Session: 6e2a4de8-c44d-41c7-8d49-a7035cd2d5d2
Coverage
2
Selected
1
Completed
0
Reused
1
Failed
0
Waived
Token Usage
694.6K
Prompt Tokens
72.78K
Completion Tokens
767.39K
Total Tokens
23
LLM Requests
612.1K
Cache Read
0
Cache Write
1
LLM Failures
File breakdown 2 files
| File | Prompt | Completion | Cache Read | Cache Write | Total |
|---|---|---|---|---|---|
| src/Controller/SsmaController.php | 678.43K | 61.75K | 608K | 0 | 740.18K |
| tests/Unit/Product/Ssma/ActionOrigemEnumTest.php | 16.17K | 11.04K | 4.1K | 0 | 27.21K |
Files Reviewed 2 files
- src/Controller/SsmaController.php
- tests/Unit/Product/Ssma/ActionOrigemEnumTest.php
Conversations 2 files
src/Controller/SsmaController.php 21 requests
plan_task
Request #1
deepseek-v4-flash
P:8.45K C:21.56K CR:1.41K CW:0
170577ms
Reasoning
O usuário quer que eu analise as mudanças de código em src/Controller/SsmaController.php (e menciona que tests/Unit/Product/Ssma/ActionOrigemEnumTest.php está em outro grupo de review) e produza um plano de revisão estruturado em português.
Vamos analisar o diff com cuidado.
Mudanças no diff:
1. **Remoção do import** `use App\Service\Ssma\SsmaOccurrenceDisplayCodeFormatter;` — mas é usado em outros lugares? Precisamos verificar se ainda há usos no arquivo. Se import removido mas classe ainda usada em outros trechos não modificados, seria erro de compilação (PHP não falha por import não usado, mas falha se usar classe sem import). Na verdade, o PHP não exige imports, mas se a classe for referenciada como `SsmaOccurrenceDisplayCodeFormatter::...` no mesmo namespace `App\Controller`, sem import, o PHP vai procurar `App\Controller\SsmaOccurrenceDisplayCodeFormatter` e falhar em runtime. Precisamos verificar se ainda há chamadas no arquivo.
2. **Remoção de bloco "Técnico com tipo associado"** na abertura de detalhe (linha ~3339). Esse bloco permitia que técnico com tipo associado abrisse detalhe mesmo se filtro de lista removesse a linha. Removido. Agora, resta o bloco de approver. Isso é mudança de permissão: técnicos que antes podiam abrir detalhe de ocorrência de seu tipo mesmo sem ser stakeholder/membro agora não podem mais, a menos que sejam approver. Isso parece intencional (regra de negócio mudou: "can_create de plataforma não pode esconder ocorrências" foi revertido). Mas precisamos avaliar se a remoção é consistente com a nova regra.
3. **Simplificação da chamada** `maybeSubmitOccurrenceForValidation($event, $company, $user)` — antes: `$company = $event->getCompany(); if ($company instanceof Company) { $this->maybeSubmitOccurrenceForValidation($event, $company, $user); }`. Agora chama direto com `$company`. Precisamos ver de onde `$company` vem nesse escopo. Se `$company` pode ser null, isso pode quebrar, pois o método provavelmente espera Company. Vamos ver o contexto: linha ~7909, dentro de um catch... Na verdade é no try. Precisamos ver mais contexto. O diff mostra:
```php
$this->entityManager->flush();
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
```
Antes havia uma checagem `if ($company instanceof Company)`. Se a variável `$company` no escopo for definida a partir do `$event->getCompany()` ou de outra forma e puder ser null, a chamada pode causar TypeError. Precisamos ver o contexto ao redor da linha 7909: qual é a origem de `$company` nesse método? E se o tipo do parâmetro de `maybeSubmitOccurrenceForValidation` é `Company` (não-nullable)? Precisamos verificar com file_read ou code_search no arquivo.
4. **Mudança na flag `$isTechEarly`** (linha ~12503): antes `!$isViewerEarly && ...`, agora `!$canManageEarly && !$isViewerEarly && ...`. Isso faz com que `$isTechEarly` seja false quando o usuário pode gerenciar ocorrências SSMA. Consequência: se `$teamFilterEarly` é `[]` e o usuário pode gerenciar, então `$needsOccurrencePostFilter` muda. Antes, para canManageEarly com teamFilterEarly = [], `$isTechEarly` podia ser true (se não viewer e tem tipos técnicos) e `$needsOccurrencePostFilter` = false (porque `$teamFilterEarly !== null && !$isTechEarly` → se teamFilterEarly = [] e isTechEarly = true, needsPostFilter = false). Agora, para canManageEarly = true, isTechEarly = false, então se teamFilterEarly for [] (não null), needsOccurrencePostFilter = true. Precisamos entender o impacto: aplicar filtro de equipe com lista vazia zeraria todas as ocorrências? Mas esse trecho é "early" — talvez depois haja outro tratamento para canManage. Mudança de regra: gestor com escopo de equipe [] ... hmm.
5. **Mudança similar em `$isTechSpecialistOnly`** (linha ~12880): antes `!$this->isSsmaViewer() && $occurrenceTeamFilterIds === [] && !empty($userTechnicalTypes)`, agora `!$ssmaCanManageOccurrences && !$this->isSsmaViewer() && $occurrenceTeamFilterIds === [] && !empty($userTechnicalTypes)`. Comentário mudou: "Técnico especialista SSMA: tem SsmaPermissionTagMember mas sem gestão ou supervisão de equipe." Isso alinha com a nova regra: quem pode gerenciar não é mais tratado como técnico especialista.
6. **Remoção de `display_code`** de três pontos de mapeamento de linha (mapSsmaEventToOccurrenceListRow, mapSsmaOccurrenceEntityToListRow, e os dois blocos no dashboard query builder/serializer). E remoção do import do formatter. Isso indica que o campo `display_code` não é mais enviado ao front. Se o front ainda espera esse campo, pode quebrar a exibição. Mas a PR diz que é "fundação backend do Painel", e o front da aba Ações pode ter sido ajustado em outra PR. Ainda assim, remover campo de resposta de API sem verificar consumidores é um risco. Precisamos verificar se o front usa `display_code`. Neste repositório, pode ser um controller que renderiza Twig ou devolve JSON para JS. Precisamos investigar se há Twig/JS usando `display_code`.
7. **Remoção do método privado** `tryLoadOccurrenceViewRowForTechnicalType` — remoção consistente com a remoção do bloco que o usava. OK.
8. **Mudança no final** (linha ~22915):
```php
if ($userTechnicalTypes !== []
&& !$this->canManageSsmaOccurrences()
&& !$this->isSsmaViewer()
) {
```
Antes:
```php
if ($userTechnicalTypes !== [] && !$this->isSsmaViewer()) {
```
Novamente, a regra agora exclui canManage. Esse é um auto-scope para filtro de equipe: se `$autoScope === []` e usuário tem tipos técnicos, e agora também não pode gerenciar. Impacto: gestor (canManage) com autoScope [] não cai nesse filtro por tipo técnico. O que acontece depois? Retorna array vazio? Precisamos ver o contexto do método. Provavelmente é o `resolveOccurrenceScope` ou similar. Se antes um gestor com escopo [] e tipos técnicos recebia as ocorrências dos tipos dele, agora não recebe esse auto-scope... mas talvez o gestor tenha acesso a todas as ocorrências da empresa, então o auto-scope [] para gestor deveria ser tratado em outro ramo (useExplicit ou permissão de gestão). Precisamos ver o método completo.
OK. Vamos estruturar os pontos de risco:
### Pontos principais
A. **Possível TypeError/null na chamada `maybeSubmitOccurrenceForValidation($event, $company, $user)`** — verificar se `$company` pode ser null nesse escopo e qual a assinatura do método. Isso pode causar crash (500) ao finalizar ocorrência. Severidade alta.
B. **Remoção de campo `display_code` das respostas** sem verificar consumidores (front JS/Twig) — se o front ainda espera, quebra exibição. Precisamos verificar com code_search em templates/JS por `display_code`. Severidade média/alta.
C. **Mudanças de regra de autorização** (isTechEarly, isTechSpecialistOnly, auto-scope): usuários com permissão de gestão (canManage) perdem acesso à lista de ocorrências filtrada por tipo técnico quando o filtro de equipe é []? Ou ganham? A mudança parece reverter um comportamento anterior que permitia a gestores ver ocorrências por tipo. Precisamos entender o fluxo completo para avaliar se há regressão: gestores podem gerenciar ocorrências mas não têm equipe atribuída no produto — com teamFilterIds = [], se o filtro de equipe for aplicado com lista vazia, o resultado é vazio. O novo código agora exige !canManage para o caminho de técnico especialista. Então o que acontece com gestor (canManage=true) e teamFilterIds=[]? Se não for tratado em outro ramo, pode ver lista vazia. Isso seria um bug crítico: gestor sem equipe não vê nada. Precisamos ver o contexto completo desses trechos para saber se há um else/fallback. Isso é bem importante.
D. **Remoção do bloco de detalhe para técnico por tipo** — regressão potencial: técnicos que não são stakeholders/membros mas têm tipo associado não conseguem mais abrir detalhe de ocorrência. Se links continuam apontando para essas ocorrências e o usuário tem permissão de tipo, ele recebe 403/não encontrado. Precisamos entender se é intencional (mudança de regra de permissão) e se há outro fluxo que cubra. A PR fala de "Permissões" como risco e descreve regras (gestor pode criar/editar; supervisor só visualiza). Um "técnico" (membro com tipo) antes podia abrir detalhe via tryLoadOccurrenceViewRowForTechnicalType; agora não pode. Se isso está relacionado ao escopo da PR (Plano de Ação/Painel), é fora de escopo potencial. Precisamos destacar como efeito colateral de refatoração/permissão.
E. **Uso restante de `SsmaOccurrenceDisplayCodeFormatter`** — se ainda houver outras chamadas no arquivo, a remoção do import causa erro runtime (classe resolvida no namespace App\Controller). Precisamos verificar com code_search. Severidade alta se houver usos remanescentes.
Vamos pensar no que as ferramentas devem verificar:
1. `code_search` para `SsmaOccurrenceDisplayCodeFormatter` em `src/Controller/SsmaController.php` — verificar se ainda há chamadas sem import.
2. `code_search` para `display_code` em templates/JS (ex.: `templates/`, `assets/`, `public/`) — verificar consumidores.
3. `file_read` com offsets? A tool file_read_diff só mostra diff. Precisamos chamar `file_read` para ver contexto, mas a tool listada é `file_read_diff` e `code_search` e `file_find`. Não há file_read na lista de tools disponíveis (apenas code_search, file_read_diff, file_find). Então usamos file_read_diff com path_array para ver o arquivo inteiro? file_read_diff retorna em git diff format para os arquivos passados. Hmm, path_array recebe lista de paths e retorna o diff completo do arquivo? O exemplo mostra diff. Para ver contexto de uma região, code_search é melhor porque retorna trechos com números de linha.
Vamos planejar as chamadas de verificação:
1. code_search para `SsmaOccurrenceDisplayCodeFormatter` em `src/Controller/SsmaController.php` — confirmar se o import removido ainda é necessário (algum uso restante não removido). A busca retorna linhas com contexto; se ainda houver chamadas, é bug high.
2. code_search para `display_code` no repositório (templates Twig, JS, etc.) — para avaliar o impacto da remoção do campo nas respostas JSON. Se o front lê `display_code`, quebra a exibição do código da ocorrência. Mas o backend pode ter sido preparado na PR B. Ainda assim, se o template atual (já em staging) consome o campo e esta branch não atualiza esse consumo, há quebra. Devemos buscar em `templates/` e `assets/`.
3. file_read_diff para ver contexto de `maybeSubmitOccurrenceForValidation` e assinatura do método — a variável `$company` no método onde ocorre a chamada (linha ~7909) pode ser null? Precisamos ver o contexto do método que contém a mudança. Com code_search podemos achar o método e ver a origem da variável `$company`.
4. code_search para `maybeSubmitOccurrenceForValidation` — assinatura e como lida com company null. Mas a signature pode estar no mesmo arquivo; a busca retorna a definição.
5. Para a regra de `isTechEarly` / `isTechSpecialistOnly` / auto-scope: precisamos entender o fluxo geral. Isso exige ler bastante contexto em volta das mudanças. code_search por `$isTechEarly`, `$isTechSpecialistOnly`, `autoScope` etc. pode ajudar. O objetivo: determinar se gestor com teamFilterIds = [] fica sem resultado (lista vazia) e se isso é uma regressão.
6. Remoção do bloco de detalhe para técnico por tipo: remoção de `tryLoadOccurrenceViewRowForTechnicalType` e do bloco que o chamava. Talvez o código de detail route agora depende de `$matching` preenchido pelo bloco approver e pelo bloco stakeholder. Um usuário técnico sem stakeholder não encontra. Se a política anterior era intencional, remover sem substituto tira acesso. Precisamos ver o contexto do bloco approver que restou e se ele pode cobrir técnicos.
Vamos também considerar a regra "God object": SsmaController é gigantesco (linhas ~22k+). A PR adiciona? A PR é net -149 linhas no controller. Mas as mudanças mexem em lógica de permissão de dashboard dentro do controller. A regra do usuário diz que se o controller já é grande e a PR aumenta responsabilidade, é o achado mais importante. Aqui não aumenta (remove), mas ainda mantém lógica complexa de permissão no controller. Podemos mencionar como sugestão de baixa prioridade? A instrução diz: "Se este controller já é grande (centenas/milhares de linhas) ou já mistura HTTP + regra de negócio + consulta + notificação, qualquer aumento dessa mesma responsabilidade na PR é o achado mais importante". Como não há aumento (só remoção/ajuste), talvez não se aplique. Mas a remoção de um método privado (tryLoadOccurrenceViewRowForTechnicalType) reduz o controller — bom. Mesmo assim, os ajustes de permissão continuam no controller; mas não é aumento. Vou considerar não levantar como issue principal, ou levantar como baixa prioridade se houver algo concreto: a regra de negócio de escopo (auto-scope para canManage) está embutida no controller, o que dificulta manutenção. Mas como as regras exigem não inventar issues... A PR em si não aumenta. Provavelmente devo focar nas regressões.
Agora, vamos avaliar cada mudança em detalhe.
### Análise detalhada
#### 1. Import removido do formatter
O import `use App\Service\Ssma\SsmaOccurrenceDisplayCodeFormatter;` foi removido. Pontos de uso removidos:
- linha ~14703: `'display_code' => SsmaOccurrenceDisplayCodeFormatter::format(...)` removido em mapSsmaOccurrenceEntityToListRow.
- linha ~15003: removido em mapSsmaEventToOccurrenceListRow.
- linha ~22738 e ~22836: removido no método de dashboard (agregação).
Se houver outras chamadas em outras partes do arquivo que não foram removidas (ex.: outra rota que ainda usa o formatter), a remoção do import quebra. Também a classe `SsmaOccurrenceDisplayCodeFormatter` pode ter sido usada em outros lugares via FQCN? Não, no mesmo namespace App\Controller exigiria import ou \App\Service... Precisamos verificar. Vou colocar como verificação.
#### 2. Remoção do fallback de detalhe para técnico por tipo
Contexto original (antes): Quando `$matching === []` após tentativas normais de achar a linha para o detail, havia um fallback: se o usuário atual é técnico com tipo correspondente à ocorrência/evento, carrega a linha via `tryLoadOccurrenceViewRowForTechnicalType`. Isso foi removido. Resta o bloco do approver (que carrega se o usuário é aprovador/stakeholder? Precisamos ver).
Impacto: usuários "técnicos por tipo" (SsmaPermissionTagMember com escopo de equipe [] e tipos técnicos, ex.: membro de comissão SSMA, técnico de segurança com especialidades) que recebem link direto para detalhe de uma ocorrência do seu tipo, mas que não são stakeholders/approvers registrados, não conseguirão mais abrir. Antes, a regra foi adicionada justamente porque "o filtro de lista (ex.: can_create de plataforma) tivesse removido a linha do hub". A remoção acompanha as mudanças de regra (gestor não é mais técnico especialista; canManage não zera lista). Mas também remove o acesso de não-gestores (membros com tipo). Se a intenção é que apenas gestores/supervisores/stakeholders vejam detalhes, ok. Mas é uma mudança de permissão relevante que precisa ser destacada: usuários com permissão de tipo técnico mas sem vínculo na ocorrência perdem acesso ao detalhe; se o front ainda exibe links para esses usuários, eles tomarão erro. Precisamos verificar no template/JS se links são exibidos para esses usuários. Difícil sem contexto. Vou marcar como média/alta e sugerir verificação com code_search do método e dos fluxos de detail.
#### 3. A chamada `maybeSubmitOccurrenceForValidation($event, $company, $user)`
Trecho removido:
```php
$company = $event->getCompany();
if ($company instanceof Company) {
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
}
```
Adicionado:
```php
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
```
Isso significa que antes, a variável `$company` poderia ser null/indefinida? Na verdade, a mudança remove a obtenção de `$company` a partir do evento. Agora usa `$company` que deve existir no escopo do método. Se `$company` foi definida antes e é não-null (talvez vinda de `$this->getUser()->getCompany()`), a mudança é segura e até evita confiar no evento. Mas se `$company` não está definida no escopo, será um erro "Undefined variable". Se está definida como `?Company` e pode ser null, a chamada pode lançar TypeError se o parâmetro é `Company`. Precisamos ver o contexto.
Vou buscar no arquivo o contexto da linha com `finalizada com sucesso` e o método que contém. O diff mostra a parte: `$this->entityManager->flush();` e catch `\Throwable`. Vamos identificar o método e a origem de `$company`. code_search por `maybeSubmitOccurrenceForValidation` e `Ocorrência finalizada com sucesso` dará as linhas.
#### 4. As mudanças isTechEarly / isTechSpecialistOnly / auto-scope
Vejamos o diff:
```php
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
$needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)
```
Antes:
```php
$isTechEarly = !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
```
Isso está num trecho "early" de decisão de filtro. Vamos chamar de contexto A.
No contexto B (mais abaixo): `isTechSpecialistOnly` agora também exige `!$ssmaCanManageOccurrences`.
No contexto C (final): auto-scope, exige `!$this->canManageSsmaOccurrences()`.
A regra geral que emerge: as mudanças reverteram deliberadamente o comportamento que permitia a "canManage" (can_create de plataforma / tag Membro com permissão) ser tratado como técnico com escopo []. Agora, apenas usuários SEM gestão e SEM viewer, com tipos técnicos e escopo de equipe [], são tratados como técnico especialista. Gestores com escopo de equipe [] não são mais tratados como técnico especialista.
A pergunta: qual o efeito colateral para um gestor com escopo de equipe []? Nos contextos A/B, se `$teamFilterEarly === []` ou `$occurrenceTeamFilterIds === []`, o gestor agora tem `needsOccurrencePostFilter = true` (contexto A) — o que significa que o filtro de equipe será aplicado? Se filtro [] aplicado, resultado vazio. Mas talvez para canManage, `$teamFilterEarly` nem chegue a ser [] porque gestores têm escopo total (o filtro de equipe do dashboard talvez seja null = sem filtro). Precisamos entender como `$teamFilterEarly` e `$occurrenceTeamFilterIds` são calculados. Se para gestores o filtro de equipe é null (acesso total), então a mudança não afeta. Se para gestores sem equipe atribuída o filtro é [], aí afeta.
Pelo comentário removido: "getSsmaOccurrenceDashboardTeamFilterIds devolve [] (sem equipe no produto) — aplicar filtro de equipe com lista vazia zeraria todas as ocorrências. Filtra por tipo técnico. Importante: NÃO exigir !$ssmaCanManageOccurrences. can_create na tag Membro / ROLE de plataforma não pode esconder ocorrências dos tipos associados ao aprofundamento."
O novo comentário: "Técnico especialista SSMA: tem SsmaPermissionTagMember mas sem gestão ou supervisão de equipe. O scope retornado por getSsmaOccurrenceDashboardTeamFilterIds ?? [] (sem equipe atribuída no produto), o que zeraria todas as ocorrências se o filtro de equipe fosse aplicado. Em vez disso, aplicamos um filtro por tipo de ocorrência após o bloco de equipe."
Ou seja, o autor deliberadamente restringiu a regra: quem tem `canManage` (gestão/supervisão de equipe) não é mais "técnico especialista". A suposição é que gestores têm `$occurrenceTeamFilterIds` não-vazio? Ou que, se for [], o filtro por tipo não se aplica e o resultado é... vazio? Isso pode ser o bug: um gestor SSMA (canManage=true) sem equipe atribuída no produto (time filter []) pode acabar vendo lista vazia, porque a única proteção contra "filtro de equipe [] zera tudo" era o `isTechSpecialistOnly`, que agora é false para ele.
Contudo, talvez o dashboard agregador trate canManage de forma diferente antes: se canManage, talvez `$occurrenceTeamFilterIds` seja null (sem filtro), não []. Depende do método `getSsmaOccurrenceDashboardTeamFilterIds`. O comentário no código removido diz que "getSsmaOccurrenceDashboardTeamFilterIds devolve [] (sem equipe no produto)" para técnico especialista. Mas para gestor com permissão total (canManage), talvez devolva null ou todos os times. Sem ler o código, não dá para afirmar. Então o plano de revisão deve incluir a verificação de como `$occurrenceTeamFilterIds` é derivado e o que acontece para `canManage` com equipe [].
Vou estruturar isso como uma issue de regressão potencial (severidade alta se confirmada): gestor/supervisor com escopo de equipe [] pode ficar com lista/dashboard vazios. As ferramentas: code_search para `getSsmaOccurrenceDashboardTeamFilterIds`, `$isTechEarly`, `$isTechSpecialistOnly`, `canManageSsmaOccurrences` no arquivo para mapear o fluxo.
#### 5. Remoção de display_code
Removidos 4 usos e o import. `display_code` era um campo derivado (código exibido tipo+id, ex.: "AC-123"). Se o front (Twig/JS) usa `display_code` para exibir o código na listagem/detalhe do Plano de Ação/Painel, a remoção quebra. O autor pode ter movido a formatação para o front? A PR B (Painel UI) virá depois, mas a aba Ações já está em staging2. O template `_tab_action_plan.html.twig` estava com auto-merging. Será que o template usa `display_code`? Precisamos buscar. Vou incluir code_search por `display_code` em `templates/` e `assets/`.
Severidade: se o front usa, é alta (funcionalidade quebrada). Se não usa, é limpeza ok.
#### 6. Comportamento do método de dashboard que perdeu display_code
Os dois blocos removidos (linhas ~22738 e ~22836) estão num método que monta arrays de `$result[]`. Removido apenas o campo display_code. Novamente verificar consumidores.
### Restrição: tool calling
As ferramentas são apenas para planejamento: devo descrever as chamadas que seriam feitas, não executar. Cada issue deve ter `→` linhas com tool e argumentos.
Vamos formalizar as issues em pt-BR, ordenadas por severidade.
Potenciais issues:
1. **Alta: Chamada direta a `maybeSubmitOccurrenceForValidation($event, $company, $user)` pode lançar erro se `$company` for null/indefinida** — O diff remove a proteção e o carregamento de `$company` a partir do evento. Precisamos ver o método que contém e a assinatura de `maybeSubmitOccurrenceForValidation`. Possível TypeError/Undefined variable causando 500 ao finalizar ocorrência.
Hmm, mas devemos ter cuidado: a variável `$company` provavelmente já existe no método (talvez definida antes). O diff removido era a única definição no bloco? Talvez. Mas o contexto não é visível. Então a issue é "verificar". Em um plano de revisão, podemos descrever como risco potencial a ser verificado. A severidade real depende do contexto. Vou descrever como "alta" mas com a ressalva de que precisa da verificação para confirmar. Ou posso usar "média" se não sei. As instruções: high = pode causar crash. Se confirmado, é crash. No plano, marcamos a severidade pelo pior caso plausível? Normalmente planos de revisão apontam "potencial" e a severidade pode ser alta se plausível. Vou olhar o contexto novamente:
```php
$this->entityManager->flush();
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
} catch (\Throwable $e) {
```
A variável `$company` usada aqui... vamos ver o código antes. Não está no diff, mas podemos inferir que `$company` foi definida anteriormente no método para outras operações (ex.: autorização). Se o método anteriormente obtinha `$company` do evento apenas para essa chamada, em vez de reutilizar a variável, pode ser porque `$company` no escopo não era confiável ou não existia. Mas o autor agora usa `$company` do escopo. Talvez `$company` tenha sido obtida de `$this->getUser()->getCompany()`, que é a empresa do usuário logado (não a da ocorrência). Isso pode ser uma mudança de comportamento: antes, a empresa passada era a da ocorrência; agora pode ser a do usuário. Se um usuário finaliza ocorrência de outra empresa (o que não deveria), envia validação para empresa errada. Mais provável: `$company` veio de checagem anterior de autorização e é a mesma. De todo modo, precisa verificar. Vou marcar como alta (crash potencial) se null; caso contrário, se for a mesma, ok. Melhor uma issue de severidade alta com texto "confirmar se $company é sempre Company e se corresponde à empresa do evento".
2. **Alta: Potencial regressão para gestores/supervisores sem equipe atribuída (escopo []) nas regras `isTechEarly`/`isTechSpecialistOnly`/auto-scope** — Antes, usuários com `canManage` mas sem equipe eram tratados como técnico especialista (filtro por tipo) para não zerar a lista; agora `canManage` desativa esse caminho. Se `getSsmaOccurrenceDashboardTeamFilterIds` devolver [] para gestor sem equipe, o filtro de equipe vazio zeraria as ocorrências. Precisamos ver a cadeia de decisão.
3. **Média/Alta: Remoção do acesso ao detalhe para técnico por tipo** — `tryLoadOccurrenceViewRowForTechnicalType` removido e o fallback no detail route removido. Técnicos/membros com tipo associado (SsmaPermissionTagMember) mas sem vínculo como stakeholder/approver perdem acesso a detalhes de ocorrências dos seus tipos; se ainda recebem links pelo front (que pode ter sido construído sob a regra antiga), abertura de detalhe passa a falhar. Necessário confirmar com o fluxo do front e a nova regra de permissão.
4. **Média: Remoção do campo `display_code` das respostas JSON** sem verificar consumidores no front (Twig/JS) — quebra a exibição do código formatado na listagem/detalhe se o front atual ainda o consome.
5. **Alta condicional: Uso remanescente de `SsmaOccurrenceDisplayCodeFormatter` sem import** — verificar.
6. **Baixa: Regras de negócio de permissão/escopo continuam implementadas dentro do controller gigante** (god object). A PR não aumenta, mas mexe em lógica de permissão complexa em controller de ~23k linhas; remoção de método privado e repetição de regras em três pontos diferentes (isTechEarly, isTechSpecialistOnly, auto-scope) sugere extrair regra de acesso para service. Baixa/média? A regra do usuário diz "maior peso" se houver aumento. Não há aumento; mas podemos sinalizar baixa prioridade para manter a regra consistente em um único lugar. Hmm... será que devo incluir? O item 6 da regra "user-specific" fala que "qualquer aumento dessa mesma responsabilidade na PR é o achado mais importante". Não há aumento. Incluir como baixa é razoável: a manutenção da regra de acesso duplicada em três pontos (mesma condição `tipos técnicos && !canManage && !viewer && escopo []`) já aparece três vezes no diff — chance de divergência futura. Mas isso é style/DRY. Pode ser baixa.
Mas devemos evitar inventar issues desnecessárias. Como o diff contém várias repetições da condição, é razoável sugerir extração de um service de escopo. Baixa prioridade.
Hmm, mas também devemos pensar: a remoção do campo display_code pode ter sido proposital: o front da aba Ações foi atualizado (está em staging2). Contudo, o teste unitário alterado (ActionOrigemEnumTest) está fora do grupo. Precisamos apenas do SsmaController.
Vamos também considerar o tipo de mudança: a regra "can_create de Membro / ROLE_* de plataforma não pode zerar a lista quando escopo de equipe é [] (técnico por tipo)" foi deliberadamente removida. O que a substitui? Para gestor, espera-se que o escopo de equipe não seja [] mas sim null/todos? Vamos tentar imaginar o código do dashboard. Há um método `getSsmaOccurrenceDashboardTeamFilterIds`. Talvez ele retorne `null` quando canManage (acesso irrestrito à empresa) e `[]` apenas para membros com permissão limitada. O comentário removido diz: "getSsmaOccurrenceDashboardTeamFilterIds devolve [] (sem equipe no produto)" — isso era para técnico. Para gestor, provavelmente retorna null (sem filtro de equipe) e portanto `$isTechEarly`/`$isTechSpecialistOnly` seriam false de qualquer forma porque `$teamFilterEarly === []` não é satisfeito (null !== []). Nesse caso, adicionar `!$canManage` não muda nada para gestores reais com acesso total. E mudaria apenas para gestores cujo método retorna [] por falta de equipe. Qual é o caso real?
O comentário no diff (contexto A) original diz: "can_create de Membro / ROLE_* de plataforma não pode zerar a lista quando o escopo de equipe é [] (técnico por tipo)". Ou seja, havia um caso em que usuário com can_create (mas não gestor de equipe?) tinha teamFilterEarly = [] e userTechnicalTypes != []. Exemplo: um usuário com ROLE_SSMA (canManage?) mas sem equipe atribuída — canManage era true porque a role de plataforma dá manage? Aí ele era tratado como técnico por tipo.
O novo código deliberadamente reverter: quem tem canManage mas sem equipe não é técnico especialista. Talvez o fluxo de gestão (canManage) agora use outro caminho (não o filtro por tipo, mas um else que retorna todas as ocorrências quando canManage). Precisamos ver.
Portanto, a verificação é legítima e importante. Incluir como alta/ponderada com chamadas para mapear.
Vou incluir a verificação:
- `code_search` por `getSsmaOccurrenceDashboardTeamFilterIds` — entender o que devolve para canManage/gestor e a origem.
- `code_search` por `isTechEarly|isTechSpecialistOnly` no arquivo — mapear todas as consequências.
- `code_search` por `needsOccurrencePostFilter` e `$occurrenceTeamFilterIds` — ver como o filtro é aplicado.
Isso pode ser agrupado numa issue? As linhas de tool são por issue. OK.
Agora, a ordem de severidade:
1. `maybeSubmitOccurrenceForValidation` com `$company` potencial null/errada — crash/empresa errada. Vou colocar high? Preciso ver o contexto para saber se `$company` é do escopo e pode ser null. Como eu não posso ver, mas o diff mostra remoção de uma checagem `instanceof Company`, há uma chance concreta de que o autor sabia que $company agora é não-null no escopo. Remover o guard é um sinal de que a variável no escopo é garantida. Hmm. Se $company fosse null, o PHP moderno com strict types? Se a função não tem type hint ou tem `?Company`, passa null. A chamada é feita dentro de um try com catch Throwable, então um TypeError seria capturado e retornaria erro JSON? O catch retorna... não sabemos. Mas ainda mudaria o resultado (erro em vez de sucesso). Enfim, é potencial: precisa verificar a definição de `$company` no método.
Para o plano, vou listar como "média" ou "alta"? A definição de alta: "pode causar ... falhas funcionais críticas". Um 500 na finalização de ocorrência é crítico. Mas é só potencial. Nos planos de revisão, marcamos com a severidade que o problema teria se confirmado? Geralmente sim, e o revisor valida. Mas para não "cry wolf", posso marcar como média e descrever a necessidade de confirmação. As instruções sobre severidade são para os achados reais. Como estamos planejando, e não confirmamos, as issues são "pontos de risco" com severidade estimada.
Vou decidir:
- Issue 1 (alta): remoção da checagem `instanceof Company` na chamada `maybeSubmitOccurrenceForValidation` — risco de TypeError/null e de usar empresa diferente da do evento caso `$company` venha de outra fonte (user). Explico que precisa confirmar.
- Issue 2 (alta): regressão de autorização/lista para gestores sem equipe — se confirmado, pode zerar dashboard/listas. Mas posso marcar como alta pela severidade potencial.
Hmm, preciso não exagerar. Deixa eu reavaliar o contexto com base nos comentários de código.
#### Contexto do trecho final (auto-scope)
O trecho final:
```php
if (!$useExplicit && $autoScope !== null && $autoScope === []) {
$userTechnicalTypes = $this->resolveCurrentUserTechnicalTypes($currentCompany, $user);
if ($userTechnicalTypes !== []
&& !$this->canManageSsmaOccurrences()
&& !$this->isSsmaViewer()
) {
$techTypesSet = array_flip($userTechnicalTypes);
return array_values(array_filter(
```
Este é provavelmente um método que resolve o escopo automático quando o filtro de equipe é []: para técnicos sem gestão, retorna ocorrências dos tipos dele. Para gestores, agora cai fora do if. O que acontece depois do if? O método continua e talvez retorne as ocorrências todas (gestor vê tudo). O `if` retorna dentro; se gestor, não retorna ali e segue para o restante que pode aplicar filtro [] e retornar vazio, ou retornar todas. Precisamos ver o resto do método. A busca code_search por `$autoScope !== null && $autoScope === []` localiza o método; depois ler ao redor.
Não vou conseguir resolver sem executar. O plano deve descrever as tool calls.
#### Sobre a remoção do detail fallback para técnico
Vamos ver o contexto: após a remoção, o código segue:
```php
if ($matching === []) {
$approverUser = $this->getUser();
$approverCompany = $approverUser instanceof User ? $approverUser->getCompany() : null;
...
}
```
O bloco do approver provavelmente carrega se o usuário é approver cadastrado da ocorrência. Então, usuário técnico que não é approver perde acesso. Mas talvez esse usuário nunca devesse ver o detalhe; o front agora não mostra links? Difícil.
### Decisão de issues
Vou montar aproximadamente 5 issues:
1. **high** — `maybeSubmitOccurrenceForValidation($event, $company, $user)` sem verificação: risco de TypeError se `$company` for nullable, além de possível uso de empresa do usuário em vez da empresa do evento (mudança de semântica). Verificar origem de `$company` e assinatura do método.
2. **high** — Mudança da regra de técnico especialista (três pontos) pode zerar listas/dashboard para gestor com escopo de equipe []; regressão de permissão potencial. Verificar derivação do `teamFilter` e caminho pós-condição.
3. **medium** — Remoção do fallback de detalhe por tipo técnico tira acesso de membros técnicos sem vínculo na ocorrência; possível quebra de links existentes. Verificar se outros fluxos (front/rotas) ainda direcionam esses usuários para o detalhe; conferir com a regra nova de permissão (gestor/supervisor).
4. **medium** — Remoção do campo `display_code` de 4 respostas JSON sem verificar consumidores atuais (Twig/JS); se o front ainda usa, quebra exibição. Buscar usos em templates/assets.
5. **high?/medium** — Import removido do formatter pode deixar chamadas órfãs no próprio arquivo (erro de classe não encontrada em runtime). Verificar com code_search. Se não houver usos, não é issue. Como é potencial e fácil de verificar, posso incluir como "alta" condicionada. Mas em um plano de revisão, o revisor deveria rodar a busca. Se encontrarmos, é bug. Porém se eu incluir como issue e a busca não achar nada, não é defect. O plano descreve riscos; a tool de verificação é "confirme". Posso incluir como alta pois consequência é fatal (Class not found). To keep precision, talvez eu a inclua como alta (uma simples busca confirma).
Na verdade, o diff removeu exatamente os quatro usos do formatter. Seria coincidência se sobrasse um quinto uso não removido. Mas pode haver usos em outros métodos (ex.: em alguma rota de exportação ou de autocomplete). Por isso a verificação tem valor.
6. **low** — Duplicação da condição de "técnico especialista" em três lugares dentro do controller gigante; sugerir centralizar em service de escopo/permissão (melhoria de manutenção).
Também poderíamos mencionar o teste unitário alterado, mas o usuário disse que está em outro grupo. Não mencionar.
Agora, o `Summary:`.
Resumo da mudança: ajuste de permissões no SsmaController (remoção do tratamento de "técnico especialista"/canManage com escopo de equipe vazio), remoção do fallback de abertura de detalhe por tipo técnico, simplificação da chamada de submissão para validação e remoção do campo `display_code` das respostas de listagem/dashboard. A PR visa alinhar o backend do Painel/Plano de Ação com as permissões de staging2.
Agora, as linhas de tool:
Issue 1:
→ code_search `maybeSubmitOccurrenceForValidation` em src/Controller/SsmaController.php — localizar a assinatura do método e o contexto da chamada (origem de $company) para confirmar se $company pode ser null e se corresponde à empresa do evento.
→ file_read_diff path_array ['src/Controller/SsmaController.php'] — hmm, file_read_diff retorna o diff inteiro do arquivo? Na verdade a tool foi usada para ver mudanças em outros arquivos; path_array aceita lista de paths. Mas no contexto do diff já recebido, "view the changes made to other files". Se eu pedir SsmaController, retorna o diff do SsmaController que já temos. Não agrega. Melhor: code_search por `$company = $this->getUser()` ou `function finalize` indicaria método. Talvez code_search por `Ocorrência finalizada com sucesso` para achar o método e então ler ao redor; mas code_search não mostra blocos grandes. Ainda assim, é a intenção.
Vou usar code_search com padrão em volta: search_text `function .*finalize|Ocorrência finalizada com sucesso`? Não é possível regex com espaço? use_perl_regexp true. Poderíamos procurar a função que contém "finalizada com sucesso". Normalmente a função é longa. Melhor: code_search `Ocorrência finalizada com sucesso` retorna a linha. Então outra busca para `private function maybeSubmitOccurrenceForValidation` retorna a definição. Isso é suficiente para o plano.
Issue 2:
→ code_search `getSsmaOccurrenceDashboardTeamFilterIds` no controller/service — entender quando devolve [] vs null para canManage.
→ code_search `$isTechEarly|$isTechSpecialistOnly|needsOccurrencePostFilter` em src/Controller/SsmaController.php — mapear as decisões e o fluxo de aplicação do filtro (se canManage cai em caminho que zera a consulta).
→ code_search `$autoScope !== null && $autoScope === \[\]` para localizar o método e o que ocorre quando a condição nova falha (gestor).
→ code_search `function canManageSsmaOccurrences|function isSsmaViewer` para conferir semântica.
Issue 3:
→ code_search `tryLoadOccurrenceViewRowForTechnicalType|list_row_key|kind`? Melhor: localizar o método de detail (action) que contém `$matching = []` e ver os blocos restantes (stakeholder/approver) e quem chama a URL de detail. Preciso saber qual método é: dá para achar com code_search `if ($matching === \[\])` no arquivo e ver qual função.
→ code_search `ssma_occurrence_detail|occurrence.*detail|kind=` em templates para ver se links de detalhe ainda são renderizados para usuários com perfil técnico (quem o front considera apto a abrir).
Também podemos procurar resolução de permissão em outras rotas para saber se o usuário técnico perde completamente o acesso ou só o fallback.
Issue 4:
→ code_search `display_code` em `src/`, `templates/`, `assets/` (excluir SsmaController?) para achar consumidores do campo nas respostas JSON/JS/Twig.
→ code_search `display_code` no diretório `assets`/`public` se houver JS.
Issue 5:
→ code_search `SsmaOccurrenceDisplayCodeFormatter` em `src/Controller/SsmaController.php` — conferir se restou algum uso sem o import removido.
Issue 6 (low):
→ code_search (opcional): procurar se existe um service de escopo de ocorrência (ex.: SsmaOccurrenceScopeResolver) que já centralize regra; sugerir mover condição. Ou apenas descrever sem tool. As instruções dizem: "If an issue needs no tool verification, omit its → lines." Para low de duplicação, posso omitir tool calls. Ou usar file_find para localizar services de escopo existentes. Vamos incluir file_find query_name `SsmaOccurrence.*Scope|Scope.*Resolver`? file_find aceita parcial. Um exemplo: file_find query_name `SsmaOccurrence` retornaria vários. Usei para "sugerir service": localizar services de escopo/permissão existentes em App\Service\Ssma. Vou incluir file_find `pkg`? Não, é PHP. file_find query_name `Service/Ssma` com barras? O parâmetro aceita caminho. Poderíamos fazer file_find `src/Service/Ssma`. Retorna arquivos no diretório. Bom, mas é detalhe. Manterei low sem tools? Uma sugestão de extração pode ser feita sem verificação. Vou omitir tools para a issue 6 ou incluir file_find para localizar services existentes — ajuda a dar recomendação precisa. Vou incluir file_find com `src/Service/Ssma` (caminho) para sugerir onde extrair a regra (ex.: service de escopo). Isso é razoável.
Também preciso cuidar da formatação: as linhas `→` devem ter tool name, argumentos, e propósito. Ex.:
→ code_search search_text='maybeSubmitOccurrenceForValidation' file_patterns=['src/Controller/SsmaController.php'] — localizar a definição do método e conferir o tipo aceito para $company.
→ code_search search_text='Ocorrência finalizada com sucesso' file_patterns=['src/Controller/SsmaController.php'] — achar o método que contém a chamada e a origem da variável $company no escopo.
Como escrever argumentos sem JSON? As instruções mostram: `→ file_read internal/agent/agent.go — confirm whether...`. Posso escrever de forma legível: `→ code_search 'SsmaOccurrenceDisplayCodeFormatter' em src/Controller/SsmaController.php — ...`.
Mas o formato de argumentos provavelmente deveria ser algo como `code_search(search_text='...', file_patterns=['...'])`. A saída de exemplo: `→ file_read internal/agent/agent.go — confirm whether...`. Não há formato rígido de argumentos, mas a tool tem parâmetros nomeados. Vou descrever de forma clara e acionável.
A língua: pt-BR, texto do issue em português, primeiro descrevendo impacto simples.
Vamos escrever as issues, prestando atenção à regra "Estrutura: (1) o que mudou e o impacto prático, em linguagem simples; (2) por que isso importa; (3) o que fazer". Para cada issue no plano, precisamos descrever o problema mas como plano de investigação. O formato de saída pede uma issue por risco com descrição da localização/natureza/impacto e depois tools.
Vamos caprichar nas descrições.
### Issue 1 (alta)
Ao remover o `if ($company instanceof Company)` e o carregamento de `$company` a partir do evento, a finalização da ocorrência agora chama `maybeSubmitOccurrenceForValidation($event, $company, $user)` com uma `$company` que pode não estar definida ou ser null naquele ponto do método (ou ser a empresa do usuário logado, não a da ocorrência). Se `$company` for null, o método pode lançar TypeError; se for a empresa do usuário, um usuário autorizado a finalizar ocorrência de outra empresa (ex.: suporte/plataforma) dispararia a submissão para a empresa errada. A checagem anterior existia justamente para evitar chamada com valor inválido. Verificar a origem da variável no método e a assinatura de `maybeSubmitOccurrenceForValidation`; se a chamada não for garantidamente segura, restaurar a checagem ou usar `$event->getCompany()`.
Wait — a regra do usuário pede "o que mudou e o impacto prático, em linguagem simples", sem jargão na primeira frase. Meu texto está ok? A primeira frase: "Ao remover a checagem que garantia empresa válida antes de submeter a ocorrência para validação, a finalização pode passar a usar uma empresa nula ou a empresa do usuário em vez da empresa da ocorrência." Sim, começa com impacto.
Mas para um plano de revisão, talvez precisemos marcar como risco a ser confirmado. O texto de issue pode incluir "(a confirmar via leitura do contexto)". As tools ajudam.
A severidade: vou colocar alta, porque se confirmado é falha crítica. Mas há o catch Throwable que pode capturar o erro e retornar JSON de erro — ainda é falha na finalização. OK.
### Issue 2 (alta)
A regra "técnico especialista" agora passa a exigir `!canManage` em três pontos. Antes, usuários com permissão de gestão/`can_create` de plataforma e escopo de equipe vazio eram filtrados por tipo técnico para não ter a lista zerada. Com a mudança, esse perfil cai no caminho normal de aplicação do filtro de equipe com lista vazia — o que pode zerar listas e o dashboard de ocorrências para gestores/supervisores sem equipe atribuída no produto. Impacto: gestor pode parar de enxergar ocorrências sem nenhum erro. Verificar o que `getSsmaOccurrenceDashboardTeamFilterIds` retorna para canManage e o fluxo completo quando `$teamFilterEarly === []`, `$occurrenceTeamFilterIds === []` e `$autoScope === []`; se realmente houver gestor sem equipe, garantir um caminho que não aplique filtro vazio (ou que considere acesso total).
### Issue 3 (média)
O fallback que permitia ao técnico com tipo associado abrir o detalhe da ocorrência mesmo sem vínculo como membro/stakeholder foi removido junto com o método auxiliar. Usuários com permissão de tipo técnico (SsmaPermissionTagMember) que ainda recebem link direto (e-mail/notificação/hub) podem passar a receber erro/negativa ao abrir detalhe, já que a linha não é encontrada no `$matching`. A mudança pode ser intencional (restringir para gestor/supervisor), mas o escopo da PR é o backend do Painel/Aba Ações, então remover acesso de leitura a detalhe de ocorrência fora desse escopo precisa estar justificado; se não houver substituto equivalente no fluxo novo, é regressão de permissão. Verificar se o front ainda gera links de detalhe para esse perfil e se a regra de autorização restante (approver/stakeholder) cobre esses usuários.
### Issue 4 (média)
O campo `display_code` deixou de ser montado em quatro respostas de listagem/detalhe (incluindo mapSsmaEventToOccurrenceListRow, mapSsmaOccurrenceEntityToListRow e os resultados de dashboard). Se o front atual (Twig/JS da aba Ações/Painel) ainda lê `display_code` para exibir o código da ocorrência/evento, a tela passa a mostrar o código vazio/indefinido. A remoção pode ser intencional (formatação movida para o front na PR B), mas é uma quebra de contrato de resposta que precisa ser verificada contra os consumidores existentes. Buscar usos de `display_code` em templates e assets antes de aprovar.
### Issue 5 (alta/média)
O import de `SsmaOccurrenceDisplayCodeFormatter` foi removido; se ainda houver alguma chamada à classe em outro método do SsmaController que não foi removida, o PHP tentará resolver `App\Controller\SsmaOccurrenceDisplayCodeFormatter` e lançará erro em runtime (Class not found) em qualquer rota que passe por esse trecho. Uma busca simples confirma.
Severidade: alta se houver uso. Posso colocar "alta" com verificação. Mas para não inflar, dado que o diff removeu todos os usos visíveis, a probabilidade de sobrar uso é baixa. Normalmente em revisão eu rodaria a busca e só reportaria se achasse. Como não posso rodar, marco como de verificação obrigatória. Vou colocar como alta? Se o uso existir, quebra; se não, não é nada. Talvez "média" seja mais justo como risco a verificar, mas o impacto é alto. A prática de planos: apontar a verificação necessária. Vou de "alta" não — vou usar "média" com texto "confirmar ausência de usos restantes". Hmm.
Na verdade, eu posso olhar o diff para ver se o import removido é o único uso: os usos removidos estão nas linhas listadas. Há um risco se o arquivo tiver mais de uma ocorrência. O diff do arquivo exibido é apenas uma parte; mas o diff completo do arquivo mostra todas as mudanças (todas as linhas removidas/adicionadas). Nenhuma outra mudança menciona formatter. Mas a classe poderia ser usada em linhas não modificadas. Por isso a busca.
Vou colocar como alta? Deixa eu considerar a "precisão sobre recall". Talvez melhor: incluir na issue 4 (display_code) a verificação de uso restante da classe? Não, são problemas distintos.
Decisão: Issue 5 como "média" — "Confirmar que não restou nenhuma referência ao formatador no arquivo; se restar, será erro fatal em runtime". Isso equilibra.
### Issue 6 (baixa)
A mesma condição de perfil "técnico especialista sem gestão/viewer e com escopo []" aparece agora em pelo menos três pontos do controller (isTechEarly, isTechSpecialistOnly e auto-scope). Como o SsmaController já é um controller de dezenas de milhares de linhas com regra de negócio de permissão embutida, essa regra central deveria viver em um service de escopo/permissão para evitar que novos ajustes de permissão continuem sendo replicados e eventualmente divergirem. Não bloqueia a PR, mas é o tipo de acúmulo que essa mudança reforça.
Tool: file_find para localizar services de escopo existentes: file_find query_name `src/Service/Ssma` — vai listar services. Ou code_search por classes de permissão/escopo existentes.
Vou incluir file_find `SsmaOccurrence` ou caminho. Hmm file_find por query 'Service/Ssma' retorna todos os arquivos em src/Service/Ssma. Vou usar: `file_find query_name='src/Service/Ssma'` para listar services onde a regra poderia ser extraída. É razoável.
Agora a formatação final: A saída deve começar com `Summary:` e depois `Issues` e lista numerada. Sem cabeçalhos markdown. Em pt-BR.
Vamos escrever com capricho, mas mantendo as linhas de tool com argumentos claros.
Detalhe importante: As tools listadas são `code_search`, `file_read_diff`, `file_find`. Não há code_search "para templates e assets" com file_patterns: posso usar `file_patterns=['*.twig', '*.js', '*.html', 'assets/']`. Exemplo: `code_search search_text='display_code' file_patterns=['templates/', 'assets/', 'public/']`. OK.
Precisamos de um "resumo" (Summary) em pt.
Vamos elaborar cada issue com (1)(2)(3):
**Issue 1** — Vou reescrever:
"A mudança faz a finalização da ocorrência chamar a submissão para validação sem a proteção que existia antes: a empresa agora é usada direto do escopo do método, sem confirmar que é a empresa da ocorrência nem que não é nula. Se em algum fluxo a variável estiver nula ou for a empresa do usuário logado (e não a do evento), a ocorrência pode falhar ao finalizar (erro 500) ou a validação pode ser disparada para a empresa errada — esse tipo de envio errado afeta o fluxo de aprovação. É preciso conferir de onde vem `$company` no método que contém a linha e qual o tipo esperado por `maybeSubmitOccurrenceForValidation`; se não houver garantia, restaurar a checagem ou usar `$event->getCompany()`."
A primeira frase precisa ser simples... está OK. Talvez simplificar mais: "Finalizar uma ocorrência agora envia para validação sem garantir que a empresa usada é a da ocorrência e não é nula..." Vou fazer.
**Issue 2** — "Gestores ou usuários com permissão de gestão que não têm equipe atribuída no cadastro podem parar de enxergar ocorrências no hub/dashboard/Painel." etc.
**Issue 3** — "Técnicos com tipo associado perdem o acesso direto ao detalhe de ocorrências do seu tipo..."
**Issue 4** — "O código exibido da ocorrência (display_code) deixou de ser enviado em quatro pontos de resposta..."
**Issue 5** — "A remoção do import do formatador pode deixar outra chamada órfã..." Adicionar que uma confirmação por busca resolve.
**Issue 6** — "A regra de acesso repetida três vezes..." low.
Agora as ordenações: alta, alta, média, média, média?, baixa. Preciso ordenar: 1 alta, 2 alta, 3 média ou alta? A remoção de acesso a detalhe pode ser alta se confirmada. Mas já há duas altas. Deixo como média por ser mudança de permissão possivelmente intencional e coberta por outro fluxo? Na real, perda de acesso de leitura para um perfil de usuário é funcional: se o usuário ainda recebe o link, não abre. Mas é regressão condicional. Vou manter média. display_code média. Import órfão: alta se houver uso. Vou reordenar:
1. alta — `$company` na submissão de validação
2. alta — regra de gestor sem equipe pode zerar listas (talvez a mais provável de verdade)
3. média — import órfão do formatter? Na verdade impacto de class not found é fatal, mas probabilidade baixa. Se eu colocar "média" ok. Mas considerando impacto alto quando presente, alguns revisor colocaria alta. A issue é condicional a um fato facilmente verificável. Vou tratar na issue do display_code? Não, separado.
4. média — perda de acesso a detalhe do técnico
5. média — remoção de display_code sem checar consumidor
6. baixa — duplicação de regra em controller god object
Ordem: alta, alta, média, média, média?, baixa.
Deixa eu reordenar de forma lógica:
1. [high] Submissão de validação: `$company`.
2. [high] Regra de técnico especialista: gestor sem equipe pode ter lista zerada.
3. [medium] Remoção do import do formatador com possível uso remanescente.
4. [medium] Técnico por tipo perde acesso ao detalhe.
5. [medium] display_code removido sem checar consumidores (inclui risco de quebra visual/contrato).
6. [low] Condição duplicada em controller gigante.
Hmm, "5" display_code medium e "3" import medium/alta: se houver uso remanescente, é crash. Talvez display_code e import devessem estar juntos? Não, uma é contrato de API, outra é classe. Mas a remoção do import e do campo estão relacionadas ao mesmo formatter. Podemos combinar: "Remoção do formatador de código de exibição: o import foi removido e o campo display_code deixou de ser enviado. Dois riscos: (a) se sobrar uso da classe no arquivo, erro fatal; (b) se o front ainda consome display_code, quebra." Então uma única issue agrupando seria mais limpa: [medium] ou [high]. Vou agrupar numa issue só? O formato "Issues" permite múltiplas. Mas agrupar é razoável por mesma causa raiz. Contudo, as verifications são diferentes: code_search da classe no controller; code_search display_code em templates/JS. Posso agrupar com duas tool lines.
Se agrupar, a severidade: impacto potencial de quebra de contrato com front e possível fatal error; médio-alto. Vou colocar [high] se houver consumidor? Sem evidência, melhor [medium]. Mas o checklist de revisão pede "remover contrato sem depreciar consumidor antigo é bloqueante" (user rules: "Mudar contrato de payload/resposta ... sem preservar ou depreciar explicitamente o consumidor antigo (front, Flowable/BPMN, jobs) é bloqueante."). Então a remoção de `display_code` das respostas, se houver consumidor no front, é bloqueante; mas precisamos verificar se há consumidor. Talvez o front desta feature (já em staging2) foi atualizado para não usar display_code, e o código está sendo limpo. O teste manual do autor diz que passou. Então provavelmente o front não usa mais. Ainda assim, porque o controller serve múltiplas telas, vale verificar.
Portanto, agrupar e marcar média, com a observação de que, se confirmado uso no front, deve ser bloqueante.
Na verdade, deixa eu manter como issues separadas para clareza das tool calls. Mas o guideline de clareza também. Vou manter separadas: 3 e 5.
Quantas issues no total? 6 está ok, mas a número 6 é baixa e pode ser considerada "inventada". A regra do usuário: "God object ... qualquer aumento dessa mesma responsabilidade na PR é o achado mais importante". Não há aumento, então não precisa. A duplicação da condição existe mas não é novidade? No diff há três locais com a mesma condição, mas isso não é necessariamente um defeito novo. Seria style. Baixa prioridade permite. Vou incluir de forma curta como low, mencionando que a PR reforça um padrão existente e que seria melhor centralizar. As instruções dizem para não inventar issues, mas esta é uma observação de manutenção válida. Manterei, curta.
E o summary:
"Este diff ajusta o SsmaController para alinhar permissões do Plano de Ação/Painel com o staging2: remove o tratamento de usuários com permissão de gestão como 'técnico especialista' quando o escopo de equipe é vazio (três pontos), remove o fallback que permitia a técnico por tipo abrir detalhe sem vínculo na ocorrência, simplifica a chamada de submissão para validação na finalização e deixa de montar o campo display_code em respostas de listagem/dashboard, removendo o import do formatador correspondente."
Agora as tool lines. Vou formatar de forma leve:
1. → code_search search_text='maybeSubmitOccurrenceForValidation' file_patterns=['src/Controller/SsmaController.php'] — localizar a assinatura do método e confirmar se aceita `?Company`/`Company`; ver como `$company` é usada lá dentro.
→ code_search search_text='Ocorrência finalizada com sucesso' file_patterns=['src/Controller/SsmaController.php'] — achar o método que contém a chamada e rastrear a origem/possível nulidade da variável `$company` no escopo.
2. → code_search search_text='getSsmaOccurrenceDashboardTeamFilterIds' file_patterns=['src/'] — ver a lógica que deriva o filtro de equipe do dashboard e o que retorna para usuários com `canManageSsmaOccurrences()` (null vs []).
→ code_search search_text='isTechEarly|isTechSpecialistOnly|needsOccurrencePostFilter' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — mapear as decisões que mudaram e o fluxo após cada condição.
→ code_search search_text='\$autoScope !== null && \$autoScope === \[\]' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — localizar o trecho do auto-scope e ver o que acontece quando a condição nova exclui o gestor.
3. → code_search search_text='SsmaOccurrenceDisplayCodeFormatter' file_patterns=['src/Controller/SsmaController.php'] — confirmar se sobraram referências à classe sem o import (o que causaria erro fatal em runtime).
4. → code_search search_text='tryLoadOccurrenceViewRowForTechnicalType|resolveCurrentUserTechnicalTypes' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — entender quem ainda usa permissão por tipo técnico e se há substituto no fluxo de detalhe.
→ code_search search_text='display_code|list_row_key' file_patterns=['templates/', 'assets/', 'public/'] — ver se o front ainda gera links/exibição de detalhe para perfis técnicos (para avaliar se a perda de acesso é observável).
Hmm, display_code é da próxima issue. Para issue 4 (acesso), melhor procurar as rotas de detalhe: search_text 'ssma_occurrence_detail|kind=event|kind=occurrence' nas templates/assets para ver o que o front envia e para quem mostra links. Mas isso é mais complicado. Em vez disso, procurar o action do controller que abre o detalhe e ver os blocos restantes de matching. Vou usar:
→ code_search search_text='/detail|function detail|occ_view|resolve.*detail' não precisa. O diff indica que há variável `$matching`, comum no método que encontra a linha. Procurar `if ($matching === \[\])` para localizar o método.
→ code_search search_text='if \(\$matching === \[\]\)' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — localizar os blocos de detail e inspecionar os critérios restantes (stakeholder/approver) para ver se técnico por tipo é coberto.
→ code_search search_text='display_code|kind=' too broad. Para gerar links no front, procurar templates que montam URLs de detalhe com kind: code_search search_text='kind=' file_patterns=['templates/ssma', 'assets/']? Não sei estrutura. Vou usar file_patterns=['templates/', 'assets/'].
5. → code_search search_text='display_code' file_patterns=['templates/', 'assets/', 'public/'] — localizar consumo do campo removido no front (Twig/JS).
→ code_search search_text='display_code' file_patterns=['src/'] — conferir se outros pontos do backend (fora deste diff) ainda produzem/consomem o campo, indicando contrato em uso.
Para não repetir demais. Vou usar a mesma busca? Não pode duplicar tool calls iguais em issues diferentes? Podemos reutilizar, mas seria melhor não repetir exatamente. Vou colocar na issue 5 (display_code) essas buscas; na issue 4, buscas relacionadas a permissões/links.
6. → file_find query_name='src/Service/Ssma' — listar services de SSMA para indicar onde a regra de escopo/permissão poderia ser centralizada.
Preciso conferir: file_find query_name aceita caminho com `src/Service/Ssma`? Sim, se contém '/', busca no path relativo.
Tudo bem.
Revisando os requisitos de output:
- Sem linha começando com '#', sem code fences, sem preâmbulo.
- "Summary:" e "Issues".
- Numerados continuamente, ordenados por severidade descrescente.
Vou incluir "→ code_search ... — motivo". formatação exata: `→ code_search` etc. Deve haver espaço? Exemplo: `→ file_read internal/agent/agent.go — confirm...` e outra linha `→ file_read`. Então posso escrever:
→ code_search search_text='...' file_patterns=['...'] — motivo
Acho aceitável.
O idioma: "Sempre responda em Português (pt-BR)". Ok.
Uma última análise da issue 1 (chamada maybeSubmit) — seria realmente um problema? Vejamos o diff ao redor: o método que finaliza ocorrência certamente tem `$user` e `$company` de contexto. A remoção da checagem foi para simplificar, provavelmente porque `$company` já foi verificada antes. Se eu marcar como alta e não for nada, o plano perde precisão. O texto deve ser "potencial" e direcionar a verificação. No plano de revisão, tudo bem. Vou escrever a descrição da issue de forma a deixar claro que é preciso confirmar, e as tools fazem isso.
Também na issue 2, devemos lembrar que o comentário do código novo indica que para técnico especialista sem gestão o filtro por tipo é aplicado "após o bloco de equipe". Então o caminho para gestores (canManage) pode ser: aplica o bloco de equipe normalmente; se `occurrenceTeamFilterIds` é [] para gestor sem equipe, resultado vazio. Mas talvez gestor com canManage nunca tenha [] mas sim lista de equipes ou null. A verificação tool 2 resolve.
Hmm, há também o trecho do diff que mostra "early": `$isTechEarly = !$canManageEarly && !$isViewerEarly && $teamFilterEarly === [] && userTechnicalTypes !== []`. O `$teamFilterEarly` pode ser null (sem filtro). Se canManage e teamFilterEarly null, isTechEarly false, needsPostFilter = (null !== null? false) -> espera: `$needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)`. Se teamFilterEarly é null, needsPostFilter false — sem filtro, tudo bem. O problema só se canManageEarly && teamFilterEarly === []. O trecho "early" ocorre antes de detalhes; depois há outro tratamento (`$occurrenceTeamFilterIds`). Casos reais variam. Vamos manter.
Outra coisa: A PR remove `tryLoadOccurrenceViewRowForTechnicalType`, que usava `resolveCurrentUserTechnicalTypes` e `loadCompanyMembersAndTeamsLite`. Esse método era privado e usado apenas no bloco removido? Se fosse usado em outro lugar, a remoção causaria erro fatal "Call to undefined method" se algum outro trecho ainda chamasse. O diff mostra apenas o bloco no detail. Vou incluir na issue 4 a busca por `tryLoadOccurrenceViewRowForTechnicalType` em todo o arquivo para garantir que nenhuma chamada remanescente existe. Já incluo a busca.
Precisamos também considerar a issue "import removido pode quebrar se método ainda chamar `tryLoadOccurrenceViewRowForTechnicalType`". Incluir busca para o nome do método removido.
Vou então:
Issue 3? Melhor: farei a issue 4 com busca tanto para o método removido quanto para os links do front. Deixa eu montar:
Issue 4:
→ code_search search_text='tryLoadOccurrenceViewRowForTechnicalType' file_patterns=['src/Controller/SsmaController.php'] — garantir que não sobrou chamada ao método privado removido (o que causaria erro fatal).
→ code_search search_text='if \(\$matching === \[\]\)' ... para localizar o método de detalhe e conferir os critérios que restaram (approver/stakeholder) e se há cobertura para técnico por tipo.
→ code_search search_text='ssma.*detail|open.*detail|href=.*occurrence' ... para ver se o front renderiza link de detalhe para técnico. Isso é genérico demais. Talvez melhor apenas descrever sem tool para essa parte? As tools devem ser relevantes. Pular a terceira se for fraca. Incluir as duas primeiras.
Agora vou escrever a descrição final.
Sobre a summary — ok.
Observação: As issues precisam estar contínuas e ordenadas por severidade. Vou separar:
1. [high] — finalização/maybeSubmit
2. [high] — regra de acesso/escopo (gestor sem equipe)
3. [medium] — chamada órfã do método privado / import do formatter? Talvez ordernar: qualquer coisa que possa causar crash deveria ser alta. Mas medium é aceitável para verificação condicional.
Vou estruturar:
1. [high] maybeSubmitOccurrenceForValidation: remoção da checagem Company.
2. [high] Regra "técnico especialista" excluindo canManage: gestor/supervisor com escopo [] pode zerar listas/Painel.
3. [medium] Remoção do fallback de detalhe para técnico por tipo: perda de acesso a leitura para perfil válido; possível uso remanescente do método removido? (incluir 2 tool lines)
4. [medium] Remoção de display_code do contrato JSON sem verificar consumidores no front.
5. [medium] Import do formatador removido pode deixar referência órfã no arquivo (se houver, erro fatal).
6. [low] Regra de acesso duplicada em três pontos do controller-gigante; sugerir service.
Mas 5 e 4 same root cause (formatter). Poderiam ser uma única issue de médio: "remoção do formatter sem verificar sobras/consumidores". Vou fundir 4 e 5 em uma issue mais completa, para ficar 5 issues:
Issue 4: "[medium] Remoção do campo display_code das respostas e do import do formatador — dois riscos: se sobrou referência à classe no arquivo, erro fatal; se o front ainda lê o campo, quebra a exibição." Tool lines:
→ code_search 'SsmaOccurrenceDisplayCodeFormatter' em src/Controller/SsmaController.php — confirmar que não há usos remanescentes da classe após a remoção do import.
→ code_search 'display_code' em templates/, assets/, public/ — verificar consumidores do campo.
→ code_search 'display_code' em src/ — verificar se outros controladores/services ainda produzem/consomem o campo (contrato em uso).
Isso fica bom e reduz o ruído.
Assim, temos 5 issues:
1 high
2 high
3 medium (acesso técnico detail)
4 medium (display_code + import)
5 low (duplicação)
Posso também incluir questão de que o `display_code` era usado para exibição na listagem e pode ter sido movido para o front; mas se o front desta branch ainda não tem a lógica, quebra. Pronto.
Falta garantir que o "Issues" esteja seguido de nada? O formato pede:
Summary: ...
Issues
1. [high] ...
→ ...
2. [medium] ...
Sim, sem linha em branco extra entre Summary e Issues? Pode haver. Vou seguir o formato proposto.
Vou escrever tudo agora em pt-BR.
Texto final:
Summary: Este diff ajusta o SsmaController para alinhar permissões e contratos do Plano de Ação/Painel com o staging2: remove o tratamento de quem tem permissão de gestão como "técnico especialista" quando o escopo de equipe é vazio (em três pontos), remove o fallback que permitia ao técnico por tipo abrir o detalhe sem vínculo na ocorrência, simplifica a chamada de submissão para validação ao finalizar e deixa de enviar o campo display_code nas respostas de listagem/dashboard (removendo também o import do formatador).
Issues
1. [high] Finalizar uma ocorrência passou a submeter para validação usando uma variável de empresa do escopo do método, sem a checagem anterior que garantia que a empresa vinha do evento e era uma instância válida de Company. Se em algum fluxo essa variável estiver nula — ou for a empresa do usuário logado em vez da empresa da ocorrência — a finalização pode retornar erro (TypeError capturado como falha) ou disparar a validação para a empresa errada, afetando o fluxo de aprovação. É preciso confirmar a origem e nulidade de `$company` no método que contém a chamada e a assinatura de `maybeSubmitOccurrenceForValidation`; se não houver garantia, restaurar a checagem ou usar `$event->getCompany()`.
→ code_search search_text='maybeSubmitOccurrenceForValidation' file_patterns=['src/Controller/SsmaController.php'] — localizar a definição do método e o tipo esperado para `$company`.
→ code_search search_text='Ocorrência finalizada com sucesso' file_patterns=['src/Controller/SsmaController.php'] — identificar o método que contém a mudança e rastrear a origem/possível nulidade de `$company` no escopo.
2. [high] Gestores e usuários com permissão de gestão podem parar de enxergar ocorrências no hub/dashboard/Painel quando não têm equipe atribuída no produto. A regra de "técnico especialista" — que antes impedia o filtro de equipe vazio de zerar a lista — agora exige `!canManage` em três pontos; se para esse perfil `getSsmaOccurrenceDashboardTeamFilterIds` retornar `[]` (sem equipe), o fluxo normal aplica um filtro de equipe vazio e o resultado vira lista vazia, sem erro aparente. Verificar o que o método de filtro devolve para `canManage` e o que acontece depois de cada condição alterada; se o caso existir, é preciso garantir um caminho explícito de acesso total (ou filtro por tipo) para quem gerencia.
→ code_search search_text='getSsmaOccurrenceDashboardTeamFilterIds' file_patterns=['src/'] — entender o que a função retorna para usuários com `canManageSsmaOccurrences()` (null vs lista vazia).
→ code_search search_text='isTechEarly|isTechSpecialistOnly|needsOccurrencePostFilter' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — mapear os três pontos alterados e o fluxo de aplicação do filtro de equipe quando o escopo é vazio.
→ code_search search_text='\$autoScope !== null && \$autoScope === \[\]' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — localizar o trecho do auto-scope e conferir o que ocorre quando a condição nova exclui quem pode gerenciar.
3. [medium] Técnicos que têm o tipo da ocorrência associado, mas não são stakeholder/approver, perdem o acesso direto ao detalhe: o fallback e o método `tryLoadOccurrenceViewRowForTechnicalType` foram removidos. Se o front ainda direciona esses usuários para o detalhe (links vindos de hub, e-mail ou notificações), a abertura passa a falhar com "não encontrado"/negativa, mesmo sendo um perfil que antes enxergava a ocorrência. A restrição pode ser intencional nesta PR, mas como o escopo declarado é o backend do Painel/aba Ações, a perda de leitura precisa ser justificada ou coberta por outro fluxo de autorização.
→ code_search search_text='tryLoadOccurrenceViewRowForTechnicalType|resolveCurrentUserTechnicalTypes' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — garantir que não sobrou chamada ao método removido e ver quem ainda usa permissão por tipo técnico.
→ code_search search_text='if \(\$matching === \[\]\)' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — localizar o método de detalhe e inspecionar os critérios restantes (approver/stakeholder) para ver se o perfil técnico continua coberto em algum cenário.
4. [medium] As respostas de listagem/dashboard deixaram de enviar o campo `display_code`, e o import do formatador foi removido. Se sobrar alguma referência à classe no arquivo, qualquer rota que passe por ela quebra com erro fatal ("class not found"); se o front atual (Twig/JS da aba Ações ou Painel) ainda lê `display_code`, o código da ocorrência some da interface. A remoção pode ser uma limpeza proposital, mas precisa ser confirmada contra os consumidores existentes antes de aprovar.
→ code_search search_text='SsmaOccurrenceDisplayCodeFormatter' file_patterns=['src/Controller/SsmaController.php'] — confirmar que não restou nenhum uso do formatador sem o import.
→ code_search search_text='display_code' file_patterns=['templates/', 'assets/', 'public/'] — verificar se o front ainda consome o campo removido.
→ code_search search_text='display_code' file_patterns=['src/'] — verificar se outros pontos do backend produzem/consomem o campo (contrato em uso fora deste arquivo).
5. [low] A condição que define o perfil "técnico especialista" (sem gestão, sem viewer, com tipos técnicos e escopo de equipe vazio) agora aparece replicada em pelo menos três pontos do SsmaController, um controller com dezenas de milhares de linhas que já concentra regra de negócio de permissão. Replicar a mesma regra em cada fluxo aumenta a chance de divergência futura; o ideal é centralizar a decisão em um service de escopo/permissão existente ou novo. Não bloqueia a PR.
→ file_find query_name='src/Service/Ssma' — listar os services de SSMA existentes para indicar onde a regra de escopo/permissão poderia ser centralizada.
Isso atende? O issue medium 4: display_code pode ser high se o front usa. Mas como afirmação "Se ... quebra" com severidade média para plano de verificação, ok.
Agora, vou verificar se as tool lines estão sintaticamente OK. O formato não exige JSON, mas com espaços e aspas simples fica legível.
Um detalhe: A issue 2 do texto: "se para esse perfil getSsmaOccurrenceDashboardTeamFilterIds retornar []" — cuidado: o comentário do código novo diz que o filtro de equipe é aplicado e depois por tipo para técnico. Para gestor, se teamFilter = [], o bloco de equipe pode pular? Precisamos ver. Vou manter hipotético.
Também na issue 1: o método pode ter `$company` não definida em escopo? Nesse caso PHP notice "Undefined variable" + null passado; TypeError se tipo não-nulo. OK.
Pronto. Devo ter certeza de não incluir nenhuma linha com "#", nem code fence, e nenhum preâmbulo. A saída deve ser exatamente summary/issues. Em pt-BR.
Vou escrever a resposta final.
Summary: Este diff ajusta o SsmaController para alinhar permissões e contratos do Plano de Ação/Painel com o staging2: remove o tratamento de quem tem permissão de gestão como "técnico especialista" quando o escopo de equipe é vazio (em três pontos), remove o fallback que permitia ao técnico por tipo abrir o detalhe sem vínculo na ocorrência, simplifica a chamada de submissão para validação ao finalizar e deixa de enviar o campo display_code nas respostas de listagem/dashboard (removendo também o import do formatador).
Issues
1. [high] Finalizar uma ocorrência passou a submeter para validação usando uma variável de empresa do escopo do método, sem a checagem anterior que garantia que a empresa vinha do evento e era uma instância válida de Company. Se em algum fluxo essa variável estiver nula — ou for a empresa do usuário logado em vez da empresa da ocorrência — a finalização pode retornar erro ou disparar a validação para a empresa errada, afetando o fluxo de aprovação. É preciso confirmar a origem e nulidade de `$company` no método que contém a chamada e a assinatura de `maybeSubmitOccurrenceForValidation`; se não houver garantia, restaurar a checagem ou usar `$event->getCompany()`.
→ code_search search_text='maybeSubmitOccurrenceForValidation' file_patterns=['src/Controller/SsmaController.php'] — localizar a definição do método e o tipo esperado para `$company`.
→ code_search search_text='Ocorrência finalizada com sucesso' file_patterns=['src/Controller/SsmaController.php'] — identificar o método que contém a mudança e rastrear a origem/possível nulidade de `$company` no escopo.
2. [high] Gestores e usuários com permissão de gestão podem parar de enxergar ocorrências no hub/dashboard/Painel quando não têm equipe atribuída no produto. A regra de "técnico especialista" — que antes impedia o filtro de equipe vazio de zerar a lista — agora exige `!canManage` em três pontos; se para esse perfil `getSsmaOccurrenceDashboardTeamFilterIds` retornar lista vazia (sem equipe), o fluxo normal pode aplicar o filtro de equipe vazio e o resultado vira lista vazia, sem erro aparente. Verificar o que o método de filtro devolve para `canManage` e o que acontece depois de cada condição alterada; se o caso existir, é preciso garantir um caminho explícito de acesso total (ou filtro por tipo) para quem gerencia.
→ code_search search_text='getSsmaOccurrenceDashboardTeamFilterIds' file_patterns=['src/'] — entender o que a função retorna para usuários com `canManageSsmaOccurrences()` (null vs lista vazia).
→ code_search search_text='isTechEarly|isTechSpecialistOnly|needsOccurrencePostFilter' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — mapear os três pontos alterados e o fluxo de aplicação do filtro de equipe quando o escopo é vazio.
→ code_search search_text='\$autoScope !== null && \$autoScope === \[\]' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — localizar o trecho do auto-scope e conferir o que ocorre quando a condição nova exclui quem pode gerenciar.
3. [medium] Técnicos que têm o tipo da ocorrência associado, mas não são stakeholder/approver, perdem o acesso direto ao detalhe: o fallback e o método `tryLoadOccurrenceViewRowForTechnicalType` foram removidos. Se o front ainda direciona esses usuários para o detalhe (links vindos de hub, e-mail ou notificações), a abertura passa a falhar com "não encontrado"/negativa, mesmo sendo um perfil que antes enxergava a ocorrência. A restrição pode ser intencional nesta PR, mas como o escopo declarado é o backend do Painel/aba Ações, a perda de leitura precisa ser justificada ou coberta por outro fluxo de autorização.
→ code_search search_text='tryLoadOccurrenceViewRowForTechnicalType|resolveCurrentUserTechnicalTypes' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — garantir que não sobrou chamada ao método removido e ver quem ainda usa permissão por tipo técnico.
→ code_search search_text='if \(\$matching === \[\]\)' file_patterns=['src/Controller/SsmaController.php'] use_perl_regexp=true — localizar o método de detalhe e inspecionar os critérios restantes (approver/stakeholder) para ver se o perfil técnico continua coberto em algum cenário.
4. [medium] As respostas de listagem/dashboard deixaram de enviar o campo `display_code`, e o import do formatador foi removido. Se sobrar alguma referência à classe no arquivo, qualquer rota que passe por ela quebra com erro fatal de classe não encontrada; se o front atual (Twig/JS da aba Ações ou Painel) ainda lê `display_code`, o código da ocorrência some da interface. A remoção pode ser uma limpeza proposital, mas precisa ser confirmada contra os consumidores existentes antes de aprovar.
→ code_search search_text='SsmaOccurrenceDisplayCodeFormatter' file_patterns=['src/Controller/SsmaController.php'] — confirmar que não restou nenhum uso do formatador sem o import.
→ code_search search_text='display_code' file_patterns=['templates/', 'assets/', 'public/'] — verificar se o front ainda consome o campo removido.
→ code_search search_text='display_code' file_patterns=['src/'] — verificar se outros pontos do backend produzem/consomem o campo (contrato em uso fora deste arquivo).
5. [low] A condição que define o perfil "técnico especialista" (sem gestão, sem viewer, com tipos técnicos e escopo de equipe vazio) agora aparece replicada em pelo menos três pontos do SsmaController, um controller com dezenas de milhares de linhas que já concentra regra de negócio de permissão. Replicar a mesma regra em cada fluxo aumenta a chance de divergência futura; o ideal é centralizar a decisão em um service de escopo/permissão existente ou novo. Não bloqueia a PR.
→ file_find query_name='src/Service/Ssma' — listar os services de SSMA existentes para indicar onde a regra de escopo/permissão poderia ser centralizada.
main_task
Request #1
deepseek-v4-flash
P:11.31K C:1.13K CR:2.69K CW:0
6233ms
Reasoning
Let me analyze the diff changes in the SsmaController.php file. The task is a code review in Portuguese (pt-BR). Let me look at the key changes:
1. Removed `use App\Service\Ssma\SsmaOccurrenceDisplayCodeFormatter;` import.
2. Removed a block that allowed a "technical type" user to open occurrence details even without stakeholder/member link.
3. Changed `maybeSubmitOccurrenceForValidation` call — removed the check `$company instanceof Company` and uses `$company` variable from scope.
4. Changed `$isTechEarly` to require `!$canManageEarly`.
5. Changed `$isTechSpecialistOnly` to require `!$ssmaCanManageOccurrences`.
6. Removed `display_code` from several response mappings.
7. Removed `tryLoadOccurrenceViewRowForTechnicalType` method.
8. Changed the auto-scope condition to require `!$this->canManageSsmaOccurrences()`.
I need to investigate the issues raised in the review plan. Let me gather context.
Let me start by searching for the relevant methods/functions.
Let me run the searches in parallel:
- `maybeSubmitOccurrenceForValidation` in SsmaController.php
- 'Ocorrência finalizada com sucesso' in SsmaController.php
- `getSsmaOccurrenceDashboardTeamFilterIds` in src/
- `isTechEarly|isTechSpecialistOnly|needsOccurrencePostFilter` in SsmaController.php
- `$autoScope !== null && $autoScope === []`
- `tryLoadOccurrenceViewRowForTechnicalType|resolveCurrentUserTechnicalTypes`
- `if ($matching === [])`
- `SsmaOccurrenceDisplayCodeFormatter` in SsmaController.php
- `display_code` in templates, assets, public
- `display_code` in src/
- file_find src/Service/Ssma
Let me do these searches.
Tool Calls (10)
code_search
Show Details
Arguments
{"search_text": "maybeSubmitOccurrenceForValidation", "file_patterns": ["src/Controller/SsmaController.php"]}
Result
File: src/Controller/SsmaController.php Match lines: 10 3459| $this->maybeSubmitOccurrenceForValidation($eventEntity, $company, $user); 7767| $this->maybeSubmitOccurrenceForValidation($parent, $company, $user); 7912| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 9328| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 9418| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 11266| private function maybeSubmitOccurrenceForValidation( 25992| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 26188| $this->maybeSubmitOccurrenceForValidation($event, $company, $user, true); 26190| $this->maybeSubmitOccurrenceForValidation($event, $company, $user, false); 28245| $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
code_search
Show Details
Arguments
{"search_text": "Ocorrência finalizada com sucesso", "file_patterns": ["src/Controller/SsmaController.php"]}
Result
File: src/Controller/SsmaController.php Match lines: 2 7861| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']); 7914| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
code_search
Show Details
Arguments
{"search_text": "getSsmaOccurrenceDashboardTeamFilterIds", "file_patterns": ["src/"]}
Result
File: src/Controller/SsmaController.php
Match lines: 17
628| $teamIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
1534| $teamIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
1598| $teamIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
9127| $occurrenceTeamFilterIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
9518| $hasTeamLimitation = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user) !== null;
10203| private function getSsmaOccurrenceDashboardTeamFilterIds(?Company $company, ?User $user): ?array
10340| $scope = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
10420| $scope = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
10481| $scope = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
10519| $scope = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
11555| $occurrenceTeamFilterIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
12502| $teamFilterEarly = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user instanceof User ? $user : null);
12675| $occurrenceTeamFilterIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
12884| // O scope retornado por getSsmaOccurrenceDashboardTeamFilterIds ?? [] (sem equipe atribuída no produto),
17064| $teamIdStr = array_map('strval', $teamIds !== [] ? $teamIds : ($this->getSsmaOccurrenceDashboardTeamFilterIds($currentCompany, $user instanceof User ? $user : null) ?? []));
22802| * Quando teams[] não vem na query, aplica getSsmaOccurrenceDashboardTeamFilterIds().
22824| $autoScope = $this->getSsmaOccurrenceDashboardTeamFilterIds($currentCompany, $user);
code_search
Show Details
Arguments
{"search_text": "isTechEarly|isTechSpecialistOnly|needsOccurrencePostFilter", "file_patterns": ["src/Controller/SsmaController.php"], "use_perl_regexp": true}
Result
File: src/Controller/SsmaController.php
Match lines: 9
12506| $isTechEarly = !$canManageEarly
12510| $needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)
12511| || $isTechEarly
12512| || (!$canManageEarly && !$isViewerEarly && $teamFilterEarly === null && !$isTechEarly);
12518| if (!$needsOccurrencePostFilter) {
12887| $isTechSpecialistOnly = !$ssmaCanManageOccurrences
12892| if ($occurrenceTeamFilterIds !== null && !$isTechSpecialistOnly) {
12977| if ($isTechSpecialistOnly) {
13098| && !$isTechSpecialistOnly) {
code_search
Show Details
Arguments
{"search_text": "\\$autoScope !== null && \\$autoScope === \\[\\]", "file_patterns": ["src/Controller/SsmaController.php"], "use_perl_regexp": true}
Result
File: src/Controller/SsmaController.php
Match lines: 2
22834| if (!$useExplicit && $autoScope !== null && $autoScope === []) {
22857| if (!$useExplicit && $autoScope !== null && $autoScope === []) {
code_search
Show Details
Arguments
{"search_text": "tryLoadOccurrenceViewRowForTechnicalType|resolveCurrentUserTechnicalTypes", "file_patterns": ["src/Controller/SsmaController.php"], "use_perl_regexp": true}
Result
File: src/Controller/SsmaController.php
Match lines: 6
10243| if ($this->resolveCurrentUserTechnicalTypes($company, $user) !== []) {
11816| private function resolveCurrentUserTechnicalTypes(Company $company, User $user): array
11836| return in_array($type, $this->resolveCurrentUserTechnicalTypes($company, $user), true);
11983| if (in_array($type, $this->resolveCurrentUserTechnicalTypes($company, $user), true)) {
12118| if ($this->resolveCurrentUserTechnicalTypes($company, $user) !== []) {
22835| $userTechnicalTypes = $this->resolveCurrentUserTechnicalTypes($currentCompany, $user);
code_search
Show Details
Arguments
{"search_text": "SsmaOccurrenceDisplayCodeFormatter", "file_patterns": ["src/Controller/SsmaController.php"]}
Result
No matches found
code_search
Show Details
Arguments
{"search_text": "display_code", "file_patterns": ["templates/", "assets/", "public/"]}
Result
File: templates/ssma/occurrence/occurrence_view.html.twig
Match lines: 1
573| {{ occurrence.display_code|default(occurrence.id) }}
File: templates/ssma/occurrence/tabs/_tab_occurrences.html.twig
Match lines: 4
479| {{ occ.display_code|default(occ.id) }}
683| style="background:rgba(108,117,125,0.10); color:#6c757d; border-color:#adb5bd;">{{ occ.display_code|default(occ.id) }}</span>
1590| if (occurrenceData && occurrenceData.display_code) {
1591| return String(occurrenceData.display_code);
code_search
Show Details
Arguments
{"search_text": "display_code", "file_patterns": ["src/"]}
Result
No matches found
file_find
Show Details
Arguments
{"query_name": "src/Service/Ssma"}
Result
src/Service/Ssma/ActionPlan/SsmaActionPlanPanelPresenter.php src/Service/Ssma/ActionPlan/SsmaActionPlanPanelService.php src/Service/Ssma/Effectiveness/SecurityActionEffectivenessPresenter.php src/Service/Ssma/Effectiveness/SecurityLeadershipEvaluationPresenter.php src/Service/Ssma/Export/SsmaAbordagemExportAccessResolver.php src/Service/Ssma/Export/SsmaAbordagemExportDataProvider.php src/Service/Ssma/Export/SsmaAbordagemExportFilters.php src/Service/Ssma/Export/SsmaAbordagemExportLabels.php src/Service/Ssma/Export/SsmaAbordagemExportRowMapper.php src/Service/Ssma/Export/SsmaAbordagemExportSchema.php src/Service/Ssma/Export/SsmaAbordagemExportService.php src/Service/Ssma/Export/SsmaAbordagemExportSpreadsheetBuilder.php src/Service/Ssma/Export/SsmaInspectionExportAccessResolver.php src/Service/Ssma/Export/SsmaInspectionExportDataProvider.php src/Service/Ssma/Export/SsmaInspectionExportFilters.php src/Service/Ssma/Export/SsmaInspectionExportLabels.php src/Service/Ssma/Export/SsmaInspectionExportRowMapper.php src/Service/Ssma/Export/SsmaInspectionExportSchema.php src/Service/Ssma/Export/SsmaInspectionExportService.php src/Service/Ssma/Export/SsmaInspectionExportSpreadsheetBuilder.php src/Service/Ssma/Export/SsmaOccurrenceExportAccessResolver.php src/Service/Ssma/Export/SsmaOccurrenceExportDataProvider.php src/Service/Ssma/Export/SsmaOccurrenceExportFilters.php src/Service/Ssma/Export/SsmaOccurrenceExportLabels.php src/Service/Ssma/Export/SsmaOccurrenceExportRowMapper.php src/Service/Ssma/Export/SsmaOccurrenceExportSchema.php src/Service/Ssma/Export/SsmaOccurrenceExportService.php src/Service/Ssma/Export/SsmaOccurrenceExportSpreadsheetBuilder.php src/Service/Ssma/Import/AuraBorborema/Accident/AuraAccidentApplyOptions.php src/Service/Ssma/Import/AuraBorborema/Accident/AuraAccidentApplyPreflightResult.php src/Service/Ssma/Import/AuraBorborema/Accident/AuraAccidentApplyRunnerInterface.php src/Service/Ssma/Import/AuraBorborema/Accident/AuraAccidentEventMapper.php src/Service/Ssma/Import/AuraBorborema/Accident/AuraAccidentImportProjection.php src/Service/Ssma/Import/AuraBorborema/Accident/AuraBorboremaAccidentApplyService.php src/Service/Ssma/Import/AuraBorborema/AuraBorboremaSsmaDryRunAnalyzer.php src/Service/Ssma/Import/AuraBorborema/Csv/AuraCsvDataset.php src/Service/Ssma/Import/AuraBorborema/Csv/AuraCsvReader.php src/Service/Ssma/Import/AuraBorborema/Normalizer/AuraValueNormalizer.php src/Service/Ssma/Import/AuraBorborema/Resolver/AuraCompanyResolution.php src/Service/Ssma/Import/AuraBorborema/Resolver/AuraCompanyResolverInterface.php src/Service/Ssma/Import/AuraBorborema/Resolver/DoctrineAuraCompanyResolver.php src/Service/Ssma/Investigation/Agent/Llm/InvestigationLlmAgentPromptBuilder.php src/Service/Ssma/Investigation/Agent/Llm/StructuredActionsLlmAgentGateway.php src/Service/Ssma/Investigation/Agent/Llm/StructuredActionsLlmAgentGatewayInterface.php src/Service/Ssma/Investigation/Agent/Llm/StructuredActionsLlmGatewayResponse.php src/Service/Ssma/Investigation/Agent/Llm/StructuredActionsLlmPilotService.php src/Service/Ssma/Investigation/Agent/Llm/StructuredInvestigationLlmAgentGateway.php src/Service/Ssma/Investigation/Agent/Llm/StructuredInvestigationLlmAgentGatewayInterface.php src/Service/Ssma/Investigation/Agent/Llm/StructuredInvestigationLlmGatewayResponse.php src/Service/Ssma/Investigation/Agent/Llm/StructuredInvestigationLlmPilotService.php src/Service/Ssma/Investigation/Agent/StructuredActionsRagAgent.php src/Service/Ssma/Investigation/Agent/StructuredHistoryRagAgent.php src/Service/Ssma/Investigation/Agent/StructuredInspectionsRagAgent.php src/Service/Ssma/Investigation/Agent/StructuredInvestigationRagAgent.php src/Service/Ssma/Investigation/Agent/StructuredOccurrenceRagAgent.php src/Service/Ssma/Investigation/Agent/StructuredOperationalContextRagAgent.php src/Service/Ssma/Investigation/Agent/StructuredRisksControlsRagAgent.php src/Service/Ssma/Investigation/Confirm/DoctrineInvestigationProposalConfirmStore.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalConfirmContext.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalConfirmOutcome.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalConfirmResult.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalConfirmService.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalConfirmStoreInterface.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalDiscardOutcome.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalDiscardResult.php src/Service/Ssma/Investigation/Confirm/InvestigationProposalDiscardService.php src/Service/Ssma/Investigation/Confirm/MockInvestigationProposalConfirmStore.php src/Service/Ssma/Investigation/Context/ActionsContextProvider.php src/Service/Ssma/Investigation/Context/EvidenceContextProvider.php src/Service/Ssma/Investigation/Context/HistoryContextProvider.php src/Service/Ssma/Investigation/Context/InspectionContextProvider.php src/Service/Ssma/Investigation/Context/InvestigationContextBuilder.php src/Service/Ssma/Investigation/Context/InvestigationContextSanitizer.php src/Service/Ssma/Investigation/Context/InvestigationContextTagBuilder.php src/Service/Ssma/Investigation/Context/NativeSignalsContextProvider.php src/Service/Ssma/Investigation/Context/PrimaryRecordContextProvider.php src/Service/Ssma/Investigation/Contract/InvestigationContextProviderInterface.php src/Service/Ssma/Investigation/Contract/InvestigationEvidenceRetrieverInterface.php src/Service/Ssma/Investigation/Contract/InvestigationFindingValidatorInterface.php src/Service/Ssma/Investigation/Contract/InvestigationLlmGatewayInterface.php src/Service/Ssma/Investigation/Contract/InvestigationLlmTokenUsageReaderInterface.php src/Service/Ssma/Investigation/Contract/InvestigationRagAgentInterface.php src/Service/Ssma/Investigation/Contract/InvestigationRecordResolverInterface.php src/Service/Ssma/Investigation/Contract/InvestigationTreePublisherInterface.php src/Service/Ssma/Investigation/Coordinator/FindingConflictDetector.php src/Service/Ssma/Investigation/Coordinator/FindingDeduplicator.php src/Service/Ssma/Investigation/Coordinator/FindingEvidenceValidator.php src/Service/Ssma/Investigation/Coordinator/FindingNormalizer.php src/Service/Ssma/Investigation/Coordinator/InvestigationCoordinator.php src/Service/Ssma/Investigation/Coordinator/InvestigationGroundingException.php src/Service/Ssma/Investigation/Coordinator/ProposalTreeBuilder.php src/Service/Ssma/Investigation/Coordinator/ProposalValidator.php src/Service/Ssma/Investigation/DoctrineInvestigationProposalStore.php src/Service/Ssma/Investigation/DoctrineInvestigationRunStore.php src/Service/Ssma/Investigation/Domain/AgentResult.php src/Service/Ssma/Investigation/Domain/ContextBlock.php src/Service/Ssma/Investigation/Domain/InvestigationAccessContext.php src/Service/Ssma/Investigation/Domain/InvestigationContext.php src/Service/Ssma/Investigation/Domain/InvestigationFinding.php src/Service/Ssma/Investigation/Domain/InvestigationQuery.php
Request #2
deepseek-v4-flash
P:15.95K C:254 CR:12.42K CW:0
2389ms
Reasoning
Let me examine the method containing the finalization change (line ~7909) and the method definition for maybeSubmitOccurrenceForValidation (line 11266). Also the surrounding code of the removal of the technical fallback in the detail method (line 3339 area), and the team filter IDs function (line 10203).
Let me read relevant sections.
First, let me read the finalization method around 7860-7920.
Tool Calls (2)
file_read
Show Details
Arguments
{"file_path": "src/Controller/SsmaController.php", "start_line": 7830, "end_line": 7920}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 7830-7920
7830| return new JsonResponse(['success' => false, 'message' => 'Não autenticado.'], 401);
7831| }
7832|
7833| $occurrence = $this->entityManager->find(SsmaOccurrence::class, $id);
7834| if (!$occurrence || $occurrence->getCompany()->getId() !== $user->getCompany()?->getId()) {
7835| return new JsonResponse(['success' => false, 'message' => 'Ocorrência não encontrada.'], 404);
7836| }
7837|
7838| if (!$this->canCompleteSsmaTechnicalType($occurrence->getCompany(), $user, (string) $occurrence->getType())) {
7839| return new JsonResponse(['success' => false, 'message' => 'Você não tem autorização para finalizar esse tipo de ocorrência.'], 403);
7840| }
7841|
7842| try {
7843| $data = json_decode($request->getContent(), true) ?? [];
7844| $occurrence->setStatus('finalizada');
7845| $activityMeta = $this->parseOccurrenceActivityPayload($occurrence->getActivity());
7846| $resolveEvidences = array_values(array_filter(array_map('trim', (array) ($data['resolve_evidences'] ?? []))));
7847| $mergedStorage = $activityMeta['evidences_storage'];
7848| foreach ($resolveEvidences as $label) {
7849| $t = trim((string) $label);
7850| if ($t !== '') {
7851| $mergedStorage[] = $t;
7852| }
7853| }
7854| $resolveComment = trim((string) ($data['resolve_comment'] ?? ''));
7855| $occurrence->setActivity(
7856| $this->buildOccurrenceActivityPayload($activityMeta['text'], $mergedStorage, $resolveComment)
7857| );
7858|
7859| $this->entityManager->flush();
7860|
7861| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
7862| } catch (\Throwable $e) {
7863| return new JsonResponse(['success' => false, 'message' => 'Erro ao finalizar ocorrência.'], 500);
7864| }
7865| }
7866|
7867| /**
7868| * POST /manager/ssma/events/{id}/resolve
7869| * Finaliza um evento SSMA tipado (lista unificada usa id de SsmaEvent, não SsmaOccurrence).
7870| */
7871| public function resolveSsmaEvent(Request $request, int $id): JsonResponse
7872| {
7873| /** @var User|null $user */
7874| $user = $this->getUser();
7875| if (!$user) {
7876| return new JsonResponse(['success' => false, 'message' => 'Não autenticado.'], 401);
7877| }
7878|
7879| $companyId = $user->getCompany()?->getId();
7880| $event = $this->entityManager->find(SsmaEvent::class, $id);
7881| if (!$event || $event->getCompany()->getId() !== $companyId) {
7882| return new JsonResponse(['success' => false, 'message' => 'Ocorrência não encontrada.'], 404);
7883| }
7884|
7885| if (!$this->canCompleteSsmaTechnicalType($event->getCompany(), $user, $event->getType())) {
7886| return new JsonResponse(['success' => false, 'message' => 'Você não tem autorização para finalizar esse tipo de ocorrência.'], 403);
7887| }
7888|
7889| try {
7890| $data = json_decode($request->getContent(), true) ?? [];
7891| $resolveEvidences = array_values(array_filter(array_map('trim', (array) ($data['resolve_evidences'] ?? []))));
7892| $resolveComment = trim((string) ($data['resolve_comment'] ?? ''));
7893|
7894| $details = $event->getDetails();
7895| if (!is_array($details)) {
7896| $details = [];
7897| }
7898| $existing = is_array($details['evidences'] ?? null) ? $details['evidences'] : [];
7899| $details['evidences'] = $this->ssmaSanitizeEvidenceStorageList(array_merge($existing, $resolveEvidences));
7900| if ($resolveComment !== '') {
7901| $details['resolve_comment'] = $resolveComment;
7902| }
7903|
7904| $prevStatus = $event->getStatus();
7905| $event->setDetails($details);
7906| $event->setStatus(SsmaEvent::STATUS_CONCLUIDO);
7907| if ($event->getStatus() !== $prevStatus) {
7908| $event->appendHistory('Ocorrência finalizada.', ['from' => $prevStatus, 'to' => $event->getStatus()]);
7909| }
7910|
7911| $this->entityManager->flush();
7912| $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
7913|
7914| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
7915| } catch (\Throwable $e) {
7916| return new JsonResponse(['success' => false, 'message' => 'Erro ao finalizar ocorrência.'], 500);
7917| }
7918| }
7919|
7920| // ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
file_read
Show Details
Arguments
{"file_path": "src/Controller/SsmaController.php", "start_line": 11260, "end_line": 11310}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 11260-11310
11260| || in_array(mb_strtolower($raw), ['finalizada', 'resolvida', 'concluida'], true);
11261| }
11262|
11263| /**
11264| * Marca pendente e notifica aprovadores quando a ocorrência foi finalizada (não no rascunho).
11265| */
11266| private function maybeSubmitOccurrenceForValidation(
11267| \App\Entity\SsmaEvent $event,
11268| Company $company,
11269| User $sender,
11270| bool $resubmitted = false
11271| ): void {
11272| if ($this->ssmaOccurrenceApprovalService->isApproved($event)) {
11273| return;
11274| }
11275|
11276| if (!$resubmitted && !$this->isSsmaEventStatusFinalized($event)) {
11277| return;
11278| }
11279|
11280| if (!$this->isEventReadyForOccurrenceValidation($event)) {
11281| return;
11282| }
11283|
11284| $status = $this->ssmaOccurrenceApprovalService->getState($event)['status'];
11285|
11286| if ($resubmitted) {
11287| if ($status !== \App\Service\Ssma\SsmaOccurrenceApprovalService::STATUS_REJECTED) {
11288| return;
11289| }
11290| $this->ssmaOccurrenceApprovalService->markPending($event, true);
11291| $this->ssmaNotificationService->notifyOccurrenceValidationApprovers($company, $event, $sender, true);
11292|
11293| return;
11294| }
11295|
11296| if ($status === \App\Service\Ssma\SsmaOccurrenceApprovalService::STATUS_PENDING) {
11297| return;
11298| }
11299|
11300| if ($status === \App\Service\Ssma\SsmaOccurrenceApprovalService::STATUS_REJECTED) {
11301| return;
11302| }
11303|
11304| $this->ssmaOccurrenceApprovalService->markPending($event, false);
11305| $this->ssmaNotificationService->notifyOccurrenceValidationApprovers($company, $event, $sender, false);
11306| }
11307|
11308| private function notifyOccurrenceRegistrantOnReject(
11309| SsmaEvent $event,
11310| Company $company,
Request #3
deepseek-v4-flash
P:18.33K C:2K CR:16.13K CW:0
13860ms
Reasoning
Interesting! The diff at line 7909-7912 changed:
Before:
```php
$this->entityManager->flush();
$company = $event->getCompany();
if ($company instanceof Company) {
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
}
return new JsonResponse([...]);
```
After:
```php
$this->entityManager->flush();
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
return new JsonResponse([...]);
```
So the new code uses `$company` from the outer scope. In `resolveSsmaEvent`, `$company` is NOT defined in the method scope! Let me check. The method `resolveSsmaEvent(Request $request, int $id)` at line 7871. It defines `$user`, `$companyId`, `$event`. It never defines `$company`. So calling `maybeSubmitOccurrenceForValidation($event, $company, $user)` will pass `null` for `$company` typed as `Company $company` — that's a TypeError! Actually wait — with strict typing... In PHP, if the file doesn't have `declare(strict_types=1)`, coercive mode will try to coerce null into Company and throw TypeError anyway since null can't be coerced to a class type (only scalar coercion is allowed in coercive mode; for object types null fails). Actually in coercive mode, passing null to a non-nullable class-typed parameter throws TypeError as well (null only allowed for nullable types). So this is a TypeError → caught by `catch (\Throwable $e)` which returns 500 "Erro ao finalizar ocorrência." — even though the flush already happened. So the event would be finalized but return error 500, and validation submission never happens.
Wait — but there could be a `$company` variable defined earlier in the method? Let me double check the whole method from line 7871 to 7918. We saw lines 7871-7918. There's no `$company` variable assignment. So indeed `$company` is undefined → actually in PHP, using an undefined variable emits a Warning (in PHP 8: "Undefined variable $company") and evaluates to null. Then passing null to typed parameter Company triggers TypeError. So this is a real bug!
Wait, but is there some `$company` available from a parent scope? This is a controller method; no. So yes, this is a genuine bug: `resolveSsmaEvent` now references undefined `$company`. This will throw TypeError, caught and returned as a 500 error. The occurrence/event is already flushed with finalizada status though, then returns 500. So the flow of finalize event breaks.
Hmm, let me verify: is the change at line 7912 in the same method `resolveSsmaEvent`? Yes. Let me confirm by reading the diff again:
```
@@ -7928,10 +7909,7 @@ class SsmaController extends AbstractController
}
$this->entityManager->flush();
- $company = $event->getCompany();
- if ($company instanceof Company) {
- $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
- }
+ $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
```
So the removed lines created `$company = $event->getCompany();` and only called when Company instance. The new code directly uses `$company`. In `resolveSsmaEvent`, `$company` is not defined anywhere in the method. So the new code calls an undefined variable → warning + null → TypeError for Company param → 500.
Actually wait — was `$company` defined earlier in this method? We need to read the full method body again from 7871 to 7918. Reading earlier snippet: 7871-7918, no `$company`. Right.
Hmm — but could `$company` be defined in method that starts before 7871? No, each function is separate scope. So this is a genuine bug. The old code even had a `$company instanceof Company` guard, which suggests there was concern about null. The refactor removed the local definition and the guard, leaving a broken call. This is bug #1 confirmed — high severity.
Actually wait, let me double check there isn't some other `resolve` method where `$company` might exist. The diff is at line 7909 area. Let me read lines 7860-7872 to see if `resolveSsmaEvent` is the method containing the change, or whether there is an intervening method. We read from 7830. Line 7861 is end of previous method (resolveSsmaOccurrence? no...). Actually line 7861 returns "Ocorrência finalizada com sucesso." inside try of an earlier method ending at 7865. The next method `resolveSsmaEvent` starts at 7871. The changed code at 7909-7912 is inside `resolveSsmaEvent`. Good — no `$company` defined there.
So confirmed bug: `$company` undefined in `resolveSsmaEvent`. Let me double-check whether there might be a `$company` defined as a property or something. In Symfony controllers, methods are instance methods; there might be a property `$company`? Not typical. Search for `$company` within that method scope is limited. I'll trust reading.
Let me search for other references to verify the other lines changed in the same manner. Actually the search for maybeSubmitOccurrenceForValidation shows many call sites: lines 3459, 7767, 7912, 9328, 9418, 25992, 26188, 26190, 28245. Many of these presumably define `$company` earlier. This one (7912) is special because it removed the local definition.
So comment #1 is confirmed and is critical/high.
Now for the other changes:
Change at 3339 (removal of the technical fallback in detail method). The detail endpoint now no longer opens detail for tech user without stakeholder link. The fallback method `tryLoadOccurrenceViewRowForTechnicalType` removed. Search shows no other references to `tryLoadOccurrenceViewRowForTechnicalType` remain (only in the code_search earlier — only 6 results for the combined pattern, all `resolveCurrentUserTechnicalTypes`). So the method is fully removed, no dangling references. Good.
The `isTechSpecialistOnly` change and `isTechEarly` change: previously "Não exige !$canManageEarly" — comment in removed code says it was deliberate not to require canManage. Now it requires `!canManage`. This is a business-rule change: users with canManage but team scope [] (empty team) will no longer be treated as tech-only filtered; the empty team filter could zero out the list. This is the design intent? Hmm. Let me understand the actual risk. Need to read surrounding code at 12500-12600 and 12880-13100, and 22824-22900.
Actually the questions: does a manager (canManage) have a null team filter or an empty-array team filter? If they have an empty array from getSsmaOccurrenceDashboardTeamFilterIds, then when teamFilterEarly === [] and userTechnicalTypesEarly !== [], previously isTechEarly was true (if not viewer) so post-filter path applied (filter by types). Now isTechEarly requires !canManageEarly. For manager with canManage=true and teamFilterEarly = [], isTechEarly = false. Then needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly) = ([] !== null && true) = true. So they need post-filter... hmm need to read code to understand what happens.
Let me read lines around 12490-12600 and 12870-13100 and 22790-22900.
Also we need to understand getSsmaOccurrenceDashboardTeamFilterIds at 10203-10300 to see when null vs [].
Let me read these chunks.
Tool Calls (3)
file_read
Show Details
Arguments
{"end_line": 12630, "file_path": "src/Controller/SsmaController.php", "start_line": 12440}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 12440-12630
12440| $company,
12441| $detailOccurrenceId,
12442| $allMembers,
12443| $teams
12444| );
12445| $actionsTaken = $this->loadActionsForOccurrenceDetail($company, $detailOccurrenceId);
12446| $inspections = [];
12447| $abordagens = [];
12448| $horasData = [];
12449| // Fase B: SSR do detalhe só com membros referenciados (+ gestores do modal).
12450| if ($this->ssmaMemberSelectDataProvider->shouldFilterToReferencedMembers($scope)) {
12451| $allMembers = $this->filterSsmaMembersToReferencedForDetail(
12452| $allMembers,
12453| $occurrences,
12454| $actionsTaken,
12455| $gestores
12456| );
12457| }
12458| } elseif ($isNetworkHeadWithUnits && $company) {
12459| $occurrences = $this->loadNetworkOccurrencesForList($company);
12460| foreach ($this->resolveSsmaNetworkSubsidiaries($company) as $netCompany) {
12461| if ((int) $netCompany->getId() === (int) $company->getId()) {
12462| continue;
12463| }
12464| [$extraMembers, $extraTeams] = $this->loadCompanyMembersAndTeamsLite($netCompany);
12465| $teamNameByMemberId = [];
12466| foreach ($extraTeams as $teamRow) {
12467| foreach ($teamRow['members'] as $teamMemberId) {
12468| $teamMemberId = (int) $teamMemberId;
12469| if ($teamMemberId > 0 && !isset($teamNameByMemberId[$teamMemberId])) {
12470| $teamNameByMemberId[$teamMemberId] = (string) ($teamRow['name'] ?? '');
12471| }
12472| }
12473| }
12474| foreach ($this->enrichSsmaMemberRowsWithTeamMeta($extraMembers, $teamNameByMemberId) as $extraMember) {
12475| $allMembers[] = $extraMember;
12476| }
12477| }
12478| $networkCompanies = $this->resolveSsmaNetworkSubsidiaries($company);
12479| if ($deferOccurrenceHubHeavyData) {
12480| $actionsTaken = [];
12481| $inspections = [];
12482| $horasData = [];
12483| } else {
12484| $actionsTaken = [];
12485| $inspections = [];
12486| foreach ($networkCompanies as $netCompany) {
12487| [$netMembers, $netTeams] = $this->loadCompanyMembersAndTeamsLite($netCompany);
12488| $actionsTaken = array_merge(
12489| $actionsTaken,
12490| $this->loadActions($netCompany)
12491| );
12492| $inspections = array_merge(
12493| $inspections,
12494| $this->loadInspections($netCompany, $netMembers, $netTeams)
12495| );
12496| }
12497| $horasData = $this->mergeHorasDataForNetworkCompanies($networkCompanies);
12498| }
12499| } else {
12500| $occurrenceListAlreadyPaged = false;
12501| if ($company && $paginateOccurrenceList) {
12502| $teamFilterEarly = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user instanceof User ? $user : null);
12503| $canManageEarly = $this->canManageSsmaOccurrences();
12504| $isViewerEarly = $this->isSsmaViewer();
12505| $userTechnicalTypesEarly = $this->resolveUserTechnicalTypes($company, $user, $companyMembers ?? []);
12506| $isTechEarly = !$canManageEarly
12507| && !$isViewerEarly
12508| && $teamFilterEarly === []
12509| && $userTechnicalTypesEarly !== [];
12510| $needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)
12511| || $isTechEarly
12512| || (!$canManageEarly && !$isViewerEarly && $teamFilterEarly === null && !$isTechEarly);
12513|
12514| $pageSize = SsmaViewDataScope::OCCURRENCE_LIST_PAGE_SIZE;
12515| $occurrencesListPage = $scope->listPage;
12516| $offset = ($occurrencesListPage - 1) * $pageSize;
12517|
12518| if (!$needsOccurrencePostFilter) {
12519| // Visão completa: hidrata só a página pedida (SQL UNION + findBy ids).
12520| $occurrencesListTotal = $this->countCompanyOccurrencesAndEvents($company);
12521| $occurrences = $this->loadOccurrences($company, $allMembers, $teams, $pageSize, $offset);
12522| $occurrencesListHasMore = ($offset + count($occurrences)) < $occurrencesListTotal;
12523| $occurrenceListAlreadyPaged = true;
12524| } else {
12525| $occurrences = $this->loadOccurrences($company, $allMembers, $teams);
12526| }
12527| } else {
12528| $occurrences = $company ? $this->loadOccurrences($company, $allMembers, $teams) : [];
12529| }
12530| if ($occurrences !== []) {
12531| // Sempre anexa cause_tree_id na página atual (UX: botão Causa aparece no SSR).
12532| // Painel/inspeções/horas continuam deferred; só o mapa de árvores volta no hub.
12533| if ($company instanceof Company) {
12534| $itemsForTrees = [];
12535| foreach ($occurrences as $occRow) {
12536| $entityId = (int) ($occRow['id'] ?? 0);
12537| if ($entityId <= 0) {
12538| continue;
12539| }
12540| $itemsForTrees[] = [
12541| 'id' => $entityId,
12542| 'is_ssma_event' => !empty($occRow['is_ssma_event']),
12543| ];
12544| }
12545| if ($itemsForTrees !== []) {
12546| $treeMeta = $this->ssmaCauseTreeService->resolveEntityTreeMetaBatch(
12547| (int) $company->getId(),
12548| $itemsForTrees
12549| );
12550| foreach ($occurrences as $idx => $occRow) {
12551| $entityId = (int) ($occRow['id'] ?? 0);
12552| $key = (!empty($occRow['is_ssma_event']) ? 'e:' : 'o:') . $entityId;
12553| $occurrences[$idx]['cause_tree_id'] = $treeMeta[$key]['cause_tree_id'] ?? null;
12554| }
12555| }
12556| }
12557| $occurrences = $this->enrichOccurrencesCommitteeTriggerFlags($occurrences, $company);
12558| $occurrences = $this->enrichOccurrencesGravityLabels($occurrences);
12559| }
12560| if ($deferOccurrenceHubHeavyData) {
12561| $actionsTaken = [];
12562| $inspections = [];
12563| $horasData = [];
12564| } else {
12565| $actionsTaken = $company ? $this->loadActions($company) : [];
12566| $inspections = $company ? $this->loadInspections($company, $allMembers, $teams) : [];
12567| $horasData = $company ? $this->loadHorasData($company) : [];
12568| }
12569| }
12570| if ($needsPreventionCollections) {
12571| $abordagens = $company ? $this->loadAbordagens($company) : [];
12572| }
12573| $occurrenceUiMeta = $this->getMockOccurrenceMetadata();
12574|
12575| $userTechnicalTypes = $company
12576| ? $this->resolveUserTechnicalTypes($company, $user, $companyMembers ?? [])
12577| : [];
12578| $ssmaCanManageOccurrences = $this->canManageSsmaOccurrences();
12579| $ssmaCanAccessSupervisorSurface = $this->canAccessSsmaSupervisorSurface();
12580| $ssmaCanAccessPreventionPanelAndMetas = $this->canAccessPreventionDashboardAndMetasTabs();
12581| $ssmaCanAccessOccurrencePanel = $ssmaCanManageOccurrences || $this->isSsmaViewer();
12582| // Supervisores veem a aba Automações mas não criam; o botão de criação usa ssmaCanManageOccurrences
12583| $ssmaCanAccessOccurrenceAutomations = $ssmaCanManageOccurrences || $this->isSsmaViewer();
12584| $ssmaCanManageConfig = $this->canManageSsmaConfig();
12585| $ssmaCanManagePermissions = $this->canManageSsmaPermissions();
12586| // ssmaCanCreateLinkedActions: botão "Criar ação" na aba Ocorrências e occurrence_view.
12587| // Brenda: Supervisor só visualiza (dash/painel). Criar/editar fica com gestor/admin
12588| // e Gestor de Equipe (override abaixo). Membro comum não cria.
12589| $ssmaCanCreateLinkedActions = $this->canMutateSsmaActionPlan();
12590| $ssmaCanMutateActionPlan = $ssmaCanCreateLinkedActions;
12591| // ssmaCanCreateCauseTree: Supervisor ?? SOMENTE LEITURA na Árvore de Causas (planilha).
12592| // NÃO incluir isSsmaViewer() aqui. Usa produto ssma-cause-tree (não can_create de ssma-occurrences).
12593| $ssmaCanCreateCauseTree = $this->canCreateSsmaCauseTree();
12594| $ssmaCanCreateAuthorization = $ssmaCanManageOccurrences;
12595| $ssmaCanEditHorasTrabalhadas = $this->canEditSsmaHorasTrabalhadas();
12596|
12597| // Tag SSMA do colaborador — sempre resolve (ROLE_MANAGER de plataforma ≠ perfil SSMA).
12598| $ssmaProductTagName = null;
12599| $memberForTagCheck = null;
12600| $ssmaPreventionProductTagName = null;
12601| if ($company && $user instanceof User) {
12602| $memberForTagCheck = $this->getCurrentCompanyMember($company, $user);
12603| if ($memberForTagCheck) {
12604| $resolvedTag = $this->resolveSsmaProductPermissionTagForMember($memberForTagCheck);
12605| if ($resolvedTag) {
12606| $ssmaProductTagName = $resolvedTag->getName();
12607| }
12608| if ($this->memberIsSsmaGestorAdministrador($memberForTagCheck)) {
12609| $ssmaProductTagName = 'Gestor Administrador';
12610| }
12611| $ssmaPreventionProductTagName = $this->ssmaPreventionHubAccessService
12612| ->resolvePreventionProductTagName($memberForTagCheck);
12613| }
12614| }
12615|
12616| // Membro/Inspetor: visão de pessoa física (matriz de tipos + registrar).
12617| // Só strip se tiver ROLE_USER (Palloma). Conta admin empresa sem ROLE_USER (Aura) mantém abas.
12618| // Tenant / SUPER_ADMIN mantêm abas mesmo com tag Membro (regressão Felipe).
12619| $ssmaIsPlainProductMemberUi = SsmaOccurrenceCreatePermissionService::shouldStripOccurrenceManagementTabsUi(
12620| $ssmaProductTagName,
12621| $this->isGranted('ROLE_SUPER_ADMIN'),
12622| $this->isGranted('ROLE_TENANT'),
12623| $user instanceof User && in_array('ROLE_USER', $user->getRoles(), true)
12624| );
12625| if ($ssmaIsPlainProductMemberUi && !$this->memberIsSsmaGestorAdministrador($memberForTagCheck)) {
12626| $ssmaCanManageOccurrences = false;
12627| $ssmaCanAccessSupervisorSurface = false;
12628| $ssmaCanAccessPreventionPanelAndMetas = false;
12629| $ssmaCanAccessOccurrencePanel = false;
12630| $ssmaCanAccessOccurrenceAutomations = false;
file_read
Show Details
Arguments
{"end_line": 12920, "file_path": "src/Controller/SsmaController.php", "start_line": 12860}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 12860-12920
12860| if ($plainMemberTeamIds !== []) {
12861| $plainTeamIdStr = array_map('strval', $plainMemberTeamIds);
12862| $teamsForInspectionModal = array_values(array_filter(
12863| $teams,
12864| static fn (array $t): bool => in_array((string) ($t['id'] ?? ''), $plainTeamIdStr, true)
12865| && $areaScope->allowsTeam((int) ($t['id'] ?? 0))
12866| ));
12867| if (count($plainMemberTeamIds) === 1) {
12868| $defaultInspectionTeamId = (int) $plainMemberTeamIds[0];
12869| }
12870| } else {
12871| $teamsForInspectionModal = [];
12872| }
12873| } elseif ($applyTeamEventScope && $teamsForInspectionModal !== []) {
12874| $defaultInspectionTeamId = (int) ($ssmaEventFormDefaults['team_id'] ?? 0) ?: null;
12875| if ($defaultInspectionTeamId === null && count($teamsForInspectionModal) === 1) {
12876| $defaultInspectionTeamId = (int) ($teamsForInspectionModal[0]['id'] ?? 0) ?: null;
12877| }
12878| }
12879| usort($teamsForInspectionModal, static function (array $a, array $b): int {
12880| return strcasecmp((string) ($a['name'] ?? ''), (string) ($b['name'] ?? ''));
12881| });
12882|
12883| // Técnico especialista SSMA: tem SsmaPermissionTagMember mas sem gestão ou supervisão de equipe.
12884| // O scope retornado por getSsmaOccurrenceDashboardTeamFilterIds ?? [] (sem equipe atribuída no produto),
12885| // o que zeraria todas as ocorrências se o filtro de equipe fosse aplicado.
12886| // Em vez disso, aplicamos um filtro por tipo de ocorrência após o bloco de equipe.
12887| $isTechSpecialistOnly = !$ssmaCanManageOccurrences
12888| && !$this->isSsmaViewer()
12889| && $occurrenceTeamFilterIds === []
12890| && !empty($userTechnicalTypes);
12891|
12892| if ($occurrenceTeamFilterIds !== null && !$isTechSpecialistOnly) {
12893| $teamIdStr = array_map('strval', $occurrenceTeamFilterIds);
12894|
12895| // Coleta IDs de membros pertencentes às equipes do viewer
12896| $memberIdsInTeams = [];
12897| foreach ($teams as $team) {
12898| if (in_array((string) ($team['id'] ?? ''), $teamIdStr, true)) {
12899| foreach ($team['members'] ?? [] as $mid) {
12900| $memberIdsInTeams[(int) $mid] = true;
12901| }
12902| }
12903| }
12904|
12905| // Supervisor/Gestor de Equipe sem equipe atribuída: ainda deve ver ocorrências onde ??
12906| // pessoalmente gestor responsável ou pessoa envolvida (regra da planilha SSMA).
12907| // Sem esse ajuste, memberIdsInTeams ficaria vazio e o filtro de manager_id/people_ids
12908| // nunca passaria — o supervisor não veria nada, mesmo sendo o responsável da ocorrência.
12909| if ($occurrenceTeamFilterIds === [] && ($ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor)) {
12910| $selfMember = $this->getCurrentCompanyMember($company, $user);
12911| $selfMemberId = (int) ($selfMember?->getId() ?? 0);
12912| if ($selfMemberId > 0) {
12913| $memberIdsInTeams[$selfMemberId] = true;
12914| }
12915| }
12916|
12917| // Ocorrências: por team_id direto OU por manager_id/people_ids/responsible_ids pertencente ?? equipe.
12918| // Supervisor de Equipe deve ver ocorrências onde ?? gestor responsável ou pessoa envolvida,
12919| // mesmo que o team_id da ocorrência não esteja preenchido ou difira do escopo.
12920| $occurrences = array_values(array_filter($occurrences, static function (array $o) use ($teamIdStr, $memberIdsInTeams): bool {
file_read
Show Details
Arguments
{"end_line": 10280, "file_path": "src/Controller/SsmaController.php", "start_line": 10200}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 10200-10280
10200| *
10201| * @return int[]|null null = sem filtro por equipe nesta tela
10202| */
10203| private function getSsmaOccurrenceDashboardTeamFilterIds(?Company $company, ?User $user): ?array
10204| {
10205| if (!$company || !$user instanceof User) {
10206| return null;
10207| }
10208|
10209| if ($this->isGranted('ROLE_SUPER_ADMIN') || $this->isGranted('ROLE_MANAGER')) {
10210| return null;
10211| }
10212|
10213| $member = $this->getCurrentCompanyMember($company, $user);
10214| if (!$member) {
10215| return null;
10216| }
10217|
10218| $tag = $this->resolveSsmaProductPermissionTagForMember($member);
10219| // 'Supervisor' puro (sem "de Equipe") ?? supervisor global: sem restrição de equipe, igual ao Gestor Administrador.
10220| if ($tag && in_array($tag->getName(), ['Gestor Administrador', 'Supervisor'], true)) {
10221| return null;
10222| }
10223|
10224| $parsed = $this->parseCompanyMemberTeamIds($member);
10225|
10226| if ($tag && in_array($tag->getName(), $this->ssmaTeamScopePermissionTagNames(), true)) {
10227| return $parsed;
10228| }
10229|
10230| if ($tag && $tag->getTeamLimitation()) {
10231| return $parsed;
10232| }
10233|
10234| $viewerTeams = $this->getSsmaViewerTeamIds();
10235| if ($viewerTeams !== null) {
10236| return $viewerTeams;
10237| }
10238|
10239| // Membro sem tag de supervisão/gestão SSMA (ex.: stakeholder via ocorrência) não deve
10240| // ter filtro de equipe aplicado: retorna null para que filterOccurrencesForMember
10241| // mostre apenas o conteúdo próprio. Retornar [] zeraria todos os dados antes disso.
10242| if ($tag !== null && $parsed === []) {
10243| if ($this->resolveCurrentUserTechnicalTypes($company, $user) !== []) {
10244| return [];
10245| }
10246|
10247| return null;
10248| }
10249|
10250| return null;
10251| }
10252|
10253| /**
10254| * Recorte de área do usuário logado na Prevenção Ativa.
10255| *
10256| * Fonte única para listagem, busca, detalhe e gravação: um escopo não restrito libera tudo,
10257| * um escopo restrito com conjunto vazio nega tudo. Não existe estado intermediário em que
10258| * a ausência de área cadastrada remova o filtro.
10259| */
10260| private function getSsmaPreventionAreaScope(?Company $company, ?User $user): SsmaPreventionAreaScope
10261| {
10262| if (!$company || !$user instanceof User) {
10263| return SsmaPreventionAreaScope::unrestricted();
10264| }
10265|
10266| $isPlatformAdmin = $this->isGranted('ROLE_SUPER_ADMIN') || $this->isGranted('ROLE_MANAGER');
10267| $member = $this->getCurrentCompanyMember($company, $user);
10268| $tag = $member ? $this->resolveSsmaProductPermissionTagForMember($member, 'ssma-prevention') : null;
10269|
10270| return $this->ssmaPreventionAreaAuthorization
10271| ->resolveScope($company, $member, $tag, $isPlatformAdmin);
10272| }
10273|
10274| /**
10275| * @return list<int>
10276| */
10277| private function parseCompanyMemberAreaIds(CompanyMembers $member): array
10278| {
10279| return $this->ssmaPreventionAreaAuthorization->memberAreaIds($member);
10280| }
Request #4
deepseek-v4-flash
P:25.63K C:1.13K CR:20.22K CW:0
9092ms
Reasoning
Important context for the tech-specialist changes: `getSsmaOccurrenceDashboardTeamFilterIds` returns `[]` when the member has a SSMA tag, parsed team ids = [], and the user has technical types. So for a member with `SsmaPermissionTagMember` + technical type and NO team — that's the "tech specialist" case returning `[]`. For `canManage` (Gestor Administrador or platform ROLE_MANAGER), returns null → no team filter. So a "canManage" user would never get `[]` from `getSsmaOccurrenceDashboardTeamFilterIds`. So the `isTechEarly` change (requiring `!canManageEarly`) doesn't break a manager with team scope [] because managers return null from that function.
But wait — can a user have `canManageSsmaOccurrences()` true while `getSsmaOccurrenceDashboardTeamFilterIds` returns `[]`? Look at getSsmaOccurrenceDashboardTeamFilterIds: returns [] only in this branch: `if ($tag !== null && $parsed === [])` and technical types present. That branch applies for members with a member tag that isn't team-scope, isn't team-supervisor/gestor, has parsed team ids [] and has technical types → the "member specialist". But then `$ssmaCanManageOccurrences` for that member would be false (they're a plain member, not a gestor). So the changed conditions are consistent with the function semantics: canManage users always return null from the team filter function, so they never hit the empty-team zeroing path.
Hmm, but there's another wrinkle. `canManageSsmaOccurrences()` might be true by platform ROLE_MANAGER even if `getSsmaOccurrenceDashboardTeamFilterIds` returns null. So managers aren't affected.
But what about `$ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor`? For Team Supervisor/Gestor, parsed = team ids possibly []. `getSsmaOccurrenceDashboardTeamFilterIds` returns $parsed (maybe []). So a team gestor/supervisor without assigned team gets `[]`. Then `$ssmaCanManageOccurrences`? A "Gestor de Equipe" may be able to manage? There's `$ssmaCanMutateActionPlan` override for Gestor de Equipe. But canManageSsmaOccurrences may be false for tag "Membro"/"Gestor de Equipe"? Need to check `canManageSsmaOccurrences` and `memberIsSsmaGestorAdministrador`.
Actually wait — the comment at line 12909 handles `$occurrenceTeamFilterIds === [] && ($ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor)` by adding the self member so that team gestor/supervisor without team sees own occurrences. That block is inside `if ($occurrenceTeamFilterIds !== null && !$isTechSpecialistOnly)`. With the new condition, `$isTechSpecialistOnly` requires `!$ssmaCanManageOccurrences`. Is a Team Gestor ("Gestor de Equipe") considered canManage? Let's check `memberIsSsmaGestorAdministrador` — the comment in code at 12608 says "Gestor Administrador" for gestor administrador. A "Gestor de Equipe" tag is a different tag (ssmaTeamScopePermissionTagNames). canManageSsmaOccurrences probably checks tag name among 'Gestor Administrador' and maybe platform ROLE_MANAGER? Need to check.
Let me read canManageSsmaOccurrences and canAccessSsmaSupervisorSurface definitions, and memberIsSsmaGestorAdministrador.
Also, the third change location: line 22834 (`autoScope === []`), plus line 22857. Let me read 22790-22920 to understand the diff context (the diff shows a change at 22915 old/22833 new area). Let's read the whole block.
Also read the removed fallback area at 3339 (detail method). Let me read around 3280-3420.
Let me look at canManageSsmaOccurrences and isSsmaViewer definitions.
Tool Calls (2)
code_search
Show Details
Arguments
{"file_patterns": ["src/Controller/SsmaController.php"], "search_text": "private function canManageSsmaOccurrences|public function canManageSsmaOccurrences|private function isSsmaViewer|public function isSsmaViewer|function memberIsSsmaGestorAdministrador|function canAccessSsmaSupervisorSurface", "use_perl_regexp": true}
Result
File: src/Controller/SsmaController.php Match lines: 4 10068| private function isSsmaViewer(): bool 10645| private function memberIsSsmaGestorAdministrador(?CompanyMembers $member): bool 11317| private function canManageSsmaOccurrences(): bool 11435| private function canAccessSsmaSupervisorSurface(): bool
file_read
Show Details
Arguments
{"end_line": 22920, "file_path": "src/Controller/SsmaController.php", "start_line": 22770}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 22770-22920
22770| 'person_id' => null,
22771| 'person_type' => (string) ($legacyDetails['person_type'] ?? ''),
22772| 'people_ids' => json_decode((string) ($row['people_ids'] ?? '[]'), true) ?? [],
22773| 'responsible_ids' => json_decode((string) ($row['responsible_ids'] ?? '[]'), true) ?? [],
22774| 'area' => '',
22775| 'consequence' => '',
22776| 'consequence_label' => '',
22777| 'potential_consequence' => (string) ($legacyDetails['potential_consequence'] ?? ''),
22778| 'potential_severity' => (string) ($legacyDetails['potential_severity'] ?? ''),
22779| 'had_injury' => !empty($legacyDetails['had_injury']),
22780| 'injury_classification' => (string) ($legacyDetails['injury_classification'] ?? ''),
22781| 'work_leave' => (string) ($legacyDetails['work_leave'] ?? ''),
22782| 'failed_barrier' => (string) ($legacyDetails['failed_barrier'] ?? ''),
22783| 'barrier_type' => (string) ($legacyDetails['barrier_type'] ?? ''),
22784| 'deviation_type' => $deviationType,
22785| 'strategic_nature_label' => '',
22786| 'activity' => '',
22787| 'injured_person_details' => is_array($legacyDetails['injured_person_details'] ?? null)
22788| ? $legacyDetails['injured_person_details']
22789| : [],
22790| ];
22791| }
22792|
22793| // Ordena por data decrescente (mistura events + occurrences legado)
22794| usort($result, static fn (array $a, array $b): int => strcmp($b['date'], $a['date']));
22795|
22796|
22797| return $result;
22798| }
22799|
22800| /**
22801| * Escopo de equipe do painel (SSR + dashboardFilter): mesma regra de buildSsmaViewData.
22802| * Quando teams[] não vem na query, aplica getSsmaOccurrenceDashboardTeamFilterIds().
22803| *
22804| * @param list<array<string, mixed>> $occurrences
22805| * @param list<Company> $scopeCompanies
22806| * @param list<int|string> $explicitTeamIds
22807| * @param array<int, true>|null $memberIdsInTeams preenchido quando filtro aplicado
22808| *
22809| * @return list<array<string, mixed>>
22810| */
22811| private function filterOccurrencesForSsmaDashboardTeamScope(
22812| array $occurrences,
22813| ?Company $currentCompany,
22814| ?User $user,
22815| array $scopeCompanies,
22816| array $explicitTeamIds = [],
22817| ?array &$memberIdsInTeams = null,
22818| ): array {
22819| if (!$currentCompany instanceof Company || !$user instanceof User) {
22820| return $occurrences;
22821| }
22822|
22823| $useExplicit = $explicitTeamIds !== [];
22824| $autoScope = $this->getSsmaOccurrenceDashboardTeamFilterIds($currentCompany, $user);
22825|
22826| if ($useExplicit) {
22827| $teamIdsToApply = array_map('strval', $explicitTeamIds);
22828| } elseif ($autoScope === null) {
22829| return $occurrences;
22830| } else {
22831| $teamIdsToApply = array_map('strval', $autoScope);
22832| }
22833|
22834| if (!$useExplicit && $autoScope !== null && $autoScope === []) {
22835| $userTechnicalTypes = $this->resolveCurrentUserTechnicalTypes($currentCompany, $user);
22836| if ($userTechnicalTypes !== []
22837| && !$this->canManageSsmaOccurrences()
22838| && !$this->isSsmaViewer()
22839| ) {
22840| $techTypesSet = array_flip($userTechnicalTypes);
22841|
22842| return array_values(array_filter(
22843| $occurrences,
22844| static fn (array $o): bool => isset($techTypesSet[$o['type_value'] ?? ''])
22845| ));
22846| }
22847| }
22848|
22849| $teamIdStr = $teamIdsToApply;
22850| $memberIdsInTeamsOut = [];
22851| foreach ($scopeCompanies as $scopeCompany) {
22852| foreach ($this->loadTeamMemberIdsForFilter($scopeCompany, $teamIdsToApply) as $memberId => $_flag) {
22853| $memberIdsInTeamsOut[$memberId] = true;
22854| }
22855| }
22856|
22857| if (!$useExplicit && $autoScope !== null && $autoScope === []) {
22858| $member = $this->getCurrentCompanyMember($currentCompany, $user);
22859| $tag = $member ? $this->resolveSsmaProductPermissionTagForMember($member) : null;
22860| $tagName = $tag?->getName() ?? '';
22861| if (in_array($tagName, ['Supervisor de Equipe', 'Gestor de Equipe', 'Supervisor'], true)) {
22862| $selfId = (int) ($member?->getId() ?? 0);
22863| if ($selfId > 0) {
22864| $memberIdsInTeamsOut[$selfId] = true;
22865| }
22866| }
22867| }
22868|
22869| $memberIdsInTeams = $memberIdsInTeamsOut;
22870|
22871| return array_values(array_filter($occurrences, static function (array $o) use ($teamIdStr, $memberIdsInTeamsOut): bool {
22872| if ($teamIdStr !== []
22873| && isset($o['team_id'])
22874| && $o['team_id'] !== null
22875| && $o['team_id'] !== ''
22876| && in_array((string) $o['team_id'], $teamIdStr, true)
22877| ) {
22878| return true;
22879| }
22880| $managerId = (int) ($o['manager_id'] ?? 0);
22881| if ($managerId > 0 && isset($memberIdsInTeamsOut[$managerId])) {
22882| return true;
22883| }
22884| $personId = (int) ($o['person_id'] ?? 0);
22885| if ($personId > 0 && isset($memberIdsInTeamsOut[$personId])) {
22886| return true;
22887| }
22888| foreach (array_merge((array) ($o['people_ids'] ?? []), (array) ($o['responsible_ids'] ?? [])) as $p) {
22889| if (isset($memberIdsInTeamsOut[(int) $p])) {
22890| return true;
22891| }
22892| }
22893|
22894| return false;
22895| }));
22896| }
22897|
22898| /**
22899| * Retorna mapa teamId — [memberId, ...] para os teamIds selecionados, usando SQL nativo.
22900| * Usado pelo dashboardFilter para o filtro de equipe sem precisar de buildSsmaViewData.
22901| *
22902| * @param list<int|string> $teamIds
22903| *
22904| * @return array<int, true> memberId — true
22905| */
22906| private function loadTeamMemberIdsForFilter(Company $company, array $teamIds): array
22907| {
22908| if (empty($teamIds)) {
22909| return [];
22910| }
22911|
22912| $conn = $this->entityManager->getConnection();
22913| $companyId = $company->getId();
22914|
22915| // company_members.teams ?? uma string CSV com IDs de equipe
22916| $rows = $conn->executeQuery(
22917| 'SELECT id, teams FROM company_members
22918| WHERE company_id = ? AND is_removed = 0
22919| AND teams IS NOT NULL AND teams != \'\'',
22920| [$companyId]
Request #5
deepseek-v4-flash
P:28.94K C:963 CR:26.75K CW:0
7395ms
Reasoning
Interesting — line 22857 area (second block) still includes 'Supervisor' in the tag list (unmodified part?) — wait the diff only changed the first block at 22834. Let me recheck diff:
```
@@ -22915,8 +22833,10 @@ SQL;
if (!$useExplicit && $autoScope !== null && $autoScope === []) {
$userTechnicalTypes = $this->resolveCurrentUserTechnicalTypes($currentCompany, $user);
- // Mesma regra do hub: tipos técnicos com escopo [] — ignora canManage de plataforma.
- if ($userTechnicalTypes !== [] && !$this->isSsmaViewer()) {
+ if ($userTechnicalTypes !== []
+ && !$this->canManageSsmaOccurrences()
+ && !$this->isSsmaViewer()
+ ) {
```
Wait — hmm. Actually there were two occurrences of `if (!$useExplicit && $autoScope !== null && $autoScope === []) {` — at 22834 and 22857. The diff hunk context at 22833 shows only one changed block. So 22857 block remains unchanged.
Wait, but earlier search shows matches at lines 22834 and 22857. The second (22857) is inside the `filterOccurrencesForSsmaDashboardTeamScope` — no wait, both are in the same method? Let me re-check: line 22857 block references `$memberIdsInTeamsOut[$selfId]` and tag names 'Supervisor de Equipe','Gestor de Equipe','Supervisor'. Yes it's the second block in the same method (adding self for team supervisors with empty team scope).
Now, the important part: for the empty autoScope with tech types, previously tech specialists with empty team scope AND `canManage` were filtered by type. Now if user has canManage, this branch doesn't return the type-filtered occurrences, and it falls through to `$teamIdStr = []`... wait no, `$teamIdsToApply` = [] so `$teamIdStr = []`. Then filters by memberIdsInTeamsOut (empty unless team supervisor tags) — occurrences would be filtered to only those where manager/people are in empty set → nothing. Wait, actually when teamIdStr is [], and memberIdsInTeamsOut empty, filter yields false for all rows → occurrences list becomes empty.
But the question remains: can a user who is `canManageSsmaOccurrences() === true` reach this method with `$autoScope === []`? getSsmaOccurrenceDashboardTeamFilterIds returns [] only for members with tag (not admin/team tags), parsed teams = [], technical types present. canManageSsmaOccurrences presumably is true for Gestor Administrador tag or platform admin ROLE_MANAGER or maybe the member tag has can_create. The removed comment said "ignora canManage de plataforma" and "can_create na tag Membro / ROLE de plataforma não pode esconder ocorrências dos tipos associados". So there was a scenario where a member with tag Membro had can_create (i.e., SsmaPermissionTagMember may include can_create?) or platform ROLE... hmm.
Wait — canManageSsmaOccurrences() definition needed. Let me read 11317 and 10068 and 10645 and 11435.
Tool Calls (3)
file_read
Show Details
Arguments
{"end_line": 10100, "file_path": "src/Controller/SsmaController.php", "start_line": 10060}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 10060-10100
10060| $payload['inspection']['can_mutate'] = $this->canMutateExistingInspection($inspection, $company, $user);
10061| } catch (\Throwable $e) {
10062| // Persistiu; o front recarrega se o payload de UI falhar.
10063| }
10064|
10065| return new JsonResponse($payload);
10066| }
10067|
10068| private function isSsmaViewer(): bool
10069| {
10070| $tag = null;
10071| $user = $this->getUser();
10072| $member = null;
10073| if ($user instanceof User) {
10074| $company = $this->getSsmaCompany() ?? $user->getCompany();
10075| $member = $company instanceof Company ? $this->getCurrentCompanyMember($company, $user) : null;
10076| if ($this->memberIsSsmaGestorAdministrador($member)) {
10077| return false;
10078| }
10079| if ($member) {
10080| $tag = $this->resolveSsmaProductPermissionTagForMember($member);
10081| }
10082| }
10083|
10084| // Supervisor global via Symfony role
10085| if ($this->isGranted('ROLE_MANAGER_VIEWER')
10086| && !$this->isGranted('ROLE_MANAGER')
10087| && !$this->isGranted('ROLE_MANAGER_GESTOR')
10088| && !$this->isGranted('ROLE_SUPER_ADMIN')
10089| ) {
10090| return true;
10091| }
10092|
10093| // Supervisor via tag SSMA de produto (can_view=true, sem permissões de escrita).
10094| // Cobre tags como "Supervisor" ou qualquer tag com can_view=1 e can_create/edit/delete=0,
10095| // atribuídas diretamente ao produto SSMA sem alterar a role global do usuário.
10096| //
10097| // IMPORTANTE: verificar a PermissionTag real da DB (não só os request attributes).
10098| // setSsmaTechnicalOccurrenceAttributes() define can_view=true nos attributes para stakeholders/técnicos
10099| // cujo PermissionTag real tem can_view=false. Esses usuários NÃO são viewers reais — são membros
10100| // com acesso técnico especial. Se só checássemos os attributes, eles bypassariam o filtro de membro.
file_read
Show Details
Arguments
{"end_line": 10690, "file_path": "src/Controller/SsmaController.php", "start_line": 10640}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 10640-10690
10640|
10641| /**
10642| * Gestor Administrador no produto Ocorrências (PTBM), inclusive quando a heurística
10643| * SSMA ainda resolveria Membro por herança/propagação (regressão Mauro/Palloma).
10644| */
10645| private function memberIsSsmaGestorAdministrador(?CompanyMembers $member): bool
10646| {
10647| if (!$member instanceof CompanyMembers) {
10648| return false;
10649| }
10650|
10651| $memberId = (int) $member->getId();
10652| if ($memberId > 0 && array_key_exists($memberId, $this->memberIsSsmaGestorAdministradorCache)) {
10653| return $this->memberIsSsmaGestorAdministradorCache[$memberId];
10654| }
10655|
10656| $isGestorAdministrador = false;
10657| if ($this->isSsmaGestorAdministradorTag($this->resolveSsmaProductPermissionTagForMember($member))) {
10658| $isGestorAdministrador = true;
10659| } else {
10660| try {
10661| $occProduct = $this->resolveSsmaOccurrencesProductForPermission();
10662| if ($occProduct instanceof \App\Entity\Product) {
10663| $occTag = $this->permissionTagByMemberService->getPermissionTag($member, $occProduct);
10664| if ($this->isSsmaGestorAdministradorTag($occTag)) {
10665| $isGestorAdministrador = true;
10666| }
10667| }
10668| } catch (\Throwable) {
10669| }
10670| }
10671|
10672| if ($memberId > 0) {
10673| $this->memberIsSsmaGestorAdministradorCache[$memberId] = $isGestorAdministrador;
10674| }
10675|
10676| return $isGestorAdministrador;
10677| }
10678|
10679| private function resolveSsmaOccurrencesProductForPermission(): ?\App\Entity\Product
10680| {
10681| if ($this->ssmaOccurrencesProductForPermissionResolved) {
10682| return $this->ssmaOccurrencesProductForPermissionCache;
10683| }
10684|
10685| $this->ssmaOccurrencesProductForPermissionResolved = true;
10686|
10687| try {
10688| $product = $this->entityManager
10689| ->getRepository(\App\Entity\Product::class)
10690| ->findOneBy(['slug' => 'ssma-occurrences']);
file_read
Show Details
Arguments
{"end_line": 11480, "file_path": "src/Controller/SsmaController.php", "start_line": 11315}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 11315-11480
11315| }
11316|
11317| private function canManageSsmaOccurrences(): bool
11318| {
11319| $user = $this->getUser();
11320| $company = $this->getSsmaCompany() ?? ($user instanceof User ? $user->getCompany() : null);
11321| if ($user instanceof User && $company instanceof Company
11322| && $this->shouldStripSsmaManagementUiForUser($company, $user)) {
11323| return false;
11324| }
11325|
11326| if (
11327| $this->isGranted('ROLE_SUPER_ADMIN')
11328| || $this->isGranted('ROLE_MANAGER')
11329| || $this->isGranted('ROLE_MANAGER_GESTOR')
11330| || $this->isGranted('ROLE_TENANT')
11331| ) {
11332| return true;
11333| }
11334|
11335| $member = null;
11336| if ($user instanceof User) {
11337| $company = $this->getSsmaCompany() ?? $user->getCompany();
11338| if ($company instanceof Company) {
11339| $member = $this->getCurrentCompanyMember($company, $user);
11340| }
11341| }
11342| if ($this->memberIsSsmaGestorAdministrador($member)) {
11343| return true;
11344| }
11345|
11346| $tag = $this->ssmaCurrentMemberPermissionTag();
11347|
11348| $request = $this->requestStack->getCurrentRequest();
11349| if ($request && (
11350| (bool) $request->attributes->get('can_create', false)
11351| || (bool) $request->attributes->get('can_edit', false)
11352| || (bool) $request->attributes->get('can_delete', false)
11353| )) {
11354| return true;
11355| }
11356|
11357| if (!$tag) {
11358| return false;
11359| }
11360|
11361| return (bool) ($tag->getCanCreate() ?? false)
11362| || (bool) ($tag->getCanEdit() ?? false)
11363| || (bool) ($tag->getCanDelete() ?? false);
11364| }
11365|
11366| /**
11367| * Edição no detalhe (UI + API legada createOccurrence edit + updateEvent).
11368| * Tenant/super admin e admin de aprofundamento (Gestor Administrador) editam tudo.
11369| */
11370| private function canEditSsmaOccurrenceDetail(): bool
11371| {
11372| $user = $this->getUser();
11373| $company = $user instanceof User ? $user->getCompany() : null;
11374| if ($user instanceof User && $this->isSsmaAprofundamentoAdmin($company, $user)) {
11375| return true;
11376| }
11377|
11378| return SsmaOccurrenceCreatePermissionService::canEditOccurrenceDetail(
11379| $this->isGranted('ROLE_SUPER_ADMIN'),
11380| $this->isGranted('ROLE_TENANT'),
11381| );
11382| }
11383|
11384| /**
11385| * Permissão padrão do Membro: registrar a PRÓPRIA ocorrência.
11386| *
11387| * Diferente de canManageSsmaOccurrences() (que também habilita editar/excluir/resolver),
11388| * esta capacidade libera apenas a CRIAÇÃO para o membro comum da empresa que tem acesso
11389| * à área de ocorrências. Supervisores (somente leitura) ficam de fora; gestores/admins
11390| * já são cobertos por canManageSsmaOccurrences().
11391| */
11392| private function canMemberRegisterOwnOccurrence(?Company $company, ?User $user): bool
11393| {
11394| if (!$company || !$user) {
11395| return false;
11396| }
11397|
11398| if ($this->canManageSsmaOccurrences()) {
11399| return true;
11400| }
11401|
11402| // Supervisores são somente leitura (planilha SSMA).
11403| if ($this->isSsmaViewer()) {
11404| return false;
11405| }
11406|
11407| return $this->getCurrentCompanyMember($company, $user) !== null;
11408| }
11409|
11410| private function canCreateSsmaOccurrenceType(string $typeKey): bool
11411| {
11412| /** @var \App\Entity\User|null $user */
11413| $user = $this->getUser();
11414| $company = $user?->getCompany();
11415| if (!$user || !$company) {
11416| return false;
11417| }
11418|
11419| $member = $this->getCurrentCompanyMember($company, $user);
11420|
11421| return $this->ssmaOccurrenceCreatePermissionService->canCreateOccurrenceType(
11422| $member,
11423| $user,
11424| $company,
11425| $typeKey,
11426| $this->canManageSsmaOccurrences(),
11427| );
11428| }
11429|
11430| private function canManageSsmaPermissions(): bool
11431| {
11432| return $this->isGranted('ROLE_SUPER_ADMIN') || $this->isGranted('ROLE_MANAGER');
11433| }
11434|
11435| private function canAccessSsmaSupervisorSurface(): bool
11436| {
11437| return $this->canManageSsmaOccurrences() || $this->isSsmaViewer();
11438| }
11439|
11440| /**
11441| * Criar/editar Plano de Ação: gestor/admin.
11442| * Supervisor (viewer ou tag Supervisor*) só visualiza dash/painel — Brenda áudio 6.
11443| * Gestor de Equipe/Área continua podendo mutar.
11444| */
11445| private function canMutateSsmaActionPlan(): bool
11446| {
11447| if ($this->isSsmaViewer()) {
11448| return false;
11449| }
11450|
11451| $tagName = $this->ssmaCurrentMemberPermissionTag()?->getName();
11452| if (in_array($tagName, [
11453| 'Supervisor de Equipe',
11454| 'Supervisor',
11455| SsmaAreaLimitationScope::TAG_SUPERVISOR_AREA,
11456| ], true)) {
11457| return false;
11458| }
11459|
11460| return $this->canManageSsmaOccurrences();
11461| }
11462|
11463| /**
11464| * Abas "Painel" e "Metas" em Prevenção Ativa: apenas perfis de supervisão/gestão na empresa.
11465| * Não usar {@see canAccessSsmaSupervisorSurface()} aqui: ele inclui Membro com can_create na tag
11466| * ssma-prevention (para registrar inspeção/abordagem), e na planilha Membro não acessa Painel/Metas.
11467| */
11468| private function canAccessPreventionDashboardAndMetasTabs(): bool
11469| {
11470| return $this->isGranted('ROLE_SUPER_ADMIN')
11471| || $this->isGranted('ROLE_MANAGER')
11472| || $this->isGranted('ROLE_MANAGER_GESTOR')
11473| || $this->isSsmaViewer();
11474| }
11475|
11476| /**
11477| * Palloma: ROLE_USER + tag Membro/Inspetor → strip de gestão (mesmo com ROLE_MANAGER de plataforma).
11478| * Aura: ROLE_MANAGER sem ROLE_USER + tag Membro → mantém gestão (retorna false aqui).
11479| */
11480| private function shouldStripSsmaManagementUiForUser(Company $company, User $user): bool
Request #6
deepseek-v4-flash
P:33.25K C:1.49K CR:29.82K CW:0
12866ms
Reasoning
Key insight: `canManageSsmaOccurrences()` returns true also when the **request attributes** `can_create`/`can_edit`/`can_delete` are set OR when the member's tag has can_create/can_edit/can_delete — even for tag "Membro" (a member with can_create tag = Membro with write access). That's exactly what the removed comments said: "can_create na tag Membro / ROLE_* de plataforma não pode zerar a lista quando o escopo de equipe é [] (técnico por tipo)".
So: a member with tag "Membro" that has can_create (write capability) and technical type, with no team parsed (parsed=[]), getSsmaOccurrenceDashboardTeamFilterIds returns [] (because tag exists, parsed [], tech types non-empty). Now with the new condition requiring `!$this->canManageSsmaOccurrences()`, if that same member has can_create=true on tag (making canManage true via request attributes or tag), the tech-specialist branch is skipped and occurrences get filtered by empty team scope → zero. Wait, but the request attributes `can_create` are set per route. On hub/dashboard routes, does the attribute get set? The old comment says "can_create de Membro / ROLE_* de plataforma" — ROLE_MANAGER platform returns null from getSsmaOccurrenceDashboardTeamFilterIds (because early return for ROLE_SUPER_ADMIN/ROLE_MANAGER). So platform managers never see [] autoScope. But a member with can_create tag and empty team scope would hit canManage = true (via tag can_create) and autoScope = []. Then previously they were included in isTechSpecialistOnly → type filter. Now they are excluded → team filter with empty scope → memberIdsInTeams empty (they aren't team supervisor) → nothing shown. That is a regression scenario: "Membro com can_create na tag" + type técnico + sem equipe → perde a lista de ocorrências do hub/dashboard.
Hold on: but for such a member, would they normally have technical types set? The `getSsmaOccurrenceDashboardTeamFilterIds` branch returning [] requires `resolveCurrentUserTechnicalTypes !== []`. So this is the "tech specialist" profile who ALSO has can_create on tag. Per the removed comments, that's precisely the case the code was meant to protect: "can_create na tag Membro / ROLE de plataforma não pode esconder ocorrências dos tipos associados ao aprofundamento."
Hmm, but this PR's intent — presumably — was to align permission so that managers see everything (no team filter empty zeroing) and plain members with technical types still filter by type. But the change to require `!canManage` means the "member with can_create" loses the special-case and falls into the empty-team-scope filter (which zeroes).
But wait: we should double check whether that case actually reaches these code paths. In the dashboard view build (`buildSsmaViewData`?), the earlier code at line 12506 in the paged branch and the one at 12887 in the filter block, and 22834 in `filterOccurrencesForSsmaDashboardTeamScope`. Also we need to understand where else post-filter `!$canManageEarly ...` line 12512: `(!$canManageEarly && !$isViewerEarly && $teamFilterEarly === null && !$isTechEarly)` implies when teamFilterEarly === null and user not manage/viewer, they need post-filter (filterOccurrencesForMember). For a canManage user with teamFilter null → no post filter → full list.
But in the isTechEarly block: with canManage true and teamFilterEarly = [] (only possible for member-tag can_create case), needsOccurrencePostFilter computed true (since teamFilterEarly !== null && !isTechEarly) → loads all occurrences then post-filter by team... let me look at what the post filter does after loading (line 12920 onward). Actually the isTechEarly at 12506-12512 affects only paging behavior. Then later (line ~12675), the occurrences are filtered by `filterOccurrencesForSsmaDashboardTeamScope`? Let's read lines 12650-13000 to see how the tech filter happens for the SSR hub (the actual filtering). We need to see where `$occurrenceTeamFilterIds` set and `$isTechSpecialistOnly` used.
Let me read 12650-13100.
Also, we need to determine the reality of `$company` bug. Wait — actually, let me double-check: maybe the removed code created `$company` local variable; new code uses `$company` which was previously local inside the if block; outside the if block, in the method resolveSsmaEvent, `$company` is not defined. Let me search the method again from 7871 to see the entire method, from start. We already read 7830-7920. The method starts at 7871. Before the try at 7889, code defines $user, $companyId, $event. `$company` not defined. So `$this->maybeSubmitOccurrenceForValidation($event, $company, $user)` → undefined variable `$company` → null → TypeError (Company param). Caught by catch Throwable → returns 500 "Erro ao finalizar ocorrência." while event was already persisted as finalizado (the flush happened before). This breaks finalization UX and validation submission. High severity bug. Definitely report.
Wait — could `$company` be an instance property or from `$this`? No, it's a local var usage. Could the file declare strict? Even so it throws TypeError. So yes, bug.
Actually wait: is it possible this `resolveSsmaEvent` method isn't the only candidate? The diff hunk shows line 7909-7912, which we mapped to `resolveSsmaEvent`. Yes.
Now, do I confirm the `$company` variable? Let me re-read the method start at 7871. Already did: 7871-7918. There is no `$company` assignment. Let me double-check maybe there's `$company` assignment between 7889-7912? We saw lines 7889-7918 fully; no `$company`. OK confirmed.
Now let's read the hub view section 12640-13120 to evaluate the technical specialist logic effect, particularly the effect for canManage users and empty team scope.
Tool Calls (1)
file_read
Show Details
Arguments
{"end_line": 13120, "file_path": "src/Controller/SsmaController.php", "start_line": 12650}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 12650-13120
12650| // Reutiliza $ssmaProductTagName (já corrigido por memberIsSsmaGestorAdministrador).
12651| $ssmaProductTagNameForRegister = $ssmaProductTagName;
12652| $ssmaCanRegisterNewOccurrence = $this->isGranted('ROLE_SUPER_ADMIN')
12653| || $this->isGranted('ROLE_MANAGER')
12654| || $this->isGranted('ROLE_MANAGER_GESTOR')
12655| || \in_array($ssmaProductTagNameForRegister, ['Gestor de Equipe', 'Gestor Administrador'], true)
12656| // Permissão padrão do Membro: registrar a própria ocorrência.
12657| || $this->canMemberRegisterOwnOccurrence($company, $user);
12658|
12659| $loggedMemberForOccurrence = ($company && $user instanceof User)
12660| ? $this->getCurrentCompanyMember($company, $user)
12661| : null;
12662| $ssmaAllowedCreateTypes = ($company && $user instanceof User)
12663| ? $this->ssmaOccurrenceCreatePermissionService->resolveAllowedCreateTypes(
12664| $loggedMemberForOccurrence,
12665| $user,
12666| $company,
12667| $this->ssmaOccurrenceTypeConfig->getAllowedTypeKeys($company),
12668| $ssmaCanManageOccurrences,
12669| )
12670| : [];
12671| if (!$ssmaCanRegisterNewOccurrence && $ssmaAllowedCreateTypes !== []) {
12672| $ssmaCanRegisterNewOccurrence = true;
12673| }
12674|
12675| $occurrenceTeamFilterIds = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user);
12676| $areaScope = $this->getSsmaPreventionAreaScope($company, $user);
12677| $occurrenceAreaFilterIds = $areaScope->isRestricted() ? $areaScope->areaIds() : null;
12678| $viewerTeamIds = $this->getSsmaViewerTeamIds();
12679|
12680| // ── Detecção de Supervisor/Gestor de Equipe via tag SSMA ──────────────────────────────
12681| // Usuários com ROLE_USER + tag SSMA (sem ROLE_MANAGER_VIEWER global) não são detectados pelas
12682| // funções baseadas em role. Identificamos o perfil pelo nome da tag para ajustar flags de UI.
12683| $ssmaIsTagTeamSupervisor = in_array($ssmaProductTagName, ['Supervisor de Equipe', 'Supervisor'], true);
12684| $ssmaIsTagTeamGestor = $ssmaProductTagName === 'Gestor de Equipe';
12685| $ssmaIsTagAreaSupervisor = $ssmaProductTagName === SsmaAreaLimitationScope::TAG_SUPERVISOR_AREA;
12686| $ssmaIsTagAreaGestor = $ssmaProductTagName === SsmaAreaLimitationScope::TAG_GESTOR_AREA;
12687| $ssmaIsPreventionTagTeamSupervisor = in_array($ssmaPreventionProductTagName, ['Supervisor de Equipe', 'Supervisor'], true);
12688| $ssmaIsPreventionTagTeamGestor = $ssmaPreventionProductTagName === 'Gestor de Equipe';
12689|
12690| // Painel + Metas: libera para Sup/G. de Equipe/Área e Gestor Administrador (ocorrências + ssma-prevention)
12691| if (!$ssmaCanAccessPreventionPanelAndMetas
12692| && (
12693| $ssmaIsTagTeamSupervisor
12694| || $ssmaIsTagTeamGestor
12695| || $ssmaIsTagAreaSupervisor
12696| || $ssmaIsTagAreaGestor
12697| || $ssmaProductTagName === 'Gestor Administrador'
12698| || $ssmaIsPreventionTagTeamSupervisor
12699| || $ssmaIsPreventionTagTeamGestor
12700| || $ssmaPreventionProductTagName === 'Gestor Administrador'
12701| )
12702| ) {
12703| $ssmaCanAccessPreventionPanelAndMetas = true;
12704| }
12705|
12706| // Membro/Inspetor (pessoa física / Palloma): não acessa Painel nem Metas.
12707| // Conta admin empresa sem ROLE_USER (Aura), Tenant e SUPER_ADMIN mantêm — mesmo contrato das abas de Ocorrências.
12708| if (SsmaOccurrenceCreatePermissionService::shouldStripOccurrenceManagementTabsUi(
12709| $ssmaProductTagName,
12710| $this->isGranted('ROLE_SUPER_ADMIN'),
12711| $this->isGranted('ROLE_TENANT'),
12712| $user instanceof User && in_array('ROLE_USER', $user->getRoles(), true)
12713| )) {
12714| $ssmaCanAccessPreventionPanelAndMetas = false;
12715| }
12716|
12717| // Modal + Evento: título/status ocultos na criação para todos os perfis (Figma Etapa 0).
12718| // Na edição o JS (evApplyAuraTitleStatusVisibility) reexibe conforme o modo.
12719| $ssmaHideEventTitleStatusOnCreate = true;
12720|
12721| // ssmaIsTeamViewer: true quando o usuário opera com escopo de equipe (via role SSMA OU via tag SSMA)
12722| // Usado para sinalizar ao template que os dados estáo limitados ?? equipe.
12723| $ssmaIsTeamViewerFlag = $viewerTeamIds !== null || $ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor
12724| || $ssmaIsTagAreaSupervisor || $ssmaIsTagAreaGestor;
12725|
12726| // ssmaCanCreatePreventionItems: Gestor de Equipe/Área e Gestor Administrador via tag SSMA
12727| // também podem registrar inspeções/abordagens (ssmaCanManageOccurrences = true via tag).
12728| $ssmaCanCreatePreventionItems = (
12729| $this->isGranted('ROLE_SUPER_ADMIN')
12730| || $this->isGranted('ROLE_MANAGER')
12731| || $this->isGranted('ROLE_MANAGER_GESTOR')
12732| || (
12733| $ssmaCanManageOccurrences
12734| && ($ssmaIsTagTeamGestor || $ssmaIsTagAreaGestor || $ssmaProductTagName === 'Gestor Administrador')
12735| )
12736| );
12737|
12738| // ssmaCanEditPreventionContent: controla botões Editar/Finalizar/Deletar em inspeções e abordagens
12739| // e o botão "Configuração" na aba Metas.
12740| // Supervisor registra/edita o próprio conteúdo (can_mutate por item); gestão edita todos.
12741| $ssmaCanEditPreventionContent = $ssmaCanManageOccurrences
12742| && !$this->isSsmaViewer()
12743| && !$ssmaIsTagTeamSupervisor
12744| && !$ssmaIsTagAreaSupervisor;
12745| $ssmaPreventionMutateOwnOnly = false;
12746|
12747| // Configurações da aba Prevenção Ativa: Sup/Gestor de Equipe ou Área não acessam (planilha: "Não acessa")
12748| if ($ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor || $ssmaIsTagAreaSupervisor || $ssmaIsTagAreaGestor) {
12749| $ssmaCanManageConfig = false;
12750| }
12751|
12752| // G. Equipe via tag SSMA pode criar ação (Plano de Ação).
12753| // Árvore de causas: {@see canCreateSsmaCauseTree()} já cobre Gestor de Equipe.
12754| if ($ssmaIsTagTeamGestor || $ssmaIsTagAreaGestor) {
12755| $ssmaCanCreateLinkedActions = true;
12756| $ssmaCanMutateActionPlan = true;
12757| }
12758|
12759| // Tabela de metas por pessoa (aba Metas): edição global só para gestão; membro com can_create não gere metas alheias.
12760| $ssmaCanEditPreventionMetasTable = $company && $user instanceof User
12761| && $this->canEditPreventionMetasTableForCurrentUser($company, $user);
12762|
12763| // ssmaPreventionCanCreateLinkedActions: botão "Criar ação" em Inspeções e Abordagem.
12764| // Alinhado com ssmaCanCreateLinkedActions (Plano de Ações): quem não pode criar
12765| // ação no Plano de Ações também não pode criar em inspeção/abordagem/árvore.
12766| $ssmaPreventionCanCreateLinkedActions = $ssmaCanCreateLinkedActions;
12767|
12768| $teamsForEventModal = $teams;
12769| $allMembersForEventPeople = $allMembers;
12770| $gestoresForEventModal = $company
12771| ? $this->buildSsmaEventModalGestores($company, $allMembers, $gestores, null)
12772| : $gestores;
12773|
12774| $ssmaEventFormDefaults = ['manager_id' => null, 'team_id' => null];
12775| $applyTeamEventScope = $occurrenceTeamFilterIds !== null && $occurrenceTeamFilterIds !== [];
12776|
12777| // Supervisor/Gestor de Equipe: filtra modais pelas equipes do cadastro (lista vazia = sem equipe — não zera selects).
12778| if ($applyTeamEventScope) {
12779| $teamIdStrScope = array_map('strval', $occurrenceTeamFilterIds);
12780| $teamsForEventModal = array_values(array_filter(
12781| $teams,
12782| static fn (array $t): bool => in_array((string) ($t['id'] ?? ''), $teamIdStrScope, true)
12783| ));
12784| $allowedMemberMap = $this->collectCompanyMemberIdsBelongingToCompanyTeams($company, $occurrenceTeamFilterIds);
12785| $allMembersForEventPeople = array_values(array_filter(
12786| $allMembers,
12787| static fn (array $m): bool => isset($allowedMemberMap[(int) ($m['id'] ?? 0)])
12788| ));
12789| // Gestor responsável: escopo da empresa (tags/roles), não só membros da equipe do supervisor
12790| $gestoresForEventModal = $this->buildSsmaEventModalGestores(
12791| $company,
12792| $allMembers,
12793| $gestores,
12794| null
12795| );
12796| $ssmaEventFormDefaults['team_id'] = (int) $occurrenceTeamFilterIds[0];
12797| $currentMemberForDefaults = $this->getCurrentCompanyMember($company, $user);
12798| $currentMemberIdForDefaults = (int) ($currentMemberForDefaults?->getId() ?? 0);
12799| if ($currentMemberIdForDefaults > 0) {
12800| foreach ($gestoresForEventModal as $gRow) {
12801| if ((int) ($gRow['id'] ?? 0) === $currentMemberIdForDefaults) {
12802| $ssmaEventFormDefaults['manager_id'] = $currentMemberIdForDefaults;
12803| break;
12804| }
12805| }
12806| }
12807| }
12808|
12809| if ($occurrenceAreaFilterIds !== null) {
12810| $areaMemberIds = $areaScope->allowedMemberIds();
12811| $teamsForEventModal = array_values(array_filter(
12812| $teamsForEventModal,
12813| static fn (array $t): bool => $areaScope->allowsTeam((int) ($t['id'] ?? 0))
12814| ));
12815| $allMembersForEventPeople = array_values(array_filter(
12816| $allMembersForEventPeople,
12817| static fn (array $m): bool => isset($areaMemberIds[(int) ($m['id'] ?? 0)])
12818| ));
12819| $gestoresForEventModal = array_values(array_filter(
12820| $gestoresForEventModal,
12821| static fn (array $m): bool => isset($areaMemberIds[(int) ($m['id'] ?? 0)])
12822| ));
12823| $applyTeamEventScope = true;
12824| if ($teamsForEventModal !== []) {
12825| $ssmaEventFormDefaults['team_id'] = (int) ($teamsForEventModal[0]['id'] ?? 0) ?: $ssmaEventFormDefaults['team_id'];
12826| }
12827| }
12828|
12829| // Fallback final: gestor responsável usa escopo da empresa (não só equipe do supervisor).
12830| if ($gestoresForEventModal === [] && $occurrenceAreaFilterIds === null) {
12831| $gestoresForEventModal = $allMembers !== [] ? $allMembers : $allMembersForEventPeople;
12832| }
12833| if ($gestores === [] && $allMembers !== []) {
12834| $gestores = $allMembers;
12835| }
12836| if ($company && $gestoresForEventModal === [] && $occurrenceAreaFilterIds === null) {
12837| $gestoresForEventModal = $this->mergeGestoresFromOccurrenceManagerIds(
12838| $company,
12839| $allMembers,
12840| $occurrences,
12841| $gestoresForEventModal
12842| );
12843| }
12844| $gestoresForEventModal = $this->enrichSsmaMemberRowsWithTeamMeta(
12845| $gestoresForEventModal,
12846| $teamNameByMemberId ?? []
12847| );
12848|
12849|
12850| // Inspeção — equipe no modal: gestão vê escopo/lista completa; Membro só suas equipes (auto se uma).
12851| // Mesmo contrato Palloma vs Aura das abas: tenant/SUPER_ADMIN/ROLE_MANAGER sem ROLE_USER
12852| // com tag Membro não entram no recorte de pessoa física.
12853| $teamsForInspectionModal = $applyTeamEventScope ? $teamsForEventModal : $teams;
12854| $defaultInspectionTeamId = null;
12855| $ssmaIsPlainPreventionMember = $ssmaIsPlainProductMemberUi
12856| && !$this->memberIsSsmaGestorAdministrador($memberForTagCheck);
12857| if ($ssmaIsPlainPreventionMember && $company && $user instanceof User) {
12858| $plainMemberRow = $this->getCurrentCompanyMember($company, $user);
12859| $plainMemberTeamIds = $plainMemberRow ? $this->parseCompanyMemberTeamIds($plainMemberRow) : [];
12860| if ($plainMemberTeamIds !== []) {
12861| $plainTeamIdStr = array_map('strval', $plainMemberTeamIds);
12862| $teamsForInspectionModal = array_values(array_filter(
12863| $teams,
12864| static fn (array $t): bool => in_array((string) ($t['id'] ?? ''), $plainTeamIdStr, true)
12865| && $areaScope->allowsTeam((int) ($t['id'] ?? 0))
12866| ));
12867| if (count($plainMemberTeamIds) === 1) {
12868| $defaultInspectionTeamId = (int) $plainMemberTeamIds[0];
12869| }
12870| } else {
12871| $teamsForInspectionModal = [];
12872| }
12873| } elseif ($applyTeamEventScope && $teamsForInspectionModal !== []) {
12874| $defaultInspectionTeamId = (int) ($ssmaEventFormDefaults['team_id'] ?? 0) ?: null;
12875| if ($defaultInspectionTeamId === null && count($teamsForInspectionModal) === 1) {
12876| $defaultInspectionTeamId = (int) ($teamsForInspectionModal[0]['id'] ?? 0) ?: null;
12877| }
12878| }
12879| usort($teamsForInspectionModal, static function (array $a, array $b): int {
12880| return strcasecmp((string) ($a['name'] ?? ''), (string) ($b['name'] ?? ''));
12881| });
12882|
12883| // Técnico especialista SSMA: tem SsmaPermissionTagMember mas sem gestão ou supervisão de equipe.
12884| // O scope retornado por getSsmaOccurrenceDashboardTeamFilterIds ?? [] (sem equipe atribuída no produto),
12885| // o que zeraria todas as ocorrências se o filtro de equipe fosse aplicado.
12886| // Em vez disso, aplicamos um filtro por tipo de ocorrência após o bloco de equipe.
12887| $isTechSpecialistOnly = !$ssmaCanManageOccurrences
12888| && !$this->isSsmaViewer()
12889| && $occurrenceTeamFilterIds === []
12890| && !empty($userTechnicalTypes);
12891|
12892| if ($occurrenceTeamFilterIds !== null && !$isTechSpecialistOnly) {
12893| $teamIdStr = array_map('strval', $occurrenceTeamFilterIds);
12894|
12895| // Coleta IDs de membros pertencentes às equipes do viewer
12896| $memberIdsInTeams = [];
12897| foreach ($teams as $team) {
12898| if (in_array((string) ($team['id'] ?? ''), $teamIdStr, true)) {
12899| foreach ($team['members'] ?? [] as $mid) {
12900| $memberIdsInTeams[(int) $mid] = true;
12901| }
12902| }
12903| }
12904|
12905| // Supervisor/Gestor de Equipe sem equipe atribuída: ainda deve ver ocorrências onde ??
12906| // pessoalmente gestor responsável ou pessoa envolvida (regra da planilha SSMA).
12907| // Sem esse ajuste, memberIdsInTeams ficaria vazio e o filtro de manager_id/people_ids
12908| // nunca passaria — o supervisor não veria nada, mesmo sendo o responsável da ocorrência.
12909| if ($occurrenceTeamFilterIds === [] && ($ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor)) {
12910| $selfMember = $this->getCurrentCompanyMember($company, $user);
12911| $selfMemberId = (int) ($selfMember?->getId() ?? 0);
12912| if ($selfMemberId > 0) {
12913| $memberIdsInTeams[$selfMemberId] = true;
12914| }
12915| }
12916|
12917| // Ocorrências: por team_id direto OU por manager_id/people_ids/responsible_ids pertencente ?? equipe.
12918| // Supervisor de Equipe deve ver ocorrências onde ?? gestor responsável ou pessoa envolvida,
12919| // mesmo que o team_id da ocorrência não esteja preenchido ou difira do escopo.
12920| $occurrences = array_values(array_filter($occurrences, static function (array $o) use ($teamIdStr, $memberIdsInTeams): bool {
12921| if (isset($o['team_id']) && $o['team_id'] !== null && in_array((string) $o['team_id'], $teamIdStr, true)) {
12922| return true;
12923| }
12924| $managerId = (int) ($o['manager_id'] ?? 0);
12925| if ($managerId > 0 && isset($memberIdsInTeams[$managerId])) {
12926| return true;
12927| }
12928| $personId = (int) ($o['person_id'] ?? 0);
12929| if ($personId > 0 && isset($memberIdsInTeams[$personId])) {
12930| return true;
12931| }
12932| foreach (array_merge((array) ($o['people_ids'] ?? []), (array) ($o['responsible_ids'] ?? [])) as $p) {
12933| if (isset($memberIdsInTeams[(int) $p])) {
12934| return true;
12935| }
12936| }
12937| return false;
12938| }));
12939|
12940| // Inspeções: por team_id
12941| $inspections = array_values(array_filter($inspections, static function (array $i) use ($teamIdStr): bool {
12942| $tid = $i['team_id'] ?? null;
12943| return $tid !== null && $tid !== '' && in_array((string) $tid, $teamIdStr, true);
12944| }));
12945|
12946| // Abordagens: por observador pertencente ?? equipe
12947| $abordagens = array_values(array_filter($abordagens, static function (array $ab) use ($memberIdsInTeams): bool {
12948| $obsId = (int) ($ab['observador_id'] ?? 0);
12949| return $obsId > 0 && isset($memberIdsInTeams[$obsId]);
12950| }));
12951|
12952| // Plano de Ação: ações em que pelo menos um responsável pertence ao escopo da equipe
12953| // (não todas as ações das ocorrências visíveis da equipe).
12954| $actionsTaken = $this->filterActionsByResponsibleMemberIds($actionsTaken, $memberIdsInTeams);
12955| }
12956|
12957| if ($occurrenceAreaFilterIds !== null) {
12958| $areaMemberIds = $areaScope->allowedMemberIds();
12959| // Equipe com área fora do recorte esconde a inspeção mesmo com participante interno:
12960| // é o que mantém a interseção quando team_limitation e area_limitation estão juntos.
12961| $inspections = SsmaAreaLimitationScope::filterInspectionsForAreaScope(
12962| $inspections,
12963| $areaScope->allowedTeamIds(),
12964| $areaMemberIds,
12965| $areaScope->teamIdsWithoutArea()
12966| );
12967| $abordagens = SsmaAreaLimitationScope::filterAbordagensByMemberIds(
12968| $abordagens,
12969| $areaMemberIds
12970| );
12971| // Mesmo critério da limitação de equipe: plano de ação só com responsável no recorte.
12972| $actionsTaken = $this->filterActionsByResponsibleMemberIds($actionsTaken, $areaMemberIds);
12973| }
12974|
12975| // Técnico especialista: filtra ocorrências pelos tipos que têm autorização técnica (SsmaPermissionTagMember).
12976| // Inspeções/Abordagens/Ações não são filtradas por equipe; o técnico não tem equipe SSMA atribuída.
12977| if ($isTechSpecialistOnly) {
12978| $techTypesSet = array_flip($userTechnicalTypes);
12979| $occurrences = array_values(array_filter(
12980| $occurrences,
12981| static fn (array $o): bool => isset($techTypesSet[$o['type_value'] ?? ''])
12982| ));
12983| }
12984|
12985| // Filtro de membro (próprio conteúdo) apenas quando o usuário NÃO tem escopo de equipe.
12986| // Supervisor/Gestor de Equipe já foram limitados pelo filtro de equipe acima — aplicar o
12987| // filtro de membro sobre eles reduziria a visão incorretamente para só o próprio conteúdo.
12988| $ssmaPreventionInspectionEnabled = true;
12989| $ssmaPreventionAbordagemEnabled = true;
12990|
12991| // Abas Inspeção/Abordagem (ROLE_USER): só quando meta do kind > 0 (igual critério da tabela Metas).
12992| // - Sem row (nunca adicionado ou removido com lixeira) → abas ocultas.
12993| // - Meta = -1 (desligado para esse kind) → aba oculta.
12994| // - Meta >= 0 (ligado, mesmo sem goal definido ainda) → aba visível.
12995| // Supervisores/Gestores de Equipe e Gestor Administrador são excluídos desse controle: suas abas dependem de outras flags.
12996| if ($company && $user instanceof User
12997| && !$this->isGranted('ROLE_SUPER_ADMIN')
12998| && !$this->isGranted('ROLE_MANAGER')
12999| && !$this->isGranted('ROLE_MANAGER_GESTOR')) {
13000| $memberForPreventionTabs = $this->getCurrentCompanyMember($company, $user);
13001| $memberIdPreventionTabs = (int) ($memberForPreventionTabs?->getId() ?? 0);
13002| if ($memberIdPreventionTabs > 0) {
13003| $metaKeyTabs = self::PREVENCAO_MEMBER_META_PREFIX . $memberIdPreventionTabs;
13004| $memberMetaRowTabs = $this->entityManager->getRepository(SsmaMeta::class)
13005| ->findOneBy(['company' => $company, 'teamName' => $metaKeyTabs]);
13006| // Le os valores de meta da linha encontrada (null quando a linha nao existe).
13007| // Aba visível quando o membro está na tabela (row existe) e esse kind não está desligado (-1).
13008| // meta=0 (ligado sem goal definido) → aba visível; meta=-1 (desligado) → aba oculta.
13009| $isMgmtPreventionProfile = $this->ssmaPreventionHubAccessService
13010| ->isManagementPreventionTag($ssmaPreventionProductTagName)
13011| || $this->ssmaPreventionHubAccessService->isManagementPreventionTag($ssmaProductTagName);
13012| $isPlainPreventionMember = $this->ssmaPreventionHubAccessService
13013| ->isPlainPreventionMemberTag($ssmaPreventionProductTagName);
13014|
13015| if ($isMgmtPreventionProfile) {
13016| // Supervisores e Gestores visualizam todos os kinds independente da meta individual.
13017| // O campo meta=-1 (desligado) serve para Membros; nao deve ocultar abas de gestao.
13018| $ssmaPreventionInspectionEnabled = true;
13019| $ssmaPreventionAbordagemEnabled = true;
13020| } elseif ($isPlainPreventionMember) {
13021| if ($memberMetaRowTabs !== null) {
13022| $ssmaPreventionInspectionEnabled = $this->ssmaPreventionHubAccessService
13023| ->isPrevencaoMemberKindTabVisible($memberMetaRowTabs->getMetaInspecao());
13024| $ssmaPreventionAbordagemEnabled = $this->ssmaPreventionHubAccessService
13025| ->isPrevencaoMemberKindTabVisible($memberMetaRowTabs->getMetaAbordagem());
13026| } else {
13027| $ssmaPreventionInspectionEnabled = false;
13028| $ssmaPreventionAbordagemEnabled = false;
13029| }
13030| }
13031| } else {
13032| // Membro não encontrado: oculta ambas as abas por segurança.
13033| $ssmaPreventionInspectionEnabled = false;
13034| $ssmaPreventionAbordagemEnabled = false;
13035| }
13036| }
13037|
13038| if ($company instanceof Company
13039| && !$this->isGranted('ROLE_SUPER_ADMIN')
13040| && !$this->isGranted('ROLE_MANAGER')
13041| && !$this->isGranted('ROLE_MANAGER_GESTOR')
13042| && !$this->ssmaPreventionHubAccessService->companyHasPreventionMetasBootstrap($company)) {
13043| $ssmaPreventionInspectionEnabled = false;
13044| $ssmaPreventionAbordagemEnabled = false;
13045| $ssmaCanAccessPreventionPanelAndMetas = false;
13046| }
13047|
13048| // Colaborador com meta, supervisor ou perfil equivalente: registrar o próprio conteúdo.
13049| // Gestor cria para outros; supervisor/membro só o próprio (ssmaPreventionMutateOwnOnly).
13050| // Inclui Supervisor/Gestor de Área via canMutatePreventionContentForCurrentUser.
13051| if ($company && $user instanceof User) {
13052| $canMutateOwnInspection = $ssmaPreventionInspectionEnabled
13053| && $this->canMutatePreventionContentForCurrentUser($company, $user, 'inspecao');
13054| $canMutateOwnAbordagem = $ssmaPreventionAbordagemEnabled
13055| && $this->canMutatePreventionContentForCurrentUser($company, $user, 'abordagem');
13056|
13057| if ($canMutateOwnInspection || $canMutateOwnAbordagem) {
13058| $ssmaCanCreatePreventionItems = true;
13059| $ssmaCanEditPreventionContent = true;
13060| }
13061| }
13062|
13063| if ($company && $user instanceof User
13064| && $ssmaCanEditPreventionContent
13065| && !$this->canManageAllPreventionContentForCurrentUser($company, $user)
13066| ) {
13067| $ssmaPreventionMutateOwnOnly = true;
13068| }
13069|
13070| $loggedPreventionMemberId = ($company && $user instanceof User)
13071| ? (int) ($this->getCurrentCompanyMember($company, $user)?->getId() ?? 0)
13072| : 0;
13073| $loggedPreventionUserId = $user instanceof User ? (int) $user->getId() : 0;
13074| if ($ssmaCanEditPreventionContent) {
13075| foreach ($inspections as $inspIdx => $inspRow) {
13076| if (!is_array($inspRow)) {
13077| continue;
13078| }
13079| $inspections[$inspIdx]['can_mutate'] = !$ssmaPreventionMutateOwnOnly
13080| || $this->preventionArrayOwnedByMember($inspRow, $loggedPreventionMemberId, $loggedPreventionUserId);
13081| }
13082| foreach ($abordagens as $abIdx => $abRow) {
13083| if (!is_array($abRow)) {
13084| continue;
13085| }
13086| $abordagens[$abIdx]['can_mutate'] = !$ssmaPreventionMutateOwnOnly
13087| || $this->preventionArrayOwnedByMember($abRow, $loggedPreventionMemberId, $loggedPreventionUserId);
13088| }
13089| }
13090|
13091| if (!$this->canManageSsmaOccurrences()
13092| && !$ssmaIsTagTeamSupervisor
13093| && !$ssmaIsTagAreaSupervisor
13094| && $ssmaProductTagName !== SsmaAreaLimitationScope::TAG_GESTOR_AREA
13095| && !$this->memberIsSsmaGestorAdministrador($company && $user instanceof User ? $this->getCurrentCompanyMember($company, $user) : null)
13096| && $occurrenceTeamFilterIds === null
13097| && $occurrenceAreaFilterIds === null
13098| && !$isTechSpecialistOnly) {
13099| $currentMember = $this->getCurrentCompanyMember($company, $user);
13100| $currentMemberId = $currentMember?->getId() ?? 0;
13101|
13102| $occurrences = $this->filterOccurrencesForMember($occurrences, $currentMemberId, $company);
13103| if ($company instanceof Company && $user instanceof User && $currentMemberId > 0) {
13104| $occurrences = $this->appendMissingActionLinkedOccurrences(
13105| $occurrences,
13106| $currentMemberId,
13107| $company,
13108| $user
13109| );
13110| }
13111| $actionsTaken = $this->filterActionsForMember($actionsTaken, $occurrences, $currentMemberId);
13112| }
13113|
13114| // Membro/Inspetor (pessoa física): na Prevenção Ativa só vê inspeções/abordagens em que está relacionado.
13115| // O filtro por equipe nas ocorrências não deve listar inspeções da equipe inteira para esses perfis.
13116| // Aura/tenant/SUPER_ADMIN com tag Membro herdada NÃO entram aqui — senão o admin vê
13117| // só o próprio conteúdo (ex.: 2 inspeções) enquanto o Gestor de Área vê o recorte da gerência (3).
13118| if ($company && $user instanceof User && $ssmaIsPlainPreventionMember) {
13119| $plainMemberId = (int) ($this->getCurrentCompanyMember($company, $user)?->getId() ?? 0);
13120| $plainUserId = (int) $user->getId();
Request #7
deepseek-v4-flash
P:42.95K C:3.37K CR:34.69K CW:0
27196ms
Reasoning
Now I need to think about the isTechSpecialistOnly logic carefully.
Consider a user with canManage true (via can_create tag) and $occurrenceTeamFilterIds === []. This happens when:
- Not ROLE_SUPER_ADMIN / ROLE_MANAGER / etc (they'd return null early)
- Member found
- Tag not in ['Gestor Administrador', 'Supervisor']
- Not team-scope tag
- Not team_limitation
- Not viewer teams
- Tag exists and parsed [] and tech types non-empty → return []
Can canManageSsmaOccurrences() be true in that scenario? canManage checks:
1. shouldStrip? if plain member with ROLE_USER → false
2. ROLE_SUPER_ADMIN / ROLE_MANAGER / ROLE_MANAGER_GESTOR / ROLE_TENANT → those users return null early from getSsmaOccurrenceDashboardTeamFilterIds → can't be [].
3. memberIsSsmaGestorAdministrador → Gestor Administrador tag → returns null early.
4. request attributes can_create/can_edit/can_delete → set on routes for members with write access (SsmaPermissionTagMember with can_create on ssma-occurrences product). Indeed — comment at line 12619: request attributes set on routes... And note line 10098-10100: "setSsmaTechnicalOccurrenceAttributes() define can_view=true nos attributes para stakeholders/técnicos cujo PermissionTag real tem can_view=false."
5. tag->canCreate/canEdit/canDelete on the Ssma permission tag.
So if the Ssma member's tag has can_create (the actual permission tag for the current product, ssma-occurrences or ssma-prevention etc), then canManageSsmaOccurrences() = true. And getSsmaOccurrenceDashboardTeamFilterIds for a member with that tag where parsed=[] and tech types present returns [].
So this case: **a "Membro" with a permission tag having can_create=true, having technical types for occurrence deep-dive (aprofundamento), but no team assigned** — the old code classified them as tech-specialist → filter by technical types. The new code excludes them from tech-specialist because canManage = true. Then team filter with empty scope → memberIdsInTeams empty → occurrences zeroed (unless they happen to be in `$ssmaIsTagTeamSupervisor/$ssmaIsTagTeamGestor`, which they aren't). Actually wait — for team filter branch, when $occurrenceTeamFilterIds = [] and not tech specialist:
- memberIdsInTeams = [] (no teams)
- then block at 12909: `if ($occurrenceTeamFilterIds === [] && ($ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor))` — member tag is "Membro", so false.
- filter requires team_id in [] or manager/people in memberIdsInTeams — but memberIdsInTeams empty → all removed. Occurrences become []!
Then the later member filter at 13091: `!canManage && ... && !$isTechSpecialistOnly` — since canManage true, skip. So occurrences remain [] — zeroed.
So this is a genuine regression: **member with write-permission tag (can_create), no team assigned, and technical types** loses visibility of occurrence types they're qualified for — the exact scenario the removed comments describe ("can_create na tag Membro / ROLE de plataforma não pode zerar a lista quando o escopo de equipe é [] (técnico por tipo)"). Actually ROLE_* platform can't hit [] autoScope, so those weren't affected; only the can_create-on-tag member case. But the point is the old comment explicitly warns about it.
Wait, but hold on. This whole PR presumably is from a series by Joabe, aligning with staging2 — this could be an intentional revert to match production? The description says the branch "traz apenas o delta necessário em cima do que o Gustavo já mergeou, com compatibilidade para o fluxo de produção." Hmm. But our job is to review the diff and flag the concern. The concern #2 is real and plausible: If a canManage member (can_create tag) with technical type but no team, then they lose hub occurrences. But is it a common profile? "Membro com can_create" + técnico? Actually the whole tech-specialist feature seems designed for members with `SsmaPermissionTagMember` having can_view on technical types... hmm.
Let me look more deeply at what "userTechnicalTypes" means: resolveUserTechnicalTypes / resolveCurrentUserTechnicalTypes. Let's read those methods (11816). Also let me check how the tags/attributes interplay.
Actually the diff removed code comments at 12883-12886 got replaced with text "Técnico especialista SSMA: tem SsmaPermissionTagMember mas sem gestão ou supervisão de equipe." So the tech specialist is a SsmaPermissionTagMember. And canManageSsmaOccurrences via request attribute can_create/can_edit... Hmm.
Let me not over-assert a definitive regression but raise as a high-severity concern requiring confirmation, since the review plan itself flags it. Actually let me think more carefully: if tech specialist has permission tag Member with can_create=true in the ssma-occurrences product, then canManageSsmaOccurrences() true, and the old code specifically included them. That's exactly what the deleted comment says: "Não exige !$canManageEarly: can_create de Membro / ROLE_* de plataforma não pode zerar a lista quando o escopo de equipe é [] (técnico por tipo)."
The diff's author decided to change this rule (matching "prod" branch presumably). This could be an intentional behavior alignment: In the aligned rule, canManage users should see all occurrences (as managers) — but the problem is that getSsmaOccurrenceDashboardTeamFilterIds returning [] for these members contradicts "managers see everything" because the filter function doesn't treat can_create as a management scope.
Wait — actually, could it be that members with can_create have a team assigned (parsed != [])? Not necessarily. E.g., tag Membro with can_create but no team in the company_members record. Hmm.
Actually — hold on, look again at canManageSsmaOccurrences: the request attributes check and tag canCreate check. But consider line 12626: `if ($ssmaIsPlainProductMemberUi && !$this->memberIsSsmaGestorAdministrador(...)) { $ssmaCanManageOccurrences = false; ... }` — For plain product member UI (ROLE_USER + tag Membro), $ssmaCanManageOccurrences gets forcibly false at line 12626! So within buildSsmaViewData (the hub SSR), plain member with ROLE_USER + tag Membro → $ssmaCanManageOccurrences false → $isTechSpecialistOnly true (if team filter [] and tech types non-empty). Good — so the isTechSpecialistOnly case at 12887 is after that strip at 12626. Wait, but canManageSsmaOccurrences() is called again at line 13091 and elsewhere later? At 13091 it calls the method directly (not the local var) → could return true via attributes even though $ssmaCanManageOccurrences local is false... but at 13091 requires `!canManage...` for member filter. Anyway.
For the hub SSR (buildSsmaViewData), the local variable $ssmaCanManageOccurrences was forced false at 12626 for plain product member UI. So isTechSpecialistOnly won't be affected by canManage for ROLE_USER members. But what about members NOT having ROLE_USER (Aura admin style) or members whose tag is Membro with can_create but that are Gestor Administrador? Gestor Administrador tag would return null from team filter.
Hmm. What about the "early" paged path at 12506 — the `$canManageEarly` there is computed before the strip at 12626? 12503 `$canManageEarly = $this->canManageSsmaOccurrences();` — direct method, so it doesn't benefit from the later forced-false strip. So for a plain product member (ROLE_USER + Membro tag + can_create), at 12506 $canManageEarly could be true (via tag can_create) while $ssmaCanManageOccurrences later is forced false. With the new condition at 12506-12509, isTechEarly = false for them, whereas previously isTechEarly was true. That affects the paging decision: `$needsOccurrencePostFilter` true → `$occurrencesListAlreadyPaged=false` and full load → then later team filter zeroes them? Wait no — need to trace what happens with the occurrences after 12530 (the full list) — then at line 12675 occurrenceTeamFilterIds = [] again, and isTechSpecialistOnly = true (because $ssmaCanManageOccurrences forced false). So they'd still be filtered by technical types. So for buildSsmaViewData path, the plain member with can_create is saved by the strip at 12626.
But wait, is `shouldStripSsmaManagementUiForUser` applying? For member with ROLE_USER + tag Membro, yes (that's what "plain member UI" means). So most cases are protected.
What about the "Aura" case: ROLE_MANAGER platform without ROLE_USER, with tag Membro? canManage is true via ROLE_MANAGER, but getSsmaOccurrenceDashboardTeamFilterIds returns null early for ROLE_MANAGER. So no [] scope → no impact.
So actually, is there a REAL reachable case where canManage true AND autoScope []? That requires the member tag to be neither Gestor Administrador nor 'Supervisor' (global) and no team scope tag and no team limitation and no viewer teams, tag exists with parsed=[] and tech types present, and canManage true (via attributes or tag canCreate), AND NOT being ROLE_USER plain member that would be stripped... e.g., ROLE_MANAGER? No — ROLE_MANAGER returns null. What about ROLE_MANAGER_GESTOR or ROLE_TENANT? Not covered in the early-return at 10209 (only ROLE_SUPER_ADMIN/ROLE_MANAGER). So a ROLE_MANAGER_GESTOR or ROLE_TENANT with tag Membro (parsed=[] with tech types) → autoScope=[] while canManage true via ROLE_MANAGER_GESTOR. Hmm wait, but the early-return in getSsmaOccurrenceDashboardTeamFilterIds returns null only for ROLE_SUPER_ADMIN or ROLE_MANAGER. ROLE_MANAGER_GESTOR / ROLE_TENANT would continue to member check. If the member exists with tag that isn't Gestor Administrador/Supervisor... Suppose a ROLE_MANAGER_GESTOR user with tag Membro (inherited), no teams, tech types → returns []. Then canManage true. Then tech specialist branch skipped → team filter zeroes → occurrences = []?
That is indeed the scenario in the removed comments: "can_create na tag Membro / ROLE de plataforma" — platform roles. And old code didn't require !canManage to handle this. Hmm. ROLE_TENANT / ROLE_MANAGER_GESTOR / can_create attribute... So the change does introduce a risk for those profiles. However, is the risk realistic? Would a Tenant/Manager-gestor be classified with tech types and no team? It's plausible in the Aura (corporate) setup.
OK — I think for issue #2, I should report it as a genuine concern at medium-high severity: there exists a plausible profile (canManage true via platform role ROLE_MANAGER_GESTOR/ROLE_TENANT or via can_create tag attributes, with SSMA tag Membro/technical and empty team scope) for which hub/dashboard lists now become empty. Since the deleted comments explicitly documented this as a reason not to require !canManage, the diff removes the safeguard. I'll report as a high/medium comment asking to verify or centralize rule; but I want to verify how the flow actually applies to buildSsmaViewData's local $ssmaCanManageOccurrences. This is complex; I'll be measured — flag with medium severity and ask to confirm the profile coverage.
Actually — let me check ROLE_MANAGER_GESTOR usage: there's `$ssmaCanManageOccurrences` = canManageSsmaOccurrences() which includes ROLE_MANAGER_GESTOR. And getSsmaOccurrenceDashboardTeamFilterIds only exempts ROLE_SUPER_ADMIN/ROLE_MANAGER. So indeed a user with ROLE_MANAGER_GESTOR and an SSMA member row with tag Membro (or SsmaPermissionTagMember), no teams parsed, and technical types → scope []. This is plausible for a corporate admin (Aura) granted platform role but product-tagged as Member for SSMA. Then:
- isTechEarly false now (canManageEarly true) → needsOccurrencePostFilter true → full list loaded.
- occurrenceTeamFilterIds = [] → isTechSpecialistOnly false (canManage true) → team filter applied with memberIdsInTeams empty → occurrences = [].
- member filter at 13091 skipped (canManage true). => Empty hub list.
Old behavior: isTechSpecialistOnly = true (no canManage check) → skip team filter → filter by technical types → sees relevant occurrences.
So this IS a plausible regression. Note the ROLE_MANAGER_GESTOR member case: But wait, would a ROLE_MANAGER_GESTOR be a "member" in company_members for SSMA with tag Membro? Possibly not; but ROLE_* platform accounts typically are admins without member row → getCurrentCompanyMember returns null → getSsmaOccurrenceDashboardTeamFilterIds returns null → no impact. So to be in the risk, they must have a member row with tag Membro + no team + tech types.
Given the deleted comment explicitly flagged this scenario, and this diff changes exactly that behavior (with no test noted), I think it's worth reporting as a medium/high finding requesting confirmation that these profiles continue to see their types. Let me decide severity = high given "hub list can zero" for some profiles, but uncertain reachability → maybe medium. I'll set severity high for the most concrete and confirmed issue (the $company bug), medium for the permission changes, and others as required.
Now let me examine issue #1's detail method more fully: read the detail method around 3280-3420 to see matching criteria after removal.
Tool Calls (2)
file_read
Show Details
Arguments
{"end_line": 3420, "file_path": "src/Controller/SsmaController.php", "start_line": 3260}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 3260-3420
3260| $validadeStr = $aut->getValidade();
3261| if ($validadeStr) {
3262| if (preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $validadeStr)) {
3263| try {
3264| $valDate = new \DateTime($validadeStr);
3265| $valDate->setTime(0, 0, 0);
3266| if ($valDate < new \DateTime('today')) {
3267| $vinculo->setStatusRequisito('expirado');
3268| return;
3269| }
3270| } catch (\Throwable) {
3271| }
3272| } elseif (ctype_digit($validadeStr)) {
3273| $dias = (int) $validadeStr;
3274| $emitida = $aut->getEmitida();
3275| if ($dias > 0 && $emitida !== null) {
3276| $expira = (clone \DateTime::createFromInterface($emitida))->modify('+' . $dias . ' days');
3277| $expira->setTime(0, 0, 0);
3278| if ($expira < new \DateTime('today')) {
3279| $vinculo->setStatusRequisito('expirado');
3280| return;
3281| }
3282| }
3283| }
3284| }
3285|
3286| $today = new \DateTimeImmutable('today');
3287| $aprovados = [];
3288| foreach ($vinculo->getDocumentos() as $d) {
3289| if ($d->getStatus() !== SsmaAutorizacaoDocumento::STATUS_APROVADO) {
3290| continue;
3291| }
3292| $val = $d->getValidadeDocumento();
3293| // Documento aprovado só conta se não houver validade ou validade >= hoje
3294| if ($val === null || \DateTimeImmutable::createFromInterface($val) >= $today) {
3295| $aprovados[$d->getRequisitoLabel()] = true;
3296| }
3297| }
3298|
3299| $todos = count(array_intersect_key(array_flip($requisitos), $aprovados)) === count($requisitos);
3300| $vinculo->setStatusRequisito($todos ? 'valido' : 'pendente');
3301| }
3302| }
3303|
3304| public function viewOccurrence(Request $request, int $id): Response
3305| {
3306| if (!$this->canEnterSsmaOperationalArea()) {
3307| throw $this->createAccessDeniedException('Sem permissão para acessar esta ocorrência.');
3308| }
3309|
3310| $viewData = $this->buildSsmaViewData([
3311| 'occurrence_id' => $id,
3312| 'occurrence_kind' => $request->query->get('kind'),
3313| ]);
3314| $occurrence = null;
3315| $occurrenceActions = [];
3316| $actionTypeLabels = $viewData['action_type_labels'] ?? [];
3317|
3318| $matching = [];
3319| foreach ($viewData['occurrences'] as $item) {
3320| if ((int) ($item['id'] ?? 0) === $id) {
3321| $matching[] = $item;
3322| }
3323| }
3324|
3325| if ($matching === []) {
3326| $userForStakeholder = $this->getUser();
3327| $companyForStakeholder = $userForStakeholder instanceof User ? $userForStakeholder->getCompany() : null;
3328| $stakeholderRow = ($companyForStakeholder instanceof Company && $userForStakeholder instanceof User)
3329| ? $this->tryLoadOccurrenceViewRowForActionStakeholder(
3330| $id,
3331| $request->query->get('kind'),
3332| $companyForStakeholder,
3333| $userForStakeholder
3334| )
3335| : null;
3336| if ($stakeholderRow !== null) {
3337| $matching = [$stakeholderRow];
3338| }
3339| }
3340|
3341| if ($matching === []) {
3342| $approverUser = $this->getUser();
3343| $approverCompany = $approverUser instanceof User ? $approverUser->getCompany() : null;
3344| if (
3345| $approverCompany instanceof Company
3346| && $approverUser instanceof User
3347| && $this->canApproveSsmaOccurrence($approverCompany, $approverUser)
3348| ) {
3349| foreach ($this->loadOccurrenceListRowsForDetailView(
3350| $approverCompany,
3351| $id,
3352| $viewData['allMembers'] ?? [],
3353| $viewData['teams'] ?? []
3354| ) as $item) {
3355| if ((int) ($item['id'] ?? 0) === $id) {
3356| $matching[] = $item;
3357| }
3358| }
3359| }
3360| }
3361|
3362| if ($matching === []) {
3363| $this->addFlash('warning', 'Ocorrência não encontrada.');
3364|
3365| return $this->redirectToRoute('ssma_ocorrencia_index');
3366| }
3367|
3368| $kind = $request->query->get('kind');
3369| if ($kind === 'event') {
3370| foreach ($matching as $item) {
3371| if (($item['is_ssma_event'] ?? false) === true) {
3372| $occurrence = $item;
3373| break;
3374| }
3375| }
3376| if ($occurrence === null) {
3377| $this->addFlash('warning', 'Registro não encontrado.');
3378|
3379| return $this->redirectToRoute('ssma_ocorrencia_index');
3380| }
3381| } else {
3382| foreach ($matching as $item) {
3383| if (!($item['is_ssma_event'] ?? false)) {
3384| $occurrence = $item;
3385| break;
3386| }
3387| }
3388| if ($occurrence === null) {
3389| $occurrence = $matching[0];
3390| }
3391| }
3392|
3393| $isSsmaEventRow = (bool) ($occurrence['is_ssma_event'] ?? false);
3394| $user = $this->getUser();
3395| $company = $user instanceof User ? $user->getCompany() : null;
3396| $this->maybeAutoFinalizeOccurrenceRowIfAllActionsClosed($occurrence, $company);
3397| $this->syncOccurrenceRowStatusFromDatabase($occurrence, $company);
3398|
3399| $today = new \DateTimeImmutable('today');
3400| foreach ($viewData['actions_taken'] as $actionItem) {
3401| if ($isSsmaEventRow) {
3402| if ((int) ($actionItem['event_id'] ?? 0) !== $id) {
3403| continue;
3404| }
3405| } elseif ((int) ($actionItem['occurrence_id'] ?? 0) !== $id) {
3406| continue;
3407| }
3408| $occurrenceActions[] = $this->enrichOccurrenceViewActionCard($actionItem, $actionTypeLabels, $today);
3409| }
3410|
3411| $history = $occurrence['history'] ?? [];
3412| if (($occurrence['is_ssma_event'] ?? false) === true) {
3413| $eventEntity = $this->entityManager->getRepository(SsmaEvent::class)->find($id);
3414| if ($eventEntity instanceof SsmaEvent && $company && $eventEntity->getCompany()->getId() === $company->getId()) {
3415| foreach ($eventEntity->getHistory() as $hItem) {
3416| if (is_array($hItem)) {
3417| $history[] = $hItem;
3418| }
3419| }
3420| }
file_read
Show Details
Arguments
{"end_line": 11890, "file_path": "src/Controller/SsmaController.php", "start_line": 11810}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 11810-11890
11810| return [];
11811| }
11812|
11813| return $this->filterActionsByResponsibleMemberIds($actions, [$memberId => true]);
11814| }
11815|
11816| private function resolveCurrentUserTechnicalTypes(Company $company, User $user): array
11817| {
11818| $members = $this->entityManager
11819| ->getRepository(CompanyMembers::class)
11820| ->findBy(['company' => $company, 'isRemoved' => 0]);
11821|
11822| return $this->resolveUserTechnicalTypes($company, $user, $members);
11823| }
11824|
11825| /**
11826| * Quem pode completar aprofundamento técnico (rotas legadas).
11827| * Alinhado a {@see canAccessSsmaEventAprofundamento}: NÃO usa canManageSsmaOccurrences()/ROLE_MANAGER.
11828| * Libera: Gestor Administrador SSMA / SUPER_ADMIN, ou especialista técnico do tipo.
11829| */
11830| private function canCompleteSsmaTechnicalType(Company $company, User $user, string $type): bool
11831| {
11832| if ($this->isSsmaAprofundamentoAdmin($company, $user)) {
11833| return true;
11834| }
11835|
11836| return in_array($type, $this->resolveCurrentUserTechnicalTypes($company, $user), true);
11837| }
11838|
11839| /**
11840| * Admin real do aprofundamento SSMA:
11841| * - SUPER_ADMIN / ROLE_TENANT / ROLE_ADMIN
11842| * - conta admin da empresa (ROLE_MANAGER) que NÃO é membro físico plain (Palloma)
11843| * - tag de produto "Gestor Administrador"
11844| *
11845| * Felipe (05/08): Tenant não via 2ª barra/botão "Aprofundamento" e precisava
11846| * se adicionar como técnico para testar — admin da tenant libera direto.
11847| *
11848| * Não libera colaborador físico ROLE_USER + tag Membro/Inspetor (Palloma),
11849| * mesmo que herde ROLE_MANAGER de plataforma.
11850| */
11851| private function isSsmaAprofundamentoAdmin(?Company $company, ?User $user): bool
11852| {
11853| if (!$user) {
11854| return false;
11855| }
11856|
11857| if (
11858| $this->isGranted('ROLE_SUPER_ADMIN')
11859| || $this->isGranted('ROLE_TENANT')
11860| || $this->isGranted('ROLE_ADMIN')
11861| ) {
11862| return true;
11863| }
11864|
11865| $member = $company ? $this->getCurrentCompanyMember($company, $user) : null;
11866|
11867| // ROLE_MANAGER de conta admin (Aura) — não plain member físico.
11868| if (
11869| \in_array('ROLE_MANAGER', $user->getRoles(), true)
11870| && !$this->ssmaOccurrenceCreatePermissionService->isPlainSsmaProductMember($member, $user)
11871| ) {
11872| return true;
11873| }
11874|
11875| if (!$company || !$member) {
11876| return false;
11877| }
11878|
11879| return $this->memberIsSsmaGestorAdministrador($member);
11880| }
11881|
11882| /**
11883| * @param array<string, mixed>|null $flashContext
11884| *
11885| * @return array{can_submit: bool, can_direct_send: bool}
11886| */
11887| private function resolveSsmaFlashReportUiPermissions(
11888| Company $company,
11889| User $user,
11890| ?array $flashContext,
Request #8
deepseek-v4-flash
P:49.44K C:1.59K CR:46.21K CW:0
11952ms
Reasoning
Now for the detail view removal (viewOccurrence at 3304). The fallback removed was for "Técnico com tipo associado". After removal, remaining fallbacks:
1. stakeholder row (tryLoadOccurrenceViewRowForActionStakeholder)
2. approver (canApproveSsmaOccurrence)
The viewData['occurrences'] is the hub occurrence list which uses buildSsmaViewData with occurrence_id/kind. The hub list filtering for technical specialists happens by type, so if the tech user's own hub list includes the occurrence by type filter, then matching would already be found. The removed fallback was only for cases where the list filter (e.g., can_create of platform) had removed the row from hub. Now, with the isTechEarly/tech-specialist changes also requiring !canManage, a technical user with canManage capability might find their occurrence missing from hub (zeroed by empty team scope), and with this fallback removed they can't open the detail — full loss of access. But again the reachability is uncertain.
Given the deliberate nature, I'll flag the detail fallback removal in relation to the permission-change (#2/#3) as a "verification needed, possibly intentional" medium finding.
Now issue #4: display_code removal. The search shows:
- templates/ssma/occurrence/occurrence_view.html.twig line 573: `{{ occurrence.display_code|default(occurrence.id) }}`
- templates/ssma/occurrence/tabs/_tab_occurrences.html.twig lines 479, 683, 1590-1591 reading `occ.display_code`/`occurrenceData.display_code`.
These templates still consume `display_code`. Are they within scope of this repo? Yes templates are part of the same repo. The PR removed the `display_code` field from list rows (mapSsmaOccurrenceEntityToListRow, mapSsmaEventToOccurrenceListRow, and two dashboard result mappings). If templates still rely on display_code, then UI code display disappears (falls back to occurrence.id). But maybe the templates are the older ones used by the "occurrences tab" and hub — for occurrences list, the `display_code` used to be `SsmaOccurrenceDisplayCodeFormatter::format($type, id)`. Where does `occ.display_code` come from in the tab? It reads from list rows which no longer carry it — they'd fallback to id. Let me read those templates to understand context: line 479 of _tab_occurrences.html.twig, and occurrence_view.html.twig line 573. Let's verify which data feeds them.
But note the diff only removed display_code from *four* mapping sites in SsmaController, and removed the import. Other parts may still provide display_code? Let me search the whole codebase for who sets 'display_code' as an array key, since the src search returned nothing (search of `display_code` in src/ returned "No matches found"?!). Interesting: search_text 'display_code' file_patterns ['src/'] returned no matches? Wait that's weird. But the diff removal lines included `'display_code' => SsmaOccurrenceDisplayCodeFormatter::format(...)`. Since the file is src/Controller/SsmaController.php, a src search should find it. Hmm — actually the code_search for 'display_code' in src/ returned "No matches found"? That seems inconsistent... Possibly because the file-read is of the current version after removal? code_search searches current version. So current version has no display_code in src. Good: that means currently, within src/, no producer/consumer of display_code remains; the only remaining consumers are templates reading the field from array payloads (now undefined → default to occurrence.id). So display_code removal is a contract change; templates still reference it. In _tab_occurrences.html.twig lines 1590-1591 JS: `if (occurrenceData && occurrenceData.display_code) return String(occurrenceData.display_code);` — used probably to show code in detail. Since occurrences detail data may come from the list row passed to JS... After removal, falls back to occurrence.id presumably. Not a fatal error, since templates use `default(occ.id)`.
But wait: occurrence_view.html.twig line 573 reads `occurrence.display_code` — where does the detail view's `occurrence` variable come from? It's the matched list row. Now display_code missing → shows occurrence.id.
Is there a separate `SsmaOccurrenceDisplayCodeFormatter` used elsewhere, e.g., in detail view building? The import removed from controller; let me check if the formatter class is used anywhere else in the codebase — search whole repo.
Also search for where `display_code` might be generated elsewhere (services). code_search across whole codebase for 'display_code' gave only templates results (because in the earlier search I used file_patterns templates/assets/public; and a src/ search gave none). Let me search the whole repo without file patterns.
Let me also confirm no remaining use of SsmaOccurrenceDisplayCodeFormatter anywhere.
Now issue #5 - maintainability: replicate rule in three+ spots. There are at least 3 spots with the same `!canManage && !viewer && teamFilter===[] && techTypes!==[]` condition (12506, 12887, 22836). Also the `resolveUserTechnicalTypes` etc. The controller is huge (28k lines). Suggest centralizing. Non-blocking suggestion.
Let me run these searches:
1. code_search whole repo for 'SsmaOccurrenceDisplayCodeFormatter'
2. code_search whole repo for 'display_code'
3. Also look at templates context lines around 470-490 & 680-690 & 1585-1595 to know which list provides display_code to the template, to determine severity of removal.
4. Confirm the file path for the earlier diff also removed `use App\Service\Ssma\SsmaOccurrenceDisplayCodeFormatter;` — yes.
Let me also double check the removed method's removal doesn't break references elsewhere: search tryLoadOccurrenceViewRowForTechnicalType across the repo.
Tool Calls (5)
code_search
Show Details
Arguments
{"search_text": "SsmaOccurrenceDisplayCodeFormatter"}
Result
File: src/Service/Ssma/SsmaOccurrenceDisplayCodeFormatter.php
Match lines: 1
13|final class SsmaOccurrenceDisplayCodeFormatter
File: tests/Unit/Product/Ssma/SsmaOccurrenceDisplayCodeFormatterTest.php
Match lines: 9
7|use App\Service\Ssma\SsmaOccurrenceDisplayCodeFormatter;
9|final class SsmaOccurrenceDisplayCodeFormatterTest extends SsmaTestCase
13| self::assertSame('ROS103', SsmaOccurrenceDisplayCodeFormatter::format('ROS', 103));
18| self::assertSame('QA103', SsmaOccurrenceDisplayCodeFormatter::format('QUASE_ACIDENTE', 103));
23| self::assertSame('Ac103', SsmaOccurrenceDisplayCodeFormatter::format('ACIDENTE_PESSOAL', 103));
24| self::assertSame('Ac104', SsmaOccurrenceDisplayCodeFormatter::format('ACIDENTE_MATERIAL', 104));
25| self::assertSame('Ac105', SsmaOccurrenceDisplayCodeFormatter::format('ACIDENTE_AMBIENTAL', 105));
30| self::assertSame('103', SsmaOccurrenceDisplayCodeFormatter::format('OUTRO_TIPO', 103));
35| self::assertSame('', SsmaOccurrenceDisplayCodeFormatter::format('ROS', 0));
code_search
Show Details
Arguments
{"search_text": "display_code"}
Result
File: templates/ssma/occurrence/occurrence_view.html.twig
Match lines: 1
573| {{ occurrence.display_code|default(occurrence.id) }}
File: templates/ssma/occurrence/tabs/_tab_occurrences.html.twig
Match lines: 4
479| {{ occ.display_code|default(occ.id) }}
683| style="background:rgba(108,117,125,0.10); color:#6c757d; border-color:#adb5bd;">{{ occ.display_code|default(occ.id) }}</span>
1590| if (occurrenceData && occurrenceData.display_code) {
1591| return String(occurrenceData.display_code);
code_search
Show Details
Arguments
{"search_text": "tryLoadOccurrenceViewRowForTechnicalType"}
Result
No matches found
file_read
Show Details
Arguments
{"end_line": 495, "file_path": "templates/ssma/occurrence/tabs/_tab_occurrences.html.twig", "start_line": 455}
Result
File: templates/ssma/occurrence/tabs/_tab_occurrences.html.twig (Total lines: 3056)
IS_TRUNCATED: false
LINE_RANGE: 455-495
455| data-area="{{ occ.area }}"
456| data-severity="{{ gravLabel }}"
457| data-status="{{ stat.label }}"
458| data-descaracter-suspect="{{ occ.descaracter_suspect|default(0) }}"
459| data-descaracterizado="{{ occ.descaracterizado|default('') }}"
460| data-aprofundamento-pending="{{ occ.aprofundamento_pending|default(0) }}"
461| {% if ssma_show_occ_unidade_filter %}data-unidade="{{ occ.company_id|default(ssma_head_office.id|default('')) }}"{% endif %}>
462| <div class="app-card-surface p-3 d-flex flex-column h-100" data-occurrence-id="{{ rowKey }}">
463|
464| {# ── Top row: severity badge + ID + 3-dot menu ── #}
465| <div class="d-flex justify-content-between align-items-start">
466| <div class="d-flex align-items-center flex-wrap" style="gap:6px;">
467| {% if isWorkflowOverdue %}
468| <span class="occ-card-overdue-badge" title="Fluxo atrasado">
469| <i class="fas fa-clock" aria-hidden="true"></i>Atrasada
470| </span>
471| {% endif %}
472| <span class="ssma-shared-tag"
473| style="background:{{ gravMeta.bg_light }}; color:{{ gravMeta.dot }}; border-color:{{ gravMeta.dot }};">
474| <span class="ssma-shared-tag-dot"></span>
475| {{ gravLabel }}
476| </span>
477| <span class="ssma-shared-tag" title="Identificador"
478| style="background:rgba(108,117,125,0.10); color:#6c757d; border-color:#adb5bd;">
479| {{ occ.display_code|default(occ.id) }}
480| </span>
481| {% if occ.is_ssma_event|default(false) and _occ_approval != '' and not _is_rejected_occ %}
482| {% if _occ_approval == 'approved' %}
483| <span class="ssma-shared-tag ssma-shared-tag--success ssma-shared-tag--sm js-occ-approval-tag">Validada</span>
484| {% elseif _occ_approval == 'pending' %}
485| <span class="ssma-shared-tag ssma-shared-tag--warning ssma-shared-tag--sm js-occ-approval-tag">Aguardando validação</span>
486| {% endif %}
487| {% endif %}
488| </div>
489| <div class="dropdown">
490| <button class="btn btn-sm border-0 p-1" type="button"
491| data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
492| data-boundary="viewport">
493| <i class="fas fa-ellipsis-v text-muted"></i>
494| </button>
495| <div class="dropdown-menu dropdown-menu-right shadow-sm">
file_read
Show Details
Arguments
{"end_line": 590, "file_path": "templates/ssma/occurrence/occurrence_view.html.twig", "start_line": 555}
Result
File: templates/ssma/occurrence/occurrence_view.html.twig (Total lines: 3234)
IS_TRUNCATED: false
LINE_RANGE: 555-590
555|
556|<section class="members-content zero-padding modern-layout ssma-module occurrence-view-page ssma-occurrence-detail">
557| {% include 'ssma/partials/_shared_module_assets.html.twig' with {
558| allMembers: allMembers|default([])
559| } %}
560| {# Readonly: view inclui o modal só com can_edit — entry precisa ficar aqui também.
561| Fonte: partial único (Encore deduplica se o modal também incluir). #}
562| {% include 'ssma/partials/_ssma_body_map_entry.html.twig' %}
563|
564| {# ── Header + ações (um sticky só) ── #}
565| <div class="ssma-occ-detail-sticky-head">
566| <div class="modern-header no-tabs">
567| <div class="header-top">
568| <a href="{{ path('ssma_ocorrencia_index') }}" class="btn-back-link mr-2">
569| <i class="fa fa-angle-left"></i>
570| </a>
571| <span class="ssma-shared-tag mr-2 align-self-center" title="Identificador"
572| style="background:rgba(108,117,125,0.10); color:#6c757d; border-color:#adb5bd; font-size:12px;">
573| {{ occurrence.display_code|default(occurrence.id) }}
574| </span>
575| <h1 class="header-title mr-3" spellcheck="false">{{ occurrence.title|default('Sem titulo') }}</h1>
576| {# Pill de status reutilizável #}
577| {% set occ_status_pill_color =
578| _is_rejected_occ
579| ? 'gray'
580| : (normalized_status in ['finalizada', 'resolvida', 'concluida']
581| ? 'green'
582| : (normalized_status == 'rascunho'
583| ? 'yellow'
584| : (normalized_status in ['nao_conforme', 'nao_conformidade', 'nao-conforme']
585| ? 'red'
586| : (normalized_status in ['parcial']
587| ? 'yellow'
588| : (normalized_status in ['investigada', 'investigacao', 'investigation', 'em_investigacao']
589| ? 'teal'
590| : 'gray'
Request #9
deepseek-v4-flash
P:52.93K C:7.2K CR:50.94K CW:0
60478ms
Reasoning
So `display_code` is only produced in this controller and consumed in templates. Now templates read `display_code` with default fallback to id; removal makes display show raw id instead of formatted code (e.g., 'ROS103'). This is a visible UX regression but not fatal (no crash), but given that the PR description is about "aba Ações" & "fundações backend Painel", and that templates still reference display_code, removing the field seems like it's part of aligning with staging2 where templates likely no longer use display_code? But templates in this repo still DO use display_code. The templates may have been changed in staging2 via other PRs (#701/#702). If this PR is meant to keep prod compatibility (feature/ssma-action-plan-acoes-np-v2 to new_production?), the removal might be intended to align prod code (where Painel templates don't exist). But the occurrence list templates that consume display_code exist in both environments (they're in this repo, unchanged in this PR). So the removal will change the occurrence ID display from "ROS103" to the numeric id in the hub tab cards and detail header.
Wait — is that true? Which data feeds these templates? The hub cards in _tab_occurrences.html.twig presumably iterate over occurrences from buildSsmaViewData → mapSsmaOccurrenceEntityToListRow/mapSsmaEventToOccurrenceListRow, which no longer include display_code. So cards will show the numeric id fallback. This is a visible change to the "Aba Ocorrências" — arguably a regression unrelated to the PR scope (aba Ações). So report as medium: templates still read display_code; removal silently changes display to numeric id unless templates are also updated (they aren't, in this diff). Suggests either keep display_code or update templates with new computed value in this same PR.
Hmm, wait — maybe in staging2, hub templates were changed and the occurrence list uses a different field (e.g., `code` or the list rows include formatted code elsewhere). Let me check how _tab_occurrences gets its data — it may consume JS from `window` data where list rows map through another mapper that adds display_code. Search for `list_row_key` producers and other keys like `is_ssma_event` produced elsewhere. It's possible the display_code is added by a Twig-level or JS-level computation, e.g., in the tab the `occ` variable may come from an array serialized with display_code from some different producer. Since no producer remains in src, we know all these rows lack display_code now.
But — could these templates be legacy / not the current flow (e.g., replaced by new Painel templates in staging2)? The diff includes a new producer at lines 22738/22836 for dashboardFilter/SSR dashboard rows (which also removed display_code). Those rows with display_code were for dashboard filter response consumed by JS. If JS elsewhere (Painel front) expects display_code and it's not yet updated, then new Painel would break. But Painel UI comes in PR B (not yet merged). Since the front of the Painel (PR B) isn't merged, removal here is "fundação backend" to align with the upcoming Painel UI.
Regardless, the currently existing consumers (tab occurrences, occurrence detail header) still read display_code and will fall back to id. That's a real functional change. Whether intended, unclear; the safest review note: verify that templates that still read `display_code` are updated in this PR or the field is recomputed elsewhere; otherwise code display will regress to numeric id on the Aba Ocorrências and detail page. Medium severity.
Actually, wait — let me double-check whether _tab_occurrences.html.twig's `occ` object really corresponds to the removed list rows. In buildSsmaViewData, occurrences are built from mapSsmaOccurrenceEntityToListRow and mapSsmaEventToOccurrenceListRow, and the Twig template receives them. But _tab_occurrences is the hub tab. Also there's another mapping at 22738 and 22836 (SSR/dashboardFilter rows used by the Painel AJAX, not the tab). The detail view `occurrence` in occurrence_view.html.twig comes from viewOccurrence matching (a list row). So yes, both consumers are fed by the removed fields.
Let me now also verify where the mapSsmaOccurrenceEntityToListRow and mapSsmaEventToOccurrenceListRow display_code removal at lines 14680 and 14979 are — those are the core list-row mappers feeding buildSsmaViewData. And diff lines 22738/22836 feed dashboard AJAX (occurrences for Painel). All four removed.
Now, let me verify there's no other producer of display_code (like in the JS building cards from server data) — nothing in src. So templates degrade to id.
Now let's evaluate issue #1 conclusively: `$company` undefined in resolveSsmaEvent.
Let me double check with a grep in the method region for `$company` assignment between lines 7871 and 7912. Already visually confirmed. To be extra careful, check that there's no `extract()` or `$company` from `$this->getSsmaCompany()` property; but variable usage is local `$company` — must be a defined local. Yes undefined.
So the call `maybeSubmitOccurrenceForValidation($event, $company, $user)`:
- `$company` is undefined local → PHP Warning "Undefined variable $company", value null.
- Method signature: `maybeSubmitOccurrenceForValidation(SsmaEvent $event, Company $company, User $sender, bool $resubmitted = false)`. Passing null for `Company $company` → TypeError. Inside try/catch \Throwable → caught → returns 500 error message. Event already flushed to finalizado.
Consequences: Finalizing an SSMA event via POST /manager/ssma/events/{id}/resolve always returns 500 "Erro ao finalizar ocorrência." while actually persisting the finalization (data inconsistency: event concluído but the user sees failure and may retry; validation submission to approvers silently never happens). That's a real, blocking bug. High/critical severity. I'll set critical? It breaks a specific route but not all. The review guidance: bug affecting flow → blocking. I'll set severity high. Actually let me re-check the route mapping: `resolveSsmaEvent` maps to `events/{id}/resolve`. It finalizes "evento SSMA tipado". This is a reachable action (part of occurrence finalization for events in the unified list). Also note the same pattern may appear at other call sites, but those are outside the diff. Our comment only targets the changed line.
Let me now confirm precisely the hunk at 7909 to give existing_code snippet: The added line: `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);`. I'll anchor on that plus context. Good.
Now decide comments to report. Given strict focus rules, we report on diff lines only.
Findings:
1. **Bug (critical/high)** at line 7912: `$company` variável indefinida em `resolveSsmaEvent` — removeu a definição local `$company = $event->getCompany()` e a checagem `instanceof`, agora a variável é indefinida (null) e quebra com TypeError (pego pelo catch → 500), e a notificação/validação nunca dispara, embora o evento já tenha sido persistido como finalizado. Severity: high/critical. I'll use high (or critical). Given it's a concrete route that will always fail after flush, that's critical severity? It produces user-visible 500 and skips the approval submission — I'd rate high. I'll go with high.
Wait — but is the change confirmed to be inside resolveSsmaEvent? The diff hunk context starts at @@ -7928,10 +7909,7 @@ which maps to old lines 7928-7937 → new lines 7909-7915. Old line numbers: The old code at 7932-7935 (approx) was:
```
$company = $event->getCompany();
if ($company instanceof Company) {
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
}
```
new at 7912: `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);`. Confirmed at file_read line 7912. And yes inside resolveSsmaEvent (7871-7918).
2. **Permission change regression (medium/high)** — three spots now require `!canManage` for the tech-specialist empty-team-scope safeguard; profiles where canManage é true (ROLE_MANAGER_GESTOR/ROLE_TENANT com tag Membro e sem equipe; ou Membro com tag can_create) podem ter o escopo de equipe `[]` aplicado e listas zeradas no hub/dashboard/Painel, exatamente o caso que os comentários removidos diziam proteger. This is a deliberate-looking change but with plausible regression; since deleted comments explain it, and diff removes safeguards, report as a warning (medium/high). I'll report at the first occurrence (12506-12509) as one comment covering the pattern, maybe also note the filterOccurrencesForSsmaDashboardTeamScope site. Could be one comment about the pattern repeated. But code_comment anchors at a line; I can provide a couple of comments at the two main sites, or one at first. Given the review instructions for precision and to avoid duplicates, I'll post two comments: one at the hub SSR condition (12506-12509) and one at the dashboard auto-scope filter (22836). Actually the isTechSpecialistOnly at 12887 is another duplicate but same hub; the isTechEarly at 12506 is the paging. Three spots total: 12506, 12887, 22836. I'll comment on the first (12506) and mention it's replicated elsewhere, or comment on 12887 too. Let me keep it concise: comment on the block at 12887 (SSR hub final filter — where actual list zeroing occurs) and on 22836 (dashboard AJAX), both. Hmm, the instruction says review focus but not duplicate findings. I'll write one combined comment anchored at 12506... but the impact at 12887 is where zeroing happens. Actually zeroing happens at 12892 for hub SSR. isTechEarly at 12506 only affects paging (loads all vs paged) — if later zeroed anyway. Let me anchor at 12887 (hub final) and mention same rule in 12506 & filterOccurrencesForSsmaDashboardTeamScope.
Hmm wait — but is it truly zeroed? Let's confirm the chain in buildSsmaViewData after line 12506 for the SSR route... Actually the isTechEarly path at 12500 is in a branch (paged occurrence list with `paginateOccurrenceList`). Then at 12675, occurrenceTeamFilterIds computed; isTechSpecialistOnly at 12887. If canManage true and autoScope [], isTechSpecialistOnly false → team filter applied (12892) with `$occurrenceTeamFilterIds === []`, memberIdsInTeams empty (they aren't team sup/gestor), and occurrences could still survive if occurrence team_id in teamIdStr... teamIdStr = [] so the first condition `in_array($o['team_id'], [], true)` false. manager/people in empty map false → all filtered out → occurrences = [] indeed.
So yes zeroing for that profile. But the profile reachability is the crux: is canManage true while autoScope == [] truly reachable? For that, the current member's SSMA tag must not be 'Gestor Administrador'/'Supervisor', no team-scope tag, no team limitation, no viewer teams, parsed = [], tech types present, plus canManage = true. Which canManage ways:
- platform roles ROLE_MANAGER/ROLE_SUPER_ADMIN return null autoScope, so excluded.
- ROLE_MANAGER_GESTOR / ROLE_TENANT with SSMA member row: possible per config? ROLE_TENANT might be tenant admin which probably is SUPER_ADMIN-like... Actually getSsmaOccurrenceDashboardTeamFilterIds doesn't exempt ROLE_MANAGER_GESTOR/ROLE_TENANT. Are ROLE_TENANT/ROLE_MANAGER_GESTOR users often set as members with tag Membro? Possibly (tenant/manager accounts created as members).
- request attributes can_create: Set via listener `setSsmaTechnicalOccurrenceAttributes()` for stakeholders/técnicos... Let me look at that listener to see when attributes set. Actually can_create attributes may be set based on tag can_create. If tag Membro with can_create → attributes set. Then autoScope [] possible (parsed = []), tech types present, and canManage true → the regression scenario: "Membro com can_create + tipo técnico + sem equipe". Given the deleted comments explicitly cite "can_create de Membro" as a reason to NOT gate on !canManage, I'm fairly confident the author knew that members can have can_create + empty team + tech types. Under the old code, such members were tech-specialists; under new code, they are considered managers → team scope [] applied → empty.
However, note: `shouldStripSsmaManagementUiForUser` inside canManageSsmaOccurrences returns false for these (line 11321-11324): if user ROLE_USER + member tag Membro (Palloma) → strip, returns false. So plain ROLE_USER member with can_create? shouldStrip returns true only if...? Read function 11480 to know. If canManage returns false for plain members with ROLE_USER, then the risky profiles are Aura-style (ROLE_MANAGER w/o ROLE_USER... but those are exempt from filter returning null). Hmm, ROLE_MANAGER w/o ROLE_USER: getSsmaOccurrenceDashboardTeamFilterIds exempts ROLE_MANAGER → null. So safe. What about ROLE_MANAGER_GESTOR/ROLE_TENANT w/o ROLE_USER? Not exempt from filter; member tag Membro with tech types, parsed [] → autoScope [] + canManage true → zeroed. Is that a real Aura/Tenant account profile? Possibly. That matches "ROLE de plataforma" in the deleted comment.
So I'll frame the comment accordingly: user profiles whose canManage vem de ROLE_MANAGER_GESTOR/ROLE_TENANT (ou request attribute can_create) + tag de produto sem equipe + tipo técnico passam a ser excluídos do perfil "técnico especialista" e, com escopo de equipe [], a lista de ocorrências zera no hub/dashboard/Painel. Antes isso era explicitamente protegido (comentários removidos). Confirmar se esses perfis continuam enxergando por tipo; caso contrário, manter a regra anterior ou tratar canManage de plataforma separadamente do escopo de equipe vazio.
Severity: high given possible full loss of visibility. But uncertain reachability — I'll use medium? The review plan sets it as high; I'd compromise to medium/high. Given the guidance "report only defects that are likely real". The reachability exists for ROLE_TENANT/ROLE_MANAGER_GESTOR admin accounts in a company that also has SSMA members with tag. Since a platform-role account is typically the company admin user — can a company admin user (ROLE_MANAGER) with member row of tag Membro be... exempt (returns null). ROLE_MANAGER_GESTOR: is a second-level manager role used in this app? It appears throughout. It's plausible. I'll set high severity but phrase with "verificar" framing? Actually reviewers should give concrete concern. I'll set high severity but balanced, saying needs confirmation.
3. **Detail access removal for technical type (medium)** — removed fallback + method. This is likely intentional (align with list); the tech user's own viewData list now would include the row if the type filter includes it. But the specific reason the fallback existed: when can_create of platform removed the row from hub. Under new rules, if the tech user also canManage, they might not have row at all and can't open detail. Combined with #2. I could fold this into #2 comment as an impact: "além de zerar a lista, o detalhe (que antes tinha fallback por tipo técnico) também passa a negar abertura para quem não é stakeholder/approver". Might be better to make one comment on the removed fallback block in viewOccurrence — but comments must anchor on new code lines. The removal is shown as `-` lines; we can't anchor on deleted lines. We could anchor on the remaining `if ($matching === []) {` after deletion? The rule: existing_code should only contain newly added lines. In a pure deletion hunk (removed block), there are no added lines to anchor on... Actually the diff region at 3339 has removed lines and context lines; no added lines. Anchoring on context lines (unchanged) is allowed? "Only return newly added code lines, should not include deleted code or unchanged code lines." Hmm — but for pure deletion, we can't place a comment at all per this constraint. The tool may accept unchanged context lines, but instructions say only newly added lines. There are no added lines near the viewOccurrence deletion (the following context `if ($matching === []) {` is unchanged). We could anchor there but that's unchanged code. Possibly acceptable because we need a location. Better to combine with #2's comment on the permission block where both changes converge (at 12887) or keep the detail-access issue folded into the high-severity permission comment.
I'll fold #3 into the permission regression comment where relevant, referencing that removing the detail fallback (tryLoadOccurrenceViewRowForTechnicalType) also kills the direct detail open for those profiles.
Actually the removed fallback at 3339 is in a pure-deletion hunk; the review instructions say "Avoid commenting on deleted code; deleted code serves only as reference context." But the *impact* of the deletion is what we review: a deleted behavior. Typically we can still report it because review is about the new state. But anchoring constraints: existing_code must be lines in diff text that are newly added. For that hunk there are no added lines. Could anchor to an added line elsewhere that is part of same logical change (the 12506 block). Alternatively, anchor to the earlier hunk's newly added `+` lines where the tech fallback was in old code but not needed to anchor; we can anchor the permission comment at 12887 added lines `!$ssmaCanManageOccurrences`. That hunk is close to the isTechSpecialistOnly change. Fine.
Let me structure comments:
Comment A (bug, high): resolveSsmaEvent uses undefined `$company`.
Anchor snippet (added line):
```
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
```
Suggestion code:
```
$company = $event->getCompany();
if ($company instanceof Company) {
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
}
```
Comment B (permission regression, high): anchor at added lines:
```
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
```
Message about the three sites and the guard removal and resulting empty list for canManage+team-empty+tech-type profiles, plus detail fallback removed. Note as both #2/#3.
Wait — however, we should double check that the "early" paging site even matters given later forced-strip at 12626 for plain product member UI; if the user is plain member with can_create via attributes, at 12506 canManageEarly is computed before strip? Actually 12503 computes canManageEarly directly before the strip at 12625-12630 (which sets the local $ssmaCanManageOccurrences to false at 12626, but the early branch at 12503 already ran). So at 12506 plain ROLE_USER member with can_create tag → canManageEarly = true (unless shouldStrip returns false). If canManage is false for them due to shouldStrip (Palloma), canManageEarly=false → no difference from old code for them. So for ROLE_USER members, no regression. The risky profile again = non-ROLE_USER accounts with canManage via platform roles that also have SSMA member row tag Membro + tech types + parsed=[] (ROLE_MANAGER_GESTOR, ROLE_TENANT). Hmm those seem quite niche but conceivable in Aura setup: Aura corporate admin (ROLE_MANAGER) is exempt; Tenant accounts maybe also SUPER_ADMIN-ish.
Alternatively members with a tag that has can_create and NOT ROLE_USER (some older accounts)? uncertain.
Honestly the reachability depends on config we can't fully verify. But we should still flag since the removed comments explicitly document real encountered scenarios. I'll phrase carefully: "Se existir perfil em que canManage vem de ROLE/atributo e o escopo de equipe retorna [] (sem equipe no produto), a lista zera... Antes isso era tratado por comentário removido explicitamente. Vale confirmar/testar..." Severity medium? The reviewer checklist instructs severity for likely-real defects; given doubt, I'll choose medium but describe concrete impact. Hmm, but the review plan labels #2 as high. I'll go high to respect the review plan reasoning? The plan says: "Gestores e usuários com permissão de gestão podem parar de enxergar ocorrências ... se para esse perfil getSsmaOccurrenceDashboardTeamFilterIds retornar lista vazia". We confirmed that scenario is reachable only for certain profiles. I'd set high as it's plausible and severe if hit. But our instructions favor precision over recall... Maybe I should anchor the comment and set severity "high" and ask to add test/confirm.
Let me also decide about display_code comment (medium): anchor where? The removal is in mapSsmaOccurrenceEntityToListRow (line ~14680) — pure deletions again (removed `'display_code' => ...` lines with no added lines nearby). The diff shows removed lines with context. No added lines in those hunks. Similarly mapSsmaEventToOccurrenceListRow at 14979, and 22738/22836. Hmm.
Wait — actually the display_code hunks:
@@ -14703,7 +14680,6 @@ — removed one line each. New added lines? None (the hunk is deletions). All display_code hunks are pure deletions; no added anchor lines. Then we can't comment there with existing_code. But the import removal hunk has an added line? That hunk removed `use ...SsmaOccurrenceDisplayCodeFormatter;` and context. Pure deletion again.
For such pure-deletion hunks, anchoring comments is impossible per the rule "Only return newly added code lines". Unless we anchor to context unchanged lines like `'id' => $row->getId(),`... but that's an unchanged line in the hunk; the tool matches lines in diff; perhaps context lines are fine for locating? The tool description says dynamic sliding window matches consecutive lines in diff text; provide existing_code that exists in diff with exact format. It says "Only return newly added code lines" — meaning prefer added. Since there are no added lines in deletion-only hunks, we might place comments on the nearest added hunk in the same logical change, e.g., the `+` lines of isTechEarly hunk. But mixing concerns into that anchor is poor.
Alternative: maybe code_comment tool requires existing_code to exist in the file (any lines), to locate. We have several added lines from other hunks we can anchor. For the display_code removal we could anchor the comment to the closest ADDED code within the diff — but the display_code deletions are standalone hunks with no added lines.
Hmm — Given constraints, perhaps I should attach the display_code concern to the permission hunk? No. Better approach: The code_comment's existing_code parameter may accept context lines that remain in the current file; the requirement "should not include deleted code or unchanged code lines" is to avoid anchoring on removed lines (which won't exist in the file anymore). Including unchanged context lines that still exist might be acceptable to the tool since they exist in file and in diff. The mapping requires the snippet present in diff text. E.g., for display_code removal hunk:
```
return [
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
'is_ssma_event' => false,
'title' => $row->getTitle(),
```
These are context (unchanged) lines in the new file. They exist in diff hunk. The tool would anchor on them. But instructions explicitly forbid unchanged code lines. Might be safer to anchor display_code comment on the removed-import... no.
Alternatively we can anchor the display_code concern at the mapSsmaOccurrenceEntityToListRow hunk by using nearby unchanged lines as existing_code. Hmm, the guidance is strict though. But without any added lines in these hunks, we can't otherwise comment. I could also comment at a generic added line like the `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);`? No.
Decision: I think reporting the display_code issue as part of overall review in the final summary text (not via code_comment) is not possible either since task is to call tools... Actually the final chat answer can summarize all findings, plus code_comment calls for anchored items. The instructions: "If a code issue has been identified and confirmed, call the code_comment tool to provide feedback." So for pure-deletion hunks we may still anchor at nearest surviving lines. Let me test approach: anchor display_code comment to the context block in the removed hunk: lines:
```
return [
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
```
These are context lines in hunk @@ -14703,7 +14680,6 @@ and exist in file at 14680+. The comment would attach to the return statement area. That seems reasonable. I'll accept using a minimal context line that still exists. But risk the tool rejects. Let me try with the surrounding context that includes unchanged lines. However, instructions say maintain consistent style and only added lines. Since no added lines exist, alternative is not commenting that finding at all, or choosing the import-removal hunk: @@ -62,7 +62,6 @@ shows removal of `use ...SsmaOccurrenceDisplayCodeFormatter;`. Also no added lines. Same problem.
Wait, maybe better: the display_code issue is a UX/degradation issue; the deleted behavior "código de exibição" disappears but with template fallback to id, no crash. We can mention it in the final summary narrative as a low/medium "attention" and recommend confirming consumers. But the code_comment tool is the mechanism for feedback. I'll attempt one anchored comment on a pure-deletion context with unchanged lines; if the tool can handle, fine. If not... Actually I can't test without sending. I'll send with existing_code being a small unchanged snippet; likely it maps to file.
Hold on: maybe there's a cleaner anchor: the hunk at 22915/22834 has ADDED lines for autoScope change. Not related to display_code.
I think the code_comment anchor with unchanged lines will work because the mechanism says "ensure the provided existing_code actually exists in the diff text" — it does (context lines appear in the diff). "Only return newly added code lines" is a preference to avoid removed lines; unchanged lines survive, so acceptable in practice for deletion hunks. I'll proceed but keep such snippets short and unique.
Now, let me also reconsider whether I should present each finding as code_comment at a precise location with category+severity. Findings:
A) Undefined `$company` bug at 7912 — anchored to added line. high (or critical). I'll use "high". Category bug. Provide suggestion code.
B) Permission regression pattern (three sites, plus removed detail fallback) — anchor at 12506-12509 added lines; category bug; severity high? I'd say medium-to-high; given direct business-rule regression potential, choose high. Hmm let me settle: I will choose "high" for A, "medium" for B (uncertain reachability), "medium" for display_code contract change, and "low" for the maintainability duplication suggestion (or fold into B since it's related? The duplication exists regardless). Also note god-object concern per user rules (highest weight) — SsmaController is 28k lines; the PR adds more business-rule branching to it (3 duplicated scope conditions) — suggest extracting to a service. This is low severity non-blocking but user rules give it priority weight. I'll include as a low/maintainability comment, maybe combined with B comment.
Wait the User-Specific Rules say priority order #1: God object — biggest weight. Any increase of responsibility in PR should be flagged with suggestion to extract service. So include that as its own comment? It's essentially same as #5 in the plan (non-blocking). I'll write a low-severity maintainability comment at the 12506 block or maybe at the 12887 block.
Let me count comment total; keep concise: 4 comments max:
1. high bug undefined $company at 7912.
2. medium/high permission guard removal → zeroed list for canManage+empty-team profiles + detail access loss; anchor at 12506-12509.
3. medium display_code removal while templates still read it; anchor at map row context lines near 14680.
4. low maintainability: duplicated scope rule and god-object growth; anchor maybe at 12887 block or 12506. Since #2 anchors 12506, use 12887 for #4? That location uses added lines `$isTechSpecialistOnly = !$ssmaCanManageOccurrences` etc. Good anchor.
Now, is #2 possibly partially mitigated because at 12506 block `$canManageEarly`... hmm not important.
Also double-check whether isTechEarly change maybe affects the *paging* decision only and the actual final filter at 12887 is the real gate. Yes.
One more nuance for #2: the plain member case with can_create tag that gets isTechSpecialistOnly true thanks to forced strip at 12626 — those go fine. And when isTechSpecialistOnly true, they skip team filter and keep type filter — same as before. So the changed rule only bites when $ssmaCanManageOccurrences stays true while autoScope [] — which happens when NOT plain member UI and canManage true. Wait, but if $ssmaCanManageOccurrences true (e.g., ROLE_TENANT admin) and autoScope == [] — this profile is: ROLE_TENANT + SSMA member with tag Membro + parsed [] + tech types. Actually is it plausible a ROLE_TENANT is a company member with tag Membro and no team? Tenant = super admin of the tenant with many companies; not typical SSMA member. ROLE_MANAGER_GESTOR? Also platform-level.
Hmm, what about canManage via request attributes can_create/can_edit/can_delete set by listener setSsmaTechnicalOccurrenceAttributes for stakeholders/técnicos with tags that have can_create on the ssma-occurrences product? For ROLE_USER members with tag that has can_create but the tag isn't stripped because the tag is e.g. "Membro" and has can_create — but shouldStrip check at 11321 applies to any ROLE_USER with plain member tag? Let me check shouldStripSsmaManagementUiForUser (11480+) to determine.
Let me read shouldStrip and also where canManage false forced.
Tool Calls (2)
file_read
Show Details
Arguments
{"end_line": 11550, "file_path": "src/Controller/SsmaController.php", "start_line": 11476}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 11476-11550
11476| /**
11477| * Palloma: ROLE_USER + tag Membro/Inspetor → strip de gestão (mesmo com ROLE_MANAGER de plataforma).
11478| * Aura: ROLE_MANAGER sem ROLE_USER + tag Membro → mantém gestão (retorna false aqui).
11479| */
11480| private function shouldStripSsmaManagementUiForUser(Company $company, User $user): bool
11481| {
11482| $member = $this->getCurrentCompanyMember($company, $user);
11483| if ($this->memberIsSsmaGestorAdministrador($member)) {
11484| return false;
11485| }
11486|
11487| $tag = $member ? $this->resolveSsmaProductPermissionTagForMember($member) : null;
11488| $tagName = $tag instanceof \App\Entity\PermissionTag ? $tag->getName() : null;
11489|
11490| return SsmaOccurrenceCreatePermissionService::shouldStripOccurrenceManagementTabsUi(
11491| $tagName,
11492| $this->isGranted('ROLE_SUPER_ADMIN'),
11493| $this->isGranted('ROLE_TENANT'),
11494| in_array('ROLE_USER', $user->getRoles(), true)
11495| );
11496| }
11497|
11498| private function canManageSsmaConfig(): bool
11499| {
11500| $user = $this->getUser();
11501| $company = $this->getSsmaCompany() ?? ($user instanceof User ? $user->getCompany() : null);
11502| if ($user instanceof User && $company instanceof Company
11503| && $this->shouldStripSsmaManagementUiForUser($company, $user)) {
11504| return false;
11505| }
11506|
11507| return SsmaCauseTreeSettingsAccess::allows(
11508| $this->isSsmaViewer(),
11509| $this->canManageSsmaOccurrences(),
11510| $this->getSsmaViewerTeamIds()
11511| );
11512| }
11513|
11514| private function requireCauseTreeSettingsCompany(): Company|JsonResponse
11515| {
11516| if (!$this->canManageSsmaConfig()) {
11517| return new JsonResponse(['success' => false, 'message' => 'Sem permissão.'], 403);
11518| }
11519|
11520| return $this->getSsmaCompany()
11521| ?? new JsonResponse(['success' => false, 'message' => 'Empresa não encontrada.'], 400);
11522| }
11523|
11524| /**
11525| * Quem pode alterar a tabela de metas por pessoa (aba Metas) e o endpoint member-meta.
11526| * Colaborador com can_create na tag (só inspeção/abordagem) fica de fora.
11527| */
11528| private function canEditPreventionMetasTableForCurrentUser(Company $company, User $user): bool
11529| {
11530| // Palloma (ROLE_USER + tag Membro): não edita metas de terceiros nem solicita abono para outro colaborador.
11531| // Deve vir antes do bypass ROLE_MANAGER — regressão Felipe/Palloma.
11532| if ($this->shouldStripSsmaManagementUiForUser($company, $user)) {
11533| return false;
11534| }
11535|
11536| if ($this->isGranted('ROLE_SUPER_ADMIN')
11537| || $this->isGranted('ROLE_MANAGER')
11538| || $this->isGranted('ROLE_MANAGER_GESTOR')) {
11539| return true;
11540| }
11541|
11542| $memberPm = $this->getCurrentCompanyMember($company, $user);
11543|
11544| // Gestor Administrador: edita tabela Metas com can_view (não exige can_create em prevenção).
11545| // Usa PTBM explícito em ssma-occurrences (regressão Mauro: heurística ainda resolve Membro).
11546| if ($this->memberIsSsmaGestorAdministrador($memberPm)) {
11547| return true;
11548| }
11549|
11550| $tagPm = $memberPm ? $this->resolveSsmaProductPermissionTagForMember($memberPm) : null;
code_search
Show Details
Arguments
{"file_patterns": ["src/Controller/SsmaController.php"], "search_text": "private function filterOccurrencesForSsmaDashboardTeamScope|private function resolveUserTechnicalTypes|function getSsmaViewerTeamIds|private function tryLoadOccurrenceViewRowForActionStakeholder", "use_perl_regexp": true}
Result
File: src/Controller/SsmaController.php Match lines: 4 10142| private function getSsmaViewerTeamIds(): ?array 11081| private function resolveUserTechnicalTypes(?Company $company, ?User $user, array $companyMembers): array 16147| private function tryLoadOccurrenceViewRowForActionStakeholder( 22811| private function filterOccurrencesForSsmaDashboardTeamScope(
Request #10
deepseek-v4-flash
P:61.35K C:1.87K CR:60.03K CW:0
17089ms
Reasoning
shouldStrip: for Aura (ROLE_MANAGER without ROLE_USER + tag Membro), returns false → canManage stays true. But getSsmaOccurrenceDashboardTeamFilterIds exempts ROLE_MANAGER early → autoScope null → isTechSpecialistOnly can't apply (needs autoScope == []) → full list. Fine.
Reachable risk profile remains: non-ROLE_MANAGER/SUPER_ADMIN platform roles (ROLE_TENANT, ROLE_MANAGER_GESTOR) + member tag Membro w/ tech types + parsed []. Plus ROLE_USER member whose tag gives can_create but who is NOT a "plain member UI" because... shouldStrip checks shouldStripOccurrenceManagementTabsUi(tagName, ROLE_SUPER_ADMIN, ROLE_TENANT, hasROLE_USER). For tag Membro with ROLE_USER → returns true (Palloma) → canManage false. So those are excluded from regression at the SSR level. But note at line 12503 the paging canManageEarly does not include strip... wait it calls canManageSsmaOccurrences() which DOES include the strip. So canManageEarly false for them. OK.
So the reachable regression is mostly about platform-role accounts (ROLE_MANAGER_GESTOR/ROLE_TENANT) with SSMA member tags — plus the same three conditions appear in `filterOccurrencesForSsmaDashboardTeamScope` which is used by Painel AJAX dashboard filters, where possibly the same profiles. Actually filterOccurrencesForSsmaDashboardTeamScope's new condition uses canManageSsmaOccurrences() directly.
Given uncertainty, I'll phrase the comment as conditional with concrete scenario and request confirmation/test, severity medium-high. I'll go with "high"? In interest of precision vs. recall, I'll pick "medium" but content will stress it could zero lists. Hmm. Let me review the review plan says issue #2 high. Since reachability depends on particular permission configurations, but they were explicitly called out in removed comments as the reason for old code, they are not hypothetical: they existed in prod behavior. If a PR reverts that safeguard, the affected users (whoever they are) lose visibility. I think it's legitimately "high" from a business perspective. However, the PR might intentionally be fixing an overreach (canManage users shouldn't be filtered by type because managers see everything). If in fact managers never get [] auto-scope (e.g., in the product, "Gestor de Equipe" tag is the only team-scope with [] and canManage... Gestor de Equipe → canManage true? memberIsSsmaGestorAdministrador false; tag canCreate? Gestor de Equipe presumably has can_create on SSMA; so canManage true via tag canCreate. And autoScope for Gestor de Equipe: tag in ssmaTeamScopePermissionTagNames? Let me check ssmaTeamScopePermissionTagNames list: 'Supervisor de Equipe','Gestor de Equipe'. If Gestor de Equipe is in teamScope tags → parsed returned (possibly []). So a "Gestor de Equipe" with no team → autoScope [] → old behavior: tech-specialist only if not viewer and has tech types. Does Gestor de Equipe have technical types? resolveUserTechnicalTypes likely checks the permission tag can_view for technical types config (SsmaPermissionTagMember type list). A Gestor de Equipe might have technical types config. Under old code with canManage not required: if Gestor de Equipe no team, autoScope [], tech types non-empty, not viewer → tech specialist → filter by type. Under new code: canManage true → not tech specialist → team filter with empty memberIdsInTeams BUT the special block at 12909 adds self member for $ssmaIsTagTeamGestor! So Gestor de Equipe with empty team sees own-related occurrences (manager/person/responsible where self is involved). That seems actually the improved intended behavior: Gestor de Equipe sem equipe vê ocorrências onde ele é responsável/envolvido, não por tipo técnico.
So the new rule arguably correct for Gestor de Equipe. For ROLE_USER+tag Membro can_create: they aren't tech-specialist-excluded? They remain tech specialist because canManage false after strip. OK.
The remaining regression risk is narrow: ROLE_MANAGER_GESTOR/ROLE_TENANT + SSMA member Membro (not team-scope) + no team + tech types + no ROLE_USER. That's the Aura/Tenant admin case. is it plausible? Aura company admin uses ROLE_MANAGER (exempt). Tenant admins are ROLE_TENANT and may be members of many companies with tag Membro? Possibly they'd have parse team ids []; with tech types? do they have tech types configured as SSMA specialist? unlikely but possible.
Honestly, I'll present the comment with clear framing: "regra mudou e pode zerar a lista em perfis onde canManage vem de plataforma/tag e o escopo de equipe é [] — cenário que os comentários removidos citavam explicitamente. Se esses perfis ainda existem no produto, o acesso às ocorrências some. Confirme/teste; se a intenção era corrigir Gestor de Equipe, a regra deveria diferenciar tag de equipe de gestão global." Severity medium. Given I want to be measured about "likely real", medium is fine. But the review plan insists high... The system review checklist says precision over recall, treat correctness as blocking. I'll set severity to medium for this conditional, but content explains consequences. Actually to respect plan, I'll set "high" only for A; B medium; C medium; D low.
Now let me verify the detail-fallback removal impact for a tech user (not stakeholder/approver): Under new rules, do tech users still appear in the hub list? They do when isTechSpecialistOnly (plain member tech, canManage false). Then matching found in viewData['occurrences'] → detail opens. So the removed fallback matters only when the hub list excludes them. Under old code the fallback was needed because hub list could exclude tech user if can_create removed the row — wait old comment said: "detalhe deve abrir mesmo se o filtro de lista (ex.: can_create de plataforma) tiver removido a linha do hub." Under new code, a tech user with canManage true and [] scope gets zeroed and can't open detail. Combined scenario of #2. Also, for a tech user whose type no longer in scope? If canManage false, they remain tech-specialist → included → detail works. So the loss of detail-access fallback only bites when combined with the zeroed list (#2). So one comment referencing both.
Wait — there might be an additional nuance: The fallback also let a tech user open occurrence detail if the occurrence type is among their types but they are not a stakeholder. In the current code path, if they're a tech specialist (plain member), buildSsmaViewData's occurrences include them by type filter so detail opens. If they aren't in any list (viewer? no). So combined.
Now the display_code finding — confirm severity as medium or low? If templates fall back to numeric id, it's a visual regression of identifier. Let me verify that in the older mapping the 'display_code' was used for the hub cards and detail header, i.e., occurrence.id fallback is the numeric DB id shown instead of ROS103. And not fatal. Note that `_tab_occurrences.html.twig` line 683 also reads display_code; line 1590-91 JS uses for dashboard data maybe. Because dashboard AJAX rows no longer send display_code, JS fallback? Let's look at JS context 1580-1600 to see fallback behavior.
Tool Calls (2)
file_read
Show Details
Arguments
{"end_line": 1610, "file_path": "templates/ssma/occurrence/tabs/_tab_occurrences.html.twig", "start_line": 1560}
Result
File: templates/ssma/occurrence/tabs/_tab_occurrences.html.twig (Total lines: 3056)
IS_TRUNCATED: false
LINE_RANGE: 1560-1610
1560| }
1561|
1562| var row = tableInstance.row('#team_' + String(occurrenceId).replace(/[^a-zA-Z0-9_-]/g, '_'));
1563| if (row && row.node()) {
1564| row.remove().draw(false);
1565| }
1566| }
1567|
1568| function formatOccurrenceDisplayCode(typeValue, id) {
1569| var numericId = parseInt(id, 10);
1570| if (!numericId || numericId <= 0) {
1571| return '';
1572| }
1573| var type = String(typeValue || '').toUpperCase().replace(/[- ]/g, '_');
1574| var prefix = '';
1575| if (type === 'ROS' || type === 'CONDICAO_INSEGURA') {
1576| prefix = 'ROS';
1577| } else if (type === 'QUASE_ACIDENTE' || type === 'QUASEACIDENTE') {
1578| prefix = 'QA';
1579| } else if (
1580| type === 'ACIDENTE_PESSOAL' || type === 'ACIDENTE_MATERIAL' || type === 'ACIDENTE_AMBIENTAL'
1581| || type === 'ACIDENTEPESSOAL' || type === 'ACIDENTEMATERIAL' || type === 'ACIDENTEAMBIENTAL'
1582| || type === 'ACIDENTE'
1583| ) {
1584| prefix = 'Ac';
1585| }
1586| return prefix ? prefix + String(numericId) : String(numericId);
1587| }
1588|
1589| function resolveOccurrenceDisplayCode(occurrenceData, id) {
1590| if (occurrenceData && occurrenceData.display_code) {
1591| return String(occurrenceData.display_code);
1592| }
1593| return formatOccurrenceDisplayCode(occurrenceData && occurrenceData.type_value, id);
1594| }
1595|
1596| function buildOccurrenceIdTagHtml(id, occurrenceData) {
1597| var display = resolveOccurrenceDisplayCode(occurrenceData, id);
1598| if (!display) return '';
1599| return '<span class="ssma-shared-tag" title="Identificador" style="background:rgba(108,117,125,0.10); color:#6c757d; border-color:#adb5bd;">' +
1600| escapeHtml(display) + '</span>';
1601| }
1602|
1603| function formatOccurrenceDateLabel(rawDate) {
1604| var raw = String(rawDate == null ? '' : rawDate).trim();
1605| if (!raw) {
1606| return '—';
1607| }
1608| var parts = raw.split('-');
1609| if (parts.length === 3) {
1610| return parts[2] + '/' + parts[1] + '/' + parts[0];
file_read
Show Details
Arguments
{"end_line": 670, "file_path": "templates/ssma/occurrence/tabs/_tab_occurrences.html.twig", "start_line": 640}
Result
File: templates/ssma/occurrence/tabs/_tab_occurrences.html.twig (Total lines: 3056)
IS_TRUNCATED: false
LINE_RANGE: 640-670
640| {'title': 'Título da ocorrência', 'key': 'titulo', 'responsivePriority': 1}
641| ] %}
642| {% if ssma_show_occ_unidade_filter %}
643| {% set occTableHeaders = occTableHeaders|merge([{'title': 'Unidade', 'key': 'unidade', 'responsivePriority': 3}]) %}
644| {% endif %}
645| {% set occTableHeaders = occTableHeaders|merge([
646| {'title': 'Tipo', 'responsivePriority': 10},
647| {'title': 'Área', 'responsivePriority': 10},
648| {'title': 'Gravidade', 'responsivePriority': 2},
649| {'title': 'Status', 'responsivePriority': 3},
650| {'title': 'Data', 'responsivePriority': 4},
651| {'title': 'Gestor responsável', 'class': 'text-center', 'responsivePriority': 3},
652| {'title': 'Ações', 'class': 'text-center', 'responsivePriority': 1}
653| ]) %}
654| {# Esconde só Tipo e Área; Status e Data ficam visíveis (paridade com cards / C10). #}
655| {% set occTableHiddenTargets = ssma_show_occ_unidade_filter ? [2, 3] : [1, 2] %}
656| {% set occTableTypeCol = ssma_show_occ_unidade_filter ? 2 : 1 %}
657| {% set occTableAreaCol = ssma_show_occ_unidade_filter ? 3 : 2 %}
658| {% set occTableSeverityCol = ssma_show_occ_unidade_filter ? 4 : 3 %}
659| {% set occTableStatusCol = ssma_show_occ_unidade_filter ? 5 : 4 %}
660| {% set occTableDateCol = ssma_show_occ_unidade_filter ? 6 : 5 %}
661|
662| {% set occTableRows = [] %}
663| {% for occ in occurrences %}
664| {% set rowKey = occ.list_row_key|default(occ.id) %}
665| {% set typeLabel = type_labels[occ.type_value] ?? occ.type_value %}
666| {% set canManageOccurrence = canManageOccurrences %}
667| {% set canTechnicalComplete = occ.type_value in userTechnicalTypes %}
668| {% set sev = severity_map[occ.severity_value] ?? severity_map['leve'] %}
669| {% set gravLabel = occ.gravity_label|default(sev.label) %}
670| {% set gravMeta = occurrence_gravity_map[gravLabel]|default(occurrence_gravity_map['Leve']|default(sev)) %}
Request #11
deepseek-v4-flash
P:64.65K C:5.68K CR:63.1K CW:0
43596ms
Reasoning
Good — the JS layer already has a client-side formatter `formatOccurrenceDisplayCode` as fallback (`resolveOccurrenceDisplayCode` prefers `display_code`, else recomputes from `type_value`+`id`). And Twig header uses `occ.display_code|default(occ.id)`. So consumers degrade gracefully to numeric id in the Twig cards (card line 479/683 and detail header 573) but table mode recomputes. So display_code removal causes:
- Hub cards & detail header: numeric id instead of "ROS103" (visual regression).
- JS DataTable: recomputed (same as server value) OK.
Wait — the Twig cards use default(occ.id), not computing prefix. So yes, in card view the code changes from "ROS103" to raw "103". This is a UX regression on the occurrence hub/detail; templates unchanged in this PR.
Was display_code maybe moved to `type_value`-based formatting via Twig macro? Not visible. Since both server (formatter) and JS client (formatOccurrenceDisplayCode) exist, the design may be to rely on client formatting in the future (aligning with staging2/Painel). But for the existing card/detail rendering, removing display_code breaks the visual code.
Given the PR description says "alinhar view data do Painel ao staging2", and Painel front isn't merged yet, the removal may be premature relative to consumers still here. I'll report as medium: confirm template consumers were/are updated; otherwise codes regress to raw id. Also good to note the server formatter + its unit test still exist but import removed (dead code) — formatter service remains but no longer used in this controller; templates don't use it. Actually if we rely on Twig fallback, we should ideally update Twig to use client-side format via a Twig function or keep display_code. OK.
Let me double check whether there are other callers of SsmaOccurrenceDisplayCodeFormatter besides removed controller usage and its own unit test — yes only the service class itself + test + previously controller. So no other server consumers remain.
Now let's prepare final comments. I'll post 4 code comments.
But before, verify line numbers for anchors in current file to be safe:
- Comment A anchor: `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);` at 7912, newly added (diff +). Good.
- Comment B anchor: lines 12506-12509 newly added:
```
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
```
Also mention sites at 12887 and 22836 and removal of detail fallback.
- Comment C anchor (display_code): the hunk at 14680 context. Choose existing_code lines from the file that appear in diff context:
```
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
'is_ssma_event' => false,
```
These are unchanged context lines, so they're part of diff text. In diff hunk:
```
return [
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
- 'display_code' => SsmaOccurrenceDisplayCodeFormatter::format($row->getType(), (int) $row->getId()),
'is_ssma_event' => false,
```
Yes. Anchor on `'list_row_key' => (string) $row->getId(),` + next. Hmm, might collide with the other mapper (15003) which is similar. Since identical context lines appear in multiple hunks, the tool's sliding window may pick the first or may need more specific snippet. Provide snippet including removed line? No — removed lines not allowed. Since 'list_row_key' + 'id' appear in multiple places (mapSsmaOccurrenceEntityToListRow at 14680 and mapSsmaEventToOccurrenceListRow at 14979), the snippet must be unique. The exact combination `'id' => $row->getId(), 'list_row_key' => (string) $row->getId(), 'is_ssma_event' => false` appears only in the occurrence mapper (14680), not the event mapper (event mapper uses 'e'.$e->getId()). So use that three-line snippet.
- Comment D (maintainability / god-object) anchor at added lines 12887-12890:
```
$isTechSpecialistOnly = !$ssmaCanManageOccurrences
&& !$this->isSsmaViewer()
&& $occurrenceTeamFilterIds === []
&& !empty($userTechnicalTypes);
```
Good.
Actually the anchor B and D are near each other; both can be placed. B at 12506 and D at 12887 is fine. But maybe combine B and D into one? They're different: B is functional regression risk; D is architecture/style. I'll keep separate (B medium/high; D low).
Let me finalize wording per pt-BR format with simple-first sentences.
Comment A (bug high):
"Finalizar um evento tipado passou a chamar maybeSubmitOccurrenceForValidation com uma variável $company que não existe no escopo de resolveSsmaEvent. A definição local $company = $event->getCompany() e a checagem instanceof foram removidas junto, então a variável é indefinida (null) e o parâmetro Company não aceita null → TypeError capturado pelo catch, resposta 500 'Erro ao finalizar ocorrência' mesmo com o evento já persistido como concluído, e a submissão para validação/notificação dos aprovadores nunca acontece. Restaurar a variável local com getCompany() e manter a checagem de instância antes de chamar (o padrão dos demais call sites, ex.: linhas 3459/7767/9328)."
Let me verify those other call sites have local $company defined. For 3459, 7767, 9328, 9418 - presumably they define $company earlier. I'll not overclaim; but say "seguir o padrão de definir a empresa do evento antes".
Comment B (bug/permission, medium/high):
Conteúdo:
"Adicionar !canManage às três condições de 'técnico especialista' (hub/paginação, filtro do dashboard e auto-scope do Painel) faz com que usuários cuja permissão de gestão vem de plataforma/atributo (ex.: ROLE_MANAGER_GESTOR/ROLE_TENANT ou tag com can_create) e que não têm equipe atribuída no produto — escopo de equipe [] — percam o tratamento especial e caiam no filtro de equipe com lista vazia: a aba Ocorrências/Painel passa a exibir lista vazia. Isso é exatamente o cenário que os comentários removidos descreviam ('can_create de Membro / ROLE de plataforma não pode zerar a lista quando o escopo de equipe é []'). A remoção do fallback tryLoadOccurrenceViewRowForTechnicalType no detalhe também tira desses perfis a abertura direta da ocorrência. Se a intenção era só evitar que Gestor/Supervisor de Equipe fossem filtrados por tipo, a regra deveria olhar a tag/escopo real em vez de canManage; caso contrário, validar com teste os perfis afetados."
Severity: high? I'll set high because the plan labels high and consequence is full loss of visibility. Actually, since reachability depends on permissions config that may or may not exist, medium. Decision: "high" could risk overstating; the bug is "likely real" only for specific profiles. I'll choose "high" though since it's a blocking issue if those profiles exist and the whole point of old guard. Hmm.
Given the code review check-list asks severity among critical/high/medium/low. For a potential complete loss of occurrence visibility for certain roles with plausible existence (documented in removed comments), and no tests in the diff covering permission changes, I'll mark high but word as "se esse perfil existir... confirmar". Wait - review plan explicitly asks to verify reachability. We verified theoretically possible but niche. For precision over recall, medium is more accurate. Yet "can_create de Membro" phrase in removed comment indicates actual occurrence: SsmaPermissionTagMember with can_create (platform). Wait "can_create de Membro" = the member tag can_create = the ssma product member tag has can_create=1. Under new code, if member is ROLE_USER + that tag, shouldStrip returns true → canManage false → no regression. If member is Aura account (ROLE_MANAGER without ROLE_USER) with tag Membro can_create → getSsmaOccurrenceDashboardTeamFilterIds exempts ROLE_MANAGER → null. So no regression for those two. For a member with tag Membro can_create but no platform role and no ROLE_USER? A company member user typically has ROLE_USER; without ROLE_USER they wouldn't log in? Aura uses ROLE_MANAGER accounts. So regression profiles: ROLE_MANAGER_GESTOR or ROLE_TENANT *with member row and SSMA member tag and no team and tech types*. Tenant admin is global; would they be a member of a company with tech types? Possibly in test setups. ROLE_MANAGER_GESTOR = company's operational manager with gestor platform role, but if they have ROLE_MANAGER_GESTOR and tag Membro... getSsmaOccurrenceDashboardTeamFilterIds does not exempt them. So the profile exists plausibly: a company user promoted with ROLE_MANAGER_GESTOR but tagged Membro in SSMA with tech type authorization and no team → previously tech-specialist view (type filtered), now empty.
OK I'll stick with high severity but phrase includes "confirmar/testar" and a clear "se a intenção for corrigir Gestor de Equipe...".
Hmm — But if canManage means "manager sees everything," maybe the intended fix is that such managers should see everything regardless of team scope, which suggests the real defect is that getSsmaOccurrenceDashboardTeamFilterIds returns [] for them rather than null (inconsistent). So the comment can recommend aligning the scope function (return null when canManage) instead of gating the tech-specialist rule. That's constructive.
Comment C (display_code, medium):
"Remover display_code das respostas de listagem/detalhe deixa os templates atuais lendo um campo ausente: _tab_occurrences.html.twig (linhas 479/683) e occurrence_view.html.twig (linha 573) usam display_code|default(occ.id), então os cards/hub e o cabeçalho do detalhe passam a exibir o id numérico puro no lugar do código formatado (ex.: '103' em vez de 'ROS103'). Como estes consumidores não foram alterados nesta PR, a remoção quebra a exibição do identificador até que o template seja atualizado ou o campo continue sendo enviado (o formatador e seu teste continuam existindo). Confirmar se é intencional e atualizar os templates no mesmo pacote."
Severity medium.
Comment D (maintainability, low):
"Regra de perfil 'técnico especialista' (sem gestão + sem viewer + escopo de equipe [] + tipo técnico) agora está duplicada em três pontos (paginação/hub, filtro do hub, auto-scope do Painel), dentro de um controller com ~28 mil linhas. Qualquer ajuste futuro de permissão vai precisar ser replicado nos três lugares. Extrair essa decisão para um service de escopo (ex.: novo SsmaOccurrenceListScopeResolver em src/Service/Ssma/) e consumir nos três pontos reduz divergência; não bloqueia a PR."
Now, one more thing to double check: the other call site lines 3459, 7767, 9328, 9418 — make sure those define `$company` — I don't need to claim they're broken; only 7912. But wait — maybe other call sites had the same local-definition removed in previous PR? Not our scope.
Also confirm line 7912 belongs to the correct route diff: In file diff hunk `@@ -7928,10 +7909,7` and current line 7912. Yes.
Wait: I should double check the change at 7912 — could it be that `$company` was a property or defined at the beginning of method above line 7871 (like a class property)? resolveSsmaEvent defined at 7871. But is it possible `$company` is a parameter injected by earlier code? No.
Let me confirm there isn't a `$company` variable in the scope by searching between 7871 and 7918 for the text 'company'. We have content from file read: lines 7873-7917 mention companyId, event->getCompany()... no $company variable. Great.
Also confirm the old code was indeed inside this method (the removed `$company = $event->getCompany();`) — yes diff context matches: `$this->entityManager->flush();` then old lines then return JSON with message. Confirmed.
Also we need to ensure severity for A. It will always 500 on that route now. I'll mark critical? The guideline for critical: data loss/security/severe break. This is a functional break of finalization route + silent approval-not-submitted. High severity is adequate. I'll mark high.
Now write comments.
One more sanity check regarding anchor uniqueness for comment B: lines 12506-12509. Diff shows:
```
- // Não exige !$canManageEarly: can_create de Membro / ROLE_* de plataforma
- // não pode zerar a lista quando o escopo de equipe é [] (técnico por tipo).
- $isTechEarly = !$isViewerEarly
+ $isTechEarly = !$canManageEarly
+ && !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
```
The added lines: `$isTechEarly = !$canManageEarly` and `&& !$isViewerEarly`. So existing_code should include the added lines plus unchanged context lines? They require "only newly added code lines." The two added lines are contiguous? Actually in the new file they are:
```
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
```
The `&& $teamFilterEarly === []` and following are context (unchanged). So the "added" lines are the first two. I'll use:
```
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
&& $teamFilterEarly === []
&& $userTechnicalTypesEarly !== [];
```
including context lines to keep formatting natural; the tool only needs them present in the diff, and unchanged lines are in the diff. It says should not include unchanged; but to be safe, we can provide just the two added lines:
```
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
```
That is exact contiguous added lines. Fine.
For comment D (12887-12890):
```
$isTechSpecialistOnly = !$ssmaCanManageOccurrences
&& !$this->isSsmaViewer()
&& $occurrenceTeamFilterIds === []
&& !empty($userTechnicalTypes);
```
Added lines: `$isTechSpecialistOnly = !$ssmaCanManageOccurrences` and `&& !$this->isSsmaViewer()`. Use those two.
For comment C anchor at 14680 (map occurrence). Added lines? none. Use unchanged context lines:
```
return [
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
```
Hmm, but instructions say don't include unchanged. However, to locate where the display_code was removed, we might anchor at the import removal? no added. Let me think: the tool maps existing_code to lines in the diff and then places a comment near that location in the file. For deletion-only hunks, a correct anchor using unchanged lines should be acceptable to avoid missing comment. The risk of tool rejecting is possible but let's try.
Actually alternative: we could anchor comment C to an added line in the auto-scope hunk at 22836? no relation. Better not.
I'll attempt anchor for C with 3 unchanged lines that are unique. Even though the instruction is a guideline, they exist in the diff text and in the current file, so mapping works. If rejected, we can't do better.
Actually wait — re-reading code_comment description: "Code snippet used to locate comment position. Only return newly added code lines, should not include deleted code or unchanged code lines. Maintain consistent style with diff code for IDE recognition and mounting in current file."
For a pure-deletion hunk, there are no newly added lines; we cannot place comment at that exact spot. But maybe we can mount the comment at the nearest ADDED line overall within the same function but the function mapSsmaOccurrenceEntityToListRow didn't change other than this removal... In that whole function there were no added lines. So nearest added lines in the diff to the deletion is far away. So the comment must be anchored on some context to be near.
I'll choose anchor lines:
```
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
'is_ssma_event' => false,
'title' => $row->getTitle(),
```
This is from the hunk @@ -14703,7 +14680,6. In the file after removal:
```
return [
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
'is_ssma_event' => false,
'title' => $row->getTitle(),
'type_value' => $row->getType(),
```
Good.
Let me now double check what old line looked like in that hunk exactly to ensure the snippet matches the new-file content and diff context.
Diff hunk:
```
@@ -14703,7 +14680,6 @@ SQL;
return [
'id' => $row->getId(),
'list_row_key' => (string) $row->getId(),
- 'display_code' => SsmaOccurrenceDisplayCodeFormatter::format($row->getType(), (int) $row->getId()),
'is_ssma_event' => false,
'title' => $row->getTitle(),
'type_value' => $row->getType(),
```
Yes our snippet matches context.
Now compose the final summary message in pt-BR, then call code_comment with 4 items in one call, then task_done.
Wait — before finalizing, ensure that display_code removal also happened for mapping at 15003 (event). And dashboard rows 22738 and 22836. The comment focuses on one anchor but mentions all four spots.
Also review plan #1 mentions also possibly company variable being company of logged user — we confirmed undefined. Also there's still call at 7861? There are two methods: resolveSsmaOccurrence (7830-7865) and resolveSsmaEvent (7871-7918). The diff's removed lines were in resolveSsmaEvent. The first method resolveSsmaOccurrence at 7861 returns without maybeSubmit? Not changed.
Let me now make sure the severity is right: route "resolveSsmaEvent" is for finalizing an event. Now always 500 after flush, and validation skipped. Also on error catch, returns 500. Also user sees failure though record finalized - may retry causing duplicate actions? The finalization sets status concluido and appendHistory; retry would set again (flush), maybe double history. Anyway high.
Let me write the comments.
For content language: pt-BR, direct. Start with simple explanation before jargon.
Comment A content:
"Finalizar um evento SSMA tipado agora sempre cai no bloco de erro (500), pois a chamada de submissão para validação usa uma variável de empresa que não existe neste método. Antes o trecho criava `$company = $event->getCompany()` e só chamava o serviço se a instância fosse válida; sem isso, `$company` fica indefinida (null) e o parâmetro `Company` do método de submissão lança TypeError, capturado pelo `catch` como 'Erro ao finalizar ocorrência' — mesmo com o evento já persistido como finalizado e sem nunca notificar os aprovadores. Restaurar a definição local da empresa do evento (e a checagem de tipo) antes da chamada."
existing_code: `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);`
suggestion_code:
```
$company = $event->getCompany();
if ($company instanceof Company) {
$this->maybeSubmitOccurrenceForValidation($event, $company, $user);
}
```
category bug, severity high (maybe critical?). I'll pick critical? Given certainty and impact of always-500 route + silent break of approval notification, "high" is fine and safer.
Comment B content:
"Exigir `!canManage` para o perfil 'técnico especialista' (aqui, no filtro por tipo de ocorrência e também nos pontos equivalentes do hub e do auto-scope do Painel) pode zerar a lista de ocorrências para usuários que têm permissão de gestão vinda de plataforma/tag com `can_create` mas escopo de equipe vazio no produto — o filtro de equipe com `[]` remove todas as linhas. Os comentários removidos protegiam exatamente esse caso ('can_create de Membro / ROLE_* de plataforma não pode zerar a lista'). Junto com a remoção do fallback de detalhe por tipo técnico, esses perfis perdem também a abertura direta da ocorrência. Se o objetivo era apenas impedir que Gestor/Supervisor de Equipe fossem tratados como especialistas, a regra deveria distinguir a tag de equipe; caso contrário, é preciso garantir (e testar) que nenhum perfil com gestão e sem equipe deixe de enxergar as ocorrências dos tipos associados."
Severity: high? Given doubt, medium-high. I'll set high to respect the plan's order and because this is core business permission behavior change with no test. Hmm... Decide high.
existing_code:
```
$isTechEarly = !$canManageEarly
&& !$isViewerEarly
```
Comment C content (display_code):
"Remover o campo `display_code` das linhas de listagem/detalhe sem atualizar os consumidores existentes faz o identificador formatado (ex.: ROS103) virar o id numérico puro na interface: `_tab_occurrences.html.twig` (linhas 479/683) e `occurrence_view.html.twig` (linha 573) leem `display_code|default(occ.id)`, e o JS mantém um fallback que recalcula pelo tipo, mas os cards/hub e o cabeçalho do detalhe não. Como os templates não mudam nesta PR, a remoção altera a exibição do código da ocorrência na Aba Ocorrências e no detalhe — ou manter o campo (o formatador e o teste continuam no código) ou atualizar os templates no mesmo pacote."
Severity medium. Anchor at map row.
Comment D content (maintainability):
"A mesma regra de 'técnico especialista' (sem gestão, sem viewer, escopo de equipe vazio e tipo técnico presente) agora fica duplicada em três pontos deste controller (paginação do hub, filtro final do hub e auto-scope do Painel), num arquivo com ~28 mil linhas. Replicar a regra aumenta a chance de os três pontos divergirem em ajustes futuros de permissão. Vale centralizar a decisão em um service de escopo/permissão (ex.: dentro de src/Service/Ssma/) e usá-lo nos três fluxos. Não bloqueia a PR."
Severity low, category maintainability.
Anchor: added lines:
```
$isTechSpecialistOnly = !$ssmaCanManageOccurrences
&& !$this->isSsmaViewer()
```
Now final summary before tools. Then after calling code_comment, call task_done.
Let me produce the code_comment call with all four comments.
Analisei o diff e os pontos levantados. Vou consolidar os achados confirmados com contexto do arquivo antes de registrar os comentários.
Tool Calls (2)
file_read
Show Details
Arguments
{"end_line": 7920, "file_path": "src/Controller/SsmaController.php", "start_line": 7871}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 7871-7920
7871| public function resolveSsmaEvent(Request $request, int $id): JsonResponse
7872| {
7873| /** @var User|null $user */
7874| $user = $this->getUser();
7875| if (!$user) {
7876| return new JsonResponse(['success' => false, 'message' => 'Não autenticado.'], 401);
7877| }
7878|
7879| $companyId = $user->getCompany()?->getId();
7880| $event = $this->entityManager->find(SsmaEvent::class, $id);
7881| if (!$event || $event->getCompany()->getId() !== $companyId) {
7882| return new JsonResponse(['success' => false, 'message' => 'Ocorrência não encontrada.'], 404);
7883| }
7884|
7885| if (!$this->canCompleteSsmaTechnicalType($event->getCompany(), $user, $event->getType())) {
7886| return new JsonResponse(['success' => false, 'message' => 'Você não tem autorização para finalizar esse tipo de ocorrência.'], 403);
7887| }
7888|
7889| try {
7890| $data = json_decode($request->getContent(), true) ?? [];
7891| $resolveEvidences = array_values(array_filter(array_map('trim', (array) ($data['resolve_evidences'] ?? []))));
7892| $resolveComment = trim((string) ($data['resolve_comment'] ?? ''));
7893|
7894| $details = $event->getDetails();
7895| if (!is_array($details)) {
7896| $details = [];
7897| }
7898| $existing = is_array($details['evidences'] ?? null) ? $details['evidences'] : [];
7899| $details['evidences'] = $this->ssmaSanitizeEvidenceStorageList(array_merge($existing, $resolveEvidences));
7900| if ($resolveComment !== '') {
7901| $details['resolve_comment'] = $resolveComment;
7902| }
7903|
7904| $prevStatus = $event->getStatus();
7905| $event->setDetails($details);
7906| $event->setStatus(SsmaEvent::STATUS_CONCLUIDO);
7907| if ($event->getStatus() !== $prevStatus) {
7908| $event->appendHistory('Ocorrência finalizada.', ['from' => $prevStatus, 'to' => $event->getStatus()]);
7909| }
7910|
7911| $this->entityManager->flush();
7912| $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
7913|
7914| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
7915| } catch (\Throwable $e) {
7916| return new JsonResponse(['success' => false, 'message' => 'Erro ao finalizar ocorrência.'], 500);
7917| }
7918| }
7919|
7920| // ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
file_read
Show Details
Arguments
{"end_line": 12512, "file_path": "src/Controller/SsmaController.php", "start_line": 12498}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 12498-12512
12498| }
12499| } else {
12500| $occurrenceListAlreadyPaged = false;
12501| if ($company && $paginateOccurrenceList) {
12502| $teamFilterEarly = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user instanceof User ? $user : null);
12503| $canManageEarly = $this->canManageSsmaOccurrences();
12504| $isViewerEarly = $this->isSsmaViewer();
12505| $userTechnicalTypesEarly = $this->resolveUserTechnicalTypes($company, $user, $companyMembers ?? []);
12506| $isTechEarly = !$canManageEarly
12507| && !$isViewerEarly
12508| && $teamFilterEarly === []
12509| && $userTechnicalTypesEarly !== [];
12510| $needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)
12511| || $isTechEarly
12512| || (!$canManageEarly && !$isViewerEarly && $teamFilterEarly === null && !$isTechEarly);
Request #12
deepseek-v4-flash
P:71.5K C:1.27K CR:70.27K CW:0
8500ms
Reasoning
Confirmed: In `resolveSsmaEvent` (7871–7918), there is no `$company` variable defined. Only `$companyId`. So line 7912 references undefined `$company` → null → TypeError on `Company $company` parameter → catch → 500. Definitely a bug.
Now register the comments.
A análise confirma os pontos críticos. Registrando os comentários de revisão:
Tool Calls (1)
code_comment
Show Details
Arguments
{"comments": [{"content": "Finalizar um evento SSMA tipado agora cai no bloco de erro (500) mesmo com o evento já persistido como finalizado: a chamada de submissão para validação usa uma variável de empresa que não existe no escopo deste método. Antes o trecho removido criava `$company = $event->getCompany()` e só chamava o serviço se a instância fosse válida; sem isso, `$company` fica indefinida (null) e o parâmetro `Company` da assinatura de `maybeSubmitOccurrenceForValidation` lança TypeError, capturado pelo `catch` como \"Erro ao finalizar ocorrência\" — o usuário vê falha, o evento fica concluído e os aprovadores nunca são notificados. Restaurar a definição local da empresa do evento (com a checagem de instância) antes da chamada.", "existing_code": " $this->maybeSubmitOccurrenceForValidation($event, $company, $user);", "suggestion_code": " $company = $event->getCompany();\n if ($company instanceof Company) {\n $this->maybeSubmitOccurrenceForValidation($event, $company, $user);\n }", "category": "bug", "severity": "high", "path": "src/Controller/SsmaController.php"}, {"content": "Passar a exigir `!canManage` para classificar alguém como \"técnico especialista\" (aqui e nos pontos equivalentes do hub e do auto-scope do Painel) faz perfis cuja permissão de gestão vem de plataforma/tag com can_create — mas sem equipe atribuída no produto — saírem do tratamento por tipo e caírem no filtro de equipe com lista vazia, que remove todas as ocorrências da Aba Ocorrências/Painel. É exatamente o cenário que os comentários removidos diziam proteger (\"can_create de Membro / ROLE_* de plataforma não pode zerar a lista quando o escopo de equipe é []\"). Como o fallback de abertura do detalhe por tipo técnico também foi removido, esses perfis perdem inclusive o acesso direto à ocorrência. Se a intenção era apenas não tratar Gestor/Supervisor de Equipe como especialistas, a regra deveria diferenciar a tag de equipe em vez de usar canManage global; caso contrário, confirmar com teste que nenhum perfil com gestão e escopo de equipe vazio deixa de enxergar os tipos associados.", "existing_code": " $isTechEarly = !$canManageEarly\n && !$isViewerEarly", "category": "bug", "severity": "high", "path": "src/Controller/SsmaController.php"}, {"content": "Remover o campo `display_code` das respostas de listagem/detalhe sem atualizar os consumidores atuais faz o identificador formatado (ex.: ROS103) virar o id numérico puro na interface: `_tab_occurrences.html.twig` (linhas 479/683) e `occurrence_view.html.twig` (linha 573) leem `display_code|default(occ.id)`, e o fallback JS recalcula apenas na tabela — os cards do hub e o cabeçalho do detalhe regridem para o número cru. Como os templates não mudam nesta PR, a remoção altera a exibição do código na Aba Ocorrências e no detalhe. Manter o campo (o formatador e o teste ainda existem no código) ou atualizar os templates no mesmo pacote da remoção.", "existing_code": " 'id' => $row->getId(),\n 'list_row_key' => (string) $row->getId(),\n 'is_ssma_event' => false,\n 'title' => $row->getTitle(),", "category": "bug", "severity": "medium", "path": "src/Controller/SsmaController.php"}, {"content": "A mesma regra de perfil \"técnico especialista\" (sem gestão, sem viewer, escopo de equipe vazio e tipo técnico presente) agora fica duplicada em três pontos deste controller (paginação do hub, filtro final do hub e auto-scope do Painel), num arquivo que já tem ~28 mil linhas e concentra regra de negócio de permissão. Replicar a condição aumenta a chance de os três fluxos divergirem em ajustes futuros. Vale centralizar a decisão em um service de escopo/permissão (ex.: dentro de src/Service/Ssma/) e consumir nos três pontos. Não bloqueia a PR.", "existing_code": " $isTechSpecialistOnly = !$ssmaCanManageOccurrences\n && !$this->isSsmaViewer()", "category": "maintainability", "severity": "low", "path": "src/Controller/SsmaController.php"}]}
Result
(async)
Request #13
deepseek-v4-flash
P:72.79K C:621 CR:72.7K CW:0
6016ms
Reasoning
Comments registered. Provide a concise summary of the review in Portuguese, then task_done.
## Resumo da revisão
Analisei cada arquivo do grupo de revisão (apenas `src/Controller/SsmaController.php`; o teste `ActionOrigemEnumTest.php` está fora do grupo). Verifiquei os fluxos afetados com leitura de contexto no próprio controller, nos templates e nas buscas de consumidores.
### Achados registrados
1. **Bug (high)** — `resolveSsmaEvent()` chama `maybeSubmitOccurrenceForValidation($event, $company, $user)` com `$company` indefinida no método (só existe `$companyId`). A variável vira `null` e o parâmetro `Company` lança TypeError, capturado pelo `catch`: a rota de finalizar evento tipado retorna 500 sempre, mesmo com o evento persistido, e a validação/notificação dos aprovadores nunca dispara. **Correção:** restaurar `$company = $event->getCompany()` com a checagem `instanceof`.
2. **Permissão (high)** — Os três pontos que passaram a exigir `!canManage` para o perfil "técnico especialista" (paginação, filtro do hub e auto-scope do Painel) podem zerar a lista para perfis com gestão vinda de plataforma/tag `can_create` e escopo de equipe `[]` — cenário que os comentários removidos protegiam explicitamente. Somado à remoção do fallback de detalhe por tipo técnico, esses perfis perdem também a abertura direta da ocorrência. Necessário confirmar/testar o comportamento por perfil ou diferenciar a regra pela tag de equipe.
3. **Contrato de resposta (medium)** — Remoção do `display_code` sem atualizar os consumidores Twig que ainda leem o campo; os cards do hub e o cabeçalho do detalhe passam a exibir o id numérico puro (o fallback JS só cobre a tabela).
4. **Manutenibilidade (low, não bloqueia)** — A regra de "técnico especialista" ficou duplicada em três pontos de um controller de ~28 mil linhas; sugiro centralizar em um service de escopo.
Os demais trechos alterados (remoção de import, limpeza do método `tryLoadOccurrenceViewRowForTechnicalType` sem chamadas remanescentes, e demais ajustes) não apresentaram problemas adicionais detectáveis.
Tool Calls (1)
task_done
Show Details
Arguments
{"state": "DONE"}
Request #14
deepseek-v4-flash
P:10.3K C:1.3K CR:3.84K CW:0
9768ms
Reasoning
Let me analyze the code changes in the review files. I have already confirmed findings that I should not repeat:
1. `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);` — uses `$company` variable that doesn't exist in scope (bug → 500 error).
2. `$isTechEarly = !$canManageEarly && !$isViewerEarly` — requiring `!canManage` changes behavior.
3. Removing `display_code` from list responses without updating consumers.
4. Duplicated tech-specialist rule in three places in the controller.
I need to review the remaining files and find any OTHER real issues, plus look at the test file change `tests/Unit/Product/Ssma/ActionOrigemEnumTest.php` — wait, that file is in "other_changed_files", NOT in review_files. The review_files only contains `src/Controller/SsmaController.php`.
So I should review `src/Controller/SsmaController.php` for other issues beyond the confirmed ones.
Let me look at the diff more carefully:
1. Removed import of `SsmaOccurrenceDisplayCodeFormatter`.
2. In the finalization endpoint around line 3339, removed a block that tried to load occurrence view row for technical type (fallback `$matching`).
3. Around 7909, the `maybeSubmitOccurrenceForValidation` call changed — confirmed issue.
4. Around 12503, `$isTechEarly` now requires `!$canManageEarly` — confirmed issue.
5. Around 12880, `$isTechSpecialistOnly = !$ssmaCanManageOccurrences && !$this->isSsmaViewer()` — confirmed issue (partially - the duplicate and behavior change).
6. Removed `display_code` in the map functions and list rows — confirmed issue.
7. Removed `tryLoadOccurrenceViewRowForTechnicalType` method — this relates to the removal at line 3339. The removed block called `tryLoadOccurrenceViewRowForTechnicalType`. Both removed together. This is the "technical type with associated type: detail should open even if list filter removed the row from hub" feature. Removing it means users with technical type permission (but not stakeholder/member) can no longer open the detail. Is this covered by confirmed finding #2? Confirmed finding #2 is about `!canManage` being required for tech specialist classification. The removal of `tryLoadOccurrenceViewRowForTechnicalType` is a separate behavior removal. Hmm.
Let me read the surrounding code to understand the detail opening flow around line 3339.
Let me think about what other issues may exist:
The removal at line 3339 of the `$matching === []` fallback for technical type: previously, when the matching list was empty and the user had a technical type, the detail would still open. Now the code falls through to the approver check. Let me read the context to understand what the approver check does. It might be that removing this technical-type fallback restricts users from opening details for occurrences where they have technical type permissions but no stakeholder/member link. This is a behavior change in detail view access - potentially a real bug regression (a user with permission to see by type can no longer open the detail row because the row is removed from hub list). Actually confirmed finding #2 says profiles "whose management permission comes from platform/tag with can_create — but without assigned team — now leave the type treatment and fall into..." team filter with empty list, which zeros out occurrences. So #2 is about list filtering. The removed fallback at line 3339 is about detail opening. These are related but distinct.
Wait — but confirmed finding #2 already describes the behavior consequence broadly. Let me re-read: "Passar a exigir `!canManage` para classificar alguém como 'técnico especialista' (aqui e nos pontos equivalentes do hub e do auto-scope do Painel) faz perfis cuja permissão de gestão vem de plataforma/tag com can_create — mas sem equipe atribuída no produto — saírem do tratamento por tipo e caírem n..." (cut). So #2 is about requiring `!canManage` for tech specialist. The removal of `tryLoadOccurrenceViewRowForTechnicalType` block is a different thing: it removed a detail-view fallback so that technicians (by type) can open detail even when the list filter removed the row.
The commit message/PR says the scope is "aba Ações — melhorias UX, permissões e fundações backend do Painel". But the diff removes a technical-type detail fallback. Actually wait, these removals may be related to aligning with staging2 as the PR description says "ajustes de permissão (canMutateSsmaActionPlan), escopo de área de prevenção e view data do Painel alinhados ao staging2". Hmm.
Actually, the diff removed the whole behavior where technicians by type could open details. But there's the complementary change at 12503 and 12880 which now requires `!canManage`. Let me not double-report #2/#4.
But should I report the removal of the detail fallback as a separate issue? Let me examine the code around line 3339 to understand the flow.
Let me read the file around that region.
Tool Calls (2)
file_read
Show Details
Arguments
{"file_path": "src/Controller/SsmaController.php", "start_line": 3250, "end_line": 3450}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 3250-3450
3250| * nula OU futura (i.e., documento ainda vigente)
3251| * - 'pendente': qualquer outra situação
3252| */
3253| private function recalcularStatusRequisito(GovernanceAuthorizationCollaborator $vinculo): void
3254| {
3255| $aut = $vinculo->getGovernanceAuthorization();
3256| $requisitos = $aut?->getRequisitosList() ?? [];
3257|
3258| if ($aut && $requisitos !== []) {
3259| // Verifica se a própria autorização está vencida
3260| $validadeStr = $aut->getValidade();
3261| if ($validadeStr) {
3262| if (preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $validadeStr)) {
3263| try {
3264| $valDate = new \DateTime($validadeStr);
3265| $valDate->setTime(0, 0, 0);
3266| if ($valDate < new \DateTime('today')) {
3267| $vinculo->setStatusRequisito('expirado');
3268| return;
3269| }
3270| } catch (\Throwable) {
3271| }
3272| } elseif (ctype_digit($validadeStr)) {
3273| $dias = (int) $validadeStr;
3274| $emitida = $aut->getEmitida();
3275| if ($dias > 0 && $emitida !== null) {
3276| $expira = (clone \DateTime::createFromInterface($emitida))->modify('+' . $dias . ' days');
3277| $expira->setTime(0, 0, 0);
3278| if ($expira < new \DateTime('today')) {
3279| $vinculo->setStatusRequisito('expirado');
3280| return;
3281| }
3282| }
3283| }
3284| }
3285|
3286| $today = new \DateTimeImmutable('today');
3287| $aprovados = [];
3288| foreach ($vinculo->getDocumentos() as $d) {
3289| if ($d->getStatus() !== SsmaAutorizacaoDocumento::STATUS_APROVADO) {
3290| continue;
3291| }
3292| $val = $d->getValidadeDocumento();
3293| // Documento aprovado só conta se não houver validade ou validade >= hoje
3294| if ($val === null || \DateTimeImmutable::createFromInterface($val) >= $today) {
3295| $aprovados[$d->getRequisitoLabel()] = true;
3296| }
3297| }
3298|
3299| $todos = count(array_intersect_key(array_flip($requisitos), $aprovados)) === count($requisitos);
3300| $vinculo->setStatusRequisito($todos ? 'valido' : 'pendente');
3301| }
3302| }
3303|
3304| public function viewOccurrence(Request $request, int $id): Response
3305| {
3306| if (!$this->canEnterSsmaOperationalArea()) {
3307| throw $this->createAccessDeniedException('Sem permissão para acessar esta ocorrência.');
3308| }
3309|
3310| $viewData = $this->buildSsmaViewData([
3311| 'occurrence_id' => $id,
3312| 'occurrence_kind' => $request->query->get('kind'),
3313| ]);
3314| $occurrence = null;
3315| $occurrenceActions = [];
3316| $actionTypeLabels = $viewData['action_type_labels'] ?? [];
3317|
3318| $matching = [];
3319| foreach ($viewData['occurrences'] as $item) {
3320| if ((int) ($item['id'] ?? 0) === $id) {
3321| $matching[] = $item;
3322| }
3323| }
3324|
3325| if ($matching === []) {
3326| $userForStakeholder = $this->getUser();
3327| $companyForStakeholder = $userForStakeholder instanceof User ? $userForStakeholder->getCompany() : null;
3328| $stakeholderRow = ($companyForStakeholder instanceof Company && $userForStakeholder instanceof User)
3329| ? $this->tryLoadOccurrenceViewRowForActionStakeholder(
3330| $id,
3331| $request->query->get('kind'),
3332| $companyForStakeholder,
3333| $userForStakeholder
3334| )
3335| : null;
3336| if ($stakeholderRow !== null) {
3337| $matching = [$stakeholderRow];
3338| }
3339| }
3340|
3341| if ($matching === []) {
3342| $approverUser = $this->getUser();
3343| $approverCompany = $approverUser instanceof User ? $approverUser->getCompany() : null;
3344| if (
3345| $approverCompany instanceof Company
3346| && $approverUser instanceof User
3347| && $this->canApproveSsmaOccurrence($approverCompany, $approverUser)
3348| ) {
3349| foreach ($this->loadOccurrenceListRowsForDetailView(
3350| $approverCompany,
3351| $id,
3352| $viewData['allMembers'] ?? [],
3353| $viewData['teams'] ?? []
3354| ) as $item) {
3355| if ((int) ($item['id'] ?? 0) === $id) {
3356| $matching[] = $item;
3357| }
3358| }
3359| }
3360| }
3361|
3362| if ($matching === []) {
3363| $this->addFlash('warning', 'Ocorrência não encontrada.');
3364|
3365| return $this->redirectToRoute('ssma_ocorrencia_index');
3366| }
3367|
3368| $kind = $request->query->get('kind');
3369| if ($kind === 'event') {
3370| foreach ($matching as $item) {
3371| if (($item['is_ssma_event'] ?? false) === true) {
3372| $occurrence = $item;
3373| break;
3374| }
3375| }
3376| if ($occurrence === null) {
3377| $this->addFlash('warning', 'Registro não encontrado.');
3378|
3379| return $this->redirectToRoute('ssma_ocorrencia_index');
3380| }
3381| } else {
3382| foreach ($matching as $item) {
3383| if (!($item['is_ssma_event'] ?? false)) {
3384| $occurrence = $item;
3385| break;
3386| }
3387| }
3388| if ($occurrence === null) {
3389| $occurrence = $matching[0];
3390| }
3391| }
3392|
3393| $isSsmaEventRow = (bool) ($occurrence['is_ssma_event'] ?? false);
3394| $user = $this->getUser();
3395| $company = $user instanceof User ? $user->getCompany() : null;
3396| $this->maybeAutoFinalizeOccurrenceRowIfAllActionsClosed($occurrence, $company);
3397| $this->syncOccurrenceRowStatusFromDatabase($occurrence, $company);
3398|
3399| $today = new \DateTimeImmutable('today');
3400| foreach ($viewData['actions_taken'] as $actionItem) {
3401| if ($isSsmaEventRow) {
3402| if ((int) ($actionItem['event_id'] ?? 0) !== $id) {
3403| continue;
3404| }
3405| } elseif ((int) ($actionItem['occurrence_id'] ?? 0) !== $id) {
3406| continue;
3407| }
3408| $occurrenceActions[] = $this->enrichOccurrenceViewActionCard($actionItem, $actionTypeLabels, $today);
3409| }
3410|
3411| $history = $occurrence['history'] ?? [];
3412| if (($occurrence['is_ssma_event'] ?? false) === true) {
3413| $eventEntity = $this->entityManager->getRepository(SsmaEvent::class)->find($id);
3414| if ($eventEntity instanceof SsmaEvent && $company && $eventEntity->getCompany()->getId() === $company->getId()) {
3415| foreach ($eventEntity->getHistory() as $hItem) {
3416| if (is_array($hItem)) {
3417| $history[] = $hItem;
3418| }
3419| }
3420| }
3421| } else {
3422| // Mescla o changelog de auditoria (tipo, gravidade) armazenado em details
3423| $occurrenceEntity = $this->entityManager->getRepository(SsmaOccurrence::class)->find($id);
3424| if ($occurrenceEntity instanceof SsmaOccurrence) {
3425| $changelog = $occurrenceEntity->getDetails()['changelog'] ?? [];
3426| foreach ($changelog as $cItem) {
3427| if (is_array($cItem) && isset($cItem['message'])) {
3428| $history[] = $cItem;
3429| }
3430| }
3431| }
3432| }
3433| foreach ($occurrenceActions as $actionItem) {
3434| $createdAt = (string) ($actionItem['created_at'] ?? '');
3435| $title = trim((string) ($actionItem['title'] ?? ''));
3436| if ($createdAt !== '' && $title !== '') {
3437| $history[] = [
3438| 'date' => (new \DateTimeImmutable($createdAt))->format('d/m/Y'),
3439| 'label' => 'Ação criada: ' . $title,
3440| ];
3441| }
3442| }
3443| // Ordena do mais recente para o mais antigo (data mais recente no topo do histórico).
3444| usort($history, function (array $a, array $b): int {
3445| return $this->occurrenceHistoryEntryTimestamp($b) <=> $this->occurrenceHistoryEntryTimestamp($a);
3446| });
3447| $occurrence['history'] = $history;
3448|
3449| $occurrence = $this->filterOccurrenceEvidencesForCurrentUser($occurrence, false);
3450|
file_read
Show Details
Arguments
{"file_path": "src/Controller/SsmaController.php", "start_line": 7840, "end_line": 7960}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 7840-7960
7840| }
7841|
7842| try {
7843| $data = json_decode($request->getContent(), true) ?? [];
7844| $occurrence->setStatus('finalizada');
7845| $activityMeta = $this->parseOccurrenceActivityPayload($occurrence->getActivity());
7846| $resolveEvidences = array_values(array_filter(array_map('trim', (array) ($data['resolve_evidences'] ?? []))));
7847| $mergedStorage = $activityMeta['evidences_storage'];
7848| foreach ($resolveEvidences as $label) {
7849| $t = trim((string) $label);
7850| if ($t !== '') {
7851| $mergedStorage[] = $t;
7852| }
7853| }
7854| $resolveComment = trim((string) ($data['resolve_comment'] ?? ''));
7855| $occurrence->setActivity(
7856| $this->buildOccurrenceActivityPayload($activityMeta['text'], $mergedStorage, $resolveComment)
7857| );
7858|
7859| $this->entityManager->flush();
7860|
7861| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
7862| } catch (\Throwable $e) {
7863| return new JsonResponse(['success' => false, 'message' => 'Erro ao finalizar ocorrência.'], 500);
7864| }
7865| }
7866|
7867| /**
7868| * POST /manager/ssma/events/{id}/resolve
7869| * Finaliza um evento SSMA tipado (lista unificada usa id de SsmaEvent, não SsmaOccurrence).
7870| */
7871| public function resolveSsmaEvent(Request $request, int $id): JsonResponse
7872| {
7873| /** @var User|null $user */
7874| $user = $this->getUser();
7875| if (!$user) {
7876| return new JsonResponse(['success' => false, 'message' => 'Não autenticado.'], 401);
7877| }
7878|
7879| $companyId = $user->getCompany()?->getId();
7880| $event = $this->entityManager->find(SsmaEvent::class, $id);
7881| if (!$event || $event->getCompany()->getId() !== $companyId) {
7882| return new JsonResponse(['success' => false, 'message' => 'Ocorrência não encontrada.'], 404);
7883| }
7884|
7885| if (!$this->canCompleteSsmaTechnicalType($event->getCompany(), $user, $event->getType())) {
7886| return new JsonResponse(['success' => false, 'message' => 'Você não tem autorização para finalizar esse tipo de ocorrência.'], 403);
7887| }
7888|
7889| try {
7890| $data = json_decode($request->getContent(), true) ?? [];
7891| $resolveEvidences = array_values(array_filter(array_map('trim', (array) ($data['resolve_evidences'] ?? []))));
7892| $resolveComment = trim((string) ($data['resolve_comment'] ?? ''));
7893|
7894| $details = $event->getDetails();
7895| if (!is_array($details)) {
7896| $details = [];
7897| }
7898| $existing = is_array($details['evidences'] ?? null) ? $details['evidences'] : [];
7899| $details['evidences'] = $this->ssmaSanitizeEvidenceStorageList(array_merge($existing, $resolveEvidences));
7900| if ($resolveComment !== '') {
7901| $details['resolve_comment'] = $resolveComment;
7902| }
7903|
7904| $prevStatus = $event->getStatus();
7905| $event->setDetails($details);
7906| $event->setStatus(SsmaEvent::STATUS_CONCLUIDO);
7907| if ($event->getStatus() !== $prevStatus) {
7908| $event->appendHistory('Ocorrência finalizada.', ['from' => $prevStatus, 'to' => $event->getStatus()]);
7909| }
7910|
7911| $this->entityManager->flush();
7912| $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
7913|
7914| return new JsonResponse(['success' => true, 'message' => 'Ocorrência finalizada com sucesso.']);
7915| } catch (\Throwable $e) {
7916| return new JsonResponse(['success' => false, 'message' => 'Erro ao finalizar ocorrência.'], 500);
7917| }
7918| }
7919|
7920| // ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
7921| // Action CRUD
7922| // ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
7923|
7924| /**
7925| * Retorna somente o HTML do modal "Criar ação" para ser carregado via AJAX
7926| * em páginas externas ao módulo SSMA (ex.: Projetos).
7927| */
7928| public function actionModalPartial(): Response
7929| {
7930| $viewData = $this->buildSsmaViewData();
7931| return new Response($this->renderView('ssma/partials/_modal_action.html.twig', [
7932| 'occurrences' => $viewData['occurrences'] ?? [],
7933| 'allMembers' => $viewData['allMembers'] ?? [],
7934| 'action_type_config' => $viewData['action_type_config'] ?? ['types' => []],
7935| ]));
7936| }
7937|
7938| // ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
7939|
7940| public function createAction(Request $request): JsonResponse
7941| {
7942| /** @var User|null $user */
7943| $user = $this->getUser();
7944| if (!$user) {
7945| return new JsonResponse(['success' => false, 'message' => 'Não autenticado.'], 401);
7946| }
7947|
7948| $company = $this->getSsmaCompany();
7949| if (!$company) {
7950| return new JsonResponse(['success' => false, 'message' => 'Empresa não encontrada.'], 400);
7951| }
7952|
7953| $data = json_decode($request->getContent(), true) ?? [];
7954| $mode = $data['mode'] ?? 'create';
7955| $title = trim((string) ($data['title'] ?? ''));
7956| $existingProject = null;
7957|
7958| // Criar: gestor/admin. Supervisor só visualiza — Brenda áudio 6.
7959| if ($mode !== 'edit' && !$this->canMutateSsmaActionPlan()) {
7960| return new JsonResponse(['success' => false, 'message' => 'Sem permissão para criar ação SSMA.'], 403);
Request #15
deepseek-v4-flash
P:16.23K C:1.26K CR:11.52K CW:0
9220ms
Reasoning
Now I have context. The confirmed findings cover issues 1-4. Let me look at other changed hunks for real issues I can still report:
1. The removal of the technical-type fallback in `viewOccurrence` (lines 3338-3357 removed). The `tryLoadOccurrenceViewRowForTechnicalType` fallback and method were removed. This means technicians by type no longer can open details when the row isn't in the list (stakeholder/approver fallbacks remain). Is this covered by confirmed finding #2? No — #2 is about `!canManage` requirement in tech specialist classification. #3 is about display_code removal. #4 is about duplication.
Actually the fallback removal may have been intentional to align with staging2 (per PR description "ajustes de permissão... alinhados ao staging2"). But it is a behavior regression concern: previously a technician with type permission whose row was removed by list filter (e.g., can_create platform) could still open detail. Now detail won't open. However this removal is consistent with confirmed finding #2 — i.e., the PR intentionally removed these "ignore canManage" fallbacks. Since #2 captures the same intent and its consequence for these profiles (their occurrences get zeroed by empty team filter), the fallback removal for detail view is basically a facet of the same change. Reporting again would duplicate. But actually #2 says the profile "falls into the team filter with empty list which zeros all occurrences". And the detail fallback removal means even if they get there some other way, they can't open. I think the confirmed finding #2 is the umbrella for this intent change. So skip.
2. Let me check remaining changes:
- `$isTechEarly` change at ~12503 (confirmed #2)
- `$isTechSpecialistOnly` change at ~12880 (confirmed #2/#4)
- display_code removal at 14703, 15003, 22661, 22755 (confirmed #3)
- auto-scope change at 22833 (confirmed #2)
- removal of `tryLoadOccurrenceViewRowForTechnicalType` (maybe covered)
- import removal (side effect of display_code removal)
Wait, but there are also changes in the test file `tests/Unit/Product/Ssma/ActionOrigemEnumTest.php`, but that file is in other_changed_files, not in the review group. So we don't need to review it. The review_files only has `src/Controller/SsmaController.php`.
Let me check whether there might be an issue with `$company` variable in the `resolveSsmaEvent` method that isn't covered. Confirmed finding #1 mentions the `$company` variable not in scope. Actually looking at the code: In `resolveSsmaEvent`, `$company` is indeed not defined in the method (only `$companyId`). Wait — is `$company` perhaps a property of the controller? Confirmed finding #1 says the variable doesn't exist in the scope. But then in the code path, `maybeSubmitOccurrenceForValidation($event, $company, $user)` — is `$company` a controller property? Let me search for `protected $company` or `private Company`. Actually the confirmed finding already analyzed this; skip.
Let me look for other places where `$company` might be defined... Actually wait, maybe `$this->getSsmaCompany()` etc. But finding #1 says it's a bug with $company not defined → error 500. That's confirmed. Skip.
Now let me review the remaining hunks not covered by confirmed findings. Let me re-read the diff:
Hunk 1 (line 62): removed import of `SsmaOccurrenceDisplayCodeFormatter`. Covered by #3? The import removal is a direct side effect of removing display_code calls. But wait, are there still uses of `SsmaOccurrenceDisplayCodeFormatter` elsewhere in the file? If the import was removed but the class is still used elsewhere, that'd be a fatal error. Let me search.
Hunk 2 (3339): removal of technical type fallback (as analyzed).
Hunk 3 (7909): confirmed #1.
Hunk 4 (12503): `$isTechEarly` change — confirmed #2.
Hunk 5 (12880): `$isTechSpecialistOnly` change — confirmed #2.
Hunk 6 (14703): display_code removal from mapSsmaOccurrenceEntityToListRow — confirmed #3.
Hunk 7 (15003): display_code removal from mapSsmaEventToOccurrenceListRow — confirmed #3.
Hunk 8 (16209): removal of tryLoadOccurrenceViewRowForTechnicalType method.
Hunk 9 (22738 / 22661): display_code removal in dashboard aggregator list rows — confirmed #3.
Hunk 10 (22836 / 22755): display_code removal — confirmed #3.
Hunk 11 (22915): auto-scope change — confirmed #2.
Let me search for any remaining uses of SsmaOccurrenceDisplayCodeFormatter in the file after import removal.
Tool Calls (3)
code_search
Show Details
Arguments
{"search_text": "SsmaOccurrenceDisplayCodeFormatter"}
Result
File: src/Service/Ssma/SsmaOccurrenceDisplayCodeFormatter.php
Match lines: 1
13|final class SsmaOccurrenceDisplayCodeFormatter
File: tests/Unit/Product/Ssma/SsmaOccurrenceDisplayCodeFormatterTest.php
Match lines: 9
7|use App\Service\Ssma\SsmaOccurrenceDisplayCodeFormatter;
9|final class SsmaOccurrenceDisplayCodeFormatterTest extends SsmaTestCase
13| self::assertSame('ROS103', SsmaOccurrenceDisplayCodeFormatter::format('ROS', 103));
18| self::assertSame('QA103', SsmaOccurrenceDisplayCodeFormatter::format('QUASE_ACIDENTE', 103));
23| self::assertSame('Ac103', SsmaOccurrenceDisplayCodeFormatter::format('ACIDENTE_PESSOAL', 103));
24| self::assertSame('Ac104', SsmaOccurrenceDisplayCodeFormatter::format('ACIDENTE_MATERIAL', 104));
25| self::assertSame('Ac105', SsmaOccurrenceDisplayCodeFormatter::format('ACIDENTE_AMBIENTAL', 105));
30| self::assertSame('103', SsmaOccurrenceDisplayCodeFormatter::format('OUTRO_TIPO', 103));
35| self::assertSame('', SsmaOccurrenceDisplayCodeFormatter::format('ROS', 0));
code_search
Show Details
Arguments
{"search_text": "tryLoadOccurrenceViewRowForTechnicalType"}
Result
No matches found
code_search
Show Details
Arguments
{"search_text": "display_code", "file_patterns": ["src/Controller/SsmaController.php"]}
Result
No matches found
Request #16
deepseek-v4-flash
P:17.84K C:1.74K CR:17.41K CW:0
14690ms
Reasoning
So no remaining usages of `SsmaOccurrenceDisplayCodeFormatter` in the controller, and `tryLoadOccurrenceViewRowForTechnicalType` no longer referenced anywhere. Good — import removal is safe within the controller.
Now let me search for consumers of `display_code` elsewhere (templates, JS) — but confirmed finding #3 already covers this. Let me check whether `mapSsmaOccurrenceEntityToListRow` is still used in other contexts where display_code might be needed — but that's covered.
Now, are there other issues not covered by confirmed findings?
Let me examine the hunks again more carefully. Actually, let me focus on:
1. In `viewOccurrence`, the removed technical-type fallback means that users whose technical types allow them to see the occurrence but who aren't stakeholders, members, or approvers can no longer open detail view. This is the consequence of the "especialista" refactor. Hmm, but confirmed finding #2 covers the general "tech profiles with can_create now zeroed". The removal of the detail fallback is a distinct code change but related to the same feature intent. Is it separately reportable?
The PR description says this PR only brings "ajustes de permissão (canMutateSsmaActionPlan), escopo de área de prevenção e view data do Painel alinhados ao staging2" — nothing about removing the technical-type detail fallback or removing display_code from detail/list. These changes contradict the stated scope ("aba Ações" e "fundações do Painel"). Actually the description says the branch contains "apenas o delta necessário em cima do que o Gustavo já mergeou". Hmm. The diff also includes changes to list/detail occurrences functions and dashboard. These seem unrelated to the "aba Ações" scope. But that's consistent with confirmed findings #2, #3, #4.
The removal of `tryLoadOccurrenceViewRowForTechnicalType` is part of the same set of permission alignment. Confirmed findings #2 is about the tech classification requiring `!canManage`; #3 about display_code. The removed fallback in viewOccurrence is directly tied to the deleted method and the "técnico com tipo associado: detalhe deve abrir mesmo se o filtro de lista tiver removido a linha" comment. This removal breaks detail access for exactly those profiles. This is arguably the user-facing impact of #2: without the fallback, a technician by type whose row was filtered out cannot open the occurrence detail at all — before they could. Actually let me re-read confirmed finding #2: "Passar a exigir !canManage para classificar alguém como 'técnico especialista' ... faz perfis cuja permissão de gestão vem de plataforma/tag com can_create — mas sem equipe atribuída no produto — saírem do tratamento por tipo e caírem n..." — likely "...e caírem no filtro de equipe vazio, zerando a lista". So #2 is about the empty-team-filter list zeroing.
The removed fallback (hunk 2) is about detail access even when the list is empty (zeroed). So both converge on the same user consequence: profiles affected can't see occurrences. The detail fallback removal is what used to rescue exactly this zeroed-list case for detail view. Since #2 already flags the zeroed list behavior as the issue and says "aqui e nos pontos equivalentes do hub e do auto-scope do Painel", I believe the confirmed findings cover the intent comprehensively, but the viewOccurrence fallback removal is a distinct diff hunk with its own comment. Should I report it? The instruction says: "Previously Confirmed Findings — Do not repeat them." Confirmed finding #2 doesn't mention viewOccurrence fallback or tryLoadOccurrenceViewRowForTechnicalType removal. Given the strict "Review every file individually" and thoroughness, but also precision over recall. Hmm.
Let me consider whether the fallback removal is actually a real bug per the design: The comment that was removed said the detail should open even if the list filter removed the row. The new logic relies on `matching` from `buildSsmaViewData` occurrences. Given the change in #2, the tech-specialist list may be empty when can_create (platform) exists. Previously viewOccurrence would fallback to tryLoadOccurrenceViewRowForTechnicalType. Now it won't. So technicians with type-based permission but no stakeholder/approver role will be redirected with "Ocorrência não encontrada" for a record they legitimately could see by type.
However, whether this is the intended design of this PR (aligning with staging2, where Gustavo already merged the "correção") is uncertain. The PR author's commit messages are truncated in the given description, but the stated purpose is about "aba Ações". Removing the technical-type detail fallback is not in the PR scope description at all. And #2 notes the duplication/behavior.
Given the confirmed finding #2 mentions "aqui e nos pontos equivalentes do hub e do auto-scope do Painel", the fallback removal in viewOccurrence is basically the "detalhe" counterpart. But the confirmed finding didn't explicitly name it. I'll consider reporting the viewOccurrence fallback removal as a distinct issue with a distinct consequence (detalhe de ocorrência com tipo técnico sem vínculo de stakeholder deixa de abrir, redirecionando para índice com "Ocorrência não encontrada"). Actually, wait. Let me think about precision vs. recall guidance: "report only defects that are likely real in the changed code and its reachable context." Also do not duplicate findings.
I think there's real risk of duplication of the same underlying change intent (permission alignment). But there is also value in pointing out that removing the fallback in `viewOccurrence` specifically breaks the detail view for those profiles — a separate user-facing impact (they'd get redirect instead of detail). Given that confirmed findings #2/#4 are about the `isTechEarly`/`isTechSpecialistOnly`/auto-scope changes and duplication, the viewOccurrence fallback removal is a distinct diff change that isn't explicitly among them. I'll report it as its own finding, being careful not to restate #2 but to focus on the detail-flow regression.
Hmm. Actually, let me reconsider: maybe the removal is intentional and consistent: if the "técnico por tipo" rule now requires `!canManage`, then profiles with can_create won't be treated as tech specialists in the list, so the hub would show... wait, no. The hub list logic with `isTechEarly` etc. determines whether the team filter is applied. For a tech user with can_create and empty team, the list will be zeroed. But wait, maybe with can_create the user IS supposed to see all occurrences (since they can manage), not zeroed. The issue #2 says they get zeroed. Actually the whole point of the removed fallback was: "can_create de plataforma pode remover a linha do hub" — i.e., can_create doesn't grant list visibility of all occurrences because the user still needs team/type scope. But then the "especialista" change with `!canManage` means profiles with can_create but no team get treated as regular members with team filter [] → zeroed. The fallback removal at viewOccurrence is tied to that.
OK. Given the broad umbrella, I'll verify how `buildSsmaViewData` list uses `isTechEarly` and see what happens with canManage in the list and detail.
Actually, let me read around line 12500 (the buildSsmaViewData occurrences) for a fuller picture.
Tool Calls (1)
file_read
Show Details
Arguments
{"end_line": 12560, "file_path": "src/Controller/SsmaController.php", "start_line": 12440}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 12440-12560
12440| $company,
12441| $detailOccurrenceId,
12442| $allMembers,
12443| $teams
12444| );
12445| $actionsTaken = $this->loadActionsForOccurrenceDetail($company, $detailOccurrenceId);
12446| $inspections = [];
12447| $abordagens = [];
12448| $horasData = [];
12449| // Fase B: SSR do detalhe só com membros referenciados (+ gestores do modal).
12450| if ($this->ssmaMemberSelectDataProvider->shouldFilterToReferencedMembers($scope)) {
12451| $allMembers = $this->filterSsmaMembersToReferencedForDetail(
12452| $allMembers,
12453| $occurrences,
12454| $actionsTaken,
12455| $gestores
12456| );
12457| }
12458| } elseif ($isNetworkHeadWithUnits && $company) {
12459| $occurrences = $this->loadNetworkOccurrencesForList($company);
12460| foreach ($this->resolveSsmaNetworkSubsidiaries($company) as $netCompany) {
12461| if ((int) $netCompany->getId() === (int) $company->getId()) {
12462| continue;
12463| }
12464| [$extraMembers, $extraTeams] = $this->loadCompanyMembersAndTeamsLite($netCompany);
12465| $teamNameByMemberId = [];
12466| foreach ($extraTeams as $teamRow) {
12467| foreach ($teamRow['members'] as $teamMemberId) {
12468| $teamMemberId = (int) $teamMemberId;
12469| if ($teamMemberId > 0 && !isset($teamNameByMemberId[$teamMemberId])) {
12470| $teamNameByMemberId[$teamMemberId] = (string) ($teamRow['name'] ?? '');
12471| }
12472| }
12473| }
12474| foreach ($this->enrichSsmaMemberRowsWithTeamMeta($extraMembers, $teamNameByMemberId) as $extraMember) {
12475| $allMembers[] = $extraMember;
12476| }
12477| }
12478| $networkCompanies = $this->resolveSsmaNetworkSubsidiaries($company);
12479| if ($deferOccurrenceHubHeavyData) {
12480| $actionsTaken = [];
12481| $inspections = [];
12482| $horasData = [];
12483| } else {
12484| $actionsTaken = [];
12485| $inspections = [];
12486| foreach ($networkCompanies as $netCompany) {
12487| [$netMembers, $netTeams] = $this->loadCompanyMembersAndTeamsLite($netCompany);
12488| $actionsTaken = array_merge(
12489| $actionsTaken,
12490| $this->loadActions($netCompany)
12491| );
12492| $inspections = array_merge(
12493| $inspections,
12494| $this->loadInspections($netCompany, $netMembers, $netTeams)
12495| );
12496| }
12497| $horasData = $this->mergeHorasDataForNetworkCompanies($networkCompanies);
12498| }
12499| } else {
12500| $occurrenceListAlreadyPaged = false;
12501| if ($company && $paginateOccurrenceList) {
12502| $teamFilterEarly = $this->getSsmaOccurrenceDashboardTeamFilterIds($company, $user instanceof User ? $user : null);
12503| $canManageEarly = $this->canManageSsmaOccurrences();
12504| $isViewerEarly = $this->isSsmaViewer();
12505| $userTechnicalTypesEarly = $this->resolveUserTechnicalTypes($company, $user, $companyMembers ?? []);
12506| $isTechEarly = !$canManageEarly
12507| && !$isViewerEarly
12508| && $teamFilterEarly === []
12509| && $userTechnicalTypesEarly !== [];
12510| $needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)
12511| || $isTechEarly
12512| || (!$canManageEarly && !$isViewerEarly && $teamFilterEarly === null && !$isTechEarly);
12513|
12514| $pageSize = SsmaViewDataScope::OCCURRENCE_LIST_PAGE_SIZE;
12515| $occurrencesListPage = $scope->listPage;
12516| $offset = ($occurrencesListPage - 1) * $pageSize;
12517|
12518| if (!$needsOccurrencePostFilter) {
12519| // Visão completa: hidrata só a página pedida (SQL UNION + findBy ids).
12520| $occurrencesListTotal = $this->countCompanyOccurrencesAndEvents($company);
12521| $occurrences = $this->loadOccurrences($company, $allMembers, $teams, $pageSize, $offset);
12522| $occurrencesListHasMore = ($offset + count($occurrences)) < $occurrencesListTotal;
12523| $occurrenceListAlreadyPaged = true;
12524| } else {
12525| $occurrences = $this->loadOccurrences($company, $allMembers, $teams);
12526| }
12527| } else {
12528| $occurrences = $company ? $this->loadOccurrences($company, $allMembers, $teams) : [];
12529| }
12530| if ($occurrences !== []) {
12531| // Sempre anexa cause_tree_id na página atual (UX: botão Causa aparece no SSR).
12532| // Painel/inspeções/horas continuam deferred; só o mapa de árvores volta no hub.
12533| if ($company instanceof Company) {
12534| $itemsForTrees = [];
12535| foreach ($occurrences as $occRow) {
12536| $entityId = (int) ($occRow['id'] ?? 0);
12537| if ($entityId <= 0) {
12538| continue;
12539| }
12540| $itemsForTrees[] = [
12541| 'id' => $entityId,
12542| 'is_ssma_event' => !empty($occRow['is_ssma_event']),
12543| ];
12544| }
12545| if ($itemsForTrees !== []) {
12546| $treeMeta = $this->ssmaCauseTreeService->resolveEntityTreeMetaBatch(
12547| (int) $company->getId(),
12548| $itemsForTrees
12549| );
12550| foreach ($occurrences as $idx => $occRow) {
12551| $entityId = (int) ($occRow['id'] ?? 0);
12552| $key = (!empty($occRow['is_ssma_event']) ? 'e:' : 'o:') . $entityId;
12553| $occurrences[$idx]['cause_tree_id'] = $treeMeta[$key]['cause_tree_id'] ?? null;
12554| }
12555| }
12556| }
12557| $occurrences = $this->enrichOccurrencesCommitteeTriggerFlags($occurrences, $company);
12558| $occurrences = $this->enrichOccurrencesGravityLabels($occurrences);
12559| }
12560| if ($deferOccurrenceHubHeavyData) {
Request #17
deepseek-v4-flash
P:21.39K C:122 CR:19.46K CW:0
1378ms
Reasoning
Now let me see the hub final filter code (~12880) and the post-filter to see how the removed fallback interacts. Let me read around 12880.
Tool Calls (1)
file_read
Show Details
Arguments
{"end_line": 13000, "file_path": "src/Controller/SsmaController.php", "start_line": 12850}
Result
File: src/Controller/SsmaController.php (Total lines: 28357)
IS_TRUNCATED: false
LINE_RANGE: 12850-13000
12850| // Inspeção — equipe no modal: gestão vê escopo/lista completa; Membro só suas equipes (auto se uma).
12851| // Mesmo contrato Palloma vs Aura das abas: tenant/SUPER_ADMIN/ROLE_MANAGER sem ROLE_USER
12852| // com tag Membro não entram no recorte de pessoa física.
12853| $teamsForInspectionModal = $applyTeamEventScope ? $teamsForEventModal : $teams;
12854| $defaultInspectionTeamId = null;
12855| $ssmaIsPlainPreventionMember = $ssmaIsPlainProductMemberUi
12856| && !$this->memberIsSsmaGestorAdministrador($memberForTagCheck);
12857| if ($ssmaIsPlainPreventionMember && $company && $user instanceof User) {
12858| $plainMemberRow = $this->getCurrentCompanyMember($company, $user);
12859| $plainMemberTeamIds = $plainMemberRow ? $this->parseCompanyMemberTeamIds($plainMemberRow) : [];
12860| if ($plainMemberTeamIds !== []) {
12861| $plainTeamIdStr = array_map('strval', $plainMemberTeamIds);
12862| $teamsForInspectionModal = array_values(array_filter(
12863| $teams,
12864| static fn (array $t): bool => in_array((string) ($t['id'] ?? ''), $plainTeamIdStr, true)
12865| && $areaScope->allowsTeam((int) ($t['id'] ?? 0))
12866| ));
12867| if (count($plainMemberTeamIds) === 1) {
12868| $defaultInspectionTeamId = (int) $plainMemberTeamIds[0];
12869| }
12870| } else {
12871| $teamsForInspectionModal = [];
12872| }
12873| } elseif ($applyTeamEventScope && $teamsForInspectionModal !== []) {
12874| $defaultInspectionTeamId = (int) ($ssmaEventFormDefaults['team_id'] ?? 0) ?: null;
12875| if ($defaultInspectionTeamId === null && count($teamsForInspectionModal) === 1) {
12876| $defaultInspectionTeamId = (int) ($teamsForInspectionModal[0]['id'] ?? 0) ?: null;
12877| }
12878| }
12879| usort($teamsForInspectionModal, static function (array $a, array $b): int {
12880| return strcasecmp((string) ($a['name'] ?? ''), (string) ($b['name'] ?? ''));
12881| });
12882|
12883| // Técnico especialista SSMA: tem SsmaPermissionTagMember mas sem gestão ou supervisão de equipe.
12884| // O scope retornado por getSsmaOccurrenceDashboardTeamFilterIds ?? [] (sem equipe atribuída no produto),
12885| // o que zeraria todas as ocorrências se o filtro de equipe fosse aplicado.
12886| // Em vez disso, aplicamos um filtro por tipo de ocorrência após o bloco de equipe.
12887| $isTechSpecialistOnly = !$ssmaCanManageOccurrences
12888| && !$this->isSsmaViewer()
12889| && $occurrenceTeamFilterIds === []
12890| && !empty($userTechnicalTypes);
12891|
12892| if ($occurrenceTeamFilterIds !== null && !$isTechSpecialistOnly) {
12893| $teamIdStr = array_map('strval', $occurrenceTeamFilterIds);
12894|
12895| // Coleta IDs de membros pertencentes às equipes do viewer
12896| $memberIdsInTeams = [];
12897| foreach ($teams as $team) {
12898| if (in_array((string) ($team['id'] ?? ''), $teamIdStr, true)) {
12899| foreach ($team['members'] ?? [] as $mid) {
12900| $memberIdsInTeams[(int) $mid] = true;
12901| }
12902| }
12903| }
12904|
12905| // Supervisor/Gestor de Equipe sem equipe atribuída: ainda deve ver ocorrências onde ??
12906| // pessoalmente gestor responsável ou pessoa envolvida (regra da planilha SSMA).
12907| // Sem esse ajuste, memberIdsInTeams ficaria vazio e o filtro de manager_id/people_ids
12908| // nunca passaria — o supervisor não veria nada, mesmo sendo o responsável da ocorrência.
12909| if ($occurrenceTeamFilterIds === [] && ($ssmaIsTagTeamSupervisor || $ssmaIsTagTeamGestor)) {
12910| $selfMember = $this->getCurrentCompanyMember($company, $user);
12911| $selfMemberId = (int) ($selfMember?->getId() ?? 0);
12912| if ($selfMemberId > 0) {
12913| $memberIdsInTeams[$selfMemberId] = true;
12914| }
12915| }
12916|
12917| // Ocorrências: por team_id direto OU por manager_id/people_ids/responsible_ids pertencente ?? equipe.
12918| // Supervisor de Equipe deve ver ocorrências onde ?? gestor responsável ou pessoa envolvida,
12919| // mesmo que o team_id da ocorrência não esteja preenchido ou difira do escopo.
12920| $occurrences = array_values(array_filter($occurrences, static function (array $o) use ($teamIdStr, $memberIdsInTeams): bool {
12921| if (isset($o['team_id']) && $o['team_id'] !== null && in_array((string) $o['team_id'], $teamIdStr, true)) {
12922| return true;
12923| }
12924| $managerId = (int) ($o['manager_id'] ?? 0);
12925| if ($managerId > 0 && isset($memberIdsInTeams[$managerId])) {
12926| return true;
12927| }
12928| $personId = (int) ($o['person_id'] ?? 0);
12929| if ($personId > 0 && isset($memberIdsInTeams[$personId])) {
12930| return true;
12931| }
12932| foreach (array_merge((array) ($o['people_ids'] ?? []), (array) ($o['responsible_ids'] ?? [])) as $p) {
12933| if (isset($memberIdsInTeams[(int) $p])) {
12934| return true;
12935| }
12936| }
12937| return false;
12938| }));
12939|
12940| // Inspeções: por team_id
12941| $inspections = array_values(array_filter($inspections, static function (array $i) use ($teamIdStr): bool {
12942| $tid = $i['team_id'] ?? null;
12943| return $tid !== null && $tid !== '' && in_array((string) $tid, $teamIdStr, true);
12944| }));
12945|
12946| // Abordagens: por observador pertencente ?? equipe
12947| $abordagens = array_values(array_filter($abordagens, static function (array $ab) use ($memberIdsInTeams): bool {
12948| $obsId = (int) ($ab['observador_id'] ?? 0);
12949| return $obsId > 0 && isset($memberIdsInTeams[$obsId]);
12950| }));
12951|
12952| // Plano de Ação: ações em que pelo menos um responsável pertence ao escopo da equipe
12953| // (não todas as ações das ocorrências visíveis da equipe).
12954| $actionsTaken = $this->filterActionsByResponsibleMemberIds($actionsTaken, $memberIdsInTeams);
12955| }
12956|
12957| if ($occurrenceAreaFilterIds !== null) {
12958| $areaMemberIds = $areaScope->allowedMemberIds();
12959| // Equipe com área fora do recorte esconde a inspeção mesmo com participante interno:
12960| // é o que mantém a interseção quando team_limitation e area_limitation estão juntos.
12961| $inspections = SsmaAreaLimitationScope::filterInspectionsForAreaScope(
12962| $inspections,
12963| $areaScope->allowedTeamIds(),
12964| $areaMemberIds,
12965| $areaScope->teamIdsWithoutArea()
12966| );
12967| $abordagens = SsmaAreaLimitationScope::filterAbordagensByMemberIds(
12968| $abordagens,
12969| $areaMemberIds
12970| );
12971| // Mesmo critério da limitação de equipe: plano de ação só com responsável no recorte.
12972| $actionsTaken = $this->filterActionsByResponsibleMemberIds($actionsTaken, $areaMemberIds);
12973| }
12974|
12975| // Técnico especialista: filtra ocorrências pelos tipos que têm autorização técnica (SsmaPermissionTagMember).
12976| // Inspeções/Abordagens/Ações não são filtradas por equipe; o técnico não tem equipe SSMA atribuída.
12977| if ($isTechSpecialistOnly) {
12978| $techTypesSet = array_flip($userTechnicalTypes);
12979| $occurrences = array_values(array_filter(
12980| $occurrences,
12981| static fn (array $o): bool => isset($techTypesSet[$o['type_value'] ?? ''])
12982| ));
12983| }
12984|
12985| // Filtro de membro (próprio conteúdo) apenas quando o usuário NÃO tem escopo de equipe.
12986| // Supervisor/Gestor de Equipe já foram limitados pelo filtro de equipe acima — aplicar o
12987| // filtro de membro sobre eles reduziria a visão incorretamente para só o próprio conteúdo.
12988| $ssmaPreventionInspectionEnabled = true;
12989| $ssmaPreventionAbordagemEnabled = true;
12990|
12991| // Abas Inspeção/Abordagem (ROLE_USER): só quando meta do kind > 0 (igual critério da tabela Metas).
12992| // - Sem row (nunca adicionado ou removido com lixeira) → abas ocultas.
12993| // - Meta = -1 (desligado para esse kind) → aba oculta.
12994| // - Meta >= 0 (ligado, mesmo sem goal definido ainda) → aba visível.
12995| // Supervisores/Gestores de Equipe e Gestor Administrador são excluídos desse controle: suas abas dependem de outras flags.
12996| if ($company && $user instanceof User
12997| && !$this->isGranted('ROLE_SUPER_ADMIN')
12998| && !$this->isGranted('ROLE_MANAGER')
12999| && !$this->isGranted('ROLE_MANAGER_GESTOR')) {
13000| $memberForPreventionTabs = $this->getCurrentCompanyMember($company, $user);
Request #18
deepseek-v4-flash
P:24.24K C:664 CR:21.5K CW:0
5705ms
Reasoning
Now I have a good picture of the changes. Let me now evaluate the diff hunks not covered by confirmed findings.
The viewOccurrence technical fallback removal: The removed code allowed a tech-by-type user to open a detail when the list had removed the row (e.g., can_create filtered out). Now, with the new classification requiring `!canManage`, the same tech profile with can_create will have its list zeroed by team filter (issue #2), and now the detail view has no rescue path — they'll get "Ocorrência não encontrada." redirect.
But wait: is this a distinct issue from #2? #2 says profiles with can_create from platform/tag without an assigned team "saem do tratamento por tipo e caem n..." (probably into the empty team filter that zeros everything). The consequence of #2 is the list is empty. The consequence of the removed fallback is detail can't be opened either. Both are the same intended removal of "can_create does not remove type access." Since #2 says the fix direction would be to revert these. The removed fallback also is in the same category: it's the detail counterpart.
But is it actually reachable as a separate problem? For a user to view detail when the row is not in list: it requires either stakeholder role, approver role, or tech-by-type. If the tech-by-type fallback is removed, and the user is not a stakeholder or approver, they can't view the detail. But with the new `!canManage` requirement, if the user has canManage, they are NOT a tech specialist, and their list will be zeroed by empty team filter anyway (issue #2). Actually wait — when canManage is true, does the team filter still zero the list? Look at line 12892: `if ($occurrenceTeamFilterIds !== null && !$isTechSpecialistOnly)`. With canManage true and team filter [] (empty), `$memberIdsInTeams` will be empty, and the filter would remove everything except where the user is personally the manager/person. Actually no — for canManage (gestor administrador), does the occurrenceTeamFilterIds come back [] or null? `getSsmaOccurrenceDashboardTeamFilterIds` returns scope for team supervisors/gestors, [] for members with no team. For canManage profiles (administrador), maybe null? Let me check the function to be sure of behavior for the affected profile.
Let me search `getSsmaOccurrenceDashboardTeamFilterIds`.
Tool Calls (2)
code_search
Show Details
Arguments
{"search_text": "function getSsmaOccurrenceDashboardTeamFilterIds", "file_patterns": ["*.php"]}
Result
File: src/Controller/SsmaController.php Match lines: 1 10203| private function getSsmaOccurrenceDashboardTeamFilterIds(?Company $company, ?User $user): ?array
code_search
Show Details
Arguments
{"search_text": "maybeSubmitOccurrenceForValidation", "file_patterns": ["*.php"]}
Result
File: src/Controller/SsmaController.php Match lines: 10 3459| $this->maybeSubmitOccurrenceForValidation($eventEntity, $company, $user); 7767| $this->maybeSubmitOccurrenceForValidation($parent, $company, $user); 7912| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 9328| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 9418| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 11266| private function maybeSubmitOccurrenceForValidation( 25992| $this->maybeSubmitOccurrenceForValidation($event, $company, $user); 26188| $this->maybeSubmitOccurrenceForValidation($event, $company, $user, true); 26190| $this->maybeSubmitOccurrenceForValidation($event, $company, $user, false); 28245| $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
Request #19
deepseek-v4-flash
P:25.21K C:5.25K CR:24.83K CW:0
43234ms
Reasoning
Let me examine how `$company` is defined in the methods at lines 9328, 9418, 25992, 26188 to confirm that the `resolveSsmaEvent` bug (finding #1) is genuine (it's confirmed anyway) and check other call sites to ensure they aren't similarly broken. But finding #1 is confirmed; no need to repeat.
Let me check other callers of maybeSubmitOccurrenceForValidation to see the pattern where `$company` is derived from `$event->getCompany()`. Actually, I shouldn't repeat #1.
Let me now evaluate what other real issues exist in the diff:
1. The removal of display_code in dashboard aggregator result arrays around 22661/22755 — wait these are NOT in buildSsmaViewData but in a different method (aggregating by rows). Let me check context: the hunks show `$result[] = [...]` inside loops around 22738 and 22836, with rows being composed from an array with type/title... Let me read around those areas to understand which method they are in and confirm whether the display_code removal impacts other consumers not covered by #3. Actually #3 covers consumers in Twig templates. OK skip.
2. Auto-scope at 22915 - part of #2. Skip.
Now, other things to check:
- Did the diff modify the controller in a way that leaves `$isTechEarly` etc. logic inconsistent between the early paging filter (12506) and the final hub filter (12887)? Confirmed #4 duplicates.
- The removal of `tryLoadOccurrenceViewRowForTechnicalType` and its call in viewOccurrence — I decided it's a related behavior change. Since confirmed #2 mentions the impact (profiles with platform can_create now exit tech-type handling and fall to empty team filter), detail view removal is the same family. I'll consider whether reporting it would constitute "repeating" #2. The instructions say the confirmed findings were "already identified and confirmed in a prior review pass. Do not repeat them. Continue reviewing all files ... and report any other real issues you find."
The viewOccurrence fallback removal is a separate hunk with a separate user-facing impact. But it's likely part of the same root decision (align permission handling). It may or may not be a real regression depending on intended design. Hmm.
Actually, I want to check whether, after this PR, a "técnico especialista" (member tag with technical type, no canManage) is still able to view detail. With `!canManage` requirement: tech specialist is recognized in list (isTechEarly true when team filter == []). In the list filter at 12892, since isTechSpecialistOnly true, occurrences filtered by type. So list contains their typed occurrences, and viewOccurrence will find the row in `$viewData['occurrences']` via the loop. So for pure tech specialists, detail works fine.
The problem case: can_create granted from platform/tag for member with technical type and no team. Such user is NOT tech specialist anymore, NOT approver, maybe not stakeholder. The list will zero them out (finding #2) — and detail fallback removed too. But also: such users might view occurrence detail via direct link (e.g., notification e-mail) and previously opened it; now they get a redirect. This is consistent with #2's root cause and consequence, so I think it is essentially a repeat of the same intended change. To avoid duplication, I will NOT report it separately.
Hmm, but actually the fallback removal appears in the diff with its own removed comment block. Confirmed finding #2 references "aqui e nos pontos equivalentes do hub e do auto-scope do Painel" — the viewOccurrence fallback is yet another "ponto equivalente". The confirmed finding mentions paginação do hub, filtro final do hub, e auto-scope do Painel. The viewOccurrence detail fallback is not among them. It's plausible the prior review didn't flag the detail fallback removal because it's covered by the general behavior change of the same permission alignment. But since the removal of the fallback + method also removes detail access for users who are not in the list (which previously rescued exactly the zeroed-list scenario) — this seems like a significant consequence. But given the umbrella and to respect "do not repeat", I'll be conservative.
Let me now think about other aspects:
- The import removal is fine.
- Are there other places in this controller that still pass `display_code`? Already no matches. So #3 covers.
Now examine if there are consumers in the controller using the `mapSsmaOccurrenceEntityToListRow`/`mapSsmaEventToOccurrenceListRow` output requiring display_code. Already no other usages of display_code in the controller. The output goes to templates/JS. Confirmed #3 mentions Twig consumers (occurrence_view.html.twig). Fine.
Let me check the `tryLoadOccurrenceViewRowForActionStakeholder` (still present) and `loadOccurrenceListRowsForDetailView` to see if those paths produce display_code or not — but there's no consumer within the controller.
Now, the auto-scope change at 22915: confirmed #2.
Let me look for any other changed lines I might have missed. Let me re-check the diff hunks given:
1. Line 62: import removal.
2. Line 3339: removal of tech fallback (viewOccurrence).
3. Line 7909: maybeSubmit change (finding #1).
4. Line 12503: isTechEarly (finding #2).
5. Line 12880: isTechSpecialistOnly (finding #2, #4).
6. Line 14680/14979: display_code removal (finding #3).
7. Line 16184: removal of tryLoadOccurrenceViewRowForTechnicalType method.
8. Line 22661/22755: display_code removal (finding #3).
9. Line 22833: auto-scope change (finding #2).
Given the confirmed findings cover 1-4 well and other changes are just deletions of dead code (tryLoadOccurrenceViewRowForTechnicalType after fallback removal) and the import, are there any other real issues?
Let me now verify the severity of the maybeSubmit issue — already confirmed.
One more angle: PR scope. The PR's stated scope is "aba Ações" + "fundação backend do Painel". The diff touches occurrence list/detail permissions, display_code removal from hub/list/events and dashboard aggregators. That is arguably out of scope and doesn't match the commit message. But the PR description says these are "ajustes... alinhados ao staging2". Hmm. Actually the confirmed findings already imply scope issues. Not necessary to repeat.
Let me look at the tests file that changed (ActionOrigemEnumTest) — it's not in review_files, so skip.
Now let's double-check that the maybeSubmit issue at line 7912 isn't perhaps not a bug because `$company` is a controller property or inherited from somewhere else. In resolveSsmaEvent, the method signature is `resolveSsmaEvent(Request $request, int $id)`. The local vars: `$user`, `$companyId`, `$event`, `$data`, etc. No `$company`. Is there a class property `$company`? Let me check class properties and `canCompleteSsmaTechnicalType($event->getCompany(), $user, ...)`. In the removed code the diff shows:
```
- $company = $event->getCompany();
- if ($company instanceof Company) {
- $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
- }
+ $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
```
Wait — actually maybe `$company` is a property on the controller? Let me check if there's `private ?Company $company` property. Given `getSsmaCompany()` exists. Let me search class-level properties or how other methods reference `$company` — they usually define it locally. To be certain this is a genuine bug (it's already confirmed though), I could verify there's no class property `$company`. But since it's confirmed, and I'm told not to repeat, let's trust it.
Now let me examine the "isTechEarly" post-filter logic. Actually confirmed #2.
Let me look for new code in the diff that I haven't yet reviewed in detail: lines 22915-... Actually already covered.
Given the confirmed findings and only one file in review_files, are there any remaining unconfirmed real issues? Let me think about the removal of the tech fallback in viewOccurrence more concretely as a user story:
Scenario: Occurrence detail via direct link (email notification or search). Previously, if the user was a technical-type specialist (e.g., canCompleteSsmaTechnicalType true) and not a stakeholder/approver, they could open the detail. After this PR, they cannot unless row appears in list (which it would for pure tech specialists given the correct !canManage). Actually the viewOccurrence flow already handles the normal case via list rows. The fallback was only to handle cases where the row was filtered out of the list.
When is a row filtered out of the list but the user is still a technical-type approver? When the user has technical type and the list filter has removed the line — e.g., "can_create de plataforma" case. That is exactly the profile change in #2. So, the detail-fallback removal is precisely the same profile's scenario. Since the reviewer already confirmed the core problem for those profiles (they lose all access due to #2), the detail fallback is another route by which they lose access, but it's the same root cause/intent change. I'll treat it as covered.
Actually, wait — I want to reconsider. Is there a scenario where the fallback removal independently regresses a case NOT covered by #2? Consider a stakeholder + technician user. List is filtered by team scope to include the user's team. If an occurrence by type is assigned to another team but the user is responsible as technician... The fallback would let them open detail. But since the new tech specialist classification doesn't require team relation... eh. This is getting too speculative.
Given precision-over-recall, and given that the confirmed findings comprehensively address the permission-alignment issues (including where in the diff they appear), I think the most valuable additional observations would be:
- The removal of the technical-type detail fallback in viewOccurrence — I'll flag it as a distinct hunk because it's a concrete lost capability (previously had explicit comment explaining why it existed), and no consumer/template mapping needs external verification. But it could be considered "part of confirmed finding #2's family." Hmm.
Actually, re-reading confirmed finding #2: "Passar a exigir !canManage para classificar alguém como 'técnico especialista' (aqui e nos pontos equivalentes do hub e do auto-scope do Painel) faz perfis cuja permissão de gestão vem de plataforma/tag com can_create — mas sem equipe atribuída no produto — saírem do tratamento por tipo e caírem n..."
The fallback removal at viewOccurrence doesn't involve canManage or tech specialist classification. It removes a rescue path for detail when the hub list has removed the row. Its own comment says the list may remove the row due to platform can_create. Hmm, that actually aligns: can_create from platform doesn't grant team scope → row removed from list → detail fallback allowed opening by type. With both removed, those profiles get nothing.
I'll decide NOT to separately report it because it's fundamentally the same behavioral regression flagged in #2 (can_create-from-platform profiles losing type-based access). Given the instruction not to repeat confirmed findings, and that #2 mentions this class of profiles, I'll not report.
Hmm, but wait. Let me reconsider whether the fallback removal breaks access for a DIFFERENT profile class: users who can complete technical types (canCompleteSsmaTechnicalType) but whose list doesn't contain the row because of team filtering. Previously the fallback rescue used resolveCurrentUserTechnicalTypes and loaded the detail row. Such users might be supervisors with team scope? If teamFilter != [] they aren't tech specialists, but the hub list would be team-filtered; an occurrence of a technical type outside their team... but then should they see it? If they have the technical-type permission to complete, and the occurrence is of that type, they could finalize it. Actually canCompleteSsmaTechnicalType checks technical type permission. It'd be odd for them to be able to complete but not view. But this nuance existed pre-PR for other reasons.
I think the decision to not duplicate stands. Let me also consider if there are tests for these changes — the review checklist suggests suggesting tests for behavior changes in authorization flow is critical per user rules. Confirmed findings mention "Mudança de comportamento sem teste automatizado" is a guideline. But confirmed finding #4 covers duplication.
Now let me also look at line ~14680/14979 to see which mapping functions removed display_code. Both are used to build occurrence rows for list/detail. And 22661/22755 removed from dashboard rows. The consumers are the templates/JS. Already #3.
Let me also review whether there is an `actionOrigem` code referenced in the diff... No. The test file (other) changed ActionOrigemEnumTest normalize; it's out of review_files.
Given the confirmed findings and this analysis, I should also verify no new code was introduced by this diff that could be an issue — the diff is almost entirely deletions. Let me confirm there are no added lines besides those in the confirmed findings.
Looking at the diff:
- `+$this->maybeSubmitOccurrenceForValidation($event, $company, $user);` (added line — #1)
- `+$isTechEarly = !$canManageEarly` and `+ && !$isViewerEarly` (#2)
- `+$isTechSpecialistOnly = !$ssmaCanManageOccurrences` and `+ && !$this->isSsmaViewer()` (#2)
- auto-scope additions `&& !$this->canManageSsmaOccurrences()` and `&& !$this->isSsmaViewer()` (#2)
- comments added (#2/#4)
All additions are covered. Deletions of dead code (method removal, import) are consequences.
Let me double-check the viewOccurrence removal is not referenced elsewhere... `tryLoadOccurrenceViewRowForTechnicalType` no matches anywhere else (search returned "No matches found" — wait, the search for tryLoadOccurrenceViewRowForTechnicalType returned "No matches found", meaning the method was removed and not referenced. Good.)
Now I want to reconsider one thing: whether `$company` in `resolveSsmaEvent` might actually be defined (making finding #1 wrong?). It is already a confirmed finding, so presumably verified. Also there might be a genuine bug worth adding nuance, but confirmed #1 covers it.
Let me reconsider the requirement from the user rules about scope creep. This PR diff changes list/detail occurrence authorization and removes display_code across the hub/dashboard — far beyond the declared "aba Ações" scope. But #3 and #4 and #2 already signal scope/permission issues.
Given all changes are covered by the confirmed findings, I might end with task_done. But before that, let me thoroughly double check one more potential real issue that is not among confirmed findings: In `viewOccurrence`, after removing the technical-type fallback, the comment about stakeholder fallback remains. Is there a subtle logic bug? No new code added there.
Also I should consider whether removing the tech fallback but keeping `tryLoadOccurrenceViewRowForActionStakeholder` leaves the flow correct; no bug.
Also check the auto-scope change at 22915 context to ensure no logic inversion, e.g., condition now returns filter only when `!canManage && !viewer`, but the code after might break for canManage users — that's #2.
Now, one more subtle thing: at line 12506 the change to `$isTechEarly` interacts with `$needsOccurrencePostFilter` computation below:
```
$needsOccurrencePostFilter = ($teamFilterEarly !== null && !$isTechEarly)
|| $isTechEarly
|| (!$canManageEarly && !$isViewerEarly && $teamFilterEarly === null && !$isTechEarly);
```
For a canManageEarly user (previously isTechEarly true when team == [] and techTypes non-empty, now false): teamFilterEarly === [] (not null) → first term true → post filter needed → full occurrences loaded then... wait. Actually if canManage is true, but teamFilterEarly === []? For a manager without team assigned, getSsmaOccurrenceDashboardTeamFilterIds returns []? Or null? If [], then with isTechEarly now false, the first term `($teamFilterEarly !== null && !$isTechEarly)` is true → needsPostFilter true → loads full list (no pagination) then filters by team at 12892 with occurrenceTeamFilterIds === [] and isTechSpecialistOnly false → team filter zeros the list. That's the #2 consequence (manager-with-platform-can_create has empty team scope → zeroed). But the #2 comment says "perfis cuja permissão de gestão vem de plataforma/tag com can_create — mas sem equipe atribuída no produto — saírem do tratamento por tipo e caírem no filtro de equipe com lista vazia, o que zeraria todas as ocorrências". Confirmed. Yes.
OK. I'm fairly convinced that after confirmed findings, the remaining diff additions are covered. But to be safe and thorough given the "review every file" requirement, let me also scan the file diff for additional context around lines 14600-15050 and 22600-22950 to see the functions and check for any subtle in-code consumer of display_code they removed.
Already searched: no other display_code usages in controller; no remaining formatter usage. Consumers are external (Twig/JS) — confirmed #3 says templates read display_code|default(...).
Let me confirm whether `mapSsmaOccurrenceEntityToListRow` output with display_code removed is also used to build detail data passed to `occurrence_view.html.twig` (line 573 reads display_code). Yes #3 covers.
I will also verify one detail: the diff at line 14703 region - this is `mapSsmaOccurrenceEntityToListRow`. And 15003 - `mapSsmaEventToOccurrenceListRow`. Those still used by detail flow. And consumers of `display_code` from these rows would break — #3 says Twig reads display_code with default. If they use `|default(...)`, removal just makes the fallback used. #3 describes it becoming numeric id pure. Confirmed.
So after analysis: all remaining changed lines are deletions that are either dead code cleanup or already covered by confirmed findings, and all additions are covered by confirmed findings. There don't appear to be any additional unreported genuine issues.
Wait, I should double check there's no issue in the test file being part of the review group... review_files only includes src/Controller/SsmaController.php. other_changed_files includes the test but not in the review group, and instructions: "Your comments must address code within <review_files> — never produce comments targeting files outside it." So skip test file.
Hmm, but "Review every file listed in <review_files> individually." Only one file. OK.
Let me do one more careful check of the `viewOccurrence` removed fallback against confirmed finding #2 wording, to decide final. Confirmed #2 focuses on `isTechEarly`, `isTechSpecialistOnly`, and auto-scope. Those are list-building. The detail fallback (tryLoadOccurrenceViewRowForTechnicalType) removal is not referenced there. It's an independent removal in the diff and it does remove a real previously-exercised path (the removed comment explicitly explains why the path existed: "detalhe deve abrir mesmo se o filtro de lista ... tiver removido a linha do hub").
Is it still reachable by users? A user with technical-type but no stakeholder/approver link who opens detail directly (e.g., from a link shared) — but pre-change, if they had can_create from platform they'd already be flagged as non-tech-specialist in the list? Wait the removed fallback used `resolveCurrentUserTechnicalTypes` regardless of canManage — it would rescue exactly those can_create users. So the fallback previously rescued users that the new list logic drops. Removing it while ALSO dropping them from tech list means they have no access. But this is exactly the regression described in #2: those profiles lose type treatment. So if #2 is fixed (reverted), the fallback removal... would they still need the fallback? With the old rule restored (canManage ignored), these can_create users WOULD be treated as tech specialists in the list, their rows would be type-filtered and present → detail finds the row via list → fallback not needed. Hmm interesting. That suggests the fallback removal is consistent with the new rule's failure mode only, and fixing #2 alone might restore access. But the fallback existed even before, to guard against subtle filter mismatches (the old comment says "mesmo se o filtro de lista (ex.: can_create de plataforma) tiver removido a linha do hub"). So the fallback removal is a defensive-capability reduction.
Given the confirmed finding #2 targets the profiles losing access, and the fallback removal is one more manifestation, I will not add a separate comment to avoid duplication/redundancy. However, I could add a small note only if clearly distinct. I'll decide not to.
Let me finalize: Since all issues have been confirmed previously and no additional genuine issues found, call task_done.
Wait, but the instructions say the user_task is to review and "report any other real issues you find." We should ensure we actually produce the final response confirming review completion. Since all findings are pre-confirmed, and this pass found nothing new that isn't covered, task_done with a brief summary in pt-BR.
Let me write final message summarizing that the file was reviewed, findings previously confirmed cover the issues, and no additional issues identified. Then call task_done.
Analisei o arquivo `src/Controller/SsmaController.php` (único arquivo do grupo de revisão) hunk a hunk, cruzando com o contexto (`viewOccurrence`, `resolveSsmaEvent`, `buildSsmaViewData`, filtros do hub/Painel) e com buscas no código:
- Remoção do import e do método privado `tryLoadOccurrenceViewRowForTechnicalType`: confirmei via `code_search` que não restam referências ao formatter nem ao método no arquivo — remoção de código morto, sem quebra local.
- Bloco removido em `viewOccurrence` (fallback de detalhe para técnico por tipo): é a contraparte do mesmo alinhamento de permissão já sinalizado (perfis com `can_create` de plataforma sem equipe atribuída perdem o tratamento por tipo) — comportamento já coberto pelos achados confirmados.
- `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);` em `resolveSsmaEvent` (variável `$company` inexistente no escopo), mudanças em `$isTechEarly`/`$isTechSpecialistOnly`/auto-scope e remoção de `display_code` nas respostas de listagem/detalhe: todos já reportados nos achados confirmados desta revisão, sem duplicação necessária.
- Verifiquei que nenhuma linha adicionada pelo diff fica fora dos achados confirmados; o restante é deleção de código que ficou sem consumidores.
Não identifiquei nenhum problema real adicional além dos já confirmados nesta passada.
Tool Calls (1)
task_done
Show Details
Arguments
{"state": "DONE"}
review_filter_task
Request #1
deepseek-v4-flash
P:5.75K C:1.26K CR:2.05K CW:0
9385ms
Reasoning
Let me analyze the review comments against the diff.
The file is src/Controller/SsmaController.php.
Comment c-0: Claims that removing `$company = $event->getCompany(); if ($company instanceof Company) { $this->maybeSubmitOccurrenceForValidation($event, $company, $user); }` and replacing with `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);` makes `$company` undefined in the method's scope, causing TypeError since the parameter `Company` is required.
Wait, but the comment says "usa uma variável de empresa que não existe no escopo deste método" — uses a company variable that doesn't exist in the scope of this method. Hmm. Is `$company` defined elsewhere in the method? We can't see the full method. The diff shows at line 7909:
```
$this->entityManager->flush();
- $company = $event->getCompany();
- if ($company instanceof Company) {
- $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
- }
+ $this->maybeSubmitOccurrenceForValidation($event, $company, $user);
```
Wait actually this is a protected subject: behavioral change / error path / altered error path. The comment is about a behavioral change — a removed instance check that could cause an error path. This falls under "Behavioral or compatibility change" protected subject. Also memory safety? No. But it's about runtime behavior — removing a check, an error path. The subject is a behavioral change. So it's a protected subject → approve.
Actually let me consider Ground A/B: is the comment factually wrong per the diff? We can't verify whether `$company` is defined in the method scope (the diff shows partial context). The diff does show that `$company` variable is used in the new line `$this->maybeSubmitOccurrenceForValidation($event, $company, $user);`. Whether $company was previously defined elsewhere in the method, we cannot tell from the diff. So not provably wrong. Also protected subject (behavioral/error path). Approve.
Comment c-1: About the `!canManageEarly` requirement being added, causing profiles with management permission from platform but empty team scope to lose access. This is behavioral change / compatibility analysis. Protected subject (behavioral change). Also involves reasoning about runtime behavior and files not visible. Can't prove wrong. Approve.
Comment c-2: About removing `display_code` field from responses without updating consumers (templates). This is about a behavioral/compatibility change — the displayed value in UI changes. Protected subject. Also the comment references templates not in the diff. Can't verify. Approve.
Comment c-3: About code duplication — three points duplicating the tech-specialist rule. This is a maintainability/style comment. It's not exactly style/formatting but a recommendation about centralizing. Is what it states true? It says the rule is duplicated in three points: paginação do hub, filtro final do hub, and auto-scope do Painel. Looking at the diff, we see:
- At 12525: `$isTechEarly = !$canManageEarly && !$isViewerEarly && $teamFilterEarly === [] && $userTechnicalTypesEarly !== [];`
- At 12903: `$isTechSpecialistOnly = !$ssmaCanManageOccurrences && !$this->isSsmaViewer() && $occurrenceTeamFilterIds === [] && !empty($userTechnicalTypes);`
- At 22833: `if ($userTechnicalTypes !== [] && !$this->canManageSsmaOccurrences() && !$this->isSsmaViewer())`
So indeed there are three points in the diff with the same rule. The comment states a true fact (three points exist). It's a recommendation for centralizing — value judgment. Not incorrect. Approve. Also it cites code that exists in the diff (the three conditions). Is it about style? It's about maintainability/redundancy. The comment states something true of this diff. Not grounds for removal.
Actually, wait — for c-3 the statement "num arquivo que já tem ~28 mil linhas" — the file appears to be huge (line numbers up to 22833), plausible. But even if not, that's not a protected concern. Anyway it's not provably wrong.
Now, are any of these comments provably factually wrong per the diff?
Let me think about Ground A more carefully for c-0. The comment targets the diff line that exists (the new line calls `maybeSubmitOccurrenceForValidation($event, $company, $user)`). The code the comment describes is present in the subject file's diff. So Ground A doesn't apply.
Ground B: Is there a diff line that literally contradicts the comment's central claim? The comment's central claim: `$company` is not defined in this method's scope. We cannot see the whole method, so we cannot verify. The diff shows a removal of a local definition. It could be that `$company` was defined earlier in the method (e.g., there's a broader method with a `$company` variable). Actually if the method previously reassigned `$company = $event->getCompany();`, that suggests `$company` might have existed earlier. But we can't confirm. Not provable.
Also protected subject: behavioral change / error path — the comment is about an altered error path. Approve.
Let me finalize: approve all comments.
Actually wait — is c-0 protected? Its subject is the removal of instance check and a TypeError, which is about an altered error path / behavioral change. Yes, protected. Approve.
So approve_all_comments.
Tool Calls (1)
approve_all_comments
Show Details
Arguments
{}
tests/Unit/Product/Ssma/ActionOrigemEnumTest.php 3 requests
plan_task
Request #1
deepseek-v4-flash
P:6.89K C:10.71K CR:1.41K CW:0
90872ms
Reasoning
The user wants me to analyze a code change and produce a structured review plan. Let me understand the changes:
1. The file under review is `tests/Unit/Product/Ssma/ActionOrigemEnumTest.php`
2. There's another changed file `src/Controller/SsmaController.php` (not in this review group, but mentioned as "other changed files")
The test file changed from testing:
- `selectLabels()` returning all four labels
- `label()` with canonical values and aliases
- `label()` fallback
- `isInspectionOrApproach()`
- `resolveRelatedEventType()` on `SsmaAction` entity (testing related event types for inspection/approach/other/occurrence)
To testing:
- `normalize()` accepting aliases and canonical values, returning null for empty/unknown
- `selectLabels()` covering base origin types (only checking OCORRENCIA, INSPECAO, ABORDAGEM keys; no longer checking OUTRO)
- `isInspectionOrApproach()` with fewer cases (no `inspection` alias, no `outro`, no `null`)
The PR background says this is a small delta on top of content already in staging2. The controller `SsmaController.php` was modified with permission adjustments (`canMutateSsmaActionPlan`), prevention area scope, and Painel view data.
Wait — the review task is to analyze the diff shown for `ActionOrigemEnumTest.php`. The test file is heavily changed: many tests removed (-69 lines in the test file alone, roughly from 105 to 36).
Key observations for the review plan:
1. The test file removed tests for `resolveRelatedEventType()` which was a method on `SsmaAction` entity. But where did the implementation go? If the test was moved to another file (e.g., entity test), that's fine. If the method `resolveRelatedEventType` was removed from the entity, the removal of tests might be aligned with code changes. But we only see a test file here — the reference to `SsmaController.php` change is the other file. We should check whether related entity methods (`ActionOrigemEnum::label`, `ActionOrigemEnum::normalize`, `SsmaAction::resolveRelatedEventType`) are consistent.
2. The test file also removed tests referencing `SsmaAction`, `SsmaEvent`, `SsmaOccurrence` entities and the `SsmaTestCase::action()`/`company()` helpers — those are still present in the parent class maybe.
3. The new test `testNormalizeAcceptsAliasesAndCanonicalValues`:
- Asserts `ActionOrigemEnum::normalize('')` is null
- Asserts `normalize('desconhecido')` is null
- Tests 'inspecao' → INSPECAO, 'inspection' → INSPECAO, 'abordagem' → ABORDAGEM, 'approach' → ABORDAGEM, 'ocorrencia' → OCORRENCIA
- Notably missing: 'outro' → OUTRO? And 'ocorrência' (accented), 'inspeção', 'abordagem' with accent? Also 'evento'/'occurrence' aliases are not tested anymore. But that's test coverage, not necessarily a bug.
4. `testSelectLabelsCoverBaseOriginTypes` checks keys OCORRENCIA, INSPECAO, ABORDAGEM exist; asserts 'Inspeção' and 'Abordagem' labels. Missing OUTRO key check. Since `normalize('outro')` and `selectLabels()[OUTRO]` aren't tested, is OUTRO still part of the enum? If OUTRO was removed from the enum (given "base origin types" wording), then references elsewhere (e.g., in SsmaController or templates) might break. If OUTRO still exists, coverage dropped but not a bug.
5. `testIsInspectionOrApproach` removed the 'inspection' alias test, 'outro' false case, and null case. The normalized aliases are still relevant — a regression in alias handling for `isInspectionOrApproach` (which may receive raw input such as 'inspection') could go unnoticed. But is `isInspectionOrApproach` still used with non-normalized input? In the old code, `isInspectionOrApproach('inspection')` returned true; the new code removed that assertion. If `isInspectionOrApproach` still internally checks aliases, fine. If the method behavior changed to only match canonical 'inspecao'/'abordagem', callers passing raw DB values might break. Need to look at the enum implementation.
Given the hidden `SsmaController.php` changes and the OCR background describing permission changes and normalize filters, some risk points:
- The tests might be removed/moved because functionality moved elsewhere. The removed `resolveRelatedEventType` tests: if the method moved from `SsmaAction` entity to somewhere else — but we don't see those code changes in this review group. Per the analysis rules, only analyze newly added and modified code. Removed test code is largely "deleted" — but deletions in a test file that correspond to removing coverage should be flagged if behavior changed without replacement tests.
Actually, the review scope rules say: "Only analyze newly added and modified code; ignore deleted code." However, in test file changes, deletions can reflect loss of coverage, and the PR rules say "Se a PR alterou comportamento e não trouxe teste novo/atualizado cobrindo esse comportamento, sinalize como pendência". But behavior changes are in the controller (other file) and possibly the enum (not shown). Since the enum's implementation isn't in the diff, we cannot verify the normalize behavior except through tests.
Tool-based plan: use `code_search`/`file_read` to find the `ActionOrigemEnum` implementation, `SsmaAction::resolveRelatedEventType`, the `SsmaController` diff, `SsmaPreventionAreaAuthorizationService`, and route/permission config to verify risk points.
Let me plan concrete issues:
Issue 1 (medium/high): Test coverage removed for `resolveRelatedEventType` mapping between persisted origem and related event type, and for `label()` fallback — if `SsmaAction::resolveRelatedEventType` and `ActionOrigemEnum::label` still exist in production code (used by templates/controllers), these deletions reduce regression protection on logic that was part of this PR family. Verify whether the method still exists and callers remain; if yes, coverage removal is concerning because the PR background claims regressions were checked in "modal de validação, permissões". Actually this is a test-only change; actual risk is future regression.
Wait, but tests were removed possibly because those features were deliberately removed (e.g., resolveRelatedEventType may no longer be needed because filtro de origem normalizes with actionOrigemEnum::normalize). Checking the enum and entity is needed.
Issue 2 (medium): `normalize` contract is asserted for empty string and unknown string returning null. But old `label()` fallback semantics existed, and old tests covered `label('ocorrência')` (accented) mapping to 'Ocorrência' — replaced test no longer covers accented variants ('ocorrência', 'inspeção'). If `normalize` doesn't handle accented input while production data (DB values) may contain accented labels, values like 'Inspeção' could now normalize to null and filter results incorrectly. The DB may store 'Inspeção' with accent or 'inspeção'. Assert `normalize('ocorrencia')` works but does normalize strip accents? Old test data provider included accented strings as aliases. The new test removed accented coverage. So verify.
Issue 3 (medium/low): `testIsInspectionOrApproach` now only tests canonical values and drops `inspection`/`approach` aliases and null safety. Since controller-level filter likely calls normalize then isInspectionOrApproach, and coverage for alias/raw input is gone, a regression in handling raw user/alias values could leak through. Also `isInspectionOrApproach` receiving `null` previously returned false; now untested. The rule about user-specific testing: changes in behavior without updated tests — point it out.
Issue 4 (medium): OUTRO removed/reduced. `testSelectLabelsCoverBaseOriginTypes` asserts "base origin types" — missing OUTRO. If OUTRO case is still in enum but not selectLabels, maybe the UI select lost 'Outro' option — would that break existing DB rows with origem=OUTRO? Check enum implementation and controller filter — in filter, origem = OUTRO may be normalized to null? Let's see normalize('outro') not tested. If OUTRO was dropped entirely from enum (renamed base types), then stored values with OUTRO could fail. But enum file isn't in the diff — so presumably unchanged? The diff only modifies tests. The implementation enum must already exist in the codebase (previously with label/selectLabels and now with normalize + selectLabels of base types). Since implementation not in the review group, use tools to inspect.
Issue 5 (reference to other file): `SsmaController.php` modified but not in review group — the checklist says analyze changed code in the provided diff only; but "Other files changed" is context. The instructions say scope only to changes shown. We can mention tool use to cross-check controller interplay with enum (e.g., filter uses ActionOrigemEnum::normalize results feeding isInspectionOrApproach).
Let me formulate the review plan with tool guidance lines.
High severity? Possibly not. The diff is tests. However, the user-specific rules: if the PR changed behavior (controller permission adjustments, normalization filter in controller) and did not bring test covering it — for authorization flows it's "Crítico". In this review group we only have the test file. The controller is in "other changed files", not in review group. Should we flag missing functional tests for authorization changes in the controller? The diff doesn't include controller content, so we can't claim what changed precisely; but the file list tells us `SsmaController.php` was modified with permission adjustments, and the test file modified is unit-level enum tests. The test-related user rule says: endpoint/functional coverage is required; unit object tests do not replace functional tests. The `ActionOrigemEnumTest` is unit test — but its new tests are unit behavior for normalize; per the rule, tests should cover real integration path, not only a helper function — the normalize is arguably a helper. But the review group is only this test file; we can plan code_search on controller to verify whether an existing functional test covers filter/permission changes and whether the normalize helper is actually being used in the controller/service paths.
Let me structure the issues sorted by severity:
1. [high? medium?] Coverage removals of `resolveRelatedEventType` and `label()` might correspond to behavior changes on the SSMA action plan flow (modal validation/origem) with entity methods still present/used. Actually, without verifying, we don't know whether it's a real issue. Severity can be medium, with tool call to verify existence/callers.
Let me consider: it's likely that these methods were removed from the entity in previous PRs (feature already in staging2) and this test file sync is removing stale tests. The PR background says branch brings delta needed; tests updated for normalize. If `label()` no longer exists or the enum changed, removals are appropriate. Need to inspect the enum implementation and the entity to know.
Let me be careful: We are asked to produce a review plan — not actual review comments. So the output is: Summary + Issues list, each with severity, description (location, nature, impact), and tool guidance lines. The description should be in Portuguese pt-BR per "Always respond in Português (pt-BR)".
Also the format demands no markdown fences and plain text. Wait, "Always respond in Português (pt-BR)" and user-specific rules in Portuguese. The output format earlier states:
```
Summary: ...
Issues
1. [high|medium|low] (...)
→ (tool name) (args) — reason
```
So produce that.
Now let me craft realistic issue candidates:
Issue A — normalize '' returns null could break controller filter default: In the controller, the filter likely does `ActionOrigemEnum::normalize($origem)` or uses `isInspectionOrApproach`. If normalize('') returns null (new test confirms), how does the controller treat empty filter (i.e., "all origins")? If the controller assigns the normalized value to the filter and then compares `=== null` as "no filter", fine. But if it passes to a query builder with `IN (null)` or to a Twig template condition `origem == null`, empty selection may filter occurrences incorrectly. Need to look at SsmaController diff. The tool `code_search` first to find the enum and controller code.
Actually, the new method contract (`normalize` returns null for empty/unknown) seems intentional, and test asserts null; not a bug per se. But regression coverage needed where the controller uses it.
Issue B — OUTRO absent from tests & possibly from labels: existing records in DB with OUTRO (e.g., actions registered earlier with origem=OUTRO) may now be excluded from the UI select and be unfilterable/not displayed; if the select labels cover only base three types, action with "Outro" origem can still be read but not edited/filtered. Check enum status: does ActionOrigemEnum still define OUTRO? If yes, but selectLabels no longer contains it (test only checks keys presence, and removed the full equality with OUTRO), UI could lose the option. Tool: file_read the enum file.
Issue C — tests dropped for `isInspectionOrApproach` with alias input and null; the controller likely uses this method with raw/normalized input from request to toggle column visibility or for "tipo de origem" rules. Need to look at where `isInspectionOrApproach` is used in `.twig` (templates may call methods on enum). Actually this method is probably used in templates/controller with stored normalized values. A regression there (e.g., now only matches canonical and no aliases) changes how inspections/approaches are treated. Tool calls.
Issue D — removed tests related to events/occurrences mapping may hide a side-effect: `testRelatedEventTypeTreatsLinkedEventAsOccurrence` — if a user links event/occurrence, related origin type resolved to OCORRENCIA; also removed "resolveRelatedEventTypeUsesPersistedOrigemForInspectionApproachAndOther". If that behavior changed (or removed) in production code, actions tied to inspection/approach may no longer resolve to their related event type when user clicks "Ir para origem" (the overflow menu). Need to verify in SsmaController/entity and route handling.
Issue E — PHPUnit/test style: the test `testNormalizeAcceptsAliasesAndCanonicalValues` asserts normalize('inspecao') and normalize('inspection') map correctly, but does not test normalize('outro')/OUTRO mapping nor null-ish behavior of other inputs; test naming/labels: the new normalize test also asserted normalize('') and normalize('desconhecido') null, ok.
Actually maybe the real concern for the plan:
1. [medium/high] Removed tests may disagree with production enum methods `label()`, `selectLabels()`, `SsmaAction::resolveRelatedEventType()` that remain and are used by the templates/controller — verify to decide. If the methods remain implemented and reachable, the removal of these tests removes regression safety around the modal/“Ir para origem” flow; if they are gone, ensure callers updated.
2. [medium] normalize is not covered w.r.t. accented values used previously ('ocorrência', 'inspeção', 'inspeção'/evento?) and with OUTRO/'evento' alias; previously `label()` handled those; filter at controller could now drop/hide records whose values carry accents. Actually DB likely stores canonical 'inspecao' values; maybe fine.
3. [medium] Coverage of selectLabels no longer asserts full list — with controller now using selectLabels to render filter select in the actions tab and "origem" column values used for display, the removal of OUTRO in expectation might match production changes (i.e., OUTRO being removed from UI as origin). If the enum still has OUTRO and DB holds those values, UI may not map label displaying raw value. verify.
4. [low] The PR description claims fixes in permission/UX, but the only test file in this diff changes unit tests of the enum; there is no functional/integration test for the new permission gating (`canMutateSsmaActionPlan`) or for the normalization filter through HTTP request (per user-specific rule about needing functional endpoint tests). Also if `ActionOrigemEnum::normalize` accepts aliases like 'inspection'/'approach' (English), maybe there's no endpoint test to confirm the request param gets normalized before DB search. The unit tests cover the helper, but not the integration through the controller route; user rule: "Teste deve cobrir o caminho de integração real... não só uma função helper isolada". So flag as low/medium pendência: falta teste funcional cobrindo o filtro e permissões alterados no controller.
Let's decide severity ordering:
- high: something that could cause system crash/security/data loss. Test removal might not directly reach that unless we claim production break. We need to be cautious. Possibly a high-severity issue: the changes appear to remove (or replace) functionality `label()` and `resolveRelatedEventType` that are likely used by the rest of the app (twig templates show origem labels; "Ir para origem" uses resolveRelatedEventType to choose where to go). If the test removal mirrors removal of these methods while templates still call them, runtime errors (call to undefined method) would be high. But we don't have diff evidence about the enum/entity modifications. Using tools to verify is the plan; we can set severity based on expected verification. The plan is allowed to hypothesize then guide tools.
Since tool calls are planned, not executed, the severity shown is our current estimation.
I must also consider analysis rules: focus on added/modified code (new tests). Deleted code should be ignored unless relevant to behavior. But removing tests and reducing coverage is a review concern under user-specific rules. Ok.
Let me now prepare the final text in pt-BR.
Summary line: describe the change: test file updated to reflect enum API evolution: new normalize() contract, selectLabels reduced to base types, removed tests tied to entity behavior (label fallback / resolveRelatedEventType / relacionamento com SsmaEvent/SsmaOccurrence).
Issues:
1. [high] Remoção dos testes de `resolveRelatedEventType` e `label()` pode ter deixado chamadas vivas sem cobertura — o fluxo "Ir para origem"/coluna origem no modal de validação ainda depende de mapear origem (INSPECAO/ABORDAGEM/OCORRENCIA) para o tipo de evento relacionado; se a regra foi alterada/removida no código de produção enquanto templates/controller continuam usando, o usuário pode receber erro/rota errada ao clicar em "Ir para origem" ou a lista não diferencia a origem correspondente. Tools: file_read enum ActionOrigemEnum.php; code_search for 'resolveRelatedEventType'; code_search for 'label(' usage; file_read diff of SsmaController.
Actually "Ir para origem" — the related origin might navigate to the related event detail. resolveRelatedEventType returns enum value mapping origem to occurrence/event type. If removed for OUTRO, then navigation for 'OUTRO' origem might break.
But hold on: this test file removal might correspond to the feature PR that's already merged; maybe resolveRelatedEventType now uses ActionOrigemEnum::normalize inside entity. Either way, tool verification needed.
Severity could be medium until verified but we make plan with high because unresolved behavior change around entity mappings could break navigation/UI. Hmm. To respect precision, I'd set medium. But review plan severity matters for triage. The instruction says judgement; we can estimate. I'd say:
1. [medium] ... about coverage reduction and need to verify whether entity methods (`resolveRelatedEventType`) and `label()` were removed; callers in templates/controller could fatal or degrade.
2. [medium] About normalize('') null and controller filter default ("todos") — precisa confirmar se o controller trata o valor vazio como "sem filtro" antes de aplicar; caso contrário, selecionar "todos" pode esconder ocorrências indevidas. Also empty default route param.
Actually careful: did the controller filter code change in this PR reference? The other file SsmaController.php includes "filtro de origem normaliza aliases". Look: commit list: "filtro de período alinhado ao design s…". The controller patch likely calls ActionOrigemEnum::normalize. If normalize('') returns null, the controller may need to check `if ($origem === '' || $origem === null)`. If the controller forgets and passes NULL into an IN clause, that filters to rows with NULL origem — bug. Good reason for a functional test; that's plausible. The unit test itself asserts normalize('')===null — desired — but integration isn't covered.
3. [medium] OUTRO: o novo `selectLabels`/`normalize` parece cobrir apenas "tipos base"; OUTRO não é testado como entrada normalizada (normalize('outro')) e nenhuma label OUTRO é esperada. Se ações persistidas com origem OUTRO ('outro') existem e o filtro agora usa normalize, elas podem ficar sem correspondência no filtro e/ou sem label na listagem; verificar se o enum mantém OUTRO e como o controller lida.
4. [low] Falta de teste funcional/integração: PR altera permissão e filtros no SsmaController (fora deste grupo), mas os únicos testes do diff são unitários de enum — sem teste de endpoint para o filtro de origem com aliases (ex.: chamar a rota com `?origem=inspection` deve retornar as ações de Inspeção e respeitar o escopo de área do usuário; supervisor não deve acessar criação). Essa é a pendência de teste do padrão da regra do usuário (testar caminho real). Tools: file_find e code_search to see existing controller tests (SsmaControllerTest?) and route names; file_read other file to propose the test.
Also maybe issue: testIsInspectionOrApproach removed `null` case — isInspectionOrApproach might receive null in templates (e.g., when origem null) — no longer covered, and if implementation assumes string, passing null/'' could produce TypeError under strict types. Wait the test is about `isInspectionOrApproach` with strings. Removal of null case might mean the method no longer needs to handle null. Skip.
Also `testNormalizeAcceptsAliasesAndCanonicalValues` accents coverage removed ('ocorrência', 'inspeção'). Might fold into OUTRO issue.
Let me also think about selectLabels semantics: previously equality test asserted 4 labels include OUTRO => 'Outro' etc. Now labels may not include OUTRO; the test only says base. If selectLabels is used to build select filter in Twig, and OUTRO is dropped, users can't filter "Outro". That matches the enum "normalize base types", but records with origem 'outro' still exist. So potential data filtering gap: Filter select shows base types, "Outro" missing → cannot query them, and old data with OUTRO shows maybe raw 'outro' label (label fallback removed → blank). Wait old label() default fallback is also removed? Old label(null,'') returned '' and label('xyz') returned 'xyz'; new normalize would give NULL for unknown. If templates use `normalize` output to display labels, unknown DB value becomes null and render blank/empty column. OK, but again production enum content not visible.
Tools list:
- `code_search` for 'enum ActionOrigemEnum' or 'ActionOrigemEnum' file position; eventually file_read on path found — but tool must be one per line: we can chain: `code_search` with search_text 'ActionOrigemEnum' then file_read on the enum file path after found. Review plan lines allowed to say call after found? We can just do `file_find query_name ActionOrigemEnum` then `file_read path found`. Since we don't know the exact path, use file_find first.
Tool lines:
Issue 1:
→ file_find query_name ActionOrigemEnum — localizar a implementação do enum (normalize/selectLabels/label) para comparar contrato com o novo teste
→ file_read src/Enum/Ssma/ActionOrigemEnum.php (path after find) — hmm can't put dynamic path; but plan is guidance. We could include explicit expected path 'src/Enum/Ssma/ActionOrigemEnum.php'. Possibly guess: namespace App\Enum\Ssma\ActionOrigemEnum => src/Enum/Ssma/ActionOrigemEnum.php. That's reasonable.
→ code_search search_text 'resolveRelatedEventType' — check if entity method remains and where used (controller/templates)
→ file_read (after diff) SsmaController.php via file_read_diff? Actually to see other changed file we can call `file_read_diff src/Controller/SsmaController.php` — but file_read_diff with path_array. That shows diff for those files. This can reveal how controller uses the enum to confirm whether issues are real. Yes: file_read_diff accepts path array. Use it.
Issue for missing functional tests:
→ code_search 'class SsmaController' or search test files: file_find 'SsmaControllerTest' / 'Ssma' test directory; code_search for 'ssma_plano_acao' route usage in tests; file_find 'tests/Product/Ssma'.
Let me craft the exact final content.
Issue descriptions in Portuguese with structure (1 what changed/practical impact, 2 why it matters, 3 what to do).
Issue 1 [medium]:
"Os testes que garantiam o mapeamento da origem para o 'tipo de evento relacionado' (usado no fluxo 'Ir para origem') e o fallback de rótulo foram apagados. Se esses métodos ainda existirem e forem chamados pelo controller/telas de Ações, a remoção tira a rede de proteção de uma regra que define para onde o usuário é levado e qual origem aparece; qualquer regressão futura passa despercebida. Se os métodos foram de fato removidos do código, é preciso confirmar que nenhuma chamada restante quebra (erro de método inexistente em template/controller). Confirme o estado atual do enum e dos chamadores antes de aprovar; se a regra continua viva, mantenha testes equivalentes (idealmente via endpoint) no lugar."
→ tool lines as above.
Issue 2 [medium]:
"Os novos testes definem que `normalize('')` devolve null, mas não há teste mostrando como o SsmaController trata esse null ao aplicar o filtro de origem. Como a mudança no controller passou a normalizar o parâmetro vindo da request, o valor vazio (opção 'todos'/'sem filtro') pode acabar virando condição `origem = null` na consulta e esconder todas as ações que têm origem preenchida. É preciso verificar se o controller distingue 'filtro ausente' de 'origem desconhecida' antes de montar a query e cobrir esse caminho com teste funcional da rota."
→ file_read_diff src/Controller/SsmaController.php (ver como o controller chama normalize e monta o filtro)
→ code_search 'normalize(' '*.php' em src/ (achar os pontos de uso do normalize)
Issue 3 [medium]:
"A cobertura de aliases acentuados ('ocorrência', 'inspeção') e do valor 'outro'/OUTRO sumiu do teste — o teste novo só cobre formas sem acento e os três tipos base. Se o banco ainda contém registros com origem gravada como 'outro' ou com acentos (dados antigos ou importados), o filtro/select pode não reconhecê-los e essas ações deixam de aparecer ou ficam sem rótulo na listagem. Verifique se o enum mantém OUTRO e se `selectLabels`/`normalize` tratam acentos; se sim, cubra no teste; se não, é decisão de produto que precisa ser explícita, pois afeta dados existentes."
→ file_read src/Enum/Ssma/ActionOrigemEnum.php (conferir constantes OUTRO e tratamento de acento/aliases)
→ code_search search_text "OUTRO|'outro'" file_patterns 'src/' (ver uso de OUTRO fora do enum: controller, templates, data fixtures) — maybe.
Issue 4 [low]:
"A PR altera permissão e filtros no controller, mas o único ajuste de teste deste diff é unitário sobre o enum; não há teste de integração do endpoint (aplicar `?origem=inspection` na rota do Plano de Ação e validar resultado/escopo por área, nem teste garantindo que supervisor não consegue criar/editar via `canMutateSsmaActionPlan`). Teste unitário de helper não cobre a decisão de acesso que mora no controller. Adicione/atualize teste funcional do controller para os fluxos alterados."
→ file_find 'SsmaController' test files (procurar SsmaControllerTest existente)
→ code_search 'ssma_plano_acao' em tests/ — achar testes funcionais das rotas para sugerir onde encaixar.
Hmm, issue ordering: high, medium, low. Maybe there's a potential high: if methods removed while templates still call, runtime fatal — but uncertainty high, medium rather than high. If the review plan's first issue deserves "high", we could phrase that verification determines. Maybe mark as medium since no concrete break demonstrated.
Wait: user-specific rule: "Se a PR alterou comportamento e não trouxe teste novo/atualizado cobrindo esse comportamento, sinalize como pendência (Atenção; Crítico se o fluxo for autorização, dinheiro, exclusão ou estado)." Controller change touches permissions (autorização) — so it is Crítico if behavior changed without tests. Since controller external to review group but part of same PR. The review checklist (system-specific PHP review principles) says scope to changed code in review group, yet the user-specific rules mention controller. The OCR background from the PR explicitly describes `canMutateSsmaActionPlan` permission changes. This diff removes/replaces tests, so missing tests for authorization: severity high? For the test-only change, we can only note missing coverage as pendência. Sorting by severity, if I mark issue about missing functional tests for permission as high (crítico per user rule). Actually the instructions of the output: high may cause critical functional failure... We can still slot authorization coverage as high given user rule explicit. But is it fair if the controller file isn't in the review group? The analysis scope says only analyze newly added and modified code; ignore deleted. But reviewing test file: a new/reviewable file. The controller changed in same commit; we can use file_read_diff for context. The task also says: "Other files changed in this update (not in this review group)" — signals we can account for context but shouldn't deeply review SsmaController. But we might need it to determine risk for the test change. I will include it as tool, not main issue.
So maybe label issue #4 [high]? That seems overblown because we don't see actual controller diff content. But the user rules say for auth flow changes with no new test, it's "Crítico". In the review plan context, I can set pending severity 'alta' for "no functional test covering the new permission/filter behavior given the controller change in the same PR". However the review group's test file actually removed tests (net negative) — the PR is test delta overall: +28/-177, including -69 in test file. So yes: A PR that removes more tests than it adds while changing authorization in controller => flag.
Maybe make the first issue combine: permissões alteradas no controller + testes removidos → falta teste de endpoint que cubra essas mudanças; isso é um bloqueador (alto). And use tools to confirm controller changes and existing tests.
I'd likely output 4 issues, ordered:
1. [high] Falta de teste funcional para as mudanças de autorização/filtro no SsmaController combinada à redução de cobertura; specifically, this diff only has unit tests for enum — no endpoint tests for create/edit permission (supervisor vs gestor) nor normalize filter path; the enum normalize behavior itself has risk because controller now relies on it. Actually user rule wants a "Crítico" for auth, but the rules for severity: high = critical functional failure. Missing tests is not a runtime failure though. Let me use medium, not high, for missing coverage per se, and reserve high for actual runtime concern. But user-specific says "Crítico se o fluxo for autorização" — I should respect it. Yet the top instructions at the very top (system) define severity, and user-specific rule reinforces test additions — it says to flag as pending (Atenção; Crítico if flow is authorization). Since the permission behavior changes are on the other file (context), and the visible changes don't show any controller-line modifications, claiming the PR changed authorization is inferred from the OCR background: "ajustes de permissão (`canMutateSsmaActionPlan`)" and commit description. This is reasonably trustworthy context. So a "crítico/pendência" for no functional test in the diff is acceptable as high.
Then:
2. [medium] Removed mapping tests for `resolveRelatedEventType`, label fallback, e vínculos com evento/ocorrência — verify if these rules still exist in code; keep or justify.
3. [medium] normalize('')/null no filtro: controller must distinguish "sem filtro"; unit does not cover integration; potential hiding of all rows.
4. [medium/low] OUTRO/acentos cobertura.
5. [low] ...
Need to limit count to avoid over-flagging. Let's go with 4 issues, sorted with high first.
But we should double-check feasibility: Review plan only, no actual tool executions. Each `→` should be one tool + reason. The tool args must be structured but can be approximate paths with quotes.
Now craft the Summary in pt-BR too? The template line "Summary:" followed by description. Since instructions say output language pt-BR, summary in Portuguese.
Let me now write final answer ensuring no markdown headers/code fences, plain text and `Issues` section header.
Draft:
Summary: O diff reformula os testes unitários do ActionOrigemEnum para acompanhar a nova API de normalização de origem (aliases em inglês/português sem acento) e reduz a suíte aos três tipos base (Ocorrência, Inspeção, Abordagem), apagando os cenários que validavam label() com fallback, o mapeamento resolveRelatedEventType do SsmaAction e a relação com SsmaEvent/SsmaOccurrence. A PR também mexe no SsmaController (permissões canMutateSsmaActionPlan e filtro de origem), fora deste grupo de revisão.
Issues
1. [high] A PR altera permissões e o filtro de origem no SsmaController, mas este diff não traz nenhum teste funcional para esses fluxos — os únicos testes são unitários e de um helper do enum, então uma falha de autorização (supervisor conseguindo criar/editar, gestor bloqueado) ou um filtro montado errado a partir do parâmetro normalizado passaria despercebida. O histórico indicado na própria descrição mostra que esse padrão (testar só unidade) já deixou passar falha de autorização em endpoints de leitura. É preciso adicionar teste de integração das rotas do Plano de Ação cobrindo a permissão canMutateSsmaActionPlan e o filtro por origem/área antes de aprovar.
→ file_find teste SsmaController — localizar a suíte funcional existente do controller para indicar onde o novo teste deve entrar
→ file_read_diff src/Controller/SsmaController.php — confirmar no diff quais comportamentos (permissão/filtro) mudaram e precisam de cobertura
→ code_search 'ssma_plano_acao' em tests/ — ver as rotas já exercitadas em testes funcionais
Wait, since ordering should reflect probable severity: high first.
2. [medium] Removidos os testes de resolveRelatedEventType, do fallback de label() e dos vínculos com evento/ocorrência; se essas regras continuarem existindo no código (entity/templates) e apenas os testes sumirem, perde-se a proteção justamente no fluxo do “Ir para origem” e na exibição de rótulos da aba Ações — regressões futuras ou já introduzidas pelo diff do controller não serão detectadas. Verifique se os métodos ainda existem e têm chamadores; se existirem, mantenha testes equivalentes (idealmente passando pelo controller) ou justifique a remoção.
→ file_find ActionOrigemEnum — achar o arquivo do enum e ler a implementação atual de normalize/selectLabels/label
→ code_search 'resolveRelatedEventType' — confirmar se o método permanece na entidade SsmaAction e onde é usado (controller/templates)
→ code_search 'ActionOrigemEnum::label' — mapear chamadas remanescentes da API antiga que o novo contrato pode ter quebrado
3. [medium] O teste novo fixa que normalize('') devolve null, mas não cobre como o controller consome esse retorno no filtro de origem; se a opção “todas as origens” chegar como string vazia e o controller aplicar o valor normalizado na consulta sem distinguir “filtro ausente”, a listagem pode passar a filtrar por origem nula e esconder todas as ações com origem preenchida. É preciso conferir o tratamento do parâmetro vazio no controller e cobrir o caminho real do endpoint.
→ file_read_diff src/Controller/SsmaController.php — ver como o valor vazio/normalizado do filtro é tratado antes da query
→ code_search 'normalize(' — localizar todos os usos do normalize no código de produção para avaliar o contrato de retorno null
4. [low] A redução da suíte tirou a cobertura dos aliases acentuados (‘ocorrência’, ‘inspeção’) e do valor OUTRO/‘outro’; como selectLabels agora cobre apenas os três tipos base e normalize não é testado para OUTRO nem para acentos, dados antigos gravados com outro valor de origem podem não ser reconhecidos pelo filtro nem exibidos com rótulo correto na listagem. Confirme se OUTRO e acentos continuam suportados pelo enum; se continuam, adicione os casos de teste; se deixaram de ser suportados, é uma mudança de regra que precisa ser explícita (e alinhada com dados persistidos).
→ file_read src/Enum/Ssma/ActionOrigemEnum.php — conferir constantes (OUTRO), normalização de acentos e composição de selectLabels
→ code_search 'OUTRO' em src/ e templates — ver se o valor ainda é produzido/consumido fora do enum (formulários, colunas de origem, dados existentes)
Check: do these comply with description requirements (location, nature, impact)? Yes.
Tool arguments with quotes: fine. Example wording: `→ code_search "ActionOrigemEnum::label" file_patterns 'src/', ':(exclude)*Test.php'` etc. Not necessary to be perfect, but plausible.
Careful with format - "Issues" on its own line followed by numbered items; each item line begins with "1. [high] ...". The user format example listed issues as:
```
Issues
1. [high] (desc)
→ ...
```
Yes.
Also "Summary:" content in same line.
Potential problem: The user instructions "Always respond in Português (pt-BR)." fine.
Let me also make sure not to over-invent issues as per "Empty Result" rule, but we have relevant concerns.
Maybe also issue: The test `testSelectLabelsCoverBaseOriginTypes` uses assertArrayHasKey and then asserts labels; if production selectLabels adds OUTRO//'Evento SSMA' (from previous alias), test still passes. That is fine; not a bug. But an actual full-equality check would catch unintended UI changes. Put in low with OUTRO issue? Maybe merge.
Need to keep the line count reasonable. Each issue can have up to 3 → lines. OK.
Let me think again about severity mapping. The first "high" issue, since the controller isn't in this review group, the review plan may be judged as off-scope? But the user includes "Other changed files" and background info explicitly says controller changed perms; and the test rule says if behavior changed and no test, flag. I keep high but phrase carefully: "no teste no diff cobre" plus note controller is outside the group.
Alternatively assign high to issue of normalize('') potentially causing empty-list results? No, speculation.
Let's keep the high as test coverage on authorization flows.
Actually also system-specific rule: "Only analyze newly added and modified code; ignore deleted code." The deletion of old tests — this is part of the modified file and could remove coverage of behavior that's still present. That's a valid review point.
One more angle: a "high" issue could be that the test file previously referenced methods like `SsmaAction::resolveRelatedEventType` and entity classes. If those still exist and the removed tests had been the only guard for the integration, removal without code change hint — no. Keep medium.
Let me set:
1. [high] Cobertura de testes: fluxos de autorização alterados no controller sem teste funcional.
2. [medium] Regras de negócio/origem: remoção dos testes de resolveRelatedEventType/label/evento-ocorrência podem esconder regressão no fluxo “Ir para origem”/rótulos.
3. [medium] normalize('')/null no filtro — risco de filtrar por origem nula.
4. [low] OUTRO/acentos/cobertura selectLabels.
Fine.
Maybe to keep issues aligned to severity definitions: medium is for performance/maintainability/potential edge-case; high is for critical functional failure — missing coverage of permission is not functional failure per se. "User-specific rules" however say Crítico. There is potential conflict. Which to follow? User-specific rules: "Se a PR alterou comportamento e não trouxe teste novo/atualizado cobrindo esse comportamento, sinalize como pendência (Atenção; Crítico se o fluxo for autorização, dinheiro, exclusão ou estado)." So on a test-related finding about authorization, they explicitly instruct Crítico. I'll treat high as "Crítico" pending; that satisfies the rule.
Write final. Use no code fences. Ensure each issue line: "1. [high] texto".
Let me integrate everything nicely. Keep text concise but precise with location, nature, impact and "what to do".
Also summary needs mention purpose/scope in Portuguese.
Let's produce final.
Summary: O diff reformula os testes unitários do ActionOrigemEnum para a nova lógica de normalização de origem (aliases em português/inglês sem acento) e reduz a suíte aos três tipos base (Ocorrência, Inspeção, Abordagem), removendo os cenários que validavam o fallback de rótulos, o mapeamento de tipo de evento relacionado no SsmaAction e a relação com SsmaEvent/SsmaOccurrence. A mesma PR altera o SsmaController em permissões (canMutateSsmaActionPlan) e no filtro de origem, fora deste grupo de revisão.
Issues
1. [high] A PR muda permissões e filtro de origem no SsmaController, mas este diff não traz teste funcional cobrindo esses fluxos — os únicos testes são unitários e recaem sobre um helper do enum. Na prática, uma falha de autorização (supervisor conseguindo criar/editar, gestor bloqueado) ou um filtro montado errado a partir do parâmetro normalizado passaria despercebida no review e na esteira; o histórico descrito na própria PR indica que esse padrão de testar só a unidade já deixou passar falha de autorização em endpoints. É preciso adicionar teste de integração das rotas do Plano de Ação cobrindo a permissão canMutateSsmaActionPlan e o filtro por origem/área antes de aprovar.
→ file_find SsmaController — localizar a suíte funcional existente do controller para indicar onde o novo teste deve entrar
→ file_read_diff src/Controller/SsmaController.php — confirmar no diff exatamente quais comportamentos de permissão/filtro mudaram e precisam de cobertura
→ code_search 'ssma_plano_acao' em tests/ — ver quais rotas já são exercitadas por testes funcionais
2. [medium] Foram removidos os testes de resolveRelatedEventType, do fallback de label() e dos vínculos com evento/ocorrência. Se essas regras continuarem existindo no código de produção e tiverem chamadores ativos (fluxo "Ir para origem", rótulos da aba Ações), a remoção tira a proteção exatamente da regra que decide para onde o usuário é levado e qual origem aparece na tela — uma regressão já introduzida ou futura não será detectada. Verifique se os métodos ainda existem e são usados; se existirem, mantenha testes equivalentes (idealmente passando pelo controller) ou justifique a remoção.
→ file_find ActionOrigemEnum — localizar o arquivo do enum para ler a implementação atual de normalize/selectLabels/label
→ code_search 'resolveRelatedEventType' — confirmar se o método permanece na entidade SsmaAction e onde é usado (controller/templates)
→ code_search 'ActionOrigemEnum::label' — mapear chamadas remanescentes da API antiga que o novo contrato pode ter quebrado
3. [medium] O teste novo fixa que normalize('') devolve null, mas não cobre como o SsmaController consome esse retorno no filtro de origem. Se a opção "todas as origens" chegar como string vazia e o controller aplicar o valor normalizado na consulta sem distinguir "filtro ausente" de "origem desconhecida", a listagem pode passar a filtrar por origem nula e esconder todas as ações com origem preenchida. Confira o tratamento do parâmetro vazio no controller e cubra o caminho real do endpoint.
→ file_read_diff src/Controller/SsmaController.php — ver como o valor vazio/normalizado do filtro é tratado antes de montar a query
→ code_search 'normalize(' — localizar todos os usos de normalize no código de produção para avaliar o impacto do retorno null
4. [low] A redução da suíte eliminou a cobertura dos aliases acentuados ('ocorrência', 'inspeção') e do valor OUTRO/'outro'; o teste novo só cobre formas sem acento e os três tipos base. Se existirem registros persistidos com origem 'outro' ou valores acentuados, o filtro e a exibição de rótulos podem não reconhecê-los. Confirme se OUTRO e acentos continuam suportados pelo enum; se continuam, adicione os casos de teste; se deixaram de ser suportados, é uma mudança de regra que precisa ser explícita e alinhada com os dados existentes.
→ file_read src/Enum/Ssma/ActionOrigemEnum.php — conferir constantes (OUTRO), tratamento de acentos/aliases e composição de selectLabels
→ code_search 'OUTRO' em src/ e templates — verificar se o valor ainda é produzido/consumido fora do enum (formulários, colunas de origem, dados persistidos)
main_task
Request #1
deepseek-v4-flash
P:9.29K C:323 CR:2.69K CW:0
2581ms
Reasoning
Vamos analisar o diff dos testes unitários. A mudança reformula ActionOrigemEnumTest para testar o novo método normalize() do ActionOrigemEnum.
Preciso verificar:
1. Se os métodos removidos (resolveRelatedEventType, label) ainda existem em produção e são usados.
2. Se o enum ActionOrigemEnum::normalize existe e como funciona.
3. O que mudou no SsmaController (fora deste grupo, mas relevante para contexto).
4. Se os testes são coerentes.
Vou começar lendo os arquivos relevantes: o enum ActionOrigemEnum, o SsmaAction, o SsmaController, e buscar usos de normalize, label, resolveRelatedEventType, OUTRO.
Vamos fazer buscas paralelas.
Tool Calls (4)
file_find
Show Details
Arguments
{"query_name": "ActionOrigemEnum"}
Result
src/Enum/Ssma/ActionOrigemEnum.php tests/Unit/Product/Ssma/ActionOrigemEnumTest.php
code_search
Show Details
Arguments
{"search_text": "normalize("}
Result
Note: The results have been truncated. Only showing first 100 results.
File: .claude/agents/especialistas/symfony/serializer_specialist.md
Match lines: 8
35| $data = $serializer->normalize($product);
41| $product = $serializer->denormalize($data, Product::class);
243| public function normalize($object, string $format = null, array $context = []): array
284| public function normalize($object, string $format = null, array $context = []): array
290| $data = $this->normalizer->normalize($object, $format, $context);
337| public function denormalize($data, string $type, string $format = null, array $context = []): Product
722|public function normalize($object, string $format = null, array $context = []): array
731|public function normalize($object, string $format = null, array $context = []): array
File: agents/especialistas/symfony/serializer_specialist.md
Match lines: 8
35| $data = $serializer->normalize($product);
41| $product = $serializer->denormalize($data, Product::class);
243| public function normalize($object, string $format = null, array $context = []): array
284| public function normalize($object, string $format = null, array $context = []): array
290| $data = $this->normalizer->normalize($object, $format, $context);
337| public function denormalize($data, string $type, string $format = null, array $context = []): Product
722|public function normalize($object, string $format = null, array $context = []): array
731|public function normalize($object, string $format = null, array $context = []): array
File: public/AdminLTE/plugins/daterangepicker/example/amd/require.js
Match lines: 2
10|b),a=a.substring(b+1,a.length));return[n,a]}function q(a,n,b,h){var k,f,d=null,g=n?n.name:null,p=a,q=!0,m="";a||(q=!1,a="_@r"+(Q+=1));a=r(a);d=a[0];a=a[1];d&&(d=c(d,g,h),f=e(v,d));a&&(d?m=f&&f.normalize?f.normalize(a,function(a){return c(a,g,h)}):-1===a.indexOf("!")?c(a,g,h):a:(m=c(a,g,h),a=r(m),d=a[0],m=a[1],b=!0,k=l.nameToUrl(m)));b=!d||f||b?"":"_unnormalized"+(T+=1);return{prefix:d,name:m,parentMap:n,unnormalized:!!b,url:k,originalName:p,isDefine:q,id:(d?d+"!"+m:m)+b}}function u(a){var b=a.id,
19|this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var a=this.map,b=a.id,d=q(a.prefix);this.depMaps.push(d);w(d,"defined",z(this,function(h){var k,f,d=e(fa,this.map.id),M=this.map.name,r=this.map.parentMap?this.map.parentMap.name:null,m=l.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(h.normalize&&(M=h.normalize(M,function(a){return c(a,r,!0)})||
File: public/AdminLTE/plugins/jquery-ui/jquery-ui.js
Match lines: 1
6035| content = this._normalize( content );
File: public/AdminLTE/plugins/jquery-ui/jquery-ui.min.js
Match lines: 1
8|this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var g=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}})),void 0):void 0}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(g,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var m;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),m===n&&(m=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))
File: public/AdminLTE/plugins/select2/js/select2.full.js
Match lines: 7
77| function normalize(name, baseName) {
204| function makeNormalize(relName) {
206| return normalize(name, relName);
263| prefix = normalize(prefix, relResourceName);
270| name = plugin.normalize(name, makeNormalize(relResourceName));
272| name = normalize(name, relResourceName);
275| name = normalize(name, relResourceName);
File: public/AdminLTE/plugins/select2/js/select2.full.min.js
Match lines: 1
2|!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),--u;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;--u){if(i=n.slice(0,u).join("/"),h)for(d=h.length;0<d;--d)if(r=(r=f[h.slice(0,d).join("/")])&&r[i]){o=r,a=u;break}if(o)break;!l&&g&&g[i]&&(l=g[i],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function D(e){if(b(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!b(m,e)&&!b(_,e))throw new Error("No "+e);return m[e]}function u(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function S(e){return e?u(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},r=Object.prototype.hasOwnProperty,a=[].slice,w=/\.js$/,f=function(e,t){var n,i,r=u(e),o=r[0],s=t[1];return e=r[1],o&&(n=D(o=c(o,s))),o?e=n&&n.normalize?n.normalize(e,(i=s,function(e){return c(e,i)})):c(e,s):(o=(r=u(e=c(e,s)))[0],e=r[1],o&&(n=D(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,i){var r,o,s,a,l,c,u,d=[],p=typeof n;if(c=S(i=i||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)r=d[l]=g.module(e);else if(b(m,o)||b(v,o)||b(_,o))d[l]=D(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(i,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):void 0,e&&(r&&r.exports!==h&&r.exports!==m[e]?m[e]=r.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,i,r){if("string"==typeof e)return g[e]?g[e](t):D(f(e,S(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=i,i=r),i?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(m,e)||b(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=i),e.define("almond",function(){}),e.define("jquery",[],function(){var e=d||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var r={};function u(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&"constructor"!==i&&n.push(i)}return n}r.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},r.Decorate=function(i,r){var e=u(r),t=u(i);function o(){var e=Array.prototype.unshift,t=r.prototype.constructor.length,n=i.prototype.constructor;0<t&&(e.call(arguments,i.prototype.constructor),n=r.prototype.constructor),n.apply(this,arguments)}r.displayName=i.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=i.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=r.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},r.Observable=e,r.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},r.bind=function(e,t){return function(){e.apply(t,arguments)}},r._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},r.hasScroll=function(e,t){var n=o(t),i=t.style.overflowX,r=t.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},r.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(e){var i=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=h(this),t=f.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,i)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","aria-selected":"false"},i=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var r in(null!=e.element&&i.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]),n){var o=n[r];t.setAttribute(r,o)}if(e.children){var s=h(t),a=document.createElement("strong");a.className="select2-results__group";h(a);this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):r<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,i=0<e.deltaY&&t-e.deltaY<=0,r=e.deltaY<0&&n<=l.$results.height();i?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):r&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=h(this),n=f.GetData(this,"data");"true"!==t.attr("aria-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=f.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:h(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=this.selectionContainer(),o=this.display(i,r);r.append(o);var s=i.title||i.text;s&&r.attr("title",s),l.StoreData(r[0],"data",i),t.push(r)}var a=this.$selection.find(".select2-selection__rendered");l.appendMany(a,t)}},n}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(r,i,a){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var i=a.GetData(n[0],"data"),r=this.$element.val();this.$element.val(this.placeholder.id);var o={data:i};if(this.trigger("clear",o),o.prevented)this.$element.val(r);else{for(var s=0;s<i.length;s++)if(o={data:i[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(r);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=i.DELETE&&t.which!=i.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=this.options.get("translations").get("removeAllItems"),i=r('<span class="select2-selection__clear" title="'+n()+'">×</span>');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=a.GetData(t[0],"data");i.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2-search--inline",function(e){i.$search.val()&&e.stopPropagation()});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?i.$selection.off("input.search input.searchcheck"):i.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)i.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&i.handleSearch(e)}})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,r)){t=t||{};var n=s.Event("select2:"+e,{params:t});i.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var t=n(e);i._cache[e]=t}return new i(i._cache[e])},i}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),e.define("select2/data/base",["../utils"],function(i){function n(e,t){n.__super__.constructor.call(this)}return i.Extend(n,i.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n=e.id+"-result-";return n+=i.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+i.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var n=[],i=this;this.$element.find(":selected").each(function(){var e=l(this),t=i.item(e);n.push(t)}),e(n)},n.prototype.select=function(r){var o=this;if(r.selected=!0,l(r.element).is("option"))return r.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(r=[r]).push.apply(r,e);for(var n=0;n<r.length;n++){var i=r[n].id;-1===l.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("input").trigger("change")});else{var e=r.id;this.$element.val(e),this.$element.trigger("input").trigger("change")}},n.prototype.unselect=function(r){var o=this;if(this.$element.prop("multiple")){if(r.selected=!1,l(r.element).is("option"))return r.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n].id;i!==r.id&&-1===l.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(i,e){var r=[],o=this;this.$element.children().each(function(){var e=l(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(i,t);null!==n&&r.push(n)}}),e({results:r})},n.prototype.addOptions=function(e){a.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=l(t),i=this._normalizeItem(e);return i.element=t,a.StoreData(t,"data",i),n},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),i=[],r=0;r<n.length;r++){var o=l(n[r]),s=this.item(o);i.push(s)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return f.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),i=n.map(function(){return t.item(g(this)).id}).get(),r=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,i)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}r.push(p)}}return r},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var i=o.ajax(e);return i.then(t),i.fail(n),i}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,i){var r=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=r.processResults(e,n);r.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(t)},function(){"status"in e&&(0===e.status||"0"===e.status)||r.trigger("results:message",{message:"errorLoading"})});r._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var i=n.get("tags"),r=n.get("createTag");void 0!==r&&(this.createTag=r);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),u.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var i=t.results,r=0;r<i.length;r++){var o=i[r],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=i,void u(t))}if(n)return!0;var a=d.createTag(c);if(null!=a){var l=d.option(a);l.attr("data-select2-tag",!0),d.addOptions([l]),d.insertTag(i,a)}t.results=i,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var r=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function(e){var t,n=r._normalizeItem(e);if(!r.$element.find("option").filter(function(){return d(this).val()===n.id}).length){var i=r.option(n);i.attr("data-select2-tag",!0),r._removeOldTags(),r.addOptions([i])}t=n,r.trigger("select",{data:t})});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.trigger("focus")),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,i){for(var r=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,r)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(i(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0<i.maximumSelectionLength&&t>=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<r.top-s,u=l>r.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=o.GetData(i[0],"data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(c,u,d,p,h,f,g,m,v,y,s,t,_,w,$,b,A,x,D,S,C,E,O,T,q,j,L,I,e){function n(){this.reset()}return n.prototype.apply=function(e){if(null==(e=c.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=$:null!=e.data?e.dataAdapter=w:e.dataAdapter=_,0<e.minimumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,x)),0<e.maximumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,D)),0<e.maximumSelectionLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,S)),e.tags&&(e.dataAdapter=y.Decorate(e.dataAdapter,b)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=y.Decorate(e.dataAdapter,A)),null!=e.query){var t=u(e.amdBase+"compat/query");e.dataAdapter=y.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=u(e.amdBase+"compat/initSelection");e.dataAdapter=y.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=d,null!=e.ajax&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,T)),null!=e.placeholder&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,O)),e.selectOnClose&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,L))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=C;else{var i=y.Decorate(C,E);e.dropdownAdapter=i}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,j)),e.closeOnSelect&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,I)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var r=u(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=y.Decorate(e.dropdownAdapter,r)}e.dropdownAdapter=y.Decorate(e.dropdownAdapter,q)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=h:e.selectionAdapter=p,null!=e.placeholder&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,f)),e.allowClear&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,g)),e.multiple&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,m)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=u(e.amdBase+"compat/containerCss");e.selectionAdapter=y.Decorate(e.selectionAdapter,o)}e.selectionAdapter=y.Decorate(e.selectionAdapter,v)}e.language=this._resolveLanguage(e.language),e.language.push("en");for(var s=[],a=0;a<e.language.length;a++){var l=e.language[a];-1===s.indexOf(l)&&s.push(l)}return e.language=s,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:y.escapeMarkup,language:{},matcher:function e(t,n){if(""===c.trim(t.term))return n;if(n.children&&0<n.children.length){for(var i=c.extend(!0,{},n),r=n.children.length-1;0<=r;r--)null==e(t,n.children[r])&&i.children.splice(r,1);return 0<i.children.length?i:e(t,i)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,i=this.defaults.language,r=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(r),this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(o));return e.language=s,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(c.isEmptyObject(e))return[];if(c.isPlainObject(e))return[e];var t;t=c.isArray(e)?e:[e];for(var n=[],i=0;i<t.length;i++)if(n.push(t[i]),"string"==typeof t[i]&&0<t[i].indexOf("-")){var r=t[i].split("-")[0];n.push(r)}return n},n.prototype._processTranslations=function(e,t){for(var n=new s,i=0;i<e.length;i++){var r=new s,o=e[i];if("string"==typeof o)try{r=s.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,r=s.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else r=c.isPlainObject(o)?new s(o):o;n.extend(r)}return n},n.prototype.set=function(e,t){var n={};n[c.camelCase(e)]=t;var i=y._convertData(n);c.extend(!0,this.defaults,i)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(i,d,r,p){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=r.applyFromElement(this.options,t)),this.options=r.apply(this.options),t&&t.is("input")){var n=i(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=p.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),p.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),p.StoreData(e[0],"data",p.GetData(e[0],"select2Tags")),p.StoreData(e[0],"tags",!0)),p.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",p.GetData(e[0],"ajaxUrl")),p.StoreData(e[0],"ajax-Url",p.GetData(e[0],"ajaxUrl")));var n={};function i(e,t){return t.toUpperCase()}for(var r=0;r<e[0].attributes.length;r++){var o=e[0].attributes[r].name,s="data-";if(o.substr(0,s.length)==s){var a=o.substring(s.length),l=p.GetData(e[0],a);n[a.replace(/-([a-z])/g,i)]=l}}d.fn.jquery&&"1."==d.fn.jquery.substr(0,2)&&e[0].dataset&&(n=d.extend(!0,{},e[0].dataset,n));var c=d.extend(!0,{},p.GetData(e[0]),n);for(var u in c=p._convertData(c))-1<d.inArray(u,t)||(d.isPlainObject(this.options[u])?d.extend(this.options[u],c[u]):this.options[u]=c[u]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,c,u,i){var d=function(e,t){null!=u.GetData(e[0],"select2")&&u.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),d.__super__.constructor.call(this);var n=e.attr("tabindex")||0;u.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");var i=this.options.get("dataAdapter");this.dataAdapter=new i(e,this.options);var r=this.render();this._placeContainer(r);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),u.StoreData(e[0],"select2",this),e.data("select2",this)};return u.Extend(d,u.Observable),d.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+u.generateChars(2):u.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},d.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},d.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},d.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},d.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=u.bind(this._syncAttributes,this),this._syncS=u.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){t._syncA(),t._syncS(null,e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},d.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,i)&&n.trigger(e,t)})},d.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===i.ESC||t===i.TAB||t===i.UP&&e.altKey?(n.close(e),e.preventDefault()):t===i.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===i.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===i.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===i.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===i.ENTER||t===i.SPACE||t===i.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},d.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},d.prototype._isChangeMutation=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var r=0;r<t.addedNodes.length;r++){t.addedNodes[r].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length?n=!0:o.isArray(t)&&o.each(t,function(e,t){if(i._isChangeMutation(e,t))return!(n=!0)});else n=!0;return n}},d.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),i=this;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})},d.prototype.trigger=function(e,t){var n=d.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var r=i[e],o={prevented:!1,name:e,args:t};if(n.call(this,r,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},d.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},d.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},d.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")},d.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},d.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},d.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},d.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},d.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},d.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];o.isArray(t)&&(t=o.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("input").trigger("change")},d.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",u.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),u.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},d.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,n)}return e.prototype.current=function(e,t){function i(e,t){var n=[];return e.selected||-1!==s.inArray(e.id,t)?(e.selected=!0,n.push(e)):e.selected=!1,e.children&&n.push.apply(n,i(e.children,t)),n}for(var n=[],r=0;r<this._currentData.length;r++){var o=this._currentData[r];n.push.apply(n,i(o,this.$element.val().split(this._valueSeparator)))}t(n)},e.prototype.select=function(e,t){if(this.options.get("multiple")){var n=this.$element.val();n+=this._valueSeparator+t.id,this.$element.val(n),this.$element.trigger("input").trigger("change")}else this.current(function(e){s.map(e,function(e){e.selected=!1})}),this.$element.val(t.id),this.$element.trigger("input").trigger("change")},e.prototype.unselect=function(e,r){var o=this;r.selected=!1,this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];r.id!=i.id&&t.push(i.id)}o.$element.val(t.join(o._valueSeparator)),o.$element.trigger("input").trigger("change")})},e.prototype.query=function(e,t,n){for(var i=[],r=0;r<this._currentData.length;r++){var o=this._currentData[r],s=this.matches(t,o);null!==s&&i.push(s)}n({results:i})},e.prototype.addOptions=function(e,t){var n=s.map(t,function(e){return i.GetData(e[0],"data")});this._currentData.push.apply(this._currentData,n)},e}),e.define("select2/compat/matcher",["jquery"],function(s){return function(o){return function(e,t){var n=s.extend(!0,{},t);if(null==e.term||""===s.trim(e.term))return n;if(t.children){for(var i=t.children.length-1;0<=i;i--){var r=t.children[i];o(e.term,r.text,r)||n.children.splice(i,1)}if(0<n.children.length)return n}return o(e.term,t.text,t)?n:null}}}),e.define("select2/compat/query",[],function(){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n,this.options.get("query").call(null,t)},e}),e.define("select2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){n.find(".dropdown-wrapper").append(t),t.addClass("select2-dropdown--below"),n.addClass("select2-container--below")},e}),e.define("select2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),e.define("select2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),l=function(p){var h,f,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(p.event.fixHooks)for(var n=e.length;n;)p.event.fixHooks[e[--n]]=p.event.mouseHooks;var m=p.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],i,!1);else this.onmousewheel=i;p.data(this,"mousewheel-line-height",m.getLineHeight(this)),p.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],i,!1);else this.onmousewheel=null;p.removeData(this,"mousewheel-line-height"),p.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=p(e),n=t["offsetParent"in p.fn?"offsetParent":"parent"]();return n.length||(n=p("body")),parseInt(n.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return p(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function i(e){var t,n=e||window.event,i=g.call(arguments,1),r=0,o=0,s=0,a=0,l=0;if((e=p.event.fix(n)).type="mousewheel","detail"in n&&(s=-1*n.detail),"wheelDelta"in n&&(s=n.wheelDelta),"wheelDeltaY"in n&&(s=n.wheelDeltaY),"wheelDeltaX"in n&&(o=-1*n.wheelDeltaX),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(o=-1*s,s=0),r=0===s?o:s,"deltaY"in n&&(r=s=-1*n.deltaY),"deltaX"in n&&(o=n.deltaX,0===s&&(r=-1*o)),0!==s||0!==o){if(1===n.deltaMode){var c=p.data(this,"mousewheel-line-height");r*=c,s*=c,o*=c}else if(2===n.deltaMode){var u=p.data(this,"mousewheel-page-height");r*=u,s*=u,o*=u}if(t=Math.max(Math.abs(s),Math.abs(o)),(!f||t<f)&&y(n,f=t)&&(f/=40),y(n,t)&&(r/=40,o/=40,s/=40),r=Math[1<=r?"floor":"ceil"](r/f),o=Math[1<=o?"floor":"ceil"](o/f),s=Math[1<=s?"floor":"ceil"](s/f),m.settings.normalizeOffset&&this.getBoundingClientRect){var d=this.getBoundingClientRect();a=e.clientX-d.left,l=e.clientY-d.top}return e.deltaX=o,e.deltaY=s,e.deltaFactor=f,e.offsetX=a,e.offsetY=l,e.deltaMode=0,i.unshift(e,r,o,s),h&&clearTimeout(h),h=setTimeout(v,200),(p.event.dispatch||p.event.handle).apply(this,i)}}function v(){f=null}function y(e,t){return m.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}p.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof e.define&&e.define.amd?e.define("jquery-mousewheel",["jquery"],l):"object"==typeof exports?module.exports=l:l(d),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(r,e,o,t,s){if(null==r.fn.select2){var a=["open","close","destroy"];r.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=r.extend(!0,{},t);new o(r(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1<r.inArray(t,a)?this:n}}return null==r.fn.select2.defaults&&(r.fn.select2.defaults=t),o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return d.fn.select2.amd=e,t});
File: public/AdminLTE/plugins/select2/js/select2.js
Match lines: 7
77| function normalize(name, baseName) {
204| function makeNormalize(relName) {
206| return normalize(name, relName);
263| prefix = normalize(prefix, relResourceName);
270| name = plugin.normalize(name, makeNormalize(relResourceName));
272| name = normalize(name, relResourceName);
275| name = normalize(name, relResourceName);
File: public/AdminLTE/plugins/select2/js/select2.min.js
Match lines: 1
2|!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),--u;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;--u){if(r=n.slice(0,u).join("/"),h)for(d=h.length;0<d;--d)if(i=(i=f[h.slice(0,d).join("/")])&&i[r]){o=i,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function D(e){if(w(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!w(m,e)&&!w(_,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function S(e){return e?c(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},i=Object.prototype.hasOwnProperty,a=[].slice,b=/\.js$/,f=function(e,t){var n,r,i=c(e),o=i[0],s=t[1];return e=i[1],o&&(n=D(o=l(o,s))),o?e=n&&n.normalize?n.normalize(e,(r=s,function(e){return l(e,r)})):l(e,s):(o=(i=c(e=l(e,s)))[0],e=i[1],o&&(n=D(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,r){var i,o,s,a,l,c,u,d=[],p=typeof n;if(c=S(r=r||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)i=d[l]=g.module(e);else if(w(m,o)||w(v,o)||w(_,o))d[l]=D(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(r,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):void 0,e&&(i&&i.exports!==h&&i.exports!==m[e]?m[e]=i.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,r,i){if("string"==typeof e)return g[e]?g[e](t):D(f(e,S(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=r,r=i),r?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),w(m,e)||w(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=r),e.define("almond",function(){}),e.define("jquery",[],function(){var e=u||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var i={};function u(e){var t=e.prototype,n=[];for(var r in t){"function"==typeof t[r]&&"constructor"!==r&&n.push(r)}return n}i.Extend=function(e,t){var n={}.hasOwnProperty;function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i.Decorate=function(r,i){var e=u(i),t=u(r);function o(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=r.prototype.constructor;0<t&&(e.call(arguments,r.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=r.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=r.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].apply(this,t)},i.Observable=e,i.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},i.bind=function(e,t){return function(){e.apply(t,arguments)}},i._convertData=function(e){for(var t in e){var n=t.split("-"),r=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];(o=o.substring(0,1).toLowerCase()+o.substring(1))in r||(r[o]={}),i==n.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},i.hasScroll=function(e,t){var n=o(t),r=t.style.overflowX,i=t.style.overflowY;return(r!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===r||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},i.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var r=e.results[n],i=this.option(r);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},r.prototype.position=function(e,t){t.find(".select2-results").append(e)},r.prototype.sort=function(e){return this.options.get("sorter")(e)},r.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},r.prototype.setClasses=function(){var t=this;this.data.current(function(e){var r=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=h(this),t=f.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,r)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},r.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},r.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},r.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","aria-selected":"false"},r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var i in(null!=e.element&&r.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]),n){var o=n[i];t.setAttribute(i,o)}if(e.children){var s=h(t),a=document.createElement("strong");a.className="select2-results__group";h(a);this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):i<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,r=0<e.deltaY&&t-e.deltaY<=0,i=e.deltaY<0&&n<=l.$results.height();r?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):i&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=h(this),n=f.GetData(this,"data");"true"!==t.attr("aria-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=f.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:h(this)})})},r.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},r.prototype.destroy=function(){this.$results.remove()},r.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,r=e.offset().top,i=this.$results.scrollTop()+(r-n),o=r-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=this.selectionContainer(),o=this.display(r,i);i.append(o);var s=r.title||r.text;s&&i.attr("title",s),l.StoreData(i[0],"data",r),t.push(i)}var a=this.$selection.find(".select2-selection__rendered");l.appendMany(a,t)}},n}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(r)},t}),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,r,a){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var r=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var o={data:r};if(this.trigger("clear",o),o.prevented)this.$element.val(i);else{for(var s=0;s<r.length;s++)if(o={data:r[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=r.DELETE&&t.which!=r.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=this.options.get("translations").get("removeAllItems"),r=i('<span class="select2-selection__clear" title="'+n()+'">×</span>');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=a.GetData(t[0],"data");r.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2-search--inline",function(e){r.$search.val()&&e.stopPropagation()});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&r.handleSearch(e)}})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var r=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,i)){t=t||{};var n=s.Event("select2:"+e,{params:t});r.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function r(e){this.dict=e||{}}return r.prototype.all=function(){return this.dict},r.prototype.get=function(e){return this.dict[e]},r.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},r._cache={},r.loadPath=function(e){if(!(e in r._cache)){var t=n(e);r._cache[e]=t}return new r(r._cache[e])},r}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),e.define("select2/data/base",["../utils"],function(r){function n(e,t){n.__super__.constructor.call(this)}return r.Extend(n,r.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n=e.id+"-result-";return n+=r.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+r.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var n=[],r=this;this.$element.find(":selected").each(function(){var e=l(this),t=r.item(e);n.push(t)}),e(n)},n.prototype.select=function(i){var o=this;if(i.selected=!0,l(i.element).is("option"))return i.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var r=i[n].id;-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")});else{var e=i.id;this.$element.val(e),this.$element.trigger("input").trigger("change")}},n.prototype.unselect=function(i){var o=this;if(this.$element.prop("multiple")){if(i.selected=!1,l(i.element).is("option"))return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n].id;r!==i.id&&-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(r,e){var i=[],o=this;this.$element.children().each(function(){var e=l(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(r,t);null!==n&&i.push(n)}}),e({results:i})},n.prototype.addOptions=function(e){a.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=l(t),r=this._normalizeItem(e);return r.element=t,a.StoreData(t,"data",r),n},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),r=[],i=0;i<n.length;i++){var o=l(n[i]),s=this.item(o);r.push(s)}t.children=r}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function r(e,t){this._dataToConvert=t.get("data")||[],r.__super__.constructor.call(this,e,t)}return f.Extend(r,e),r.prototype.bind=function(e,t){r.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},r.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),r.__super__.select.call(this,n)},r.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),r=n.map(function(){return t.item(g(this)).id}).get(),i=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,r)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}i.push(p)}}return i},r}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var r=o.ajax(e);return r.then(t),r.fail(n),r}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,r){var i=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=i.processResults(e,n);i.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),r(t)},function(){"status"in e&&(0===e.status||"0"===e.status)||i.trigger("results:message",{message:"errorLoading"})});i._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var r=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),u.isArray(r))for(var s=0;s<r.length;s++){var a=r[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var r=t.results,i=0;i<r.length;i++){var o=r[i],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=r,void u(t))}if(n)return!0;var a=d.createTag(c);if(null!=a){var l=d.option(a);l.attr("data-select2-tag",!0),d.addOptions([l]),d.insertTag(r,a)}t.results=r,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var i=this;t.term=t.term||"";var r=this.tokenizer(t,this.options,function(e){var t,n=i._normalizeItem(e);if(!i.$element.find("option").filter(function(){return d(this).val()===n.id}).length){var r=i.option(n);r.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([r])}t=n,i.trigger("select",{data:t})});r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),t.term=r.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,r){for(var i=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,i)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(r(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0<r.maximumSelectionLength&&t>=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-s,u=l>i.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r<t.length;r++){var i=t[r];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("close",function(e){r._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var i=o.GetData(r[0],"data");null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(c,u,d,p,h,f,g,m,v,y,s,t,_,$,b,w,A,x,D,S,E,C,O,T,q,L,I,j,e){function n(){this.reset()}return n.prototype.apply=function(e){if(null==(e=c.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=b:null!=e.data?e.dataAdapter=$:e.dataAdapter=_,0<e.minimumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,x)),0<e.maximumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,D)),0<e.maximumSelectionLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,S)),e.tags&&(e.dataAdapter=y.Decorate(e.dataAdapter,w)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=y.Decorate(e.dataAdapter,A)),null!=e.query){var t=u(e.amdBase+"compat/query");e.dataAdapter=y.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=u(e.amdBase+"compat/initSelection");e.dataAdapter=y.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=d,null!=e.ajax&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,T)),null!=e.placeholder&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,O)),e.selectOnClose&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=E;else{var r=y.Decorate(E,C);e.dropdownAdapter=r}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,L)),e.closeOnSelect&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,j)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var i=u(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=y.Decorate(e.dropdownAdapter,i)}e.dropdownAdapter=y.Decorate(e.dropdownAdapter,q)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=h:e.selectionAdapter=p,null!=e.placeholder&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,f)),e.allowClear&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,g)),e.multiple&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,m)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=u(e.amdBase+"compat/containerCss");e.selectionAdapter=y.Decorate(e.selectionAdapter,o)}e.selectionAdapter=y.Decorate(e.selectionAdapter,v)}e.language=this._resolveLanguage(e.language),e.language.push("en");for(var s=[],a=0;a<e.language.length;a++){var l=e.language[a];-1===s.indexOf(l)&&s.push(l)}return e.language=s,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:y.escapeMarkup,language:{},matcher:function e(t,n){if(""===c.trim(t.term))return n;if(n.children&&0<n.children.length){for(var r=c.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&r.children.splice(i,1);return 0<r.children.length?r:e(t,r)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,r=this.defaults.language,i=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(r),this._resolveLanguage(o));return e.language=s,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(c.isEmptyObject(e))return[];if(c.isPlainObject(e))return[e];var t;t=c.isArray(e)?e:[e];for(var n=[],r=0;r<t.length;r++)if(n.push(t[r]),"string"==typeof t[r]&&0<t[r].indexOf("-")){var i=t[r].split("-")[0];n.push(i)}return n},n.prototype._processTranslations=function(e,t){for(var n=new s,r=0;r<e.length;r++){var i=new s,o=e[r];if("string"==typeof o)try{i=s.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,i=s.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else i=c.isPlainObject(o)?new s(o):o;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[c.camelCase(e)]=t;var r=y._convertData(n);c.extend(!0,this.defaults,r)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(r,d,i,p){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=i.applyFromElement(this.options,t)),this.options=i.apply(this.options),t&&t.is("input")){var n=r(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=p.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),p.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),p.StoreData(e[0],"data",p.GetData(e[0],"select2Tags")),p.StoreData(e[0],"tags",!0)),p.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",p.GetData(e[0],"ajaxUrl")),p.StoreData(e[0],"ajax-Url",p.GetData(e[0],"ajaxUrl")));var n={};function r(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var o=e[0].attributes[i].name,s="data-";if(o.substr(0,s.length)==s){var a=o.substring(s.length),l=p.GetData(e[0],a);n[a.replace(/-([a-z])/g,r)]=l}}d.fn.jquery&&"1."==d.fn.jquery.substr(0,2)&&e[0].dataset&&(n=d.extend(!0,{},e[0].dataset,n));var c=d.extend(!0,{},p.GetData(e[0]),n);for(var u in c=p._convertData(c))-1<d.inArray(u,t)||(d.isPlainObject(this.options[u])?d.extend(this.options[u],c[u]):this.options[u]=c[u]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,c,u,r){var d=function(e,t){null!=u.GetData(e[0],"select2")&&u.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),d.__super__.constructor.call(this);var n=e.attr("tabindex")||0;u.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var i=this.render();this._placeContainer(i);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,i);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,i);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),u.StoreData(e[0],"select2",this),e.data("select2",this)};return u.Extend(d,u.Observable),d.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+u.generateChars(2):u.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},d.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},d.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},d.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},d.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=u.bind(this._syncAttributes,this),this._syncS=u.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){t._syncA(),t._syncS(null,e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},d.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerSelectionEvents=function(){var n=this,r=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,r)&&n.trigger(e,t)})},d.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===r.ESC||t===r.TAB||t===r.UP&&e.altKey?(n.close(e),e.preventDefault()):t===r.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===r.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===r.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===r.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===r.ENTER||t===r.SPACE||t===r.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},d.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},d.prototype._isChangeMutation=function(e,t){var n=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var i=0;i<t.addedNodes.length;i++){t.addedNodes[i].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length?n=!0:o.isArray(t)&&o.each(t,function(e,t){if(r._isChangeMutation(e,t))return!(n=!0)});else n=!0;return n}},d.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),r=this;n&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})},d.prototype.trigger=function(e,t){var n=d.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in r){var i=r[e],o={prevented:!1,name:e,args:t};if(n.call(this,i,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},d.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},d.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},d.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")},d.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},d.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},d.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},d.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},d.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},d.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];o.isArray(t)&&(t=o.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("input").trigger("change")},d.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",u.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),u.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},d.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1<i.inArray(t,a)?this:n}}return null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return u.fn.select2.amd=e,t});
File: public/AdminLTE/plugins/summernote/summernote-bs4.js
Match lines: 8
2727| value: function normalize() {
2955| return new WrappedRange(point.node, point.offset, point.node, point.offset).normalize();
3013| var rng = this.normalize();
3044| return this.normalize();
4371| range.create(nextPara, 0).normalize().select().scrollIntoView(editable);
5266| _this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());
5712| rng = rng.normalize();
6173| this.$editable[0].normalize();
File: public/AdminLTE/plugins/summernote/summernote-bs4.js.map
Match lines: 1
1|{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///external {\"root\":\"jQuery\",\"commonjs2\":\"jquery\",\"commonjs\":\"jquery\",\"amd\":\"jquery\"}","webpack:///./src/js/base/renderer.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./src/js/base/summernote-en-US.js","webpack:///./src/js/base/core/env.js","webpack:///./src/js/base/core/func.js","webpack:///./src/js/base/core/lists.js","webpack:///./src/js/base/core/dom.js","webpack:///./src/js/base/Context.js","webpack:///./src/js/summernote.js","webpack:///./src/js/base/core/range.js","webpack:///./src/js/base/core/key.js","webpack:///./src/js/base/core/async.js","webpack:///./src/js/base/editing/History.js","webpack:///./src/js/base/editing/Style.js","webpack:///./src/js/base/editing/Bullet.js","webpack:///./src/js/base/editing/Typing.js","webpack:///./src/js/base/editing/Table.js","webpack:///./src/js/base/module/Editor.js","webpack:///./src/js/base/module/Clipboard.js","webpack:///./src/js/base/module/Dropzone.js","webpack:///./src/js/base/module/Codeview.js","webpack:///./src/js/base/module/Statusbar.js","webpack:///./src/js/base/module/Fullscreen.js","webpack:///./src/js/base/module/Handle.js","webpack:///./src/js/base/module/AutoLink.js","webpack:///./src/js/base/module/AutoSync.js","webpack:///./src/js/base/module/AutoReplace.js","webpack:///./src/js/base/module/Placeholder.js","webpack:///./src/js/base/module/Buttons.js","webpack:///./src/js/base/module/Toolbar.js","webpack:///./src/js/base/module/LinkDialog.js","webpack:///./src/js/base/module/LinkPopover.js","webpack:///./src/js/base/module/ImageDialog.js","webpack:///./src/js/base/module/ImagePopover.js","webpack:///./src/js/base/module/TablePopover.js","webpack:///./src/js/base/module/VideoDialog.js","webpack:///./src/js/base/module/HelpDialog.js","webpack:///./src/js/base/module/AirPopover.js","webpack:///./src/js/base/module/HintPopover.js","webpack:///./src/js/base/settings.js","webpack:///./src/styles/summernote-bs4.scss","webpack:///./src/js/bs4/ui.js","webpack:///./src/js/bs4/settings.js"],"names":["Renderer","markup","children","options","callback","$parent","$node","$","contents","html","className","addClass","data","each","k","v","attr","click","on","$container","find","forEach","child","render","length","append","create","arguments","Array","isArray","summernote","lang","extend","font","bold","italic","underline","clear","height","name","strikethrough","subscript","superscript","size","sizeunit","image","insert","resizeFull","resizeHalf","resizeQuarter","resizeNone","floatLeft","floatRight","floatNone","shapeRounded","shapeCircle","shapeThumbnail","shapeNone","dragImageHere","dropImage","selectFromFiles","maximumFileSize","maximumFileSizeError","url","remove","original","video","videoLink","providers","link","unlink","edit","textToDisplay","openInNewWindow","useProtocol","table","addRowAbove","addRowBelow","addColLeft","addColRight","delRow","delCol","delTable","hr","style","p","blockquote","pre","h1","h2","h3","h4","h5","h6","lists","unordered","ordered","help","fullscreen","codeview","paragraph","outdent","indent","left","center","right","justify","color","recent","more","background","foreground","transparent","setTransparent","reset","resetToDefault","cpSelect","shortcut","shortcuts","close","textFormatting","action","paragraphFormatting","documentStyle","extraKeys","history","undo","redo","specialChar","select","output","noSelection","isSupportAmd","define","genericFontFamilies","validFontName","fontName","inArray","toLowerCase","isFontInstalled","testFontName","testText","testSize","canvas","document","createElement","context","getContext","originalWidth","measureText","width","userAgent","navigator","isMSIE","test","browserVersion","matches","exec","parseFloat","isEdge","hasCodeMirror","window","CodeMirror","isSupportTouch","MaxTouchPoints","msMaxTouchPoints","inputEventName","isMac","appVersion","indexOf","isFF","isPhantom","isWebkit","isChrome","isSafari","jqueryVersion","fn","jquery","isW3CRangeSupport","createRange","eq","itemA","itemB","eq2","peq2","propName","ok","fail","not","f","apply","and","fA","fB","item","self","a","invoke","obj","method","idCounter","resetUniqueId","uniqueId","prefix","id","rect2bnd","rect","$document","top","scrollTop","scrollLeft","bottom","invertObject","inverted","key","Object","prototype","hasOwnProperty","call","namespaceToCamel","namespace","split","map","substring","toUpperCase","join","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","setTimeout","isValidUrl","expression","head","array","last","initial","slice","tail","pred","idx","len","all","contains","sum","reduce","memo","from","collection","result","isEmpty","clusterBy","aTail","aLast","compact","aResult","push","unique","results","next","prev","NBSP_CHAR","String","fromCharCode","ZERO_WIDTH_NBSP_CHAR","isEditable","node","hasClass","isControlSizing","makePredByNodeName","nodeName","isText","nodeType","isElement","isVoid","isPara","isHeading","isPre","isLi","isPurePara","isTable","isData","isInline","isBodyContainer","isList","isHr","isBlockquote","isCell","isAnchor","isParaInline","ancestor","isBodyInline","isBody","isClosestSibling","nodeA","nodeB","nextSibling","previousSibling","withClosestSiblings","siblings","blankHTML","env","nodeLength","nodeValue","childNodes","deepestChildIsEmpty","firstElementChild","innerHTML","paddingBlankHTML","parentNode","singleChildAncestor","listAncestor","ancestors","el","lastAncestor","filter","commonAncestor","n","listPrev","nodes","listNext","listDescendant","descendants","fnWalk","current","wrap","wrapperName","parent","wrapper","insertBefore","appendChild","insertAfter","preceding","appendChildNodes","aChild","isLeftEdgePoint","point","offset","isRightEdgePoint","isEdgePoint","isLeftEdgeOf","position","isRightEdgeOf","isLeftEdgePointOf","isRightEdgePointOf","hasChildren","prevPoint","isSkipInnerOffset","nextPoint","isSamePoint","pointA","pointB","isVisiblePoint","leftNode","rightNode","prevPointUntil","nextPointUntil","isCharPoint","ch","charAt","isSpacePoint","walkPoint","startPoint","endPoint","handler","isSkipOffset","makeOffsetPath","reverse","fromOffsetPath","offsets","i","splitNode","isSkipPaddingBlankHTML","isNotSplitEdgePoint","isDiscardEmptySplits","splitText","childNode","clone","cloneNode","splitTree","root","splitPoint","topAncestor","splitRoot","container","pivot","createText","text","createTextNode","isRemoveChild","removeNode","removeChild","removeWhile","replace","newNode","cssText","isTextarea","value","stripLinebreaks","val","isNewlineOnBlock","regexTag","match","endSlash","isEndOfInlineContainer","isBlockNode","trim","posFromPlaceholder","placeholder","$placeholder","pos","outerHeight","attachEvents","events","keys","detachEvents","off","isCustomStyleTag","classList","blank","emptyPara","isBlock","isDiv","isBR","isSpan","isB","isU","isS","isI","isImg","isEmptyAnchor","Context","$note","memos","modules","layoutInfo","ui","ui_template","initialize","createLayout","_initialize","hide","_destroy","removeData","removeLayout","disabled","isDisabled","code","dom","disable","now","editor","buttons","plugins","module","initializeModule","removeModule","removeMemo","triggerEvent","isActivated","undefined","codable","editable","editing","callbacks","trigger","shouldInitialize","ModuleClass","withoutIntialize","destroy","event","createInvokeHandler","preventDefault","$target","target","closest","splits","hasSeparator","moduleName","methodName","type","isExternalAPICalled","hasInitOptions","langInfo","icons","tooltip","note","first","focus","textRangeToPoint","textRange","isStart","parentElement","tester","body","createTextRange","prevContainer","moveToElementText","compareEndPoints","textRangeStart","curTextNode","collapse","firstChild","pointTester","duplicate","setEndPoint","textCount","dummy","cont","pointToTextRange","textRangeInfo","isCollapseToStart","prevTextNodes","collapseToStart","info","moveStart","WrappedRange","sc","so","ec","eo","isOnEditable","makeIsOn","isOnList","isOnAnchor","isOnCell","isOnData","w3cRange","setStart","setEnd","Math","min","nativeRng","nativeRange","selection","getSelection","rangeCount","removeAllRanges","addRange","offsetTop","abs","getVisiblePoint","isLeftToRight","block","hasRightNode","hasLeftNode","getEndPoint","isCollapsed","getStartPoint","includeAncestor","fullyContains","leftEdgeNodes","startAncestor","endAncestor","boundaryPoints","getPoints","isSameContainer","rng","emptyParents","normalize","inlineSiblings","concat","para","wrapBodyInlineWithPara","deleteContents","contentsContainer","insertNode","toString","findAfter","isNotTextPoint","regex","index","s","path","e","paras","getClientRects","wrappedRange","createFromSelection","bodyElement","lastChild","createFromBodyElement","createFromNode","anchorNode","getRangeAt","startContainer","startOffset","endContainer","endOffset","textRangeEnd","isTextNode","createFromNodeBefore","createFromNodeAfter","createFromBookmark","bookmark","createFromParaBookmark","KEY_MAP","isEdit","keyCode","BACKSPACE","TAB","ENTER","SPACE","DELETE","isMove","LEFT","UP","RIGHT","DOWN","isNavigation","HOME","END","PAGEUP","PAGEDOWN","nameFromCode","readFileAsDataURL","file","Deferred","deferred","FileReader","onload","dataURL","resolve","onerror","err","reject","readAsDataURL","promise","createImage","$img","one","detach","css","display","appendTo","History","stack","stackOffset","$editable","range","emptyBookmark","snapshot","recordUndo","applySnapshot","makeSnapshot","historyLimit","shift","Style","$obj","propertyNames","propertyName","properties","styleInfo","jQueryCSS","fontSize","parseInt","expandClosestSibling","onlyPartialContains","nodesInRange","tails","elem","$cont","fromNode","queryCommandState","queryCommandValue","orderedTypes","isUnordered","lineHeight","toFixed","anchor","Bullet","toggleList","clustereds","previousList","findList","wrapList","appendToPrevious","releaseList","listName","paraBookmark","wrappedParas","diffLists","listNode","prevList","nextList","isEscapseToBody","releasedParas","headList","parentItem","newList","findNextSiblings","lastList","middleList","rootLists","rootList","listNodes","Typing","bullet","tabsize","tab","nextPara","blockquoteBreakingLevel","emptyAnchors","scrollIntoView","TableResultAction","where","domTable","_startPoint","_virtualTable","_actionCellList","setStartPoint","tagName","colPos","cellIndex","rowPos","rowIndex","setVirtualTablePosition","baseRow","baseCell","isRowSpan","isColSpan","isVirtualCell","objPosition","getActionCell","virtualTableCellObj","resultAction","virtualRowPosition","virtualColPosition","recoverCellIndex","newCellIndex","addCellInfoToVirtual","row","cell","cellHasColspan","colSpan","cellHasRowspan","rowSpan","isThisSelectedCell","rowspanNumber","attributes","rp","rowspanIndex","adjustStartPoint","colspanNumber","cp","cellspanIndex","isSelectedCell","createVirtualTable","rows","cells","getDeleteResultActionToCell","Column","SubtractSpanCount","Row","isVirtual","AddCell","RemoveCell","getAddResultActionToCell","SumSpanCount","Ignore","init","getActionList","fixedRow","fixedCol","actualPosition","canContinue","rowPosition","colPosition","requestAction","Add","Delete","Table","isShift","nextCell","currentTr","trAttributes","recoverAttributes","vTable","actions","idCell","currentCell","tdAttributes","baseCellTr","isTopFromRowSpan","newTd","removeAttr","setAttribute","before","lastTrIndex","after","rowsGroup","actionIndex","resultStr","attrList","specified","cellPos","virtualPosition","virtualTable","hasRowspan","nextRow","cloneRow","removeAttribute","hasColspan","colCount","rowCount","tds","tdHTML","idxCol","trs","trHTML","idxRow","$table","tableClassName","KEY_BOGUS","Editor","$editor","lastRange","typing","untab","insertParagraph","insertOrderedList","insertUnorderedList","formatPara","insertHorizontalRule","commands","sCmd","beforeCommand","execCommand","afterCommand","wrapCommand","fontStyling","unit","currentStyle","fontSizeUnit","formatBlock","isLimited","getLastRange","setLastRange","insertText","textNode","pasteHTML","onApplyCustomStyle","onFormatBlock","hrNode","stylePara","createLink","linkInfo","linkUrl","linkText","isNewWindow","checkProtocol","additionalTextLength","isTextChanged","onCreateLink","defaultProtocol","anchors","styleNodes","startRange","endRange","colorInfo","foreColor","backColor","insertTable","dim","dimension","createTable","removeMedia","restoreTarget","floatMe","toggleClass","resize","hasKeyShortCut","isDefaultPrevented","handleKeyMap","preventDefaultEditableShortCuts","recordEveryKeystroke","spellCheck","disableGrammar","airMode","overrideContextMenu","outerWidth","maxHeight","minHeight","keyMap","metaKey","ctrlKey","altKey","shiftKey","keyName","eventName","tabDisable","pad","maxTextLength","thenCollapse","commit","styleWithCSS","isPreventTrigger","normalizeContent","tabSize","insertTab","src","param","then","$image","show","files","filename","maximumImageFileSize","insertImage","onImageUpload","insertImagesAsDataURL","currentRange","spans","firstSpan","noteStatusOutput","expand","$anchor","addRow","addCol","deleteRow","deleteCol","deleteTable","bKeepRatio","imageSize","newRatio","y","x","ratio","is","hasFocus","Clipboard","pasteByEvent","bind","clipboardData","originalEvent","items","kind","getAsFile","getData","Dropzone","$eventListener","documentEventHandlers","$dropzone","prependTo","disableDragAndDrop","onDrop","attachDragAndDropEvent","$dropzoneMessage","onDragenter","isCodeview","hasEditorSize","add","onDragleave","removeClass","dataTransfer","types","content","substr","CodeView","$codable","save","deactivate","activate","codeviewFilter","codeviewFilterRegex","codeviewIframeFilter","whitelist","codeviewIframeWhitelistSrc","codeviewIframeWhitelistSrcBase","tag","RegExp","prettifyHtml","cmEditor","fromTextArea","codemirror","tern","server","TernServer","ternServer","cm","updateArgHints","getValue","setSize","toTextArea","purify","isChange","EDITABLE_PADDING","Statusbar","$statusbar","statusbar","disableResizeEditor","stopPropagation","editableTop","onMouseMove","clientY","minheight","max","Fullscreen","$toolbar","toolbar","$window","$scrollbar","onResize","resizeTo","h","setsize","isFullscreen","Handle","$editingArea","editingArea","we","update","$handle","disableResizeImage","posStart","clientX","isImage","$selection","w","origImageObj","Image","sizingText","defaultScheme","linkPattern","AutoLink","handleKeyup","handleKeydown","lastWordRange","keyword","urlText","linkTargetBlank","wordRange","getWordRange","AutoSync","AutoReplace","PERIOD","COMMA","SEMICOLON","SLASH","previousKeydownCode","lastWord","jQuery","Node","Placeholder","inheritPlaceholder","isShow","toggle","Buttons","invertedKeyMap","editorMethod","o","button","addToolbarButtons","addImagePopoverButtons","addLinkPopoverButtons","addTablePopoverButtons","fontInstalledMap","fontNamesIgnoreCheck","buttonGroup","icon","$button","currentTarget","$recentColor","colorButton","dropdownButtonContents","dropdown","$dropdown","$holder","palette","colors","colorsName","customColors","change","$chip","$picker","$palette","prepend","$color","$currentButton","magic","styleTags","title","template","styleIdx","styleLen","representShortcut","createInvokeHandlerAndUpdateState","eraser","addDefaultFonts","fontname","isFontDeservedToAdd","fontNames","dropdownCheck","checkClassName","menuCheck","fontSizes","fontSizeUnits","colorPalette","unorderedlist","orderedlist","justifyLeft","alignLeft","justifyCenter","alignCenter","justifyRight","alignRight","justifyFull","alignJustify","textHeight","lineHeights","$catcher","insertTableMaxSize","col","mousedown","tableMoveHandler","picture","minus","arrowsAlt","question","rollback","trash","rowAbove","rowBelow","colBefore","colAfter","rowRemove","colRemove","groups","groupIdx","groupLen","group","groupName","$group","btn","updateBtnStates","$item","isChecked","infos","selector","toggleBtnActive","PX_PER_EM","$dimensionDisplay","$highlighted","$unhighlighted","posOffset","offsetX","posCatcher","pageX","pageY","offsetY","c","ceil","r","Toolbar","isFollowing","followScroll","toolbarContainer","changeContainer","followingToolbar","editorHeight","editorWidth","toolbarHeight","statusbarHeight","otherBarHeight","otherStaticBar","currentOffset","editorOffsetTop","editorOffsetBottom","activateOffset","deactivateOffsetBottom","marginTop","zIndex","isIncludeCodeview","$btn","toggleBtn","LinkDialog","$body","dialogsInBody","disableLinkTarget","checkbox","checked","buttonClass","footer","$dialog","dialog","fade","dialogsFade","hideDialog","$input","$linkBtn","$linkText","$linkUrl","$openInNewWindow","$useProtocol","onDialogShown","toggleLinkBtn","bindEnterKey","isNewWindowChecked","prop","useProtocolChecked","onDialogHidden","state","showDialog","showLinkDialog","LinkPopover","popover","$popover","$content","href","containerOffset","ImageDialog","imageLimitation","floor","log","readableSize","pow","showImageDialog","onImageLinkInsert","$imageInput","$imageUrl","$imageBtn","replaceWith","ImagePopover","popatmouse","TablePopover","VideoDialog","ytRegExp","ytRegExpForStart","ytMatch","igRegExp","igMatch","vRegExp","vMatch","vimRegExp","vimMatch","dmRegExp","dmMatch","youkuRegExp","youkuMatch","qqRegExp","qqMatch","qqRegExp2","qqMatch2","mp4RegExp","mp4Match","oggRegExp","oggMatch","webmRegExp","webmMatch","fbRegExp","fbMatch","$video","youtubeId","start","ytMatchForStart","vid","encodeURIComponent","showVideoDialog","createVideoNode","$videoUrl","$videoBtn","HelpDialog","createShortcutList","command","$row","showHelpDialog","AIRMODE_POPOVER_X_OFFSET","AIRMODE_POPOVER_Y_OFFSET","AirPopover","hidable","onContextmenu","air","forcelyOpen","POPOVER_DIST","HintPopover","hint","direction","hintDirection","hints","matchingWord","hideArrow","innerHeight","$current","$next","selectItem","$nextGroup","$prev","$prevGroup","nodeFromItem","rangeCompute","hintSelect","hintIdx","moveUp","moveDown","search","searchKeyword","createItemTemplates","hintMode","getWordsRange","getWordsMatchRange","empty","bnd","createGroup","version","Codeview","toolbarPosition","tabDisabled","textareaAutoSync","onBeforeCommand","onBlur","onBlurCodeview","onChange","onChangeCodeview","onEnter","onFocus","onImageUploadError","onInit","onKeydown","onKeyup","onMousedown","onMouseup","onPaste","onScroll","mode","htmlMode","lineNumbers","pc","mac","renderer","airEditor","airEditable","option","dataValue","dataOption","iconClassName","editorOptions","rowSize","colSize","colorName","placement","isEnable","isActive","modal"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDA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AAkBxY,MAAlB;AACAqX,WAAK,CAACwd,IAAN;AACD;AA1II,GAAP;AA4ID,CA7ID;;AA+Iepd,gDAAf,E;;;;;;;;AC3PA;AACA;AACA;AAEA;AAEAlb,0EAAC,CAACuB,UAAF,GAAevB,0EAAC,CAACyB,MAAF,CAASzB,0EAAC,CAACuB,UAAX,EAAuB;AACpC4Z,aAAW,EAAED,MADuB;AAEpC,eAAW;AAFyB,CAAvB,CAAf;AAKAlb,0EAAC,CAACuB,UAAF,CAAa3B,OAAb,CAAqB0jC,SAArB,GAAiC,CAC/B,GAD+B,EAE/B;AAAEC,OAAK,EAAE,YAAT;AAAuBhH,KAAG,EAAE,YAA5B;AAA0Cp8B,WAAS,EAAE,YAArD;AAAmEwY,OAAK,EAAE;AAA1E,CAF+B,EAG/B,KAH+B,EAGxB,IAHwB,EAGlB,IAHkB,EAGZ,IAHY,EAGN,IAHM,EAGA,IAHA,EAGM,IAHN,CAAjC,C","file":"summernote-bs4.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 53);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import $ from 'jquery';\n\nclass Renderer {\n constructor(markup, children, options, callback) {\n this.markup = markup;\n this.children = children;\n this.options = options;\n this.callback = callback;\n }\n\n render($parent) {\n const $node = $(this.markup);\n\n if (this.options && this.options.contents) {\n $node.html(this.options.contents);\n }\n\n if (this.options && this.options.className) {\n $node.addClass(this.options.className);\n }\n\n if (this.options && this.options.data) {\n $.each(this.options.data, (k, v) => {\n $node.attr('data-' + k, v);\n });\n }\n\n if (this.options && this.options.click) {\n $node.on('click', this.options.click);\n }\n\n if (this.children) {\n const $container = $node.find('.note-children-container');\n this.children.forEach((child) => {\n child.render($container.length ? $container : $node);\n });\n }\n\n if (this.callback) {\n this.callback($node, this.options);\n }\n\n if (this.options && this.options.callback) {\n this.options.callback($node);\n }\n\n if ($parent) {\n $parent.append($node);\n }\n\n return $node;\n }\n}\n\nexport default {\n create: (markup, callback) => {\n return function() {\n const options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n let children = Array.isArray(arguments[0]) ? arguments[0] : [];\n if (options && options.children) {\n children = options.children;\n }\n return new Renderer(markup, children, options, callback);\n };\n },\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import $ from 'jquery';\n\n$.summernote = $.summernote || {\n lang: {},\n};\n\n$.extend($.summernote.lang, {\n 'en-US': {\n font: {\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n clear: 'Remove Font Style',\n height: 'Line Height',\n name: 'Font Family',\n strikethrough: 'Strikethrough',\n subscript: 'Subscript',\n superscript: 'Superscript',\n size: 'Font Size',\n sizeunit: 'Font Size Unit',\n },\n image: {\n image: 'Picture',\n insert: 'Insert Image',\n resizeFull: 'Resize full',\n resizeHalf: 'Resize half',\n resizeQuarter: 'Resize quarter',\n resizeNone: 'Original size',\n floatLeft: 'Float Left',\n floatRight: 'Float Right',\n floatNone: 'Remove float',\n shapeRounded: 'Shape: Rounded',\n shapeCircle: 'Shape: Circle',\n shapeThumbnail: 'Shape: Thumbnail',\n shapeNone: 'Shape: None',\n dragImageHere: 'Drag image or text here',\n dropImage: 'Drop image or Text',\n selectFromFiles: 'Select from files',\n maximumFileSize: 'Maximum file size',\n maximumFileSizeError: 'Maximum file size exceeded.',\n url: 'Image URL',\n remove: 'Remove Image',\n original: 'Original',\n },\n video: {\n video: 'Video',\n videoLink: 'Video Link',\n insert: 'Insert Video',\n url: 'Video URL',\n providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)',\n },\n link: {\n link: 'Link',\n insert: 'Insert Link',\n unlink: 'Unlink',\n edit: 'Edit',\n textToDisplay: 'Text to display',\n url: 'To what URL should this link go?',\n openInNewWindow: 'Open in new window',\n useProtocol: 'Use default protocol',\n },\n table: {\n table: 'Table',\n addRowAbove: 'Add row above',\n addRowBelow: 'Add row below',\n addColLeft: 'Add column left',\n addColRight: 'Add column right',\n delRow: 'Delete row',\n delCol: 'Delete column',\n delTable: 'Delete table',\n },\n hr: {\n insert: 'Insert Horizontal Rule',\n },\n style: {\n style: 'Style',\n p: 'Normal',\n blockquote: 'Quote',\n pre: 'Code',\n h1: 'Header 1',\n h2: 'Header 2',\n h3: 'Header 3',\n h4: 'Header 4',\n h5: 'Header 5',\n h6: 'Header 6',\n },\n lists: {\n unordered: 'Unordered list',\n ordered: 'Ordered list',\n },\n options: {\n help: 'Help',\n fullscreen: 'Full Screen',\n codeview: 'Code View',\n },\n paragraph: {\n paragraph: 'Paragraph',\n outdent: 'Outdent',\n indent: 'Indent',\n left: 'Align left',\n center: 'Align center',\n right: 'Align right',\n justify: 'Justify full',\n },\n color: {\n recent: 'Recent Color',\n more: 'More Color',\n background: 'Background Color',\n foreground: 'Text Color',\n transparent: 'Transparent',\n setTransparent: 'Set transparent',\n reset: 'Reset',\n resetToDefault: 'Reset to default',\n cpSelect: 'Select',\n },\n shortcut: {\n shortcuts: 'Keyboard shortcuts',\n close: 'Close',\n textFormatting: 'Text formatting',\n action: 'Action',\n paragraphFormatting: 'Paragraph formatting',\n documentStyle: 'Document Style',\n extraKeys: 'Extra keys',\n },\n help: {\n 'insertParagraph': 'Insert Paragraph',\n 'undo': 'Undoes the last command',\n 'redo': 'Redoes the last command',\n 'tab': 'Tab',\n 'untab': 'Untab',\n 'bold': 'Set a bold style',\n 'italic': 'Set a italic style',\n 'underline': 'Set a underline style',\n 'strikethrough': 'Set a strikethrough style',\n 'removeFormat': 'Clean a style',\n 'justifyLeft': 'Set left align',\n 'justifyCenter': 'Set center align',\n 'justifyRight': 'Set right align',\n 'justifyFull': 'Set full align',\n 'insertUnorderedList': 'Toggle unordered list',\n 'insertOrderedList': 'Toggle ordered list',\n 'outdent': 'Outdent on current paragraph',\n 'indent': 'Indent on current paragraph',\n 'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n 'formatH1': 'Change current block\\'s format as H1',\n 'formatH2': 'Change current block\\'s format as H2',\n 'formatH3': 'Change current block\\'s format as H3',\n 'formatH4': 'Change current block\\'s format as H4',\n 'formatH5': 'Change current block\\'s format as H5',\n 'formatH6': 'Change current block\\'s format as H6',\n 'insertHorizontalRule': 'Insert horizontal rule',\n 'linkDialog.show': 'Show Link Dialog',\n },\n history: {\n undo: 'Undo',\n redo: 'Redo',\n },\n specialChar: {\n specialChar: 'SPECIAL CHARACTERS',\n select: 'Select Special characters',\n },\n output: {\n noSelection: 'No Selection Made!',\n },\n },\n});\n","import $ from 'jquery';\nconst isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n\n/**\n * returns whether font is installed or not.\n *\n * @param {String} fontName\n * @return {Boolean}\n */\nconst genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n\nfunction validFontName(fontName) {\n return ($.inArray(fontName.toLowerCase(), genericFontFamilies) === -1) ? `'${fontName}'` : fontName;\n}\n\nfunction isFontInstalled(fontName) {\n const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n const testText = 'mmmmmmmmmmwwwww';\n const testSize = '200px';\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n\n context.font = testSize + \" '\" + testFontName + \"'\";\n const originalWidth = context.measureText(testText).width;\n\n context.font = testSize + ' ' + validFontName(fontName) + ', \"' + testFontName + '\"';\n const width = context.measureText(testText).width;\n\n return originalWidth !== width;\n}\n\nconst userAgent = navigator.userAgent;\nconst isMSIE = /MSIE|Trident/i.test(userAgent);\nlet browserVersion;\nif (isMSIE) {\n let matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n}\n\nconst isEdge = /Edge\\/\\d+/.test(userAgent);\n\nlet hasCodeMirror = !!window.CodeMirror;\n\nconst isSupportTouch =\n (('ontouchstart' in window) ||\n (navigator.MaxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0));\n\n// [workaround] IE doesn't have input events for contentEditable\n// - see: https://goo.gl/4bfIvA\nconst inputEventName = (isMSIE) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n\n/**\n * @class core.env\n *\n * Object which check platform and agent\n *\n * @singleton\n * @alternateClassName env\n */\nexport default {\n isMac: navigator.appVersion.indexOf('Mac') > -1,\n isMSIE,\n isEdge,\n isFF: !isEdge && /firefox/i.test(userAgent),\n isPhantom: /PhantomJS/i.test(userAgent),\n isWebkit: !isEdge && /webkit/i.test(userAgent),\n isChrome: !isEdge && /chrome/i.test(userAgent),\n isSafari: !isEdge && /safari/i.test(userAgent) && (!/chrome/i.test(userAgent)),\n browserVersion,\n jqueryVersion: parseFloat($.fn.jquery),\n isSupportAmd,\n isSupportTouch,\n hasCodeMirror,\n isFontInstalled,\n isW3CRangeSupport: !!document.createRange,\n inputEventName,\n genericFontFamilies,\n validFontName,\n};\n","import $ from 'jquery';\n\n/**\n * @class core.func\n *\n * func utils (for high-order func's arg)\n *\n * @singleton\n * @alternateClassName func\n */\nfunction eq(itemA) {\n return function(itemB) {\n return itemA === itemB;\n };\n}\n\nfunction eq2(itemA, itemB) {\n return itemA === itemB;\n}\n\nfunction peq2(propName) {\n return function(itemA, itemB) {\n return itemA[propName] === itemB[propName];\n };\n}\n\nfunction ok() {\n return true;\n}\n\nfunction fail() {\n return false;\n}\n\nfunction not(f) {\n return function() {\n return !f.apply(f, arguments);\n };\n}\n\nfunction and(fA, fB) {\n return function(item) {\n return fA(item) && fB(item);\n };\n}\n\nfunction self(a) {\n return a;\n}\n\nfunction invoke(obj, method) {\n return function() {\n return obj[method].apply(obj, arguments);\n };\n}\n\nlet idCounter = 0;\n\n/**\n * reset globally-unique id\n *\n */\nfunction resetUniqueId() {\n idCounter = 0;\n}\n\n/**\n * generate a globally-unique id\n *\n * @param {String} [prefix]\n */\nfunction uniqueId(prefix) {\n const id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n/**\n * returns bnd (bounds) from rect\n *\n * - IE Compatibility Issue: http://goo.gl/sRLOAo\n * - Scroll Issue: http://goo.gl/sNjUc\n *\n * @param {Rect} rect\n * @return {Object} bounds\n * @return {Number} bounds.top\n * @return {Number} bounds.left\n * @return {Number} bounds.width\n * @return {Number} bounds.height\n */\nfunction rect2bnd(rect) {\n const $document = $(document);\n return {\n top: rect.top + $document.scrollTop(),\n left: rect.left + $document.scrollLeft(),\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\n/**\n * returns a copy of the object where the keys have become the values and the values the keys.\n * @param {Object} obj\n * @return {Object}\n */\nfunction invertObject(obj) {\n const inverted = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n inverted[obj[key]] = key;\n }\n }\n return inverted;\n}\n\n/**\n * @param {String} namespace\n * @param {String} [prefix]\n * @return {String}\n */\nfunction namespaceToCamel(namespace, prefix) {\n prefix = prefix || '';\n return prefix + namespace.split('.').map(function(name) {\n return name.substring(0, 1).toUpperCase() + name.substring(1);\n }).join('');\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n * @param {Function} func\n * @param {Number} wait\n * @param {Boolean} immediate\n * @return {Function}\n */\nfunction debounce(func, wait, immediate) {\n let timeout;\n return function() {\n const context = this;\n const args = arguments;\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/**\n *\n * @param {String} url\n * @return {Boolean}\n */\nfunction isValidUrl(url) {\n const expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n return expression.test(url);\n}\n\nexport default {\n eq,\n eq2,\n peq2,\n ok,\n fail,\n self,\n not,\n and,\n invoke,\n resetUniqueId,\n uniqueId,\n rect2bnd,\n invertObject,\n namespaceToCamel,\n debounce,\n isValidUrl,\n};\n","import func from './func';\n\n/**\n * returns the first item of an array.\n *\n * @param {Array} array\n */\nfunction head(array) {\n return array[0];\n}\n\n/**\n * returns the last item of an array.\n *\n * @param {Array} array\n */\nfunction last(array) {\n return array[array.length - 1];\n}\n\n/**\n * returns everything but the last entry of the array.\n *\n * @param {Array} array\n */\nfunction initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * returns the rest of the items in an array.\n *\n * @param {Array} array\n */\nfunction tail(array) {\n return array.slice(1);\n}\n\n/**\n * returns item of array\n */\nfunction find(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n const item = array[idx];\n if (pred(item)) {\n return item;\n }\n }\n}\n\n/**\n * returns true if all of the values in the array pass the predicate truth test.\n */\nfunction all(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * returns true if the value is present in the list.\n */\nfunction contains(array, item) {\n if (array && array.length && item) {\n if (array.indexOf) {\n return array.indexOf(item) !== -1;\n } else if (array.contains) {\n // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`\n return array.contains(item);\n }\n }\n return false;\n}\n\n/**\n * get sum from a list\n *\n * @param {Array} array - array\n * @param {Function} fn - iterator\n */\nfunction sum(array, fn) {\n fn = fn || func.self;\n return array.reduce(function(memo, v) {\n return memo + fn(v);\n }, 0);\n}\n\n/**\n * returns a copy of the collection with array type.\n * @param {Collection} collection - collection eg) node.childNodes, ...\n */\nfunction from(collection) {\n const result = [];\n const length = collection.length;\n let idx = -1;\n while (++idx < length) {\n result[idx] = collection[idx];\n }\n return result;\n}\n\n/**\n * returns whether list is empty or not\n */\nfunction isEmpty(array) {\n return !array || !array.length;\n}\n\n/**\n * cluster elements by predicate function.\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n * @param {Array[]}\n */\nfunction clusterBy(array, fn) {\n if (!array.length) { return []; }\n const aTail = tail(array);\n return aTail.reduce(function(memo, v) {\n const aLast = last(memo);\n if (fn(last(aLast), v)) {\n aLast[aLast.length] = v;\n } else {\n memo[memo.length] = [v];\n }\n return memo;\n }, [[head(array)]]);\n}\n\n/**\n * returns a copy of the array with all false values removed\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n */\nfunction compact(array) {\n const aResult = [];\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (array[idx]) { aResult.push(array[idx]); }\n }\n return aResult;\n}\n\n/**\n * produces a duplicate-free version of the array\n *\n * @param {Array} array\n */\nfunction unique(array) {\n const results = [];\n\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!contains(results, array[idx])) {\n results.push(array[idx]);\n }\n }\n\n return results;\n}\n\n/**\n * returns next item.\n * @param {Array} array\n */\nfunction next(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx + 1];\n }\n return null;\n}\n\n/**\n * returns prev item.\n * @param {Array} array\n */\nfunction prev(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx - 1];\n }\n return null;\n}\n\n/**\n * @class core.list\n *\n * list utils\n *\n * @singleton\n * @alternateClassName list\n */\nexport default {\n head,\n last,\n initial,\n tail,\n prev,\n next,\n find,\n contains,\n all,\n sum,\n from,\n isEmpty,\n clusterBy,\n compact,\n unique,\n};\n","import $ from 'jquery';\nimport func from './func';\nimport lists from './lists';\nimport env from './env';\n\nconst NBSP_CHAR = String.fromCharCode(160);\nconst ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n\n/**\n * @method isEditable\n *\n * returns whether node is `note-editable` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEditable(node) {\n return node && $(node).hasClass('note-editable');\n}\n\n/**\n * @method isControlSizing\n *\n * returns whether node is `note-control-sizing` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isControlSizing(node) {\n return node && $(node).hasClass('note-control-sizing');\n}\n\n/**\n * @method makePredByNodeName\n *\n * returns predicate which judge whether nodeName is same\n *\n * @param {String} nodeName\n * @return {Function}\n */\nfunction makePredByNodeName(nodeName) {\n nodeName = nodeName.toUpperCase();\n return function(node) {\n return node && node.nodeName.toUpperCase() === nodeName;\n };\n}\n\n/**\n * @method isText\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is text(3)\n */\nfunction isText(node) {\n return node && node.nodeType === 3;\n}\n\n/**\n * @method isElement\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is element(1)\n */\nfunction isElement(node) {\n return node && node.nodeType === 1;\n}\n\n/**\n * ex) br, col, embed, hr, img, input, ...\n * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n */\nfunction isVoid(node) {\n return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n}\n\nfunction isPara(node) {\n if (isEditable(node)) {\n return false;\n }\n\n // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nfunction isHeading(node) {\n return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nconst isPre = makePredByNodeName('PRE');\n\nconst isLi = makePredByNodeName('LI');\n\nfunction isPurePara(node) {\n return isPara(node) && !isLi(node);\n}\n\nconst isTable = makePredByNodeName('TABLE');\n\nconst isData = makePredByNodeName('DATA');\n\nfunction isInline(node) {\n return !isBodyContainer(node) &&\n !isList(node) &&\n !isHr(node) &&\n !isPara(node) &&\n !isTable(node) &&\n !isBlockquote(node) &&\n !isData(node);\n}\n\nfunction isList(node) {\n return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n}\n\nconst isHr = makePredByNodeName('HR');\n\nfunction isCell(node) {\n return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n}\n\nconst isBlockquote = makePredByNodeName('BLOCKQUOTE');\n\nfunction isBodyContainer(node) {\n return isCell(node) || isBlockquote(node) || isEditable(node);\n}\n\nconst isAnchor = makePredByNodeName('A');\n\nfunction isParaInline(node) {\n return isInline(node) && !!ancestor(node, isPara);\n}\n\nfunction isBodyInline(node) {\n return isInline(node) && !ancestor(node, isPara);\n}\n\nconst isBody = makePredByNodeName('BODY');\n\n/**\n * returns whether nodeB is closest sibling of nodeA\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @return {Boolean}\n */\nfunction isClosestSibling(nodeA, nodeB) {\n return nodeA.nextSibling === nodeB ||\n nodeA.previousSibling === nodeB;\n}\n\n/**\n * returns array of closest siblings with node\n *\n * @param {Node} node\n * @param {function} [pred] - predicate function\n * @return {Node[]}\n */\nfunction withClosestSiblings(node, pred) {\n pred = pred || func.ok;\n\n const siblings = [];\n if (node.previousSibling && pred(node.previousSibling)) {\n siblings.push(node.previousSibling);\n }\n siblings.push(node);\n if (node.nextSibling && pred(node.nextSibling)) {\n siblings.push(node.nextSibling);\n }\n return siblings;\n}\n\n/**\n * blank HTML for cursor position\n * - [workaround] old IE only works with \n * - [workaround] IE11 and other browser works with bogus br\n */\nconst blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '<br>';\n\n/**\n * @method nodeLength\n *\n * returns #text's text size or element's childNodes size\n *\n * @param {Node} node\n */\nfunction nodeLength(node) {\n if (isText(node)) {\n return node.nodeValue.length;\n }\n\n if (node) {\n return node.childNodes.length;\n }\n\n return 0;\n}\n\n/**\n * returns whether deepest child node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction deepestChildIsEmpty(node) {\n do {\n if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;\n } while ((node = node.firstElementChild));\n\n return isEmpty(node);\n}\n\n/**\n * returns whether node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEmpty(node) {\n const len = nodeLength(node);\n\n if (len === 0) {\n return true;\n } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n // ex) <p><br></p>, <span><br></span>\n return true;\n } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n // ex) <p></p>, <span></span>\n return true;\n }\n\n return false;\n}\n\n/**\n * padding blankHTML if node is empty (for cursor position)\n */\nfunction paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}\n\n/**\n * find nearest ancestor predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction ancestor(node, pred) {\n while (node) {\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * find nearest ancestor only single child blood line and predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction singleChildAncestor(node, pred) {\n node = node.parentNode;\n\n while (node) {\n if (nodeLength(node) !== 1) { break; }\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * returns new array of ancestor nodes (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listAncestor(node, pred) {\n pred = pred || func.fail;\n\n const ancestors = [];\n ancestor(node, function(el) {\n if (!isEditable(el)) {\n ancestors.push(el);\n }\n\n return pred(el);\n });\n return ancestors;\n}\n\n/**\n * find farthest ancestor predicate hit\n */\nfunction lastAncestor(node, pred) {\n const ancestors = listAncestor(node);\n return lists.last(ancestors.filter(pred));\n}\n\n/**\n * returns common ancestor node between two nodes.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\nfunction commonAncestor(nodeA, nodeB) {\n const ancestors = listAncestor(nodeA);\n for (let n = nodeB; n; n = n.parentNode) {\n if (ancestors.indexOf(n) > -1) return n;\n }\n return null; // difference document area\n}\n\n/**\n * listing all previous siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listPrev(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.previousSibling;\n }\n return nodes;\n}\n\n/**\n * listing next siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listNext(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.nextSibling;\n }\n return nodes;\n}\n\n/**\n * listing descendant nodes\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listDescendant(node, pred) {\n const descendants = [];\n pred = pred || func.ok;\n\n // start DFS(depth first search) with node\n (function fnWalk(current) {\n if (node !== current && pred(current)) {\n descendants.push(current);\n }\n for (let idx = 0, len = current.childNodes.length; idx < len; idx++) {\n fnWalk(current.childNodes[idx]);\n }\n })(node);\n\n return descendants;\n}\n\n/**\n * wrap node with new tag.\n *\n * @param {Node} node\n * @param {Node} tagName of wrapper\n * @return {Node} - wrapper\n */\nfunction wrap(node, wrapperName) {\n const parent = node.parentNode;\n const wrapper = $('<' + wrapperName + '>')[0];\n\n parent.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n}\n\n/**\n * insert node after preceding\n *\n * @param {Node} node\n * @param {Node} preceding - predicate function\n */\nfunction insertAfter(node, preceding) {\n const next = preceding.nextSibling;\n let parent = preceding.parentNode;\n if (next) {\n parent.insertBefore(node, next);\n } else {\n parent.appendChild(node);\n }\n return node;\n}\n\n/**\n * append elements.\n *\n * @param {Node} node\n * @param {Collection} aChild\n */\nfunction appendChildNodes(node, aChild) {\n $.each(aChild, function(idx, child) {\n node.appendChild(child);\n });\n return node;\n}\n\n/**\n * returns whether boundaryPoint is left edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isLeftEdgePoint(point) {\n return point.offset === 0;\n}\n\n/**\n * returns whether boundaryPoint is right edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isRightEdgePoint(point) {\n return point.offset === nodeLength(point.node);\n}\n\n/**\n * returns whether boundaryPoint is edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isEdgePoint(point) {\n return isLeftEdgePoint(point) || isRightEdgePoint(point);\n}\n\n/**\n * returns whether node is left edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgeOf(node, ancestor) {\n while (node && node !== ancestor) {\n if (position(node) !== 0) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether node is right edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgeOf(node, ancestor) {\n if (!ancestor) {\n return false;\n }\n while (node && node !== ancestor) {\n if (position(node) !== nodeLength(node.parentNode) - 1) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether point is left edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgePointOf(point, ancestor) {\n return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns whether point is right edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgePointOf(point, ancestor) {\n return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns offset from parent.\n *\n * @param {Node} node\n */\nfunction position(node) {\n let offset = 0;\n while ((node = node.previousSibling)) {\n offset += 1;\n }\n return offset;\n}\n\nfunction hasChildren(node) {\n return !!(node && node.childNodes && node.childNodes.length);\n}\n\n/**\n * returns previous boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction prevPoint(point, isSkipInnerOffset) {\n let node;\n let offset;\n\n if (point.offset === 0) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node);\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset - 1];\n offset = nodeLength(node);\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? 0 : point.offset - 1;\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns next boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction nextPoint(point, isSkipInnerOffset) {\n let node, offset;\n\n if (isEmpty(point.node)) {\n return null;\n }\n\n if (nodeLength(point.node) === point.offset) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node) + 1;\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset];\n offset = 0;\n if (isEmpty(node)) {\n return null;\n }\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n\n if (isEmpty(node)) {\n return null;\n }\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns whether pointA and pointB is same or not.\n *\n * @param {BoundaryPoint} pointA\n * @param {BoundaryPoint} pointB\n * @return {Boolean}\n */\nfunction isSamePoint(pointA, pointB) {\n return pointA.node === pointB.node && pointA.offset === pointB.offset;\n}\n\n/**\n * returns whether point is visible (can set cursor) or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isVisiblePoint(point) {\n if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {\n return true;\n }\n\n const leftNode = point.node.childNodes[point.offset - 1];\n const rightNode = point.node.childNodes[point.offset];\n if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @method prevPointUtil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction prevPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = prevPoint(point);\n }\n\n return null;\n}\n\n/**\n * @method nextPointUntil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction nextPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = nextPoint(point);\n }\n\n return null;\n}\n\n/**\n * returns whether point has character or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isCharPoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n}\n\n/**\n * returns whether point has space or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isSpacePoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch === ' ' || ch === NBSP_CHAR;\n}\n\n/**\n * @method walkPoint\n *\n * @param {BoundaryPoint} startPoint\n * @param {BoundaryPoint} endPoint\n * @param {Function} handler\n * @param {Boolean} isSkipInnerOffset\n */\nfunction walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n let point = startPoint;\n\n while (point) {\n handler(point);\n\n if (isSamePoint(point, endPoint)) {\n break;\n }\n\n const isSkipOffset = isSkipInnerOffset &&\n startPoint.node !== point.node &&\n endPoint.node !== point.node;\n point = nextPoint(point, isSkipOffset);\n }\n}\n\n/**\n * @method makeOffsetPath\n *\n * return offsetPath(array of offset) from ancestor\n *\n * @param {Node} ancestor - ancestor node\n * @param {Node} node\n */\nfunction makeOffsetPath(ancestor, node) {\n const ancestors = listAncestor(node, func.eq(ancestor));\n return ancestors.map(position).reverse();\n}\n\n/**\n * @method fromOffsetPath\n *\n * return element from offsetPath(array of offset)\n *\n * @param {Node} ancestor - ancestor node\n * @param {array} offsets - offsetPath\n */\nfunction fromOffsetPath(ancestor, offsets) {\n let current = ancestor;\n for (let i = 0, len = offsets.length; i < len; i++) {\n if (current.childNodes.length <= offsets[i]) {\n current = current.childNodes[current.childNodes.length - 1];\n } else {\n current = current.childNodes[offsets[i]];\n }\n }\n return current;\n}\n\n/**\n * @method splitNode\n *\n * split element or #text\n *\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitNode(point, options) {\n let isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n const isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n const isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n\n if (isDiscardEmptySplits) {\n isSkipPaddingBlankHTML = true;\n }\n\n // edge case\n if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n if (isLeftEdgePoint(point)) {\n return point.node;\n } else if (isRightEdgePoint(point)) {\n return point.node.nextSibling;\n }\n }\n\n // split #text\n if (isText(point.node)) {\n return point.node.splitText(point.offset);\n } else {\n const childNode = point.node.childNodes[point.offset];\n const clone = insertAfter(point.node.cloneNode(false), point.node);\n appendChildNodes(clone, listNext(childNode));\n\n if (!isSkipPaddingBlankHTML) {\n paddingBlankHTML(point.node);\n paddingBlankHTML(clone);\n }\n\n if (isDiscardEmptySplits) {\n if (isEmpty(point.node)) {\n remove(point.node);\n }\n if (isEmpty(clone)) {\n remove(clone);\n return point.node.nextSibling;\n }\n }\n\n return clone;\n }\n}\n\n/**\n * @method splitTree\n *\n * split tree by point\n *\n * @param {Node} root - split root\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitTree(root, point, options) {\n // ex) [#text, <span>, <p>]\n const ancestors = listAncestor(point.node, func.eq(root));\n\n if (!ancestors.length) {\n return null;\n } else if (ancestors.length === 1) {\n return splitNode(point, options);\n }\n\n return ancestors.reduce(function(node, parent) {\n if (node === point.node) {\n node = splitNode(point, options);\n }\n\n return splitNode({\n node: parent,\n offset: node ? position(node) : nodeLength(parent),\n }, options);\n });\n}\n\n/**\n * split point\n *\n * @param {Point} point\n * @param {Boolean} isInline\n * @return {Object}\n */\nfunction splitPoint(point, isInline) {\n // find splitRoot, container\n // - inline: splitRoot is a child of paragraph\n // - block: splitRoot is a child of bodyContainer\n const pred = isInline ? isPara : isBodyContainer;\n const ancestors = listAncestor(point.node, pred);\n const topAncestor = lists.last(ancestors) || point.node;\n\n let splitRoot, container;\n if (pred(topAncestor)) {\n splitRoot = ancestors[ancestors.length - 2];\n container = topAncestor;\n } else {\n splitRoot = topAncestor;\n container = splitRoot.parentNode;\n }\n\n // if splitRoot is exists, split with splitTree\n let pivot = splitRoot && splitTree(splitRoot, point, {\n isSkipPaddingBlankHTML: isInline,\n isNotSplitEdgePoint: isInline,\n });\n\n // if container is point.node, find pivot with point.offset\n if (!pivot && container === point.node) {\n pivot = point.node.childNodes[point.offset];\n }\n\n return {\n rightNode: pivot,\n container: container,\n };\n}\n\nfunction create(nodeName) {\n return document.createElement(nodeName);\n}\n\nfunction createText(text) {\n return document.createTextNode(text);\n}\n\n/**\n * @method remove\n *\n * remove node, (isRemoveChild: remove child or not)\n *\n * @param {Node} node\n * @param {Boolean} isRemoveChild\n */\nfunction remove(node, isRemoveChild) {\n if (!node || !node.parentNode) { return; }\n if (node.removeNode) { return node.removeNode(isRemoveChild); }\n\n const parent = node.parentNode;\n if (!isRemoveChild) {\n const nodes = [];\n for (let i = 0, len = node.childNodes.length; i < len; i++) {\n nodes.push(node.childNodes[i]);\n }\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n parent.insertBefore(nodes[i], node);\n }\n }\n\n parent.removeChild(node);\n}\n\n/**\n * @method removeWhile\n *\n * @param {Node} node\n * @param {Function} pred\n */\nfunction removeWhile(node, pred) {\n while (node) {\n if (isEditable(node) || !pred(node)) {\n break;\n }\n\n const parent = node.parentNode;\n remove(node);\n node = parent;\n }\n}\n\n/**\n * @method replace\n *\n * replace node with provided nodeName\n *\n * @param {Node} node\n * @param {String} nodeName\n * @return {Node} - new node\n */\nfunction replace(node, nodeName) {\n if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n return node;\n }\n\n const newNode = create(nodeName);\n\n if (node.style.cssText) {\n newNode.style.cssText = node.style.cssText;\n }\n\n appendChildNodes(newNode, lists.from(node.childNodes));\n insertAfter(newNode, node);\n remove(node);\n\n return newNode;\n}\n\nconst isTextarea = makePredByNodeName('TEXTAREA');\n\n/**\n * @param {jQuery} $node\n * @param {Boolean} [stripLinebreaks] - default: false\n */\nfunction value($node, stripLinebreaks) {\n const val = isTextarea($node[0]) ? $node.val() : $node.html();\n if (stripLinebreaks) {\n return val.replace(/[\\n\\r]/g, '');\n }\n return val;\n}\n\n/**\n * @method html\n *\n * get the HTML contents of node\n *\n * @param {jQuery} $node\n * @param {Boolean} [isNewlineOnBlock]\n */\nfunction html($node, isNewlineOnBlock) {\n let markup = value($node);\n\n if (isNewlineOnBlock) {\n const regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n markup = markup.replace(regexTag, function(match, endSlash, name) {\n name = name.toUpperCase();\n const isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n !!endSlash;\n const isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n\n return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n });\n markup = markup.trim();\n }\n\n return markup;\n}\n\nfunction posFromPlaceholder(placeholder) {\n const $placeholder = $(placeholder);\n const pos = $placeholder.offset();\n const height = $placeholder.outerHeight(true); // include margin\n\n return {\n left: pos.left,\n top: pos.top + height,\n };\n}\n\nfunction attachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.on(key, events[key]);\n });\n}\n\nfunction detachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.off(key, events[key]);\n });\n}\n\n/**\n * @method isCustomStyleTag\n *\n * assert if a node contains a \"note-styletag\" class,\n * which implies that's a custom-made style tag node\n *\n * @param {Node} an HTML DOM node\n */\nfunction isCustomStyleTag(node) {\n return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n}\n\nexport default {\n /** @property {String} NBSP_CHAR */\n NBSP_CHAR,\n /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n ZERO_WIDTH_NBSP_CHAR,\n /** @property {String} blank */\n blank: blankHTML,\n /** @property {String} emptyPara */\n emptyPara: `<p>${blankHTML}</p>`,\n makePredByNodeName,\n isEditable,\n isControlSizing,\n isText,\n isElement,\n isVoid,\n isPara,\n isPurePara,\n isHeading,\n isInline,\n isBlock: func.not(isInline),\n isBodyInline,\n isBody,\n isParaInline,\n isPre,\n isList,\n isTable,\n isData,\n isCell,\n isBlockquote,\n isBodyContainer,\n isAnchor,\n isDiv: makePredByNodeName('DIV'),\n isLi,\n isBR: makePredByNodeName('BR'),\n isSpan: makePredByNodeName('SPAN'),\n isB: makePredByNodeName('B'),\n isU: makePredByNodeName('U'),\n isS: makePredByNodeName('S'),\n isI: makePredByNodeName('I'),\n isImg: makePredByNodeName('IMG'),\n isTextarea,\n deepestChildIsEmpty,\n isEmpty,\n isEmptyAnchor: func.and(isAnchor, isEmpty),\n isClosestSibling,\n withClosestSiblings,\n nodeLength,\n isLeftEdgePoint,\n isRightEdgePoint,\n isEdgePoint,\n isLeftEdgeOf,\n isRightEdgeOf,\n isLeftEdgePointOf,\n isRightEdgePointOf,\n prevPoint,\n nextPoint,\n isSamePoint,\n isVisiblePoint,\n prevPointUntil,\n nextPointUntil,\n isCharPoint,\n isSpacePoint,\n walkPoint,\n ancestor,\n singleChildAncestor,\n listAncestor,\n lastAncestor,\n listNext,\n listPrev,\n listDescendant,\n commonAncestor,\n wrap,\n insertAfter,\n appendChildNodes,\n position,\n hasChildren,\n makeOffsetPath,\n fromOffsetPath,\n splitTree,\n splitPoint,\n create,\n createText,\n remove,\n removeWhile,\n replace,\n html,\n value,\n posFromPlaceholder,\n attachEvents,\n detachEvents,\n isCustomStyleTag,\n};\n","import $ from 'jquery';\nimport func from './core/func';\nimport lists from './core/lists';\nimport dom from './core/dom';\n\nexport default class Context {\n /**\n * @param {jQuery} $note\n * @param {Object} options\n */\n constructor($note, options) {\n this.$note = $note;\n\n this.memos = {};\n this.modules = {};\n this.layoutInfo = {};\n this.options = $.extend(true, {}, options);\n\n // init ui with options\n $.summernote.ui = $.summernote.ui_template(this.options);\n this.ui = $.summernote.ui;\n\n this.initialize();\n }\n\n /**\n * create layout and initialize modules and other resources\n */\n initialize() {\n this.layoutInfo = this.ui.createLayout(this.$note);\n this._initialize();\n this.$note.hide();\n return this;\n }\n\n /**\n * destroy modules and other resources and remove layout\n */\n destroy() {\n this._destroy();\n this.$note.removeData('summernote');\n this.ui.removeLayout(this.$note, this.layoutInfo);\n }\n\n /**\n * destory modules and other resources and initialize it again\n */\n reset() {\n const disabled = this.isDisabled();\n this.code(dom.emptyPara);\n this._destroy();\n this._initialize();\n\n if (disabled) {\n this.disable();\n }\n }\n\n _initialize() {\n // set own id\n this.options.id = func.uniqueId($.now());\n // set default container for tooltips, popovers, and dialogs\n this.options.container = this.options.container || this.layoutInfo.editor;\n\n // add optional buttons\n const buttons = $.extend({}, this.options.buttons);\n Object.keys(buttons).forEach((key) => {\n this.memo('button.' + key, buttons[key]);\n });\n\n const modules = $.extend({}, this.options.modules, $.summernote.plugins || {});\n\n // add and initialize modules\n Object.keys(modules).forEach((key) => {\n this.module(key, modules[key], true);\n });\n\n Object.keys(this.modules).forEach((key) => {\n this.initializeModule(key);\n });\n }\n\n _destroy() {\n // destroy modules with reversed order\n Object.keys(this.modules).reverse().forEach((key) => {\n this.removeModule(key);\n });\n\n Object.keys(this.memos).forEach((key) => {\n this.removeMemo(key);\n });\n // trigger custom onDestroy callback\n this.triggerEvent('destroy', this);\n }\n\n code(html) {\n const isActivated = this.invoke('codeview.isActivated');\n\n if (html === undefined) {\n this.invoke('codeview.sync');\n return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n } else {\n if (isActivated) {\n this.layoutInfo.codable.val(html);\n } else {\n this.layoutInfo.editable.html(html);\n }\n this.$note.val(html);\n this.triggerEvent('change', html, this.layoutInfo.editable);\n }\n }\n\n isDisabled() {\n return this.layoutInfo.editable.attr('contenteditable') === 'false';\n }\n\n enable() {\n this.layoutInfo.editable.attr('contenteditable', true);\n this.invoke('toolbar.activate', true);\n this.triggerEvent('disable', false);\n this.options.editing = true;\n }\n\n disable() {\n // close codeview if codeview is opend\n if (this.invoke('codeview.isActivated')) {\n this.invoke('codeview.deactivate');\n }\n this.layoutInfo.editable.attr('contenteditable', false);\n this.options.editing = false;\n this.invoke('toolbar.deactivate', true);\n\n this.triggerEvent('disable', true);\n }\n\n triggerEvent() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n if (callback) {\n callback.apply(this.$note[0], args);\n }\n this.$note.trigger('summernote.' + namespace, args);\n }\n\n initializeModule(key) {\n const module = this.modules[key];\n module.shouldInitialize = module.shouldInitialize || func.ok;\n if (!module.shouldInitialize()) {\n return;\n }\n\n // initialize module\n if (module.initialize) {\n module.initialize();\n }\n\n // attach events\n if (module.events) {\n dom.attachEvents(this.$note, module.events);\n }\n }\n\n module(key, ModuleClass, withoutIntialize) {\n if (arguments.length === 1) {\n return this.modules[key];\n }\n\n this.modules[key] = new ModuleClass(this);\n\n if (!withoutIntialize) {\n this.initializeModule(key);\n }\n }\n\n removeModule(key) {\n const module = this.modules[key];\n if (module.shouldInitialize()) {\n if (module.events) {\n dom.detachEvents(this.$note, module.events);\n }\n\n if (module.destroy) {\n module.destroy();\n }\n }\n\n delete this.modules[key];\n }\n\n memo(key, obj) {\n if (arguments.length === 1) {\n return this.memos[key];\n }\n this.memos[key] = obj;\n }\n\n removeMemo(key) {\n if (this.memos[key] && this.memos[key].destroy) {\n this.memos[key].destroy();\n }\n\n delete this.memos[key];\n }\n\n /**\n * Some buttons need to change their visual style immediately once they get pressed\n */\n createInvokeHandlerAndUpdateState(namespace, value) {\n return (event) => {\n this.createInvokeHandler(namespace, value)(event);\n this.invoke('buttons.updateCurrentStyle');\n };\n }\n\n createInvokeHandler(namespace, value) {\n return (event) => {\n event.preventDefault();\n const $target = $(event.target);\n this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n };\n }\n\n invoke() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const splits = namespace.split('.');\n const hasSeparator = splits.length > 1;\n const moduleName = hasSeparator && lists.head(splits);\n const methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n\n const module = this.modules[moduleName || 'editor'];\n if (!moduleName && this[methodName]) {\n return this[methodName].apply(this, args);\n } else if (module && module[methodName] && module.shouldInitialize()) {\n return module[methodName].apply(module, args);\n }\n }\n}\n","import $ from 'jquery';\nimport env from './base/core/env';\nimport lists from './base/core/lists';\nimport Context from './base/Context';\n\n$.fn.extend({\n /**\n * Summernote API\n *\n * @param {Object|String}\n * @return {this}\n */\n summernote: function() {\n const type = $.type(lists.head(arguments));\n const isExternalAPICalled = type === 'string';\n const hasInitOptions = type === 'object';\n\n const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n\n // Update options\n options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);\n options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons);\n options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n\n this.each((idx, note) => {\n const $note = $(note);\n if (!$note.data('summernote')) {\n const context = new Context($note, options);\n $note.data('summernote', context);\n $note.data('summernote').triggerEvent('init', context.layoutInfo);\n }\n });\n\n const $note = this.first();\n if ($note.length) {\n const context = $note.data('summernote');\n if (isExternalAPICalled) {\n return context.invoke.apply(context, lists.from(arguments));\n } else if (options.focus) {\n context.invoke('editor.focus');\n }\n }\n\n return this;\n },\n});\n","import $ from 'jquery';\nimport env from './env';\nimport func from './func';\nimport lists from './lists';\nimport dom from './dom';\n\n/**\n * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n *\n * @param {TextRange} textRange\n * @param {Boolean} isStart\n * @return {BoundaryPoint}\n *\n * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n */\nfunction textRangeToPoint(textRange, isStart) {\n let container = textRange.parentElement();\n let offset;\n\n const tester = document.body.createTextRange();\n let prevContainer;\n const childNodes = lists.from(container.childNodes);\n for (offset = 0; offset < childNodes.length; offset++) {\n if (dom.isText(childNodes[offset])) {\n continue;\n }\n tester.moveToElementText(childNodes[offset]);\n if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n break;\n }\n prevContainer = childNodes[offset];\n }\n\n if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n const textRangeStart = document.body.createTextRange();\n let curTextNode = null;\n textRangeStart.moveToElementText(prevContainer || container);\n textRangeStart.collapse(!prevContainer);\n curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n\n const pointTester = textRange.duplicate();\n pointTester.setEndPoint('StartToStart', textRangeStart);\n let textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n\n while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n // [workaround] enforce IE to re-reference curTextNode, hack\n const dummy = curTextNode.nodeValue; // eslint-disable-line\n\n if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n textCount === curTextNode.nodeValue.length) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n container = curTextNode;\n offset = textCount;\n }\n\n return {\n cont: container,\n offset: offset,\n };\n}\n\n/**\n * return TextRange from boundary point (inspired by google closure-library)\n * @param {BoundaryPoint} point\n * @return {TextRange}\n */\nfunction pointToTextRange(point) {\n const textRangeInfo = function(container, offset) {\n let node, isCollapseToStart;\n\n if (dom.isText(container)) {\n const prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n const prevContainer = lists.last(prevTextNodes).previousSibling;\n node = prevContainer || container.parentNode;\n offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n isCollapseToStart = !prevContainer;\n } else {\n node = container.childNodes[offset] || container;\n if (dom.isText(node)) {\n return textRangeInfo(node, 0);\n }\n\n offset = 0;\n isCollapseToStart = false;\n }\n\n return {\n node: node,\n collapseToStart: isCollapseToStart,\n offset: offset,\n };\n };\n\n const textRange = document.body.createTextRange();\n const info = textRangeInfo(point.node, point.offset);\n\n textRange.moveToElementText(info.node);\n textRange.collapse(info.collapseToStart);\n textRange.moveStart('character', info.offset);\n return textRange;\n}\n\n/**\n * Wrapped Range\n *\n * @constructor\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n */\nclass WrappedRange {\n constructor(sc, so, ec, eo) {\n this.sc = sc;\n this.so = so;\n this.ec = ec;\n this.eo = eo;\n\n // isOnEditable: judge whether range is on editable or not\n this.isOnEditable = this.makeIsOn(dom.isEditable);\n // isOnList: judge whether range is on list node or not\n this.isOnList = this.makeIsOn(dom.isList);\n // isOnAnchor: judge whether range is on anchor node or not\n this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n // isOnCell: judge whether range is on cell node or not\n this.isOnCell = this.makeIsOn(dom.isCell);\n // isOnData: judge whether range is on data node or not\n this.isOnData = this.makeIsOn(dom.isData);\n }\n\n // nativeRange: get nativeRange from sc, so, ec, eo\n nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }\n\n getPoints() {\n return {\n sc: this.sc,\n so: this.so,\n ec: this.ec,\n eo: this.eo,\n };\n }\n\n getStartPoint() {\n return {\n node: this.sc,\n offset: this.so,\n };\n }\n\n getEndPoint() {\n return {\n node: this.ec,\n offset: this.eo,\n };\n }\n\n /**\n * select update visible range\n */\n select() {\n const nativeRng = this.nativeRange();\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (selection.rangeCount > 0) {\n selection.removeAllRanges();\n }\n selection.addRange(nativeRng);\n } else {\n nativeRng.select();\n }\n\n return this;\n }\n\n /**\n * Moves the scrollbar to start container(sc) of current range\n *\n * @return {WrappedRange}\n */\n scrollIntoView(container) {\n const height = $(container).height();\n if (container.scrollTop + height < this.sc.offsetTop) {\n container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n }\n\n return this;\n }\n\n /**\n * @return {WrappedRange}\n */\n normalize() {\n /**\n * @param {BoundaryPoint} point\n * @param {Boolean} isLeftToRight - true: prefer to choose right node\n * - false: prefer to choose left node\n * @return {BoundaryPoint}\n */\n const getVisiblePoint = function(point, isLeftToRight) {\n if (!point) {\n return point;\n }\n\n // Just use the given point [XXX:Adhoc]\n // - case 01. if the point is on the middle of the node\n // - case 02. if the point is on the right edge and prefer to choose left node\n // - case 03. if the point is on the left edge and prefer to choose right node\n // - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n // - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n // - case 06. if the point is on the block node and there is no children\n if (dom.isVisiblePoint(point)) {\n if (!dom.isEdgePoint(point) ||\n (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n return point;\n }\n }\n\n // point on block's edge\n const block = dom.ancestor(point.node, dom.isBlock);\n let hasRightNode = false;\n\n if (!hasRightNode) {\n const prevPoint = dom.prevPoint(point) || { node: null };\n hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;\n }\n\n let hasLeftNode = false;\n if (!hasLeftNode) {\n const nextPoint = dom.nextPoint(point) || { node: null };\n hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(nextPoint.node)) && isLeftToRight;\n }\n\n if (hasRightNode || hasLeftNode) {\n // returns point already on visible point\n if (dom.isVisiblePoint(point)) {\n return point;\n }\n // reverse direction\n isLeftToRight = !isLeftToRight;\n }\n\n const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n return nextPoint || point;\n };\n\n const endPoint = getVisiblePoint(this.getEndPoint(), false);\n const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns matched nodes on range\n *\n * @param {Function} [pred] - predicate function\n * @param {Object} [options]\n * @param {Boolean} [options.includeAncestor]\n * @param {Boolean} [options.fullyContains]\n * @return {Node[]}\n */\n nodes(pred, options) {\n pred = pred || func.ok;\n\n const includeAncestor = options && options.includeAncestor;\n const fullyContains = options && options.fullyContains;\n\n // TODO compare points and sort\n const startPoint = this.getStartPoint();\n const endPoint = this.getEndPoint();\n\n const nodes = [];\n const leftEdgeNodes = [];\n\n dom.walkPoint(startPoint, endPoint, function(point) {\n if (dom.isEditable(point.node)) {\n return;\n }\n\n let node;\n if (fullyContains) {\n if (dom.isLeftEdgePoint(point)) {\n leftEdgeNodes.push(point.node);\n }\n if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n node = point.node;\n }\n } else if (includeAncestor) {\n node = dom.ancestor(point.node, pred);\n } else {\n node = point.node;\n }\n\n if (node && pred(node)) {\n nodes.push(node);\n }\n }, true);\n\n return lists.unique(nodes);\n }\n\n /**\n * returns commonAncestor of range\n * @return {Element} - commonAncestor\n */\n commonAncestor() {\n return dom.commonAncestor(this.sc, this.ec);\n }\n\n /**\n * returns expanded range by pred\n *\n * @param {Function} pred - predicate function\n * @return {WrappedRange}\n */\n expand(pred) {\n const startAncestor = dom.ancestor(this.sc, pred);\n const endAncestor = dom.ancestor(this.ec, pred);\n\n if (!startAncestor && !endAncestor) {\n return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n }\n\n const boundaryPoints = this.getPoints();\n\n if (startAncestor) {\n boundaryPoints.sc = startAncestor;\n boundaryPoints.so = 0;\n }\n\n if (endAncestor) {\n boundaryPoints.ec = endAncestor;\n boundaryPoints.eo = dom.nodeLength(endAncestor);\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * @param {Boolean} isCollapseToStart\n * @return {WrappedRange}\n */\n collapse(isCollapseToStart) {\n if (isCollapseToStart) {\n return new WrappedRange(this.sc, this.so, this.sc, this.so);\n } else {\n return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n }\n }\n\n /**\n * splitText on range\n */\n splitText() {\n const isSameContainer = this.sc === this.ec;\n const boundaryPoints = this.getPoints();\n\n if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n this.ec.splitText(this.eo);\n }\n\n if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n boundaryPoints.sc = this.sc.splitText(this.so);\n boundaryPoints.so = 0;\n\n if (isSameContainer) {\n boundaryPoints.ec = boundaryPoints.sc;\n boundaryPoints.eo = this.eo - this.so;\n }\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * delete contents on range\n * @return {WrappedRange}\n */\n deleteContents() {\n if (this.isCollapsed()) {\n return this;\n }\n\n const rng = this.splitText();\n const nodes = rng.nodes(null, {\n fullyContains: true,\n });\n\n // find new cursor point\n const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {\n return !lists.contains(nodes, point.node);\n });\n\n const emptyParents = [];\n $.each(nodes, function(idx, node) {\n // find empty parents\n const parent = node.parentNode;\n if (point.node !== parent && dom.nodeLength(parent) === 1) {\n emptyParents.push(parent);\n }\n dom.remove(node, false);\n });\n\n // remove empty parents\n $.each(emptyParents, function(idx, node) {\n dom.remove(node, false);\n });\n\n return new WrappedRange(\n point.node,\n point.offset,\n point.node,\n point.offset\n ).normalize();\n }\n\n /**\n * makeIsOn: return isOn(pred) function\n */\n makeIsOn(pred) {\n return function() {\n const ancestor = dom.ancestor(this.sc, pred);\n return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n };\n }\n\n /**\n * @param {Function} pred\n * @return {Boolean}\n */\n isLeftEdgeOf(pred) {\n if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n return false;\n }\n\n const node = dom.ancestor(this.sc, pred);\n return node && dom.isLeftEdgeOf(this.sc, node);\n }\n\n /**\n * returns whether range was collapsed or not\n */\n isCollapsed() {\n return this.sc === this.ec && this.so === this.eo;\n }\n\n /**\n * wrap inline nodes which children of body with paragraph\n *\n * @return {WrappedRange}\n */\n wrapBodyInlineWithPara() {\n if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n this.sc.innerHTML = dom.emptyPara;\n return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n }\n\n /**\n * [workaround] firefox often create range on not visible point. so normalize here.\n * - firefox: |<p>text</p>|\n * - chrome: <p>|text|</p>\n */\n const rng = this.normalize();\n if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n return rng;\n }\n\n // find inline top ancestor\n let topAncestor;\n if (dom.isInline(rng.sc)) {\n const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n topAncestor = lists.last(ancestors);\n if (!dom.isInline(topAncestor)) {\n topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n }\n } else {\n topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n }\n\n if (topAncestor) {\n // siblings not in paragraph\n let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n\n // wrap with paragraph\n if (inlineSiblings.length) {\n const para = dom.wrap(lists.head(inlineSiblings), 'p');\n dom.appendChildNodes(para, lists.tail(inlineSiblings));\n }\n }\n\n return this.normalize();\n }\n\n /**\n * insert node at current cursor\n *\n * @param {Node} node\n * @return {Node}\n */\n insertNode(node) {\n let rng = this;\n\n if (dom.isText(node) || dom.isInline(node)) {\n rng = this.wrapBodyInlineWithPara().deleteContents();\n }\n\n const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n if (info.rightNode) {\n info.rightNode.parentNode.insertBefore(node, info.rightNode);\n } else {\n info.container.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * insert html at current cursor\n */\n pasteHTML(markup) {\n markup = $.trim(markup);\n\n const contentsContainer = $('<div></div>').html(markup)[0];\n let childNodes = lists.from(contentsContainer.childNodes);\n\n // const rng = this.wrapBodyInlineWithPara().deleteContents();\n const rng = this;\n\n if (rng.so >= 0) {\n childNodes = childNodes.reverse();\n }\n childNodes = childNodes.map(function(childNode) {\n return rng.insertNode(childNode);\n });\n if (rng.so > 0) {\n childNodes = childNodes.reverse();\n }\n return childNodes;\n }\n\n /**\n * returns text in range\n *\n * @return {String}\n */\n toString() {\n const nativeRng = this.nativeRange();\n return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n }\n\n /**\n * returns range for word before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordRange(findAfter) {\n let endPoint = this.getEndPoint();\n\n if (!dom.isCharPoint(endPoint)) {\n return this;\n }\n\n const startPoint = dom.prevPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordsRange(findAfter) {\n var endPoint = this.getEndPoint();\n\n var isNotTextPoint = function(point) {\n return !dom.isCharPoint(point) && !dom.isSpacePoint(point);\n };\n\n if (isNotTextPoint(endPoint)) {\n return this;\n }\n\n var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor that match with a Regex\n *\n * example:\n * range: 'hi @Peter Pan'\n * regex: '/@[a-z ]+/i'\n * return range: '@Peter Pan'\n *\n * @param {RegExp} [regex]\n * @return {WrappedRange|null}\n */\n getWordsMatchRange(regex) {\n var endPoint = this.getEndPoint();\n\n var startPoint = dom.prevPointUntil(endPoint, function(point) {\n if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {\n return true;\n }\n var rng = new WrappedRange(\n point.node,\n point.offset,\n endPoint.node,\n endPoint.offset\n );\n var result = regex.exec(rng.toString());\n return result && result.index === 0;\n });\n\n var rng = new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n\n var text = rng.toString();\n var result = regex.exec(text);\n\n if (result && result[0].length === text.length) {\n return rng;\n } else {\n return null;\n }\n }\n\n /**\n * create offsetPath bookmark\n *\n * @param {Node} editable\n */\n bookmark(editable) {\n return {\n s: {\n path: dom.makeOffsetPath(editable, this.sc),\n offset: this.so,\n },\n e: {\n path: dom.makeOffsetPath(editable, this.ec),\n offset: this.eo,\n },\n };\n }\n\n /**\n * create offsetPath bookmark base on paragraph\n *\n * @param {Node[]} paras\n */\n paraBookmark(paras) {\n return {\n s: {\n path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n offset: this.so,\n },\n e: {\n path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n offset: this.eo,\n },\n };\n }\n\n /**\n * getClientRects\n * @return {Rect[]}\n */\n getClientRects() {\n const nativeRng = this.nativeRange();\n return nativeRng.getClientRects();\n }\n}\n\n/**\n * Data structure\n * * BoundaryPoint: a point of dom tree\n * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n *\n * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n */\nexport default {\n /**\n * create Range Object From arguments or Browser Selection\n *\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n * @return {WrappedRange}\n */\n create: function(sc, so, ec, eo) {\n if (arguments.length === 4) {\n return new WrappedRange(sc, so, ec, eo);\n } else if (arguments.length === 2) { // collapsed\n ec = sc;\n eo = so;\n return new WrappedRange(sc, so, ec, eo);\n } else {\n let wrappedRange = this.createFromSelection();\n\n if (!wrappedRange && arguments.length === 1) {\n let bodyElement = arguments[0];\n if (dom.isEditable(bodyElement)) {\n bodyElement = bodyElement.lastChild;\n }\n return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);\n }\n return wrappedRange;\n }\n },\n\n createFromBodyElement: function(bodyElement, isCollapseToStart = false) {\n var wrappedRange = this.createFromNode(bodyElement);\n return wrappedRange.collapse(isCollapseToStart);\n },\n\n createFromSelection: function() {\n let sc, so, ec, eo;\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n } else if (dom.isBody(selection.anchorNode)) {\n // Firefox: returns entire body as range on initialization.\n // We won't never need it.\n return null;\n }\n\n const nativeRng = selection.getRangeAt(0);\n sc = nativeRng.startContainer;\n so = nativeRng.startOffset;\n ec = nativeRng.endContainer;\n eo = nativeRng.endOffset;\n } else { // IE8: TextRange\n const textRange = document.selection.createRange();\n const textRangeEnd = textRange.duplicate();\n textRangeEnd.collapse(false);\n const textRangeStart = textRange;\n textRangeStart.collapse(true);\n\n let startPoint = textRangeToPoint(textRangeStart, true);\n let endPoint = textRangeToPoint(textRangeEnd, false);\n\n // same visible point case: range was collapsed.\n if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n endPoint.node.nextSibling === startPoint.node) {\n startPoint = endPoint;\n }\n\n sc = startPoint.cont;\n so = startPoint.offset;\n ec = endPoint.cont;\n eo = endPoint.offset;\n }\n\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from node\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNode: function(node) {\n let sc = node;\n let so = 0;\n let ec = node;\n let eo = dom.nodeLength(ec);\n\n // browsers can't target a picture or void node\n if (dom.isVoid(sc)) {\n so = dom.listPrev(sc).length - 1;\n sc = sc.parentNode;\n }\n if (dom.isBR(ec)) {\n eo = dom.listPrev(ec).length - 1;\n ec = ec.parentNode;\n } else if (dom.isVoid(ec)) {\n eo = dom.listPrev(ec).length;\n ec = ec.parentNode;\n }\n\n return this.create(sc, so, ec, eo);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeBefore: function(node) {\n return this.createFromNode(node).collapse(true);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeAfter: function(node) {\n return this.createFromNode(node).collapse();\n },\n\n /**\n * @method\n *\n * create WrappedRange from bookmark\n *\n * @param {Node} editable\n * @param {Object} bookmark\n * @return {WrappedRange}\n */\n createFromBookmark: function(editable, bookmark) {\n const sc = dom.fromOffsetPath(editable, bookmark.s.path);\n const so = bookmark.s.offset;\n const ec = dom.fromOffsetPath(editable, bookmark.e.path);\n const eo = bookmark.e.offset;\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from paraBookmark\n *\n * @param {Object} bookmark\n * @param {Node[]} paras\n * @return {WrappedRange}\n */\n createFromParaBookmark: function(bookmark, paras) {\n const so = bookmark.s.offset;\n const eo = bookmark.e.offset;\n const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n\n return new WrappedRange(sc, so, ec, eo);\n },\n};\n","import lists from './lists';\nimport func from './func';\n\nconst KEY_MAP = {\n 'BACKSPACE': 8,\n 'TAB': 9,\n 'ENTER': 13,\n 'SPACE': 32,\n 'DELETE': 46,\n\n // Arrow\n 'LEFT': 37,\n 'UP': 38,\n 'RIGHT': 39,\n 'DOWN': 40,\n\n // Number: 0-9\n 'NUM0': 48,\n 'NUM1': 49,\n 'NUM2': 50,\n 'NUM3': 51,\n 'NUM4': 52,\n 'NUM5': 53,\n 'NUM6': 54,\n 'NUM7': 55,\n 'NUM8': 56,\n\n // Alphabet: a-z\n 'B': 66,\n 'E': 69,\n 'I': 73,\n 'J': 74,\n 'K': 75,\n 'L': 76,\n 'R': 82,\n 'S': 83,\n 'U': 85,\n 'V': 86,\n 'Y': 89,\n 'Z': 90,\n\n 'SLASH': 191,\n 'LEFTBRACKET': 219,\n 'BACKSLASH': 220,\n 'RIGHTBRACKET': 221,\n\n // Navigation\n 'HOME': 36,\n 'END': 35,\n 'PAGEUP': 33,\n 'PAGEDOWN': 34,\n};\n\n/**\n * @class core.key\n *\n * Object for keycodes.\n *\n * @singleton\n * @alternateClassName key\n */\nexport default {\n /**\n * @method isEdit\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isEdit: (keyCode) => {\n return lists.contains([\n KEY_MAP.BACKSPACE,\n KEY_MAP.TAB,\n KEY_MAP.ENTER,\n KEY_MAP.SPACE,\n KEY_MAP.DELETE,\n ], keyCode);\n },\n /**\n * @method isMove\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isMove: (keyCode) => {\n return lists.contains([\n KEY_MAP.LEFT,\n KEY_MAP.UP,\n KEY_MAP.RIGHT,\n KEY_MAP.DOWN,\n ], keyCode);\n },\n /**\n * @method isNavigation\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isNavigation: (keyCode) => {\n return lists.contains([\n KEY_MAP.HOME,\n KEY_MAP.END,\n KEY_MAP.PAGEUP,\n KEY_MAP.PAGEDOWN,\n ], keyCode);\n },\n /**\n * @property {Object} nameFromCode\n * @property {String} nameFromCode.8 \"BACKSPACE\"\n */\n nameFromCode: func.invertObject(KEY_MAP),\n code: KEY_MAP,\n};\n","import $ from 'jquery';\n\n/**\n * @method readFileAsDataURL\n *\n * read contents of file as representing URL\n *\n * @param {File} file\n * @return {Promise} - then: dataUrl\n */\nexport function readFileAsDataURL(file) {\n return $.Deferred((deferred) => {\n $.extend(new FileReader(), {\n onload: (e) => {\n const dataURL = e.target.result;\n deferred.resolve(dataURL);\n },\n onerror: (err) => {\n deferred.reject(err);\n },\n }).readAsDataURL(file);\n }).promise();\n}\n\n/**\n * @method createImage\n *\n * create `<image>` from url string\n *\n * @param {String} url\n * @return {Promise} - then: $image\n */\nexport function createImage(url) {\n return $.Deferred((deferred) => {\n const $img = $('<img>');\n\n $img.one('load', () => {\n $img.off('error abort');\n deferred.resolve($img);\n }).one('error abort', () => {\n $img.off('load').detach();\n deferred.reject($img);\n }).css({\n display: 'none',\n }).appendTo(document.body).attr('src', url);\n }).promise();\n}\n","import range from '../core/range';\n\nexport default class History {\n constructor(context) {\n this.stack = [];\n this.stackOffset = -1;\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n this.editable = this.$editable[0];\n }\n\n makeSnapshot() {\n const rng = range.create(this.editable);\n const emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n\n return {\n contents: this.$editable.html(),\n bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark),\n };\n }\n\n applySnapshot(snapshot) {\n if (snapshot.contents !== null) {\n this.$editable.html(snapshot.contents);\n }\n if (snapshot.bookmark !== null) {\n range.createFromBookmark(this.editable, snapshot.bookmark).select();\n }\n }\n\n /**\n * @method rewind\n * Rewinds the history stack back to the first snapshot taken.\n * Leaves the stack intact, so that \"Redo\" can still be used.\n */\n rewind() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n // Return to the first available snapshot.\n this.stackOffset = 0;\n\n // Apply that snapshot.\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n\n /**\n * @method commit\n * Resets history stack, but keeps current editor's content.\n */\n commit() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * @method reset\n * Resets the history stack completely; reverting to an empty editor.\n */\n reset() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Clear the editable area.\n this.$editable.html('');\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * undo\n */\n undo() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n if (this.stackOffset > 0) {\n this.stackOffset--;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * redo\n */\n redo() {\n if (this.stack.length - 1 > this.stackOffset) {\n this.stackOffset++;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * recorded undo\n */\n recordUndo() {\n this.stackOffset++;\n\n // Wash out stack after stackOffset\n if (this.stack.length > this.stackOffset) {\n this.stack = this.stack.slice(0, this.stackOffset);\n }\n\n // Create new snapshot and push it to the end\n this.stack.push(this.makeSnapshot());\n\n // If the stack size reachs to the limit, then slice it\n if (this.stack.length > this.context.options.historyLimit) {\n this.stack.shift();\n this.stackOffset -= 1;\n }\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class Style {\n /**\n * @method jQueryCSS\n *\n * [workaround] for old jQuery\n * passing an array of style properties to .css()\n * will result in an object of property-value pairs.\n * (compability with version < 1.9)\n *\n * @private\n * @param {jQuery} $obj\n * @param {Array} propertyNames - An array of one or more CSS properties.\n * @return {Object}\n */\n jQueryCSS($obj, propertyNames) {\n if (env.jqueryVersion < 1.9) {\n const result = {};\n $.each(propertyNames, (idx, propertyName) => {\n result[propertyName] = $obj.css(propertyName);\n });\n return result;\n }\n return $obj.css(propertyNames);\n }\n\n /**\n * returns style object from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n fromNode($node) {\n const properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n const styleInfo = this.jQueryCSS($node, properties) || {};\n\n const fontSize = $node[0].style.fontSize || styleInfo['font-size'];\n\n styleInfo['font-size'] = parseInt(fontSize, 10);\n styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);\n\n return styleInfo;\n }\n\n /**\n * paragraph level style\n *\n * @param {WrappedRange} rng\n * @param {Object} styleInfo\n */\n stylePara(rng, styleInfo) {\n $.each(rng.nodes(dom.isPara, {\n includeAncestor: true,\n }), (idx, para) => {\n $(para).css(styleInfo);\n });\n }\n\n /**\n * insert and returns styleNodes on range.\n *\n * @param {WrappedRange} rng\n * @param {Object} [options] - options for styleNodes\n * @param {String} [options.nodeName] - default: `SPAN`\n * @param {Boolean} [options.expandClosestSibling] - default: `false`\n * @param {Boolean} [options.onlyPartialContains] - default: `false`\n * @return {Node[]}\n */\n styleNodes(rng, options) {\n rng = rng.splitText();\n\n const nodeName = (options && options.nodeName) || 'SPAN';\n const expandClosestSibling = !!(options && options.expandClosestSibling);\n const onlyPartialContains = !!(options && options.onlyPartialContains);\n\n if (rng.isCollapsed()) {\n return [rng.insertNode(dom.create(nodeName))];\n }\n\n let pred = dom.makePredByNodeName(nodeName);\n const nodes = rng.nodes(dom.isText, {\n fullyContains: true,\n }).map((text) => {\n return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n });\n\n if (expandClosestSibling) {\n if (onlyPartialContains) {\n const nodesInRange = rng.nodes();\n // compose with partial contains predication\n pred = func.and(pred, (node) => {\n return lists.contains(nodesInRange, node);\n });\n }\n\n return nodes.map((node) => {\n const siblings = dom.withClosestSiblings(node, pred);\n const head = lists.head(siblings);\n const tails = lists.tail(siblings);\n $.each(tails, (idx, elem) => {\n dom.appendChildNodes(head, elem.childNodes);\n dom.remove(elem);\n });\n return lists.head(siblings);\n });\n } else {\n return nodes;\n }\n }\n\n /**\n * get current style on cursor\n *\n * @param {WrappedRange} rng\n * @return {Object} - object contains style properties.\n */\n current(rng) {\n const $cont = $(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n let styleInfo = this.fromNode($cont);\n\n // document.queryCommandState for toggle state\n // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n try {\n styleInfo = $.extend(styleInfo, {\n 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'],\n });\n } catch (e) {\n // eslint-disable-next-line\n }\n\n // list-style-type to list-style(unordered, ordered)\n if (!rng.isOnList()) {\n styleInfo['list-style'] = 'none';\n } else {\n const orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n const isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n }\n\n const para = dom.ancestor(rng.sc, dom.isPara);\n if (para && para.style['line-height']) {\n styleInfo['line-height'] = para.style.lineHeight;\n } else {\n const lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n styleInfo['line-height'] = lineHeight.toFixed(1);\n }\n\n styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n styleInfo.range = rng;\n\n return styleInfo;\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport func from '../core/func';\nimport dom from '../core/dom';\nimport range from '../core/range';\n\nexport default class Bullet {\n /**\n * toggle ordered list\n */\n insertOrderedList(editable) {\n this.toggleList('OL', editable);\n }\n\n /**\n * toggle unordered list\n */\n insertUnorderedList(editable) {\n this.toggleList('UL', editable);\n }\n\n /**\n * indent\n */\n indent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n const previousList = this.findList(head.previousSibling);\n if (previousList) {\n paras\n .map(para => previousList.appendChild(para));\n } else {\n this.wrapList(paras, head.parentNode.nodeName);\n paras\n .map((para) => para.parentNode)\n .map((para) => this.appendToPrevious(para));\n }\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n return (parseInt(val, 10) || 0) + 25;\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * outdent\n */\n outdent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n this.releaseList([paras]);\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n val = (parseInt(val, 10) || 0);\n return val > 25 ? val - 25 : '';\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * toggle list\n *\n * @param {String} listName - OL or UL\n */\n toggleList(listName, editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n let paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const bookmark = rng.paraBookmark(paras);\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n // paragraph to list\n if (lists.find(paras, dom.isPurePara)) {\n let wrappedParas = [];\n $.each(clustereds, (idx, paras) => {\n wrappedParas = wrappedParas.concat(this.wrapList(paras, listName));\n });\n paras = wrappedParas;\n // list to paragraph or change list style\n } else {\n const diffLists = rng.nodes(dom.isList, {\n includeAncestor: true,\n }).filter((listNode) => {\n return !$.nodeName(listNode, listName);\n });\n\n if (diffLists.length) {\n $.each(diffLists, (idx, listNode) => {\n dom.replace(listNode, listName);\n });\n } else {\n paras = this.releaseList(clustereds, true);\n }\n }\n\n range.createFromParaBookmark(bookmark, paras).select();\n }\n\n /**\n * @param {Node[]} paras\n * @param {String} listName\n * @return {Node[]}\n */\n wrapList(paras, listName) {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const prevList = dom.isList(head.previousSibling) && head.previousSibling;\n const nextList = dom.isList(last.nextSibling) && last.nextSibling;\n\n const listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n\n // P to LI\n paras = paras.map((para) => {\n return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n });\n\n // append to list(<ul>, <ol>)\n dom.appendChildNodes(listNode, paras);\n\n if (nextList) {\n dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n dom.remove(nextList);\n }\n\n return paras;\n }\n\n /**\n * @method releaseList\n *\n * @param {Array[]} clustereds\n * @param {Boolean} isEscapseToBody\n * @return {Node[]}\n */\n releaseList(clustereds, isEscapseToBody) {\n let releasedParas = [];\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n const parentItem = headList.parentNode;\n\n if (headList.parentNode.nodeName === 'LI') {\n paras.map(para => {\n const newList = this.findNextSiblings(para);\n\n if (parentItem.nextSibling) {\n parentItem.parentNode.insertBefore(\n para,\n parentItem.nextSibling\n );\n } else {\n parentItem.parentNode.appendChild(para);\n }\n\n if (newList.length) {\n this.wrapList(newList, headList.nodeName);\n para.appendChild(newList[0].parentNode);\n }\n });\n\n if (headList.children.length === 0) {\n parentItem.removeChild(headList);\n }\n\n if (parentItem.childNodes.length === 0) {\n parentItem.parentNode.removeChild(parentItem);\n }\n } else {\n const lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n node: last.parentNode,\n offset: dom.position(last) + 1,\n }, {\n isSkipPaddingBlankHTML: true,\n }) : null;\n\n const middleList = dom.splitTree(headList, {\n node: head.parentNode,\n offset: dom.position(head),\n }, {\n isSkipPaddingBlankHTML: true,\n });\n\n paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n : lists.from(middleList.childNodes).filter(dom.isLi);\n\n // LI to P\n if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n paras = paras.map((para) => {\n return dom.replace(para, 'P');\n });\n }\n\n $.each(lists.from(paras).reverse(), (idx, para) => {\n dom.insertAfter(para, headList);\n });\n\n // remove empty lists\n const rootLists = lists.compact([headList, middleList, lastList]);\n $.each(rootLists, (idx, rootList) => {\n const listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n $.each(listNodes.reverse(), (idx, listNode) => {\n if (!dom.nodeLength(listNode)) {\n dom.remove(listNode, true);\n }\n });\n });\n }\n\n releasedParas = releasedParas.concat(paras);\n });\n\n return releasedParas;\n }\n\n /**\n * @method appendToPrevious\n *\n * Appends list to previous list item, if\n * none exist it wraps the list in a new list item.\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n appendToPrevious(node) {\n return node.previousSibling\n ? dom.appendChildNodes(node.previousSibling, [node])\n : this.wrapList([node], 'LI');\n }\n\n /**\n * @method findList\n *\n * Finds an existing list in list item\n *\n * @param {HTMLNode} ListItem\n * @return {Array[]}\n */\n findList(node) {\n return node\n ? lists.find(node.children, child => ['OL', 'UL'].indexOf(child.nodeName) > -1)\n : null;\n }\n\n /**\n * @method findNextSiblings\n *\n * Finds all list item siblings that follow it\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n findNextSiblings(node) {\n const siblings = [];\n while (node.nextSibling) {\n siblings.push(node.nextSibling);\n node = node.nextSibling;\n }\n return siblings;\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport Bullet from '../editing/Bullet';\n\n/**\n * @class editing.Typing\n *\n * Typing\n *\n */\nexport default class Typing {\n constructor(context) {\n // a Bullet instance to toggle lists off\n this.bullet = new Bullet();\n this.options = context.options;\n }\n\n /**\n * insert tab\n *\n * @param {WrappedRange} rng\n * @param {Number} tabsize\n */\n insertTab(rng, tabsize) {\n const tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n rng = rng.deleteContents();\n rng.insertNode(tab, true);\n\n rng = range.create(tab, tabsize);\n rng.select();\n }\n\n /**\n * insert paragraph\n *\n * @param {jQuery} $editable\n * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n *\n * blockquoteBreakingLevel\n * 0 - No break, the new paragraph remains inside the quote\n * 1 - Break the first blockquote in the ancestors list\n * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n */\n insertParagraph(editable, rng) {\n rng = rng || range.create(editable);\n\n // deleteContents on range.\n rng = rng.deleteContents();\n\n // Wrap range if it needs to be wrapped by paragraph\n rng = rng.wrapBodyInlineWithPara();\n\n // finding paragraph\n const splitRoot = dom.ancestor(rng.sc, dom.isPara);\n\n let nextPara;\n // on paragraph: split paragraph\n if (splitRoot) {\n // if it is an empty line with li\n if (dom.isLi(splitRoot) && (dom.isEmpty(splitRoot) || dom.deepestChildIsEmpty(splitRoot))) {\n // toogle UL/OL and escape\n this.bullet.toggleList(splitRoot.parentNode.nodeName);\n return;\n } else {\n let blockquote = null;\n if (this.options.blockquoteBreakingLevel === 1) {\n blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n } else if (this.options.blockquoteBreakingLevel === 2) {\n blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n }\n\n if (blockquote) {\n // We're inside a blockquote and options ask us to break it\n nextPara = $(dom.emptyPara)[0];\n // If the split is right before a <br>, remove it so that there's no \"empty line\"\n // after the split in the new blockquote created\n if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n $(rng.sc.nextSibling).remove();\n }\n const split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n if (split) {\n split.parentNode.insertBefore(nextPara, split);\n } else {\n dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n }\n } else {\n nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n\n // not a blockquote, just insert the paragraph\n let emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n\n $.each(emptyAnchors, (idx, anchor) => {\n dom.remove(anchor);\n });\n\n // replace empty heading, pre or custom-made styleTag with P tag\n if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n nextPara = dom.replace(nextPara, 'p');\n }\n }\n }\n // no paragraph: insert empty paragraph\n } else {\n const next = rng.sc.childNodes[rng.so];\n nextPara = $(dom.emptyPara)[0];\n if (next) {\n rng.sc.insertBefore(nextPara, next);\n } else {\n rng.sc.appendChild(nextPara);\n }\n }\n\n range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport lists from '../core/lists';\n\n/**\n * @class Create a virtual table to create what actions to do in change.\n * @param {object} startPoint Cell selected to apply change.\n * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where\n * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n * @param {object} domTable Dom element of table to make changes.\n */\nconst TableResultAction = function(startPoint, where, action, domTable) {\n const _startPoint = { 'colPos': 0, 'rowPos': 0 };\n const _virtualTable = [];\n const _actionCellList = [];\n\n /// ///////////////////////////////////////////\n // Private functions\n /// ///////////////////////////////////////////\n\n /**\n * Set the startPoint of action.\n */\n function setStartPoint() {\n if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n // Impossible to identify start Cell point\n return;\n }\n _startPoint.colPos = startPoint.cellIndex;\n if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n // Impossible to identify start Row point\n return;\n }\n _startPoint.rowPos = startPoint.parentElement.rowIndex;\n }\n\n /**\n * Define virtual table position info object.\n *\n * @param {int} rowIndex Index position in line of virtual table.\n * @param {int} cellIndex Index position in column of virtual table.\n * @param {object} baseRow Row affected by this position.\n * @param {object} baseCell Cell affected by this position.\n * @param {bool} isSpan Inform if it is an span cell/row.\n */\n function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n const objPosition = {\n 'baseRow': baseRow,\n 'baseCell': baseCell,\n 'isRowSpan': isRowSpan,\n 'isColSpan': isColSpan,\n 'isVirtual': isVirtualCell,\n };\n if (!_virtualTable[rowIndex]) {\n _virtualTable[rowIndex] = [];\n }\n _virtualTable[rowIndex][cellIndex] = objPosition;\n }\n\n /**\n * Create action cell object.\n *\n * @param {object} virtualTableCellObj Object of specific position on virtual table.\n * @param {enum} resultAction Action to be applied in that item.\n */\n function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n return {\n 'baseCell': virtualTableCellObj.baseCell,\n 'action': resultAction,\n 'virtualTable': {\n 'rowIndex': virtualRowPosition,\n 'cellIndex': virtualColPosition,\n },\n };\n }\n\n /**\n * Recover free index of row to append Cell.\n *\n * @param {int} rowIndex Index of row to find free space.\n * @param {int} cellIndex Index of cell to find free space in table.\n */\n function recoverCellIndex(rowIndex, cellIndex) {\n if (!_virtualTable[rowIndex]) {\n return cellIndex;\n }\n if (!_virtualTable[rowIndex][cellIndex]) {\n return cellIndex;\n }\n\n let newCellIndex = cellIndex;\n while (_virtualTable[rowIndex][newCellIndex]) {\n newCellIndex++;\n if (!_virtualTable[rowIndex][newCellIndex]) {\n return newCellIndex;\n }\n }\n }\n\n /**\n * Recover info about row and cell and add information to virtual table.\n *\n * @param {object} row Row to recover information.\n * @param {object} cell Cell to recover information.\n */\n function addCellInfoToVirtual(row, cell) {\n const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n const cellHasColspan = (cell.colSpan > 1);\n const cellHasRowspan = (cell.rowSpan > 1);\n const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n\n // Add span rows to virtual Table.\n const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n if (rowspanNumber > 1) {\n for (let rp = 1; rp < rowspanNumber; rp++) {\n const rowspanIndex = row.rowIndex + rp;\n adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n }\n }\n\n // Add span cols to virtual table.\n const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n if (colspanNumber > 1) {\n for (let cp = 1; cp < colspanNumber; cp++) {\n const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n }\n }\n }\n\n /**\n * Process validation and adjust of start point if needed\n *\n * @param {int} rowIndex\n * @param {int} cellIndex\n * @param {object} cell\n * @param {bool} isSelectedCell\n */\n function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n _startPoint.colPos++;\n }\n }\n\n /**\n * Create virtual table of cells with all cells, including span cells.\n */\n function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getDeleteResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n case TableResultAction.where.Row:\n if (!cell.isVirtual && cell.isRowSpan) {\n return TableResultAction.resultAction.AddCell;\n } else if (cell.isRowSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n }\n return TableResultAction.resultAction.RemoveCell;\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getAddResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isRowSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n case TableResultAction.where.Row:\n if (cell.isRowSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isColSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n }\n return TableResultAction.resultAction.AddCell;\n }\n\n function init() {\n setStartPoint();\n createVirtualTable();\n }\n\n /// ///////////////////////////////////////////\n // Public functions\n /// ///////////////////////////////////////////\n\n /**\n * Recover array os what to do in table.\n */\n this.getActionList = function() {\n const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n\n let actualPosition = 0;\n let canContinue = true;\n while (canContinue) {\n const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n const row = _virtualTable[rowPosition];\n if (!row) {\n canContinue = false;\n return _actionCellList;\n }\n const cell = row[colPosition];\n if (!cell) {\n canContinue = false;\n return _actionCellList;\n }\n\n // Define action to be applied in this cell\n let resultAction = TableResultAction.resultAction.Ignore;\n switch (action) {\n case TableResultAction.requestAction.Add:\n resultAction = getAddResultActionToCell(cell);\n break;\n case TableResultAction.requestAction.Delete:\n resultAction = getDeleteResultActionToCell(cell);\n break;\n }\n _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n actualPosition++;\n }\n\n return _actionCellList;\n };\n\n init();\n};\n/**\n*\n* Where action occours enum.\n*/\nTableResultAction.where = { 'Row': 0, 'Column': 1 };\n/**\n*\n* Requested action to apply enum.\n*/\nTableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n/**\n*\n* Result action to be executed enum.\n*/\nTableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n\n/**\n *\n * @class editing.Table\n *\n * Table\n *\n */\nexport default class Table {\n /**\n * handle tab key\n *\n * @param {WrappedRange} rng\n * @param {Boolean} isShift\n */\n tab(rng, isShift) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const table = dom.ancestor(cell, dom.isTable);\n const cells = dom.listDescendant(table, dom.isCell);\n\n const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n if (nextCell) {\n range.create(nextCell, 0).select();\n }\n }\n\n /**\n * Add a new row\n *\n * @param {WrappedRange} rng\n * @param {String} position (top/bottom)\n * @return {Node}\n */\n addRow(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n\n const currentTr = $(cell).closest('tr');\n const trAttributes = this.recoverAttributes(currentTr);\n const html = $('<tr' + trAttributes + '></tr>');\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let idCell = 0; idCell < actions.length; idCell++) {\n const currentCell = actions[idCell];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n break;\n case TableResultAction.resultAction.SumSpanCount:\n {\n if (position === 'top') {\n const baseCellTr = currentCell.baseCell.parent;\n const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n if (isTopFromRowSpan) {\n const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n html.append(newTd);\n break;\n }\n }\n let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n rowspanNumber++;\n currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n }\n break;\n }\n }\n\n if (position === 'top') {\n currentTr.before(html);\n } else {\n const cellHasRowspan = (cell.rowSpan > 1);\n if (cellHasRowspan) {\n const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n $($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));\n return;\n }\n currentTr.after(html);\n }\n }\n\n /**\n * Add a new col\n *\n * @param {WrappedRange} rng\n * @param {String} position (left/right)\n * @return {Node}\n */\n addCol(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const rowsGroup = $(row).siblings();\n rowsGroup.push(row);\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Add, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n const currentCell = actions[actionIndex];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n if (position === 'right') {\n $(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n case TableResultAction.resultAction.SumSpanCount:\n if (position === 'right') {\n let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n colspanNumber++;\n currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n }\n }\n }\n\n /*\n * Copy attributes from element.\n *\n * @param {object} Element to recover attributes.\n * @return {string} Copied string elements.\n */\n recoverAttributes(el) {\n let resultStr = '';\n\n if (!el) {\n return resultStr;\n }\n\n const attrList = el.attributes || [];\n\n for (let i = 0; i < attrList.length; i++) {\n if (attrList[i].name.toLowerCase() === 'id') {\n continue;\n }\n\n if (attrList[i].specified) {\n resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n }\n }\n\n return resultStr;\n }\n\n /**\n * Delete current row\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteRow(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n const rowPos = row[0].rowIndex;\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n\n const baseCell = actions[actionIndex].baseCell;\n const virtualPosition = actions[actionIndex].virtualTable;\n const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.AddCell:\n {\n const nextRow = row.next('tr')[0];\n if (!nextRow) { continue; }\n const cloneRow = row[0].cells[cellPos];\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n nextRow.cells[cellPos].innerHTML = '';\n } else if (rowspanNumber === 2) {\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].removeAttribute('rowSpan');\n nextRow.cells[cellPos].innerHTML = '';\n }\n }\n }\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n baseCell.setAttribute('rowSpan', rowspanNumber);\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (rowspanNumber === 2) {\n baseCell.removeAttribute('rowSpan');\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n // Do not need remove cell because row will be deleted.\n continue;\n }\n }\n row.remove();\n }\n\n /**\n * Delete current col\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteCol(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n {\n const baseCell = actions[actionIndex].baseCell;\n const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n if (hasColspan) {\n let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n if (colspanNumber > 2) {\n colspanNumber--;\n baseCell.setAttribute('colSpan', colspanNumber);\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (colspanNumber === 2) {\n baseCell.removeAttribute('colSpan');\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n dom.remove(actions[actionIndex].baseCell, true);\n continue;\n }\n }\n }\n\n /**\n * create empty table element\n *\n * @param {Number} rowCount\n * @param {Number} colCount\n * @return {Node}\n */\n createTable(colCount, rowCount, options) {\n const tds = [];\n let tdHTML;\n for (let idxCol = 0; idxCol < colCount; idxCol++) {\n tds.push('<td>' + dom.blank + '</td>');\n }\n tdHTML = tds.join('');\n\n const trs = [];\n let trHTML;\n for (let idxRow = 0; idxRow < rowCount; idxRow++) {\n trs.push('<tr>' + tdHTML + '</tr>');\n }\n trHTML = trs.join('');\n const $table = $('<table>' + trHTML + '</table>');\n if (options && options.tableClassName) {\n $table.addClass(options.tableClassName);\n }\n\n return $table[0];\n }\n\n /**\n * Delete current table\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteTable(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n $(cell).closest('table').remove();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport { readFileAsDataURL, createImage } from '../core/async';\nimport History from '../editing/History';\nimport Style from '../editing/Style';\nimport Typing from '../editing/Typing';\nimport Table from '../editing/Table';\nimport Bullet from '../editing/Bullet';\n\nconst KEY_BOGUS = 'bogus';\n\n/**\n * @class Editor\n */\nexport default class Editor {\n constructor(context) {\n this.context = context;\n\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.editable = this.$editable[0];\n this.lastRange = null;\n this.snapshot = null;\n\n this.style = new Style();\n this.table = new Table();\n this.typing = new Typing(context);\n this.bullet = new Bullet();\n this.history = new History(context);\n\n this.context.memo('help.undo', this.lang.help.undo);\n this.context.memo('help.redo', this.lang.help.redo);\n this.context.memo('help.tab', this.lang.help.tab);\n this.context.memo('help.untab', this.lang.help.untab);\n this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n this.context.memo('help.indent', this.lang.help.indent);\n this.context.memo('help.outdent', this.lang.help.outdent);\n this.context.memo('help.formatPara', this.lang.help.formatPara);\n this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n this.context.memo('help.fontName', this.lang.help.fontName);\n\n // native commands(with execCommand), generate function for execCommand\n const commands = [\n 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n 'formatBlock', 'removeFormat', 'backColor',\n ];\n\n for (let idx = 0, len = commands.length; idx < len; idx++) {\n this[commands[idx]] = ((sCmd) => {\n return (value) => {\n this.beforeCommand();\n document.execCommand(sCmd, false, value);\n this.afterCommand(true);\n };\n })(commands[idx]);\n this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n }\n\n this.fontName = this.wrapCommand((value) => {\n return this.fontStyling('font-family', env.validFontName(value));\n });\n\n this.fontSize = this.wrapCommand((value) => {\n const unit = this.currentStyle()['font-size-unit'];\n return this.fontStyling('font-size', value + unit);\n });\n\n this.fontSizeUnit = this.wrapCommand((value) => {\n const size = this.currentStyle()['font-size'];\n return this.fontStyling('font-size', size + value);\n });\n\n for (let idx = 1; idx <= 6; idx++) {\n this['formatH' + idx] = ((idx) => {\n return () => {\n this.formatBlock('H' + idx);\n };\n })(idx);\n this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n }\n\n this.insertParagraph = this.wrapCommand(() => {\n this.typing.insertParagraph(this.editable);\n });\n\n this.insertOrderedList = this.wrapCommand(() => {\n this.bullet.insertOrderedList(this.editable);\n });\n\n this.insertUnorderedList = this.wrapCommand(() => {\n this.bullet.insertUnorderedList(this.editable);\n });\n\n this.indent = this.wrapCommand(() => {\n this.bullet.indent(this.editable);\n });\n\n this.outdent = this.wrapCommand(() => {\n this.bullet.outdent(this.editable);\n });\n\n /**\n * insertNode\n * insert node\n * @param {Node} node\n */\n this.insertNode = this.wrapCommand((node) => {\n if (this.isLimited($(node).text().length)) {\n return;\n }\n const rng = this.getLastRange();\n rng.insertNode(node);\n this.setLastRange(range.createFromNodeAfter(node).select());\n });\n\n /**\n * insert text\n * @param {String} text\n */\n this.insertText = this.wrapCommand((text) => {\n if (this.isLimited(text.length)) {\n return;\n }\n const rng = this.getLastRange();\n const textNode = rng.insertNode(dom.createText(text));\n this.setLastRange(range.create(textNode, dom.nodeLength(textNode)).select());\n });\n\n /**\n * paste HTML\n * @param {String} markup\n */\n this.pasteHTML = this.wrapCommand((markup) => {\n if (this.isLimited(markup.length)) {\n return;\n }\n markup = this.context.invoke('codeview.purify', markup);\n const contents = this.getLastRange().pasteHTML(markup);\n this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select());\n });\n\n /**\n * formatBlock\n *\n * @param {String} tagName\n */\n this.formatBlock = this.wrapCommand((tagName, $target) => {\n const onApplyCustomStyle = this.options.callbacks.onApplyCustomStyle;\n if (onApplyCustomStyle) {\n onApplyCustomStyle.call(this, $target, this.context, this.onFormatBlock);\n } else {\n this.onFormatBlock(tagName, $target);\n }\n });\n\n /**\n * insert horizontal rule\n */\n this.insertHorizontalRule = this.wrapCommand(() => {\n const hrNode = this.getLastRange().insertNode(dom.create('HR'));\n if (hrNode.nextSibling) {\n this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());\n }\n });\n\n /**\n * lineHeight\n * @param {String} value\n */\n this.lineHeight = this.wrapCommand((value) => {\n this.style.stylePara(this.getLastRange(), {\n lineHeight: value,\n });\n });\n\n /**\n * create link (command)\n *\n * @param {Object} linkInfo\n */\n this.createLink = this.wrapCommand((linkInfo) => {\n let linkUrl = linkInfo.url;\n const linkText = linkInfo.text;\n const isNewWindow = linkInfo.isNewWindow;\n const checkProtocol = linkInfo.checkProtocol;\n let rng = linkInfo.range || this.getLastRange();\n const additionalTextLength = linkText.length - rng.toString().length;\n if (additionalTextLength > 0 && this.isLimited(additionalTextLength)) {\n return;\n }\n const isTextChanged = rng.toString() !== linkText;\n\n // handle spaced urls from input\n if (typeof linkUrl === 'string') {\n linkUrl = linkUrl.trim();\n }\n\n if (this.options.onCreateLink) {\n linkUrl = this.options.onCreateLink(linkUrl);\n } else if (checkProtocol) {\n // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n ? linkUrl : this.options.defaultProtocol + linkUrl;\n }\n\n let anchors = [];\n if (isTextChanged) {\n rng = rng.deleteContents();\n const anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);\n anchors.push(anchor);\n } else {\n anchors = this.style.styleNodes(rng, {\n nodeName: 'A',\n expandClosestSibling: true,\n onlyPartialContains: true,\n });\n }\n\n $.each(anchors, (idx, anchor) => {\n $(anchor).attr('href', linkUrl);\n if (isNewWindow) {\n $(anchor).attr('target', '_blank');\n } else {\n $(anchor).removeAttr('target');\n }\n });\n\n const startRange = range.createFromNodeBefore(lists.head(anchors));\n const startPoint = startRange.getStartPoint();\n const endRange = range.createFromNodeAfter(lists.last(anchors));\n const endPoint = endRange.getEndPoint();\n\n this.setLastRange(\n range.create(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n ).select()\n );\n });\n\n /**\n * setting color\n *\n * @param {Object} sObjColor color code\n * @param {String} sObjColor.foreColor foreground color\n * @param {String} sObjColor.backColor background color\n */\n this.color = this.wrapCommand((colorInfo) => {\n const foreColor = colorInfo.foreColor;\n const backColor = colorInfo.backColor;\n\n if (foreColor) { document.execCommand('foreColor', false, foreColor); }\n if (backColor) { document.execCommand('backColor', false, backColor); }\n });\n\n /**\n * Set foreground color\n *\n * @param {String} colorCode foreground color code\n */\n this.foreColor = this.wrapCommand((colorInfo) => {\n document.execCommand('foreColor', false, colorInfo);\n });\n\n /**\n * insert Table\n *\n * @param {String} dimension of table (ex : \"5x5\")\n */\n this.insertTable = this.wrapCommand((dim) => {\n const dimension = dim.split('x');\n\n const rng = this.getLastRange().deleteContents();\n rng.insertNode(this.table.createTable(dimension[0], dimension[1], this.options));\n });\n\n /**\n * remove media object and Figure Elements if media object is img with Figure.\n */\n this.removeMedia = this.wrapCommand(() => {\n let $target = $(this.restoreTarget()).parent();\n if ($target.closest('figure').length) {\n $target.closest('figure').remove();\n } else {\n $target = $(this.restoreTarget()).detach();\n }\n this.context.triggerEvent('media.delete', $target, this.$editable);\n });\n\n /**\n * float me\n *\n * @param {String} value\n */\n this.floatMe = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n $target.toggleClass('note-float-left', value === 'left');\n $target.toggleClass('note-float-right', value === 'right');\n $target.css('float', (value === 'none' ? '' : value));\n });\n\n /**\n * resize overlay element\n * @param {String} value\n */\n this.resize = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n value = parseFloat(value);\n if (value === 0) {\n $target.css('width', '');\n } else {\n $target.css({\n width: value * 100 + '%',\n height: '',\n });\n }\n });\n }\n\n initialize() {\n // bind custom events\n this.$editable.on('keydown', (event) => {\n if (event.keyCode === key.code.ENTER) {\n this.context.triggerEvent('enter', event);\n }\n this.context.triggerEvent('keydown', event);\n\n // keep a snapshot to limit text on input event\n this.snapshot = this.history.makeSnapshot();\n this.hasKeyShortCut = false;\n if (!event.isDefaultPrevented()) {\n if (this.options.shortcuts) {\n this.hasKeyShortCut = this.handleKeyMap(event);\n } else {\n this.preventDefaultEditableShortCuts(event);\n }\n }\n if (this.isLimited(1, event)) {\n const lastRange = this.getLastRange();\n if (lastRange.eo - lastRange.so === 0) {\n return false;\n }\n }\n this.setLastRange();\n\n // record undo in the key event except keyMap.\n if (this.options.recordEveryKeystroke) {\n if (this.hasKeyShortCut === false) {\n this.history.recordUndo();\n }\n }\n }).on('keyup', (event) => {\n this.setLastRange();\n this.context.triggerEvent('keyup', event);\n }).on('focus', (event) => {\n this.setLastRange();\n this.context.triggerEvent('focus', event);\n }).on('blur', (event) => {\n this.context.triggerEvent('blur', event);\n }).on('mousedown', (event) => {\n this.context.triggerEvent('mousedown', event);\n }).on('mouseup', (event) => {\n this.setLastRange();\n this.history.recordUndo();\n this.context.triggerEvent('mouseup', event);\n }).on('scroll', (event) => {\n this.context.triggerEvent('scroll', event);\n }).on('paste', (event) => {\n this.setLastRange();\n this.context.triggerEvent('paste', event);\n }).on('input', () => {\n // To limit composition characters (e.g. Korean)\n if (this.isLimited(0) && this.snapshot) {\n this.history.applySnapshot(this.snapshot);\n }\n });\n\n this.$editable.attr('spellcheck', this.options.spellCheck);\n\n this.$editable.attr('autocorrect', this.options.spellCheck);\n\n if (this.options.disableGrammar) {\n this.$editable.attr('data-gramm', false);\n }\n\n // init content before set event\n this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n\n this.$editable.on(env.inputEventName, func.debounce(() => {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }, 10));\n\n this.$editable.on('focusin', (event) => {\n this.context.triggerEvent('focusin', event);\n }).on('focusout', (event) => {\n this.context.triggerEvent('focusout', event);\n });\n\n if (this.options.airMode) {\n if (this.options.overrideContextMenu) {\n this.$editor.on('contextmenu', (event) => {\n this.context.triggerEvent('contextmenu', event);\n return false;\n });\n }\n } else {\n if (this.options.width) {\n this.$editor.outerWidth(this.options.width);\n }\n if (this.options.height) {\n this.$editable.outerHeight(this.options.height);\n }\n if (this.options.maxHeight) {\n this.$editable.css('max-height', this.options.maxHeight);\n }\n if (this.options.minHeight) {\n this.$editable.css('min-height', this.options.minHeight);\n }\n }\n\n this.history.recordUndo();\n this.setLastRange();\n }\n\n destroy() {\n this.$editable.off();\n }\n\n handleKeyMap(event) {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n const keys = [];\n\n if (event.metaKey) { keys.push('CMD'); }\n if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }\n if (event.shiftKey) { keys.push('SHIFT'); }\n\n const keyName = key.nameFromCode[event.keyCode];\n if (keyName) {\n keys.push(keyName);\n }\n\n const eventName = keyMap[keys.join('+')];\n\n if (keyName === 'TAB' && !this.options.tabDisable) {\n this.afterCommand();\n } else if (eventName) {\n if (this.context.invoke(eventName) !== false) {\n event.preventDefault();\n // if keyMap action was invoked\n return true;\n }\n } else if (key.isEdit(event.keyCode)) {\n this.afterCommand();\n }\n return false;\n }\n\n preventDefaultEditableShortCuts(event) {\n // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n if ((event.ctrlKey || event.metaKey) &&\n lists.contains([66, 73, 85], event.keyCode)) {\n event.preventDefault();\n }\n }\n\n isLimited(pad, event) {\n pad = pad || 0;\n\n if (typeof event !== 'undefined') {\n if (key.isMove(event.keyCode) ||\n key.isNavigation(event.keyCode) ||\n (event.ctrlKey || event.metaKey) ||\n lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n return false;\n }\n }\n\n if (this.options.maxTextLength > 0) {\n if ((this.$editable.text().length + pad) > this.options.maxTextLength) {\n return true;\n }\n }\n return false;\n }\n /**\n * create range\n * @return {WrappedRange}\n */\n createRange() {\n this.focus();\n this.setLastRange();\n return this.getLastRange();\n }\n\n setLastRange(rng) {\n if (rng) {\n this.lastRange = rng;\n } else {\n this.lastRange = range.create(this.editable);\n\n if ($(this.lastRange.sc).closest('.note-editable').length === 0) {\n this.lastRange = range.createFromBodyElement(this.editable);\n }\n }\n }\n\n getLastRange() {\n if (!this.lastRange) {\n this.setLastRange();\n }\n return this.lastRange;\n }\n\n /**\n * saveRange\n *\n * save current range\n *\n * @param {Boolean} [thenCollapse=false]\n */\n saveRange(thenCollapse) {\n if (thenCollapse) {\n this.getLastRange().collapse().select();\n }\n }\n\n /**\n * restoreRange\n *\n * restore lately range\n */\n restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }\n\n saveTarget(node) {\n this.$editable.data('target', node);\n }\n\n clearTarget() {\n this.$editable.removeData('target');\n }\n\n restoreTarget() {\n return this.$editable.data('target');\n }\n\n /**\n * currentStyle\n *\n * current style\n * @return {Object|Boolean} unfocus\n */\n currentStyle() {\n let rng = range.create();\n if (rng) {\n rng = rng.normalize();\n }\n return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n }\n\n /**\n * style from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n styleFromNode($node) {\n return this.style.fromNode($node);\n }\n\n /**\n * undo\n */\n undo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.undo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /*\n * commit\n */\n commit() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.commit();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * redo\n */\n redo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.redo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * before command\n */\n beforeCommand() {\n this.context.triggerEvent('before.command', this.$editable.html());\n\n // Set styleWithCSS before run a command\n document.execCommand('styleWithCSS', false, this.options.styleWithCSS);\n\n // keep focus on editable before command execution\n this.focus();\n }\n\n /**\n * after command\n * @param {Boolean} isPreventTrigger\n */\n afterCommand(isPreventTrigger) {\n this.normalizeContent();\n this.history.recordUndo();\n if (!isPreventTrigger) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n }\n\n /**\n * handle tab key\n */\n tab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n\n if (!this.isLimited(this.options.tabSize)) {\n this.beforeCommand();\n this.typing.insertTab(rng, this.options.tabSize);\n this.afterCommand();\n }\n }\n }\n\n /**\n * handle shift+tab key\n */\n untab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng, true);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n }\n }\n\n /**\n * run given function between beforeCommand and afterCommand\n */\n wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }\n\n /**\n * insert image\n *\n * @param {String} src\n * @param {String|Function} param\n * @return {Promise}\n */\n insertImage(src, param) {\n return createImage(src, param).then(($image) => {\n this.beforeCommand();\n\n if (typeof param === 'function') {\n param($image);\n } else {\n if (typeof param === 'string') {\n $image.attr('data-filename', param);\n }\n $image.css('width', Math.min(this.$editable.width(), $image.width()));\n }\n\n $image.show();\n this.getLastRange().insertNode($image[0]);\n this.setLastRange(range.createFromNodeAfter($image[0]).select());\n this.afterCommand();\n }).fail((e) => {\n this.context.triggerEvent('image.upload.error', e);\n });\n }\n\n /**\n * insertImages\n * @param {File[]} files\n */\n insertImagesAsDataURL(files) {\n $.each(files, (idx, file) => {\n const filename = file.name;\n if (this.options.maximumImageFileSize && this.options.maximumImageFileSize < file.size) {\n this.context.triggerEvent('image.upload.error', this.lang.image.maximumFileSizeError);\n } else {\n readFileAsDataURL(file).then((dataURL) => {\n return this.insertImage(dataURL, filename);\n }).fail(() => {\n this.context.triggerEvent('image.upload.error');\n });\n }\n });\n }\n\n /**\n * insertImagesOrCallback\n * @param {File[]} files\n */\n insertImagesOrCallback(files) {\n const callbacks = this.options.callbacks;\n // If onImageUpload set,\n if (callbacks.onImageUpload) {\n this.context.triggerEvent('image.upload', files);\n // else insert Image as dataURL\n } else {\n this.insertImagesAsDataURL(files);\n }\n }\n\n /**\n * return selected plain text\n * @return {String} text\n */\n getSelectedText() {\n let rng = this.getLastRange();\n\n // if range on anchor, expand range with anchor\n if (rng.isOnAnchor()) {\n rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n }\n\n return rng.toString();\n }\n\n onFormatBlock(tagName, $target) {\n // [workaround] for MSIE, IE need `<`\n document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n\n // support custom class\n if ($target && $target.length) {\n // find the exact element has given tagName\n if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n $target = $target.find(tagName);\n }\n\n if ($target && $target.length) {\n const className = $target[0].className || '';\n if (className) {\n const currentRange = this.createRange();\n\n const $parent = $([currentRange.sc, currentRange.ec]).closest(tagName);\n $parent.addClass(className);\n }\n }\n }\n }\n\n formatPara() {\n this.formatBlock('P');\n }\n\n fontStyling(target, value) {\n const rng = this.getLastRange();\n\n if (rng !== '') {\n const spans = this.style.styleNodes(rng);\n this.$editor.find('.note-status-output').html('');\n $(spans).css(target, value);\n\n // [workaround] added styled bogus span for style\n // - also bogus character needed for cursor position\n if (rng.isCollapsed()) {\n const firstSpan = lists.head(spans);\n if (firstSpan && !dom.nodeLength(firstSpan)) {\n firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n range.createFromNodeAfter(firstSpan.firstChild).select();\n this.setLastRange();\n this.$editable.data(KEY_BOGUS, firstSpan);\n }\n }\n } else {\n const noteStatusOutput = $.now();\n this.$editor.find('.note-status-output').html('<div id=\"note-status-output-' + noteStatusOutput + '\" class=\"alert alert-info\">' + this.lang.output.noSelection + '</div>');\n setTimeout(function() { $('#note-status-output-' + noteStatusOutput).remove(); }, 5000);\n }\n }\n\n /**\n * unlink\n *\n * @type command\n */\n unlink() {\n let rng = this.getLastRange();\n if (rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n rng = range.createFromNode(anchor);\n rng.select();\n this.setLastRange();\n\n this.beforeCommand();\n document.execCommand('unlink');\n this.afterCommand();\n }\n }\n\n /**\n * returns link info\n *\n * @return {Object}\n * @return {WrappedRange} return.range\n * @return {String} return.text\n * @return {Boolean} [return.isNewWindow=true]\n * @return {String} [return.url=\"\"]\n */\n getLinkInfo() {\n const rng = this.getLastRange().expand(dom.isAnchor);\n // Get the first anchor on range(for edit).\n const $anchor = $(lists.head(rng.nodes(dom.isAnchor)));\n const linkInfo = {\n range: rng,\n text: rng.toString(),\n url: $anchor.length ? $anchor.attr('href') : '',\n };\n\n // When anchor exists,\n if ($anchor.length) {\n // Set isNewWindow by checking its target.\n linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n }\n\n return linkInfo;\n }\n\n addRow(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addRow(rng, position);\n this.afterCommand();\n }\n }\n\n addCol(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addCol(rng, position);\n this.afterCommand();\n }\n }\n\n deleteRow() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteRow(rng);\n this.afterCommand();\n }\n }\n\n deleteCol() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteCol(rng);\n this.afterCommand();\n }\n }\n\n deleteTable() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteTable(rng);\n this.afterCommand();\n }\n }\n\n /**\n * @param {Position} pos\n * @param {jQuery} $target - target element\n * @param {Boolean} [bKeepRatio] - keep ratio\n */\n resizeTo(pos, $target, bKeepRatio) {\n let imageSize;\n if (bKeepRatio) {\n const newRatio = pos.y / pos.x;\n const ratio = $target.data('ratio');\n imageSize = {\n width: ratio > newRatio ? pos.x : pos.y / ratio,\n height: ratio > newRatio ? pos.x * ratio : pos.y,\n };\n } else {\n imageSize = {\n width: pos.x,\n height: pos.y,\n };\n }\n\n $target.css(imageSize);\n }\n\n /**\n * returns whether editable area has focus or not.\n */\n hasFocus() {\n return this.$editable.is(':focus');\n }\n\n /**\n * set focus\n */\n focus() {\n // [workaround] Screen will move when page is scolled in IE.\n // - do focus when not focused\n if (!this.hasFocus()) {\n this.$editable.focus();\n }\n }\n\n /**\n * returns whether contents is empty or not.\n * @return {Boolean}\n */\n isEmpty() {\n return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n }\n\n /**\n * Removes all contents and restores the editable instance to an _emptyPara_.\n */\n empty() {\n this.context.invoke('code', dom.emptyPara);\n }\n\n /**\n * normalize content\n */\n normalizeContent() {\n this.$editable[0].normalize();\n }\n}\n","import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n this.$editable.on('paste', this.pasteByEvent.bind(this));\n }\n\n /**\n * paste by clipboard event\n *\n * @param {Event} event\n */\n pasteByEvent(event) {\n const clipboardData = event.originalEvent.clipboardData;\n\n if (clipboardData && clipboardData.items && clipboardData.items.length) {\n const item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n // paste img file\n this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n event.preventDefault();\n } else if (item.kind === 'string') {\n // paste text with maxTextLength check\n if (this.context.invoke('editor.isLimited', clipboardData.getData('Text').length)) {\n event.preventDefault();\n }\n }\n } else if (window.clipboardData) {\n // for IE\n let text = window.clipboardData.getData('text');\n if (this.context.invoke('editor.isLimited', text.length)) {\n event.preventDefault();\n }\n }\n // Call editor.afterCommand after proceeding default event handler\n setTimeout(() => {\n this.context.invoke('editor.afterCommand');\n }, 10);\n }\n}\n","import $ from 'jquery';\n\nexport default class Dropzone {\n constructor(context) {\n this.context = context;\n this.$eventListener = $(document);\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.documentEventHandlers = {};\n\n this.$dropzone = $([\n '<div class=\"note-dropzone\">',\n '<div class=\"note-dropzone-message\"/>',\n '</div>',\n ].join('')).prependTo(this.$editor);\n }\n\n /**\n * attach Drag and Drop Events\n */\n initialize() {\n if (this.options.disableDragAndDrop) {\n // prevent default drop event\n this.documentEventHandlers.onDrop = (e) => {\n e.preventDefault();\n };\n // do not consider outside of dropzone\n this.$eventListener = this.$dropzone;\n this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n } else {\n this.attachDragAndDropEvent();\n }\n }\n\n /**\n * attach Drag and Drop Events\n */\n attachDragAndDropEvent() {\n let collection = $();\n const $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n\n this.documentEventHandlers.onDragenter = (e) => {\n const isCodeview = this.context.invoke('codeview.isActivated');\n const hasEditorSize = this.$editor.width() > 0 && this.$editor.height() > 0;\n if (!isCodeview && !collection.length && hasEditorSize) {\n this.$editor.addClass('dragover');\n this.$dropzone.width(this.$editor.width());\n this.$dropzone.height(this.$editor.height());\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n }\n collection = collection.add(e.target);\n };\n\n this.documentEventHandlers.onDragleave = (e) => {\n collection = collection.not(e.target);\n\n // If nodeName is BODY, then just make it over (fix for IE)\n if (!collection.length || e.target.nodeName === 'BODY') {\n collection = $();\n this.$editor.removeClass('dragover');\n }\n };\n\n this.documentEventHandlers.onDrop = () => {\n collection = $();\n this.$editor.removeClass('dragover');\n };\n\n // show dropzone on dragenter when dragging a object to document\n // -but only if the editor is visible, i.e. has a positive width and height\n this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n .on('dragleave', this.documentEventHandlers.onDragleave)\n .on('drop', this.documentEventHandlers.onDrop);\n\n // change dropzone's message on hover.\n this.$dropzone.on('dragenter', () => {\n this.$dropzone.addClass('hover');\n $dropzoneMessage.text(this.lang.image.dropImage);\n }).on('dragleave', () => {\n this.$dropzone.removeClass('hover');\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n });\n\n // attach dropImage\n this.$dropzone.on('drop', (event) => {\n const dataTransfer = event.originalEvent.dataTransfer;\n\n // stop the browser from opening the dropped content\n event.preventDefault();\n\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n this.$editable.focus();\n this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n } else {\n $.each(dataTransfer.types, (idx, type) => {\n // skip moz-specific types\n if (type.toLowerCase().indexOf('_moz_') > -1) {\n return;\n }\n const content = dataTransfer.getData(type);\n\n if (type.toLowerCase().indexOf('text') > -1) {\n this.context.invoke('editor.pasteHTML', content);\n } else {\n $(content).each((idx, item) => {\n this.context.invoke('editor.insertNode', item);\n });\n }\n });\n }\n }).on('dragover', false); // prevent default dragover event\n }\n\n destroy() {\n Object.keys(this.documentEventHandlers).forEach((key) => {\n this.$eventListener.off(key.substr(2).toLowerCase(), this.documentEventHandlers[key]);\n });\n this.documentEventHandlers = {};\n }\n}\n","import env from '../core/env';\nimport dom from '../core/dom';\n\nlet CodeMirror;\nif (env.hasCodeMirror) {\n CodeMirror = window.CodeMirror;\n}\n\n/**\n * @class Codeview\n */\nexport default class CodeView {\n constructor(context) {\n this.context = context;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n this.options = context.options;\n }\n\n sync() {\n const isCodeview = this.isActivated();\n if (isCodeview && env.hasCodeMirror) {\n this.$codable.data('cmEditor').save();\n }\n }\n\n /**\n * @return {Boolean}\n */\n isActivated() {\n return this.$editor.hasClass('codeview');\n }\n\n /**\n * toggle codeview\n */\n toggle() {\n if (this.isActivated()) {\n this.deactivate();\n } else {\n this.activate();\n }\n this.context.triggerEvent('codeview.toggled');\n }\n\n /**\n * purify input value\n * @param value\n * @returns {*}\n */\n purify(value) {\n if (this.options.codeviewFilter) {\n // filter code view regex\n value = value.replace(this.options.codeviewFilterRegex, '');\n // allow specific iframe tag\n if (this.options.codeviewIframeFilter) {\n const whitelist = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function(tag) {\n // remove if src attribute is duplicated\n if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n return '';\n }\n for (const src of whitelist) {\n // pass if src is trusted\n if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n return tag;\n }\n }\n return '';\n });\n }\n }\n return value;\n }\n\n /**\n * activate code view\n */\n activate() {\n this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n this.$codable.height(this.$editable.height());\n\n this.context.invoke('toolbar.updateCodeview', true);\n this.$editor.addClass('codeview');\n this.$codable.focus();\n\n // activate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n\n // CodeMirror TernServer\n if (this.options.codemirror.tern) {\n const server = new CodeMirror.TernServer(this.options.codemirror.tern);\n cmEditor.ternServer = server;\n cmEditor.on('cursorActivity', (cm) => {\n server.updateArgHints(cm);\n });\n }\n\n cmEditor.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', cmEditor.getValue(), event);\n });\n cmEditor.on('change', () => {\n this.context.triggerEvent('change.codeview', cmEditor.getValue(), cmEditor);\n });\n\n // CodeMirror hasn't Padding.\n cmEditor.setSize(null, this.$editable.outerHeight());\n this.$codable.data('cmEditor', cmEditor);\n } else {\n this.$codable.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', this.$codable.val(), event);\n });\n this.$codable.on('input', () => {\n this.context.triggerEvent('change.codeview', this.$codable.val(), this.$codable);\n });\n }\n }\n\n /**\n * deactivate code view\n */\n deactivate() {\n // deactivate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = this.$codable.data('cmEditor');\n this.$codable.val(cmEditor.getValue());\n cmEditor.toTextArea();\n }\n\n const value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n const isChange = this.$editable.html() !== value;\n\n this.$editable.html(value);\n this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n this.$editor.removeClass('codeview');\n\n if (isChange) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n this.$editable.focus();\n\n this.context.invoke('toolbar.updateCodeview', false);\n }\n\n destroy() {\n if (this.isActivated()) {\n this.deactivate();\n }\n }\n}\n","import $ from 'jquery';\nconst EDITABLE_PADDING = 24;\n\nexport default class Statusbar {\n constructor(context) {\n this.$document = $(document);\n this.$statusbar = context.layoutInfo.statusbar;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n }\n\n initialize() {\n if (this.options.airMode || this.options.disableResizeEditor) {\n this.destroy();\n return;\n }\n\n this.$statusbar.on('mousedown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const editableTop = this.$editable.offset().top - this.$document.scrollTop();\n const onMouseMove = (event) => {\n let height = event.clientY - (editableTop + EDITABLE_PADDING);\n\n height = (this.options.minheight > 0) ? Math.max(height, this.options.minheight) : height;\n height = (this.options.maxHeight > 0) ? Math.min(height, this.options.maxHeight) : height;\n\n this.$editable.height(height);\n };\n\n this.$document.on('mousemove', onMouseMove).one('mouseup', () => {\n this.$document.off('mousemove', onMouseMove);\n });\n });\n }\n\n destroy() {\n this.$statusbar.off();\n this.$statusbar.addClass('locked');\n }\n}\n","import $ from 'jquery';\n\nexport default class Fullscreen {\n constructor(context) {\n this.context = context;\n\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n\n this.$window = $(window);\n this.$scrollbar = $('html, body');\n\n this.onResize = () => {\n this.resizeTo({\n h: this.$window.height() - this.$toolbar.outerHeight(),\n });\n };\n }\n\n resizeTo(size) {\n this.$editable.css('height', size.h);\n this.$codable.css('height', size.h);\n if (this.$codable.data('cmeditor')) {\n this.$codable.data('cmeditor').setsize(null, size.h);\n }\n }\n\n /**\n * toggle fullscreen\n */\n toggle() {\n this.$editor.toggleClass('fullscreen');\n if (this.isFullscreen()) {\n this.$editable.data('orgHeight', this.$editable.css('height'));\n this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n this.$editable.css('maxHeight', '');\n this.$window.on('resize', this.onResize).trigger('resize');\n this.$scrollbar.css('overflow', 'hidden');\n } else {\n this.$window.off('resize', this.onResize);\n this.resizeTo({ h: this.$editable.data('orgHeight') });\n this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n this.$scrollbar.css('overflow', 'visible');\n }\n\n this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n }\n\n isFullscreen() {\n return this.$editor.hasClass('fullscreen');\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\n\nexport default class Handle {\n constructor(context) {\n this.context = context;\n this.$document = $(document);\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.events = {\n 'summernote.mousedown': (we, e) => {\n if (this.update(e.target, e)) {\n e.preventDefault();\n }\n },\n 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n initialize() {\n this.$handle = $([\n '<div class=\"note-handle\">',\n '<div class=\"note-control-selection\">',\n '<div class=\"note-control-selection-bg\"></div>',\n '<div class=\"note-control-holder note-control-nw\"></div>',\n '<div class=\"note-control-holder note-control-ne\"></div>',\n '<div class=\"note-control-holder note-control-sw\"></div>',\n '<div class=\"',\n (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n ' note-control-se\"></div>',\n (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n '</div>',\n '</div>',\n ].join('')).prependTo(this.$editingArea);\n\n this.$handle.on('mousedown', (event) => {\n if (dom.isControlSizing(event.target)) {\n event.preventDefault();\n event.stopPropagation();\n\n const $target = this.$handle.find('.note-control-selection').data('target');\n const posStart = $target.offset();\n const scrollTop = this.$document.scrollTop();\n\n const onMouseMove = (event) => {\n this.context.invoke('editor.resizeTo', {\n x: event.clientX - posStart.left,\n y: event.clientY - (posStart.top - scrollTop),\n }, $target, !event.shiftKey);\n\n this.update($target[0], event);\n };\n\n this.$document\n .on('mousemove', onMouseMove)\n .one('mouseup', (e) => {\n e.preventDefault();\n this.$document.off('mousemove', onMouseMove);\n this.context.invoke('editor.afterCommand');\n });\n\n if (!$target.data('ratio')) { // original ratio.\n $target.data('ratio', $target.height() / $target.width());\n }\n }\n });\n\n // Listen for scrolling on the handle overlay.\n this.$handle.on('wheel', (e) => {\n e.preventDefault();\n this.update();\n });\n }\n\n destroy() {\n this.$handle.remove();\n }\n\n update(target, event) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isImage = dom.isImg(target);\n const $selection = this.$handle.find('.note-control-selection');\n\n this.context.invoke('imagePopover.update', target, event);\n\n if (isImage) {\n const $image = $(target);\n const position = $image.position();\n const pos = {\n left: position.left + parseInt($image.css('marginLeft'), 10),\n top: position.top + parseInt($image.css('marginTop'), 10),\n };\n\n // exclude margin\n const imageSize = {\n w: $image.outerWidth(false),\n h: $image.outerHeight(false),\n };\n\n $selection.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n width: imageSize.w,\n height: imageSize.h,\n }).data('target', $image); // save current image element.\n\n const origImageObj = new Image();\n origImageObj.src = $image.attr('src');\n\n const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n $selection.find('.note-control-selection-info').text(sizingText);\n this.context.invoke('editor.saveTarget', target);\n } else {\n this.hide();\n }\n\n return isImage;\n }\n\n /**\n * hide\n *\n * @param {jQuery} $handle\n */\n hide() {\n this.context.invoke('editor.clearTarget');\n this.$handle.children().hide();\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport key from '../core/key';\n\nconst defaultScheme = 'http://';\nconst linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n\nexport default class AutoLink {\n constructor(context) {\n this.context = context;\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n initialize() {\n this.lastWordRange = null;\n }\n\n destroy() {\n this.lastWordRange = null;\n }\n\n replace() {\n if (!this.lastWordRange) {\n return;\n }\n\n const keyword = this.lastWordRange.toString();\n const match = keyword.match(linkPattern);\n\n if (match && (match[1] || match[2])) {\n const link = match[1] ? keyword : defaultScheme + keyword;\n const urlText = keyword.replace(/^(?:https?:\\/\\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\\.)?/i, '').split('/')[0];\n const node = $('<a />').html(urlText).attr('href', link)[0];\n if (this.context.options.linkTargetBlank) {\n $(node).attr('target', '_blank');\n }\n\n this.lastWordRange.insertNode(node);\n this.lastWordRange = null;\n this.context.invoke('editor.focus');\n }\n }\n\n handleKeydown(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWordRange = wordRange;\n }\n }\n\n handleKeyup(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n this.replace();\n }\n }\n}\n","import dom from '../core/dom';\n\n/**\n * textarea auto sync.\n */\nexport default class AutoSync {\n constructor(context) {\n this.$note = context.layoutInfo.note;\n this.events = {\n 'summernote.change': () => {\n this.$note.val(context.invoke('code'));\n },\n };\n }\n\n shouldInitialize() {\n return dom.isTextarea(this.$note[0]);\n }\n}\n","import lists from '../core/lists';\nimport dom from '../core/dom';\nimport key from '../core/key';\n\nexport default class AutoReplace {\n constructor(context) {\n this.context = context;\n this.options = context.options.replace || {};\n\n this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n this.previousKeydownCode = null;\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.match;\n }\n\n initialize() {\n this.lastWord = null;\n }\n\n destroy() {\n this.lastWord = null;\n }\n\n replace() {\n if (!this.lastWord) {\n return;\n }\n\n const self = this;\n const keyword = this.lastWord.toString();\n this.options.match(keyword, function(match) {\n if (match) {\n let node = '';\n\n if (typeof match === 'string') {\n node = dom.createText(match);\n } else if (match instanceof jQuery) {\n node = match[0];\n } else if (match instanceof Node) {\n node = match;\n }\n\n if (!node) return;\n self.lastWord.insertNode(node);\n self.lastWord = null;\n self.context.invoke('editor.focus');\n }\n });\n }\n\n handleKeydown(e) {\n // this forces it to remember the last whole word, even if multiple termination keys are pressed\n // before the previous key is let go.\n if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n this.previousKeydownCode = e.keyCode;\n return;\n }\n\n if (lists.contains(this.keys, e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWord = wordRange;\n }\n this.previousKeydownCode = e.keyCode;\n }\n\n handleKeyup(e) {\n if (lists.contains(this.keys, e.keyCode)) {\n this.replace();\n }\n }\n}\n","import $ from 'jquery';\nexport default class Placeholder {\n constructor(context) {\n this.context = context;\n\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n\n if (this.options.inheritPlaceholder === true) {\n // get placeholder value from the original element\n this.options.placeholder = this.context.$note.attr('placeholder') || this.options.placeholder;\n }\n\n this.events = {\n 'summernote.init summernote.change': () => {\n this.update();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.placeholder;\n }\n\n initialize() {\n this.$placeholder = $('<div class=\"note-placeholder\">');\n this.$placeholder.on('click', () => {\n this.context.invoke('focus');\n }).html(this.options.placeholder).prependTo(this.$editingArea);\n\n this.update();\n }\n\n destroy() {\n this.$placeholder.remove();\n }\n\n update() {\n const isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n this.$placeholder.toggle(isShow);\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport env from '../core/env';\n\nexport default class Buttons {\n constructor(context) {\n this.ui = $.summernote.ui;\n this.context = context;\n this.$toolbar = context.layoutInfo.toolbar;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.invertedKeyMap = func.invertObject(\n this.options.keyMap[env.isMac ? 'mac' : 'pc']\n );\n }\n\n representShortcut(editorMethod) {\n let shortcut = this.invertedKeyMap[editorMethod];\n if (!this.options.shortcuts || !shortcut) {\n return '';\n }\n\n if (env.isMac) {\n shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n }\n\n shortcut = shortcut.replace('BACKSLASH', '\\\\')\n .replace('SLASH', '/')\n .replace('LEFTBRACKET', '[')\n .replace('RIGHTBRACKET', ']');\n\n return ' (' + shortcut + ')';\n }\n\n button(o) {\n if (!this.options.tooltip && o.tooltip) {\n delete o.tooltip;\n }\n o.container = this.options.container;\n return this.ui.button(o);\n }\n\n initialize() {\n this.addToolbarButtons();\n this.addImagePopoverButtons();\n this.addLinkPopoverButtons();\n this.addTablePopoverButtons();\n this.fontInstalledMap = {};\n }\n\n destroy() {\n delete this.fontInstalledMap;\n }\n\n isFontInstalled(name) {\n if (!Object.prototype.hasOwnProperty.call(this.fontInstalledMap, name)) {\n this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n lists.contains(this.options.fontNamesIgnoreCheck, name);\n }\n return this.fontInstalledMap[name];\n }\n\n isFontDeservedToAdd(name) {\n name = name.toLowerCase();\n return (name !== '' && this.isFontInstalled(name) && env.genericFontFamilies.indexOf(name) === -1);\n }\n\n colorPalette(className, tooltip, backColor, foreColor) {\n return this.ui.buttonGroup({\n className: 'note-color ' + className,\n children: [\n this.button({\n className: 'note-current-color-button',\n contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n tooltip: tooltip,\n click: (e) => {\n const $button = $(e.currentTarget);\n if (backColor && foreColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n foreColor: $button.attr('data-foreColor'),\n });\n } else if (backColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n });\n } else if (foreColor) {\n this.context.invoke('editor.color', {\n foreColor: $button.attr('data-foreColor'),\n });\n }\n },\n callback: ($button) => {\n const $recentColor = $button.find('.note-recent-color');\n if (backColor) {\n $recentColor.css('background-color', this.options.colorButton.backColor);\n $button.attr('data-backColor', this.options.colorButton.backColor);\n }\n if (foreColor) {\n $recentColor.css('color', this.options.colorButton.foreColor);\n $button.attr('data-foreColor', this.options.colorButton.foreColor);\n } else {\n $recentColor.css('color', 'transparent');\n }\n },\n }),\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('', this.options),\n tooltip: this.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n items: (backColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n this.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n '</div>',\n '<div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n '</div>',\n ].join('') : '') +\n (foreColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n this.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n '</div>', // Fix missing Div, Commented to find easily if it's wrong\n '<div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n '</div>',\n ].join('') : ''),\n callback: ($dropdown) => {\n $dropdown.find('.note-holder').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: this.options.colors,\n colorsName: this.options.colorsName,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n /* TODO: do we have to record recent custom colors within cookies? */\n var customColors = [\n ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n ];\n $dropdown.find('.note-holder-custom').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: customColors,\n colorsName: customColors,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n $dropdown.find('input[type=color]').each((idx, item) => {\n $(item).change(function() {\n const $chip = $dropdown.find('#' + $(this).data('event')).find('.note-color-btn').first();\n const color = this.value.toUpperCase();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $chip.click();\n });\n });\n },\n click: (event) => {\n event.stopPropagation();\n\n const $parent = $('.' + className).find('.note-dropdown-menu');\n const $button = $(event.target);\n const eventName = $button.data('event');\n const value = $button.attr('data-value');\n\n if (eventName === 'openPalette') {\n const $picker = $parent.find('#' + value);\n const $palette = $($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n\n // Shift palette chips\n const $chip = $palette.find('.note-color-btn').last().detach();\n\n // Set chip attributes\n const color = $picker.val();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $palette.prepend($chip);\n $picker.click();\n } else {\n if (lists.contains(['backColor', 'foreColor'], eventName)) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n }\n this.context.invoke('editor.' + eventName, value);\n }\n },\n }),\n ],\n }).render();\n }\n\n addToolbarButtons() {\n this.context.memo('button.style', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n this.ui.icon(this.options.icons.magic), this.options\n ),\n tooltip: this.lang.style.style,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n className: 'dropdown-style',\n items: this.options.styleTags,\n title: this.lang.style.style,\n template: (item) => {\n // TBD: need to be simplified\n if (typeof item === 'string') {\n item = {\n tag: item,\n title: (Object.prototype.hasOwnProperty.call(this.lang.style, item) ? this.lang.style[item] : item),\n };\n }\n\n const tag = item.tag;\n const title = item.title;\n const style = item.style ? ' style=\"' + item.style + '\" ' : '';\n const className = item.className ? ' class=\"' + item.className + '\"' : '';\n\n return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n },\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }),\n ]).render();\n });\n\n for (let styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n const item = this.options.styleTags[styleIdx];\n\n this.context.memo('button.style.' + item, () => {\n return this.button({\n className: 'note-btn-style-' + item,\n contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n tooltip: this.lang.style[item],\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }).render();\n });\n }\n\n this.context.memo('button.bold', () => {\n return this.button({\n className: 'note-btn-bold',\n contents: this.ui.icon(this.options.icons.bold),\n tooltip: this.lang.font.bold + this.representShortcut('bold'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.bold'),\n }).render();\n });\n\n this.context.memo('button.italic', () => {\n return this.button({\n className: 'note-btn-italic',\n contents: this.ui.icon(this.options.icons.italic),\n tooltip: this.lang.font.italic + this.representShortcut('italic'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.italic'),\n }).render();\n });\n\n this.context.memo('button.underline', () => {\n return this.button({\n className: 'note-btn-underline',\n contents: this.ui.icon(this.options.icons.underline),\n tooltip: this.lang.font.underline + this.representShortcut('underline'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.underline'),\n }).render();\n });\n\n this.context.memo('button.clear', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.eraser),\n tooltip: this.lang.font.clear + this.representShortcut('removeFormat'),\n click: this.context.createInvokeHandler('editor.removeFormat'),\n }).render();\n });\n\n this.context.memo('button.strikethrough', () => {\n return this.button({\n className: 'note-btn-strikethrough',\n contents: this.ui.icon(this.options.icons.strikethrough),\n tooltip: this.lang.font.strikethrough + this.representShortcut('strikethrough'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.strikethrough'),\n }).render();\n });\n\n this.context.memo('button.superscript', () => {\n return this.button({\n className: 'note-btn-superscript',\n contents: this.ui.icon(this.options.icons.superscript),\n tooltip: this.lang.font.superscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.superscript'),\n }).render();\n });\n\n this.context.memo('button.subscript', () => {\n return this.button({\n className: 'note-btn-subscript',\n contents: this.ui.icon(this.options.icons.subscript),\n tooltip: this.lang.font.subscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.subscript'),\n }).render();\n });\n\n this.context.memo('button.fontname', () => {\n const styleInfo = this.context.invoke('editor.currentStyle');\n\n if (this.options.addDefaultFonts) {\n // Add 'default' fonts into the fontnames array if not exist\n $.each(styleInfo['font-family'].split(','), (idx, fontname) => {\n fontname = fontname.trim().replace(/['\"]+/g, '');\n if (this.isFontDeservedToAdd(fontname)) {\n if (this.options.fontNames.indexOf(fontname) === -1) {\n this.options.fontNames.push(fontname);\n }\n }\n });\n }\n\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n '<span class=\"note-current-fontname\"/>', this.options\n ),\n tooltip: this.lang.font.name,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontname',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontNames.filter(this.isFontInstalled.bind(this)),\n title: this.lang.font.name,\n template: (item) => {\n return '<span style=\"font-family: ' + env.validFontName(item) + '\">' + item + '</span>';\n },\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontName'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsize', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', this.options),\n tooltip: this.lang.font.size,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsize',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizes,\n title: this.lang.font.size,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSize'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsizeunit', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsizeunit\"/>', this.options),\n tooltip: this.lang.font.sizeunit,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsizeunit',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizeUnits,\n title: this.lang.font.sizeunit,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSizeUnit'),\n }),\n ]).render();\n });\n\n this.context.memo('button.color', () => {\n return this.colorPalette('note-color-all', this.lang.color.recent, true, true);\n });\n\n this.context.memo('button.forecolor', () => {\n return this.colorPalette('note-color-fore', this.lang.color.foreground, false, true);\n });\n\n this.context.memo('button.backcolor', () => {\n return this.colorPalette('note-color-back', this.lang.color.background, true, false);\n });\n\n this.context.memo('button.ul', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unorderedlist),\n tooltip: this.lang.lists.unordered + this.representShortcut('insertUnorderedList'),\n click: this.context.createInvokeHandler('editor.insertUnorderedList'),\n }).render();\n });\n\n this.context.memo('button.ol', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.orderedlist),\n tooltip: this.lang.lists.ordered + this.representShortcut('insertOrderedList'),\n click: this.context.createInvokeHandler('editor.insertOrderedList'),\n }).render();\n });\n\n const justifyLeft = this.button({\n contents: this.ui.icon(this.options.icons.alignLeft),\n tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n click: this.context.createInvokeHandler('editor.justifyLeft'),\n });\n\n const justifyCenter = this.button({\n contents: this.ui.icon(this.options.icons.alignCenter),\n tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n click: this.context.createInvokeHandler('editor.justifyCenter'),\n });\n\n const justifyRight = this.button({\n contents: this.ui.icon(this.options.icons.alignRight),\n tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n click: this.context.createInvokeHandler('editor.justifyRight'),\n });\n\n const justifyFull = this.button({\n contents: this.ui.icon(this.options.icons.alignJustify),\n tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n click: this.context.createInvokeHandler('editor.justifyFull'),\n });\n\n const outdent = this.button({\n contents: this.ui.icon(this.options.icons.outdent),\n tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n click: this.context.createInvokeHandler('editor.outdent'),\n });\n\n const indent = this.button({\n contents: this.ui.icon(this.options.icons.indent),\n tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n click: this.context.createInvokeHandler('editor.indent'),\n });\n\n this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n this.context.memo('button.indent', func.invoke(indent, 'render'));\n\n this.context.memo('button.paragraph', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft), this.options),\n tooltip: this.lang.paragraph.paragraph,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown([\n this.ui.buttonGroup({\n className: 'note-align',\n children: [justifyLeft, justifyCenter, justifyRight, justifyFull],\n }),\n this.ui.buttonGroup({\n className: 'note-list',\n children: [outdent, indent],\n }),\n ]),\n ]).render();\n });\n\n this.context.memo('button.height', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight), this.options),\n tooltip: this.lang.font.height,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n items: this.options.lineHeights,\n checkClassName: this.options.icons.menuCheck,\n className: 'dropdown-line-height',\n title: this.lang.font.height,\n click: this.context.createInvokeHandler('editor.lineHeight'),\n }),\n ]).render();\n });\n\n this.context.memo('button.table', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table), this.options),\n tooltip: this.lang.table.table,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n title: this.lang.table.table,\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: ($node) => {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: this.options.insertTableMaxSize.col + 'em',\n height: this.options.insertTableMaxSize.row + 'em',\n }).mousedown(this.context.createInvokeHandler('editor.insertTable'))\n .on('mousemove', this.tableMoveHandler.bind(this));\n },\n }).render();\n });\n\n this.context.memo('button.link', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.link + this.representShortcut('linkDialog.show'),\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.picture', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.picture),\n tooltip: this.lang.image.image,\n click: this.context.createInvokeHandler('imageDialog.show'),\n }).render();\n });\n\n this.context.memo('button.video', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.video),\n tooltip: this.lang.video.video,\n click: this.context.createInvokeHandler('videoDialog.show'),\n }).render();\n });\n\n this.context.memo('button.hr', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.minus),\n tooltip: this.lang.hr.insert + this.representShortcut('insertHorizontalRule'),\n click: this.context.createInvokeHandler('editor.insertHorizontalRule'),\n }).render();\n });\n\n this.context.memo('button.fullscreen', () => {\n return this.button({\n className: 'btn-fullscreen',\n contents: this.ui.icon(this.options.icons.arrowsAlt),\n tooltip: this.lang.options.fullscreen,\n click: this.context.createInvokeHandler('fullscreen.toggle'),\n }).render();\n });\n\n this.context.memo('button.codeview', () => {\n return this.button({\n className: 'btn-codeview',\n contents: this.ui.icon(this.options.icons.code),\n tooltip: this.lang.options.codeview,\n click: this.context.createInvokeHandler('codeview.toggle'),\n }).render();\n });\n\n this.context.memo('button.redo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.redo),\n tooltip: this.lang.history.redo + this.representShortcut('redo'),\n click: this.context.createInvokeHandler('editor.redo'),\n }).render();\n });\n\n this.context.memo('button.undo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.undo),\n tooltip: this.lang.history.undo + this.representShortcut('undo'),\n click: this.context.createInvokeHandler('editor.undo'),\n }).render();\n });\n\n this.context.memo('button.help', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.question),\n tooltip: this.lang.options.help,\n click: this.context.createInvokeHandler('helpDialog.show'),\n }).render();\n });\n }\n\n /**\n * image: [\n * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n * ['float', ['floatLeft', 'floatRight', 'floatNone']],\n * ['remove', ['removeMedia']],\n * ],\n */\n addImagePopoverButtons() {\n // Image Size Buttons\n this.context.memo('button.resizeFull', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">100%</span>',\n tooltip: this.lang.image.resizeFull,\n click: this.context.createInvokeHandler('editor.resize', '1'),\n }).render();\n });\n this.context.memo('button.resizeHalf', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">50%</span>',\n tooltip: this.lang.image.resizeHalf,\n click: this.context.createInvokeHandler('editor.resize', '0.5'),\n }).render();\n });\n this.context.memo('button.resizeQuarter', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">25%</span>',\n tooltip: this.lang.image.resizeQuarter,\n click: this.context.createInvokeHandler('editor.resize', '0.25'),\n }).render();\n });\n this.context.memo('button.resizeNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.resizeNone,\n click: this.context.createInvokeHandler('editor.resize', '0'),\n }).render();\n });\n\n // Float Buttons\n this.context.memo('button.floatLeft', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatLeft),\n tooltip: this.lang.image.floatLeft,\n click: this.context.createInvokeHandler('editor.floatMe', 'left'),\n }).render();\n });\n\n this.context.memo('button.floatRight', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatRight),\n tooltip: this.lang.image.floatRight,\n click: this.context.createInvokeHandler('editor.floatMe', 'right'),\n }).render();\n });\n\n this.context.memo('button.floatNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.floatNone,\n click: this.context.createInvokeHandler('editor.floatMe', 'none'),\n }).render();\n });\n\n // Remove Buttons\n this.context.memo('button.removeMedia', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.image.remove,\n click: this.context.createInvokeHandler('editor.removeMedia'),\n }).render();\n });\n }\n\n addLinkPopoverButtons() {\n this.context.memo('button.linkDialogShow', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.edit,\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.unlink', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unlink),\n tooltip: this.lang.link.unlink,\n click: this.context.createInvokeHandler('editor.unlink'),\n }).render();\n });\n }\n\n /**\n * table : [\n * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n * ],\n */\n addTablePopoverButtons() {\n this.context.memo('button.addRowUp', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowAbove),\n tooltip: this.lang.table.addRowAbove,\n click: this.context.createInvokeHandler('editor.addRow', 'top'),\n }).render();\n });\n this.context.memo('button.addRowDown', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowBelow),\n tooltip: this.lang.table.addRowBelow,\n click: this.context.createInvokeHandler('editor.addRow', 'bottom'),\n }).render();\n });\n this.context.memo('button.addColLeft', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colBefore),\n tooltip: this.lang.table.addColLeft,\n click: this.context.createInvokeHandler('editor.addCol', 'left'),\n }).render();\n });\n this.context.memo('button.addColRight', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colAfter),\n tooltip: this.lang.table.addColRight,\n click: this.context.createInvokeHandler('editor.addCol', 'right'),\n }).render();\n });\n this.context.memo('button.deleteRow', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowRemove),\n tooltip: this.lang.table.delRow,\n click: this.context.createInvokeHandler('editor.deleteRow'),\n }).render();\n });\n this.context.memo('button.deleteCol', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colRemove),\n tooltip: this.lang.table.delCol,\n click: this.context.createInvokeHandler('editor.deleteCol'),\n }).render();\n });\n this.context.memo('button.deleteTable', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.table.delTable,\n click: this.context.createInvokeHandler('editor.deleteTable'),\n }).render();\n });\n }\n\n build($container, groups) {\n for (let groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n const group = groups[groupIdx];\n const groupName = Array.isArray(group) ? group[0] : group;\n const buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n\n const $group = this.ui.buttonGroup({\n className: 'note-' + groupName,\n }).render();\n\n for (let idx = 0, len = buttons.length; idx < len; idx++) {\n const btn = this.context.memo('button.' + buttons[idx]);\n if (btn) {\n $group.append(typeof btn === 'function' ? btn(this.context) : btn);\n }\n }\n $group.appendTo($container);\n }\n }\n\n /**\n * @param {jQuery} [$container]\n */\n updateCurrentStyle($container) {\n const $cont = $container || this.$toolbar;\n\n const styleInfo = this.context.invoke('editor.currentStyle');\n this.updateBtnStates($cont, {\n '.note-btn-bold': () => {\n return styleInfo['font-bold'] === 'bold';\n },\n '.note-btn-italic': () => {\n return styleInfo['font-italic'] === 'italic';\n },\n '.note-btn-underline': () => {\n return styleInfo['font-underline'] === 'underline';\n },\n '.note-btn-subscript': () => {\n return styleInfo['font-subscript'] === 'subscript';\n },\n '.note-btn-superscript': () => {\n return styleInfo['font-superscript'] === 'superscript';\n },\n '.note-btn-strikethrough': () => {\n return styleInfo['font-strikethrough'] === 'strikethrough';\n },\n });\n\n if (styleInfo['font-family']) {\n const fontNames = styleInfo['font-family'].split(',').map((name) => {\n return name.replace(/[\\'\\\"]/g, '')\n .replace(/\\s+$/, '')\n .replace(/^\\s+/, '');\n });\n const fontName = lists.find(fontNames, this.isFontInstalled.bind(this));\n\n $cont.find('.dropdown-fontname a').each((idx, item) => {\n const $item = $(item);\n // always compare string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontName + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontname').text(fontName).css('font-family', fontName);\n }\n\n if (styleInfo['font-size']) {\n const fontSize = styleInfo['font-size'];\n $cont.find('.dropdown-fontsize a').each((idx, item) => {\n const $item = $(item);\n // always compare with string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontSize + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsize').text(fontSize);\n\n const fontSizeUnit = styleInfo['font-size-unit'];\n $cont.find('.dropdown-fontsizeunit a').each((idx, item) => {\n const $item = $(item);\n const isChecked = ($item.data('value') + '') === (fontSizeUnit + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsizeunit').text(fontSizeUnit);\n }\n\n if (styleInfo['line-height']) {\n const lineHeight = styleInfo['line-height'];\n $cont.find('.dropdown-line-height li a').each((idx, item) => {\n // always compare with string to avoid creating another func.\n const isChecked = ($(item).data('value') + '') === (lineHeight + '');\n this.className = isChecked ? 'checked' : '';\n });\n }\n }\n\n updateBtnStates($container, infos) {\n $.each(infos, (selector, pred) => {\n this.ui.toggleBtnActive($container.find(selector), pred());\n });\n }\n\n tableMoveHandler(event) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n }\n}\n","import $ from 'jquery';\nexport default class Toolbar {\n constructor(context) {\n this.context = context;\n\n this.$window = $(window);\n this.$document = $(document);\n\n this.ui = $.summernote.ui;\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$statusbar = context.layoutInfo.statusbar;\n this.options = context.options;\n\n this.isFollowing = false;\n this.followScroll = this.followScroll.bind(this);\n }\n\n shouldInitialize() {\n return !this.options.airMode;\n }\n\n initialize() {\n this.options.toolbar = this.options.toolbar || [];\n\n if (!this.options.toolbar.length) {\n this.$toolbar.hide();\n } else {\n this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n }\n\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n\n this.changeContainer(false);\n\n this.$note.on('summernote.keyup summernote.mouseup summernote.change', () => {\n this.context.invoke('buttons.updateCurrentStyle');\n });\n\n this.context.invoke('buttons.updateCurrentStyle');\n if (this.options.followingToolbar) {\n this.$window.on('scroll resize', this.followScroll);\n }\n }\n\n destroy() {\n this.$toolbar.children().remove();\n\n if (this.options.followingToolbar) {\n this.$window.off('scroll resize', this.followScroll);\n }\n }\n\n followScroll() {\n if (this.$editor.hasClass('fullscreen')) {\n return false;\n }\n\n const editorHeight = this.$editor.outerHeight();\n const editorWidth = this.$editor.width();\n const toolbarHeight = this.$toolbar.height();\n const statusbarHeight = this.$statusbar.height();\n\n // check if the web app is currently using another static bar\n let otherBarHeight = 0;\n if (this.options.otherStaticBar) {\n otherBarHeight = $(this.options.otherStaticBar).outerHeight();\n }\n\n const currentOffset = this.$document.scrollTop();\n const editorOffsetTop = this.$editor.offset().top;\n const editorOffsetBottom = editorOffsetTop + editorHeight;\n const activateOffset = editorOffsetTop - otherBarHeight;\n const deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n\n if (!this.isFollowing &&\n (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n this.isFollowing = true;\n this.$editable.css({\n marginTop: this.$toolbar.outerHeight(),\n });\n this.$toolbar.css({\n position: 'fixed',\n top: otherBarHeight,\n width: editorWidth,\n zIndex: 1000,\n });\n } else if (this.isFollowing &&\n ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n this.isFollowing = false;\n this.$toolbar.css({\n position: 'relative',\n top: 0,\n width: '100%',\n zIndex: 'auto',\n });\n this.$editable.css({\n marginTop: '',\n });\n }\n }\n\n changeContainer(isFullscreen) {\n if (isFullscreen) {\n this.$toolbar.prependTo(this.$editor);\n } else {\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n }\n if (this.options.followingToolbar) {\n this.followScroll();\n }\n }\n\n updateFullscreen(isFullscreen) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n\n this.changeContainer(isFullscreen);\n }\n\n updateCodeview(isCodeview) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n if (isCodeview) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n activate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, true);\n }\n\n deactivate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, false);\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\n\nexport default class LinkDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-txt-${this.options.id}\" class=\"note-form-label\">${this.lang.link.textToDisplay}</label>`,\n `<input id=\"note-dialog-link-txt-${this.options.id}\" class=\"note-link-text form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-url-${this.options.id}\" class=\"note-form-label\">${this.lang.link.url}</label>`,\n `<input id=\"note-dialog-link-url-${this.options.id}\" class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\"/>`,\n '</div>',\n !this.options.disableLinkTarget\n ? $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-open-in-new-window',\n text: this.lang.link.openInNewWindow,\n checked: true,\n }).render()).html()\n : '',\n $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-use-protocol',\n text: this.lang.link.useProtocol,\n checked: true,\n }).render()).html(),\n ].join('');\n\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.link.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n className: 'link-dialog',\n title: this.lang.link.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n /**\n * toggle update button\n */\n toggleLinkBtn($linkBtn, $linkText, $linkUrl) {\n this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n }\n\n /**\n * Show link dialog and set event handlers on dialog controls.\n *\n * @param {Object} linkInfo\n * @return {Promise}\n */\n showLinkDialog(linkInfo) {\n return $.Deferred((deferred) => {\n const $linkText = this.$dialog.find('.note-link-text');\n const $linkUrl = this.$dialog.find('.note-link-url');\n const $linkBtn = this.$dialog.find('.note-link-btn');\n const $openInNewWindow = this.$dialog\n .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n const $useProtocol = this.$dialog\n .find('.sn-checkbox-use-protocol input[type=checkbox]');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // If no url was given and given text is valid URL then copy that into URL Field\n if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n linkInfo.url = linkInfo.text;\n }\n\n $linkText.on('input paste propertychange', () => {\n // If linktext was modified by input events,\n // cloning text from linkUrl will be stopped.\n linkInfo.text = $linkText.val();\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.text);\n\n $linkUrl.on('input paste propertychange', () => {\n // Display same text on `Text to display` as default\n // when linktext has no text\n if (!linkInfo.text) {\n $linkText.val($linkUrl.val());\n }\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.url);\n\n if (!env.isSupportTouch) {\n $linkUrl.trigger('focus');\n }\n\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n this.bindEnterKey($linkUrl, $linkBtn);\n this.bindEnterKey($linkText, $linkBtn);\n\n const isNewWindowChecked = linkInfo.isNewWindow !== undefined\n ? linkInfo.isNewWindow : this.context.options.linkTargetBlank;\n\n $openInNewWindow.prop('checked', isNewWindowChecked);\n\n const useProtocolChecked = linkInfo.url\n ? false : this.context.options.useProtocol;\n\n $useProtocol.prop('checked', useProtocolChecked);\n\n $linkBtn.one('click', (event) => {\n event.preventDefault();\n\n deferred.resolve({\n range: linkInfo.range,\n url: $linkUrl.val(),\n text: $linkText.val(),\n isNewWindow: $openInNewWindow.is(':checked'),\n checkProtocol: $useProtocol.is(':checked'),\n });\n this.ui.hideDialog(this.$dialog);\n });\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n // detach events\n $linkText.off();\n $linkUrl.off();\n $linkBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n /**\n * @param {Object} layoutInfo\n */\n show() {\n const linkInfo = this.context.invoke('editor.getLinkInfo');\n\n this.context.invoke('editor.saveRange');\n this.showLinkDialog(linkInfo).then((linkInfo) => {\n this.context.invoke('editor.restoreRange');\n this.context.invoke('editor.createLink', linkInfo);\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class LinkPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': () => {\n this.update();\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.link);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-link-popover',\n callback: ($node) => {\n const $content = $node.find('.popover-content,.note-popover-content');\n $content.prepend('<span><a target=\"_blank\"></a> </span>');\n },\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.link);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update() {\n // Prevent focusing on editable when invoke('code') is executed\n if (!this.context.invoke('editor.hasFocus')) {\n this.hide();\n return;\n }\n\n const rng = this.context.invoke('editor.getLastRange');\n if (rng.isCollapsed() && rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n const href = $(anchor).attr('href');\n this.$popover.find('a').attr('href', href).text(href);\n\n const pos = dom.posFromPlaceholder(anchor);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class ImageDialog {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n let imageLimitation = '';\n if (this.options.maximumImageFileSize) {\n const unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n const readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n ' ' + ' KMGTP'[unit] + 'B';\n imageLimitation = `<small>${this.lang.image.maximumFileSize + ' : ' + readableSize}</small>`;\n }\n\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group note-group-select-from-files\">',\n '<label for=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n '<input id=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-image-input form-control-file note-form-control note-input\" ',\n ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>',\n imageLimitation,\n '</div>',\n '<div class=\"form-group note-group-image-url\">',\n '<label for=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.url + '</label>',\n '<input id=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-image-url form-control note-form-control note-input\" type=\"text\"/>',\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.image.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.image.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showImageDialog().then((data) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n if (typeof data === 'string') { // image url\n // If onImageLinkInsert set,\n if (this.options.callbacks.onImageLinkInsert) {\n this.context.triggerEvent('image.link.insert', data);\n } else {\n this.context.invoke('editor.insertImage', data);\n }\n } else { // array of files\n this.context.invoke('editor.insertImagesOrCallback', data);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show image dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showImageDialog() {\n return $.Deferred((deferred) => {\n const $imageInput = this.$dialog.find('.note-image-input');\n const $imageUrl = this.$dialog.find('.note-image-url');\n const $imageBtn = this.$dialog.find('.note-image-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // Cloning imageInput to clear element.\n $imageInput.replaceWith($imageInput.clone().on('change', (event) => {\n deferred.resolve(event.target.files || event.target.value);\n }).val(''));\n\n $imageUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($imageBtn, $imageUrl.val());\n }).val('');\n\n if (!env.isSupportTouch) {\n $imageUrl.trigger('focus');\n }\n\n $imageBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($imageUrl.val());\n });\n\n this.bindEnterKey($imageUrl, $imageBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $imageInput.off();\n $imageUrl.off();\n $imageBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\n/**\n * Image popover module\n * mouse events that show/hide popover will be handled by Handle.js.\n * Handle.js will receive the events and invoke 'imagePopover.update'.\n */\nexport default class ImagePopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n\n this.editable = context.layoutInfo.editable[0];\n this.options = context.options;\n\n this.events = {\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.image);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-image-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n this.context.invoke('buttons.build', $content, this.options.popover.image);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target, event) {\n if (dom.isImg(target)) {\n const position = $(target).offset();\n const containerOffset = $(this.options.container).offset();\n let pos = {};\n if (this.options.popatmouse) {\n pos.left = event.pageX - 20;\n pos.top = event.pageY;\n } else {\n pos = position;\n }\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class TablePopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.mousedown': (we, e) => {\n this.update(e.target);\n },\n 'summernote.keyup summernote.scroll summernote.change': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.table);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-table-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.table);\n\n // [workaround] Disable Firefox's default table editor\n if (env.isFF) {\n document.execCommand('enableInlineTableEditing', false, false);\n }\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isCell = dom.isCell(target);\n\n if (isCell) {\n const pos = dom.posFromPlaceholder(target);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n\n return isCell;\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class VideoDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group row-fluid\">',\n `<label for=\"note-dialog-video-url-${this.options.id}\" class=\"note-form-label\">${this.lang.video.url} <small class=\"text-muted\">${this.lang.video.providers}</small></label>`,\n `<input id=\"note-dialog-video-url-${this.options.id}\" class=\"note-video-url form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.video.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.video.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n createVideoNode(url) {\n // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n const ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n const ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n const ytMatch = url.match(ytRegExp);\n\n const igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n const igMatch = url.match(igRegExp);\n\n const vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n const vMatch = url.match(vRegExp);\n\n const vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n const vimMatch = url.match(vimRegExp);\n\n const dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n const dmMatch = url.match(dmRegExp);\n\n const youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n const youkuMatch = url.match(youkuRegExp);\n\n const qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n const qqMatch = url.match(qqRegExp);\n\n const qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n const qqMatch2 = url.match(qqRegExp2);\n\n const mp4RegExp = /^.+.(mp4|m4v)$/;\n const mp4Match = url.match(mp4RegExp);\n\n const oggRegExp = /^.+.(ogg|ogv)$/;\n const oggMatch = url.match(oggRegExp);\n\n const webmRegExp = /^.+.(webm)$/;\n const webmMatch = url.match(webmRegExp);\n\n const fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n const fbMatch = url.match(fbRegExp);\n\n let $video;\n if (ytMatch && ytMatch[1].length === 11) {\n const youtubeId = ytMatch[1];\n var start = 0;\n if (typeof ytMatch[2] !== 'undefined') {\n const ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n if (ytMatchForStart) {\n for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n }\n }\n }\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n .attr('width', '640').attr('height', '360');\n } else if (igMatch && igMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n .attr('width', '612').attr('height', '710')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else if (vMatch && vMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', vMatch[0] + '/embed/simple')\n .attr('width', '600').attr('height', '600')\n .attr('class', 'vine-embed');\n } else if (vimMatch && vimMatch[3].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n .attr('width', '640').attr('height', '360');\n } else if (dmMatch && dmMatch[2].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n .attr('width', '640').attr('height', '360');\n } else if (youkuMatch && youkuMatch[1].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '498')\n .attr('width', '510')\n .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n const vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '310')\n .attr('width', '500')\n .attr('src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');\n } else if (mp4Match || oggMatch || webmMatch) {\n $video = $('<video controls>')\n .attr('src', url)\n .attr('width', '640').attr('height', '360');\n } else if (fbMatch && fbMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n .attr('width', '560').attr('height', '301')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else {\n // this is not a known video link. Now what, Cat? Now what?\n return false;\n }\n\n $video.addClass('note-video-clip');\n\n return $video[0];\n }\n\n show() {\n const text = this.context.invoke('editor.getSelectedText');\n this.context.invoke('editor.saveRange');\n this.showVideoDialog(text).then((url) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n // build node\n const $node = this.createVideoNode(url);\n\n if ($node) {\n // insert video node\n this.context.invoke('editor.insertNode', $node);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show video dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showVideoDialog(/* text */) {\n return $.Deferred((deferred) => {\n const $videoUrl = this.$dialog.find('.note-video-url');\n const $videoBtn = this.$dialog.find('.note-video-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n $videoUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($videoBtn, $videoUrl.val());\n });\n\n if (!env.isSupportTouch) {\n $videoUrl.trigger('focus');\n }\n\n $videoBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($videoUrl.val());\n });\n\n this.bindEnterKey($videoUrl, $videoBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $videoUrl.off();\n $videoBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\n\nexport default class HelpDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<p class=\"text-center\">',\n '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote @@VERSION@@</a> · ',\n '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n '</p>',\n ].join('');\n\n this.$dialog = this.ui.dialog({\n title: this.lang.options.help,\n fade: this.options.dialogsFade,\n body: this.createShortcutList(),\n footer: body,\n callback: ($node) => {\n $node.find('.modal-body,.note-modal-body').css({\n 'max-height': 300,\n 'overflow': 'scroll',\n });\n },\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n createShortcutList() {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n return Object.keys(keyMap).map((key) => {\n const command = keyMap[key];\n const $row = $('<div><div class=\"help-list-item\"/></div>');\n $row.append($('<label><kbd>' + key + '</kdb></label>').css({\n 'width': 180,\n 'margin-right': 10,\n })).append($('<span/>').html(this.context.memo('help.' + command) || command));\n return $row.html();\n }).join('');\n }\n\n /**\n * show help dialog\n *\n * @return {Promise}\n */\n showHelpDialog() {\n return $.Deferred((deferred) => {\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n deferred.resolve();\n });\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showHelpDialog().then(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\n\nconst AIRMODE_POPOVER_X_OFFSET = -5;\nconst AIRMODE_POPOVER_Y_OFFSET = 5;\n\nexport default class AirPopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.options = context.options;\n\n this.hidable = true;\n this.onContextmenu = false;\n this.pageX = null;\n this.pageY = null;\n\n this.events = {\n 'summernote.contextmenu': (e) => {\n if (this.options.editing) {\n e.preventDefault();\n e.stopPropagation();\n this.onContextmenu = true;\n this.update(true);\n }\n },\n 'summernote.mousedown': (we, e) => {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n },\n 'summernote.keyup summernote.mouseup summernote.scroll': (we, e) => {\n if (this.options.editing && !this.onContextmenu) {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n this.update();\n }\n this.onContextmenu = false;\n },\n 'summernote.disable summernote.change summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n 'summernote.focusout': () => {\n if (!this.$popover.is(':active,:focus')) {\n this.hide();\n }\n },\n };\n }\n\n shouldInitialize() {\n return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-air-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.air);\n\n // disable hiding this popover preemptively by 'summernote.blur' event.\n this.$popover.on('mousedown', () => { this.hidable = false; });\n // (re-)enable hiding after 'summernote.blur' has been handled (aka. ignored).\n this.$popover.on('mouseup', () => { this.hidable = true; });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(forcelyOpen) {\n const styleInfo = this.context.invoke('editor.currentStyle');\n if (styleInfo.range && (!styleInfo.range.isCollapsed() || forcelyOpen)) {\n let rect = {\n left: this.pageX,\n top: this.pageY,\n };\n\n const containerOffset = $(this.options.container).offset();\n rect.top -= containerOffset.top;\n rect.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: Math.max(rect.left, 0) + AIRMODE_POPOVER_X_OFFSET,\n top: rect.top + AIRMODE_POPOVER_Y_OFFSET,\n });\n this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n } else {\n this.hide();\n }\n }\n\n hide() {\n if (this.hidable) {\n this.$popover.hide();\n }\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport key from '../core/key';\n\nconst POPOVER_DIST = 5;\n\nexport default class HintPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.hint = this.options.hint || [];\n this.direction = this.options.hintDirection || 'bottom';\n this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return this.hints.length > 0;\n }\n\n initialize() {\n this.lastWordRange = null;\n this.matchingWord = null;\n this.$popover = this.ui.popover({\n className: 'note-hint-popover',\n hideArrow: true,\n direction: '',\n }).render().appendTo(this.options.container);\n\n this.$popover.hide();\n this.$content = this.$popover.find('.popover-content,.note-popover-content');\n this.$content.on('click', '.note-hint-item', (e) => {\n this.$content.find('.active').removeClass('active');\n $(e.currentTarget).addClass('active');\n this.replace();\n });\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n selectItem($item) {\n this.$content.find('.active').removeClass('active');\n $item.addClass('active');\n\n this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n }\n\n moveDown() {\n const $current = this.$content.find('.note-hint-item.active');\n const $next = $current.next();\n\n if ($next.length) {\n this.selectItem($next);\n } else {\n let $nextGroup = $current.parent().next();\n\n if (!$nextGroup.length) {\n $nextGroup = this.$content.find('.note-hint-group').first();\n }\n\n this.selectItem($nextGroup.find('.note-hint-item').first());\n }\n }\n\n moveUp() {\n const $current = this.$content.find('.note-hint-item.active');\n const $prev = $current.prev();\n\n if ($prev.length) {\n this.selectItem($prev);\n } else {\n let $prevGroup = $current.parent().prev();\n\n if (!$prevGroup.length) {\n $prevGroup = this.$content.find('.note-hint-group').last();\n }\n\n this.selectItem($prevGroup.find('.note-hint-item').last());\n }\n }\n\n replace() {\n const $item = this.$content.find('.note-hint-item.active');\n\n if ($item.length) {\n var node = this.nodeFromItem($item);\n // If matchingWord length = 0 -> capture OK / open hint / but as mention capture \"\" (\\w*)\n if (this.matchingWord !== null && this.matchingWord.length === 0) {\n this.lastWordRange.so = this.lastWordRange.eo;\n // Else si > 0 and normal case -> adjust range \"before\" for correct position of insertion\n } else if (this.matchingWord !== null && this.matchingWord.length > 0 && !this.lastWordRange.isCollapsed()) {\n let rangeCompute = this.lastWordRange.eo - this.lastWordRange.so - this.matchingWord.length;\n if (rangeCompute > 0) {\n this.lastWordRange.so += rangeCompute;\n }\n }\n this.lastWordRange.insertNode(node);\n\n if (this.options.hintSelect === 'next') {\n var blank = document.createTextNode('');\n $(node).after(blank);\n range.createFromNodeBefore(blank).select();\n } else {\n range.createFromNodeAfter(node).select();\n }\n\n this.lastWordRange = null;\n this.hide();\n this.context.invoke('editor.focus');\n }\n }\n\n nodeFromItem($item) {\n const hint = this.hints[$item.data('index')];\n const item = $item.data('item');\n let node = hint.content ? hint.content(item) : item;\n if (typeof node === 'string') {\n node = dom.createText(node);\n }\n return node;\n }\n\n createItemTemplates(hintIdx, items) {\n const hint = this.hints[hintIdx];\n return items.map((item /*, idx */) => {\n const $item = $('<div class=\"note-hint-item\"/>');\n $item.append(hint.template ? hint.template(item) : item + '');\n $item.data({\n 'index': hintIdx,\n 'item': item,\n });\n return $item;\n });\n }\n\n handleKeydown(e) {\n if (!this.$popover.is(':visible')) {\n return;\n }\n\n if (e.keyCode === key.code.ENTER) {\n e.preventDefault();\n this.replace();\n } else if (e.keyCode === key.code.UP) {\n e.preventDefault();\n this.moveUp();\n } else if (e.keyCode === key.code.DOWN) {\n e.preventDefault();\n this.moveDown();\n }\n }\n\n searchKeyword(index, keyword, callback) {\n const hint = this.hints[index];\n if (hint && hint.match.test(keyword) && hint.search) {\n const matches = hint.match.exec(keyword);\n this.matchingWord = matches[0];\n hint.search(matches[1], callback);\n } else {\n callback();\n }\n }\n\n createGroup(idx, keyword) {\n const $group = $('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n this.searchKeyword(idx, keyword, (items) => {\n items = items || [];\n if (items.length) {\n $group.html(this.createItemTemplates(idx, items));\n this.show();\n }\n });\n\n return $group;\n }\n\n handleKeyup(e) {\n if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n let range = this.context.invoke('editor.getLastRange');\n let wordRange, keyword;\n if (this.options.hintMode === 'words') {\n wordRange = range.getWordsRange(range);\n keyword = wordRange.toString();\n\n this.hints.forEach((hint) => {\n if (hint.match.test(keyword)) {\n wordRange = range.getWordsMatchRange(hint.match);\n return false;\n }\n });\n\n if (!wordRange) {\n this.hide();\n return;\n }\n\n keyword = wordRange.toString();\n } else {\n wordRange = range.getWordRange();\n keyword = wordRange.toString();\n }\n\n if (this.hints.length && keyword) {\n this.$content.empty();\n\n const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n const containerOffset = $(this.options.container).offset();\n if (bnd) {\n bnd.top -= containerOffset.top;\n bnd.left -= containerOffset.left;\n\n this.$popover.hide();\n this.lastWordRange = wordRange;\n this.hints.forEach((hint, idx) => {\n if (hint.match.test(keyword)) {\n this.createGroup(idx, keyword).appendTo(this.$content);\n }\n });\n // select first .note-hint-item\n this.$content.find('.note-hint-item:first').addClass('active');\n\n // set position for popover after group is created\n if (this.direction === 'top') {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST,\n });\n } else {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top + bnd.height + POPOVER_DIST,\n });\n }\n }\n } else {\n this.hide();\n }\n }\n }\n\n show() {\n this.$popover.show();\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport './summernote-en-US';\nimport '../summernote';\nimport dom from './core/dom';\nimport range from './core/range';\nimport lists from './core/lists';\nimport Editor from './module/Editor';\nimport Clipboard from './module/Clipboard';\nimport Dropzone from './module/Dropzone';\nimport Codeview from './module/Codeview';\nimport Statusbar from './module/Statusbar';\nimport Fullscreen from './module/Fullscreen';\nimport Handle from './module/Handle';\nimport AutoLink from './module/AutoLink';\nimport AutoSync from './module/AutoSync';\nimport AutoReplace from './module/AutoReplace';\nimport Placeholder from './module/Placeholder';\nimport Buttons from './module/Buttons';\nimport Toolbar from './module/Toolbar';\nimport LinkDialog from './module/LinkDialog';\nimport LinkPopover from './module/LinkPopover';\nimport ImageDialog from './module/ImageDialog';\nimport ImagePopover from './module/ImagePopover';\nimport TablePopover from './module/TablePopover';\nimport VideoDialog from './module/VideoDialog';\nimport HelpDialog from './module/HelpDialog';\nimport AirPopover from './module/AirPopover';\nimport HintPopover from './module/HintPopover';\n\n$.summernote = $.extend($.summernote, {\n version: '@@VERSION@@',\n plugins: {},\n\n dom: dom,\n range: range,\n lists: lists,\n\n options: {\n langInfo: $.summernote.lang['en-US'],\n editing: true,\n modules: {\n 'editor': Editor,\n 'clipboard': Clipboard,\n 'dropzone': Dropzone,\n 'codeview': Codeview,\n 'statusbar': Statusbar,\n 'fullscreen': Fullscreen,\n 'handle': Handle,\n // FIXME: HintPopover must be front of autolink\n // - Script error about range when Enter key is pressed on hint popover\n 'hintPopover': HintPopover,\n 'autoLink': AutoLink,\n 'autoSync': AutoSync,\n 'autoReplace': AutoReplace,\n 'placeholder': Placeholder,\n 'buttons': Buttons,\n 'toolbar': Toolbar,\n 'linkDialog': LinkDialog,\n 'linkPopover': LinkPopover,\n 'imageDialog': ImageDialog,\n 'imagePopover': ImagePopover,\n 'tablePopover': TablePopover,\n 'videoDialog': VideoDialog,\n 'helpDialog': HelpDialog,\n 'airPopover': AirPopover,\n },\n\n buttons: {},\n\n lang: 'en-US',\n\n followingToolbar: false,\n toolbarPosition: 'top',\n otherStaticBar: '',\n\n // toolbar\n toolbar: [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['fontname', ['fontname']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']],\n ],\n\n // popover\n popatmouse: true,\n popover: {\n image: [\n ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n ['float', ['floatLeft', 'floatRight', 'floatNone']],\n ['remove', ['removeMedia']],\n ],\n link: [\n ['link', ['linkDialogShow', 'unlink']],\n ],\n table: [\n ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n ],\n air: [\n ['color', ['color']],\n ['font', ['bold', 'underline', 'clear']],\n ['para', ['ul', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture']],\n ['view', ['fullscreen', 'codeview']],\n ],\n },\n\n // air mode: inline editor\n airMode: false,\n overrideContextMenu: false, // TBD\n\n width: null,\n height: null,\n linkTargetBlank: true,\n useProtocol: true,\n defaultProtocol: 'http://',\n\n focus: false,\n tabDisabled: false,\n tabSize: 4,\n styleWithCSS: false,\n shortcuts: true,\n textareaAutoSync: true,\n tooltip: 'auto',\n container: null,\n maxTextLength: 0,\n blockquoteBreakingLevel: 2,\n spellCheck: true,\n disableGrammar: false,\n placeholder: null,\n inheritPlaceholder: false,\n // TODO: need to be documented\n recordEveryKeystroke: false,\n historyLimit: 200,\n\n // TODO: need to be documented\n hintMode: 'word',\n hintSelect: 'after',\n hintDirection: 'bottom',\n\n styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n fontNames: [\n 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n 'Tahoma', 'Times New Roman', 'Verdana',\n ],\n fontNamesIgnoreCheck: [],\n addDefaultFonts: true,\n\n fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n\n fontSizeUnits: ['px', 'pt'],\n\n // pallete colors(n x n)\n colors: [\n ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n ],\n\n // http://chir.ag/projects/name-that-color/\n colorsName: [\n ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n ],\n\n colorButton: {\n foreColor: '#000000',\n backColor: '#FFFF00',\n },\n\n lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n\n tableClassName: 'table table-bordered',\n\n insertTableMaxSize: {\n col: 10,\n row: 10,\n },\n\n // By default, dialogs are attached in container.\n dialogsInBody: false,\n dialogsFade: false,\n\n maximumImageFileSize: null,\n\n callbacks: {\n onBeforeCommand: null,\n onBlur: null,\n onBlurCodeview: null,\n onChange: null,\n onChangeCodeview: null,\n onDialogShown: null,\n onEnter: null,\n onFocus: null,\n onImageLinkInsert: null,\n onImageUpload: null,\n onImageUploadError: null,\n onInit: null,\n onKeydown: null,\n onKeyup: null,\n onMousedown: null,\n onMouseup: null,\n onPaste: null,\n onScroll: null,\n },\n\n codemirror: {\n mode: 'text/html',\n htmlMode: true,\n lineNumbers: true,\n },\n\n codeviewFilter: false,\n codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n codeviewIframeFilter: true,\n codeviewIframeWhitelistSrc: [],\n codeviewIframeWhitelistSrcBase: [\n 'www.youtube.com',\n 'www.youtube-nocookie.com',\n 'www.facebook.com',\n 'vine.co',\n 'instagram.com',\n 'player.vimeo.com',\n 'www.dailymotion.com',\n 'player.youku.com',\n 'v.qq.com',\n ],\n\n keyMap: {\n pc: {\n 'ENTER': 'insertParagraph',\n 'CTRL+Z': 'undo',\n 'CTRL+Y': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CTRL+B': 'bold',\n 'CTRL+I': 'italic',\n 'CTRL+U': 'underline',\n 'CTRL+SHIFT+S': 'strikethrough',\n 'CTRL+BACKSLASH': 'removeFormat',\n 'CTRL+SHIFT+L': 'justifyLeft',\n 'CTRL+SHIFT+E': 'justifyCenter',\n 'CTRL+SHIFT+R': 'justifyRight',\n 'CTRL+SHIFT+J': 'justifyFull',\n 'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n 'CTRL+SHIFT+NUM8': 'insertOrderedList',\n 'CTRL+LEFTBRACKET': 'outdent',\n 'CTRL+RIGHTBRACKET': 'indent',\n 'CTRL+NUM0': 'formatPara',\n 'CTRL+NUM1': 'formatH1',\n 'CTRL+NUM2': 'formatH2',\n 'CTRL+NUM3': 'formatH3',\n 'CTRL+NUM4': 'formatH4',\n 'CTRL+NUM5': 'formatH5',\n 'CTRL+NUM6': 'formatH6',\n 'CTRL+ENTER': 'insertHorizontalRule',\n 'CTRL+K': 'linkDialog.show',\n },\n\n mac: {\n 'ENTER': 'insertParagraph',\n 'CMD+Z': 'undo',\n 'CMD+SHIFT+Z': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CMD+B': 'bold',\n 'CMD+I': 'italic',\n 'CMD+U': 'underline',\n 'CMD+SHIFT+S': 'strikethrough',\n 'CMD+BACKSLASH': 'removeFormat',\n 'CMD+SHIFT+L': 'justifyLeft',\n 'CMD+SHIFT+E': 'justifyCenter',\n 'CMD+SHIFT+R': 'justifyRight',\n 'CMD+SHIFT+J': 'justifyFull',\n 'CMD+SHIFT+NUM7': 'insertUnorderedList',\n 'CMD+SHIFT+NUM8': 'insertOrderedList',\n 'CMD+LEFTBRACKET': 'outdent',\n 'CMD+RIGHTBRACKET': 'indent',\n 'CMD+NUM0': 'formatPara',\n 'CMD+NUM1': 'formatH1',\n 'CMD+NUM2': 'formatH2',\n 'CMD+NUM3': 'formatH3',\n 'CMD+NUM4': 'formatH4',\n 'CMD+NUM5': 'formatH5',\n 'CMD+NUM6': 'formatH6',\n 'CMD+ENTER': 'insertHorizontalRule',\n 'CMD+K': 'linkDialog.show',\n },\n },\n icons: {\n 'align': 'note-icon-align',\n 'alignCenter': 'note-icon-align-center',\n 'alignJustify': 'note-icon-align-justify',\n 'alignLeft': 'note-icon-align-left',\n 'alignRight': 'note-icon-align-right',\n 'rowBelow': 'note-icon-row-below',\n 'colBefore': 'note-icon-col-before',\n 'colAfter': 'note-icon-col-after',\n 'rowAbove': 'note-icon-row-above',\n 'rowRemove': 'note-icon-row-remove',\n 'colRemove': 'note-icon-col-remove',\n 'indent': 'note-icon-align-indent',\n 'outdent': 'note-icon-align-outdent',\n 'arrowsAlt': 'note-icon-arrows-alt',\n 'bold': 'note-icon-bold',\n 'caret': 'note-icon-caret',\n 'circle': 'note-icon-circle',\n 'close': 'note-icon-close',\n 'code': 'note-icon-code',\n 'eraser': 'note-icon-eraser',\n 'floatLeft': 'note-icon-float-left',\n 'floatRight': 'note-icon-float-right',\n 'font': 'note-icon-font',\n 'frame': 'note-icon-frame',\n 'italic': 'note-icon-italic',\n 'link': 'note-icon-link',\n 'unlink': 'note-icon-chain-broken',\n 'magic': 'note-icon-magic',\n 'menuCheck': 'note-icon-menu-check',\n 'minus': 'note-icon-minus',\n 'orderedlist': 'note-icon-orderedlist',\n 'pencil': 'note-icon-pencil',\n 'picture': 'note-icon-picture',\n 'question': 'note-icon-question',\n 'redo': 'note-icon-redo',\n 'rollback': 'note-icon-rollback',\n 'square': 'note-icon-square',\n 'strikethrough': 'note-icon-strikethrough',\n 'subscript': 'note-icon-subscript',\n 'superscript': 'note-icon-superscript',\n 'table': 'note-icon-table',\n 'textHeight': 'note-icon-text-height',\n 'trash': 'note-icon-trash',\n 'underline': 'note-icon-underline',\n 'undo': 'note-icon-undo',\n 'unorderedlist': 'note-icon-unorderedlist',\n 'video': 'note-icon-video',\n },\n },\n});\n","// extracted by mini-css-extract-plugin","import $ from 'jquery';\nimport renderer from '../base/renderer';\n\nconst editor = renderer.create('<div class=\"note-editor note-frame card\"/>');\nconst toolbar = renderer.create('<div class=\"note-toolbar card-header\" role=\"toolbar\"></div>');\nconst editingArea = renderer.create('<div class=\"note-editing-area\"/>');\nconst codable = renderer.create('<textarea class=\"note-codable\" aria-multiline=\"true\"/>');\nconst editable = renderer.create('<div class=\"note-editable card-block\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\nconst statusbar = renderer.create([\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n '<div class=\"note-statusbar\" role=\"status\">',\n '<output class=\"note-status-output\" aria-live=\"polite\"></output>',\n '<div class=\"note-resizebar\" aria-label=\"Resize\">',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '</div>',\n '</div>',\n].join(''));\n\nconst airEditor = renderer.create('<div class=\"note-editor note-airframe\"/>');\nconst airEditable = renderer.create([\n '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n].join(''));\n\nconst buttonGroup = renderer.create('<div class=\"note-btn-group btn-group\">');\n\nconst dropdown = renderer.create('<div class=\"note-dropdown-menu dropdown-menu\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n const option = (typeof item === 'object') ? item.option : undefined;\n\n const dataValue = 'data-value=\"' + value + '\"';\n const dataOption = (option !== undefined) ? ' data-option=\"' + option + '\"' : '';\n return '<a class=\"dropdown-item\" href=\"#\" ' + (dataValue + dataOption) + ' role=\"listitem\" aria-label=\"' + value + '\">' + content + '</a>';\n }).join('') : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dropdownButtonContents = function(contents) {\n return contents;\n};\n\nconst dropdownCheck = renderer.create('<div class=\"note-dropdown-menu dropdown-menu note-check\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n return '<a class=\"dropdown-item\" href=\"#\" data-value=\"' + value + '\" role=\"listitem\" aria-label=\"' + item + '\">' + icon(options.checkClassName) + ' ' + content + '</a>';\n }).join('') : options.items;\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dialog = renderer.create('<div class=\"modal note-modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function($node, options) {\n if (options.fade) {\n $node.addClass('fade');\n }\n $node.attr({\n 'aria-label': options.title,\n });\n $node.html([\n '<div class=\"modal-dialog\">',\n '<div class=\"modal-content\">',\n (options.title ? '<div class=\"modal-header\">' +\n '<h4 class=\"modal-title\">' + options.title + '</h4>' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" aria-hidden=\"true\">×</button>' +\n '</div>' : ''),\n '<div class=\"modal-body\">' + options.body + '</div>',\n (options.footer ? '<div class=\"modal-footer\">' + options.footer + '</div>' : ''),\n '</div>',\n '</div>',\n ].join(''));\n});\n\nconst popover = renderer.create([\n '<div class=\"note-popover popover in\">',\n '<div class=\"arrow\"/>',\n '<div class=\"popover-content note-children-container\"/>',\n '</div>',\n].join(''), function($node, options) {\n const direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n\n $node.addClass(direction);\n\n if (options.hideArrow) {\n $node.find('.arrow').hide();\n }\n});\n\nconst checkbox = renderer.create('<div class=\"form-check\"></div>', function($node, options) {\n $node.html([\n '<label class=\"form-check-label\"' + (options.id ? ' for=\"note-' + options.id + '\"' : '') + '>',\n '<input type=\"checkbox\" class=\"form-check-input\"' + (options.id ? ' id=\"note-' + options.id + '\"' : ''),\n (options.checked ? ' checked' : ''),\n ' aria-label=\"' + (options.text ? options.text : '') + '\"',\n ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n ' ' + (options.text ? options.text : '') +\n '</label>',\n ].join(''));\n});\n\nconst icon = function(iconClassName, tagName) {\n tagName = tagName || 'i';\n return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n};\n\nconst ui = function(editorOptions) {\n return {\n editor: editor,\n toolbar: toolbar,\n editingArea: editingArea,\n codable: codable,\n editable: editable,\n statusbar: statusbar,\n airEditor: airEditor,\n airEditable: airEditable,\n buttonGroup: buttonGroup,\n dropdown: dropdown,\n dropdownButtonContents: dropdownButtonContents,\n dropdownCheck: dropdownCheck,\n dialog: dialog,\n popover: popover,\n icon: icon,\n checkbox: checkbox,\n options: editorOptions,\n\n palette: function($node, options) {\n return renderer.create('<div class=\"note-color-palette\"/>', function($node, options) {\n const contents = [];\n for (let row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n const eventName = options.eventName;\n const colors = options.colors[row];\n const colorsName = options.colorsName[row];\n const buttons = [];\n for (let col = 0, colSize = colors.length; col < colSize; col++) {\n const color = colors[col];\n const colorName = colorsName[col];\n buttons.push([\n '<button type=\"button\" class=\"note-color-btn\"',\n 'style=\"background-color:', color, '\" ',\n 'data-event=\"', eventName, '\" ',\n 'data-value=\"', color, '\" ',\n 'title=\"', colorName, '\" ',\n 'aria-label=\"', colorName, '\" ',\n 'data-toggle=\"button\" tabindex=\"-1\"></button>',\n ].join(''));\n }\n contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n }\n $node.html(contents.join(''));\n\n if (options.tooltip) {\n $node.find('.note-color-btn').tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n });\n }\n })($node, options);\n },\n\n button: function($node, options) {\n return renderer.create('<button type=\"button\" class=\"note-btn btn btn-light btn-sm\" tabindex=\"-1\">', function($node, options) {\n if (options && options.tooltip) {\n $node.attr({\n title: options.tooltip,\n 'aria-label': options.tooltip,\n }).tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n }).on('click', (e) => {\n $(e.currentTarget).tooltip('hide');\n });\n }\n })($node, options);\n },\n\n toggleBtn: function($btn, isEnable) {\n $btn.toggleClass('disabled', !isEnable);\n $btn.attr('disabled', !isEnable);\n },\n\n toggleBtnActive: function($btn, isActive) {\n $btn.toggleClass('active', isActive);\n },\n\n onDialogShown: function($dialog, handler) {\n $dialog.one('shown.bs.modal', handler);\n },\n\n onDialogHidden: function($dialog, handler) {\n $dialog.one('hidden.bs.modal', handler);\n },\n\n showDialog: function($dialog) {\n $dialog.modal('show');\n },\n\n hideDialog: function($dialog) {\n $dialog.modal('hide');\n },\n\n createLayout: function($note) {\n const $editor = (editorOptions.airMode ? airEditor([\n editingArea([\n codable(),\n airEditable(),\n ]),\n ]) : (editorOptions.toolbarPosition === 'bottom'\n ? editor([\n editingArea([\n codable(),\n editable(),\n ]),\n toolbar(),\n statusbar(),\n ])\n : editor([\n toolbar(),\n editingArea([\n codable(),\n editable(),\n ]),\n statusbar(),\n ])\n )).render();\n\n $editor.insertAfter($note);\n\n return {\n note: $note,\n editor: $editor,\n toolbar: $editor.find('.note-toolbar'),\n editingArea: $editor.find('.note-editing-area'),\n editable: $editor.find('.note-editable'),\n codable: $editor.find('.note-codable'),\n statusbar: $editor.find('.note-statusbar'),\n };\n },\n\n removeLayout: function($note, layoutInfo) {\n $note.html(layoutInfo.editable.html());\n layoutInfo.editor.remove();\n $note.show();\n },\n };\n};\n\nexport default ui;\n","import $ from 'jquery';\nimport ui from './ui';\nimport '../base/settings.js';\n\nimport '../../styles/summernote-bs4.scss';\n\n$.summernote = $.extend($.summernote, {\n ui_template: ui,\n interface: 'bs4',\n});\n\n$.summernote.options.styleTags = [\n 'p',\n { title: 'Blockquote', tag: 'blockquote', className: 'blockquote', value: 'blockquote' },\n 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n];\n"],"sourceRoot":""}
File: public/AdminLTE/plugins/summernote/summernote-bs4.min.js
Match lines: 1
2|!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var n="object"==typeof exports?e(require("jquery")):e(t.jQuery);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=53)}({0:function(e,n){e.exports=t},1:function(t,e,n){"use strict";var o=n(0),i=n.n(o);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var s=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.markup=e,this.children=n,this.options=o,this.callback=i}var e,n,o;return e=t,(n=[{key:"render",value:function(t){var e=i()(this.markup);if(this.options&&this.options.contents&&e.html(this.options.contents),this.options&&this.options.className&&e.addClass(this.options.className),this.options&&this.options.data&&i.a.each(this.options.data,(function(t,n){e.attr("data-"+t,n)})),this.options&&this.options.click&&e.on("click",this.options.click),this.children){var n=e.find(".note-children-container");this.children.forEach((function(t){t.render(n.length?n:e)}))}return this.callback&&this.callback(e,this.options),this.options&&this.options.callback&&this.options.callback(e),t&&t.append(e),e}}])&&a(e.prototype,n),o&&a(e,o),t}();e.a={create:function(t,e){return function(){var n="object"===r(arguments[1])?arguments[1]:arguments[0],o=Array.isArray(arguments[0])?arguments[0]:[];return n&&n.children&&(o=n.children),new s(t,o,n,e)}}}},2:function(t,e){(function(e){t.exports=e}).call(this,{})},3:function(t,e,n){"use strict";var o=n(0),i=n.n(o);i.a.summernote=i.a.summernote||{lang:{}},i.a.extend(i.a.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window",useProtocol:"Use default protocol"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"},output:{noSelection:"No Selection Made!"}}});var r="function"==typeof define&&n(2),a=["sans-serif","serif","monospace","cursive","fantasy"];function s(t){return-1===i.a.inArray(t.toLowerCase(),a)?"'".concat(t,"'"):t}var l,c=navigator.userAgent,u=/MSIE|Trident/i.test(c);if(u){var d=/MSIE (\d+[.]\d+)/.exec(c);d&&(l=parseFloat(d[1])),(d=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(c))&&(l=parseFloat(d[1]))}var h=/Edge\/\d+/.test(c),f=!!window.CodeMirror,p="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,m=u?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",v={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:u,isEdge:h,isFF:!h&&/firefox/i.test(c),isPhantom:/PhantomJS/i.test(c),isWebkit:!h&&/webkit/i.test(c),isChrome:!h&&/chrome/i.test(c),isSafari:!h&&/safari/i.test(c)&&!/chrome/i.test(c),browserVersion:l,jqueryVersion:parseFloat(i.a.fn.jquery),isSupportAmd:r,isSupportTouch:p,hasCodeMirror:f,isFontInstalled:function(t){var e="Comic Sans MS"===t?"Courier New":"Comic Sans MS",n=document.createElement("canvas").getContext("2d");n.font="200px '"+e+"'";var o=n.measureText("mmmmmmmmmmwwwww").width;return n.font="200px "+s(t)+', "'+e+'"',o!==n.measureText("mmmmmmmmmmwwwww").width},isW3CRangeSupport:!!document.createRange,inputEventName:m,genericFontFamilies:a,validFontName:s};var g=0;var b={eq:function(t){return function(e){return t===e}},eq2:function(t,e){return t===e},peq2:function(t){return function(e,n){return e[t]===n[t]}},ok:function(){return!0},fail:function(){return!1},self:function(t){return t},not:function(t){return function(){return!t.apply(t,arguments)}},and:function(t,e){return function(n){return t(n)&&e(n)}},invoke:function(t,e){return function(){return t[e].apply(t,arguments)}},resetUniqueId:function(){g=0},uniqueId:function(t){var e=++g+"";return t?t+e:e},rect2bnd:function(t){var e=i()(document);return{top:t.top+e.scrollTop(),left:t.left+e.scrollLeft(),width:t.right-t.left,height:t.bottom-t.top}},invertObject:function(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[t[n]]=n);return e},namespaceToCamel:function(t,e){return(e=e||"")+t.split(".").map((function(t){return t.substring(0,1).toUpperCase()+t.substring(1)})).join("")},debounce:function(t,e,n){var o;return function(){var i=this,r=arguments,a=function(){o=null,n||t.apply(i,r)},s=n&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(i,r)}},isValidUrl:function(t){return/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)}};function y(t){return t[0]}function k(t){return t[t.length-1]}function w(t){return t.slice(1)}function C(t,e){if(t&&t.length&&e){if(t.indexOf)return-1!==t.indexOf(e);if(t.contains)return t.contains(e)}return!1}var x={head:y,last:k,initial:function(t){return t.slice(0,t.length-1)},tail:w,prev:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n-1]}return null},next:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n+1]}return null},find:function(t,e){for(var n=0,o=t.length;n<o;n++){var i=t[n];if(e(i))return i}},contains:C,all:function(t,e){for(var n=0,o=t.length;n<o;n++)if(!e(t[n]))return!1;return!0},sum:function(t,e){return e=e||b.self,t.reduce((function(t,n){return t+e(n)}),0)},from:function(t){for(var e=[],n=t.length,o=-1;++o<n;)e[o]=t[o];return e},isEmpty:function(t){return!t||!t.length},clusterBy:function(t,e){return t.length?w(t).reduce((function(t,n){var o=k(t);return e(k(o),n)?o[o.length]=n:t[t.length]=[n],t}),[[y(t)]]):[]},compact:function(t){for(var e=[],n=0,o=t.length;n<o;n++)t[n]&&e.push(t[n]);return e},unique:function(t){for(var e=[],n=0,o=t.length;n<o;n++)C(e,t[n])||e.push(t[n]);return e}},S=String.fromCharCode(160);function T(t){return t&&i()(t).hasClass("note-editable")}function E(t){return t=t.toUpperCase(),function(e){return e&&e.nodeName.toUpperCase()===t}}function I(t){return t&&3===t.nodeType}function $(t){return t&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(t.nodeName.toUpperCase())}function N(t){return!T(t)&&(t&&/^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))}var P=E("PRE"),R=E("LI");var L=E("TABLE"),A=E("DATA");function F(t){return!(M(t)||D(t)||H(t)||N(t)||L(t)||B(t)||A(t))}function D(t){return t&&/^UL|^OL/.test(t.nodeName.toUpperCase())}var H=E("HR");function z(t){return t&&/^TD|^TH/.test(t.nodeName.toUpperCase())}var B=E("BLOCKQUOTE");function M(t){return z(t)||B(t)||T(t)}var O=E("A");var U=E("BODY");var j=v.isMSIE&&v.browserVersion<11?" ":"<br>";function W(t){return I(t)?t.nodeValue.length:t?t.childNodes.length:0}function K(t){var e=W(t);return 0===e||(!I(t)&&1===e&&t.innerHTML===j||!(!x.all(t.childNodes,I)||""!==t.innerHTML))}function q(t){$(t)||W(t)||(t.innerHTML=j)}function V(t,e){for(;t;){if(e(t))return t;if(T(t))break;t=t.parentNode}return null}function _(t,e){e=e||b.fail;var n=[];return V(t,(function(t){return T(t)||n.push(t),e(t)})),n}function G(t,e){e=e||b.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.nextSibling;return n}function Y(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function Z(t,e){return i.a.each(e,(function(e,n){t.appendChild(n)})),t}function X(t){return 0===t.offset}function Q(t){return t.offset===W(t.node)}function J(t){return X(t)||Q(t)}function tt(t,e){for(;t&&t!==e;){if(0!==nt(t))return!1;t=t.parentNode}return!0}function et(t,e){if(!e)return!1;for(;t&&t!==e;){if(nt(t)!==W(t.parentNode)-1)return!1;t=t.parentNode}return!0}function nt(t){for(var e=0;t=t.previousSibling;)e+=1;return e}function ot(t){return!!(t&&t.childNodes&&t.childNodes.length)}function it(t,e){var n,o;if(0===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)}else ot(t.node)?o=W(n=t.node.childNodes[t.offset-1]):(n=t.node,o=e?0:t.offset-1);return{node:n,offset:o}}function rt(t,e){var n,o;if(K(t.node))return null;if(W(t.node)===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)+1}else if(ot(t.node)){if(o=0,K(n=t.node.childNodes[t.offset]))return null}else if(n=t.node,o=e?W(t.node):t.offset+1,K(n))return null;return{node:n,offset:o}}function at(t,e){return t.node===e.node&&t.offset===e.offset}function st(t,e){var n=e&&e.isSkipPaddingBlankHTML,o=e&&e.isNotSplitEdgePoint,i=e&&e.isDiscardEmptySplits;if(i&&(n=!0),J(t)&&(I(t.node)||o)){if(X(t))return t.node;if(Q(t))return t.node.nextSibling}if(I(t.node))return t.node.splitText(t.offset);var r=t.node.childNodes[t.offset],a=Y(t.node.cloneNode(!1),t.node);return Z(a,G(r)),n||(q(t.node),q(a)),i&&(K(t.node)&&ut(t.node),K(a))?(ut(a),t.node.nextSibling):a}function lt(t,e,n){var o=_(e.node,b.eq(t));return o.length?1===o.length?st(e,n):o.reduce((function(t,o){return t===e.node&&(t=st(e,n)),st({node:o,offset:t?nt(t):W(o)},n)})):null}function ct(t){return document.createElement(t)}function ut(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var n=t.parentNode;if(!e){for(var o=[],i=0,r=t.childNodes.length;i<r;i++)o.push(t.childNodes[i]);for(var a=0,s=o.length;a<s;a++)n.insertBefore(o[a],t)}n.removeChild(t)}}var dt=E("TEXTAREA");function ht(t,e){var n=dt(t[0])?t.val():t.html();return e?n.replace(/[\n\r]/g,""):n}var ft={NBSP_CHAR:S,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:j,emptyPara:"<p>".concat(j,"</p>"),makePredByNodeName:E,isEditable:T,isControlSizing:function(t){return t&&i()(t).hasClass("note-control-sizing")},isText:I,isElement:function(t){return t&&1===t.nodeType},isVoid:$,isPara:N,isPurePara:function(t){return N(t)&&!R(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:F,isBlock:b.not(F),isBodyInline:function(t){return F(t)&&!V(t,N)},isBody:U,isParaInline:function(t){return F(t)&&!!V(t,N)},isPre:P,isList:D,isTable:L,isData:A,isCell:z,isBlockquote:B,isBodyContainer:M,isAnchor:O,isDiv:E("DIV"),isLi:R,isBR:E("BR"),isSpan:E("SPAN"),isB:E("B"),isU:E("U"),isS:E("S"),isI:E("I"),isImg:E("IMG"),isTextarea:dt,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return K(t)},isEmpty:K,isEmptyAnchor:b.and(O,K),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||b.ok;var n=[];return t.previousSibling&&e(t.previousSibling)&&n.push(t.previousSibling),n.push(t),t.nextSibling&&e(t.nextSibling)&&n.push(t.nextSibling),n},nodeLength:W,isLeftEdgePoint:X,isRightEdgePoint:Q,isEdgePoint:J,isLeftEdgeOf:tt,isRightEdgeOf:et,isLeftEdgePointOf:function(t,e){return X(t)&&tt(t.node,e)},isRightEdgePointOf:function(t,e){return Q(t)&&et(t.node,e)},prevPoint:it,nextPoint:rt,isSamePoint:at,isVisiblePoint:function(t){if(I(t.node)||!ot(t.node)||K(t.node))return!0;var e=t.node.childNodes[t.offset-1],n=t.node.childNodes[t.offset];return!(e&&!$(e)||n&&!$(n))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=it(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=rt(t)}return null},isCharPoint:function(t){if(!I(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==S},isSpacePoint:function(t){if(!I(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return" "===e||e===S},walkPoint:function(t,e,n,o){for(var i=t;i&&(n(i),!at(i,e));){i=rt(i,o&&t.node!==i.node&&e.node!==i.node)}},ancestor:V,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===W(t);){if(e(t))return t;if(T(t))break;t=t.parentNode}return null},listAncestor:_,lastAncestor:function(t,e){var n=_(t);return x.last(n.filter(e))},listNext:G,listPrev:function(t,e){e=e||b.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.previousSibling;return n},listDescendant:function(t,e){var n=[];return e=e||b.ok,function o(i){t!==i&&e(i)&&n.push(i);for(var r=0,a=i.childNodes.length;r<a;r++)o(i.childNodes[r])}(t),n},commonAncestor:function(t,e){for(var n=_(t),o=e;o;o=o.parentNode)if(n.indexOf(o)>-1)return o;return null},wrap:function(t,e){var n=t.parentNode,o=i()("<"+e+">")[0];return n.insertBefore(o,t),o.appendChild(t),o},insertAfter:Y,appendChildNodes:Z,position:nt,hasChildren:ot,makeOffsetPath:function(t,e){return _(e,b.eq(t)).map(nt).reverse()},fromOffsetPath:function(t,e){for(var n=t,o=0,i=e.length;o<i;o++)n=n.childNodes.length<=e[o]?n.childNodes[n.childNodes.length-1]:n.childNodes[e[o]];return n},splitTree:lt,splitPoint:function(t,e){var n,o,i=e?N:M,r=_(t.node,i),a=x.last(r)||t.node;i(a)?(n=r[r.length-2],o=a):o=(n=a).parentNode;var s=n&<(n,t,{isSkipPaddingBlankHTML:e,isNotSplitEdgePoint:e});return s||o!==t.node||(s=t.node.childNodes[t.offset]),{rightNode:s,container:o}},create:ct,createText:function(t){return document.createTextNode(t)},remove:ut,removeWhile:function(t,e){for(;t&&!T(t)&&e(t);){var n=t.parentNode;ut(t),t=n}},replace:function(t,e){if(t.nodeName.toUpperCase()===e.toUpperCase())return t;var n=ct(e);return t.style.cssText&&(n.style.cssText=t.style.cssText),Z(n,x.from(t.childNodes)),Y(n,t),ut(t),n},html:function(t,e){var n=ht(t);if(e){n=(n=n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g,(function(t,e,n){n=n.toUpperCase();var o=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!e,i=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return t+(o||i?"\n":"")}))).trim()}return n},value:ht,posFromPlaceholder:function(t){var e=i()(t),n=e.offset(),o=e.outerHeight(!0);return{left:n.left,top:n.top+o}},attachEvents:function(t,e){Object.keys(e).forEach((function(n){t.on(n,e[n])}))},detachEvents:function(t,e){Object.keys(e).forEach((function(n){t.off(n,e[n])}))},isCustomStyleTag:function(t){return t&&!I(t)&&x.contains(t.classList,"note-styletag")}};function pt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var mt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$note=e,this.memos={},this.modules={},this.layoutInfo={},this.options=i.a.extend(!0,{},n),i.a.summernote.ui=i.a.summernote.ui_template(this.options),this.ui=i.a.summernote.ui,this.initialize()}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}},{key:"destroy",value:function(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}},{key:"reset",value:function(){var t=this.isDisabled();this.code(ft.emptyPara),this._destroy(),this._initialize(),t&&this.disable()}},{key:"_initialize",value:function(){var t=this;this.options.id=b.uniqueId(i.a.now()),this.options.container=this.options.container||this.layoutInfo.editor;var e=i.a.extend({},this.options.buttons);Object.keys(e).forEach((function(n){t.memo("button."+n,e[n])}));var n=i.a.extend({},this.options.modules,i.a.summernote.plugins||{});Object.keys(n).forEach((function(e){t.module(e,n[e],!0)})),Object.keys(this.modules).forEach((function(e){t.initializeModule(e)}))}},{key:"_destroy",value:function(){var t=this;Object.keys(this.modules).reverse().forEach((function(e){t.removeModule(e)})),Object.keys(this.memos).forEach((function(e){t.removeMemo(e)})),this.triggerEvent("destroy",this)}},{key:"code",value:function(t){var e=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),e?this.layoutInfo.codable.val():this.layoutInfo.editable.html();e?this.layoutInfo.codable.val(t):this.layoutInfo.editable.html(t),this.$note.val(t),this.triggerEvent("change",t,this.layoutInfo.editable)}},{key:"isDisabled",value:function(){return"false"===this.layoutInfo.editable.attr("contenteditable")}},{key:"enable",value:function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}},{key:"disable",value:function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}},{key:"triggerEvent",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=this.options.callbacks[b.namespaceToCamel(t,"on")];n&&n.apply(this.$note[0],e),this.$note.trigger("summernote."+t,e)}},{key:"initializeModule",value:function(t){var e=this.modules[t];e.shouldInitialize=e.shouldInitialize||b.ok,e.shouldInitialize()&&(e.initialize&&e.initialize(),e.events&&ft.attachEvents(this.$note,e.events))}},{key:"module",value:function(t,e,n){if(1===arguments.length)return this.modules[t];this.modules[t]=new e(this),n||this.initializeModule(t)}},{key:"removeModule",value:function(t){var e=this.modules[t];e.shouldInitialize()&&(e.events&&ft.detachEvents(this.$note,e.events),e.destroy&&e.destroy()),delete this.modules[t]}},{key:"memo",value:function(t,e){if(1===arguments.length)return this.memos[t];this.memos[t]=e}},{key:"removeMemo",value:function(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]}},{key:"createInvokeHandlerAndUpdateState",value:function(t,e){var n=this;return function(o){n.createInvokeHandler(t,e)(o),n.invoke("buttons.updateCurrentStyle")}}},{key:"createInvokeHandler",value:function(t,e){var n=this;return function(o){o.preventDefault();var r=i()(o.target);n.invoke(t,e||r.closest("[data-value]").data("value"),r)}}},{key:"invoke",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=t.split("."),o=n.length>1,i=o&&x.head(n),r=o?x.last(n):x.head(n),a=this.modules[i||"editor"];return!i&&this[r]?this[r].apply(this,e):a&&a[r]&&a.shouldInitialize()?a[r].apply(a,e):void 0}}])&&pt(e.prototype,n),o&&pt(e,o),t}();function vt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function gt(t,e){var n,o,i=t.parentElement(),r=document.body.createTextRange(),a=x.from(i.childNodes);for(n=0;n<a.length;n++)if(!ft.isText(a[n])){if(r.moveToElementText(a[n]),r.compareEndPoints("StartToStart",t)>=0)break;o=a[n]}if(0!==n&&ft.isText(a[n-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(o||i),s.collapse(!o),l=o?o.nextSibling:i.firstChild;var c=t.duplicate();c.setEndPoint("StartToStart",s);for(var u=c.text.replace(/[\r\n]/g,"").length;u>l.nodeValue.length&&l.nextSibling;)u-=l.nodeValue.length,l=l.nextSibling;l.nodeValue;e&&l.nextSibling&&ft.isText(l.nextSibling)&&u===l.nodeValue.length&&(u-=l.nodeValue.length,l=l.nextSibling),i=l,n=u}return{cont:i,offset:n}}function bt(t){var e=document.body.createTextRange(),n=function t(e,n){var o,i;if(ft.isText(e)){var r=ft.listPrev(e,b.not(ft.isText)),a=x.last(r).previousSibling;o=a||e.parentNode,n+=x.sum(x.tail(r),ft.nodeLength),i=!a}else{if(o=e.childNodes[n]||e,ft.isText(o))return t(o,0);n=0,i=!1}return{node:o,collapseToStart:i,offset:n}}(t.node,t.offset);return e.moveToElementText(n.node),e.collapse(n.collapseToStart),e.moveStart("character",n.offset),e}i.a.fn.extend({summernote:function(){var t=i.a.type(x.head(arguments)),e="string"===t,n="object"===t,o=i.a.extend({},i.a.summernote.options,n?x.head(arguments):{});o.langInfo=i.a.extend(!0,{},i.a.summernote.lang["en-US"],i.a.summernote.lang[o.lang]),o.icons=i.a.extend(!0,{},i.a.summernote.options.icons,o.icons),o.tooltip="auto"===o.tooltip?!v.isSupportTouch:o.tooltip,this.each((function(t,e){var n=i()(e);if(!n.data("summernote")){var r=new mt(n,o);n.data("summernote",r),n.data("summernote").triggerEvent("init",r.layoutInfo)}}));var r=this.first();if(r.length){var a=r.data("summernote");if(e)return a.invoke.apply(a,x.from(arguments));o.focus&&a.invoke("editor.focus")}return this}});var yt=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sc=e,this.so=n,this.ec=o,this.eo=i,this.isOnEditable=this.makeIsOn(ft.isEditable),this.isOnList=this.makeIsOn(ft.isList),this.isOnAnchor=this.makeIsOn(ft.isAnchor),this.isOnCell=this.makeIsOn(ft.isCell),this.isOnData=this.makeIsOn(ft.isData)}var e,n,o;return e=t,(n=[{key:"nativeRange",value:function(){if(v.isW3CRangeSupport){var t=document.createRange();return t.setStart(this.sc,this.sc.data&&this.so>this.sc.data.length?0:this.so),t.setEnd(this.ec,this.sc.data?Math.min(this.eo,this.sc.data.length):this.eo),t}var e=bt({node:this.sc,offset:this.so});return e.setEndPoint("EndToEnd",bt({node:this.ec,offset:this.eo})),e}},{key:"getPoints",value:function(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function(){var t=this.nativeRange();if(v.isW3CRangeSupport){var e=document.getSelection();e.rangeCount>0&&e.removeAllRanges(),e.addRange(t)}else t.select();return this}},{key:"scrollIntoView",value:function(t){var e=i()(t).height();return t.scrollTop+e<this.sc.offsetTop&&(t.scrollTop+=Math.abs(t.scrollTop+e-this.sc.offsetTop)),this}},{key:"normalize",value:function(){var e=function(t,e){if(!t)return t;if(ft.isVisiblePoint(t)&&(!ft.isEdgePoint(t)||ft.isRightEdgePoint(t)&&!e||ft.isLeftEdgePoint(t)&&e||ft.isRightEdgePoint(t)&&e&&ft.isVoid(t.node.nextSibling)||ft.isLeftEdgePoint(t)&&!e&&ft.isVoid(t.node.previousSibling)||ft.isBlock(t.node)&&ft.isEmpty(t.node)))return t;var n=ft.ancestor(t.node,ft.isBlock),o=!1;if(!o){var i=ft.prevPoint(t)||{node:null};o=(ft.isLeftEdgePointOf(t,n)||ft.isVoid(i.node))&&!e}var r=!1;if(!r){var a=ft.nextPoint(t)||{node:null};r=(ft.isRightEdgePointOf(t,n)||ft.isVoid(a.node))&&e}if(o||r){if(ft.isVisiblePoint(t))return t;e=!e}return(e?ft.nextPointUntil(ft.nextPoint(t),ft.isVisiblePoint):ft.prevPointUntil(ft.prevPoint(t),ft.isVisiblePoint))||t},n=e(this.getEndPoint(),!1),o=this.isCollapsed()?n:e(this.getStartPoint(),!0);return new t(o.node,o.offset,n.node,n.offset)}},{key:"nodes",value:function(t,e){t=t||b.ok;var n=e&&e.includeAncestor,o=e&&e.fullyContains,i=this.getStartPoint(),r=this.getEndPoint(),a=[],s=[];return ft.walkPoint(i,r,(function(e){var i;ft.isEditable(e.node)||(o?(ft.isLeftEdgePoint(e)&&s.push(e.node),ft.isRightEdgePoint(e)&&x.contains(s,e.node)&&(i=e.node)):i=n?ft.ancestor(e.node,t):e.node,i&&t(i)&&a.push(i))}),!0),x.unique(a)}},{key:"commonAncestor",value:function(){return ft.commonAncestor(this.sc,this.ec)}},{key:"expand",value:function(e){var n=ft.ancestor(this.sc,e),o=ft.ancestor(this.ec,e);if(!n&&!o)return new t(this.sc,this.so,this.ec,this.eo);var i=this.getPoints();return n&&(i.sc=n,i.so=0),o&&(i.ec=o,i.eo=ft.nodeLength(o)),new t(i.sc,i.so,i.ec,i.eo)}},{key:"collapse",value:function(e){return e?new t(this.sc,this.so,this.sc,this.so):new t(this.ec,this.eo,this.ec,this.eo)}},{key:"splitText",value:function(){var e=this.sc===this.ec,n=this.getPoints();return ft.isText(this.ec)&&!ft.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),ft.isText(this.sc)&&!ft.isEdgePoint(this.getStartPoint())&&(n.sc=this.sc.splitText(this.so),n.so=0,e&&(n.ec=n.sc,n.eo=this.eo-this.so)),new t(n.sc,n.so,n.ec,n.eo)}},{key:"deleteContents",value:function(){if(this.isCollapsed())return this;var e=this.splitText(),n=e.nodes(null,{fullyContains:!0}),o=ft.prevPointUntil(e.getStartPoint(),(function(t){return!x.contains(n,t.node)})),r=[];return i.a.each(n,(function(t,e){var n=e.parentNode;o.node!==n&&1===ft.nodeLength(n)&&r.push(n),ft.remove(e,!1)})),i.a.each(r,(function(t,e){ft.remove(e,!1)})),new t(o.node,o.offset,o.node,o.offset).normalize()}},{key:"makeIsOn",value:function(t){return function(){var e=ft.ancestor(this.sc,t);return!!e&&e===ft.ancestor(this.ec,t)}}},{key:"isLeftEdgeOf",value:function(t){if(!ft.isLeftEdgePoint(this.getStartPoint()))return!1;var e=ft.ancestor(this.sc,t);return e&&ft.isLeftEdgeOf(this.sc,e)}},{key:"isCollapsed",value:function(){return this.sc===this.ec&&this.so===this.eo}},{key:"wrapBodyInlineWithPara",value:function(){if(ft.isBodyContainer(this.sc)&&ft.isEmpty(this.sc))return this.sc.innerHTML=ft.emptyPara,new t(this.sc.firstChild,0,this.sc.firstChild,0);var e,n=this.normalize();if(ft.isParaInline(this.sc)||ft.isPara(this.sc))return n;if(ft.isInline(n.sc)){var o=ft.listAncestor(n.sc,b.not(ft.isInline));e=x.last(o),ft.isInline(e)||(e=o[o.length-2]||n.sc.childNodes[n.so])}else e=n.sc.childNodes[n.so>0?n.so-1:0];if(e){var i=ft.listPrev(e,ft.isParaInline).reverse();if((i=i.concat(ft.listNext(e.nextSibling,ft.isParaInline))).length){var r=ft.wrap(x.head(i),"p");ft.appendChildNodes(r,x.tail(i))}}return this.normalize()}},{key:"insertNode",value:function(t){var e=this;(ft.isText(t)||ft.isInline(t))&&(e=this.wrapBodyInlineWithPara().deleteContents());var n=ft.splitPoint(e.getStartPoint(),ft.isInline(t));return n.rightNode?n.rightNode.parentNode.insertBefore(t,n.rightNode):n.container.appendChild(t),t}},{key:"pasteHTML",value:function(t){t=i.a.trim(t);var e=i()("<div></div>").html(t)[0],n=x.from(e.childNodes),o=this;return o.so>=0&&(n=n.reverse()),n=n.map((function(t){return o.insertNode(t)})),o.so>0&&(n=n.reverse()),n}},{key:"toString",value:function(){var t=this.nativeRange();return v.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(e){var n=this.getEndPoint();if(!ft.isCharPoint(n))return this;var o=ft.prevPointUntil(n,(function(t){return!ft.isCharPoint(t)}));return e&&(n=ft.nextPointUntil(n,(function(t){return!ft.isCharPoint(t)}))),new t(o.node,o.offset,n.node,n.offset)}},{key:"getWordsRange",value:function(e){var n=this.getEndPoint(),o=function(t){return!ft.isCharPoint(t)&&!ft.isSpacePoint(t)};if(o(n))return this;var i=ft.prevPointUntil(n,o);return e&&(n=ft.nextPointUntil(n,o)),new t(i.node,i.offset,n.node,n.offset)}},{key:"getWordsMatchRange",value:function(e){var n=this.getEndPoint(),o=ft.prevPointUntil(n,(function(o){if(!ft.isCharPoint(o)&&!ft.isSpacePoint(o))return!0;var i=new t(o.node,o.offset,n.node,n.offset),r=e.exec(i.toString());return r&&0===r.index})),i=new t(o.node,o.offset,n.node,n.offset),r=i.toString(),a=e.exec(r);return a&&a[0].length===r.length?i:null}},{key:"bookmark",value:function(t){return{s:{path:ft.makeOffsetPath(t,this.sc),offset:this.so},e:{path:ft.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:x.tail(ft.makeOffsetPath(x.head(t),this.sc)),offset:this.so},e:{path:x.tail(ft.makeOffsetPath(x.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}])&&vt(e.prototype,n),o&&vt(e,o),t}(),kt={create:function(t,e,n,o){if(4===arguments.length)return new yt(t,e,n,o);if(2===arguments.length)return new yt(t,e,n=t,o=e);var i=this.createFromSelection();if(!i&&1===arguments.length){var r=arguments[0];return ft.isEditable(r)&&(r=r.lastChild),this.createFromBodyElement(r,ft.emptyPara===arguments[0].innerHTML)}return i},createFromBodyElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.createFromNode(t);return n.collapse(e)},createFromSelection:function(){var t,e,n,o;if(v.isW3CRangeSupport){var i=document.getSelection();if(!i||0===i.rangeCount)return null;if(ft.isBody(i.anchorNode))return null;var r=i.getRangeAt(0);t=r.startContainer,e=r.startOffset,n=r.endContainer,o=r.endOffset}else{var a=document.selection.createRange(),s=a.duplicate();s.collapse(!1);var l=a;l.collapse(!0);var c=gt(l,!0),u=gt(s,!1);ft.isText(c.node)&&ft.isLeftEdgePoint(c)&&ft.isTextNode(u.node)&&ft.isRightEdgePoint(u)&&u.node.nextSibling===c.node&&(c=u),t=c.cont,e=c.offset,n=u.cont,o=u.offset}return new yt(t,e,n,o)},createFromNode:function(t){var e=t,n=0,o=t,i=ft.nodeLength(o);return ft.isVoid(e)&&(n=ft.listPrev(e).length-1,e=e.parentNode),ft.isBR(o)?(i=ft.listPrev(o).length-1,o=o.parentNode):ft.isVoid(o)&&(i=ft.listPrev(o).length,o=o.parentNode),this.create(e,n,o,i)},createFromNodeBefore:function(t){return this.createFromNode(t).collapse(!0)},createFromNodeAfter:function(t){return this.createFromNode(t).collapse()},createFromBookmark:function(t,e){var n=ft.fromOffsetPath(t,e.s.path),o=e.s.offset,i=ft.fromOffsetPath(t,e.e.path),r=e.e.offset;return new yt(n,o,i,r)},createFromParaBookmark:function(t,e){var n=t.s.offset,o=t.e.offset,i=ft.fromOffsetPath(x.head(e),t.s.path),r=ft.fromOffsetPath(x.last(e),t.e.path);return new yt(i,n,r,o)}},wt={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34},Ct={isEdit:function(t){return x.contains([wt.BACKSPACE,wt.TAB,wt.ENTER,wt.SPACE,wt.DELETE],t)},isMove:function(t){return x.contains([wt.LEFT,wt.UP,wt.RIGHT,wt.DOWN],t)},isNavigation:function(t){return x.contains([wt.HOME,wt.END,wt.PAGEUP,wt.PAGEDOWN],t)},nameFromCode:b.invertObject(wt),code:wt};function xt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var St=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stack=[],this.stackOffset=-1,this.context=e,this.$editable=e.layoutInfo.editable,this.editable=this.$editable[0]}var e,n,o;return e=t,(n=[{key:"makeSnapshot",value:function(){var t=kt.create(this.editable);return{contents:this.$editable.html(),bookmark:t&&t.isOnEditable()?t.bookmark(this.editable):{s:{path:[],offset:0},e:{path:[],offset:0}}}}},{key:"applySnapshot",value:function(t){null!==t.contents&&this.$editable.html(t.contents),null!==t.bookmark&&kt.createFromBookmark(this.editable,t.bookmark).select()}},{key:"rewind",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}},{key:"commit",value:function(){this.stack=[],this.stackOffset=-1,this.recordUndo()}},{key:"reset",value:function(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}},{key:"undo",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset>0&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"redo",value:function(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),this.stackOffset-=1)}}])&&xt(e.prototype,n),o&&xt(e,o),t}();function Tt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Et=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"jQueryCSS",value:function(t,e){if(v.jqueryVersion<1.9){var n={};return i.a.each(e,(function(e,o){n[o]=t.css(o)})),n}return t.css(e)}},{key:"fromNode",value:function(t){var e=this.jQueryCSS(t,["font-family","font-size","text-align","list-style-type","line-height"])||{},n=t[0].style.fontSize||e["font-size"];return e["font-size"]=parseInt(n,10),e["font-size-unit"]=n.match(/[a-z%]+$/),e}},{key:"stylePara",value:function(t,e){i.a.each(t.nodes(ft.isPara,{includeAncestor:!0}),(function(t,n){i()(n).css(e)}))}},{key:"styleNodes",value:function(t,e){t=t.splitText();var n=e&&e.nodeName||"SPAN",o=!(!e||!e.expandClosestSibling),r=!(!e||!e.onlyPartialContains);if(t.isCollapsed())return[t.insertNode(ft.create(n))];var a=ft.makePredByNodeName(n),s=t.nodes(ft.isText,{fullyContains:!0}).map((function(t){return ft.singleChildAncestor(t,a)||ft.wrap(t,n)}));if(o){if(r){var l=t.nodes();a=b.and(a,(function(t){return x.contains(l,t)}))}return s.map((function(t){var e=ft.withClosestSiblings(t,a),n=x.head(e),o=x.tail(e);return i.a.each(o,(function(t,e){ft.appendChildNodes(n,e.childNodes),ft.remove(e)})),x.head(e)}))}return s}},{key:"current",value:function(t){var e=i()(ft.isElement(t.sc)?t.sc:t.sc.parentNode),n=this.fromNode(e);try{n=i.a.extend(n,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||n["font-family"]})}catch(t){}if(t.isOnList()){var o=["circle","disc","disc-leading-zero","square"].indexOf(n["list-style-type"])>-1;n["list-style"]=o?"unordered":"ordered"}else n["list-style"]="none";var r=ft.ancestor(t.sc,ft.isPara);if(r&&r.style["line-height"])n["line-height"]=r.style.lineHeight;else{var a=parseInt(n["line-height"],10)/parseInt(n["font-size"],10);n["line-height"]=a.toFixed(1)}return n.anchor=t.isOnAnchor()&&ft.ancestor(t.sc,ft.isAnchor),n.ancestors=ft.listAncestor(t.sc,ft.isEditable),n.range=t,n}}])&&Tt(e.prototype,n),o&&Tt(e,o),t}();function It(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var $t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"insertOrderedList",value:function(t){this.toggleList("OL",t)}},{key:"insertUnorderedList",value:function(t){this.toggleList("UL",t)}},{key:"indent",value:function(t){var e=this,n=kt.create(t).wrapBodyInlineWithPara(),o=n.nodes(ft.isPara,{includeAncestor:!0}),r=x.clusterBy(o,b.peq2("parentNode"));i.a.each(r,(function(t,n){var o=x.head(n);if(ft.isLi(o)){var r=e.findList(o.previousSibling);r?n.map((function(t){return r.appendChild(t)})):(e.wrapList(n,o.parentNode.nodeName),n.map((function(t){return t.parentNode})).map((function(t){return e.appendToPrevious(t)})))}else i.a.each(n,(function(t,e){i()(e).css("marginLeft",(function(t,e){return(parseInt(e,10)||0)+25}))}))})),n.select()}},{key:"outdent",value:function(t){var e=this,n=kt.create(t).wrapBodyInlineWithPara(),o=n.nodes(ft.isPara,{includeAncestor:!0}),r=x.clusterBy(o,b.peq2("parentNode"));i.a.each(r,(function(t,n){var o=x.head(n);ft.isLi(o)?e.releaseList([n]):i.a.each(n,(function(t,e){i()(e).css("marginLeft",(function(t,e){return(e=parseInt(e,10)||0)>25?e-25:""}))}))})),n.select()}},{key:"toggleList",value:function(t,e){var n=this,o=kt.create(e).wrapBodyInlineWithPara(),r=o.nodes(ft.isPara,{includeAncestor:!0}),a=o.paraBookmark(r),s=x.clusterBy(r,b.peq2("parentNode"));if(x.find(r,ft.isPurePara)){var l=[];i.a.each(s,(function(e,o){l=l.concat(n.wrapList(o,t))})),r=l}else{var c=o.nodes(ft.isList,{includeAncestor:!0}).filter((function(e){return!i.a.nodeName(e,t)}));c.length?i.a.each(c,(function(e,n){ft.replace(n,t)})):r=this.releaseList(s,!0)}kt.createFromParaBookmark(a,r).select()}},{key:"wrapList",value:function(t,e){var n=x.head(t),o=x.last(t),i=ft.isList(n.previousSibling)&&n.previousSibling,r=ft.isList(o.nextSibling)&&o.nextSibling,a=i||ft.insertAfter(ft.create(e||"UL"),o);return t=t.map((function(t){return ft.isPurePara(t)?ft.replace(t,"LI"):t})),ft.appendChildNodes(a,t),r&&(ft.appendChildNodes(a,x.from(r.childNodes)),ft.remove(r)),t}},{key:"releaseList",value:function(t,e){var n=this,o=[];return i.a.each(t,(function(t,r){var a=x.head(r),s=x.last(r),l=e?ft.lastAncestor(a,ft.isList):a.parentNode,c=l.parentNode;if("LI"===l.parentNode.nodeName)r.map((function(t){var e=n.findNextSiblings(t);c.nextSibling?c.parentNode.insertBefore(t,c.nextSibling):c.parentNode.appendChild(t),e.length&&(n.wrapList(e,l.nodeName),t.appendChild(e[0].parentNode))})),0===l.children.length&&c.removeChild(l),0===c.childNodes.length&&c.parentNode.removeChild(c);else{var u=l.childNodes.length>1?ft.splitTree(l,{node:s.parentNode,offset:ft.position(s)+1},{isSkipPaddingBlankHTML:!0}):null,d=ft.splitTree(l,{node:a.parentNode,offset:ft.position(a)},{isSkipPaddingBlankHTML:!0});r=e?ft.listDescendant(d,ft.isLi):x.from(d.childNodes).filter(ft.isLi),!e&&ft.isList(l.parentNode)||(r=r.map((function(t){return ft.replace(t,"P")}))),i.a.each(x.from(r).reverse(),(function(t,e){ft.insertAfter(e,l)}));var h=x.compact([l,d,u]);i.a.each(h,(function(t,e){var n=[e].concat(ft.listDescendant(e,ft.isList));i.a.each(n.reverse(),(function(t,e){ft.nodeLength(e)||ft.remove(e,!0)}))}))}o=o.concat(r)})),o}},{key:"appendToPrevious",value:function(t){return t.previousSibling?ft.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}},{key:"findList",value:function(t){return t?x.find(t.children,(function(t){return["OL","UL"].indexOf(t.nodeName)>-1})):null}},{key:"findNextSiblings",value:function(t){for(var e=[];t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}])&&It(e.prototype,n),o&&It(e,o),t}();function Nt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Pt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bullet=new $t,this.options=e.options}var e,n,o;return e=t,(n=[{key:"insertTab",value:function(t,e){var n=ft.createText(new Array(e+1).join(ft.NBSP_CHAR));(t=t.deleteContents()).insertNode(n,!0),(t=kt.create(n,e)).select()}},{key:"insertParagraph",value:function(t,e){e=(e=(e=e||kt.create(t)).deleteContents()).wrapBodyInlineWithPara();var n,o=ft.ancestor(e.sc,ft.isPara);if(o){if(ft.isLi(o)&&(ft.isEmpty(o)||ft.deepestChildIsEmpty(o)))return void this.bullet.toggleList(o.parentNode.nodeName);var r=null;if(1===this.options.blockquoteBreakingLevel?r=ft.ancestor(o,ft.isBlockquote):2===this.options.blockquoteBreakingLevel&&(r=ft.lastAncestor(o,ft.isBlockquote)),r){n=i()(ft.emptyPara)[0],ft.isRightEdgePoint(e.getStartPoint())&&ft.isBR(e.sc.nextSibling)&&i()(e.sc.nextSibling).remove();var a=ft.splitTree(r,e.getStartPoint(),{isDiscardEmptySplits:!0});a?a.parentNode.insertBefore(n,a):ft.insertAfter(n,r)}else{n=ft.splitTree(o,e.getStartPoint());var s=ft.listDescendant(o,ft.isEmptyAnchor);s=s.concat(ft.listDescendant(n,ft.isEmptyAnchor)),i.a.each(s,(function(t,e){ft.remove(e)})),(ft.isHeading(n)||ft.isPre(n)||ft.isCustomStyleTag(n))&&ft.isEmpty(n)&&(n=ft.replace(n,"p"))}}else{var l=e.sc.childNodes[e.so];n=i()(ft.emptyPara)[0],l?e.sc.insertBefore(n,l):e.sc.appendChild(n)}kt.create(n,0).normalize().select().scrollIntoView(t)}}])&&Nt(e.prototype,n),o&&Nt(e,o),t}();function Rt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Lt=function t(e,n,o,i){var r={colPos:0,rowPos:0},a=[],s=[];function l(t,e,n,o,i,r,s){var l={baseRow:n,baseCell:o,isRowSpan:i,isColSpan:r,isVirtual:s};a[t]||(a[t]=[]),a[t][e]=l}function c(t,e,n,o){return{baseCell:t.baseCell,action:e,virtualTable:{rowIndex:n,cellIndex:o}}}function u(t,e){if(!a[t])return e;if(!a[t][e])return e;for(var n=e;a[t][n];)if(n++,!a[t][n])return n}function d(t,e){var n=u(t.rowIndex,e.cellIndex),o=e.colSpan>1,i=e.rowSpan>1,a=t.rowIndex===r.rowPos&&e.cellIndex===r.colPos;l(t.rowIndex,n,t,e,i,o,!1);var s=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(s>1)for(var c=1;c<s;c++){var d=t.rowIndex+c;h(d,n,e,a),l(d,n,t,e,!0,o,!0)}var f=e.attributes.colSpan?parseInt(e.attributes.colSpan.value,10):0;if(f>1)for(var p=1;p<f;p++){var m=u(t.rowIndex,n+p);h(t.rowIndex,m,e,a),l(t.rowIndex,m,t,e,i,!0,!0)}}function h(t,e,n,o){t===r.rowPos&&r.colPos>=n.cellIndex&&n.cellIndex<=e&&!o&&r.colPos++}function f(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SubtractSpanCount;break;case t.where.Row:if(!e.isVirtual&&e.isRowSpan)return t.resultAction.AddCell;if(e.isRowSpan)return t.resultAction.SubtractSpanCount}return t.resultAction.RemoveCell}function p(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SumSpanCount;if(e.isRowSpan&&e.isVirtual)return t.resultAction.Ignore;break;case t.where.Row:if(e.isRowSpan)return t.resultAction.SumSpanCount;if(e.isColSpan&&e.isVirtual)return t.resultAction.Ignore}return t.resultAction.AddCell}this.getActionList=function(){for(var e=n===t.where.Row?r.rowPos:-1,i=n===t.where.Column?r.colPos:-1,l=0,u=!0;u;){var d=e>=0?e:l,h=i>=0?i:l,m=a[d];if(!m)return u=!1,s;var v=m[h];if(!v)return u=!1,s;var g=t.resultAction.Ignore;switch(o){case t.requestAction.Add:g=p(v);break;case t.requestAction.Delete:g=f(v)}s.push(c(v,g,d,h)),l++}return s},e&&e.tagName&&("td"===e.tagName.toLowerCase()||"th"===e.tagName.toLowerCase())&&(r.colPos=e.cellIndex,e.parentElement&&e.parentElement.tagName&&"tr"===e.parentElement.tagName.toLowerCase()&&(r.rowPos=e.parentElement.rowIndex)),function(){for(var t=i.rows,e=0;e<t.length;e++)for(var n=t[e].cells,o=0;o<n.length;o++)d(t[e],n[o])}()};Lt.where={Row:0,Column:1},Lt.requestAction={Add:0,Delete:1},Lt.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var At=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"tab",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=ft.ancestor(n,ft.isTable),i=ft.listDescendant(o,ft.isCell),r=x[e?"prev":"next"](i,n);r&&kt.create(r,0).select()}},{key:"addRow",value:function(t,e){for(var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=i()(n).closest("tr"),r=this.recoverAttributes(o),a=i()("<tr"+r+"></tr>"),s=new Lt(n,Lt.where.Row,Lt.requestAction.Add,i()(o).closest("table")[0]).getActionList(),l=0;l<s.length;l++){var c=s[l],u=this.recoverAttributes(c.baseCell);switch(c.action){case Lt.resultAction.AddCell:a.append("<td"+u+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("top"===e&&(c.baseCell.parent?c.baseCell.closest("tr").rowIndex:0)<=o[0].rowIndex){var d=i()("<div></div>").append(i()("<td"+u+">"+ft.blank+"</td>").removeAttr("rowspan")).html();a.append(d);break}var h=parseInt(c.baseCell.rowSpan,10);h++,c.baseCell.setAttribute("rowSpan",h)}}if("top"===e)o.before(a);else{if(n.rowSpan>1){var f=o[0].rowIndex+(n.rowSpan-2);return void i()(i()(o).parent().find("tr")[f]).after(i()(a))}o.after(a)}}},{key:"addCol",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=i()(n).closest("tr");i()(o).siblings().push(o);for(var r=new Lt(n,Lt.where.Column,Lt.requestAction.Add,i()(o).closest("table")[0]).getActionList(),a=0;a<r.length;a++){var s=r[a],l=this.recoverAttributes(s.baseCell);switch(s.action){case Lt.resultAction.AddCell:"right"===e?i()(s.baseCell).after("<td"+l+">"+ft.blank+"</td>"):i()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("right"===e){var c=parseInt(s.baseCell.colSpan,10);c++,s.baseCell.setAttribute("colSpan",c)}else i()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var n=t.attributes||[],o=0;o<n.length;o++)"id"!==n[o].name.toLowerCase()&&n[o].specified&&(e+=" "+n[o].name+"='"+n[o].value+"'");return e}},{key:"deleteRow",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=i()(e).closest("tr"),o=n.children("td, th").index(i()(e)),r=n[0].rowIndex,a=new Lt(e,Lt.where.Row,Lt.requestAction.Delete,i()(n).closest("table")[0]).getActionList(),s=0;s<a.length;s++)if(a[s]){var l=a[s].baseCell,c=a[s].virtualTable,u=l.rowSpan&&l.rowSpan>1,d=u?parseInt(l.rowSpan,10):0;switch(a[s].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.AddCell:var h=n.next("tr")[0];if(!h)continue;var f=n[0].cells[o];u&&(d>2?(d--,h.insertBefore(f,h.cells[o]),h.cells[o].setAttribute("rowSpan",d),h.cells[o].innerHTML=""):2===d&&(h.insertBefore(f,h.cells[o]),h.cells[o].removeAttribute("rowSpan"),h.cells[o].innerHTML=""));continue;case Lt.resultAction.SubtractSpanCount:u&&(d>2?(d--,l.setAttribute("rowSpan",d),c.rowIndex!==r&&l.cellIndex===o&&(l.innerHTML="")):2===d&&(l.removeAttribute("rowSpan"),c.rowIndex!==r&&l.cellIndex===o&&(l.innerHTML="")));continue;case Lt.resultAction.RemoveCell:continue}}n.remove()}},{key:"deleteCol",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=i()(e).closest("tr"),o=n.children("td, th").index(i()(e)),r=new Lt(e,Lt.where.Column,Lt.requestAction.Delete,i()(n).closest("table")[0]).getActionList(),a=0;a<r.length;a++)if(r[a])switch(r[a].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.SubtractSpanCount:var s=r[a].baseCell;if(s.colSpan&&s.colSpan>1){var l=s.colSpan?parseInt(s.colSpan,10):0;l>2?(l--,s.setAttribute("colSpan",l),s.cellIndex===o&&(s.innerHTML="")):2===l&&(s.removeAttribute("colSpan"),s.cellIndex===o&&(s.innerHTML=""))}continue;case Lt.resultAction.RemoveCell:ft.remove(r[a].baseCell,!0);continue}}},{key:"createTable",value:function(t,e,n){for(var o,r=[],a=0;a<t;a++)r.push("<td>"+ft.blank+"</td>");o=r.join("");for(var s,l=[],c=0;c<e;c++)l.push("<tr>"+o+"</tr>");s=l.join("");var u=i()("<table>"+s+"</table>");return n&&n.tableClassName&&u.addClass(n.tableClassName),u[0]}},{key:"deleteTable",value:function(t){var e=ft.ancestor(t.commonAncestor(),ft.isCell);i()(e).closest("table").remove()}}])&&Rt(e.prototype,n),o&&Rt(e,o),t}();function Ft(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Dt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$note=e.layoutInfo.note,this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.options=e.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.lastRange=null,this.snapshot=null,this.style=new Et,this.table=new At,this.typing=new Pt(e),this.bullet=new $t,this.history=new St(e),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);for(var o=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"],r=0,a=o.length;r<a;r++)this[o[r]]=function(t){return function(e){n.beforeCommand(),document.execCommand(t,!1,e),n.afterCommand(!0)}}(o[r]),this.context.memo("help."+o[r],this.lang.help[o[r]]);this.fontName=this.wrapCommand((function(t){return n.fontStyling("font-family",v.validFontName(t))})),this.fontSize=this.wrapCommand((function(t){var e=n.currentStyle()["font-size-unit"];return n.fontStyling("font-size",t+e)})),this.fontSizeUnit=this.wrapCommand((function(t){var e=n.currentStyle()["font-size"];return n.fontStyling("font-size",e+t)}));for(var s=1;s<=6;s++)this["formatH"+s]=function(t){return function(){n.formatBlock("H"+t)}}(s),this.context.memo("help.formatH"+s,this.lang.help["formatH"+s]);this.insertParagraph=this.wrapCommand((function(){n.typing.insertParagraph(n.editable)})),this.insertOrderedList=this.wrapCommand((function(){n.bullet.insertOrderedList(n.editable)})),this.insertUnorderedList=this.wrapCommand((function(){n.bullet.insertUnorderedList(n.editable)})),this.indent=this.wrapCommand((function(){n.bullet.indent(n.editable)})),this.outdent=this.wrapCommand((function(){n.bullet.outdent(n.editable)})),this.insertNode=this.wrapCommand((function(t){n.isLimited(i()(t).text().length)||(n.getLastRange().insertNode(t),n.setLastRange(kt.createFromNodeAfter(t).select()))})),this.insertText=this.wrapCommand((function(t){if(!n.isLimited(t.length)){var e=n.getLastRange().insertNode(ft.createText(t));n.setLastRange(kt.create(e,ft.nodeLength(e)).select())}})),this.pasteHTML=this.wrapCommand((function(t){if(!n.isLimited(t.length)){t=n.context.invoke("codeview.purify",t);var e=n.getLastRange().pasteHTML(t);n.setLastRange(kt.createFromNodeAfter(x.last(e)).select())}})),this.formatBlock=this.wrapCommand((function(t,e){var o=n.options.callbacks.onApplyCustomStyle;o?o.call(n,e,n.context,n.onFormatBlock):n.onFormatBlock(t,e)})),this.insertHorizontalRule=this.wrapCommand((function(){var t=n.getLastRange().insertNode(ft.create("HR"));t.nextSibling&&n.setLastRange(kt.create(t.nextSibling,0).normalize().select())})),this.lineHeight=this.wrapCommand((function(t){n.style.stylePara(n.getLastRange(),{lineHeight:t})})),this.createLink=this.wrapCommand((function(t){var e=t.url,o=t.text,r=t.isNewWindow,a=t.checkProtocol,s=t.range||n.getLastRange(),l=o.length-s.toString().length;if(!(l>0&&n.isLimited(l))){var c=s.toString()!==o;"string"==typeof e&&(e=e.trim()),n.options.onCreateLink?e=n.options.onCreateLink(e):a&&(e=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(e)?e:n.options.defaultProtocol+e);var u=[];if(c){var d=(s=s.deleteContents()).insertNode(i()("<A>"+o+"</A>")[0]);u.push(d)}else u=n.style.styleNodes(s,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});i.a.each(u,(function(t,n){i()(n).attr("href",e),r?i()(n).attr("target","_blank"):i()(n).removeAttr("target")}));var h=kt.createFromNodeBefore(x.head(u)).getStartPoint(),f=kt.createFromNodeAfter(x.last(u)).getEndPoint();n.setLastRange(kt.create(h.node,h.offset,f.node,f.offset).select())}})),this.color=this.wrapCommand((function(t){var e=t.foreColor,n=t.backColor;e&&document.execCommand("foreColor",!1,e),n&&document.execCommand("backColor",!1,n)})),this.foreColor=this.wrapCommand((function(t){document.execCommand("foreColor",!1,t)})),this.insertTable=this.wrapCommand((function(t){var e=t.split("x");n.getLastRange().deleteContents().insertNode(n.table.createTable(e[0],e[1],n.options))})),this.removeMedia=this.wrapCommand((function(){var t=i()(n.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=i()(n.restoreTarget()).detach(),n.context.triggerEvent("media.delete",t,n.$editable)})),this.floatMe=this.wrapCommand((function(t){var e=i()(n.restoreTarget());e.toggleClass("note-float-left","left"===t),e.toggleClass("note-float-right","right"===t),e.css("float","none"===t?"":t)})),this.resize=this.wrapCommand((function(t){var e=i()(n.restoreTarget());0===(t=parseFloat(t))?e.css("width",""):e.css({width:100*t+"%",height:""})}))}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.$editable.on("keydown",(function(e){if(e.keyCode===Ct.code.ENTER&&t.context.triggerEvent("enter",e),t.context.triggerEvent("keydown",e),t.snapshot=t.history.makeSnapshot(),t.hasKeyShortCut=!1,e.isDefaultPrevented()||(t.options.shortcuts?t.hasKeyShortCut=t.handleKeyMap(e):t.preventDefaultEditableShortCuts(e)),t.isLimited(1,e)){var n=t.getLastRange();if(n.eo-n.so==0)return!1}t.setLastRange(),t.options.recordEveryKeystroke&&!1===t.hasKeyShortCut&&t.history.recordUndo()})).on("keyup",(function(e){t.setLastRange(),t.context.triggerEvent("keyup",e)})).on("focus",(function(e){t.setLastRange(),t.context.triggerEvent("focus",e)})).on("blur",(function(e){t.context.triggerEvent("blur",e)})).on("mousedown",(function(e){t.context.triggerEvent("mousedown",e)})).on("mouseup",(function(e){t.setLastRange(),t.history.recordUndo(),t.context.triggerEvent("mouseup",e)})).on("scroll",(function(e){t.context.triggerEvent("scroll",e)})).on("paste",(function(e){t.setLastRange(),t.context.triggerEvent("paste",e)})).on("input",(function(){t.isLimited(0)&&t.snapshot&&t.history.applySnapshot(t.snapshot)})),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(ft.html(this.$note)||ft.emptyPara),this.$editable.on(v.inputEventName,b.debounce((function(){t.context.triggerEvent("change",t.$editable.html(),t.$editable)}),10)),this.$editable.on("focusin",(function(e){t.context.triggerEvent("focusin",e)})).on("focusout",(function(e){t.context.triggerEvent("focusout",e)})),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",(function(e){return t.context.triggerEvent("contextmenu",e),!1})):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function(){this.$editable.off()}},{key:"handleKeyMap",value:function(t){var e=this.options.keyMap[v.isMac?"mac":"pc"],n=[];t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT");var o=Ct.nameFromCode[t.keyCode];o&&n.push(o);var i=e[n.join("+")];if("TAB"!==o||this.options.tabDisable)if(i){if(!1!==this.context.invoke(i))return t.preventDefault(),!0}else Ct.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&x.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(Ct.isMove(e.keyCode)||Ct.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||x.contains([Ct.code.BACKSPACE,Ct.code.DELETE],e.keyCode)))&&this.options.maxTextLength>0&&this.$editable.text().length+t>this.options.maxTextLength}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=kt.create(this.editable),0===i()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=kt.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(t){t&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(t){this.$editable.data("target",t)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var t=kt.create();return t&&(t=t.normalize()),t?this.style.current(t):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(t){return this.style.fromNode(t)}},{key:"undo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(t,e){var n,o=this;return(n=t,i.a.Deferred((function(t){var e=i()("<img>");e.one("load",(function(){e.off("error abort"),t.resolve(e)})).one("error abort",(function(){e.off("load").detach(),t.reject(e)})).css({display:"none"}).appendTo(document.body).attr("src",n)})).promise()).then((function(t){o.beforeCommand(),"function"==typeof e?e(t):("string"==typeof e&&t.attr("data-filename",e),t.css("width",Math.min(o.$editable.width(),t.width()))),t.show(),o.getLastRange().insertNode(t[0]),o.setLastRange(kt.createFromNodeAfter(t[0]).select()),o.afterCommand()})).fail((function(t){o.context.triggerEvent("image.upload.error",t)}))}},{key:"insertImagesAsDataURL",value:function(t){var e=this;i.a.each(t,(function(t,n){var o=n.name;e.options.maximumImageFileSize&&e.options.maximumImageFileSize<n.size?e.context.triggerEvent("image.upload.error",e.lang.image.maximumFileSizeError):function(t){return i.a.Deferred((function(e){i.a.extend(new FileReader,{onload:function(t){var n=t.target.result;e.resolve(n)},onerror:function(t){e.reject(t)}}).readAsDataURL(t)})).promise()}(n).then((function(t){return e.insertImage(t,o)})).fail((function(){e.context.triggerEvent("image.upload.error")}))}))}},{key:"insertImagesOrCallback",value:function(t){this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",t):this.insertImagesAsDataURL(t)}},{key:"getSelectedText",value:function(){var t=this.getLastRange();return t.isOnAnchor()&&(t=kt.createFromNode(ft.ancestor(t.sc,ft.isAnchor))),t.toString()}},{key:"onFormatBlock",value:function(t,e){if(document.execCommand("FormatBlock",!1,v.isMSIE?"<"+t+">":t),e&&e.length&&(e[0].tagName.toUpperCase()!==t.toUpperCase()&&(e=e.find(t)),e&&e.length)){var n=e[0].className||"";if(n){var o=this.createRange();i()([o.sc,o.ec]).closest(t).addClass(n)}}}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,e){var n=this.getLastRange();if(""!==n){var o=this.style.styleNodes(n);if(this.$editor.find(".note-status-output").html(""),i()(o).css(t,e),n.isCollapsed()){var r=x.head(o);r&&!ft.nodeLength(r)&&(r.innerHTML=ft.ZERO_WIDTH_NBSP_CHAR,kt.createFromNodeAfter(r.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",r))}}else{var a=i.a.now();this.$editor.find(".note-status-output").html('<div id="note-status-output-'+a+'" class="alert alert-info">'+this.lang.output.noSelection+"</div>"),setTimeout((function(){i()("#note-status-output-"+a).remove()}),5e3)}}},{key:"unlink",value:function(){var t=this.getLastRange();if(t.isOnAnchor()){var e=ft.ancestor(t.sc,ft.isAnchor);(t=kt.createFromNode(e)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(ft.isAnchor),e=i()(x.head(t.nodes(ft.isAnchor))),n={range:t,text:t.toString(),url:e.length?e.attr("href"):""};return e.length&&(n.isNewWindow="_blank"===e.attr("target")),n}},{key:"addRow",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}},{key:"addCol",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}},{key:"deleteRow",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}},{key:"deleteCol",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}},{key:"deleteTable",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}},{key:"resizeTo",value:function(t,e,n){var o;if(n){var i=t.y/t.x,r=e.data("ratio");o={width:r>i?t.x:t.y/r,height:r>i?t.x*r:t.y}}else o={width:t.x,height:t.y};e.css(o)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return ft.isEmpty(this.$editable[0])||ft.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",ft.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}])&&Ft(e.prototype,n),o&&Ft(e,o),t}();function Ht(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var zt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editable=e.layoutInfo.editable}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function(t){var e=this,n=t.originalEvent.clipboardData;if(n&&n.items&&n.items.length){var o=n.items.length>1?n.items[1]:x.head(n.items);"file"===o.kind&&-1!==o.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[o.getAsFile()]),t.preventDefault()):"string"===o.kind&&this.context.invoke("editor.isLimited",n.getData("Text").length)&&t.preventDefault()}else if(window.clipboardData){var i=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",i.length)&&t.preventDefault()}setTimeout((function(){e.context.invoke("editor.afterCommand")}),10)}}])&&Ht(e.prototype,n),o&&Ht(e,o),t}();function Bt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Mt,Ot=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$eventListener=i()(document),this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.options=e.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=i()(['<div class="note-dropzone">','<div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(this.$editor)}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(t){t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var t=this,e=i()(),n=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(o){var i=t.context.invoke("codeview.isActivated"),r=t.$editor.width()>0&&t.$editor.height()>0;i||e.length||!r||(t.$editor.addClass("dragover"),t.$dropzone.width(t.$editor.width()),t.$dropzone.height(t.$editor.height()),n.text(t.lang.image.dragImageHere)),e=e.add(o.target)},this.documentEventHandlers.onDragleave=function(n){(e=e.not(n.target)).length&&"BODY"!==n.target.nodeName||(e=i()(),t.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){e=i()(),t.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",(function(){t.$dropzone.addClass("hover"),n.text(t.lang.image.dropImage)})).on("dragleave",(function(){t.$dropzone.removeClass("hover"),n.text(t.lang.image.dragImageHere)})),this.$dropzone.on("drop",(function(e){var n=e.originalEvent.dataTransfer;e.preventDefault(),n&&n.files&&n.files.length?(t.$editable.focus(),t.context.invoke("editor.insertImagesOrCallback",n.files)):i.a.each(n.types,(function(e,o){if(!(o.toLowerCase().indexOf("_moz_")>-1)){var r=n.getData(o);o.toLowerCase().indexOf("text")>-1?t.context.invoke("editor.pasteHTML",r):i()(r).each((function(e,n){t.context.invoke("editor.insertNode",n)}))}}))})).on("dragover",!1)}},{key:"destroy",value:function(){var t=this;Object.keys(this.documentEventHandlers).forEach((function(e){t.$eventListener.off(e.substr(2).toLowerCase(),t.documentEventHandlers[e])})),this.documentEventHandlers={}}}])&&Bt(e.prototype,n),o&&Bt(e,o),t}();function Ut(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}v.hasCodeMirror&&(Mt=window.CodeMirror);var jt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.$codable=e.layoutInfo.codable,this.options=e.options}var e,n,o;return e=t,(n=[{key:"sync",value:function(){this.isActivated()&&v.hasCodeMirror&&this.$codable.data("cmEditor").save()}},{key:"isActivated",value:function(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function(t){if(this.options.codeviewFilter&&(t=t.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter)){var e=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);t=t.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi,(function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var n=!0,o=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;if(new RegExp('src="(https?:)?//'+s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return""}))}return t}},{key:"activate",value:function(){var t=this;if(this.$codable.val(ft.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),v.hasCodeMirror){var e=Mt.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){var n=new Mt.TernServer(this.options.codemirror.tern);e.ternServer=n,e.on("cursorActivity",(function(t){n.updateArgHints(t)}))}e.on("blur",(function(n){t.context.triggerEvent("blur.codeview",e.getValue(),n)})),e.on("change",(function(){t.context.triggerEvent("change.codeview",e.getValue(),e)})),e.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",e)}else this.$codable.on("blur",(function(e){t.context.triggerEvent("blur.codeview",t.$codable.val(),e)})),this.$codable.on("input",(function(){t.context.triggerEvent("change.codeview",t.$codable.val(),t.$codable)}))}},{key:"deactivate",value:function(){if(v.hasCodeMirror){var t=this.$codable.data("cmEditor");this.$codable.val(t.getValue()),t.toTextArea()}var e=this.purify(ft.value(this.$codable,this.options.prettifyHtml)||ft.emptyPara),n=this.$editable.html()!==e;this.$editable.html(e),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),n&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}])&&Ut(e.prototype,n),o&&Ut(e,o),t}();function Wt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Kt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$document=i()(document),this.$statusbar=e.layoutInfo.statusbar,this.$editable=e.layoutInfo.editable,this.options=e.options}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.options.airMode||this.options.disableResizeEditor?this.destroy():this.$statusbar.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation();var n=t.$editable.offset().top-t.$document.scrollTop(),o=function(e){var o=e.clientY-(n+24);o=t.options.minheight>0?Math.max(o,t.options.minheight):o,o=t.options.maxHeight>0?Math.min(o,t.options.maxHeight):o,t.$editable.height(o)};t.$document.on("mousemove",o).one("mouseup",(function(){t.$document.off("mousemove",o)}))}))}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}])&&Wt(e.prototype,n),o&&Wt(e,o),t}();function qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Vt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editor=e.layoutInfo.editor,this.$toolbar=e.layoutInfo.toolbar,this.$editable=e.layoutInfo.editable,this.$codable=e.layoutInfo.codable,this.$window=i()(window),this.$scrollbar=i()("html, body"),this.onResize=function(){n.resizeTo({h:n.$window.height()-n.$toolbar.outerHeight()})}}var e,n,o;return e=t,(n=[{key:"resizeTo",value:function(t){this.$editable.css("height",t.h),this.$codable.css("height",t.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,t.h)}},{key:"toggle",value:function(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function(){return this.$editor.hasClass("fullscreen")}}])&&qt(e.prototype,n),o&&qt(e,o),t}();function _t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Gt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$document=i()(document),this.$editingArea=e.layoutInfo.editingArea,this.options=e.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function(t,e){n.update(e.target,e)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()},"summernote.codeview.toggled":function(){n.update()}}}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.$handle=i()(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',this.options.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',this.options.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",(function(e){if(ft.isControlSizing(e.target)){e.preventDefault(),e.stopPropagation();var n=t.$handle.find(".note-control-selection").data("target"),o=n.offset(),i=t.$document.scrollTop(),r=function(e){t.context.invoke("editor.resizeTo",{x:e.clientX-o.left,y:e.clientY-(o.top-i)},n,!e.shiftKey),t.update(n[0],e)};t.$document.on("mousemove",r).one("mouseup",(function(e){e.preventDefault(),t.$document.off("mousemove",r),t.context.invoke("editor.afterCommand")})),n.data("ratio")||n.data("ratio",n.height()/n.width())}})),this.$handle.on("wheel",(function(e){e.preventDefault(),t.update()}))}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,e){if(this.context.isDisabled())return!1;var n=ft.isImg(t),o=this.$handle.find(".note-control-selection");if(this.context.invoke("imagePopover.update",t,e),n){var r=i()(t),a=r.position(),s={left:a.left+parseInt(r.css("marginLeft"),10),top:a.top+parseInt(r.css("marginTop"),10)},l={w:r.outerWidth(!1),h:r.outerHeight(!1)};o.css({display:"block",left:s.left,top:s.top,width:l.w,height:l.h}).data("target",r);var c=new Image;c.src=r.attr("src");var u=l.w+"x"+l.h+" ("+this.lang.image.original+": "+c.width+"x"+c.height+")";o.find(".note-control-selection-info").text(u),this.context.invoke("editor.saveTarget",t)}else this.hide();return n}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}])&&_t(e.prototype,n),o&&_t(e,o),t}();function Yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Zt=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,Xt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.lastWordRange=null}},{key:"destroy",value:function(){this.lastWordRange=null}},{key:"replace",value:function(){if(this.lastWordRange){var t=this.lastWordRange.toString(),e=t.match(Zt);if(e&&(e[1]||e[2])){var n=e[1]?t:"http://"+t,o=t.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0],r=i()("<a />").html(o).attr("href",n)[0];this.context.options.linkTargetBlank&&i()(r).attr("target","_blank"),this.lastWordRange.insertNode(r),this.lastWordRange=null,this.context.invoke("editor.focus")}}}},{key:"handleKeydown",value:function(t){if(x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWordRange=e}}},{key:"handleKeyup",value:function(t){x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&this.replace()}}])&&Yt(e.prototype,n),o&&Yt(e,o),t}();function Qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Jt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$note=e.layoutInfo.note,this.events={"summernote.change":function(){n.$note.val(e.invoke("code"))}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return ft.isTextarea(this.$note[0])}}])&&Qt(e.prototype,n),o&&Qt(e,o),t}();function te(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ee=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.options=e.options.replace||{},this.keys=[Ct.code.ENTER,Ct.code.SPACE,Ct.code.PERIOD,Ct.code.COMMA,Ct.code.SEMICOLON,Ct.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!!this.options.match}},{key:"initialize",value:function(){this.lastWord=null}},{key:"destroy",value:function(){this.lastWord=null}},{key:"replace",value:function(){if(this.lastWord){var t=this,e=this.lastWord.toString();this.options.match(e,(function(e){if(e){var n="";if("string"==typeof e?n=ft.createText(e):e instanceof jQuery?n=e[0]:e instanceof Node&&(n=e),!n)return;t.lastWord.insertNode(n),t.lastWord=null,t.context.invoke("editor.focus")}}))}}},{key:"handleKeydown",value:function(t){if(this.previousKeydownCode&&x.contains(this.keys,this.previousKeydownCode))this.previousKeydownCode=t.keyCode;else{if(x.contains(this.keys,t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWord=e}this.previousKeydownCode=t.keyCode}}},{key:"handleKeyup",value:function(t){x.contains(this.keys,t.keyCode)&&this.replace()}}])&&te(e.prototype,n),o&&te(e,o),t}();function ne(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var oe=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editingArea=e.layoutInfo.editingArea,this.options=e.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function(){n.update()},"summernote.codeview.toggled":function(){n.update()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!!this.options.placeholder}},{key:"initialize",value:function(){var t=this;this.$placeholder=i()('<div class="note-placeholder">'),this.$placeholder.on("click",(function(){t.context.invoke("focus")})).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}])&&ne(e.prototype,n),o&&ne(e,o),t}();function ie(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var re=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ui=i.a.summernote.ui,this.context=e,this.$toolbar=e.layoutInfo.toolbar,this.options=e.options,this.lang=this.options.langInfo,this.invertedKeyMap=b.invertObject(this.options.keyMap[v.isMac?"mac":"pc"])}var e,n,o;return e=t,(n=[{key:"representShortcut",value:function(t){var e=this.invertedKeyMap[t];return this.options.shortcuts&&e?(v.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)}},{key:"initialize",value:function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function(t){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,t)||(this.fontInstalledMap[t]=v.isFontInstalled(t)||x.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]}},{key:"isFontDeservedToAdd",value:function(t){return""!==(t=t.toLowerCase())&&this.isFontInstalled(t)&&-1===v.genericFontFamilies.indexOf(t)}},{key:"colorPalette",value:function(t,e,n,o){var r=this;return this.ui.buttonGroup({className:"note-color "+t,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:e,click:function(t){var e=i()(t.currentTarget);n&&o?r.context.invoke("editor.color",{backColor:e.attr("data-backColor"),foreColor:e.attr("data-foreColor")}):n?r.context.invoke("editor.color",{backColor:e.attr("data-backColor")}):o&&r.context.invoke("editor.color",{foreColor:e.attr("data-foreColor")})},callback:function(t){var e=t.find(".note-recent-color");n&&(e.css("background-color",r.options.colorButton.backColor),t.attr("data-backColor",r.options.colorButton.backColor)),o?(e.css("color",r.options.colorButton.foreColor),t.attr("data-foreColor",r.options.colorButton.foreColor)):e.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(n?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="backColor" data-value="inherit">',this.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="backColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.backColor+'" data-event="backColorPalette">',"</div>",'<div class="note-holder-custom" id="backColorPalette" data-event="backColor"/>',"</div>"].join(""):"")+(o?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="removeFormat" data-value="foreColor">',this.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="foreColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.foreColor+'" data-event="foreColorPalette">',"</div>",'<div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"/>',"</div>"].join(""):""),callback:function(t){t.find(".note-holder").each((function(t,e){var n=i()(e);n.append(r.ui.palette({colors:r.options.colors,colorsName:r.options.colorsName,eventName:n.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())}));var e=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];t.find(".note-holder-custom").each((function(t,n){var o=i()(n);o.append(r.ui.palette({colors:e,colorsName:e,eventName:o.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())})),t.find("input[type=color]").each((function(e,n){i()(n).change((function(){var e=t.find("#"+i()(this).data("event")).find(".note-color-btn").first(),n=this.value.toUpperCase();e.css("background-color",n).attr("aria-label",n).attr("data-value",n).attr("data-original-title",n),e.click()}))}))},click:function(e){e.stopPropagation();var n=i()("."+t).find(".note-dropdown-menu"),o=i()(e.target),a=o.data("event"),s=o.attr("data-value");if("openPalette"===a){var l=n.find("#"+s),c=i()(n.find("#"+l.data("event")).find(".note-color-row")[0]),u=c.find(".note-color-btn").last().detach(),d=l.val();u.css("background-color",d).attr("aria-label",d).attr("data-value",d).attr("data-original-title",d),c.prepend(u),l.click()}else{if(x.contains(["backColor","foreColor"],a)){var h="backColor"===a?"background-color":"color",f=o.closest(".note-color").find(".note-recent-color"),p=o.closest(".note-color").find(".note-current-color-button");f.css(h,s),p.attr("data-"+a,s)}r.context.invoke("editor."+a,s)}}})]}).render()}},{key:"addToolbarButtons",value:function(){var t=this;this.context.memo("button.style",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.magic),t.options),tooltip:t.lang.style.style,data:{toggle:"dropdown"}}),t.ui.dropdown({className:"dropdown-style",items:t.options.styleTags,title:t.lang.style.style,template:function(e){"string"==typeof e&&(e={tag:e,title:Object.prototype.hasOwnProperty.call(t.lang.style,e)?t.lang.style[e]:e});var n=e.tag,o=e.title;return"<"+n+(e.style?' style="'+e.style+'" ':"")+(e.className?' class="'+e.className+'"':"")+">"+o+"</"+n+">"},click:t.context.createInvokeHandler("editor.formatBlock")})]).render()}));for(var e=function(e,n){var o=t.options.styleTags[e];t.context.memo("button.style."+o,(function(){return t.button({className:"note-btn-style-"+o,contents:'<div data-value="'+o+'">'+o.toUpperCase()+"</div>",tooltip:t.lang.style[o],click:t.context.createInvokeHandler("editor.formatBlock")}).render()}))},n=0,o=this.options.styleTags.length;n<o;n++)e(n);this.context.memo("button.bold",(function(){return t.button({className:"note-btn-bold",contents:t.ui.icon(t.options.icons.bold),tooltip:t.lang.font.bold+t.representShortcut("bold"),click:t.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()})),this.context.memo("button.italic",(function(){return t.button({className:"note-btn-italic",contents:t.ui.icon(t.options.icons.italic),tooltip:t.lang.font.italic+t.representShortcut("italic"),click:t.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()})),this.context.memo("button.underline",(function(){return t.button({className:"note-btn-underline",contents:t.ui.icon(t.options.icons.underline),tooltip:t.lang.font.underline+t.representShortcut("underline"),click:t.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()})),this.context.memo("button.clear",(function(){return t.button({contents:t.ui.icon(t.options.icons.eraser),tooltip:t.lang.font.clear+t.representShortcut("removeFormat"),click:t.context.createInvokeHandler("editor.removeFormat")}).render()})),this.context.memo("button.strikethrough",(function(){return t.button({className:"note-btn-strikethrough",contents:t.ui.icon(t.options.icons.strikethrough),tooltip:t.lang.font.strikethrough+t.representShortcut("strikethrough"),click:t.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()})),this.context.memo("button.superscript",(function(){return t.button({className:"note-btn-superscript",contents:t.ui.icon(t.options.icons.superscript),tooltip:t.lang.font.superscript,click:t.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()})),this.context.memo("button.subscript",(function(){return t.button({className:"note-btn-subscript",contents:t.ui.icon(t.options.icons.subscript),tooltip:t.lang.font.subscript,click:t.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()})),this.context.memo("button.fontname",(function(){var e=t.context.invoke("editor.currentStyle");return t.options.addDefaultFonts&&i.a.each(e["font-family"].split(","),(function(e,n){n=n.trim().replace(/['"]+/g,""),t.isFontDeservedToAdd(n)&&-1===t.options.fontNames.indexOf(n)&&t.options.fontNames.push(n)})),t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontname"/>',t.options),tooltip:t.lang.font.name,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:t.options.icons.menuCheck,items:t.options.fontNames.filter(t.isFontInstalled.bind(t)),title:t.lang.font.name,template:function(t){return'<span style="font-family: '+v.validFontName(t)+'">'+t+"</span>"},click:t.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()})),this.context.memo("button.fontsize",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontsize"/>',t.options),tooltip:t.lang.font.size,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizes,title:t.lang.font.size,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()})),this.context.memo("button.fontsizeunit",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontsizeunit"/>',t.options),tooltip:t.lang.font.sizeunit,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizeUnits,title:t.lang.font.sizeunit,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()})),this.context.memo("button.color",(function(){return t.colorPalette("note-color-all",t.lang.color.recent,!0,!0)})),this.context.memo("button.forecolor",(function(){return t.colorPalette("note-color-fore",t.lang.color.foreground,!1,!0)})),this.context.memo("button.backcolor",(function(){return t.colorPalette("note-color-back",t.lang.color.background,!0,!1)})),this.context.memo("button.ul",(function(){return t.button({contents:t.ui.icon(t.options.icons.unorderedlist),tooltip:t.lang.lists.unordered+t.representShortcut("insertUnorderedList"),click:t.context.createInvokeHandler("editor.insertUnorderedList")}).render()})),this.context.memo("button.ol",(function(){return t.button({contents:t.ui.icon(t.options.icons.orderedlist),tooltip:t.lang.lists.ordered+t.representShortcut("insertOrderedList"),click:t.context.createInvokeHandler("editor.insertOrderedList")}).render()}));var r=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),a=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),s=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),l=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),c=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),u=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",b.invoke(r,"render")),this.context.memo("button.justifyCenter",b.invoke(a,"render")),this.context.memo("button.justifyRight",b.invoke(s,"render")),this.context.memo("button.justifyFull",b.invoke(l,"render")),this.context.memo("button.outdent",b.invoke(c,"render")),this.context.memo("button.indent",b.invoke(u,"render")),this.context.memo("button.paragraph",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.alignLeft),t.options),tooltip:t.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),t.ui.dropdown([t.ui.buttonGroup({className:"note-align",children:[r,a,s,l]}),t.ui.buttonGroup({className:"note-list",children:[c,u]})])]).render()})),this.context.memo("button.height",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.textHeight),t.options),tooltip:t.lang.font.height,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({items:t.options.lineHeights,checkClassName:t.options.icons.menuCheck,className:"dropdown-line-height",title:t.lang.font.height,click:t.context.createInvokeHandler("editor.lineHeight")})]).render()})),this.context.memo("button.table",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.table),t.options),tooltip:t.lang.table.table,data:{toggle:"dropdown"}}),t.ui.dropdown({title:t.lang.table.table,className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>','<div class="note-dimension-picker-highlighted"/>','<div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(e){e.find(".note-dimension-picker-mousecatcher").css({width:t.options.insertTableMaxSize.col+"em",height:t.options.insertTableMaxSize.row+"em"}).mousedown(t.context.createInvokeHandler("editor.insertTable")).on("mousemove",t.tableMoveHandler.bind(t))}}).render()})),this.context.memo("button.link",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.link+t.representShortcut("linkDialog.show"),click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.picture",(function(){return t.button({contents:t.ui.icon(t.options.icons.picture),tooltip:t.lang.image.image,click:t.context.createInvokeHandler("imageDialog.show")}).render()})),this.context.memo("button.video",(function(){return t.button({contents:t.ui.icon(t.options.icons.video),tooltip:t.lang.video.video,click:t.context.createInvokeHandler("videoDialog.show")}).render()})),this.context.memo("button.hr",(function(){return t.button({contents:t.ui.icon(t.options.icons.minus),tooltip:t.lang.hr.insert+t.representShortcut("insertHorizontalRule"),click:t.context.createInvokeHandler("editor.insertHorizontalRule")}).render()})),this.context.memo("button.fullscreen",(function(){return t.button({className:"btn-fullscreen",contents:t.ui.icon(t.options.icons.arrowsAlt),tooltip:t.lang.options.fullscreen,click:t.context.createInvokeHandler("fullscreen.toggle")}).render()})),this.context.memo("button.codeview",(function(){return t.button({className:"btn-codeview",contents:t.ui.icon(t.options.icons.code),tooltip:t.lang.options.codeview,click:t.context.createInvokeHandler("codeview.toggle")}).render()})),this.context.memo("button.redo",(function(){return t.button({contents:t.ui.icon(t.options.icons.redo),tooltip:t.lang.history.redo+t.representShortcut("redo"),click:t.context.createInvokeHandler("editor.redo")}).render()})),this.context.memo("button.undo",(function(){return t.button({contents:t.ui.icon(t.options.icons.undo),tooltip:t.lang.history.undo+t.representShortcut("undo"),click:t.context.createInvokeHandler("editor.undo")}).render()})),this.context.memo("button.help",(function(){return t.button({contents:t.ui.icon(t.options.icons.question),tooltip:t.lang.options.help,click:t.context.createInvokeHandler("helpDialog.show")}).render()}))}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",(function(){return t.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()})),this.context.memo("button.resizeHalf",(function(){return t.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()})),this.context.memo("button.resizeQuarter",(function(){return t.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()})),this.context.memo("button.resizeNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()})),this.context.memo("button.floatLeft",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()})),this.context.memo("button.floatRight",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()})),this.context.memo("button.floatNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()})),this.context.memo("button.removeMedia",(function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()}))}},{key:"addLinkPopoverButtons",value:function(){var t=this;this.context.memo("button.linkDialogShow",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.unlink",(function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()}))}},{key:"addTablePopoverButtons",value:function(){var t=this;this.context.memo("button.addRowUp",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()})),this.context.memo("button.addRowDown",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()})),this.context.memo("button.addColLeft",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()})),this.context.memo("button.addColRight",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()})),this.context.memo("button.deleteRow",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()})),this.context.memo("button.deleteCol",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()})),this.context.memo("button.deleteTable",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()}))}},{key:"build",value:function(t,e){for(var n=0,o=e.length;n<o;n++){for(var i=e[n],r=Array.isArray(i)?i[0]:i,a=Array.isArray(i)?1===i.length?[i[0]]:i[1]:[i],s=this.ui.buttonGroup({className:"note-"+r}).render(),l=0,c=a.length;l<c;l++){var u=this.context.memo("button."+a[l]);u&&s.append("function"==typeof u?u(this.context):u)}s.appendTo(t)}}},{key:"updateCurrentStyle",value:function(t){var e=this,n=t||this.$toolbar,o=this.context.invoke("editor.currentStyle");if(this.updateBtnStates(n,{".note-btn-bold":function(){return"bold"===o["font-bold"]},".note-btn-italic":function(){return"italic"===o["font-italic"]},".note-btn-underline":function(){return"underline"===o["font-underline"]},".note-btn-subscript":function(){return"subscript"===o["font-subscript"]},".note-btn-superscript":function(){return"superscript"===o["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===o["font-strikethrough"]}}),o["font-family"]){var r=o["font-family"].split(",").map((function(t){return t.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")})),a=x.find(r,this.isFontInstalled.bind(this));n.find(".dropdown-fontname a").each((function(t,e){var n=i()(e),o=n.data("value")+""==a+"";n.toggleClass("checked",o)})),n.find(".note-current-fontname").text(a).css("font-family",a)}if(o["font-size"]){var s=o["font-size"];n.find(".dropdown-fontsize a").each((function(t,e){var n=i()(e),o=n.data("value")+""==s+"";n.toggleClass("checked",o)})),n.find(".note-current-fontsize").text(s);var l=o["font-size-unit"];n.find(".dropdown-fontsizeunit a").each((function(t,e){var n=i()(e),o=n.data("value")+""==l+"";n.toggleClass("checked",o)})),n.find(".note-current-fontsizeunit").text(l)}if(o["line-height"]){var c=o["line-height"];n.find(".dropdown-line-height li a").each((function(t,n){var o=i()(n).data("value")+""==c+"";e.className=o?"checked":""}))}}},{key:"updateBtnStates",value:function(t,e){var n=this;i.a.each(e,(function(e,o){n.ui.toggleBtnActive(t.find(e),o())}))}},{key:"tableMoveHandler",value:function(t){var e,n=i()(t.target.parentNode),o=n.next(),r=n.find(".note-dimension-picker-mousecatcher"),a=n.find(".note-dimension-picker-highlighted"),s=n.find(".note-dimension-picker-unhighlighted");if(void 0===t.offsetX){var l=i()(t.target).offset();e={x:t.pageX-l.left,y:t.pageY-l.top}}else e={x:t.offsetX,y:t.offsetY};var c=Math.ceil(e.x/18)||1,u=Math.ceil(e.y/18)||1;a.css({width:c+"em",height:u+"em"}),r.data("value",c+"x"+u),c>3&&c<this.options.insertTableMaxSize.col&&s.css({width:c+1+"em"}),u>3&&u<this.options.insertTableMaxSize.row&&s.css({height:u+1+"em"}),o.html(c+" x "+u)}}])&&ie(e.prototype,n),o&&ie(e,o),t}();function ae(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var se=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$window=i()(window),this.$document=i()(document),this.ui=i.a.summernote.ui,this.$note=e.layoutInfo.note,this.$editor=e.layoutInfo.editor,this.$toolbar=e.layoutInfo.toolbar,this.$editable=e.layoutInfo.editable,this.$statusbar=e.layoutInfo.statusbar,this.options=e.options,this.isFollowing=!1,this.followScroll=this.followScroll.bind(this)}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!this.options.airMode}},{key:"initialize",value:function(){var t=this;this.options.toolbar=this.options.toolbar||[],this.options.toolbar.length?this.context.invoke("buttons.build",this.$toolbar,this.options.toolbar):this.$toolbar.hide(),this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.changeContainer(!1),this.$note.on("summernote.keyup summernote.mouseup summernote.change",(function(){t.context.invoke("buttons.updateCurrentStyle")})),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}},{key:"destroy",value:function(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}},{key:"followScroll",value:function(){if(this.$editor.hasClass("fullscreen"))return!1;var t=this.$editor.outerHeight(),e=this.$editor.width(),n=this.$toolbar.height(),o=this.$statusbar.height(),r=0;this.options.otherStaticBar&&(r=i()(this.options.otherStaticBar).outerHeight());var a=this.$document.scrollTop(),s=this.$editor.offset().top,l=s-r,c=s+t-r-n-o;!this.isFollowing&&a>l&&a<c-n?(this.isFollowing=!0,this.$editable.css({marginTop:this.$toolbar.outerHeight()}),this.$toolbar.css({position:"fixed",top:r,width:e,zIndex:1e3})):this.isFollowing&&(a<l||a>c)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function(t){t?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),t),this.changeContainer(t)}},{key:"updateCodeview",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),t),t?this.deactivate():this.activate()}},{key:"activate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!0)}},{key:"deactivate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!1)}}])&&ae(e.prototype,n),o&&ae(e,o),t}();function le(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ce=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo,e.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group">','<label for="note-dialog-link-txt-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.textToDisplay,"</label>"),'<input id="note-dialog-link-txt-'.concat(this.options.id,'" class="note-link-text form-control note-form-control note-input" type="text"/>'),"</div>",'<div class="form-group note-form-group">','<label for="note-dialog-link-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.url,"</label>"),'<input id="note-dialog-link-url-'.concat(this.options.id,'" class="note-link-url form-control note-form-control note-input" type="text" value="http://"/>'),"</div>",this.options.disableLinkTarget?"":i()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),i()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-link-btn",'" value="').concat(this.lang.link.insert,'" disabled>');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"toggleLinkBtn",value:function(t,e,n){this.ui.toggleBtn(t,e.val()&&n.val())}},{key:"showLinkDialog",value:function(t){var e=this;return i.a.Deferred((function(n){var o=e.$dialog.find(".note-link-text"),i=e.$dialog.find(".note-link-url"),r=e.$dialog.find(".note-link-btn"),a=e.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),s=e.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");e.ui.onDialogShown(e.$dialog,(function(){e.context.triggerEvent("dialog.shown"),!t.url&&b.isValidUrl(t.text)&&(t.url=t.text),o.on("input paste propertychange",(function(){t.text=o.val(),e.toggleLinkBtn(r,o,i)})).val(t.text),i.on("input paste propertychange",(function(){t.text||o.val(i.val()),e.toggleLinkBtn(r,o,i)})).val(t.url),v.isSupportTouch||i.trigger("focus"),e.toggleLinkBtn(r,o,i),e.bindEnterKey(i,r),e.bindEnterKey(o,r);var l=void 0!==t.isNewWindow?t.isNewWindow:e.context.options.linkTargetBlank;a.prop("checked",l);var c=!t.url&&e.context.options.useProtocol;s.prop("checked",c),r.one("click",(function(r){r.preventDefault(),n.resolve({range:t.range,url:i.val(),text:o.val(),isNewWindow:a.is(":checked"),checkProtocol:s.is(":checked")}),e.ui.hideDialog(e.$dialog)}))})),e.ui.onDialogHidden(e.$dialog,(function(){o.off(),i.off(),r.off(),"pending"===n.state()&&n.reject()})),e.ui.showDialog(e.$dialog)})).promise()}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(e).then((function(e){t.context.invoke("editor.restoreRange"),t.context.invoke("editor.createLink",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}}])&&le(e.prototype,n),o&&le(e,o),t}();function ue(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var de=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){n.update()},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.link)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a> </span>')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){if(this.context.invoke("editor.hasFocus")){var t=this.context.invoke("editor.getLastRange");if(t.isCollapsed()&&t.isOnAnchor()){var e=ft.ancestor(t.sc,ft.isAnchor),n=i()(e).attr("href");this.$popover.find("a").attr("href",n).text(n);var o=ft.posFromPlaceholder(e),r=i()(this.options.container).offset();o.top-=r.top,o.left-=r.left,this.$popover.css({display:"block",left:o.left,top:o.top})}else this.hide()}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&ue(e.prototype,n),o&&ue(e,o),t}();function he(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var fe=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t="";if(this.options.maximumImageFileSize){var e=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),n=1*(this.options.maximumImageFileSize/Math.pow(1024,e)).toFixed(2)+" "+" KMGTP"[e]+"B";t="<small>".concat(this.lang.image.maximumFileSize+" : "+n,"</small>")}var o=this.options.dialogsInBody?this.$body:this.options.container,i=['<div class="form-group note-form-group note-group-select-from-files">','<label for="note-dialog-image-file-'+this.options.id+'" class="note-form-label">'+this.lang.image.selectFromFiles+"</label>",'<input id="note-dialog-image-file-'+this.options.id+'" class="note-image-input form-control-file note-form-control note-input" ',' type="file" name="files" accept="image/*" multiple="multiple"/>',t,"</div>",'<div class="form-group note-group-image-url">','<label for="note-dialog-image-url-'+this.options.id+'" class="note-form-label">'+this.lang.image.url+"</label>",'<input id="note-dialog-image-url-'+this.options.id+'" class="note-image-url form-control note-form-control note-input" type="text"/>',"</div>"].join(""),r='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-image-btn",'" value="').concat(this.lang.image.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:i,footer:r}).render().appendTo(o)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange"),"string"==typeof e?t.options.callbacks.onImageLinkInsert?t.context.triggerEvent("image.link.insert",e):t.context.invoke("editor.insertImage",e):t.context.invoke("editor.insertImagesOrCallback",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showImageDialog",value:function(){var t=this;return i.a.Deferred((function(e){var n=t.$dialog.find(".note-image-input"),o=t.$dialog.find(".note-image-url"),i=t.$dialog.find(".note-image-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.replaceWith(n.clone().on("change",(function(t){e.resolve(t.target.files||t.target.value)})).val("")),o.on("input paste propertychange",(function(){t.ui.toggleBtn(i,o.val())})).val(""),v.isSupportTouch||o.trigger("focus"),i.click((function(t){t.preventDefault(),e.resolve(o.val())})),t.bindEnterKey(o,i)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),i.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&he(e.prototype,n),o&&he(e,o),t}();function pe(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var me=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.editable=e.layoutInfo.editable[0],this.options=e.options,this.events={"summernote.disable summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.image)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t,e){if(ft.isImg(t)){var n=i()(t).offset(),o=i()(this.options.container).offset(),r={};this.options.popatmouse?(r.left=e.pageX-20,r.top=e.pageY):r=n,r.top-=o.top,r.left-=o.left,this.$popover.css({display:"block",left:r.left,top:r.top})}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&pe(e.prototype,n),o&&pe(e,o),t}();function ve(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ge=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.events={"summernote.mousedown":function(t,e){n.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.table)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),v.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){if(this.context.isDisabled())return!1;var e=ft.isCell(t);if(e){var n=ft.posFromPlaceholder(t),o=i()(this.options.container).offset();n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:n.left,top:n.top})}else this.hide();return e}},{key:"hide",value:function(){this.$popover.hide()}}])&&ve(e.prototype,n),o&&ve(e,o),t}();function be(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ye=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group row-fluid">','<label for="note-dialog-video-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.video.url,' <small class="text-muted">').concat(this.lang.video.providers,"</small></label>"),'<input id="note-dialog-video-url-'.concat(this.options.id,'" class="note-video-url form-control note-form-control note-input" type="text"/>'),"</div>"].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-video-btn",'" value="').concat(this.lang.video.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"createVideoNode",value:function(t){var e,n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),o=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),r=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),a=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),s=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),l=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),c=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),u=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),d=t.match(/^.+.(mp4|m4v)$/),h=t.match(/^.+.(ogg|ogv)$/),f=t.match(/^.+.(webm)$/),p=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(n&&11===n[1].length){var m=n[1],v=0;if(void 0!==n[2]){var g=n[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(g)for(var b=[3600,60,1],y=0,k=b.length;y<k;y++)v+=void 0!==g[y+1]?b[y]*parseInt(g[y+1],10):0}e=i()("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+m+(v>0?"?start="+v:"")).attr("width","640").attr("height","360")}else if(o&&o[0].length)e=i()("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+o[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(r&&r[0].length)e=i()("<iframe>").attr("frameborder",0).attr("src",r[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(a&&a[3].length)e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+a[3]).attr("width","640").attr("height","360");else if(s&&s[2].length)e=i()("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+s[2]).attr("width","640").attr("height","360");else if(l&&l[1].length)e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+l[1]);else if(c&&c[1].length||u&&u[2].length){var w=c&&c[1].length?c[1]:u[2];e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","https://v.qq.com/iframe/player.html?vid="+w+"&auto=0")}else if(d||h||f)e=i()("<video controls>").attr("src",t).attr("width","640").attr("height","360");else{if(!p||!p[0].length)return!1;e=i()("<iframe>").attr("frameborder",0).attr("src","https://www.facebook.com/plugins/video.php?href="+encodeURIComponent(p[0])+"&show_text=0&width=560").attr("width","560").attr("height","301").attr("scrolling","no").attr("allowtransparency","true")}return e.addClass("note-video-clip"),e[0]}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getSelectedText");this.context.invoke("editor.saveRange"),this.showVideoDialog(e).then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange");var n=t.createVideoNode(e);n&&t.context.invoke("editor.insertNode",n)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showVideoDialog",value:function(){var t=this;return i.a.Deferred((function(e){var n=t.$dialog.find(".note-video-url"),o=t.$dialog.find(".note-video-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.on("input paste propertychange",(function(){t.ui.toggleBtn(o,n.val())})),v.isSupportTouch||n.trigger("focus"),o.click((function(t){t.preventDefault(),e.resolve(n.val())})),t.bindEnterKey(n,o)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&be(e.prototype,n),o&&be(e,o),t}();function ke(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var we=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.16</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:e,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function(){var t=this,e=this.options.keyMap[v.isMac?"mac":"pc"];return Object.keys(e).map((function(n){var o=e[n],r=i()('<div><div class="help-list-item"/></div>');return r.append(i()("<label><kbd>"+n+"</kdb></label>").css({width:180,"margin-right":10})).append(i()("<span/>").html(t.context.memo("help."+o)||o)),r.html()})).join("")}},{key:"showHelpDialog",value:function(){var t=this;return i.a.Deferred((function(e){t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),e.resolve()})),t.ui.showDialog(t.$dialog)})).promise()}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then((function(){t.context.invoke("editor.restoreRange")}))}}])&&ke(e.prototype,n),o&&ke(e,o),t}();function Ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var xe=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.hidable=!0,this.onContextmenu=!1,this.pageX=null,this.pageY=null,this.events={"summernote.contextmenu":function(t){n.options.editing&&(t.preventDefault(),t.stopPropagation(),n.onContextmenu=!0,n.update(!0))},"summernote.mousedown":function(t,e){n.pageX=e.pageX,n.pageY=e.pageY},"summernote.keyup summernote.mouseup summernote.scroll":function(t,e){n.options.editing&&!n.onContextmenu&&(n.pageX=e.pageX,n.pageY=e.pageY,n.update()),n.onContextmenu=!1},"summernote.disable summernote.change summernote.dialog.shown summernote.blur":function(){n.hide()},"summernote.focusout":function(){n.$popover.is(":active,:focus")||n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return this.options.airMode&&!x.isEmpty(this.options.popover.air)}},{key:"initialize",value:function(){var t=this;this.$popover=this.ui.popover({className:"note-air-popover"}).render().appendTo(this.options.container);var e=this.$popover.find(".popover-content");this.context.invoke("buttons.build",e,this.options.popover.air),this.$popover.on("mousedown",(function(){t.hidable=!1})),this.$popover.on("mouseup",(function(){t.hidable=!0}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){var e=this.context.invoke("editor.currentStyle");if(!e.range||e.range.isCollapsed()&&!t)this.hide();else{var n={left:this.pageX,top:this.pageY},o=i()(this.options.container).offset();n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:Math.max(n.left,0)+-5,top:n.top+5}),this.context.invoke("buttons.updateCurrentStyle",this.$popover)}}},{key:"hide",value:function(){this.hidable&&this.$popover.hide()}}])&&Ce(e.prototype,n),o&&Ce(e,o),t}();function Se(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Te=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$editable=e.layoutInfo.editable,this.options=e.options,this.hint=this.options.hint||[],this.direction=this.options.hintDirection||"bottom",this.hints=Array.isArray(this.hint)?this.hint:[this.hint],this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return this.hints.length>0}},{key:"initialize",value:function(){var t=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",(function(e){t.$content.find(".active").removeClass("active"),i()(e.currentTarget).addClass("active"),t.replace()})),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"selectItem",value:function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.next();if(e.length)this.selectItem(e);else{var n=t.parent().next();n.length||(n=this.$content.find(".note-hint-group").first()),this.selectItem(n.find(".note-hint-item").first())}}},{key:"moveUp",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.prev();if(e.length)this.selectItem(e);else{var n=t.parent().prev();n.length||(n=this.$content.find(".note-hint-group").last()),this.selectItem(n.find(".note-hint-item").last())}}},{key:"replace",value:function(){var t=this.$content.find(".note-hint-item.active");if(t.length){var e=this.nodeFromItem(t);if(null!==this.matchingWord&&0===this.matchingWord.length)this.lastWordRange.so=this.lastWordRange.eo;else if(null!==this.matchingWord&&this.matchingWord.length>0&&!this.lastWordRange.isCollapsed()){var n=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length;n>0&&(this.lastWordRange.so+=n)}if(this.lastWordRange.insertNode(e),"next"===this.options.hintSelect){var o=document.createTextNode("");i()(e).after(o),kt.createFromNodeBefore(o).select()}else kt.createFromNodeAfter(e).select();this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus")}}},{key:"nodeFromItem",value:function(t){var e=this.hints[t.data("index")],n=t.data("item"),o=e.content?e.content(n):n;return"string"==typeof o&&(o=ft.createText(o)),o}},{key:"createItemTemplates",value:function(t,e){var n=this.hints[t];return e.map((function(e){var o=i()('<div class="note-hint-item"/>');return o.append(n.template?n.template(e):e+""),o.data({index:t,item:e}),o}))}},{key:"handleKeydown",value:function(t){this.$popover.is(":visible")&&(t.keyCode===Ct.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===Ct.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===Ct.code.DOWN&&(t.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function(t,e,n){var o=this.hints[t];if(o&&o.match.test(e)&&o.search){var i=o.match.exec(e);this.matchingWord=i[0],o.search(i[1],n)}else n()}},{key:"createGroup",value:function(t,e){var n=this,o=i()('<div class="note-hint-group note-hint-group-'+t+'"/>');return this.searchKeyword(t,e,(function(e){(e=e||[]).length&&(o.html(n.createItemTemplates(t,e)),n.show())})),o}},{key:"handleKeyup",value:function(t){var e=this;if(!x.contains([Ct.code.ENTER,Ct.code.UP,Ct.code.DOWN],t.keyCode)){var n,o,r=this.context.invoke("editor.getLastRange");if("words"===this.options.hintMode){if(n=r.getWordsRange(r),o=n.toString(),this.hints.forEach((function(t){if(t.match.test(o))return n=r.getWordsMatchRange(t.match),!1})),!n)return void this.hide();o=n.toString()}else n=r.getWordRange(),o=n.toString();if(this.hints.length&&o){this.$content.empty();var a=b.rect2bnd(x.last(n.getClientRects())),s=i()(this.options.container).offset();a&&(a.top-=s.top,a.left-=s.left,this.$popover.hide(),this.lastWordRange=n,this.hints.forEach((function(t,n){t.match.test(o)&&e.createGroup(n,o).appendTo(e.$content)})),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:a.left,top:a.top-this.$popover.outerHeight()-5}):this.$popover.css({left:a.left,top:a.top+a.height+5}))}else this.hide()}}},{key:"show",value:function(){this.$popover.show()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Se(e.prototype,n),o&&Se(e,o),t}();i.a.summernote=i.a.extend(i.a.summernote,{version:"0.8.16",plugins:{},dom:ft,range:kt,lists:x,options:{langInfo:i.a.summernote.lang["en-US"],editing:!0,modules:{editor:Dt,clipboard:zt,dropzone:Ot,codeview:jt,statusbar:Kt,fullscreen:Vt,handle:Gt,hintPopover:Te,autoLink:Xt,autoSync:Jt,autoReplace:ee,placeholder:oe,buttons:re,toolbar:se,linkDialog:ce,linkPopover:de,imageDialog:fe,imagePopover:me,tablePopover:ge,videoDialog:ye,helpDialog:we,airPopover:xe},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},5:function(t,e,n){},53:function(t,e,n){"use strict";n.r(e);var o=n(0),i=n.n(o),r=n(1);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r.a.create('<div class="note-editor note-frame card"/>'),l=r.a.create('<div class="note-toolbar card-header" role="toolbar"></div>'),c=r.a.create('<div class="note-editing-area"/>'),u=r.a.create('<textarea class="note-codable" aria-multiline="true"/>'),d=r.a.create('<div class="note-editable card-block" contentEditable="true" role="textbox" aria-multiline="true"/>'),h=r.a.create(['<output class="note-status-output" role="status" aria-live="polite"/>','<div class="note-statusbar" role="status">','<output class="note-status-output" aria-live="polite"></output>','<div class="note-resizebar" aria-label="Resize">','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>',"</div>","</div>"].join("")),f=r.a.create('<div class="note-editor note-airframe"/>'),p=r.a.create(['<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>','<output class="note-status-output" role="status" aria-live="polite"/>'].join("")),m=r.a.create('<div class="note-btn-group btn-group">'),v=r.a.create('<div class="note-dropdown-menu dropdown-menu" role="list">',(function(t,e){var n=Array.isArray(e.items)?e.items.map((function(t){var n="string"==typeof t?t:t.value||"",o=e.template?e.template(t):t,i="object"===a(t)?t.option:void 0;return'<a class="dropdown-item" href="#" '+('data-value="'+n+'"'+(void 0!==i?' data-option="'+i+'"':""))+' role="listitem" aria-label="'+n+'">'+o+"</a>"})).join(""):e.items;t.html(n).attr({"aria-label":e.title})})),g=function(t){return t},b=r.a.create('<div class="note-dropdown-menu dropdown-menu note-check" role="list">',(function(t,e){var n=Array.isArray(e.items)?e.items.map((function(t){var n="string"==typeof t?t:t.value||"",o=e.template?e.template(t):t;return'<a class="dropdown-item" href="#" data-value="'+n+'" role="listitem" aria-label="'+t+'">'+C(e.checkClassName)+" "+o+"</a>"})).join(""):e.items;t.html(n).attr({"aria-label":e.title})})),y=r.a.create('<div class="modal note-modal" aria-hidden="false" tabindex="-1" role="dialog"/>',(function(t,e){e.fade&&t.addClass("fade"),t.attr({"aria-label":e.title}),t.html(['<div class="modal-dialog">','<div class="modal-content">',e.title?'<div class="modal-header"><h4 class="modal-title">'+e.title+'</h4><button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">×</button></div>':"",'<div class="modal-body">'+e.body+"</div>",e.footer?'<div class="modal-footer">'+e.footer+"</div>":"","</div>","</div>"].join(""))})),k=r.a.create(['<div class="note-popover popover in">','<div class="arrow"/>','<div class="popover-content note-children-container"/>',"</div>"].join(""),(function(t,e){var n=void 0!==e.direction?e.direction:"bottom";t.addClass(n),e.hideArrow&&t.find(".arrow").hide()})),w=r.a.create('<div class="form-check"></div>',(function(t,e){t.html(['<label class="form-check-label"'+(e.id?' for="note-'+e.id+'"':"")+">",'<input type="checkbox" class="form-check-input"'+(e.id?' id="note-'+e.id+'"':""),e.checked?" checked":"",' aria-label="'+(e.text?e.text:"")+'"',' aria-checked="'+(e.checked?"true":"false")+'"/>'," "+(e.text?e.text:"")+"</label>"].join(""))})),C=function(t,e){return"<"+(e=e||"i")+' class="'+t+'"/>'},x=function(t){return{editor:s,toolbar:l,editingArea:c,codable:u,editable:d,statusbar:h,airEditor:f,airEditable:p,buttonGroup:m,dropdown:v,dropdownButtonContents:g,dropdownCheck:b,dialog:y,popover:k,icon:C,checkbox:w,options:t,palette:function(e,n){return r.a.create('<div class="note-color-palette"/>',(function(e,n){for(var o=[],i=0,r=n.colors.length;i<r;i++){for(var a=n.eventName,s=n.colors[i],l=n.colorsName[i],c=[],u=0,d=s.length;u<d;u++){var h=s[u],f=l[u];c.push(['<button type="button" class="note-color-btn"','style="background-color:',h,'" ','data-event="',a,'" ','data-value="',h,'" ','title="',f,'" ','aria-label="',f,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}o.push('<div class="note-color-row">'+c.join("")+"</div>")}e.html(o.join("")),n.tooltip&&e.find(".note-color-btn").tooltip({container:n.container||t.container,trigger:"hover",placement:"bottom"})}))(e,n)},button:function(e,n){return r.a.create('<button type="button" class="note-btn btn btn-light btn-sm" tabindex="-1">',(function(e,n){n&&n.tooltip&&e.attr({title:n.tooltip,"aria-label":n.tooltip}).tooltip({container:n.container||t.container,trigger:"hover",placement:"bottom"}).on("click",(function(t){i()(t.currentTarget).tooltip("hide")}))}))(e,n)},toggleBtn:function(t,e){t.toggleClass("disabled",!e),t.attr("disabled",!e)},toggleBtnActive:function(t,e){t.toggleClass("active",e)},onDialogShown:function(t,e){t.one("shown.bs.modal",e)},onDialogHidden:function(t,e){t.one("hidden.bs.modal",e)},showDialog:function(t){t.modal("show")},hideDialog:function(t){t.modal("hide")},createLayout:function(e){var n=(t.airMode?f([c([u(),p()])]):"bottom"===t.toolbarPosition?s([c([u(),d()]),l(),h()]):s([l(),c([u(),d()]),h()])).render();return n.insertAfter(e),{note:e,editor:n,toolbar:n.find(".note-toolbar"),editingArea:n.find(".note-editing-area"),editable:n.find(".note-editable"),codable:n.find(".note-codable"),statusbar:n.find(".note-statusbar")}},removeLayout:function(t,e){t.html(e.editable.html()),e.editor.remove(),t.show()}}};n(3),n(5);i.a.summernote=i.a.extend(i.a.summernote,{ui_template:x,interface:"bs4"}),i.a.summernote.options.styleTags=["p",{title:"Blockquote",tag:"blockquote",className:"blockquote",value:"blockquote"},"pre","h1","h2","h3","h4","h5","h6"]}})}));
File: public/AdminLTE/plugins/summernote/summernote-bs4.min.js.map
Match lines: 1
1|{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///external {\"root\":\"jQuery\",\"commonjs2\":\"jquery\",\"commonjs\":\"jquery\",\"amd\":\"jquery\"}","webpack:///./src/js/base/renderer.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./src/js/base/summernote-en-US.js","webpack:///./src/js/base/core/env.js","webpack:///./src/js/base/core/func.js","webpack:///./src/js/base/core/lists.js","webpack:///./src/js/base/core/dom.js","webpack:///./src/js/base/Context.js","webpack:///./src/js/base/core/range.js","webpack:///./src/js/summernote.js","webpack:///./src/js/base/core/key.js","webpack:///./src/js/base/editing/History.js","webpack:///./src/js/base/editing/Style.js","webpack:///./src/js/base/editing/Bullet.js","webpack:///./src/js/base/editing/Typing.js","webpack:///./src/js/base/editing/Table.js","webpack:///./src/js/base/module/Editor.js","webpack:///./src/js/base/core/async.js","webpack:///./src/js/base/module/Clipboard.js","webpack:///./src/js/base/module/Codeview.js","webpack:///./src/js/base/module/Dropzone.js","webpack:///./src/js/base/module/Statusbar.js","webpack:///./src/js/base/module/Fullscreen.js","webpack:///./src/js/base/module/Handle.js","webpack:///./src/js/base/module/AutoLink.js","webpack:///./src/js/base/module/AutoSync.js","webpack:///./src/js/base/module/AutoReplace.js","webpack:///./src/js/base/module/Placeholder.js","webpack:///./src/js/base/module/Buttons.js","webpack:///./src/js/base/module/Toolbar.js","webpack:///./src/js/base/module/LinkDialog.js","webpack:///./src/js/base/module/LinkPopover.js","webpack:///./src/js/base/module/ImageDialog.js","webpack:///./src/js/base/module/ImagePopover.js","webpack:///./src/js/base/module/TablePopover.js","webpack:///./src/js/base/module/VideoDialog.js","webpack:///./src/js/base/module/HelpDialog.js","webpack:///./src/js/base/module/AirPopover.js","webpack:///./src/js/base/module/HintPopover.js","webpack:///./src/js/base/settings.js","webpack:///./src/js/bs4/ui.js","webpack:///./src/js/bs4/settings.js"],"names":["root","factory","exports","module","require","define","amd","a","i","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Renderer","markup","children","options","callback","this","$parent","$node","$","contents","html","className","addClass","data","each","k","v","attr","click","on","$container","find","forEach","child","render","length","append","arguments","Array","isArray","__webpack_amd_options__","summernote","lang","extend","font","bold","italic","underline","clear","height","strikethrough","subscript","superscript","size","sizeunit","image","insert","resizeFull","resizeHalf","resizeQuarter","resizeNone","floatLeft","floatRight","floatNone","shapeRounded","shapeCircle","shapeThumbnail","shapeNone","dragImageHere","dropImage","selectFromFiles","maximumFileSize","maximumFileSizeError","url","remove","original","video","videoLink","providers","link","unlink","edit","textToDisplay","openInNewWindow","useProtocol","table","addRowAbove","addRowBelow","addColLeft","addColRight","delRow","delCol","delTable","hr","style","blockquote","pre","h1","h2","h3","h4","h5","h6","lists","unordered","ordered","help","fullscreen","codeview","paragraph","outdent","indent","left","center","right","justify","color","recent","more","background","foreground","transparent","setTransparent","reset","resetToDefault","cpSelect","shortcut","shortcuts","close","textFormatting","action","paragraphFormatting","documentStyle","extraKeys","history","undo","redo","specialChar","select","output","noSelection","isSupportAmd","genericFontFamilies","validFontName","fontName","inArray","toLowerCase","browserVersion","userAgent","navigator","isMSIE","test","matches","exec","parseFloat","isEdge","hasCodeMirror","CodeMirror","isSupportTouch","MaxTouchPoints","msMaxTouchPoints","inputEventName","isMac","appVersion","indexOf","isFF","isPhantom","isWebkit","isChrome","isSafari","jqueryVersion","fn","jquery","isFontInstalled","testFontName","context","document","createElement","getContext","testSize","originalWidth","measureText","width","isW3CRangeSupport","createRange","idCounter","eq","itemA","itemB","eq2","peq2","propName","ok","fail","self","not","f","apply","and","fA","fB","item","invoke","obj","method","resetUniqueId","uniqueId","prefix","id","rect2bnd","rect","$document","top","scrollTop","scrollLeft","bottom","invertObject","inverted","namespaceToCamel","namespace","split","map","substring","toUpperCase","join","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","setTimeout","isValidUrl","head","array","last","tail","slice","contains","initial","prev","idx","next","pred","len","all","sum","reduce","memo","from","collection","result","isEmpty","clusterBy","aLast","compact","aResult","push","unique","results","NBSP_CHAR","String","fromCharCode","isEditable","node","hasClass","makePredByNodeName","nodeName","isText","nodeType","isVoid","isPara","isPre","isLi","isTable","isData","isInline","isBodyContainer","isList","isHr","isBlockquote","isCell","isAnchor","isBody","blankHTML","env","nodeLength","nodeValue","childNodes","innerHTML","paddingBlankHTML","ancestor","parentNode","listAncestor","ancestors","el","listNext","nodes","nextSibling","insertAfter","preceding","parent","insertBefore","appendChild","appendChildNodes","aChild","isLeftEdgePoint","point","offset","isRightEdgePoint","isEdgePoint","isLeftEdgeOf","position","isRightEdgeOf","previousSibling","hasChildren","prevPoint","isSkipInnerOffset","nextPoint","isSamePoint","pointA","pointB","splitNode","isSkipPaddingBlankHTML","isNotSplitEdgePoint","isDiscardEmptySplits","splitText","childNode","clone","cloneNode","splitTree","isRemoveChild","removeNode","removeChild","isTextarea","stripLinebreaks","val","replace","ZERO_WIDTH_NBSP_CHAR","blank","emptyPara","isControlSizing","isElement","isPurePara","isHeading","isBlock","isBodyInline","isParaInline","isDiv","isBR","isSpan","isB","isU","isS","isI","isImg","deepestChildIsEmpty","firstElementChild","isEmptyAnchor","isClosestSibling","nodeA","nodeB","withClosestSiblings","siblings","isLeftEdgePointOf","isRightEdgePointOf","isVisiblePoint","leftNode","rightNode","prevPointUntil","nextPointUntil","isCharPoint","ch","charAt","isSpacePoint","walkPoint","startPoint","endPoint","handler","singleChildAncestor","lastAncestor","filter","listPrev","listDescendant","descendants","fnWalk","current","commonAncestor","wrap","wrapperName","wrapper","makeOffsetPath","reverse","fromOffsetPath","offsets","splitPoint","splitRoot","container","topAncestor","pivot","createText","text","createTextNode","removeWhile","newNode","cssText","isNewlineOnBlock","match","endSlash","isEndOfInlineContainer","isBlockNode","trim","posFromPlaceholder","placeholder","$placeholder","pos","outerHeight","attachEvents","events","keys","detachEvents","off","isCustomStyleTag","classList","Context","$note","memos","layoutInfo","ui","ui_template","initialize","createLayout","_initialize","hide","_destroy","removeData","removeLayout","disabled","isDisabled","code","dom","disable","now","editor","buttons","plugins","initializeModule","removeModule","removeMemo","triggerEvent","isActivated","undefined","codable","editable","editing","callbacks","trigger","shouldInitialize","ModuleClass","withoutIntialize","destroy","event","createInvokeHandler","preventDefault","$target","target","closest","splits","hasSeparator","moduleName","methodName","textRangeToPoint","textRange","isStart","prevContainer","parentElement","tester","body","createTextRange","moveToElementText","compareEndPoints","textRangeStart","curTextNode","collapse","firstChild","pointTester","duplicate","setEndPoint","textCount","cont","pointToTextRange","info","textRangeInfo","isCollapseToStart","prevTextNodes","collapseToStart","moveStart","type","isExternalAPICalled","hasInitOptions","langInfo","icons","tooltip","note","first","focus","WrappedRange","sc","so","ec","eo","isOnEditable","makeIsOn","isOnList","isOnAnchor","isOnCell","isOnData","w3cRange","setStart","setEnd","Math","min","nativeRng","nativeRange","selection","getSelection","rangeCount","removeAllRanges","addRange","offsetTop","abs","getVisiblePoint","isLeftToRight","block","hasRightNode","hasLeftNode","getEndPoint","isCollapsed","getStartPoint","includeAncestor","fullyContains","leftEdgeNodes","startAncestor","endAncestor","boundaryPoints","getPoints","isSameContainer","rng","emptyParents","normalize","inlineSiblings","concat","para","wrapBodyInlineWithPara","deleteContents","contentsContainer","insertNode","toString","findAfter","isNotTextPoint","regex","index","path","e","paras","getClientRects","wrappedRange","createFromSelection","bodyElement","lastChild","createFromBodyElement","createFromNode","anchorNode","getRangeAt","startContainer","startOffset","endContainer","endOffset","textRangeEnd","isTextNode","createFromNodeBefore","createFromNodeAfter","createFromBookmark","bookmark","createFromParaBookmark","KEY_MAP","isEdit","keyCode","BACKSPACE","TAB","ENTER","SPACE","DELETE","isMove","LEFT","UP","RIGHT","DOWN","isNavigation","HOME","END","PAGEUP","PAGEDOWN","nameFromCode","History","stack","stackOffset","$editable","range","snapshot","recordUndo","applySnapshot","makeSnapshot","historyLimit","shift","Style","$obj","propertyNames","propertyName","css","styleInfo","jQueryCSS","fontSize","parseInt","expandClosestSibling","onlyPartialContains","nodesInRange","tails","elem","$cont","fromNode","queryCommandState","queryCommandValue","isUnordered","lineHeight","toFixed","anchor","Bullet","toggleList","clustereds","previousList","findList","wrapList","appendToPrevious","releaseList","listName","paraBookmark","wrappedParas","diffLists","listNode","prevList","nextList","isEscapseToBody","releasedParas","headList","parentItem","newList","findNextSiblings","lastList","middleList","rootLists","rootList","listNodes","Typing","bullet","tabsize","tab","nextPara","blockquoteBreakingLevel","emptyAnchors","scrollIntoView","TableResultAction","where","domTable","_startPoint","_virtualTable","_actionCellList","setVirtualTablePosition","rowIndex","cellIndex","baseRow","baseCell","isRowSpan","isColSpan","isVirtualCell","objPosition","getActionCell","virtualTableCellObj","resultAction","virtualRowPosition","virtualColPosition","recoverCellIndex","newCellIndex","addCellInfoToVirtual","row","cell","cellHasColspan","colSpan","cellHasRowspan","rowSpan","isThisSelectedCell","rowPos","colPos","rowspanNumber","attributes","rp","rowspanIndex","adjustStartPoint","colspanNumber","cp","cellspanIndex","isSelectedCell","getDeleteResultActionToCell","Column","SubtractSpanCount","Row","isVirtual","AddCell","RemoveCell","getAddResultActionToCell","SumSpanCount","Ignore","getActionList","fixedRow","fixedCol","actualPosition","canContinue","rowPosition","colPosition","requestAction","Add","Delete","tagName","rows","cells","createVirtualTable","Table","isShift","nextCell","currentTr","trAttributes","recoverAttributes","actions","idCell","currentCell","tdAttributes","newTd","removeAttr","setAttribute","before","lastTrIndex","after","actionIndex","resultStr","attrList","specified","cellPos","virtualPosition","virtualTable","hasRowspan","nextRow","cloneRow","removeAttribute","colCount","rowCount","tdHTML","tds","idxCol","trHTML","trs","idxRow","$table","tableClassName","Editor","$editor","lastRange","typing","untab","insertParagraph","insertOrderedList","insertUnorderedList","formatPara","insertHorizontalRule","commands","sCmd","beforeCommand","execCommand","afterCommand","wrapCommand","fontStyling","unit","currentStyle","fontSizeUnit","formatBlock","isLimited","getLastRange","setLastRange","insertText","textNode","pasteHTML","onApplyCustomStyle","onFormatBlock","hrNode","stylePara","createLink","linkInfo","linkUrl","linkText","isNewWindow","checkProtocol","additionalTextLength","isTextChanged","onCreateLink","defaultProtocol","anchors","styleNodes","colorInfo","foreColor","backColor","insertTable","dim","dimension","createTable","removeMedia","restoreTarget","detach","floatMe","toggleClass","resize","hasKeyShortCut","isDefaultPrevented","handleKeyMap","preventDefaultEditableShortCuts","recordEveryKeystroke","spellCheck","disableGrammar","airMode","overrideContextMenu","outerWidth","maxHeight","minHeight","keyMap","metaKey","ctrlKey","altKey","shiftKey","keyName","eventName","tabDisable","pad","maxTextLength","thenCollapse","commit","styleWithCSS","isPreventTrigger","normalizeContent","tabSize","insertTab","src","param","Deferred","deferred","$img","one","resolve","reject","display","appendTo","promise","then","$image","show","files","file","filename","maximumImageFileSize","FileReader","onload","dataURL","onerror","err","readAsDataURL","readFileAsDataURL","insertImage","onImageUpload","insertImagesAsDataURL","currentRange","spans","firstSpan","noteStatusOutput","expand","$anchor","addRow","addCol","deleteRow","deleteCol","deleteTable","bKeepRatio","imageSize","newRatio","y","x","ratio","is","hasFocus","Clipboard","pasteByEvent","clipboardData","originalEvent","items","kind","getAsFile","getData","Dropzone","$eventListener","documentEventHandlers","$dropzone","prependTo","disableDragAndDrop","onDrop","attachDragAndDropEvent","$dropzoneMessage","onDragenter","isCodeview","hasEditorSize","add","onDragleave","removeClass","dataTransfer","types","content","substr","CodeView","$codable","save","deactivate","activate","codeviewFilter","codeviewFilterRegex","codeviewIframeFilter","whitelist","codeviewIframeWhitelistSrc","codeviewIframeWhitelistSrcBase","tag","RegExp","prettifyHtml","cmEditor","fromTextArea","codemirror","tern","server","TernServer","ternServer","cm","updateArgHints","getValue","setSize","toTextArea","purify","isChange","Statusbar","$statusbar","statusbar","disableResizeEditor","stopPropagation","editableTop","onMouseMove","clientY","minheight","max","Fullscreen","$toolbar","toolbar","$window","$scrollbar","onResize","resizeTo","h","setsize","isFullscreen","Handle","$editingArea","editingArea","we","update","$handle","disableResizeImage","posStart","clientX","isImage","$selection","w","origImageObj","Image","sizingText","linkPattern","AutoLink","handleKeyup","handleKeydown","lastWordRange","keyword","urlText","linkTargetBlank","wordRange","getWordRange","AutoSync","AutoReplace","PERIOD","COMMA","SEMICOLON","SLASH","previousKeydownCode","lastWord","jQuery","Node","Placeholder","inheritPlaceholder","isShow","toggle","Buttons","invertedKeyMap","editorMethod","button","addToolbarButtons","addImagePopoverButtons","addLinkPopoverButtons","addTablePopoverButtons","fontInstalledMap","fontNamesIgnoreCheck","buttonGroup","icon","$button","currentTarget","$recentColor","colorButton","dropdownButtonContents","dropdown","$dropdown","$holder","palette","colors","colorsName","customColors","change","$chip","$picker","$palette","prepend","$color","$currentButton","magic","styleTags","title","template","styleIdx","styleLen","representShortcut","createInvokeHandlerAndUpdateState","eraser","addDefaultFonts","fontname","isFontDeservedToAdd","fontNames","dropdownCheck","checkClassName","menuCheck","fontSizes","fontSizeUnits","colorPalette","unorderedlist","orderedlist","justifyLeft","alignLeft","justifyCenter","alignCenter","justifyRight","alignRight","justifyFull","alignJustify","textHeight","lineHeights","insertTableMaxSize","col","mousedown","tableMoveHandler","picture","minus","arrowsAlt","question","rollback","trash","rowAbove","rowBelow","colBefore","colAfter","rowRemove","colRemove","groups","groupIdx","groupLen","group","groupName","$group","btn","updateBtnStates","$item","isChecked","infos","selector","toggleBtnActive","posOffset","$dimensionDisplay","$catcher","$highlighted","$unhighlighted","offsetX","posCatcher","pageX","pageY","offsetY","ceil","Toolbar","isFollowing","followScroll","toolbarContainer","changeContainer","followingToolbar","editorHeight","editorWidth","toolbarHeight","statusbarHeight","otherBarHeight","otherStaticBar","currentOffset","editorOffsetTop","activateOffset","deactivateOffsetBottom","marginTop","zIndex","isIncludeCodeview","$btn","toggleBtn","LinkDialog","$body","dialogsInBody","disableLinkTarget","checkbox","checked","footer","$dialog","dialog","fade","dialogsFade","hideDialog","$input","$linkBtn","$linkText","$linkUrl","$openInNewWindow","$useProtocol","onDialogShown","toggleLinkBtn","bindEnterKey","isNewWindowChecked","prop","useProtocolChecked","onDialogHidden","state","showDialog","showLinkDialog","LinkPopover","popover","$popover","$content","href","containerOffset","ImageDialog","imageLimitation","floor","log","readableSize","pow","showImageDialog","onImageLinkInsert","$imageInput","$imageUrl","$imageBtn","replaceWith","ImagePopover","popatmouse","TablePopover","VideoDialog","$video","ytMatch","igMatch","vMatch","vimMatch","dmMatch","youkuMatch","qqMatch","qqMatch2","mp4Match","oggMatch","webmMatch","fbMatch","youtubeId","start","ytMatchForStart","vid","encodeURIComponent","showVideoDialog","createVideoNode","$videoUrl","$videoBtn","HelpDialog","createShortcutList","command","$row","showHelpDialog","AirPopover","hidable","onContextmenu","air","forcelyOpen","HintPopover","hint","direction","hintDirection","hints","matchingWord","hideArrow","innerHeight","$current","$next","selectItem","$nextGroup","$prev","$prevGroup","nodeFromItem","rangeCompute","hintSelect","hintIdx","moveUp","moveDown","search","searchKeyword","createItemTemplates","hintMode","getWordsRange","getWordsMatchRange","empty","bnd","createGroup","version","Codeview","toolbarPosition","tabDisabled","textareaAutoSync","onBeforeCommand","onBlur","onBlurCodeview","onChange","onChangeCodeview","onEnter","onFocus","onImageUploadError","onInit","onKeydown","onKeyup","onMousedown","onMouseup","onPaste","onScroll","htmlMode","lineNumbers","pc","mac","renderer","airEditor","airEditable","option","iconClassName","editorOptions","rowSize","colSize","colorName","placement","isEnable","isActive","modal","interface"],"mappings":";CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,gBAC7B,GAAqB,mBAAXC,QAAyBA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wB,EAAQ9R,IAAI,iBAAkBre,IAGhCoxB,eAAgB,SAASjB,EAASnwB,GAChCmwB,EAAQ9R,IAAI,kBAAmBre,IAGjCsxB,WAAY,SAASnB,GACnBA,EAAQ4I,MAAM,SAGhBxI,WAAY,SAASJ,GACnBA,EAAQ4I,MAAM,SAGhB11B,aAAc,SAASN,GACrB,IAAM6V,GAAW4f,EAAc9b,QAAU0b,EAAU,CACjDxS,EAAY,CACVlhB,IACA2zB,QAEoC,WAAlCG,EAAc3B,gBAChB5yB,EAAO,CACP2hB,EAAY,CACVlhB,IACAC,MAEFugB,IACAV,MAEAvgB,EAAO,CACPihB,IACAU,EAAY,CACVlhB,IACAC,MAEF6f,OAEDn6B,SAIH,OAFAuuB,EAAQ3d,YAAY8H,GAEb,CACL8E,KAAM9E,EACNkB,OAAQ2U,EACRsM,QAAStM,EAAQ1uB,KAAK,iBACtB07B,YAAahN,EAAQ1uB,KAAK,sBAC1Bya,SAAUiU,EAAQ1uB,KAAK,kBACvBwa,QAASkU,EAAQ1uB,KAAK,iBACtBs6B,UAAW5L,EAAQ1uB,KAAK,qBAI5BwZ,aAAc,SAASX,EAAOE,GAC5BF,EAAMxZ,KAAK0Z,EAAW0B,SAASpb,QAC/B0Z,EAAWgB,OAAOpX,SAClBkW,EAAM8b,U,UChPZx1B,IAAEuB,WAAavB,IAAEyB,OAAOzB,IAAEuB,WAAY,CACpCuY,YAAaD,EACb81B,UAAW,QAGb3vC,IAAEuB,WAAW5B,QAAQihC,UAAY,CAC/B,IACA,CAAEC,MAAO,aAAc7G,IAAK,aAAc75B,UAAW,aAAc1B,MAAO,cAC1E,MAAO,KAAM,KAAM,KAAM,KAAM,KAAM","file":"summernote-bs4.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 53);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import $ from 'jquery';\n\nclass Renderer {\n constructor(markup, children, options, callback) {\n this.markup = markup;\n this.children = children;\n this.options = options;\n this.callback = callback;\n }\n\n render($parent) {\n const $node = $(this.markup);\n\n if (this.options && this.options.contents) {\n $node.html(this.options.contents);\n }\n\n if (this.options && this.options.className) {\n $node.addClass(this.options.className);\n }\n\n if (this.options && this.options.data) {\n $.each(this.options.data, (k, v) => {\n $node.attr('data-' + k, v);\n });\n }\n\n if (this.options && this.options.click) {\n $node.on('click', this.options.click);\n }\n\n if (this.children) {\n const $container = $node.find('.note-children-container');\n this.children.forEach((child) => {\n child.render($container.length ? $container : $node);\n });\n }\n\n if (this.callback) {\n this.callback($node, this.options);\n }\n\n if (this.options && this.options.callback) {\n this.options.callback($node);\n }\n\n if ($parent) {\n $parent.append($node);\n }\n\n return $node;\n }\n}\n\nexport default {\n create: (markup, callback) => {\n return function() {\n const options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n let children = Array.isArray(arguments[0]) ? arguments[0] : [];\n if (options && options.children) {\n children = options.children;\n }\n return new Renderer(markup, children, options, callback);\n };\n },\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import $ from 'jquery';\n\n$.summernote = $.summernote || {\n lang: {},\n};\n\n$.extend($.summernote.lang, {\n 'en-US': {\n font: {\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n clear: 'Remove Font Style',\n height: 'Line Height',\n name: 'Font Family',\n strikethrough: 'Strikethrough',\n subscript: 'Subscript',\n superscript: 'Superscript',\n size: 'Font Size',\n sizeunit: 'Font Size Unit',\n },\n image: {\n image: 'Picture',\n insert: 'Insert Image',\n resizeFull: 'Resize full',\n resizeHalf: 'Resize half',\n resizeQuarter: 'Resize quarter',\n resizeNone: 'Original size',\n floatLeft: 'Float Left',\n floatRight: 'Float Right',\n floatNone: 'Remove float',\n shapeRounded: 'Shape: Rounded',\n shapeCircle: 'Shape: Circle',\n shapeThumbnail: 'Shape: Thumbnail',\n shapeNone: 'Shape: None',\n dragImageHere: 'Drag image or text here',\n dropImage: 'Drop image or Text',\n selectFromFiles: 'Select from files',\n maximumFileSize: 'Maximum file size',\n maximumFileSizeError: 'Maximum file size exceeded.',\n url: 'Image URL',\n remove: 'Remove Image',\n original: 'Original',\n },\n video: {\n video: 'Video',\n videoLink: 'Video Link',\n insert: 'Insert Video',\n url: 'Video URL',\n providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)',\n },\n link: {\n link: 'Link',\n insert: 'Insert Link',\n unlink: 'Unlink',\n edit: 'Edit',\n textToDisplay: 'Text to display',\n url: 'To what URL should this link go?',\n openInNewWindow: 'Open in new window',\n useProtocol: 'Use default protocol',\n },\n table: {\n table: 'Table',\n addRowAbove: 'Add row above',\n addRowBelow: 'Add row below',\n addColLeft: 'Add column left',\n addColRight: 'Add column right',\n delRow: 'Delete row',\n delCol: 'Delete column',\n delTable: 'Delete table',\n },\n hr: {\n insert: 'Insert Horizontal Rule',\n },\n style: {\n style: 'Style',\n p: 'Normal',\n blockquote: 'Quote',\n pre: 'Code',\n h1: 'Header 1',\n h2: 'Header 2',\n h3: 'Header 3',\n h4: 'Header 4',\n h5: 'Header 5',\n h6: 'Header 6',\n },\n lists: {\n unordered: 'Unordered list',\n ordered: 'Ordered list',\n },\n options: {\n help: 'Help',\n fullscreen: 'Full Screen',\n codeview: 'Code View',\n },\n paragraph: {\n paragraph: 'Paragraph',\n outdent: 'Outdent',\n indent: 'Indent',\n left: 'Align left',\n center: 'Align center',\n right: 'Align right',\n justify: 'Justify full',\n },\n color: {\n recent: 'Recent Color',\n more: 'More Color',\n background: 'Background Color',\n foreground: 'Text Color',\n transparent: 'Transparent',\n setTransparent: 'Set transparent',\n reset: 'Reset',\n resetToDefault: 'Reset to default',\n cpSelect: 'Select',\n },\n shortcut: {\n shortcuts: 'Keyboard shortcuts',\n close: 'Close',\n textFormatting: 'Text formatting',\n action: 'Action',\n paragraphFormatting: 'Paragraph formatting',\n documentStyle: 'Document Style',\n extraKeys: 'Extra keys',\n },\n help: {\n 'insertParagraph': 'Insert Paragraph',\n 'undo': 'Undoes the last command',\n 'redo': 'Redoes the last command',\n 'tab': 'Tab',\n 'untab': 'Untab',\n 'bold': 'Set a bold style',\n 'italic': 'Set a italic style',\n 'underline': 'Set a underline style',\n 'strikethrough': 'Set a strikethrough style',\n 'removeFormat': 'Clean a style',\n 'justifyLeft': 'Set left align',\n 'justifyCenter': 'Set center align',\n 'justifyRight': 'Set right align',\n 'justifyFull': 'Set full align',\n 'insertUnorderedList': 'Toggle unordered list',\n 'insertOrderedList': 'Toggle ordered list',\n 'outdent': 'Outdent on current paragraph',\n 'indent': 'Indent on current paragraph',\n 'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n 'formatH1': 'Change current block\\'s format as H1',\n 'formatH2': 'Change current block\\'s format as H2',\n 'formatH3': 'Change current block\\'s format as H3',\n 'formatH4': 'Change current block\\'s format as H4',\n 'formatH5': 'Change current block\\'s format as H5',\n 'formatH6': 'Change current block\\'s format as H6',\n 'insertHorizontalRule': 'Insert horizontal rule',\n 'linkDialog.show': 'Show Link Dialog',\n },\n history: {\n undo: 'Undo',\n redo: 'Redo',\n },\n specialChar: {\n specialChar: 'SPECIAL CHARACTERS',\n select: 'Select Special characters',\n },\n output: {\n noSelection: 'No Selection Made!',\n },\n },\n});\n","import $ from 'jquery';\nconst isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n\n/**\n * returns whether font is installed or not.\n *\n * @param {String} fontName\n * @return {Boolean}\n */\nconst genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n\nfunction validFontName(fontName) {\n return ($.inArray(fontName.toLowerCase(), genericFontFamilies) === -1) ? `'${fontName}'` : fontName;\n}\n\nfunction isFontInstalled(fontName) {\n const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n const testText = 'mmmmmmmmmmwwwww';\n const testSize = '200px';\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n\n context.font = testSize + \" '\" + testFontName + \"'\";\n const originalWidth = context.measureText(testText).width;\n\n context.font = testSize + ' ' + validFontName(fontName) + ', \"' + testFontName + '\"';\n const width = context.measureText(testText).width;\n\n return originalWidth !== width;\n}\n\nconst userAgent = navigator.userAgent;\nconst isMSIE = /MSIE|Trident/i.test(userAgent);\nlet browserVersion;\nif (isMSIE) {\n let matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n}\n\nconst isEdge = /Edge\\/\\d+/.test(userAgent);\n\nlet hasCodeMirror = !!window.CodeMirror;\n\nconst isSupportTouch =\n (('ontouchstart' in window) ||\n (navigator.MaxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0));\n\n// [workaround] IE doesn't have input events for contentEditable\n// - see: https://goo.gl/4bfIvA\nconst inputEventName = (isMSIE) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n\n/**\n * @class core.env\n *\n * Object which check platform and agent\n *\n * @singleton\n * @alternateClassName env\n */\nexport default {\n isMac: navigator.appVersion.indexOf('Mac') > -1,\n isMSIE,\n isEdge,\n isFF: !isEdge && /firefox/i.test(userAgent),\n isPhantom: /PhantomJS/i.test(userAgent),\n isWebkit: !isEdge && /webkit/i.test(userAgent),\n isChrome: !isEdge && /chrome/i.test(userAgent),\n isSafari: !isEdge && /safari/i.test(userAgent) && (!/chrome/i.test(userAgent)),\n browserVersion,\n jqueryVersion: parseFloat($.fn.jquery),\n isSupportAmd,\n isSupportTouch,\n hasCodeMirror,\n isFontInstalled,\n isW3CRangeSupport: !!document.createRange,\n inputEventName,\n genericFontFamilies,\n validFontName,\n};\n","import $ from 'jquery';\n\n/**\n * @class core.func\n *\n * func utils (for high-order func's arg)\n *\n * @singleton\n * @alternateClassName func\n */\nfunction eq(itemA) {\n return function(itemB) {\n return itemA === itemB;\n };\n}\n\nfunction eq2(itemA, itemB) {\n return itemA === itemB;\n}\n\nfunction peq2(propName) {\n return function(itemA, itemB) {\n return itemA[propName] === itemB[propName];\n };\n}\n\nfunction ok() {\n return true;\n}\n\nfunction fail() {\n return false;\n}\n\nfunction not(f) {\n return function() {\n return !f.apply(f, arguments);\n };\n}\n\nfunction and(fA, fB) {\n return function(item) {\n return fA(item) && fB(item);\n };\n}\n\nfunction self(a) {\n return a;\n}\n\nfunction invoke(obj, method) {\n return function() {\n return obj[method].apply(obj, arguments);\n };\n}\n\nlet idCounter = 0;\n\n/**\n * reset globally-unique id\n *\n */\nfunction resetUniqueId() {\n idCounter = 0;\n}\n\n/**\n * generate a globally-unique id\n *\n * @param {String} [prefix]\n */\nfunction uniqueId(prefix) {\n const id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n/**\n * returns bnd (bounds) from rect\n *\n * - IE Compatibility Issue: http://goo.gl/sRLOAo\n * - Scroll Issue: http://goo.gl/sNjUc\n *\n * @param {Rect} rect\n * @return {Object} bounds\n * @return {Number} bounds.top\n * @return {Number} bounds.left\n * @return {Number} bounds.width\n * @return {Number} bounds.height\n */\nfunction rect2bnd(rect) {\n const $document = $(document);\n return {\n top: rect.top + $document.scrollTop(),\n left: rect.left + $document.scrollLeft(),\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\n/**\n * returns a copy of the object where the keys have become the values and the values the keys.\n * @param {Object} obj\n * @return {Object}\n */\nfunction invertObject(obj) {\n const inverted = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n inverted[obj[key]] = key;\n }\n }\n return inverted;\n}\n\n/**\n * @param {String} namespace\n * @param {String} [prefix]\n * @return {String}\n */\nfunction namespaceToCamel(namespace, prefix) {\n prefix = prefix || '';\n return prefix + namespace.split('.').map(function(name) {\n return name.substring(0, 1).toUpperCase() + name.substring(1);\n }).join('');\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n * @param {Function} func\n * @param {Number} wait\n * @param {Boolean} immediate\n * @return {Function}\n */\nfunction debounce(func, wait, immediate) {\n let timeout;\n return function() {\n const context = this;\n const args = arguments;\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/**\n *\n * @param {String} url\n * @return {Boolean}\n */\nfunction isValidUrl(url) {\n const expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n return expression.test(url);\n}\n\nexport default {\n eq,\n eq2,\n peq2,\n ok,\n fail,\n self,\n not,\n and,\n invoke,\n resetUniqueId,\n uniqueId,\n rect2bnd,\n invertObject,\n namespaceToCamel,\n debounce,\n isValidUrl,\n};\n","import func from './func';\n\n/**\n * returns the first item of an array.\n *\n * @param {Array} array\n */\nfunction head(array) {\n return array[0];\n}\n\n/**\n * returns the last item of an array.\n *\n * @param {Array} array\n */\nfunction last(array) {\n return array[array.length - 1];\n}\n\n/**\n * returns everything but the last entry of the array.\n *\n * @param {Array} array\n */\nfunction initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * returns the rest of the items in an array.\n *\n * @param {Array} array\n */\nfunction tail(array) {\n return array.slice(1);\n}\n\n/**\n * returns item of array\n */\nfunction find(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n const item = array[idx];\n if (pred(item)) {\n return item;\n }\n }\n}\n\n/**\n * returns true if all of the values in the array pass the predicate truth test.\n */\nfunction all(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * returns true if the value is present in the list.\n */\nfunction contains(array, item) {\n if (array && array.length && item) {\n if (array.indexOf) {\n return array.indexOf(item) !== -1;\n } else if (array.contains) {\n // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`\n return array.contains(item);\n }\n }\n return false;\n}\n\n/**\n * get sum from a list\n *\n * @param {Array} array - array\n * @param {Function} fn - iterator\n */\nfunction sum(array, fn) {\n fn = fn || func.self;\n return array.reduce(function(memo, v) {\n return memo + fn(v);\n }, 0);\n}\n\n/**\n * returns a copy of the collection with array type.\n * @param {Collection} collection - collection eg) node.childNodes, ...\n */\nfunction from(collection) {\n const result = [];\n const length = collection.length;\n let idx = -1;\n while (++idx < length) {\n result[idx] = collection[idx];\n }\n return result;\n}\n\n/**\n * returns whether list is empty or not\n */\nfunction isEmpty(array) {\n return !array || !array.length;\n}\n\n/**\n * cluster elements by predicate function.\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n * @param {Array[]}\n */\nfunction clusterBy(array, fn) {\n if (!array.length) { return []; }\n const aTail = tail(array);\n return aTail.reduce(function(memo, v) {\n const aLast = last(memo);\n if (fn(last(aLast), v)) {\n aLast[aLast.length] = v;\n } else {\n memo[memo.length] = [v];\n }\n return memo;\n }, [[head(array)]]);\n}\n\n/**\n * returns a copy of the array with all false values removed\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n */\nfunction compact(array) {\n const aResult = [];\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (array[idx]) { aResult.push(array[idx]); }\n }\n return aResult;\n}\n\n/**\n * produces a duplicate-free version of the array\n *\n * @param {Array} array\n */\nfunction unique(array) {\n const results = [];\n\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!contains(results, array[idx])) {\n results.push(array[idx]);\n }\n }\n\n return results;\n}\n\n/**\n * returns next item.\n * @param {Array} array\n */\nfunction next(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx + 1];\n }\n return null;\n}\n\n/**\n * returns prev item.\n * @param {Array} array\n */\nfunction prev(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx - 1];\n }\n return null;\n}\n\n/**\n * @class core.list\n *\n * list utils\n *\n * @singleton\n * @alternateClassName list\n */\nexport default {\n head,\n last,\n initial,\n tail,\n prev,\n next,\n find,\n contains,\n all,\n sum,\n from,\n isEmpty,\n clusterBy,\n compact,\n unique,\n};\n","import $ from 'jquery';\nimport func from './func';\nimport lists from './lists';\nimport env from './env';\n\nconst NBSP_CHAR = String.fromCharCode(160);\nconst ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n\n/**\n * @method isEditable\n *\n * returns whether node is `note-editable` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEditable(node) {\n return node && $(node).hasClass('note-editable');\n}\n\n/**\n * @method isControlSizing\n *\n * returns whether node is `note-control-sizing` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isControlSizing(node) {\n return node && $(node).hasClass('note-control-sizing');\n}\n\n/**\n * @method makePredByNodeName\n *\n * returns predicate which judge whether nodeName is same\n *\n * @param {String} nodeName\n * @return {Function}\n */\nfunction makePredByNodeName(nodeName) {\n nodeName = nodeName.toUpperCase();\n return function(node) {\n return node && node.nodeName.toUpperCase() === nodeName;\n };\n}\n\n/**\n * @method isText\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is text(3)\n */\nfunction isText(node) {\n return node && node.nodeType === 3;\n}\n\n/**\n * @method isElement\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is element(1)\n */\nfunction isElement(node) {\n return node && node.nodeType === 1;\n}\n\n/**\n * ex) br, col, embed, hr, img, input, ...\n * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n */\nfunction isVoid(node) {\n return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n}\n\nfunction isPara(node) {\n if (isEditable(node)) {\n return false;\n }\n\n // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nfunction isHeading(node) {\n return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nconst isPre = makePredByNodeName('PRE');\n\nconst isLi = makePredByNodeName('LI');\n\nfunction isPurePara(node) {\n return isPara(node) && !isLi(node);\n}\n\nconst isTable = makePredByNodeName('TABLE');\n\nconst isData = makePredByNodeName('DATA');\n\nfunction isInline(node) {\n return !isBodyContainer(node) &&\n !isList(node) &&\n !isHr(node) &&\n !isPara(node) &&\n !isTable(node) &&\n !isBlockquote(node) &&\n !isData(node);\n}\n\nfunction isList(node) {\n return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n}\n\nconst isHr = makePredByNodeName('HR');\n\nfunction isCell(node) {\n return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n}\n\nconst isBlockquote = makePredByNodeName('BLOCKQUOTE');\n\nfunction isBodyContainer(node) {\n return isCell(node) || isBlockquote(node) || isEditable(node);\n}\n\nconst isAnchor = makePredByNodeName('A');\n\nfunction isParaInline(node) {\n return isInline(node) && !!ancestor(node, isPara);\n}\n\nfunction isBodyInline(node) {\n return isInline(node) && !ancestor(node, isPara);\n}\n\nconst isBody = makePredByNodeName('BODY');\n\n/**\n * returns whether nodeB is closest sibling of nodeA\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @return {Boolean}\n */\nfunction isClosestSibling(nodeA, nodeB) {\n return nodeA.nextSibling === nodeB ||\n nodeA.previousSibling === nodeB;\n}\n\n/**\n * returns array of closest siblings with node\n *\n * @param {Node} node\n * @param {function} [pred] - predicate function\n * @return {Node[]}\n */\nfunction withClosestSiblings(node, pred) {\n pred = pred || func.ok;\n\n const siblings = [];\n if (node.previousSibling && pred(node.previousSibling)) {\n siblings.push(node.previousSibling);\n }\n siblings.push(node);\n if (node.nextSibling && pred(node.nextSibling)) {\n siblings.push(node.nextSibling);\n }\n return siblings;\n}\n\n/**\n * blank HTML for cursor position\n * - [workaround] old IE only works with \n * - [workaround] IE11 and other browser works with bogus br\n */\nconst blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '<br>';\n\n/**\n * @method nodeLength\n *\n * returns #text's text size or element's childNodes size\n *\n * @param {Node} node\n */\nfunction nodeLength(node) {\n if (isText(node)) {\n return node.nodeValue.length;\n }\n\n if (node) {\n return node.childNodes.length;\n }\n\n return 0;\n}\n\n/**\n * returns whether deepest child node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction deepestChildIsEmpty(node) {\n do {\n if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;\n } while ((node = node.firstElementChild));\n\n return isEmpty(node);\n}\n\n/**\n * returns whether node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEmpty(node) {\n const len = nodeLength(node);\n\n if (len === 0) {\n return true;\n } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n // ex) <p><br></p>, <span><br></span>\n return true;\n } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n // ex) <p></p>, <span></span>\n return true;\n }\n\n return false;\n}\n\n/**\n * padding blankHTML if node is empty (for cursor position)\n */\nfunction paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}\n\n/**\n * find nearest ancestor predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction ancestor(node, pred) {\n while (node) {\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * find nearest ancestor only single child blood line and predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction singleChildAncestor(node, pred) {\n node = node.parentNode;\n\n while (node) {\n if (nodeLength(node) !== 1) { break; }\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * returns new array of ancestor nodes (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listAncestor(node, pred) {\n pred = pred || func.fail;\n\n const ancestors = [];\n ancestor(node, function(el) {\n if (!isEditable(el)) {\n ancestors.push(el);\n }\n\n return pred(el);\n });\n return ancestors;\n}\n\n/**\n * find farthest ancestor predicate hit\n */\nfunction lastAncestor(node, pred) {\n const ancestors = listAncestor(node);\n return lists.last(ancestors.filter(pred));\n}\n\n/**\n * returns common ancestor node between two nodes.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\nfunction commonAncestor(nodeA, nodeB) {\n const ancestors = listAncestor(nodeA);\n for (let n = nodeB; n; n = n.parentNode) {\n if (ancestors.indexOf(n) > -1) return n;\n }\n return null; // difference document area\n}\n\n/**\n * listing all previous siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listPrev(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.previousSibling;\n }\n return nodes;\n}\n\n/**\n * listing next siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listNext(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.nextSibling;\n }\n return nodes;\n}\n\n/**\n * listing descendant nodes\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listDescendant(node, pred) {\n const descendants = [];\n pred = pred || func.ok;\n\n // start DFS(depth first search) with node\n (function fnWalk(current) {\n if (node !== current && pred(current)) {\n descendants.push(current);\n }\n for (let idx = 0, len = current.childNodes.length; idx < len; idx++) {\n fnWalk(current.childNodes[idx]);\n }\n })(node);\n\n return descendants;\n}\n\n/**\n * wrap node with new tag.\n *\n * @param {Node} node\n * @param {Node} tagName of wrapper\n * @return {Node} - wrapper\n */\nfunction wrap(node, wrapperName) {\n const parent = node.parentNode;\n const wrapper = $('<' + wrapperName + '>')[0];\n\n parent.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n}\n\n/**\n * insert node after preceding\n *\n * @param {Node} node\n * @param {Node} preceding - predicate function\n */\nfunction insertAfter(node, preceding) {\n const next = preceding.nextSibling;\n let parent = preceding.parentNode;\n if (next) {\n parent.insertBefore(node, next);\n } else {\n parent.appendChild(node);\n }\n return node;\n}\n\n/**\n * append elements.\n *\n * @param {Node} node\n * @param {Collection} aChild\n */\nfunction appendChildNodes(node, aChild) {\n $.each(aChild, function(idx, child) {\n node.appendChild(child);\n });\n return node;\n}\n\n/**\n * returns whether boundaryPoint is left edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isLeftEdgePoint(point) {\n return point.offset === 0;\n}\n\n/**\n * returns whether boundaryPoint is right edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isRightEdgePoint(point) {\n return point.offset === nodeLength(point.node);\n}\n\n/**\n * returns whether boundaryPoint is edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isEdgePoint(point) {\n return isLeftEdgePoint(point) || isRightEdgePoint(point);\n}\n\n/**\n * returns whether node is left edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgeOf(node, ancestor) {\n while (node && node !== ancestor) {\n if (position(node) !== 0) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether node is right edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgeOf(node, ancestor) {\n if (!ancestor) {\n return false;\n }\n while (node && node !== ancestor) {\n if (position(node) !== nodeLength(node.parentNode) - 1) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether point is left edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgePointOf(point, ancestor) {\n return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns whether point is right edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgePointOf(point, ancestor) {\n return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns offset from parent.\n *\n * @param {Node} node\n */\nfunction position(node) {\n let offset = 0;\n while ((node = node.previousSibling)) {\n offset += 1;\n }\n return offset;\n}\n\nfunction hasChildren(node) {\n return !!(node && node.childNodes && node.childNodes.length);\n}\n\n/**\n * returns previous boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction prevPoint(point, isSkipInnerOffset) {\n let node;\n let offset;\n\n if (point.offset === 0) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node);\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset - 1];\n offset = nodeLength(node);\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? 0 : point.offset - 1;\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns next boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction nextPoint(point, isSkipInnerOffset) {\n let node, offset;\n\n if (isEmpty(point.node)) {\n return null;\n }\n\n if (nodeLength(point.node) === point.offset) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node) + 1;\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset];\n offset = 0;\n if (isEmpty(node)) {\n return null;\n }\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n\n if (isEmpty(node)) {\n return null;\n }\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns whether pointA and pointB is same or not.\n *\n * @param {BoundaryPoint} pointA\n * @param {BoundaryPoint} pointB\n * @return {Boolean}\n */\nfunction isSamePoint(pointA, pointB) {\n return pointA.node === pointB.node && pointA.offset === pointB.offset;\n}\n\n/**\n * returns whether point is visible (can set cursor) or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isVisiblePoint(point) {\n if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {\n return true;\n }\n\n const leftNode = point.node.childNodes[point.offset - 1];\n const rightNode = point.node.childNodes[point.offset];\n if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @method prevPointUtil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction prevPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = prevPoint(point);\n }\n\n return null;\n}\n\n/**\n * @method nextPointUntil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction nextPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = nextPoint(point);\n }\n\n return null;\n}\n\n/**\n * returns whether point has character or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isCharPoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n}\n\n/**\n * returns whether point has space or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isSpacePoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch === ' ' || ch === NBSP_CHAR;\n}\n\n/**\n * @method walkPoint\n *\n * @param {BoundaryPoint} startPoint\n * @param {BoundaryPoint} endPoint\n * @param {Function} handler\n * @param {Boolean} isSkipInnerOffset\n */\nfunction walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n let point = startPoint;\n\n while (point) {\n handler(point);\n\n if (isSamePoint(point, endPoint)) {\n break;\n }\n\n const isSkipOffset = isSkipInnerOffset &&\n startPoint.node !== point.node &&\n endPoint.node !== point.node;\n point = nextPoint(point, isSkipOffset);\n }\n}\n\n/**\n * @method makeOffsetPath\n *\n * return offsetPath(array of offset) from ancestor\n *\n * @param {Node} ancestor - ancestor node\n * @param {Node} node\n */\nfunction makeOffsetPath(ancestor, node) {\n const ancestors = listAncestor(node, func.eq(ancestor));\n return ancestors.map(position).reverse();\n}\n\n/**\n * @method fromOffsetPath\n *\n * return element from offsetPath(array of offset)\n *\n * @param {Node} ancestor - ancestor node\n * @param {array} offsets - offsetPath\n */\nfunction fromOffsetPath(ancestor, offsets) {\n let current = ancestor;\n for (let i = 0, len = offsets.length; i < len; i++) {\n if (current.childNodes.length <= offsets[i]) {\n current = current.childNodes[current.childNodes.length - 1];\n } else {\n current = current.childNodes[offsets[i]];\n }\n }\n return current;\n}\n\n/**\n * @method splitNode\n *\n * split element or #text\n *\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitNode(point, options) {\n let isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n const isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n const isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n\n if (isDiscardEmptySplits) {\n isSkipPaddingBlankHTML = true;\n }\n\n // edge case\n if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n if (isLeftEdgePoint(point)) {\n return point.node;\n } else if (isRightEdgePoint(point)) {\n return point.node.nextSibling;\n }\n }\n\n // split #text\n if (isText(point.node)) {\n return point.node.splitText(point.offset);\n } else {\n const childNode = point.node.childNodes[point.offset];\n const clone = insertAfter(point.node.cloneNode(false), point.node);\n appendChildNodes(clone, listNext(childNode));\n\n if (!isSkipPaddingBlankHTML) {\n paddingBlankHTML(point.node);\n paddingBlankHTML(clone);\n }\n\n if (isDiscardEmptySplits) {\n if (isEmpty(point.node)) {\n remove(point.node);\n }\n if (isEmpty(clone)) {\n remove(clone);\n return point.node.nextSibling;\n }\n }\n\n return clone;\n }\n}\n\n/**\n * @method splitTree\n *\n * split tree by point\n *\n * @param {Node} root - split root\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitTree(root, point, options) {\n // ex) [#text, <span>, <p>]\n const ancestors = listAncestor(point.node, func.eq(root));\n\n if (!ancestors.length) {\n return null;\n } else if (ancestors.length === 1) {\n return splitNode(point, options);\n }\n\n return ancestors.reduce(function(node, parent) {\n if (node === point.node) {\n node = splitNode(point, options);\n }\n\n return splitNode({\n node: parent,\n offset: node ? position(node) : nodeLength(parent),\n }, options);\n });\n}\n\n/**\n * split point\n *\n * @param {Point} point\n * @param {Boolean} isInline\n * @return {Object}\n */\nfunction splitPoint(point, isInline) {\n // find splitRoot, container\n // - inline: splitRoot is a child of paragraph\n // - block: splitRoot is a child of bodyContainer\n const pred = isInline ? isPara : isBodyContainer;\n const ancestors = listAncestor(point.node, pred);\n const topAncestor = lists.last(ancestors) || point.node;\n\n let splitRoot, container;\n if (pred(topAncestor)) {\n splitRoot = ancestors[ancestors.length - 2];\n container = topAncestor;\n } else {\n splitRoot = topAncestor;\n container = splitRoot.parentNode;\n }\n\n // if splitRoot is exists, split with splitTree\n let pivot = splitRoot && splitTree(splitRoot, point, {\n isSkipPaddingBlankHTML: isInline,\n isNotSplitEdgePoint: isInline,\n });\n\n // if container is point.node, find pivot with point.offset\n if (!pivot && container === point.node) {\n pivot = point.node.childNodes[point.offset];\n }\n\n return {\n rightNode: pivot,\n container: container,\n };\n}\n\nfunction create(nodeName) {\n return document.createElement(nodeName);\n}\n\nfunction createText(text) {\n return document.createTextNode(text);\n}\n\n/**\n * @method remove\n *\n * remove node, (isRemoveChild: remove child or not)\n *\n * @param {Node} node\n * @param {Boolean} isRemoveChild\n */\nfunction remove(node, isRemoveChild) {\n if (!node || !node.parentNode) { return; }\n if (node.removeNode) { return node.removeNode(isRemoveChild); }\n\n const parent = node.parentNode;\n if (!isRemoveChild) {\n const nodes = [];\n for (let i = 0, len = node.childNodes.length; i < len; i++) {\n nodes.push(node.childNodes[i]);\n }\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n parent.insertBefore(nodes[i], node);\n }\n }\n\n parent.removeChild(node);\n}\n\n/**\n * @method removeWhile\n *\n * @param {Node} node\n * @param {Function} pred\n */\nfunction removeWhile(node, pred) {\n while (node) {\n if (isEditable(node) || !pred(node)) {\n break;\n }\n\n const parent = node.parentNode;\n remove(node);\n node = parent;\n }\n}\n\n/**\n * @method replace\n *\n * replace node with provided nodeName\n *\n * @param {Node} node\n * @param {String} nodeName\n * @return {Node} - new node\n */\nfunction replace(node, nodeName) {\n if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n return node;\n }\n\n const newNode = create(nodeName);\n\n if (node.style.cssText) {\n newNode.style.cssText = node.style.cssText;\n }\n\n appendChildNodes(newNode, lists.from(node.childNodes));\n insertAfter(newNode, node);\n remove(node);\n\n return newNode;\n}\n\nconst isTextarea = makePredByNodeName('TEXTAREA');\n\n/**\n * @param {jQuery} $node\n * @param {Boolean} [stripLinebreaks] - default: false\n */\nfunction value($node, stripLinebreaks) {\n const val = isTextarea($node[0]) ? $node.val() : $node.html();\n if (stripLinebreaks) {\n return val.replace(/[\\n\\r]/g, '');\n }\n return val;\n}\n\n/**\n * @method html\n *\n * get the HTML contents of node\n *\n * @param {jQuery} $node\n * @param {Boolean} [isNewlineOnBlock]\n */\nfunction html($node, isNewlineOnBlock) {\n let markup = value($node);\n\n if (isNewlineOnBlock) {\n const regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n markup = markup.replace(regexTag, function(match, endSlash, name) {\n name = name.toUpperCase();\n const isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n !!endSlash;\n const isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n\n return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n });\n markup = markup.trim();\n }\n\n return markup;\n}\n\nfunction posFromPlaceholder(placeholder) {\n const $placeholder = $(placeholder);\n const pos = $placeholder.offset();\n const height = $placeholder.outerHeight(true); // include margin\n\n return {\n left: pos.left,\n top: pos.top + height,\n };\n}\n\nfunction attachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.on(key, events[key]);\n });\n}\n\nfunction detachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.off(key, events[key]);\n });\n}\n\n/**\n * @method isCustomStyleTag\n *\n * assert if a node contains a \"note-styletag\" class,\n * which implies that's a custom-made style tag node\n *\n * @param {Node} an HTML DOM node\n */\nfunction isCustomStyleTag(node) {\n return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n}\n\nexport default {\n /** @property {String} NBSP_CHAR */\n NBSP_CHAR,\n /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n ZERO_WIDTH_NBSP_CHAR,\n /** @property {String} blank */\n blank: blankHTML,\n /** @property {String} emptyPara */\n emptyPara: `<p>${blankHTML}</p>`,\n makePredByNodeName,\n isEditable,\n isControlSizing,\n isText,\n isElement,\n isVoid,\n isPara,\n isPurePara,\n isHeading,\n isInline,\n isBlock: func.not(isInline),\n isBodyInline,\n isBody,\n isParaInline,\n isPre,\n isList,\n isTable,\n isData,\n isCell,\n isBlockquote,\n isBodyContainer,\n isAnchor,\n isDiv: makePredByNodeName('DIV'),\n isLi,\n isBR: makePredByNodeName('BR'),\n isSpan: makePredByNodeName('SPAN'),\n isB: makePredByNodeName('B'),\n isU: makePredByNodeName('U'),\n isS: makePredByNodeName('S'),\n isI: makePredByNodeName('I'),\n isImg: makePredByNodeName('IMG'),\n isTextarea,\n deepestChildIsEmpty,\n isEmpty,\n isEmptyAnchor: func.and(isAnchor, isEmpty),\n isClosestSibling,\n withClosestSiblings,\n nodeLength,\n isLeftEdgePoint,\n isRightEdgePoint,\n isEdgePoint,\n isLeftEdgeOf,\n isRightEdgeOf,\n isLeftEdgePointOf,\n isRightEdgePointOf,\n prevPoint,\n nextPoint,\n isSamePoint,\n isVisiblePoint,\n prevPointUntil,\n nextPointUntil,\n isCharPoint,\n isSpacePoint,\n walkPoint,\n ancestor,\n singleChildAncestor,\n listAncestor,\n lastAncestor,\n listNext,\n listPrev,\n listDescendant,\n commonAncestor,\n wrap,\n insertAfter,\n appendChildNodes,\n position,\n hasChildren,\n makeOffsetPath,\n fromOffsetPath,\n splitTree,\n splitPoint,\n create,\n createText,\n remove,\n removeWhile,\n replace,\n html,\n value,\n posFromPlaceholder,\n attachEvents,\n detachEvents,\n isCustomStyleTag,\n};\n","import $ from 'jquery';\nimport func from './core/func';\nimport lists from './core/lists';\nimport dom from './core/dom';\n\nexport default class Context {\n /**\n * @param {jQuery} $note\n * @param {Object} options\n */\n constructor($note, options) {\n this.$note = $note;\n\n this.memos = {};\n this.modules = {};\n this.layoutInfo = {};\n this.options = $.extend(true, {}, options);\n\n // init ui with options\n $.summernote.ui = $.summernote.ui_template(this.options);\n this.ui = $.summernote.ui;\n\n this.initialize();\n }\n\n /**\n * create layout and initialize modules and other resources\n */\n initialize() {\n this.layoutInfo = this.ui.createLayout(this.$note);\n this._initialize();\n this.$note.hide();\n return this;\n }\n\n /**\n * destroy modules and other resources and remove layout\n */\n destroy() {\n this._destroy();\n this.$note.removeData('summernote');\n this.ui.removeLayout(this.$note, this.layoutInfo);\n }\n\n /**\n * destory modules and other resources and initialize it again\n */\n reset() {\n const disabled = this.isDisabled();\n this.code(dom.emptyPara);\n this._destroy();\n this._initialize();\n\n if (disabled) {\n this.disable();\n }\n }\n\n _initialize() {\n // set own id\n this.options.id = func.uniqueId($.now());\n // set default container for tooltips, popovers, and dialogs\n this.options.container = this.options.container || this.layoutInfo.editor;\n\n // add optional buttons\n const buttons = $.extend({}, this.options.buttons);\n Object.keys(buttons).forEach((key) => {\n this.memo('button.' + key, buttons[key]);\n });\n\n const modules = $.extend({}, this.options.modules, $.summernote.plugins || {});\n\n // add and initialize modules\n Object.keys(modules).forEach((key) => {\n this.module(key, modules[key], true);\n });\n\n Object.keys(this.modules).forEach((key) => {\n this.initializeModule(key);\n });\n }\n\n _destroy() {\n // destroy modules with reversed order\n Object.keys(this.modules).reverse().forEach((key) => {\n this.removeModule(key);\n });\n\n Object.keys(this.memos).forEach((key) => {\n this.removeMemo(key);\n });\n // trigger custom onDestroy callback\n this.triggerEvent('destroy', this);\n }\n\n code(html) {\n const isActivated = this.invoke('codeview.isActivated');\n\n if (html === undefined) {\n this.invoke('codeview.sync');\n return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n } else {\n if (isActivated) {\n this.layoutInfo.codable.val(html);\n } else {\n this.layoutInfo.editable.html(html);\n }\n this.$note.val(html);\n this.triggerEvent('change', html, this.layoutInfo.editable);\n }\n }\n\n isDisabled() {\n return this.layoutInfo.editable.attr('contenteditable') === 'false';\n }\n\n enable() {\n this.layoutInfo.editable.attr('contenteditable', true);\n this.invoke('toolbar.activate', true);\n this.triggerEvent('disable', false);\n this.options.editing = true;\n }\n\n disable() {\n // close codeview if codeview is opend\n if (this.invoke('codeview.isActivated')) {\n this.invoke('codeview.deactivate');\n }\n this.layoutInfo.editable.attr('contenteditable', false);\n this.options.editing = false;\n this.invoke('toolbar.deactivate', true);\n\n this.triggerEvent('disable', true);\n }\n\n triggerEvent() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n if (callback) {\n callback.apply(this.$note[0], args);\n }\n this.$note.trigger('summernote.' + namespace, args);\n }\n\n initializeModule(key) {\n const module = this.modules[key];\n module.shouldInitialize = module.shouldInitialize || func.ok;\n if (!module.shouldInitialize()) {\n return;\n }\n\n // initialize module\n if (module.initialize) {\n module.initialize();\n }\n\n // attach events\n if (module.events) {\n dom.attachEvents(this.$note, module.events);\n }\n }\n\n module(key, ModuleClass, withoutIntialize) {\n if (arguments.length === 1) {\n return this.modules[key];\n }\n\n this.modules[key] = new ModuleClass(this);\n\n if (!withoutIntialize) {\n this.initializeModule(key);\n }\n }\n\n removeModule(key) {\n const module = this.modules[key];\n if (module.shouldInitialize()) {\n if (module.events) {\n dom.detachEvents(this.$note, module.events);\n }\n\n if (module.destroy) {\n module.destroy();\n }\n }\n\n delete this.modules[key];\n }\n\n memo(key, obj) {\n if (arguments.length === 1) {\n return this.memos[key];\n }\n this.memos[key] = obj;\n }\n\n removeMemo(key) {\n if (this.memos[key] && this.memos[key].destroy) {\n this.memos[key].destroy();\n }\n\n delete this.memos[key];\n }\n\n /**\n * Some buttons need to change their visual style immediately once they get pressed\n */\n createInvokeHandlerAndUpdateState(namespace, value) {\n return (event) => {\n this.createInvokeHandler(namespace, value)(event);\n this.invoke('buttons.updateCurrentStyle');\n };\n }\n\n createInvokeHandler(namespace, value) {\n return (event) => {\n event.preventDefault();\n const $target = $(event.target);\n this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n };\n }\n\n invoke() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const splits = namespace.split('.');\n const hasSeparator = splits.length > 1;\n const moduleName = hasSeparator && lists.head(splits);\n const methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n\n const module = this.modules[moduleName || 'editor'];\n if (!moduleName && this[methodName]) {\n return this[methodName].apply(this, args);\n } else if (module && module[methodName] && module.shouldInitialize()) {\n return module[methodName].apply(module, args);\n }\n }\n}\n","import $ from 'jquery';\nimport env from './env';\nimport func from './func';\nimport lists from './lists';\nimport dom from './dom';\n\n/**\n * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n *\n * @param {TextRange} textRange\n * @param {Boolean} isStart\n * @return {BoundaryPoint}\n *\n * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n */\nfunction textRangeToPoint(textRange, isStart) {\n let container = textRange.parentElement();\n let offset;\n\n const tester = document.body.createTextRange();\n let prevContainer;\n const childNodes = lists.from(container.childNodes);\n for (offset = 0; offset < childNodes.length; offset++) {\n if (dom.isText(childNodes[offset])) {\n continue;\n }\n tester.moveToElementText(childNodes[offset]);\n if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n break;\n }\n prevContainer = childNodes[offset];\n }\n\n if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n const textRangeStart = document.body.createTextRange();\n let curTextNode = null;\n textRangeStart.moveToElementText(prevContainer || container);\n textRangeStart.collapse(!prevContainer);\n curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n\n const pointTester = textRange.duplicate();\n pointTester.setEndPoint('StartToStart', textRangeStart);\n let textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n\n while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n // [workaround] enforce IE to re-reference curTextNode, hack\n const dummy = curTextNode.nodeValue; // eslint-disable-line\n\n if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n textCount === curTextNode.nodeValue.length) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n container = curTextNode;\n offset = textCount;\n }\n\n return {\n cont: container,\n offset: offset,\n };\n}\n\n/**\n * return TextRange from boundary point (inspired by google closure-library)\n * @param {BoundaryPoint} point\n * @return {TextRange}\n */\nfunction pointToTextRange(point) {\n const textRangeInfo = function(container, offset) {\n let node, isCollapseToStart;\n\n if (dom.isText(container)) {\n const prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n const prevContainer = lists.last(prevTextNodes).previousSibling;\n node = prevContainer || container.parentNode;\n offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n isCollapseToStart = !prevContainer;\n } else {\n node = container.childNodes[offset] || container;\n if (dom.isText(node)) {\n return textRangeInfo(node, 0);\n }\n\n offset = 0;\n isCollapseToStart = false;\n }\n\n return {\n node: node,\n collapseToStart: isCollapseToStart,\n offset: offset,\n };\n };\n\n const textRange = document.body.createTextRange();\n const info = textRangeInfo(point.node, point.offset);\n\n textRange.moveToElementText(info.node);\n textRange.collapse(info.collapseToStart);\n textRange.moveStart('character', info.offset);\n return textRange;\n}\n\n/**\n * Wrapped Range\n *\n * @constructor\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n */\nclass WrappedRange {\n constructor(sc, so, ec, eo) {\n this.sc = sc;\n this.so = so;\n this.ec = ec;\n this.eo = eo;\n\n // isOnEditable: judge whether range is on editable or not\n this.isOnEditable = this.makeIsOn(dom.isEditable);\n // isOnList: judge whether range is on list node or not\n this.isOnList = this.makeIsOn(dom.isList);\n // isOnAnchor: judge whether range is on anchor node or not\n this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n // isOnCell: judge whether range is on cell node or not\n this.isOnCell = this.makeIsOn(dom.isCell);\n // isOnData: judge whether range is on data node or not\n this.isOnData = this.makeIsOn(dom.isData);\n }\n\n // nativeRange: get nativeRange from sc, so, ec, eo\n nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }\n\n getPoints() {\n return {\n sc: this.sc,\n so: this.so,\n ec: this.ec,\n eo: this.eo,\n };\n }\n\n getStartPoint() {\n return {\n node: this.sc,\n offset: this.so,\n };\n }\n\n getEndPoint() {\n return {\n node: this.ec,\n offset: this.eo,\n };\n }\n\n /**\n * select update visible range\n */\n select() {\n const nativeRng = this.nativeRange();\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (selection.rangeCount > 0) {\n selection.removeAllRanges();\n }\n selection.addRange(nativeRng);\n } else {\n nativeRng.select();\n }\n\n return this;\n }\n\n /**\n * Moves the scrollbar to start container(sc) of current range\n *\n * @return {WrappedRange}\n */\n scrollIntoView(container) {\n const height = $(container).height();\n if (container.scrollTop + height < this.sc.offsetTop) {\n container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n }\n\n return this;\n }\n\n /**\n * @return {WrappedRange}\n */\n normalize() {\n /**\n * @param {BoundaryPoint} point\n * @param {Boolean} isLeftToRight - true: prefer to choose right node\n * - false: prefer to choose left node\n * @return {BoundaryPoint}\n */\n const getVisiblePoint = function(point, isLeftToRight) {\n if (!point) {\n return point;\n }\n\n // Just use the given point [XXX:Adhoc]\n // - case 01. if the point is on the middle of the node\n // - case 02. if the point is on the right edge and prefer to choose left node\n // - case 03. if the point is on the left edge and prefer to choose right node\n // - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n // - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n // - case 06. if the point is on the block node and there is no children\n if (dom.isVisiblePoint(point)) {\n if (!dom.isEdgePoint(point) ||\n (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n return point;\n }\n }\n\n // point on block's edge\n const block = dom.ancestor(point.node, dom.isBlock);\n let hasRightNode = false;\n\n if (!hasRightNode) {\n const prevPoint = dom.prevPoint(point) || { node: null };\n hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;\n }\n\n let hasLeftNode = false;\n if (!hasLeftNode) {\n const nextPoint = dom.nextPoint(point) || { node: null };\n hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(nextPoint.node)) && isLeftToRight;\n }\n\n if (hasRightNode || hasLeftNode) {\n // returns point already on visible point\n if (dom.isVisiblePoint(point)) {\n return point;\n }\n // reverse direction\n isLeftToRight = !isLeftToRight;\n }\n\n const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n return nextPoint || point;\n };\n\n const endPoint = getVisiblePoint(this.getEndPoint(), false);\n const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns matched nodes on range\n *\n * @param {Function} [pred] - predicate function\n * @param {Object} [options]\n * @param {Boolean} [options.includeAncestor]\n * @param {Boolean} [options.fullyContains]\n * @return {Node[]}\n */\n nodes(pred, options) {\n pred = pred || func.ok;\n\n const includeAncestor = options && options.includeAncestor;\n const fullyContains = options && options.fullyContains;\n\n // TODO compare points and sort\n const startPoint = this.getStartPoint();\n const endPoint = this.getEndPoint();\n\n const nodes = [];\n const leftEdgeNodes = [];\n\n dom.walkPoint(startPoint, endPoint, function(point) {\n if (dom.isEditable(point.node)) {\n return;\n }\n\n let node;\n if (fullyContains) {\n if (dom.isLeftEdgePoint(point)) {\n leftEdgeNodes.push(point.node);\n }\n if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n node = point.node;\n }\n } else if (includeAncestor) {\n node = dom.ancestor(point.node, pred);\n } else {\n node = point.node;\n }\n\n if (node && pred(node)) {\n nodes.push(node);\n }\n }, true);\n\n return lists.unique(nodes);\n }\n\n /**\n * returns commonAncestor of range\n * @return {Element} - commonAncestor\n */\n commonAncestor() {\n return dom.commonAncestor(this.sc, this.ec);\n }\n\n /**\n * returns expanded range by pred\n *\n * @param {Function} pred - predicate function\n * @return {WrappedRange}\n */\n expand(pred) {\n const startAncestor = dom.ancestor(this.sc, pred);\n const endAncestor = dom.ancestor(this.ec, pred);\n\n if (!startAncestor && !endAncestor) {\n return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n }\n\n const boundaryPoints = this.getPoints();\n\n if (startAncestor) {\n boundaryPoints.sc = startAncestor;\n boundaryPoints.so = 0;\n }\n\n if (endAncestor) {\n boundaryPoints.ec = endAncestor;\n boundaryPoints.eo = dom.nodeLength(endAncestor);\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * @param {Boolean} isCollapseToStart\n * @return {WrappedRange}\n */\n collapse(isCollapseToStart) {\n if (isCollapseToStart) {\n return new WrappedRange(this.sc, this.so, this.sc, this.so);\n } else {\n return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n }\n }\n\n /**\n * splitText on range\n */\n splitText() {\n const isSameContainer = this.sc === this.ec;\n const boundaryPoints = this.getPoints();\n\n if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n this.ec.splitText(this.eo);\n }\n\n if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n boundaryPoints.sc = this.sc.splitText(this.so);\n boundaryPoints.so = 0;\n\n if (isSameContainer) {\n boundaryPoints.ec = boundaryPoints.sc;\n boundaryPoints.eo = this.eo - this.so;\n }\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * delete contents on range\n * @return {WrappedRange}\n */\n deleteContents() {\n if (this.isCollapsed()) {\n return this;\n }\n\n const rng = this.splitText();\n const nodes = rng.nodes(null, {\n fullyContains: true,\n });\n\n // find new cursor point\n const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {\n return !lists.contains(nodes, point.node);\n });\n\n const emptyParents = [];\n $.each(nodes, function(idx, node) {\n // find empty parents\n const parent = node.parentNode;\n if (point.node !== parent && dom.nodeLength(parent) === 1) {\n emptyParents.push(parent);\n }\n dom.remove(node, false);\n });\n\n // remove empty parents\n $.each(emptyParents, function(idx, node) {\n dom.remove(node, false);\n });\n\n return new WrappedRange(\n point.node,\n point.offset,\n point.node,\n point.offset\n ).normalize();\n }\n\n /**\n * makeIsOn: return isOn(pred) function\n */\n makeIsOn(pred) {\n return function() {\n const ancestor = dom.ancestor(this.sc, pred);\n return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n };\n }\n\n /**\n * @param {Function} pred\n * @return {Boolean}\n */\n isLeftEdgeOf(pred) {\n if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n return false;\n }\n\n const node = dom.ancestor(this.sc, pred);\n return node && dom.isLeftEdgeOf(this.sc, node);\n }\n\n /**\n * returns whether range was collapsed or not\n */\n isCollapsed() {\n return this.sc === this.ec && this.so === this.eo;\n }\n\n /**\n * wrap inline nodes which children of body with paragraph\n *\n * @return {WrappedRange}\n */\n wrapBodyInlineWithPara() {\n if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n this.sc.innerHTML = dom.emptyPara;\n return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n }\n\n /**\n * [workaround] firefox often create range on not visible point. so normalize here.\n * - firefox: |<p>text</p>|\n * - chrome: <p>|text|</p>\n */\n const rng = this.normalize();\n if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n return rng;\n }\n\n // find inline top ancestor\n let topAncestor;\n if (dom.isInline(rng.sc)) {\n const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n topAncestor = lists.last(ancestors);\n if (!dom.isInline(topAncestor)) {\n topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n }\n } else {\n topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n }\n\n if (topAncestor) {\n // siblings not in paragraph\n let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n\n // wrap with paragraph\n if (inlineSiblings.length) {\n const para = dom.wrap(lists.head(inlineSiblings), 'p');\n dom.appendChildNodes(para, lists.tail(inlineSiblings));\n }\n }\n\n return this.normalize();\n }\n\n /**\n * insert node at current cursor\n *\n * @param {Node} node\n * @return {Node}\n */\n insertNode(node) {\n let rng = this;\n\n if (dom.isText(node) || dom.isInline(node)) {\n rng = this.wrapBodyInlineWithPara().deleteContents();\n }\n\n const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n if (info.rightNode) {\n info.rightNode.parentNode.insertBefore(node, info.rightNode);\n } else {\n info.container.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * insert html at current cursor\n */\n pasteHTML(markup) {\n markup = $.trim(markup);\n\n const contentsContainer = $('<div></div>').html(markup)[0];\n let childNodes = lists.from(contentsContainer.childNodes);\n\n // const rng = this.wrapBodyInlineWithPara().deleteContents();\n const rng = this;\n\n if (rng.so >= 0) {\n childNodes = childNodes.reverse();\n }\n childNodes = childNodes.map(function(childNode) {\n return rng.insertNode(childNode);\n });\n if (rng.so > 0) {\n childNodes = childNodes.reverse();\n }\n return childNodes;\n }\n\n /**\n * returns text in range\n *\n * @return {String}\n */\n toString() {\n const nativeRng = this.nativeRange();\n return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n }\n\n /**\n * returns range for word before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordRange(findAfter) {\n let endPoint = this.getEndPoint();\n\n if (!dom.isCharPoint(endPoint)) {\n return this;\n }\n\n const startPoint = dom.prevPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordsRange(findAfter) {\n var endPoint = this.getEndPoint();\n\n var isNotTextPoint = function(point) {\n return !dom.isCharPoint(point) && !dom.isSpacePoint(point);\n };\n\n if (isNotTextPoint(endPoint)) {\n return this;\n }\n\n var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor that match with a Regex\n *\n * example:\n * range: 'hi @Peter Pan'\n * regex: '/@[a-z ]+/i'\n * return range: '@Peter Pan'\n *\n * @param {RegExp} [regex]\n * @return {WrappedRange|null}\n */\n getWordsMatchRange(regex) {\n var endPoint = this.getEndPoint();\n\n var startPoint = dom.prevPointUntil(endPoint, function(point) {\n if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {\n return true;\n }\n var rng = new WrappedRange(\n point.node,\n point.offset,\n endPoint.node,\n endPoint.offset\n );\n var result = regex.exec(rng.toString());\n return result && result.index === 0;\n });\n\n var rng = new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n\n var text = rng.toString();\n var result = regex.exec(text);\n\n if (result && result[0].length === text.length) {\n return rng;\n } else {\n return null;\n }\n }\n\n /**\n * create offsetPath bookmark\n *\n * @param {Node} editable\n */\n bookmark(editable) {\n return {\n s: {\n path: dom.makeOffsetPath(editable, this.sc),\n offset: this.so,\n },\n e: {\n path: dom.makeOffsetPath(editable, this.ec),\n offset: this.eo,\n },\n };\n }\n\n /**\n * create offsetPath bookmark base on paragraph\n *\n * @param {Node[]} paras\n */\n paraBookmark(paras) {\n return {\n s: {\n path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n offset: this.so,\n },\n e: {\n path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n offset: this.eo,\n },\n };\n }\n\n /**\n * getClientRects\n * @return {Rect[]}\n */\n getClientRects() {\n const nativeRng = this.nativeRange();\n return nativeRng.getClientRects();\n }\n}\n\n/**\n * Data structure\n * * BoundaryPoint: a point of dom tree\n * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n *\n * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n */\nexport default {\n /**\n * create Range Object From arguments or Browser Selection\n *\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n * @return {WrappedRange}\n */\n create: function(sc, so, ec, eo) {\n if (arguments.length === 4) {\n return new WrappedRange(sc, so, ec, eo);\n } else if (arguments.length === 2) { // collapsed\n ec = sc;\n eo = so;\n return new WrappedRange(sc, so, ec, eo);\n } else {\n let wrappedRange = this.createFromSelection();\n\n if (!wrappedRange && arguments.length === 1) {\n let bodyElement = arguments[0];\n if (dom.isEditable(bodyElement)) {\n bodyElement = bodyElement.lastChild;\n }\n return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);\n }\n return wrappedRange;\n }\n },\n\n createFromBodyElement: function(bodyElement, isCollapseToStart = false) {\n var wrappedRange = this.createFromNode(bodyElement);\n return wrappedRange.collapse(isCollapseToStart);\n },\n\n createFromSelection: function() {\n let sc, so, ec, eo;\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n } else if (dom.isBody(selection.anchorNode)) {\n // Firefox: returns entire body as range on initialization.\n // We won't never need it.\n return null;\n }\n\n const nativeRng = selection.getRangeAt(0);\n sc = nativeRng.startContainer;\n so = nativeRng.startOffset;\n ec = nativeRng.endContainer;\n eo = nativeRng.endOffset;\n } else { // IE8: TextRange\n const textRange = document.selection.createRange();\n const textRangeEnd = textRange.duplicate();\n textRangeEnd.collapse(false);\n const textRangeStart = textRange;\n textRangeStart.collapse(true);\n\n let startPoint = textRangeToPoint(textRangeStart, true);\n let endPoint = textRangeToPoint(textRangeEnd, false);\n\n // same visible point case: range was collapsed.\n if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n endPoint.node.nextSibling === startPoint.node) {\n startPoint = endPoint;\n }\n\n sc = startPoint.cont;\n so = startPoint.offset;\n ec = endPoint.cont;\n eo = endPoint.offset;\n }\n\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from node\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNode: function(node) {\n let sc = node;\n let so = 0;\n let ec = node;\n let eo = dom.nodeLength(ec);\n\n // browsers can't target a picture or void node\n if (dom.isVoid(sc)) {\n so = dom.listPrev(sc).length - 1;\n sc = sc.parentNode;\n }\n if (dom.isBR(ec)) {\n eo = dom.listPrev(ec).length - 1;\n ec = ec.parentNode;\n } else if (dom.isVoid(ec)) {\n eo = dom.listPrev(ec).length;\n ec = ec.parentNode;\n }\n\n return this.create(sc, so, ec, eo);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeBefore: function(node) {\n return this.createFromNode(node).collapse(true);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeAfter: function(node) {\n return this.createFromNode(node).collapse();\n },\n\n /**\n * @method\n *\n * create WrappedRange from bookmark\n *\n * @param {Node} editable\n * @param {Object} bookmark\n * @return {WrappedRange}\n */\n createFromBookmark: function(editable, bookmark) {\n const sc = dom.fromOffsetPath(editable, bookmark.s.path);\n const so = bookmark.s.offset;\n const ec = dom.fromOffsetPath(editable, bookmark.e.path);\n const eo = bookmark.e.offset;\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from paraBookmark\n *\n * @param {Object} bookmark\n * @param {Node[]} paras\n * @return {WrappedRange}\n */\n createFromParaBookmark: function(bookmark, paras) {\n const so = bookmark.s.offset;\n const eo = bookmark.e.offset;\n const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n\n return new WrappedRange(sc, so, ec, eo);\n },\n};\n","import $ from 'jquery';\nimport env from './base/core/env';\nimport lists from './base/core/lists';\nimport Context from './base/Context';\n\n$.fn.extend({\n /**\n * Summernote API\n *\n * @param {Object|String}\n * @return {this}\n */\n summernote: function() {\n const type = $.type(lists.head(arguments));\n const isExternalAPICalled = type === 'string';\n const hasInitOptions = type === 'object';\n\n const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n\n // Update options\n options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);\n options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons);\n options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n\n this.each((idx, note) => {\n const $note = $(note);\n if (!$note.data('summernote')) {\n const context = new Context($note, options);\n $note.data('summernote', context);\n $note.data('summernote').triggerEvent('init', context.layoutInfo);\n }\n });\n\n const $note = this.first();\n if ($note.length) {\n const context = $note.data('summernote');\n if (isExternalAPICalled) {\n return context.invoke.apply(context, lists.from(arguments));\n } else if (options.focus) {\n context.invoke('editor.focus');\n }\n }\n\n return this;\n },\n});\n","import lists from './lists';\nimport func from './func';\n\nconst KEY_MAP = {\n 'BACKSPACE': 8,\n 'TAB': 9,\n 'ENTER': 13,\n 'SPACE': 32,\n 'DELETE': 46,\n\n // Arrow\n 'LEFT': 37,\n 'UP': 38,\n 'RIGHT': 39,\n 'DOWN': 40,\n\n // Number: 0-9\n 'NUM0': 48,\n 'NUM1': 49,\n 'NUM2': 50,\n 'NUM3': 51,\n 'NUM4': 52,\n 'NUM5': 53,\n 'NUM6': 54,\n 'NUM7': 55,\n 'NUM8': 56,\n\n // Alphabet: a-z\n 'B': 66,\n 'E': 69,\n 'I': 73,\n 'J': 74,\n 'K': 75,\n 'L': 76,\n 'R': 82,\n 'S': 83,\n 'U': 85,\n 'V': 86,\n 'Y': 89,\n 'Z': 90,\n\n 'SLASH': 191,\n 'LEFTBRACKET': 219,\n 'BACKSLASH': 220,\n 'RIGHTBRACKET': 221,\n\n // Navigation\n 'HOME': 36,\n 'END': 35,\n 'PAGEUP': 33,\n 'PAGEDOWN': 34,\n};\n\n/**\n * @class core.key\n *\n * Object for keycodes.\n *\n * @singleton\n * @alternateClassName key\n */\nexport default {\n /**\n * @method isEdit\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isEdit: (keyCode) => {\n return lists.contains([\n KEY_MAP.BACKSPACE,\n KEY_MAP.TAB,\n KEY_MAP.ENTER,\n KEY_MAP.SPACE,\n KEY_MAP.DELETE,\n ], keyCode);\n },\n /**\n * @method isMove\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isMove: (keyCode) => {\n return lists.contains([\n KEY_MAP.LEFT,\n KEY_MAP.UP,\n KEY_MAP.RIGHT,\n KEY_MAP.DOWN,\n ], keyCode);\n },\n /**\n * @method isNavigation\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isNavigation: (keyCode) => {\n return lists.contains([\n KEY_MAP.HOME,\n KEY_MAP.END,\n KEY_MAP.PAGEUP,\n KEY_MAP.PAGEDOWN,\n ], keyCode);\n },\n /**\n * @property {Object} nameFromCode\n * @property {String} nameFromCode.8 \"BACKSPACE\"\n */\n nameFromCode: func.invertObject(KEY_MAP),\n code: KEY_MAP,\n};\n","import range from '../core/range';\n\nexport default class History {\n constructor(context) {\n this.stack = [];\n this.stackOffset = -1;\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n this.editable = this.$editable[0];\n }\n\n makeSnapshot() {\n const rng = range.create(this.editable);\n const emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n\n return {\n contents: this.$editable.html(),\n bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark),\n };\n }\n\n applySnapshot(snapshot) {\n if (snapshot.contents !== null) {\n this.$editable.html(snapshot.contents);\n }\n if (snapshot.bookmark !== null) {\n range.createFromBookmark(this.editable, snapshot.bookmark).select();\n }\n }\n\n /**\n * @method rewind\n * Rewinds the history stack back to the first snapshot taken.\n * Leaves the stack intact, so that \"Redo\" can still be used.\n */\n rewind() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n // Return to the first available snapshot.\n this.stackOffset = 0;\n\n // Apply that snapshot.\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n\n /**\n * @method commit\n * Resets history stack, but keeps current editor's content.\n */\n commit() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * @method reset\n * Resets the history stack completely; reverting to an empty editor.\n */\n reset() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Clear the editable area.\n this.$editable.html('');\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * undo\n */\n undo() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n if (this.stackOffset > 0) {\n this.stackOffset--;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * redo\n */\n redo() {\n if (this.stack.length - 1 > this.stackOffset) {\n this.stackOffset++;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * recorded undo\n */\n recordUndo() {\n this.stackOffset++;\n\n // Wash out stack after stackOffset\n if (this.stack.length > this.stackOffset) {\n this.stack = this.stack.slice(0, this.stackOffset);\n }\n\n // Create new snapshot and push it to the end\n this.stack.push(this.makeSnapshot());\n\n // If the stack size reachs to the limit, then slice it\n if (this.stack.length > this.context.options.historyLimit) {\n this.stack.shift();\n this.stackOffset -= 1;\n }\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class Style {\n /**\n * @method jQueryCSS\n *\n * [workaround] for old jQuery\n * passing an array of style properties to .css()\n * will result in an object of property-value pairs.\n * (compability with version < 1.9)\n *\n * @private\n * @param {jQuery} $obj\n * @param {Array} propertyNames - An array of one or more CSS properties.\n * @return {Object}\n */\n jQueryCSS($obj, propertyNames) {\n if (env.jqueryVersion < 1.9) {\n const result = {};\n $.each(propertyNames, (idx, propertyName) => {\n result[propertyName] = $obj.css(propertyName);\n });\n return result;\n }\n return $obj.css(propertyNames);\n }\n\n /**\n * returns style object from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n fromNode($node) {\n const properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n const styleInfo = this.jQueryCSS($node, properties) || {};\n\n const fontSize = $node[0].style.fontSize || styleInfo['font-size'];\n\n styleInfo['font-size'] = parseInt(fontSize, 10);\n styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);\n\n return styleInfo;\n }\n\n /**\n * paragraph level style\n *\n * @param {WrappedRange} rng\n * @param {Object} styleInfo\n */\n stylePara(rng, styleInfo) {\n $.each(rng.nodes(dom.isPara, {\n includeAncestor: true,\n }), (idx, para) => {\n $(para).css(styleInfo);\n });\n }\n\n /**\n * insert and returns styleNodes on range.\n *\n * @param {WrappedRange} rng\n * @param {Object} [options] - options for styleNodes\n * @param {String} [options.nodeName] - default: `SPAN`\n * @param {Boolean} [options.expandClosestSibling] - default: `false`\n * @param {Boolean} [options.onlyPartialContains] - default: `false`\n * @return {Node[]}\n */\n styleNodes(rng, options) {\n rng = rng.splitText();\n\n const nodeName = (options && options.nodeName) || 'SPAN';\n const expandClosestSibling = !!(options && options.expandClosestSibling);\n const onlyPartialContains = !!(options && options.onlyPartialContains);\n\n if (rng.isCollapsed()) {\n return [rng.insertNode(dom.create(nodeName))];\n }\n\n let pred = dom.makePredByNodeName(nodeName);\n const nodes = rng.nodes(dom.isText, {\n fullyContains: true,\n }).map((text) => {\n return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n });\n\n if (expandClosestSibling) {\n if (onlyPartialContains) {\n const nodesInRange = rng.nodes();\n // compose with partial contains predication\n pred = func.and(pred, (node) => {\n return lists.contains(nodesInRange, node);\n });\n }\n\n return nodes.map((node) => {\n const siblings = dom.withClosestSiblings(node, pred);\n const head = lists.head(siblings);\n const tails = lists.tail(siblings);\n $.each(tails, (idx, elem) => {\n dom.appendChildNodes(head, elem.childNodes);\n dom.remove(elem);\n });\n return lists.head(siblings);\n });\n } else {\n return nodes;\n }\n }\n\n /**\n * get current style on cursor\n *\n * @param {WrappedRange} rng\n * @return {Object} - object contains style properties.\n */\n current(rng) {\n const $cont = $(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n let styleInfo = this.fromNode($cont);\n\n // document.queryCommandState for toggle state\n // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n try {\n styleInfo = $.extend(styleInfo, {\n 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'],\n });\n } catch (e) {\n // eslint-disable-next-line\n }\n\n // list-style-type to list-style(unordered, ordered)\n if (!rng.isOnList()) {\n styleInfo['list-style'] = 'none';\n } else {\n const orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n const isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n }\n\n const para = dom.ancestor(rng.sc, dom.isPara);\n if (para && para.style['line-height']) {\n styleInfo['line-height'] = para.style.lineHeight;\n } else {\n const lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n styleInfo['line-height'] = lineHeight.toFixed(1);\n }\n\n styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n styleInfo.range = rng;\n\n return styleInfo;\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport func from '../core/func';\nimport dom from '../core/dom';\nimport range from '../core/range';\n\nexport default class Bullet {\n /**\n * toggle ordered list\n */\n insertOrderedList(editable) {\n this.toggleList('OL', editable);\n }\n\n /**\n * toggle unordered list\n */\n insertUnorderedList(editable) {\n this.toggleList('UL', editable);\n }\n\n /**\n * indent\n */\n indent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n const previousList = this.findList(head.previousSibling);\n if (previousList) {\n paras\n .map(para => previousList.appendChild(para));\n } else {\n this.wrapList(paras, head.parentNode.nodeName);\n paras\n .map((para) => para.parentNode)\n .map((para) => this.appendToPrevious(para));\n }\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n return (parseInt(val, 10) || 0) + 25;\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * outdent\n */\n outdent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n this.releaseList([paras]);\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n val = (parseInt(val, 10) || 0);\n return val > 25 ? val - 25 : '';\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * toggle list\n *\n * @param {String} listName - OL or UL\n */\n toggleList(listName, editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n let paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const bookmark = rng.paraBookmark(paras);\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n // paragraph to list\n if (lists.find(paras, dom.isPurePara)) {\n let wrappedParas = [];\n $.each(clustereds, (idx, paras) => {\n wrappedParas = wrappedParas.concat(this.wrapList(paras, listName));\n });\n paras = wrappedParas;\n // list to paragraph or change list style\n } else {\n const diffLists = rng.nodes(dom.isList, {\n includeAncestor: true,\n }).filter((listNode) => {\n return !$.nodeName(listNode, listName);\n });\n\n if (diffLists.length) {\n $.each(diffLists, (idx, listNode) => {\n dom.replace(listNode, listName);\n });\n } else {\n paras = this.releaseList(clustereds, true);\n }\n }\n\n range.createFromParaBookmark(bookmark, paras).select();\n }\n\n /**\n * @param {Node[]} paras\n * @param {String} listName\n * @return {Node[]}\n */\n wrapList(paras, listName) {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const prevList = dom.isList(head.previousSibling) && head.previousSibling;\n const nextList = dom.isList(last.nextSibling) && last.nextSibling;\n\n const listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n\n // P to LI\n paras = paras.map((para) => {\n return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n });\n\n // append to list(<ul>, <ol>)\n dom.appendChildNodes(listNode, paras);\n\n if (nextList) {\n dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n dom.remove(nextList);\n }\n\n return paras;\n }\n\n /**\n * @method releaseList\n *\n * @param {Array[]} clustereds\n * @param {Boolean} isEscapseToBody\n * @return {Node[]}\n */\n releaseList(clustereds, isEscapseToBody) {\n let releasedParas = [];\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n const parentItem = headList.parentNode;\n\n if (headList.parentNode.nodeName === 'LI') {\n paras.map(para => {\n const newList = this.findNextSiblings(para);\n\n if (parentItem.nextSibling) {\n parentItem.parentNode.insertBefore(\n para,\n parentItem.nextSibling\n );\n } else {\n parentItem.parentNode.appendChild(para);\n }\n\n if (newList.length) {\n this.wrapList(newList, headList.nodeName);\n para.appendChild(newList[0].parentNode);\n }\n });\n\n if (headList.children.length === 0) {\n parentItem.removeChild(headList);\n }\n\n if (parentItem.childNodes.length === 0) {\n parentItem.parentNode.removeChild(parentItem);\n }\n } else {\n const lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n node: last.parentNode,\n offset: dom.position(last) + 1,\n }, {\n isSkipPaddingBlankHTML: true,\n }) : null;\n\n const middleList = dom.splitTree(headList, {\n node: head.parentNode,\n offset: dom.position(head),\n }, {\n isSkipPaddingBlankHTML: true,\n });\n\n paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n : lists.from(middleList.childNodes).filter(dom.isLi);\n\n // LI to P\n if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n paras = paras.map((para) => {\n return dom.replace(para, 'P');\n });\n }\n\n $.each(lists.from(paras).reverse(), (idx, para) => {\n dom.insertAfter(para, headList);\n });\n\n // remove empty lists\n const rootLists = lists.compact([headList, middleList, lastList]);\n $.each(rootLists, (idx, rootList) => {\n const listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n $.each(listNodes.reverse(), (idx, listNode) => {\n if (!dom.nodeLength(listNode)) {\n dom.remove(listNode, true);\n }\n });\n });\n }\n\n releasedParas = releasedParas.concat(paras);\n });\n\n return releasedParas;\n }\n\n /**\n * @method appendToPrevious\n *\n * Appends list to previous list item, if\n * none exist it wraps the list in a new list item.\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n appendToPrevious(node) {\n return node.previousSibling\n ? dom.appendChildNodes(node.previousSibling, [node])\n : this.wrapList([node], 'LI');\n }\n\n /**\n * @method findList\n *\n * Finds an existing list in list item\n *\n * @param {HTMLNode} ListItem\n * @return {Array[]}\n */\n findList(node) {\n return node\n ? lists.find(node.children, child => ['OL', 'UL'].indexOf(child.nodeName) > -1)\n : null;\n }\n\n /**\n * @method findNextSiblings\n *\n * Finds all list item siblings that follow it\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n findNextSiblings(node) {\n const siblings = [];\n while (node.nextSibling) {\n siblings.push(node.nextSibling);\n node = node.nextSibling;\n }\n return siblings;\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport Bullet from '../editing/Bullet';\n\n/**\n * @class editing.Typing\n *\n * Typing\n *\n */\nexport default class Typing {\n constructor(context) {\n // a Bullet instance to toggle lists off\n this.bullet = new Bullet();\n this.options = context.options;\n }\n\n /**\n * insert tab\n *\n * @param {WrappedRange} rng\n * @param {Number} tabsize\n */\n insertTab(rng, tabsize) {\n const tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n rng = rng.deleteContents();\n rng.insertNode(tab, true);\n\n rng = range.create(tab, tabsize);\n rng.select();\n }\n\n /**\n * insert paragraph\n *\n * @param {jQuery} $editable\n * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n *\n * blockquoteBreakingLevel\n * 0 - No break, the new paragraph remains inside the quote\n * 1 - Break the first blockquote in the ancestors list\n * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n */\n insertParagraph(editable, rng) {\n rng = rng || range.create(editable);\n\n // deleteContents on range.\n rng = rng.deleteContents();\n\n // Wrap range if it needs to be wrapped by paragraph\n rng = rng.wrapBodyInlineWithPara();\n\n // finding paragraph\n const splitRoot = dom.ancestor(rng.sc, dom.isPara);\n\n let nextPara;\n // on paragraph: split paragraph\n if (splitRoot) {\n // if it is an empty line with li\n if (dom.isLi(splitRoot) && (dom.isEmpty(splitRoot) || dom.deepestChildIsEmpty(splitRoot))) {\n // toogle UL/OL and escape\n this.bullet.toggleList(splitRoot.parentNode.nodeName);\n return;\n } else {\n let blockquote = null;\n if (this.options.blockquoteBreakingLevel === 1) {\n blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n } else if (this.options.blockquoteBreakingLevel === 2) {\n blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n }\n\n if (blockquote) {\n // We're inside a blockquote and options ask us to break it\n nextPara = $(dom.emptyPara)[0];\n // If the split is right before a <br>, remove it so that there's no \"empty line\"\n // after the split in the new blockquote created\n if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n $(rng.sc.nextSibling).remove();\n }\n const split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n if (split) {\n split.parentNode.insertBefore(nextPara, split);\n } else {\n dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n }\n } else {\n nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n\n // not a blockquote, just insert the paragraph\n let emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n\n $.each(emptyAnchors, (idx, anchor) => {\n dom.remove(anchor);\n });\n\n // replace empty heading, pre or custom-made styleTag with P tag\n if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n nextPara = dom.replace(nextPara, 'p');\n }\n }\n }\n // no paragraph: insert empty paragraph\n } else {\n const next = rng.sc.childNodes[rng.so];\n nextPara = $(dom.emptyPara)[0];\n if (next) {\n rng.sc.insertBefore(nextPara, next);\n } else {\n rng.sc.appendChild(nextPara);\n }\n }\n\n range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport lists from '../core/lists';\n\n/**\n * @class Create a virtual table to create what actions to do in change.\n * @param {object} startPoint Cell selected to apply change.\n * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where\n * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n * @param {object} domTable Dom element of table to make changes.\n */\nconst TableResultAction = function(startPoint, where, action, domTable) {\n const _startPoint = { 'colPos': 0, 'rowPos': 0 };\n const _virtualTable = [];\n const _actionCellList = [];\n\n /// ///////////////////////////////////////////\n // Private functions\n /// ///////////////////////////////////////////\n\n /**\n * Set the startPoint of action.\n */\n function setStartPoint() {\n if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n // Impossible to identify start Cell point\n return;\n }\n _startPoint.colPos = startPoint.cellIndex;\n if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n // Impossible to identify start Row point\n return;\n }\n _startPoint.rowPos = startPoint.parentElement.rowIndex;\n }\n\n /**\n * Define virtual table position info object.\n *\n * @param {int} rowIndex Index position in line of virtual table.\n * @param {int} cellIndex Index position in column of virtual table.\n * @param {object} baseRow Row affected by this position.\n * @param {object} baseCell Cell affected by this position.\n * @param {bool} isSpan Inform if it is an span cell/row.\n */\n function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n const objPosition = {\n 'baseRow': baseRow,\n 'baseCell': baseCell,\n 'isRowSpan': isRowSpan,\n 'isColSpan': isColSpan,\n 'isVirtual': isVirtualCell,\n };\n if (!_virtualTable[rowIndex]) {\n _virtualTable[rowIndex] = [];\n }\n _virtualTable[rowIndex][cellIndex] = objPosition;\n }\n\n /**\n * Create action cell object.\n *\n * @param {object} virtualTableCellObj Object of specific position on virtual table.\n * @param {enum} resultAction Action to be applied in that item.\n */\n function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n return {\n 'baseCell': virtualTableCellObj.baseCell,\n 'action': resultAction,\n 'virtualTable': {\n 'rowIndex': virtualRowPosition,\n 'cellIndex': virtualColPosition,\n },\n };\n }\n\n /**\n * Recover free index of row to append Cell.\n *\n * @param {int} rowIndex Index of row to find free space.\n * @param {int} cellIndex Index of cell to find free space in table.\n */\n function recoverCellIndex(rowIndex, cellIndex) {\n if (!_virtualTable[rowIndex]) {\n return cellIndex;\n }\n if (!_virtualTable[rowIndex][cellIndex]) {\n return cellIndex;\n }\n\n let newCellIndex = cellIndex;\n while (_virtualTable[rowIndex][newCellIndex]) {\n newCellIndex++;\n if (!_virtualTable[rowIndex][newCellIndex]) {\n return newCellIndex;\n }\n }\n }\n\n /**\n * Recover info about row and cell and add information to virtual table.\n *\n * @param {object} row Row to recover information.\n * @param {object} cell Cell to recover information.\n */\n function addCellInfoToVirtual(row, cell) {\n const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n const cellHasColspan = (cell.colSpan > 1);\n const cellHasRowspan = (cell.rowSpan > 1);\n const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n\n // Add span rows to virtual Table.\n const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n if (rowspanNumber > 1) {\n for (let rp = 1; rp < rowspanNumber; rp++) {\n const rowspanIndex = row.rowIndex + rp;\n adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n }\n }\n\n // Add span cols to virtual table.\n const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n if (colspanNumber > 1) {\n for (let cp = 1; cp < colspanNumber; cp++) {\n const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n }\n }\n }\n\n /**\n * Process validation and adjust of start point if needed\n *\n * @param {int} rowIndex\n * @param {int} cellIndex\n * @param {object} cell\n * @param {bool} isSelectedCell\n */\n function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n _startPoint.colPos++;\n }\n }\n\n /**\n * Create virtual table of cells with all cells, including span cells.\n */\n function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getDeleteResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n case TableResultAction.where.Row:\n if (!cell.isVirtual && cell.isRowSpan) {\n return TableResultAction.resultAction.AddCell;\n } else if (cell.isRowSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n }\n return TableResultAction.resultAction.RemoveCell;\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getAddResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isRowSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n case TableResultAction.where.Row:\n if (cell.isRowSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isColSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n }\n return TableResultAction.resultAction.AddCell;\n }\n\n function init() {\n setStartPoint();\n createVirtualTable();\n }\n\n /// ///////////////////////////////////////////\n // Public functions\n /// ///////////////////////////////////////////\n\n /**\n * Recover array os what to do in table.\n */\n this.getActionList = function() {\n const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n\n let actualPosition = 0;\n let canContinue = true;\n while (canContinue) {\n const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n const row = _virtualTable[rowPosition];\n if (!row) {\n canContinue = false;\n return _actionCellList;\n }\n const cell = row[colPosition];\n if (!cell) {\n canContinue = false;\n return _actionCellList;\n }\n\n // Define action to be applied in this cell\n let resultAction = TableResultAction.resultAction.Ignore;\n switch (action) {\n case TableResultAction.requestAction.Add:\n resultAction = getAddResultActionToCell(cell);\n break;\n case TableResultAction.requestAction.Delete:\n resultAction = getDeleteResultActionToCell(cell);\n break;\n }\n _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n actualPosition++;\n }\n\n return _actionCellList;\n };\n\n init();\n};\n/**\n*\n* Where action occours enum.\n*/\nTableResultAction.where = { 'Row': 0, 'Column': 1 };\n/**\n*\n* Requested action to apply enum.\n*/\nTableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n/**\n*\n* Result action to be executed enum.\n*/\nTableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n\n/**\n *\n * @class editing.Table\n *\n * Table\n *\n */\nexport default class Table {\n /**\n * handle tab key\n *\n * @param {WrappedRange} rng\n * @param {Boolean} isShift\n */\n tab(rng, isShift) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const table = dom.ancestor(cell, dom.isTable);\n const cells = dom.listDescendant(table, dom.isCell);\n\n const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n if (nextCell) {\n range.create(nextCell, 0).select();\n }\n }\n\n /**\n * Add a new row\n *\n * @param {WrappedRange} rng\n * @param {String} position (top/bottom)\n * @return {Node}\n */\n addRow(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n\n const currentTr = $(cell).closest('tr');\n const trAttributes = this.recoverAttributes(currentTr);\n const html = $('<tr' + trAttributes + '></tr>');\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let idCell = 0; idCell < actions.length; idCell++) {\n const currentCell = actions[idCell];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n break;\n case TableResultAction.resultAction.SumSpanCount:\n {\n if (position === 'top') {\n const baseCellTr = currentCell.baseCell.parent;\n const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n if (isTopFromRowSpan) {\n const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n html.append(newTd);\n break;\n }\n }\n let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n rowspanNumber++;\n currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n }\n break;\n }\n }\n\n if (position === 'top') {\n currentTr.before(html);\n } else {\n const cellHasRowspan = (cell.rowSpan > 1);\n if (cellHasRowspan) {\n const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n $($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));\n return;\n }\n currentTr.after(html);\n }\n }\n\n /**\n * Add a new col\n *\n * @param {WrappedRange} rng\n * @param {String} position (left/right)\n * @return {Node}\n */\n addCol(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const rowsGroup = $(row).siblings();\n rowsGroup.push(row);\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Add, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n const currentCell = actions[actionIndex];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n if (position === 'right') {\n $(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n case TableResultAction.resultAction.SumSpanCount:\n if (position === 'right') {\n let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n colspanNumber++;\n currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n }\n }\n }\n\n /*\n * Copy attributes from element.\n *\n * @param {object} Element to recover attributes.\n * @return {string} Copied string elements.\n */\n recoverAttributes(el) {\n let resultStr = '';\n\n if (!el) {\n return resultStr;\n }\n\n const attrList = el.attributes || [];\n\n for (let i = 0; i < attrList.length; i++) {\n if (attrList[i].name.toLowerCase() === 'id') {\n continue;\n }\n\n if (attrList[i].specified) {\n resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n }\n }\n\n return resultStr;\n }\n\n /**\n * Delete current row\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteRow(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n const rowPos = row[0].rowIndex;\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n\n const baseCell = actions[actionIndex].baseCell;\n const virtualPosition = actions[actionIndex].virtualTable;\n const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.AddCell:\n {\n const nextRow = row.next('tr')[0];\n if (!nextRow) { continue; }\n const cloneRow = row[0].cells[cellPos];\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n nextRow.cells[cellPos].innerHTML = '';\n } else if (rowspanNumber === 2) {\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].removeAttribute('rowSpan');\n nextRow.cells[cellPos].innerHTML = '';\n }\n }\n }\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n baseCell.setAttribute('rowSpan', rowspanNumber);\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (rowspanNumber === 2) {\n baseCell.removeAttribute('rowSpan');\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n // Do not need remove cell because row will be deleted.\n continue;\n }\n }\n row.remove();\n }\n\n /**\n * Delete current col\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteCol(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n {\n const baseCell = actions[actionIndex].baseCell;\n const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n if (hasColspan) {\n let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n if (colspanNumber > 2) {\n colspanNumber--;\n baseCell.setAttribute('colSpan', colspanNumber);\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (colspanNumber === 2) {\n baseCell.removeAttribute('colSpan');\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n dom.remove(actions[actionIndex].baseCell, true);\n continue;\n }\n }\n }\n\n /**\n * create empty table element\n *\n * @param {Number} rowCount\n * @param {Number} colCount\n * @return {Node}\n */\n createTable(colCount, rowCount, options) {\n const tds = [];\n let tdHTML;\n for (let idxCol = 0; idxCol < colCount; idxCol++) {\n tds.push('<td>' + dom.blank + '</td>');\n }\n tdHTML = tds.join('');\n\n const trs = [];\n let trHTML;\n for (let idxRow = 0; idxRow < rowCount; idxRow++) {\n trs.push('<tr>' + tdHTML + '</tr>');\n }\n trHTML = trs.join('');\n const $table = $('<table>' + trHTML + '</table>');\n if (options && options.tableClassName) {\n $table.addClass(options.tableClassName);\n }\n\n return $table[0];\n }\n\n /**\n * Delete current table\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteTable(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n $(cell).closest('table').remove();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport { readFileAsDataURL, createImage } from '../core/async';\nimport History from '../editing/History';\nimport Style from '../editing/Style';\nimport Typing from '../editing/Typing';\nimport Table from '../editing/Table';\nimport Bullet from '../editing/Bullet';\n\nconst KEY_BOGUS = 'bogus';\n\n/**\n * @class Editor\n */\nexport default class Editor {\n constructor(context) {\n this.context = context;\n\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.editable = this.$editable[0];\n this.lastRange = null;\n this.snapshot = null;\n\n this.style = new Style();\n this.table = new Table();\n this.typing = new Typing(context);\n this.bullet = new Bullet();\n this.history = new History(context);\n\n this.context.memo('help.undo', this.lang.help.undo);\n this.context.memo('help.redo', this.lang.help.redo);\n this.context.memo('help.tab', this.lang.help.tab);\n this.context.memo('help.untab', this.lang.help.untab);\n this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n this.context.memo('help.indent', this.lang.help.indent);\n this.context.memo('help.outdent', this.lang.help.outdent);\n this.context.memo('help.formatPara', this.lang.help.formatPara);\n this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n this.context.memo('help.fontName', this.lang.help.fontName);\n\n // native commands(with execCommand), generate function for execCommand\n const commands = [\n 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n 'formatBlock', 'removeFormat', 'backColor',\n ];\n\n for (let idx = 0, len = commands.length; idx < len; idx++) {\n this[commands[idx]] = ((sCmd) => {\n return (value) => {\n this.beforeCommand();\n document.execCommand(sCmd, false, value);\n this.afterCommand(true);\n };\n })(commands[idx]);\n this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n }\n\n this.fontName = this.wrapCommand((value) => {\n return this.fontStyling('font-family', env.validFontName(value));\n });\n\n this.fontSize = this.wrapCommand((value) => {\n const unit = this.currentStyle()['font-size-unit'];\n return this.fontStyling('font-size', value + unit);\n });\n\n this.fontSizeUnit = this.wrapCommand((value) => {\n const size = this.currentStyle()['font-size'];\n return this.fontStyling('font-size', size + value);\n });\n\n for (let idx = 1; idx <= 6; idx++) {\n this['formatH' + idx] = ((idx) => {\n return () => {\n this.formatBlock('H' + idx);\n };\n })(idx);\n this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n }\n\n this.insertParagraph = this.wrapCommand(() => {\n this.typing.insertParagraph(this.editable);\n });\n\n this.insertOrderedList = this.wrapCommand(() => {\n this.bullet.insertOrderedList(this.editable);\n });\n\n this.insertUnorderedList = this.wrapCommand(() => {\n this.bullet.insertUnorderedList(this.editable);\n });\n\n this.indent = this.wrapCommand(() => {\n this.bullet.indent(this.editable);\n });\n\n this.outdent = this.wrapCommand(() => {\n this.bullet.outdent(this.editable);\n });\n\n /**\n * insertNode\n * insert node\n * @param {Node} node\n */\n this.insertNode = this.wrapCommand((node) => {\n if (this.isLimited($(node).text().length)) {\n return;\n }\n const rng = this.getLastRange();\n rng.insertNode(node);\n this.setLastRange(range.createFromNodeAfter(node).select());\n });\n\n /**\n * insert text\n * @param {String} text\n */\n this.insertText = this.wrapCommand((text) => {\n if (this.isLimited(text.length)) {\n return;\n }\n const rng = this.getLastRange();\n const textNode = rng.insertNode(dom.createText(text));\n this.setLastRange(range.create(textNode, dom.nodeLength(textNode)).select());\n });\n\n /**\n * paste HTML\n * @param {String} markup\n */\n this.pasteHTML = this.wrapCommand((markup) => {\n if (this.isLimited(markup.length)) {\n return;\n }\n markup = this.context.invoke('codeview.purify', markup);\n const contents = this.getLastRange().pasteHTML(markup);\n this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select());\n });\n\n /**\n * formatBlock\n *\n * @param {String} tagName\n */\n this.formatBlock = this.wrapCommand((tagName, $target) => {\n const onApplyCustomStyle = this.options.callbacks.onApplyCustomStyle;\n if (onApplyCustomStyle) {\n onApplyCustomStyle.call(this, $target, this.context, this.onFormatBlock);\n } else {\n this.onFormatBlock(tagName, $target);\n }\n });\n\n /**\n * insert horizontal rule\n */\n this.insertHorizontalRule = this.wrapCommand(() => {\n const hrNode = this.getLastRange().insertNode(dom.create('HR'));\n if (hrNode.nextSibling) {\n this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());\n }\n });\n\n /**\n * lineHeight\n * @param {String} value\n */\n this.lineHeight = this.wrapCommand((value) => {\n this.style.stylePara(this.getLastRange(), {\n lineHeight: value,\n });\n });\n\n /**\n * create link (command)\n *\n * @param {Object} linkInfo\n */\n this.createLink = this.wrapCommand((linkInfo) => {\n let linkUrl = linkInfo.url;\n const linkText = linkInfo.text;\n const isNewWindow = linkInfo.isNewWindow;\n const checkProtocol = linkInfo.checkProtocol;\n let rng = linkInfo.range || this.getLastRange();\n const additionalTextLength = linkText.length - rng.toString().length;\n if (additionalTextLength > 0 && this.isLimited(additionalTextLength)) {\n return;\n }\n const isTextChanged = rng.toString() !== linkText;\n\n // handle spaced urls from input\n if (typeof linkUrl === 'string') {\n linkUrl = linkUrl.trim();\n }\n\n if (this.options.onCreateLink) {\n linkUrl = this.options.onCreateLink(linkUrl);\n } else if (checkProtocol) {\n // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n ? linkUrl : this.options.defaultProtocol + linkUrl;\n }\n\n let anchors = [];\n if (isTextChanged) {\n rng = rng.deleteContents();\n const anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);\n anchors.push(anchor);\n } else {\n anchors = this.style.styleNodes(rng, {\n nodeName: 'A',\n expandClosestSibling: true,\n onlyPartialContains: true,\n });\n }\n\n $.each(anchors, (idx, anchor) => {\n $(anchor).attr('href', linkUrl);\n if (isNewWindow) {\n $(anchor).attr('target', '_blank');\n } else {\n $(anchor).removeAttr('target');\n }\n });\n\n const startRange = range.createFromNodeBefore(lists.head(anchors));\n const startPoint = startRange.getStartPoint();\n const endRange = range.createFromNodeAfter(lists.last(anchors));\n const endPoint = endRange.getEndPoint();\n\n this.setLastRange(\n range.create(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n ).select()\n );\n });\n\n /**\n * setting color\n *\n * @param {Object} sObjColor color code\n * @param {String} sObjColor.foreColor foreground color\n * @param {String} sObjColor.backColor background color\n */\n this.color = this.wrapCommand((colorInfo) => {\n const foreColor = colorInfo.foreColor;\n const backColor = colorInfo.backColor;\n\n if (foreColor) { document.execCommand('foreColor', false, foreColor); }\n if (backColor) { document.execCommand('backColor', false, backColor); }\n });\n\n /**\n * Set foreground color\n *\n * @param {String} colorCode foreground color code\n */\n this.foreColor = this.wrapCommand((colorInfo) => {\n document.execCommand('foreColor', false, colorInfo);\n });\n\n /**\n * insert Table\n *\n * @param {String} dimension of table (ex : \"5x5\")\n */\n this.insertTable = this.wrapCommand((dim) => {\n const dimension = dim.split('x');\n\n const rng = this.getLastRange().deleteContents();\n rng.insertNode(this.table.createTable(dimension[0], dimension[1], this.options));\n });\n\n /**\n * remove media object and Figure Elements if media object is img with Figure.\n */\n this.removeMedia = this.wrapCommand(() => {\n let $target = $(this.restoreTarget()).parent();\n if ($target.closest('figure').length) {\n $target.closest('figure').remove();\n } else {\n $target = $(this.restoreTarget()).detach();\n }\n this.context.triggerEvent('media.delete', $target, this.$editable);\n });\n\n /**\n * float me\n *\n * @param {String} value\n */\n this.floatMe = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n $target.toggleClass('note-float-left', value === 'left');\n $target.toggleClass('note-float-right', value === 'right');\n $target.css('float', (value === 'none' ? '' : value));\n });\n\n /**\n * resize overlay element\n * @param {String} value\n */\n this.resize = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n value = parseFloat(value);\n if (value === 0) {\n $target.css('width', '');\n } else {\n $target.css({\n width: value * 100 + '%',\n height: '',\n });\n }\n });\n }\n\n initialize() {\n // bind custom events\n this.$editable.on('keydown', (event) => {\n if (event.keyCode === key.code.ENTER) {\n this.context.triggerEvent('enter', event);\n }\n this.context.triggerEvent('keydown', event);\n\n // keep a snapshot to limit text on input event\n this.snapshot = this.history.makeSnapshot();\n this.hasKeyShortCut = false;\n if (!event.isDefaultPrevented()) {\n if (this.options.shortcuts) {\n this.hasKeyShortCut = this.handleKeyMap(event);\n } else {\n this.preventDefaultEditableShortCuts(event);\n }\n }\n if (this.isLimited(1, event)) {\n const lastRange = this.getLastRange();\n if (lastRange.eo - lastRange.so === 0) {\n return false;\n }\n }\n this.setLastRange();\n\n // record undo in the key event except keyMap.\n if (this.options.recordEveryKeystroke) {\n if (this.hasKeyShortCut === false) {\n this.history.recordUndo();\n }\n }\n }).on('keyup', (event) => {\n this.setLastRange();\n this.context.triggerEvent('keyup', event);\n }).on('focus', (event) => {\n this.setLastRange();\n this.context.triggerEvent('focus', event);\n }).on('blur', (event) => {\n this.context.triggerEvent('blur', event);\n }).on('mousedown', (event) => {\n this.context.triggerEvent('mousedown', event);\n }).on('mouseup', (event) => {\n this.setLastRange();\n this.history.recordUndo();\n this.context.triggerEvent('mouseup', event);\n }).on('scroll', (event) => {\n this.context.triggerEvent('scroll', event);\n }).on('paste', (event) => {\n this.setLastRange();\n this.context.triggerEvent('paste', event);\n }).on('input', () => {\n // To limit composition characters (e.g. Korean)\n if (this.isLimited(0) && this.snapshot) {\n this.history.applySnapshot(this.snapshot);\n }\n });\n\n this.$editable.attr('spellcheck', this.options.spellCheck);\n\n this.$editable.attr('autocorrect', this.options.spellCheck);\n\n if (this.options.disableGrammar) {\n this.$editable.attr('data-gramm', false);\n }\n\n // init content before set event\n this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n\n this.$editable.on(env.inputEventName, func.debounce(() => {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }, 10));\n\n this.$editable.on('focusin', (event) => {\n this.context.triggerEvent('focusin', event);\n }).on('focusout', (event) => {\n this.context.triggerEvent('focusout', event);\n });\n\n if (this.options.airMode) {\n if (this.options.overrideContextMenu) {\n this.$editor.on('contextmenu', (event) => {\n this.context.triggerEvent('contextmenu', event);\n return false;\n });\n }\n } else {\n if (this.options.width) {\n this.$editor.outerWidth(this.options.width);\n }\n if (this.options.height) {\n this.$editable.outerHeight(this.options.height);\n }\n if (this.options.maxHeight) {\n this.$editable.css('max-height', this.options.maxHeight);\n }\n if (this.options.minHeight) {\n this.$editable.css('min-height', this.options.minHeight);\n }\n }\n\n this.history.recordUndo();\n this.setLastRange();\n }\n\n destroy() {\n this.$editable.off();\n }\n\n handleKeyMap(event) {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n const keys = [];\n\n if (event.metaKey) { keys.push('CMD'); }\n if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }\n if (event.shiftKey) { keys.push('SHIFT'); }\n\n const keyName = key.nameFromCode[event.keyCode];\n if (keyName) {\n keys.push(keyName);\n }\n\n const eventName = keyMap[keys.join('+')];\n\n if (keyName === 'TAB' && !this.options.tabDisable) {\n this.afterCommand();\n } else if (eventName) {\n if (this.context.invoke(eventName) !== false) {\n event.preventDefault();\n // if keyMap action was invoked\n return true;\n }\n } else if (key.isEdit(event.keyCode)) {\n this.afterCommand();\n }\n return false;\n }\n\n preventDefaultEditableShortCuts(event) {\n // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n if ((event.ctrlKey || event.metaKey) &&\n lists.contains([66, 73, 85], event.keyCode)) {\n event.preventDefault();\n }\n }\n\n isLimited(pad, event) {\n pad = pad || 0;\n\n if (typeof event !== 'undefined') {\n if (key.isMove(event.keyCode) ||\n key.isNavigation(event.keyCode) ||\n (event.ctrlKey || event.metaKey) ||\n lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n return false;\n }\n }\n\n if (this.options.maxTextLength > 0) {\n if ((this.$editable.text().length + pad) > this.options.maxTextLength) {\n return true;\n }\n }\n return false;\n }\n /**\n * create range\n * @return {WrappedRange}\n */\n createRange() {\n this.focus();\n this.setLastRange();\n return this.getLastRange();\n }\n\n setLastRange(rng) {\n if (rng) {\n this.lastRange = rng;\n } else {\n this.lastRange = range.create(this.editable);\n\n if ($(this.lastRange.sc).closest('.note-editable').length === 0) {\n this.lastRange = range.createFromBodyElement(this.editable);\n }\n }\n }\n\n getLastRange() {\n if (!this.lastRange) {\n this.setLastRange();\n }\n return this.lastRange;\n }\n\n /**\n * saveRange\n *\n * save current range\n *\n * @param {Boolean} [thenCollapse=false]\n */\n saveRange(thenCollapse) {\n if (thenCollapse) {\n this.getLastRange().collapse().select();\n }\n }\n\n /**\n * restoreRange\n *\n * restore lately range\n */\n restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }\n\n saveTarget(node) {\n this.$editable.data('target', node);\n }\n\n clearTarget() {\n this.$editable.removeData('target');\n }\n\n restoreTarget() {\n return this.$editable.data('target');\n }\n\n /**\n * currentStyle\n *\n * current style\n * @return {Object|Boolean} unfocus\n */\n currentStyle() {\n let rng = range.create();\n if (rng) {\n rng = rng.normalize();\n }\n return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n }\n\n /**\n * style from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n styleFromNode($node) {\n return this.style.fromNode($node);\n }\n\n /**\n * undo\n */\n undo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.undo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /*\n * commit\n */\n commit() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.commit();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * redo\n */\n redo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.redo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * before command\n */\n beforeCommand() {\n this.context.triggerEvent('before.command', this.$editable.html());\n\n // Set styleWithCSS before run a command\n document.execCommand('styleWithCSS', false, this.options.styleWithCSS);\n\n // keep focus on editable before command execution\n this.focus();\n }\n\n /**\n * after command\n * @param {Boolean} isPreventTrigger\n */\n afterCommand(isPreventTrigger) {\n this.normalizeContent();\n this.history.recordUndo();\n if (!isPreventTrigger) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n }\n\n /**\n * handle tab key\n */\n tab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n\n if (!this.isLimited(this.options.tabSize)) {\n this.beforeCommand();\n this.typing.insertTab(rng, this.options.tabSize);\n this.afterCommand();\n }\n }\n }\n\n /**\n * handle shift+tab key\n */\n untab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng, true);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n }\n }\n\n /**\n * run given function between beforeCommand and afterCommand\n */\n wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }\n\n /**\n * insert image\n *\n * @param {String} src\n * @param {String|Function} param\n * @return {Promise}\n */\n insertImage(src, param) {\n return createImage(src, param).then(($image) => {\n this.beforeCommand();\n\n if (typeof param === 'function') {\n param($image);\n } else {\n if (typeof param === 'string') {\n $image.attr('data-filename', param);\n }\n $image.css('width', Math.min(this.$editable.width(), $image.width()));\n }\n\n $image.show();\n this.getLastRange().insertNode($image[0]);\n this.setLastRange(range.createFromNodeAfter($image[0]).select());\n this.afterCommand();\n }).fail((e) => {\n this.context.triggerEvent('image.upload.error', e);\n });\n }\n\n /**\n * insertImages\n * @param {File[]} files\n */\n insertImagesAsDataURL(files) {\n $.each(files, (idx, file) => {\n const filename = file.name;\n if (this.options.maximumImageFileSize && this.options.maximumImageFileSize < file.size) {\n this.context.triggerEvent('image.upload.error', this.lang.image.maximumFileSizeError);\n } else {\n readFileAsDataURL(file).then((dataURL) => {\n return this.insertImage(dataURL, filename);\n }).fail(() => {\n this.context.triggerEvent('image.upload.error');\n });\n }\n });\n }\n\n /**\n * insertImagesOrCallback\n * @param {File[]} files\n */\n insertImagesOrCallback(files) {\n const callbacks = this.options.callbacks;\n // If onImageUpload set,\n if (callbacks.onImageUpload) {\n this.context.triggerEvent('image.upload', files);\n // else insert Image as dataURL\n } else {\n this.insertImagesAsDataURL(files);\n }\n }\n\n /**\n * return selected plain text\n * @return {String} text\n */\n getSelectedText() {\n let rng = this.getLastRange();\n\n // if range on anchor, expand range with anchor\n if (rng.isOnAnchor()) {\n rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n }\n\n return rng.toString();\n }\n\n onFormatBlock(tagName, $target) {\n // [workaround] for MSIE, IE need `<`\n document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n\n // support custom class\n if ($target && $target.length) {\n // find the exact element has given tagName\n if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n $target = $target.find(tagName);\n }\n\n if ($target && $target.length) {\n const className = $target[0].className || '';\n if (className) {\n const currentRange = this.createRange();\n\n const $parent = $([currentRange.sc, currentRange.ec]).closest(tagName);\n $parent.addClass(className);\n }\n }\n }\n }\n\n formatPara() {\n this.formatBlock('P');\n }\n\n fontStyling(target, value) {\n const rng = this.getLastRange();\n\n if (rng !== '') {\n const spans = this.style.styleNodes(rng);\n this.$editor.find('.note-status-output').html('');\n $(spans).css(target, value);\n\n // [workaround] added styled bogus span for style\n // - also bogus character needed for cursor position\n if (rng.isCollapsed()) {\n const firstSpan = lists.head(spans);\n if (firstSpan && !dom.nodeLength(firstSpan)) {\n firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n range.createFromNodeAfter(firstSpan.firstChild).select();\n this.setLastRange();\n this.$editable.data(KEY_BOGUS, firstSpan);\n }\n }\n } else {\n const noteStatusOutput = $.now();\n this.$editor.find('.note-status-output').html('<div id=\"note-status-output-' + noteStatusOutput + '\" class=\"alert alert-info\">' + this.lang.output.noSelection + '</div>');\n setTimeout(function() { $('#note-status-output-' + noteStatusOutput).remove(); }, 5000);\n }\n }\n\n /**\n * unlink\n *\n * @type command\n */\n unlink() {\n let rng = this.getLastRange();\n if (rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n rng = range.createFromNode(anchor);\n rng.select();\n this.setLastRange();\n\n this.beforeCommand();\n document.execCommand('unlink');\n this.afterCommand();\n }\n }\n\n /**\n * returns link info\n *\n * @return {Object}\n * @return {WrappedRange} return.range\n * @return {String} return.text\n * @return {Boolean} [return.isNewWindow=true]\n * @return {String} [return.url=\"\"]\n */\n getLinkInfo() {\n const rng = this.getLastRange().expand(dom.isAnchor);\n // Get the first anchor on range(for edit).\n const $anchor = $(lists.head(rng.nodes(dom.isAnchor)));\n const linkInfo = {\n range: rng,\n text: rng.toString(),\n url: $anchor.length ? $anchor.attr('href') : '',\n };\n\n // When anchor exists,\n if ($anchor.length) {\n // Set isNewWindow by checking its target.\n linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n }\n\n return linkInfo;\n }\n\n addRow(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addRow(rng, position);\n this.afterCommand();\n }\n }\n\n addCol(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addCol(rng, position);\n this.afterCommand();\n }\n }\n\n deleteRow() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteRow(rng);\n this.afterCommand();\n }\n }\n\n deleteCol() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteCol(rng);\n this.afterCommand();\n }\n }\n\n deleteTable() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteTable(rng);\n this.afterCommand();\n }\n }\n\n /**\n * @param {Position} pos\n * @param {jQuery} $target - target element\n * @param {Boolean} [bKeepRatio] - keep ratio\n */\n resizeTo(pos, $target, bKeepRatio) {\n let imageSize;\n if (bKeepRatio) {\n const newRatio = pos.y / pos.x;\n const ratio = $target.data('ratio');\n imageSize = {\n width: ratio > newRatio ? pos.x : pos.y / ratio,\n height: ratio > newRatio ? pos.x * ratio : pos.y,\n };\n } else {\n imageSize = {\n width: pos.x,\n height: pos.y,\n };\n }\n\n $target.css(imageSize);\n }\n\n /**\n * returns whether editable area has focus or not.\n */\n hasFocus() {\n return this.$editable.is(':focus');\n }\n\n /**\n * set focus\n */\n focus() {\n // [workaround] Screen will move when page is scolled in IE.\n // - do focus when not focused\n if (!this.hasFocus()) {\n this.$editable.focus();\n }\n }\n\n /**\n * returns whether contents is empty or not.\n * @return {Boolean}\n */\n isEmpty() {\n return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n }\n\n /**\n * Removes all contents and restores the editable instance to an _emptyPara_.\n */\n empty() {\n this.context.invoke('code', dom.emptyPara);\n }\n\n /**\n * normalize content\n */\n normalizeContent() {\n this.$editable[0].normalize();\n }\n}\n","import $ from 'jquery';\n\n/**\n * @method readFileAsDataURL\n *\n * read contents of file as representing URL\n *\n * @param {File} file\n * @return {Promise} - then: dataUrl\n */\nexport function readFileAsDataURL(file) {\n return $.Deferred((deferred) => {\n $.extend(new FileReader(), {\n onload: (e) => {\n const dataURL = e.target.result;\n deferred.resolve(dataURL);\n },\n onerror: (err) => {\n deferred.reject(err);\n },\n }).readAsDataURL(file);\n }).promise();\n}\n\n/**\n * @method createImage\n *\n * create `<image>` from url string\n *\n * @param {String} url\n * @return {Promise} - then: $image\n */\nexport function createImage(url) {\n return $.Deferred((deferred) => {\n const $img = $('<img>');\n\n $img.one('load', () => {\n $img.off('error abort');\n deferred.resolve($img);\n }).one('error abort', () => {\n $img.off('load').detach();\n deferred.reject($img);\n }).css({\n display: 'none',\n }).appendTo(document.body).attr('src', url);\n }).promise();\n}\n","import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n this.$editable.on('paste', this.pasteByEvent.bind(this));\n }\n\n /**\n * paste by clipboard event\n *\n * @param {Event} event\n */\n pasteByEvent(event) {\n const clipboardData = event.originalEvent.clipboardData;\n\n if (clipboardData && clipboardData.items && clipboardData.items.length) {\n const item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n // paste img file\n this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n event.preventDefault();\n } else if (item.kind === 'string') {\n // paste text with maxTextLength check\n if (this.context.invoke('editor.isLimited', clipboardData.getData('Text').length)) {\n event.preventDefault();\n }\n }\n } else if (window.clipboardData) {\n // for IE\n let text = window.clipboardData.getData('text');\n if (this.context.invoke('editor.isLimited', text.length)) {\n event.preventDefault();\n }\n }\n // Call editor.afterCommand after proceeding default event handler\n setTimeout(() => {\n this.context.invoke('editor.afterCommand');\n }, 10);\n }\n}\n","import env from '../core/env';\nimport dom from '../core/dom';\n\nlet CodeMirror;\nif (env.hasCodeMirror) {\n CodeMirror = window.CodeMirror;\n}\n\n/**\n * @class Codeview\n */\nexport default class CodeView {\n constructor(context) {\n this.context = context;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n this.options = context.options;\n }\n\n sync() {\n const isCodeview = this.isActivated();\n if (isCodeview && env.hasCodeMirror) {\n this.$codable.data('cmEditor').save();\n }\n }\n\n /**\n * @return {Boolean}\n */\n isActivated() {\n return this.$editor.hasClass('codeview');\n }\n\n /**\n * toggle codeview\n */\n toggle() {\n if (this.isActivated()) {\n this.deactivate();\n } else {\n this.activate();\n }\n this.context.triggerEvent('codeview.toggled');\n }\n\n /**\n * purify input value\n * @param value\n * @returns {*}\n */\n purify(value) {\n if (this.options.codeviewFilter) {\n // filter code view regex\n value = value.replace(this.options.codeviewFilterRegex, '');\n // allow specific iframe tag\n if (this.options.codeviewIframeFilter) {\n const whitelist = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function(tag) {\n // remove if src attribute is duplicated\n if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n return '';\n }\n for (const src of whitelist) {\n // pass if src is trusted\n if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n return tag;\n }\n }\n return '';\n });\n }\n }\n return value;\n }\n\n /**\n * activate code view\n */\n activate() {\n this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n this.$codable.height(this.$editable.height());\n\n this.context.invoke('toolbar.updateCodeview', true);\n this.$editor.addClass('codeview');\n this.$codable.focus();\n\n // activate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n\n // CodeMirror TernServer\n if (this.options.codemirror.tern) {\n const server = new CodeMirror.TernServer(this.options.codemirror.tern);\n cmEditor.ternServer = server;\n cmEditor.on('cursorActivity', (cm) => {\n server.updateArgHints(cm);\n });\n }\n\n cmEditor.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', cmEditor.getValue(), event);\n });\n cmEditor.on('change', () => {\n this.context.triggerEvent('change.codeview', cmEditor.getValue(), cmEditor);\n });\n\n // CodeMirror hasn't Padding.\n cmEditor.setSize(null, this.$editable.outerHeight());\n this.$codable.data('cmEditor', cmEditor);\n } else {\n this.$codable.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', this.$codable.val(), event);\n });\n this.$codable.on('input', () => {\n this.context.triggerEvent('change.codeview', this.$codable.val(), this.$codable);\n });\n }\n }\n\n /**\n * deactivate code view\n */\n deactivate() {\n // deactivate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = this.$codable.data('cmEditor');\n this.$codable.val(cmEditor.getValue());\n cmEditor.toTextArea();\n }\n\n const value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n const isChange = this.$editable.html() !== value;\n\n this.$editable.html(value);\n this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n this.$editor.removeClass('codeview');\n\n if (isChange) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n this.$editable.focus();\n\n this.context.invoke('toolbar.updateCodeview', false);\n }\n\n destroy() {\n if (this.isActivated()) {\n this.deactivate();\n }\n }\n}\n","import $ from 'jquery';\n\nexport default class Dropzone {\n constructor(context) {\n this.context = context;\n this.$eventListener = $(document);\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.documentEventHandlers = {};\n\n this.$dropzone = $([\n '<div class=\"note-dropzone\">',\n '<div class=\"note-dropzone-message\"/>',\n '</div>',\n ].join('')).prependTo(this.$editor);\n }\n\n /**\n * attach Drag and Drop Events\n */\n initialize() {\n if (this.options.disableDragAndDrop) {\n // prevent default drop event\n this.documentEventHandlers.onDrop = (e) => {\n e.preventDefault();\n };\n // do not consider outside of dropzone\n this.$eventListener = this.$dropzone;\n this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n } else {\n this.attachDragAndDropEvent();\n }\n }\n\n /**\n * attach Drag and Drop Events\n */\n attachDragAndDropEvent() {\n let collection = $();\n const $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n\n this.documentEventHandlers.onDragenter = (e) => {\n const isCodeview = this.context.invoke('codeview.isActivated');\n const hasEditorSize = this.$editor.width() > 0 && this.$editor.height() > 0;\n if (!isCodeview && !collection.length && hasEditorSize) {\n this.$editor.addClass('dragover');\n this.$dropzone.width(this.$editor.width());\n this.$dropzone.height(this.$editor.height());\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n }\n collection = collection.add(e.target);\n };\n\n this.documentEventHandlers.onDragleave = (e) => {\n collection = collection.not(e.target);\n\n // If nodeName is BODY, then just make it over (fix for IE)\n if (!collection.length || e.target.nodeName === 'BODY') {\n collection = $();\n this.$editor.removeClass('dragover');\n }\n };\n\n this.documentEventHandlers.onDrop = () => {\n collection = $();\n this.$editor.removeClass('dragover');\n };\n\n // show dropzone on dragenter when dragging a object to document\n // -but only if the editor is visible, i.e. has a positive width and height\n this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n .on('dragleave', this.documentEventHandlers.onDragleave)\n .on('drop', this.documentEventHandlers.onDrop);\n\n // change dropzone's message on hover.\n this.$dropzone.on('dragenter', () => {\n this.$dropzone.addClass('hover');\n $dropzoneMessage.text(this.lang.image.dropImage);\n }).on('dragleave', () => {\n this.$dropzone.removeClass('hover');\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n });\n\n // attach dropImage\n this.$dropzone.on('drop', (event) => {\n const dataTransfer = event.originalEvent.dataTransfer;\n\n // stop the browser from opening the dropped content\n event.preventDefault();\n\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n this.$editable.focus();\n this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n } else {\n $.each(dataTransfer.types, (idx, type) => {\n // skip moz-specific types\n if (type.toLowerCase().indexOf('_moz_') > -1) {\n return;\n }\n const content = dataTransfer.getData(type);\n\n if (type.toLowerCase().indexOf('text') > -1) {\n this.context.invoke('editor.pasteHTML', content);\n } else {\n $(content).each((idx, item) => {\n this.context.invoke('editor.insertNode', item);\n });\n }\n });\n }\n }).on('dragover', false); // prevent default dragover event\n }\n\n destroy() {\n Object.keys(this.documentEventHandlers).forEach((key) => {\n this.$eventListener.off(key.substr(2).toLowerCase(), this.documentEventHandlers[key]);\n });\n this.documentEventHandlers = {};\n }\n}\n","import $ from 'jquery';\nconst EDITABLE_PADDING = 24;\n\nexport default class Statusbar {\n constructor(context) {\n this.$document = $(document);\n this.$statusbar = context.layoutInfo.statusbar;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n }\n\n initialize() {\n if (this.options.airMode || this.options.disableResizeEditor) {\n this.destroy();\n return;\n }\n\n this.$statusbar.on('mousedown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const editableTop = this.$editable.offset().top - this.$document.scrollTop();\n const onMouseMove = (event) => {\n let height = event.clientY - (editableTop + EDITABLE_PADDING);\n\n height = (this.options.minheight > 0) ? Math.max(height, this.options.minheight) : height;\n height = (this.options.maxHeight > 0) ? Math.min(height, this.options.maxHeight) : height;\n\n this.$editable.height(height);\n };\n\n this.$document.on('mousemove', onMouseMove).one('mouseup', () => {\n this.$document.off('mousemove', onMouseMove);\n });\n });\n }\n\n destroy() {\n this.$statusbar.off();\n this.$statusbar.addClass('locked');\n }\n}\n","import $ from 'jquery';\n\nexport default class Fullscreen {\n constructor(context) {\n this.context = context;\n\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n\n this.$window = $(window);\n this.$scrollbar = $('html, body');\n\n this.onResize = () => {\n this.resizeTo({\n h: this.$window.height() - this.$toolbar.outerHeight(),\n });\n };\n }\n\n resizeTo(size) {\n this.$editable.css('height', size.h);\n this.$codable.css('height', size.h);\n if (this.$codable.data('cmeditor')) {\n this.$codable.data('cmeditor').setsize(null, size.h);\n }\n }\n\n /**\n * toggle fullscreen\n */\n toggle() {\n this.$editor.toggleClass('fullscreen');\n if (this.isFullscreen()) {\n this.$editable.data('orgHeight', this.$editable.css('height'));\n this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n this.$editable.css('maxHeight', '');\n this.$window.on('resize', this.onResize).trigger('resize');\n this.$scrollbar.css('overflow', 'hidden');\n } else {\n this.$window.off('resize', this.onResize);\n this.resizeTo({ h: this.$editable.data('orgHeight') });\n this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n this.$scrollbar.css('overflow', 'visible');\n }\n\n this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n }\n\n isFullscreen() {\n return this.$editor.hasClass('fullscreen');\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\n\nexport default class Handle {\n constructor(context) {\n this.context = context;\n this.$document = $(document);\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.events = {\n 'summernote.mousedown': (we, e) => {\n if (this.update(e.target, e)) {\n e.preventDefault();\n }\n },\n 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n initialize() {\n this.$handle = $([\n '<div class=\"note-handle\">',\n '<div class=\"note-control-selection\">',\n '<div class=\"note-control-selection-bg\"></div>',\n '<div class=\"note-control-holder note-control-nw\"></div>',\n '<div class=\"note-control-holder note-control-ne\"></div>',\n '<div class=\"note-control-holder note-control-sw\"></div>',\n '<div class=\"',\n (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n ' note-control-se\"></div>',\n (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n '</div>',\n '</div>',\n ].join('')).prependTo(this.$editingArea);\n\n this.$handle.on('mousedown', (event) => {\n if (dom.isControlSizing(event.target)) {\n event.preventDefault();\n event.stopPropagation();\n\n const $target = this.$handle.find('.note-control-selection').data('target');\n const posStart = $target.offset();\n const scrollTop = this.$document.scrollTop();\n\n const onMouseMove = (event) => {\n this.context.invoke('editor.resizeTo', {\n x: event.clientX - posStart.left,\n y: event.clientY - (posStart.top - scrollTop),\n }, $target, !event.shiftKey);\n\n this.update($target[0], event);\n };\n\n this.$document\n .on('mousemove', onMouseMove)\n .one('mouseup', (e) => {\n e.preventDefault();\n this.$document.off('mousemove', onMouseMove);\n this.context.invoke('editor.afterCommand');\n });\n\n if (!$target.data('ratio')) { // original ratio.\n $target.data('ratio', $target.height() / $target.width());\n }\n }\n });\n\n // Listen for scrolling on the handle overlay.\n this.$handle.on('wheel', (e) => {\n e.preventDefault();\n this.update();\n });\n }\n\n destroy() {\n this.$handle.remove();\n }\n\n update(target, event) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isImage = dom.isImg(target);\n const $selection = this.$handle.find('.note-control-selection');\n\n this.context.invoke('imagePopover.update', target, event);\n\n if (isImage) {\n const $image = $(target);\n const position = $image.position();\n const pos = {\n left: position.left + parseInt($image.css('marginLeft'), 10),\n top: position.top + parseInt($image.css('marginTop'), 10),\n };\n\n // exclude margin\n const imageSize = {\n w: $image.outerWidth(false),\n h: $image.outerHeight(false),\n };\n\n $selection.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n width: imageSize.w,\n height: imageSize.h,\n }).data('target', $image); // save current image element.\n\n const origImageObj = new Image();\n origImageObj.src = $image.attr('src');\n\n const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n $selection.find('.note-control-selection-info').text(sizingText);\n this.context.invoke('editor.saveTarget', target);\n } else {\n this.hide();\n }\n\n return isImage;\n }\n\n /**\n * hide\n *\n * @param {jQuery} $handle\n */\n hide() {\n this.context.invoke('editor.clearTarget');\n this.$handle.children().hide();\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport key from '../core/key';\n\nconst defaultScheme = 'http://';\nconst linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n\nexport default class AutoLink {\n constructor(context) {\n this.context = context;\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n initialize() {\n this.lastWordRange = null;\n }\n\n destroy() {\n this.lastWordRange = null;\n }\n\n replace() {\n if (!this.lastWordRange) {\n return;\n }\n\n const keyword = this.lastWordRange.toString();\n const match = keyword.match(linkPattern);\n\n if (match && (match[1] || match[2])) {\n const link = match[1] ? keyword : defaultScheme + keyword;\n const urlText = keyword.replace(/^(?:https?:\\/\\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\\.)?/i, '').split('/')[0];\n const node = $('<a />').html(urlText).attr('href', link)[0];\n if (this.context.options.linkTargetBlank) {\n $(node).attr('target', '_blank');\n }\n\n this.lastWordRange.insertNode(node);\n this.lastWordRange = null;\n this.context.invoke('editor.focus');\n }\n }\n\n handleKeydown(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWordRange = wordRange;\n }\n }\n\n handleKeyup(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n this.replace();\n }\n }\n}\n","import dom from '../core/dom';\n\n/**\n * textarea auto sync.\n */\nexport default class AutoSync {\n constructor(context) {\n this.$note = context.layoutInfo.note;\n this.events = {\n 'summernote.change': () => {\n this.$note.val(context.invoke('code'));\n },\n };\n }\n\n shouldInitialize() {\n return dom.isTextarea(this.$note[0]);\n }\n}\n","import lists from '../core/lists';\nimport dom from '../core/dom';\nimport key from '../core/key';\n\nexport default class AutoReplace {\n constructor(context) {\n this.context = context;\n this.options = context.options.replace || {};\n\n this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n this.previousKeydownCode = null;\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.match;\n }\n\n initialize() {\n this.lastWord = null;\n }\n\n destroy() {\n this.lastWord = null;\n }\n\n replace() {\n if (!this.lastWord) {\n return;\n }\n\n const self = this;\n const keyword = this.lastWord.toString();\n this.options.match(keyword, function(match) {\n if (match) {\n let node = '';\n\n if (typeof match === 'string') {\n node = dom.createText(match);\n } else if (match instanceof jQuery) {\n node = match[0];\n } else if (match instanceof Node) {\n node = match;\n }\n\n if (!node) return;\n self.lastWord.insertNode(node);\n self.lastWord = null;\n self.context.invoke('editor.focus');\n }\n });\n }\n\n handleKeydown(e) {\n // this forces it to remember the last whole word, even if multiple termination keys are pressed\n // before the previous key is let go.\n if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n this.previousKeydownCode = e.keyCode;\n return;\n }\n\n if (lists.contains(this.keys, e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWord = wordRange;\n }\n this.previousKeydownCode = e.keyCode;\n }\n\n handleKeyup(e) {\n if (lists.contains(this.keys, e.keyCode)) {\n this.replace();\n }\n }\n}\n","import $ from 'jquery';\nexport default class Placeholder {\n constructor(context) {\n this.context = context;\n\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n\n if (this.options.inheritPlaceholder === true) {\n // get placeholder value from the original element\n this.options.placeholder = this.context.$note.attr('placeholder') || this.options.placeholder;\n }\n\n this.events = {\n 'summernote.init summernote.change': () => {\n this.update();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.placeholder;\n }\n\n initialize() {\n this.$placeholder = $('<div class=\"note-placeholder\">');\n this.$placeholder.on('click', () => {\n this.context.invoke('focus');\n }).html(this.options.placeholder).prependTo(this.$editingArea);\n\n this.update();\n }\n\n destroy() {\n this.$placeholder.remove();\n }\n\n update() {\n const isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n this.$placeholder.toggle(isShow);\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport env from '../core/env';\n\nexport default class Buttons {\n constructor(context) {\n this.ui = $.summernote.ui;\n this.context = context;\n this.$toolbar = context.layoutInfo.toolbar;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.invertedKeyMap = func.invertObject(\n this.options.keyMap[env.isMac ? 'mac' : 'pc']\n );\n }\n\n representShortcut(editorMethod) {\n let shortcut = this.invertedKeyMap[editorMethod];\n if (!this.options.shortcuts || !shortcut) {\n return '';\n }\n\n if (env.isMac) {\n shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n }\n\n shortcut = shortcut.replace('BACKSLASH', '\\\\')\n .replace('SLASH', '/')\n .replace('LEFTBRACKET', '[')\n .replace('RIGHTBRACKET', ']');\n\n return ' (' + shortcut + ')';\n }\n\n button(o) {\n if (!this.options.tooltip && o.tooltip) {\n delete o.tooltip;\n }\n o.container = this.options.container;\n return this.ui.button(o);\n }\n\n initialize() {\n this.addToolbarButtons();\n this.addImagePopoverButtons();\n this.addLinkPopoverButtons();\n this.addTablePopoverButtons();\n this.fontInstalledMap = {};\n }\n\n destroy() {\n delete this.fontInstalledMap;\n }\n\n isFontInstalled(name) {\n if (!Object.prototype.hasOwnProperty.call(this.fontInstalledMap, name)) {\n this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n lists.contains(this.options.fontNamesIgnoreCheck, name);\n }\n return this.fontInstalledMap[name];\n }\n\n isFontDeservedToAdd(name) {\n name = name.toLowerCase();\n return (name !== '' && this.isFontInstalled(name) && env.genericFontFamilies.indexOf(name) === -1);\n }\n\n colorPalette(className, tooltip, backColor, foreColor) {\n return this.ui.buttonGroup({\n className: 'note-color ' + className,\n children: [\n this.button({\n className: 'note-current-color-button',\n contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n tooltip: tooltip,\n click: (e) => {\n const $button = $(e.currentTarget);\n if (backColor && foreColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n foreColor: $button.attr('data-foreColor'),\n });\n } else if (backColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n });\n } else if (foreColor) {\n this.context.invoke('editor.color', {\n foreColor: $button.attr('data-foreColor'),\n });\n }\n },\n callback: ($button) => {\n const $recentColor = $button.find('.note-recent-color');\n if (backColor) {\n $recentColor.css('background-color', this.options.colorButton.backColor);\n $button.attr('data-backColor', this.options.colorButton.backColor);\n }\n if (foreColor) {\n $recentColor.css('color', this.options.colorButton.foreColor);\n $button.attr('data-foreColor', this.options.colorButton.foreColor);\n } else {\n $recentColor.css('color', 'transparent');\n }\n },\n }),\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('', this.options),\n tooltip: this.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n items: (backColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n this.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n '</div>',\n '<div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n '</div>',\n ].join('') : '') +\n (foreColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n this.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n '</div>', // Fix missing Div, Commented to find easily if it's wrong\n '<div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n '</div>',\n ].join('') : ''),\n callback: ($dropdown) => {\n $dropdown.find('.note-holder').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: this.options.colors,\n colorsName: this.options.colorsName,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n /* TODO: do we have to record recent custom colors within cookies? */\n var customColors = [\n ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n ];\n $dropdown.find('.note-holder-custom').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: customColors,\n colorsName: customColors,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n $dropdown.find('input[type=color]').each((idx, item) => {\n $(item).change(function() {\n const $chip = $dropdown.find('#' + $(this).data('event')).find('.note-color-btn').first();\n const color = this.value.toUpperCase();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $chip.click();\n });\n });\n },\n click: (event) => {\n event.stopPropagation();\n\n const $parent = $('.' + className).find('.note-dropdown-menu');\n const $button = $(event.target);\n const eventName = $button.data('event');\n const value = $button.attr('data-value');\n\n if (eventName === 'openPalette') {\n const $picker = $parent.find('#' + value);\n const $palette = $($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n\n // Shift palette chips\n const $chip = $palette.find('.note-color-btn').last().detach();\n\n // Set chip attributes\n const color = $picker.val();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $palette.prepend($chip);\n $picker.click();\n } else {\n if (lists.contains(['backColor', 'foreColor'], eventName)) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n }\n this.context.invoke('editor.' + eventName, value);\n }\n },\n }),\n ],\n }).render();\n }\n\n addToolbarButtons() {\n this.context.memo('button.style', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n this.ui.icon(this.options.icons.magic), this.options\n ),\n tooltip: this.lang.style.style,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n className: 'dropdown-style',\n items: this.options.styleTags,\n title: this.lang.style.style,\n template: (item) => {\n // TBD: need to be simplified\n if (typeof item === 'string') {\n item = {\n tag: item,\n title: (Object.prototype.hasOwnProperty.call(this.lang.style, item) ? this.lang.style[item] : item),\n };\n }\n\n const tag = item.tag;\n const title = item.title;\n const style = item.style ? ' style=\"' + item.style + '\" ' : '';\n const className = item.className ? ' class=\"' + item.className + '\"' : '';\n\n return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n },\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }),\n ]).render();\n });\n\n for (let styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n const item = this.options.styleTags[styleIdx];\n\n this.context.memo('button.style.' + item, () => {\n return this.button({\n className: 'note-btn-style-' + item,\n contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n tooltip: this.lang.style[item],\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }).render();\n });\n }\n\n this.context.memo('button.bold', () => {\n return this.button({\n className: 'note-btn-bold',\n contents: this.ui.icon(this.options.icons.bold),\n tooltip: this.lang.font.bold + this.representShortcut('bold'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.bold'),\n }).render();\n });\n\n this.context.memo('button.italic', () => {\n return this.button({\n className: 'note-btn-italic',\n contents: this.ui.icon(this.options.icons.italic),\n tooltip: this.lang.font.italic + this.representShortcut('italic'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.italic'),\n }).render();\n });\n\n this.context.memo('button.underline', () => {\n return this.button({\n className: 'note-btn-underline',\n contents: this.ui.icon(this.options.icons.underline),\n tooltip: this.lang.font.underline + this.representShortcut('underline'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.underline'),\n }).render();\n });\n\n this.context.memo('button.clear', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.eraser),\n tooltip: this.lang.font.clear + this.representShortcut('removeFormat'),\n click: this.context.createInvokeHandler('editor.removeFormat'),\n }).render();\n });\n\n this.context.memo('button.strikethrough', () => {\n return this.button({\n className: 'note-btn-strikethrough',\n contents: this.ui.icon(this.options.icons.strikethrough),\n tooltip: this.lang.font.strikethrough + this.representShortcut('strikethrough'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.strikethrough'),\n }).render();\n });\n\n this.context.memo('button.superscript', () => {\n return this.button({\n className: 'note-btn-superscript',\n contents: this.ui.icon(this.options.icons.superscript),\n tooltip: this.lang.font.superscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.superscript'),\n }).render();\n });\n\n this.context.memo('button.subscript', () => {\n return this.button({\n className: 'note-btn-subscript',\n contents: this.ui.icon(this.options.icons.subscript),\n tooltip: this.lang.font.subscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.subscript'),\n }).render();\n });\n\n this.context.memo('button.fontname', () => {\n const styleInfo = this.context.invoke('editor.currentStyle');\n\n if (this.options.addDefaultFonts) {\n // Add 'default' fonts into the fontnames array if not exist\n $.each(styleInfo['font-family'].split(','), (idx, fontname) => {\n fontname = fontname.trim().replace(/['\"]+/g, '');\n if (this.isFontDeservedToAdd(fontname)) {\n if (this.options.fontNames.indexOf(fontname) === -1) {\n this.options.fontNames.push(fontname);\n }\n }\n });\n }\n\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n '<span class=\"note-current-fontname\"/>', this.options\n ),\n tooltip: this.lang.font.name,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontname',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontNames.filter(this.isFontInstalled.bind(this)),\n title: this.lang.font.name,\n template: (item) => {\n return '<span style=\"font-family: ' + env.validFontName(item) + '\">' + item + '</span>';\n },\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontName'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsize', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', this.options),\n tooltip: this.lang.font.size,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsize',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizes,\n title: this.lang.font.size,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSize'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsizeunit', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsizeunit\"/>', this.options),\n tooltip: this.lang.font.sizeunit,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsizeunit',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizeUnits,\n title: this.lang.font.sizeunit,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSizeUnit'),\n }),\n ]).render();\n });\n\n this.context.memo('button.color', () => {\n return this.colorPalette('note-color-all', this.lang.color.recent, true, true);\n });\n\n this.context.memo('button.forecolor', () => {\n return this.colorPalette('note-color-fore', this.lang.color.foreground, false, true);\n });\n\n this.context.memo('button.backcolor', () => {\n return this.colorPalette('note-color-back', this.lang.color.background, true, false);\n });\n\n this.context.memo('button.ul', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unorderedlist),\n tooltip: this.lang.lists.unordered + this.representShortcut('insertUnorderedList'),\n click: this.context.createInvokeHandler('editor.insertUnorderedList'),\n }).render();\n });\n\n this.context.memo('button.ol', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.orderedlist),\n tooltip: this.lang.lists.ordered + this.representShortcut('insertOrderedList'),\n click: this.context.createInvokeHandler('editor.insertOrderedList'),\n }).render();\n });\n\n const justifyLeft = this.button({\n contents: this.ui.icon(this.options.icons.alignLeft),\n tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n click: this.context.createInvokeHandler('editor.justifyLeft'),\n });\n\n const justifyCenter = this.button({\n contents: this.ui.icon(this.options.icons.alignCenter),\n tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n click: this.context.createInvokeHandler('editor.justifyCenter'),\n });\n\n const justifyRight = this.button({\n contents: this.ui.icon(this.options.icons.alignRight),\n tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n click: this.context.createInvokeHandler('editor.justifyRight'),\n });\n\n const justifyFull = this.button({\n contents: this.ui.icon(this.options.icons.alignJustify),\n tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n click: this.context.createInvokeHandler('editor.justifyFull'),\n });\n\n const outdent = this.button({\n contents: this.ui.icon(this.options.icons.outdent),\n tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n click: this.context.createInvokeHandler('editor.outdent'),\n });\n\n const indent = this.button({\n contents: this.ui.icon(this.options.icons.indent),\n tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n click: this.context.createInvokeHandler('editor.indent'),\n });\n\n this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n this.context.memo('button.indent', func.invoke(indent, 'render'));\n\n this.context.memo('button.paragraph', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft), this.options),\n tooltip: this.lang.paragraph.paragraph,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown([\n this.ui.buttonGroup({\n className: 'note-align',\n children: [justifyLeft, justifyCenter, justifyRight, justifyFull],\n }),\n this.ui.buttonGroup({\n className: 'note-list',\n children: [outdent, indent],\n }),\n ]),\n ]).render();\n });\n\n this.context.memo('button.height', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight), this.options),\n tooltip: this.lang.font.height,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n items: this.options.lineHeights,\n checkClassName: this.options.icons.menuCheck,\n className: 'dropdown-line-height',\n title: this.lang.font.height,\n click: this.context.createInvokeHandler('editor.lineHeight'),\n }),\n ]).render();\n });\n\n this.context.memo('button.table', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table), this.options),\n tooltip: this.lang.table.table,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n title: this.lang.table.table,\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: ($node) => {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: this.options.insertTableMaxSize.col + 'em',\n height: this.options.insertTableMaxSize.row + 'em',\n }).mousedown(this.context.createInvokeHandler('editor.insertTable'))\n .on('mousemove', this.tableMoveHandler.bind(this));\n },\n }).render();\n });\n\n this.context.memo('button.link', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.link + this.representShortcut('linkDialog.show'),\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.picture', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.picture),\n tooltip: this.lang.image.image,\n click: this.context.createInvokeHandler('imageDialog.show'),\n }).render();\n });\n\n this.context.memo('button.video', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.video),\n tooltip: this.lang.video.video,\n click: this.context.createInvokeHandler('videoDialog.show'),\n }).render();\n });\n\n this.context.memo('button.hr', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.minus),\n tooltip: this.lang.hr.insert + this.representShortcut('insertHorizontalRule'),\n click: this.context.createInvokeHandler('editor.insertHorizontalRule'),\n }).render();\n });\n\n this.context.memo('button.fullscreen', () => {\n return this.button({\n className: 'btn-fullscreen',\n contents: this.ui.icon(this.options.icons.arrowsAlt),\n tooltip: this.lang.options.fullscreen,\n click: this.context.createInvokeHandler('fullscreen.toggle'),\n }).render();\n });\n\n this.context.memo('button.codeview', () => {\n return this.button({\n className: 'btn-codeview',\n contents: this.ui.icon(this.options.icons.code),\n tooltip: this.lang.options.codeview,\n click: this.context.createInvokeHandler('codeview.toggle'),\n }).render();\n });\n\n this.context.memo('button.redo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.redo),\n tooltip: this.lang.history.redo + this.representShortcut('redo'),\n click: this.context.createInvokeHandler('editor.redo'),\n }).render();\n });\n\n this.context.memo('button.undo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.undo),\n tooltip: this.lang.history.undo + this.representShortcut('undo'),\n click: this.context.createInvokeHandler('editor.undo'),\n }).render();\n });\n\n this.context.memo('button.help', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.question),\n tooltip: this.lang.options.help,\n click: this.context.createInvokeHandler('helpDialog.show'),\n }).render();\n });\n }\n\n /**\n * image: [\n * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n * ['float', ['floatLeft', 'floatRight', 'floatNone']],\n * ['remove', ['removeMedia']],\n * ],\n */\n addImagePopoverButtons() {\n // Image Size Buttons\n this.context.memo('button.resizeFull', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">100%</span>',\n tooltip: this.lang.image.resizeFull,\n click: this.context.createInvokeHandler('editor.resize', '1'),\n }).render();\n });\n this.context.memo('button.resizeHalf', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">50%</span>',\n tooltip: this.lang.image.resizeHalf,\n click: this.context.createInvokeHandler('editor.resize', '0.5'),\n }).render();\n });\n this.context.memo('button.resizeQuarter', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">25%</span>',\n tooltip: this.lang.image.resizeQuarter,\n click: this.context.createInvokeHandler('editor.resize', '0.25'),\n }).render();\n });\n this.context.memo('button.resizeNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.resizeNone,\n click: this.context.createInvokeHandler('editor.resize', '0'),\n }).render();\n });\n\n // Float Buttons\n this.context.memo('button.floatLeft', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatLeft),\n tooltip: this.lang.image.floatLeft,\n click: this.context.createInvokeHandler('editor.floatMe', 'left'),\n }).render();\n });\n\n this.context.memo('button.floatRight', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatRight),\n tooltip: this.lang.image.floatRight,\n click: this.context.createInvokeHandler('editor.floatMe', 'right'),\n }).render();\n });\n\n this.context.memo('button.floatNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.floatNone,\n click: this.context.createInvokeHandler('editor.floatMe', 'none'),\n }).render();\n });\n\n // Remove Buttons\n this.context.memo('button.removeMedia', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.image.remove,\n click: this.context.createInvokeHandler('editor.removeMedia'),\n }).render();\n });\n }\n\n addLinkPopoverButtons() {\n this.context.memo('button.linkDialogShow', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.edit,\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.unlink', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unlink),\n tooltip: this.lang.link.unlink,\n click: this.context.createInvokeHandler('editor.unlink'),\n }).render();\n });\n }\n\n /**\n * table : [\n * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n * ],\n */\n addTablePopoverButtons() {\n this.context.memo('button.addRowUp', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowAbove),\n tooltip: this.lang.table.addRowAbove,\n click: this.context.createInvokeHandler('editor.addRow', 'top'),\n }).render();\n });\n this.context.memo('button.addRowDown', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowBelow),\n tooltip: this.lang.table.addRowBelow,\n click: this.context.createInvokeHandler('editor.addRow', 'bottom'),\n }).render();\n });\n this.context.memo('button.addColLeft', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colBefore),\n tooltip: this.lang.table.addColLeft,\n click: this.context.createInvokeHandler('editor.addCol', 'left'),\n }).render();\n });\n this.context.memo('button.addColRight', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colAfter),\n tooltip: this.lang.table.addColRight,\n click: this.context.createInvokeHandler('editor.addCol', 'right'),\n }).render();\n });\n this.context.memo('button.deleteRow', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowRemove),\n tooltip: this.lang.table.delRow,\n click: this.context.createInvokeHandler('editor.deleteRow'),\n }).render();\n });\n this.context.memo('button.deleteCol', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colRemove),\n tooltip: this.lang.table.delCol,\n click: this.context.createInvokeHandler('editor.deleteCol'),\n }).render();\n });\n this.context.memo('button.deleteTable', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.table.delTable,\n click: this.context.createInvokeHandler('editor.deleteTable'),\n }).render();\n });\n }\n\n build($container, groups) {\n for (let groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n const group = groups[groupIdx];\n const groupName = Array.isArray(group) ? group[0] : group;\n const buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n\n const $group = this.ui.buttonGroup({\n className: 'note-' + groupName,\n }).render();\n\n for (let idx = 0, len = buttons.length; idx < len; idx++) {\n const btn = this.context.memo('button.' + buttons[idx]);\n if (btn) {\n $group.append(typeof btn === 'function' ? btn(this.context) : btn);\n }\n }\n $group.appendTo($container);\n }\n }\n\n /**\n * @param {jQuery} [$container]\n */\n updateCurrentStyle($container) {\n const $cont = $container || this.$toolbar;\n\n const styleInfo = this.context.invoke('editor.currentStyle');\n this.updateBtnStates($cont, {\n '.note-btn-bold': () => {\n return styleInfo['font-bold'] === 'bold';\n },\n '.note-btn-italic': () => {\n return styleInfo['font-italic'] === 'italic';\n },\n '.note-btn-underline': () => {\n return styleInfo['font-underline'] === 'underline';\n },\n '.note-btn-subscript': () => {\n return styleInfo['font-subscript'] === 'subscript';\n },\n '.note-btn-superscript': () => {\n return styleInfo['font-superscript'] === 'superscript';\n },\n '.note-btn-strikethrough': () => {\n return styleInfo['font-strikethrough'] === 'strikethrough';\n },\n });\n\n if (styleInfo['font-family']) {\n const fontNames = styleInfo['font-family'].split(',').map((name) => {\n return name.replace(/[\\'\\\"]/g, '')\n .replace(/\\s+$/, '')\n .replace(/^\\s+/, '');\n });\n const fontName = lists.find(fontNames, this.isFontInstalled.bind(this));\n\n $cont.find('.dropdown-fontname a').each((idx, item) => {\n const $item = $(item);\n // always compare string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontName + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontname').text(fontName).css('font-family', fontName);\n }\n\n if (styleInfo['font-size']) {\n const fontSize = styleInfo['font-size'];\n $cont.find('.dropdown-fontsize a').each((idx, item) => {\n const $item = $(item);\n // always compare with string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontSize + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsize').text(fontSize);\n\n const fontSizeUnit = styleInfo['font-size-unit'];\n $cont.find('.dropdown-fontsizeunit a').each((idx, item) => {\n const $item = $(item);\n const isChecked = ($item.data('value') + '') === (fontSizeUnit + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsizeunit').text(fontSizeUnit);\n }\n\n if (styleInfo['line-height']) {\n const lineHeight = styleInfo['line-height'];\n $cont.find('.dropdown-line-height li a').each((idx, item) => {\n // always compare with string to avoid creating another func.\n const isChecked = ($(item).data('value') + '') === (lineHeight + '');\n this.className = isChecked ? 'checked' : '';\n });\n }\n }\n\n updateBtnStates($container, infos) {\n $.each(infos, (selector, pred) => {\n this.ui.toggleBtnActive($container.find(selector), pred());\n });\n }\n\n tableMoveHandler(event) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n }\n}\n","import $ from 'jquery';\nexport default class Toolbar {\n constructor(context) {\n this.context = context;\n\n this.$window = $(window);\n this.$document = $(document);\n\n this.ui = $.summernote.ui;\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$statusbar = context.layoutInfo.statusbar;\n this.options = context.options;\n\n this.isFollowing = false;\n this.followScroll = this.followScroll.bind(this);\n }\n\n shouldInitialize() {\n return !this.options.airMode;\n }\n\n initialize() {\n this.options.toolbar = this.options.toolbar || [];\n\n if (!this.options.toolbar.length) {\n this.$toolbar.hide();\n } else {\n this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n }\n\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n\n this.changeContainer(false);\n\n this.$note.on('summernote.keyup summernote.mouseup summernote.change', () => {\n this.context.invoke('buttons.updateCurrentStyle');\n });\n\n this.context.invoke('buttons.updateCurrentStyle');\n if (this.options.followingToolbar) {\n this.$window.on('scroll resize', this.followScroll);\n }\n }\n\n destroy() {\n this.$toolbar.children().remove();\n\n if (this.options.followingToolbar) {\n this.$window.off('scroll resize', this.followScroll);\n }\n }\n\n followScroll() {\n if (this.$editor.hasClass('fullscreen')) {\n return false;\n }\n\n const editorHeight = this.$editor.outerHeight();\n const editorWidth = this.$editor.width();\n const toolbarHeight = this.$toolbar.height();\n const statusbarHeight = this.$statusbar.height();\n\n // check if the web app is currently using another static bar\n let otherBarHeight = 0;\n if (this.options.otherStaticBar) {\n otherBarHeight = $(this.options.otherStaticBar).outerHeight();\n }\n\n const currentOffset = this.$document.scrollTop();\n const editorOffsetTop = this.$editor.offset().top;\n const editorOffsetBottom = editorOffsetTop + editorHeight;\n const activateOffset = editorOffsetTop - otherBarHeight;\n const deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n\n if (!this.isFollowing &&\n (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n this.isFollowing = true;\n this.$editable.css({\n marginTop: this.$toolbar.outerHeight(),\n });\n this.$toolbar.css({\n position: 'fixed',\n top: otherBarHeight,\n width: editorWidth,\n zIndex: 1000,\n });\n } else if (this.isFollowing &&\n ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n this.isFollowing = false;\n this.$toolbar.css({\n position: 'relative',\n top: 0,\n width: '100%',\n zIndex: 'auto',\n });\n this.$editable.css({\n marginTop: '',\n });\n }\n }\n\n changeContainer(isFullscreen) {\n if (isFullscreen) {\n this.$toolbar.prependTo(this.$editor);\n } else {\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n }\n if (this.options.followingToolbar) {\n this.followScroll();\n }\n }\n\n updateFullscreen(isFullscreen) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n\n this.changeContainer(isFullscreen);\n }\n\n updateCodeview(isCodeview) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n if (isCodeview) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n activate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, true);\n }\n\n deactivate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, false);\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\n\nexport default class LinkDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-txt-${this.options.id}\" class=\"note-form-label\">${this.lang.link.textToDisplay}</label>`,\n `<input id=\"note-dialog-link-txt-${this.options.id}\" class=\"note-link-text form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-url-${this.options.id}\" class=\"note-form-label\">${this.lang.link.url}</label>`,\n `<input id=\"note-dialog-link-url-${this.options.id}\" class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\"/>`,\n '</div>',\n !this.options.disableLinkTarget\n ? $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-open-in-new-window',\n text: this.lang.link.openInNewWindow,\n checked: true,\n }).render()).html()\n : '',\n $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-use-protocol',\n text: this.lang.link.useProtocol,\n checked: true,\n }).render()).html(),\n ].join('');\n\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.link.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n className: 'link-dialog',\n title: this.lang.link.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n /**\n * toggle update button\n */\n toggleLinkBtn($linkBtn, $linkText, $linkUrl) {\n this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n }\n\n /**\n * Show link dialog and set event handlers on dialog controls.\n *\n * @param {Object} linkInfo\n * @return {Promise}\n */\n showLinkDialog(linkInfo) {\n return $.Deferred((deferred) => {\n const $linkText = this.$dialog.find('.note-link-text');\n const $linkUrl = this.$dialog.find('.note-link-url');\n const $linkBtn = this.$dialog.find('.note-link-btn');\n const $openInNewWindow = this.$dialog\n .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n const $useProtocol = this.$dialog\n .find('.sn-checkbox-use-protocol input[type=checkbox]');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // If no url was given and given text is valid URL then copy that into URL Field\n if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n linkInfo.url = linkInfo.text;\n }\n\n $linkText.on('input paste propertychange', () => {\n // If linktext was modified by input events,\n // cloning text from linkUrl will be stopped.\n linkInfo.text = $linkText.val();\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.text);\n\n $linkUrl.on('input paste propertychange', () => {\n // Display same text on `Text to display` as default\n // when linktext has no text\n if (!linkInfo.text) {\n $linkText.val($linkUrl.val());\n }\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.url);\n\n if (!env.isSupportTouch) {\n $linkUrl.trigger('focus');\n }\n\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n this.bindEnterKey($linkUrl, $linkBtn);\n this.bindEnterKey($linkText, $linkBtn);\n\n const isNewWindowChecked = linkInfo.isNewWindow !== undefined\n ? linkInfo.isNewWindow : this.context.options.linkTargetBlank;\n\n $openInNewWindow.prop('checked', isNewWindowChecked);\n\n const useProtocolChecked = linkInfo.url\n ? false : this.context.options.useProtocol;\n\n $useProtocol.prop('checked', useProtocolChecked);\n\n $linkBtn.one('click', (event) => {\n event.preventDefault();\n\n deferred.resolve({\n range: linkInfo.range,\n url: $linkUrl.val(),\n text: $linkText.val(),\n isNewWindow: $openInNewWindow.is(':checked'),\n checkProtocol: $useProtocol.is(':checked'),\n });\n this.ui.hideDialog(this.$dialog);\n });\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n // detach events\n $linkText.off();\n $linkUrl.off();\n $linkBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n /**\n * @param {Object} layoutInfo\n */\n show() {\n const linkInfo = this.context.invoke('editor.getLinkInfo');\n\n this.context.invoke('editor.saveRange');\n this.showLinkDialog(linkInfo).then((linkInfo) => {\n this.context.invoke('editor.restoreRange');\n this.context.invoke('editor.createLink', linkInfo);\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class LinkPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': () => {\n this.update();\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.link);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-link-popover',\n callback: ($node) => {\n const $content = $node.find('.popover-content,.note-popover-content');\n $content.prepend('<span><a target=\"_blank\"></a> </span>');\n },\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.link);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update() {\n // Prevent focusing on editable when invoke('code') is executed\n if (!this.context.invoke('editor.hasFocus')) {\n this.hide();\n return;\n }\n\n const rng = this.context.invoke('editor.getLastRange');\n if (rng.isCollapsed() && rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n const href = $(anchor).attr('href');\n this.$popover.find('a').attr('href', href).text(href);\n\n const pos = dom.posFromPlaceholder(anchor);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class ImageDialog {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n let imageLimitation = '';\n if (this.options.maximumImageFileSize) {\n const unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n const readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n ' ' + ' KMGTP'[unit] + 'B';\n imageLimitation = `<small>${this.lang.image.maximumFileSize + ' : ' + readableSize}</small>`;\n }\n\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group note-group-select-from-files\">',\n '<label for=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n '<input id=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-image-input form-control-file note-form-control note-input\" ',\n ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>',\n imageLimitation,\n '</div>',\n '<div class=\"form-group note-group-image-url\">',\n '<label for=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.url + '</label>',\n '<input id=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-image-url form-control note-form-control note-input\" type=\"text\"/>',\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.image.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.image.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showImageDialog().then((data) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n if (typeof data === 'string') { // image url\n // If onImageLinkInsert set,\n if (this.options.callbacks.onImageLinkInsert) {\n this.context.triggerEvent('image.link.insert', data);\n } else {\n this.context.invoke('editor.insertImage', data);\n }\n } else { // array of files\n this.context.invoke('editor.insertImagesOrCallback', data);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show image dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showImageDialog() {\n return $.Deferred((deferred) => {\n const $imageInput = this.$dialog.find('.note-image-input');\n const $imageUrl = this.$dialog.find('.note-image-url');\n const $imageBtn = this.$dialog.find('.note-image-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // Cloning imageInput to clear element.\n $imageInput.replaceWith($imageInput.clone().on('change', (event) => {\n deferred.resolve(event.target.files || event.target.value);\n }).val(''));\n\n $imageUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($imageBtn, $imageUrl.val());\n }).val('');\n\n if (!env.isSupportTouch) {\n $imageUrl.trigger('focus');\n }\n\n $imageBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($imageUrl.val());\n });\n\n this.bindEnterKey($imageUrl, $imageBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $imageInput.off();\n $imageUrl.off();\n $imageBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\n/**\n * Image popover module\n * mouse events that show/hide popover will be handled by Handle.js.\n * Handle.js will receive the events and invoke 'imagePopover.update'.\n */\nexport default class ImagePopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n\n this.editable = context.layoutInfo.editable[0];\n this.options = context.options;\n\n this.events = {\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.image);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-image-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n this.context.invoke('buttons.build', $content, this.options.popover.image);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target, event) {\n if (dom.isImg(target)) {\n const position = $(target).offset();\n const containerOffset = $(this.options.container).offset();\n let pos = {};\n if (this.options.popatmouse) {\n pos.left = event.pageX - 20;\n pos.top = event.pageY;\n } else {\n pos = position;\n }\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class TablePopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.mousedown': (we, e) => {\n this.update(e.target);\n },\n 'summernote.keyup summernote.scroll summernote.change': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.table);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-table-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.table);\n\n // [workaround] Disable Firefox's default table editor\n if (env.isFF) {\n document.execCommand('enableInlineTableEditing', false, false);\n }\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isCell = dom.isCell(target);\n\n if (isCell) {\n const pos = dom.posFromPlaceholder(target);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n\n return isCell;\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class VideoDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group row-fluid\">',\n `<label for=\"note-dialog-video-url-${this.options.id}\" class=\"note-form-label\">${this.lang.video.url} <small class=\"text-muted\">${this.lang.video.providers}</small></label>`,\n `<input id=\"note-dialog-video-url-${this.options.id}\" class=\"note-video-url form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.video.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.video.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n createVideoNode(url) {\n // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n const ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n const ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n const ytMatch = url.match(ytRegExp);\n\n const igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n const igMatch = url.match(igRegExp);\n\n const vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n const vMatch = url.match(vRegExp);\n\n const vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n const vimMatch = url.match(vimRegExp);\n\n const dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n const dmMatch = url.match(dmRegExp);\n\n const youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n const youkuMatch = url.match(youkuRegExp);\n\n const qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n const qqMatch = url.match(qqRegExp);\n\n const qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n const qqMatch2 = url.match(qqRegExp2);\n\n const mp4RegExp = /^.+.(mp4|m4v)$/;\n const mp4Match = url.match(mp4RegExp);\n\n const oggRegExp = /^.+.(ogg|ogv)$/;\n const oggMatch = url.match(oggRegExp);\n\n const webmRegExp = /^.+.(webm)$/;\n const webmMatch = url.match(webmRegExp);\n\n const fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n const fbMatch = url.match(fbRegExp);\n\n let $video;\n if (ytMatch && ytMatch[1].length === 11) {\n const youtubeId = ytMatch[1];\n var start = 0;\n if (typeof ytMatch[2] !== 'undefined') {\n const ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n if (ytMatchForStart) {\n for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n }\n }\n }\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n .attr('width', '640').attr('height', '360');\n } else if (igMatch && igMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n .attr('width', '612').attr('height', '710')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else if (vMatch && vMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', vMatch[0] + '/embed/simple')\n .attr('width', '600').attr('height', '600')\n .attr('class', 'vine-embed');\n } else if (vimMatch && vimMatch[3].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n .attr('width', '640').attr('height', '360');\n } else if (dmMatch && dmMatch[2].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n .attr('width', '640').attr('height', '360');\n } else if (youkuMatch && youkuMatch[1].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '498')\n .attr('width', '510')\n .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n const vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '310')\n .attr('width', '500')\n .attr('src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');\n } else if (mp4Match || oggMatch || webmMatch) {\n $video = $('<video controls>')\n .attr('src', url)\n .attr('width', '640').attr('height', '360');\n } else if (fbMatch && fbMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n .attr('width', '560').attr('height', '301')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else {\n // this is not a known video link. Now what, Cat? Now what?\n return false;\n }\n\n $video.addClass('note-video-clip');\n\n return $video[0];\n }\n\n show() {\n const text = this.context.invoke('editor.getSelectedText');\n this.context.invoke('editor.saveRange');\n this.showVideoDialog(text).then((url) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n // build node\n const $node = this.createVideoNode(url);\n\n if ($node) {\n // insert video node\n this.context.invoke('editor.insertNode', $node);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show video dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showVideoDialog(/* text */) {\n return $.Deferred((deferred) => {\n const $videoUrl = this.$dialog.find('.note-video-url');\n const $videoBtn = this.$dialog.find('.note-video-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n $videoUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($videoBtn, $videoUrl.val());\n });\n\n if (!env.isSupportTouch) {\n $videoUrl.trigger('focus');\n }\n\n $videoBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($videoUrl.val());\n });\n\n this.bindEnterKey($videoUrl, $videoBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $videoUrl.off();\n $videoBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\n\nexport default class HelpDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<p class=\"text-center\">',\n '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote @@VERSION@@</a> · ',\n '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n '</p>',\n ].join('');\n\n this.$dialog = this.ui.dialog({\n title: this.lang.options.help,\n fade: this.options.dialogsFade,\n body: this.createShortcutList(),\n footer: body,\n callback: ($node) => {\n $node.find('.modal-body,.note-modal-body').css({\n 'max-height': 300,\n 'overflow': 'scroll',\n });\n },\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n createShortcutList() {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n return Object.keys(keyMap).map((key) => {\n const command = keyMap[key];\n const $row = $('<div><div class=\"help-list-item\"/></div>');\n $row.append($('<label><kbd>' + key + '</kdb></label>').css({\n 'width': 180,\n 'margin-right': 10,\n })).append($('<span/>').html(this.context.memo('help.' + command) || command));\n return $row.html();\n }).join('');\n }\n\n /**\n * show help dialog\n *\n * @return {Promise}\n */\n showHelpDialog() {\n return $.Deferred((deferred) => {\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n deferred.resolve();\n });\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showHelpDialog().then(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\n\nconst AIRMODE_POPOVER_X_OFFSET = -5;\nconst AIRMODE_POPOVER_Y_OFFSET = 5;\n\nexport default class AirPopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.options = context.options;\n\n this.hidable = true;\n this.onContextmenu = false;\n this.pageX = null;\n this.pageY = null;\n\n this.events = {\n 'summernote.contextmenu': (e) => {\n if (this.options.editing) {\n e.preventDefault();\n e.stopPropagation();\n this.onContextmenu = true;\n this.update(true);\n }\n },\n 'summernote.mousedown': (we, e) => {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n },\n 'summernote.keyup summernote.mouseup summernote.scroll': (we, e) => {\n if (this.options.editing && !this.onContextmenu) {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n this.update();\n }\n this.onContextmenu = false;\n },\n 'summernote.disable summernote.change summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n 'summernote.focusout': () => {\n if (!this.$popover.is(':active,:focus')) {\n this.hide();\n }\n },\n };\n }\n\n shouldInitialize() {\n return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-air-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.air);\n\n // disable hiding this popover preemptively by 'summernote.blur' event.\n this.$popover.on('mousedown', () => { this.hidable = false; });\n // (re-)enable hiding after 'summernote.blur' has been handled (aka. ignored).\n this.$popover.on('mouseup', () => { this.hidable = true; });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(forcelyOpen) {\n const styleInfo = this.context.invoke('editor.currentStyle');\n if (styleInfo.range && (!styleInfo.range.isCollapsed() || forcelyOpen)) {\n let rect = {\n left: this.pageX,\n top: this.pageY,\n };\n\n const containerOffset = $(this.options.container).offset();\n rect.top -= containerOffset.top;\n rect.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: Math.max(rect.left, 0) + AIRMODE_POPOVER_X_OFFSET,\n top: rect.top + AIRMODE_POPOVER_Y_OFFSET,\n });\n this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n } else {\n this.hide();\n }\n }\n\n hide() {\n if (this.hidable) {\n this.$popover.hide();\n }\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport key from '../core/key';\n\nconst POPOVER_DIST = 5;\n\nexport default class HintPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.hint = this.options.hint || [];\n this.direction = this.options.hintDirection || 'bottom';\n this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return this.hints.length > 0;\n }\n\n initialize() {\n this.lastWordRange = null;\n this.matchingWord = null;\n this.$popover = this.ui.popover({\n className: 'note-hint-popover',\n hideArrow: true,\n direction: '',\n }).render().appendTo(this.options.container);\n\n this.$popover.hide();\n this.$content = this.$popover.find('.popover-content,.note-popover-content');\n this.$content.on('click', '.note-hint-item', (e) => {\n this.$content.find('.active').removeClass('active');\n $(e.currentTarget).addClass('active');\n this.replace();\n });\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n selectItem($item) {\n this.$content.find('.active').removeClass('active');\n $item.addClass('active');\n\n this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n }\n\n moveDown() {\n const $current = this.$content.find('.note-hint-item.active');\n const $next = $current.next();\n\n if ($next.length) {\n this.selectItem($next);\n } else {\n let $nextGroup = $current.parent().next();\n\n if (!$nextGroup.length) {\n $nextGroup = this.$content.find('.note-hint-group').first();\n }\n\n this.selectItem($nextGroup.find('.note-hint-item').first());\n }\n }\n\n moveUp() {\n const $current = this.$content.find('.note-hint-item.active');\n const $prev = $current.prev();\n\n if ($prev.length) {\n this.selectItem($prev);\n } else {\n let $prevGroup = $current.parent().prev();\n\n if (!$prevGroup.length) {\n $prevGroup = this.$content.find('.note-hint-group').last();\n }\n\n this.selectItem($prevGroup.find('.note-hint-item').last());\n }\n }\n\n replace() {\n const $item = this.$content.find('.note-hint-item.active');\n\n if ($item.length) {\n var node = this.nodeFromItem($item);\n // If matchingWord length = 0 -> capture OK / open hint / but as mention capture \"\" (\\w*)\n if (this.matchingWord !== null && this.matchingWord.length === 0) {\n this.lastWordRange.so = this.lastWordRange.eo;\n // Else si > 0 and normal case -> adjust range \"before\" for correct position of insertion\n } else if (this.matchingWord !== null && this.matchingWord.length > 0 && !this.lastWordRange.isCollapsed()) {\n let rangeCompute = this.lastWordRange.eo - this.lastWordRange.so - this.matchingWord.length;\n if (rangeCompute > 0) {\n this.lastWordRange.so += rangeCompute;\n }\n }\n this.lastWordRange.insertNode(node);\n\n if (this.options.hintSelect === 'next') {\n var blank = document.createTextNode('');\n $(node).after(blank);\n range.createFromNodeBefore(blank).select();\n } else {\n range.createFromNodeAfter(node).select();\n }\n\n this.lastWordRange = null;\n this.hide();\n this.context.invoke('editor.focus');\n }\n }\n\n nodeFromItem($item) {\n const hint = this.hints[$item.data('index')];\n const item = $item.data('item');\n let node = hint.content ? hint.content(item) : item;\n if (typeof node === 'string') {\n node = dom.createText(node);\n }\n return node;\n }\n\n createItemTemplates(hintIdx, items) {\n const hint = this.hints[hintIdx];\n return items.map((item /*, idx */) => {\n const $item = $('<div class=\"note-hint-item\"/>');\n $item.append(hint.template ? hint.template(item) : item + '');\n $item.data({\n 'index': hintIdx,\n 'item': item,\n });\n return $item;\n });\n }\n\n handleKeydown(e) {\n if (!this.$popover.is(':visible')) {\n return;\n }\n\n if (e.keyCode === key.code.ENTER) {\n e.preventDefault();\n this.replace();\n } else if (e.keyCode === key.code.UP) {\n e.preventDefault();\n this.moveUp();\n } else if (e.keyCode === key.code.DOWN) {\n e.preventDefault();\n this.moveDown();\n }\n }\n\n searchKeyword(index, keyword, callback) {\n const hint = this.hints[index];\n if (hint && hint.match.test(keyword) && hint.search) {\n const matches = hint.match.exec(keyword);\n this.matchingWord = matches[0];\n hint.search(matches[1], callback);\n } else {\n callback();\n }\n }\n\n createGroup(idx, keyword) {\n const $group = $('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n this.searchKeyword(idx, keyword, (items) => {\n items = items || [];\n if (items.length) {\n $group.html(this.createItemTemplates(idx, items));\n this.show();\n }\n });\n\n return $group;\n }\n\n handleKeyup(e) {\n if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n let range = this.context.invoke('editor.getLastRange');\n let wordRange, keyword;\n if (this.options.hintMode === 'words') {\n wordRange = range.getWordsRange(range);\n keyword = wordRange.toString();\n\n this.hints.forEach((hint) => {\n if (hint.match.test(keyword)) {\n wordRange = range.getWordsMatchRange(hint.match);\n return false;\n }\n });\n\n if (!wordRange) {\n this.hide();\n return;\n }\n\n keyword = wordRange.toString();\n } else {\n wordRange = range.getWordRange();\n keyword = wordRange.toString();\n }\n\n if (this.hints.length && keyword) {\n this.$content.empty();\n\n const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n const containerOffset = $(this.options.container).offset();\n if (bnd) {\n bnd.top -= containerOffset.top;\n bnd.left -= containerOffset.left;\n\n this.$popover.hide();\n this.lastWordRange = wordRange;\n this.hints.forEach((hint, idx) => {\n if (hint.match.test(keyword)) {\n this.createGroup(idx, keyword).appendTo(this.$content);\n }\n });\n // select first .note-hint-item\n this.$content.find('.note-hint-item:first').addClass('active');\n\n // set position for popover after group is created\n if (this.direction === 'top') {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST,\n });\n } else {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top + bnd.height + POPOVER_DIST,\n });\n }\n }\n } else {\n this.hide();\n }\n }\n }\n\n show() {\n this.$popover.show();\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport './summernote-en-US';\nimport '../summernote';\nimport dom from './core/dom';\nimport range from './core/range';\nimport lists from './core/lists';\nimport Editor from './module/Editor';\nimport Clipboard from './module/Clipboard';\nimport Dropzone from './module/Dropzone';\nimport Codeview from './module/Codeview';\nimport Statusbar from './module/Statusbar';\nimport Fullscreen from './module/Fullscreen';\nimport Handle from './module/Handle';\nimport AutoLink from './module/AutoLink';\nimport AutoSync from './module/AutoSync';\nimport AutoReplace from './module/AutoReplace';\nimport Placeholder from './module/Placeholder';\nimport Buttons from './module/Buttons';\nimport Toolbar from './module/Toolbar';\nimport LinkDialog from './module/LinkDialog';\nimport LinkPopover from './module/LinkPopover';\nimport ImageDialog from './module/ImageDialog';\nimport ImagePopover from './module/ImagePopover';\nimport TablePopover from './module/TablePopover';\nimport VideoDialog from './module/VideoDialog';\nimport HelpDialog from './module/HelpDialog';\nimport AirPopover from './module/AirPopover';\nimport HintPopover from './module/HintPopover';\n\n$.summernote = $.extend($.summernote, {\n version: '@@VERSION@@',\n plugins: {},\n\n dom: dom,\n range: range,\n lists: lists,\n\n options: {\n langInfo: $.summernote.lang['en-US'],\n editing: true,\n modules: {\n 'editor': Editor,\n 'clipboard': Clipboard,\n 'dropzone': Dropzone,\n 'codeview': Codeview,\n 'statusbar': Statusbar,\n 'fullscreen': Fullscreen,\n 'handle': Handle,\n // FIXME: HintPopover must be front of autolink\n // - Script error about range when Enter key is pressed on hint popover\n 'hintPopover': HintPopover,\n 'autoLink': AutoLink,\n 'autoSync': AutoSync,\n 'autoReplace': AutoReplace,\n 'placeholder': Placeholder,\n 'buttons': Buttons,\n 'toolbar': Toolbar,\n 'linkDialog': LinkDialog,\n 'linkPopover': LinkPopover,\n 'imageDialog': ImageDialog,\n 'imagePopover': ImagePopover,\n 'tablePopover': TablePopover,\n 'videoDialog': VideoDialog,\n 'helpDialog': HelpDialog,\n 'airPopover': AirPopover,\n },\n\n buttons: {},\n\n lang: 'en-US',\n\n followingToolbar: false,\n toolbarPosition: 'top',\n otherStaticBar: '',\n\n // toolbar\n toolbar: [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['fontname', ['fontname']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']],\n ],\n\n // popover\n popatmouse: true,\n popover: {\n image: [\n ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n ['float', ['floatLeft', 'floatRight', 'floatNone']],\n ['remove', ['removeMedia']],\n ],\n link: [\n ['link', ['linkDialogShow', 'unlink']],\n ],\n table: [\n ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n ],\n air: [\n ['color', ['color']],\n ['font', ['bold', 'underline', 'clear']],\n ['para', ['ul', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture']],\n ['view', ['fullscreen', 'codeview']],\n ],\n },\n\n // air mode: inline editor\n airMode: false,\n overrideContextMenu: false, // TBD\n\n width: null,\n height: null,\n linkTargetBlank: true,\n useProtocol: true,\n defaultProtocol: 'http://',\n\n focus: false,\n tabDisabled: false,\n tabSize: 4,\n styleWithCSS: false,\n shortcuts: true,\n textareaAutoSync: true,\n tooltip: 'auto',\n container: null,\n maxTextLength: 0,\n blockquoteBreakingLevel: 2,\n spellCheck: true,\n disableGrammar: false,\n placeholder: null,\n inheritPlaceholder: false,\n // TODO: need to be documented\n recordEveryKeystroke: false,\n historyLimit: 200,\n\n // TODO: need to be documented\n hintMode: 'word',\n hintSelect: 'after',\n hintDirection: 'bottom',\n\n styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n fontNames: [\n 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n 'Tahoma', 'Times New Roman', 'Verdana',\n ],\n fontNamesIgnoreCheck: [],\n addDefaultFonts: true,\n\n fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n\n fontSizeUnits: ['px', 'pt'],\n\n // pallete colors(n x n)\n colors: [\n ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n ],\n\n // http://chir.ag/projects/name-that-color/\n colorsName: [\n ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n ],\n\n colorButton: {\n foreColor: '#000000',\n backColor: '#FFFF00',\n },\n\n lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n\n tableClassName: 'table table-bordered',\n\n insertTableMaxSize: {\n col: 10,\n row: 10,\n },\n\n // By default, dialogs are attached in container.\n dialogsInBody: false,\n dialogsFade: false,\n\n maximumImageFileSize: null,\n\n callbacks: {\n onBeforeCommand: null,\n onBlur: null,\n onBlurCodeview: null,\n onChange: null,\n onChangeCodeview: null,\n onDialogShown: null,\n onEnter: null,\n onFocus: null,\n onImageLinkInsert: null,\n onImageUpload: null,\n onImageUploadError: null,\n onInit: null,\n onKeydown: null,\n onKeyup: null,\n onMousedown: null,\n onMouseup: null,\n onPaste: null,\n onScroll: null,\n },\n\n codemirror: {\n mode: 'text/html',\n htmlMode: true,\n lineNumbers: true,\n },\n\n codeviewFilter: false,\n codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n codeviewIframeFilter: true,\n codeviewIframeWhitelistSrc: [],\n codeviewIframeWhitelistSrcBase: [\n 'www.youtube.com',\n 'www.youtube-nocookie.com',\n 'www.facebook.com',\n 'vine.co',\n 'instagram.com',\n 'player.vimeo.com',\n 'www.dailymotion.com',\n 'player.youku.com',\n 'v.qq.com',\n ],\n\n keyMap: {\n pc: {\n 'ENTER': 'insertParagraph',\n 'CTRL+Z': 'undo',\n 'CTRL+Y': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CTRL+B': 'bold',\n 'CTRL+I': 'italic',\n 'CTRL+U': 'underline',\n 'CTRL+SHIFT+S': 'strikethrough',\n 'CTRL+BACKSLASH': 'removeFormat',\n 'CTRL+SHIFT+L': 'justifyLeft',\n 'CTRL+SHIFT+E': 'justifyCenter',\n 'CTRL+SHIFT+R': 'justifyRight',\n 'CTRL+SHIFT+J': 'justifyFull',\n 'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n 'CTRL+SHIFT+NUM8': 'insertOrderedList',\n 'CTRL+LEFTBRACKET': 'outdent',\n 'CTRL+RIGHTBRACKET': 'indent',\n 'CTRL+NUM0': 'formatPara',\n 'CTRL+NUM1': 'formatH1',\n 'CTRL+NUM2': 'formatH2',\n 'CTRL+NUM3': 'formatH3',\n 'CTRL+NUM4': 'formatH4',\n 'CTRL+NUM5': 'formatH5',\n 'CTRL+NUM6': 'formatH6',\n 'CTRL+ENTER': 'insertHorizontalRule',\n 'CTRL+K': 'linkDialog.show',\n },\n\n mac: {\n 'ENTER': 'insertParagraph',\n 'CMD+Z': 'undo',\n 'CMD+SHIFT+Z': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CMD+B': 'bold',\n 'CMD+I': 'italic',\n 'CMD+U': 'underline',\n 'CMD+SHIFT+S': 'strikethrough',\n 'CMD+BACKSLASH': 'removeFormat',\n 'CMD+SHIFT+L': 'justifyLeft',\n 'CMD+SHIFT+E': 'justifyCenter',\n 'CMD+SHIFT+R': 'justifyRight',\n 'CMD+SHIFT+J': 'justifyFull',\n 'CMD+SHIFT+NUM7': 'insertUnorderedList',\n 'CMD+SHIFT+NUM8': 'insertOrderedList',\n 'CMD+LEFTBRACKET': 'outdent',\n 'CMD+RIGHTBRACKET': 'indent',\n 'CMD+NUM0': 'formatPara',\n 'CMD+NUM1': 'formatH1',\n 'CMD+NUM2': 'formatH2',\n 'CMD+NUM3': 'formatH3',\n 'CMD+NUM4': 'formatH4',\n 'CMD+NUM5': 'formatH5',\n 'CMD+NUM6': 'formatH6',\n 'CMD+ENTER': 'insertHorizontalRule',\n 'CMD+K': 'linkDialog.show',\n },\n },\n icons: {\n 'align': 'note-icon-align',\n 'alignCenter': 'note-icon-align-center',\n 'alignJustify': 'note-icon-align-justify',\n 'alignLeft': 'note-icon-align-left',\n 'alignRight': 'note-icon-align-right',\n 'rowBelow': 'note-icon-row-below',\n 'colBefore': 'note-icon-col-before',\n 'colAfter': 'note-icon-col-after',\n 'rowAbove': 'note-icon-row-above',\n 'rowRemove': 'note-icon-row-remove',\n 'colRemove': 'note-icon-col-remove',\n 'indent': 'note-icon-align-indent',\n 'outdent': 'note-icon-align-outdent',\n 'arrowsAlt': 'note-icon-arrows-alt',\n 'bold': 'note-icon-bold',\n 'caret': 'note-icon-caret',\n 'circle': 'note-icon-circle',\n 'close': 'note-icon-close',\n 'code': 'note-icon-code',\n 'eraser': 'note-icon-eraser',\n 'floatLeft': 'note-icon-float-left',\n 'floatRight': 'note-icon-float-right',\n 'font': 'note-icon-font',\n 'frame': 'note-icon-frame',\n 'italic': 'note-icon-italic',\n 'link': 'note-icon-link',\n 'unlink': 'note-icon-chain-broken',\n 'magic': 'note-icon-magic',\n 'menuCheck': 'note-icon-menu-check',\n 'minus': 'note-icon-minus',\n 'orderedlist': 'note-icon-orderedlist',\n 'pencil': 'note-icon-pencil',\n 'picture': 'note-icon-picture',\n 'question': 'note-icon-question',\n 'redo': 'note-icon-redo',\n 'rollback': 'note-icon-rollback',\n 'square': 'note-icon-square',\n 'strikethrough': 'note-icon-strikethrough',\n 'subscript': 'note-icon-subscript',\n 'superscript': 'note-icon-superscript',\n 'table': 'note-icon-table',\n 'textHeight': 'note-icon-text-height',\n 'trash': 'note-icon-trash',\n 'underline': 'note-icon-underline',\n 'undo': 'note-icon-undo',\n 'unorderedlist': 'note-icon-unorderedlist',\n 'video': 'note-icon-video',\n },\n },\n});\n","import $ from 'jquery';\nimport renderer from '../base/renderer';\n\nconst editor = renderer.create('<div class=\"note-editor note-frame card\"/>');\nconst toolbar = renderer.create('<div class=\"note-toolbar card-header\" role=\"toolbar\"></div>');\nconst editingArea = renderer.create('<div class=\"note-editing-area\"/>');\nconst codable = renderer.create('<textarea class=\"note-codable\" aria-multiline=\"true\"/>');\nconst editable = renderer.create('<div class=\"note-editable card-block\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\nconst statusbar = renderer.create([\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n '<div class=\"note-statusbar\" role=\"status\">',\n '<output class=\"note-status-output\" aria-live=\"polite\"></output>',\n '<div class=\"note-resizebar\" aria-label=\"Resize\">',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '</div>',\n '</div>',\n].join(''));\n\nconst airEditor = renderer.create('<div class=\"note-editor note-airframe\"/>');\nconst airEditable = renderer.create([\n '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n].join(''));\n\nconst buttonGroup = renderer.create('<div class=\"note-btn-group btn-group\">');\n\nconst dropdown = renderer.create('<div class=\"note-dropdown-menu dropdown-menu\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n const option = (typeof item === 'object') ? item.option : undefined;\n\n const dataValue = 'data-value=\"' + value + '\"';\n const dataOption = (option !== undefined) ? ' data-option=\"' + option + '\"' : '';\n return '<a class=\"dropdown-item\" href=\"#\" ' + (dataValue + dataOption) + ' role=\"listitem\" aria-label=\"' + value + '\">' + content + '</a>';\n }).join('') : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dropdownButtonContents = function(contents) {\n return contents;\n};\n\nconst dropdownCheck = renderer.create('<div class=\"note-dropdown-menu dropdown-menu note-check\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n return '<a class=\"dropdown-item\" href=\"#\" data-value=\"' + value + '\" role=\"listitem\" aria-label=\"' + item + '\">' + icon(options.checkClassName) + ' ' + content + '</a>';\n }).join('') : options.items;\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dialog = renderer.create('<div class=\"modal note-modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function($node, options) {\n if (options.fade) {\n $node.addClass('fade');\n }\n $node.attr({\n 'aria-label': options.title,\n });\n $node.html([\n '<div class=\"modal-dialog\">',\n '<div class=\"modal-content\">',\n (options.title ? '<div class=\"modal-header\">' +\n '<h4 class=\"modal-title\">' + options.title + '</h4>' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" aria-hidden=\"true\">×</button>' +\n '</div>' : ''),\n '<div class=\"modal-body\">' + options.body + '</div>',\n (options.footer ? '<div class=\"modal-footer\">' + options.footer + '</div>' : ''),\n '</div>',\n '</div>',\n ].join(''));\n});\n\nconst popover = renderer.create([\n '<div class=\"note-popover popover in\">',\n '<div class=\"arrow\"/>',\n '<div class=\"popover-content note-children-container\"/>',\n '</div>',\n].join(''), function($node, options) {\n const direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n\n $node.addClass(direction);\n\n if (options.hideArrow) {\n $node.find('.arrow').hide();\n }\n});\n\nconst checkbox = renderer.create('<div class=\"form-check\"></div>', function($node, options) {\n $node.html([\n '<label class=\"form-check-label\"' + (options.id ? ' for=\"note-' + options.id + '\"' : '') + '>',\n '<input type=\"checkbox\" class=\"form-check-input\"' + (options.id ? ' id=\"note-' + options.id + '\"' : ''),\n (options.checked ? ' checked' : ''),\n ' aria-label=\"' + (options.text ? options.text : '') + '\"',\n ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n ' ' + (options.text ? options.text : '') +\n '</label>',\n ].join(''));\n});\n\nconst icon = function(iconClassName, tagName) {\n tagName = tagName || 'i';\n return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n};\n\nconst ui = function(editorOptions) {\n return {\n editor: editor,\n toolbar: toolbar,\n editingArea: editingArea,\n codable: codable,\n editable: editable,\n statusbar: statusbar,\n airEditor: airEditor,\n airEditable: airEditable,\n buttonGroup: buttonGroup,\n dropdown: dropdown,\n dropdownButtonContents: dropdownButtonContents,\n dropdownCheck: dropdownCheck,\n dialog: dialog,\n popover: popover,\n icon: icon,\n checkbox: checkbox,\n options: editorOptions,\n\n palette: function($node, options) {\n return renderer.create('<div class=\"note-color-palette\"/>', function($node, options) {\n const contents = [];\n for (let row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n const eventName = options.eventName;\n const colors = options.colors[row];\n const colorsName = options.colorsName[row];\n const buttons = [];\n for (let col = 0, colSize = colors.length; col < colSize; col++) {\n const color = colors[col];\n const colorName = colorsName[col];\n buttons.push([\n '<button type=\"button\" class=\"note-color-btn\"',\n 'style=\"background-color:', color, '\" ',\n 'data-event=\"', eventName, '\" ',\n 'data-value=\"', color, '\" ',\n 'title=\"', colorName, '\" ',\n 'aria-label=\"', colorName, '\" ',\n 'data-toggle=\"button\" tabindex=\"-1\"></button>',\n ].join(''));\n }\n contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n }\n $node.html(contents.join(''));\n\n if (options.tooltip) {\n $node.find('.note-color-btn').tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n });\n }\n })($node, options);\n },\n\n button: function($node, options) {\n return renderer.create('<button type=\"button\" class=\"note-btn btn btn-light btn-sm\" tabindex=\"-1\">', function($node, options) {\n if (options && options.tooltip) {\n $node.attr({\n title: options.tooltip,\n 'aria-label': options.tooltip,\n }).tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n }).on('click', (e) => {\n $(e.currentTarget).tooltip('hide');\n });\n }\n })($node, options);\n },\n\n toggleBtn: function($btn, isEnable) {\n $btn.toggleClass('disabled', !isEnable);\n $btn.attr('disabled', !isEnable);\n },\n\n toggleBtnActive: function($btn, isActive) {\n $btn.toggleClass('active', isActive);\n },\n\n onDialogShown: function($dialog, handler) {\n $dialog.one('shown.bs.modal', handler);\n },\n\n onDialogHidden: function($dialog, handler) {\n $dialog.one('hidden.bs.modal', handler);\n },\n\n showDialog: function($dialog) {\n $dialog.modal('show');\n },\n\n hideDialog: function($dialog) {\n $dialog.modal('hide');\n },\n\n createLayout: function($note) {\n const $editor = (editorOptions.airMode ? airEditor([\n editingArea([\n codable(),\n airEditable(),\n ]),\n ]) : (editorOptions.toolbarPosition === 'bottom'\n ? editor([\n editingArea([\n codable(),\n editable(),\n ]),\n toolbar(),\n statusbar(),\n ])\n : editor([\n toolbar(),\n editingArea([\n codable(),\n editable(),\n ]),\n statusbar(),\n ])\n )).render();\n\n $editor.insertAfter($note);\n\n return {\n note: $note,\n editor: $editor,\n toolbar: $editor.find('.note-toolbar'),\n editingArea: $editor.find('.note-editing-area'),\n editable: $editor.find('.note-editable'),\n codable: $editor.find('.note-codable'),\n statusbar: $editor.find('.note-statusbar'),\n };\n },\n\n removeLayout: function($note, layoutInfo) {\n $note.html(layoutInfo.editable.html());\n layoutInfo.editor.remove();\n $note.show();\n },\n };\n};\n\nexport default ui;\n","import $ from 'jquery';\nimport ui from './ui';\nimport '../base/settings.js';\n\nimport '../../styles/summernote-bs4.scss';\n\n$.summernote = $.extend($.summernote, {\n ui_template: ui,\n interface: 'bs4',\n});\n\n$.summernote.options.styleTags = [\n 'p',\n { title: 'Blockquote', tag: 'blockquote', className: 'blockquote', value: 'blockquote' },\n 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n];\n"],"sourceRoot":""}
File: public/AdminLTE/plugins/summernote/summernote-lite.js
Match lines: 8
2727| value: function normalize() {
2955| return new WrappedRange(point.node, point.offset, point.node, point.offset).normalize();
3013| var rng = this.normalize();
3044| return this.normalize();
4371| range.create(nextPara, 0).normalize().select().scrollIntoView(editable);
5266| _this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());
5712| rng = rng.normalize();
6173| this.$editable[0].normalize();
File: public/AdminLTE/plugins/summernote/summernote-lite.js.map
Match lines: 1
1|{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///external {\"root\":\"jQuery\",\"commonjs2\":\"jquery\",\"commonjs\":\"jquery\",\"amd\":\"jquery\"}","webpack:///./src/js/base/renderer.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./src/js/base/summernote-en-US.js","webpack:///./src/js/base/core/env.js","webpack:///./src/js/base/core/func.js","webpack:///./src/js/base/core/lists.js","webpack:///./src/js/base/core/dom.js","webpack:///./src/js/base/Context.js","webpack:///./src/js/summernote.js","webpack:///./src/js/base/core/range.js","webpack:///./src/js/base/core/key.js","webpack:///./src/js/base/core/async.js","webpack:///./src/js/base/editing/History.js","webpack:///./src/js/base/editing/Style.js","webpack:///./src/js/base/editing/Bullet.js","webpack:///./src/js/base/editing/Typing.js","webpack:///./src/js/base/editing/Table.js","webpack:///./src/js/base/module/Editor.js","webpack:///./src/js/base/module/Clipboard.js","webpack:///./src/js/base/module/Dropzone.js","webpack:///./src/js/base/module/Codeview.js","webpack:///./src/js/base/module/Statusbar.js","webpack:///./src/js/base/module/Fullscreen.js","webpack:///./src/js/base/module/Handle.js","webpack:///./src/js/base/module/AutoLink.js","webpack:///./src/js/base/module/AutoSync.js","webpack:///./src/js/base/module/AutoReplace.js","webpack:///./src/js/base/module/Placeholder.js","webpack:///./src/js/base/module/Buttons.js","webpack:///./src/js/base/module/Toolbar.js","webpack:///./src/js/base/module/LinkDialog.js","webpack:///./src/js/base/module/LinkPopover.js","webpack:///./src/js/base/module/ImageDialog.js","webpack:///./src/js/base/module/ImagePopover.js","webpack:///./src/js/base/module/TablePopover.js","webpack:///./src/js/base/module/VideoDialog.js","webpack:///./src/js/base/module/HelpDialog.js","webpack:///./src/js/base/module/AirPopover.js","webpack:///./src/js/base/module/HintPopover.js","webpack:///./src/js/base/settings.js","webpack:///./src/js/lite/ui/TooltipUI.js","webpack:///./src/js/lite/ui/DropdownUI.js","webpack:///./src/js/lite/ui/ModalUI.js","webpack:///./src/js/lite/ui.js","webpack:///./src/js/lite/settings.js","webpack:///./src/styles/summernote-lite.scss"],"names":["Renderer","markup","children","options","callback","$parent","$node","$","contents","html","className","addClass","data","each","k","v","attr","click","on","$container","find","forEach","child","render","length","append","create","arguments","Array","isArray","summernote","lang","extend","font","bold","italic","underline","clear","height","name","strikethrough","subscript","superscript","size","sizeunit","image","insert","resizeFull","resizeHalf","resizeQuarter","resizeNone","floatLeft","floatRight","floatNone","shapeRounded","shapeCircle","shapeThumbnail","shapeNone","dragImageHere","dropImage","selectFromFiles","maximumFileSize","maximumFileSizeError","url","remove","original","video","videoLink","providers","link","unlink","edit","textToDisplay","openInNewWindow","useProtocol","table","addRowAbove","addRowBelow","addColLeft","addColRight","delRow","delCol","delTable","hr","style","p","blockquote","pre","h1","h2","h3","h4","h5","h6","lists","unordered","ordered","help","fullscreen","codeview","paragraph","outdent","indent","left","center","right","justify","color","recent","more","background","foreground","transparent","setTransparent","reset","resetToDefault","cpSelect","shortcut","shortcuts","close","textFormatting","action","paragraphFormatting","documentStyle","extraKeys","history","undo","redo","specialChar","select","output","noSelection","isSupportAmd","define","genericFontFamilies","validFontName","fontName","inArray","toLowerCase","isFontInstalled","testFontName","testText","testSize","canvas","document","createElement","context","getContext","originalWidth","measureText","width","userAgent","navigator","isMSIE","test","browserVersion","matches","exec","parseFloat","isEdge","hasCodeMirror","window","CodeMirror","isSupportTouch","MaxTouchPoints","msMaxTouchPoints","inputEventName","isMac","appVersion","indexOf","isFF","isPhantom","isWebkit","isChrome","isSafari","jqueryVersion","fn","jquery","isW3CRangeSupport","createRange","eq","itemA","itemB","eq2","peq2","propName","ok","fail","not","f","apply","and","fA","fB","item","self","a","invoke","obj","method","idCounter","resetUniqueId","uniqueId","prefix","id","rect2bnd","rect","$document","top","scrollTop","scrollLeft","bottom","invertObject","inverted","key","Object","prototype","hasOwnProperty","call","namespaceToCamel","namespace","split","map","substring","toUpperCase","join","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","setTimeout","isValidUrl","expression","head","array","last","initial","slice","tail","pred","idx","len","all","contains","sum","reduce","memo","from","collection","result","isEmpty","clusterBy","aTail","aLast","compact","aResult","push","unique","results","next","prev","NBSP_CHAR","String","fromCharCode","ZERO_WIDTH_NBSP_CHAR","isEditable","node","hasClass","isControlSizing","makePredByNodeName","nodeName","isText","nodeType","isElement","isVoid","isPara","isHeading","isPre","isLi","isPurePara","isTable","isData","isInline","isBodyContainer","isList","isHr","isBlockquote","isCell","isAnchor","isParaInline","ancestor","isBodyInline","isBody","isClosestSibling","nodeA","nodeB","nextSibling","previousSibling","withClosestSiblings","siblings","blankHTML","env","nodeLength","nodeValue","childNodes","deepestChildIsEmpty","firstElementChild","innerHTML","paddingBlankHTML","parentNode","singleChildAncestor","listAncestor","ancestors","el","lastAncestor","filter","commonAncestor","n","listPrev","nodes","listNext","listDescendant","descendants","fnWalk","current","wrap","wrapperName","parent","wrapper","insertBefore","appendChild","insertAfter","preceding","appendChildNodes","aChild","isLeftEdgePoint","point","offset","isRightEdgePoint","isEdgePoint","isLeftEdgeOf","position","isRightEdgeOf","isLeftEdgePointOf","isRightEdgePointOf","hasChildren","prevPoint","isSkipInnerOffset","nextPoint","isSamePoint","pointA","pointB","isVisiblePoint","leftNode","rightNode","prevPointUntil","nextPointUntil","isCharPoint","ch","charAt","isSpacePoint","walkPoint","startPoint","endPoint","handler","isSkipOffset","makeOffsetPath","reverse","fromOffsetPath","offsets","i","splitNode","isSkipPaddingBlankHTML","isNotSplitEdgePoint","isDiscardEmptySplits","splitText","childNode","clone","cloneNode","splitTree","root","splitPoint","topAncestor","splitRoot","container","pivot","createText","text","createTextNode","isRemoveChild","removeNode","removeChild","removeWhile","replace","newNode","cssText","isTextarea","value","stripLinebreaks","val","isNewlineOnBlock","regexTag","match","endSlash","isEndOfInlineContainer","isBlockNode","trim","posFromPlaceholder","placeholder","$placeholder","pos","outerHeight","attachEvents","events","keys","detachEvents","off","isCustomStyleTag","classList","blank","emptyPara","isBlock","isDiv","isBR","isSpan","isB","isU","isS","isI","isImg","isEmptyAnchor","Context","$note","memos","modules","layoutInfo","ui","ui_template","initialize","createLayout","_initialize","hide","_destroy","removeData","removeLayout","disabled","isDisabled","code","dom","disable","now","editor","buttons","plugins","module","initializeModule","removeModule","removeMemo","triggerEvent","isActivated","undefined","codable","editable","editing","callbacks","trigger","shouldInitialize","ModuleClass","withoutIntialize","destroy","event","createInvokeHandler","preventDefault","$target","target","closest","splits","hasSeparator","moduleName","methodName","type","isExternalAPICalled","hasInitOptions","langInfo","icons","tooltip","note","first","focus","textRangeToPoint","textRange","isStart","parentElement","tester","body","createTextRange","prevContainer","moveToElementText","compareEndPoints","textRangeStart","curTextNode","collapse","firstChild","pointTester","duplicate","setEndPoint","textCount","dummy","cont","pointToTextRange","textRangeInfo","isCollapseToStart","prevTextNodes","collapseToStart","info","moveStart","WrappedRange","sc","so","ec","eo","isOnEditable","makeIsOn","isOnList","isOnAnchor","isOnCell","isOnData","w3cRange","setStart","setEnd","Math","min","nativeRng","nativeRange","selection","getSelection","rangeCount","removeAllRanges","addRange","offsetTop","abs","getVisiblePoint","isLeftToRight","block","hasRightNode","hasLeftNode","getEndPoint","isCollapsed","getStartPoint","includeAncestor","fullyContains","leftEdgeNodes","startAncestor","endAncestor","boundaryPoints","getPoints","isSameContainer","rng","emptyParents","normalize","inlineSiblings","concat","para","wrapBodyInlineWithPara","deleteContents","contentsContainer","insertNode","toString","findAfter","isNotTextPoint","regex","index","s","path","e","paras","getClientRects","wrappedRange","createFromSelection","bodyElement","lastChild","createFromBodyElement","createFromNode","anchorNode","getRangeAt","startContainer","startOffset","endContainer","endOffset","textRangeEnd","isTextNode","createFromNodeBefore","createFromNodeAfter","createFromBookmark","bookmark","createFromParaBookmark","KEY_MAP","isEdit","keyCode","BACKSPACE","TAB","ENTER","SPACE","DELETE","isMove","LEFT","UP","RIGHT","DOWN","isNavigation","HOME","END","PAGEUP","PAGEDOWN","nameFromCode","readFileAsDataURL","file","Deferred","deferred","FileReader","onload","dataURL","resolve","onerror","err","reject","readAsDataURL","promise","createImage","$img","one","detach","css","display","appendTo","History","stack","stackOffset","$editable","range","emptyBookmark","snapshot","recordUndo","applySnapshot","makeSnapshot","historyLimit","shift","Style","$obj","propertyNames","propertyName","properties","styleInfo","jQueryCSS","fontSize","parseInt","expandClosestSibling","onlyPartialContains","nodesInRange","tails","elem","$cont","fromNode","queryCommandState","queryCommandValue","orderedTypes","isUnordered","lineHeight","toFixed","anchor","Bullet","toggleList","clustereds","previousList","findList","wrapList","appendToPrevious","releaseList","listName","paraBookmark","wrappedParas","diffLists","listNode","prevList","nextList","isEscapseToBody","releasedParas","headList","parentItem","newList","findNextSiblings","lastList","middleList","rootLists","rootList","listNodes","Typing","bullet","tabsize","tab","nextPara","blockquoteBreakingLevel","emptyAnchors","scrollIntoView","TableResultAction","where","domTable","_startPoint","_virtualTable","_actionCellList","setStartPoint","tagName","colPos","cellIndex","rowPos","rowIndex","setVirtualTablePosition","baseRow","baseCell","isRowSpan","isColSpan","isVirtualCell","objPosition","getActionCell","virtualTableCellObj","resultAction","virtualRowPosition","virtualColPosition","recoverCellIndex","newCellIndex","addCellInfoToVirtual","row","cell","cellHasColspan","colSpan","cellHasRowspan","rowSpan","isThisSelectedCell","rowspanNumber","attributes","rp","rowspanIndex","adjustStartPoint","colspanNumber","cp","cellspanIndex","isSelectedCell","createVirtualTable","rows","cells","getDeleteResultActionToCell","Column","SubtractSpanCount","Row","isVirtual","AddCell","RemoveCell","getAddResultActionToCell","SumSpanCount","Ignore","init","getActionList","fixedRow","fixedCol","actualPosition","canContinue","rowPosition","colPosition","requestAction","Add","Delete","Table","isShift","nextCell","currentTr","trAttributes","recoverAttributes","vTable","actions","idCell","currentCell","tdAttributes","baseCellTr","isTopFromRowSpan","newTd","removeAttr","setAttribute","before","lastTrIndex","after","rowsGroup","actionIndex","resultStr","attrList","specified","cellPos","virtualPosition","virtualTable","hasRowspan","nextRow","cloneRow","removeAttribute","hasColspan","colCount","rowCount","tds","tdHTML","idxCol","trs","trHTML","idxRow","$table","tableClassName","KEY_BOGUS","Editor","$editor","lastRange","typing","untab","insertParagraph","insertOrderedList","insertUnorderedList","formatPara","insertHorizontalRule","commands","sCmd","beforeCommand","execCommand","afterCommand","wrapCommand","fontStyling","unit","currentStyle","fontSizeUnit","formatBlock","isLimited","getLastRange","setLastRange","insertText","textNode","pasteHTML","onApplyCustomStyle","onFormatBlock","hrNode","stylePara","createLink","linkInfo","linkUrl","linkText","isNewWindow","checkProtocol","additionalTextLength","isTextChanged","onCreateLink","defaultProtocol","anchors","styleNodes","startRange","endRange","colorInfo","foreColor","backColor","insertTable","dim","dimension","createTable","removeMedia","restoreTarget","floatMe","toggleClass","resize","hasKeyShortCut","isDefaultPrevented","handleKeyMap","preventDefaultEditableShortCuts","recordEveryKeystroke","spellCheck","disableGrammar","airMode","overrideContextMenu","outerWidth","maxHeight","minHeight","keyMap","metaKey","ctrlKey","altKey","shiftKey","keyName","eventName","tabDisable","pad","maxTextLength","thenCollapse","commit","styleWithCSS","isPreventTrigger","normalizeContent","tabSize","insertTab","src","param","then","$image","show","files","filename","maximumImageFileSize","insertImage","onImageUpload","insertImagesAsDataURL","currentRange","spans","firstSpan","noteStatusOutput","expand","$anchor","addRow","addCol","deleteRow","deleteCol","deleteTable","bKeepRatio","imageSize","newRatio","y","x","ratio","is","hasFocus","Clipboard","pasteByEvent","bind","clipboardData","originalEvent","items","kind","getAsFile","getData","Dropzone","$eventListener","documentEventHandlers","$dropzone","prependTo","disableDragAndDrop","onDrop","attachDragAndDropEvent","$dropzoneMessage","onDragenter","isCodeview","hasEditorSize","add","onDragleave","removeClass","dataTransfer","types","content","substr","CodeView","$codable","save","deactivate","activate","codeviewFilter","codeviewFilterRegex","codeviewIframeFilter","whitelist","codeviewIframeWhitelistSrc","codeviewIframeWhitelistSrcBase","tag","RegExp","prettifyHtml","cmEditor","fromTextArea","codemirror","tern","server","TernServer","ternServer","cm","updateArgHints","getValue","setSize","toTextArea","purify","isChange","EDITABLE_PADDING","Statusbar","$statusbar","statusbar","disableResizeEditor","stopPropagation","editableTop","onMouseMove","clientY","minheight","max","Fullscreen","$toolbar","toolbar","$window","$scrollbar","onResize","resizeTo","h","setsize","isFullscreen","Handle","$editingArea","editingArea","we","update","$handle","disableResizeImage","posStart","clientX","isImage","$selection","w","origImageObj","Image","sizingText","defaultScheme","linkPattern","AutoLink","handleKeyup","handleKeydown","lastWordRange","keyword","urlText","linkTargetBlank","wordRange","getWordRange","AutoSync","AutoReplace","PERIOD","COMMA","SEMICOLON","SLASH","previousKeydownCode","lastWord","jQuery","Node","Placeholder","inheritPlaceholder","isShow","toggle","Buttons","invertedKeyMap","editorMethod","o","button","addToolbarButtons","addImagePopoverButtons","addLinkPopoverButtons","addTablePopoverButtons","fontInstalledMap","fontNamesIgnoreCheck","buttonGroup","icon","$button","currentTarget","$recentColor","colorButton","dropdownButtonContents","dropdown","$dropdown","$holder","palette","colors","colorsName","customColors","change","$chip","$picker","$palette","prepend","$color","$currentButton","magic","styleTags","title","template","styleIdx","styleLen","representShortcut","createInvokeHandlerAndUpdateState","eraser","addDefaultFonts","fontname","isFontDeservedToAdd","fontNames","dropdownCheck","checkClassName","menuCheck","fontSizes","fontSizeUnits","colorPalette","unorderedlist","orderedlist","justifyLeft","alignLeft","justifyCenter","alignCenter","justifyRight","alignRight","justifyFull","alignJustify","textHeight","lineHeights","$catcher","insertTableMaxSize","col","mousedown","tableMoveHandler","picture","minus","arrowsAlt","question","rollback","trash","rowAbove","rowBelow","colBefore","colAfter","rowRemove","colRemove","groups","groupIdx","groupLen","group","groupName","$group","btn","updateBtnStates","$item","isChecked","infos","selector","toggleBtnActive","PX_PER_EM","$dimensionDisplay","$highlighted","$unhighlighted","posOffset","offsetX","posCatcher","pageX","pageY","offsetY","c","ceil","r","Toolbar","isFollowing","followScroll","toolbarContainer","changeContainer","followingToolbar","editorHeight","editorWidth","toolbarHeight","statusbarHeight","otherBarHeight","otherStaticBar","currentOffset","editorOffsetTop","editorOffsetBottom","activateOffset","deactivateOffsetBottom","marginTop","zIndex","isIncludeCodeview","$btn","toggleBtn","LinkDialog","$body","dialogsInBody","disableLinkTarget","checkbox","checked","buttonClass","footer","$dialog","dialog","fade","dialogsFade","hideDialog","$input","$linkBtn","$linkText","$linkUrl","$openInNewWindow","$useProtocol","onDialogShown","toggleLinkBtn","bindEnterKey","isNewWindowChecked","prop","useProtocolChecked","onDialogHidden","state","showDialog","showLinkDialog","LinkPopover","popover","$popover","$content","href","containerOffset","ImageDialog","imageLimitation","floor","log","readableSize","pow","showImageDialog","onImageLinkInsert","$imageInput","$imageUrl","$imageBtn","replaceWith","ImagePopover","popatmouse","TablePopover","VideoDialog","ytRegExp","ytRegExpForStart","ytMatch","igRegExp","igMatch","vRegExp","vMatch","vimRegExp","vimMatch","dmRegExp","dmMatch","youkuRegExp","youkuMatch","qqRegExp","qqMatch","qqRegExp2","qqMatch2","mp4RegExp","mp4Match","oggRegExp","oggMatch","webmRegExp","webmMatch","fbRegExp","fbMatch","$video","youtubeId","start","ytMatchForStart","vid","encodeURIComponent","showVideoDialog","createVideoNode","$videoUrl","$videoBtn","HelpDialog","createShortcutList","command","$row","showHelpDialog","AIRMODE_POPOVER_X_OFFSET","AIRMODE_POPOVER_Y_OFFSET","AirPopover","hidable","onContextmenu","air","forcelyOpen","POPOVER_DIST","HintPopover","hint","direction","hintDirection","hints","matchingWord","hideArrow","innerHeight","$current","$next","selectItem","$nextGroup","$prev","$prevGroup","nodeFromItem","rangeCompute","hintSelect","hintIdx","moveUp","moveDown","search","searchKeyword","createItemTemplates","hintMode","getWordsRange","getWordsMatchRange","empty","bnd","createGroup","version","Codeview","toolbarPosition","tabDisabled","textareaAutoSync","onBeforeCommand","onBlur","onBlurCodeview","onChange","onChangeCodeview","onEnter","onFocus","onImageUploadError","onInit","onKeydown","onKeyup","onMousedown","onMouseup","onPaste","onScroll","mode","htmlMode","lineNumbers","pc","mac","TooltipUI","placement","$tooltip","showCallback","hideCallback","toggleCallback","targetOffset","nodeWidth","nodeHeight","tooltipWidth","tooltipHeight","DropdownUI","setEvent","stopImmediatePropagation","windowWidth","targetMarginRight","isOpened","ModalUI","$modal","$backdrop","which","renderer","airEditor","airEditable","$temp","$a","itemClick","caret","dropdownButton","opt","dropdownCheckButton","paragraphDropdownButton","tableDropdownButton","mousemove","rowSize","colSize","colorName","colorDropdownButton","currentClick","foreinput","getElementById","backinput","videoDialog","imageDialog","linkDialog","iconClassName","editorOptions","isEnable","isActive","check","$dom","getPopoverContent","getDialogBody"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,gD;;;;;;;;;;;;;;;;;;ACAA;;IAEMA,Q;;;AACJ,oBAAYC,MAAZ,EAAoBC,QAApB,EAA8BC,OAA9B,EAAuCC,QAAvC,EAAiD;AAAA;;AAC/C,SAAKH,MAAL,GAAcA,M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c,IAApB,EAAX;AACA+a,gBAAU,CAACgB,MAAX,CAAkBxY,MAAlB;AACAqX,WAAK,CAAChB,GAAN,CAAU,YAAV,EAHwC,CAGf;;AACzBgB,WAAK,CAACwd,IAAN;AACD;AA1HI,GAAP;AA4HD,CA7HD;;AA+Hepd,8CAAf,E;;;;;;;;AChoBA;AACA;AACA;AAEA;AAEAlb,0EAAC,CAACuB,UAAF,GAAevB,0EAAC,CAACyB,MAAF,CAASzB,0EAAC,CAACuB,UAAX,EAAuB;AACpC4Z,aAAW,EAAED,OADuB;AAEpC,eAAW;AAFyB,CAAvB,CAAf,C;;;;;;;ACNA,uC","file":"summernote-lite.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 51);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import $ from 'jquery';\n\nclass Renderer {\n constructor(markup, children, options, callback) {\n this.markup = markup;\n this.children = children;\n this.options = options;\n this.callback = callback;\n }\n\n render($parent) {\n const $node = $(this.markup);\n\n if (this.options && this.options.contents) {\n $node.html(this.options.contents);\n }\n\n if (this.options && this.options.className) {\n $node.addClass(this.options.className);\n }\n\n if (this.options && this.options.data) {\n $.each(this.options.data, (k, v) => {\n $node.attr('data-' + k, v);\n });\n }\n\n if (this.options && this.options.click) {\n $node.on('click', this.options.click);\n }\n\n if (this.children) {\n const $container = $node.find('.note-children-container');\n this.children.forEach((child) => {\n child.render($container.length ? $container : $node);\n });\n }\n\n if (this.callback) {\n this.callback($node, this.options);\n }\n\n if (this.options && this.options.callback) {\n this.options.callback($node);\n }\n\n if ($parent) {\n $parent.append($node);\n }\n\n return $node;\n }\n}\n\nexport default {\n create: (markup, callback) => {\n return function() {\n const options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n let children = Array.isArray(arguments[0]) ? arguments[0] : [];\n if (options && options.children) {\n children = options.children;\n }\n return new Renderer(markup, children, options, callback);\n };\n },\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import $ from 'jquery';\n\n$.summernote = $.summernote || {\n lang: {},\n};\n\n$.extend($.summernote.lang, {\n 'en-US': {\n font: {\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n clear: 'Remove Font Style',\n height: 'Line Height',\n name: 'Font Family',\n strikethrough: 'Strikethrough',\n subscript: 'Subscript',\n superscript: 'Superscript',\n size: 'Font Size',\n sizeunit: 'Font Size Unit',\n },\n image: {\n image: 'Picture',\n insert: 'Insert Image',\n resizeFull: 'Resize full',\n resizeHalf: 'Resize half',\n resizeQuarter: 'Resize quarter',\n resizeNone: 'Original size',\n floatLeft: 'Float Left',\n floatRight: 'Float Right',\n floatNone: 'Remove float',\n shapeRounded: 'Shape: Rounded',\n shapeCircle: 'Shape: Circle',\n shapeThumbnail: 'Shape: Thumbnail',\n shapeNone: 'Shape: None',\n dragImageHere: 'Drag image or text here',\n dropImage: 'Drop image or Text',\n selectFromFiles: 'Select from files',\n maximumFileSize: 'Maximum file size',\n maximumFileSizeError: 'Maximum file size exceeded.',\n url: 'Image URL',\n remove: 'Remove Image',\n original: 'Original',\n },\n video: {\n video: 'Video',\n videoLink: 'Video Link',\n insert: 'Insert Video',\n url: 'Video URL',\n providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)',\n },\n link: {\n link: 'Link',\n insert: 'Insert Link',\n unlink: 'Unlink',\n edit: 'Edit',\n textToDisplay: 'Text to display',\n url: 'To what URL should this link go?',\n openInNewWindow: 'Open in new window',\n useProtocol: 'Use default protocol',\n },\n table: {\n table: 'Table',\n addRowAbove: 'Add row above',\n addRowBelow: 'Add row below',\n addColLeft: 'Add column left',\n addColRight: 'Add column right',\n delRow: 'Delete row',\n delCol: 'Delete column',\n delTable: 'Delete table',\n },\n hr: {\n insert: 'Insert Horizontal Rule',\n },\n style: {\n style: 'Style',\n p: 'Normal',\n blockquote: 'Quote',\n pre: 'Code',\n h1: 'Header 1',\n h2: 'Header 2',\n h3: 'Header 3',\n h4: 'Header 4',\n h5: 'Header 5',\n h6: 'Header 6',\n },\n lists: {\n unordered: 'Unordered list',\n ordered: 'Ordered list',\n },\n options: {\n help: 'Help',\n fullscreen: 'Full Screen',\n codeview: 'Code View',\n },\n paragraph: {\n paragraph: 'Paragraph',\n outdent: 'Outdent',\n indent: 'Indent',\n left: 'Align left',\n center: 'Align center',\n right: 'Align right',\n justify: 'Justify full',\n },\n color: {\n recent: 'Recent Color',\n more: 'More Color',\n background: 'Background Color',\n foreground: 'Text Color',\n transparent: 'Transparent',\n setTransparent: 'Set transparent',\n reset: 'Reset',\n resetToDefault: 'Reset to default',\n cpSelect: 'Select',\n },\n shortcut: {\n shortcuts: 'Keyboard shortcuts',\n close: 'Close',\n textFormatting: 'Text formatting',\n action: 'Action',\n paragraphFormatting: 'Paragraph formatting',\n documentStyle: 'Document Style',\n extraKeys: 'Extra keys',\n },\n help: {\n 'insertParagraph': 'Insert Paragraph',\n 'undo': 'Undoes the last command',\n 'redo': 'Redoes the last command',\n 'tab': 'Tab',\n 'untab': 'Untab',\n 'bold': 'Set a bold style',\n 'italic': 'Set a italic style',\n 'underline': 'Set a underline style',\n 'strikethrough': 'Set a strikethrough style',\n 'removeFormat': 'Clean a style',\n 'justifyLeft': 'Set left align',\n 'justifyCenter': 'Set center align',\n 'justifyRight': 'Set right align',\n 'justifyFull': 'Set full align',\n 'insertUnorderedList': 'Toggle unordered list',\n 'insertOrderedList': 'Toggle ordered list',\n 'outdent': 'Outdent on current paragraph',\n 'indent': 'Indent on current paragraph',\n 'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n 'formatH1': 'Change current block\\'s format as H1',\n 'formatH2': 'Change current block\\'s format as H2',\n 'formatH3': 'Change current block\\'s format as H3',\n 'formatH4': 'Change current block\\'s format as H4',\n 'formatH5': 'Change current block\\'s format as H5',\n 'formatH6': 'Change current block\\'s format as H6',\n 'insertHorizontalRule': 'Insert horizontal rule',\n 'linkDialog.show': 'Show Link Dialog',\n },\n history: {\n undo: 'Undo',\n redo: 'Redo',\n },\n specialChar: {\n specialChar: 'SPECIAL CHARACTERS',\n select: 'Select Special characters',\n },\n output: {\n noSelection: 'No Selection Made!',\n },\n },\n});\n","import $ from 'jquery';\nconst isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n\n/**\n * returns whether font is installed or not.\n *\n * @param {String} fontName\n * @return {Boolean}\n */\nconst genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n\nfunction validFontName(fontName) {\n return ($.inArray(fontName.toLowerCase(), genericFontFamilies) === -1) ? `'${fontName}'` : fontName;\n}\n\nfunction isFontInstalled(fontName) {\n const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n const testText = 'mmmmmmmmmmwwwww';\n const testSize = '200px';\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n\n context.font = testSize + \" '\" + testFontName + \"'\";\n const originalWidth = context.measureText(testText).width;\n\n context.font = testSize + ' ' + validFontName(fontName) + ', \"' + testFontName + '\"';\n const width = context.measureText(testText).width;\n\n return originalWidth !== width;\n}\n\nconst userAgent = navigator.userAgent;\nconst isMSIE = /MSIE|Trident/i.test(userAgent);\nlet browserVersion;\nif (isMSIE) {\n let matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n}\n\nconst isEdge = /Edge\\/\\d+/.test(userAgent);\n\nlet hasCodeMirror = !!window.CodeMirror;\n\nconst isSupportTouch =\n (('ontouchstart' in window) ||\n (navigator.MaxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0));\n\n// [workaround] IE doesn't have input events for contentEditable\n// - see: https://goo.gl/4bfIvA\nconst inputEventName = (isMSIE) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n\n/**\n * @class core.env\n *\n * Object which check platform and agent\n *\n * @singleton\n * @alternateClassName env\n */\nexport default {\n isMac: navigator.appVersion.indexOf('Mac') > -1,\n isMSIE,\n isEdge,\n isFF: !isEdge && /firefox/i.test(userAgent),\n isPhantom: /PhantomJS/i.test(userAgent),\n isWebkit: !isEdge && /webkit/i.test(userAgent),\n isChrome: !isEdge && /chrome/i.test(userAgent),\n isSafari: !isEdge && /safari/i.test(userAgent) && (!/chrome/i.test(userAgent)),\n browserVersion,\n jqueryVersion: parseFloat($.fn.jquery),\n isSupportAmd,\n isSupportTouch,\n hasCodeMirror,\n isFontInstalled,\n isW3CRangeSupport: !!document.createRange,\n inputEventName,\n genericFontFamilies,\n validFontName,\n};\n","import $ from 'jquery';\n\n/**\n * @class core.func\n *\n * func utils (for high-order func's arg)\n *\n * @singleton\n * @alternateClassName func\n */\nfunction eq(itemA) {\n return function(itemB) {\n return itemA === itemB;\n };\n}\n\nfunction eq2(itemA, itemB) {\n return itemA === itemB;\n}\n\nfunction peq2(propName) {\n return function(itemA, itemB) {\n return itemA[propName] === itemB[propName];\n };\n}\n\nfunction ok() {\n return true;\n}\n\nfunction fail() {\n return false;\n}\n\nfunction not(f) {\n return function() {\n return !f.apply(f, arguments);\n };\n}\n\nfunction and(fA, fB) {\n return function(item) {\n return fA(item) && fB(item);\n };\n}\n\nfunction self(a) {\n return a;\n}\n\nfunction invoke(obj, method) {\n return function() {\n return obj[method].apply(obj, arguments);\n };\n}\n\nlet idCounter = 0;\n\n/**\n * reset globally-unique id\n *\n */\nfunction resetUniqueId() {\n idCounter = 0;\n}\n\n/**\n * generate a globally-unique id\n *\n * @param {String} [prefix]\n */\nfunction uniqueId(prefix) {\n const id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n/**\n * returns bnd (bounds) from rect\n *\n * - IE Compatibility Issue: http://goo.gl/sRLOAo\n * - Scroll Issue: http://goo.gl/sNjUc\n *\n * @param {Rect} rect\n * @return {Object} bounds\n * @return {Number} bounds.top\n * @return {Number} bounds.left\n * @return {Number} bounds.width\n * @return {Number} bounds.height\n */\nfunction rect2bnd(rect) {\n const $document = $(document);\n return {\n top: rect.top + $document.scrollTop(),\n left: rect.left + $document.scrollLeft(),\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\n/**\n * returns a copy of the object where the keys have become the values and the values the keys.\n * @param {Object} obj\n * @return {Object}\n */\nfunction invertObject(obj) {\n const inverted = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n inverted[obj[key]] = key;\n }\n }\n return inverted;\n}\n\n/**\n * @param {String} namespace\n * @param {String} [prefix]\n * @return {String}\n */\nfunction namespaceToCamel(namespace, prefix) {\n prefix = prefix || '';\n return prefix + namespace.split('.').map(function(name) {\n return name.substring(0, 1).toUpperCase() + name.substring(1);\n }).join('');\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n * @param {Function} func\n * @param {Number} wait\n * @param {Boolean} immediate\n * @return {Function}\n */\nfunction debounce(func, wait, immediate) {\n let timeout;\n return function() {\n const context = this;\n const args = arguments;\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/**\n *\n * @param {String} url\n * @return {Boolean}\n */\nfunction isValidUrl(url) {\n const expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n return expression.test(url);\n}\n\nexport default {\n eq,\n eq2,\n peq2,\n ok,\n fail,\n self,\n not,\n and,\n invoke,\n resetUniqueId,\n uniqueId,\n rect2bnd,\n invertObject,\n namespaceToCamel,\n debounce,\n isValidUrl,\n};\n","import func from './func';\n\n/**\n * returns the first item of an array.\n *\n * @param {Array} array\n */\nfunction head(array) {\n return array[0];\n}\n\n/**\n * returns the last item of an array.\n *\n * @param {Array} array\n */\nfunction last(array) {\n return array[array.length - 1];\n}\n\n/**\n * returns everything but the last entry of the array.\n *\n * @param {Array} array\n */\nfunction initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * returns the rest of the items in an array.\n *\n * @param {Array} array\n */\nfunction tail(array) {\n return array.slice(1);\n}\n\n/**\n * returns item of array\n */\nfunction find(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n const item = array[idx];\n if (pred(item)) {\n return item;\n }\n }\n}\n\n/**\n * returns true if all of the values in the array pass the predicate truth test.\n */\nfunction all(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * returns true if the value is present in the list.\n */\nfunction contains(array, item) {\n if (array && array.length && item) {\n if (array.indexOf) {\n return array.indexOf(item) !== -1;\n } else if (array.contains) {\n // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`\n return array.contains(item);\n }\n }\n return false;\n}\n\n/**\n * get sum from a list\n *\n * @param {Array} array - array\n * @param {Function} fn - iterator\n */\nfunction sum(array, fn) {\n fn = fn || func.self;\n return array.reduce(function(memo, v) {\n return memo + fn(v);\n }, 0);\n}\n\n/**\n * returns a copy of the collection with array type.\n * @param {Collection} collection - collection eg) node.childNodes, ...\n */\nfunction from(collection) {\n const result = [];\n const length = collection.length;\n let idx = -1;\n while (++idx < length) {\n result[idx] = collection[idx];\n }\n return result;\n}\n\n/**\n * returns whether list is empty or not\n */\nfunction isEmpty(array) {\n return !array || !array.length;\n}\n\n/**\n * cluster elements by predicate function.\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n * @param {Array[]}\n */\nfunction clusterBy(array, fn) {\n if (!array.length) { return []; }\n const aTail = tail(array);\n return aTail.reduce(function(memo, v) {\n const aLast = last(memo);\n if (fn(last(aLast), v)) {\n aLast[aLast.length] = v;\n } else {\n memo[memo.length] = [v];\n }\n return memo;\n }, [[head(array)]]);\n}\n\n/**\n * returns a copy of the array with all false values removed\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n */\nfunction compact(array) {\n const aResult = [];\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (array[idx]) { aResult.push(array[idx]); }\n }\n return aResult;\n}\n\n/**\n * produces a duplicate-free version of the array\n *\n * @param {Array} array\n */\nfunction unique(array) {\n const results = [];\n\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!contains(results, array[idx])) {\n results.push(array[idx]);\n }\n }\n\n return results;\n}\n\n/**\n * returns next item.\n * @param {Array} array\n */\nfunction next(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx + 1];\n }\n return null;\n}\n\n/**\n * returns prev item.\n * @param {Array} array\n */\nfunction prev(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx - 1];\n }\n return null;\n}\n\n/**\n * @class core.list\n *\n * list utils\n *\n * @singleton\n * @alternateClassName list\n */\nexport default {\n head,\n last,\n initial,\n tail,\n prev,\n next,\n find,\n contains,\n all,\n sum,\n from,\n isEmpty,\n clusterBy,\n compact,\n unique,\n};\n","import $ from 'jquery';\nimport func from './func';\nimport lists from './lists';\nimport env from './env';\n\nconst NBSP_CHAR = String.fromCharCode(160);\nconst ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n\n/**\n * @method isEditable\n *\n * returns whether node is `note-editable` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEditable(node) {\n return node && $(node).hasClass('note-editable');\n}\n\n/**\n * @method isControlSizing\n *\n * returns whether node is `note-control-sizing` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isControlSizing(node) {\n return node && $(node).hasClass('note-control-sizing');\n}\n\n/**\n * @method makePredByNodeName\n *\n * returns predicate which judge whether nodeName is same\n *\n * @param {String} nodeName\n * @return {Function}\n */\nfunction makePredByNodeName(nodeName) {\n nodeName = nodeName.toUpperCase();\n return function(node) {\n return node && node.nodeName.toUpperCase() === nodeName;\n };\n}\n\n/**\n * @method isText\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is text(3)\n */\nfunction isText(node) {\n return node && node.nodeType === 3;\n}\n\n/**\n * @method isElement\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is element(1)\n */\nfunction isElement(node) {\n return node && node.nodeType === 1;\n}\n\n/**\n * ex) br, col, embed, hr, img, input, ...\n * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n */\nfunction isVoid(node) {\n return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n}\n\nfunction isPara(node) {\n if (isEditable(node)) {\n return false;\n }\n\n // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nfunction isHeading(node) {\n return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nconst isPre = makePredByNodeName('PRE');\n\nconst isLi = makePredByNodeName('LI');\n\nfunction isPurePara(node) {\n return isPara(node) && !isLi(node);\n}\n\nconst isTable = makePredByNodeName('TABLE');\n\nconst isData = makePredByNodeName('DATA');\n\nfunction isInline(node) {\n return !isBodyContainer(node) &&\n !isList(node) &&\n !isHr(node) &&\n !isPara(node) &&\n !isTable(node) &&\n !isBlockquote(node) &&\n !isData(node);\n}\n\nfunction isList(node) {\n return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n}\n\nconst isHr = makePredByNodeName('HR');\n\nfunction isCell(node) {\n return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n}\n\nconst isBlockquote = makePredByNodeName('BLOCKQUOTE');\n\nfunction isBodyContainer(node) {\n return isCell(node) || isBlockquote(node) || isEditable(node);\n}\n\nconst isAnchor = makePredByNodeName('A');\n\nfunction isParaInline(node) {\n return isInline(node) && !!ancestor(node, isPara);\n}\n\nfunction isBodyInline(node) {\n return isInline(node) && !ancestor(node, isPara);\n}\n\nconst isBody = makePredByNodeName('BODY');\n\n/**\n * returns whether nodeB is closest sibling of nodeA\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @return {Boolean}\n */\nfunction isClosestSibling(nodeA, nodeB) {\n return nodeA.nextSibling === nodeB ||\n nodeA.previousSibling === nodeB;\n}\n\n/**\n * returns array of closest siblings with node\n *\n * @param {Node} node\n * @param {function} [pred] - predicate function\n * @return {Node[]}\n */\nfunction withClosestSiblings(node, pred) {\n pred = pred || func.ok;\n\n const siblings = [];\n if (node.previousSibling && pred(node.previousSibling)) {\n siblings.push(node.previousSibling);\n }\n siblings.push(node);\n if (node.nextSibling && pred(node.nextSibling)) {\n siblings.push(node.nextSibling);\n }\n return siblings;\n}\n\n/**\n * blank HTML for cursor position\n * - [workaround] old IE only works with \n * - [workaround] IE11 and other browser works with bogus br\n */\nconst blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '<br>';\n\n/**\n * @method nodeLength\n *\n * returns #text's text size or element's childNodes size\n *\n * @param {Node} node\n */\nfunction nodeLength(node) {\n if (isText(node)) {\n return node.nodeValue.length;\n }\n\n if (node) {\n return node.childNodes.length;\n }\n\n return 0;\n}\n\n/**\n * returns whether deepest child node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction deepestChildIsEmpty(node) {\n do {\n if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;\n } while ((node = node.firstElementChild));\n\n return isEmpty(node);\n}\n\n/**\n * returns whether node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEmpty(node) {\n const len = nodeLength(node);\n\n if (len === 0) {\n return true;\n } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n // ex) <p><br></p>, <span><br></span>\n return true;\n } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n // ex) <p></p>, <span></span>\n return true;\n }\n\n return false;\n}\n\n/**\n * padding blankHTML if node is empty (for cursor position)\n */\nfunction paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}\n\n/**\n * find nearest ancestor predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction ancestor(node, pred) {\n while (node) {\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * find nearest ancestor only single child blood line and predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction singleChildAncestor(node, pred) {\n node = node.parentNode;\n\n while (node) {\n if (nodeLength(node) !== 1) { break; }\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * returns new array of ancestor nodes (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listAncestor(node, pred) {\n pred = pred || func.fail;\n\n const ancestors = [];\n ancestor(node, function(el) {\n if (!isEditable(el)) {\n ancestors.push(el);\n }\n\n return pred(el);\n });\n return ancestors;\n}\n\n/**\n * find farthest ancestor predicate hit\n */\nfunction lastAncestor(node, pred) {\n const ancestors = listAncestor(node);\n return lists.last(ancestors.filter(pred));\n}\n\n/**\n * returns common ancestor node between two nodes.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\nfunction commonAncestor(nodeA, nodeB) {\n const ancestors = listAncestor(nodeA);\n for (let n = nodeB; n; n = n.parentNode) {\n if (ancestors.indexOf(n) > -1) return n;\n }\n return null; // difference document area\n}\n\n/**\n * listing all previous siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listPrev(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.previousSibling;\n }\n return nodes;\n}\n\n/**\n * listing next siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listNext(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.nextSibling;\n }\n return nodes;\n}\n\n/**\n * listing descendant nodes\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listDescendant(node, pred) {\n const descendants = [];\n pred = pred || func.ok;\n\n // start DFS(depth first search) with node\n (function fnWalk(current) {\n if (node !== current && pred(current)) {\n descendants.push(current);\n }\n for (let idx = 0, len = current.childNodes.length; idx < len; idx++) {\n fnWalk(current.childNodes[idx]);\n }\n })(node);\n\n return descendants;\n}\n\n/**\n * wrap node with new tag.\n *\n * @param {Node} node\n * @param {Node} tagName of wrapper\n * @return {Node} - wrapper\n */\nfunction wrap(node, wrapperName) {\n const parent = node.parentNode;\n const wrapper = $('<' + wrapperName + '>')[0];\n\n parent.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n}\n\n/**\n * insert node after preceding\n *\n * @param {Node} node\n * @param {Node} preceding - predicate function\n */\nfunction insertAfter(node, preceding) {\n const next = preceding.nextSibling;\n let parent = preceding.parentNode;\n if (next) {\n parent.insertBefore(node, next);\n } else {\n parent.appendChild(node);\n }\n return node;\n}\n\n/**\n * append elements.\n *\n * @param {Node} node\n * @param {Collection} aChild\n */\nfunction appendChildNodes(node, aChild) {\n $.each(aChild, function(idx, child) {\n node.appendChild(child);\n });\n return node;\n}\n\n/**\n * returns whether boundaryPoint is left edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isLeftEdgePoint(point) {\n return point.offset === 0;\n}\n\n/**\n * returns whether boundaryPoint is right edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isRightEdgePoint(point) {\n return point.offset === nodeLength(point.node);\n}\n\n/**\n * returns whether boundaryPoint is edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isEdgePoint(point) {\n return isLeftEdgePoint(point) || isRightEdgePoint(point);\n}\n\n/**\n * returns whether node is left edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgeOf(node, ancestor) {\n while (node && node !== ancestor) {\n if (position(node) !== 0) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether node is right edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgeOf(node, ancestor) {\n if (!ancestor) {\n return false;\n }\n while (node && node !== ancestor) {\n if (position(node) !== nodeLength(node.parentNode) - 1) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether point is left edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgePointOf(point, ancestor) {\n return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns whether point is right edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgePointOf(point, ancestor) {\n return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns offset from parent.\n *\n * @param {Node} node\n */\nfunction position(node) {\n let offset = 0;\n while ((node = node.previousSibling)) {\n offset += 1;\n }\n return offset;\n}\n\nfunction hasChildren(node) {\n return !!(node && node.childNodes && node.childNodes.length);\n}\n\n/**\n * returns previous boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction prevPoint(point, isSkipInnerOffset) {\n let node;\n let offset;\n\n if (point.offset === 0) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node);\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset - 1];\n offset = nodeLength(node);\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? 0 : point.offset - 1;\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns next boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction nextPoint(point, isSkipInnerOffset) {\n let node, offset;\n\n if (isEmpty(point.node)) {\n return null;\n }\n\n if (nodeLength(point.node) === point.offset) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node) + 1;\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset];\n offset = 0;\n if (isEmpty(node)) {\n return null;\n }\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n\n if (isEmpty(node)) {\n return null;\n }\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns whether pointA and pointB is same or not.\n *\n * @param {BoundaryPoint} pointA\n * @param {BoundaryPoint} pointB\n * @return {Boolean}\n */\nfunction isSamePoint(pointA, pointB) {\n return pointA.node === pointB.node && pointA.offset === pointB.offset;\n}\n\n/**\n * returns whether point is visible (can set cursor) or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isVisiblePoint(point) {\n if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {\n return true;\n }\n\n const leftNode = point.node.childNodes[point.offset - 1];\n const rightNode = point.node.childNodes[point.offset];\n if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @method prevPointUtil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction prevPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = prevPoint(point);\n }\n\n return null;\n}\n\n/**\n * @method nextPointUntil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction nextPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = nextPoint(point);\n }\n\n return null;\n}\n\n/**\n * returns whether point has character or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isCharPoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n}\n\n/**\n * returns whether point has space or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isSpacePoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch === ' ' || ch === NBSP_CHAR;\n}\n\n/**\n * @method walkPoint\n *\n * @param {BoundaryPoint} startPoint\n * @param {BoundaryPoint} endPoint\n * @param {Function} handler\n * @param {Boolean} isSkipInnerOffset\n */\nfunction walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n let point = startPoint;\n\n while (point) {\n handler(point);\n\n if (isSamePoint(point, endPoint)) {\n break;\n }\n\n const isSkipOffset = isSkipInnerOffset &&\n startPoint.node !== point.node &&\n endPoint.node !== point.node;\n point = nextPoint(point, isSkipOffset);\n }\n}\n\n/**\n * @method makeOffsetPath\n *\n * return offsetPath(array of offset) from ancestor\n *\n * @param {Node} ancestor - ancestor node\n * @param {Node} node\n */\nfunction makeOffsetPath(ancestor, node) {\n const ancestors = listAncestor(node, func.eq(ancestor));\n return ancestors.map(position).reverse();\n}\n\n/**\n * @method fromOffsetPath\n *\n * return element from offsetPath(array of offset)\n *\n * @param {Node} ancestor - ancestor node\n * @param {array} offsets - offsetPath\n */\nfunction fromOffsetPath(ancestor, offsets) {\n let current = ancestor;\n for (let i = 0, len = offsets.length; i < len; i++) {\n if (current.childNodes.length <= offsets[i]) {\n current = current.childNodes[current.childNodes.length - 1];\n } else {\n current = current.childNodes[offsets[i]];\n }\n }\n return current;\n}\n\n/**\n * @method splitNode\n *\n * split element or #text\n *\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitNode(point, options) {\n let isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n const isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n const isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n\n if (isDiscardEmptySplits) {\n isSkipPaddingBlankHTML = true;\n }\n\n // edge case\n if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n if (isLeftEdgePoint(point)) {\n return point.node;\n } else if (isRightEdgePoint(point)) {\n return point.node.nextSibling;\n }\n }\n\n // split #text\n if (isText(point.node)) {\n return point.node.splitText(point.offset);\n } else {\n const childNode = point.node.childNodes[point.offset];\n const clone = insertAfter(point.node.cloneNode(false), point.node);\n appendChildNodes(clone, listNext(childNode));\n\n if (!isSkipPaddingBlankHTML) {\n paddingBlankHTML(point.node);\n paddingBlankHTML(clone);\n }\n\n if (isDiscardEmptySplits) {\n if (isEmpty(point.node)) {\n remove(point.node);\n }\n if (isEmpty(clone)) {\n remove(clone);\n return point.node.nextSibling;\n }\n }\n\n return clone;\n }\n}\n\n/**\n * @method splitTree\n *\n * split tree by point\n *\n * @param {Node} root - split root\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitTree(root, point, options) {\n // ex) [#text, <span>, <p>]\n const ancestors = listAncestor(point.node, func.eq(root));\n\n if (!ancestors.length) {\n return null;\n } else if (ancestors.length === 1) {\n return splitNode(point, options);\n }\n\n return ancestors.reduce(function(node, parent) {\n if (node === point.node) {\n node = splitNode(point, options);\n }\n\n return splitNode({\n node: parent,\n offset: node ? position(node) : nodeLength(parent),\n }, options);\n });\n}\n\n/**\n * split point\n *\n * @param {Point} point\n * @param {Boolean} isInline\n * @return {Object}\n */\nfunction splitPoint(point, isInline) {\n // find splitRoot, container\n // - inline: splitRoot is a child of paragraph\n // - block: splitRoot is a child of bodyContainer\n const pred = isInline ? isPara : isBodyContainer;\n const ancestors = listAncestor(point.node, pred);\n const topAncestor = lists.last(ancestors) || point.node;\n\n let splitRoot, container;\n if (pred(topAncestor)) {\n splitRoot = ancestors[ancestors.length - 2];\n container = topAncestor;\n } else {\n splitRoot = topAncestor;\n container = splitRoot.parentNode;\n }\n\n // if splitRoot is exists, split with splitTree\n let pivot = splitRoot && splitTree(splitRoot, point, {\n isSkipPaddingBlankHTML: isInline,\n isNotSplitEdgePoint: isInline,\n });\n\n // if container is point.node, find pivot with point.offset\n if (!pivot && container === point.node) {\n pivot = point.node.childNodes[point.offset];\n }\n\n return {\n rightNode: pivot,\n container: container,\n };\n}\n\nfunction create(nodeName) {\n return document.createElement(nodeName);\n}\n\nfunction createText(text) {\n return document.createTextNode(text);\n}\n\n/**\n * @method remove\n *\n * remove node, (isRemoveChild: remove child or not)\n *\n * @param {Node} node\n * @param {Boolean} isRemoveChild\n */\nfunction remove(node, isRemoveChild) {\n if (!node || !node.parentNode) { return; }\n if (node.removeNode) { return node.removeNode(isRemoveChild); }\n\n const parent = node.parentNode;\n if (!isRemoveChild) {\n const nodes = [];\n for (let i = 0, len = node.childNodes.length; i < len; i++) {\n nodes.push(node.childNodes[i]);\n }\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n parent.insertBefore(nodes[i], node);\n }\n }\n\n parent.removeChild(node);\n}\n\n/**\n * @method removeWhile\n *\n * @param {Node} node\n * @param {Function} pred\n */\nfunction removeWhile(node, pred) {\n while (node) {\n if (isEditable(node) || !pred(node)) {\n break;\n }\n\n const parent = node.parentNode;\n remove(node);\n node = parent;\n }\n}\n\n/**\n * @method replace\n *\n * replace node with provided nodeName\n *\n * @param {Node} node\n * @param {String} nodeName\n * @return {Node} - new node\n */\nfunction replace(node, nodeName) {\n if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n return node;\n }\n\n const newNode = create(nodeName);\n\n if (node.style.cssText) {\n newNode.style.cssText = node.style.cssText;\n }\n\n appendChildNodes(newNode, lists.from(node.childNodes));\n insertAfter(newNode, node);\n remove(node);\n\n return newNode;\n}\n\nconst isTextarea = makePredByNodeName('TEXTAREA');\n\n/**\n * @param {jQuery} $node\n * @param {Boolean} [stripLinebreaks] - default: false\n */\nfunction value($node, stripLinebreaks) {\n const val = isTextarea($node[0]) ? $node.val() : $node.html();\n if (stripLinebreaks) {\n return val.replace(/[\\n\\r]/g, '');\n }\n return val;\n}\n\n/**\n * @method html\n *\n * get the HTML contents of node\n *\n * @param {jQuery} $node\n * @param {Boolean} [isNewlineOnBlock]\n */\nfunction html($node, isNewlineOnBlock) {\n let markup = value($node);\n\n if (isNewlineOnBlock) {\n const regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n markup = markup.replace(regexTag, function(match, endSlash, name) {\n name = name.toUpperCase();\n const isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n !!endSlash;\n const isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n\n return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n });\n markup = markup.trim();\n }\n\n return markup;\n}\n\nfunction posFromPlaceholder(placeholder) {\n const $placeholder = $(placeholder);\n const pos = $placeholder.offset();\n const height = $placeholder.outerHeight(true); // include margin\n\n return {\n left: pos.left,\n top: pos.top + height,\n };\n}\n\nfunction attachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.on(key, events[key]);\n });\n}\n\nfunction detachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.off(key, events[key]);\n });\n}\n\n/**\n * @method isCustomStyleTag\n *\n * assert if a node contains a \"note-styletag\" class,\n * which implies that's a custom-made style tag node\n *\n * @param {Node} an HTML DOM node\n */\nfunction isCustomStyleTag(node) {\n return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n}\n\nexport default {\n /** @property {String} NBSP_CHAR */\n NBSP_CHAR,\n /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n ZERO_WIDTH_NBSP_CHAR,\n /** @property {String} blank */\n blank: blankHTML,\n /** @property {String} emptyPara */\n emptyPara: `<p>${blankHTML}</p>`,\n makePredByNodeName,\n isEditable,\n isControlSizing,\n isText,\n isElement,\n isVoid,\n isPara,\n isPurePara,\n isHeading,\n isInline,\n isBlock: func.not(isInline),\n isBodyInline,\n isBody,\n isParaInline,\n isPre,\n isList,\n isTable,\n isData,\n isCell,\n isBlockquote,\n isBodyContainer,\n isAnchor,\n isDiv: makePredByNodeName('DIV'),\n isLi,\n isBR: makePredByNodeName('BR'),\n isSpan: makePredByNodeName('SPAN'),\n isB: makePredByNodeName('B'),\n isU: makePredByNodeName('U'),\n isS: makePredByNodeName('S'),\n isI: makePredByNodeName('I'),\n isImg: makePredByNodeName('IMG'),\n isTextarea,\n deepestChildIsEmpty,\n isEmpty,\n isEmptyAnchor: func.and(isAnchor, isEmpty),\n isClosestSibling,\n withClosestSiblings,\n nodeLength,\n isLeftEdgePoint,\n isRightEdgePoint,\n isEdgePoint,\n isLeftEdgeOf,\n isRightEdgeOf,\n isLeftEdgePointOf,\n isRightEdgePointOf,\n prevPoint,\n nextPoint,\n isSamePoint,\n isVisiblePoint,\n prevPointUntil,\n nextPointUntil,\n isCharPoint,\n isSpacePoint,\n walkPoint,\n ancestor,\n singleChildAncestor,\n listAncestor,\n lastAncestor,\n listNext,\n listPrev,\n listDescendant,\n commonAncestor,\n wrap,\n insertAfter,\n appendChildNodes,\n position,\n hasChildren,\n makeOffsetPath,\n fromOffsetPath,\n splitTree,\n splitPoint,\n create,\n createText,\n remove,\n removeWhile,\n replace,\n html,\n value,\n posFromPlaceholder,\n attachEvents,\n detachEvents,\n isCustomStyleTag,\n};\n","import $ from 'jquery';\nimport func from './core/func';\nimport lists from './core/lists';\nimport dom from './core/dom';\n\nexport default class Context {\n /**\n * @param {jQuery} $note\n * @param {Object} options\n */\n constructor($note, options) {\n this.$note = $note;\n\n this.memos = {};\n this.modules = {};\n this.layoutInfo = {};\n this.options = $.extend(true, {}, options);\n\n // init ui with options\n $.summernote.ui = $.summernote.ui_template(this.options);\n this.ui = $.summernote.ui;\n\n this.initialize();\n }\n\n /**\n * create layout and initialize modules and other resources\n */\n initialize() {\n this.layoutInfo = this.ui.createLayout(this.$note);\n this._initialize();\n this.$note.hide();\n return this;\n }\n\n /**\n * destroy modules and other resources and remove layout\n */\n destroy() {\n this._destroy();\n this.$note.removeData('summernote');\n this.ui.removeLayout(this.$note, this.layoutInfo);\n }\n\n /**\n * destory modules and other resources and initialize it again\n */\n reset() {\n const disabled = this.isDisabled();\n this.code(dom.emptyPara);\n this._destroy();\n this._initialize();\n\n if (disabled) {\n this.disable();\n }\n }\n\n _initialize() {\n // set own id\n this.options.id = func.uniqueId($.now());\n // set default container for tooltips, popovers, and dialogs\n this.options.container = this.options.container || this.layoutInfo.editor;\n\n // add optional buttons\n const buttons = $.extend({}, this.options.buttons);\n Object.keys(buttons).forEach((key) => {\n this.memo('button.' + key, buttons[key]);\n });\n\n const modules = $.extend({}, this.options.modules, $.summernote.plugins || {});\n\n // add and initialize modules\n Object.keys(modules).forEach((key) => {\n this.module(key, modules[key], true);\n });\n\n Object.keys(this.modules).forEach((key) => {\n this.initializeModule(key);\n });\n }\n\n _destroy() {\n // destroy modules with reversed order\n Object.keys(this.modules).reverse().forEach((key) => {\n this.removeModule(key);\n });\n\n Object.keys(this.memos).forEach((key) => {\n this.removeMemo(key);\n });\n // trigger custom onDestroy callback\n this.triggerEvent('destroy', this);\n }\n\n code(html) {\n const isActivated = this.invoke('codeview.isActivated');\n\n if (html === undefined) {\n this.invoke('codeview.sync');\n return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n } else {\n if (isActivated) {\n this.layoutInfo.codable.val(html);\n } else {\n this.layoutInfo.editable.html(html);\n }\n this.$note.val(html);\n this.triggerEvent('change', html, this.layoutInfo.editable);\n }\n }\n\n isDisabled() {\n return this.layoutInfo.editable.attr('contenteditable') === 'false';\n }\n\n enable() {\n this.layoutInfo.editable.attr('contenteditable', true);\n this.invoke('toolbar.activate', true);\n this.triggerEvent('disable', false);\n this.options.editing = true;\n }\n\n disable() {\n // close codeview if codeview is opend\n if (this.invoke('codeview.isActivated')) {\n this.invoke('codeview.deactivate');\n }\n this.layoutInfo.editable.attr('contenteditable', false);\n this.options.editing = false;\n this.invoke('toolbar.deactivate', true);\n\n this.triggerEvent('disable', true);\n }\n\n triggerEvent() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n if (callback) {\n callback.apply(this.$note[0], args);\n }\n this.$note.trigger('summernote.' + namespace, args);\n }\n\n initializeModule(key) {\n const module = this.modules[key];\n module.shouldInitialize = module.shouldInitialize || func.ok;\n if (!module.shouldInitialize()) {\n return;\n }\n\n // initialize module\n if (module.initialize) {\n module.initialize();\n }\n\n // attach events\n if (module.events) {\n dom.attachEvents(this.$note, module.events);\n }\n }\n\n module(key, ModuleClass, withoutIntialize) {\n if (arguments.length === 1) {\n return this.modules[key];\n }\n\n this.modules[key] = new ModuleClass(this);\n\n if (!withoutIntialize) {\n this.initializeModule(key);\n }\n }\n\n removeModule(key) {\n const module = this.modules[key];\n if (module.shouldInitialize()) {\n if (module.events) {\n dom.detachEvents(this.$note, module.events);\n }\n\n if (module.destroy) {\n module.destroy();\n }\n }\n\n delete this.modules[key];\n }\n\n memo(key, obj) {\n if (arguments.length === 1) {\n return this.memos[key];\n }\n this.memos[key] = obj;\n }\n\n removeMemo(key) {\n if (this.memos[key] && this.memos[key].destroy) {\n this.memos[key].destroy();\n }\n\n delete this.memos[key];\n }\n\n /**\n * Some buttons need to change their visual style immediately once they get pressed\n */\n createInvokeHandlerAndUpdateState(namespace, value) {\n return (event) => {\n this.createInvokeHandler(namespace, value)(event);\n this.invoke('buttons.updateCurrentStyle');\n };\n }\n\n createInvokeHandler(namespace, value) {\n return (event) => {\n event.preventDefault();\n const $target = $(event.target);\n this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n };\n }\n\n invoke() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const splits = namespace.split('.');\n const hasSeparator = splits.length > 1;\n const moduleName = hasSeparator && lists.head(splits);\n const methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n\n const module = this.modules[moduleName || 'editor'];\n if (!moduleName && this[methodName]) {\n return this[methodName].apply(this, args);\n } else if (module && module[methodName] && module.shouldInitialize()) {\n return module[methodName].apply(module, args);\n }\n }\n}\n","import $ from 'jquery';\nimport env from './base/core/env';\nimport lists from './base/core/lists';\nimport Context from './base/Context';\n\n$.fn.extend({\n /**\n * Summernote API\n *\n * @param {Object|String}\n * @return {this}\n */\n summernote: function() {\n const type = $.type(lists.head(arguments));\n const isExternalAPICalled = type === 'string';\n const hasInitOptions = type === 'object';\n\n const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n\n // Update options\n options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);\n options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons);\n options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n\n this.each((idx, note) => {\n const $note = $(note);\n if (!$note.data('summernote')) {\n const context = new Context($note, options);\n $note.data('summernote', context);\n $note.data('summernote').triggerEvent('init', context.layoutInfo);\n }\n });\n\n const $note = this.first();\n if ($note.length) {\n const context = $note.data('summernote');\n if (isExternalAPICalled) {\n return context.invoke.apply(context, lists.from(arguments));\n } else if (options.focus) {\n context.invoke('editor.focus');\n }\n }\n\n return this;\n },\n});\n","import $ from 'jquery';\nimport env from './env';\nimport func from './func';\nimport lists from './lists';\nimport dom from './dom';\n\n/**\n * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n *\n * @param {TextRange} textRange\n * @param {Boolean} isStart\n * @return {BoundaryPoint}\n *\n * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n */\nfunction textRangeToPoint(textRange, isStart) {\n let container = textRange.parentElement();\n let offset;\n\n const tester = document.body.createTextRange();\n let prevContainer;\n const childNodes = lists.from(container.childNodes);\n for (offset = 0; offset < childNodes.length; offset++) {\n if (dom.isText(childNodes[offset])) {\n continue;\n }\n tester.moveToElementText(childNodes[offset]);\n if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n break;\n }\n prevContainer = childNodes[offset];\n }\n\n if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n const textRangeStart = document.body.createTextRange();\n let curTextNode = null;\n textRangeStart.moveToElementText(prevContainer || container);\n textRangeStart.collapse(!prevContainer);\n curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n\n const pointTester = textRange.duplicate();\n pointTester.setEndPoint('StartToStart', textRangeStart);\n let textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n\n while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n // [workaround] enforce IE to re-reference curTextNode, hack\n const dummy = curTextNode.nodeValue; // eslint-disable-line\n\n if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n textCount === curTextNode.nodeValue.length) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n container = curTextNode;\n offset = textCount;\n }\n\n return {\n cont: container,\n offset: offset,\n };\n}\n\n/**\n * return TextRange from boundary point (inspired by google closure-library)\n * @param {BoundaryPoint} point\n * @return {TextRange}\n */\nfunction pointToTextRange(point) {\n const textRangeInfo = function(container, offset) {\n let node, isCollapseToStart;\n\n if (dom.isText(container)) {\n const prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n const prevContainer = lists.last(prevTextNodes).previousSibling;\n node = prevContainer || container.parentNode;\n offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n isCollapseToStart = !prevContainer;\n } else {\n node = container.childNodes[offset] || container;\n if (dom.isText(node)) {\n return textRangeInfo(node, 0);\n }\n\n offset = 0;\n isCollapseToStart = false;\n }\n\n return {\n node: node,\n collapseToStart: isCollapseToStart,\n offset: offset,\n };\n };\n\n const textRange = document.body.createTextRange();\n const info = textRangeInfo(point.node, point.offset);\n\n textRange.moveToElementText(info.node);\n textRange.collapse(info.collapseToStart);\n textRange.moveStart('character', info.offset);\n return textRange;\n}\n\n/**\n * Wrapped Range\n *\n * @constructor\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n */\nclass WrappedRange {\n constructor(sc, so, ec, eo) {\n this.sc = sc;\n this.so = so;\n this.ec = ec;\n this.eo = eo;\n\n // isOnEditable: judge whether range is on editable or not\n this.isOnEditable = this.makeIsOn(dom.isEditable);\n // isOnList: judge whether range is on list node or not\n this.isOnList = this.makeIsOn(dom.isList);\n // isOnAnchor: judge whether range is on anchor node or not\n this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n // isOnCell: judge whether range is on cell node or not\n this.isOnCell = this.makeIsOn(dom.isCell);\n // isOnData: judge whether range is on data node or not\n this.isOnData = this.makeIsOn(dom.isData);\n }\n\n // nativeRange: get nativeRange from sc, so, ec, eo\n nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }\n\n getPoints() {\n return {\n sc: this.sc,\n so: this.so,\n ec: this.ec,\n eo: this.eo,\n };\n }\n\n getStartPoint() {\n return {\n node: this.sc,\n offset: this.so,\n };\n }\n\n getEndPoint() {\n return {\n node: this.ec,\n offset: this.eo,\n };\n }\n\n /**\n * select update visible range\n */\n select() {\n const nativeRng = this.nativeRange();\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (selection.rangeCount > 0) {\n selection.removeAllRanges();\n }\n selection.addRange(nativeRng);\n } else {\n nativeRng.select();\n }\n\n return this;\n }\n\n /**\n * Moves the scrollbar to start container(sc) of current range\n *\n * @return {WrappedRange}\n */\n scrollIntoView(container) {\n const height = $(container).height();\n if (container.scrollTop + height < this.sc.offsetTop) {\n container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n }\n\n return this;\n }\n\n /**\n * @return {WrappedRange}\n */\n normalize() {\n /**\n * @param {BoundaryPoint} point\n * @param {Boolean} isLeftToRight - true: prefer to choose right node\n * - false: prefer to choose left node\n * @return {BoundaryPoint}\n */\n const getVisiblePoint = function(point, isLeftToRight) {\n if (!point) {\n return point;\n }\n\n // Just use the given point [XXX:Adhoc]\n // - case 01. if the point is on the middle of the node\n // - case 02. if the point is on the right edge and prefer to choose left node\n // - case 03. if the point is on the left edge and prefer to choose right node\n // - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n // - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n // - case 06. if the point is on the block node and there is no children\n if (dom.isVisiblePoint(point)) {\n if (!dom.isEdgePoint(point) ||\n (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n return point;\n }\n }\n\n // point on block's edge\n const block = dom.ancestor(point.node, dom.isBlock);\n let hasRightNode = false;\n\n if (!hasRightNode) {\n const prevPoint = dom.prevPoint(point) || { node: null };\n hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;\n }\n\n let hasLeftNode = false;\n if (!hasLeftNode) {\n const nextPoint = dom.nextPoint(point) || { node: null };\n hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(nextPoint.node)) && isLeftToRight;\n }\n\n if (hasRightNode || hasLeftNode) {\n // returns point already on visible point\n if (dom.isVisiblePoint(point)) {\n return point;\n }\n // reverse direction\n isLeftToRight = !isLeftToRight;\n }\n\n const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n return nextPoint || point;\n };\n\n const endPoint = getVisiblePoint(this.getEndPoint(), false);\n const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns matched nodes on range\n *\n * @param {Function} [pred] - predicate function\n * @param {Object} [options]\n * @param {Boolean} [options.includeAncestor]\n * @param {Boolean} [options.fullyContains]\n * @return {Node[]}\n */\n nodes(pred, options) {\n pred = pred || func.ok;\n\n const includeAncestor = options && options.includeAncestor;\n const fullyContains = options && options.fullyContains;\n\n // TODO compare points and sort\n const startPoint = this.getStartPoint();\n const endPoint = this.getEndPoint();\n\n const nodes = [];\n const leftEdgeNodes = [];\n\n dom.walkPoint(startPoint, endPoint, function(point) {\n if (dom.isEditable(point.node)) {\n return;\n }\n\n let node;\n if (fullyContains) {\n if (dom.isLeftEdgePoint(point)) {\n leftEdgeNodes.push(point.node);\n }\n if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n node = point.node;\n }\n } else if (includeAncestor) {\n node = dom.ancestor(point.node, pred);\n } else {\n node = point.node;\n }\n\n if (node && pred(node)) {\n nodes.push(node);\n }\n }, true);\n\n return lists.unique(nodes);\n }\n\n /**\n * returns commonAncestor of range\n * @return {Element} - commonAncestor\n */\n commonAncestor() {\n return dom.commonAncestor(this.sc, this.ec);\n }\n\n /**\n * returns expanded range by pred\n *\n * @param {Function} pred - predicate function\n * @return {WrappedRange}\n */\n expand(pred) {\n const startAncestor = dom.ancestor(this.sc, pred);\n const endAncestor = dom.ancestor(this.ec, pred);\n\n if (!startAncestor && !endAncestor) {\n return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n }\n\n const boundaryPoints = this.getPoints();\n\n if (startAncestor) {\n boundaryPoints.sc = startAncestor;\n boundaryPoints.so = 0;\n }\n\n if (endAncestor) {\n boundaryPoints.ec = endAncestor;\n boundaryPoints.eo = dom.nodeLength(endAncestor);\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * @param {Boolean} isCollapseToStart\n * @return {WrappedRange}\n */\n collapse(isCollapseToStart) {\n if (isCollapseToStart) {\n return new WrappedRange(this.sc, this.so, this.sc, this.so);\n } else {\n return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n }\n }\n\n /**\n * splitText on range\n */\n splitText() {\n const isSameContainer = this.sc === this.ec;\n const boundaryPoints = this.getPoints();\n\n if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n this.ec.splitText(this.eo);\n }\n\n if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n boundaryPoints.sc = this.sc.splitText(this.so);\n boundaryPoints.so = 0;\n\n if (isSameContainer) {\n boundaryPoints.ec = boundaryPoints.sc;\n boundaryPoints.eo = this.eo - this.so;\n }\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * delete contents on range\n * @return {WrappedRange}\n */\n deleteContents() {\n if (this.isCollapsed()) {\n return this;\n }\n\n const rng = this.splitText();\n const nodes = rng.nodes(null, {\n fullyContains: true,\n });\n\n // find new cursor point\n const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {\n return !lists.contains(nodes, point.node);\n });\n\n const emptyParents = [];\n $.each(nodes, function(idx, node) {\n // find empty parents\n const parent = node.parentNode;\n if (point.node !== parent && dom.nodeLength(parent) === 1) {\n emptyParents.push(parent);\n }\n dom.remove(node, false);\n });\n\n // remove empty parents\n $.each(emptyParents, function(idx, node) {\n dom.remove(node, false);\n });\n\n return new WrappedRange(\n point.node,\n point.offset,\n point.node,\n point.offset\n ).normalize();\n }\n\n /**\n * makeIsOn: return isOn(pred) function\n */\n makeIsOn(pred) {\n return function() {\n const ancestor = dom.ancestor(this.sc, pred);\n return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n };\n }\n\n /**\n * @param {Function} pred\n * @return {Boolean}\n */\n isLeftEdgeOf(pred) {\n if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n return false;\n }\n\n const node = dom.ancestor(this.sc, pred);\n return node && dom.isLeftEdgeOf(this.sc, node);\n }\n\n /**\n * returns whether range was collapsed or not\n */\n isCollapsed() {\n return this.sc === this.ec && this.so === this.eo;\n }\n\n /**\n * wrap inline nodes which children of body with paragraph\n *\n * @return {WrappedRange}\n */\n wrapBodyInlineWithPara() {\n if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n this.sc.innerHTML = dom.emptyPara;\n return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n }\n\n /**\n * [workaround] firefox often create range on not visible point. so normalize here.\n * - firefox: |<p>text</p>|\n * - chrome: <p>|text|</p>\n */\n const rng = this.normalize();\n if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n return rng;\n }\n\n // find inline top ancestor\n let topAncestor;\n if (dom.isInline(rng.sc)) {\n const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n topAncestor = lists.last(ancestors);\n if (!dom.isInline(topAncestor)) {\n topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n }\n } else {\n topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n }\n\n if (topAncestor) {\n // siblings not in paragraph\n let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n\n // wrap with paragraph\n if (inlineSiblings.length) {\n const para = dom.wrap(lists.head(inlineSiblings), 'p');\n dom.appendChildNodes(para, lists.tail(inlineSiblings));\n }\n }\n\n return this.normalize();\n }\n\n /**\n * insert node at current cursor\n *\n * @param {Node} node\n * @return {Node}\n */\n insertNode(node) {\n let rng = this;\n\n if (dom.isText(node) || dom.isInline(node)) {\n rng = this.wrapBodyInlineWithPara().deleteContents();\n }\n\n const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n if (info.rightNode) {\n info.rightNode.parentNode.insertBefore(node, info.rightNode);\n } else {\n info.container.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * insert html at current cursor\n */\n pasteHTML(markup) {\n markup = $.trim(markup);\n\n const contentsContainer = $('<div></div>').html(markup)[0];\n let childNodes = lists.from(contentsContainer.childNodes);\n\n // const rng = this.wrapBodyInlineWithPara().deleteContents();\n const rng = this;\n\n if (rng.so >= 0) {\n childNodes = childNodes.reverse();\n }\n childNodes = childNodes.map(function(childNode) {\n return rng.insertNode(childNode);\n });\n if (rng.so > 0) {\n childNodes = childNodes.reverse();\n }\n return childNodes;\n }\n\n /**\n * returns text in range\n *\n * @return {String}\n */\n toString() {\n const nativeRng = this.nativeRange();\n return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n }\n\n /**\n * returns range for word before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordRange(findAfter) {\n let endPoint = this.getEndPoint();\n\n if (!dom.isCharPoint(endPoint)) {\n return this;\n }\n\n const startPoint = dom.prevPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordsRange(findAfter) {\n var endPoint = this.getEndPoint();\n\n var isNotTextPoint = function(point) {\n return !dom.isCharPoint(point) && !dom.isSpacePoint(point);\n };\n\n if (isNotTextPoint(endPoint)) {\n return this;\n }\n\n var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor that match with a Regex\n *\n * example:\n * range: 'hi @Peter Pan'\n * regex: '/@[a-z ]+/i'\n * return range: '@Peter Pan'\n *\n * @param {RegExp} [regex]\n * @return {WrappedRange|null}\n */\n getWordsMatchRange(regex) {\n var endPoint = this.getEndPoint();\n\n var startPoint = dom.prevPointUntil(endPoint, function(point) {\n if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {\n return true;\n }\n var rng = new WrappedRange(\n point.node,\n point.offset,\n endPoint.node,\n endPoint.offset\n );\n var result = regex.exec(rng.toString());\n return result && result.index === 0;\n });\n\n var rng = new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n\n var text = rng.toString();\n var result = regex.exec(text);\n\n if (result && result[0].length === text.length) {\n return rng;\n } else {\n return null;\n }\n }\n\n /**\n * create offsetPath bookmark\n *\n * @param {Node} editable\n */\n bookmark(editable) {\n return {\n s: {\n path: dom.makeOffsetPath(editable, this.sc),\n offset: this.so,\n },\n e: {\n path: dom.makeOffsetPath(editable, this.ec),\n offset: this.eo,\n },\n };\n }\n\n /**\n * create offsetPath bookmark base on paragraph\n *\n * @param {Node[]} paras\n */\n paraBookmark(paras) {\n return {\n s: {\n path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n offset: this.so,\n },\n e: {\n path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n offset: this.eo,\n },\n };\n }\n\n /**\n * getClientRects\n * @return {Rect[]}\n */\n getClientRects() {\n const nativeRng = this.nativeRange();\n return nativeRng.getClientRects();\n }\n}\n\n/**\n * Data structure\n * * BoundaryPoint: a point of dom tree\n * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n *\n * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n */\nexport default {\n /**\n * create Range Object From arguments or Browser Selection\n *\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n * @return {WrappedRange}\n */\n create: function(sc, so, ec, eo) {\n if (arguments.length === 4) {\n return new WrappedRange(sc, so, ec, eo);\n } else if (arguments.length === 2) { // collapsed\n ec = sc;\n eo = so;\n return new WrappedRange(sc, so, ec, eo);\n } else {\n let wrappedRange = this.createFromSelection();\n\n if (!wrappedRange && arguments.length === 1) {\n let bodyElement = arguments[0];\n if (dom.isEditable(bodyElement)) {\n bodyElement = bodyElement.lastChild;\n }\n return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);\n }\n return wrappedRange;\n }\n },\n\n createFromBodyElement: function(bodyElement, isCollapseToStart = false) {\n var wrappedRange = this.createFromNode(bodyElement);\n return wrappedRange.collapse(isCollapseToStart);\n },\n\n createFromSelection: function() {\n let sc, so, ec, eo;\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n } else if (dom.isBody(selection.anchorNode)) {\n // Firefox: returns entire body as range on initialization.\n // We won't never need it.\n return null;\n }\n\n const nativeRng = selection.getRangeAt(0);\n sc = nativeRng.startContainer;\n so = nativeRng.startOffset;\n ec = nativeRng.endContainer;\n eo = nativeRng.endOffset;\n } else { // IE8: TextRange\n const textRange = document.selection.createRange();\n const textRangeEnd = textRange.duplicate();\n textRangeEnd.collapse(false);\n const textRangeStart = textRange;\n textRangeStart.collapse(true);\n\n let startPoint = textRangeToPoint(textRangeStart, true);\n let endPoint = textRangeToPoint(textRangeEnd, false);\n\n // same visible point case: range was collapsed.\n if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n endPoint.node.nextSibling === startPoint.node) {\n startPoint = endPoint;\n }\n\n sc = startPoint.cont;\n so = startPoint.offset;\n ec = endPoint.cont;\n eo = endPoint.offset;\n }\n\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from node\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNode: function(node) {\n let sc = node;\n let so = 0;\n let ec = node;\n let eo = dom.nodeLength(ec);\n\n // browsers can't target a picture or void node\n if (dom.isVoid(sc)) {\n so = dom.listPrev(sc).length - 1;\n sc = sc.parentNode;\n }\n if (dom.isBR(ec)) {\n eo = dom.listPrev(ec).length - 1;\n ec = ec.parentNode;\n } else if (dom.isVoid(ec)) {\n eo = dom.listPrev(ec).length;\n ec = ec.parentNode;\n }\n\n return this.create(sc, so, ec, eo);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeBefore: function(node) {\n return this.createFromNode(node).collapse(true);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeAfter: function(node) {\n return this.createFromNode(node).collapse();\n },\n\n /**\n * @method\n *\n * create WrappedRange from bookmark\n *\n * @param {Node} editable\n * @param {Object} bookmark\n * @return {WrappedRange}\n */\n createFromBookmark: function(editable, bookmark) {\n const sc = dom.fromOffsetPath(editable, bookmark.s.path);\n const so = bookmark.s.offset;\n const ec = dom.fromOffsetPath(editable, bookmark.e.path);\n const eo = bookmark.e.offset;\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from paraBookmark\n *\n * @param {Object} bookmark\n * @param {Node[]} paras\n * @return {WrappedRange}\n */\n createFromParaBookmark: function(bookmark, paras) {\n const so = bookmark.s.offset;\n const eo = bookmark.e.offset;\n const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n\n return new WrappedRange(sc, so, ec, eo);\n },\n};\n","import lists from './lists';\nimport func from './func';\n\nconst KEY_MAP = {\n 'BACKSPACE': 8,\n 'TAB': 9,\n 'ENTER': 13,\n 'SPACE': 32,\n 'DELETE': 46,\n\n // Arrow\n 'LEFT': 37,\n 'UP': 38,\n 'RIGHT': 39,\n 'DOWN': 40,\n\n // Number: 0-9\n 'NUM0': 48,\n 'NUM1': 49,\n 'NUM2': 50,\n 'NUM3': 51,\n 'NUM4': 52,\n 'NUM5': 53,\n 'NUM6': 54,\n 'NUM7': 55,\n 'NUM8': 56,\n\n // Alphabet: a-z\n 'B': 66,\n 'E': 69,\n 'I': 73,\n 'J': 74,\n 'K': 75,\n 'L': 76,\n 'R': 82,\n 'S': 83,\n 'U': 85,\n 'V': 86,\n 'Y': 89,\n 'Z': 90,\n\n 'SLASH': 191,\n 'LEFTBRACKET': 219,\n 'BACKSLASH': 220,\n 'RIGHTBRACKET': 221,\n\n // Navigation\n 'HOME': 36,\n 'END': 35,\n 'PAGEUP': 33,\n 'PAGEDOWN': 34,\n};\n\n/**\n * @class core.key\n *\n * Object for keycodes.\n *\n * @singleton\n * @alternateClassName key\n */\nexport default {\n /**\n * @method isEdit\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isEdit: (keyCode) => {\n return lists.contains([\n KEY_MAP.BACKSPACE,\n KEY_MAP.TAB,\n KEY_MAP.ENTER,\n KEY_MAP.SPACE,\n KEY_MAP.DELETE,\n ], keyCode);\n },\n /**\n * @method isMove\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isMove: (keyCode) => {\n return lists.contains([\n KEY_MAP.LEFT,\n KEY_MAP.UP,\n KEY_MAP.RIGHT,\n KEY_MAP.DOWN,\n ], keyCode);\n },\n /**\n * @method isNavigation\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isNavigation: (keyCode) => {\n return lists.contains([\n KEY_MAP.HOME,\n KEY_MAP.END,\n KEY_MAP.PAGEUP,\n KEY_MAP.PAGEDOWN,\n ], keyCode);\n },\n /**\n * @property {Object} nameFromCode\n * @property {String} nameFromCode.8 \"BACKSPACE\"\n */\n nameFromCode: func.invertObject(KEY_MAP),\n code: KEY_MAP,\n};\n","import $ from 'jquery';\n\n/**\n * @method readFileAsDataURL\n *\n * read contents of file as representing URL\n *\n * @param {File} file\n * @return {Promise} - then: dataUrl\n */\nexport function readFileAsDataURL(file) {\n return $.Deferred((deferred) => {\n $.extend(new FileReader(), {\n onload: (e) => {\n const dataURL = e.target.result;\n deferred.resolve(dataURL);\n },\n onerror: (err) => {\n deferred.reject(err);\n },\n }).readAsDataURL(file);\n }).promise();\n}\n\n/**\n * @method createImage\n *\n * create `<image>` from url string\n *\n * @param {String} url\n * @return {Promise} - then: $image\n */\nexport function createImage(url) {\n return $.Deferred((deferred) => {\n const $img = $('<img>');\n\n $img.one('load', () => {\n $img.off('error abort');\n deferred.resolve($img);\n }).one('error abort', () => {\n $img.off('load').detach();\n deferred.reject($img);\n }).css({\n display: 'none',\n }).appendTo(document.body).attr('src', url);\n }).promise();\n}\n","import range from '../core/range';\n\nexport default class History {\n constructor(context) {\n this.stack = [];\n this.stackOffset = -1;\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n this.editable = this.$editable[0];\n }\n\n makeSnapshot() {\n const rng = range.create(this.editable);\n const emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n\n return {\n contents: this.$editable.html(),\n bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark),\n };\n }\n\n applySnapshot(snapshot) {\n if (snapshot.contents !== null) {\n this.$editable.html(snapshot.contents);\n }\n if (snapshot.bookmark !== null) {\n range.createFromBookmark(this.editable, snapshot.bookmark).select();\n }\n }\n\n /**\n * @method rewind\n * Rewinds the history stack back to the first snapshot taken.\n * Leaves the stack intact, so that \"Redo\" can still be used.\n */\n rewind() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n // Return to the first available snapshot.\n this.stackOffset = 0;\n\n // Apply that snapshot.\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n\n /**\n * @method commit\n * Resets history stack, but keeps current editor's content.\n */\n commit() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * @method reset\n * Resets the history stack completely; reverting to an empty editor.\n */\n reset() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Clear the editable area.\n this.$editable.html('');\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * undo\n */\n undo() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n if (this.stackOffset > 0) {\n this.stackOffset--;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * redo\n */\n redo() {\n if (this.stack.length - 1 > this.stackOffset) {\n this.stackOffset++;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * recorded undo\n */\n recordUndo() {\n this.stackOffset++;\n\n // Wash out stack after stackOffset\n if (this.stack.length > this.stackOffset) {\n this.stack = this.stack.slice(0, this.stackOffset);\n }\n\n // Create new snapshot and push it to the end\n this.stack.push(this.makeSnapshot());\n\n // If the stack size reachs to the limit, then slice it\n if (this.stack.length > this.context.options.historyLimit) {\n this.stack.shift();\n this.stackOffset -= 1;\n }\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class Style {\n /**\n * @method jQueryCSS\n *\n * [workaround] for old jQuery\n * passing an array of style properties to .css()\n * will result in an object of property-value pairs.\n * (compability with version < 1.9)\n *\n * @private\n * @param {jQuery} $obj\n * @param {Array} propertyNames - An array of one or more CSS properties.\n * @return {Object}\n */\n jQueryCSS($obj, propertyNames) {\n if (env.jqueryVersion < 1.9) {\n const result = {};\n $.each(propertyNames, (idx, propertyName) => {\n result[propertyName] = $obj.css(propertyName);\n });\n return result;\n }\n return $obj.css(propertyNames);\n }\n\n /**\n * returns style object from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n fromNode($node) {\n const properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n const styleInfo = this.jQueryCSS($node, properties) || {};\n\n const fontSize = $node[0].style.fontSize || styleInfo['font-size'];\n\n styleInfo['font-size'] = parseInt(fontSize, 10);\n styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);\n\n return styleInfo;\n }\n\n /**\n * paragraph level style\n *\n * @param {WrappedRange} rng\n * @param {Object} styleInfo\n */\n stylePara(rng, styleInfo) {\n $.each(rng.nodes(dom.isPara, {\n includeAncestor: true,\n }), (idx, para) => {\n $(para).css(styleInfo);\n });\n }\n\n /**\n * insert and returns styleNodes on range.\n *\n * @param {WrappedRange} rng\n * @param {Object} [options] - options for styleNodes\n * @param {String} [options.nodeName] - default: `SPAN`\n * @param {Boolean} [options.expandClosestSibling] - default: `false`\n * @param {Boolean} [options.onlyPartialContains] - default: `false`\n * @return {Node[]}\n */\n styleNodes(rng, options) {\n rng = rng.splitText();\n\n const nodeName = (options && options.nodeName) || 'SPAN';\n const expandClosestSibling = !!(options && options.expandClosestSibling);\n const onlyPartialContains = !!(options && options.onlyPartialContains);\n\n if (rng.isCollapsed()) {\n return [rng.insertNode(dom.create(nodeName))];\n }\n\n let pred = dom.makePredByNodeName(nodeName);\n const nodes = rng.nodes(dom.isText, {\n fullyContains: true,\n }).map((text) => {\n return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n });\n\n if (expandClosestSibling) {\n if (onlyPartialContains) {\n const nodesInRange = rng.nodes();\n // compose with partial contains predication\n pred = func.and(pred, (node) => {\n return lists.contains(nodesInRange, node);\n });\n }\n\n return nodes.map((node) => {\n const siblings = dom.withClosestSiblings(node, pred);\n const head = lists.head(siblings);\n const tails = lists.tail(siblings);\n $.each(tails, (idx, elem) => {\n dom.appendChildNodes(head, elem.childNodes);\n dom.remove(elem);\n });\n return lists.head(siblings);\n });\n } else {\n return nodes;\n }\n }\n\n /**\n * get current style on cursor\n *\n * @param {WrappedRange} rng\n * @return {Object} - object contains style properties.\n */\n current(rng) {\n const $cont = $(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n let styleInfo = this.fromNode($cont);\n\n // document.queryCommandState for toggle state\n // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n try {\n styleInfo = $.extend(styleInfo, {\n 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'],\n });\n } catch (e) {\n // eslint-disable-next-line\n }\n\n // list-style-type to list-style(unordered, ordered)\n if (!rng.isOnList()) {\n styleInfo['list-style'] = 'none';\n } else {\n const orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n const isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n }\n\n const para = dom.ancestor(rng.sc, dom.isPara);\n if (para && para.style['line-height']) {\n styleInfo['line-height'] = para.style.lineHeight;\n } else {\n const lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n styleInfo['line-height'] = lineHeight.toFixed(1);\n }\n\n styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n styleInfo.range = rng;\n\n return styleInfo;\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport func from '../core/func';\nimport dom from '../core/dom';\nimport range from '../core/range';\n\nexport default class Bullet {\n /**\n * toggle ordered list\n */\n insertOrderedList(editable) {\n this.toggleList('OL', editable);\n }\n\n /**\n * toggle unordered list\n */\n insertUnorderedList(editable) {\n this.toggleList('UL', editable);\n }\n\n /**\n * indent\n */\n indent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n const previousList = this.findList(head.previousSibling);\n if (previousList) {\n paras\n .map(para => previousList.appendChild(para));\n } else {\n this.wrapList(paras, head.parentNode.nodeName);\n paras\n .map((para) => para.parentNode)\n .map((para) => this.appendToPrevious(para));\n }\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n return (parseInt(val, 10) || 0) + 25;\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * outdent\n */\n outdent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n this.releaseList([paras]);\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n val = (parseInt(val, 10) || 0);\n return val > 25 ? val - 25 : '';\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * toggle list\n *\n * @param {String} listName - OL or UL\n */\n toggleList(listName, editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n let paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const bookmark = rng.paraBookmark(paras);\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n // paragraph to list\n if (lists.find(paras, dom.isPurePara)) {\n let wrappedParas = [];\n $.each(clustereds, (idx, paras) => {\n wrappedParas = wrappedParas.concat(this.wrapList(paras, listName));\n });\n paras = wrappedParas;\n // list to paragraph or change list style\n } else {\n const diffLists = rng.nodes(dom.isList, {\n includeAncestor: true,\n }).filter((listNode) => {\n return !$.nodeName(listNode, listName);\n });\n\n if (diffLists.length) {\n $.each(diffLists, (idx, listNode) => {\n dom.replace(listNode, listName);\n });\n } else {\n paras = this.releaseList(clustereds, true);\n }\n }\n\n range.createFromParaBookmark(bookmark, paras).select();\n }\n\n /**\n * @param {Node[]} paras\n * @param {String} listName\n * @return {Node[]}\n */\n wrapList(paras, listName) {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const prevList = dom.isList(head.previousSibling) && head.previousSibling;\n const nextList = dom.isList(last.nextSibling) && last.nextSibling;\n\n const listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n\n // P to LI\n paras = paras.map((para) => {\n return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n });\n\n // append to list(<ul>, <ol>)\n dom.appendChildNodes(listNode, paras);\n\n if (nextList) {\n dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n dom.remove(nextList);\n }\n\n return paras;\n }\n\n /**\n * @method releaseList\n *\n * @param {Array[]} clustereds\n * @param {Boolean} isEscapseToBody\n * @return {Node[]}\n */\n releaseList(clustereds, isEscapseToBody) {\n let releasedParas = [];\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n const parentItem = headList.parentNode;\n\n if (headList.parentNode.nodeName === 'LI') {\n paras.map(para => {\n const newList = this.findNextSiblings(para);\n\n if (parentItem.nextSibling) {\n parentItem.parentNode.insertBefore(\n para,\n parentItem.nextSibling\n );\n } else {\n parentItem.parentNode.appendChild(para);\n }\n\n if (newList.length) {\n this.wrapList(newList, headList.nodeName);\n para.appendChild(newList[0].parentNode);\n }\n });\n\n if (headList.children.length === 0) {\n parentItem.removeChild(headList);\n }\n\n if (parentItem.childNodes.length === 0) {\n parentItem.parentNode.removeChild(parentItem);\n }\n } else {\n const lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n node: last.parentNode,\n offset: dom.position(last) + 1,\n }, {\n isSkipPaddingBlankHTML: true,\n }) : null;\n\n const middleList = dom.splitTree(headList, {\n node: head.parentNode,\n offset: dom.position(head),\n }, {\n isSkipPaddingBlankHTML: true,\n });\n\n paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n : lists.from(middleList.childNodes).filter(dom.isLi);\n\n // LI to P\n if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n paras = paras.map((para) => {\n return dom.replace(para, 'P');\n });\n }\n\n $.each(lists.from(paras).reverse(), (idx, para) => {\n dom.insertAfter(para, headList);\n });\n\n // remove empty lists\n const rootLists = lists.compact([headList, middleList, lastList]);\n $.each(rootLists, (idx, rootList) => {\n const listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n $.each(listNodes.reverse(), (idx, listNode) => {\n if (!dom.nodeLength(listNode)) {\n dom.remove(listNode, true);\n }\n });\n });\n }\n\n releasedParas = releasedParas.concat(paras);\n });\n\n return releasedParas;\n }\n\n /**\n * @method appendToPrevious\n *\n * Appends list to previous list item, if\n * none exist it wraps the list in a new list item.\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n appendToPrevious(node) {\n return node.previousSibling\n ? dom.appendChildNodes(node.previousSibling, [node])\n : this.wrapList([node], 'LI');\n }\n\n /**\n * @method findList\n *\n * Finds an existing list in list item\n *\n * @param {HTMLNode} ListItem\n * @return {Array[]}\n */\n findList(node) {\n return node\n ? lists.find(node.children, child => ['OL', 'UL'].indexOf(child.nodeName) > -1)\n : null;\n }\n\n /**\n * @method findNextSiblings\n *\n * Finds all list item siblings that follow it\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n findNextSiblings(node) {\n const siblings = [];\n while (node.nextSibling) {\n siblings.push(node.nextSibling);\n node = node.nextSibling;\n }\n return siblings;\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport Bullet from '../editing/Bullet';\n\n/**\n * @class editing.Typing\n *\n * Typing\n *\n */\nexport default class Typing {\n constructor(context) {\n // a Bullet instance to toggle lists off\n this.bullet = new Bullet();\n this.options = context.options;\n }\n\n /**\n * insert tab\n *\n * @param {WrappedRange} rng\n * @param {Number} tabsize\n */\n insertTab(rng, tabsize) {\n const tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n rng = rng.deleteContents();\n rng.insertNode(tab, true);\n\n rng = range.create(tab, tabsize);\n rng.select();\n }\n\n /**\n * insert paragraph\n *\n * @param {jQuery} $editable\n * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n *\n * blockquoteBreakingLevel\n * 0 - No break, the new paragraph remains inside the quote\n * 1 - Break the first blockquote in the ancestors list\n * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n */\n insertParagraph(editable, rng) {\n rng = rng || range.create(editable);\n\n // deleteContents on range.\n rng = rng.deleteContents();\n\n // Wrap range if it needs to be wrapped by paragraph\n rng = rng.wrapBodyInlineWithPara();\n\n // finding paragraph\n const splitRoot = dom.ancestor(rng.sc, dom.isPara);\n\n let nextPara;\n // on paragraph: split paragraph\n if (splitRoot) {\n // if it is an empty line with li\n if (dom.isLi(splitRoot) && (dom.isEmpty(splitRoot) || dom.deepestChildIsEmpty(splitRoot))) {\n // toogle UL/OL and escape\n this.bullet.toggleList(splitRoot.parentNode.nodeName);\n return;\n } else {\n let blockquote = null;\n if (this.options.blockquoteBreakingLevel === 1) {\n blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n } else if (this.options.blockquoteBreakingLevel === 2) {\n blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n }\n\n if (blockquote) {\n // We're inside a blockquote and options ask us to break it\n nextPara = $(dom.emptyPara)[0];\n // If the split is right before a <br>, remove it so that there's no \"empty line\"\n // after the split in the new blockquote created\n if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n $(rng.sc.nextSibling).remove();\n }\n const split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n if (split) {\n split.parentNode.insertBefore(nextPara, split);\n } else {\n dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n }\n } else {\n nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n\n // not a blockquote, just insert the paragraph\n let emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n\n $.each(emptyAnchors, (idx, anchor) => {\n dom.remove(anchor);\n });\n\n // replace empty heading, pre or custom-made styleTag with P tag\n if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n nextPara = dom.replace(nextPara, 'p');\n }\n }\n }\n // no paragraph: insert empty paragraph\n } else {\n const next = rng.sc.childNodes[rng.so];\n nextPara = $(dom.emptyPara)[0];\n if (next) {\n rng.sc.insertBefore(nextPara, next);\n } else {\n rng.sc.appendChild(nextPara);\n }\n }\n\n range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport lists from '../core/lists';\n\n/**\n * @class Create a virtual table to create what actions to do in change.\n * @param {object} startPoint Cell selected to apply change.\n * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where\n * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n * @param {object} domTable Dom element of table to make changes.\n */\nconst TableResultAction = function(startPoint, where, action, domTable) {\n const _startPoint = { 'colPos': 0, 'rowPos': 0 };\n const _virtualTable = [];\n const _actionCellList = [];\n\n /// ///////////////////////////////////////////\n // Private functions\n /// ///////////////////////////////////////////\n\n /**\n * Set the startPoint of action.\n */\n function setStartPoint() {\n if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n // Impossible to identify start Cell point\n return;\n }\n _startPoint.colPos = startPoint.cellIndex;\n if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n // Impossible to identify start Row point\n return;\n }\n _startPoint.rowPos = startPoint.parentElement.rowIndex;\n }\n\n /**\n * Define virtual table position info object.\n *\n * @param {int} rowIndex Index position in line of virtual table.\n * @param {int} cellIndex Index position in column of virtual table.\n * @param {object} baseRow Row affected by this position.\n * @param {object} baseCell Cell affected by this position.\n * @param {bool} isSpan Inform if it is an span cell/row.\n */\n function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n const objPosition = {\n 'baseRow': baseRow,\n 'baseCell': baseCell,\n 'isRowSpan': isRowSpan,\n 'isColSpan': isColSpan,\n 'isVirtual': isVirtualCell,\n };\n if (!_virtualTable[rowIndex]) {\n _virtualTable[rowIndex] = [];\n }\n _virtualTable[rowIndex][cellIndex] = objPosition;\n }\n\n /**\n * Create action cell object.\n *\n * @param {object} virtualTableCellObj Object of specific position on virtual table.\n * @param {enum} resultAction Action to be applied in that item.\n */\n function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n return {\n 'baseCell': virtualTableCellObj.baseCell,\n 'action': resultAction,\n 'virtualTable': {\n 'rowIndex': virtualRowPosition,\n 'cellIndex': virtualColPosition,\n },\n };\n }\n\n /**\n * Recover free index of row to append Cell.\n *\n * @param {int} rowIndex Index of row to find free space.\n * @param {int} cellIndex Index of cell to find free space in table.\n */\n function recoverCellIndex(rowIndex, cellIndex) {\n if (!_virtualTable[rowIndex]) {\n return cellIndex;\n }\n if (!_virtualTable[rowIndex][cellIndex]) {\n return cellIndex;\n }\n\n let newCellIndex = cellIndex;\n while (_virtualTable[rowIndex][newCellIndex]) {\n newCellIndex++;\n if (!_virtualTable[rowIndex][newCellIndex]) {\n return newCellIndex;\n }\n }\n }\n\n /**\n * Recover info about row and cell and add information to virtual table.\n *\n * @param {object} row Row to recover information.\n * @param {object} cell Cell to recover information.\n */\n function addCellInfoToVirtual(row, cell) {\n const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n const cellHasColspan = (cell.colSpan > 1);\n const cellHasRowspan = (cell.rowSpan > 1);\n const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n\n // Add span rows to virtual Table.\n const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n if (rowspanNumber > 1) {\n for (let rp = 1; rp < rowspanNumber; rp++) {\n const rowspanIndex = row.rowIndex + rp;\n adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n }\n }\n\n // Add span cols to virtual table.\n const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n if (colspanNumber > 1) {\n for (let cp = 1; cp < colspanNumber; cp++) {\n const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n }\n }\n }\n\n /**\n * Process validation and adjust of start point if needed\n *\n * @param {int} rowIndex\n * @param {int} cellIndex\n * @param {object} cell\n * @param {bool} isSelectedCell\n */\n function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n _startPoint.colPos++;\n }\n }\n\n /**\n * Create virtual table of cells with all cells, including span cells.\n */\n function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getDeleteResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n case TableResultAction.where.Row:\n if (!cell.isVirtual && cell.isRowSpan) {\n return TableResultAction.resultAction.AddCell;\n } else if (cell.isRowSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n }\n return TableResultAction.resultAction.RemoveCell;\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getAddResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isRowSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n case TableResultAction.where.Row:\n if (cell.isRowSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isColSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n }\n return TableResultAction.resultAction.AddCell;\n }\n\n function init() {\n setStartPoint();\n createVirtualTable();\n }\n\n /// ///////////////////////////////////////////\n // Public functions\n /// ///////////////////////////////////////////\n\n /**\n * Recover array os what to do in table.\n */\n this.getActionList = function() {\n const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n\n let actualPosition = 0;\n let canContinue = true;\n while (canContinue) {\n const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n const row = _virtualTable[rowPosition];\n if (!row) {\n canContinue = false;\n return _actionCellList;\n }\n const cell = row[colPosition];\n if (!cell) {\n canContinue = false;\n return _actionCellList;\n }\n\n // Define action to be applied in this cell\n let resultAction = TableResultAction.resultAction.Ignore;\n switch (action) {\n case TableResultAction.requestAction.Add:\n resultAction = getAddResultActionToCell(cell);\n break;\n case TableResultAction.requestAction.Delete:\n resultAction = getDeleteResultActionToCell(cell);\n break;\n }\n _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n actualPosition++;\n }\n\n return _actionCellList;\n };\n\n init();\n};\n/**\n*\n* Where action occours enum.\n*/\nTableResultAction.where = { 'Row': 0, 'Column': 1 };\n/**\n*\n* Requested action to apply enum.\n*/\nTableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n/**\n*\n* Result action to be executed enum.\n*/\nTableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n\n/**\n *\n * @class editing.Table\n *\n * Table\n *\n */\nexport default class Table {\n /**\n * handle tab key\n *\n * @param {WrappedRange} rng\n * @param {Boolean} isShift\n */\n tab(rng, isShift) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const table = dom.ancestor(cell, dom.isTable);\n const cells = dom.listDescendant(table, dom.isCell);\n\n const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n if (nextCell) {\n range.create(nextCell, 0).select();\n }\n }\n\n /**\n * Add a new row\n *\n * @param {WrappedRange} rng\n * @param {String} position (top/bottom)\n * @return {Node}\n */\n addRow(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n\n const currentTr = $(cell).closest('tr');\n const trAttributes = this.recoverAttributes(currentTr);\n const html = $('<tr' + trAttributes + '></tr>');\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let idCell = 0; idCell < actions.length; idCell++) {\n const currentCell = actions[idCell];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n break;\n case TableResultAction.resultAction.SumSpanCount:\n {\n if (position === 'top') {\n const baseCellTr = currentCell.baseCell.parent;\n const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n if (isTopFromRowSpan) {\n const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n html.append(newTd);\n break;\n }\n }\n let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n rowspanNumber++;\n currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n }\n break;\n }\n }\n\n if (position === 'top') {\n currentTr.before(html);\n } else {\n const cellHasRowspan = (cell.rowSpan > 1);\n if (cellHasRowspan) {\n const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n $($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));\n return;\n }\n currentTr.after(html);\n }\n }\n\n /**\n * Add a new col\n *\n * @param {WrappedRange} rng\n * @param {String} position (left/right)\n * @return {Node}\n */\n addCol(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const rowsGroup = $(row).siblings();\n rowsGroup.push(row);\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Add, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n const currentCell = actions[actionIndex];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n if (position === 'right') {\n $(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n case TableResultAction.resultAction.SumSpanCount:\n if (position === 'right') {\n let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n colspanNumber++;\n currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n }\n }\n }\n\n /*\n * Copy attributes from element.\n *\n * @param {object} Element to recover attributes.\n * @return {string} Copied string elements.\n */\n recoverAttributes(el) {\n let resultStr = '';\n\n if (!el) {\n return resultStr;\n }\n\n const attrList = el.attributes || [];\n\n for (let i = 0; i < attrList.length; i++) {\n if (attrList[i].name.toLowerCase() === 'id') {\n continue;\n }\n\n if (attrList[i].specified) {\n resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n }\n }\n\n return resultStr;\n }\n\n /**\n * Delete current row\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteRow(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n const rowPos = row[0].rowIndex;\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n\n const baseCell = actions[actionIndex].baseCell;\n const virtualPosition = actions[actionIndex].virtualTable;\n const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.AddCell:\n {\n const nextRow = row.next('tr')[0];\n if (!nextRow) { continue; }\n const cloneRow = row[0].cells[cellPos];\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n nextRow.cells[cellPos].innerHTML = '';\n } else if (rowspanNumber === 2) {\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].removeAttribute('rowSpan');\n nextRow.cells[cellPos].innerHTML = '';\n }\n }\n }\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n baseCell.setAttribute('rowSpan', rowspanNumber);\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (rowspanNumber === 2) {\n baseCell.removeAttribute('rowSpan');\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n // Do not need remove cell because row will be deleted.\n continue;\n }\n }\n row.remove();\n }\n\n /**\n * Delete current col\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteCol(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n {\n const baseCell = actions[actionIndex].baseCell;\n const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n if (hasColspan) {\n let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n if (colspanNumber > 2) {\n colspanNumber--;\n baseCell.setAttribute('colSpan', colspanNumber);\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (colspanNumber === 2) {\n baseCell.removeAttribute('colSpan');\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n dom.remove(actions[actionIndex].baseCell, true);\n continue;\n }\n }\n }\n\n /**\n * create empty table element\n *\n * @param {Number} rowCount\n * @param {Number} colCount\n * @return {Node}\n */\n createTable(colCount, rowCount, options) {\n const tds = [];\n let tdHTML;\n for (let idxCol = 0; idxCol < colCount; idxCol++) {\n tds.push('<td>' + dom.blank + '</td>');\n }\n tdHTML = tds.join('');\n\n const trs = [];\n let trHTML;\n for (let idxRow = 0; idxRow < rowCount; idxRow++) {\n trs.push('<tr>' + tdHTML + '</tr>');\n }\n trHTML = trs.join('');\n const $table = $('<table>' + trHTML + '</table>');\n if (options && options.tableClassName) {\n $table.addClass(options.tableClassName);\n }\n\n return $table[0];\n }\n\n /**\n * Delete current table\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteTable(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n $(cell).closest('table').remove();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport { readFileAsDataURL, createImage } from '../core/async';\nimport History from '../editing/History';\nimport Style from '../editing/Style';\nimport Typing from '../editing/Typing';\nimport Table from '../editing/Table';\nimport Bullet from '../editing/Bullet';\n\nconst KEY_BOGUS = 'bogus';\n\n/**\n * @class Editor\n */\nexport default class Editor {\n constructor(context) {\n this.context = context;\n\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.editable = this.$editable[0];\n this.lastRange = null;\n this.snapshot = null;\n\n this.style = new Style();\n this.table = new Table();\n this.typing = new Typing(context);\n this.bullet = new Bullet();\n this.history = new History(context);\n\n this.context.memo('help.undo', this.lang.help.undo);\n this.context.memo('help.redo', this.lang.help.redo);\n this.context.memo('help.tab', this.lang.help.tab);\n this.context.memo('help.untab', this.lang.help.untab);\n this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n this.context.memo('help.indent', this.lang.help.indent);\n this.context.memo('help.outdent', this.lang.help.outdent);\n this.context.memo('help.formatPara', this.lang.help.formatPara);\n this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n this.context.memo('help.fontName', this.lang.help.fontName);\n\n // native commands(with execCommand), generate function for execCommand\n const commands = [\n 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n 'formatBlock', 'removeFormat', 'backColor',\n ];\n\n for (let idx = 0, len = commands.length; idx < len; idx++) {\n this[commands[idx]] = ((sCmd) => {\n return (value) => {\n this.beforeCommand();\n document.execCommand(sCmd, false, value);\n this.afterCommand(true);\n };\n })(commands[idx]);\n this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n }\n\n this.fontName = this.wrapCommand((value) => {\n return this.fontStyling('font-family', env.validFontName(value));\n });\n\n this.fontSize = this.wrapCommand((value) => {\n const unit = this.currentStyle()['font-size-unit'];\n return this.fontStyling('font-size', value + unit);\n });\n\n this.fontSizeUnit = this.wrapCommand((value) => {\n const size = this.currentStyle()['font-size'];\n return this.fontStyling('font-size', size + value);\n });\n\n for (let idx = 1; idx <= 6; idx++) {\n this['formatH' + idx] = ((idx) => {\n return () => {\n this.formatBlock('H' + idx);\n };\n })(idx);\n this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n }\n\n this.insertParagraph = this.wrapCommand(() => {\n this.typing.insertParagraph(this.editable);\n });\n\n this.insertOrderedList = this.wrapCommand(() => {\n this.bullet.insertOrderedList(this.editable);\n });\n\n this.insertUnorderedList = this.wrapCommand(() => {\n this.bullet.insertUnorderedList(this.editable);\n });\n\n this.indent = this.wrapCommand(() => {\n this.bullet.indent(this.editable);\n });\n\n this.outdent = this.wrapCommand(() => {\n this.bullet.outdent(this.editable);\n });\n\n /**\n * insertNode\n * insert node\n * @param {Node} node\n */\n this.insertNode = this.wrapCommand((node) => {\n if (this.isLimited($(node).text().length)) {\n return;\n }\n const rng = this.getLastRange();\n rng.insertNode(node);\n this.setLastRange(range.createFromNodeAfter(node).select());\n });\n\n /**\n * insert text\n * @param {String} text\n */\n this.insertText = this.wrapCommand((text) => {\n if (this.isLimited(text.length)) {\n return;\n }\n const rng = this.getLastRange();\n const textNode = rng.insertNode(dom.createText(text));\n this.setLastRange(range.create(textNode, dom.nodeLength(textNode)).select());\n });\n\n /**\n * paste HTML\n * @param {String} markup\n */\n this.pasteHTML = this.wrapCommand((markup) => {\n if (this.isLimited(markup.length)) {\n return;\n }\n markup = this.context.invoke('codeview.purify', markup);\n const contents = this.getLastRange().pasteHTML(markup);\n this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select());\n });\n\n /**\n * formatBlock\n *\n * @param {String} tagName\n */\n this.formatBlock = this.wrapCommand((tagName, $target) => {\n const onApplyCustomStyle = this.options.callbacks.onApplyCustomStyle;\n if (onApplyCustomStyle) {\n onApplyCustomStyle.call(this, $target, this.context, this.onFormatBlock);\n } else {\n this.onFormatBlock(tagName, $target);\n }\n });\n\n /**\n * insert horizontal rule\n */\n this.insertHorizontalRule = this.wrapCommand(() => {\n const hrNode = this.getLastRange().insertNode(dom.create('HR'));\n if (hrNode.nextSibling) {\n this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());\n }\n });\n\n /**\n * lineHeight\n * @param {String} value\n */\n this.lineHeight = this.wrapCommand((value) => {\n this.style.stylePara(this.getLastRange(), {\n lineHeight: value,\n });\n });\n\n /**\n * create link (command)\n *\n * @param {Object} linkInfo\n */\n this.createLink = this.wrapCommand((linkInfo) => {\n let linkUrl = linkInfo.url;\n const linkText = linkInfo.text;\n const isNewWindow = linkInfo.isNewWindow;\n const checkProtocol = linkInfo.checkProtocol;\n let rng = linkInfo.range || this.getLastRange();\n const additionalTextLength = linkText.length - rng.toString().length;\n if (additionalTextLength > 0 && this.isLimited(additionalTextLength)) {\n return;\n }\n const isTextChanged = rng.toString() !== linkText;\n\n // handle spaced urls from input\n if (typeof linkUrl === 'string') {\n linkUrl = linkUrl.trim();\n }\n\n if (this.options.onCreateLink) {\n linkUrl = this.options.onCreateLink(linkUrl);\n } else if (checkProtocol) {\n // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n ? linkUrl : this.options.defaultProtocol + linkUrl;\n }\n\n let anchors = [];\n if (isTextChanged) {\n rng = rng.deleteContents();\n const anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);\n anchors.push(anchor);\n } else {\n anchors = this.style.styleNodes(rng, {\n nodeName: 'A',\n expandClosestSibling: true,\n onlyPartialContains: true,\n });\n }\n\n $.each(anchors, (idx, anchor) => {\n $(anchor).attr('href', linkUrl);\n if (isNewWindow) {\n $(anchor).attr('target', '_blank');\n } else {\n $(anchor).removeAttr('target');\n }\n });\n\n const startRange = range.createFromNodeBefore(lists.head(anchors));\n const startPoint = startRange.getStartPoint();\n const endRange = range.createFromNodeAfter(lists.last(anchors));\n const endPoint = endRange.getEndPoint();\n\n this.setLastRange(\n range.create(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n ).select()\n );\n });\n\n /**\n * setting color\n *\n * @param {Object} sObjColor color code\n * @param {String} sObjColor.foreColor foreground color\n * @param {String} sObjColor.backColor background color\n */\n this.color = this.wrapCommand((colorInfo) => {\n const foreColor = colorInfo.foreColor;\n const backColor = colorInfo.backColor;\n\n if (foreColor) { document.execCommand('foreColor', false, foreColor); }\n if (backColor) { document.execCommand('backColor', false, backColor); }\n });\n\n /**\n * Set foreground color\n *\n * @param {String} colorCode foreground color code\n */\n this.foreColor = this.wrapCommand((colorInfo) => {\n document.execCommand('foreColor', false, colorInfo);\n });\n\n /**\n * insert Table\n *\n * @param {String} dimension of table (ex : \"5x5\")\n */\n this.insertTable = this.wrapCommand((dim) => {\n const dimension = dim.split('x');\n\n const rng = this.getLastRange().deleteContents();\n rng.insertNode(this.table.createTable(dimension[0], dimension[1], this.options));\n });\n\n /**\n * remove media object and Figure Elements if media object is img with Figure.\n */\n this.removeMedia = this.wrapCommand(() => {\n let $target = $(this.restoreTarget()).parent();\n if ($target.closest('figure').length) {\n $target.closest('figure').remove();\n } else {\n $target = $(this.restoreTarget()).detach();\n }\n this.context.triggerEvent('media.delete', $target, this.$editable);\n });\n\n /**\n * float me\n *\n * @param {String} value\n */\n this.floatMe = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n $target.toggleClass('note-float-left', value === 'left');\n $target.toggleClass('note-float-right', value === 'right');\n $target.css('float', (value === 'none' ? '' : value));\n });\n\n /**\n * resize overlay element\n * @param {String} value\n */\n this.resize = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n value = parseFloat(value);\n if (value === 0) {\n $target.css('width', '');\n } else {\n $target.css({\n width: value * 100 + '%',\n height: '',\n });\n }\n });\n }\n\n initialize() {\n // bind custom events\n this.$editable.on('keydown', (event) => {\n if (event.keyCode === key.code.ENTER) {\n this.context.triggerEvent('enter', event);\n }\n this.context.triggerEvent('keydown', event);\n\n // keep a snapshot to limit text on input event\n this.snapshot = this.history.makeSnapshot();\n this.hasKeyShortCut = false;\n if (!event.isDefaultPrevented()) {\n if (this.options.shortcuts) {\n this.hasKeyShortCut = this.handleKeyMap(event);\n } else {\n this.preventDefaultEditableShortCuts(event);\n }\n }\n if (this.isLimited(1, event)) {\n const lastRange = this.getLastRange();\n if (lastRange.eo - lastRange.so === 0) {\n return false;\n }\n }\n this.setLastRange();\n\n // record undo in the key event except keyMap.\n if (this.options.recordEveryKeystroke) {\n if (this.hasKeyShortCut === false) {\n this.history.recordUndo();\n }\n }\n }).on('keyup', (event) => {\n this.setLastRange();\n this.context.triggerEvent('keyup', event);\n }).on('focus', (event) => {\n this.setLastRange();\n this.context.triggerEvent('focus', event);\n }).on('blur', (event) => {\n this.context.triggerEvent('blur', event);\n }).on('mousedown', (event) => {\n this.context.triggerEvent('mousedown', event);\n }).on('mouseup', (event) => {\n this.setLastRange();\n this.history.recordUndo();\n this.context.triggerEvent('mouseup', event);\n }).on('scroll', (event) => {\n this.context.triggerEvent('scroll', event);\n }).on('paste', (event) => {\n this.setLastRange();\n this.context.triggerEvent('paste', event);\n }).on('input', () => {\n // To limit composition characters (e.g. Korean)\n if (this.isLimited(0) && this.snapshot) {\n this.history.applySnapshot(this.snapshot);\n }\n });\n\n this.$editable.attr('spellcheck', this.options.spellCheck);\n\n this.$editable.attr('autocorrect', this.options.spellCheck);\n\n if (this.options.disableGrammar) {\n this.$editable.attr('data-gramm', false);\n }\n\n // init content before set event\n this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n\n this.$editable.on(env.inputEventName, func.debounce(() => {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }, 10));\n\n this.$editable.on('focusin', (event) => {\n this.context.triggerEvent('focusin', event);\n }).on('focusout', (event) => {\n this.context.triggerEvent('focusout', event);\n });\n\n if (this.options.airMode) {\n if (this.options.overrideContextMenu) {\n this.$editor.on('contextmenu', (event) => {\n this.context.triggerEvent('contextmenu', event);\n return false;\n });\n }\n } else {\n if (this.options.width) {\n this.$editor.outerWidth(this.options.width);\n }\n if (this.options.height) {\n this.$editable.outerHeight(this.options.height);\n }\n if (this.options.maxHeight) {\n this.$editable.css('max-height', this.options.maxHeight);\n }\n if (this.options.minHeight) {\n this.$editable.css('min-height', this.options.minHeight);\n }\n }\n\n this.history.recordUndo();\n this.setLastRange();\n }\n\n destroy() {\n this.$editable.off();\n }\n\n handleKeyMap(event) {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n const keys = [];\n\n if (event.metaKey) { keys.push('CMD'); }\n if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }\n if (event.shiftKey) { keys.push('SHIFT'); }\n\n const keyName = key.nameFromCode[event.keyCode];\n if (keyName) {\n keys.push(keyName);\n }\n\n const eventName = keyMap[keys.join('+')];\n\n if (keyName === 'TAB' && !this.options.tabDisable) {\n this.afterCommand();\n } else if (eventName) {\n if (this.context.invoke(eventName) !== false) {\n event.preventDefault();\n // if keyMap action was invoked\n return true;\n }\n } else if (key.isEdit(event.keyCode)) {\n this.afterCommand();\n }\n return false;\n }\n\n preventDefaultEditableShortCuts(event) {\n // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n if ((event.ctrlKey || event.metaKey) &&\n lists.contains([66, 73, 85], event.keyCode)) {\n event.preventDefault();\n }\n }\n\n isLimited(pad, event) {\n pad = pad || 0;\n\n if (typeof event !== 'undefined') {\n if (key.isMove(event.keyCode) ||\n key.isNavigation(event.keyCode) ||\n (event.ctrlKey || event.metaKey) ||\n lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n return false;\n }\n }\n\n if (this.options.maxTextLength > 0) {\n if ((this.$editable.text().length + pad) > this.options.maxTextLength) {\n return true;\n }\n }\n return false;\n }\n /**\n * create range\n * @return {WrappedRange}\n */\n createRange() {\n this.focus();\n this.setLastRange();\n return this.getLastRange();\n }\n\n setLastRange(rng) {\n if (rng) {\n this.lastRange = rng;\n } else {\n this.lastRange = range.create(this.editable);\n\n if ($(this.lastRange.sc).closest('.note-editable').length === 0) {\n this.lastRange = range.createFromBodyElement(this.editable);\n }\n }\n }\n\n getLastRange() {\n if (!this.lastRange) {\n this.setLastRange();\n }\n return this.lastRange;\n }\n\n /**\n * saveRange\n *\n * save current range\n *\n * @param {Boolean} [thenCollapse=false]\n */\n saveRange(thenCollapse) {\n if (thenCollapse) {\n this.getLastRange().collapse().select();\n }\n }\n\n /**\n * restoreRange\n *\n * restore lately range\n */\n restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }\n\n saveTarget(node) {\n this.$editable.data('target', node);\n }\n\n clearTarget() {\n this.$editable.removeData('target');\n }\n\n restoreTarget() {\n return this.$editable.data('target');\n }\n\n /**\n * currentStyle\n *\n * current style\n * @return {Object|Boolean} unfocus\n */\n currentStyle() {\n let rng = range.create();\n if (rng) {\n rng = rng.normalize();\n }\n return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n }\n\n /**\n * style from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n styleFromNode($node) {\n return this.style.fromNode($node);\n }\n\n /**\n * undo\n */\n undo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.undo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /*\n * commit\n */\n commit() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.commit();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * redo\n */\n redo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.redo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * before command\n */\n beforeCommand() {\n this.context.triggerEvent('before.command', this.$editable.html());\n\n // Set styleWithCSS before run a command\n document.execCommand('styleWithCSS', false, this.options.styleWithCSS);\n\n // keep focus on editable before command execution\n this.focus();\n }\n\n /**\n * after command\n * @param {Boolean} isPreventTrigger\n */\n afterCommand(isPreventTrigger) {\n this.normalizeContent();\n this.history.recordUndo();\n if (!isPreventTrigger) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n }\n\n /**\n * handle tab key\n */\n tab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n\n if (!this.isLimited(this.options.tabSize)) {\n this.beforeCommand();\n this.typing.insertTab(rng, this.options.tabSize);\n this.afterCommand();\n }\n }\n }\n\n /**\n * handle shift+tab key\n */\n untab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng, true);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n }\n }\n\n /**\n * run given function between beforeCommand and afterCommand\n */\n wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }\n\n /**\n * insert image\n *\n * @param {String} src\n * @param {String|Function} param\n * @return {Promise}\n */\n insertImage(src, param) {\n return createImage(src, param).then(($image) => {\n this.beforeCommand();\n\n if (typeof param === 'function') {\n param($image);\n } else {\n if (typeof param === 'string') {\n $image.attr('data-filename', param);\n }\n $image.css('width', Math.min(this.$editable.width(), $image.width()));\n }\n\n $image.show();\n this.getLastRange().insertNode($image[0]);\n this.setLastRange(range.createFromNodeAfter($image[0]).select());\n this.afterCommand();\n }).fail((e) => {\n this.context.triggerEvent('image.upload.error', e);\n });\n }\n\n /**\n * insertImages\n * @param {File[]} files\n */\n insertImagesAsDataURL(files) {\n $.each(files, (idx, file) => {\n const filename = file.name;\n if (this.options.maximumImageFileSize && this.options.maximumImageFileSize < file.size) {\n this.context.triggerEvent('image.upload.error', this.lang.image.maximumFileSizeError);\n } else {\n readFileAsDataURL(file).then((dataURL) => {\n return this.insertImage(dataURL, filename);\n }).fail(() => {\n this.context.triggerEvent('image.upload.error');\n });\n }\n });\n }\n\n /**\n * insertImagesOrCallback\n * @param {File[]} files\n */\n insertImagesOrCallback(files) {\n const callbacks = this.options.callbacks;\n // If onImageUpload set,\n if (callbacks.onImageUpload) {\n this.context.triggerEvent('image.upload', files);\n // else insert Image as dataURL\n } else {\n this.insertImagesAsDataURL(files);\n }\n }\n\n /**\n * return selected plain text\n * @return {String} text\n */\n getSelectedText() {\n let rng = this.getLastRange();\n\n // if range on anchor, expand range with anchor\n if (rng.isOnAnchor()) {\n rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n }\n\n return rng.toString();\n }\n\n onFormatBlock(tagName, $target) {\n // [workaround] for MSIE, IE need `<`\n document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n\n // support custom class\n if ($target && $target.length) {\n // find the exact element has given tagName\n if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n $target = $target.find(tagName);\n }\n\n if ($target && $target.length) {\n const className = $target[0].className || '';\n if (className) {\n const currentRange = this.createRange();\n\n const $parent = $([currentRange.sc, currentRange.ec]).closest(tagName);\n $parent.addClass(className);\n }\n }\n }\n }\n\n formatPara() {\n this.formatBlock('P');\n }\n\n fontStyling(target, value) {\n const rng = this.getLastRange();\n\n if (rng !== '') {\n const spans = this.style.styleNodes(rng);\n this.$editor.find('.note-status-output').html('');\n $(spans).css(target, value);\n\n // [workaround] added styled bogus span for style\n // - also bogus character needed for cursor position\n if (rng.isCollapsed()) {\n const firstSpan = lists.head(spans);\n if (firstSpan && !dom.nodeLength(firstSpan)) {\n firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n range.createFromNodeAfter(firstSpan.firstChild).select();\n this.setLastRange();\n this.$editable.data(KEY_BOGUS, firstSpan);\n }\n }\n } else {\n const noteStatusOutput = $.now();\n this.$editor.find('.note-status-output').html('<div id=\"note-status-output-' + noteStatusOutput + '\" class=\"alert alert-info\">' + this.lang.output.noSelection + '</div>');\n setTimeout(function() { $('#note-status-output-' + noteStatusOutput).remove(); }, 5000);\n }\n }\n\n /**\n * unlink\n *\n * @type command\n */\n unlink() {\n let rng = this.getLastRange();\n if (rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n rng = range.createFromNode(anchor);\n rng.select();\n this.setLastRange();\n\n this.beforeCommand();\n document.execCommand('unlink');\n this.afterCommand();\n }\n }\n\n /**\n * returns link info\n *\n * @return {Object}\n * @return {WrappedRange} return.range\n * @return {String} return.text\n * @return {Boolean} [return.isNewWindow=true]\n * @return {String} [return.url=\"\"]\n */\n getLinkInfo() {\n const rng = this.getLastRange().expand(dom.isAnchor);\n // Get the first anchor on range(for edit).\n const $anchor = $(lists.head(rng.nodes(dom.isAnchor)));\n const linkInfo = {\n range: rng,\n text: rng.toString(),\n url: $anchor.length ? $anchor.attr('href') : '',\n };\n\n // When anchor exists,\n if ($anchor.length) {\n // Set isNewWindow by checking its target.\n linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n }\n\n return linkInfo;\n }\n\n addRow(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addRow(rng, position);\n this.afterCommand();\n }\n }\n\n addCol(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addCol(rng, position);\n this.afterCommand();\n }\n }\n\n deleteRow() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteRow(rng);\n this.afterCommand();\n }\n }\n\n deleteCol() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteCol(rng);\n this.afterCommand();\n }\n }\n\n deleteTable() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteTable(rng);\n this.afterCommand();\n }\n }\n\n /**\n * @param {Position} pos\n * @param {jQuery} $target - target element\n * @param {Boolean} [bKeepRatio] - keep ratio\n */\n resizeTo(pos, $target, bKeepRatio) {\n let imageSize;\n if (bKeepRatio) {\n const newRatio = pos.y / pos.x;\n const ratio = $target.data('ratio');\n imageSize = {\n width: ratio > newRatio ? pos.x : pos.y / ratio,\n height: ratio > newRatio ? pos.x * ratio : pos.y,\n };\n } else {\n imageSize = {\n width: pos.x,\n height: pos.y,\n };\n }\n\n $target.css(imageSize);\n }\n\n /**\n * returns whether editable area has focus or not.\n */\n hasFocus() {\n return this.$editable.is(':focus');\n }\n\n /**\n * set focus\n */\n focus() {\n // [workaround] Screen will move when page is scolled in IE.\n // - do focus when not focused\n if (!this.hasFocus()) {\n this.$editable.focus();\n }\n }\n\n /**\n * returns whether contents is empty or not.\n * @return {Boolean}\n */\n isEmpty() {\n return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n }\n\n /**\n * Removes all contents and restores the editable instance to an _emptyPara_.\n */\n empty() {\n this.context.invoke('code', dom.emptyPara);\n }\n\n /**\n * normalize content\n */\n normalizeContent() {\n this.$editable[0].normalize();\n }\n}\n","import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n this.$editable.on('paste', this.pasteByEvent.bind(this));\n }\n\n /**\n * paste by clipboard event\n *\n * @param {Event} event\n */\n pasteByEvent(event) {\n const clipboardData = event.originalEvent.clipboardData;\n\n if (clipboardData && clipboardData.items && clipboardData.items.length) {\n const item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n // paste img file\n this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n event.preventDefault();\n } else if (item.kind === 'string') {\n // paste text with maxTextLength check\n if (this.context.invoke('editor.isLimited', clipboardData.getData('Text').length)) {\n event.preventDefault();\n }\n }\n } else if (window.clipboardData) {\n // for IE\n let text = window.clipboardData.getData('text');\n if (this.context.invoke('editor.isLimited', text.length)) {\n event.preventDefault();\n }\n }\n // Call editor.afterCommand after proceeding default event handler\n setTimeout(() => {\n this.context.invoke('editor.afterCommand');\n }, 10);\n }\n}\n","import $ from 'jquery';\n\nexport default class Dropzone {\n constructor(context) {\n this.context = context;\n this.$eventListener = $(document);\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.documentEventHandlers = {};\n\n this.$dropzone = $([\n '<div class=\"note-dropzone\">',\n '<div class=\"note-dropzone-message\"/>',\n '</div>',\n ].join('')).prependTo(this.$editor);\n }\n\n /**\n * attach Drag and Drop Events\n */\n initialize() {\n if (this.options.disableDragAndDrop) {\n // prevent default drop event\n this.documentEventHandlers.onDrop = (e) => {\n e.preventDefault();\n };\n // do not consider outside of dropzone\n this.$eventListener = this.$dropzone;\n this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n } else {\n this.attachDragAndDropEvent();\n }\n }\n\n /**\n * attach Drag and Drop Events\n */\n attachDragAndDropEvent() {\n let collection = $();\n const $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n\n this.documentEventHandlers.onDragenter = (e) => {\n const isCodeview = this.context.invoke('codeview.isActivated');\n const hasEditorSize = this.$editor.width() > 0 && this.$editor.height() > 0;\n if (!isCodeview && !collection.length && hasEditorSize) {\n this.$editor.addClass('dragover');\n this.$dropzone.width(this.$editor.width());\n this.$dropzone.height(this.$editor.height());\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n }\n collection = collection.add(e.target);\n };\n\n this.documentEventHandlers.onDragleave = (e) => {\n collection = collection.not(e.target);\n\n // If nodeName is BODY, then just make it over (fix for IE)\n if (!collection.length || e.target.nodeName === 'BODY') {\n collection = $();\n this.$editor.removeClass('dragover');\n }\n };\n\n this.documentEventHandlers.onDrop = () => {\n collection = $();\n this.$editor.removeClass('dragover');\n };\n\n // show dropzone on dragenter when dragging a object to document\n // -but only if the editor is visible, i.e. has a positive width and height\n this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n .on('dragleave', this.documentEventHandlers.onDragleave)\n .on('drop', this.documentEventHandlers.onDrop);\n\n // change dropzone's message on hover.\n this.$dropzone.on('dragenter', () => {\n this.$dropzone.addClass('hover');\n $dropzoneMessage.text(this.lang.image.dropImage);\n }).on('dragleave', () => {\n this.$dropzone.removeClass('hover');\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n });\n\n // attach dropImage\n this.$dropzone.on('drop', (event) => {\n const dataTransfer = event.originalEvent.dataTransfer;\n\n // stop the browser from opening the dropped content\n event.preventDefault();\n\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n this.$editable.focus();\n this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n } else {\n $.each(dataTransfer.types, (idx, type) => {\n // skip moz-specific types\n if (type.toLowerCase().indexOf('_moz_') > -1) {\n return;\n }\n const content = dataTransfer.getData(type);\n\n if (type.toLowerCase().indexOf('text') > -1) {\n this.context.invoke('editor.pasteHTML', content);\n } else {\n $(content).each((idx, item) => {\n this.context.invoke('editor.insertNode', item);\n });\n }\n });\n }\n }).on('dragover', false); // prevent default dragover event\n }\n\n destroy() {\n Object.keys(this.documentEventHandlers).forEach((key) => {\n this.$eventListener.off(key.substr(2).toLowerCase(), this.documentEventHandlers[key]);\n });\n this.documentEventHandlers = {};\n }\n}\n","import env from '../core/env';\nimport dom from '../core/dom';\n\nlet CodeMirror;\nif (env.hasCodeMirror) {\n CodeMirror = window.CodeMirror;\n}\n\n/**\n * @class Codeview\n */\nexport default class CodeView {\n constructor(context) {\n this.context = context;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n this.options = context.options;\n }\n\n sync() {\n const isCodeview = this.isActivated();\n if (isCodeview && env.hasCodeMirror) {\n this.$codable.data('cmEditor').save();\n }\n }\n\n /**\n * @return {Boolean}\n */\n isActivated() {\n return this.$editor.hasClass('codeview');\n }\n\n /**\n * toggle codeview\n */\n toggle() {\n if (this.isActivated()) {\n this.deactivate();\n } else {\n this.activate();\n }\n this.context.triggerEvent('codeview.toggled');\n }\n\n /**\n * purify input value\n * @param value\n * @returns {*}\n */\n purify(value) {\n if (this.options.codeviewFilter) {\n // filter code view regex\n value = value.replace(this.options.codeviewFilterRegex, '');\n // allow specific iframe tag\n if (this.options.codeviewIframeFilter) {\n const whitelist = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function(tag) {\n // remove if src attribute is duplicated\n if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n return '';\n }\n for (const src of whitelist) {\n // pass if src is trusted\n if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n return tag;\n }\n }\n return '';\n });\n }\n }\n return value;\n }\n\n /**\n * activate code view\n */\n activate() {\n this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n this.$codable.height(this.$editable.height());\n\n this.context.invoke('toolbar.updateCodeview', true);\n this.$editor.addClass('codeview');\n this.$codable.focus();\n\n // activate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n\n // CodeMirror TernServer\n if (this.options.codemirror.tern) {\n const server = new CodeMirror.TernServer(this.options.codemirror.tern);\n cmEditor.ternServer = server;\n cmEditor.on('cursorActivity', (cm) => {\n server.updateArgHints(cm);\n });\n }\n\n cmEditor.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', cmEditor.getValue(), event);\n });\n cmEditor.on('change', () => {\n this.context.triggerEvent('change.codeview', cmEditor.getValue(), cmEditor);\n });\n\n // CodeMirror hasn't Padding.\n cmEditor.setSize(null, this.$editable.outerHeight());\n this.$codable.data('cmEditor', cmEditor);\n } else {\n this.$codable.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', this.$codable.val(), event);\n });\n this.$codable.on('input', () => {\n this.context.triggerEvent('change.codeview', this.$codable.val(), this.$codable);\n });\n }\n }\n\n /**\n * deactivate code view\n */\n deactivate() {\n // deactivate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = this.$codable.data('cmEditor');\n this.$codable.val(cmEditor.getValue());\n cmEditor.toTextArea();\n }\n\n const value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n const isChange = this.$editable.html() !== value;\n\n this.$editable.html(value);\n this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n this.$editor.removeClass('codeview');\n\n if (isChange) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n this.$editable.focus();\n\n this.context.invoke('toolbar.updateCodeview', false);\n }\n\n destroy() {\n if (this.isActivated()) {\n this.deactivate();\n }\n }\n}\n","import $ from 'jquery';\nconst EDITABLE_PADDING = 24;\n\nexport default class Statusbar {\n constructor(context) {\n this.$document = $(document);\n this.$statusbar = context.layoutInfo.statusbar;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n }\n\n initialize() {\n if (this.options.airMode || this.options.disableResizeEditor) {\n this.destroy();\n return;\n }\n\n this.$statusbar.on('mousedown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const editableTop = this.$editable.offset().top - this.$document.scrollTop();\n const onMouseMove = (event) => {\n let height = event.clientY - (editableTop + EDITABLE_PADDING);\n\n height = (this.options.minheight > 0) ? Math.max(height, this.options.minheight) : height;\n height = (this.options.maxHeight > 0) ? Math.min(height, this.options.maxHeight) : height;\n\n this.$editable.height(height);\n };\n\n this.$document.on('mousemove', onMouseMove).one('mouseup', () => {\n this.$document.off('mousemove', onMouseMove);\n });\n });\n }\n\n destroy() {\n this.$statusbar.off();\n this.$statusbar.addClass('locked');\n }\n}\n","import $ from 'jquery';\n\nexport default class Fullscreen {\n constructor(context) {\n this.context = context;\n\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n\n this.$window = $(window);\n this.$scrollbar = $('html, body');\n\n this.onResize = () => {\n this.resizeTo({\n h: this.$window.height() - this.$toolbar.outerHeight(),\n });\n };\n }\n\n resizeTo(size) {\n this.$editable.css('height', size.h);\n this.$codable.css('height', size.h);\n if (this.$codable.data('cmeditor')) {\n this.$codable.data('cmeditor').setsize(null, size.h);\n }\n }\n\n /**\n * toggle fullscreen\n */\n toggle() {\n this.$editor.toggleClass('fullscreen');\n if (this.isFullscreen()) {\n this.$editable.data('orgHeight', this.$editable.css('height'));\n this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n this.$editable.css('maxHeight', '');\n this.$window.on('resize', this.onResize).trigger('resize');\n this.$scrollbar.css('overflow', 'hidden');\n } else {\n this.$window.off('resize', this.onResize);\n this.resizeTo({ h: this.$editable.data('orgHeight') });\n this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n this.$scrollbar.css('overflow', 'visible');\n }\n\n this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n }\n\n isFullscreen() {\n return this.$editor.hasClass('fullscreen');\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\n\nexport default class Handle {\n constructor(context) {\n this.context = context;\n this.$document = $(document);\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.events = {\n 'summernote.mousedown': (we, e) => {\n if (this.update(e.target, e)) {\n e.preventDefault();\n }\n },\n 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n initialize() {\n this.$handle = $([\n '<div class=\"note-handle\">',\n '<div class=\"note-control-selection\">',\n '<div class=\"note-control-selection-bg\"></div>',\n '<div class=\"note-control-holder note-control-nw\"></div>',\n '<div class=\"note-control-holder note-control-ne\"></div>',\n '<div class=\"note-control-holder note-control-sw\"></div>',\n '<div class=\"',\n (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n ' note-control-se\"></div>',\n (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n '</div>',\n '</div>',\n ].join('')).prependTo(this.$editingArea);\n\n this.$handle.on('mousedown', (event) => {\n if (dom.isControlSizing(event.target)) {\n event.preventDefault();\n event.stopPropagation();\n\n const $target = this.$handle.find('.note-control-selection').data('target');\n const posStart = $target.offset();\n const scrollTop = this.$document.scrollTop();\n\n const onMouseMove = (event) => {\n this.context.invoke('editor.resizeTo', {\n x: event.clientX - posStart.left,\n y: event.clientY - (posStart.top - scrollTop),\n }, $target, !event.shiftKey);\n\n this.update($target[0], event);\n };\n\n this.$document\n .on('mousemove', onMouseMove)\n .one('mouseup', (e) => {\n e.preventDefault();\n this.$document.off('mousemove', onMouseMove);\n this.context.invoke('editor.afterCommand');\n });\n\n if (!$target.data('ratio')) { // original ratio.\n $target.data('ratio', $target.height() / $target.width());\n }\n }\n });\n\n // Listen for scrolling on the handle overlay.\n this.$handle.on('wheel', (e) => {\n e.preventDefault();\n this.update();\n });\n }\n\n destroy() {\n this.$handle.remove();\n }\n\n update(target, event) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isImage = dom.isImg(target);\n const $selection = this.$handle.find('.note-control-selection');\n\n this.context.invoke('imagePopover.update', target, event);\n\n if (isImage) {\n const $image = $(target);\n const position = $image.position();\n const pos = {\n left: position.left + parseInt($image.css('marginLeft'), 10),\n top: position.top + parseInt($image.css('marginTop'), 10),\n };\n\n // exclude margin\n const imageSize = {\n w: $image.outerWidth(false),\n h: $image.outerHeight(false),\n };\n\n $selection.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n width: imageSize.w,\n height: imageSize.h,\n }).data('target', $image); // save current image element.\n\n const origImageObj = new Image();\n origImageObj.src = $image.attr('src');\n\n const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n $selection.find('.note-control-selection-info').text(sizingText);\n this.context.invoke('editor.saveTarget', target);\n } else {\n this.hide();\n }\n\n return isImage;\n }\n\n /**\n * hide\n *\n * @param {jQuery} $handle\n */\n hide() {\n this.context.invoke('editor.clearTarget');\n this.$handle.children().hide();\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport key from '../core/key';\n\nconst defaultScheme = 'http://';\nconst linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n\nexport default class AutoLink {\n constructor(context) {\n this.context = context;\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n initialize() {\n this.lastWordRange = null;\n }\n\n destroy() {\n this.lastWordRange = null;\n }\n\n replace() {\n if (!this.lastWordRange) {\n return;\n }\n\n const keyword = this.lastWordRange.toString();\n const match = keyword.match(linkPattern);\n\n if (match && (match[1] || match[2])) {\n const link = match[1] ? keyword : defaultScheme + keyword;\n const urlText = keyword.replace(/^(?:https?:\\/\\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\\.)?/i, '').split('/')[0];\n const node = $('<a />').html(urlText).attr('href', link)[0];\n if (this.context.options.linkTargetBlank) {\n $(node).attr('target', '_blank');\n }\n\n this.lastWordRange.insertNode(node);\n this.lastWordRange = null;\n this.context.invoke('editor.focus');\n }\n }\n\n handleKeydown(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWordRange = wordRange;\n }\n }\n\n handleKeyup(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n this.replace();\n }\n }\n}\n","import dom from '../core/dom';\n\n/**\n * textarea auto sync.\n */\nexport default class AutoSync {\n constructor(context) {\n this.$note = context.layoutInfo.note;\n this.events = {\n 'summernote.change': () => {\n this.$note.val(context.invoke('code'));\n },\n };\n }\n\n shouldInitialize() {\n return dom.isTextarea(this.$note[0]);\n }\n}\n","import lists from '../core/lists';\nimport dom from '../core/dom';\nimport key from '../core/key';\n\nexport default class AutoReplace {\n constructor(context) {\n this.context = context;\n this.options = context.options.replace || {};\n\n this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n this.previousKeydownCode = null;\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.match;\n }\n\n initialize() {\n this.lastWord = null;\n }\n\n destroy() {\n this.lastWord = null;\n }\n\n replace() {\n if (!this.lastWord) {\n return;\n }\n\n const self = this;\n const keyword = this.lastWord.toString();\n this.options.match(keyword, function(match) {\n if (match) {\n let node = '';\n\n if (typeof match === 'string') {\n node = dom.createText(match);\n } else if (match instanceof jQuery) {\n node = match[0];\n } else if (match instanceof Node) {\n node = match;\n }\n\n if (!node) return;\n self.lastWord.insertNode(node);\n self.lastWord = null;\n self.context.invoke('editor.focus');\n }\n });\n }\n\n handleKeydown(e) {\n // this forces it to remember the last whole word, even if multiple termination keys are pressed\n // before the previous key is let go.\n if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n this.previousKeydownCode = e.keyCode;\n return;\n }\n\n if (lists.contains(this.keys, e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWord = wordRange;\n }\n this.previousKeydownCode = e.keyCode;\n }\n\n handleKeyup(e) {\n if (lists.contains(this.keys, e.keyCode)) {\n this.replace();\n }\n }\n}\n","import $ from 'jquery';\nexport default class Placeholder {\n constructor(context) {\n this.context = context;\n\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n\n if (this.options.inheritPlaceholder === true) {\n // get placeholder value from the original element\n this.options.placeholder = this.context.$note.attr('placeholder') || this.options.placeholder;\n }\n\n this.events = {\n 'summernote.init summernote.change': () => {\n this.update();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.placeholder;\n }\n\n initialize() {\n this.$placeholder = $('<div class=\"note-placeholder\">');\n this.$placeholder.on('click', () => {\n this.context.invoke('focus');\n }).html(this.options.placeholder).prependTo(this.$editingArea);\n\n this.update();\n }\n\n destroy() {\n this.$placeholder.remove();\n }\n\n update() {\n const isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n this.$placeholder.toggle(isShow);\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport env from '../core/env';\n\nexport default class Buttons {\n constructor(context) {\n this.ui = $.summernote.ui;\n this.context = context;\n this.$toolbar = context.layoutInfo.toolbar;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.invertedKeyMap = func.invertObject(\n this.options.keyMap[env.isMac ? 'mac' : 'pc']\n );\n }\n\n representShortcut(editorMethod) {\n let shortcut = this.invertedKeyMap[editorMethod];\n if (!this.options.shortcuts || !shortcut) {\n return '';\n }\n\n if (env.isMac) {\n shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n }\n\n shortcut = shortcut.replace('BACKSLASH', '\\\\')\n .replace('SLASH', '/')\n .replace('LEFTBRACKET', '[')\n .replace('RIGHTBRACKET', ']');\n\n return ' (' + shortcut + ')';\n }\n\n button(o) {\n if (!this.options.tooltip && o.tooltip) {\n delete o.tooltip;\n }\n o.container = this.options.container;\n return this.ui.button(o);\n }\n\n initialize() {\n this.addToolbarButtons();\n this.addImagePopoverButtons();\n this.addLinkPopoverButtons();\n this.addTablePopoverButtons();\n this.fontInstalledMap = {};\n }\n\n destroy() {\n delete this.fontInstalledMap;\n }\n\n isFontInstalled(name) {\n if (!Object.prototype.hasOwnProperty.call(this.fontInstalledMap, name)) {\n this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n lists.contains(this.options.fontNamesIgnoreCheck, name);\n }\n return this.fontInstalledMap[name];\n }\n\n isFontDeservedToAdd(name) {\n name = name.toLowerCase();\n return (name !== '' && this.isFontInstalled(name) && env.genericFontFamilies.indexOf(name) === -1);\n }\n\n colorPalette(className, tooltip, backColor, foreColor) {\n return this.ui.buttonGroup({\n className: 'note-color ' + className,\n children: [\n this.button({\n className: 'note-current-color-button',\n contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n tooltip: tooltip,\n click: (e) => {\n const $button = $(e.currentTarget);\n if (backColor && foreColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n foreColor: $button.attr('data-foreColor'),\n });\n } else if (backColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n });\n } else if (foreColor) {\n this.context.invoke('editor.color', {\n foreColor: $button.attr('data-foreColor'),\n });\n }\n },\n callback: ($button) => {\n const $recentColor = $button.find('.note-recent-color');\n if (backColor) {\n $recentColor.css('background-color', this.options.colorButton.backColor);\n $button.attr('data-backColor', this.options.colorButton.backColor);\n }\n if (foreColor) {\n $recentColor.css('color', this.options.colorButton.foreColor);\n $button.attr('data-foreColor', this.options.colorButton.foreColor);\n } else {\n $recentColor.css('color', 'transparent');\n }\n },\n }),\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('', this.options),\n tooltip: this.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n items: (backColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n this.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n '</div>',\n '<div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n '</div>',\n ].join('') : '') +\n (foreColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n this.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n '</div>', // Fix missing Div, Commented to find easily if it's wrong\n '<div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n '</div>',\n ].join('') : ''),\n callback: ($dropdown) => {\n $dropdown.find('.note-holder').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: this.options.colors,\n colorsName: this.options.colorsName,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n /* TODO: do we have to record recent custom colors within cookies? */\n var customColors = [\n ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n ];\n $dropdown.find('.note-holder-custom').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: customColors,\n colorsName: customColors,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n $dropdown.find('input[type=color]').each((idx, item) => {\n $(item).change(function() {\n const $chip = $dropdown.find('#' + $(this).data('event')).find('.note-color-btn').first();\n const color = this.value.toUpperCase();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $chip.click();\n });\n });\n },\n click: (event) => {\n event.stopPropagation();\n\n const $parent = $('.' + className).find('.note-dropdown-menu');\n const $button = $(event.target);\n const eventName = $button.data('event');\n const value = $button.attr('data-value');\n\n if (eventName === 'openPalette') {\n const $picker = $parent.find('#' + value);\n const $palette = $($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n\n // Shift palette chips\n const $chip = $palette.find('.note-color-btn').last().detach();\n\n // Set chip attributes\n const color = $picker.val();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $palette.prepend($chip);\n $picker.click();\n } else {\n if (lists.contains(['backColor', 'foreColor'], eventName)) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n }\n this.context.invoke('editor.' + eventName, value);\n }\n },\n }),\n ],\n }).render();\n }\n\n addToolbarButtons() {\n this.context.memo('button.style', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n this.ui.icon(this.options.icons.magic), this.options\n ),\n tooltip: this.lang.style.style,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n className: 'dropdown-style',\n items: this.options.styleTags,\n title: this.lang.style.style,\n template: (item) => {\n // TBD: need to be simplified\n if (typeof item === 'string') {\n item = {\n tag: item,\n title: (Object.prototype.hasOwnProperty.call(this.lang.style, item) ? this.lang.style[item] : item),\n };\n }\n\n const tag = item.tag;\n const title = item.title;\n const style = item.style ? ' style=\"' + item.style + '\" ' : '';\n const className = item.className ? ' class=\"' + item.className + '\"' : '';\n\n return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n },\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }),\n ]).render();\n });\n\n for (let styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n const item = this.options.styleTags[styleIdx];\n\n this.context.memo('button.style.' + item, () => {\n return this.button({\n className: 'note-btn-style-' + item,\n contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n tooltip: this.lang.style[item],\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }).render();\n });\n }\n\n this.context.memo('button.bold', () => {\n return this.button({\n className: 'note-btn-bold',\n contents: this.ui.icon(this.options.icons.bold),\n tooltip: this.lang.font.bold + this.representShortcut('bold'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.bold'),\n }).render();\n });\n\n this.context.memo('button.italic', () => {\n return this.button({\n className: 'note-btn-italic',\n contents: this.ui.icon(this.options.icons.italic),\n tooltip: this.lang.font.italic + this.representShortcut('italic'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.italic'),\n }).render();\n });\n\n this.context.memo('button.underline', () => {\n return this.button({\n className: 'note-btn-underline',\n contents: this.ui.icon(this.options.icons.underline),\n tooltip: this.lang.font.underline + this.representShortcut('underline'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.underline'),\n }).render();\n });\n\n this.context.memo('button.clear', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.eraser),\n tooltip: this.lang.font.clear + this.representShortcut('removeFormat'),\n click: this.context.createInvokeHandler('editor.removeFormat'),\n }).render();\n });\n\n this.context.memo('button.strikethrough', () => {\n return this.button({\n className: 'note-btn-strikethrough',\n contents: this.ui.icon(this.options.icons.strikethrough),\n tooltip: this.lang.font.strikethrough + this.representShortcut('strikethrough'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.strikethrough'),\n }).render();\n });\n\n this.context.memo('button.superscript', () => {\n return this.button({\n className: 'note-btn-superscript',\n contents: this.ui.icon(this.options.icons.superscript),\n tooltip: this.lang.font.superscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.superscript'),\n }).render();\n });\n\n this.context.memo('button.subscript', () => {\n return this.button({\n className: 'note-btn-subscript',\n contents: this.ui.icon(this.options.icons.subscript),\n tooltip: this.lang.font.subscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.subscript'),\n }).render();\n });\n\n this.context.memo('button.fontname', () => {\n const styleInfo = this.context.invoke('editor.currentStyle');\n\n if (this.options.addDefaultFonts) {\n // Add 'default' fonts into the fontnames array if not exist\n $.each(styleInfo['font-family'].split(','), (idx, fontname) => {\n fontname = fontname.trim().replace(/['\"]+/g, '');\n if (this.isFontDeservedToAdd(fontname)) {\n if (this.options.fontNames.indexOf(fontname) === -1) {\n this.options.fontNames.push(fontname);\n }\n }\n });\n }\n\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n '<span class=\"note-current-fontname\"/>', this.options\n ),\n tooltip: this.lang.font.name,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontname',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontNames.filter(this.isFontInstalled.bind(this)),\n title: this.lang.font.name,\n template: (item) => {\n return '<span style=\"font-family: ' + env.validFontName(item) + '\">' + item + '</span>';\n },\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontName'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsize', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', this.options),\n tooltip: this.lang.font.size,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsize',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizes,\n title: this.lang.font.size,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSize'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsizeunit', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsizeunit\"/>', this.options),\n tooltip: this.lang.font.sizeunit,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsizeunit',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizeUnits,\n title: this.lang.font.sizeunit,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSizeUnit'),\n }),\n ]).render();\n });\n\n this.context.memo('button.color', () => {\n return this.colorPalette('note-color-all', this.lang.color.recent, true, true);\n });\n\n this.context.memo('button.forecolor', () => {\n return this.colorPalette('note-color-fore', this.lang.color.foreground, false, true);\n });\n\n this.context.memo('button.backcolor', () => {\n return this.colorPalette('note-color-back', this.lang.color.background, true, false);\n });\n\n this.context.memo('button.ul', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unorderedlist),\n tooltip: this.lang.lists.unordered + this.representShortcut('insertUnorderedList'),\n click: this.context.createInvokeHandler('editor.insertUnorderedList'),\n }).render();\n });\n\n this.context.memo('button.ol', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.orderedlist),\n tooltip: this.lang.lists.ordered + this.representShortcut('insertOrderedList'),\n click: this.context.createInvokeHandler('editor.insertOrderedList'),\n }).render();\n });\n\n const justifyLeft = this.button({\n contents: this.ui.icon(this.options.icons.alignLeft),\n tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n click: this.context.createInvokeHandler('editor.justifyLeft'),\n });\n\n const justifyCenter = this.button({\n contents: this.ui.icon(this.options.icons.alignCenter),\n tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n click: this.context.createInvokeHandler('editor.justifyCenter'),\n });\n\n const justifyRight = this.button({\n contents: this.ui.icon(this.options.icons.alignRight),\n tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n click: this.context.createInvokeHandler('editor.justifyRight'),\n });\n\n const justifyFull = this.button({\n contents: this.ui.icon(this.options.icons.alignJustify),\n tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n click: this.context.createInvokeHandler('editor.justifyFull'),\n });\n\n const outdent = this.button({\n contents: this.ui.icon(this.options.icons.outdent),\n tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n click: this.context.createInvokeHandler('editor.outdent'),\n });\n\n const indent = this.button({\n contents: this.ui.icon(this.options.icons.indent),\n tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n click: this.context.createInvokeHandler('editor.indent'),\n });\n\n this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n this.context.memo('button.indent', func.invoke(indent, 'render'));\n\n this.context.memo('button.paragraph', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft), this.options),\n tooltip: this.lang.paragraph.paragraph,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown([\n this.ui.buttonGroup({\n className: 'note-align',\n children: [justifyLeft, justifyCenter, justifyRight, justifyFull],\n }),\n this.ui.buttonGroup({\n className: 'note-list',\n children: [outdent, indent],\n }),\n ]),\n ]).render();\n });\n\n this.context.memo('button.height', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight), this.options),\n tooltip: this.lang.font.height,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n items: this.options.lineHeights,\n checkClassName: this.options.icons.menuCheck,\n className: 'dropdown-line-height',\n title: this.lang.font.height,\n click: this.context.createInvokeHandler('editor.lineHeight'),\n }),\n ]).render();\n });\n\n this.context.memo('button.table', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table), this.options),\n tooltip: this.lang.table.table,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n title: this.lang.table.table,\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: ($node) => {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: this.options.insertTableMaxSize.col + 'em',\n height: this.options.insertTableMaxSize.row + 'em',\n }).mousedown(this.context.createInvokeHandler('editor.insertTable'))\n .on('mousemove', this.tableMoveHandler.bind(this));\n },\n }).render();\n });\n\n this.context.memo('button.link', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.link + this.representShortcut('linkDialog.show'),\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.picture', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.picture),\n tooltip: this.lang.image.image,\n click: this.context.createInvokeHandler('imageDialog.show'),\n }).render();\n });\n\n this.context.memo('button.video', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.video),\n tooltip: this.lang.video.video,\n click: this.context.createInvokeHandler('videoDialog.show'),\n }).render();\n });\n\n this.context.memo('button.hr', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.minus),\n tooltip: this.lang.hr.insert + this.representShortcut('insertHorizontalRule'),\n click: this.context.createInvokeHandler('editor.insertHorizontalRule'),\n }).render();\n });\n\n this.context.memo('button.fullscreen', () => {\n return this.button({\n className: 'btn-fullscreen',\n contents: this.ui.icon(this.options.icons.arrowsAlt),\n tooltip: this.lang.options.fullscreen,\n click: this.context.createInvokeHandler('fullscreen.toggle'),\n }).render();\n });\n\n this.context.memo('button.codeview', () => {\n return this.button({\n className: 'btn-codeview',\n contents: this.ui.icon(this.options.icons.code),\n tooltip: this.lang.options.codeview,\n click: this.context.createInvokeHandler('codeview.toggle'),\n }).render();\n });\n\n this.context.memo('button.redo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.redo),\n tooltip: this.lang.history.redo + this.representShortcut('redo'),\n click: this.context.createInvokeHandler('editor.redo'),\n }).render();\n });\n\n this.context.memo('button.undo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.undo),\n tooltip: this.lang.history.undo + this.representShortcut('undo'),\n click: this.context.createInvokeHandler('editor.undo'),\n }).render();\n });\n\n this.context.memo('button.help', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.question),\n tooltip: this.lang.options.help,\n click: this.context.createInvokeHandler('helpDialog.show'),\n }).render();\n });\n }\n\n /**\n * image: [\n * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n * ['float', ['floatLeft', 'floatRight', 'floatNone']],\n * ['remove', ['removeMedia']],\n * ],\n */\n addImagePopoverButtons() {\n // Image Size Buttons\n this.context.memo('button.resizeFull', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">100%</span>',\n tooltip: this.lang.image.resizeFull,\n click: this.context.createInvokeHandler('editor.resize', '1'),\n }).render();\n });\n this.context.memo('button.resizeHalf', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">50%</span>',\n tooltip: this.lang.image.resizeHalf,\n click: this.context.createInvokeHandler('editor.resize', '0.5'),\n }).render();\n });\n this.context.memo('button.resizeQuarter', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">25%</span>',\n tooltip: this.lang.image.resizeQuarter,\n click: this.context.createInvokeHandler('editor.resize', '0.25'),\n }).render();\n });\n this.context.memo('button.resizeNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.resizeNone,\n click: this.context.createInvokeHandler('editor.resize', '0'),\n }).render();\n });\n\n // Float Buttons\n this.context.memo('button.floatLeft', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatLeft),\n tooltip: this.lang.image.floatLeft,\n click: this.context.createInvokeHandler('editor.floatMe', 'left'),\n }).render();\n });\n\n this.context.memo('button.floatRight', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatRight),\n tooltip: this.lang.image.floatRight,\n click: this.context.createInvokeHandler('editor.floatMe', 'right'),\n }).render();\n });\n\n this.context.memo('button.floatNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.floatNone,\n click: this.context.createInvokeHandler('editor.floatMe', 'none'),\n }).render();\n });\n\n // Remove Buttons\n this.context.memo('button.removeMedia', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.image.remove,\n click: this.context.createInvokeHandler('editor.removeMedia'),\n }).render();\n });\n }\n\n addLinkPopoverButtons() {\n this.context.memo('button.linkDialogShow', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.edit,\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.unlink', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unlink),\n tooltip: this.lang.link.unlink,\n click: this.context.createInvokeHandler('editor.unlink'),\n }).render();\n });\n }\n\n /**\n * table : [\n * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n * ],\n */\n addTablePopoverButtons() {\n this.context.memo('button.addRowUp', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowAbove),\n tooltip: this.lang.table.addRowAbove,\n click: this.context.createInvokeHandler('editor.addRow', 'top'),\n }).render();\n });\n this.context.memo('button.addRowDown', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowBelow),\n tooltip: this.lang.table.addRowBelow,\n click: this.context.createInvokeHandler('editor.addRow', 'bottom'),\n }).render();\n });\n this.context.memo('button.addColLeft', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colBefore),\n tooltip: this.lang.table.addColLeft,\n click: this.context.createInvokeHandler('editor.addCol', 'left'),\n }).render();\n });\n this.context.memo('button.addColRight', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colAfter),\n tooltip: this.lang.table.addColRight,\n click: this.context.createInvokeHandler('editor.addCol', 'right'),\n }).render();\n });\n this.context.memo('button.deleteRow', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowRemove),\n tooltip: this.lang.table.delRow,\n click: this.context.createInvokeHandler('editor.deleteRow'),\n }).render();\n });\n this.context.memo('button.deleteCol', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colRemove),\n tooltip: this.lang.table.delCol,\n click: this.context.createInvokeHandler('editor.deleteCol'),\n }).render();\n });\n this.context.memo('button.deleteTable', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.table.delTable,\n click: this.context.createInvokeHandler('editor.deleteTable'),\n }).render();\n });\n }\n\n build($container, groups) {\n for (let groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n const group = groups[groupIdx];\n const groupName = Array.isArray(group) ? group[0] : group;\n const buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n\n const $group = this.ui.buttonGroup({\n className: 'note-' + groupName,\n }).render();\n\n for (let idx = 0, len = buttons.length; idx < len; idx++) {\n const btn = this.context.memo('button.' + buttons[idx]);\n if (btn) {\n $group.append(typeof btn === 'function' ? btn(this.context) : btn);\n }\n }\n $group.appendTo($container);\n }\n }\n\n /**\n * @param {jQuery} [$container]\n */\n updateCurrentStyle($container) {\n const $cont = $container || this.$toolbar;\n\n const styleInfo = this.context.invoke('editor.currentStyle');\n this.updateBtnStates($cont, {\n '.note-btn-bold': () => {\n return styleInfo['font-bold'] === 'bold';\n },\n '.note-btn-italic': () => {\n return styleInfo['font-italic'] === 'italic';\n },\n '.note-btn-underline': () => {\n return styleInfo['font-underline'] === 'underline';\n },\n '.note-btn-subscript': () => {\n return styleInfo['font-subscript'] === 'subscript';\n },\n '.note-btn-superscript': () => {\n return styleInfo['font-superscript'] === 'superscript';\n },\n '.note-btn-strikethrough': () => {\n return styleInfo['font-strikethrough'] === 'strikethrough';\n },\n });\n\n if (styleInfo['font-family']) {\n const fontNames = styleInfo['font-family'].split(',').map((name) => {\n return name.replace(/[\\'\\\"]/g, '')\n .replace(/\\s+$/, '')\n .replace(/^\\s+/, '');\n });\n const fontName = lists.find(fontNames, this.isFontInstalled.bind(this));\n\n $cont.find('.dropdown-fontname a').each((idx, item) => {\n const $item = $(item);\n // always compare string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontName + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontname').text(fontName).css('font-family', fontName);\n }\n\n if (styleInfo['font-size']) {\n const fontSize = styleInfo['font-size'];\n $cont.find('.dropdown-fontsize a').each((idx, item) => {\n const $item = $(item);\n // always compare with string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontSize + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsize').text(fontSize);\n\n const fontSizeUnit = styleInfo['font-size-unit'];\n $cont.find('.dropdown-fontsizeunit a').each((idx, item) => {\n const $item = $(item);\n const isChecked = ($item.data('value') + '') === (fontSizeUnit + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsizeunit').text(fontSizeUnit);\n }\n\n if (styleInfo['line-height']) {\n const lineHeight = styleInfo['line-height'];\n $cont.find('.dropdown-line-height li a').each((idx, item) => {\n // always compare with string to avoid creating another func.\n const isChecked = ($(item).data('value') + '') === (lineHeight + '');\n this.className = isChecked ? 'checked' : '';\n });\n }\n }\n\n updateBtnStates($container, infos) {\n $.each(infos, (selector, pred) => {\n this.ui.toggleBtnActive($container.find(selector), pred());\n });\n }\n\n tableMoveHandler(event) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n }\n}\n","import $ from 'jquery';\nexport default class Toolbar {\n constructor(context) {\n this.context = context;\n\n this.$window = $(window);\n this.$document = $(document);\n\n this.ui = $.summernote.ui;\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$statusbar = context.layoutInfo.statusbar;\n this.options = context.options;\n\n this.isFollowing = false;\n this.followScroll = this.followScroll.bind(this);\n }\n\n shouldInitialize() {\n return !this.options.airMode;\n }\n\n initialize() {\n this.options.toolbar = this.options.toolbar || [];\n\n if (!this.options.toolbar.length) {\n this.$toolbar.hide();\n } else {\n this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n }\n\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n\n this.changeContainer(false);\n\n this.$note.on('summernote.keyup summernote.mouseup summernote.change', () => {\n this.context.invoke('buttons.updateCurrentStyle');\n });\n\n this.context.invoke('buttons.updateCurrentStyle');\n if (this.options.followingToolbar) {\n this.$window.on('scroll resize', this.followScroll);\n }\n }\n\n destroy() {\n this.$toolbar.children().remove();\n\n if (this.options.followingToolbar) {\n this.$window.off('scroll resize', this.followScroll);\n }\n }\n\n followScroll() {\n if (this.$editor.hasClass('fullscreen')) {\n return false;\n }\n\n const editorHeight = this.$editor.outerHeight();\n const editorWidth = this.$editor.width();\n const toolbarHeight = this.$toolbar.height();\n const statusbarHeight = this.$statusbar.height();\n\n // check if the web app is currently using another static bar\n let otherBarHeight = 0;\n if (this.options.otherStaticBar) {\n otherBarHeight = $(this.options.otherStaticBar).outerHeight();\n }\n\n const currentOffset = this.$document.scrollTop();\n const editorOffsetTop = this.$editor.offset().top;\n const editorOffsetBottom = editorOffsetTop + editorHeight;\n const activateOffset = editorOffsetTop - otherBarHeight;\n const deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n\n if (!this.isFollowing &&\n (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n this.isFollowing = true;\n this.$editable.css({\n marginTop: this.$toolbar.outerHeight(),\n });\n this.$toolbar.css({\n position: 'fixed',\n top: otherBarHeight,\n width: editorWidth,\n zIndex: 1000,\n });\n } else if (this.isFollowing &&\n ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n this.isFollowing = false;\n this.$toolbar.css({\n position: 'relative',\n top: 0,\n width: '100%',\n zIndex: 'auto',\n });\n this.$editable.css({\n marginTop: '',\n });\n }\n }\n\n changeContainer(isFullscreen) {\n if (isFullscreen) {\n this.$toolbar.prependTo(this.$editor);\n } else {\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n }\n if (this.options.followingToolbar) {\n this.followScroll();\n }\n }\n\n updateFullscreen(isFullscreen) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n\n this.changeContainer(isFullscreen);\n }\n\n updateCodeview(isCodeview) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n if (isCodeview) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n activate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, true);\n }\n\n deactivate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, false);\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\n\nexport default class LinkDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-txt-${this.options.id}\" class=\"note-form-label\">${this.lang.link.textToDisplay}</label>`,\n `<input id=\"note-dialog-link-txt-${this.options.id}\" class=\"note-link-text form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-url-${this.options.id}\" class=\"note-form-label\">${this.lang.link.url}</label>`,\n `<input id=\"note-dialog-link-url-${this.options.id}\" class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\"/>`,\n '</div>',\n !this.options.disableLinkTarget\n ? $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-open-in-new-window',\n text: this.lang.link.openInNewWindow,\n checked: true,\n }).render()).html()\n : '',\n $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-use-protocol',\n text: this.lang.link.useProtocol,\n checked: true,\n }).render()).html(),\n ].join('');\n\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.link.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n className: 'link-dialog',\n title: this.lang.link.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n /**\n * toggle update button\n */\n toggleLinkBtn($linkBtn, $linkText, $linkUrl) {\n this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n }\n\n /**\n * Show link dialog and set event handlers on dialog controls.\n *\n * @param {Object} linkInfo\n * @return {Promise}\n */\n showLinkDialog(linkInfo) {\n return $.Deferred((deferred) => {\n const $linkText = this.$dialog.find('.note-link-text');\n const $linkUrl = this.$dialog.find('.note-link-url');\n const $linkBtn = this.$dialog.find('.note-link-btn');\n const $openInNewWindow = this.$dialog\n .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n const $useProtocol = this.$dialog\n .find('.sn-checkbox-use-protocol input[type=checkbox]');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // If no url was given and given text is valid URL then copy that into URL Field\n if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n linkInfo.url = linkInfo.text;\n }\n\n $linkText.on('input paste propertychange', () => {\n // If linktext was modified by input events,\n // cloning text from linkUrl will be stopped.\n linkInfo.text = $linkText.val();\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.text);\n\n $linkUrl.on('input paste propertychange', () => {\n // Display same text on `Text to display` as default\n // when linktext has no text\n if (!linkInfo.text) {\n $linkText.val($linkUrl.val());\n }\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.url);\n\n if (!env.isSupportTouch) {\n $linkUrl.trigger('focus');\n }\n\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n this.bindEnterKey($linkUrl, $linkBtn);\n this.bindEnterKey($linkText, $linkBtn);\n\n const isNewWindowChecked = linkInfo.isNewWindow !== undefined\n ? linkInfo.isNewWindow : this.context.options.linkTargetBlank;\n\n $openInNewWindow.prop('checked', isNewWindowChecked);\n\n const useProtocolChecked = linkInfo.url\n ? false : this.context.options.useProtocol;\n\n $useProtocol.prop('checked', useProtocolChecked);\n\n $linkBtn.one('click', (event) => {\n event.preventDefault();\n\n deferred.resolve({\n range: linkInfo.range,\n url: $linkUrl.val(),\n text: $linkText.val(),\n isNewWindow: $openInNewWindow.is(':checked'),\n checkProtocol: $useProtocol.is(':checked'),\n });\n this.ui.hideDialog(this.$dialog);\n });\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n // detach events\n $linkText.off();\n $linkUrl.off();\n $linkBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n /**\n * @param {Object} layoutInfo\n */\n show() {\n const linkInfo = this.context.invoke('editor.getLinkInfo');\n\n this.context.invoke('editor.saveRange');\n this.showLinkDialog(linkInfo).then((linkInfo) => {\n this.context.invoke('editor.restoreRange');\n this.context.invoke('editor.createLink', linkInfo);\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class LinkPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': () => {\n this.update();\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.link);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-link-popover',\n callback: ($node) => {\n const $content = $node.find('.popover-content,.note-popover-content');\n $content.prepend('<span><a target=\"_blank\"></a> </span>');\n },\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.link);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update() {\n // Prevent focusing on editable when invoke('code') is executed\n if (!this.context.invoke('editor.hasFocus')) {\n this.hide();\n return;\n }\n\n const rng = this.context.invoke('editor.getLastRange');\n if (rng.isCollapsed() && rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n const href = $(anchor).attr('href');\n this.$popover.find('a').attr('href', href).text(href);\n\n const pos = dom.posFromPlaceholder(anchor);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class ImageDialog {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n let imageLimitation = '';\n if (this.options.maximumImageFileSize) {\n const unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n const readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n ' ' + ' KMGTP'[unit] + 'B';\n imageLimitation = `<small>${this.lang.image.maximumFileSize + ' : ' + readableSize}</small>`;\n }\n\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group note-group-select-from-files\">',\n '<label for=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n '<input id=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-image-input form-control-file note-form-control note-input\" ',\n ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>',\n imageLimitation,\n '</div>',\n '<div class=\"form-group note-group-image-url\">',\n '<label for=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.url + '</label>',\n '<input id=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-image-url form-control note-form-control note-input\" type=\"text\"/>',\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.image.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.image.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showImageDialog().then((data) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n if (typeof data === 'string') { // image url\n // If onImageLinkInsert set,\n if (this.options.callbacks.onImageLinkInsert) {\n this.context.triggerEvent('image.link.insert', data);\n } else {\n this.context.invoke('editor.insertImage', data);\n }\n } else { // array of files\n this.context.invoke('editor.insertImagesOrCallback', data);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show image dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showImageDialog() {\n return $.Deferred((deferred) => {\n const $imageInput = this.$dialog.find('.note-image-input');\n const $imageUrl = this.$dialog.find('.note-image-url');\n const $imageBtn = this.$dialog.find('.note-image-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // Cloning imageInput to clear element.\n $imageInput.replaceWith($imageInput.clone().on('change', (event) => {\n deferred.resolve(event.target.files || event.target.value);\n }).val(''));\n\n $imageUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($imageBtn, $imageUrl.val());\n }).val('');\n\n if (!env.isSupportTouch) {\n $imageUrl.trigger('focus');\n }\n\n $imageBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($imageUrl.val());\n });\n\n this.bindEnterKey($imageUrl, $imageBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $imageInput.off();\n $imageUrl.off();\n $imageBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\n/**\n * Image popover module\n * mouse events that show/hide popover will be handled by Handle.js.\n * Handle.js will receive the events and invoke 'imagePopover.update'.\n */\nexport default class ImagePopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n\n this.editable = context.layoutInfo.editable[0];\n this.options = context.options;\n\n this.events = {\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.image);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-image-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n this.context.invoke('buttons.build', $content, this.options.popover.image);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target, event) {\n if (dom.isImg(target)) {\n const position = $(target).offset();\n const containerOffset = $(this.options.container).offset();\n let pos = {};\n if (this.options.popatmouse) {\n pos.left = event.pageX - 20;\n pos.top = event.pageY;\n } else {\n pos = position;\n }\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class TablePopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.mousedown': (we, e) => {\n this.update(e.target);\n },\n 'summernote.keyup summernote.scroll summernote.change': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.table);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-table-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.table);\n\n // [workaround] Disable Firefox's default table editor\n if (env.isFF) {\n document.execCommand('enableInlineTableEditing', false, false);\n }\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isCell = dom.isCell(target);\n\n if (isCell) {\n const pos = dom.posFromPlaceholder(target);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n\n return isCell;\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class VideoDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group row-fluid\">',\n `<label for=\"note-dialog-video-url-${this.options.id}\" class=\"note-form-label\">${this.lang.video.url} <small class=\"text-muted\">${this.lang.video.providers}</small></label>`,\n `<input id=\"note-dialog-video-url-${this.options.id}\" class=\"note-video-url form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.video.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.video.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n createVideoNode(url) {\n // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n const ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n const ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n const ytMatch = url.match(ytRegExp);\n\n const igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n const igMatch = url.match(igRegExp);\n\n const vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n const vMatch = url.match(vRegExp);\n\n const vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n const vimMatch = url.match(vimRegExp);\n\n const dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n const dmMatch = url.match(dmRegExp);\n\n const youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n const youkuMatch = url.match(youkuRegExp);\n\n const qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n const qqMatch = url.match(qqRegExp);\n\n const qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n const qqMatch2 = url.match(qqRegExp2);\n\n const mp4RegExp = /^.+.(mp4|m4v)$/;\n const mp4Match = url.match(mp4RegExp);\n\n const oggRegExp = /^.+.(ogg|ogv)$/;\n const oggMatch = url.match(oggRegExp);\n\n const webmRegExp = /^.+.(webm)$/;\n const webmMatch = url.match(webmRegExp);\n\n const fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n const fbMatch = url.match(fbRegExp);\n\n let $video;\n if (ytMatch && ytMatch[1].length === 11) {\n const youtubeId = ytMatch[1];\n var start = 0;\n if (typeof ytMatch[2] !== 'undefined') {\n const ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n if (ytMatchForStart) {\n for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n }\n }\n }\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n .attr('width', '640').attr('height', '360');\n } else if (igMatch && igMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n .attr('width', '612').attr('height', '710')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else if (vMatch && vMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', vMatch[0] + '/embed/simple')\n .attr('width', '600').attr('height', '600')\n .attr('class', 'vine-embed');\n } else if (vimMatch && vimMatch[3].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n .attr('width', '640').attr('height', '360');\n } else if (dmMatch && dmMatch[2].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n .attr('width', '640').attr('height', '360');\n } else if (youkuMatch && youkuMatch[1].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '498')\n .attr('width', '510')\n .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n const vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '310')\n .attr('width', '500')\n .attr('src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');\n } else if (mp4Match || oggMatch || webmMatch) {\n $video = $('<video controls>')\n .attr('src', url)\n .attr('width', '640').attr('height', '360');\n } else if (fbMatch && fbMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n .attr('width', '560').attr('height', '301')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else {\n // this is not a known video link. Now what, Cat? Now what?\n return false;\n }\n\n $video.addClass('note-video-clip');\n\n return $video[0];\n }\n\n show() {\n const text = this.context.invoke('editor.getSelectedText');\n this.context.invoke('editor.saveRange');\n this.showVideoDialog(text).then((url) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n // build node\n const $node = this.createVideoNode(url);\n\n if ($node) {\n // insert video node\n this.context.invoke('editor.insertNode', $node);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show video dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showVideoDialog(/* text */) {\n return $.Deferred((deferred) => {\n const $videoUrl = this.$dialog.find('.note-video-url');\n const $videoBtn = this.$dialog.find('.note-video-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n $videoUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($videoBtn, $videoUrl.val());\n });\n\n if (!env.isSupportTouch) {\n $videoUrl.trigger('focus');\n }\n\n $videoBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($videoUrl.val());\n });\n\n this.bindEnterKey($videoUrl, $videoBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $videoUrl.off();\n $videoBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\n\nexport default class HelpDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<p class=\"text-center\">',\n '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote @@VERSION@@</a> · ',\n '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n '</p>',\n ].join('');\n\n this.$dialog = this.ui.dialog({\n title: this.lang.options.help,\n fade: this.options.dialogsFade,\n body: this.createShortcutList(),\n footer: body,\n callback: ($node) => {\n $node.find('.modal-body,.note-modal-body').css({\n 'max-height': 300,\n 'overflow': 'scroll',\n });\n },\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n createShortcutList() {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n return Object.keys(keyMap).map((key) => {\n const command = keyMap[key];\n const $row = $('<div><div class=\"help-list-item\"/></div>');\n $row.append($('<label><kbd>' + key + '</kdb></label>').css({\n 'width': 180,\n 'margin-right': 10,\n })).append($('<span/>').html(this.context.memo('help.' + command) || command));\n return $row.html();\n }).join('');\n }\n\n /**\n * show help dialog\n *\n * @return {Promise}\n */\n showHelpDialog() {\n return $.Deferred((deferred) => {\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n deferred.resolve();\n });\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showHelpDialog().then(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\n\nconst AIRMODE_POPOVER_X_OFFSET = -5;\nconst AIRMODE_POPOVER_Y_OFFSET = 5;\n\nexport default class AirPopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.options = context.options;\n\n this.hidable = true;\n this.onContextmenu = false;\n this.pageX = null;\n this.pageY = null;\n\n this.events = {\n 'summernote.contextmenu': (e) => {\n if (this.options.editing) {\n e.preventDefault();\n e.stopPropagation();\n this.onContextmenu = true;\n this.update(true);\n }\n },\n 'summernote.mousedown': (we, e) => {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n },\n 'summernote.keyup summernote.mouseup summernote.scroll': (we, e) => {\n if (this.options.editing && !this.onContextmenu) {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n this.update();\n }\n this.onContextmenu = false;\n },\n 'summernote.disable summernote.change summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n 'summernote.focusout': () => {\n if (!this.$popover.is(':active,:focus')) {\n this.hide();\n }\n },\n };\n }\n\n shouldInitialize() {\n return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-air-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.air);\n\n // disable hiding this popover preemptively by 'summernote.blur' event.\n this.$popover.on('mousedown', () => { this.hidable = false; });\n // (re-)enable hiding after 'summernote.blur' has been handled (aka. ignored).\n this.$popover.on('mouseup', () => { this.hidable = true; });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(forcelyOpen) {\n const styleInfo = this.context.invoke('editor.currentStyle');\n if (styleInfo.range && (!styleInfo.range.isCollapsed() || forcelyOpen)) {\n let rect = {\n left: this.pageX,\n top: this.pageY,\n };\n\n const containerOffset = $(this.options.container).offset();\n rect.top -= containerOffset.top;\n rect.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: Math.max(rect.left, 0) + AIRMODE_POPOVER_X_OFFSET,\n top: rect.top + AIRMODE_POPOVER_Y_OFFSET,\n });\n this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n } else {\n this.hide();\n }\n }\n\n hide() {\n if (this.hidable) {\n this.$popover.hide();\n }\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport key from '../core/key';\n\nconst POPOVER_DIST = 5;\n\nexport default class HintPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.hint = this.options.hint || [];\n this.direction = this.options.hintDirection || 'bottom';\n this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return this.hints.length > 0;\n }\n\n initialize() {\n this.lastWordRange = null;\n this.matchingWord = null;\n this.$popover = this.ui.popover({\n className: 'note-hint-popover',\n hideArrow: true,\n direction: '',\n }).render().appendTo(this.options.container);\n\n this.$popover.hide();\n this.$content = this.$popover.find('.popover-content,.note-popover-content');\n this.$content.on('click', '.note-hint-item', (e) => {\n this.$content.find('.active').removeClass('active');\n $(e.currentTarget).addClass('active');\n this.replace();\n });\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n selectItem($item) {\n this.$content.find('.active').removeClass('active');\n $item.addClass('active');\n\n this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n }\n\n moveDown() {\n const $current = this.$content.find('.note-hint-item.active');\n const $next = $current.next();\n\n if ($next.length) {\n this.selectItem($next);\n } else {\n let $nextGroup = $current.parent().next();\n\n if (!$nextGroup.length) {\n $nextGroup = this.$content.find('.note-hint-group').first();\n }\n\n this.selectItem($nextGroup.find('.note-hint-item').first());\n }\n }\n\n moveUp() {\n const $current = this.$content.find('.note-hint-item.active');\n const $prev = $current.prev();\n\n if ($prev.length) {\n this.selectItem($prev);\n } else {\n let $prevGroup = $current.parent().prev();\n\n if (!$prevGroup.length) {\n $prevGroup = this.$content.find('.note-hint-group').last();\n }\n\n this.selectItem($prevGroup.find('.note-hint-item').last());\n }\n }\n\n replace() {\n const $item = this.$content.find('.note-hint-item.active');\n\n if ($item.length) {\n var node = this.nodeFromItem($item);\n // If matchingWord length = 0 -> capture OK / open hint / but as mention capture \"\" (\\w*)\n if (this.matchingWord !== null && this.matchingWord.length === 0) {\n this.lastWordRange.so = this.lastWordRange.eo;\n // Else si > 0 and normal case -> adjust range \"before\" for correct position of insertion\n } else if (this.matchingWord !== null && this.matchingWord.length > 0 && !this.lastWordRange.isCollapsed()) {\n let rangeCompute = this.lastWordRange.eo - this.lastWordRange.so - this.matchingWord.length;\n if (rangeCompute > 0) {\n this.lastWordRange.so += rangeCompute;\n }\n }\n this.lastWordRange.insertNode(node);\n\n if (this.options.hintSelect === 'next') {\n var blank = document.createTextNode('');\n $(node).after(blank);\n range.createFromNodeBefore(blank).select();\n } else {\n range.createFromNodeAfter(node).select();\n }\n\n this.lastWordRange = null;\n this.hide();\n this.context.invoke('editor.focus');\n }\n }\n\n nodeFromItem($item) {\n const hint = this.hints[$item.data('index')];\n const item = $item.data('item');\n let node = hint.content ? hint.content(item) : item;\n if (typeof node === 'string') {\n node = dom.createText(node);\n }\n return node;\n }\n\n createItemTemplates(hintIdx, items) {\n const hint = this.hints[hintIdx];\n return items.map((item /*, idx */) => {\n const $item = $('<div class=\"note-hint-item\"/>');\n $item.append(hint.template ? hint.template(item) : item + '');\n $item.data({\n 'index': hintIdx,\n 'item': item,\n });\n return $item;\n });\n }\n\n handleKeydown(e) {\n if (!this.$popover.is(':visible')) {\n return;\n }\n\n if (e.keyCode === key.code.ENTER) {\n e.preventDefault();\n this.replace();\n } else if (e.keyCode === key.code.UP) {\n e.preventDefault();\n this.moveUp();\n } else if (e.keyCode === key.code.DOWN) {\n e.preventDefault();\n this.moveDown();\n }\n }\n\n searchKeyword(index, keyword, callback) {\n const hint = this.hints[index];\n if (hint && hint.match.test(keyword) && hint.search) {\n const matches = hint.match.exec(keyword);\n this.matchingWord = matches[0];\n hint.search(matches[1], callback);\n } else {\n callback();\n }\n }\n\n createGroup(idx, keyword) {\n const $group = $('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n this.searchKeyword(idx, keyword, (items) => {\n items = items || [];\n if (items.length) {\n $group.html(this.createItemTemplates(idx, items));\n this.show();\n }\n });\n\n return $group;\n }\n\n handleKeyup(e) {\n if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n let range = this.context.invoke('editor.getLastRange');\n let wordRange, keyword;\n if (this.options.hintMode === 'words') {\n wordRange = range.getWordsRange(range);\n keyword = wordRange.toString();\n\n this.hints.forEach((hint) => {\n if (hint.match.test(keyword)) {\n wordRange = range.getWordsMatchRange(hint.match);\n return false;\n }\n });\n\n if (!wordRange) {\n this.hide();\n return;\n }\n\n keyword = wordRange.toString();\n } else {\n wordRange = range.getWordRange();\n keyword = wordRange.toString();\n }\n\n if (this.hints.length && keyword) {\n this.$content.empty();\n\n const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n const containerOffset = $(this.options.container).offset();\n if (bnd) {\n bnd.top -= containerOffset.top;\n bnd.left -= containerOffset.left;\n\n this.$popover.hide();\n this.lastWordRange = wordRange;\n this.hints.forEach((hint, idx) => {\n if (hint.match.test(keyword)) {\n this.createGroup(idx, keyword).appendTo(this.$content);\n }\n });\n // select first .note-hint-item\n this.$content.find('.note-hint-item:first').addClass('active');\n\n // set position for popover after group is created\n if (this.direction === 'top') {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST,\n });\n } else {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top + bnd.height + POPOVER_DIST,\n });\n }\n }\n } else {\n this.hide();\n }\n }\n }\n\n show() {\n this.$popover.show();\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport './summernote-en-US';\nimport '../summernote';\nimport dom from './core/dom';\nimport range from './core/range';\nimport lists from './core/lists';\nimport Editor from './module/Editor';\nimport Clipboard from './module/Clipboard';\nimport Dropzone from './module/Dropzone';\nimport Codeview from './module/Codeview';\nimport Statusbar from './module/Statusbar';\nimport Fullscreen from './module/Fullscreen';\nimport Handle from './module/Handle';\nimport AutoLink from './module/AutoLink';\nimport AutoSync from './module/AutoSync';\nimport AutoReplace from './module/AutoReplace';\nimport Placeholder from './module/Placeholder';\nimport Buttons from './module/Buttons';\nimport Toolbar from './module/Toolbar';\nimport LinkDialog from './module/LinkDialog';\nimport LinkPopover from './module/LinkPopover';\nimport ImageDialog from './module/ImageDialog';\nimport ImagePopover from './module/ImagePopover';\nimport TablePopover from './module/TablePopover';\nimport VideoDialog from './module/VideoDialog';\nimport HelpDialog from './module/HelpDialog';\nimport AirPopover from './module/AirPopover';\nimport HintPopover from './module/HintPopover';\n\n$.summernote = $.extend($.summernote, {\n version: '@@VERSION@@',\n plugins: {},\n\n dom: dom,\n range: range,\n lists: lists,\n\n options: {\n langInfo: $.summernote.lang['en-US'],\n editing: true,\n modules: {\n 'editor': Editor,\n 'clipboard': Clipboard,\n 'dropzone': Dropzone,\n 'codeview': Codeview,\n 'statusbar': Statusbar,\n 'fullscreen': Fullscreen,\n 'handle': Handle,\n // FIXME: HintPopover must be front of autolink\n // - Script error about range when Enter key is pressed on hint popover\n 'hintPopover': HintPopover,\n 'autoLink': AutoLink,\n 'autoSync': AutoSync,\n 'autoReplace': AutoReplace,\n 'placeholder': Placeholder,\n 'buttons': Buttons,\n 'toolbar': Toolbar,\n 'linkDialog': LinkDialog,\n 'linkPopover': LinkPopover,\n 'imageDialog': ImageDialog,\n 'imagePopover': ImagePopover,\n 'tablePopover': TablePopover,\n 'videoDialog': VideoDialog,\n 'helpDialog': HelpDialog,\n 'airPopover': AirPopover,\n },\n\n buttons: {},\n\n lang: 'en-US',\n\n followingToolbar: false,\n toolbarPosition: 'top',\n otherStaticBar: '',\n\n // toolbar\n toolbar: [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['fontname', ['fontname']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']],\n ],\n\n // popover\n popatmouse: true,\n popover: {\n image: [\n ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n ['float', ['floatLeft', 'floatRight', 'floatNone']],\n ['remove', ['removeMedia']],\n ],\n link: [\n ['link', ['linkDialogShow', 'unlink']],\n ],\n table: [\n ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n ],\n air: [\n ['color', ['color']],\n ['font', ['bold', 'underline', 'clear']],\n ['para', ['ul', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture']],\n ['view', ['fullscreen', 'codeview']],\n ],\n },\n\n // air mode: inline editor\n airMode: false,\n overrideContextMenu: false, // TBD\n\n width: null,\n height: null,\n linkTargetBlank: true,\n useProtocol: true,\n defaultProtocol: 'http://',\n\n focus: false,\n tabDisabled: false,\n tabSize: 4,\n styleWithCSS: false,\n shortcuts: true,\n textareaAutoSync: true,\n tooltip: 'auto',\n container: null,\n maxTextLength: 0,\n blockquoteBreakingLevel: 2,\n spellCheck: true,\n disableGrammar: false,\n placeholder: null,\n inheritPlaceholder: false,\n // TODO: need to be documented\n recordEveryKeystroke: false,\n historyLimit: 200,\n\n // TODO: need to be documented\n hintMode: 'word',\n hintSelect: 'after',\n hintDirection: 'bottom',\n\n styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n fontNames: [\n 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n 'Tahoma', 'Times New Roman', 'Verdana',\n ],\n fontNamesIgnoreCheck: [],\n addDefaultFonts: true,\n\n fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n\n fontSizeUnits: ['px', 'pt'],\n\n // pallete colors(n x n)\n colors: [\n ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n ],\n\n // http://chir.ag/projects/name-that-color/\n colorsName: [\n ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n ],\n\n colorButton: {\n foreColor: '#000000',\n backColor: '#FFFF00',\n },\n\n lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n\n tableClassName: 'table table-bordered',\n\n insertTableMaxSize: {\n col: 10,\n row: 10,\n },\n\n // By default, dialogs are attached in container.\n dialogsInBody: false,\n dialogsFade: false,\n\n maximumImageFileSize: null,\n\n callbacks: {\n onBeforeCommand: null,\n onBlur: null,\n onBlurCodeview: null,\n onChange: null,\n onChangeCodeview: null,\n onDialogShown: null,\n onEnter: null,\n onFocus: null,\n onImageLinkInsert: null,\n onImageUpload: null,\n onImageUploadError: null,\n onInit: null,\n onKeydown: null,\n onKeyup: null,\n onMousedown: null,\n onMouseup: null,\n onPaste: null,\n onScroll: null,\n },\n\n codemirror: {\n mode: 'text/html',\n htmlMode: true,\n lineNumbers: true,\n },\n\n codeviewFilter: false,\n codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n codeviewIframeFilter: true,\n codeviewIframeWhitelistSrc: [],\n codeviewIframeWhitelistSrcBase: [\n 'www.youtube.com',\n 'www.youtube-nocookie.com',\n 'www.facebook.com',\n 'vine.co',\n 'instagram.com',\n 'player.vimeo.com',\n 'www.dailymotion.com',\n 'player.youku.com',\n 'v.qq.com',\n ],\n\n keyMap: {\n pc: {\n 'ENTER': 'insertParagraph',\n 'CTRL+Z': 'undo',\n 'CTRL+Y': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CTRL+B': 'bold',\n 'CTRL+I': 'italic',\n 'CTRL+U': 'underline',\n 'CTRL+SHIFT+S': 'strikethrough',\n 'CTRL+BACKSLASH': 'removeFormat',\n 'CTRL+SHIFT+L': 'justifyLeft',\n 'CTRL+SHIFT+E': 'justifyCenter',\n 'CTRL+SHIFT+R': 'justifyRight',\n 'CTRL+SHIFT+J': 'justifyFull',\n 'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n 'CTRL+SHIFT+NUM8': 'insertOrderedList',\n 'CTRL+LEFTBRACKET': 'outdent',\n 'CTRL+RIGHTBRACKET': 'indent',\n 'CTRL+NUM0': 'formatPara',\n 'CTRL+NUM1': 'formatH1',\n 'CTRL+NUM2': 'formatH2',\n 'CTRL+NUM3': 'formatH3',\n 'CTRL+NUM4': 'formatH4',\n 'CTRL+NUM5': 'formatH5',\n 'CTRL+NUM6': 'formatH6',\n 'CTRL+ENTER': 'insertHorizontalRule',\n 'CTRL+K': 'linkDialog.show',\n },\n\n mac: {\n 'ENTER': 'insertParagraph',\n 'CMD+Z': 'undo',\n 'CMD+SHIFT+Z': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CMD+B': 'bold',\n 'CMD+I': 'italic',\n 'CMD+U': 'underline',\n 'CMD+SHIFT+S': 'strikethrough',\n 'CMD+BACKSLASH': 'removeFormat',\n 'CMD+SHIFT+L': 'justifyLeft',\n 'CMD+SHIFT+E': 'justifyCenter',\n 'CMD+SHIFT+R': 'justifyRight',\n 'CMD+SHIFT+J': 'justifyFull',\n 'CMD+SHIFT+NUM7': 'insertUnorderedList',\n 'CMD+SHIFT+NUM8': 'insertOrderedList',\n 'CMD+LEFTBRACKET': 'outdent',\n 'CMD+RIGHTBRACKET': 'indent',\n 'CMD+NUM0': 'formatPara',\n 'CMD+NUM1': 'formatH1',\n 'CMD+NUM2': 'formatH2',\n 'CMD+NUM3': 'formatH3',\n 'CMD+NUM4': 'formatH4',\n 'CMD+NUM5': 'formatH5',\n 'CMD+NUM6': 'formatH6',\n 'CMD+ENTER': 'insertHorizontalRule',\n 'CMD+K': 'linkDialog.show',\n },\n },\n icons: {\n 'align': 'note-icon-align',\n 'alignCenter': 'note-icon-align-center',\n 'alignJustify': 'note-icon-align-justify',\n 'alignLeft': 'note-icon-align-left',\n 'alignRight': 'note-icon-align-right',\n 'rowBelow': 'note-icon-row-below',\n 'colBefore': 'note-icon-col-before',\n 'colAfter': 'note-icon-col-after',\n 'rowAbove': 'note-icon-row-above',\n 'rowRemove': 'note-icon-row-remove',\n 'colRemove': 'note-icon-col-remove',\n 'indent': 'note-icon-align-indent',\n 'outdent': 'note-icon-align-outdent',\n 'arrowsAlt': 'note-icon-arrows-alt',\n 'bold': 'note-icon-bold',\n 'caret': 'note-icon-caret',\n 'circle': 'note-icon-circle',\n 'close': 'note-icon-close',\n 'code': 'note-icon-code',\n 'eraser': 'note-icon-eraser',\n 'floatLeft': 'note-icon-float-left',\n 'floatRight': 'note-icon-float-right',\n 'font': 'note-icon-font',\n 'frame': 'note-icon-frame',\n 'italic': 'note-icon-italic',\n 'link': 'note-icon-link',\n 'unlink': 'note-icon-chain-broken',\n 'magic': 'note-icon-magic',\n 'menuCheck': 'note-icon-menu-check',\n 'minus': 'note-icon-minus',\n 'orderedlist': 'note-icon-orderedlist',\n 'pencil': 'note-icon-pencil',\n 'picture': 'note-icon-picture',\n 'question': 'note-icon-question',\n 'redo': 'note-icon-redo',\n 'rollback': 'note-icon-rollback',\n 'square': 'note-icon-square',\n 'strikethrough': 'note-icon-strikethrough',\n 'subscript': 'note-icon-subscript',\n 'superscript': 'note-icon-superscript',\n 'table': 'note-icon-table',\n 'textHeight': 'note-icon-text-height',\n 'trash': 'note-icon-trash',\n 'underline': 'note-icon-underline',\n 'undo': 'note-icon-undo',\n 'unorderedlist': 'note-icon-unorderedlist',\n 'video': 'note-icon-video',\n },\n },\n});\n","import $ from 'jquery';\n\nclass TooltipUI {\n constructor($node, options) {\n this.$node = $node;\n this.options = $.extend({}, {\n title: '',\n target: options.container,\n trigger: 'hover focus',\n placement: 'bottom',\n }, options);\n\n // create tooltip node\n this.$tooltip = $([\n '<div class=\"note-tooltip\">',\n '<div class=\"note-tooltip-arrow\"/>',\n '<div class=\"note-tooltip-content\"/>',\n '</div>',\n ].join(''));\n\n // define event\n if (this.options.trigger !== 'manual') {\n const showCallback = this.show.bind(this);\n const hideCallback = this.hide.bind(this);\n const toggleCallback = this.toggle.bind(this);\n\n this.options.trigger.split(' ').forEach(function(eventName) {\n if (eventName === 'hover') {\n $node.off('mouseenter mouseleave');\n $node.on('mouseenter', showCallback).on('mouseleave', hideCallback);\n } else if (eventName === 'click') {\n $node.on('click', toggleCallback);\n } else if (eventName === 'focus') {\n $node.on('focus', showCallback).on('blur', hideCallback);\n }\n });\n }\n }\n\n show() {\n const $node = this.$node;\n const offset = $node.offset();\n const targetOffset = $(this.options.target).offset();\n offset.top -= targetOffset.top;\n offset.left -= targetOffset.left;\n\n const $tooltip = this.$tooltip;\n const title = this.options.title || $node.attr('title') || $node.data('title');\n const placement = this.options.placement || $node.data('placement');\n\n $tooltip.addClass(placement);\n $tooltip.find('.note-tooltip-content').text(title);\n $tooltip.appendTo(this.options.target);\n\n const nodeWidth = $node.outerWidth();\n const nodeHeight = $node.outerHeight();\n const tooltipWidth = $tooltip.outerWidth();\n const tooltipHeight = $tooltip.outerHeight();\n\n if (placement === 'bottom') {\n $tooltip.css({\n top: offset.top + nodeHeight,\n left: offset.left + (nodeWidth / 2 - tooltipWidth / 2),\n });\n } else if (placement === 'top') {\n $tooltip.css({\n top: offset.top - tooltipHeight,\n left: offset.left + (nodeWidth / 2 - tooltipWidth / 2),\n });\n } else if (placement === 'left') {\n $tooltip.css({\n top: offset.top + (nodeHeight / 2 - tooltipHeight / 2),\n left: offset.left - tooltipWidth,\n });\n } else if (placement === 'right') {\n $tooltip.css({\n top: offset.top + (nodeHeight / 2 - tooltipHeight / 2),\n left: offset.left + nodeWidth,\n });\n }\n\n $tooltip.addClass('in');\n }\n\n hide() {\n this.$tooltip.removeClass('in');\n setTimeout(() => {\n this.$tooltip.remove();\n }, 200);\n }\n\n toggle() {\n if (this.$tooltip.hasClass('in')) {\n this.hide();\n } else {\n this.show();\n }\n }\n}\n\nexport default TooltipUI;\n","import $ from 'jquery';\n\nclass DropdownUI {\n constructor($node, options) {\n this.$button = $node;\n this.options = $.extend({}, {\n target: options.container,\n }, options);\n this.setEvent();\n }\n\n setEvent() {\n this.$button.on('click', (e) => {\n this.toggle();\n e.stopImmediatePropagation();\n });\n }\n\n clear() {\n var $parent = $('.note-btn-group.open');\n $parent.find('.note-btn.active').removeClass('active');\n $parent.removeClass('open');\n }\n\n show() {\n this.$button.addClass('active');\n this.$button.parent().addClass('open');\n\n var $dropdown = this.$button.next();\n var offset = $dropdown.offset();\n var width = $dropdown.outerWidth();\n var windowWidth = $(window).width();\n var targetMarginRight = parseFloat($(this.options.target).css('margin-right'));\n\n if (offset.left + width > windowWidth - targetMarginRight) {\n $dropdown.css('margin-left', windowWidth - targetMarginRight - (offset.left + width));\n } else {\n $dropdown.css('margin-left', '');\n }\n }\n\n hide() {\n this.$button.removeClass('active');\n this.$button.parent().removeClass('open');\n }\n\n toggle() {\n var isOpened = this.$button.parent().hasClass('open');\n\n this.clear();\n\n if (isOpened) {\n this.hide();\n } else {\n this.show();\n }\n }\n}\n\n$(document).on('click', function(e) {\n if (!$(e.target).closest('.note-btn-group').length) {\n $('.note-btn-group.open').removeClass('open');\n $('.note-btn-group .note-btn.active').removeClass('active');\n }\n});\n\n$(document).on('click.note-dropdown-menu', function(e) {\n $(e.target).closest('.note-dropdown-menu').parent().removeClass('open');\n $(e.target).closest('.note-dropdown-menu').parent().find('.note-btn.active').removeClass('active');\n});\n\nexport default DropdownUI;\n","import $ from 'jquery';\n\nclass ModalUI {\n constructor($node /*, options */) {\n this.$modal = $node;\n this.$backdrop = $('<div class=\"note-modal-backdrop\"/>');\n }\n\n show() {\n this.$backdrop.appendTo(document.body).show();\n this.$modal.addClass('open').show();\n this.$modal.trigger('note.modal.show');\n this.$modal.off('click', '.close').on('click', '.close', this.hide.bind(this));\n this.$modal.on('keydown', (event) => {\n if (event.which === 27) {\n event.preventDefault();\n this.hide();\n }\n });\n }\n\n hide() {\n this.$modal.removeClass('open').hide();\n this.$backdrop.hide();\n this.$modal.trigger('note.modal.hide');\n this.$modal.off('keydown');\n }\n}\n\nexport default ModalUI;\n","import $ from 'jquery';\nimport renderer from '../base/renderer';\nimport TooltipUI from './ui/TooltipUI';\nimport DropdownUI from './ui/DropdownUI';\nimport ModalUI from './ui/ModalUI';\n\nconst editor = renderer.create('<div class=\"note-editor note-frame\"/>');\nconst toolbar = renderer.create('<div class=\"note-toolbar\" role=\"toolbar\"/>');\nconst editingArea = renderer.create('<div class=\"note-editing-area\"/>');\nconst codable = renderer.create('<textarea class=\"note-codable\" aria-multiline=\"true\"/>');\nconst editable = renderer.create('<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\nconst statusbar = renderer.create([\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n '<div class=\"note-statusbar\" role=\"status\">',\n '<div class=\"note-resizebar\" aria-label=\"resize\">',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '</div>',\n '</div>',\n].join(''));\n\nconst airEditor = renderer.create('<div class=\"note-editor note-airframe\"/>');\nconst airEditable = renderer.create([\n '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n].join(''));\n\nconst buttonGroup = renderer.create('<div class=\"note-btn-group\">');\nconst button = renderer.create('<button type=\"button\" class=\"note-btn\" tabindex=\"-1\">', function($node, options) {\n // set button type\n if (options && options.tooltip) {\n $node.attr({\n 'aria-label': options.tooltip,\n });\n $node.data('_lite_tooltip', new TooltipUI($node, {\n title: options.tooltip,\n container: options.container,\n })).on('click', (e) => {\n $(e.currentTarget).data('_lite_tooltip').hide();\n });\n }\n if (options.contents) {\n $node.html(options.contents);\n }\n\n if (options && options.data && options.data.toggle === 'dropdown') {\n $node.data('_lite_dropdown', new DropdownUI($node, {\n container: options.container,\n }));\n }\n});\n\nconst dropdown = renderer.create('<div class=\"note-dropdown-menu\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n const $temp = $('<a class=\"note-dropdown-item\" href=\"#\" data-value=\"' + value + '\" role=\"listitem\" aria-label=\"' + value + '\"></a>');\n\n $temp.html(content).data('item', item);\n\n return $temp;\n }) : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n\n $node.on('click', '> .note-dropdown-item', function(e) {\n const $a = $(this);\n\n const item = $a.data('item');\n const value = $a.data('value');\n\n if (item.click) {\n item.click($a);\n } else if (options.itemClick) {\n options.itemClick(e, item, value);\n }\n });\n});\n\nconst dropdownCheck = renderer.create('<div class=\"note-dropdown-menu note-check\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n\n const $temp = $('<a class=\"note-dropdown-item\" href=\"#\" data-value=\"' + value + '\" role=\"listitem\" aria-label=\"' + item + '\"></a>');\n $temp.html([icon(options.checkClassName), ' ', content]).data('item', item);\n return $temp;\n }) : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n\n $node.on('click', '> .note-dropdown-item', function(e) {\n const $a = $(this);\n\n const item = $a.data('item');\n const value = $a.data('value');\n\n if (item.click) {\n item.click($a);\n } else if (options.itemClick) {\n options.itemClick(e, item, value);\n }\n });\n});\n\nconst dropdownButtonContents = function(contents, options) {\n return contents + ' ' + icon(options.icons.caret, 'span');\n};\n\nconst dropdownButton = function(opt, callback) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown({\n className: opt.className,\n items: opt.items,\n template: opt.template,\n itemClick: opt.itemClick,\n }),\n ], { callback: callback }).render();\n};\n\nconst dropdownCheckButton = function(opt, callback) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdownCheck({\n className: opt.className,\n checkClassName: opt.checkClassName,\n items: opt.items,\n template: opt.template,\n itemClick: opt.itemClick,\n }),\n ], { callback: callback }).render();\n};\n\nconst paragraphDropdownButton = function(opt) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown([\n buttonGroup({\n className: 'note-align',\n children: opt.items[0],\n }),\n buttonGroup({\n className: 'note-list',\n children: opt.items[1],\n }),\n ]),\n ]).render();\n};\n\nconst tableMoveHandler = function(event, col, row) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n};\n\nconst tableDropdownButton = function(opt) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown({\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: function($node) {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: opt.col + 'em',\n height: opt.row + 'em',\n })\n .mousedown(opt.itemClick)\n .mousemove(function(e) {\n tableMoveHandler(e, opt.col, opt.row);\n });\n },\n }).render();\n};\n\nconst palette = renderer.create('<div class=\"note-color-palette\"/>', function($node, options) {\n const contents = [];\n for (let row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n const eventName = options.eventName;\n const colors = options.colors[row];\n const colorsName = options.colorsName[row];\n const buttons = [];\n for (let col = 0, colSize = colors.length; col < colSize; col++) {\n const color = colors[col];\n const colorName = colorsName[col];\n buttons.push([\n '<button type=\"button\" class=\"note-btn note-color-btn\"',\n 'style=\"background-color:', color, '\" ',\n 'data-event=\"', eventName, '\" ',\n 'data-value=\"', color, '\" ',\n 'data-title=\"', colorName, '\" ',\n 'aria-label=\"', colorName, '\" ',\n 'data-toggle=\"button\" tabindex=\"-1\"></button>',\n ].join(''));\n }\n contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n }\n $node.html(contents.join(''));\n\n $node.find('.note-color-btn').each(function() {\n $(this).data('_lite_tooltip', new TooltipUI($(this), {\n container: options.container,\n }));\n });\n});\n\nconst colorDropdownButton = function(opt, type) {\n return buttonGroup({\n className: 'note-color',\n children: [\n button({\n className: 'note-current-color-button',\n contents: opt.title,\n tooltip: opt.lang.color.recent,\n click: opt.currentClick,\n callback: function($button) {\n const $recentColor = $button.find('.note-recent-color');\n\n if (type !== 'foreColor') {\n $recentColor.css('background-color', '#FFFF00');\n $button.attr('data-backColor', '#FFFF00');\n }\n },\n }),\n button({\n className: 'dropdown-toggle',\n contents: icon('note-icon-caret'),\n tooltip: opt.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown({\n items: [\n '<div>',\n '<div class=\"note-btn-group btn-background-color\">',\n '<div class=\"note-palette-title\">' + opt.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset note-btn note-btn-block\" data-event=\"backColor\" data-value=\"inherit\">',\n opt.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div class=\"btn-sm\">',\n '<input type=\"color\" id=\"html5bcp\" class=\"note-btn btn-default\" value=\"#21104A\" style=\"width:100%;\" data-value=\"cp\">',\n '<button type=\"button\" class=\"note-color-reset btn\" data-event=\"backColor\" data-value=\"cpbackColor\">',\n opt.lang.color.cpSelect,\n '</button>',\n '</div>',\n '</div>',\n '<div class=\"note-btn-group btn-foreground-color\">',\n '<div class=\"note-palette-title\">' + opt.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset note-btn note-btn-block\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n opt.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div class=\"btn-sm\">',\n '<input type=\"color\" id=\"html5fcp\" class=\"note-btn btn-default\" value=\"#21104A\" style=\"width:100%;\" data-value=\"cp\">',\n '<button type=\"button\" class=\"note-color-reset btn\" data-event=\"foreColor\" data-value=\"cpforeColor\">',\n opt.lang.color.cpSelect,\n '</button>',\n '</div>',\n '</div>',\n '</div>',\n ].join(''),\n callback: function($dropdown) {\n $dropdown.find('.note-holder').each(function() {\n const $holder = $(this);\n $holder.append(palette({\n colors: opt.colors,\n eventName: $holder.data('event'),\n }).render());\n });\n\n if (type === 'fore') {\n $dropdown.find('.btn-background-color').hide();\n $dropdown.css({ 'min-width': '210px' });\n } else if (type === 'back') {\n $dropdown.find('.btn-foreground-color').hide();\n $dropdown.css({ 'min-width': '210px' });\n }\n },\n click: function(event) {\n const $button = $(event.target);\n const eventName = $button.data('event');\n let value = $button.data('value');\n const foreinput = document.getElementById('html5fcp').value;\n const backinput = document.getElementById('html5bcp').value;\n if (value === 'cp') {\n event.stopPropagation();\n } else if (value === 'cpbackColor') {\n value = backinput;\n } else if (value === 'cpforeColor') {\n value = foreinput;\n }\n\n if (eventName && value) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n\n if (type === 'fore') {\n opt.itemClick('foreColor', value);\n } else if (type === 'back') {\n opt.itemClick('backColor', value);\n } else {\n opt.itemClick(eventName, value);\n }\n }\n },\n }),\n ],\n }).render();\n};\n\nconst dialog = renderer.create('<div class=\"note-modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function($node, options) {\n if (options.fade) {\n $node.addClass('fade');\n }\n $node.attr({\n 'aria-label': options.title,\n });\n $node.html([\n '<div class=\"note-modal-content\">',\n (options.title ? '<div class=\"note-modal-header\"><button type=\"button\" class=\"close\" aria-label=\"Close\" aria-hidden=\"true\"><i class=\"note-icon-close\"></i></button><h4 class=\"note-modal-title\">' + options.title + '</h4></div>' : ''),\n '<div class=\"note-modal-body\">' + options.body + '</div>',\n (options.footer ? '<div class=\"note-modal-footer\">' + options.footer + '</div>' : ''),\n '</div>',\n ].join(''));\n\n $node.data('modal', new ModalUI($node, options));\n});\n\nconst videoDialog = function(opt) {\n const body = '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-video-url-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.video.url + ' <small class=\"text-muted\">' + opt.lang.video.providers + '</small></label>' +\n '<input id=\"note-dialog-video-url-' + opt.id + '\" class=\"note-video-url note-input\" type=\"text\"/>' +\n '</div>';\n const footer = [\n '<button type=\"button\" href=\"#\" class=\"note-btn note-btn-primary note-video-btn disabled\" disabled>',\n opt.lang.video.insert,\n '</button>',\n ].join('');\n\n return dialog({\n title: opt.lang.video.insert,\n fade: opt.fade,\n body: body,\n footer: footer,\n }).render();\n};\n\nconst imageDialog = function(opt) {\n const body = '<div class=\"note-form-group note-group-select-from-files\">' +\n '<label for=\"note-dialog-image-file-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.image.selectFromFiles + '</label>' +\n '<input id=\"note-dialog-image-file-' + opt.id + '\" class=\"note-note-image-input note-input\" type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>' +\n opt.imageLimitation +\n '</div>' +\n '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-image-url-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.image.url + '</label>' +\n '<input id=\"note-dialog-image-url-' + opt.id + '\" class=\"note-image-url note-input\" type=\"text\"/>' +\n '</div>';\n const footer = [\n '<button href=\"#\" type=\"button\" class=\"note-btn note-btn-primary note-btn-large note-image-btn disabled\" disabled>',\n opt.lang.image.insert,\n '</button>',\n ].join('');\n\n return dialog({\n title: opt.lang.image.insert,\n fade: opt.fade,\n body: body,\n footer: footer,\n }).render();\n};\n\nconst linkDialog = function(opt) {\n const body = '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-link-txt-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.link.textToDisplay + '</label>' +\n '<input id=\"note-dialog-link-txt-' + opt.id + '\" class=\"note-link-text note-input\" type=\"text\"/>' +\n '</div>' +\n '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-link-url-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.link.url + '</label>' +\n '<input id=\"note-dialog-link-url-' + opt.id + '\" class=\"note-link-url note-input\" type=\"text\" value=\"http://\"/>' +\n '</div>' +\n (!opt.disableLinkTarget ? '<div class=\"checkbox\"><label for=\"note-dialog-link-nw-' + opt.id + '\"><input id=\"note-dialog-link-nw-' + opt.id + '\" type=\"checkbox\" checked> ' + opt.lang.link.openInNewWindow + '</label></div>' : '') +\n '<div class=\"checkbox\"><label for=\"note-dialog-link-up-' + opt.id + '\"><input id=\"note-dialog-link-up-' + opt.id + '\" type=\"checkbox\" checked> ' + opt.lang.link.useProtocol + '</label></div>';\n const footer = [\n '<button href=\"#\" type=\"button\" class=\"note-btn note-btn-primary note-link-btn disabled\" disabled>',\n opt.lang.link.insert,\n '</button>',\n ].join('');\n\n return dialog({\n className: 'link-dialog',\n title: opt.lang.link.insert,\n fade: opt.fade,\n body: body,\n footer: footer,\n }).render();\n};\n\nconst popover = renderer.create([\n '<div class=\"note-popover bottom\">',\n '<div class=\"note-popover-arrow\"/>',\n '<div class=\"popover-content note-children-container\"/>',\n '</div>',\n].join(''), function($node, options) {\n const direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n\n $node.addClass(direction).hide();\n\n if (options.hideArrow) {\n $node.find('.note-popover-arrow').hide();\n }\n});\n\nconst checkbox = renderer.create('<div class=\"checkbox\"></div>', function($node, options) {\n $node.html([\n '<label' + (options.id ? ' for=\"note-' + options.id + '\"' : '') + '>',\n '<input role=\"checkbox\" type=\"checkbox\"' + (options.id ? ' id=\"note-' + options.id + '\"' : ''),\n (options.checked ? ' checked' : ''),\n ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n (options.text ? options.text : ''),\n '</label>',\n ].join(''));\n});\n\nconst icon = function(iconClassName, tagName) {\n tagName = tagName || 'i';\n return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n};\n\nconst ui = function(editorOptions) {\n return {\n editor: editor,\n toolbar: toolbar,\n editingArea: editingArea,\n codable: codable,\n editable: editable,\n statusbar: statusbar,\n airEditor: airEditor,\n airEditable: airEditable,\n buttonGroup: buttonGroup,\n button: button,\n dropdown: dropdown,\n dropdownCheck: dropdownCheck,\n dropdownButton: dropdownButton,\n dropdownButtonContents: dropdownButtonContents,\n dropdownCheckButton: dropdownCheckButton,\n paragraphDropdownButton: paragraphDropdownButton,\n tableDropdownButton: tableDropdownButton,\n colorDropdownButton: colorDropdownButton,\n palette: palette,\n dialog: dialog,\n videoDialog: videoDialog,\n imageDialog: imageDialog,\n linkDialog: linkDialog,\n popover: popover,\n checkbox: checkbox,\n icon: icon,\n options: editorOptions,\n\n toggleBtn: function($btn, isEnable) {\n $btn.toggleClass('disabled', !isEnable);\n $btn.attr('disabled', !isEnable);\n },\n\n toggleBtnActive: function($btn, isActive) {\n $btn.toggleClass('active', isActive);\n },\n\n check: function($dom, value) {\n $dom.find('.checked').removeClass('checked');\n $dom.find('[data-value=\"' + value + '\"]').addClass('checked');\n },\n\n onDialogShown: function($dialog, handler) {\n $dialog.one('note.modal.show', handler);\n },\n\n onDialogHidden: function($dialog, handler) {\n $dialog.one('note.modal.hide', handler);\n },\n\n showDialog: function($dialog) {\n $dialog.data('modal').show();\n },\n\n hideDialog: function($dialog) {\n $dialog.data('modal').hide();\n },\n\n /**\n * get popover content area\n *\n * @param $popover\n * @returns {*}\n */\n getPopoverContent: function($popover) {\n return $popover.find('.note-popover-content');\n },\n\n /**\n * get dialog's body area\n *\n * @param $dialog\n * @returns {*}\n */\n getDialogBody: function($dialog) {\n return $dialog.find('.note-modal-body');\n },\n\n createLayout: function($note) {\n const $editor = (editorOptions.airMode ? airEditor([\n editingArea([\n codable(),\n airEditable(),\n ]),\n ]) : (editorOptions.toolbarPosition === 'bottom'\n ? editor([\n editingArea([\n codable(),\n editable(),\n ]),\n toolbar(),\n statusbar(),\n ])\n : editor([\n toolbar(),\n editingArea([\n codable(),\n editable(),\n ]),\n statusbar(),\n ])\n )).render();\n\n $editor.insertAfter($note);\n\n return {\n note: $note,\n editor: $editor,\n toolbar: $editor.find('.note-toolbar'),\n editingArea: $editor.find('.note-editing-area'),\n editable: $editor.find('.note-editable'),\n codable: $editor.find('.note-codable'),\n statusbar: $editor.find('.note-statusbar'),\n };\n },\n\n removeLayout: function($note, layoutInfo) {\n $note.html(layoutInfo.editable.html());\n layoutInfo.editor.remove();\n $note.off('summernote'); // remove summernote custom event\n $note.show();\n },\n };\n};\n\nexport default ui;\n","import $ from 'jquery';\nimport ui from './ui';\nimport '../base/settings.js';\n\nimport '../../styles/summernote-lite.scss';\n\n$.summernote = $.extend($.summernote, {\n ui_template: ui,\n interface: 'lite',\n});\n","// extracted by mini-css-extract-plugin"],"sourceRoot":""}
File: public/AdminLTE/plugins/summernote/summernote-lite.min.js
Match lines: 1
2|!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var n="object"==typeof exports?e(require("jquery")):e(t.jQuery);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=51)}({0:function(e,n){e.exports=t},1:function(t,e,n){"use strict";var o=n(0),i=n.n(o);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var s=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.markup=e,this.children=n,this.options=o,this.callback=i}var e,n,o;return e=t,(n=[{key:"render",value:function(t){var e=i()(this.markup);if(this.options&&this.options.contents&&e.html(this.options.contents),this.options&&this.options.className&&e.addClass(this.options.className),this.options&&this.options.data&&i.a.each(this.options.data,(function(t,n){e.attr("data-"+t,n)})),this.options&&this.options.click&&e.on("click",this.options.click),this.children){var n=e.find(".note-children-container");this.children.forEach((function(t){t.render(n.length?n:e)}))}return this.callback&&this.callback(e,this.options),this.options&&this.options.callback&&this.options.callback(e),t&&t.append(e),e}}])&&a(e.prototype,n),o&&a(e,o),t}();e.a={create:function(t,e){return function(){var n="object"===r(arguments[1])?arguments[1]:arguments[0],o=Array.isArray(arguments[0])?arguments[0]:[];return n&&n.children&&(o=n.children),new s(t,o,n,e)}}}},2:function(t,e){(function(e){t.exports=e}).call(this,{})},3:function(t,e,n){"use strict";var o=n(0),i=n.n(o);i.a.summernote=i.a.summernote||{lang:{}},i.a.extend(i.a.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window",useProtocol:"Use default protocol"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"},output:{noSelection:"No Selection Made!"}}});var r="function"==typeof define&&n(2),a=["sans-serif","serif","monospace","cursive","fantasy"];function s(t){return-1===i.a.inArray(t.toLowerCase(),a)?"'".concat(t,"'"):t}var l,c=navigator.userAgent,u=/MSIE|Trident/i.test(c);if(u){var d=/MSIE (\d+[.]\d+)/.exec(c);d&&(l=parseFloat(d[1])),(d=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(c))&&(l=parseFloat(d[1]))}var h=/Edge\/\d+/.test(c),f=!!window.CodeMirror,p="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,m=u?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",v={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:u,isEdge:h,isFF:!h&&/firefox/i.test(c),isPhantom:/PhantomJS/i.test(c),isWebkit:!h&&/webkit/i.test(c),isChrome:!h&&/chrome/i.test(c),isSafari:!h&&/safari/i.test(c)&&!/chrome/i.test(c),browserVersion:l,jqueryVersion:parseFloat(i.a.fn.jquery),isSupportAmd:r,isSupportTouch:p,hasCodeMirror:f,isFontInstalled:function(t){var e="Comic Sans MS"===t?"Courier New":"Comic Sans MS",n=document.createElement("canvas").getContext("2d");n.font="200px '"+e+"'";var o=n.measureText("mmmmmmmmmmwwwww").width;return n.font="200px "+s(t)+', "'+e+'"',o!==n.measureText("mmmmmmmmmmwwwww").width},isW3CRangeSupport:!!document.createRange,inputEventName:m,genericFontFamilies:a,validFontName:s};var g=0;var b={eq:function(t){return function(e){return t===e}},eq2:function(t,e){return t===e},peq2:function(t){return function(e,n){return e[t]===n[t]}},ok:function(){return!0},fail:function(){return!1},self:function(t){return t},not:function(t){return function(){return!t.apply(t,arguments)}},and:function(t,e){return function(n){return t(n)&&e(n)}},invoke:function(t,e){return function(){return t[e].apply(t,arguments)}},resetUniqueId:function(){g=0},uniqueId:function(t){var e=++g+"";return t?t+e:e},rect2bnd:function(t){var e=i()(document);return{top:t.top+e.scrollTop(),left:t.left+e.scrollLeft(),width:t.right-t.left,height:t.bottom-t.top}},invertObject:function(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[t[n]]=n);return e},namespaceToCamel:function(t,e){return(e=e||"")+t.split(".").map((function(t){return t.substring(0,1).toUpperCase()+t.substring(1)})).join("")},debounce:function(t,e,n){var o;return function(){var i=this,r=arguments,a=function(){o=null,n||t.apply(i,r)},s=n&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(i,r)}},isValidUrl:function(t){return/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)}};function k(t){return t[0]}function y(t){return t[t.length-1]}function w(t){return t.slice(1)}function C(t,e){if(t&&t.length&&e){if(t.indexOf)return-1!==t.indexOf(e);if(t.contains)return t.contains(e)}return!1}var x={head:k,last:y,initial:function(t){return t.slice(0,t.length-1)},tail:w,prev:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n-1]}return null},next:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n+1]}return null},find:function(t,e){for(var n=0,o=t.length;n<o;n++){var i=t[n];if(e(i))return i}},contains:C,all:function(t,e){for(var n=0,o=t.length;n<o;n++)if(!e(t[n]))return!1;return!0},sum:function(t,e){return e=e||b.self,t.reduce((function(t,n){return t+e(n)}),0)},from:function(t){for(var e=[],n=t.length,o=-1;++o<n;)e[o]=t[o];return e},isEmpty:function(t){return!t||!t.length},clusterBy:function(t,e){return t.length?w(t).reduce((function(t,n){var o=y(t);return e(y(o),n)?o[o.length]=n:t[t.length]=[n],t}),[[k(t)]]):[]},compact:function(t){for(var e=[],n=0,o=t.length;n<o;n++)t[n]&&e.push(t[n]);return e},unique:function(t){for(var e=[],n=0,o=t.length;n<o;n++)C(e,t[n])||e.push(t[n]);return e}},S=String.fromCharCode(160);function T(t){return t&&i()(t).hasClass("note-editable")}function $(t){return t=t.toUpperCase(),function(e){return e&&e.nodeName.toUpperCase()===t}}function E(t){return t&&3===t.nodeType}function I(t){return t&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(t.nodeName.toUpperCase())}function N(t){return!T(t)&&(t&&/^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))}var P=$("PRE"),R=$("LI");var L=$("TABLE"),A=$("DATA");function F(t){return!(M(t)||D(t)||H(t)||N(t)||L(t)||z(t)||A(t))}function D(t){return t&&/^UL|^OL/.test(t.nodeName.toUpperCase())}var H=$("HR");function B(t){return t&&/^TD|^TH/.test(t.nodeName.toUpperCase())}var z=$("BLOCKQUOTE");function M(t){return B(t)||z(t)||T(t)}var O=$("A");var j=$("BODY");var U=v.isMSIE&&v.browserVersion<11?" ":"<br>";function W(t){return E(t)?t.nodeValue.length:t?t.childNodes.length:0}function K(t){var e=W(t);return 0===e||(!E(t)&&1===e&&t.innerHTML===U||!(!x.all(t.childNodes,E)||""!==t.innerHTML))}function q(t){I(t)||W(t)||(t.innerHTML=U)}function V(t,e){for(;t;){if(e(t))return t;if(T(t))break;t=t.parentNode}return null}function _(t,e){e=e||b.fail;var n=[];return V(t,(function(t){return T(t)||n.push(t),e(t)})),n}function G(t,e){e=e||b.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.nextSibling;return n}function Y(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function Z(t,e){return i.a.each(e,(function(e,n){t.appendChild(n)})),t}function X(t){return 0===t.offset}function Q(t){return t.offset===W(t.node)}function J(t){return X(t)||Q(t)}function tt(t,e){for(;t&&t!==e;){if(0!==nt(t))return!1;t=t.parentNode}return!0}function et(t,e){if(!e)return!1;for(;t&&t!==e;){if(nt(t)!==W(t.parentNode)-1)return!1;t=t.parentNode}return!0}function nt(t){for(var e=0;t=t.previousSibling;)e+=1;return e}function ot(t){return!!(t&&t.childNodes&&t.childNodes.length)}function it(t,e){var n,o;if(0===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)}else ot(t.node)?o=W(n=t.node.childNodes[t.offset-1]):(n=t.node,o=e?0:t.offset-1);return{node:n,offset:o}}function rt(t,e){var n,o;if(K(t.node))return null;if(W(t.node)===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)+1}else if(ot(t.node)){if(o=0,K(n=t.node.childNodes[t.offset]))return null}else if(n=t.node,o=e?W(t.node):t.offset+1,K(n))return null;return{node:n,offset:o}}function at(t,e){return t.node===e.node&&t.offset===e.offset}function st(t,e){var n=e&&e.isSkipPaddingBlankHTML,o=e&&e.isNotSplitEdgePoint,i=e&&e.isDiscardEmptySplits;if(i&&(n=!0),J(t)&&(E(t.node)||o)){if(X(t))return t.node;if(Q(t))return t.node.nextSibling}if(E(t.node))return t.node.splitText(t.offset);var r=t.node.childNodes[t.offset],a=Y(t.node.cloneNode(!1),t.node);return Z(a,G(r)),n||(q(t.node),q(a)),i&&(K(t.node)&&ut(t.node),K(a))?(ut(a),t.node.nextSibling):a}function lt(t,e,n){var o=_(e.node,b.eq(t));return o.length?1===o.length?st(e,n):o.reduce((function(t,o){return t===e.node&&(t=st(e,n)),st({node:o,offset:t?nt(t):W(o)},n)})):null}function ct(t){return document.createElement(t)}function ut(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var n=t.parentNode;if(!e){for(var o=[],i=0,r=t.childNodes.length;i<r;i++)o.push(t.childNodes[i]);for(var a=0,s=o.length;a<s;a++)n.insertBefore(o[a],t)}n.removeChild(t)}}var dt=$("TEXTAREA");function ht(t,e){var n=dt(t[0])?t.val():t.html();return e?n.replace(/[\n\r]/g,""):n}var ft={NBSP_CHAR:S,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:U,emptyPara:"<p>".concat(U,"</p>"),makePredByNodeName:$,isEditable:T,isControlSizing:function(t){return t&&i()(t).hasClass("note-control-sizing")},isText:E,isElement:function(t){return t&&1===t.nodeType},isVoid:I,isPara:N,isPurePara:function(t){return N(t)&&!R(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:F,isBlock:b.not(F),isBodyInline:function(t){return F(t)&&!V(t,N)},isBody:j,isParaInline:function(t){return F(t)&&!!V(t,N)},isPre:P,isList:D,isTable:L,isData:A,isCell:B,isBlockquote:z,isBodyContainer:M,isAnchor:O,isDiv:$("DIV"),isLi:R,isBR:$("BR"),isSpan:$("SPAN"),isB:$("B"),isU:$("U"),isS:$("S"),isI:$("I"),isImg:$("IMG"),isTextarea:dt,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return K(t)},isEmpty:K,isEmptyAnchor:b.and(O,K),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||b.ok;var n=[];return t.previousSibling&&e(t.previousSibling)&&n.push(t.previousSibling),n.push(t),t.nextSibling&&e(t.nextSibling)&&n.push(t.nextSibling),n},nodeLength:W,isLeftEdgePoint:X,isRightEdgePoint:Q,isEdgePoint:J,isLeftEdgeOf:tt,isRightEdgeOf:et,isLeftEdgePointOf:function(t,e){return X(t)&&tt(t.node,e)},isRightEdgePointOf:function(t,e){return Q(t)&&et(t.node,e)},prevPoint:it,nextPoint:rt,isSamePoint:at,isVisiblePoint:function(t){if(E(t.node)||!ot(t.node)||K(t.node))return!0;var e=t.node.childNodes[t.offset-1],n=t.node.childNodes[t.offset];return!(e&&!I(e)||n&&!I(n))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=it(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=rt(t)}return null},isCharPoint:function(t){if(!E(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==S},isSpacePoint:function(t){if(!E(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return" "===e||e===S},walkPoint:function(t,e,n,o){for(var i=t;i&&(n(i),!at(i,e));){i=rt(i,o&&t.node!==i.node&&e.node!==i.node)}},ancestor:V,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===W(t);){if(e(t))return t;if(T(t))break;t=t.parentNode}return null},listAncestor:_,lastAncestor:function(t,e){var n=_(t);return x.last(n.filter(e))},listNext:G,listPrev:function(t,e){e=e||b.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.previousSibling;return n},listDescendant:function(t,e){var n=[];return e=e||b.ok,function o(i){t!==i&&e(i)&&n.push(i);for(var r=0,a=i.childNodes.length;r<a;r++)o(i.childNodes[r])}(t),n},commonAncestor:function(t,e){for(var n=_(t),o=e;o;o=o.parentNode)if(n.indexOf(o)>-1)return o;return null},wrap:function(t,e){var n=t.parentNode,o=i()("<"+e+">")[0];return n.insertBefore(o,t),o.appendChild(t),o},insertAfter:Y,appendChildNodes:Z,position:nt,hasChildren:ot,makeOffsetPath:function(t,e){return _(e,b.eq(t)).map(nt).reverse()},fromOffsetPath:function(t,e){for(var n=t,o=0,i=e.length;o<i;o++)n=n.childNodes.length<=e[o]?n.childNodes[n.childNodes.length-1]:n.childNodes[e[o]];return n},splitTree:lt,splitPoint:function(t,e){var n,o,i=e?N:M,r=_(t.node,i),a=x.last(r)||t.node;i(a)?(n=r[r.length-2],o=a):o=(n=a).parentNode;var s=n&<(n,t,{isSkipPaddingBlankHTML:e,isNotSplitEdgePoint:e});return s||o!==t.node||(s=t.node.childNodes[t.offset]),{rightNode:s,container:o}},create:ct,createText:function(t){return document.createTextNode(t)},remove:ut,removeWhile:function(t,e){for(;t&&!T(t)&&e(t);){var n=t.parentNode;ut(t),t=n}},replace:function(t,e){if(t.nodeName.toUpperCase()===e.toUpperCase())return t;var n=ct(e);return t.style.cssText&&(n.style.cssText=t.style.cssText),Z(n,x.from(t.childNodes)),Y(n,t),ut(t),n},html:function(t,e){var n=ht(t);if(e){n=(n=n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g,(function(t,e,n){n=n.toUpperCase();var o=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!e,i=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return t+(o||i?"\n":"")}))).trim()}return n},value:ht,posFromPlaceholder:function(t){var e=i()(t),n=e.offset(),o=e.outerHeight(!0);return{left:n.left,top:n.top+o}},attachEvents:function(t,e){Object.keys(e).forEach((function(n){t.on(n,e[n])}))},detachEvents:function(t,e){Object.keys(e).forEach((function(n){t.off(n,e[n])}))},isCustomStyleTag:function(t){return t&&!E(t)&&x.contains(t.classList,"note-styletag")}};function pt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var mt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$note=e,this.memos={},this.modules={},this.layoutInfo={},this.options=i.a.extend(!0,{},n),i.a.summernote.ui=i.a.summernote.ui_template(this.options),this.ui=i.a.summernote.ui,this.initialize()}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}},{key:"destroy",value:function(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}},{key:"reset",value:function(){var t=this.isDisabled();this.code(ft.emptyPara),this._destroy(),this._initialize(),t&&this.disable()}},{key:"_initialize",value:function(){var t=this;this.options.id=b.uniqueId(i.a.now()),this.options.container=this.options.container||this.layoutInfo.editor;var e=i.a.extend({},this.options.buttons);Object.keys(e).forEach((function(n){t.memo("button."+n,e[n])}));var n=i.a.extend({},this.options.modules,i.a.summernote.plugins||{});Object.keys(n).forEach((function(e){t.module(e,n[e],!0)})),Object.keys(this.modules).forEach((function(e){t.initializeModule(e)}))}},{key:"_destroy",value:function(){var t=this;Object.keys(this.modules).reverse().forEach((function(e){t.removeModule(e)})),Object.keys(this.memos).forEach((function(e){t.removeMemo(e)})),this.triggerEvent("destroy",this)}},{key:"code",value:function(t){var e=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),e?this.layoutInfo.codable.val():this.layoutInfo.editable.html();e?this.layoutInfo.codable.val(t):this.layoutInfo.editable.html(t),this.$note.val(t),this.triggerEvent("change",t,this.layoutInfo.editable)}},{key:"isDisabled",value:function(){return"false"===this.layoutInfo.editable.attr("contenteditable")}},{key:"enable",value:function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}},{key:"disable",value:function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}},{key:"triggerEvent",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=this.options.callbacks[b.namespaceToCamel(t,"on")];n&&n.apply(this.$note[0],e),this.$note.trigger("summernote."+t,e)}},{key:"initializeModule",value:function(t){var e=this.modules[t];e.shouldInitialize=e.shouldInitialize||b.ok,e.shouldInitialize()&&(e.initialize&&e.initialize(),e.events&&ft.attachEvents(this.$note,e.events))}},{key:"module",value:function(t,e,n){if(1===arguments.length)return this.modules[t];this.modules[t]=new e(this),n||this.initializeModule(t)}},{key:"removeModule",value:function(t){var e=this.modules[t];e.shouldInitialize()&&(e.events&&ft.detachEvents(this.$note,e.events),e.destroy&&e.destroy()),delete this.modules[t]}},{key:"memo",value:function(t,e){if(1===arguments.length)return this.memos[t];this.memos[t]=e}},{key:"removeMemo",value:function(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]}},{key:"createInvokeHandlerAndUpdateState",value:function(t,e){var n=this;return function(o){n.createInvokeHandler(t,e)(o),n.invoke("buttons.updateCurrentStyle")}}},{key:"createInvokeHandler",value:function(t,e){var n=this;return function(o){o.preventDefault();var r=i()(o.target);n.invoke(t,e||r.closest("[data-value]").data("value"),r)}}},{key:"invoke",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=t.split("."),o=n.length>1,i=o&&x.head(n),r=o?x.last(n):x.head(n),a=this.modules[i||"editor"];return!i&&this[r]?this[r].apply(this,e):a&&a[r]&&a.shouldInitialize()?a[r].apply(a,e):void 0}}])&&pt(e.prototype,n),o&&pt(e,o),t}();function vt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function gt(t,e){var n,o,i=t.parentElement(),r=document.body.createTextRange(),a=x.from(i.childNodes);for(n=0;n<a.length;n++)if(!ft.isText(a[n])){if(r.moveToElementText(a[n]),r.compareEndPoints("StartToStart",t)>=0)break;o=a[n]}if(0!==n&&ft.isText(a[n-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(o||i),s.collapse(!o),l=o?o.nextSibling:i.firstChild;var c=t.duplicate();c.setEndPoint("StartToStart",s);for(var u=c.text.replace(/[\r\n]/g,"").length;u>l.nodeValue.length&&l.nextSibling;)u-=l.nodeValue.length,l=l.nextSibling;l.nodeValue;e&&l.nextSibling&&ft.isText(l.nextSibling)&&u===l.nodeValue.length&&(u-=l.nodeValue.length,l=l.nextSibling),i=l,n=u}return{cont:i,offset:n}}function bt(t){var e=document.body.createTextRange(),n=function t(e,n){var o,i;if(ft.isText(e)){var r=ft.listPrev(e,b.not(ft.isText)),a=x.last(r).previousSibling;o=a||e.parentNode,n+=x.sum(x.tail(r),ft.nodeLength),i=!a}else{if(o=e.childNodes[n]||e,ft.isText(o))return t(o,0);n=0,i=!1}return{node:o,collapseToStart:i,offset:n}}(t.node,t.offset);return e.moveToElementText(n.node),e.collapse(n.collapseToStart),e.moveStart("character",n.offset),e}i.a.fn.extend({summernote:function(){var t=i.a.type(x.head(arguments)),e="string"===t,n="object"===t,o=i.a.extend({},i.a.summernote.options,n?x.head(arguments):{});o.langInfo=i.a.extend(!0,{},i.a.summernote.lang["en-US"],i.a.summernote.lang[o.lang]),o.icons=i.a.extend(!0,{},i.a.summernote.options.icons,o.icons),o.tooltip="auto"===o.tooltip?!v.isSupportTouch:o.tooltip,this.each((function(t,e){var n=i()(e);if(!n.data("summernote")){var r=new mt(n,o);n.data("summernote",r),n.data("summernote").triggerEvent("init",r.layoutInfo)}}));var r=this.first();if(r.length){var a=r.data("summernote");if(e)return a.invoke.apply(a,x.from(arguments));o.focus&&a.invoke("editor.focus")}return this}});var kt=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sc=e,this.so=n,this.ec=o,this.eo=i,this.isOnEditable=this.makeIsOn(ft.isEditable),this.isOnList=this.makeIsOn(ft.isList),this.isOnAnchor=this.makeIsOn(ft.isAnchor),this.isOnCell=this.makeIsOn(ft.isCell),this.isOnData=this.makeIsOn(ft.isData)}var e,n,o;return e=t,(n=[{key:"nativeRange",value:function(){if(v.isW3CRangeSupport){var t=document.createRange();return t.setStart(this.sc,this.sc.data&&this.so>this.sc.data.length?0:this.so),t.setEnd(this.ec,this.sc.data?Math.min(this.eo,this.sc.data.length):this.eo),t}var e=bt({node:this.sc,offset:this.so});return e.setEndPoint("EndToEnd",bt({node:this.ec,offset:this.eo})),e}},{key:"getPoints",value:function(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function(){var t=this.nativeRange();if(v.isW3CRangeSupport){var e=document.getSelection();e.rangeCount>0&&e.removeAllRanges(),e.addRange(t)}else t.select();return this}},{key:"scrollIntoView",value:function(t){var e=i()(t).height();return t.scrollTop+e<this.sc.offsetTop&&(t.scrollTop+=Math.abs(t.scrollTop+e-this.sc.offsetTop)),this}},{key:"normalize",value:function(){var e=function(t,e){if(!t)return t;if(ft.isVisiblePoint(t)&&(!ft.isEdgePoint(t)||ft.isRightEdgePoint(t)&&!e||ft.isLeftEdgePoint(t)&&e||ft.isRightEdgePoint(t)&&e&&ft.isVoid(t.node.nextSibling)||ft.isLeftEdgePoint(t)&&!e&&ft.isVoid(t.node.previousSibling)||ft.isBlock(t.node)&&ft.isEmpty(t.node)))return t;var n=ft.ancestor(t.node,ft.isBlock),o=!1;if(!o){var i=ft.prevPoint(t)||{node:null};o=(ft.isLeftEdgePointOf(t,n)||ft.isVoid(i.node))&&!e}var r=!1;if(!r){var a=ft.nextPoint(t)||{node:null};r=(ft.isRightEdgePointOf(t,n)||ft.isVoid(a.node))&&e}if(o||r){if(ft.isVisiblePoint(t))return t;e=!e}return(e?ft.nextPointUntil(ft.nextPoint(t),ft.isVisiblePoint):ft.prevPointUntil(ft.prevPoint(t),ft.isVisiblePoint))||t},n=e(this.getEndPoint(),!1),o=this.isCollapsed()?n:e(this.getStartPoint(),!0);return new t(o.node,o.offset,n.node,n.offset)}},{key:"nodes",value:function(t,e){t=t||b.ok;var n=e&&e.includeAncestor,o=e&&e.fullyContains,i=this.getStartPoint(),r=this.getEndPoint(),a=[],s=[];return ft.walkPoint(i,r,(function(e){var i;ft.isEditable(e.node)||(o?(ft.isLeftEdgePoint(e)&&s.push(e.node),ft.isRightEdgePoint(e)&&x.contains(s,e.node)&&(i=e.node)):i=n?ft.ancestor(e.node,t):e.node,i&&t(i)&&a.push(i))}),!0),x.unique(a)}},{key:"commonAncestor",value:function(){return ft.commonAncestor(this.sc,this.ec)}},{key:"expand",value:function(e){var n=ft.ancestor(this.sc,e),o=ft.ancestor(this.ec,e);if(!n&&!o)return new t(this.sc,this.so,this.ec,this.eo);var i=this.getPoints();return n&&(i.sc=n,i.so=0),o&&(i.ec=o,i.eo=ft.nodeLength(o)),new t(i.sc,i.so,i.ec,i.eo)}},{key:"collapse",value:function(e){return e?new t(this.sc,this.so,this.sc,this.so):new t(this.ec,this.eo,this.ec,this.eo)}},{key:"splitText",value:function(){var e=this.sc===this.ec,n=this.getPoints();return ft.isText(this.ec)&&!ft.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),ft.isText(this.sc)&&!ft.isEdgePoint(this.getStartPoint())&&(n.sc=this.sc.splitText(this.so),n.so=0,e&&(n.ec=n.sc,n.eo=this.eo-this.so)),new t(n.sc,n.so,n.ec,n.eo)}},{key:"deleteContents",value:function(){if(this.isCollapsed())return this;var e=this.splitText(),n=e.nodes(null,{fullyContains:!0}),o=ft.prevPointUntil(e.getStartPoint(),(function(t){return!x.contains(n,t.node)})),r=[];return i.a.each(n,(function(t,e){var n=e.parentNode;o.node!==n&&1===ft.nodeLength(n)&&r.push(n),ft.remove(e,!1)})),i.a.each(r,(function(t,e){ft.remove(e,!1)})),new t(o.node,o.offset,o.node,o.offset).normalize()}},{key:"makeIsOn",value:function(t){return function(){var e=ft.ancestor(this.sc,t);return!!e&&e===ft.ancestor(this.ec,t)}}},{key:"isLeftEdgeOf",value:function(t){if(!ft.isLeftEdgePoint(this.getStartPoint()))return!1;var e=ft.ancestor(this.sc,t);return e&&ft.isLeftEdgeOf(this.sc,e)}},{key:"isCollapsed",value:function(){return this.sc===this.ec&&this.so===this.eo}},{key:"wrapBodyInlineWithPara",value:function(){if(ft.isBodyContainer(this.sc)&&ft.isEmpty(this.sc))return this.sc.innerHTML=ft.emptyPara,new t(this.sc.firstChild,0,this.sc.firstChild,0);var e,n=this.normalize();if(ft.isParaInline(this.sc)||ft.isPara(this.sc))return n;if(ft.isInline(n.sc)){var o=ft.listAncestor(n.sc,b.not(ft.isInline));e=x.last(o),ft.isInline(e)||(e=o[o.length-2]||n.sc.childNodes[n.so])}else e=n.sc.childNodes[n.so>0?n.so-1:0];if(e){var i=ft.listPrev(e,ft.isParaInline).reverse();if((i=i.concat(ft.listNext(e.nextSibling,ft.isParaInline))).length){var r=ft.wrap(x.head(i),"p");ft.appendChildNodes(r,x.tail(i))}}return this.normalize()}},{key:"insertNode",value:function(t){var e=this;(ft.isText(t)||ft.isInline(t))&&(e=this.wrapBodyInlineWithPara().deleteContents());var n=ft.splitPoint(e.getStartPoint(),ft.isInline(t));return n.rightNode?n.rightNode.parentNode.insertBefore(t,n.rightNode):n.container.appendChild(t),t}},{key:"pasteHTML",value:function(t){t=i.a.trim(t);var e=i()("<div></div>").html(t)[0],n=x.from(e.childNodes),o=this;return o.so>=0&&(n=n.reverse()),n=n.map((function(t){return o.insertNode(t)})),o.so>0&&(n=n.reverse()),n}},{key:"toString",value:function(){var t=this.nativeRange();return v.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(e){var n=this.getEndPoint();if(!ft.isCharPoint(n))return this;var o=ft.prevPointUntil(n,(function(t){return!ft.isCharPoint(t)}));return e&&(n=ft.nextPointUntil(n,(function(t){return!ft.isCharPoint(t)}))),new t(o.node,o.offset,n.node,n.offset)}},{key:"getWordsRange",value:function(e){var n=this.getEndPoint(),o=function(t){return!ft.isCharPoint(t)&&!ft.isSpacePoint(t)};if(o(n))return this;var i=ft.prevPointUntil(n,o);return e&&(n=ft.nextPointUntil(n,o)),new t(i.node,i.offset,n.node,n.offset)}},{key:"getWordsMatchRange",value:function(e){var n=this.getEndPoint(),o=ft.prevPointUntil(n,(function(o){if(!ft.isCharPoint(o)&&!ft.isSpacePoint(o))return!0;var i=new t(o.node,o.offset,n.node,n.offset),r=e.exec(i.toString());return r&&0===r.index})),i=new t(o.node,o.offset,n.node,n.offset),r=i.toString(),a=e.exec(r);return a&&a[0].length===r.length?i:null}},{key:"bookmark",value:function(t){return{s:{path:ft.makeOffsetPath(t,this.sc),offset:this.so},e:{path:ft.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:x.tail(ft.makeOffsetPath(x.head(t),this.sc)),offset:this.so},e:{path:x.tail(ft.makeOffsetPath(x.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}])&&vt(e.prototype,n),o&&vt(e,o),t}(),yt={create:function(t,e,n,o){if(4===arguments.length)return new kt(t,e,n,o);if(2===arguments.length)return new kt(t,e,n=t,o=e);var i=this.createFromSelection();if(!i&&1===arguments.length){var r=arguments[0];return ft.isEditable(r)&&(r=r.lastChild),this.createFromBodyElement(r,ft.emptyPara===arguments[0].innerHTML)}return i},createFromBodyElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.createFromNode(t);return n.collapse(e)},createFromSelection:function(){var t,e,n,o;if(v.isW3CRangeSupport){var i=document.getSelection();if(!i||0===i.rangeCount)return null;if(ft.isBody(i.anchorNode))return null;var r=i.getRangeAt(0);t=r.startContainer,e=r.startOffset,n=r.endContainer,o=r.endOffset}else{var a=document.selection.createRange(),s=a.duplicate();s.collapse(!1);var l=a;l.collapse(!0);var c=gt(l,!0),u=gt(s,!1);ft.isText(c.node)&&ft.isLeftEdgePoint(c)&&ft.isTextNode(u.node)&&ft.isRightEdgePoint(u)&&u.node.nextSibling===c.node&&(c=u),t=c.cont,e=c.offset,n=u.cont,o=u.offset}return new kt(t,e,n,o)},createFromNode:function(t){var e=t,n=0,o=t,i=ft.nodeLength(o);return ft.isVoid(e)&&(n=ft.listPrev(e).length-1,e=e.parentNode),ft.isBR(o)?(i=ft.listPrev(o).length-1,o=o.parentNode):ft.isVoid(o)&&(i=ft.listPrev(o).length,o=o.parentNode),this.create(e,n,o,i)},createFromNodeBefore:function(t){return this.createFromNode(t).collapse(!0)},createFromNodeAfter:function(t){return this.createFromNode(t).collapse()},createFromBookmark:function(t,e){var n=ft.fromOffsetPath(t,e.s.path),o=e.s.offset,i=ft.fromOffsetPath(t,e.e.path),r=e.e.offset;return new kt(n,o,i,r)},createFromParaBookmark:function(t,e){var n=t.s.offset,o=t.e.offset,i=ft.fromOffsetPath(x.head(e),t.s.path),r=ft.fromOffsetPath(x.last(e),t.e.path);return new kt(i,n,r,o)}},wt={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34},Ct={isEdit:function(t){return x.contains([wt.BACKSPACE,wt.TAB,wt.ENTER,wt.SPACE,wt.DELETE],t)},isMove:function(t){return x.contains([wt.LEFT,wt.UP,wt.RIGHT,wt.DOWN],t)},isNavigation:function(t){return x.contains([wt.HOME,wt.END,wt.PAGEUP,wt.PAGEDOWN],t)},nameFromCode:b.invertObject(wt),code:wt};function xt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var St=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stack=[],this.stackOffset=-1,this.context=e,this.$editable=e.layoutInfo.editable,this.editable=this.$editable[0]}var e,n,o;return e=t,(n=[{key:"makeSnapshot",value:function(){var t=yt.create(this.editable);return{contents:this.$editable.html(),bookmark:t&&t.isOnEditable()?t.bookmark(this.editable):{s:{path:[],offset:0},e:{path:[],offset:0}}}}},{key:"applySnapshot",value:function(t){null!==t.contents&&this.$editable.html(t.contents),null!==t.bookmark&&yt.createFromBookmark(this.editable,t.bookmark).select()}},{key:"rewind",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}},{key:"commit",value:function(){this.stack=[],this.stackOffset=-1,this.recordUndo()}},{key:"reset",value:function(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}},{key:"undo",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset>0&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"redo",value:function(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),this.stackOffset-=1)}}])&&xt(e.prototype,n),o&&xt(e,o),t}();function Tt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var $t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"jQueryCSS",value:function(t,e){if(v.jqueryVersion<1.9){var n={};return i.a.each(e,(function(e,o){n[o]=t.css(o)})),n}return t.css(e)}},{key:"fromNode",value:function(t){var e=this.jQueryCSS(t,["font-family","font-size","text-align","list-style-type","line-height"])||{},n=t[0].style.fontSize||e["font-size"];return e["font-size"]=parseInt(n,10),e["font-size-unit"]=n.match(/[a-z%]+$/),e}},{key:"stylePara",value:function(t,e){i.a.each(t.nodes(ft.isPara,{includeAncestor:!0}),(function(t,n){i()(n).css(e)}))}},{key:"styleNodes",value:function(t,e){t=t.splitText();var n=e&&e.nodeName||"SPAN",o=!(!e||!e.expandClosestSibling),r=!(!e||!e.onlyPartialContains);if(t.isCollapsed())return[t.insertNode(ft.create(n))];var a=ft.makePredByNodeName(n),s=t.nodes(ft.isText,{fullyContains:!0}).map((function(t){return ft.singleChildAncestor(t,a)||ft.wrap(t,n)}));if(o){if(r){var l=t.nodes();a=b.and(a,(function(t){return x.contains(l,t)}))}return s.map((function(t){var e=ft.withClosestSiblings(t,a),n=x.head(e),o=x.tail(e);return i.a.each(o,(function(t,e){ft.appendChildNodes(n,e.childNodes),ft.remove(e)})),x.head(e)}))}return s}},{key:"current",value:function(t){var e=i()(ft.isElement(t.sc)?t.sc:t.sc.parentNode),n=this.fromNode(e);try{n=i.a.extend(n,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||n["font-family"]})}catch(t){}if(t.isOnList()){var o=["circle","disc","disc-leading-zero","square"].indexOf(n["list-style-type"])>-1;n["list-style"]=o?"unordered":"ordered"}else n["list-style"]="none";var r=ft.ancestor(t.sc,ft.isPara);if(r&&r.style["line-height"])n["line-height"]=r.style.lineHeight;else{var a=parseInt(n["line-height"],10)/parseInt(n["font-size"],10);n["line-height"]=a.toFixed(1)}return n.anchor=t.isOnAnchor()&&ft.ancestor(t.sc,ft.isAnchor),n.ancestors=ft.listAncestor(t.sc,ft.isEditable),n.range=t,n}}])&&Tt(e.prototype,n),o&&Tt(e,o),t}();function Et(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var It=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"insertOrderedList",value:function(t){this.toggleList("OL",t)}},{key:"insertUnorderedList",value:function(t){this.toggleList("UL",t)}},{key:"indent",value:function(t){var e=this,n=yt.create(t).wrapBodyInlineWithPara(),o=n.nodes(ft.isPara,{includeAncestor:!0}),r=x.clusterBy(o,b.peq2("parentNode"));i.a.each(r,(function(t,n){var o=x.head(n);if(ft.isLi(o)){var r=e.findList(o.previousSibling);r?n.map((function(t){return r.appendChild(t)})):(e.wrapList(n,o.parentNode.nodeName),n.map((function(t){return t.parentNode})).map((function(t){return e.appendToPrevious(t)})))}else i.a.each(n,(function(t,e){i()(e).css("marginLeft",(function(t,e){return(parseInt(e,10)||0)+25}))}))})),n.select()}},{key:"outdent",value:function(t){var e=this,n=yt.create(t).wrapBodyInlineWithPara(),o=n.nodes(ft.isPara,{includeAncestor:!0}),r=x.clusterBy(o,b.peq2("parentNode"));i.a.each(r,(function(t,n){var o=x.head(n);ft.isLi(o)?e.releaseList([n]):i.a.each(n,(function(t,e){i()(e).css("marginLeft",(function(t,e){return(e=parseInt(e,10)||0)>25?e-25:""}))}))})),n.select()}},{key:"toggleList",value:function(t,e){var n=this,o=yt.create(e).wrapBodyInlineWithPara(),r=o.nodes(ft.isPara,{includeAncestor:!0}),a=o.paraBookmark(r),s=x.clusterBy(r,b.peq2("parentNode"));if(x.find(r,ft.isPurePara)){var l=[];i.a.each(s,(function(e,o){l=l.concat(n.wrapList(o,t))})),r=l}else{var c=o.nodes(ft.isList,{includeAncestor:!0}).filter((function(e){return!i.a.nodeName(e,t)}));c.length?i.a.each(c,(function(e,n){ft.replace(n,t)})):r=this.releaseList(s,!0)}yt.createFromParaBookmark(a,r).select()}},{key:"wrapList",value:function(t,e){var n=x.head(t),o=x.last(t),i=ft.isList(n.previousSibling)&&n.previousSibling,r=ft.isList(o.nextSibling)&&o.nextSibling,a=i||ft.insertAfter(ft.create(e||"UL"),o);return t=t.map((function(t){return ft.isPurePara(t)?ft.replace(t,"LI"):t})),ft.appendChildNodes(a,t),r&&(ft.appendChildNodes(a,x.from(r.childNodes)),ft.remove(r)),t}},{key:"releaseList",value:function(t,e){var n=this,o=[];return i.a.each(t,(function(t,r){var a=x.head(r),s=x.last(r),l=e?ft.lastAncestor(a,ft.isList):a.parentNode,c=l.parentNode;if("LI"===l.parentNode.nodeName)r.map((function(t){var e=n.findNextSiblings(t);c.nextSibling?c.parentNode.insertBefore(t,c.nextSibling):c.parentNode.appendChild(t),e.length&&(n.wrapList(e,l.nodeName),t.appendChild(e[0].parentNode))})),0===l.children.length&&c.removeChild(l),0===c.childNodes.length&&c.parentNode.removeChild(c);else{var u=l.childNodes.length>1?ft.splitTree(l,{node:s.parentNode,offset:ft.position(s)+1},{isSkipPaddingBlankHTML:!0}):null,d=ft.splitTree(l,{node:a.parentNode,offset:ft.position(a)},{isSkipPaddingBlankHTML:!0});r=e?ft.listDescendant(d,ft.isLi):x.from(d.childNodes).filter(ft.isLi),!e&&ft.isList(l.parentNode)||(r=r.map((function(t){return ft.replace(t,"P")}))),i.a.each(x.from(r).reverse(),(function(t,e){ft.insertAfter(e,l)}));var h=x.compact([l,d,u]);i.a.each(h,(function(t,e){var n=[e].concat(ft.listDescendant(e,ft.isList));i.a.each(n.reverse(),(function(t,e){ft.nodeLength(e)||ft.remove(e,!0)}))}))}o=o.concat(r)})),o}},{key:"appendToPrevious",value:function(t){return t.previousSibling?ft.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}},{key:"findList",value:function(t){return t?x.find(t.children,(function(t){return["OL","UL"].indexOf(t.nodeName)>-1})):null}},{key:"findNextSiblings",value:function(t){for(var e=[];t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}])&&Et(e.prototype,n),o&&Et(e,o),t}();function Nt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Pt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bullet=new It,this.options=e.options}var e,n,o;return e=t,(n=[{key:"insertTab",value:function(t,e){var n=ft.createText(new Array(e+1).join(ft.NBSP_CHAR));(t=t.deleteContents()).insertNode(n,!0),(t=yt.create(n,e)).select()}},{key:"insertParagraph",value:function(t,e){e=(e=(e=e||yt.create(t)).deleteContents()).wrapBodyInlineWithPara();var n,o=ft.ancestor(e.sc,ft.isPara);if(o){if(ft.isLi(o)&&(ft.isEmpty(o)||ft.deepestChildIsEmpty(o)))return void this.bullet.toggleList(o.parentNode.nodeName);var r=null;if(1===this.options.blockquoteBreakingLevel?r=ft.ancestor(o,ft.isBlockquote):2===this.options.blockquoteBreakingLevel&&(r=ft.lastAncestor(o,ft.isBlockquote)),r){n=i()(ft.emptyPara)[0],ft.isRightEdgePoint(e.getStartPoint())&&ft.isBR(e.sc.nextSibling)&&i()(e.sc.nextSibling).remove();var a=ft.splitTree(r,e.getStartPoint(),{isDiscardEmptySplits:!0});a?a.parentNode.insertBefore(n,a):ft.insertAfter(n,r)}else{n=ft.splitTree(o,e.getStartPoint());var s=ft.listDescendant(o,ft.isEmptyAnchor);s=s.concat(ft.listDescendant(n,ft.isEmptyAnchor)),i.a.each(s,(function(t,e){ft.remove(e)})),(ft.isHeading(n)||ft.isPre(n)||ft.isCustomStyleTag(n))&&ft.isEmpty(n)&&(n=ft.replace(n,"p"))}}else{var l=e.sc.childNodes[e.so];n=i()(ft.emptyPara)[0],l?e.sc.insertBefore(n,l):e.sc.appendChild(n)}yt.create(n,0).normalize().select().scrollIntoView(t)}}])&&Nt(e.prototype,n),o&&Nt(e,o),t}();function Rt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Lt=function t(e,n,o,i){var r={colPos:0,rowPos:0},a=[],s=[];function l(t,e,n,o,i,r,s){var l={baseRow:n,baseCell:o,isRowSpan:i,isColSpan:r,isVirtual:s};a[t]||(a[t]=[]),a[t][e]=l}function c(t,e,n,o){return{baseCell:t.baseCell,action:e,virtualTable:{rowIndex:n,cellIndex:o}}}function u(t,e){if(!a[t])return e;if(!a[t][e])return e;for(var n=e;a[t][n];)if(n++,!a[t][n])return n}function d(t,e){var n=u(t.rowIndex,e.cellIndex),o=e.colSpan>1,i=e.rowSpan>1,a=t.rowIndex===r.rowPos&&e.cellIndex===r.colPos;l(t.rowIndex,n,t,e,i,o,!1);var s=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(s>1)for(var c=1;c<s;c++){var d=t.rowIndex+c;h(d,n,e,a),l(d,n,t,e,!0,o,!0)}var f=e.attributes.colSpan?parseInt(e.attributes.colSpan.value,10):0;if(f>1)for(var p=1;p<f;p++){var m=u(t.rowIndex,n+p);h(t.rowIndex,m,e,a),l(t.rowIndex,m,t,e,i,!0,!0)}}function h(t,e,n,o){t===r.rowPos&&r.colPos>=n.cellIndex&&n.cellIndex<=e&&!o&&r.colPos++}function f(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SubtractSpanCount;break;case t.where.Row:if(!e.isVirtual&&e.isRowSpan)return t.resultAction.AddCell;if(e.isRowSpan)return t.resultAction.SubtractSpanCount}return t.resultAction.RemoveCell}function p(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SumSpanCount;if(e.isRowSpan&&e.isVirtual)return t.resultAction.Ignore;break;case t.where.Row:if(e.isRowSpan)return t.resultAction.SumSpanCount;if(e.isColSpan&&e.isVirtual)return t.resultAction.Ignore}return t.resultAction.AddCell}this.getActionList=function(){for(var e=n===t.where.Row?r.rowPos:-1,i=n===t.where.Column?r.colPos:-1,l=0,u=!0;u;){var d=e>=0?e:l,h=i>=0?i:l,m=a[d];if(!m)return u=!1,s;var v=m[h];if(!v)return u=!1,s;var g=t.resultAction.Ignore;switch(o){case t.requestAction.Add:g=p(v);break;case t.requestAction.Delete:g=f(v)}s.push(c(v,g,d,h)),l++}return s},e&&e.tagName&&("td"===e.tagName.toLowerCase()||"th"===e.tagName.toLowerCase())&&(r.colPos=e.cellIndex,e.parentElement&&e.parentElement.tagName&&"tr"===e.parentElement.tagName.toLowerCase()&&(r.rowPos=e.parentElement.rowIndex)),function(){for(var t=i.rows,e=0;e<t.length;e++)for(var n=t[e].cells,o=0;o<n.length;o++)d(t[e],n[o])}()};Lt.where={Row:0,Column:1},Lt.requestAction={Add:0,Delete:1},Lt.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var At=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"tab",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=ft.ancestor(n,ft.isTable),i=ft.listDescendant(o,ft.isCell),r=x[e?"prev":"next"](i,n);r&&yt.create(r,0).select()}},{key:"addRow",value:function(t,e){for(var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=i()(n).closest("tr"),r=this.recoverAttributes(o),a=i()("<tr"+r+"></tr>"),s=new Lt(n,Lt.where.Row,Lt.requestAction.Add,i()(o).closest("table")[0]).getActionList(),l=0;l<s.length;l++){var c=s[l],u=this.recoverAttributes(c.baseCell);switch(c.action){case Lt.resultAction.AddCell:a.append("<td"+u+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("top"===e&&(c.baseCell.parent?c.baseCell.closest("tr").rowIndex:0)<=o[0].rowIndex){var d=i()("<div></div>").append(i()("<td"+u+">"+ft.blank+"</td>").removeAttr("rowspan")).html();a.append(d);break}var h=parseInt(c.baseCell.rowSpan,10);h++,c.baseCell.setAttribute("rowSpan",h)}}if("top"===e)o.before(a);else{if(n.rowSpan>1){var f=o[0].rowIndex+(n.rowSpan-2);return void i()(i()(o).parent().find("tr")[f]).after(i()(a))}o.after(a)}}},{key:"addCol",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=i()(n).closest("tr");i()(o).siblings().push(o);for(var r=new Lt(n,Lt.where.Column,Lt.requestAction.Add,i()(o).closest("table")[0]).getActionList(),a=0;a<r.length;a++){var s=r[a],l=this.recoverAttributes(s.baseCell);switch(s.action){case Lt.resultAction.AddCell:"right"===e?i()(s.baseCell).after("<td"+l+">"+ft.blank+"</td>"):i()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("right"===e){var c=parseInt(s.baseCell.colSpan,10);c++,s.baseCell.setAttribute("colSpan",c)}else i()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var n=t.attributes||[],o=0;o<n.length;o++)"id"!==n[o].name.toLowerCase()&&n[o].specified&&(e+=" "+n[o].name+"='"+n[o].value+"'");return e}},{key:"deleteRow",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=i()(e).closest("tr"),o=n.children("td, th").index(i()(e)),r=n[0].rowIndex,a=new Lt(e,Lt.where.Row,Lt.requestAction.Delete,i()(n).closest("table")[0]).getActionList(),s=0;s<a.length;s++)if(a[s]){var l=a[s].baseCell,c=a[s].virtualTable,u=l.rowSpan&&l.rowSpan>1,d=u?parseInt(l.rowSpan,10):0;switch(a[s].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.AddCell:var h=n.next("tr")[0];if(!h)continue;var f=n[0].cells[o];u&&(d>2?(d--,h.insertBefore(f,h.cells[o]),h.cells[o].setAttribute("rowSpan",d),h.cells[o].innerHTML=""):2===d&&(h.insertBefore(f,h.cells[o]),h.cells[o].removeAttribute("rowSpan"),h.cells[o].innerHTML=""));continue;case Lt.resultAction.SubtractSpanCount:u&&(d>2?(d--,l.setAttribute("rowSpan",d),c.rowIndex!==r&&l.cellIndex===o&&(l.innerHTML="")):2===d&&(l.removeAttribute("rowSpan"),c.rowIndex!==r&&l.cellIndex===o&&(l.innerHTML="")));continue;case Lt.resultAction.RemoveCell:continue}}n.remove()}},{key:"deleteCol",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=i()(e).closest("tr"),o=n.children("td, th").index(i()(e)),r=new Lt(e,Lt.where.Column,Lt.requestAction.Delete,i()(n).closest("table")[0]).getActionList(),a=0;a<r.length;a++)if(r[a])switch(r[a].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.SubtractSpanCount:var s=r[a].baseCell;if(s.colSpan&&s.colSpan>1){var l=s.colSpan?parseInt(s.colSpan,10):0;l>2?(l--,s.setAttribute("colSpan",l),s.cellIndex===o&&(s.innerHTML="")):2===l&&(s.removeAttribute("colSpan"),s.cellIndex===o&&(s.innerHTML=""))}continue;case Lt.resultAction.RemoveCell:ft.remove(r[a].baseCell,!0);continue}}},{key:"createTable",value:function(t,e,n){for(var o,r=[],a=0;a<t;a++)r.push("<td>"+ft.blank+"</td>");o=r.join("");for(var s,l=[],c=0;c<e;c++)l.push("<tr>"+o+"</tr>");s=l.join("");var u=i()("<table>"+s+"</table>");return n&&n.tableClassName&&u.addClass(n.tableClassName),u[0]}},{key:"deleteTable",value:function(t){var e=ft.ancestor(t.commonAncestor(),ft.isCell);i()(e).closest("table").remove()}}])&&Rt(e.prototype,n),o&&Rt(e,o),t}();function Ft(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Dt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$note=e.layoutInfo.note,this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.options=e.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.lastRange=null,this.snapshot=null,this.style=new $t,this.table=new At,this.typing=new Pt(e),this.bullet=new It,this.history=new St(e),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);for(var o=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"],r=0,a=o.length;r<a;r++)this[o[r]]=function(t){return function(e){n.beforeCommand(),document.execCommand(t,!1,e),n.afterCommand(!0)}}(o[r]),this.context.memo("help."+o[r],this.lang.help[o[r]]);this.fontName=this.wrapCommand((function(t){return n.fontStyling("font-family",v.validFontName(t))})),this.fontSize=this.wrapCommand((function(t){var e=n.currentStyle()["font-size-unit"];return n.fontStyling("font-size",t+e)})),this.fontSizeUnit=this.wrapCommand((function(t){var e=n.currentStyle()["font-size"];return n.fontStyling("font-size",e+t)}));for(var s=1;s<=6;s++)this["formatH"+s]=function(t){return function(){n.formatBlock("H"+t)}}(s),this.context.memo("help.formatH"+s,this.lang.help["formatH"+s]);this.insertParagraph=this.wrapCommand((function(){n.typing.insertParagraph(n.editable)})),this.insertOrderedList=this.wrapCommand((function(){n.bullet.insertOrderedList(n.editable)})),this.insertUnorderedList=this.wrapCommand((function(){n.bullet.insertUnorderedList(n.editable)})),this.indent=this.wrapCommand((function(){n.bullet.indent(n.editable)})),this.outdent=this.wrapCommand((function(){n.bullet.outdent(n.editable)})),this.insertNode=this.wrapCommand((function(t){n.isLimited(i()(t).text().length)||(n.getLastRange().insertNode(t),n.setLastRange(yt.createFromNodeAfter(t).select()))})),this.insertText=this.wrapCommand((function(t){if(!n.isLimited(t.length)){var e=n.getLastRange().insertNode(ft.createText(t));n.setLastRange(yt.create(e,ft.nodeLength(e)).select())}})),this.pasteHTML=this.wrapCommand((function(t){if(!n.isLimited(t.length)){t=n.context.invoke("codeview.purify",t);var e=n.getLastRange().pasteHTML(t);n.setLastRange(yt.createFromNodeAfter(x.last(e)).select())}})),this.formatBlock=this.wrapCommand((function(t,e){var o=n.options.callbacks.onApplyCustomStyle;o?o.call(n,e,n.context,n.onFormatBlock):n.onFormatBlock(t,e)})),this.insertHorizontalRule=this.wrapCommand((function(){var t=n.getLastRange().insertNode(ft.create("HR"));t.nextSibling&&n.setLastRange(yt.create(t.nextSibling,0).normalize().select())})),this.lineHeight=this.wrapCommand((function(t){n.style.stylePara(n.getLastRange(),{lineHeight:t})})),this.createLink=this.wrapCommand((function(t){var e=t.url,o=t.text,r=t.isNewWindow,a=t.checkProtocol,s=t.range||n.getLastRange(),l=o.length-s.toString().length;if(!(l>0&&n.isLimited(l))){var c=s.toString()!==o;"string"==typeof e&&(e=e.trim()),n.options.onCreateLink?e=n.options.onCreateLink(e):a&&(e=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(e)?e:n.options.defaultProtocol+e);var u=[];if(c){var d=(s=s.deleteContents()).insertNode(i()("<A>"+o+"</A>")[0]);u.push(d)}else u=n.style.styleNodes(s,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});i.a.each(u,(function(t,n){i()(n).attr("href",e),r?i()(n).attr("target","_blank"):i()(n).removeAttr("target")}));var h=yt.createFromNodeBefore(x.head(u)).getStartPoint(),f=yt.createFromNodeAfter(x.last(u)).getEndPoint();n.setLastRange(yt.create(h.node,h.offset,f.node,f.offset).select())}})),this.color=this.wrapCommand((function(t){var e=t.foreColor,n=t.backColor;e&&document.execCommand("foreColor",!1,e),n&&document.execCommand("backColor",!1,n)})),this.foreColor=this.wrapCommand((function(t){document.execCommand("foreColor",!1,t)})),this.insertTable=this.wrapCommand((function(t){var e=t.split("x");n.getLastRange().deleteContents().insertNode(n.table.createTable(e[0],e[1],n.options))})),this.removeMedia=this.wrapCommand((function(){var t=i()(n.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=i()(n.restoreTarget()).detach(),n.context.triggerEvent("media.delete",t,n.$editable)})),this.floatMe=this.wrapCommand((function(t){var e=i()(n.restoreTarget());e.toggleClass("note-float-left","left"===t),e.toggleClass("note-float-right","right"===t),e.css("float","none"===t?"":t)})),this.resize=this.wrapCommand((function(t){var e=i()(n.restoreTarget());0===(t=parseFloat(t))?e.css("width",""):e.css({width:100*t+"%",height:""})}))}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.$editable.on("keydown",(function(e){if(e.keyCode===Ct.code.ENTER&&t.context.triggerEvent("enter",e),t.context.triggerEvent("keydown",e),t.snapshot=t.history.makeSnapshot(),t.hasKeyShortCut=!1,e.isDefaultPrevented()||(t.options.shortcuts?t.hasKeyShortCut=t.handleKeyMap(e):t.preventDefaultEditableShortCuts(e)),t.isLimited(1,e)){var n=t.getLastRange();if(n.eo-n.so==0)return!1}t.setLastRange(),t.options.recordEveryKeystroke&&!1===t.hasKeyShortCut&&t.history.recordUndo()})).on("keyup",(function(e){t.setLastRange(),t.context.triggerEvent("keyup",e)})).on("focus",(function(e){t.setLastRange(),t.context.triggerEvent("focus",e)})).on("blur",(function(e){t.context.triggerEvent("blur",e)})).on("mousedown",(function(e){t.context.triggerEvent("mousedown",e)})).on("mouseup",(function(e){t.setLastRange(),t.history.recordUndo(),t.context.triggerEvent("mouseup",e)})).on("scroll",(function(e){t.context.triggerEvent("scroll",e)})).on("paste",(function(e){t.setLastRange(),t.context.triggerEvent("paste",e)})).on("input",(function(){t.isLimited(0)&&t.snapshot&&t.history.applySnapshot(t.snapshot)})),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(ft.html(this.$note)||ft.emptyPara),this.$editable.on(v.inputEventName,b.debounce((function(){t.context.triggerEvent("change",t.$editable.html(),t.$editable)}),10)),this.$editable.on("focusin",(function(e){t.context.triggerEvent("focusin",e)})).on("focusout",(function(e){t.context.triggerEvent("focusout",e)})),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",(function(e){return t.context.triggerEvent("contextmenu",e),!1})):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function(){this.$editable.off()}},{key:"handleKeyMap",value:function(t){var e=this.options.keyMap[v.isMac?"mac":"pc"],n=[];t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT");var o=Ct.nameFromCode[t.keyCode];o&&n.push(o);var i=e[n.join("+")];if("TAB"!==o||this.options.tabDisable)if(i){if(!1!==this.context.invoke(i))return t.preventDefault(),!0}else Ct.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&x.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(Ct.isMove(e.keyCode)||Ct.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||x.contains([Ct.code.BACKSPACE,Ct.code.DELETE],e.keyCode)))&&this.options.maxTextLength>0&&this.$editable.text().length+t>this.options.maxTextLength}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=yt.create(this.editable),0===i()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=yt.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(t){t&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(t){this.$editable.data("target",t)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var t=yt.create();return t&&(t=t.normalize()),t?this.style.current(t):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(t){return this.style.fromNode(t)}},{key:"undo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(t,e){var n,o=this;return(n=t,i.a.Deferred((function(t){var e=i()("<img>");e.one("load",(function(){e.off("error abort"),t.resolve(e)})).one("error abort",(function(){e.off("load").detach(),t.reject(e)})).css({display:"none"}).appendTo(document.body).attr("src",n)})).promise()).then((function(t){o.beforeCommand(),"function"==typeof e?e(t):("string"==typeof e&&t.attr("data-filename",e),t.css("width",Math.min(o.$editable.width(),t.width()))),t.show(),o.getLastRange().insertNode(t[0]),o.setLastRange(yt.createFromNodeAfter(t[0]).select()),o.afterCommand()})).fail((function(t){o.context.triggerEvent("image.upload.error",t)}))}},{key:"insertImagesAsDataURL",value:function(t){var e=this;i.a.each(t,(function(t,n){var o=n.name;e.options.maximumImageFileSize&&e.options.maximumImageFileSize<n.size?e.context.triggerEvent("image.upload.error",e.lang.image.maximumFileSizeError):function(t){return i.a.Deferred((function(e){i.a.extend(new FileReader,{onload:function(t){var n=t.target.result;e.resolve(n)},onerror:function(t){e.reject(t)}}).readAsDataURL(t)})).promise()}(n).then((function(t){return e.insertImage(t,o)})).fail((function(){e.context.triggerEvent("image.upload.error")}))}))}},{key:"insertImagesOrCallback",value:function(t){this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",t):this.insertImagesAsDataURL(t)}},{key:"getSelectedText",value:function(){var t=this.getLastRange();return t.isOnAnchor()&&(t=yt.createFromNode(ft.ancestor(t.sc,ft.isAnchor))),t.toString()}},{key:"onFormatBlock",value:function(t,e){if(document.execCommand("FormatBlock",!1,v.isMSIE?"<"+t+">":t),e&&e.length&&(e[0].tagName.toUpperCase()!==t.toUpperCase()&&(e=e.find(t)),e&&e.length)){var n=e[0].className||"";if(n){var o=this.createRange();i()([o.sc,o.ec]).closest(t).addClass(n)}}}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,e){var n=this.getLastRange();if(""!==n){var o=this.style.styleNodes(n);if(this.$editor.find(".note-status-output").html(""),i()(o).css(t,e),n.isCollapsed()){var r=x.head(o);r&&!ft.nodeLength(r)&&(r.innerHTML=ft.ZERO_WIDTH_NBSP_CHAR,yt.createFromNodeAfter(r.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",r))}}else{var a=i.a.now();this.$editor.find(".note-status-output").html('<div id="note-status-output-'+a+'" class="alert alert-info">'+this.lang.output.noSelection+"</div>"),setTimeout((function(){i()("#note-status-output-"+a).remove()}),5e3)}}},{key:"unlink",value:function(){var t=this.getLastRange();if(t.isOnAnchor()){var e=ft.ancestor(t.sc,ft.isAnchor);(t=yt.createFromNode(e)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(ft.isAnchor),e=i()(x.head(t.nodes(ft.isAnchor))),n={range:t,text:t.toString(),url:e.length?e.attr("href"):""};return e.length&&(n.isNewWindow="_blank"===e.attr("target")),n}},{key:"addRow",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}},{key:"addCol",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}},{key:"deleteRow",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}},{key:"deleteCol",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}},{key:"deleteTable",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}},{key:"resizeTo",value:function(t,e,n){var o;if(n){var i=t.y/t.x,r=e.data("ratio");o={width:r>i?t.x:t.y/r,height:r>i?t.x*r:t.y}}else o={width:t.x,height:t.y};e.css(o)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return ft.isEmpty(this.$editable[0])||ft.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",ft.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}])&&Ft(e.prototype,n),o&&Ft(e,o),t}();function Ht(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Bt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editable=e.layoutInfo.editable}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function(t){var e=this,n=t.originalEvent.clipboardData;if(n&&n.items&&n.items.length){var o=n.items.length>1?n.items[1]:x.head(n.items);"file"===o.kind&&-1!==o.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[o.getAsFile()]),t.preventDefault()):"string"===o.kind&&this.context.invoke("editor.isLimited",n.getData("Text").length)&&t.preventDefault()}else if(window.clipboardData){var i=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",i.length)&&t.preventDefault()}setTimeout((function(){e.context.invoke("editor.afterCommand")}),10)}}])&&Ht(e.prototype,n),o&&Ht(e,o),t}();function zt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Mt,Ot=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$eventListener=i()(document),this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.options=e.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=i()(['<div class="note-dropzone">','<div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(this.$editor)}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(t){t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var t=this,e=i()(),n=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(o){var i=t.context.invoke("codeview.isActivated"),r=t.$editor.width()>0&&t.$editor.height()>0;i||e.length||!r||(t.$editor.addClass("dragover"),t.$dropzone.width(t.$editor.width()),t.$dropzone.height(t.$editor.height()),n.text(t.lang.image.dragImageHere)),e=e.add(o.target)},this.documentEventHandlers.onDragleave=function(n){(e=e.not(n.target)).length&&"BODY"!==n.target.nodeName||(e=i()(),t.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){e=i()(),t.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",(function(){t.$dropzone.addClass("hover"),n.text(t.lang.image.dropImage)})).on("dragleave",(function(){t.$dropzone.removeClass("hover"),n.text(t.lang.image.dragImageHere)})),this.$dropzone.on("drop",(function(e){var n=e.originalEvent.dataTransfer;e.preventDefault(),n&&n.files&&n.files.length?(t.$editable.focus(),t.context.invoke("editor.insertImagesOrCallback",n.files)):i.a.each(n.types,(function(e,o){if(!(o.toLowerCase().indexOf("_moz_")>-1)){var r=n.getData(o);o.toLowerCase().indexOf("text")>-1?t.context.invoke("editor.pasteHTML",r):i()(r).each((function(e,n){t.context.invoke("editor.insertNode",n)}))}}))})).on("dragover",!1)}},{key:"destroy",value:function(){var t=this;Object.keys(this.documentEventHandlers).forEach((function(e){t.$eventListener.off(e.substr(2).toLowerCase(),t.documentEventHandlers[e])})),this.documentEventHandlers={}}}])&&zt(e.prototype,n),o&&zt(e,o),t}();function jt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}v.hasCodeMirror&&(Mt=window.CodeMirror);var Ut=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.$codable=e.layoutInfo.codable,this.options=e.options}var e,n,o;return e=t,(n=[{key:"sync",value:function(){this.isActivated()&&v.hasCodeMirror&&this.$codable.data("cmEditor").save()}},{key:"isActivated",value:function(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function(t){if(this.options.codeviewFilter&&(t=t.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter)){var e=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);t=t.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi,(function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var n=!0,o=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;if(new RegExp('src="(https?:)?//'+s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return""}))}return t}},{key:"activate",value:function(){var t=this;if(this.$codable.val(ft.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),v.hasCodeMirror){var e=Mt.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){var n=new Mt.TernServer(this.options.codemirror.tern);e.ternServer=n,e.on("cursorActivity",(function(t){n.updateArgHints(t)}))}e.on("blur",(function(n){t.context.triggerEvent("blur.codeview",e.getValue(),n)})),e.on("change",(function(){t.context.triggerEvent("change.codeview",e.getValue(),e)})),e.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",e)}else this.$codable.on("blur",(function(e){t.context.triggerEvent("blur.codeview",t.$codable.val(),e)})),this.$codable.on("input",(function(){t.context.triggerEvent("change.codeview",t.$codable.val(),t.$codable)}))}},{key:"deactivate",value:function(){if(v.hasCodeMirror){var t=this.$codable.data("cmEditor");this.$codable.val(t.getValue()),t.toTextArea()}var e=this.purify(ft.value(this.$codable,this.options.prettifyHtml)||ft.emptyPara),n=this.$editable.html()!==e;this.$editable.html(e),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),n&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}])&&jt(e.prototype,n),o&&jt(e,o),t}();function Wt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Kt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$document=i()(document),this.$statusbar=e.layoutInfo.statusbar,this.$editable=e.layoutInfo.editable,this.options=e.options}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.options.airMode||this.options.disableResizeEditor?this.destroy():this.$statusbar.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation();var n=t.$editable.offset().top-t.$document.scrollTop(),o=function(e){var o=e.clientY-(n+24);o=t.options.minheight>0?Math.max(o,t.options.minheight):o,o=t.options.maxHeight>0?Math.min(o,t.options.maxHeight):o,t.$editable.height(o)};t.$document.on("mousemove",o).one("mouseup",(function(){t.$document.off("mousemove",o)}))}))}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}])&&Wt(e.prototype,n),o&&Wt(e,o),t}();function qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Vt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editor=e.layoutInfo.editor,this.$toolbar=e.layoutInfo.toolbar,this.$editable=e.layoutInfo.editable,this.$codable=e.layoutInfo.codable,this.$window=i()(window),this.$scrollbar=i()("html, body"),this.onResize=function(){n.resizeTo({h:n.$window.height()-n.$toolbar.outerHeight()})}}var e,n,o;return e=t,(n=[{key:"resizeTo",value:function(t){this.$editable.css("height",t.h),this.$codable.css("height",t.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,t.h)}},{key:"toggle",value:function(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function(){return this.$editor.hasClass("fullscreen")}}])&&qt(e.prototype,n),o&&qt(e,o),t}();function _t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Gt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$document=i()(document),this.$editingArea=e.layoutInfo.editingArea,this.options=e.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function(t,e){n.update(e.target,e)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()},"summernote.codeview.toggled":function(){n.update()}}}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.$handle=i()(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',this.options.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',this.options.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",(function(e){if(ft.isControlSizing(e.target)){e.preventDefault(),e.stopPropagation();var n=t.$handle.find(".note-control-selection").data("target"),o=n.offset(),i=t.$document.scrollTop(),r=function(e){t.context.invoke("editor.resizeTo",{x:e.clientX-o.left,y:e.clientY-(o.top-i)},n,!e.shiftKey),t.update(n[0],e)};t.$document.on("mousemove",r).one("mouseup",(function(e){e.preventDefault(),t.$document.off("mousemove",r),t.context.invoke("editor.afterCommand")})),n.data("ratio")||n.data("ratio",n.height()/n.width())}})),this.$handle.on("wheel",(function(e){e.preventDefault(),t.update()}))}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,e){if(this.context.isDisabled())return!1;var n=ft.isImg(t),o=this.$handle.find(".note-control-selection");if(this.context.invoke("imagePopover.update",t,e),n){var r=i()(t),a=r.position(),s={left:a.left+parseInt(r.css("marginLeft"),10),top:a.top+parseInt(r.css("marginTop"),10)},l={w:r.outerWidth(!1),h:r.outerHeight(!1)};o.css({display:"block",left:s.left,top:s.top,width:l.w,height:l.h}).data("target",r);var c=new Image;c.src=r.attr("src");var u=l.w+"x"+l.h+" ("+this.lang.image.original+": "+c.width+"x"+c.height+")";o.find(".note-control-selection-info").text(u),this.context.invoke("editor.saveTarget",t)}else this.hide();return n}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}])&&_t(e.prototype,n),o&&_t(e,o),t}();function Yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Zt=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,Xt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.lastWordRange=null}},{key:"destroy",value:function(){this.lastWordRange=null}},{key:"replace",value:function(){if(this.lastWordRange){var t=this.lastWordRange.toString(),e=t.match(Zt);if(e&&(e[1]||e[2])){var n=e[1]?t:"http://"+t,o=t.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0],r=i()("<a />").html(o).attr("href",n)[0];this.context.options.linkTargetBlank&&i()(r).attr("target","_blank"),this.lastWordRange.insertNode(r),this.lastWordRange=null,this.context.invoke("editor.focus")}}}},{key:"handleKeydown",value:function(t){if(x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWordRange=e}}},{key:"handleKeyup",value:function(t){x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&this.replace()}}])&&Yt(e.prototype,n),o&&Yt(e,o),t}();function Qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Jt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$note=e.layoutInfo.note,this.events={"summernote.change":function(){n.$note.val(e.invoke("code"))}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return ft.isTextarea(this.$note[0])}}])&&Qt(e.prototype,n),o&&Qt(e,o),t}();function te(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ee=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.options=e.options.replace||{},this.keys=[Ct.code.ENTER,Ct.code.SPACE,Ct.code.PERIOD,Ct.code.COMMA,Ct.code.SEMICOLON,Ct.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!!this.options.match}},{key:"initialize",value:function(){this.lastWord=null}},{key:"destroy",value:function(){this.lastWord=null}},{key:"replace",value:function(){if(this.lastWord){var t=this,e=this.lastWord.toString();this.options.match(e,(function(e){if(e){var n="";if("string"==typeof e?n=ft.createText(e):e instanceof jQuery?n=e[0]:e instanceof Node&&(n=e),!n)return;t.lastWord.insertNode(n),t.lastWord=null,t.context.invoke("editor.focus")}}))}}},{key:"handleKeydown",value:function(t){if(this.previousKeydownCode&&x.contains(this.keys,this.previousKeydownCode))this.previousKeydownCode=t.keyCode;else{if(x.contains(this.keys,t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWord=e}this.previousKeydownCode=t.keyCode}}},{key:"handleKeyup",value:function(t){x.contains(this.keys,t.keyCode)&&this.replace()}}])&&te(e.prototype,n),o&&te(e,o),t}();function ne(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var oe=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editingArea=e.layoutInfo.editingArea,this.options=e.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function(){n.update()},"summernote.codeview.toggled":function(){n.update()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!!this.options.placeholder}},{key:"initialize",value:function(){var t=this;this.$placeholder=i()('<div class="note-placeholder">'),this.$placeholder.on("click",(function(){t.context.invoke("focus")})).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}])&&ne(e.prototype,n),o&&ne(e,o),t}();function ie(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var re=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ui=i.a.summernote.ui,this.context=e,this.$toolbar=e.layoutInfo.toolbar,this.options=e.options,this.lang=this.options.langInfo,this.invertedKeyMap=b.invertObject(this.options.keyMap[v.isMac?"mac":"pc"])}var e,n,o;return e=t,(n=[{key:"representShortcut",value:function(t){var e=this.invertedKeyMap[t];return this.options.shortcuts&&e?(v.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)}},{key:"initialize",value:function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function(t){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,t)||(this.fontInstalledMap[t]=v.isFontInstalled(t)||x.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]}},{key:"isFontDeservedToAdd",value:function(t){return""!==(t=t.toLowerCase())&&this.isFontInstalled(t)&&-1===v.genericFontFamilies.indexOf(t)}},{key:"colorPalette",value:function(t,e,n,o){var r=this;return this.ui.buttonGroup({className:"note-color "+t,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:e,click:function(t){var e=i()(t.currentTarget);n&&o?r.context.invoke("editor.color",{backColor:e.attr("data-backColor"),foreColor:e.attr("data-foreColor")}):n?r.context.invoke("editor.color",{backColor:e.attr("data-backColor")}):o&&r.context.invoke("editor.color",{foreColor:e.attr("data-foreColor")})},callback:function(t){var e=t.find(".note-recent-color");n&&(e.css("background-color",r.options.colorButton.backColor),t.attr("data-backColor",r.options.colorButton.backColor)),o?(e.css("color",r.options.colorButton.foreColor),t.attr("data-foreColor",r.options.colorButton.foreColor)):e.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(n?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="backColor" data-value="inherit">',this.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="backColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.backColor+'" data-event="backColorPalette">',"</div>",'<div class="note-holder-custom" id="backColorPalette" data-event="backColor"/>',"</div>"].join(""):"")+(o?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="removeFormat" data-value="foreColor">',this.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="foreColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.foreColor+'" data-event="foreColorPalette">',"</div>",'<div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"/>',"</div>"].join(""):""),callback:function(t){t.find(".note-holder").each((function(t,e){var n=i()(e);n.append(r.ui.palette({colors:r.options.colors,colorsName:r.options.colorsName,eventName:n.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())}));var e=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];t.find(".note-holder-custom").each((function(t,n){var o=i()(n);o.append(r.ui.palette({colors:e,colorsName:e,eventName:o.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())})),t.find("input[type=color]").each((function(e,n){i()(n).change((function(){var e=t.find("#"+i()(this).data("event")).find(".note-color-btn").first(),n=this.value.toUpperCase();e.css("background-color",n).attr("aria-label",n).attr("data-value",n).attr("data-original-title",n),e.click()}))}))},click:function(e){e.stopPropagation();var n=i()("."+t).find(".note-dropdown-menu"),o=i()(e.target),a=o.data("event"),s=o.attr("data-value");if("openPalette"===a){var l=n.find("#"+s),c=i()(n.find("#"+l.data("event")).find(".note-color-row")[0]),u=c.find(".note-color-btn").last().detach(),d=l.val();u.css("background-color",d).attr("aria-label",d).attr("data-value",d).attr("data-original-title",d),c.prepend(u),l.click()}else{if(x.contains(["backColor","foreColor"],a)){var h="backColor"===a?"background-color":"color",f=o.closest(".note-color").find(".note-recent-color"),p=o.closest(".note-color").find(".note-current-color-button");f.css(h,s),p.attr("data-"+a,s)}r.context.invoke("editor."+a,s)}}})]}).render()}},{key:"addToolbarButtons",value:function(){var t=this;this.context.memo("button.style",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.magic),t.options),tooltip:t.lang.style.style,data:{toggle:"dropdown"}}),t.ui.dropdown({className:"dropdown-style",items:t.options.styleTags,title:t.lang.style.style,template:function(e){"string"==typeof e&&(e={tag:e,title:Object.prototype.hasOwnProperty.call(t.lang.style,e)?t.lang.style[e]:e});var n=e.tag,o=e.title;return"<"+n+(e.style?' style="'+e.style+'" ':"")+(e.className?' class="'+e.className+'"':"")+">"+o+"</"+n+">"},click:t.context.createInvokeHandler("editor.formatBlock")})]).render()}));for(var e=function(e,n){var o=t.options.styleTags[e];t.context.memo("button.style."+o,(function(){return t.button({className:"note-btn-style-"+o,contents:'<div data-value="'+o+'">'+o.toUpperCase()+"</div>",tooltip:t.lang.style[o],click:t.context.createInvokeHandler("editor.formatBlock")}).render()}))},n=0,o=this.options.styleTags.length;n<o;n++)e(n);this.context.memo("button.bold",(function(){return t.button({className:"note-btn-bold",contents:t.ui.icon(t.options.icons.bold),tooltip:t.lang.font.bold+t.representShortcut("bold"),click:t.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()})),this.context.memo("button.italic",(function(){return t.button({className:"note-btn-italic",contents:t.ui.icon(t.options.icons.italic),tooltip:t.lang.font.italic+t.representShortcut("italic"),click:t.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()})),this.context.memo("button.underline",(function(){return t.button({className:"note-btn-underline",contents:t.ui.icon(t.options.icons.underline),tooltip:t.lang.font.underline+t.representShortcut("underline"),click:t.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()})),this.context.memo("button.clear",(function(){return t.button({contents:t.ui.icon(t.options.icons.eraser),tooltip:t.lang.font.clear+t.representShortcut("removeFormat"),click:t.context.createInvokeHandler("editor.removeFormat")}).render()})),this.context.memo("button.strikethrough",(function(){return t.button({className:"note-btn-strikethrough",contents:t.ui.icon(t.options.icons.strikethrough),tooltip:t.lang.font.strikethrough+t.representShortcut("strikethrough"),click:t.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()})),this.context.memo("button.superscript",(function(){return t.button({className:"note-btn-superscript",contents:t.ui.icon(t.options.icons.superscript),tooltip:t.lang.font.superscript,click:t.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()})),this.context.memo("button.subscript",(function(){return t.button({className:"note-btn-subscript",contents:t.ui.icon(t.options.icons.subscript),tooltip:t.lang.font.subscript,click:t.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()})),this.context.memo("button.fontname",(function(){var e=t.context.invoke("editor.currentStyle");return t.options.addDefaultFonts&&i.a.each(e["font-family"].split(","),(function(e,n){n=n.trim().replace(/['"]+/g,""),t.isFontDeservedToAdd(n)&&-1===t.options.fontNames.indexOf(n)&&t.options.fontNames.push(n)})),t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontname"/>',t.options),tooltip:t.lang.font.name,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:t.options.icons.menuCheck,items:t.options.fontNames.filter(t.isFontInstalled.bind(t)),title:t.lang.font.name,template:function(t){return'<span style="font-family: '+v.validFontName(t)+'">'+t+"</span>"},click:t.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()})),this.context.memo("button.fontsize",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontsize"/>',t.options),tooltip:t.lang.font.size,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizes,title:t.lang.font.size,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()})),this.context.memo("button.fontsizeunit",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontsizeunit"/>',t.options),tooltip:t.lang.font.sizeunit,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizeUnits,title:t.lang.font.sizeunit,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()})),this.context.memo("button.color",(function(){return t.colorPalette("note-color-all",t.lang.color.recent,!0,!0)})),this.context.memo("button.forecolor",(function(){return t.colorPalette("note-color-fore",t.lang.color.foreground,!1,!0)})),this.context.memo("button.backcolor",(function(){return t.colorPalette("note-color-back",t.lang.color.background,!0,!1)})),this.context.memo("button.ul",(function(){return t.button({contents:t.ui.icon(t.options.icons.unorderedlist),tooltip:t.lang.lists.unordered+t.representShortcut("insertUnorderedList"),click:t.context.createInvokeHandler("editor.insertUnorderedList")}).render()})),this.context.memo("button.ol",(function(){return t.button({contents:t.ui.icon(t.options.icons.orderedlist),tooltip:t.lang.lists.ordered+t.representShortcut("insertOrderedList"),click:t.context.createInvokeHandler("editor.insertOrderedList")}).render()}));var r=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),a=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),s=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),l=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),c=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),u=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",b.invoke(r,"render")),this.context.memo("button.justifyCenter",b.invoke(a,"render")),this.context.memo("button.justifyRight",b.invoke(s,"render")),this.context.memo("button.justifyFull",b.invoke(l,"render")),this.context.memo("button.outdent",b.invoke(c,"render")),this.context.memo("button.indent",b.invoke(u,"render")),this.context.memo("button.paragraph",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.alignLeft),t.options),tooltip:t.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),t.ui.dropdown([t.ui.buttonGroup({className:"note-align",children:[r,a,s,l]}),t.ui.buttonGroup({className:"note-list",children:[c,u]})])]).render()})),this.context.memo("button.height",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.textHeight),t.options),tooltip:t.lang.font.height,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({items:t.options.lineHeights,checkClassName:t.options.icons.menuCheck,className:"dropdown-line-height",title:t.lang.font.height,click:t.context.createInvokeHandler("editor.lineHeight")})]).render()})),this.context.memo("button.table",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.table),t.options),tooltip:t.lang.table.table,data:{toggle:"dropdown"}}),t.ui.dropdown({title:t.lang.table.table,className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>','<div class="note-dimension-picker-highlighted"/>','<div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(e){e.find(".note-dimension-picker-mousecatcher").css({width:t.options.insertTableMaxSize.col+"em",height:t.options.insertTableMaxSize.row+"em"}).mousedown(t.context.createInvokeHandler("editor.insertTable")).on("mousemove",t.tableMoveHandler.bind(t))}}).render()})),this.context.memo("button.link",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.link+t.representShortcut("linkDialog.show"),click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.picture",(function(){return t.button({contents:t.ui.icon(t.options.icons.picture),tooltip:t.lang.image.image,click:t.context.createInvokeHandler("imageDialog.show")}).render()})),this.context.memo("button.video",(function(){return t.button({contents:t.ui.icon(t.options.icons.video),tooltip:t.lang.video.video,click:t.context.createInvokeHandler("videoDialog.show")}).render()})),this.context.memo("button.hr",(function(){return t.button({contents:t.ui.icon(t.options.icons.minus),tooltip:t.lang.hr.insert+t.representShortcut("insertHorizontalRule"),click:t.context.createInvokeHandler("editor.insertHorizontalRule")}).render()})),this.context.memo("button.fullscreen",(function(){return t.button({className:"btn-fullscreen",contents:t.ui.icon(t.options.icons.arrowsAlt),tooltip:t.lang.options.fullscreen,click:t.context.createInvokeHandler("fullscreen.toggle")}).render()})),this.context.memo("button.codeview",(function(){return t.button({className:"btn-codeview",contents:t.ui.icon(t.options.icons.code),tooltip:t.lang.options.codeview,click:t.context.createInvokeHandler("codeview.toggle")}).render()})),this.context.memo("button.redo",(function(){return t.button({contents:t.ui.icon(t.options.icons.redo),tooltip:t.lang.history.redo+t.representShortcut("redo"),click:t.context.createInvokeHandler("editor.redo")}).render()})),this.context.memo("button.undo",(function(){return t.button({contents:t.ui.icon(t.options.icons.undo),tooltip:t.lang.history.undo+t.representShortcut("undo"),click:t.context.createInvokeHandler("editor.undo")}).render()})),this.context.memo("button.help",(function(){return t.button({contents:t.ui.icon(t.options.icons.question),tooltip:t.lang.options.help,click:t.context.createInvokeHandler("helpDialog.show")}).render()}))}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",(function(){return t.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()})),this.context.memo("button.resizeHalf",(function(){return t.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()})),this.context.memo("button.resizeQuarter",(function(){return t.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()})),this.context.memo("button.resizeNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()})),this.context.memo("button.floatLeft",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()})),this.context.memo("button.floatRight",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()})),this.context.memo("button.floatNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()})),this.context.memo("button.removeMedia",(function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()}))}},{key:"addLinkPopoverButtons",value:function(){var t=this;this.context.memo("button.linkDialogShow",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.unlink",(function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()}))}},{key:"addTablePopoverButtons",value:function(){var t=this;this.context.memo("button.addRowUp",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()})),this.context.memo("button.addRowDown",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()})),this.context.memo("button.addColLeft",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()})),this.context.memo("button.addColRight",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()})),this.context.memo("button.deleteRow",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()})),this.context.memo("button.deleteCol",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()})),this.context.memo("button.deleteTable",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()}))}},{key:"build",value:function(t,e){for(var n=0,o=e.length;n<o;n++){for(var i=e[n],r=Array.isArray(i)?i[0]:i,a=Array.isArray(i)?1===i.length?[i[0]]:i[1]:[i],s=this.ui.buttonGroup({className:"note-"+r}).render(),l=0,c=a.length;l<c;l++){var u=this.context.memo("button."+a[l]);u&&s.append("function"==typeof u?u(this.context):u)}s.appendTo(t)}}},{key:"updateCurrentStyle",value:function(t){var e=this,n=t||this.$toolbar,o=this.context.invoke("editor.currentStyle");if(this.updateBtnStates(n,{".note-btn-bold":function(){return"bold"===o["font-bold"]},".note-btn-italic":function(){return"italic"===o["font-italic"]},".note-btn-underline":function(){return"underline"===o["font-underline"]},".note-btn-subscript":function(){return"subscript"===o["font-subscript"]},".note-btn-superscript":function(){return"superscript"===o["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===o["font-strikethrough"]}}),o["font-family"]){var r=o["font-family"].split(",").map((function(t){return t.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")})),a=x.find(r,this.isFontInstalled.bind(this));n.find(".dropdown-fontname a").each((function(t,e){var n=i()(e),o=n.data("value")+""==a+"";n.toggleClass("checked",o)})),n.find(".note-current-fontname").text(a).css("font-family",a)}if(o["font-size"]){var s=o["font-size"];n.find(".dropdown-fontsize a").each((function(t,e){var n=i()(e),o=n.data("value")+""==s+"";n.toggleClass("checked",o)})),n.find(".note-current-fontsize").text(s);var l=o["font-size-unit"];n.find(".dropdown-fontsizeunit a").each((function(t,e){var n=i()(e),o=n.data("value")+""==l+"";n.toggleClass("checked",o)})),n.find(".note-current-fontsizeunit").text(l)}if(o["line-height"]){var c=o["line-height"];n.find(".dropdown-line-height li a").each((function(t,n){var o=i()(n).data("value")+""==c+"";e.className=o?"checked":""}))}}},{key:"updateBtnStates",value:function(t,e){var n=this;i.a.each(e,(function(e,o){n.ui.toggleBtnActive(t.find(e),o())}))}},{key:"tableMoveHandler",value:function(t){var e,n=i()(t.target.parentNode),o=n.next(),r=n.find(".note-dimension-picker-mousecatcher"),a=n.find(".note-dimension-picker-highlighted"),s=n.find(".note-dimension-picker-unhighlighted");if(void 0===t.offsetX){var l=i()(t.target).offset();e={x:t.pageX-l.left,y:t.pageY-l.top}}else e={x:t.offsetX,y:t.offsetY};var c=Math.ceil(e.x/18)||1,u=Math.ceil(e.y/18)||1;a.css({width:c+"em",height:u+"em"}),r.data("value",c+"x"+u),c>3&&c<this.options.insertTableMaxSize.col&&s.css({width:c+1+"em"}),u>3&&u<this.options.insertTableMaxSize.row&&s.css({height:u+1+"em"}),o.html(c+" x "+u)}}])&&ie(e.prototype,n),o&&ie(e,o),t}();function ae(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var se=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$window=i()(window),this.$document=i()(document),this.ui=i.a.summernote.ui,this.$note=e.layoutInfo.note,this.$editor=e.layoutInfo.editor,this.$toolbar=e.layoutInfo.toolbar,this.$editable=e.layoutInfo.editable,this.$statusbar=e.layoutInfo.statusbar,this.options=e.options,this.isFollowing=!1,this.followScroll=this.followScroll.bind(this)}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!this.options.airMode}},{key:"initialize",value:function(){var t=this;this.options.toolbar=this.options.toolbar||[],this.options.toolbar.length?this.context.invoke("buttons.build",this.$toolbar,this.options.toolbar):this.$toolbar.hide(),this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.changeContainer(!1),this.$note.on("summernote.keyup summernote.mouseup summernote.change",(function(){t.context.invoke("buttons.updateCurrentStyle")})),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}},{key:"destroy",value:function(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}},{key:"followScroll",value:function(){if(this.$editor.hasClass("fullscreen"))return!1;var t=this.$editor.outerHeight(),e=this.$editor.width(),n=this.$toolbar.height(),o=this.$statusbar.height(),r=0;this.options.otherStaticBar&&(r=i()(this.options.otherStaticBar).outerHeight());var a=this.$document.scrollTop(),s=this.$editor.offset().top,l=s-r,c=s+t-r-n-o;!this.isFollowing&&a>l&&a<c-n?(this.isFollowing=!0,this.$editable.css({marginTop:this.$toolbar.outerHeight()}),this.$toolbar.css({position:"fixed",top:r,width:e,zIndex:1e3})):this.isFollowing&&(a<l||a>c)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function(t){t?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),t),this.changeContainer(t)}},{key:"updateCodeview",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),t),t?this.deactivate():this.activate()}},{key:"activate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!0)}},{key:"deactivate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!1)}}])&&ae(e.prototype,n),o&&ae(e,o),t}();function le(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ce=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo,e.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group">','<label for="note-dialog-link-txt-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.textToDisplay,"</label>"),'<input id="note-dialog-link-txt-'.concat(this.options.id,'" class="note-link-text form-control note-form-control note-input" type="text"/>'),"</div>",'<div class="form-group note-form-group">','<label for="note-dialog-link-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.url,"</label>"),'<input id="note-dialog-link-url-'.concat(this.options.id,'" class="note-link-url form-control note-form-control note-input" type="text" value="http://"/>'),"</div>",this.options.disableLinkTarget?"":i()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),i()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-link-btn",'" value="').concat(this.lang.link.insert,'" disabled>');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"toggleLinkBtn",value:function(t,e,n){this.ui.toggleBtn(t,e.val()&&n.val())}},{key:"showLinkDialog",value:function(t){var e=this;return i.a.Deferred((function(n){var o=e.$dialog.find(".note-link-text"),i=e.$dialog.find(".note-link-url"),r=e.$dialog.find(".note-link-btn"),a=e.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),s=e.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");e.ui.onDialogShown(e.$dialog,(function(){e.context.triggerEvent("dialog.shown"),!t.url&&b.isValidUrl(t.text)&&(t.url=t.text),o.on("input paste propertychange",(function(){t.text=o.val(),e.toggleLinkBtn(r,o,i)})).val(t.text),i.on("input paste propertychange",(function(){t.text||o.val(i.val()),e.toggleLinkBtn(r,o,i)})).val(t.url),v.isSupportTouch||i.trigger("focus"),e.toggleLinkBtn(r,o,i),e.bindEnterKey(i,r),e.bindEnterKey(o,r);var l=void 0!==t.isNewWindow?t.isNewWindow:e.context.options.linkTargetBlank;a.prop("checked",l);var c=!t.url&&e.context.options.useProtocol;s.prop("checked",c),r.one("click",(function(r){r.preventDefault(),n.resolve({range:t.range,url:i.val(),text:o.val(),isNewWindow:a.is(":checked"),checkProtocol:s.is(":checked")}),e.ui.hideDialog(e.$dialog)}))})),e.ui.onDialogHidden(e.$dialog,(function(){o.off(),i.off(),r.off(),"pending"===n.state()&&n.reject()})),e.ui.showDialog(e.$dialog)})).promise()}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(e).then((function(e){t.context.invoke("editor.restoreRange"),t.context.invoke("editor.createLink",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}}])&&le(e.prototype,n),o&&le(e,o),t}();function ue(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var de=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){n.update()},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.link)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a> </span>')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){if(this.context.invoke("editor.hasFocus")){var t=this.context.invoke("editor.getLastRange");if(t.isCollapsed()&&t.isOnAnchor()){var e=ft.ancestor(t.sc,ft.isAnchor),n=i()(e).attr("href");this.$popover.find("a").attr("href",n).text(n);var o=ft.posFromPlaceholder(e),r=i()(this.options.container).offset();o.top-=r.top,o.left-=r.left,this.$popover.css({display:"block",left:o.left,top:o.top})}else this.hide()}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&ue(e.prototype,n),o&&ue(e,o),t}();function he(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var fe=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t="";if(this.options.maximumImageFileSize){var e=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),n=1*(this.options.maximumImageFileSize/Math.pow(1024,e)).toFixed(2)+" "+" KMGTP"[e]+"B";t="<small>".concat(this.lang.image.maximumFileSize+" : "+n,"</small>")}var o=this.options.dialogsInBody?this.$body:this.options.container,i=['<div class="form-group note-form-group note-group-select-from-files">','<label for="note-dialog-image-file-'+this.options.id+'" class="note-form-label">'+this.lang.image.selectFromFiles+"</label>",'<input id="note-dialog-image-file-'+this.options.id+'" class="note-image-input form-control-file note-form-control note-input" ',' type="file" name="files" accept="image/*" multiple="multiple"/>',t,"</div>",'<div class="form-group note-group-image-url">','<label for="note-dialog-image-url-'+this.options.id+'" class="note-form-label">'+this.lang.image.url+"</label>",'<input id="note-dialog-image-url-'+this.options.id+'" class="note-image-url form-control note-form-control note-input" type="text"/>',"</div>"].join(""),r='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-image-btn",'" value="').concat(this.lang.image.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:i,footer:r}).render().appendTo(o)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange"),"string"==typeof e?t.options.callbacks.onImageLinkInsert?t.context.triggerEvent("image.link.insert",e):t.context.invoke("editor.insertImage",e):t.context.invoke("editor.insertImagesOrCallback",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showImageDialog",value:function(){var t=this;return i.a.Deferred((function(e){var n=t.$dialog.find(".note-image-input"),o=t.$dialog.find(".note-image-url"),i=t.$dialog.find(".note-image-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.replaceWith(n.clone().on("change",(function(t){e.resolve(t.target.files||t.target.value)})).val("")),o.on("input paste propertychange",(function(){t.ui.toggleBtn(i,o.val())})).val(""),v.isSupportTouch||o.trigger("focus"),i.click((function(t){t.preventDefault(),e.resolve(o.val())})),t.bindEnterKey(o,i)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),i.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&he(e.prototype,n),o&&he(e,o),t}();function pe(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var me=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.editable=e.layoutInfo.editable[0],this.options=e.options,this.events={"summernote.disable summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.image)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t,e){if(ft.isImg(t)){var n=i()(t).offset(),o=i()(this.options.container).offset(),r={};this.options.popatmouse?(r.left=e.pageX-20,r.top=e.pageY):r=n,r.top-=o.top,r.left-=o.left,this.$popover.css({display:"block",left:r.left,top:r.top})}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&pe(e.prototype,n),o&&pe(e,o),t}();function ve(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ge=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.events={"summernote.mousedown":function(t,e){n.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.table)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),v.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){if(this.context.isDisabled())return!1;var e=ft.isCell(t);if(e){var n=ft.posFromPlaceholder(t),o=i()(this.options.container).offset();n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:n.left,top:n.top})}else this.hide();return e}},{key:"hide",value:function(){this.$popover.hide()}}])&&ve(e.prototype,n),o&&ve(e,o),t}();function be(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ke=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group row-fluid">','<label for="note-dialog-video-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.video.url,' <small class="text-muted">').concat(this.lang.video.providers,"</small></label>"),'<input id="note-dialog-video-url-'.concat(this.options.id,'" class="note-video-url form-control note-form-control note-input" type="text"/>'),"</div>"].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-video-btn",'" value="').concat(this.lang.video.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"createVideoNode",value:function(t){var e,n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),o=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),r=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),a=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),s=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),l=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),c=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),u=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),d=t.match(/^.+.(mp4|m4v)$/),h=t.match(/^.+.(ogg|ogv)$/),f=t.match(/^.+.(webm)$/),p=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(n&&11===n[1].length){var m=n[1],v=0;if(void 0!==n[2]){var g=n[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(g)for(var b=[3600,60,1],k=0,y=b.length;k<y;k++)v+=void 0!==g[k+1]?b[k]*parseInt(g[k+1],10):0}e=i()("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+m+(v>0?"?start="+v:"")).attr("width","640").attr("height","360")}else if(o&&o[0].length)e=i()("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+o[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(r&&r[0].length)e=i()("<iframe>").attr("frameborder",0).attr("src",r[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(a&&a[3].length)e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+a[3]).attr("width","640").attr("height","360");else if(s&&s[2].length)e=i()("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+s[2]).attr("width","640").attr("height","360");else if(l&&l[1].length)e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+l[1]);else if(c&&c[1].length||u&&u[2].length){var w=c&&c[1].length?c[1]:u[2];e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","https://v.qq.com/iframe/player.html?vid="+w+"&auto=0")}else if(d||h||f)e=i()("<video controls>").attr("src",t).attr("width","640").attr("height","360");else{if(!p||!p[0].length)return!1;e=i()("<iframe>").attr("frameborder",0).attr("src","https://www.facebook.com/plugins/video.php?href="+encodeURIComponent(p[0])+"&show_text=0&width=560").attr("width","560").attr("height","301").attr("scrolling","no").attr("allowtransparency","true")}return e.addClass("note-video-clip"),e[0]}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getSelectedText");this.context.invoke("editor.saveRange"),this.showVideoDialog(e).then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange");var n=t.createVideoNode(e);n&&t.context.invoke("editor.insertNode",n)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showVideoDialog",value:function(){var t=this;return i.a.Deferred((function(e){var n=t.$dialog.find(".note-video-url"),o=t.$dialog.find(".note-video-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.on("input paste propertychange",(function(){t.ui.toggleBtn(o,n.val())})),v.isSupportTouch||n.trigger("focus"),o.click((function(t){t.preventDefault(),e.resolve(n.val())})),t.bindEnterKey(n,o)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&be(e.prototype,n),o&&be(e,o),t}();function ye(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var we=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.16</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:e,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function(){var t=this,e=this.options.keyMap[v.isMac?"mac":"pc"];return Object.keys(e).map((function(n){var o=e[n],r=i()('<div><div class="help-list-item"/></div>');return r.append(i()("<label><kbd>"+n+"</kdb></label>").css({width:180,"margin-right":10})).append(i()("<span/>").html(t.context.memo("help."+o)||o)),r.html()})).join("")}},{key:"showHelpDialog",value:function(){var t=this;return i.a.Deferred((function(e){t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),e.resolve()})),t.ui.showDialog(t.$dialog)})).promise()}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then((function(){t.context.invoke("editor.restoreRange")}))}}])&&ye(e.prototype,n),o&&ye(e,o),t}();function Ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var xe=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.hidable=!0,this.onContextmenu=!1,this.pageX=null,this.pageY=null,this.events={"summernote.contextmenu":function(t){n.options.editing&&(t.preventDefault(),t.stopPropagation(),n.onContextmenu=!0,n.update(!0))},"summernote.mousedown":function(t,e){n.pageX=e.pageX,n.pageY=e.pageY},"summernote.keyup summernote.mouseup summernote.scroll":function(t,e){n.options.editing&&!n.onContextmenu&&(n.pageX=e.pageX,n.pageY=e.pageY,n.update()),n.onContextmenu=!1},"summernote.disable summernote.change summernote.dialog.shown summernote.blur":function(){n.hide()},"summernote.focusout":function(){n.$popover.is(":active,:focus")||n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return this.options.airMode&&!x.isEmpty(this.options.popover.air)}},{key:"initialize",value:function(){var t=this;this.$popover=this.ui.popover({className:"note-air-popover"}).render().appendTo(this.options.container);var e=this.$popover.find(".popover-content");this.context.invoke("buttons.build",e,this.options.popover.air),this.$popover.on("mousedown",(function(){t.hidable=!1})),this.$popover.on("mouseup",(function(){t.hidable=!0}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){var e=this.context.invoke("editor.currentStyle");if(!e.range||e.range.isCollapsed()&&!t)this.hide();else{var n={left:this.pageX,top:this.pageY},o=i()(this.options.container).offset();n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:Math.max(n.left,0)+-5,top:n.top+5}),this.context.invoke("buttons.updateCurrentStyle",this.$popover)}}},{key:"hide",value:function(){this.hidable&&this.$popover.hide()}}])&&Ce(e.prototype,n),o&&Ce(e,o),t}();function Se(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Te=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$editable=e.layoutInfo.editable,this.options=e.options,this.hint=this.options.hint||[],this.direction=this.options.hintDirection||"bottom",this.hints=Array.isArray(this.hint)?this.hint:[this.hint],this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return this.hints.length>0}},{key:"initialize",value:function(){var t=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",(function(e){t.$content.find(".active").removeClass("active"),i()(e.currentTarget).addClass("active"),t.replace()})),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"selectItem",value:function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.next();if(e.length)this.selectItem(e);else{var n=t.parent().next();n.length||(n=this.$content.find(".note-hint-group").first()),this.selectItem(n.find(".note-hint-item").first())}}},{key:"moveUp",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.prev();if(e.length)this.selectItem(e);else{var n=t.parent().prev();n.length||(n=this.$content.find(".note-hint-group").last()),this.selectItem(n.find(".note-hint-item").last())}}},{key:"replace",value:function(){var t=this.$content.find(".note-hint-item.active");if(t.length){var e=this.nodeFromItem(t);if(null!==this.matchingWord&&0===this.matchingWord.length)this.lastWordRange.so=this.lastWordRange.eo;else if(null!==this.matchingWord&&this.matchingWord.length>0&&!this.lastWordRange.isCollapsed()){var n=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length;n>0&&(this.lastWordRange.so+=n)}if(this.lastWordRange.insertNode(e),"next"===this.options.hintSelect){var o=document.createTextNode("");i()(e).after(o),yt.createFromNodeBefore(o).select()}else yt.createFromNodeAfter(e).select();this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus")}}},{key:"nodeFromItem",value:function(t){var e=this.hints[t.data("index")],n=t.data("item"),o=e.content?e.content(n):n;return"string"==typeof o&&(o=ft.createText(o)),o}},{key:"createItemTemplates",value:function(t,e){var n=this.hints[t];return e.map((function(e){var o=i()('<div class="note-hint-item"/>');return o.append(n.template?n.template(e):e+""),o.data({index:t,item:e}),o}))}},{key:"handleKeydown",value:function(t){this.$popover.is(":visible")&&(t.keyCode===Ct.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===Ct.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===Ct.code.DOWN&&(t.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function(t,e,n){var o=this.hints[t];if(o&&o.match.test(e)&&o.search){var i=o.match.exec(e);this.matchingWord=i[0],o.search(i[1],n)}else n()}},{key:"createGroup",value:function(t,e){var n=this,o=i()('<div class="note-hint-group note-hint-group-'+t+'"/>');return this.searchKeyword(t,e,(function(e){(e=e||[]).length&&(o.html(n.createItemTemplates(t,e)),n.show())})),o}},{key:"handleKeyup",value:function(t){var e=this;if(!x.contains([Ct.code.ENTER,Ct.code.UP,Ct.code.DOWN],t.keyCode)){var n,o,r=this.context.invoke("editor.getLastRange");if("words"===this.options.hintMode){if(n=r.getWordsRange(r),o=n.toString(),this.hints.forEach((function(t){if(t.match.test(o))return n=r.getWordsMatchRange(t.match),!1})),!n)return void this.hide();o=n.toString()}else n=r.getWordRange(),o=n.toString();if(this.hints.length&&o){this.$content.empty();var a=b.rect2bnd(x.last(n.getClientRects())),s=i()(this.options.container).offset();a&&(a.top-=s.top,a.left-=s.left,this.$popover.hide(),this.lastWordRange=n,this.hints.forEach((function(t,n){t.match.test(o)&&e.createGroup(n,o).appendTo(e.$content)})),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:a.left,top:a.top-this.$popover.outerHeight()-5}):this.$popover.css({left:a.left,top:a.top+a.height+5}))}else this.hide()}}},{key:"show",value:function(){this.$popover.show()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Se(e.prototype,n),o&&Se(e,o),t}();i.a.summernote=i.a.extend(i.a.summernote,{version:"0.8.16",plugins:{},dom:ft,range:yt,lists:x,options:{langInfo:i.a.summernote.lang["en-US"],editing:!0,modules:{editor:Dt,clipboard:Bt,dropzone:Ot,codeview:Ut,statusbar:Kt,fullscreen:Vt,handle:Gt,hintPopover:Te,autoLink:Xt,autoSync:Jt,autoReplace:ee,placeholder:oe,buttons:re,toolbar:se,linkDialog:ce,linkPopover:de,imageDialog:fe,imagePopover:me,tablePopover:ge,videoDialog:ke,helpDialog:we,airPopover:xe},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},51:function(t,e,n){"use strict";n.r(e);var o=n(0),i=n.n(o),r=n(1);function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var s=function(){function t(e,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$node=e,this.options=i.a.extend({},{title:"",target:n.container,trigger:"hover focus",placement:"bottom"},n),this.$tooltip=i()(['<div class="note-tooltip">','<div class="note-tooltip-arrow"/>','<div class="note-tooltip-content"/>',"</div>"].join("")),"manual"!==this.options.trigger){var o=this.show.bind(this),r=this.hide.bind(this),a=this.toggle.bind(this);this.options.trigger.split(" ").forEach((function(t){"hover"===t?(e.off("mouseenter mouseleave"),e.on("mouseenter",o).on("mouseleave",r)):"click"===t?e.on("click",a):"focus"===t&&e.on("focus",o).on("blur",r)}))}}var e,n,o;return e=t,(n=[{key:"show",value:function(){var t=this.$node,e=t.offset(),n=i()(this.options.target).offset();e.top-=n.top,e.left-=n.left;var o=this.$tooltip,r=this.options.title||t.attr("title")||t.data("title"),a=this.options.placement||t.data("placement");o.addClass(a),o.find(".note-tooltip-content").text(r),o.appendTo(this.options.target);var s=t.outerWidth(),l=t.outerHeight(),c=o.outerWidth(),u=o.outerHeight();"bottom"===a?o.css({top:e.top+l,left:e.left+(s/2-c/2)}):"top"===a?o.css({top:e.top-u,left:e.left+(s/2-c/2)}):"left"===a?o.css({top:e.top+(l/2-u/2),left:e.left-c}):"right"===a&&o.css({top:e.top+(l/2-u/2),left:e.left+s}),o.addClass("in")}},{key:"hide",value:function(){var t=this;this.$tooltip.removeClass("in"),setTimeout((function(){t.$tooltip.remove()}),200)}},{key:"toggle",value:function(){this.$tooltip.hasClass("in")?this.hide():this.show()}}])&&a(e.prototype,n),o&&a(e,o),t}();function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var c=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$button=e,this.options=i.a.extend({},{target:n.container},n),this.setEvent()}var e,n,o;return e=t,(n=[{key:"setEvent",value:function(){var t=this;this.$button.on("click",(function(e){t.toggle(),e.stopImmediatePropagation()}))}},{key:"clear",value:function(){var t=i()(".note-btn-group.open");t.find(".note-btn.active").removeClass("active"),t.removeClass("open")}},{key:"show",value:function(){this.$button.addClass("active"),this.$button.parent().addClass("open");var t=this.$button.next(),e=t.offset(),n=t.outerWidth(),o=i()(window).width(),r=parseFloat(i()(this.options.target).css("margin-right"));e.left+n>o-r?t.css("margin-left",o-r-(e.left+n)):t.css("margin-left","")}},{key:"hide",value:function(){this.$button.removeClass("active"),this.$button.parent().removeClass("open")}},{key:"toggle",value:function(){var t=this.$button.parent().hasClass("open");this.clear(),t?this.hide():this.show()}}])&&l(e.prototype,n),o&&l(e,o),t}();i()(document).on("click",(function(t){i()(t.target).closest(".note-btn-group").length||(i()(".note-btn-group.open").removeClass("open"),i()(".note-btn-group .note-btn.active").removeClass("active"))})),i()(document).on("click.note-dropdown-menu",(function(t){i()(t.target).closest(".note-dropdown-menu").parent().removeClass("open"),i()(t.target).closest(".note-dropdown-menu").parent().find(".note-btn.active").removeClass("active")}));var u=c;function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var h=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$modal=e,this.$backdrop=i()('<div class="note-modal-backdrop"/>')}var e,n,o;return e=t,(n=[{key:"show",value:function(){var t=this;this.$backdrop.appendTo(document.body).show(),this.$modal.addClass("open").show(),this.$modal.trigger("note.modal.show"),this.$modal.off("click",".close").on("click",".close",this.hide.bind(this)),this.$modal.on("keydown",(function(e){27===e.which&&(e.preventDefault(),t.hide())}))}},{key:"hide",value:function(){this.$modal.removeClass("open").hide(),this.$backdrop.hide(),this.$modal.trigger("note.modal.hide"),this.$modal.off("keydown")}}])&&d(e.prototype,n),o&&d(e,o),t}(),f=r.a.create('<div class="note-editor note-frame"/>'),p=r.a.create('<div class="note-toolbar" role="toolbar"/>'),m=r.a.create('<div class="note-editing-area"/>'),v=r.a.create('<textarea class="note-codable" aria-multiline="true"/>'),g=r.a.create('<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>'),b=r.a.create(['<output class="note-status-output" role="status" aria-live="polite"/>','<div class="note-statusbar" role="status">','<div class="note-resizebar" aria-label="resize">','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>',"</div>","</div>"].join("")),k=r.a.create('<div class="note-editor note-airframe"/>'),y=r.a.create(['<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>','<output class="note-status-output" role="status" aria-live="polite"/>'].join("")),w=r.a.create('<div class="note-btn-group">'),C=r.a.create('<button type="button" class="note-btn" tabindex="-1">',(function(t,e){e&&e.tooltip&&(t.attr({"aria-label":e.tooltip}),t.data("_lite_tooltip",new s(t,{title:e.tooltip,container:e.container})).on("click",(function(t){i()(t.currentTarget).data("_lite_tooltip").hide()}))),e.contents&&t.html(e.contents),e&&e.data&&"dropdown"===e.data.toggle&&t.data("_lite_dropdown",new u(t,{container:e.container}))})),x=r.a.create('<div class="note-dropdown-menu" role="list">',(function(t,e){var n=Array.isArray(e.items)?e.items.map((function(t){var n="string"==typeof t?t:t.value||"",o=e.template?e.template(t):t,r=i()('<a class="note-dropdown-item" href="#" data-value="'+n+'" role="listitem" aria-label="'+n+'"></a>');return r.html(o).data("item",t),r})):e.items;t.html(n).attr({"aria-label":e.title}),t.on("click","> .note-dropdown-item",(function(t){var n=i()(this),o=n.data("item"),r=n.data("value");o.click?o.click(n):e.itemClick&&e.itemClick(t,o,r)}))})),S=r.a.create('<div class="note-dropdown-menu note-check" role="list">',(function(t,e){var n=Array.isArray(e.items)?e.items.map((function(t){var n="string"==typeof t?t:t.value||"",o=e.template?e.template(t):t,r=i()('<a class="note-dropdown-item" href="#" data-value="'+n+'" role="listitem" aria-label="'+t+'"></a>');return r.html([z(e.checkClassName)," ",o]).data("item",t),r})):e.items;t.html(n).attr({"aria-label":e.title}),t.on("click","> .note-dropdown-item",(function(t){var n=i()(this),o=n.data("item"),r=n.data("value");o.click?o.click(n):e.itemClick&&e.itemClick(t,o,r)}))})),T=function(t,e){return t+" "+z(e.icons.caret,"span")},$=function(t,e){return w([C({className:"dropdown-toggle",contents:t.title+" "+z("note-icon-caret"),tooltip:t.tooltip,data:{toggle:"dropdown"}}),x({className:t.className,items:t.items,template:t.template,itemClick:t.itemClick})],{callback:e}).render()},E=function(t,e){return w([C({className:"dropdown-toggle",contents:t.title+" "+z("note-icon-caret"),tooltip:t.tooltip,data:{toggle:"dropdown"}}),S({className:t.className,checkClassName:t.checkClassName,items:t.items,template:t.template,itemClick:t.itemClick})],{callback:e}).render()},I=function(t){return w([C({className:"dropdown-toggle",contents:t.title+" "+z("note-icon-caret"),tooltip:t.tooltip,data:{toggle:"dropdown"}}),x([w({className:"note-align",children:t.items[0]}),w({className:"note-list",children:t.items[1]})])]).render()},N=function(t){return w([C({className:"dropdown-toggle",contents:t.title+" "+z("note-icon-caret"),tooltip:t.tooltip,data:{toggle:"dropdown"}}),x({className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>','<div class="note-dimension-picker-highlighted"/>','<div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(e){e.find(".note-dimension-picker-mousecatcher").css({width:t.col+"em",height:t.row+"em"}).mousedown(t.itemClick).mousemove((function(e){!function(t,e,n){var o,r=i()(t.target.parentNode),a=r.next(),s=r.find(".note-dimension-picker-mousecatcher"),l=r.find(".note-dimension-picker-highlighted"),c=r.find(".note-dimension-picker-unhighlighted");if(void 0===t.offsetX){var u=i()(t.target).offset();o={x:t.pageX-u.left,y:t.pageY-u.top}}else o={x:t.offsetX,y:t.offsetY};var d=Math.ceil(o.x/18)||1,h=Math.ceil(o.y/18)||1;l.css({width:d+"em",height:h+"em"}),s.data("value",d+"x"+h),d>3&&d<e&&c.css({width:d+1+"em"}),h>3&&h<n&&c.css({height:h+1+"em"}),a.html(d+" x "+h)}(e,t.col,t.row)}))}}).render()},P=r.a.create('<div class="note-color-palette"/>',(function(t,e){for(var n=[],o=0,r=e.colors.length;o<r;o++){for(var a=e.eventName,l=e.colors[o],c=e.colorsName[o],u=[],d=0,h=l.length;d<h;d++){var f=l[d],p=c[d];u.push(['<button type="button" class="note-btn note-color-btn"','style="background-color:',f,'" ','data-event="',a,'" ','data-value="',f,'" ','data-title="',p,'" ','aria-label="',p,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}n.push('<div class="note-color-row">'+u.join("")+"</div>")}t.html(n.join("")),t.find(".note-color-btn").each((function(){i()(this).data("_lite_tooltip",new s(i()(this),{container:e.container}))}))})),R=function(t,e){return w({className:"note-color",children:[C({className:"note-current-color-button",contents:t.title,tooltip:t.lang.color.recent,click:t.currentClick,callback:function(t){var n=t.find(".note-recent-color");"foreColor"!==e&&(n.css("background-color","#FFFF00"),t.attr("data-backColor","#FFFF00"))}}),C({className:"dropdown-toggle",contents:z("note-icon-caret"),tooltip:t.lang.color.more,data:{toggle:"dropdown"}}),x({items:["<div>",'<div class="note-btn-group btn-background-color">','<div class="note-palette-title">'+t.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset note-btn note-btn-block" data-event="backColor" data-value="inherit">',t.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor"/>','<div class="btn-sm">','<input type="color" id="html5bcp" class="note-btn btn-default" value="#21104A" style="width:100%;" data-value="cp">','<button type="button" class="note-color-reset btn" data-event="backColor" data-value="cpbackColor">',t.lang.color.cpSelect,"</button>","</div>","</div>",'<div class="note-btn-group btn-foreground-color">','<div class="note-palette-title">'+t.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset note-btn note-btn-block" data-event="removeFormat" data-value="foreColor">',t.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor"/>','<div class="btn-sm">','<input type="color" id="html5fcp" class="note-btn btn-default" value="#21104A" style="width:100%;" data-value="cp">','<button type="button" class="note-color-reset btn" data-event="foreColor" data-value="cpforeColor">',t.lang.color.cpSelect,"</button>","</div>","</div>","</div>"].join(""),callback:function(n){n.find(".note-holder").each((function(){var e=i()(this);e.append(P({colors:t.colors,eventName:e.data("event")}).render())})),"fore"===e?(n.find(".btn-background-color").hide(),n.css({"min-width":"210px"})):"back"===e&&(n.find(".btn-foreground-color").hide(),n.css({"min-width":"210px"}))},click:function(n){var o=i()(n.target),r=o.data("event"),a=o.data("value"),s=document.getElementById("html5fcp").value,l=document.getElementById("html5bcp").value;if("cp"===a?n.stopPropagation():"cpbackColor"===a?a=l:"cpforeColor"===a&&(a=s),r&&a){var c="backColor"===r?"background-color":"color",u=o.closest(".note-color").find(".note-recent-color"),d=o.closest(".note-color").find(".note-current-color-button");u.css(c,a),d.attr("data-"+r,a),"fore"===e?t.itemClick("foreColor",a):"back"===e?t.itemClick("backColor",a):t.itemClick(r,a)}}})]}).render()},L=r.a.create('<div class="note-modal" aria-hidden="false" tabindex="-1" role="dialog"/>',(function(t,e){e.fade&&t.addClass("fade"),t.attr({"aria-label":e.title}),t.html(['<div class="note-modal-content">',e.title?'<div class="note-modal-header"><button type="button" class="close" aria-label="Close" aria-hidden="true"><i class="note-icon-close"></i></button><h4 class="note-modal-title">'+e.title+"</h4></div>":"",'<div class="note-modal-body">'+e.body+"</div>",e.footer?'<div class="note-modal-footer">'+e.footer+"</div>":"","</div>"].join("")),t.data("modal",new h(t,e))})),A=function(t){var e='<div class="note-form-group"><label for="note-dialog-video-url-'+t.id+'" class="note-form-label">'+t.lang.video.url+' <small class="text-muted">'+t.lang.video.providers+'</small></label><input id="note-dialog-video-url-'+t.id+'" class="note-video-url note-input" type="text"/></div>',n=['<button type="button" href="#" class="note-btn note-btn-primary note-video-btn disabled" disabled>',t.lang.video.insert,"</button>"].join("");return L({title:t.lang.video.insert,fade:t.fade,body:e,footer:n}).render()},F=function(t){var e='<div class="note-form-group note-group-select-from-files"><label for="note-dialog-image-file-'+t.id+'" class="note-form-label">'+t.lang.image.selectFromFiles+'</label><input id="note-dialog-image-file-'+t.id+'" class="note-note-image-input note-input" type="file" name="files" accept="image/*" multiple="multiple"/>'+t.imageLimitation+'</div><div class="note-form-group"><label for="note-dialog-image-url-'+t.id+'" class="note-form-label">'+t.lang.image.url+'</label><input id="note-dialog-image-url-'+t.id+'" class="note-image-url note-input" type="text"/></div>',n=['<button href="#" type="button" class="note-btn note-btn-primary note-btn-large note-image-btn disabled" disabled>',t.lang.image.insert,"</button>"].join("");return L({title:t.lang.image.insert,fade:t.fade,body:e,footer:n}).render()},D=function(t){var e='<div class="note-form-group"><label for="note-dialog-link-txt-'+t.id+'" class="note-form-label">'+t.lang.link.textToDisplay+'</label><input id="note-dialog-link-txt-'+t.id+'" class="note-link-text note-input" type="text"/></div><div class="note-form-group"><label for="note-dialog-link-url-'+t.id+'" class="note-form-label">'+t.lang.link.url+'</label><input id="note-dialog-link-url-'+t.id+'" class="note-link-url note-input" type="text" value="http://"/></div>'+(t.disableLinkTarget?"":'<div class="checkbox"><label for="note-dialog-link-nw-'+t.id+'"><input id="note-dialog-link-nw-'+t.id+'" type="checkbox" checked> '+t.lang.link.openInNewWindow+"</label></div>")+'<div class="checkbox"><label for="note-dialog-link-up-'+t.id+'"><input id="note-dialog-link-up-'+t.id+'" type="checkbox" checked> '+t.lang.link.useProtocol+"</label></div>",n=['<button href="#" type="button" class="note-btn note-btn-primary note-link-btn disabled" disabled>',t.lang.link.insert,"</button>"].join("");return L({className:"link-dialog",title:t.lang.link.insert,fade:t.fade,body:e,footer:n}).render()},H=r.a.create(['<div class="note-popover bottom">','<div class="note-popover-arrow"/>','<div class="popover-content note-children-container"/>',"</div>"].join(""),(function(t,e){var n=void 0!==e.direction?e.direction:"bottom";t.addClass(n).hide(),e.hideArrow&&t.find(".note-popover-arrow").hide()})),B=r.a.create('<div class="checkbox"></div>',(function(t,e){t.html(["<label"+(e.id?' for="note-'+e.id+'"':"")+">",'<input role="checkbox" type="checkbox"'+(e.id?' id="note-'+e.id+'"':""),e.checked?" checked":"",' aria-checked="'+(e.checked?"true":"false")+'"/>',e.text?e.text:"","</label>"].join(""))})),z=function(t,e){return"<"+(e=e||"i")+' class="'+t+'"/>'},M=function(t){return{editor:f,toolbar:p,editingArea:m,codable:v,editable:g,statusbar:b,airEditor:k,airEditable:y,buttonGroup:w,button:C,dropdown:x,dropdownCheck:S,dropdownButton:$,dropdownButtonContents:T,dropdownCheckButton:E,paragraphDropdownButton:I,tableDropdownButton:N,colorDropdownButton:R,palette:P,dialog:L,videoDialog:A,imageDialog:F,linkDialog:D,popover:H,checkbox:B,icon:z,options:t,toggleBtn:function(t,e){t.toggleClass("disabled",!e),t.attr("disabled",!e)},toggleBtnActive:function(t,e){t.toggleClass("active",e)},check:function(t,e){t.find(".checked").removeClass("checked"),t.find('[data-value="'+e+'"]').addClass("checked")},onDialogShown:function(t,e){t.one("note.modal.show",e)},onDialogHidden:function(t,e){t.one("note.modal.hide",e)},showDialog:function(t){t.data("modal").show()},hideDialog:function(t){t.data("modal").hide()},getPopoverContent:function(t){return t.find(".note-popover-content")},getDialogBody:function(t){return t.find(".note-modal-body")},createLayout:function(e){var n=(t.airMode?k([m([v(),y()])]):"bottom"===t.toolbarPosition?f([m([v(),g()]),p(),b()]):f([p(),m([v(),g()]),b()])).render();return n.insertAfter(e),{note:e,editor:n,toolbar:n.find(".note-toolbar"),editingArea:n.find(".note-editing-area"),editable:n.find(".note-editable"),codable:n.find(".note-codable"),statusbar:n.find(".note-statusbar")}},removeLayout:function(t,e){t.html(e.editable.html()),e.editor.remove(),t.off("summernote"),t.show()}}};n(3),n(6);i.a.summernote=i.a.extend(i.a.summernote,{ui_template:M,interface:"lite"})},6:function(t,e,n){}})}));
File: public/AdminLTE/plugins/summernote/summernote-lite.min.js.map
Match lines: 1
1|{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///external {\"root\":\"jQuery\",\"commonjs2\":\"jquery\",\"commonjs\":\"jquery\",\"amd\":\"jquery\"}","webpack:///./src/js/base/renderer.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./src/js/base/summernote-en-US.js","webpack:///./src/js/base/core/env.js","webpack:///./src/js/base/core/func.js","webpack:///./src/js/base/core/lists.js","webpack:///./src/js/base/core/dom.js","webpack:///./src/js/base/Context.js","webpack:///./src/js/base/core/range.js","webpack:///./src/js/summernote.js","webpack:///./src/js/base/core/key.js","webpack:///./src/js/base/editing/History.js","webpack:///./src/js/base/editing/Style.js","webpack:///./src/js/base/editing/Bullet.js","webpack:///./src/js/base/editing/Typing.js","webpack:///./src/js/base/editing/Table.js","webpack:///./src/js/base/module/Editor.js","webpack:///./src/js/base/core/async.js","webpack:///./src/js/base/module/Clipboard.js","webpack:///./src/js/base/module/Codeview.js","webpack:///./src/js/base/module/Dropzone.js","webpack:///./src/js/base/module/Statusbar.js","webpack:///./src/js/base/module/Fullscreen.js","webpack:///./src/js/base/module/Handle.js","webpack:///./src/js/base/module/AutoLink.js","webpack:///./src/js/base/module/AutoSync.js","webpack:///./src/js/base/module/AutoReplace.js","webpack:///./src/js/base/module/Placeholder.js","webpack:///./src/js/base/module/Buttons.js","webpack:///./src/js/base/module/Toolbar.js","webpack:///./src/js/base/module/LinkDialog.js","webpack:///./src/js/base/module/LinkPopover.js","webpack:///./src/js/base/module/ImageDialog.js","webpack:///./src/js/base/module/ImagePopover.js","webpack:///./src/js/base/module/TablePopover.js","webpack:///./src/js/base/module/VideoDialog.js","webpack:///./src/js/base/module/HelpDialog.js","webpack:///./src/js/base/module/AirPopover.js","webpack:///./src/js/base/module/HintPopover.js","webpack:///./src/js/base/settings.js","webpack:///./src/js/lite/ui/TooltipUI.js","webpack:///./src/js/lite/ui/DropdownUI.js","webpack:///./src/js/lite/ui/ModalUI.js","webpack:///./src/js/lite/ui.js","webpack:///./src/js/lite/settings.js"],"names":["root","factory","exports","module","require","define","amd","a","i","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Renderer","markup","children","options","callback","this","$parent","$node","$","contents","html","className","addClass","data","each","k","v","attr","click","on","$container","find","forEach","child","render","length","append","arguments","Array","isArray","__webpack_amd_options__","summernote","lang","extend","font","bold","italic","underline","clear","height","strikethrough","subscript","superscript","size","sizeunit","image","insert","resizeFull","resizeHalf","resizeQuarter","resizeNone","floatLeft","floatRight","floatNone","shapeRounded","shapeCircle","shapeThumbnail","shapeNone","dragImageHere","dropImage","selectFromFiles","maximumFileSize","maximumFileSizeError","url","remove","original","video","videoLink","providers","link","unlink","edit","textToDisplay","openInNewWindow","useProtocol","table","addRowAbove","addRowBelow","addColLeft","addColRight","delRow","delCol","delTable","hr","style","blockquote","pre","h1","h2","h3","h4","h5","h6","lists","unordered","ordered","help","fullscreen","codeview","paragraph","outdent","indent","left","center","right","justify","color","recent","more","background","foreground","transparent","setTransparent","reset","resetToDefault","cpSelect","shortcut","shortcuts","close","textFormatting","action","paragraphFormatting","documentStyle","extraKeys","history","undo","redo","specialChar","select","output","noSelection","isSupportAmd","genericFontFamilies","validFontName","fontName","inArray","toLowerCase","browserVersion","userAgent","navigator","isMSIE","test","matches","exec","parseFloat","isEdge","hasCodeMirror","CodeMirror","isSupportTouch","MaxTouchPoints","msMaxTouchPoints","inputEventName","isMac","appVersion","indexOf","isFF","isPhantom","isWebkit","isChrome","isSafari","jqueryVersion","fn","jquery","isFontInstalled","testFontName","context","document","createElement","getContext","testSize","originalWidth","measureText","width","isW3CRangeSupport","createRange","idCounter","eq","itemA","itemB","eq2","peq2","propName","ok","fail","self","not","f","apply","and","fA","fB","item","invoke","obj","method","resetUniqueId","uniqueId","prefix","id","rect2bnd","rect","$document","top","scrollTop","scrollLeft","bottom","invertObject","inverted","namespaceToCamel","namespace","split","map","substring","toUpperCase","join","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","setTimeout","isValidUrl","head","array","last","tail","slice","contains","initial","prev","idx","next","pred","len","all","sum","reduce","memo","from","collection","result","isEmpty","clusterBy","aLast","compact","aResult","push","unique","results","NBSP_CHAR","String","fromCharCode","isEditable","node","hasClass","makePredByNodeName","nodeName","isText","nodeType","isVoid","isPara","isPre","isLi","isTable","isData","isInline","isBodyContainer","isList","isHr","isBlockquote","isCell","isAnchor","isBody","blankHTML","env","nodeLength","nodeValue","childNodes","innerHTML","paddingBlankHTML","ancestor","parentNode","listAncestor","ancestors","el","listNext","nodes","nextSibling","insertAfter","preceding","parent","insertBefore","appendChild","appendChildNodes","aChild","isLeftEdgePoint","point","offset","isRightEdgePoint","isEdgePoint","isLeftEdgeOf","position","isRightEdgeOf","previousSibling","hasChildren","prevPoint","isSkipInnerOffset","nextPoint","isSamePoint","pointA","pointB","splitNode","isSkipPaddingBlankHTML","isNotSplitEdgePoint","isDiscardEmptySplits","splitText","childNode","clone","cloneNode","splitTree","isRemoveChild","removeNode","removeChild","isTextarea","stripLinebreaks","val","replace","ZERO_WIDTH_NBSP_CHAR","blank","emptyPara","isControlSizing","isElement","isPurePara","isHeading","isBlock","isBodyInline","isParaInline","isDiv","isBR","isSpan","isB","isU","isS","isI","isImg","deepestChildIsEmpty","firstElementChild","isEmptyAnchor","isClosestSibling","nodeA","nodeB","withClosestSiblings","siblings","isLeftEdgePointOf","isRightEdgePointOf","isVisiblePoint","leftNode","rightNode","prevPointUntil","nextPointUntil","isCharPoint","ch","charAt","isSpacePoint","walkPoint","startPoint","endPoint","handler","singleChildAncestor","lastAncestor","filter","listPrev","listDescendant","descendants","fnWalk","current","commonAncestor","wrap","wrapperName","wrapper","makeOffsetPath","reverse","fromOffsetPath","offsets","splitPoint","splitRoot","container","topAncestor","pivot","createText","text","createTextNode","removeWhile","newNode","cssText","isNewlineOnBlock","match","endSlash","isEndOfInlineContainer","isBlockNode","trim","posFromPlaceholder","placeholder","$placeholder","pos","outerHeight","attachEvents","events","keys","detachEvents","off","isCustomStyleTag","classList","Context","$note","memos","layoutInfo","ui","ui_template","initialize","createLayout","_initialize","hide","_destroy","removeData","removeLayout","disabled","isDisabled","code","dom","disable","now","editor","buttons","plugins","initializeModule","removeModule","removeMemo","triggerEvent","isActivated","undefined","codable","editable","editing","callbacks","trigger","shouldInitialize","ModuleClass","withoutIntialize","destroy","event","createInvokeHandler","preventDefault","$target","target","closest","splits","hasSeparator","moduleName","methodName","textRangeToPoint","textRange","isStart","prevContainer","parentElement","tester","body","createTextRange","moveToElementText","compareEndPoints","textRangeStart","curTextNode","collapse","firstChild","pointTester","duplicate","setEndPoint","textCount","cont","pointToTextRange","info","textRangeInfo","isCollapseToStart","prevTextNodes","collapseToStart","moveStart","type","isExternalAPICalled","hasInitOptions","langInfo","icons","tooltip","note","first","focus","WrappedRange","sc","so","ec","eo","isOnEditable","makeIsOn","isOnList","isOnAnchor","isOnCell","isOnData","w3cRange","setStart","setEnd","Math","min","nativeRng","nativeRange","selection","getSelection","rangeCount","removeAllRanges","addRange","offsetTop","abs","getVisiblePoint","isLeftToRight","block","hasRightNode","hasLeftNode","getEndPoint","isCollapsed","getStartPoint","includeAncestor","fullyContains","leftEdgeNodes","startAncestor","endAncestor","boundaryPoints","getPoints","isSameContainer","rng","emptyParents","normalize","inlineSiblings","concat","para","wrapBodyInlineWithPara","deleteContents","contentsContainer","insertNode","toString","findAfter","isNotTextPoint","regex","index","path","e","paras","getClientRects","wrappedRange","createFromSelection","bodyElement","lastChild","createFromBodyElement","createFromNode","anchorNode","getRangeAt","startContainer","startOffset","endContainer","endOffset","textRangeEnd","isTextNode","createFromNodeBefore","createFromNodeAfter","createFromBookmark","bookmark","createFromParaBookmark","KEY_MAP","isEdit","keyCode","BACKSPACE","TAB","ENTER","SPACE","DELETE","isMove","LEFT","UP","RIGHT","DOWN","isNavigation","HOME","END","PAGEUP","PAGEDOWN","nameFromCode","History","stack","stackOffset","$editable","range","snapshot","recordUndo","applySnapshot","makeSnapshot","historyLimit","shift","Style","$obj","propertyNames","propertyName","css","styleInfo","jQueryCSS","fontSize","parseInt","expandClosestSibling","onlyPartialContains","nodesInRange","tails","elem","$cont","fromNode","queryCommandState","queryCommandValue","isUnordered","lineHeight","toFixed","anchor","Bullet","toggleList","clustereds","previousList","findList","wrapList","appendToPrevious","releaseList","listName","paraBookmark","wrappedParas","diffLists","listNode","prevList","nextList","isEscapseToBody","releasedParas","headList","parentItem","newList","findNextSiblings","lastList","middleList","rootLists","rootList","listNodes","Typing","bullet","tabsize","tab","nextPara","blockquoteBreakingLevel","emptyAnchors","scrollIntoView","TableResultAction","where","domTable","_startPoint","_virtualTable","_actionCellList","setVirtualTablePosition","rowIndex","cellIndex","baseRow","baseCell","isRowSpan","isColSpan","isVirtualCell","objPosition","getActionCell","virtualTableCellObj","resultAction","virtualRowPosition","virtualColPosition","recoverCellIndex","newCellIndex","addCellInfoToVirtual","row","cell","cellHasColspan","colSpan","cellHasRowspan","rowSpan","isThisSelectedCell","rowPos","colPos","rowspanNumber","attributes","rp","rowspanIndex","adjustStartPoint","colspanNumber","cp","cellspanIndex","isSelectedCell","getDeleteResultActionToCell","Column","SubtractSpanCount","Row","isVirtual","AddCell","RemoveCell","getAddResultActionToCell","SumSpanCount","Ignore","getActionList","fixedRow","fixedCol","actualPosition","canContinue","rowPosition","colPosition","requestAction","Add","Delete","tagName","rows","cells","createVirtualTable","Table","isShift","nextCell","currentTr","trAttributes","recoverAttributes","actions","idCell","currentCell","tdAttributes","newTd","removeAttr","setAttribute","before","lastTrIndex","after","actionIndex","resultStr","attrList","specified","cellPos","virtualPosition","virtualTable","hasRowspan","nextRow","cloneRow","removeAttribute","colCount","rowCount","tdHTML","tds","idxCol","trHTML","trs","idxRow","$table","tableClassName","Editor","$editor","lastRange","typing","untab","insertParagraph","insertOrderedList","insertUnorderedList","formatPara","insertHorizontalRule","commands","sCmd","beforeCommand","execCommand","afterCommand","wrapCommand","fontStyling","unit","currentStyle","fontSizeUnit","formatBlock","isLimited","getLastRange","setLastRange","insertText","textNode","pasteHTML","onApplyCustomStyle","onFormatBlock","hrNode","stylePara","createLink","linkInfo","linkUrl","linkText","isNewWindow","checkProtocol","additionalTextLength","isTextChanged","onCreateLink","defaultProtocol","anchors","styleNodes","colorInfo","foreColor","backColor","insertTable","dim","dimension","createTable","removeMedia","restoreTarget","detach","floatMe","toggleClass","resize","hasKeyShortCut","isDefaultPrevented","handleKeyMap","preventDefaultEditableShortCuts","recordEveryKeystroke","spellCheck","disableGrammar","airMode","overrideContextMenu","outerWidth","maxHeight","minHeight","keyMap","metaKey","ctrlKey","altKey","shiftKey","keyName","eventName","tabDisable","pad","maxTextLength","thenCollapse","commit","styleWithCSS","isPreventTrigger","normalizeContent","tabSize","insertTab","src","param","Deferred","deferred","$img","one","resolve","reject","display","appendTo","promise","then","$image","show","files","file","filename","maximumImageFileSize","FileReader","onload","dataURL","onerror","err","readAsDataURL","readFileAsDataURL","insertImage","onImageUpload","insertImagesAsDataURL","currentRange","spans","firstSpan","noteStatusOutput","expand","$anchor","addRow","addCol","deleteRow","deleteCol","deleteTable","bKeepRatio","imageSize","newRatio","y","x","ratio","is","hasFocus","Clipboard","pasteByEvent","clipboardData","originalEvent","items","kind","getAsFile","getData","Dropzone","$eventListener","documentEventHandlers","$dropzone","prependTo","disableDragAndDrop","onDrop","attachDragAndDropEvent","$dropzoneMessage","onDragenter","isCodeview","hasEditorSize","add","onDragleave","removeClass","dataTransfer","types","content","substr","CodeView","$codable","save","deactivate","activate","codeviewFilter","codeviewFilterRegex","codeviewIframeFilter","whitelist","codeviewIframeWhitelistSrc","codeviewIframeWhitelistSrcBase","tag","RegExp","prettifyHtml","cmEditor","fromTextArea","codemirror","tern","server","TernServer","ternServer","cm","updateArgHints","getValue","setSize","toTextArea","purify","isChange","Statusbar","$statusbar","statusbar","disableResizeEditor","stopPropagation","editableTop","onMouseMove","clientY","minheight","max","Fullscreen","$toolbar","toolbar","$window","$scrollbar","onResize","resizeTo","h","setsize","isFullscreen","Handle","$editingArea","editingArea","we","update","$handle","disableResizeImage","posStart","clientX","isImage","$selection","w","origImageObj","Image","sizingText","linkPattern","AutoLink","handleKeyup","handleKeydown","lastWordRange","keyword","urlText","linkTargetBlank","wordRange","getWordRange","AutoSync","AutoReplace","PERIOD","COMMA","SEMICOLON","SLASH","previousKeydownCode","lastWord","jQuery","Node","Placeholder","inheritPlaceholder","isShow","toggle","Buttons","invertedKeyMap","editorMethod","button","addToolbarButtons","addImagePopoverButtons","addLinkPopoverButtons","addTablePopoverButtons","fontInstalledMap","fontNamesIgnoreCheck","buttonGroup","icon","$button","currentTarget","$recentColor","colorButton","dropdownButtonContents","dropdown","$dropdown","$holder","palette","colors","colorsName","customColors","change","$chip","$picker","$palette","prepend","$color","$currentButton","magic","styleTags","title","template","styleIdx","styleLen","representShortcut","createInvokeHandlerAndUpdateState","eraser","addDefaultFonts","fontname","isFontDeservedToAdd","fontNames","dropdownCheck","checkClassName","menuCheck","fontSizes","fontSizeUnits","colorPalette","unorderedlist","orderedlist","justifyLeft","alignLeft","justifyCenter","alignCenter","justifyRight","alignRight","justifyFull","alignJustify","textHeight","lineHeights","insertTableMaxSize","col","mousedown","tableMoveHandler","picture","minus","arrowsAlt","question","rollback","trash","rowAbove","rowBelow","colBefore","colAfter","rowRemove","colRemove","groups","groupIdx","groupLen","group","groupName","$group","btn","updateBtnStates","$item","isChecked","infos","selector","toggleBtnActive","posOffset","$dimensionDisplay","$catcher","$highlighted","$unhighlighted","offsetX","posCatcher","pageX","pageY","offsetY","ceil","Toolbar","isFollowing","followScroll","toolbarContainer","changeContainer","followingToolbar","editorHeight","editorWidth","toolbarHeight","statusbarHeight","otherBarHeight","otherStaticBar","currentOffset","editorOffsetTop","activateOffset","deactivateOffsetBottom","marginTop","zIndex","isIncludeCodeview","$btn","toggleBtn","LinkDialog","$body","dialogsInBody","disableLinkTarget","checkbox","checked","footer","$dialog","dialog","fade","dialogsFade","hideDialog","$input","$linkBtn","$linkText","$linkUrl","$openInNewWindow","$useProtocol","onDialogShown","toggleLinkBtn","bindEnterKey","isNewWindowChecked","prop","useProtocolChecked","onDialogHidden","state","showDialog","showLinkDialog","LinkPopover","popover","$popover","$content","href","containerOffset","ImageDialog","imageLimitation","floor","log","readableSize","pow","showImageDialog","onImageLinkInsert","$imageInput","$imageUrl","$imageBtn","replaceWith","ImagePopover","popatmouse","TablePopover","VideoDialog","$video","ytMatch","igMatch","vMatch","vimMatch","dmMatch","youkuMatch","qqMatch","qqMatch2","mp4Match","oggMatch","webmMatch","fbMatch","youtubeId","start","ytMatchForStart","vid","encodeURIComponent","showVideoDialog","createVideoNode","$videoUrl","$videoBtn","HelpDialog","createShortcutList","command","$row","showHelpDialog","AirPopover","hidable","onContextmenu","air","forcelyOpen","HintPopover","hint","direction","hintDirection","hints","matchingWord","hideArrow","innerHeight","$current","$next","selectItem","$nextGroup","$prev","$prevGroup","nodeFromItem","rangeCompute","hintSelect","hintIdx","moveUp","moveDown","search","searchKeyword","createItemTemplates","hintMode","getWordsRange","getWordsMatchRange","empty","bnd","createGroup","version","Codeview","toolbarPosition","tabDisabled","textareaAutoSync","onBeforeCommand","onBlur","onBlurCodeview","onChange","onChangeCodeview","onEnter","onFocus","onImageUploadError","onInit","onKeydown","onKeyup","onMousedown","onMouseup","onPaste","onScroll","htmlMode","lineNumbers","pc","mac","TooltipUI","placement","$tooltip","showCallback","hideCallback","toggleCallback","targetOffset","nodeWidth","nodeHeight","tooltipWidth","tooltipHeight","DropdownUI","setEvent","stopImmediatePropagation","windowWidth","targetMarginRight","isOpened","ModalUI","$modal","$backdrop","which","renderer","airEditor","airEditable","$temp","$a","itemClick","caret","dropdownButton","opt","dropdownCheckButton","paragraphDropdownButton","tableDropdownButton","mousemove","rowSize","colSize","colorName","colorDropdownButton","currentClick","foreinput","getElementById","backinput","videoDialog","imageDialog","linkDialog","iconClassName","editorOptions","isEnable","isActive","check","$dom","getPopoverContent","getDialogBody","interface"],"mappings":";CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,gBAC7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iB,EAAcve,QAAU+c,EAAU,CACjD7T,EAAY,CACVlhB,IACAg1B,QAEoC,WAAlCuB,EAAcpE,gBAChB5yB,EAAO,CACP2hB,EAAY,CACVlhB,IACAC,MAEFugB,IACAV,MAEAvgB,EAAO,CACPihB,IACAU,EAAY,CACVlhB,IACAC,MAEF6f,OAEDn6B,SAIH,OAFAuuB,EAAQ3d,YAAY8H,GAEb,CACL8E,KAAM9E,EACNkB,OAAQ2U,EACRsM,QAAStM,EAAQ1uB,KAAK,iBACtB07B,YAAahN,EAAQ1uB,KAAK,sBAC1Bya,SAAUiU,EAAQ1uB,KAAK,kBACvBwa,QAASkU,EAAQ1uB,KAAK,iBACtBs6B,UAAW5L,EAAQ1uB,KAAK,qBAI5BwZ,aAAc,SAASX,EAAOE,GAC5BF,EAAMxZ,KAAK0Z,EAAW0B,SAASpb,QAC/B0Z,EAAWgB,OAAOpX,SAClBkW,EAAMJ,IAAI,cACVI,EAAM8b,U,UCrnBZx1B,IAAEuB,WAAavB,IAAEyB,OAAOzB,IAAEuB,WAAY,CACpCuY,YAAaD,EACbs4B,UAAW,U","file":"summernote-lite.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 51);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import $ from 'jquery';\n\nclass Renderer {\n constructor(markup, children, options, callback) {\n this.markup = markup;\n this.children = children;\n this.options = options;\n this.callback = callback;\n }\n\n render($parent) {\n const $node = $(this.markup);\n\n if (this.options && this.options.contents) {\n $node.html(this.options.contents);\n }\n\n if (this.options && this.options.className) {\n $node.addClass(this.options.className);\n }\n\n if (this.options && this.options.data) {\n $.each(this.options.data, (k, v) => {\n $node.attr('data-' + k, v);\n });\n }\n\n if (this.options && this.options.click) {\n $node.on('click', this.options.click);\n }\n\n if (this.children) {\n const $container = $node.find('.note-children-container');\n this.children.forEach((child) => {\n child.render($container.length ? $container : $node);\n });\n }\n\n if (this.callback) {\n this.callback($node, this.options);\n }\n\n if (this.options && this.options.callback) {\n this.options.callback($node);\n }\n\n if ($parent) {\n $parent.append($node);\n }\n\n return $node;\n }\n}\n\nexport default {\n create: (markup, callback) => {\n return function() {\n const options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n let children = Array.isArray(arguments[0]) ? arguments[0] : [];\n if (options && options.children) {\n children = options.children;\n }\n return new Renderer(markup, children, options, callback);\n };\n },\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import $ from 'jquery';\n\n$.summernote = $.summernote || {\n lang: {},\n};\n\n$.extend($.summernote.lang, {\n 'en-US': {\n font: {\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n clear: 'Remove Font Style',\n height: 'Line Height',\n name: 'Font Family',\n strikethrough: 'Strikethrough',\n subscript: 'Subscript',\n superscript: 'Superscript',\n size: 'Font Size',\n sizeunit: 'Font Size Unit',\n },\n image: {\n image: 'Picture',\n insert: 'Insert Image',\n resizeFull: 'Resize full',\n resizeHalf: 'Resize half',\n resizeQuarter: 'Resize quarter',\n resizeNone: 'Original size',\n floatLeft: 'Float Left',\n floatRight: 'Float Right',\n floatNone: 'Remove float',\n shapeRounded: 'Shape: Rounded',\n shapeCircle: 'Shape: Circle',\n shapeThumbnail: 'Shape: Thumbnail',\n shapeNone: 'Shape: None',\n dragImageHere: 'Drag image or text here',\n dropImage: 'Drop image or Text',\n selectFromFiles: 'Select from files',\n maximumFileSize: 'Maximum file size',\n maximumFileSizeError: 'Maximum file size exceeded.',\n url: 'Image URL',\n remove: 'Remove Image',\n original: 'Original',\n },\n video: {\n video: 'Video',\n videoLink: 'Video Link',\n insert: 'Insert Video',\n url: 'Video URL',\n providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)',\n },\n link: {\n link: 'Link',\n insert: 'Insert Link',\n unlink: 'Unlink',\n edit: 'Edit',\n textToDisplay: 'Text to display',\n url: 'To what URL should this link go?',\n openInNewWindow: 'Open in new window',\n useProtocol: 'Use default protocol',\n },\n table: {\n table: 'Table',\n addRowAbove: 'Add row above',\n addRowBelow: 'Add row below',\n addColLeft: 'Add column left',\n addColRight: 'Add column right',\n delRow: 'Delete row',\n delCol: 'Delete column',\n delTable: 'Delete table',\n },\n hr: {\n insert: 'Insert Horizontal Rule',\n },\n style: {\n style: 'Style',\n p: 'Normal',\n blockquote: 'Quote',\n pre: 'Code',\n h1: 'Header 1',\n h2: 'Header 2',\n h3: 'Header 3',\n h4: 'Header 4',\n h5: 'Header 5',\n h6: 'Header 6',\n },\n lists: {\n unordered: 'Unordered list',\n ordered: 'Ordered list',\n },\n options: {\n help: 'Help',\n fullscreen: 'Full Screen',\n codeview: 'Code View',\n },\n paragraph: {\n paragraph: 'Paragraph',\n outdent: 'Outdent',\n indent: 'Indent',\n left: 'Align left',\n center: 'Align center',\n right: 'Align right',\n justify: 'Justify full',\n },\n color: {\n recent: 'Recent Color',\n more: 'More Color',\n background: 'Background Color',\n foreground: 'Text Color',\n transparent: 'Transparent',\n setTransparent: 'Set transparent',\n reset: 'Reset',\n resetToDefault: 'Reset to default',\n cpSelect: 'Select',\n },\n shortcut: {\n shortcuts: 'Keyboard shortcuts',\n close: 'Close',\n textFormatting: 'Text formatting',\n action: 'Action',\n paragraphFormatting: 'Paragraph formatting',\n documentStyle: 'Document Style',\n extraKeys: 'Extra keys',\n },\n help: {\n 'insertParagraph': 'Insert Paragraph',\n 'undo': 'Undoes the last command',\n 'redo': 'Redoes the last command',\n 'tab': 'Tab',\n 'untab': 'Untab',\n 'bold': 'Set a bold style',\n 'italic': 'Set a italic style',\n 'underline': 'Set a underline style',\n 'strikethrough': 'Set a strikethrough style',\n 'removeFormat': 'Clean a style',\n 'justifyLeft': 'Set left align',\n 'justifyCenter': 'Set center align',\n 'justifyRight': 'Set right align',\n 'justifyFull': 'Set full align',\n 'insertUnorderedList': 'Toggle unordered list',\n 'insertOrderedList': 'Toggle ordered list',\n 'outdent': 'Outdent on current paragraph',\n 'indent': 'Indent on current paragraph',\n 'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n 'formatH1': 'Change current block\\'s format as H1',\n 'formatH2': 'Change current block\\'s format as H2',\n 'formatH3': 'Change current block\\'s format as H3',\n 'formatH4': 'Change current block\\'s format as H4',\n 'formatH5': 'Change current block\\'s format as H5',\n 'formatH6': 'Change current block\\'s format as H6',\n 'insertHorizontalRule': 'Insert horizontal rule',\n 'linkDialog.show': 'Show Link Dialog',\n },\n history: {\n undo: 'Undo',\n redo: 'Redo',\n },\n specialChar: {\n specialChar: 'SPECIAL CHARACTERS',\n select: 'Select Special characters',\n },\n output: {\n noSelection: 'No Selection Made!',\n },\n },\n});\n","import $ from 'jquery';\nconst isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n\n/**\n * returns whether font is installed or not.\n *\n * @param {String} fontName\n * @return {Boolean}\n */\nconst genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n\nfunction validFontName(fontName) {\n return ($.inArray(fontName.toLowerCase(), genericFontFamilies) === -1) ? `'${fontName}'` : fontName;\n}\n\nfunction isFontInstalled(fontName) {\n const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n const testText = 'mmmmmmmmmmwwwww';\n const testSize = '200px';\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n\n context.font = testSize + \" '\" + testFontName + \"'\";\n const originalWidth = context.measureText(testText).width;\n\n context.font = testSize + ' ' + validFontName(fontName) + ', \"' + testFontName + '\"';\n const width = context.measureText(testText).width;\n\n return originalWidth !== width;\n}\n\nconst userAgent = navigator.userAgent;\nconst isMSIE = /MSIE|Trident/i.test(userAgent);\nlet browserVersion;\nif (isMSIE) {\n let matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n}\n\nconst isEdge = /Edge\\/\\d+/.test(userAgent);\n\nlet hasCodeMirror = !!window.CodeMirror;\n\nconst isSupportTouch =\n (('ontouchstart' in window) ||\n (navigator.MaxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0));\n\n// [workaround] IE doesn't have input events for contentEditable\n// - see: https://goo.gl/4bfIvA\nconst inputEventName = (isMSIE) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n\n/**\n * @class core.env\n *\n * Object which check platform and agent\n *\n * @singleton\n * @alternateClassName env\n */\nexport default {\n isMac: navigator.appVersion.indexOf('Mac') > -1,\n isMSIE,\n isEdge,\n isFF: !isEdge && /firefox/i.test(userAgent),\n isPhantom: /PhantomJS/i.test(userAgent),\n isWebkit: !isEdge && /webkit/i.test(userAgent),\n isChrome: !isEdge && /chrome/i.test(userAgent),\n isSafari: !isEdge && /safari/i.test(userAgent) && (!/chrome/i.test(userAgent)),\n browserVersion,\n jqueryVersion: parseFloat($.fn.jquery),\n isSupportAmd,\n isSupportTouch,\n hasCodeMirror,\n isFontInstalled,\n isW3CRangeSupport: !!document.createRange,\n inputEventName,\n genericFontFamilies,\n validFontName,\n};\n","import $ from 'jquery';\n\n/**\n * @class core.func\n *\n * func utils (for high-order func's arg)\n *\n * @singleton\n * @alternateClassName func\n */\nfunction eq(itemA) {\n return function(itemB) {\n return itemA === itemB;\n };\n}\n\nfunction eq2(itemA, itemB) {\n return itemA === itemB;\n}\n\nfunction peq2(propName) {\n return function(itemA, itemB) {\n return itemA[propName] === itemB[propName];\n };\n}\n\nfunction ok() {\n return true;\n}\n\nfunction fail() {\n return false;\n}\n\nfunction not(f) {\n return function() {\n return !f.apply(f, arguments);\n };\n}\n\nfunction and(fA, fB) {\n return function(item) {\n return fA(item) && fB(item);\n };\n}\n\nfunction self(a) {\n return a;\n}\n\nfunction invoke(obj, method) {\n return function() {\n return obj[method].apply(obj, arguments);\n };\n}\n\nlet idCounter = 0;\n\n/**\n * reset globally-unique id\n *\n */\nfunction resetUniqueId() {\n idCounter = 0;\n}\n\n/**\n * generate a globally-unique id\n *\n * @param {String} [prefix]\n */\nfunction uniqueId(prefix) {\n const id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n/**\n * returns bnd (bounds) from rect\n *\n * - IE Compatibility Issue: http://goo.gl/sRLOAo\n * - Scroll Issue: http://goo.gl/sNjUc\n *\n * @param {Rect} rect\n * @return {Object} bounds\n * @return {Number} bounds.top\n * @return {Number} bounds.left\n * @return {Number} bounds.width\n * @return {Number} bounds.height\n */\nfunction rect2bnd(rect) {\n const $document = $(document);\n return {\n top: rect.top + $document.scrollTop(),\n left: rect.left + $document.scrollLeft(),\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\n/**\n * returns a copy of the object where the keys have become the values and the values the keys.\n * @param {Object} obj\n * @return {Object}\n */\nfunction invertObject(obj) {\n const inverted = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n inverted[obj[key]] = key;\n }\n }\n return inverted;\n}\n\n/**\n * @param {String} namespace\n * @param {String} [prefix]\n * @return {String}\n */\nfunction namespaceToCamel(namespace, prefix) {\n prefix = prefix || '';\n return prefix + namespace.split('.').map(function(name) {\n return name.substring(0, 1).toUpperCase() + name.substring(1);\n }).join('');\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n * @param {Function} func\n * @param {Number} wait\n * @param {Boolean} immediate\n * @return {Function}\n */\nfunction debounce(func, wait, immediate) {\n let timeout;\n return function() {\n const context = this;\n const args = arguments;\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/**\n *\n * @param {String} url\n * @return {Boolean}\n */\nfunction isValidUrl(url) {\n const expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n return expression.test(url);\n}\n\nexport default {\n eq,\n eq2,\n peq2,\n ok,\n fail,\n self,\n not,\n and,\n invoke,\n resetUniqueId,\n uniqueId,\n rect2bnd,\n invertObject,\n namespaceToCamel,\n debounce,\n isValidUrl,\n};\n","import func from './func';\n\n/**\n * returns the first item of an array.\n *\n * @param {Array} array\n */\nfunction head(array) {\n return array[0];\n}\n\n/**\n * returns the last item of an array.\n *\n * @param {Array} array\n */\nfunction last(array) {\n return array[array.length - 1];\n}\n\n/**\n * returns everything but the last entry of the array.\n *\n * @param {Array} array\n */\nfunction initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * returns the rest of the items in an array.\n *\n * @param {Array} array\n */\nfunction tail(array) {\n return array.slice(1);\n}\n\n/**\n * returns item of array\n */\nfunction find(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n const item = array[idx];\n if (pred(item)) {\n return item;\n }\n }\n}\n\n/**\n * returns true if all of the values in the array pass the predicate truth test.\n */\nfunction all(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * returns true if the value is present in the list.\n */\nfunction contains(array, item) {\n if (array && array.length && item) {\n if (array.indexOf) {\n return array.indexOf(item) !== -1;\n } else if (array.contains) {\n // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`\n return array.contains(item);\n }\n }\n return false;\n}\n\n/**\n * get sum from a list\n *\n * @param {Array} array - array\n * @param {Function} fn - iterator\n */\nfunction sum(array, fn) {\n fn = fn || func.self;\n return array.reduce(function(memo, v) {\n return memo + fn(v);\n }, 0);\n}\n\n/**\n * returns a copy of the collection with array type.\n * @param {Collection} collection - collection eg) node.childNodes, ...\n */\nfunction from(collection) {\n const result = [];\n const length = collection.length;\n let idx = -1;\n while (++idx < length) {\n result[idx] = collection[idx];\n }\n return result;\n}\n\n/**\n * returns whether list is empty or not\n */\nfunction isEmpty(array) {\n return !array || !array.length;\n}\n\n/**\n * cluster elements by predicate function.\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n * @param {Array[]}\n */\nfunction clusterBy(array, fn) {\n if (!array.length) { return []; }\n const aTail = tail(array);\n return aTail.reduce(function(memo, v) {\n const aLast = last(memo);\n if (fn(last(aLast), v)) {\n aLast[aLast.length] = v;\n } else {\n memo[memo.length] = [v];\n }\n return memo;\n }, [[head(array)]]);\n}\n\n/**\n * returns a copy of the array with all false values removed\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n */\nfunction compact(array) {\n const aResult = [];\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (array[idx]) { aResult.push(array[idx]); }\n }\n return aResult;\n}\n\n/**\n * produces a duplicate-free version of the array\n *\n * @param {Array} array\n */\nfunction unique(array) {\n const results = [];\n\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!contains(results, array[idx])) {\n results.push(array[idx]);\n }\n }\n\n return results;\n}\n\n/**\n * returns next item.\n * @param {Array} array\n */\nfunction next(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx + 1];\n }\n return null;\n}\n\n/**\n * returns prev item.\n * @param {Array} array\n */\nfunction prev(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx - 1];\n }\n return null;\n}\n\n/**\n * @class core.list\n *\n * list utils\n *\n * @singleton\n * @alternateClassName list\n */\nexport default {\n head,\n last,\n initial,\n tail,\n prev,\n next,\n find,\n contains,\n all,\n sum,\n from,\n isEmpty,\n clusterBy,\n compact,\n unique,\n};\n","import $ from 'jquery';\nimport func from './func';\nimport lists from './lists';\nimport env from './env';\n\nconst NBSP_CHAR = String.fromCharCode(160);\nconst ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n\n/**\n * @method isEditable\n *\n * returns whether node is `note-editable` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEditable(node) {\n return node && $(node).hasClass('note-editable');\n}\n\n/**\n * @method isControlSizing\n *\n * returns whether node is `note-control-sizing` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isControlSizing(node) {\n return node && $(node).hasClass('note-control-sizing');\n}\n\n/**\n * @method makePredByNodeName\n *\n * returns predicate which judge whether nodeName is same\n *\n * @param {String} nodeName\n * @return {Function}\n */\nfunction makePredByNodeName(nodeName) {\n nodeName = nodeName.toUpperCase();\n return function(node) {\n return node && node.nodeName.toUpperCase() === nodeName;\n };\n}\n\n/**\n * @method isText\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is text(3)\n */\nfunction isText(node) {\n return node && node.nodeType === 3;\n}\n\n/**\n * @method isElement\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is element(1)\n */\nfunction isElement(node) {\n return node && node.nodeType === 1;\n}\n\n/**\n * ex) br, col, embed, hr, img, input, ...\n * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n */\nfunction isVoid(node) {\n return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n}\n\nfunction isPara(node) {\n if (isEditable(node)) {\n return false;\n }\n\n // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nfunction isHeading(node) {\n return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nconst isPre = makePredByNodeName('PRE');\n\nconst isLi = makePredByNodeName('LI');\n\nfunction isPurePara(node) {\n return isPara(node) && !isLi(node);\n}\n\nconst isTable = makePredByNodeName('TABLE');\n\nconst isData = makePredByNodeName('DATA');\n\nfunction isInline(node) {\n return !isBodyContainer(node) &&\n !isList(node) &&\n !isHr(node) &&\n !isPara(node) &&\n !isTable(node) &&\n !isBlockquote(node) &&\n !isData(node);\n}\n\nfunction isList(node) {\n return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n}\n\nconst isHr = makePredByNodeName('HR');\n\nfunction isCell(node) {\n return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n}\n\nconst isBlockquote = makePredByNodeName('BLOCKQUOTE');\n\nfunction isBodyContainer(node) {\n return isCell(node) || isBlockquote(node) || isEditable(node);\n}\n\nconst isAnchor = makePredByNodeName('A');\n\nfunction isParaInline(node) {\n return isInline(node) && !!ancestor(node, isPara);\n}\n\nfunction isBodyInline(node) {\n return isInline(node) && !ancestor(node, isPara);\n}\n\nconst isBody = makePredByNodeName('BODY');\n\n/**\n * returns whether nodeB is closest sibling of nodeA\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @return {Boolean}\n */\nfunction isClosestSibling(nodeA, nodeB) {\n return nodeA.nextSibling === nodeB ||\n nodeA.previousSibling === nodeB;\n}\n\n/**\n * returns array of closest siblings with node\n *\n * @param {Node} node\n * @param {function} [pred] - predicate function\n * @return {Node[]}\n */\nfunction withClosestSiblings(node, pred) {\n pred = pred || func.ok;\n\n const siblings = [];\n if (node.previousSibling && pred(node.previousSibling)) {\n siblings.push(node.previousSibling);\n }\n siblings.push(node);\n if (node.nextSibling && pred(node.nextSibling)) {\n siblings.push(node.nextSibling);\n }\n return siblings;\n}\n\n/**\n * blank HTML for cursor position\n * - [workaround] old IE only works with \n * - [workaround] IE11 and other browser works with bogus br\n */\nconst blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '<br>';\n\n/**\n * @method nodeLength\n *\n * returns #text's text size or element's childNodes size\n *\n * @param {Node} node\n */\nfunction nodeLength(node) {\n if (isText(node)) {\n return node.nodeValue.length;\n }\n\n if (node) {\n return node.childNodes.length;\n }\n\n return 0;\n}\n\n/**\n * returns whether deepest child node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction deepestChildIsEmpty(node) {\n do {\n if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;\n } while ((node = node.firstElementChild));\n\n return isEmpty(node);\n}\n\n/**\n * returns whether node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEmpty(node) {\n const len = nodeLength(node);\n\n if (len === 0) {\n return true;\n } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n // ex) <p><br></p>, <span><br></span>\n return true;\n } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n // ex) <p></p>, <span></span>\n return true;\n }\n\n return false;\n}\n\n/**\n * padding blankHTML if node is empty (for cursor position)\n */\nfunction paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}\n\n/**\n * find nearest ancestor predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction ancestor(node, pred) {\n while (node) {\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * find nearest ancestor only single child blood line and predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction singleChildAncestor(node, pred) {\n node = node.parentNode;\n\n while (node) {\n if (nodeLength(node) !== 1) { break; }\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * returns new array of ancestor nodes (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listAncestor(node, pred) {\n pred = pred || func.fail;\n\n const ancestors = [];\n ancestor(node, function(el) {\n if (!isEditable(el)) {\n ancestors.push(el);\n }\n\n return pred(el);\n });\n return ancestors;\n}\n\n/**\n * find farthest ancestor predicate hit\n */\nfunction lastAncestor(node, pred) {\n const ancestors = listAncestor(node);\n return lists.last(ancestors.filter(pred));\n}\n\n/**\n * returns common ancestor node between two nodes.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\nfunction commonAncestor(nodeA, nodeB) {\n const ancestors = listAncestor(nodeA);\n for (let n = nodeB; n; n = n.parentNode) {\n if (ancestors.indexOf(n) > -1) return n;\n }\n return null; // difference document area\n}\n\n/**\n * listing all previous siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listPrev(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.previousSibling;\n }\n return nodes;\n}\n\n/**\n * listing next siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listNext(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.nextSibling;\n }\n return nodes;\n}\n\n/**\n * listing descendant nodes\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listDescendant(node, pred) {\n const descendants = [];\n pred = pred || func.ok;\n\n // start DFS(depth first search) with node\n (function fnWalk(current) {\n if (node !== current && pred(current)) {\n descendants.push(current);\n }\n for (let idx = 0, len = current.childNodes.length; idx < len; idx++) {\n fnWalk(current.childNodes[idx]);\n }\n })(node);\n\n return descendants;\n}\n\n/**\n * wrap node with new tag.\n *\n * @param {Node} node\n * @param {Node} tagName of wrapper\n * @return {Node} - wrapper\n */\nfunction wrap(node, wrapperName) {\n const parent = node.parentNode;\n const wrapper = $('<' + wrapperName + '>')[0];\n\n parent.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n}\n\n/**\n * insert node after preceding\n *\n * @param {Node} node\n * @param {Node} preceding - predicate function\n */\nfunction insertAfter(node, preceding) {\n const next = preceding.nextSibling;\n let parent = preceding.parentNode;\n if (next) {\n parent.insertBefore(node, next);\n } else {\n parent.appendChild(node);\n }\n return node;\n}\n\n/**\n * append elements.\n *\n * @param {Node} node\n * @param {Collection} aChild\n */\nfunction appendChildNodes(node, aChild) {\n $.each(aChild, function(idx, child) {\n node.appendChild(child);\n });\n return node;\n}\n\n/**\n * returns whether boundaryPoint is left edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isLeftEdgePoint(point) {\n return point.offset === 0;\n}\n\n/**\n * returns whether boundaryPoint is right edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isRightEdgePoint(point) {\n return point.offset === nodeLength(point.node);\n}\n\n/**\n * returns whether boundaryPoint is edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isEdgePoint(point) {\n return isLeftEdgePoint(point) || isRightEdgePoint(point);\n}\n\n/**\n * returns whether node is left edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgeOf(node, ancestor) {\n while (node && node !== ancestor) {\n if (position(node) !== 0) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether node is right edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgeOf(node, ancestor) {\n if (!ancestor) {\n return false;\n }\n while (node && node !== ancestor) {\n if (position(node) !== nodeLength(node.parentNode) - 1) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether point is left edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgePointOf(point, ancestor) {\n return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns whether point is right edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgePointOf(point, ancestor) {\n return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns offset from parent.\n *\n * @param {Node} node\n */\nfunction position(node) {\n let offset = 0;\n while ((node = node.previousSibling)) {\n offset += 1;\n }\n return offset;\n}\n\nfunction hasChildren(node) {\n return !!(node && node.childNodes && node.childNodes.length);\n}\n\n/**\n * returns previous boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction prevPoint(point, isSkipInnerOffset) {\n let node;\n let offset;\n\n if (point.offset === 0) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node);\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset - 1];\n offset = nodeLength(node);\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? 0 : point.offset - 1;\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns next boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction nextPoint(point, isSkipInnerOffset) {\n let node, offset;\n\n if (isEmpty(point.node)) {\n return null;\n }\n\n if (nodeLength(point.node) === point.offset) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node) + 1;\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset];\n offset = 0;\n if (isEmpty(node)) {\n return null;\n }\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n\n if (isEmpty(node)) {\n return null;\n }\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns whether pointA and pointB is same or not.\n *\n * @param {BoundaryPoint} pointA\n * @param {BoundaryPoint} pointB\n * @return {Boolean}\n */\nfunction isSamePoint(pointA, pointB) {\n return pointA.node === pointB.node && pointA.offset === pointB.offset;\n}\n\n/**\n * returns whether point is visible (can set cursor) or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isVisiblePoint(point) {\n if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {\n return true;\n }\n\n const leftNode = point.node.childNodes[point.offset - 1];\n const rightNode = point.node.childNodes[point.offset];\n if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @method prevPointUtil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction prevPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = prevPoint(point);\n }\n\n return null;\n}\n\n/**\n * @method nextPointUntil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction nextPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = nextPoint(point);\n }\n\n return null;\n}\n\n/**\n * returns whether point has character or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isCharPoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n}\n\n/**\n * returns whether point has space or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isSpacePoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch === ' ' || ch === NBSP_CHAR;\n}\n\n/**\n * @method walkPoint\n *\n * @param {BoundaryPoint} startPoint\n * @param {BoundaryPoint} endPoint\n * @param {Function} handler\n * @param {Boolean} isSkipInnerOffset\n */\nfunction walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n let point = startPoint;\n\n while (point) {\n handler(point);\n\n if (isSamePoint(point, endPoint)) {\n break;\n }\n\n const isSkipOffset = isSkipInnerOffset &&\n startPoint.node !== point.node &&\n endPoint.node !== point.node;\n point = nextPoint(point, isSkipOffset);\n }\n}\n\n/**\n * @method makeOffsetPath\n *\n * return offsetPath(array of offset) from ancestor\n *\n * @param {Node} ancestor - ancestor node\n * @param {Node} node\n */\nfunction makeOffsetPath(ancestor, node) {\n const ancestors = listAncestor(node, func.eq(ancestor));\n return ancestors.map(position).reverse();\n}\n\n/**\n * @method fromOffsetPath\n *\n * return element from offsetPath(array of offset)\n *\n * @param {Node} ancestor - ancestor node\n * @param {array} offsets - offsetPath\n */\nfunction fromOffsetPath(ancestor, offsets) {\n let current = ancestor;\n for (let i = 0, len = offsets.length; i < len; i++) {\n if (current.childNodes.length <= offsets[i]) {\n current = current.childNodes[current.childNodes.length - 1];\n } else {\n current = current.childNodes[offsets[i]];\n }\n }\n return current;\n}\n\n/**\n * @method splitNode\n *\n * split element or #text\n *\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitNode(point, options) {\n let isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n const isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n const isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n\n if (isDiscardEmptySplits) {\n isSkipPaddingBlankHTML = true;\n }\n\n // edge case\n if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n if (isLeftEdgePoint(point)) {\n return point.node;\n } else if (isRightEdgePoint(point)) {\n return point.node.nextSibling;\n }\n }\n\n // split #text\n if (isText(point.node)) {\n return point.node.splitText(point.offset);\n } else {\n const childNode = point.node.childNodes[point.offset];\n const clone = insertAfter(point.node.cloneNode(false), point.node);\n appendChildNodes(clone, listNext(childNode));\n\n if (!isSkipPaddingBlankHTML) {\n paddingBlankHTML(point.node);\n paddingBlankHTML(clone);\n }\n\n if (isDiscardEmptySplits) {\n if (isEmpty(point.node)) {\n remove(point.node);\n }\n if (isEmpty(clone)) {\n remove(clone);\n return point.node.nextSibling;\n }\n }\n\n return clone;\n }\n}\n\n/**\n * @method splitTree\n *\n * split tree by point\n *\n * @param {Node} root - split root\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitTree(root, point, options) {\n // ex) [#text, <span>, <p>]\n const ancestors = listAncestor(point.node, func.eq(root));\n\n if (!ancestors.length) {\n return null;\n } else if (ancestors.length === 1) {\n return splitNode(point, options);\n }\n\n return ancestors.reduce(function(node, parent) {\n if (node === point.node) {\n node = splitNode(point, options);\n }\n\n return splitNode({\n node: parent,\n offset: node ? position(node) : nodeLength(parent),\n }, options);\n });\n}\n\n/**\n * split point\n *\n * @param {Point} point\n * @param {Boolean} isInline\n * @return {Object}\n */\nfunction splitPoint(point, isInline) {\n // find splitRoot, container\n // - inline: splitRoot is a child of paragraph\n // - block: splitRoot is a child of bodyContainer\n const pred = isInline ? isPara : isBodyContainer;\n const ancestors = listAncestor(point.node, pred);\n const topAncestor = lists.last(ancestors) || point.node;\n\n let splitRoot, container;\n if (pred(topAncestor)) {\n splitRoot = ancestors[ancestors.length - 2];\n container = topAncestor;\n } else {\n splitRoot = topAncestor;\n container = splitRoot.parentNode;\n }\n\n // if splitRoot is exists, split with splitTree\n let pivot = splitRoot && splitTree(splitRoot, point, {\n isSkipPaddingBlankHTML: isInline,\n isNotSplitEdgePoint: isInline,\n });\n\n // if container is point.node, find pivot with point.offset\n if (!pivot && container === point.node) {\n pivot = point.node.childNodes[point.offset];\n }\n\n return {\n rightNode: pivot,\n container: container,\n };\n}\n\nfunction create(nodeName) {\n return document.createElement(nodeName);\n}\n\nfunction createText(text) {\n return document.createTextNode(text);\n}\n\n/**\n * @method remove\n *\n * remove node, (isRemoveChild: remove child or not)\n *\n * @param {Node} node\n * @param {Boolean} isRemoveChild\n */\nfunction remove(node, isRemoveChild) {\n if (!node || !node.parentNode) { return; }\n if (node.removeNode) { return node.removeNode(isRemoveChild); }\n\n const parent = node.parentNode;\n if (!isRemoveChild) {\n const nodes = [];\n for (let i = 0, len = node.childNodes.length; i < len; i++) {\n nodes.push(node.childNodes[i]);\n }\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n parent.insertBefore(nodes[i], node);\n }\n }\n\n parent.removeChild(node);\n}\n\n/**\n * @method removeWhile\n *\n * @param {Node} node\n * @param {Function} pred\n */\nfunction removeWhile(node, pred) {\n while (node) {\n if (isEditable(node) || !pred(node)) {\n break;\n }\n\n const parent = node.parentNode;\n remove(node);\n node = parent;\n }\n}\n\n/**\n * @method replace\n *\n * replace node with provided nodeName\n *\n * @param {Node} node\n * @param {String} nodeName\n * @return {Node} - new node\n */\nfunction replace(node, nodeName) {\n if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n return node;\n }\n\n const newNode = create(nodeName);\n\n if (node.style.cssText) {\n newNode.style.cssText = node.style.cssText;\n }\n\n appendChildNodes(newNode, lists.from(node.childNodes));\n insertAfter(newNode, node);\n remove(node);\n\n return newNode;\n}\n\nconst isTextarea = makePredByNodeName('TEXTAREA');\n\n/**\n * @param {jQuery} $node\n * @param {Boolean} [stripLinebreaks] - default: false\n */\nfunction value($node, stripLinebreaks) {\n const val = isTextarea($node[0]) ? $node.val() : $node.html();\n if (stripLinebreaks) {\n return val.replace(/[\\n\\r]/g, '');\n }\n return val;\n}\n\n/**\n * @method html\n *\n * get the HTML contents of node\n *\n * @param {jQuery} $node\n * @param {Boolean} [isNewlineOnBlock]\n */\nfunction html($node, isNewlineOnBlock) {\n let markup = value($node);\n\n if (isNewlineOnBlock) {\n const regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n markup = markup.replace(regexTag, function(match, endSlash, name) {\n name = name.toUpperCase();\n const isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n !!endSlash;\n const isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n\n return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n });\n markup = markup.trim();\n }\n\n return markup;\n}\n\nfunction posFromPlaceholder(placeholder) {\n const $placeholder = $(placeholder);\n const pos = $placeholder.offset();\n const height = $placeholder.outerHeight(true); // include margin\n\n return {\n left: pos.left,\n top: pos.top + height,\n };\n}\n\nfunction attachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.on(key, events[key]);\n });\n}\n\nfunction detachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.off(key, events[key]);\n });\n}\n\n/**\n * @method isCustomStyleTag\n *\n * assert if a node contains a \"note-styletag\" class,\n * which implies that's a custom-made style tag node\n *\n * @param {Node} an HTML DOM node\n */\nfunction isCustomStyleTag(node) {\n return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n}\n\nexport default {\n /** @property {String} NBSP_CHAR */\n NBSP_CHAR,\n /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n ZERO_WIDTH_NBSP_CHAR,\n /** @property {String} blank */\n blank: blankHTML,\n /** @property {String} emptyPara */\n emptyPara: `<p>${blankHTML}</p>`,\n makePredByNodeName,\n isEditable,\n isControlSizing,\n isText,\n isElement,\n isVoid,\n isPara,\n isPurePara,\n isHeading,\n isInline,\n isBlock: func.not(isInline),\n isBodyInline,\n isBody,\n isParaInline,\n isPre,\n isList,\n isTable,\n isData,\n isCell,\n isBlockquote,\n isBodyContainer,\n isAnchor,\n isDiv: makePredByNodeName('DIV'),\n isLi,\n isBR: makePredByNodeName('BR'),\n isSpan: makePredByNodeName('SPAN'),\n isB: makePredByNodeName('B'),\n isU: makePredByNodeName('U'),\n isS: makePredByNodeName('S'),\n isI: makePredByNodeName('I'),\n isImg: makePredByNodeName('IMG'),\n isTextarea,\n deepestChildIsEmpty,\n isEmpty,\n isEmptyAnchor: func.and(isAnchor, isEmpty),\n isClosestSibling,\n withClosestSiblings,\n nodeLength,\n isLeftEdgePoint,\n isRightEdgePoint,\n isEdgePoint,\n isLeftEdgeOf,\n isRightEdgeOf,\n isLeftEdgePointOf,\n isRightEdgePointOf,\n prevPoint,\n nextPoint,\n isSamePoint,\n isVisiblePoint,\n prevPointUntil,\n nextPointUntil,\n isCharPoint,\n isSpacePoint,\n walkPoint,\n ancestor,\n singleChildAncestor,\n listAncestor,\n lastAncestor,\n listNext,\n listPrev,\n listDescendant,\n commonAncestor,\n wrap,\n insertAfter,\n appendChildNodes,\n position,\n hasChildren,\n makeOffsetPath,\n fromOffsetPath,\n splitTree,\n splitPoint,\n create,\n createText,\n remove,\n removeWhile,\n replace,\n html,\n value,\n posFromPlaceholder,\n attachEvents,\n detachEvents,\n isCustomStyleTag,\n};\n","import $ from 'jquery';\nimport func from './core/func';\nimport lists from './core/lists';\nimport dom from './core/dom';\n\nexport default class Context {\n /**\n * @param {jQuery} $note\n * @param {Object} options\n */\n constructor($note, options) {\n this.$note = $note;\n\n this.memos = {};\n this.modules = {};\n this.layoutInfo = {};\n this.options = $.extend(true, {}, options);\n\n // init ui with options\n $.summernote.ui = $.summernote.ui_template(this.options);\n this.ui = $.summernote.ui;\n\n this.initialize();\n }\n\n /**\n * create layout and initialize modules and other resources\n */\n initialize() {\n this.layoutInfo = this.ui.createLayout(this.$note);\n this._initialize();\n this.$note.hide();\n return this;\n }\n\n /**\n * destroy modules and other resources and remove layout\n */\n destroy() {\n this._destroy();\n this.$note.removeData('summernote');\n this.ui.removeLayout(this.$note, this.layoutInfo);\n }\n\n /**\n * destory modules and other resources and initialize it again\n */\n reset() {\n const disabled = this.isDisabled();\n this.code(dom.emptyPara);\n this._destroy();\n this._initialize();\n\n if (disabled) {\n this.disable();\n }\n }\n\n _initialize() {\n // set own id\n this.options.id = func.uniqueId($.now());\n // set default container for tooltips, popovers, and dialogs\n this.options.container = this.options.container || this.layoutInfo.editor;\n\n // add optional buttons\n const buttons = $.extend({}, this.options.buttons);\n Object.keys(buttons).forEach((key) => {\n this.memo('button.' + key, buttons[key]);\n });\n\n const modules = $.extend({}, this.options.modules, $.summernote.plugins || {});\n\n // add and initialize modules\n Object.keys(modules).forEach((key) => {\n this.module(key, modules[key], true);\n });\n\n Object.keys(this.modules).forEach((key) => {\n this.initializeModule(key);\n });\n }\n\n _destroy() {\n // destroy modules with reversed order\n Object.keys(this.modules).reverse().forEach((key) => {\n this.removeModule(key);\n });\n\n Object.keys(this.memos).forEach((key) => {\n this.removeMemo(key);\n });\n // trigger custom onDestroy callback\n this.triggerEvent('destroy', this);\n }\n\n code(html) {\n const isActivated = this.invoke('codeview.isActivated');\n\n if (html === undefined) {\n this.invoke('codeview.sync');\n return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n } else {\n if (isActivated) {\n this.layoutInfo.codable.val(html);\n } else {\n this.layoutInfo.editable.html(html);\n }\n this.$note.val(html);\n this.triggerEvent('change', html, this.layoutInfo.editable);\n }\n }\n\n isDisabled() {\n return this.layoutInfo.editable.attr('contenteditable') === 'false';\n }\n\n enable() {\n this.layoutInfo.editable.attr('contenteditable', true);\n this.invoke('toolbar.activate', true);\n this.triggerEvent('disable', false);\n this.options.editing = true;\n }\n\n disable() {\n // close codeview if codeview is opend\n if (this.invoke('codeview.isActivated')) {\n this.invoke('codeview.deactivate');\n }\n this.layoutInfo.editable.attr('contenteditable', false);\n this.options.editing = false;\n this.invoke('toolbar.deactivate', true);\n\n this.triggerEvent('disable', true);\n }\n\n triggerEvent() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n if (callback) {\n callback.apply(this.$note[0], args);\n }\n this.$note.trigger('summernote.' + namespace, args);\n }\n\n initializeModule(key) {\n const module = this.modules[key];\n module.shouldInitialize = module.shouldInitialize || func.ok;\n if (!module.shouldInitialize()) {\n return;\n }\n\n // initialize module\n if (module.initialize) {\n module.initialize();\n }\n\n // attach events\n if (module.events) {\n dom.attachEvents(this.$note, module.events);\n }\n }\n\n module(key, ModuleClass, withoutIntialize) {\n if (arguments.length === 1) {\n return this.modules[key];\n }\n\n this.modules[key] = new ModuleClass(this);\n\n if (!withoutIntialize) {\n this.initializeModule(key);\n }\n }\n\n removeModule(key) {\n const module = this.modules[key];\n if (module.shouldInitialize()) {\n if (module.events) {\n dom.detachEvents(this.$note, module.events);\n }\n\n if (module.destroy) {\n module.destroy();\n }\n }\n\n delete this.modules[key];\n }\n\n memo(key, obj) {\n if (arguments.length === 1) {\n return this.memos[key];\n }\n this.memos[key] = obj;\n }\n\n removeMemo(key) {\n if (this.memos[key] && this.memos[key].destroy) {\n this.memos[key].destroy();\n }\n\n delete this.memos[key];\n }\n\n /**\n * Some buttons need to change their visual style immediately once they get pressed\n */\n createInvokeHandlerAndUpdateState(namespace, value) {\n return (event) => {\n this.createInvokeHandler(namespace, value)(event);\n this.invoke('buttons.updateCurrentStyle');\n };\n }\n\n createInvokeHandler(namespace, value) {\n return (event) => {\n event.preventDefault();\n const $target = $(event.target);\n this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n };\n }\n\n invoke() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const splits = namespace.split('.');\n const hasSeparator = splits.length > 1;\n const moduleName = hasSeparator && lists.head(splits);\n const methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n\n const module = this.modules[moduleName || 'editor'];\n if (!moduleName && this[methodName]) {\n return this[methodName].apply(this, args);\n } else if (module && module[methodName] && module.shouldInitialize()) {\n return module[methodName].apply(module, args);\n }\n }\n}\n","import $ from 'jquery';\nimport env from './env';\nimport func from './func';\nimport lists from './lists';\nimport dom from './dom';\n\n/**\n * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n *\n * @param {TextRange} textRange\n * @param {Boolean} isStart\n * @return {BoundaryPoint}\n *\n * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n */\nfunction textRangeToPoint(textRange, isStart) {\n let container = textRange.parentElement();\n let offset;\n\n const tester = document.body.createTextRange();\n let prevContainer;\n const childNodes = lists.from(container.childNodes);\n for (offset = 0; offset < childNodes.length; offset++) {\n if (dom.isText(childNodes[offset])) {\n continue;\n }\n tester.moveToElementText(childNodes[offset]);\n if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n break;\n }\n prevContainer = childNodes[offset];\n }\n\n if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n const textRangeStart = document.body.createTextRange();\n let curTextNode = null;\n textRangeStart.moveToElementText(prevContainer || container);\n textRangeStart.collapse(!prevContainer);\n curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n\n const pointTester = textRange.duplicate();\n pointTester.setEndPoint('StartToStart', textRangeStart);\n let textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n\n while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n // [workaround] enforce IE to re-reference curTextNode, hack\n const dummy = curTextNode.nodeValue; // eslint-disable-line\n\n if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n textCount === curTextNode.nodeValue.length) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n container = curTextNode;\n offset = textCount;\n }\n\n return {\n cont: container,\n offset: offset,\n };\n}\n\n/**\n * return TextRange from boundary point (inspired by google closure-library)\n * @param {BoundaryPoint} point\n * @return {TextRange}\n */\nfunction pointToTextRange(point) {\n const textRangeInfo = function(container, offset) {\n let node, isCollapseToStart;\n\n if (dom.isText(container)) {\n const prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n const prevContainer = lists.last(prevTextNodes).previousSibling;\n node = prevContainer || container.parentNode;\n offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n isCollapseToStart = !prevContainer;\n } else {\n node = container.childNodes[offset] || container;\n if (dom.isText(node)) {\n return textRangeInfo(node, 0);\n }\n\n offset = 0;\n isCollapseToStart = false;\n }\n\n return {\n node: node,\n collapseToStart: isCollapseToStart,\n offset: offset,\n };\n };\n\n const textRange = document.body.createTextRange();\n const info = textRangeInfo(point.node, point.offset);\n\n textRange.moveToElementText(info.node);\n textRange.collapse(info.collapseToStart);\n textRange.moveStart('character', info.offset);\n return textRange;\n}\n\n/**\n * Wrapped Range\n *\n * @constructor\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n */\nclass WrappedRange {\n constructor(sc, so, ec, eo) {\n this.sc = sc;\n this.so = so;\n this.ec = ec;\n this.eo = eo;\n\n // isOnEditable: judge whether range is on editable or not\n this.isOnEditable = this.makeIsOn(dom.isEditable);\n // isOnList: judge whether range is on list node or not\n this.isOnList = this.makeIsOn(dom.isList);\n // isOnAnchor: judge whether range is on anchor node or not\n this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n // isOnCell: judge whether range is on cell node or not\n this.isOnCell = this.makeIsOn(dom.isCell);\n // isOnData: judge whether range is on data node or not\n this.isOnData = this.makeIsOn(dom.isData);\n }\n\n // nativeRange: get nativeRange from sc, so, ec, eo\n nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }\n\n getPoints() {\n return {\n sc: this.sc,\n so: this.so,\n ec: this.ec,\n eo: this.eo,\n };\n }\n\n getStartPoint() {\n return {\n node: this.sc,\n offset: this.so,\n };\n }\n\n getEndPoint() {\n return {\n node: this.ec,\n offset: this.eo,\n };\n }\n\n /**\n * select update visible range\n */\n select() {\n const nativeRng = this.nativeRange();\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (selection.rangeCount > 0) {\n selection.removeAllRanges();\n }\n selection.addRange(nativeRng);\n } else {\n nativeRng.select();\n }\n\n return this;\n }\n\n /**\n * Moves the scrollbar to start container(sc) of current range\n *\n * @return {WrappedRange}\n */\n scrollIntoView(container) {\n const height = $(container).height();\n if (container.scrollTop + height < this.sc.offsetTop) {\n container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n }\n\n return this;\n }\n\n /**\n * @return {WrappedRange}\n */\n normalize() {\n /**\n * @param {BoundaryPoint} point\n * @param {Boolean} isLeftToRight - true: prefer to choose right node\n * - false: prefer to choose left node\n * @return {BoundaryPoint}\n */\n const getVisiblePoint = function(point, isLeftToRight) {\n if (!point) {\n return point;\n }\n\n // Just use the given point [XXX:Adhoc]\n // - case 01. if the point is on the middle of the node\n // - case 02. if the point is on the right edge and prefer to choose left node\n // - case 03. if the point is on the left edge and prefer to choose right node\n // - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n // - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n // - case 06. if the point is on the block node and there is no children\n if (dom.isVisiblePoint(point)) {\n if (!dom.isEdgePoint(point) ||\n (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n return point;\n }\n }\n\n // point on block's edge\n const block = dom.ancestor(point.node, dom.isBlock);\n let hasRightNode = false;\n\n if (!hasRightNode) {\n const prevPoint = dom.prevPoint(point) || { node: null };\n hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;\n }\n\n let hasLeftNode = false;\n if (!hasLeftNode) {\n const nextPoint = dom.nextPoint(point) || { node: null };\n hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(nextPoint.node)) && isLeftToRight;\n }\n\n if (hasRightNode || hasLeftNode) {\n // returns point already on visible point\n if (dom.isVisiblePoint(point)) {\n return point;\n }\n // reverse direction\n isLeftToRight = !isLeftToRight;\n }\n\n const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n return nextPoint || point;\n };\n\n const endPoint = getVisiblePoint(this.getEndPoint(), false);\n const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns matched nodes on range\n *\n * @param {Function} [pred] - predicate function\n * @param {Object} [options]\n * @param {Boolean} [options.includeAncestor]\n * @param {Boolean} [options.fullyContains]\n * @return {Node[]}\n */\n nodes(pred, options) {\n pred = pred || func.ok;\n\n const includeAncestor = options && options.includeAncestor;\n const fullyContains = options && options.fullyContains;\n\n // TODO compare points and sort\n const startPoint = this.getStartPoint();\n const endPoint = this.getEndPoint();\n\n const nodes = [];\n const leftEdgeNodes = [];\n\n dom.walkPoint(startPoint, endPoint, function(point) {\n if (dom.isEditable(point.node)) {\n return;\n }\n\n let node;\n if (fullyContains) {\n if (dom.isLeftEdgePoint(point)) {\n leftEdgeNodes.push(point.node);\n }\n if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n node = point.node;\n }\n } else if (includeAncestor) {\n node = dom.ancestor(point.node, pred);\n } else {\n node = point.node;\n }\n\n if (node && pred(node)) {\n nodes.push(node);\n }\n }, true);\n\n return lists.unique(nodes);\n }\n\n /**\n * returns commonAncestor of range\n * @return {Element} - commonAncestor\n */\n commonAncestor() {\n return dom.commonAncestor(this.sc, this.ec);\n }\n\n /**\n * returns expanded range by pred\n *\n * @param {Function} pred - predicate function\n * @return {WrappedRange}\n */\n expand(pred) {\n const startAncestor = dom.ancestor(this.sc, pred);\n const endAncestor = dom.ancestor(this.ec, pred);\n\n if (!startAncestor && !endAncestor) {\n return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n }\n\n const boundaryPoints = this.getPoints();\n\n if (startAncestor) {\n boundaryPoints.sc = startAncestor;\n boundaryPoints.so = 0;\n }\n\n if (endAncestor) {\n boundaryPoints.ec = endAncestor;\n boundaryPoints.eo = dom.nodeLength(endAncestor);\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * @param {Boolean} isCollapseToStart\n * @return {WrappedRange}\n */\n collapse(isCollapseToStart) {\n if (isCollapseToStart) {\n return new WrappedRange(this.sc, this.so, this.sc, this.so);\n } else {\n return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n }\n }\n\n /**\n * splitText on range\n */\n splitText() {\n const isSameContainer = this.sc === this.ec;\n const boundaryPoints = this.getPoints();\n\n if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n this.ec.splitText(this.eo);\n }\n\n if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n boundaryPoints.sc = this.sc.splitText(this.so);\n boundaryPoints.so = 0;\n\n if (isSameContainer) {\n boundaryPoints.ec = boundaryPoints.sc;\n boundaryPoints.eo = this.eo - this.so;\n }\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * delete contents on range\n * @return {WrappedRange}\n */\n deleteContents() {\n if (this.isCollapsed()) {\n return this;\n }\n\n const rng = this.splitText();\n const nodes = rng.nodes(null, {\n fullyContains: true,\n });\n\n // find new cursor point\n const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {\n return !lists.contains(nodes, point.node);\n });\n\n const emptyParents = [];\n $.each(nodes, function(idx, node) {\n // find empty parents\n const parent = node.parentNode;\n if (point.node !== parent && dom.nodeLength(parent) === 1) {\n emptyParents.push(parent);\n }\n dom.remove(node, false);\n });\n\n // remove empty parents\n $.each(emptyParents, function(idx, node) {\n dom.remove(node, false);\n });\n\n return new WrappedRange(\n point.node,\n point.offset,\n point.node,\n point.offset\n ).normalize();\n }\n\n /**\n * makeIsOn: return isOn(pred) function\n */\n makeIsOn(pred) {\n return function() {\n const ancestor = dom.ancestor(this.sc, pred);\n return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n };\n }\n\n /**\n * @param {Function} pred\n * @return {Boolean}\n */\n isLeftEdgeOf(pred) {\n if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n return false;\n }\n\n const node = dom.ancestor(this.sc, pred);\n return node && dom.isLeftEdgeOf(this.sc, node);\n }\n\n /**\n * returns whether range was collapsed or not\n */\n isCollapsed() {\n return this.sc === this.ec && this.so === this.eo;\n }\n\n /**\n * wrap inline nodes which children of body with paragraph\n *\n * @return {WrappedRange}\n */\n wrapBodyInlineWithPara() {\n if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n this.sc.innerHTML = dom.emptyPara;\n return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n }\n\n /**\n * [workaround] firefox often create range on not visible point. so normalize here.\n * - firefox: |<p>text</p>|\n * - chrome: <p>|text|</p>\n */\n const rng = this.normalize();\n if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n return rng;\n }\n\n // find inline top ancestor\n let topAncestor;\n if (dom.isInline(rng.sc)) {\n const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n topAncestor = lists.last(ancestors);\n if (!dom.isInline(topAncestor)) {\n topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n }\n } else {\n topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n }\n\n if (topAncestor) {\n // siblings not in paragraph\n let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n\n // wrap with paragraph\n if (inlineSiblings.length) {\n const para = dom.wrap(lists.head(inlineSiblings), 'p');\n dom.appendChildNodes(para, lists.tail(inlineSiblings));\n }\n }\n\n return this.normalize();\n }\n\n /**\n * insert node at current cursor\n *\n * @param {Node} node\n * @return {Node}\n */\n insertNode(node) {\n let rng = this;\n\n if (dom.isText(node) || dom.isInline(node)) {\n rng = this.wrapBodyInlineWithPara().deleteContents();\n }\n\n const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n if (info.rightNode) {\n info.rightNode.parentNode.insertBefore(node, info.rightNode);\n } else {\n info.container.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * insert html at current cursor\n */\n pasteHTML(markup) {\n markup = $.trim(markup);\n\n const contentsContainer = $('<div></div>').html(markup)[0];\n let childNodes = lists.from(contentsContainer.childNodes);\n\n // const rng = this.wrapBodyInlineWithPara().deleteContents();\n const rng = this;\n\n if (rng.so >= 0) {\n childNodes = childNodes.reverse();\n }\n childNodes = childNodes.map(function(childNode) {\n return rng.insertNode(childNode);\n });\n if (rng.so > 0) {\n childNodes = childNodes.reverse();\n }\n return childNodes;\n }\n\n /**\n * returns text in range\n *\n * @return {String}\n */\n toString() {\n const nativeRng = this.nativeRange();\n return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n }\n\n /**\n * returns range for word before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordRange(findAfter) {\n let endPoint = this.getEndPoint();\n\n if (!dom.isCharPoint(endPoint)) {\n return this;\n }\n\n const startPoint = dom.prevPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordsRange(findAfter) {\n var endPoint = this.getEndPoint();\n\n var isNotTextPoint = function(point) {\n return !dom.isCharPoint(point) && !dom.isSpacePoint(point);\n };\n\n if (isNotTextPoint(endPoint)) {\n return this;\n }\n\n var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor that match with a Regex\n *\n * example:\n * range: 'hi @Peter Pan'\n * regex: '/@[a-z ]+/i'\n * return range: '@Peter Pan'\n *\n * @param {RegExp} [regex]\n * @return {WrappedRange|null}\n */\n getWordsMatchRange(regex) {\n var endPoint = this.getEndPoint();\n\n var startPoint = dom.prevPointUntil(endPoint, function(point) {\n if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {\n return true;\n }\n var rng = new WrappedRange(\n point.node,\n point.offset,\n endPoint.node,\n endPoint.offset\n );\n var result = regex.exec(rng.toString());\n return result && result.index === 0;\n });\n\n var rng = new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n\n var text = rng.toString();\n var result = regex.exec(text);\n\n if (result && result[0].length === text.length) {\n return rng;\n } else {\n return null;\n }\n }\n\n /**\n * create offsetPath bookmark\n *\n * @param {Node} editable\n */\n bookmark(editable) {\n return {\n s: {\n path: dom.makeOffsetPath(editable, this.sc),\n offset: this.so,\n },\n e: {\n path: dom.makeOffsetPath(editable, this.ec),\n offset: this.eo,\n },\n };\n }\n\n /**\n * create offsetPath bookmark base on paragraph\n *\n * @param {Node[]} paras\n */\n paraBookmark(paras) {\n return {\n s: {\n path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n offset: this.so,\n },\n e: {\n path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n offset: this.eo,\n },\n };\n }\n\n /**\n * getClientRects\n * @return {Rect[]}\n */\n getClientRects() {\n const nativeRng = this.nativeRange();\n return nativeRng.getClientRects();\n }\n}\n\n/**\n * Data structure\n * * BoundaryPoint: a point of dom tree\n * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n *\n * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n */\nexport default {\n /**\n * create Range Object From arguments or Browser Selection\n *\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n * @return {WrappedRange}\n */\n create: function(sc, so, ec, eo) {\n if (arguments.length === 4) {\n return new WrappedRange(sc, so, ec, eo);\n } else if (arguments.length === 2) { // collapsed\n ec = sc;\n eo = so;\n return new WrappedRange(sc, so, ec, eo);\n } else {\n let wrappedRange = this.createFromSelection();\n\n if (!wrappedRange && arguments.length === 1) {\n let bodyElement = arguments[0];\n if (dom.isEditable(bodyElement)) {\n bodyElement = bodyElement.lastChild;\n }\n return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);\n }\n return wrappedRange;\n }\n },\n\n createFromBodyElement: function(bodyElement, isCollapseToStart = false) {\n var wrappedRange = this.createFromNode(bodyElement);\n return wrappedRange.collapse(isCollapseToStart);\n },\n\n createFromSelection: function() {\n let sc, so, ec, eo;\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n } else if (dom.isBody(selection.anchorNode)) {\n // Firefox: returns entire body as range on initialization.\n // We won't never need it.\n return null;\n }\n\n const nativeRng = selection.getRangeAt(0);\n sc = nativeRng.startContainer;\n so = nativeRng.startOffset;\n ec = nativeRng.endContainer;\n eo = nativeRng.endOffset;\n } else { // IE8: TextRange\n const textRange = document.selection.createRange();\n const textRangeEnd = textRange.duplicate();\n textRangeEnd.collapse(false);\n const textRangeStart = textRange;\n textRangeStart.collapse(true);\n\n let startPoint = textRangeToPoint(textRangeStart, true);\n let endPoint = textRangeToPoint(textRangeEnd, false);\n\n // same visible point case: range was collapsed.\n if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n endPoint.node.nextSibling === startPoint.node) {\n startPoint = endPoint;\n }\n\n sc = startPoint.cont;\n so = startPoint.offset;\n ec = endPoint.cont;\n eo = endPoint.offset;\n }\n\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from node\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNode: function(node) {\n let sc = node;\n let so = 0;\n let ec = node;\n let eo = dom.nodeLength(ec);\n\n // browsers can't target a picture or void node\n if (dom.isVoid(sc)) {\n so = dom.listPrev(sc).length - 1;\n sc = sc.parentNode;\n }\n if (dom.isBR(ec)) {\n eo = dom.listPrev(ec).length - 1;\n ec = ec.parentNode;\n } else if (dom.isVoid(ec)) {\n eo = dom.listPrev(ec).length;\n ec = ec.parentNode;\n }\n\n return this.create(sc, so, ec, eo);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeBefore: function(node) {\n return this.createFromNode(node).collapse(true);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeAfter: function(node) {\n return this.createFromNode(node).collapse();\n },\n\n /**\n * @method\n *\n * create WrappedRange from bookmark\n *\n * @param {Node} editable\n * @param {Object} bookmark\n * @return {WrappedRange}\n */\n createFromBookmark: function(editable, bookmark) {\n const sc = dom.fromOffsetPath(editable, bookmark.s.path);\n const so = bookmark.s.offset;\n const ec = dom.fromOffsetPath(editable, bookmark.e.path);\n const eo = bookmark.e.offset;\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from paraBookmark\n *\n * @param {Object} bookmark\n * @param {Node[]} paras\n * @return {WrappedRange}\n */\n createFromParaBookmark: function(bookmark, paras) {\n const so = bookmark.s.offset;\n const eo = bookmark.e.offset;\n const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n\n return new WrappedRange(sc, so, ec, eo);\n },\n};\n","import $ from 'jquery';\nimport env from './base/core/env';\nimport lists from './base/core/lists';\nimport Context from './base/Context';\n\n$.fn.extend({\n /**\n * Summernote API\n *\n * @param {Object|String}\n * @return {this}\n */\n summernote: function() {\n const type = $.type(lists.head(arguments));\n const isExternalAPICalled = type === 'string';\n const hasInitOptions = type === 'object';\n\n const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n\n // Update options\n options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);\n options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons);\n options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n\n this.each((idx, note) => {\n const $note = $(note);\n if (!$note.data('summernote')) {\n const context = new Context($note, options);\n $note.data('summernote', context);\n $note.data('summernote').triggerEvent('init', context.layoutInfo);\n }\n });\n\n const $note = this.first();\n if ($note.length) {\n const context = $note.data('summernote');\n if (isExternalAPICalled) {\n return context.invoke.apply(context, lists.from(arguments));\n } else if (options.focus) {\n context.invoke('editor.focus');\n }\n }\n\n return this;\n },\n});\n","import lists from './lists';\nimport func from './func';\n\nconst KEY_MAP = {\n 'BACKSPACE': 8,\n 'TAB': 9,\n 'ENTER': 13,\n 'SPACE': 32,\n 'DELETE': 46,\n\n // Arrow\n 'LEFT': 37,\n 'UP': 38,\n 'RIGHT': 39,\n 'DOWN': 40,\n\n // Number: 0-9\n 'NUM0': 48,\n 'NUM1': 49,\n 'NUM2': 50,\n 'NUM3': 51,\n 'NUM4': 52,\n 'NUM5': 53,\n 'NUM6': 54,\n 'NUM7': 55,\n 'NUM8': 56,\n\n // Alphabet: a-z\n 'B': 66,\n 'E': 69,\n 'I': 73,\n 'J': 74,\n 'K': 75,\n 'L': 76,\n 'R': 82,\n 'S': 83,\n 'U': 85,\n 'V': 86,\n 'Y': 89,\n 'Z': 90,\n\n 'SLASH': 191,\n 'LEFTBRACKET': 219,\n 'BACKSLASH': 220,\n 'RIGHTBRACKET': 221,\n\n // Navigation\n 'HOME': 36,\n 'END': 35,\n 'PAGEUP': 33,\n 'PAGEDOWN': 34,\n};\n\n/**\n * @class core.key\n *\n * Object for keycodes.\n *\n * @singleton\n * @alternateClassName key\n */\nexport default {\n /**\n * @method isEdit\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isEdit: (keyCode) => {\n return lists.contains([\n KEY_MAP.BACKSPACE,\n KEY_MAP.TAB,\n KEY_MAP.ENTER,\n KEY_MAP.SPACE,\n KEY_MAP.DELETE,\n ], keyCode);\n },\n /**\n * @method isMove\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isMove: (keyCode) => {\n return lists.contains([\n KEY_MAP.LEFT,\n KEY_MAP.UP,\n KEY_MAP.RIGHT,\n KEY_MAP.DOWN,\n ], keyCode);\n },\n /**\n * @method isNavigation\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isNavigation: (keyCode) => {\n return lists.contains([\n KEY_MAP.HOME,\n KEY_MAP.END,\n KEY_MAP.PAGEUP,\n KEY_MAP.PAGEDOWN,\n ], keyCode);\n },\n /**\n * @property {Object} nameFromCode\n * @property {String} nameFromCode.8 \"BACKSPACE\"\n */\n nameFromCode: func.invertObject(KEY_MAP),\n code: KEY_MAP,\n};\n","import range from '../core/range';\n\nexport default class History {\n constructor(context) {\n this.stack = [];\n this.stackOffset = -1;\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n this.editable = this.$editable[0];\n }\n\n makeSnapshot() {\n const rng = range.create(this.editable);\n const emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n\n return {\n contents: this.$editable.html(),\n bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark),\n };\n }\n\n applySnapshot(snapshot) {\n if (snapshot.contents !== null) {\n this.$editable.html(snapshot.contents);\n }\n if (snapshot.bookmark !== null) {\n range.createFromBookmark(this.editable, snapshot.bookmark).select();\n }\n }\n\n /**\n * @method rewind\n * Rewinds the history stack back to the first snapshot taken.\n * Leaves the stack intact, so that \"Redo\" can still be used.\n */\n rewind() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n // Return to the first available snapshot.\n this.stackOffset = 0;\n\n // Apply that snapshot.\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n\n /**\n * @method commit\n * Resets history stack, but keeps current editor's content.\n */\n commit() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * @method reset\n * Resets the history stack completely; reverting to an empty editor.\n */\n reset() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Clear the editable area.\n this.$editable.html('');\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * undo\n */\n undo() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n if (this.stackOffset > 0) {\n this.stackOffset--;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * redo\n */\n redo() {\n if (this.stack.length - 1 > this.stackOffset) {\n this.stackOffset++;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * recorded undo\n */\n recordUndo() {\n this.stackOffset++;\n\n // Wash out stack after stackOffset\n if (this.stack.length > this.stackOffset) {\n this.stack = this.stack.slice(0, this.stackOffset);\n }\n\n // Create new snapshot and push it to the end\n this.stack.push(this.makeSnapshot());\n\n // If the stack size reachs to the limit, then slice it\n if (this.stack.length > this.context.options.historyLimit) {\n this.stack.shift();\n this.stackOffset -= 1;\n }\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class Style {\n /**\n * @method jQueryCSS\n *\n * [workaround] for old jQuery\n * passing an array of style properties to .css()\n * will result in an object of property-value pairs.\n * (compability with version < 1.9)\n *\n * @private\n * @param {jQuery} $obj\n * @param {Array} propertyNames - An array of one or more CSS properties.\n * @return {Object}\n */\n jQueryCSS($obj, propertyNames) {\n if (env.jqueryVersion < 1.9) {\n const result = {};\n $.each(propertyNames, (idx, propertyName) => {\n result[propertyName] = $obj.css(propertyName);\n });\n return result;\n }\n return $obj.css(propertyNames);\n }\n\n /**\n * returns style object from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n fromNode($node) {\n const properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n const styleInfo = this.jQueryCSS($node, properties) || {};\n\n const fontSize = $node[0].style.fontSize || styleInfo['font-size'];\n\n styleInfo['font-size'] = parseInt(fontSize, 10);\n styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);\n\n return styleInfo;\n }\n\n /**\n * paragraph level style\n *\n * @param {WrappedRange} rng\n * @param {Object} styleInfo\n */\n stylePara(rng, styleInfo) {\n $.each(rng.nodes(dom.isPara, {\n includeAncestor: true,\n }), (idx, para) => {\n $(para).css(styleInfo);\n });\n }\n\n /**\n * insert and returns styleNodes on range.\n *\n * @param {WrappedRange} rng\n * @param {Object} [options] - options for styleNodes\n * @param {String} [options.nodeName] - default: `SPAN`\n * @param {Boolean} [options.expandClosestSibling] - default: `false`\n * @param {Boolean} [options.onlyPartialContains] - default: `false`\n * @return {Node[]}\n */\n styleNodes(rng, options) {\n rng = rng.splitText();\n\n const nodeName = (options && options.nodeName) || 'SPAN';\n const expandClosestSibling = !!(options && options.expandClosestSibling);\n const onlyPartialContains = !!(options && options.onlyPartialContains);\n\n if (rng.isCollapsed()) {\n return [rng.insertNode(dom.create(nodeName))];\n }\n\n let pred = dom.makePredByNodeName(nodeName);\n const nodes = rng.nodes(dom.isText, {\n fullyContains: true,\n }).map((text) => {\n return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n });\n\n if (expandClosestSibling) {\n if (onlyPartialContains) {\n const nodesInRange = rng.nodes();\n // compose with partial contains predication\n pred = func.and(pred, (node) => {\n return lists.contains(nodesInRange, node);\n });\n }\n\n return nodes.map((node) => {\n const siblings = dom.withClosestSiblings(node, pred);\n const head = lists.head(siblings);\n const tails = lists.tail(siblings);\n $.each(tails, (idx, elem) => {\n dom.appendChildNodes(head, elem.childNodes);\n dom.remove(elem);\n });\n return lists.head(siblings);\n });\n } else {\n return nodes;\n }\n }\n\n /**\n * get current style on cursor\n *\n * @param {WrappedRange} rng\n * @return {Object} - object contains style properties.\n */\n current(rng) {\n const $cont = $(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n let styleInfo = this.fromNode($cont);\n\n // document.queryCommandState for toggle state\n // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n try {\n styleInfo = $.extend(styleInfo, {\n 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'],\n });\n } catch (e) {\n // eslint-disable-next-line\n }\n\n // list-style-type to list-style(unordered, ordered)\n if (!rng.isOnList()) {\n styleInfo['list-style'] = 'none';\n } else {\n const orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n const isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n }\n\n const para = dom.ancestor(rng.sc, dom.isPara);\n if (para && para.style['line-height']) {\n styleInfo['line-height'] = para.style.lineHeight;\n } else {\n const lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n styleInfo['line-height'] = lineHeight.toFixed(1);\n }\n\n styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n styleInfo.range = rng;\n\n return styleInfo;\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport func from '../core/func';\nimport dom from '../core/dom';\nimport range from '../core/range';\n\nexport default class Bullet {\n /**\n * toggle ordered list\n */\n insertOrderedList(editable) {\n this.toggleList('OL', editable);\n }\n\n /**\n * toggle unordered list\n */\n insertUnorderedList(editable) {\n this.toggleList('UL', editable);\n }\n\n /**\n * indent\n */\n indent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n const previousList = this.findList(head.previousSibling);\n if (previousList) {\n paras\n .map(para => previousList.appendChild(para));\n } else {\n this.wrapList(paras, head.parentNode.nodeName);\n paras\n .map((para) => para.parentNode)\n .map((para) => this.appendToPrevious(para));\n }\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n return (parseInt(val, 10) || 0) + 25;\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * outdent\n */\n outdent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n this.releaseList([paras]);\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n val = (parseInt(val, 10) || 0);\n return val > 25 ? val - 25 : '';\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * toggle list\n *\n * @param {String} listName - OL or UL\n */\n toggleList(listName, editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n let paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const bookmark = rng.paraBookmark(paras);\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n // paragraph to list\n if (lists.find(paras, dom.isPurePara)) {\n let wrappedParas = [];\n $.each(clustereds, (idx, paras) => {\n wrappedParas = wrappedParas.concat(this.wrapList(paras, listName));\n });\n paras = wrappedParas;\n // list to paragraph or change list style\n } else {\n const diffLists = rng.nodes(dom.isList, {\n includeAncestor: true,\n }).filter((listNode) => {\n return !$.nodeName(listNode, listName);\n });\n\n if (diffLists.length) {\n $.each(diffLists, (idx, listNode) => {\n dom.replace(listNode, listName);\n });\n } else {\n paras = this.releaseList(clustereds, true);\n }\n }\n\n range.createFromParaBookmark(bookmark, paras).select();\n }\n\n /**\n * @param {Node[]} paras\n * @param {String} listName\n * @return {Node[]}\n */\n wrapList(paras, listName) {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const prevList = dom.isList(head.previousSibling) && head.previousSibling;\n const nextList = dom.isList(last.nextSibling) && last.nextSibling;\n\n const listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n\n // P to LI\n paras = paras.map((para) => {\n return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n });\n\n // append to list(<ul>, <ol>)\n dom.appendChildNodes(listNode, paras);\n\n if (nextList) {\n dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n dom.remove(nextList);\n }\n\n return paras;\n }\n\n /**\n * @method releaseList\n *\n * @param {Array[]} clustereds\n * @param {Boolean} isEscapseToBody\n * @return {Node[]}\n */\n releaseList(clustereds, isEscapseToBody) {\n let releasedParas = [];\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n const parentItem = headList.parentNode;\n\n if (headList.parentNode.nodeName === 'LI') {\n paras.map(para => {\n const newList = this.findNextSiblings(para);\n\n if (parentItem.nextSibling) {\n parentItem.parentNode.insertBefore(\n para,\n parentItem.nextSibling\n );\n } else {\n parentItem.parentNode.appendChild(para);\n }\n\n if (newList.length) {\n this.wrapList(newList, headList.nodeName);\n para.appendChild(newList[0].parentNode);\n }\n });\n\n if (headList.children.length === 0) {\n parentItem.removeChild(headList);\n }\n\n if (parentItem.childNodes.length === 0) {\n parentItem.parentNode.removeChild(parentItem);\n }\n } else {\n const lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n node: last.parentNode,\n offset: dom.position(last) + 1,\n }, {\n isSkipPaddingBlankHTML: true,\n }) : null;\n\n const middleList = dom.splitTree(headList, {\n node: head.parentNode,\n offset: dom.position(head),\n }, {\n isSkipPaddingBlankHTML: true,\n });\n\n paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n : lists.from(middleList.childNodes).filter(dom.isLi);\n\n // LI to P\n if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n paras = paras.map((para) => {\n return dom.replace(para, 'P');\n });\n }\n\n $.each(lists.from(paras).reverse(), (idx, para) => {\n dom.insertAfter(para, headList);\n });\n\n // remove empty lists\n const rootLists = lists.compact([headList, middleList, lastList]);\n $.each(rootLists, (idx, rootList) => {\n const listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n $.each(listNodes.reverse(), (idx, listNode) => {\n if (!dom.nodeLength(listNode)) {\n dom.remove(listNode, true);\n }\n });\n });\n }\n\n releasedParas = releasedParas.concat(paras);\n });\n\n return releasedParas;\n }\n\n /**\n * @method appendToPrevious\n *\n * Appends list to previous list item, if\n * none exist it wraps the list in a new list item.\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n appendToPrevious(node) {\n return node.previousSibling\n ? dom.appendChildNodes(node.previousSibling, [node])\n : this.wrapList([node], 'LI');\n }\n\n /**\n * @method findList\n *\n * Finds an existing list in list item\n *\n * @param {HTMLNode} ListItem\n * @return {Array[]}\n */\n findList(node) {\n return node\n ? lists.find(node.children, child => ['OL', 'UL'].indexOf(child.nodeName) > -1)\n : null;\n }\n\n /**\n * @method findNextSiblings\n *\n * Finds all list item siblings that follow it\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n findNextSiblings(node) {\n const siblings = [];\n while (node.nextSibling) {\n siblings.push(node.nextSibling);\n node = node.nextSibling;\n }\n return siblings;\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport Bullet from '../editing/Bullet';\n\n/**\n * @class editing.Typing\n *\n * Typing\n *\n */\nexport default class Typing {\n constructor(context) {\n // a Bullet instance to toggle lists off\n this.bullet = new Bullet();\n this.options = context.options;\n }\n\n /**\n * insert tab\n *\n * @param {WrappedRange} rng\n * @param {Number} tabsize\n */\n insertTab(rng, tabsize) {\n const tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n rng = rng.deleteContents();\n rng.insertNode(tab, true);\n\n rng = range.create(tab, tabsize);\n rng.select();\n }\n\n /**\n * insert paragraph\n *\n * @param {jQuery} $editable\n * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n *\n * blockquoteBreakingLevel\n * 0 - No break, the new paragraph remains inside the quote\n * 1 - Break the first blockquote in the ancestors list\n * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n */\n insertParagraph(editable, rng) {\n rng = rng || range.create(editable);\n\n // deleteContents on range.\n rng = rng.deleteContents();\n\n // Wrap range if it needs to be wrapped by paragraph\n rng = rng.wrapBodyInlineWithPara();\n\n // finding paragraph\n const splitRoot = dom.ancestor(rng.sc, dom.isPara);\n\n let nextPara;\n // on paragraph: split paragraph\n if (splitRoot) {\n // if it is an empty line with li\n if (dom.isLi(splitRoot) && (dom.isEmpty(splitRoot) || dom.deepestChildIsEmpty(splitRoot))) {\n // toogle UL/OL and escape\n this.bullet.toggleList(splitRoot.parentNode.nodeName);\n return;\n } else {\n let blockquote = null;\n if (this.options.blockquoteBreakingLevel === 1) {\n blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n } else if (this.options.blockquoteBreakingLevel === 2) {\n blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n }\n\n if (blockquote) {\n // We're inside a blockquote and options ask us to break it\n nextPara = $(dom.emptyPara)[0];\n // If the split is right before a <br>, remove it so that there's no \"empty line\"\n // after the split in the new blockquote created\n if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n $(rng.sc.nextSibling).remove();\n }\n const split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n if (split) {\n split.parentNode.insertBefore(nextPara, split);\n } else {\n dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n }\n } else {\n nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n\n // not a blockquote, just insert the paragraph\n let emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n\n $.each(emptyAnchors, (idx, anchor) => {\n dom.remove(anchor);\n });\n\n // replace empty heading, pre or custom-made styleTag with P tag\n if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n nextPara = dom.replace(nextPara, 'p');\n }\n }\n }\n // no paragraph: insert empty paragraph\n } else {\n const next = rng.sc.childNodes[rng.so];\n nextPara = $(dom.emptyPara)[0];\n if (next) {\n rng.sc.insertBefore(nextPara, next);\n } else {\n rng.sc.appendChild(nextPara);\n }\n }\n\n range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport lists from '../core/lists';\n\n/**\n * @class Create a virtual table to create what actions to do in change.\n * @param {object} startPoint Cell selected to apply change.\n * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where\n * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n * @param {object} domTable Dom element of table to make changes.\n */\nconst TableResultAction = function(startPoint, where, action, domTable) {\n const _startPoint = { 'colPos': 0, 'rowPos': 0 };\n const _virtualTable = [];\n const _actionCellList = [];\n\n /// ///////////////////////////////////////////\n // Private functions\n /// ///////////////////////////////////////////\n\n /**\n * Set the startPoint of action.\n */\n function setStartPoint() {\n if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n // Impossible to identify start Cell point\n return;\n }\n _startPoint.colPos = startPoint.cellIndex;\n if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n // Impossible to identify start Row point\n return;\n }\n _startPoint.rowPos = startPoint.parentElement.rowIndex;\n }\n\n /**\n * Define virtual table position info object.\n *\n * @param {int} rowIndex Index position in line of virtual table.\n * @param {int} cellIndex Index position in column of virtual table.\n * @param {object} baseRow Row affected by this position.\n * @param {object} baseCell Cell affected by this position.\n * @param {bool} isSpan Inform if it is an span cell/row.\n */\n function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n const objPosition = {\n 'baseRow': baseRow,\n 'baseCell': baseCell,\n 'isRowSpan': isRowSpan,\n 'isColSpan': isColSpan,\n 'isVirtual': isVirtualCell,\n };\n if (!_virtualTable[rowIndex]) {\n _virtualTable[rowIndex] = [];\n }\n _virtualTable[rowIndex][cellIndex] = objPosition;\n }\n\n /**\n * Create action cell object.\n *\n * @param {object} virtualTableCellObj Object of specific position on virtual table.\n * @param {enum} resultAction Action to be applied in that item.\n */\n function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n return {\n 'baseCell': virtualTableCellObj.baseCell,\n 'action': resultAction,\n 'virtualTable': {\n 'rowIndex': virtualRowPosition,\n 'cellIndex': virtualColPosition,\n },\n };\n }\n\n /**\n * Recover free index of row to append Cell.\n *\n * @param {int} rowIndex Index of row to find free space.\n * @param {int} cellIndex Index of cell to find free space in table.\n */\n function recoverCellIndex(rowIndex, cellIndex) {\n if (!_virtualTable[rowIndex]) {\n return cellIndex;\n }\n if (!_virtualTable[rowIndex][cellIndex]) {\n return cellIndex;\n }\n\n let newCellIndex = cellIndex;\n while (_virtualTable[rowIndex][newCellIndex]) {\n newCellIndex++;\n if (!_virtualTable[rowIndex][newCellIndex]) {\n return newCellIndex;\n }\n }\n }\n\n /**\n * Recover info about row and cell and add information to virtual table.\n *\n * @param {object} row Row to recover information.\n * @param {object} cell Cell to recover information.\n */\n function addCellInfoToVirtual(row, cell) {\n const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n const cellHasColspan = (cell.colSpan > 1);\n const cellHasRowspan = (cell.rowSpan > 1);\n const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n\n // Add span rows to virtual Table.\n const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n if (rowspanNumber > 1) {\n for (let rp = 1; rp < rowspanNumber; rp++) {\n const rowspanIndex = row.rowIndex + rp;\n adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n }\n }\n\n // Add span cols to virtual table.\n const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n if (colspanNumber > 1) {\n for (let cp = 1; cp < colspanNumber; cp++) {\n const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n }\n }\n }\n\n /**\n * Process validation and adjust of start point if needed\n *\n * @param {int} rowIndex\n * @param {int} cellIndex\n * @param {object} cell\n * @param {bool} isSelectedCell\n */\n function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n _startPoint.colPos++;\n }\n }\n\n /**\n * Create virtual table of cells with all cells, including span cells.\n */\n function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getDeleteResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n case TableResultAction.where.Row:\n if (!cell.isVirtual && cell.isRowSpan) {\n return TableResultAction.resultAction.AddCell;\n } else if (cell.isRowSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n }\n return TableResultAction.resultAction.RemoveCell;\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getAddResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isRowSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n case TableResultAction.where.Row:\n if (cell.isRowSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isColSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n }\n return TableResultAction.resultAction.AddCell;\n }\n\n function init() {\n setStartPoint();\n createVirtualTable();\n }\n\n /// ///////////////////////////////////////////\n // Public functions\n /// ///////////////////////////////////////////\n\n /**\n * Recover array os what to do in table.\n */\n this.getActionList = function() {\n const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n\n let actualPosition = 0;\n let canContinue = true;\n while (canContinue) {\n const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n const row = _virtualTable[rowPosition];\n if (!row) {\n canContinue = false;\n return _actionCellList;\n }\n const cell = row[colPosition];\n if (!cell) {\n canContinue = false;\n return _actionCellList;\n }\n\n // Define action to be applied in this cell\n let resultAction = TableResultAction.resultAction.Ignore;\n switch (action) {\n case TableResultAction.requestAction.Add:\n resultAction = getAddResultActionToCell(cell);\n break;\n case TableResultAction.requestAction.Delete:\n resultAction = getDeleteResultActionToCell(cell);\n break;\n }\n _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n actualPosition++;\n }\n\n return _actionCellList;\n };\n\n init();\n};\n/**\n*\n* Where action occours enum.\n*/\nTableResultAction.where = { 'Row': 0, 'Column': 1 };\n/**\n*\n* Requested action to apply enum.\n*/\nTableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n/**\n*\n* Result action to be executed enum.\n*/\nTableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n\n/**\n *\n * @class editing.Table\n *\n * Table\n *\n */\nexport default class Table {\n /**\n * handle tab key\n *\n * @param {WrappedRange} rng\n * @param {Boolean} isShift\n */\n tab(rng, isShift) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const table = dom.ancestor(cell, dom.isTable);\n const cells = dom.listDescendant(table, dom.isCell);\n\n const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n if (nextCell) {\n range.create(nextCell, 0).select();\n }\n }\n\n /**\n * Add a new row\n *\n * @param {WrappedRange} rng\n * @param {String} position (top/bottom)\n * @return {Node}\n */\n addRow(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n\n const currentTr = $(cell).closest('tr');\n const trAttributes = this.recoverAttributes(currentTr);\n const html = $('<tr' + trAttributes + '></tr>');\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let idCell = 0; idCell < actions.length; idCell++) {\n const currentCell = actions[idCell];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n break;\n case TableResultAction.resultAction.SumSpanCount:\n {\n if (position === 'top') {\n const baseCellTr = currentCell.baseCell.parent;\n const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n if (isTopFromRowSpan) {\n const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n html.append(newTd);\n break;\n }\n }\n let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n rowspanNumber++;\n currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n }\n break;\n }\n }\n\n if (position === 'top') {\n currentTr.before(html);\n } else {\n const cellHasRowspan = (cell.rowSpan > 1);\n if (cellHasRowspan) {\n const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n $($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));\n return;\n }\n currentTr.after(html);\n }\n }\n\n /**\n * Add a new col\n *\n * @param {WrappedRange} rng\n * @param {String} position (left/right)\n * @return {Node}\n */\n addCol(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const rowsGroup = $(row).siblings();\n rowsGroup.push(row);\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Add, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n const currentCell = actions[actionIndex];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n if (position === 'right') {\n $(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n case TableResultAction.resultAction.SumSpanCount:\n if (position === 'right') {\n let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n colspanNumber++;\n currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n }\n }\n }\n\n /*\n * Copy attributes from element.\n *\n * @param {object} Element to recover attributes.\n * @return {string} Copied string elements.\n */\n recoverAttributes(el) {\n let resultStr = '';\n\n if (!el) {\n return resultStr;\n }\n\n const attrList = el.attributes || [];\n\n for (let i = 0; i < attrList.length; i++) {\n if (attrList[i].name.toLowerCase() === 'id') {\n continue;\n }\n\n if (attrList[i].specified) {\n resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n }\n }\n\n return resultStr;\n }\n\n /**\n * Delete current row\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteRow(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n const rowPos = row[0].rowIndex;\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n\n const baseCell = actions[actionIndex].baseCell;\n const virtualPosition = actions[actionIndex].virtualTable;\n const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.AddCell:\n {\n const nextRow = row.next('tr')[0];\n if (!nextRow) { continue; }\n const cloneRow = row[0].cells[cellPos];\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n nextRow.cells[cellPos].innerHTML = '';\n } else if (rowspanNumber === 2) {\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].removeAttribute('rowSpan');\n nextRow.cells[cellPos].innerHTML = '';\n }\n }\n }\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n baseCell.setAttribute('rowSpan', rowspanNumber);\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (rowspanNumber === 2) {\n baseCell.removeAttribute('rowSpan');\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n // Do not need remove cell because row will be deleted.\n continue;\n }\n }\n row.remove();\n }\n\n /**\n * Delete current col\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteCol(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n {\n const baseCell = actions[actionIndex].baseCell;\n const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n if (hasColspan) {\n let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n if (colspanNumber > 2) {\n colspanNumber--;\n baseCell.setAttribute('colSpan', colspanNumber);\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (colspanNumber === 2) {\n baseCell.removeAttribute('colSpan');\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n dom.remove(actions[actionIndex].baseCell, true);\n continue;\n }\n }\n }\n\n /**\n * create empty table element\n *\n * @param {Number} rowCount\n * @param {Number} colCount\n * @return {Node}\n */\n createTable(colCount, rowCount, options) {\n const tds = [];\n let tdHTML;\n for (let idxCol = 0; idxCol < colCount; idxCol++) {\n tds.push('<td>' + dom.blank + '</td>');\n }\n tdHTML = tds.join('');\n\n const trs = [];\n let trHTML;\n for (let idxRow = 0; idxRow < rowCount; idxRow++) {\n trs.push('<tr>' + tdHTML + '</tr>');\n }\n trHTML = trs.join('');\n const $table = $('<table>' + trHTML + '</table>');\n if (options && options.tableClassName) {\n $table.addClass(options.tableClassName);\n }\n\n return $table[0];\n }\n\n /**\n * Delete current table\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteTable(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n $(cell).closest('table').remove();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport { readFileAsDataURL, createImage } from '../core/async';\nimport History from '../editing/History';\nimport Style from '../editing/Style';\nimport Typing from '../editing/Typing';\nimport Table from '../editing/Table';\nimport Bullet from '../editing/Bullet';\n\nconst KEY_BOGUS = 'bogus';\n\n/**\n * @class Editor\n */\nexport default class Editor {\n constructor(context) {\n this.context = context;\n\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.editable = this.$editable[0];\n this.lastRange = null;\n this.snapshot = null;\n\n this.style = new Style();\n this.table = new Table();\n this.typing = new Typing(context);\n this.bullet = new Bullet();\n this.history = new History(context);\n\n this.context.memo('help.undo', this.lang.help.undo);\n this.context.memo('help.redo', this.lang.help.redo);\n this.context.memo('help.tab', this.lang.help.tab);\n this.context.memo('help.untab', this.lang.help.untab);\n this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n this.context.memo('help.indent', this.lang.help.indent);\n this.context.memo('help.outdent', this.lang.help.outdent);\n this.context.memo('help.formatPara', this.lang.help.formatPara);\n this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n this.context.memo('help.fontName', this.lang.help.fontName);\n\n // native commands(with execCommand), generate function for execCommand\n const commands = [\n 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n 'formatBlock', 'removeFormat', 'backColor',\n ];\n\n for (let idx = 0, len = commands.length; idx < len; idx++) {\n this[commands[idx]] = ((sCmd) => {\n return (value) => {\n this.beforeCommand();\n document.execCommand(sCmd, false, value);\n this.afterCommand(true);\n };\n })(commands[idx]);\n this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n }\n\n this.fontName = this.wrapCommand((value) => {\n return this.fontStyling('font-family', env.validFontName(value));\n });\n\n this.fontSize = this.wrapCommand((value) => {\n const unit = this.currentStyle()['font-size-unit'];\n return this.fontStyling('font-size', value + unit);\n });\n\n this.fontSizeUnit = this.wrapCommand((value) => {\n const size = this.currentStyle()['font-size'];\n return this.fontStyling('font-size', size + value);\n });\n\n for (let idx = 1; idx <= 6; idx++) {\n this['formatH' + idx] = ((idx) => {\n return () => {\n this.formatBlock('H' + idx);\n };\n })(idx);\n this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n }\n\n this.insertParagraph = this.wrapCommand(() => {\n this.typing.insertParagraph(this.editable);\n });\n\n this.insertOrderedList = this.wrapCommand(() => {\n this.bullet.insertOrderedList(this.editable);\n });\n\n this.insertUnorderedList = this.wrapCommand(() => {\n this.bullet.insertUnorderedList(this.editable);\n });\n\n this.indent = this.wrapCommand(() => {\n this.bullet.indent(this.editable);\n });\n\n this.outdent = this.wrapCommand(() => {\n this.bullet.outdent(this.editable);\n });\n\n /**\n * insertNode\n * insert node\n * @param {Node} node\n */\n this.insertNode = this.wrapCommand((node) => {\n if (this.isLimited($(node).text().length)) {\n return;\n }\n const rng = this.getLastRange();\n rng.insertNode(node);\n this.setLastRange(range.createFromNodeAfter(node).select());\n });\n\n /**\n * insert text\n * @param {String} text\n */\n this.insertText = this.wrapCommand((text) => {\n if (this.isLimited(text.length)) {\n return;\n }\n const rng = this.getLastRange();\n const textNode = rng.insertNode(dom.createText(text));\n this.setLastRange(range.create(textNode, dom.nodeLength(textNode)).select());\n });\n\n /**\n * paste HTML\n * @param {String} markup\n */\n this.pasteHTML = this.wrapCommand((markup) => {\n if (this.isLimited(markup.length)) {\n return;\n }\n markup = this.context.invoke('codeview.purify', markup);\n const contents = this.getLastRange().pasteHTML(markup);\n this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select());\n });\n\n /**\n * formatBlock\n *\n * @param {String} tagName\n */\n this.formatBlock = this.wrapCommand((tagName, $target) => {\n const onApplyCustomStyle = this.options.callbacks.onApplyCustomStyle;\n if (onApplyCustomStyle) {\n onApplyCustomStyle.call(this, $target, this.context, this.onFormatBlock);\n } else {\n this.onFormatBlock(tagName, $target);\n }\n });\n\n /**\n * insert horizontal rule\n */\n this.insertHorizontalRule = this.wrapCommand(() => {\n const hrNode = this.getLastRange().insertNode(dom.create('HR'));\n if (hrNode.nextSibling) {\n this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());\n }\n });\n\n /**\n * lineHeight\n * @param {String} value\n */\n this.lineHeight = this.wrapCommand((value) => {\n this.style.stylePara(this.getLastRange(), {\n lineHeight: value,\n });\n });\n\n /**\n * create link (command)\n *\n * @param {Object} linkInfo\n */\n this.createLink = this.wrapCommand((linkInfo) => {\n let linkUrl = linkInfo.url;\n const linkText = linkInfo.text;\n const isNewWindow = linkInfo.isNewWindow;\n const checkProtocol = linkInfo.checkProtocol;\n let rng = linkInfo.range || this.getLastRange();\n const additionalTextLength = linkText.length - rng.toString().length;\n if (additionalTextLength > 0 && this.isLimited(additionalTextLength)) {\n return;\n }\n const isTextChanged = rng.toString() !== linkText;\n\n // handle spaced urls from input\n if (typeof linkUrl === 'string') {\n linkUrl = linkUrl.trim();\n }\n\n if (this.options.onCreateLink) {\n linkUrl = this.options.onCreateLink(linkUrl);\n } else if (checkProtocol) {\n // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n ? linkUrl : this.options.defaultProtocol + linkUrl;\n }\n\n let anchors = [];\n if (isTextChanged) {\n rng = rng.deleteContents();\n const anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);\n anchors.push(anchor);\n } else {\n anchors = this.style.styleNodes(rng, {\n nodeName: 'A',\n expandClosestSibling: true,\n onlyPartialContains: true,\n });\n }\n\n $.each(anchors, (idx, anchor) => {\n $(anchor).attr('href', linkUrl);\n if (isNewWindow) {\n $(anchor).attr('target', '_blank');\n } else {\n $(anchor).removeAttr('target');\n }\n });\n\n const startRange = range.createFromNodeBefore(lists.head(anchors));\n const startPoint = startRange.getStartPoint();\n const endRange = range.createFromNodeAfter(lists.last(anchors));\n const endPoint = endRange.getEndPoint();\n\n this.setLastRange(\n range.create(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n ).select()\n );\n });\n\n /**\n * setting color\n *\n * @param {Object} sObjColor color code\n * @param {String} sObjColor.foreColor foreground color\n * @param {String} sObjColor.backColor background color\n */\n this.color = this.wrapCommand((colorInfo) => {\n const foreColor = colorInfo.foreColor;\n const backColor = colorInfo.backColor;\n\n if (foreColor) { document.execCommand('foreColor', false, foreColor); }\n if (backColor) { document.execCommand('backColor', false, backColor); }\n });\n\n /**\n * Set foreground color\n *\n * @param {String} colorCode foreground color code\n */\n this.foreColor = this.wrapCommand((colorInfo) => {\n document.execCommand('foreColor', false, colorInfo);\n });\n\n /**\n * insert Table\n *\n * @param {String} dimension of table (ex : \"5x5\")\n */\n this.insertTable = this.wrapCommand((dim) => {\n const dimension = dim.split('x');\n\n const rng = this.getLastRange().deleteContents();\n rng.insertNode(this.table.createTable(dimension[0], dimension[1], this.options));\n });\n\n /**\n * remove media object and Figure Elements if media object is img with Figure.\n */\n this.removeMedia = this.wrapCommand(() => {\n let $target = $(this.restoreTarget()).parent();\n if ($target.closest('figure').length) {\n $target.closest('figure').remove();\n } else {\n $target = $(this.restoreTarget()).detach();\n }\n this.context.triggerEvent('media.delete', $target, this.$editable);\n });\n\n /**\n * float me\n *\n * @param {String} value\n */\n this.floatMe = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n $target.toggleClass('note-float-left', value === 'left');\n $target.toggleClass('note-float-right', value === 'right');\n $target.css('float', (value === 'none' ? '' : value));\n });\n\n /**\n * resize overlay element\n * @param {String} value\n */\n this.resize = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n value = parseFloat(value);\n if (value === 0) {\n $target.css('width', '');\n } else {\n $target.css({\n width: value * 100 + '%',\n height: '',\n });\n }\n });\n }\n\n initialize() {\n // bind custom events\n this.$editable.on('keydown', (event) => {\n if (event.keyCode === key.code.ENTER) {\n this.context.triggerEvent('enter', event);\n }\n this.context.triggerEvent('keydown', event);\n\n // keep a snapshot to limit text on input event\n this.snapshot = this.history.makeSnapshot();\n this.hasKeyShortCut = false;\n if (!event.isDefaultPrevented()) {\n if (this.options.shortcuts) {\n this.hasKeyShortCut = this.handleKeyMap(event);\n } else {\n this.preventDefaultEditableShortCuts(event);\n }\n }\n if (this.isLimited(1, event)) {\n const lastRange = this.getLastRange();\n if (lastRange.eo - lastRange.so === 0) {\n return false;\n }\n }\n this.setLastRange();\n\n // record undo in the key event except keyMap.\n if (this.options.recordEveryKeystroke) {\n if (this.hasKeyShortCut === false) {\n this.history.recordUndo();\n }\n }\n }).on('keyup', (event) => {\n this.setLastRange();\n this.context.triggerEvent('keyup', event);\n }).on('focus', (event) => {\n this.setLastRange();\n this.context.triggerEvent('focus', event);\n }).on('blur', (event) => {\n this.context.triggerEvent('blur', event);\n }).on('mousedown', (event) => {\n this.context.triggerEvent('mousedown', event);\n }).on('mouseup', (event) => {\n this.setLastRange();\n this.history.recordUndo();\n this.context.triggerEvent('mouseup', event);\n }).on('scroll', (event) => {\n this.context.triggerEvent('scroll', event);\n }).on('paste', (event) => {\n this.setLastRange();\n this.context.triggerEvent('paste', event);\n }).on('input', () => {\n // To limit composition characters (e.g. Korean)\n if (this.isLimited(0) && this.snapshot) {\n this.history.applySnapshot(this.snapshot);\n }\n });\n\n this.$editable.attr('spellcheck', this.options.spellCheck);\n\n this.$editable.attr('autocorrect', this.options.spellCheck);\n\n if (this.options.disableGrammar) {\n this.$editable.attr('data-gramm', false);\n }\n\n // init content before set event\n this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n\n this.$editable.on(env.inputEventName, func.debounce(() => {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }, 10));\n\n this.$editable.on('focusin', (event) => {\n this.context.triggerEvent('focusin', event);\n }).on('focusout', (event) => {\n this.context.triggerEvent('focusout', event);\n });\n\n if (this.options.airMode) {\n if (this.options.overrideContextMenu) {\n this.$editor.on('contextmenu', (event) => {\n this.context.triggerEvent('contextmenu', event);\n return false;\n });\n }\n } else {\n if (this.options.width) {\n this.$editor.outerWidth(this.options.width);\n }\n if (this.options.height) {\n this.$editable.outerHeight(this.options.height);\n }\n if (this.options.maxHeight) {\n this.$editable.css('max-height', this.options.maxHeight);\n }\n if (this.options.minHeight) {\n this.$editable.css('min-height', this.options.minHeight);\n }\n }\n\n this.history.recordUndo();\n this.setLastRange();\n }\n\n destroy() {\n this.$editable.off();\n }\n\n handleKeyMap(event) {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n const keys = [];\n\n if (event.metaKey) { keys.push('CMD'); }\n if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }\n if (event.shiftKey) { keys.push('SHIFT'); }\n\n const keyName = key.nameFromCode[event.keyCode];\n if (keyName) {\n keys.push(keyName);\n }\n\n const eventName = keyMap[keys.join('+')];\n\n if (keyName === 'TAB' && !this.options.tabDisable) {\n this.afterCommand();\n } else if (eventName) {\n if (this.context.invoke(eventName) !== false) {\n event.preventDefault();\n // if keyMap action was invoked\n return true;\n }\n } else if (key.isEdit(event.keyCode)) {\n this.afterCommand();\n }\n return false;\n }\n\n preventDefaultEditableShortCuts(event) {\n // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n if ((event.ctrlKey || event.metaKey) &&\n lists.contains([66, 73, 85], event.keyCode)) {\n event.preventDefault();\n }\n }\n\n isLimited(pad, event) {\n pad = pad || 0;\n\n if (typeof event !== 'undefined') {\n if (key.isMove(event.keyCode) ||\n key.isNavigation(event.keyCode) ||\n (event.ctrlKey || event.metaKey) ||\n lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n return false;\n }\n }\n\n if (this.options.maxTextLength > 0) {\n if ((this.$editable.text().length + pad) > this.options.maxTextLength) {\n return true;\n }\n }\n return false;\n }\n /**\n * create range\n * @return {WrappedRange}\n */\n createRange() {\n this.focus();\n this.setLastRange();\n return this.getLastRange();\n }\n\n setLastRange(rng) {\n if (rng) {\n this.lastRange = rng;\n } else {\n this.lastRange = range.create(this.editable);\n\n if ($(this.lastRange.sc).closest('.note-editable').length === 0) {\n this.lastRange = range.createFromBodyElement(this.editable);\n }\n }\n }\n\n getLastRange() {\n if (!this.lastRange) {\n this.setLastRange();\n }\n return this.lastRange;\n }\n\n /**\n * saveRange\n *\n * save current range\n *\n * @param {Boolean} [thenCollapse=false]\n */\n saveRange(thenCollapse) {\n if (thenCollapse) {\n this.getLastRange().collapse().select();\n }\n }\n\n /**\n * restoreRange\n *\n * restore lately range\n */\n restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }\n\n saveTarget(node) {\n this.$editable.data('target', node);\n }\n\n clearTarget() {\n this.$editable.removeData('target');\n }\n\n restoreTarget() {\n return this.$editable.data('target');\n }\n\n /**\n * currentStyle\n *\n * current style\n * @return {Object|Boolean} unfocus\n */\n currentStyle() {\n let rng = range.create();\n if (rng) {\n rng = rng.normalize();\n }\n return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n }\n\n /**\n * style from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n styleFromNode($node) {\n return this.style.fromNode($node);\n }\n\n /**\n * undo\n */\n undo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.undo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /*\n * commit\n */\n commit() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.commit();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * redo\n */\n redo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.redo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * before command\n */\n beforeCommand() {\n this.context.triggerEvent('before.command', this.$editable.html());\n\n // Set styleWithCSS before run a command\n document.execCommand('styleWithCSS', false, this.options.styleWithCSS);\n\n // keep focus on editable before command execution\n this.focus();\n }\n\n /**\n * after command\n * @param {Boolean} isPreventTrigger\n */\n afterCommand(isPreventTrigger) {\n this.normalizeContent();\n this.history.recordUndo();\n if (!isPreventTrigger) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n }\n\n /**\n * handle tab key\n */\n tab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n\n if (!this.isLimited(this.options.tabSize)) {\n this.beforeCommand();\n this.typing.insertTab(rng, this.options.tabSize);\n this.afterCommand();\n }\n }\n }\n\n /**\n * handle shift+tab key\n */\n untab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng, true);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n }\n }\n\n /**\n * run given function between beforeCommand and afterCommand\n */\n wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }\n\n /**\n * insert image\n *\n * @param {String} src\n * @param {String|Function} param\n * @return {Promise}\n */\n insertImage(src, param) {\n return createImage(src, param).then(($image) => {\n this.beforeCommand();\n\n if (typeof param === 'function') {\n param($image);\n } else {\n if (typeof param === 'string') {\n $image.attr('data-filename', param);\n }\n $image.css('width', Math.min(this.$editable.width(), $image.width()));\n }\n\n $image.show();\n this.getLastRange().insertNode($image[0]);\n this.setLastRange(range.createFromNodeAfter($image[0]).select());\n this.afterCommand();\n }).fail((e) => {\n this.context.triggerEvent('image.upload.error', e);\n });\n }\n\n /**\n * insertImages\n * @param {File[]} files\n */\n insertImagesAsDataURL(files) {\n $.each(files, (idx, file) => {\n const filename = file.name;\n if (this.options.maximumImageFileSize && this.options.maximumImageFileSize < file.size) {\n this.context.triggerEvent('image.upload.error', this.lang.image.maximumFileSizeError);\n } else {\n readFileAsDataURL(file).then((dataURL) => {\n return this.insertImage(dataURL, filename);\n }).fail(() => {\n this.context.triggerEvent('image.upload.error');\n });\n }\n });\n }\n\n /**\n * insertImagesOrCallback\n * @param {File[]} files\n */\n insertImagesOrCallback(files) {\n const callbacks = this.options.callbacks;\n // If onImageUpload set,\n if (callbacks.onImageUpload) {\n this.context.triggerEvent('image.upload', files);\n // else insert Image as dataURL\n } else {\n this.insertImagesAsDataURL(files);\n }\n }\n\n /**\n * return selected plain text\n * @return {String} text\n */\n getSelectedText() {\n let rng = this.getLastRange();\n\n // if range on anchor, expand range with anchor\n if (rng.isOnAnchor()) {\n rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n }\n\n return rng.toString();\n }\n\n onFormatBlock(tagName, $target) {\n // [workaround] for MSIE, IE need `<`\n document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n\n // support custom class\n if ($target && $target.length) {\n // find the exact element has given tagName\n if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n $target = $target.find(tagName);\n }\n\n if ($target && $target.length) {\n const className = $target[0].className || '';\n if (className) {\n const currentRange = this.createRange();\n\n const $parent = $([currentRange.sc, currentRange.ec]).closest(tagName);\n $parent.addClass(className);\n }\n }\n }\n }\n\n formatPara() {\n this.formatBlock('P');\n }\n\n fontStyling(target, value) {\n const rng = this.getLastRange();\n\n if (rng !== '') {\n const spans = this.style.styleNodes(rng);\n this.$editor.find('.note-status-output').html('');\n $(spans).css(target, value);\n\n // [workaround] added styled bogus span for style\n // - also bogus character needed for cursor position\n if (rng.isCollapsed()) {\n const firstSpan = lists.head(spans);\n if (firstSpan && !dom.nodeLength(firstSpan)) {\n firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n range.createFromNodeAfter(firstSpan.firstChild).select();\n this.setLastRange();\n this.$editable.data(KEY_BOGUS, firstSpan);\n }\n }\n } else {\n const noteStatusOutput = $.now();\n this.$editor.find('.note-status-output').html('<div id=\"note-status-output-' + noteStatusOutput + '\" class=\"alert alert-info\">' + this.lang.output.noSelection + '</div>');\n setTimeout(function() { $('#note-status-output-' + noteStatusOutput).remove(); }, 5000);\n }\n }\n\n /**\n * unlink\n *\n * @type command\n */\n unlink() {\n let rng = this.getLastRange();\n if (rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n rng = range.createFromNode(anchor);\n rng.select();\n this.setLastRange();\n\n this.beforeCommand();\n document.execCommand('unlink');\n this.afterCommand();\n }\n }\n\n /**\n * returns link info\n *\n * @return {Object}\n * @return {WrappedRange} return.range\n * @return {String} return.text\n * @return {Boolean} [return.isNewWindow=true]\n * @return {String} [return.url=\"\"]\n */\n getLinkInfo() {\n const rng = this.getLastRange().expand(dom.isAnchor);\n // Get the first anchor on range(for edit).\n const $anchor = $(lists.head(rng.nodes(dom.isAnchor)));\n const linkInfo = {\n range: rng,\n text: rng.toString(),\n url: $anchor.length ? $anchor.attr('href') : '',\n };\n\n // When anchor exists,\n if ($anchor.length) {\n // Set isNewWindow by checking its target.\n linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n }\n\n return linkInfo;\n }\n\n addRow(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addRow(rng, position);\n this.afterCommand();\n }\n }\n\n addCol(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addCol(rng, position);\n this.afterCommand();\n }\n }\n\n deleteRow() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteRow(rng);\n this.afterCommand();\n }\n }\n\n deleteCol() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteCol(rng);\n this.afterCommand();\n }\n }\n\n deleteTable() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteTable(rng);\n this.afterCommand();\n }\n }\n\n /**\n * @param {Position} pos\n * @param {jQuery} $target - target element\n * @param {Boolean} [bKeepRatio] - keep ratio\n */\n resizeTo(pos, $target, bKeepRatio) {\n let imageSize;\n if (bKeepRatio) {\n const newRatio = pos.y / pos.x;\n const ratio = $target.data('ratio');\n imageSize = {\n width: ratio > newRatio ? pos.x : pos.y / ratio,\n height: ratio > newRatio ? pos.x * ratio : pos.y,\n };\n } else {\n imageSize = {\n width: pos.x,\n height: pos.y,\n };\n }\n\n $target.css(imageSize);\n }\n\n /**\n * returns whether editable area has focus or not.\n */\n hasFocus() {\n return this.$editable.is(':focus');\n }\n\n /**\n * set focus\n */\n focus() {\n // [workaround] Screen will move when page is scolled in IE.\n // - do focus when not focused\n if (!this.hasFocus()) {\n this.$editable.focus();\n }\n }\n\n /**\n * returns whether contents is empty or not.\n * @return {Boolean}\n */\n isEmpty() {\n return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n }\n\n /**\n * Removes all contents and restores the editable instance to an _emptyPara_.\n */\n empty() {\n this.context.invoke('code', dom.emptyPara);\n }\n\n /**\n * normalize content\n */\n normalizeContent() {\n this.$editable[0].normalize();\n }\n}\n","import $ from 'jquery';\n\n/**\n * @method readFileAsDataURL\n *\n * read contents of file as representing URL\n *\n * @param {File} file\n * @return {Promise} - then: dataUrl\n */\nexport function readFileAsDataURL(file) {\n return $.Deferred((deferred) => {\n $.extend(new FileReader(), {\n onload: (e) => {\n const dataURL = e.target.result;\n deferred.resolve(dataURL);\n },\n onerror: (err) => {\n deferred.reject(err);\n },\n }).readAsDataURL(file);\n }).promise();\n}\n\n/**\n * @method createImage\n *\n * create `<image>` from url string\n *\n * @param {String} url\n * @return {Promise} - then: $image\n */\nexport function createImage(url) {\n return $.Deferred((deferred) => {\n const $img = $('<img>');\n\n $img.one('load', () => {\n $img.off('error abort');\n deferred.resolve($img);\n }).one('error abort', () => {\n $img.off('load').detach();\n deferred.reject($img);\n }).css({\n display: 'none',\n }).appendTo(document.body).attr('src', url);\n }).promise();\n}\n","import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n this.$editable.on('paste', this.pasteByEvent.bind(this));\n }\n\n /**\n * paste by clipboard event\n *\n * @param {Event} event\n */\n pasteByEvent(event) {\n const clipboardData = event.originalEvent.clipboardData;\n\n if (clipboardData && clipboardData.items && clipboardData.items.length) {\n const item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n // paste img file\n this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n event.preventDefault();\n } else if (item.kind === 'string') {\n // paste text with maxTextLength check\n if (this.context.invoke('editor.isLimited', clipboardData.getData('Text').length)) {\n event.preventDefault();\n }\n }\n } else if (window.clipboardData) {\n // for IE\n let text = window.clipboardData.getData('text');\n if (this.context.invoke('editor.isLimited', text.length)) {\n event.preventDefault();\n }\n }\n // Call editor.afterCommand after proceeding default event handler\n setTimeout(() => {\n this.context.invoke('editor.afterCommand');\n }, 10);\n }\n}\n","import env from '../core/env';\nimport dom from '../core/dom';\n\nlet CodeMirror;\nif (env.hasCodeMirror) {\n CodeMirror = window.CodeMirror;\n}\n\n/**\n * @class Codeview\n */\nexport default class CodeView {\n constructor(context) {\n this.context = context;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n this.options = context.options;\n }\n\n sync() {\n const isCodeview = this.isActivated();\n if (isCodeview && env.hasCodeMirror) {\n this.$codable.data('cmEditor').save();\n }\n }\n\n /**\n * @return {Boolean}\n */\n isActivated() {\n return this.$editor.hasClass('codeview');\n }\n\n /**\n * toggle codeview\n */\n toggle() {\n if (this.isActivated()) {\n this.deactivate();\n } else {\n this.activate();\n }\n this.context.triggerEvent('codeview.toggled');\n }\n\n /**\n * purify input value\n * @param value\n * @returns {*}\n */\n purify(value) {\n if (this.options.codeviewFilter) {\n // filter code view regex\n value = value.replace(this.options.codeviewFilterRegex, '');\n // allow specific iframe tag\n if (this.options.codeviewIframeFilter) {\n const whitelist = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function(tag) {\n // remove if src attribute is duplicated\n if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n return '';\n }\n for (const src of whitelist) {\n // pass if src is trusted\n if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n return tag;\n }\n }\n return '';\n });\n }\n }\n return value;\n }\n\n /**\n * activate code view\n */\n activate() {\n this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n this.$codable.height(this.$editable.height());\n\n this.context.invoke('toolbar.updateCodeview', true);\n this.$editor.addClass('codeview');\n this.$codable.focus();\n\n // activate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n\n // CodeMirror TernServer\n if (this.options.codemirror.tern) {\n const server = new CodeMirror.TernServer(this.options.codemirror.tern);\n cmEditor.ternServer = server;\n cmEditor.on('cursorActivity', (cm) => {\n server.updateArgHints(cm);\n });\n }\n\n cmEditor.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', cmEditor.getValue(), event);\n });\n cmEditor.on('change', () => {\n this.context.triggerEvent('change.codeview', cmEditor.getValue(), cmEditor);\n });\n\n // CodeMirror hasn't Padding.\n cmEditor.setSize(null, this.$editable.outerHeight());\n this.$codable.data('cmEditor', cmEditor);\n } else {\n this.$codable.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', this.$codable.val(), event);\n });\n this.$codable.on('input', () => {\n this.context.triggerEvent('change.codeview', this.$codable.val(), this.$codable);\n });\n }\n }\n\n /**\n * deactivate code view\n */\n deactivate() {\n // deactivate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = this.$codable.data('cmEditor');\n this.$codable.val(cmEditor.getValue());\n cmEditor.toTextArea();\n }\n\n const value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n const isChange = this.$editable.html() !== value;\n\n this.$editable.html(value);\n this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n this.$editor.removeClass('codeview');\n\n if (isChange) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n this.$editable.focus();\n\n this.context.invoke('toolbar.updateCodeview', false);\n }\n\n destroy() {\n if (this.isActivated()) {\n this.deactivate();\n }\n }\n}\n","import $ from 'jquery';\n\nexport default class Dropzone {\n constructor(context) {\n this.context = context;\n this.$eventListener = $(document);\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.documentEventHandlers = {};\n\n this.$dropzone = $([\n '<div class=\"note-dropzone\">',\n '<div class=\"note-dropzone-message\"/>',\n '</div>',\n ].join('')).prependTo(this.$editor);\n }\n\n /**\n * attach Drag and Drop Events\n */\n initialize() {\n if (this.options.disableDragAndDrop) {\n // prevent default drop event\n this.documentEventHandlers.onDrop = (e) => {\n e.preventDefault();\n };\n // do not consider outside of dropzone\n this.$eventListener = this.$dropzone;\n this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n } else {\n this.attachDragAndDropEvent();\n }\n }\n\n /**\n * attach Drag and Drop Events\n */\n attachDragAndDropEvent() {\n let collection = $();\n const $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n\n this.documentEventHandlers.onDragenter = (e) => {\n const isCodeview = this.context.invoke('codeview.isActivated');\n const hasEditorSize = this.$editor.width() > 0 && this.$editor.height() > 0;\n if (!isCodeview && !collection.length && hasEditorSize) {\n this.$editor.addClass('dragover');\n this.$dropzone.width(this.$editor.width());\n this.$dropzone.height(this.$editor.height());\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n }\n collection = collection.add(e.target);\n };\n\n this.documentEventHandlers.onDragleave = (e) => {\n collection = collection.not(e.target);\n\n // If nodeName is BODY, then just make it over (fix for IE)\n if (!collection.length || e.target.nodeName === 'BODY') {\n collection = $();\n this.$editor.removeClass('dragover');\n }\n };\n\n this.documentEventHandlers.onDrop = () => {\n collection = $();\n this.$editor.removeClass('dragover');\n };\n\n // show dropzone on dragenter when dragging a object to document\n // -but only if the editor is visible, i.e. has a positive width and height\n this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n .on('dragleave', this.documentEventHandlers.onDragleave)\n .on('drop', this.documentEventHandlers.onDrop);\n\n // change dropzone's message on hover.\n this.$dropzone.on('dragenter', () => {\n this.$dropzone.addClass('hover');\n $dropzoneMessage.text(this.lang.image.dropImage);\n }).on('dragleave', () => {\n this.$dropzone.removeClass('hover');\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n });\n\n // attach dropImage\n this.$dropzone.on('drop', (event) => {\n const dataTransfer = event.originalEvent.dataTransfer;\n\n // stop the browser from opening the dropped content\n event.preventDefault();\n\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n this.$editable.focus();\n this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n } else {\n $.each(dataTransfer.types, (idx, type) => {\n // skip moz-specific types\n if (type.toLowerCase().indexOf('_moz_') > -1) {\n return;\n }\n const content = dataTransfer.getData(type);\n\n if (type.toLowerCase().indexOf('text') > -1) {\n this.context.invoke('editor.pasteHTML', content);\n } else {\n $(content).each((idx, item) => {\n this.context.invoke('editor.insertNode', item);\n });\n }\n });\n }\n }).on('dragover', false); // prevent default dragover event\n }\n\n destroy() {\n Object.keys(this.documentEventHandlers).forEach((key) => {\n this.$eventListener.off(key.substr(2).toLowerCase(), this.documentEventHandlers[key]);\n });\n this.documentEventHandlers = {};\n }\n}\n","import $ from 'jquery';\nconst EDITABLE_PADDING = 24;\n\nexport default class Statusbar {\n constructor(context) {\n this.$document = $(document);\n this.$statusbar = context.layoutInfo.statusbar;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n }\n\n initialize() {\n if (this.options.airMode || this.options.disableResizeEditor) {\n this.destroy();\n return;\n }\n\n this.$statusbar.on('mousedown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const editableTop = this.$editable.offset().top - this.$document.scrollTop();\n const onMouseMove = (event) => {\n let height = event.clientY - (editableTop + EDITABLE_PADDING);\n\n height = (this.options.minheight > 0) ? Math.max(height, this.options.minheight) : height;\n height = (this.options.maxHeight > 0) ? Math.min(height, this.options.maxHeight) : height;\n\n this.$editable.height(height);\n };\n\n this.$document.on('mousemove', onMouseMove).one('mouseup', () => {\n this.$document.off('mousemove', onMouseMove);\n });\n });\n }\n\n destroy() {\n this.$statusbar.off();\n this.$statusbar.addClass('locked');\n }\n}\n","import $ from 'jquery';\n\nexport default class Fullscreen {\n constructor(context) {\n this.context = context;\n\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n\n this.$window = $(window);\n this.$scrollbar = $('html, body');\n\n this.onResize = () => {\n this.resizeTo({\n h: this.$window.height() - this.$toolbar.outerHeight(),\n });\n };\n }\n\n resizeTo(size) {\n this.$editable.css('height', size.h);\n this.$codable.css('height', size.h);\n if (this.$codable.data('cmeditor')) {\n this.$codable.data('cmeditor').setsize(null, size.h);\n }\n }\n\n /**\n * toggle fullscreen\n */\n toggle() {\n this.$editor.toggleClass('fullscreen');\n if (this.isFullscreen()) {\n this.$editable.data('orgHeight', this.$editable.css('height'));\n this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n this.$editable.css('maxHeight', '');\n this.$window.on('resize', this.onResize).trigger('resize');\n this.$scrollbar.css('overflow', 'hidden');\n } else {\n this.$window.off('resize', this.onResize);\n this.resizeTo({ h: this.$editable.data('orgHeight') });\n this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n this.$scrollbar.css('overflow', 'visible');\n }\n\n this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n }\n\n isFullscreen() {\n return this.$editor.hasClass('fullscreen');\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\n\nexport default class Handle {\n constructor(context) {\n this.context = context;\n this.$document = $(document);\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.events = {\n 'summernote.mousedown': (we, e) => {\n if (this.update(e.target, e)) {\n e.preventDefault();\n }\n },\n 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n initialize() {\n this.$handle = $([\n '<div class=\"note-handle\">',\n '<div class=\"note-control-selection\">',\n '<div class=\"note-control-selection-bg\"></div>',\n '<div class=\"note-control-holder note-control-nw\"></div>',\n '<div class=\"note-control-holder note-control-ne\"></div>',\n '<div class=\"note-control-holder note-control-sw\"></div>',\n '<div class=\"',\n (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n ' note-control-se\"></div>',\n (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n '</div>',\n '</div>',\n ].join('')).prependTo(this.$editingArea);\n\n this.$handle.on('mousedown', (event) => {\n if (dom.isControlSizing(event.target)) {\n event.preventDefault();\n event.stopPropagation();\n\n const $target = this.$handle.find('.note-control-selection').data('target');\n const posStart = $target.offset();\n const scrollTop = this.$document.scrollTop();\n\n const onMouseMove = (event) => {\n this.context.invoke('editor.resizeTo', {\n x: event.clientX - posStart.left,\n y: event.clientY - (posStart.top - scrollTop),\n }, $target, !event.shiftKey);\n\n this.update($target[0], event);\n };\n\n this.$document\n .on('mousemove', onMouseMove)\n .one('mouseup', (e) => {\n e.preventDefault();\n this.$document.off('mousemove', onMouseMove);\n this.context.invoke('editor.afterCommand');\n });\n\n if (!$target.data('ratio')) { // original ratio.\n $target.data('ratio', $target.height() / $target.width());\n }\n }\n });\n\n // Listen for scrolling on the handle overlay.\n this.$handle.on('wheel', (e) => {\n e.preventDefault();\n this.update();\n });\n }\n\n destroy() {\n this.$handle.remove();\n }\n\n update(target, event) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isImage = dom.isImg(target);\n const $selection = this.$handle.find('.note-control-selection');\n\n this.context.invoke('imagePopover.update', target, event);\n\n if (isImage) {\n const $image = $(target);\n const position = $image.position();\n const pos = {\n left: position.left + parseInt($image.css('marginLeft'), 10),\n top: position.top + parseInt($image.css('marginTop'), 10),\n };\n\n // exclude margin\n const imageSize = {\n w: $image.outerWidth(false),\n h: $image.outerHeight(false),\n };\n\n $selection.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n width: imageSize.w,\n height: imageSize.h,\n }).data('target', $image); // save current image element.\n\n const origImageObj = new Image();\n origImageObj.src = $image.attr('src');\n\n const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n $selection.find('.note-control-selection-info').text(sizingText);\n this.context.invoke('editor.saveTarget', target);\n } else {\n this.hide();\n }\n\n return isImage;\n }\n\n /**\n * hide\n *\n * @param {jQuery} $handle\n */\n hide() {\n this.context.invoke('editor.clearTarget');\n this.$handle.children().hide();\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport key from '../core/key';\n\nconst defaultScheme = 'http://';\nconst linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n\nexport default class AutoLink {\n constructor(context) {\n this.context = context;\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n initialize() {\n this.lastWordRange = null;\n }\n\n destroy() {\n this.lastWordRange = null;\n }\n\n replace() {\n if (!this.lastWordRange) {\n return;\n }\n\n const keyword = this.lastWordRange.toString();\n const match = keyword.match(linkPattern);\n\n if (match && (match[1] || match[2])) {\n const link = match[1] ? keyword : defaultScheme + keyword;\n const urlText = keyword.replace(/^(?:https?:\\/\\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\\.)?/i, '').split('/')[0];\n const node = $('<a />').html(urlText).attr('href', link)[0];\n if (this.context.options.linkTargetBlank) {\n $(node).attr('target', '_blank');\n }\n\n this.lastWordRange.insertNode(node);\n this.lastWordRange = null;\n this.context.invoke('editor.focus');\n }\n }\n\n handleKeydown(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWordRange = wordRange;\n }\n }\n\n handleKeyup(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n this.replace();\n }\n }\n}\n","import dom from '../core/dom';\n\n/**\n * textarea auto sync.\n */\nexport default class AutoSync {\n constructor(context) {\n this.$note = context.layoutInfo.note;\n this.events = {\n 'summernote.change': () => {\n this.$note.val(context.invoke('code'));\n },\n };\n }\n\n shouldInitialize() {\n return dom.isTextarea(this.$note[0]);\n }\n}\n","import lists from '../core/lists';\nimport dom from '../core/dom';\nimport key from '../core/key';\n\nexport default class AutoReplace {\n constructor(context) {\n this.context = context;\n this.options = context.options.replace || {};\n\n this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n this.previousKeydownCode = null;\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.match;\n }\n\n initialize() {\n this.lastWord = null;\n }\n\n destroy() {\n this.lastWord = null;\n }\n\n replace() {\n if (!this.lastWord) {\n return;\n }\n\n const self = this;\n const keyword = this.lastWord.toString();\n this.options.match(keyword, function(match) {\n if (match) {\n let node = '';\n\n if (typeof match === 'string') {\n node = dom.createText(match);\n } else if (match instanceof jQuery) {\n node = match[0];\n } else if (match instanceof Node) {\n node = match;\n }\n\n if (!node) return;\n self.lastWord.insertNode(node);\n self.lastWord = null;\n self.context.invoke('editor.focus');\n }\n });\n }\n\n handleKeydown(e) {\n // this forces it to remember the last whole word, even if multiple termination keys are pressed\n // before the previous key is let go.\n if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n this.previousKeydownCode = e.keyCode;\n return;\n }\n\n if (lists.contains(this.keys, e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWord = wordRange;\n }\n this.previousKeydownCode = e.keyCode;\n }\n\n handleKeyup(e) {\n if (lists.contains(this.keys, e.keyCode)) {\n this.replace();\n }\n }\n}\n","import $ from 'jquery';\nexport default class Placeholder {\n constructor(context) {\n this.context = context;\n\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n\n if (this.options.inheritPlaceholder === true) {\n // get placeholder value from the original element\n this.options.placeholder = this.context.$note.attr('placeholder') || this.options.placeholder;\n }\n\n this.events = {\n 'summernote.init summernote.change': () => {\n this.update();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.placeholder;\n }\n\n initialize() {\n this.$placeholder = $('<div class=\"note-placeholder\">');\n this.$placeholder.on('click', () => {\n this.context.invoke('focus');\n }).html(this.options.placeholder).prependTo(this.$editingArea);\n\n this.update();\n }\n\n destroy() {\n this.$placeholder.remove();\n }\n\n update() {\n const isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n this.$placeholder.toggle(isShow);\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport env from '../core/env';\n\nexport default class Buttons {\n constructor(context) {\n this.ui = $.summernote.ui;\n this.context = context;\n this.$toolbar = context.layoutInfo.toolbar;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.invertedKeyMap = func.invertObject(\n this.options.keyMap[env.isMac ? 'mac' : 'pc']\n );\n }\n\n representShortcut(editorMethod) {\n let shortcut = this.invertedKeyMap[editorMethod];\n if (!this.options.shortcuts || !shortcut) {\n return '';\n }\n\n if (env.isMac) {\n shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n }\n\n shortcut = shortcut.replace('BACKSLASH', '\\\\')\n .replace('SLASH', '/')\n .replace('LEFTBRACKET', '[')\n .replace('RIGHTBRACKET', ']');\n\n return ' (' + shortcut + ')';\n }\n\n button(o) {\n if (!this.options.tooltip && o.tooltip) {\n delete o.tooltip;\n }\n o.container = this.options.container;\n return this.ui.button(o);\n }\n\n initialize() {\n this.addToolbarButtons();\n this.addImagePopoverButtons();\n this.addLinkPopoverButtons();\n this.addTablePopoverButtons();\n this.fontInstalledMap = {};\n }\n\n destroy() {\n delete this.fontInstalledMap;\n }\n\n isFontInstalled(name) {\n if (!Object.prototype.hasOwnProperty.call(this.fontInstalledMap, name)) {\n this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n lists.contains(this.options.fontNamesIgnoreCheck, name);\n }\n return this.fontInstalledMap[name];\n }\n\n isFontDeservedToAdd(name) {\n name = name.toLowerCase();\n return (name !== '' && this.isFontInstalled(name) && env.genericFontFamilies.indexOf(name) === -1);\n }\n\n colorPalette(className, tooltip, backColor, foreColor) {\n return this.ui.buttonGroup({\n className: 'note-color ' + className,\n children: [\n this.button({\n className: 'note-current-color-button',\n contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n tooltip: tooltip,\n click: (e) => {\n const $button = $(e.currentTarget);\n if (backColor && foreColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n foreColor: $button.attr('data-foreColor'),\n });\n } else if (backColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n });\n } else if (foreColor) {\n this.context.invoke('editor.color', {\n foreColor: $button.attr('data-foreColor'),\n });\n }\n },\n callback: ($button) => {\n const $recentColor = $button.find('.note-recent-color');\n if (backColor) {\n $recentColor.css('background-color', this.options.colorButton.backColor);\n $button.attr('data-backColor', this.options.colorButton.backColor);\n }\n if (foreColor) {\n $recentColor.css('color', this.options.colorButton.foreColor);\n $button.attr('data-foreColor', this.options.colorButton.foreColor);\n } else {\n $recentColor.css('color', 'transparent');\n }\n },\n }),\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('', this.options),\n tooltip: this.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n items: (backColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n this.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n '</div>',\n '<div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n '</div>',\n ].join('') : '') +\n (foreColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n this.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n '</div>', // Fix missing Div, Commented to find easily if it's wrong\n '<div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n '</div>',\n ].join('') : ''),\n callback: ($dropdown) => {\n $dropdown.find('.note-holder').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: this.options.colors,\n colorsName: this.options.colorsName,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n /* TODO: do we have to record recent custom colors within cookies? */\n var customColors = [\n ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n ];\n $dropdown.find('.note-holder-custom').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: customColors,\n colorsName: customColors,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n $dropdown.find('input[type=color]').each((idx, item) => {\n $(item).change(function() {\n const $chip = $dropdown.find('#' + $(this).data('event')).find('.note-color-btn').first();\n const color = this.value.toUpperCase();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $chip.click();\n });\n });\n },\n click: (event) => {\n event.stopPropagation();\n\n const $parent = $('.' + className).find('.note-dropdown-menu');\n const $button = $(event.target);\n const eventName = $button.data('event');\n const value = $button.attr('data-value');\n\n if (eventName === 'openPalette') {\n const $picker = $parent.find('#' + value);\n const $palette = $($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n\n // Shift palette chips\n const $chip = $palette.find('.note-color-btn').last().detach();\n\n // Set chip attributes\n const color = $picker.val();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $palette.prepend($chip);\n $picker.click();\n } else {\n if (lists.contains(['backColor', 'foreColor'], eventName)) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n }\n this.context.invoke('editor.' + eventName, value);\n }\n },\n }),\n ],\n }).render();\n }\n\n addToolbarButtons() {\n this.context.memo('button.style', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n this.ui.icon(this.options.icons.magic), this.options\n ),\n tooltip: this.lang.style.style,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n className: 'dropdown-style',\n items: this.options.styleTags,\n title: this.lang.style.style,\n template: (item) => {\n // TBD: need to be simplified\n if (typeof item === 'string') {\n item = {\n tag: item,\n title: (Object.prototype.hasOwnProperty.call(this.lang.style, item) ? this.lang.style[item] : item),\n };\n }\n\n const tag = item.tag;\n const title = item.title;\n const style = item.style ? ' style=\"' + item.style + '\" ' : '';\n const className = item.className ? ' class=\"' + item.className + '\"' : '';\n\n return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n },\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }),\n ]).render();\n });\n\n for (let styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n const item = this.options.styleTags[styleIdx];\n\n this.context.memo('button.style.' + item, () => {\n return this.button({\n className: 'note-btn-style-' + item,\n contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n tooltip: this.lang.style[item],\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }).render();\n });\n }\n\n this.context.memo('button.bold', () => {\n return this.button({\n className: 'note-btn-bold',\n contents: this.ui.icon(this.options.icons.bold),\n tooltip: this.lang.font.bold + this.representShortcut('bold'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.bold'),\n }).render();\n });\n\n this.context.memo('button.italic', () => {\n return this.button({\n className: 'note-btn-italic',\n contents: this.ui.icon(this.options.icons.italic),\n tooltip: this.lang.font.italic + this.representShortcut('italic'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.italic'),\n }).render();\n });\n\n this.context.memo('button.underline', () => {\n return this.button({\n className: 'note-btn-underline',\n contents: this.ui.icon(this.options.icons.underline),\n tooltip: this.lang.font.underline + this.representShortcut('underline'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.underline'),\n }).render();\n });\n\n this.context.memo('button.clear', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.eraser),\n tooltip: this.lang.font.clear + this.representShortcut('removeFormat'),\n click: this.context.createInvokeHandler('editor.removeFormat'),\n }).render();\n });\n\n this.context.memo('button.strikethrough', () => {\n return this.button({\n className: 'note-btn-strikethrough',\n contents: this.ui.icon(this.options.icons.strikethrough),\n tooltip: this.lang.font.strikethrough + this.representShortcut('strikethrough'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.strikethrough'),\n }).render();\n });\n\n this.context.memo('button.superscript', () => {\n return this.button({\n className: 'note-btn-superscript',\n contents: this.ui.icon(this.options.icons.superscript),\n tooltip: this.lang.font.superscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.superscript'),\n }).render();\n });\n\n this.context.memo('button.subscript', () => {\n return this.button({\n className: 'note-btn-subscript',\n contents: this.ui.icon(this.options.icons.subscript),\n tooltip: this.lang.font.subscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.subscript'),\n }).render();\n });\n\n this.context.memo('button.fontname', () => {\n const styleInfo = this.context.invoke('editor.currentStyle');\n\n if (this.options.addDefaultFonts) {\n // Add 'default' fonts into the fontnames array if not exist\n $.each(styleInfo['font-family'].split(','), (idx, fontname) => {\n fontname = fontname.trim().replace(/['\"]+/g, '');\n if (this.isFontDeservedToAdd(fontname)) {\n if (this.options.fontNames.indexOf(fontname) === -1) {\n this.options.fontNames.push(fontname);\n }\n }\n });\n }\n\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n '<span class=\"note-current-fontname\"/>', this.options\n ),\n tooltip: this.lang.font.name,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontname',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontNames.filter(this.isFontInstalled.bind(this)),\n title: this.lang.font.name,\n template: (item) => {\n return '<span style=\"font-family: ' + env.validFontName(item) + '\">' + item + '</span>';\n },\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontName'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsize', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', this.options),\n tooltip: this.lang.font.size,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsize',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizes,\n title: this.lang.font.size,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSize'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsizeunit', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsizeunit\"/>', this.options),\n tooltip: this.lang.font.sizeunit,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsizeunit',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizeUnits,\n title: this.lang.font.sizeunit,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSizeUnit'),\n }),\n ]).render();\n });\n\n this.context.memo('button.color', () => {\n return this.colorPalette('note-color-all', this.lang.color.recent, true, true);\n });\n\n this.context.memo('button.forecolor', () => {\n return this.colorPalette('note-color-fore', this.lang.color.foreground, false, true);\n });\n\n this.context.memo('button.backcolor', () => {\n return this.colorPalette('note-color-back', this.lang.color.background, true, false);\n });\n\n this.context.memo('button.ul', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unorderedlist),\n tooltip: this.lang.lists.unordered + this.representShortcut('insertUnorderedList'),\n click: this.context.createInvokeHandler('editor.insertUnorderedList'),\n }).render();\n });\n\n this.context.memo('button.ol', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.orderedlist),\n tooltip: this.lang.lists.ordered + this.representShortcut('insertOrderedList'),\n click: this.context.createInvokeHandler('editor.insertOrderedList'),\n }).render();\n });\n\n const justifyLeft = this.button({\n contents: this.ui.icon(this.options.icons.alignLeft),\n tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n click: this.context.createInvokeHandler('editor.justifyLeft'),\n });\n\n const justifyCenter = this.button({\n contents: this.ui.icon(this.options.icons.alignCenter),\n tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n click: this.context.createInvokeHandler('editor.justifyCenter'),\n });\n\n const justifyRight = this.button({\n contents: this.ui.icon(this.options.icons.alignRight),\n tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n click: this.context.createInvokeHandler('editor.justifyRight'),\n });\n\n const justifyFull = this.button({\n contents: this.ui.icon(this.options.icons.alignJustify),\n tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n click: this.context.createInvokeHandler('editor.justifyFull'),\n });\n\n const outdent = this.button({\n contents: this.ui.icon(this.options.icons.outdent),\n tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n click: this.context.createInvokeHandler('editor.outdent'),\n });\n\n const indent = this.button({\n contents: this.ui.icon(this.options.icons.indent),\n tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n click: this.context.createInvokeHandler('editor.indent'),\n });\n\n this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n this.context.memo('button.indent', func.invoke(indent, 'render'));\n\n this.context.memo('button.paragraph', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft), this.options),\n tooltip: this.lang.paragraph.paragraph,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown([\n this.ui.buttonGroup({\n className: 'note-align',\n children: [justifyLeft, justifyCenter, justifyRight, justifyFull],\n }),\n this.ui.buttonGroup({\n className: 'note-list',\n children: [outdent, indent],\n }),\n ]),\n ]).render();\n });\n\n this.context.memo('button.height', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight), this.options),\n tooltip: this.lang.font.height,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n items: this.options.lineHeights,\n checkClassName: this.options.icons.menuCheck,\n className: 'dropdown-line-height',\n title: this.lang.font.height,\n click: this.context.createInvokeHandler('editor.lineHeight'),\n }),\n ]).render();\n });\n\n this.context.memo('button.table', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table), this.options),\n tooltip: this.lang.table.table,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n title: this.lang.table.table,\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: ($node) => {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: this.options.insertTableMaxSize.col + 'em',\n height: this.options.insertTableMaxSize.row + 'em',\n }).mousedown(this.context.createInvokeHandler('editor.insertTable'))\n .on('mousemove', this.tableMoveHandler.bind(this));\n },\n }).render();\n });\n\n this.context.memo('button.link', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.link + this.representShortcut('linkDialog.show'),\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.picture', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.picture),\n tooltip: this.lang.image.image,\n click: this.context.createInvokeHandler('imageDialog.show'),\n }).render();\n });\n\n this.context.memo('button.video', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.video),\n tooltip: this.lang.video.video,\n click: this.context.createInvokeHandler('videoDialog.show'),\n }).render();\n });\n\n this.context.memo('button.hr', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.minus),\n tooltip: this.lang.hr.insert + this.representShortcut('insertHorizontalRule'),\n click: this.context.createInvokeHandler('editor.insertHorizontalRule'),\n }).render();\n });\n\n this.context.memo('button.fullscreen', () => {\n return this.button({\n className: 'btn-fullscreen',\n contents: this.ui.icon(this.options.icons.arrowsAlt),\n tooltip: this.lang.options.fullscreen,\n click: this.context.createInvokeHandler('fullscreen.toggle'),\n }).render();\n });\n\n this.context.memo('button.codeview', () => {\n return this.button({\n className: 'btn-codeview',\n contents: this.ui.icon(this.options.icons.code),\n tooltip: this.lang.options.codeview,\n click: this.context.createInvokeHandler('codeview.toggle'),\n }).render();\n });\n\n this.context.memo('button.redo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.redo),\n tooltip: this.lang.history.redo + this.representShortcut('redo'),\n click: this.context.createInvokeHandler('editor.redo'),\n }).render();\n });\n\n this.context.memo('button.undo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.undo),\n tooltip: this.lang.history.undo + this.representShortcut('undo'),\n click: this.context.createInvokeHandler('editor.undo'),\n }).render();\n });\n\n this.context.memo('button.help', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.question),\n tooltip: this.lang.options.help,\n click: this.context.createInvokeHandler('helpDialog.show'),\n }).render();\n });\n }\n\n /**\n * image: [\n * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n * ['float', ['floatLeft', 'floatRight', 'floatNone']],\n * ['remove', ['removeMedia']],\n * ],\n */\n addImagePopoverButtons() {\n // Image Size Buttons\n this.context.memo('button.resizeFull', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">100%</span>',\n tooltip: this.lang.image.resizeFull,\n click: this.context.createInvokeHandler('editor.resize', '1'),\n }).render();\n });\n this.context.memo('button.resizeHalf', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">50%</span>',\n tooltip: this.lang.image.resizeHalf,\n click: this.context.createInvokeHandler('editor.resize', '0.5'),\n }).render();\n });\n this.context.memo('button.resizeQuarter', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">25%</span>',\n tooltip: this.lang.image.resizeQuarter,\n click: this.context.createInvokeHandler('editor.resize', '0.25'),\n }).render();\n });\n this.context.memo('button.resizeNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.resizeNone,\n click: this.context.createInvokeHandler('editor.resize', '0'),\n }).render();\n });\n\n // Float Buttons\n this.context.memo('button.floatLeft', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatLeft),\n tooltip: this.lang.image.floatLeft,\n click: this.context.createInvokeHandler('editor.floatMe', 'left'),\n }).render();\n });\n\n this.context.memo('button.floatRight', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatRight),\n tooltip: this.lang.image.floatRight,\n click: this.context.createInvokeHandler('editor.floatMe', 'right'),\n }).render();\n });\n\n this.context.memo('button.floatNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.floatNone,\n click: this.context.createInvokeHandler('editor.floatMe', 'none'),\n }).render();\n });\n\n // Remove Buttons\n this.context.memo('button.removeMedia', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.image.remove,\n click: this.context.createInvokeHandler('editor.removeMedia'),\n }).render();\n });\n }\n\n addLinkPopoverButtons() {\n this.context.memo('button.linkDialogShow', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.edit,\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.unlink', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unlink),\n tooltip: this.lang.link.unlink,\n click: this.context.createInvokeHandler('editor.unlink'),\n }).render();\n });\n }\n\n /**\n * table : [\n * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n * ],\n */\n addTablePopoverButtons() {\n this.context.memo('button.addRowUp', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowAbove),\n tooltip: this.lang.table.addRowAbove,\n click: this.context.createInvokeHandler('editor.addRow', 'top'),\n }).render();\n });\n this.context.memo('button.addRowDown', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowBelow),\n tooltip: this.lang.table.addRowBelow,\n click: this.context.createInvokeHandler('editor.addRow', 'bottom'),\n }).render();\n });\n this.context.memo('button.addColLeft', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colBefore),\n tooltip: this.lang.table.addColLeft,\n click: this.context.createInvokeHandler('editor.addCol', 'left'),\n }).render();\n });\n this.context.memo('button.addColRight', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colAfter),\n tooltip: this.lang.table.addColRight,\n click: this.context.createInvokeHandler('editor.addCol', 'right'),\n }).render();\n });\n this.context.memo('button.deleteRow', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowRemove),\n tooltip: this.lang.table.delRow,\n click: this.context.createInvokeHandler('editor.deleteRow'),\n }).render();\n });\n this.context.memo('button.deleteCol', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colRemove),\n tooltip: this.lang.table.delCol,\n click: this.context.createInvokeHandler('editor.deleteCol'),\n }).render();\n });\n this.context.memo('button.deleteTable', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.table.delTable,\n click: this.context.createInvokeHandler('editor.deleteTable'),\n }).render();\n });\n }\n\n build($container, groups) {\n for (let groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n const group = groups[groupIdx];\n const groupName = Array.isArray(group) ? group[0] : group;\n const buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n\n const $group = this.ui.buttonGroup({\n className: 'note-' + groupName,\n }).render();\n\n for (let idx = 0, len = buttons.length; idx < len; idx++) {\n const btn = this.context.memo('button.' + buttons[idx]);\n if (btn) {\n $group.append(typeof btn === 'function' ? btn(this.context) : btn);\n }\n }\n $group.appendTo($container);\n }\n }\n\n /**\n * @param {jQuery} [$container]\n */\n updateCurrentStyle($container) {\n const $cont = $container || this.$toolbar;\n\n const styleInfo = this.context.invoke('editor.currentStyle');\n this.updateBtnStates($cont, {\n '.note-btn-bold': () => {\n return styleInfo['font-bold'] === 'bold';\n },\n '.note-btn-italic': () => {\n return styleInfo['font-italic'] === 'italic';\n },\n '.note-btn-underline': () => {\n return styleInfo['font-underline'] === 'underline';\n },\n '.note-btn-subscript': () => {\n return styleInfo['font-subscript'] === 'subscript';\n },\n '.note-btn-superscript': () => {\n return styleInfo['font-superscript'] === 'superscript';\n },\n '.note-btn-strikethrough': () => {\n return styleInfo['font-strikethrough'] === 'strikethrough';\n },\n });\n\n if (styleInfo['font-family']) {\n const fontNames = styleInfo['font-family'].split(',').map((name) => {\n return name.replace(/[\\'\\\"]/g, '')\n .replace(/\\s+$/, '')\n .replace(/^\\s+/, '');\n });\n const fontName = lists.find(fontNames, this.isFontInstalled.bind(this));\n\n $cont.find('.dropdown-fontname a').each((idx, item) => {\n const $item = $(item);\n // always compare string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontName + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontname').text(fontName).css('font-family', fontName);\n }\n\n if (styleInfo['font-size']) {\n const fontSize = styleInfo['font-size'];\n $cont.find('.dropdown-fontsize a').each((idx, item) => {\n const $item = $(item);\n // always compare with string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontSize + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsize').text(fontSize);\n\n const fontSizeUnit = styleInfo['font-size-unit'];\n $cont.find('.dropdown-fontsizeunit a').each((idx, item) => {\n const $item = $(item);\n const isChecked = ($item.data('value') + '') === (fontSizeUnit + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsizeunit').text(fontSizeUnit);\n }\n\n if (styleInfo['line-height']) {\n const lineHeight = styleInfo['line-height'];\n $cont.find('.dropdown-line-height li a').each((idx, item) => {\n // always compare with string to avoid creating another func.\n const isChecked = ($(item).data('value') + '') === (lineHeight + '');\n this.className = isChecked ? 'checked' : '';\n });\n }\n }\n\n updateBtnStates($container, infos) {\n $.each(infos, (selector, pred) => {\n this.ui.toggleBtnActive($container.find(selector), pred());\n });\n }\n\n tableMoveHandler(event) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n }\n}\n","import $ from 'jquery';\nexport default class Toolbar {\n constructor(context) {\n this.context = context;\n\n this.$window = $(window);\n this.$document = $(document);\n\n this.ui = $.summernote.ui;\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$statusbar = context.layoutInfo.statusbar;\n this.options = context.options;\n\n this.isFollowing = false;\n this.followScroll = this.followScroll.bind(this);\n }\n\n shouldInitialize() {\n return !this.options.airMode;\n }\n\n initialize() {\n this.options.toolbar = this.options.toolbar || [];\n\n if (!this.options.toolbar.length) {\n this.$toolbar.hide();\n } else {\n this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n }\n\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n\n this.changeContainer(false);\n\n this.$note.on('summernote.keyup summernote.mouseup summernote.change', () => {\n this.context.invoke('buttons.updateCurrentStyle');\n });\n\n this.context.invoke('buttons.updateCurrentStyle');\n if (this.options.followingToolbar) {\n this.$window.on('scroll resize', this.followScroll);\n }\n }\n\n destroy() {\n this.$toolbar.children().remove();\n\n if (this.options.followingToolbar) {\n this.$window.off('scroll resize', this.followScroll);\n }\n }\n\n followScroll() {\n if (this.$editor.hasClass('fullscreen')) {\n return false;\n }\n\n const editorHeight = this.$editor.outerHeight();\n const editorWidth = this.$editor.width();\n const toolbarHeight = this.$toolbar.height();\n const statusbarHeight = this.$statusbar.height();\n\n // check if the web app is currently using another static bar\n let otherBarHeight = 0;\n if (this.options.otherStaticBar) {\n otherBarHeight = $(this.options.otherStaticBar).outerHeight();\n }\n\n const currentOffset = this.$document.scrollTop();\n const editorOffsetTop = this.$editor.offset().top;\n const editorOffsetBottom = editorOffsetTop + editorHeight;\n const activateOffset = editorOffsetTop - otherBarHeight;\n const deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n\n if (!this.isFollowing &&\n (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n this.isFollowing = true;\n this.$editable.css({\n marginTop: this.$toolbar.outerHeight(),\n });\n this.$toolbar.css({\n position: 'fixed',\n top: otherBarHeight,\n width: editorWidth,\n zIndex: 1000,\n });\n } else if (this.isFollowing &&\n ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n this.isFollowing = false;\n this.$toolbar.css({\n position: 'relative',\n top: 0,\n width: '100%',\n zIndex: 'auto',\n });\n this.$editable.css({\n marginTop: '',\n });\n }\n }\n\n changeContainer(isFullscreen) {\n if (isFullscreen) {\n this.$toolbar.prependTo(this.$editor);\n } else {\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n }\n if (this.options.followingToolbar) {\n this.followScroll();\n }\n }\n\n updateFullscreen(isFullscreen) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n\n this.changeContainer(isFullscreen);\n }\n\n updateCodeview(isCodeview) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n if (isCodeview) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n activate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, true);\n }\n\n deactivate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, false);\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\n\nexport default class LinkDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-txt-${this.options.id}\" class=\"note-form-label\">${this.lang.link.textToDisplay}</label>`,\n `<input id=\"note-dialog-link-txt-${this.options.id}\" class=\"note-link-text form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-url-${this.options.id}\" class=\"note-form-label\">${this.lang.link.url}</label>`,\n `<input id=\"note-dialog-link-url-${this.options.id}\" class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\"/>`,\n '</div>',\n !this.options.disableLinkTarget\n ? $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-open-in-new-window',\n text: this.lang.link.openInNewWindow,\n checked: true,\n }).render()).html()\n : '',\n $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-use-protocol',\n text: this.lang.link.useProtocol,\n checked: true,\n }).render()).html(),\n ].join('');\n\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.link.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n className: 'link-dialog',\n title: this.lang.link.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n /**\n * toggle update button\n */\n toggleLinkBtn($linkBtn, $linkText, $linkUrl) {\n this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n }\n\n /**\n * Show link dialog and set event handlers on dialog controls.\n *\n * @param {Object} linkInfo\n * @return {Promise}\n */\n showLinkDialog(linkInfo) {\n return $.Deferred((deferred) => {\n const $linkText = this.$dialog.find('.note-link-text');\n const $linkUrl = this.$dialog.find('.note-link-url');\n const $linkBtn = this.$dialog.find('.note-link-btn');\n const $openInNewWindow = this.$dialog\n .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n const $useProtocol = this.$dialog\n .find('.sn-checkbox-use-protocol input[type=checkbox]');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // If no url was given and given text is valid URL then copy that into URL Field\n if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n linkInfo.url = linkInfo.text;\n }\n\n $linkText.on('input paste propertychange', () => {\n // If linktext was modified by input events,\n // cloning text from linkUrl will be stopped.\n linkInfo.text = $linkText.val();\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.text);\n\n $linkUrl.on('input paste propertychange', () => {\n // Display same text on `Text to display` as default\n // when linktext has no text\n if (!linkInfo.text) {\n $linkText.val($linkUrl.val());\n }\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.url);\n\n if (!env.isSupportTouch) {\n $linkUrl.trigger('focus');\n }\n\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n this.bindEnterKey($linkUrl, $linkBtn);\n this.bindEnterKey($linkText, $linkBtn);\n\n const isNewWindowChecked = linkInfo.isNewWindow !== undefined\n ? linkInfo.isNewWindow : this.context.options.linkTargetBlank;\n\n $openInNewWindow.prop('checked', isNewWindowChecked);\n\n const useProtocolChecked = linkInfo.url\n ? false : this.context.options.useProtocol;\n\n $useProtocol.prop('checked', useProtocolChecked);\n\n $linkBtn.one('click', (event) => {\n event.preventDefault();\n\n deferred.resolve({\n range: linkInfo.range,\n url: $linkUrl.val(),\n text: $linkText.val(),\n isNewWindow: $openInNewWindow.is(':checked'),\n checkProtocol: $useProtocol.is(':checked'),\n });\n this.ui.hideDialog(this.$dialog);\n });\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n // detach events\n $linkText.off();\n $linkUrl.off();\n $linkBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n /**\n * @param {Object} layoutInfo\n */\n show() {\n const linkInfo = this.context.invoke('editor.getLinkInfo');\n\n this.context.invoke('editor.saveRange');\n this.showLinkDialog(linkInfo).then((linkInfo) => {\n this.context.invoke('editor.restoreRange');\n this.context.invoke('editor.createLink', linkInfo);\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class LinkPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': () => {\n this.update();\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.link);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-link-popover',\n callback: ($node) => {\n const $content = $node.find('.popover-content,.note-popover-content');\n $content.prepend('<span><a target=\"_blank\"></a> </span>');\n },\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.link);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update() {\n // Prevent focusing on editable when invoke('code') is executed\n if (!this.context.invoke('editor.hasFocus')) {\n this.hide();\n return;\n }\n\n const rng = this.context.invoke('editor.getLastRange');\n if (rng.isCollapsed() && rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n const href = $(anchor).attr('href');\n this.$popover.find('a').attr('href', href).text(href);\n\n const pos = dom.posFromPlaceholder(anchor);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class ImageDialog {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n let imageLimitation = '';\n if (this.options.maximumImageFileSize) {\n const unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n const readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n ' ' + ' KMGTP'[unit] + 'B';\n imageLimitation = `<small>${this.lang.image.maximumFileSize + ' : ' + readableSize}</small>`;\n }\n\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group note-group-select-from-files\">',\n '<label for=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n '<input id=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-image-input form-control-file note-form-control note-input\" ',\n ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>',\n imageLimitation,\n '</div>',\n '<div class=\"form-group note-group-image-url\">',\n '<label for=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.url + '</label>',\n '<input id=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-image-url form-control note-form-control note-input\" type=\"text\"/>',\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.image.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.image.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showImageDialog().then((data) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n if (typeof data === 'string') { // image url\n // If onImageLinkInsert set,\n if (this.options.callbacks.onImageLinkInsert) {\n this.context.triggerEvent('image.link.insert', data);\n } else {\n this.context.invoke('editor.insertImage', data);\n }\n } else { // array of files\n this.context.invoke('editor.insertImagesOrCallback', data);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show image dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showImageDialog() {\n return $.Deferred((deferred) => {\n const $imageInput = this.$dialog.find('.note-image-input');\n const $imageUrl = this.$dialog.find('.note-image-url');\n const $imageBtn = this.$dialog.find('.note-image-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // Cloning imageInput to clear element.\n $imageInput.replaceWith($imageInput.clone().on('change', (event) => {\n deferred.resolve(event.target.files || event.target.value);\n }).val(''));\n\n $imageUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($imageBtn, $imageUrl.val());\n }).val('');\n\n if (!env.isSupportTouch) {\n $imageUrl.trigger('focus');\n }\n\n $imageBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($imageUrl.val());\n });\n\n this.bindEnterKey($imageUrl, $imageBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $imageInput.off();\n $imageUrl.off();\n $imageBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\n/**\n * Image popover module\n * mouse events that show/hide popover will be handled by Handle.js.\n * Handle.js will receive the events and invoke 'imagePopover.update'.\n */\nexport default class ImagePopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n\n this.editable = context.layoutInfo.editable[0];\n this.options = context.options;\n\n this.events = {\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.image);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-image-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n this.context.invoke('buttons.build', $content, this.options.popover.image);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target, event) {\n if (dom.isImg(target)) {\n const position = $(target).offset();\n const containerOffset = $(this.options.container).offset();\n let pos = {};\n if (this.options.popatmouse) {\n pos.left = event.pageX - 20;\n pos.top = event.pageY;\n } else {\n pos = position;\n }\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class TablePopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.mousedown': (we, e) => {\n this.update(e.target);\n },\n 'summernote.keyup summernote.scroll summernote.change': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.table);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-table-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.table);\n\n // [workaround] Disable Firefox's default table editor\n if (env.isFF) {\n document.execCommand('enableInlineTableEditing', false, false);\n }\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isCell = dom.isCell(target);\n\n if (isCell) {\n const pos = dom.posFromPlaceholder(target);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n\n return isCell;\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class VideoDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group row-fluid\">',\n `<label for=\"note-dialog-video-url-${this.options.id}\" class=\"note-form-label\">${this.lang.video.url} <small class=\"text-muted\">${this.lang.video.providers}</small></label>`,\n `<input id=\"note-dialog-video-url-${this.options.id}\" class=\"note-video-url form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.video.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.video.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n createVideoNode(url) {\n // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n const ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n const ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n const ytMatch = url.match(ytRegExp);\n\n const igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n const igMatch = url.match(igRegExp);\n\n const vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n const vMatch = url.match(vRegExp);\n\n const vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n const vimMatch = url.match(vimRegExp);\n\n const dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n const dmMatch = url.match(dmRegExp);\n\n const youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n const youkuMatch = url.match(youkuRegExp);\n\n const qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n const qqMatch = url.match(qqRegExp);\n\n const qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n const qqMatch2 = url.match(qqRegExp2);\n\n const mp4RegExp = /^.+.(mp4|m4v)$/;\n const mp4Match = url.match(mp4RegExp);\n\n const oggRegExp = /^.+.(ogg|ogv)$/;\n const oggMatch = url.match(oggRegExp);\n\n const webmRegExp = /^.+.(webm)$/;\n const webmMatch = url.match(webmRegExp);\n\n const fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n const fbMatch = url.match(fbRegExp);\n\n let $video;\n if (ytMatch && ytMatch[1].length === 11) {\n const youtubeId = ytMatch[1];\n var start = 0;\n if (typeof ytMatch[2] !== 'undefined') {\n const ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n if (ytMatchForStart) {\n for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n }\n }\n }\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n .attr('width', '640').attr('height', '360');\n } else if (igMatch && igMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n .attr('width', '612').attr('height', '710')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else if (vMatch && vMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', vMatch[0] + '/embed/simple')\n .attr('width', '600').attr('height', '600')\n .attr('class', 'vine-embed');\n } else if (vimMatch && vimMatch[3].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n .attr('width', '640').attr('height', '360');\n } else if (dmMatch && dmMatch[2].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n .attr('width', '640').attr('height', '360');\n } else if (youkuMatch && youkuMatch[1].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '498')\n .attr('width', '510')\n .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n const vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '310')\n .attr('width', '500')\n .attr('src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');\n } else if (mp4Match || oggMatch || webmMatch) {\n $video = $('<video controls>')\n .attr('src', url)\n .attr('width', '640').attr('height', '360');\n } else if (fbMatch && fbMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n .attr('width', '560').attr('height', '301')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else {\n // this is not a known video link. Now what, Cat? Now what?\n return false;\n }\n\n $video.addClass('note-video-clip');\n\n return $video[0];\n }\n\n show() {\n const text = this.context.invoke('editor.getSelectedText');\n this.context.invoke('editor.saveRange');\n this.showVideoDialog(text).then((url) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n // build node\n const $node = this.createVideoNode(url);\n\n if ($node) {\n // insert video node\n this.context.invoke('editor.insertNode', $node);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show video dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showVideoDialog(/* text */) {\n return $.Deferred((deferred) => {\n const $videoUrl = this.$dialog.find('.note-video-url');\n const $videoBtn = this.$dialog.find('.note-video-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n $videoUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($videoBtn, $videoUrl.val());\n });\n\n if (!env.isSupportTouch) {\n $videoUrl.trigger('focus');\n }\n\n $videoBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($videoUrl.val());\n });\n\n this.bindEnterKey($videoUrl, $videoBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $videoUrl.off();\n $videoBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\n\nexport default class HelpDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<p class=\"text-center\">',\n '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote @@VERSION@@</a> · ',\n '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n '</p>',\n ].join('');\n\n this.$dialog = this.ui.dialog({\n title: this.lang.options.help,\n fade: this.options.dialogsFade,\n body: this.createShortcutList(),\n footer: body,\n callback: ($node) => {\n $node.find('.modal-body,.note-modal-body').css({\n 'max-height': 300,\n 'overflow': 'scroll',\n });\n },\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n createShortcutList() {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n return Object.keys(keyMap).map((key) => {\n const command = keyMap[key];\n const $row = $('<div><div class=\"help-list-item\"/></div>');\n $row.append($('<label><kbd>' + key + '</kdb></label>').css({\n 'width': 180,\n 'margin-right': 10,\n })).append($('<span/>').html(this.context.memo('help.' + command) || command));\n return $row.html();\n }).join('');\n }\n\n /**\n * show help dialog\n *\n * @return {Promise}\n */\n showHelpDialog() {\n return $.Deferred((deferred) => {\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n deferred.resolve();\n });\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showHelpDialog().then(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\n\nconst AIRMODE_POPOVER_X_OFFSET = -5;\nconst AIRMODE_POPOVER_Y_OFFSET = 5;\n\nexport default class AirPopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.options = context.options;\n\n this.hidable = true;\n this.onContextmenu = false;\n this.pageX = null;\n this.pageY = null;\n\n this.events = {\n 'summernote.contextmenu': (e) => {\n if (this.options.editing) {\n e.preventDefault();\n e.stopPropagation();\n this.onContextmenu = true;\n this.update(true);\n }\n },\n 'summernote.mousedown': (we, e) => {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n },\n 'summernote.keyup summernote.mouseup summernote.scroll': (we, e) => {\n if (this.options.editing && !this.onContextmenu) {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n this.update();\n }\n this.onContextmenu = false;\n },\n 'summernote.disable summernote.change summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n 'summernote.focusout': () => {\n if (!this.$popover.is(':active,:focus')) {\n this.hide();\n }\n },\n };\n }\n\n shouldInitialize() {\n return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-air-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.air);\n\n // disable hiding this popover preemptively by 'summernote.blur' event.\n this.$popover.on('mousedown', () => { this.hidable = false; });\n // (re-)enable hiding after 'summernote.blur' has been handled (aka. ignored).\n this.$popover.on('mouseup', () => { this.hidable = true; });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(forcelyOpen) {\n const styleInfo = this.context.invoke('editor.currentStyle');\n if (styleInfo.range && (!styleInfo.range.isCollapsed() || forcelyOpen)) {\n let rect = {\n left: this.pageX,\n top: this.pageY,\n };\n\n const containerOffset = $(this.options.container).offset();\n rect.top -= containerOffset.top;\n rect.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: Math.max(rect.left, 0) + AIRMODE_POPOVER_X_OFFSET,\n top: rect.top + AIRMODE_POPOVER_Y_OFFSET,\n });\n this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n } else {\n this.hide();\n }\n }\n\n hide() {\n if (this.hidable) {\n this.$popover.hide();\n }\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport key from '../core/key';\n\nconst POPOVER_DIST = 5;\n\nexport default class HintPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.hint = this.options.hint || [];\n this.direction = this.options.hintDirection || 'bottom';\n this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return this.hints.length > 0;\n }\n\n initialize() {\n this.lastWordRange = null;\n this.matchingWord = null;\n this.$popover = this.ui.popover({\n className: 'note-hint-popover',\n hideArrow: true,\n direction: '',\n }).render().appendTo(this.options.container);\n\n this.$popover.hide();\n this.$content = this.$popover.find('.popover-content,.note-popover-content');\n this.$content.on('click', '.note-hint-item', (e) => {\n this.$content.find('.active').removeClass('active');\n $(e.currentTarget).addClass('active');\n this.replace();\n });\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n selectItem($item) {\n this.$content.find('.active').removeClass('active');\n $item.addClass('active');\n\n this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n }\n\n moveDown() {\n const $current = this.$content.find('.note-hint-item.active');\n const $next = $current.next();\n\n if ($next.length) {\n this.selectItem($next);\n } else {\n let $nextGroup = $current.parent().next();\n\n if (!$nextGroup.length) {\n $nextGroup = this.$content.find('.note-hint-group').first();\n }\n\n this.selectItem($nextGroup.find('.note-hint-item').first());\n }\n }\n\n moveUp() {\n const $current = this.$content.find('.note-hint-item.active');\n const $prev = $current.prev();\n\n if ($prev.length) {\n this.selectItem($prev);\n } else {\n let $prevGroup = $current.parent().prev();\n\n if (!$prevGroup.length) {\n $prevGroup = this.$content.find('.note-hint-group').last();\n }\n\n this.selectItem($prevGroup.find('.note-hint-item').last());\n }\n }\n\n replace() {\n const $item = this.$content.find('.note-hint-item.active');\n\n if ($item.length) {\n var node = this.nodeFromItem($item);\n // If matchingWord length = 0 -> capture OK / open hint / but as mention capture \"\" (\\w*)\n if (this.matchingWord !== null && this.matchingWord.length === 0) {\n this.lastWordRange.so = this.lastWordRange.eo;\n // Else si > 0 and normal case -> adjust range \"before\" for correct position of insertion\n } else if (this.matchingWord !== null && this.matchingWord.length > 0 && !this.lastWordRange.isCollapsed()) {\n let rangeCompute = this.lastWordRange.eo - this.lastWordRange.so - this.matchingWord.length;\n if (rangeCompute > 0) {\n this.lastWordRange.so += rangeCompute;\n }\n }\n this.lastWordRange.insertNode(node);\n\n if (this.options.hintSelect === 'next') {\n var blank = document.createTextNode('');\n $(node).after(blank);\n range.createFromNodeBefore(blank).select();\n } else {\n range.createFromNodeAfter(node).select();\n }\n\n this.lastWordRange = null;\n this.hide();\n this.context.invoke('editor.focus');\n }\n }\n\n nodeFromItem($item) {\n const hint = this.hints[$item.data('index')];\n const item = $item.data('item');\n let node = hint.content ? hint.content(item) : item;\n if (typeof node === 'string') {\n node = dom.createText(node);\n }\n return node;\n }\n\n createItemTemplates(hintIdx, items) {\n const hint = this.hints[hintIdx];\n return items.map((item /*, idx */) => {\n const $item = $('<div class=\"note-hint-item\"/>');\n $item.append(hint.template ? hint.template(item) : item + '');\n $item.data({\n 'index': hintIdx,\n 'item': item,\n });\n return $item;\n });\n }\n\n handleKeydown(e) {\n if (!this.$popover.is(':visible')) {\n return;\n }\n\n if (e.keyCode === key.code.ENTER) {\n e.preventDefault();\n this.replace();\n } else if (e.keyCode === key.code.UP) {\n e.preventDefault();\n this.moveUp();\n } else if (e.keyCode === key.code.DOWN) {\n e.preventDefault();\n this.moveDown();\n }\n }\n\n searchKeyword(index, keyword, callback) {\n const hint = this.hints[index];\n if (hint && hint.match.test(keyword) && hint.search) {\n const matches = hint.match.exec(keyword);\n this.matchingWord = matches[0];\n hint.search(matches[1], callback);\n } else {\n callback();\n }\n }\n\n createGroup(idx, keyword) {\n const $group = $('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n this.searchKeyword(idx, keyword, (items) => {\n items = items || [];\n if (items.length) {\n $group.html(this.createItemTemplates(idx, items));\n this.show();\n }\n });\n\n return $group;\n }\n\n handleKeyup(e) {\n if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n let range = this.context.invoke('editor.getLastRange');\n let wordRange, keyword;\n if (this.options.hintMode === 'words') {\n wordRange = range.getWordsRange(range);\n keyword = wordRange.toString();\n\n this.hints.forEach((hint) => {\n if (hint.match.test(keyword)) {\n wordRange = range.getWordsMatchRange(hint.match);\n return false;\n }\n });\n\n if (!wordRange) {\n this.hide();\n return;\n }\n\n keyword = wordRange.toString();\n } else {\n wordRange = range.getWordRange();\n keyword = wordRange.toString();\n }\n\n if (this.hints.length && keyword) {\n this.$content.empty();\n\n const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n const containerOffset = $(this.options.container).offset();\n if (bnd) {\n bnd.top -= containerOffset.top;\n bnd.left -= containerOffset.left;\n\n this.$popover.hide();\n this.lastWordRange = wordRange;\n this.hints.forEach((hint, idx) => {\n if (hint.match.test(keyword)) {\n this.createGroup(idx, keyword).appendTo(this.$content);\n }\n });\n // select first .note-hint-item\n this.$content.find('.note-hint-item:first').addClass('active');\n\n // set position for popover after group is created\n if (this.direction === 'top') {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST,\n });\n } else {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top + bnd.height + POPOVER_DIST,\n });\n }\n }\n } else {\n this.hide();\n }\n }\n }\n\n show() {\n this.$popover.show();\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport './summernote-en-US';\nimport '../summernote';\nimport dom from './core/dom';\nimport range from './core/range';\nimport lists from './core/lists';\nimport Editor from './module/Editor';\nimport Clipboard from './module/Clipboard';\nimport Dropzone from './module/Dropzone';\nimport Codeview from './module/Codeview';\nimport Statusbar from './module/Statusbar';\nimport Fullscreen from './module/Fullscreen';\nimport Handle from './module/Handle';\nimport AutoLink from './module/AutoLink';\nimport AutoSync from './module/AutoSync';\nimport AutoReplace from './module/AutoReplace';\nimport Placeholder from './module/Placeholder';\nimport Buttons from './module/Buttons';\nimport Toolbar from './module/Toolbar';\nimport LinkDialog from './module/LinkDialog';\nimport LinkPopover from './module/LinkPopover';\nimport ImageDialog from './module/ImageDialog';\nimport ImagePopover from './module/ImagePopover';\nimport TablePopover from './module/TablePopover';\nimport VideoDialog from './module/VideoDialog';\nimport HelpDialog from './module/HelpDialog';\nimport AirPopover from './module/AirPopover';\nimport HintPopover from './module/HintPopover';\n\n$.summernote = $.extend($.summernote, {\n version: '@@VERSION@@',\n plugins: {},\n\n dom: dom,\n range: range,\n lists: lists,\n\n options: {\n langInfo: $.summernote.lang['en-US'],\n editing: true,\n modules: {\n 'editor': Editor,\n 'clipboard': Clipboard,\n 'dropzone': Dropzone,\n 'codeview': Codeview,\n 'statusbar': Statusbar,\n 'fullscreen': Fullscreen,\n 'handle': Handle,\n // FIXME: HintPopover must be front of autolink\n // - Script error about range when Enter key is pressed on hint popover\n 'hintPopover': HintPopover,\n 'autoLink': AutoLink,\n 'autoSync': AutoSync,\n 'autoReplace': AutoReplace,\n 'placeholder': Placeholder,\n 'buttons': Buttons,\n 'toolbar': Toolbar,\n 'linkDialog': LinkDialog,\n 'linkPopover': LinkPopover,\n 'imageDialog': ImageDialog,\n 'imagePopover': ImagePopover,\n 'tablePopover': TablePopover,\n 'videoDialog': VideoDialog,\n 'helpDialog': HelpDialog,\n 'airPopover': AirPopover,\n },\n\n buttons: {},\n\n lang: 'en-US',\n\n followingToolbar: false,\n toolbarPosition: 'top',\n otherStaticBar: '',\n\n // toolbar\n toolbar: [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['fontname', ['fontname']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']],\n ],\n\n // popover\n popatmouse: true,\n popover: {\n image: [\n ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n ['float', ['floatLeft', 'floatRight', 'floatNone']],\n ['remove', ['removeMedia']],\n ],\n link: [\n ['link', ['linkDialogShow', 'unlink']],\n ],\n table: [\n ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n ],\n air: [\n ['color', ['color']],\n ['font', ['bold', 'underline', 'clear']],\n ['para', ['ul', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture']],\n ['view', ['fullscreen', 'codeview']],\n ],\n },\n\n // air mode: inline editor\n airMode: false,\n overrideContextMenu: false, // TBD\n\n width: null,\n height: null,\n linkTargetBlank: true,\n useProtocol: true,\n defaultProtocol: 'http://',\n\n focus: false,\n tabDisabled: false,\n tabSize: 4,\n styleWithCSS: false,\n shortcuts: true,\n textareaAutoSync: true,\n tooltip: 'auto',\n container: null,\n maxTextLength: 0,\n blockquoteBreakingLevel: 2,\n spellCheck: true,\n disableGrammar: false,\n placeholder: null,\n inheritPlaceholder: false,\n // TODO: need to be documented\n recordEveryKeystroke: false,\n historyLimit: 200,\n\n // TODO: need to be documented\n hintMode: 'word',\n hintSelect: 'after',\n hintDirection: 'bottom',\n\n styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n fontNames: [\n 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n 'Tahoma', 'Times New Roman', 'Verdana',\n ],\n fontNamesIgnoreCheck: [],\n addDefaultFonts: true,\n\n fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n\n fontSizeUnits: ['px', 'pt'],\n\n // pallete colors(n x n)\n colors: [\n ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n ],\n\n // http://chir.ag/projects/name-that-color/\n colorsName: [\n ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n ],\n\n colorButton: {\n foreColor: '#000000',\n backColor: '#FFFF00',\n },\n\n lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n\n tableClassName: 'table table-bordered',\n\n insertTableMaxSize: {\n col: 10,\n row: 10,\n },\n\n // By default, dialogs are attached in container.\n dialogsInBody: false,\n dialogsFade: false,\n\n maximumImageFileSize: null,\n\n callbacks: {\n onBeforeCommand: null,\n onBlur: null,\n onBlurCodeview: null,\n onChange: null,\n onChangeCodeview: null,\n onDialogShown: null,\n onEnter: null,\n onFocus: null,\n onImageLinkInsert: null,\n onImageUpload: null,\n onImageUploadError: null,\n onInit: null,\n onKeydown: null,\n onKeyup: null,\n onMousedown: null,\n onMouseup: null,\n onPaste: null,\n onScroll: null,\n },\n\n codemirror: {\n mode: 'text/html',\n htmlMode: true,\n lineNumbers: true,\n },\n\n codeviewFilter: false,\n codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n codeviewIframeFilter: true,\n codeviewIframeWhitelistSrc: [],\n codeviewIframeWhitelistSrcBase: [\n 'www.youtube.com',\n 'www.youtube-nocookie.com',\n 'www.facebook.com',\n 'vine.co',\n 'instagram.com',\n 'player.vimeo.com',\n 'www.dailymotion.com',\n 'player.youku.com',\n 'v.qq.com',\n ],\n\n keyMap: {\n pc: {\n 'ENTER': 'insertParagraph',\n 'CTRL+Z': 'undo',\n 'CTRL+Y': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CTRL+B': 'bold',\n 'CTRL+I': 'italic',\n 'CTRL+U': 'underline',\n 'CTRL+SHIFT+S': 'strikethrough',\n 'CTRL+BACKSLASH': 'removeFormat',\n 'CTRL+SHIFT+L': 'justifyLeft',\n 'CTRL+SHIFT+E': 'justifyCenter',\n 'CTRL+SHIFT+R': 'justifyRight',\n 'CTRL+SHIFT+J': 'justifyFull',\n 'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n 'CTRL+SHIFT+NUM8': 'insertOrderedList',\n 'CTRL+LEFTBRACKET': 'outdent',\n 'CTRL+RIGHTBRACKET': 'indent',\n 'CTRL+NUM0': 'formatPara',\n 'CTRL+NUM1': 'formatH1',\n 'CTRL+NUM2': 'formatH2',\n 'CTRL+NUM3': 'formatH3',\n 'CTRL+NUM4': 'formatH4',\n 'CTRL+NUM5': 'formatH5',\n 'CTRL+NUM6': 'formatH6',\n 'CTRL+ENTER': 'insertHorizontalRule',\n 'CTRL+K': 'linkDialog.show',\n },\n\n mac: {\n 'ENTER': 'insertParagraph',\n 'CMD+Z': 'undo',\n 'CMD+SHIFT+Z': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CMD+B': 'bold',\n 'CMD+I': 'italic',\n 'CMD+U': 'underline',\n 'CMD+SHIFT+S': 'strikethrough',\n 'CMD+BACKSLASH': 'removeFormat',\n 'CMD+SHIFT+L': 'justifyLeft',\n 'CMD+SHIFT+E': 'justifyCenter',\n 'CMD+SHIFT+R': 'justifyRight',\n 'CMD+SHIFT+J': 'justifyFull',\n 'CMD+SHIFT+NUM7': 'insertUnorderedList',\n 'CMD+SHIFT+NUM8': 'insertOrderedList',\n 'CMD+LEFTBRACKET': 'outdent',\n 'CMD+RIGHTBRACKET': 'indent',\n 'CMD+NUM0': 'formatPara',\n 'CMD+NUM1': 'formatH1',\n 'CMD+NUM2': 'formatH2',\n 'CMD+NUM3': 'formatH3',\n 'CMD+NUM4': 'formatH4',\n 'CMD+NUM5': 'formatH5',\n 'CMD+NUM6': 'formatH6',\n 'CMD+ENTER': 'insertHorizontalRule',\n 'CMD+K': 'linkDialog.show',\n },\n },\n icons: {\n 'align': 'note-icon-align',\n 'alignCenter': 'note-icon-align-center',\n 'alignJustify': 'note-icon-align-justify',\n 'alignLeft': 'note-icon-align-left',\n 'alignRight': 'note-icon-align-right',\n 'rowBelow': 'note-icon-row-below',\n 'colBefore': 'note-icon-col-before',\n 'colAfter': 'note-icon-col-after',\n 'rowAbove': 'note-icon-row-above',\n 'rowRemove': 'note-icon-row-remove',\n 'colRemove': 'note-icon-col-remove',\n 'indent': 'note-icon-align-indent',\n 'outdent': 'note-icon-align-outdent',\n 'arrowsAlt': 'note-icon-arrows-alt',\n 'bold': 'note-icon-bold',\n 'caret': 'note-icon-caret',\n 'circle': 'note-icon-circle',\n 'close': 'note-icon-close',\n 'code': 'note-icon-code',\n 'eraser': 'note-icon-eraser',\n 'floatLeft': 'note-icon-float-left',\n 'floatRight': 'note-icon-float-right',\n 'font': 'note-icon-font',\n 'frame': 'note-icon-frame',\n 'italic': 'note-icon-italic',\n 'link': 'note-icon-link',\n 'unlink': 'note-icon-chain-broken',\n 'magic': 'note-icon-magic',\n 'menuCheck': 'note-icon-menu-check',\n 'minus': 'note-icon-minus',\n 'orderedlist': 'note-icon-orderedlist',\n 'pencil': 'note-icon-pencil',\n 'picture': 'note-icon-picture',\n 'question': 'note-icon-question',\n 'redo': 'note-icon-redo',\n 'rollback': 'note-icon-rollback',\n 'square': 'note-icon-square',\n 'strikethrough': 'note-icon-strikethrough',\n 'subscript': 'note-icon-subscript',\n 'superscript': 'note-icon-superscript',\n 'table': 'note-icon-table',\n 'textHeight': 'note-icon-text-height',\n 'trash': 'note-icon-trash',\n 'underline': 'note-icon-underline',\n 'undo': 'note-icon-undo',\n 'unorderedlist': 'note-icon-unorderedlist',\n 'video': 'note-icon-video',\n },\n },\n});\n","import $ from 'jquery';\n\nclass TooltipUI {\n constructor($node, options) {\n this.$node = $node;\n this.options = $.extend({}, {\n title: '',\n target: options.container,\n trigger: 'hover focus',\n placement: 'bottom',\n }, options);\n\n // create tooltip node\n this.$tooltip = $([\n '<div class=\"note-tooltip\">',\n '<div class=\"note-tooltip-arrow\"/>',\n '<div class=\"note-tooltip-content\"/>',\n '</div>',\n ].join(''));\n\n // define event\n if (this.options.trigger !== 'manual') {\n const showCallback = this.show.bind(this);\n const hideCallback = this.hide.bind(this);\n const toggleCallback = this.toggle.bind(this);\n\n this.options.trigger.split(' ').forEach(function(eventName) {\n if (eventName === 'hover') {\n $node.off('mouseenter mouseleave');\n $node.on('mouseenter', showCallback).on('mouseleave', hideCallback);\n } else if (eventName === 'click') {\n $node.on('click', toggleCallback);\n } else if (eventName === 'focus') {\n $node.on('focus', showCallback).on('blur', hideCallback);\n }\n });\n }\n }\n\n show() {\n const $node = this.$node;\n const offset = $node.offset();\n const targetOffset = $(this.options.target).offset();\n offset.top -= targetOffset.top;\n offset.left -= targetOffset.left;\n\n const $tooltip = this.$tooltip;\n const title = this.options.title || $node.attr('title') || $node.data('title');\n const placement = this.options.placement || $node.data('placement');\n\n $tooltip.addClass(placement);\n $tooltip.find('.note-tooltip-content').text(title);\n $tooltip.appendTo(this.options.target);\n\n const nodeWidth = $node.outerWidth();\n const nodeHeight = $node.outerHeight();\n const tooltipWidth = $tooltip.outerWidth();\n const tooltipHeight = $tooltip.outerHeight();\n\n if (placement === 'bottom') {\n $tooltip.css({\n top: offset.top + nodeHeight,\n left: offset.left + (nodeWidth / 2 - tooltipWidth / 2),\n });\n } else if (placement === 'top') {\n $tooltip.css({\n top: offset.top - tooltipHeight,\n left: offset.left + (nodeWidth / 2 - tooltipWidth / 2),\n });\n } else if (placement === 'left') {\n $tooltip.css({\n top: offset.top + (nodeHeight / 2 - tooltipHeight / 2),\n left: offset.left - tooltipWidth,\n });\n } else if (placement === 'right') {\n $tooltip.css({\n top: offset.top + (nodeHeight / 2 - tooltipHeight / 2),\n left: offset.left + nodeWidth,\n });\n }\n\n $tooltip.addClass('in');\n }\n\n hide() {\n this.$tooltip.removeClass('in');\n setTimeout(() => {\n this.$tooltip.remove();\n }, 200);\n }\n\n toggle() {\n if (this.$tooltip.hasClass('in')) {\n this.hide();\n } else {\n this.show();\n }\n }\n}\n\nexport default TooltipUI;\n","import $ from 'jquery';\n\nclass DropdownUI {\n constructor($node, options) {\n this.$button = $node;\n this.options = $.extend({}, {\n target: options.container,\n }, options);\n this.setEvent();\n }\n\n setEvent() {\n this.$button.on('click', (e) => {\n this.toggle();\n e.stopImmediatePropagation();\n });\n }\n\n clear() {\n var $parent = $('.note-btn-group.open');\n $parent.find('.note-btn.active').removeClass('active');\n $parent.removeClass('open');\n }\n\n show() {\n this.$button.addClass('active');\n this.$button.parent().addClass('open');\n\n var $dropdown = this.$button.next();\n var offset = $dropdown.offset();\n var width = $dropdown.outerWidth();\n var windowWidth = $(window).width();\n var targetMarginRight = parseFloat($(this.options.target).css('margin-right'));\n\n if (offset.left + width > windowWidth - targetMarginRight) {\n $dropdown.css('margin-left', windowWidth - targetMarginRight - (offset.left + width));\n } else {\n $dropdown.css('margin-left', '');\n }\n }\n\n hide() {\n this.$button.removeClass('active');\n this.$button.parent().removeClass('open');\n }\n\n toggle() {\n var isOpened = this.$button.parent().hasClass('open');\n\n this.clear();\n\n if (isOpened) {\n this.hide();\n } else {\n this.show();\n }\n }\n}\n\n$(document).on('click', function(e) {\n if (!$(e.target).closest('.note-btn-group').length) {\n $('.note-btn-group.open').removeClass('open');\n $('.note-btn-group .note-btn.active').removeClass('active');\n }\n});\n\n$(document).on('click.note-dropdown-menu', function(e) {\n $(e.target).closest('.note-dropdown-menu').parent().removeClass('open');\n $(e.target).closest('.note-dropdown-menu').parent().find('.note-btn.active').removeClass('active');\n});\n\nexport default DropdownUI;\n","import $ from 'jquery';\n\nclass ModalUI {\n constructor($node /*, options */) {\n this.$modal = $node;\n this.$backdrop = $('<div class=\"note-modal-backdrop\"/>');\n }\n\n show() {\n this.$backdrop.appendTo(document.body).show();\n this.$modal.addClass('open').show();\n this.$modal.trigger('note.modal.show');\n this.$modal.off('click', '.close').on('click', '.close', this.hide.bind(this));\n this.$modal.on('keydown', (event) => {\n if (event.which === 27) {\n event.preventDefault();\n this.hide();\n }\n });\n }\n\n hide() {\n this.$modal.removeClass('open').hide();\n this.$backdrop.hide();\n this.$modal.trigger('note.modal.hide');\n this.$modal.off('keydown');\n }\n}\n\nexport default ModalUI;\n","import $ from 'jquery';\nimport renderer from '../base/renderer';\nimport TooltipUI from './ui/TooltipUI';\nimport DropdownUI from './ui/DropdownUI';\nimport ModalUI from './ui/ModalUI';\n\nconst editor = renderer.create('<div class=\"note-editor note-frame\"/>');\nconst toolbar = renderer.create('<div class=\"note-toolbar\" role=\"toolbar\"/>');\nconst editingArea = renderer.create('<div class=\"note-editing-area\"/>');\nconst codable = renderer.create('<textarea class=\"note-codable\" aria-multiline=\"true\"/>');\nconst editable = renderer.create('<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\nconst statusbar = renderer.create([\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n '<div class=\"note-statusbar\" role=\"status\">',\n '<div class=\"note-resizebar\" aria-label=\"resize\">',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '</div>',\n '</div>',\n].join(''));\n\nconst airEditor = renderer.create('<div class=\"note-editor note-airframe\"/>');\nconst airEditable = renderer.create([\n '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n].join(''));\n\nconst buttonGroup = renderer.create('<div class=\"note-btn-group\">');\nconst button = renderer.create('<button type=\"button\" class=\"note-btn\" tabindex=\"-1\">', function($node, options) {\n // set button type\n if (options && options.tooltip) {\n $node.attr({\n 'aria-label': options.tooltip,\n });\n $node.data('_lite_tooltip', new TooltipUI($node, {\n title: options.tooltip,\n container: options.container,\n })).on('click', (e) => {\n $(e.currentTarget).data('_lite_tooltip').hide();\n });\n }\n if (options.contents) {\n $node.html(options.contents);\n }\n\n if (options && options.data && options.data.toggle === 'dropdown') {\n $node.data('_lite_dropdown', new DropdownUI($node, {\n container: options.container,\n }));\n }\n});\n\nconst dropdown = renderer.create('<div class=\"note-dropdown-menu\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n const $temp = $('<a class=\"note-dropdown-item\" href=\"#\" data-value=\"' + value + '\" role=\"listitem\" aria-label=\"' + value + '\"></a>');\n\n $temp.html(content).data('item', item);\n\n return $temp;\n }) : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n\n $node.on('click', '> .note-dropdown-item', function(e) {\n const $a = $(this);\n\n const item = $a.data('item');\n const value = $a.data('value');\n\n if (item.click) {\n item.click($a);\n } else if (options.itemClick) {\n options.itemClick(e, item, value);\n }\n });\n});\n\nconst dropdownCheck = renderer.create('<div class=\"note-dropdown-menu note-check\" role=\"list\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n\n const $temp = $('<a class=\"note-dropdown-item\" href=\"#\" data-value=\"' + value + '\" role=\"listitem\" aria-label=\"' + item + '\"></a>');\n $temp.html([icon(options.checkClassName), ' ', content]).data('item', item);\n return $temp;\n }) : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n\n $node.on('click', '> .note-dropdown-item', function(e) {\n const $a = $(this);\n\n const item = $a.data('item');\n const value = $a.data('value');\n\n if (item.click) {\n item.click($a);\n } else if (options.itemClick) {\n options.itemClick(e, item, value);\n }\n });\n});\n\nconst dropdownButtonContents = function(contents, options) {\n return contents + ' ' + icon(options.icons.caret, 'span');\n};\n\nconst dropdownButton = function(opt, callback) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown({\n className: opt.className,\n items: opt.items,\n template: opt.template,\n itemClick: opt.itemClick,\n }),\n ], { callback: callback }).render();\n};\n\nconst dropdownCheckButton = function(opt, callback) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdownCheck({\n className: opt.className,\n checkClassName: opt.checkClassName,\n items: opt.items,\n template: opt.template,\n itemClick: opt.itemClick,\n }),\n ], { callback: callback }).render();\n};\n\nconst paragraphDropdownButton = function(opt) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown([\n buttonGroup({\n className: 'note-align',\n children: opt.items[0],\n }),\n buttonGroup({\n className: 'note-list',\n children: opt.items[1],\n }),\n ]),\n ]).render();\n};\n\nconst tableMoveHandler = function(event, col, row) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n};\n\nconst tableDropdownButton = function(opt) {\n return buttonGroup([\n button({\n className: 'dropdown-toggle',\n contents: opt.title + ' ' + icon('note-icon-caret'),\n tooltip: opt.tooltip,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown({\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: function($node) {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: opt.col + 'em',\n height: opt.row + 'em',\n })\n .mousedown(opt.itemClick)\n .mousemove(function(e) {\n tableMoveHandler(e, opt.col, opt.row);\n });\n },\n }).render();\n};\n\nconst palette = renderer.create('<div class=\"note-color-palette\"/>', function($node, options) {\n const contents = [];\n for (let row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n const eventName = options.eventName;\n const colors = options.colors[row];\n const colorsName = options.colorsName[row];\n const buttons = [];\n for (let col = 0, colSize = colors.length; col < colSize; col++) {\n const color = colors[col];\n const colorName = colorsName[col];\n buttons.push([\n '<button type=\"button\" class=\"note-btn note-color-btn\"',\n 'style=\"background-color:', color, '\" ',\n 'data-event=\"', eventName, '\" ',\n 'data-value=\"', color, '\" ',\n 'data-title=\"', colorName, '\" ',\n 'aria-label=\"', colorName, '\" ',\n 'data-toggle=\"button\" tabindex=\"-1\"></button>',\n ].join(''));\n }\n contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n }\n $node.html(contents.join(''));\n\n $node.find('.note-color-btn').each(function() {\n $(this).data('_lite_tooltip', new TooltipUI($(this), {\n container: options.container,\n }));\n });\n});\n\nconst colorDropdownButton = function(opt, type) {\n return buttonGroup({\n className: 'note-color',\n children: [\n button({\n className: 'note-current-color-button',\n contents: opt.title,\n tooltip: opt.lang.color.recent,\n click: opt.currentClick,\n callback: function($button) {\n const $recentColor = $button.find('.note-recent-color');\n\n if (type !== 'foreColor') {\n $recentColor.css('background-color', '#FFFF00');\n $button.attr('data-backColor', '#FFFF00');\n }\n },\n }),\n button({\n className: 'dropdown-toggle',\n contents: icon('note-icon-caret'),\n tooltip: opt.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n dropdown({\n items: [\n '<div>',\n '<div class=\"note-btn-group btn-background-color\">',\n '<div class=\"note-palette-title\">' + opt.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset note-btn note-btn-block\" data-event=\"backColor\" data-value=\"inherit\">',\n opt.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div class=\"btn-sm\">',\n '<input type=\"color\" id=\"html5bcp\" class=\"note-btn btn-default\" value=\"#21104A\" style=\"width:100%;\" data-value=\"cp\">',\n '<button type=\"button\" class=\"note-color-reset btn\" data-event=\"backColor\" data-value=\"cpbackColor\">',\n opt.lang.color.cpSelect,\n '</button>',\n '</div>',\n '</div>',\n '<div class=\"note-btn-group btn-foreground-color\">',\n '<div class=\"note-palette-title\">' + opt.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset note-btn note-btn-block\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n opt.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div class=\"btn-sm\">',\n '<input type=\"color\" id=\"html5fcp\" class=\"note-btn btn-default\" value=\"#21104A\" style=\"width:100%;\" data-value=\"cp\">',\n '<button type=\"button\" class=\"note-color-reset btn\" data-event=\"foreColor\" data-value=\"cpforeColor\">',\n opt.lang.color.cpSelect,\n '</button>',\n '</div>',\n '</div>',\n '</div>',\n ].join(''),\n callback: function($dropdown) {\n $dropdown.find('.note-holder').each(function() {\n const $holder = $(this);\n $holder.append(palette({\n colors: opt.colors,\n eventName: $holder.data('event'),\n }).render());\n });\n\n if (type === 'fore') {\n $dropdown.find('.btn-background-color').hide();\n $dropdown.css({ 'min-width': '210px' });\n } else if (type === 'back') {\n $dropdown.find('.btn-foreground-color').hide();\n $dropdown.css({ 'min-width': '210px' });\n }\n },\n click: function(event) {\n const $button = $(event.target);\n const eventName = $button.data('event');\n let value = $button.data('value');\n const foreinput = document.getElementById('html5fcp').value;\n const backinput = document.getElementById('html5bcp').value;\n if (value === 'cp') {\n event.stopPropagation();\n } else if (value === 'cpbackColor') {\n value = backinput;\n } else if (value === 'cpforeColor') {\n value = foreinput;\n }\n\n if (eventName && value) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n\n if (type === 'fore') {\n opt.itemClick('foreColor', value);\n } else if (type === 'back') {\n opt.itemClick('backColor', value);\n } else {\n opt.itemClick(eventName, value);\n }\n }\n },\n }),\n ],\n }).render();\n};\n\nconst dialog = renderer.create('<div class=\"note-modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function($node, options) {\n if (options.fade) {\n $node.addClass('fade');\n }\n $node.attr({\n 'aria-label': options.title,\n });\n $node.html([\n '<div class=\"note-modal-content\">',\n (options.title ? '<div class=\"note-modal-header\"><button type=\"button\" class=\"close\" aria-label=\"Close\" aria-hidden=\"true\"><i class=\"note-icon-close\"></i></button><h4 class=\"note-modal-title\">' + options.title + '</h4></div>' : ''),\n '<div class=\"note-modal-body\">' + options.body + '</div>',\n (options.footer ? '<div class=\"note-modal-footer\">' + options.footer + '</div>' : ''),\n '</div>',\n ].join(''));\n\n $node.data('modal', new ModalUI($node, options));\n});\n\nconst videoDialog = function(opt) {\n const body = '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-video-url-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.video.url + ' <small class=\"text-muted\">' + opt.lang.video.providers + '</small></label>' +\n '<input id=\"note-dialog-video-url-' + opt.id + '\" class=\"note-video-url note-input\" type=\"text\"/>' +\n '</div>';\n const footer = [\n '<button type=\"button\" href=\"#\" class=\"note-btn note-btn-primary note-video-btn disabled\" disabled>',\n opt.lang.video.insert,\n '</button>',\n ].join('');\n\n return dialog({\n title: opt.lang.video.insert,\n fade: opt.fade,\n body: body,\n footer: footer,\n }).render();\n};\n\nconst imageDialog = function(opt) {\n const body = '<div class=\"note-form-group note-group-select-from-files\">' +\n '<label for=\"note-dialog-image-file-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.image.selectFromFiles + '</label>' +\n '<input id=\"note-dialog-image-file-' + opt.id + '\" class=\"note-note-image-input note-input\" type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>' +\n opt.imageLimitation +\n '</div>' +\n '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-image-url-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.image.url + '</label>' +\n '<input id=\"note-dialog-image-url-' + opt.id + '\" class=\"note-image-url note-input\" type=\"text\"/>' +\n '</div>';\n const footer = [\n '<button href=\"#\" type=\"button\" class=\"note-btn note-btn-primary note-btn-large note-image-btn disabled\" disabled>',\n opt.lang.image.insert,\n '</button>',\n ].join('');\n\n return dialog({\n title: opt.lang.image.insert,\n fade: opt.fade,\n body: body,\n footer: footer,\n }).render();\n};\n\nconst linkDialog = function(opt) {\n const body = '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-link-txt-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.link.textToDisplay + '</label>' +\n '<input id=\"note-dialog-link-txt-' + opt.id + '\" class=\"note-link-text note-input\" type=\"text\"/>' +\n '</div>' +\n '<div class=\"note-form-group\">' +\n '<label for=\"note-dialog-link-url-' + opt.id + '\" class=\"note-form-label\">' + opt.lang.link.url + '</label>' +\n '<input id=\"note-dialog-link-url-' + opt.id + '\" class=\"note-link-url note-input\" type=\"text\" value=\"http://\"/>' +\n '</div>' +\n (!opt.disableLinkTarget ? '<div class=\"checkbox\"><label for=\"note-dialog-link-nw-' + opt.id + '\"><input id=\"note-dialog-link-nw-' + opt.id + '\" type=\"checkbox\" checked> ' + opt.lang.link.openInNewWindow + '</label></div>' : '') +\n '<div class=\"checkbox\"><label for=\"note-dialog-link-up-' + opt.id + '\"><input id=\"note-dialog-link-up-' + opt.id + '\" type=\"checkbox\" checked> ' + opt.lang.link.useProtocol + '</label></div>';\n const footer = [\n '<button href=\"#\" type=\"button\" class=\"note-btn note-btn-primary note-link-btn disabled\" disabled>',\n opt.lang.link.insert,\n '</button>',\n ].join('');\n\n return dialog({\n className: 'link-dialog',\n title: opt.lang.link.insert,\n fade: opt.fade,\n body: body,\n footer: footer,\n }).render();\n};\n\nconst popover = renderer.create([\n '<div class=\"note-popover bottom\">',\n '<div class=\"note-popover-arrow\"/>',\n '<div class=\"popover-content note-children-container\"/>',\n '</div>',\n].join(''), function($node, options) {\n const direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n\n $node.addClass(direction).hide();\n\n if (options.hideArrow) {\n $node.find('.note-popover-arrow').hide();\n }\n});\n\nconst checkbox = renderer.create('<div class=\"checkbox\"></div>', function($node, options) {\n $node.html([\n '<label' + (options.id ? ' for=\"note-' + options.id + '\"' : '') + '>',\n '<input role=\"checkbox\" type=\"checkbox\"' + (options.id ? ' id=\"note-' + options.id + '\"' : ''),\n (options.checked ? ' checked' : ''),\n ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n (options.text ? options.text : ''),\n '</label>',\n ].join(''));\n});\n\nconst icon = function(iconClassName, tagName) {\n tagName = tagName || 'i';\n return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n};\n\nconst ui = function(editorOptions) {\n return {\n editor: editor,\n toolbar: toolbar,\n editingArea: editingArea,\n codable: codable,\n editable: editable,\n statusbar: statusbar,\n airEditor: airEditor,\n airEditable: airEditable,\n buttonGroup: buttonGroup,\n button: button,\n dropdown: dropdown,\n dropdownCheck: dropdownCheck,\n dropdownButton: dropdownButton,\n dropdownButtonContents: dropdownButtonContents,\n dropdownCheckButton: dropdownCheckButton,\n paragraphDropdownButton: paragraphDropdownButton,\n tableDropdownButton: tableDropdownButton,\n colorDropdownButton: colorDropdownButton,\n palette: palette,\n dialog: dialog,\n videoDialog: videoDialog,\n imageDialog: imageDialog,\n linkDialog: linkDialog,\n popover: popover,\n checkbox: checkbox,\n icon: icon,\n options: editorOptions,\n\n toggleBtn: function($btn, isEnable) {\n $btn.toggleClass('disabled', !isEnable);\n $btn.attr('disabled', !isEnable);\n },\n\n toggleBtnActive: function($btn, isActive) {\n $btn.toggleClass('active', isActive);\n },\n\n check: function($dom, value) {\n $dom.find('.checked').removeClass('checked');\n $dom.find('[data-value=\"' + value + '\"]').addClass('checked');\n },\n\n onDialogShown: function($dialog, handler) {\n $dialog.one('note.modal.show', handler);\n },\n\n onDialogHidden: function($dialog, handler) {\n $dialog.one('note.modal.hide', handler);\n },\n\n showDialog: function($dialog) {\n $dialog.data('modal').show();\n },\n\n hideDialog: function($dialog) {\n $dialog.data('modal').hide();\n },\n\n /**\n * get popover content area\n *\n * @param $popover\n * @returns {*}\n */\n getPopoverContent: function($popover) {\n return $popover.find('.note-popover-content');\n },\n\n /**\n * get dialog's body area\n *\n * @param $dialog\n * @returns {*}\n */\n getDialogBody: function($dialog) {\n return $dialog.find('.note-modal-body');\n },\n\n createLayout: function($note) {\n const $editor = (editorOptions.airMode ? airEditor([\n editingArea([\n codable(),\n airEditable(),\n ]),\n ]) : (editorOptions.toolbarPosition === 'bottom'\n ? editor([\n editingArea([\n codable(),\n editable(),\n ]),\n toolbar(),\n statusbar(),\n ])\n : editor([\n toolbar(),\n editingArea([\n codable(),\n editable(),\n ]),\n statusbar(),\n ])\n )).render();\n\n $editor.insertAfter($note);\n\n return {\n note: $note,\n editor: $editor,\n toolbar: $editor.find('.note-toolbar'),\n editingArea: $editor.find('.note-editing-area'),\n editable: $editor.find('.note-editable'),\n codable: $editor.find('.note-codable'),\n statusbar: $editor.find('.note-statusbar'),\n };\n },\n\n removeLayout: function($note, layoutInfo) {\n $note.html(layoutInfo.editable.html());\n layoutInfo.editor.remove();\n $note.off('summernote'); // remove summernote custom event\n $note.show();\n },\n };\n};\n\nexport default ui;\n","import $ from 'jquery';\nimport ui from './ui';\nimport '../base/settings.js';\n\nimport '../../styles/summernote-lite.scss';\n\n$.summernote = $.extend($.summernote, {\n ui_template: ui,\n interface: 'lite',\n});\n"],"sourceRoot":""}
File: public/AdminLTE/plugins/summernote/summernote.js
Match lines: 8
2727| value: function normalize() {
2955| return new WrappedRange(point.node, point.offset, point.node, point.offset).normalize();
3013| var rng = this.normalize();
3044| return this.normalize();
4371| range.create(nextPara, 0).normalize().select().scrollIntoView(editable);
5266| _this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());
5712| rng = rng.normalize();
6173| this.$editable[0].normalize();
File: public/AdminLTE/plugins/summernote/summernote.js.map
Match lines: 1
1|{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///external {\"root\":\"jQuery\",\"commonjs2\":\"jquery\",\"commonjs\":\"jquery\",\"amd\":\"jquery\"}","webpack:///./src/js/base/renderer.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./src/js/base/summernote-en-US.js","webpack:///./src/js/base/core/env.js","webpack:///./src/js/base/core/func.js","webpack:///./src/js/base/core/lists.js","webpack:///./src/js/base/core/dom.js","webpack:///./src/js/base/Context.js","webpack:///./src/js/summernote.js","webpack:///./src/js/base/core/range.js","webpack:///./src/js/base/core/key.js","webpack:///./src/js/base/core/async.js","webpack:///./src/js/base/editing/History.js","webpack:///./src/js/base/editing/Style.js","webpack:///./src/js/base/editing/Bullet.js","webpack:///./src/js/base/editing/Typing.js","webpack:///./src/js/base/editing/Table.js","webpack:///./src/js/base/module/Editor.js","webpack:///./src/js/base/module/Clipboard.js","webpack:///./src/js/base/module/Dropzone.js","webpack:///./src/js/base/module/Codeview.js","webpack:///./src/js/base/module/Statusbar.js","webpack:///./src/js/base/module/Fullscreen.js","webpack:///./src/js/base/module/Handle.js","webpack:///./src/js/base/module/AutoLink.js","webpack:///./src/js/base/module/AutoSync.js","webpack:///./src/js/base/module/AutoReplace.js","webpack:///./src/js/base/module/Placeholder.js","webpack:///./src/js/base/module/Buttons.js","webpack:///./src/js/base/module/Toolbar.js","webpack:///./src/js/base/module/LinkDialog.js","webpack:///./src/js/base/module/LinkPopover.js","webpack:///./src/js/base/module/ImageDialog.js","webpack:///./src/js/base/module/ImagePopover.js","webpack:///./src/js/base/module/TablePopover.js","webpack:///./src/js/base/module/VideoDialog.js","webpack:///./src/js/base/module/HelpDialog.js","webpack:///./src/js/base/module/AirPopover.js","webpack:///./src/js/base/module/HintPopover.js","webpack:///./src/js/base/settings.js","webpack:///./src/styles/summernote-bs3.scss","webpack:///./src/js/bs3/ui.js","webpack:///./src/js/bs3/settings.js"],"names":["Renderer","markup","children","options","callback","$parent","$node","$","contents","html","className","addClass","data","each","k","v","attr","click","on","$container","find","forEach","child","render","length","append","create","arguments","Array","isArray","summernote","lang","extend","font","bold","italic","underline","clear","height","name","strikethrough","subscript","superscript","size","sizeunit","image","insert","resizeFull","resizeHalf","resizeQuarter","resizeNone","floatLeft","floatRight","floatNone","shapeRounded","shapeCircle","shapeThumbnail","shapeNone","dragImageHere","dropImage","selectFromFiles","maximumFileSize","maximumFileSizeError","url","remove","original","video","videoLink","providers","link","unlink","edit","textToDisplay","openInNewWindow","useProtocol","table","addRowAbove","addRowBelow","addColLeft","addColRight","delRow","delCol","delTable","hr","style","p","blockquote","pre","h1","h2","h3","h4","h5","h6","lists","unordered","ordered","help","fullscreen","codeview","paragraph","outdent","indent","left","center","right","justify","color","recent","more","background","foreground","transparent","setTransparent","reset","resetToDefault","cpSelect","shortcut","shortcuts","close","textFormatting","action","paragraphFormatting","documentStyle","extraKeys","history","undo","redo","specialChar","select","output","noSelection","isSupportAmd","define","genericFontFamilies","validFontName","fontName","inArray","toLowerCase","isFontInstalled","testFontName","testText","testSize","canvas","document","createElement","context","getContext","originalWidth","measureText","width","userAgent","navigator","isMSIE","test","browserVersion","matches","exec","parseFloat","isEdge","hasCodeMirror","window","CodeMirror","isSupportTouch","MaxTouchPoints","msMaxTouchPoints","inputEventName","isMac","appVersion","indexOf","isFF","isPhantom","isWebkit","isChrome","isSafari","jqueryVersion","fn","jquery","isW3CRangeSupport","createRange","eq","itemA","itemB","eq2","peq2","propName","ok","fail","not","f","apply","and","fA","fB","item","self","a","invoke","obj","method","idCounter","resetUniqueId","uniqueId","prefix","id","rect2bnd","rect","$document","top","scrollTop","scrollLeft","bottom","invertObject","inverted","key","Object","prototype","hasOwnProperty","call","namespaceToCamel","namespace","split","map","substring","toUpperCase","join","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","setTimeout","isValidUrl","expression","head","array","last","initial","slice","tail","pred","idx","len","all","contains","sum","reduce","memo","from","collection","result","isEmpty","clusterBy","aTail","aLast","compact","aResult","push","unique","results","next","prev","NBSP_CHAR","String","fromCharCode","ZERO_WIDTH_NBSP_CHAR","isEditable","node","hasClass","isControlSizing","makePredByNodeName","nodeName","isText","nodeType","isElement","isVoid","isPara","isHeading","isPre","isLi","isPurePara","isTable","isData","isInline","isBodyContainer","isList","isHr","isBlockquote","isCell","isAnchor","isParaInline","ancestor","isBodyInline","isBody","isClosestSibling","nodeA","nodeB","nextSibling","previousSibling","withClosestSiblings","siblings","blankHTML","env","nodeLength","nodeValue","childNodes","deepestChildIsEmpty","firstElementChild","innerHTML","paddingBlankHTML","parentNode","singleChildAncestor","listAncestor","ancestors","el","lastAncestor","filter","commonAncestor","n","listPrev","nodes","listNext","listDescendant","descendants","fnWalk","current","wrap","wrapperName","parent","wrapper","insertBefore","appendChild","insertAfter","preceding","appendChildNodes","aChild","isLeftEdgePoint","point","offset","isRightEdgePoint","isEdgePoint","isLeftEdgeOf","position","isRightEdgeOf","isLeftEdgePointOf","isRightEdgePointOf","hasChildren","prevPoint","isSkipInnerOffset","nextPoint","isSamePoint","pointA","pointB","isVisiblePoint","leftNode","rightNode","prevPointUntil","nextPointUntil","isCharPoint","ch","charAt","isSpacePoint","walkPoint","startPoint","endPoint","handler","isSkipOffset","makeOffsetPath","reverse","fromOffsetPath","offsets","i","splitNode","isSkipPaddingBlankHTML","isNotSplitEdgePoint","isDiscardEmptySplits","splitText","childNode","clone","cloneNode","splitTree","root","splitPoint","topAncestor","splitRoot","container","pivot","createText","text","createTextNode","isRemoveChild","removeNode","removeChild","removeWhile","replace","newNode","cssText","isTextarea","value","stripLinebreaks","val","isNewlineOnBlock","regexTag","match","endSlash","isEndOfInlineContainer","isBlockNode","trim","posFromPlaceholder","placeholder","$placeholder","pos","outerHeight","attachEvents","events","keys","detachEvents","off","isCustomStyleTag","classList","blank","emptyPara","isBlock","isDiv","isBR","isSpan","isB","isU","isS","isI","isImg","isEmptyAnchor","Context","$note","memos","modules","layoutInfo","ui","ui_template","initialize","createLayout","_initialize","hide","_destroy","removeData","removeLayout","disabled","isDisabled","code","dom","disable","now","editor","buttons","plugins","module","initializeModule","removeModule","removeMemo","triggerEvent","isActivated","undefined","codable","editable","editing","callbacks","trigger","shouldInitialize","ModuleClass","withoutIntialize","destroy","event","createInvokeHandler","preventDefault","$target","target","closest","splits","hasSeparator","moduleName","methodName","type","isExternalAPICalled","hasInitOptions","langInfo","icons","tooltip","note","first","focus","textRangeToPoint","textRange","isStart","parentElement","tester","body","createTextRange","prevContainer","moveToElementText","compareEndPoints","textRangeStart","curTextNode","collapse","firstChild","pointTester","duplicate","setEndPoint","textCount","dummy","cont","pointToTextRange","textRangeInfo","isCollapseToStart","prevTextNodes","collapseToStart","info","moveStart","WrappedRange","sc","so","ec","eo","isOnEditable","makeIsOn","isOnList","isOnAnchor","isOnCell","isOnData","w3cRange","setStart","setEnd","Math","min","nativeRng","nativeRange","selection","getSelection","rangeCount","removeAllRanges","addRange","offsetTop","abs","getVisiblePoint","isLeftToRight","block","hasRightNode","hasLeftNode","getEndPoint","isCollapsed","getStartPoint","includeAncestor","fullyContains","leftEdgeNodes","startAncestor","endAncestor","boundaryPoints","getPoints","isSameContainer","rng","emptyParents","normalize","inlineSiblings","concat","para","wrapBodyInlineWithPara","deleteContents","contentsContainer","insertNode","toString","findAfter","isNotTextPoint","regex","index","s","path","e","paras","getClientRects","wrappedRange","createFromSelection","bodyElement","lastChild","createFromBodyElement","createFromNode","anchorNode","getRangeAt","startContainer","startOffset","endContainer","endOffset","textRangeEnd","isTextNode","createFromNodeBefore","createFromNodeAfter","createFromBookmark","bookmark","createFromParaBookmark","KEY_MAP","isEdit","keyCode","BACKSPACE","TAB","ENTER","SPACE","DELETE","isMove","LEFT","UP","RIGHT","DOWN","isNavigation","HOME","END","PAGEUP","PAGEDOWN","nameFromCode","readFileAsDataURL","file","Deferred","deferred","FileReader","onload","dataURL","resolve","onerror","err","reject","readAsDataURL","promise","createImage","$img","one","detach","css","display","appendTo","History","stack","stackOffset","$editable","range","emptyBookmark","snapshot","recordUndo","applySnapshot","makeSnapshot","historyLimit","shift","Style","$obj","propertyNames","propertyName","properties","styleInfo","jQueryCSS","fontSize","parseInt","expandClosestSibling","onlyPartialContains","nodesInRange","tails","elem","$cont","fromNode","queryCommandState","queryCommandValue","orderedTypes","isUnordered","lineHeight","toFixed","anchor","Bullet","toggleList","clustereds","previousList","findList","wrapList","appendToPrevious","releaseList","listName","paraBookmark","wrappedParas","diffLists","listNode","prevList","nextList","isEscapseToBody","releasedParas","headList","parentItem","newList","findNextSiblings","lastList","middleList","rootLists","rootList","listNodes","Typing","bullet","tabsize","tab","nextPara","blockquoteBreakingLevel","emptyAnchors","scrollIntoView","TableResultAction","where","domTable","_startPoint","_virtualTable","_actionCellList","setStartPoint","tagName","colPos","cellIndex","rowPos","rowIndex","setVirtualTablePosition","baseRow","baseCell","isRowSpan","isColSpan","isVirtualCell","objPosition","getActionCell","virtualTableCellObj","resultAction","virtualRowPosition","virtualColPosition","recoverCellIndex","newCellIndex","addCellInfoToVirtual","row","cell","cellHasColspan","colSpan","cellHasRowspan","rowSpan","isThisSelectedCell","rowspanNumber","attributes","rp","rowspanIndex","adjustStartPoint","colspanNumber","cp","cellspanIndex","isSelectedCell","createVirtualTable","rows","cells","getDeleteResultActionToCell","Column","SubtractSpanCount","Row","isVirtual","AddCell","RemoveCell","getAddResultActionToCell","SumSpanCount","Ignore","init","getActionList","fixedRow","fixedCol","actualPosition","canContinue","rowPosition","colPosition","requestAction","Add","Delete","Table","isShift","nextCell","currentTr","trAttributes","recoverAttributes","vTable","actions","idCell","currentCell","tdAttributes","baseCellTr","isTopFromRowSpan","newTd","removeAttr","setAttribute","before","lastTrIndex","after","rowsGroup","actionIndex","resultStr","attrList","specified","cellPos","virtualPosition","virtualTable","hasRowspan","nextRow","cloneRow","removeAttribute","hasColspan","colCount","rowCount","tds","tdHTML","idxCol","trs","trHTML","idxRow","$table","tableClassName","KEY_BOGUS","Editor","$editor","lastRange","typing","untab","insertParagraph","insertOrderedList","insertUnorderedList","formatPara","insertHorizontalRule","commands","sCmd","beforeCommand","execCommand","afterCommand","wrapCommand","fontStyling","unit","currentStyle","fontSizeUnit","formatBlock","isLimited","getLastRange","setLastRange","insertText","textNode","pasteHTML","onApplyCustomStyle","onFormatBlock","hrNode","stylePara","createLink","linkInfo","linkUrl","linkText","isNewWindow","checkProtocol","additionalTextLength","isTextChanged","onCreateLink","defaultProtocol","anchors","styleNodes","startRange","endRange","colorInfo","foreColor","backColor","insertTable","dim","dimension","createTable","removeMedia","restoreTarget","floatMe","toggleClass","resize","hasKeyShortCut","isDefaultPrevented","handleKeyMap","preventDefaultEditableShortCuts","recordEveryKeystroke","spellCheck","disableGrammar","airMode","overrideContextMenu","outerWidth","maxHeight","minHeight","keyMap","metaKey","ctrlKey","altKey","shiftKey","keyName","eventName","tabDisable","pad","maxTextLength","thenCollapse","commit","styleWithCSS","isPreventTrigger","normalizeContent","tabSize","insertTab","src","param","then","$image","show","files","filename","maximumImageFileSize","insertImage","onImageUpload","insertImagesAsDataURL","currentRange","spans","firstSpan","noteStatusOutput","expand","$anchor","addRow","addCol","deleteRow","deleteCol","deleteTable","bKeepRatio","imageSize","newRatio","y","x","ratio","is","hasFocus","Clipboard","pasteByEvent","bind","clipboardData","originalEvent","items","kind","getAsFile","getData","Dropzone","$eventListener","documentEventHandlers","$dropzone","prependTo","disableDragAndDrop","onDrop","attachDragAndDropEvent","$dropzoneMessage","onDragenter","isCodeview","hasEditorSize","add","onDragleave","removeClass","dataTransfer","types","content","substr","CodeView","$codable","save","deactivate","activate","codeviewFilter","codeviewFilterRegex","codeviewIframeFilter","whitelist","codeviewIframeWhitelistSrc","codeviewIframeWhitelistSrcBase","tag","RegExp","prettifyHtml","cmEditor","fromTextArea","codemirror","tern","server","TernServer","ternServer","cm","updateArgHints","getValue","setSize","toTextArea","purify","isChange","EDITABLE_PADDING","Statusbar","$statusbar","statusbar","disableResizeEditor","stopPropagation","editableTop","onMouseMove","clientY","minheight","max","Fullscreen","$toolbar","toolbar","$window","$scrollbar","onResize","resizeTo","h","setsize","isFullscreen","Handle","$editingArea","editingArea","we","update","$handle","disableResizeImage","posStart","clientX","isImage","$selection","w","origImageObj","Image","sizingText","defaultScheme","linkPattern","AutoLink","handleKeyup","handleKeydown","lastWordRange","keyword","urlText","linkTargetBlank","wordRange","getWordRange","AutoSync","AutoReplace","PERIOD","COMMA","SEMICOLON","SLASH","previousKeydownCode","lastWord","jQuery","Node","Placeholder","inheritPlaceholder","isShow","toggle","Buttons","invertedKeyMap","editorMethod","o","button","addToolbarButtons","addImagePopoverButtons","addLinkPopoverButtons","addTablePopoverButtons","fontInstalledMap","fontNamesIgnoreCheck","buttonGroup","icon","$button","currentTarget","$recentColor","colorButton","dropdownButtonContents","dropdown","$dropdown","$holder","palette","colors","colorsName","customColors","change","$chip","$picker","$palette","prepend","$color","$currentButton","magic","styleTags","title","template","styleIdx","styleLen","representShortcut","createInvokeHandlerAndUpdateState","eraser","addDefaultFonts","fontname","isFontDeservedToAdd","fontNames","dropdownCheck","checkClassName","menuCheck","fontSizes","fontSizeUnits","colorPalette","unorderedlist","orderedlist","justifyLeft","alignLeft","justifyCenter","alignCenter","justifyRight","alignRight","justifyFull","alignJustify","textHeight","lineHeights","$catcher","insertTableMaxSize","col","mousedown","tableMoveHandler","picture","minus","arrowsAlt","question","rollback","trash","rowAbove","rowBelow","colBefore","colAfter","rowRemove","colRemove","groups","groupIdx","groupLen","group","groupName","$group","btn","updateBtnStates","$item","isChecked","infos","selector","toggleBtnActive","PX_PER_EM","$dimensionDisplay","$highlighted","$unhighlighted","posOffset","offsetX","posCatcher","pageX","pageY","offsetY","c","ceil","r","Toolbar","isFollowing","followScroll","toolbarContainer","changeContainer","followingToolbar","editorHeight","editorWidth","toolbarHeight","statusbarHeight","otherBarHeight","otherStaticBar","currentOffset","editorOffsetTop","editorOffsetBottom","activateOffset","deactivateOffsetBottom","marginTop","zIndex","isIncludeCodeview","$btn","toggleBtn","LinkDialog","$body","dialogsInBody","disableLinkTarget","checkbox","checked","buttonClass","footer","$dialog","dialog","fade","dialogsFade","hideDialog","$input","$linkBtn","$linkText","$linkUrl","$openInNewWindow","$useProtocol","onDialogShown","toggleLinkBtn","bindEnterKey","isNewWindowChecked","prop","useProtocolChecked","onDialogHidden","state","showDialog","showLinkDialog","LinkPopover","popover","$popover","$content","href","containerOffset","ImageDialog","imageLimitation","floor","log","readableSize","pow","showImageDialog","onImageLinkInsert","$imageInput","$imageUrl","$imageBtn","replaceWith","ImagePopover","popatmouse","TablePopover","VideoDialog","ytRegExp","ytRegExpForStart","ytMatch","igRegExp","igMatch","vRegExp","vMatch","vimRegExp","vimMatch","dmRegExp","dmMatch","youkuRegExp","youkuMatch","qqRegExp","qqMatch","qqRegExp2","qqMatch2","mp4RegExp","mp4Match","oggRegExp","oggMatch","webmRegExp","webmMatch","fbRegExp","fbMatch","$video","youtubeId","start","ytMatchForStart","vid","encodeURIComponent","showVideoDialog","createVideoNode","$videoUrl","$videoBtn","HelpDialog","createShortcutList","command","$row","showHelpDialog","AIRMODE_POPOVER_X_OFFSET","AIRMODE_POPOVER_Y_OFFSET","AirPopover","hidable","onContextmenu","air","forcelyOpen","POPOVER_DIST","HintPopover","hint","direction","hintDirection","hints","matchingWord","hideArrow","innerHeight","$current","$next","selectItem","$nextGroup","$prev","$prevGroup","nodeFromItem","rangeCompute","hintSelect","hintIdx","moveUp","moveDown","search","searchKeyword","createItemTemplates","hintMode","getWordsRange","getWordsMatchRange","empty","bnd","createGroup","version","Codeview","toolbarPosition","tabDisabled","textareaAutoSync","onBeforeCommand","onBlur","onBlurCodeview","onChange","onChangeCodeview","onEnter","onFocus","onImageUploadError","onInit","onKeydown","onKeyup","onMousedown","onMouseup","onPaste","onScroll","mode","htmlMode","lineNumbers","pc","mac","renderer","airEditor","airEditable","option","dataValue","dataOption","caret","iconClassName","editorOptions","rowSize","colSize","colorName","placement","isEnable","isActive","modal"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,gD;;;;;;;;;;;;;;;;;;ACAA;;IAEMA,Q;;;AACJ,oBAAYC,MAAZ,EAAoBC,QAApB,EAA8BC,OAA9B,EAAuCC,QAAvC,EAAiD;AAAA;;AAC/C,SAAKH,MAAL,GAAcA,MAAd;AACA,SAAKC,QAAL,GAAgBA,QAAhB;AACA,SAAKC,OAAL,GAAeA,OAAf;AAC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AFE,CAAD,CAFJ,EAMP+gB,SAAS,EANF,CAAD,CAdM,EAsBb38B,MAtBa,EAAhB;AAwBA6xB,aAAO,CAACpe,WAAR,CAAoBqG,KAApB;AAEA,aAAO;AACLsD,YAAI,EAAEtD,KADD;AAELmB,cAAM,EAAE4W,OAFH;AAGLwL,eAAO,EAAExL,OAAO,CAAChyB,IAAR,CAAa,eAAb,CAHJ;AAILk+B,mBAAW,EAAElM,OAAO,CAAChyB,IAAR,CAAa,oBAAb,CAJR;AAKL+b,gBAAQ,EAAEiW,OAAO,CAAChyB,IAAR,CAAa,gBAAb,CALL;AAML8b,eAAO,EAAEkW,OAAO,CAAChyB,IAAR,CAAa,eAAb,CANJ;AAOL88B,iBAAS,EAAE9K,OAAO,CAAChyB,IAAR,CAAa,iBAAb;AAPN,OAAP;AASD,KApII;AAsIL6a,gBAAY,EAAE,sBAASZ,KAAT,EAAgBG,UAAhB,EAA4B;AACxCH,WAAK,CAAC5a,IAAN,CAAW+a,UAAU,CAAC2B,QAAX,CAAoB1c,IAApB,EAAX;AACA+a,gBAAU,CAACgB,MAAX,CAAkBxY,MAAlB;AACAqX,WAAK,CAACwd,IAAN;AACD;AA1II,GAAP;AA4ID,CA7ID;;AA+Iepd,gDAAf,E;;;;;;;;ACzPA;AACA;AACA;AAEA;AAEAlb,0EAAC,CAACuB,UAAF,GAAevB,0EAAC,CAACyB,MAAF,CAASzB,0EAAC,CAACuB,UAAX,EAAuB;AACpC4Z,aAAW,EAAED,MADuB;AAEpC,eAAW;AAFyB,CAAvB,CAAf,C","file":"summernote.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 52);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import $ from 'jquery';\n\nclass Renderer {\n constructor(markup, children, options, callback) {\n this.markup = markup;\n this.children = children;\n this.options = options;\n this.callback = callback;\n }\n\n render($parent) {\n const $node = $(this.markup);\n\n if (this.options && this.options.contents) {\n $node.html(this.options.contents);\n }\n\n if (this.options && this.options.className) {\n $node.addClass(this.options.className);\n }\n\n if (this.options && this.options.data) {\n $.each(this.options.data, (k, v) => {\n $node.attr('data-' + k, v);\n });\n }\n\n if (this.options && this.options.click) {\n $node.on('click', this.options.click);\n }\n\n if (this.children) {\n const $container = $node.find('.note-children-container');\n this.children.forEach((child) => {\n child.render($container.length ? $container : $node);\n });\n }\n\n if (this.callback) {\n this.callback($node, this.options);\n }\n\n if (this.options && this.options.callback) {\n this.options.callback($node);\n }\n\n if ($parent) {\n $parent.append($node);\n }\n\n return $node;\n }\n}\n\nexport default {\n create: (markup, callback) => {\n return function() {\n const options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n let children = Array.isArray(arguments[0]) ? arguments[0] : [];\n if (options && options.children) {\n children = options.children;\n }\n return new Renderer(markup, children, options, callback);\n };\n },\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import $ from 'jquery';\n\n$.summernote = $.summernote || {\n lang: {},\n};\n\n$.extend($.summernote.lang, {\n 'en-US': {\n font: {\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n clear: 'Remove Font Style',\n height: 'Line Height',\n name: 'Font Family',\n strikethrough: 'Strikethrough',\n subscript: 'Subscript',\n superscript: 'Superscript',\n size: 'Font Size',\n sizeunit: 'Font Size Unit',\n },\n image: {\n image: 'Picture',\n insert: 'Insert Image',\n resizeFull: 'Resize full',\n resizeHalf: 'Resize half',\n resizeQuarter: 'Resize quarter',\n resizeNone: 'Original size',\n floatLeft: 'Float Left',\n floatRight: 'Float Right',\n floatNone: 'Remove float',\n shapeRounded: 'Shape: Rounded',\n shapeCircle: 'Shape: Circle',\n shapeThumbnail: 'Shape: Thumbnail',\n shapeNone: 'Shape: None',\n dragImageHere: 'Drag image or text here',\n dropImage: 'Drop image or Text',\n selectFromFiles: 'Select from files',\n maximumFileSize: 'Maximum file size',\n maximumFileSizeError: 'Maximum file size exceeded.',\n url: 'Image URL',\n remove: 'Remove Image',\n original: 'Original',\n },\n video: {\n video: 'Video',\n videoLink: 'Video Link',\n insert: 'Insert Video',\n url: 'Video URL',\n providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)',\n },\n link: {\n link: 'Link',\n insert: 'Insert Link',\n unlink: 'Unlink',\n edit: 'Edit',\n textToDisplay: 'Text to display',\n url: 'To what URL should this link go?',\n openInNewWindow: 'Open in new window',\n useProtocol: 'Use default protocol',\n },\n table: {\n table: 'Table',\n addRowAbove: 'Add row above',\n addRowBelow: 'Add row below',\n addColLeft: 'Add column left',\n addColRight: 'Add column right',\n delRow: 'Delete row',\n delCol: 'Delete column',\n delTable: 'Delete table',\n },\n hr: {\n insert: 'Insert Horizontal Rule',\n },\n style: {\n style: 'Style',\n p: 'Normal',\n blockquote: 'Quote',\n pre: 'Code',\n h1: 'Header 1',\n h2: 'Header 2',\n h3: 'Header 3',\n h4: 'Header 4',\n h5: 'Header 5',\n h6: 'Header 6',\n },\n lists: {\n unordered: 'Unordered list',\n ordered: 'Ordered list',\n },\n options: {\n help: 'Help',\n fullscreen: 'Full Screen',\n codeview: 'Code View',\n },\n paragraph: {\n paragraph: 'Paragraph',\n outdent: 'Outdent',\n indent: 'Indent',\n left: 'Align left',\n center: 'Align center',\n right: 'Align right',\n justify: 'Justify full',\n },\n color: {\n recent: 'Recent Color',\n more: 'More Color',\n background: 'Background Color',\n foreground: 'Text Color',\n transparent: 'Transparent',\n setTransparent: 'Set transparent',\n reset: 'Reset',\n resetToDefault: 'Reset to default',\n cpSelect: 'Select',\n },\n shortcut: {\n shortcuts: 'Keyboard shortcuts',\n close: 'Close',\n textFormatting: 'Text formatting',\n action: 'Action',\n paragraphFormatting: 'Paragraph formatting',\n documentStyle: 'Document Style',\n extraKeys: 'Extra keys',\n },\n help: {\n 'insertParagraph': 'Insert Paragraph',\n 'undo': 'Undoes the last command',\n 'redo': 'Redoes the last command',\n 'tab': 'Tab',\n 'untab': 'Untab',\n 'bold': 'Set a bold style',\n 'italic': 'Set a italic style',\n 'underline': 'Set a underline style',\n 'strikethrough': 'Set a strikethrough style',\n 'removeFormat': 'Clean a style',\n 'justifyLeft': 'Set left align',\n 'justifyCenter': 'Set center align',\n 'justifyRight': 'Set right align',\n 'justifyFull': 'Set full align',\n 'insertUnorderedList': 'Toggle unordered list',\n 'insertOrderedList': 'Toggle ordered list',\n 'outdent': 'Outdent on current paragraph',\n 'indent': 'Indent on current paragraph',\n 'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n 'formatH1': 'Change current block\\'s format as H1',\n 'formatH2': 'Change current block\\'s format as H2',\n 'formatH3': 'Change current block\\'s format as H3',\n 'formatH4': 'Change current block\\'s format as H4',\n 'formatH5': 'Change current block\\'s format as H5',\n 'formatH6': 'Change current block\\'s format as H6',\n 'insertHorizontalRule': 'Insert horizontal rule',\n 'linkDialog.show': 'Show Link Dialog',\n },\n history: {\n undo: 'Undo',\n redo: 'Redo',\n },\n specialChar: {\n specialChar: 'SPECIAL CHARACTERS',\n select: 'Select Special characters',\n },\n output: {\n noSelection: 'No Selection Made!',\n },\n },\n});\n","import $ from 'jquery';\nconst isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n\n/**\n * returns whether font is installed or not.\n *\n * @param {String} fontName\n * @return {Boolean}\n */\nconst genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n\nfunction validFontName(fontName) {\n return ($.inArray(fontName.toLowerCase(), genericFontFamilies) === -1) ? `'${fontName}'` : fontName;\n}\n\nfunction isFontInstalled(fontName) {\n const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n const testText = 'mmmmmmmmmmwwwww';\n const testSize = '200px';\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n\n context.font = testSize + \" '\" + testFontName + \"'\";\n const originalWidth = context.measureText(testText).width;\n\n context.font = testSize + ' ' + validFontName(fontName) + ', \"' + testFontName + '\"';\n const width = context.measureText(testText).width;\n\n return originalWidth !== width;\n}\n\nconst userAgent = navigator.userAgent;\nconst isMSIE = /MSIE|Trident/i.test(userAgent);\nlet browserVersion;\nif (isMSIE) {\n let matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n}\n\nconst isEdge = /Edge\\/\\d+/.test(userAgent);\n\nlet hasCodeMirror = !!window.CodeMirror;\n\nconst isSupportTouch =\n (('ontouchstart' in window) ||\n (navigator.MaxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0));\n\n// [workaround] IE doesn't have input events for contentEditable\n// - see: https://goo.gl/4bfIvA\nconst inputEventName = (isMSIE) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n\n/**\n * @class core.env\n *\n * Object which check platform and agent\n *\n * @singleton\n * @alternateClassName env\n */\nexport default {\n isMac: navigator.appVersion.indexOf('Mac') > -1,\n isMSIE,\n isEdge,\n isFF: !isEdge && /firefox/i.test(userAgent),\n isPhantom: /PhantomJS/i.test(userAgent),\n isWebkit: !isEdge && /webkit/i.test(userAgent),\n isChrome: !isEdge && /chrome/i.test(userAgent),\n isSafari: !isEdge && /safari/i.test(userAgent) && (!/chrome/i.test(userAgent)),\n browserVersion,\n jqueryVersion: parseFloat($.fn.jquery),\n isSupportAmd,\n isSupportTouch,\n hasCodeMirror,\n isFontInstalled,\n isW3CRangeSupport: !!document.createRange,\n inputEventName,\n genericFontFamilies,\n validFontName,\n};\n","import $ from 'jquery';\n\n/**\n * @class core.func\n *\n * func utils (for high-order func's arg)\n *\n * @singleton\n * @alternateClassName func\n */\nfunction eq(itemA) {\n return function(itemB) {\n return itemA === itemB;\n };\n}\n\nfunction eq2(itemA, itemB) {\n return itemA === itemB;\n}\n\nfunction peq2(propName) {\n return function(itemA, itemB) {\n return itemA[propName] === itemB[propName];\n };\n}\n\nfunction ok() {\n return true;\n}\n\nfunction fail() {\n return false;\n}\n\nfunction not(f) {\n return function() {\n return !f.apply(f, arguments);\n };\n}\n\nfunction and(fA, fB) {\n return function(item) {\n return fA(item) && fB(item);\n };\n}\n\nfunction self(a) {\n return a;\n}\n\nfunction invoke(obj, method) {\n return function() {\n return obj[method].apply(obj, arguments);\n };\n}\n\nlet idCounter = 0;\n\n/**\n * reset globally-unique id\n *\n */\nfunction resetUniqueId() {\n idCounter = 0;\n}\n\n/**\n * generate a globally-unique id\n *\n * @param {String} [prefix]\n */\nfunction uniqueId(prefix) {\n const id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n/**\n * returns bnd (bounds) from rect\n *\n * - IE Compatibility Issue: http://goo.gl/sRLOAo\n * - Scroll Issue: http://goo.gl/sNjUc\n *\n * @param {Rect} rect\n * @return {Object} bounds\n * @return {Number} bounds.top\n * @return {Number} bounds.left\n * @return {Number} bounds.width\n * @return {Number} bounds.height\n */\nfunction rect2bnd(rect) {\n const $document = $(document);\n return {\n top: rect.top + $document.scrollTop(),\n left: rect.left + $document.scrollLeft(),\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\n/**\n * returns a copy of the object where the keys have become the values and the values the keys.\n * @param {Object} obj\n * @return {Object}\n */\nfunction invertObject(obj) {\n const inverted = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n inverted[obj[key]] = key;\n }\n }\n return inverted;\n}\n\n/**\n * @param {String} namespace\n * @param {String} [prefix]\n * @return {String}\n */\nfunction namespaceToCamel(namespace, prefix) {\n prefix = prefix || '';\n return prefix + namespace.split('.').map(function(name) {\n return name.substring(0, 1).toUpperCase() + name.substring(1);\n }).join('');\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n * @param {Function} func\n * @param {Number} wait\n * @param {Boolean} immediate\n * @return {Function}\n */\nfunction debounce(func, wait, immediate) {\n let timeout;\n return function() {\n const context = this;\n const args = arguments;\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/**\n *\n * @param {String} url\n * @return {Boolean}\n */\nfunction isValidUrl(url) {\n const expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n return expression.test(url);\n}\n\nexport default {\n eq,\n eq2,\n peq2,\n ok,\n fail,\n self,\n not,\n and,\n invoke,\n resetUniqueId,\n uniqueId,\n rect2bnd,\n invertObject,\n namespaceToCamel,\n debounce,\n isValidUrl,\n};\n","import func from './func';\n\n/**\n * returns the first item of an array.\n *\n * @param {Array} array\n */\nfunction head(array) {\n return array[0];\n}\n\n/**\n * returns the last item of an array.\n *\n * @param {Array} array\n */\nfunction last(array) {\n return array[array.length - 1];\n}\n\n/**\n * returns everything but the last entry of the array.\n *\n * @param {Array} array\n */\nfunction initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * returns the rest of the items in an array.\n *\n * @param {Array} array\n */\nfunction tail(array) {\n return array.slice(1);\n}\n\n/**\n * returns item of array\n */\nfunction find(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n const item = array[idx];\n if (pred(item)) {\n return item;\n }\n }\n}\n\n/**\n * returns true if all of the values in the array pass the predicate truth test.\n */\nfunction all(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * returns true if the value is present in the list.\n */\nfunction contains(array, item) {\n if (array && array.length && item) {\n if (array.indexOf) {\n return array.indexOf(item) !== -1;\n } else if (array.contains) {\n // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`\n return array.contains(item);\n }\n }\n return false;\n}\n\n/**\n * get sum from a list\n *\n * @param {Array} array - array\n * @param {Function} fn - iterator\n */\nfunction sum(array, fn) {\n fn = fn || func.self;\n return array.reduce(function(memo, v) {\n return memo + fn(v);\n }, 0);\n}\n\n/**\n * returns a copy of the collection with array type.\n * @param {Collection} collection - collection eg) node.childNodes, ...\n */\nfunction from(collection) {\n const result = [];\n const length = collection.length;\n let idx = -1;\n while (++idx < length) {\n result[idx] = collection[idx];\n }\n return result;\n}\n\n/**\n * returns whether list is empty or not\n */\nfunction isEmpty(array) {\n return !array || !array.length;\n}\n\n/**\n * cluster elements by predicate function.\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n * @param {Array[]}\n */\nfunction clusterBy(array, fn) {\n if (!array.length) { return []; }\n const aTail = tail(array);\n return aTail.reduce(function(memo, v) {\n const aLast = last(memo);\n if (fn(last(aLast), v)) {\n aLast[aLast.length] = v;\n } else {\n memo[memo.length] = [v];\n }\n return memo;\n }, [[head(array)]]);\n}\n\n/**\n * returns a copy of the array with all false values removed\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n */\nfunction compact(array) {\n const aResult = [];\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (array[idx]) { aResult.push(array[idx]); }\n }\n return aResult;\n}\n\n/**\n * produces a duplicate-free version of the array\n *\n * @param {Array} array\n */\nfunction unique(array) {\n const results = [];\n\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!contains(results, array[idx])) {\n results.push(array[idx]);\n }\n }\n\n return results;\n}\n\n/**\n * returns next item.\n * @param {Array} array\n */\nfunction next(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx + 1];\n }\n return null;\n}\n\n/**\n * returns prev item.\n * @param {Array} array\n */\nfunction prev(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx - 1];\n }\n return null;\n}\n\n/**\n * @class core.list\n *\n * list utils\n *\n * @singleton\n * @alternateClassName list\n */\nexport default {\n head,\n last,\n initial,\n tail,\n prev,\n next,\n find,\n contains,\n all,\n sum,\n from,\n isEmpty,\n clusterBy,\n compact,\n unique,\n};\n","import $ from 'jquery';\nimport func from './func';\nimport lists from './lists';\nimport env from './env';\n\nconst NBSP_CHAR = String.fromCharCode(160);\nconst ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n\n/**\n * @method isEditable\n *\n * returns whether node is `note-editable` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEditable(node) {\n return node && $(node).hasClass('note-editable');\n}\n\n/**\n * @method isControlSizing\n *\n * returns whether node is `note-control-sizing` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isControlSizing(node) {\n return node && $(node).hasClass('note-control-sizing');\n}\n\n/**\n * @method makePredByNodeName\n *\n * returns predicate which judge whether nodeName is same\n *\n * @param {String} nodeName\n * @return {Function}\n */\nfunction makePredByNodeName(nodeName) {\n nodeName = nodeName.toUpperCase();\n return function(node) {\n return node && node.nodeName.toUpperCase() === nodeName;\n };\n}\n\n/**\n * @method isText\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is text(3)\n */\nfunction isText(node) {\n return node && node.nodeType === 3;\n}\n\n/**\n * @method isElement\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is element(1)\n */\nfunction isElement(node) {\n return node && node.nodeType === 1;\n}\n\n/**\n * ex) br, col, embed, hr, img, input, ...\n * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n */\nfunction isVoid(node) {\n return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n}\n\nfunction isPara(node) {\n if (isEditable(node)) {\n return false;\n }\n\n // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nfunction isHeading(node) {\n return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nconst isPre = makePredByNodeName('PRE');\n\nconst isLi = makePredByNodeName('LI');\n\nfunction isPurePara(node) {\n return isPara(node) && !isLi(node);\n}\n\nconst isTable = makePredByNodeName('TABLE');\n\nconst isData = makePredByNodeName('DATA');\n\nfunction isInline(node) {\n return !isBodyContainer(node) &&\n !isList(node) &&\n !isHr(node) &&\n !isPara(node) &&\n !isTable(node) &&\n !isBlockquote(node) &&\n !isData(node);\n}\n\nfunction isList(node) {\n return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n}\n\nconst isHr = makePredByNodeName('HR');\n\nfunction isCell(node) {\n return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n}\n\nconst isBlockquote = makePredByNodeName('BLOCKQUOTE');\n\nfunction isBodyContainer(node) {\n return isCell(node) || isBlockquote(node) || isEditable(node);\n}\n\nconst isAnchor = makePredByNodeName('A');\n\nfunction isParaInline(node) {\n return isInline(node) && !!ancestor(node, isPara);\n}\n\nfunction isBodyInline(node) {\n return isInline(node) && !ancestor(node, isPara);\n}\n\nconst isBody = makePredByNodeName('BODY');\n\n/**\n * returns whether nodeB is closest sibling of nodeA\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @return {Boolean}\n */\nfunction isClosestSibling(nodeA, nodeB) {\n return nodeA.nextSibling === nodeB ||\n nodeA.previousSibling === nodeB;\n}\n\n/**\n * returns array of closest siblings with node\n *\n * @param {Node} node\n * @param {function} [pred] - predicate function\n * @return {Node[]}\n */\nfunction withClosestSiblings(node, pred) {\n pred = pred || func.ok;\n\n const siblings = [];\n if (node.previousSibling && pred(node.previousSibling)) {\n siblings.push(node.previousSibling);\n }\n siblings.push(node);\n if (node.nextSibling && pred(node.nextSibling)) {\n siblings.push(node.nextSibling);\n }\n return siblings;\n}\n\n/**\n * blank HTML for cursor position\n * - [workaround] old IE only works with \n * - [workaround] IE11 and other browser works with bogus br\n */\nconst blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '<br>';\n\n/**\n * @method nodeLength\n *\n * returns #text's text size or element's childNodes size\n *\n * @param {Node} node\n */\nfunction nodeLength(node) {\n if (isText(node)) {\n return node.nodeValue.length;\n }\n\n if (node) {\n return node.childNodes.length;\n }\n\n return 0;\n}\n\n/**\n * returns whether deepest child node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction deepestChildIsEmpty(node) {\n do {\n if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;\n } while ((node = node.firstElementChild));\n\n return isEmpty(node);\n}\n\n/**\n * returns whether node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEmpty(node) {\n const len = nodeLength(node);\n\n if (len === 0) {\n return true;\n } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n // ex) <p><br></p>, <span><br></span>\n return true;\n } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n // ex) <p></p>, <span></span>\n return true;\n }\n\n return false;\n}\n\n/**\n * padding blankHTML if node is empty (for cursor position)\n */\nfunction paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}\n\n/**\n * find nearest ancestor predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction ancestor(node, pred) {\n while (node) {\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * find nearest ancestor only single child blood line and predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction singleChildAncestor(node, pred) {\n node = node.parentNode;\n\n while (node) {\n if (nodeLength(node) !== 1) { break; }\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * returns new array of ancestor nodes (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listAncestor(node, pred) {\n pred = pred || func.fail;\n\n const ancestors = [];\n ancestor(node, function(el) {\n if (!isEditable(el)) {\n ancestors.push(el);\n }\n\n return pred(el);\n });\n return ancestors;\n}\n\n/**\n * find farthest ancestor predicate hit\n */\nfunction lastAncestor(node, pred) {\n const ancestors = listAncestor(node);\n return lists.last(ancestors.filter(pred));\n}\n\n/**\n * returns common ancestor node between two nodes.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\nfunction commonAncestor(nodeA, nodeB) {\n const ancestors = listAncestor(nodeA);\n for (let n = nodeB; n; n = n.parentNode) {\n if (ancestors.indexOf(n) > -1) return n;\n }\n return null; // difference document area\n}\n\n/**\n * listing all previous siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listPrev(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.previousSibling;\n }\n return nodes;\n}\n\n/**\n * listing next siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listNext(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.nextSibling;\n }\n return nodes;\n}\n\n/**\n * listing descendant nodes\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listDescendant(node, pred) {\n const descendants = [];\n pred = pred || func.ok;\n\n // start DFS(depth first search) with node\n (function fnWalk(current) {\n if (node !== current && pred(current)) {\n descendants.push(current);\n }\n for (let idx = 0, len = current.childNodes.length; idx < len; idx++) {\n fnWalk(current.childNodes[idx]);\n }\n })(node);\n\n return descendants;\n}\n\n/**\n * wrap node with new tag.\n *\n * @param {Node} node\n * @param {Node} tagName of wrapper\n * @return {Node} - wrapper\n */\nfunction wrap(node, wrapperName) {\n const parent = node.parentNode;\n const wrapper = $('<' + wrapperName + '>')[0];\n\n parent.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n}\n\n/**\n * insert node after preceding\n *\n * @param {Node} node\n * @param {Node} preceding - predicate function\n */\nfunction insertAfter(node, preceding) {\n const next = preceding.nextSibling;\n let parent = preceding.parentNode;\n if (next) {\n parent.insertBefore(node, next);\n } else {\n parent.appendChild(node);\n }\n return node;\n}\n\n/**\n * append elements.\n *\n * @param {Node} node\n * @param {Collection} aChild\n */\nfunction appendChildNodes(node, aChild) {\n $.each(aChild, function(idx, child) {\n node.appendChild(child);\n });\n return node;\n}\n\n/**\n * returns whether boundaryPoint is left edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isLeftEdgePoint(point) {\n return point.offset === 0;\n}\n\n/**\n * returns whether boundaryPoint is right edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isRightEdgePoint(point) {\n return point.offset === nodeLength(point.node);\n}\n\n/**\n * returns whether boundaryPoint is edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isEdgePoint(point) {\n return isLeftEdgePoint(point) || isRightEdgePoint(point);\n}\n\n/**\n * returns whether node is left edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgeOf(node, ancestor) {\n while (node && node !== ancestor) {\n if (position(node) !== 0) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether node is right edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgeOf(node, ancestor) {\n if (!ancestor) {\n return false;\n }\n while (node && node !== ancestor) {\n if (position(node) !== nodeLength(node.parentNode) - 1) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether point is left edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgePointOf(point, ancestor) {\n return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns whether point is right edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgePointOf(point, ancestor) {\n return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns offset from parent.\n *\n * @param {Node} node\n */\nfunction position(node) {\n let offset = 0;\n while ((node = node.previousSibling)) {\n offset += 1;\n }\n return offset;\n}\n\nfunction hasChildren(node) {\n return !!(node && node.childNodes && node.childNodes.length);\n}\n\n/**\n * returns previous boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction prevPoint(point, isSkipInnerOffset) {\n let node;\n let offset;\n\n if (point.offset === 0) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node);\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset - 1];\n offset = nodeLength(node);\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? 0 : point.offset - 1;\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns next boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction nextPoint(point, isSkipInnerOffset) {\n let node, offset;\n\n if (isEmpty(point.node)) {\n return null;\n }\n\n if (nodeLength(point.node) === point.offset) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node) + 1;\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset];\n offset = 0;\n if (isEmpty(node)) {\n return null;\n }\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n\n if (isEmpty(node)) {\n return null;\n }\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns whether pointA and pointB is same or not.\n *\n * @param {BoundaryPoint} pointA\n * @param {BoundaryPoint} pointB\n * @return {Boolean}\n */\nfunction isSamePoint(pointA, pointB) {\n return pointA.node === pointB.node && pointA.offset === pointB.offset;\n}\n\n/**\n * returns whether point is visible (can set cursor) or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isVisiblePoint(point) {\n if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {\n return true;\n }\n\n const leftNode = point.node.childNodes[point.offset - 1];\n const rightNode = point.node.childNodes[point.offset];\n if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @method prevPointUtil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction prevPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = prevPoint(point);\n }\n\n return null;\n}\n\n/**\n * @method nextPointUntil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction nextPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = nextPoint(point);\n }\n\n return null;\n}\n\n/**\n * returns whether point has character or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isCharPoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n}\n\n/**\n * returns whether point has space or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isSpacePoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch === ' ' || ch === NBSP_CHAR;\n}\n\n/**\n * @method walkPoint\n *\n * @param {BoundaryPoint} startPoint\n * @param {BoundaryPoint} endPoint\n * @param {Function} handler\n * @param {Boolean} isSkipInnerOffset\n */\nfunction walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n let point = startPoint;\n\n while (point) {\n handler(point);\n\n if (isSamePoint(point, endPoint)) {\n break;\n }\n\n const isSkipOffset = isSkipInnerOffset &&\n startPoint.node !== point.node &&\n endPoint.node !== point.node;\n point = nextPoint(point, isSkipOffset);\n }\n}\n\n/**\n * @method makeOffsetPath\n *\n * return offsetPath(array of offset) from ancestor\n *\n * @param {Node} ancestor - ancestor node\n * @param {Node} node\n */\nfunction makeOffsetPath(ancestor, node) {\n const ancestors = listAncestor(node, func.eq(ancestor));\n return ancestors.map(position).reverse();\n}\n\n/**\n * @method fromOffsetPath\n *\n * return element from offsetPath(array of offset)\n *\n * @param {Node} ancestor - ancestor node\n * @param {array} offsets - offsetPath\n */\nfunction fromOffsetPath(ancestor, offsets) {\n let current = ancestor;\n for (let i = 0, len = offsets.length; i < len; i++) {\n if (current.childNodes.length <= offsets[i]) {\n current = current.childNodes[current.childNodes.length - 1];\n } else {\n current = current.childNodes[offsets[i]];\n }\n }\n return current;\n}\n\n/**\n * @method splitNode\n *\n * split element or #text\n *\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitNode(point, options) {\n let isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n const isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n const isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n\n if (isDiscardEmptySplits) {\n isSkipPaddingBlankHTML = true;\n }\n\n // edge case\n if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n if (isLeftEdgePoint(point)) {\n return point.node;\n } else if (isRightEdgePoint(point)) {\n return point.node.nextSibling;\n }\n }\n\n // split #text\n if (isText(point.node)) {\n return point.node.splitText(point.offset);\n } else {\n const childNode = point.node.childNodes[point.offset];\n const clone = insertAfter(point.node.cloneNode(false), point.node);\n appendChildNodes(clone, listNext(childNode));\n\n if (!isSkipPaddingBlankHTML) {\n paddingBlankHTML(point.node);\n paddingBlankHTML(clone);\n }\n\n if (isDiscardEmptySplits) {\n if (isEmpty(point.node)) {\n remove(point.node);\n }\n if (isEmpty(clone)) {\n remove(clone);\n return point.node.nextSibling;\n }\n }\n\n return clone;\n }\n}\n\n/**\n * @method splitTree\n *\n * split tree by point\n *\n * @param {Node} root - split root\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitTree(root, point, options) {\n // ex) [#text, <span>, <p>]\n const ancestors = listAncestor(point.node, func.eq(root));\n\n if (!ancestors.length) {\n return null;\n } else if (ancestors.length === 1) {\n return splitNode(point, options);\n }\n\n return ancestors.reduce(function(node, parent) {\n if (node === point.node) {\n node = splitNode(point, options);\n }\n\n return splitNode({\n node: parent,\n offset: node ? position(node) : nodeLength(parent),\n }, options);\n });\n}\n\n/**\n * split point\n *\n * @param {Point} point\n * @param {Boolean} isInline\n * @return {Object}\n */\nfunction splitPoint(point, isInline) {\n // find splitRoot, container\n // - inline: splitRoot is a child of paragraph\n // - block: splitRoot is a child of bodyContainer\n const pred = isInline ? isPara : isBodyContainer;\n const ancestors = listAncestor(point.node, pred);\n const topAncestor = lists.last(ancestors) || point.node;\n\n let splitRoot, container;\n if (pred(topAncestor)) {\n splitRoot = ancestors[ancestors.length - 2];\n container = topAncestor;\n } else {\n splitRoot = topAncestor;\n container = splitRoot.parentNode;\n }\n\n // if splitRoot is exists, split with splitTree\n let pivot = splitRoot && splitTree(splitRoot, point, {\n isSkipPaddingBlankHTML: isInline,\n isNotSplitEdgePoint: isInline,\n });\n\n // if container is point.node, find pivot with point.offset\n if (!pivot && container === point.node) {\n pivot = point.node.childNodes[point.offset];\n }\n\n return {\n rightNode: pivot,\n container: container,\n };\n}\n\nfunction create(nodeName) {\n return document.createElement(nodeName);\n}\n\nfunction createText(text) {\n return document.createTextNode(text);\n}\n\n/**\n * @method remove\n *\n * remove node, (isRemoveChild: remove child or not)\n *\n * @param {Node} node\n * @param {Boolean} isRemoveChild\n */\nfunction remove(node, isRemoveChild) {\n if (!node || !node.parentNode) { return; }\n if (node.removeNode) { return node.removeNode(isRemoveChild); }\n\n const parent = node.parentNode;\n if (!isRemoveChild) {\n const nodes = [];\n for (let i = 0, len = node.childNodes.length; i < len; i++) {\n nodes.push(node.childNodes[i]);\n }\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n parent.insertBefore(nodes[i], node);\n }\n }\n\n parent.removeChild(node);\n}\n\n/**\n * @method removeWhile\n *\n * @param {Node} node\n * @param {Function} pred\n */\nfunction removeWhile(node, pred) {\n while (node) {\n if (isEditable(node) || !pred(node)) {\n break;\n }\n\n const parent = node.parentNode;\n remove(node);\n node = parent;\n }\n}\n\n/**\n * @method replace\n *\n * replace node with provided nodeName\n *\n * @param {Node} node\n * @param {String} nodeName\n * @return {Node} - new node\n */\nfunction replace(node, nodeName) {\n if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n return node;\n }\n\n const newNode = create(nodeName);\n\n if (node.style.cssText) {\n newNode.style.cssText = node.style.cssText;\n }\n\n appendChildNodes(newNode, lists.from(node.childNodes));\n insertAfter(newNode, node);\n remove(node);\n\n return newNode;\n}\n\nconst isTextarea = makePredByNodeName('TEXTAREA');\n\n/**\n * @param {jQuery} $node\n * @param {Boolean} [stripLinebreaks] - default: false\n */\nfunction value($node, stripLinebreaks) {\n const val = isTextarea($node[0]) ? $node.val() : $node.html();\n if (stripLinebreaks) {\n return val.replace(/[\\n\\r]/g, '');\n }\n return val;\n}\n\n/**\n * @method html\n *\n * get the HTML contents of node\n *\n * @param {jQuery} $node\n * @param {Boolean} [isNewlineOnBlock]\n */\nfunction html($node, isNewlineOnBlock) {\n let markup = value($node);\n\n if (isNewlineOnBlock) {\n const regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n markup = markup.replace(regexTag, function(match, endSlash, name) {\n name = name.toUpperCase();\n const isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n !!endSlash;\n const isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n\n return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n });\n markup = markup.trim();\n }\n\n return markup;\n}\n\nfunction posFromPlaceholder(placeholder) {\n const $placeholder = $(placeholder);\n const pos = $placeholder.offset();\n const height = $placeholder.outerHeight(true); // include margin\n\n return {\n left: pos.left,\n top: pos.top + height,\n };\n}\n\nfunction attachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.on(key, events[key]);\n });\n}\n\nfunction detachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.off(key, events[key]);\n });\n}\n\n/**\n * @method isCustomStyleTag\n *\n * assert if a node contains a \"note-styletag\" class,\n * which implies that's a custom-made style tag node\n *\n * @param {Node} an HTML DOM node\n */\nfunction isCustomStyleTag(node) {\n return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n}\n\nexport default {\n /** @property {String} NBSP_CHAR */\n NBSP_CHAR,\n /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n ZERO_WIDTH_NBSP_CHAR,\n /** @property {String} blank */\n blank: blankHTML,\n /** @property {String} emptyPara */\n emptyPara: `<p>${blankHTML}</p>`,\n makePredByNodeName,\n isEditable,\n isControlSizing,\n isText,\n isElement,\n isVoid,\n isPara,\n isPurePara,\n isHeading,\n isInline,\n isBlock: func.not(isInline),\n isBodyInline,\n isBody,\n isParaInline,\n isPre,\n isList,\n isTable,\n isData,\n isCell,\n isBlockquote,\n isBodyContainer,\n isAnchor,\n isDiv: makePredByNodeName('DIV'),\n isLi,\n isBR: makePredByNodeName('BR'),\n isSpan: makePredByNodeName('SPAN'),\n isB: makePredByNodeName('B'),\n isU: makePredByNodeName('U'),\n isS: makePredByNodeName('S'),\n isI: makePredByNodeName('I'),\n isImg: makePredByNodeName('IMG'),\n isTextarea,\n deepestChildIsEmpty,\n isEmpty,\n isEmptyAnchor: func.and(isAnchor, isEmpty),\n isClosestSibling,\n withClosestSiblings,\n nodeLength,\n isLeftEdgePoint,\n isRightEdgePoint,\n isEdgePoint,\n isLeftEdgeOf,\n isRightEdgeOf,\n isLeftEdgePointOf,\n isRightEdgePointOf,\n prevPoint,\n nextPoint,\n isSamePoint,\n isVisiblePoint,\n prevPointUntil,\n nextPointUntil,\n isCharPoint,\n isSpacePoint,\n walkPoint,\n ancestor,\n singleChildAncestor,\n listAncestor,\n lastAncestor,\n listNext,\n listPrev,\n listDescendant,\n commonAncestor,\n wrap,\n insertAfter,\n appendChildNodes,\n position,\n hasChildren,\n makeOffsetPath,\n fromOffsetPath,\n splitTree,\n splitPoint,\n create,\n createText,\n remove,\n removeWhile,\n replace,\n html,\n value,\n posFromPlaceholder,\n attachEvents,\n detachEvents,\n isCustomStyleTag,\n};\n","import $ from 'jquery';\nimport func from './core/func';\nimport lists from './core/lists';\nimport dom from './core/dom';\n\nexport default class Context {\n /**\n * @param {jQuery} $note\n * @param {Object} options\n */\n constructor($note, options) {\n this.$note = $note;\n\n this.memos = {};\n this.modules = {};\n this.layoutInfo = {};\n this.options = $.extend(true, {}, options);\n\n // init ui with options\n $.summernote.ui = $.summernote.ui_template(this.options);\n this.ui = $.summernote.ui;\n\n this.initialize();\n }\n\n /**\n * create layout and initialize modules and other resources\n */\n initialize() {\n this.layoutInfo = this.ui.createLayout(this.$note);\n this._initialize();\n this.$note.hide();\n return this;\n }\n\n /**\n * destroy modules and other resources and remove layout\n */\n destroy() {\n this._destroy();\n this.$note.removeData('summernote');\n this.ui.removeLayout(this.$note, this.layoutInfo);\n }\n\n /**\n * destory modules and other resources and initialize it again\n */\n reset() {\n const disabled = this.isDisabled();\n this.code(dom.emptyPara);\n this._destroy();\n this._initialize();\n\n if (disabled) {\n this.disable();\n }\n }\n\n _initialize() {\n // set own id\n this.options.id = func.uniqueId($.now());\n // set default container for tooltips, popovers, and dialogs\n this.options.container = this.options.container || this.layoutInfo.editor;\n\n // add optional buttons\n const buttons = $.extend({}, this.options.buttons);\n Object.keys(buttons).forEach((key) => {\n this.memo('button.' + key, buttons[key]);\n });\n\n const modules = $.extend({}, this.options.modules, $.summernote.plugins || {});\n\n // add and initialize modules\n Object.keys(modules).forEach((key) => {\n this.module(key, modules[key], true);\n });\n\n Object.keys(this.modules).forEach((key) => {\n this.initializeModule(key);\n });\n }\n\n _destroy() {\n // destroy modules with reversed order\n Object.keys(this.modules).reverse().forEach((key) => {\n this.removeModule(key);\n });\n\n Object.keys(this.memos).forEach((key) => {\n this.removeMemo(key);\n });\n // trigger custom onDestroy callback\n this.triggerEvent('destroy', this);\n }\n\n code(html) {\n const isActivated = this.invoke('codeview.isActivated');\n\n if (html === undefined) {\n this.invoke('codeview.sync');\n return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n } else {\n if (isActivated) {\n this.layoutInfo.codable.val(html);\n } else {\n this.layoutInfo.editable.html(html);\n }\n this.$note.val(html);\n this.triggerEvent('change', html, this.layoutInfo.editable);\n }\n }\n\n isDisabled() {\n return this.layoutInfo.editable.attr('contenteditable') === 'false';\n }\n\n enable() {\n this.layoutInfo.editable.attr('contenteditable', true);\n this.invoke('toolbar.activate', true);\n this.triggerEvent('disable', false);\n this.options.editing = true;\n }\n\n disable() {\n // close codeview if codeview is opend\n if (this.invoke('codeview.isActivated')) {\n this.invoke('codeview.deactivate');\n }\n this.layoutInfo.editable.attr('contenteditable', false);\n this.options.editing = false;\n this.invoke('toolbar.deactivate', true);\n\n this.triggerEvent('disable', true);\n }\n\n triggerEvent() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n if (callback) {\n callback.apply(this.$note[0], args);\n }\n this.$note.trigger('summernote.' + namespace, args);\n }\n\n initializeModule(key) {\n const module = this.modules[key];\n module.shouldInitialize = module.shouldInitialize || func.ok;\n if (!module.shouldInitialize()) {\n return;\n }\n\n // initialize module\n if (module.initialize) {\n module.initialize();\n }\n\n // attach events\n if (module.events) {\n dom.attachEvents(this.$note, module.events);\n }\n }\n\n module(key, ModuleClass, withoutIntialize) {\n if (arguments.length === 1) {\n return this.modules[key];\n }\n\n this.modules[key] = new ModuleClass(this);\n\n if (!withoutIntialize) {\n this.initializeModule(key);\n }\n }\n\n removeModule(key) {\n const module = this.modules[key];\n if (module.shouldInitialize()) {\n if (module.events) {\n dom.detachEvents(this.$note, module.events);\n }\n\n if (module.destroy) {\n module.destroy();\n }\n }\n\n delete this.modules[key];\n }\n\n memo(key, obj) {\n if (arguments.length === 1) {\n return this.memos[key];\n }\n this.memos[key] = obj;\n }\n\n removeMemo(key) {\n if (this.memos[key] && this.memos[key].destroy) {\n this.memos[key].destroy();\n }\n\n delete this.memos[key];\n }\n\n /**\n * Some buttons need to change their visual style immediately once they get pressed\n */\n createInvokeHandlerAndUpdateState(namespace, value) {\n return (event) => {\n this.createInvokeHandler(namespace, value)(event);\n this.invoke('buttons.updateCurrentStyle');\n };\n }\n\n createInvokeHandler(namespace, value) {\n return (event) => {\n event.preventDefault();\n const $target = $(event.target);\n this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n };\n }\n\n invoke() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const splits = namespace.split('.');\n const hasSeparator = splits.length > 1;\n const moduleName = hasSeparator && lists.head(splits);\n const methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n\n const module = this.modules[moduleName || 'editor'];\n if (!moduleName && this[methodName]) {\n return this[methodName].apply(this, args);\n } else if (module && module[methodName] && module.shouldInitialize()) {\n return module[methodName].apply(module, args);\n }\n }\n}\n","import $ from 'jquery';\nimport env from './base/core/env';\nimport lists from './base/core/lists';\nimport Context from './base/Context';\n\n$.fn.extend({\n /**\n * Summernote API\n *\n * @param {Object|String}\n * @return {this}\n */\n summernote: function() {\n const type = $.type(lists.head(arguments));\n const isExternalAPICalled = type === 'string';\n const hasInitOptions = type === 'object';\n\n const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n\n // Update options\n options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);\n options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons);\n options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n\n this.each((idx, note) => {\n const $note = $(note);\n if (!$note.data('summernote')) {\n const context = new Context($note, options);\n $note.data('summernote', context);\n $note.data('summernote').triggerEvent('init', context.layoutInfo);\n }\n });\n\n const $note = this.first();\n if ($note.length) {\n const context = $note.data('summernote');\n if (isExternalAPICalled) {\n return context.invoke.apply(context, lists.from(arguments));\n } else if (options.focus) {\n context.invoke('editor.focus');\n }\n }\n\n return this;\n },\n});\n","import $ from 'jquery';\nimport env from './env';\nimport func from './func';\nimport lists from './lists';\nimport dom from './dom';\n\n/**\n * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n *\n * @param {TextRange} textRange\n * @param {Boolean} isStart\n * @return {BoundaryPoint}\n *\n * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n */\nfunction textRangeToPoint(textRange, isStart) {\n let container = textRange.parentElement();\n let offset;\n\n const tester = document.body.createTextRange();\n let prevContainer;\n const childNodes = lists.from(container.childNodes);\n for (offset = 0; offset < childNodes.length; offset++) {\n if (dom.isText(childNodes[offset])) {\n continue;\n }\n tester.moveToElementText(childNodes[offset]);\n if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n break;\n }\n prevContainer = childNodes[offset];\n }\n\n if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n const textRangeStart = document.body.createTextRange();\n let curTextNode = null;\n textRangeStart.moveToElementText(prevContainer || container);\n textRangeStart.collapse(!prevContainer);\n curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n\n const pointTester = textRange.duplicate();\n pointTester.setEndPoint('StartToStart', textRangeStart);\n let textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n\n while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n // [workaround] enforce IE to re-reference curTextNode, hack\n const dummy = curTextNode.nodeValue; // eslint-disable-line\n\n if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n textCount === curTextNode.nodeValue.length) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n container = curTextNode;\n offset = textCount;\n }\n\n return {\n cont: container,\n offset: offset,\n };\n}\n\n/**\n * return TextRange from boundary point (inspired by google closure-library)\n * @param {BoundaryPoint} point\n * @return {TextRange}\n */\nfunction pointToTextRange(point) {\n const textRangeInfo = function(container, offset) {\n let node, isCollapseToStart;\n\n if (dom.isText(container)) {\n const prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n const prevContainer = lists.last(prevTextNodes).previousSibling;\n node = prevContainer || container.parentNode;\n offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n isCollapseToStart = !prevContainer;\n } else {\n node = container.childNodes[offset] || container;\n if (dom.isText(node)) {\n return textRangeInfo(node, 0);\n }\n\n offset = 0;\n isCollapseToStart = false;\n }\n\n return {\n node: node,\n collapseToStart: isCollapseToStart,\n offset: offset,\n };\n };\n\n const textRange = document.body.createTextRange();\n const info = textRangeInfo(point.node, point.offset);\n\n textRange.moveToElementText(info.node);\n textRange.collapse(info.collapseToStart);\n textRange.moveStart('character', info.offset);\n return textRange;\n}\n\n/**\n * Wrapped Range\n *\n * @constructor\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n */\nclass WrappedRange {\n constructor(sc, so, ec, eo) {\n this.sc = sc;\n this.so = so;\n this.ec = ec;\n this.eo = eo;\n\n // isOnEditable: judge whether range is on editable or not\n this.isOnEditable = this.makeIsOn(dom.isEditable);\n // isOnList: judge whether range is on list node or not\n this.isOnList = this.makeIsOn(dom.isList);\n // isOnAnchor: judge whether range is on anchor node or not\n this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n // isOnCell: judge whether range is on cell node or not\n this.isOnCell = this.makeIsOn(dom.isCell);\n // isOnData: judge whether range is on data node or not\n this.isOnData = this.makeIsOn(dom.isData);\n }\n\n // nativeRange: get nativeRange from sc, so, ec, eo\n nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }\n\n getPoints() {\n return {\n sc: this.sc,\n so: this.so,\n ec: this.ec,\n eo: this.eo,\n };\n }\n\n getStartPoint() {\n return {\n node: this.sc,\n offset: this.so,\n };\n }\n\n getEndPoint() {\n return {\n node: this.ec,\n offset: this.eo,\n };\n }\n\n /**\n * select update visible range\n */\n select() {\n const nativeRng = this.nativeRange();\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (selection.rangeCount > 0) {\n selection.removeAllRanges();\n }\n selection.addRange(nativeRng);\n } else {\n nativeRng.select();\n }\n\n return this;\n }\n\n /**\n * Moves the scrollbar to start container(sc) of current range\n *\n * @return {WrappedRange}\n */\n scrollIntoView(container) {\n const height = $(container).height();\n if (container.scrollTop + height < this.sc.offsetTop) {\n container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n }\n\n return this;\n }\n\n /**\n * @return {WrappedRange}\n */\n normalize() {\n /**\n * @param {BoundaryPoint} point\n * @param {Boolean} isLeftToRight - true: prefer to choose right node\n * - false: prefer to choose left node\n * @return {BoundaryPoint}\n */\n const getVisiblePoint = function(point, isLeftToRight) {\n if (!point) {\n return point;\n }\n\n // Just use the given point [XXX:Adhoc]\n // - case 01. if the point is on the middle of the node\n // - case 02. if the point is on the right edge and prefer to choose left node\n // - case 03. if the point is on the left edge and prefer to choose right node\n // - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n // - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n // - case 06. if the point is on the block node and there is no children\n if (dom.isVisiblePoint(point)) {\n if (!dom.isEdgePoint(point) ||\n (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n return point;\n }\n }\n\n // point on block's edge\n const block = dom.ancestor(point.node, dom.isBlock);\n let hasRightNode = false;\n\n if (!hasRightNode) {\n const prevPoint = dom.prevPoint(point) || { node: null };\n hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;\n }\n\n let hasLeftNode = false;\n if (!hasLeftNode) {\n const nextPoint = dom.nextPoint(point) || { node: null };\n hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(nextPoint.node)) && isLeftToRight;\n }\n\n if (hasRightNode || hasLeftNode) {\n // returns point already on visible point\n if (dom.isVisiblePoint(point)) {\n return point;\n }\n // reverse direction\n isLeftToRight = !isLeftToRight;\n }\n\n const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n return nextPoint || point;\n };\n\n const endPoint = getVisiblePoint(this.getEndPoint(), false);\n const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns matched nodes on range\n *\n * @param {Function} [pred] - predicate function\n * @param {Object} [options]\n * @param {Boolean} [options.includeAncestor]\n * @param {Boolean} [options.fullyContains]\n * @return {Node[]}\n */\n nodes(pred, options) {\n pred = pred || func.ok;\n\n const includeAncestor = options && options.includeAncestor;\n const fullyContains = options && options.fullyContains;\n\n // TODO compare points and sort\n const startPoint = this.getStartPoint();\n const endPoint = this.getEndPoint();\n\n const nodes = [];\n const leftEdgeNodes = [];\n\n dom.walkPoint(startPoint, endPoint, function(point) {\n if (dom.isEditable(point.node)) {\n return;\n }\n\n let node;\n if (fullyContains) {\n if (dom.isLeftEdgePoint(point)) {\n leftEdgeNodes.push(point.node);\n }\n if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n node = point.node;\n }\n } else if (includeAncestor) {\n node = dom.ancestor(point.node, pred);\n } else {\n node = point.node;\n }\n\n if (node && pred(node)) {\n nodes.push(node);\n }\n }, true);\n\n return lists.unique(nodes);\n }\n\n /**\n * returns commonAncestor of range\n * @return {Element} - commonAncestor\n */\n commonAncestor() {\n return dom.commonAncestor(this.sc, this.ec);\n }\n\n /**\n * returns expanded range by pred\n *\n * @param {Function} pred - predicate function\n * @return {WrappedRange}\n */\n expand(pred) {\n const startAncestor = dom.ancestor(this.sc, pred);\n const endAncestor = dom.ancestor(this.ec, pred);\n\n if (!startAncestor && !endAncestor) {\n return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n }\n\n const boundaryPoints = this.getPoints();\n\n if (startAncestor) {\n boundaryPoints.sc = startAncestor;\n boundaryPoints.so = 0;\n }\n\n if (endAncestor) {\n boundaryPoints.ec = endAncestor;\n boundaryPoints.eo = dom.nodeLength(endAncestor);\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * @param {Boolean} isCollapseToStart\n * @return {WrappedRange}\n */\n collapse(isCollapseToStart) {\n if (isCollapseToStart) {\n return new WrappedRange(this.sc, this.so, this.sc, this.so);\n } else {\n return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n }\n }\n\n /**\n * splitText on range\n */\n splitText() {\n const isSameContainer = this.sc === this.ec;\n const boundaryPoints = this.getPoints();\n\n if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n this.ec.splitText(this.eo);\n }\n\n if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n boundaryPoints.sc = this.sc.splitText(this.so);\n boundaryPoints.so = 0;\n\n if (isSameContainer) {\n boundaryPoints.ec = boundaryPoints.sc;\n boundaryPoints.eo = this.eo - this.so;\n }\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * delete contents on range\n * @return {WrappedRange}\n */\n deleteContents() {\n if (this.isCollapsed()) {\n return this;\n }\n\n const rng = this.splitText();\n const nodes = rng.nodes(null, {\n fullyContains: true,\n });\n\n // find new cursor point\n const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {\n return !lists.contains(nodes, point.node);\n });\n\n const emptyParents = [];\n $.each(nodes, function(idx, node) {\n // find empty parents\n const parent = node.parentNode;\n if (point.node !== parent && dom.nodeLength(parent) === 1) {\n emptyParents.push(parent);\n }\n dom.remove(node, false);\n });\n\n // remove empty parents\n $.each(emptyParents, function(idx, node) {\n dom.remove(node, false);\n });\n\n return new WrappedRange(\n point.node,\n point.offset,\n point.node,\n point.offset\n ).normalize();\n }\n\n /**\n * makeIsOn: return isOn(pred) function\n */\n makeIsOn(pred) {\n return function() {\n const ancestor = dom.ancestor(this.sc, pred);\n return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n };\n }\n\n /**\n * @param {Function} pred\n * @return {Boolean}\n */\n isLeftEdgeOf(pred) {\n if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n return false;\n }\n\n const node = dom.ancestor(this.sc, pred);\n return node && dom.isLeftEdgeOf(this.sc, node);\n }\n\n /**\n * returns whether range was collapsed or not\n */\n isCollapsed() {\n return this.sc === this.ec && this.so === this.eo;\n }\n\n /**\n * wrap inline nodes which children of body with paragraph\n *\n * @return {WrappedRange}\n */\n wrapBodyInlineWithPara() {\n if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n this.sc.innerHTML = dom.emptyPara;\n return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n }\n\n /**\n * [workaround] firefox often create range on not visible point. so normalize here.\n * - firefox: |<p>text</p>|\n * - chrome: <p>|text|</p>\n */\n const rng = this.normalize();\n if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n return rng;\n }\n\n // find inline top ancestor\n let topAncestor;\n if (dom.isInline(rng.sc)) {\n const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n topAncestor = lists.last(ancestors);\n if (!dom.isInline(topAncestor)) {\n topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n }\n } else {\n topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n }\n\n if (topAncestor) {\n // siblings not in paragraph\n let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n\n // wrap with paragraph\n if (inlineSiblings.length) {\n const para = dom.wrap(lists.head(inlineSiblings), 'p');\n dom.appendChildNodes(para, lists.tail(inlineSiblings));\n }\n }\n\n return this.normalize();\n }\n\n /**\n * insert node at current cursor\n *\n * @param {Node} node\n * @return {Node}\n */\n insertNode(node) {\n let rng = this;\n\n if (dom.isText(node) || dom.isInline(node)) {\n rng = this.wrapBodyInlineWithPara().deleteContents();\n }\n\n const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n if (info.rightNode) {\n info.rightNode.parentNode.insertBefore(node, info.rightNode);\n } else {\n info.container.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * insert html at current cursor\n */\n pasteHTML(markup) {\n markup = $.trim(markup);\n\n const contentsContainer = $('<div></div>').html(markup)[0];\n let childNodes = lists.from(contentsContainer.childNodes);\n\n // const rng = this.wrapBodyInlineWithPara().deleteContents();\n const rng = this;\n\n if (rng.so >= 0) {\n childNodes = childNodes.reverse();\n }\n childNodes = childNodes.map(function(childNode) {\n return rng.insertNode(childNode);\n });\n if (rng.so > 0) {\n childNodes = childNodes.reverse();\n }\n return childNodes;\n }\n\n /**\n * returns text in range\n *\n * @return {String}\n */\n toString() {\n const nativeRng = this.nativeRange();\n return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n }\n\n /**\n * returns range for word before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordRange(findAfter) {\n let endPoint = this.getEndPoint();\n\n if (!dom.isCharPoint(endPoint)) {\n return this;\n }\n\n const startPoint = dom.prevPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordsRange(findAfter) {\n var endPoint = this.getEndPoint();\n\n var isNotTextPoint = function(point) {\n return !dom.isCharPoint(point) && !dom.isSpacePoint(point);\n };\n\n if (isNotTextPoint(endPoint)) {\n return this;\n }\n\n var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor that match with a Regex\n *\n * example:\n * range: 'hi @Peter Pan'\n * regex: '/@[a-z ]+/i'\n * return range: '@Peter Pan'\n *\n * @param {RegExp} [regex]\n * @return {WrappedRange|null}\n */\n getWordsMatchRange(regex) {\n var endPoint = this.getEndPoint();\n\n var startPoint = dom.prevPointUntil(endPoint, function(point) {\n if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {\n return true;\n }\n var rng = new WrappedRange(\n point.node,\n point.offset,\n endPoint.node,\n endPoint.offset\n );\n var result = regex.exec(rng.toString());\n return result && result.index === 0;\n });\n\n var rng = new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n\n var text = rng.toString();\n var result = regex.exec(text);\n\n if (result && result[0].length === text.length) {\n return rng;\n } else {\n return null;\n }\n }\n\n /**\n * create offsetPath bookmark\n *\n * @param {Node} editable\n */\n bookmark(editable) {\n return {\n s: {\n path: dom.makeOffsetPath(editable, this.sc),\n offset: this.so,\n },\n e: {\n path: dom.makeOffsetPath(editable, this.ec),\n offset: this.eo,\n },\n };\n }\n\n /**\n * create offsetPath bookmark base on paragraph\n *\n * @param {Node[]} paras\n */\n paraBookmark(paras) {\n return {\n s: {\n path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n offset: this.so,\n },\n e: {\n path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n offset: this.eo,\n },\n };\n }\n\n /**\n * getClientRects\n * @return {Rect[]}\n */\n getClientRects() {\n const nativeRng = this.nativeRange();\n return nativeRng.getClientRects();\n }\n}\n\n/**\n * Data structure\n * * BoundaryPoint: a point of dom tree\n * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n *\n * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n */\nexport default {\n /**\n * create Range Object From arguments or Browser Selection\n *\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n * @return {WrappedRange}\n */\n create: function(sc, so, ec, eo) {\n if (arguments.length === 4) {\n return new WrappedRange(sc, so, ec, eo);\n } else if (arguments.length === 2) { // collapsed\n ec = sc;\n eo = so;\n return new WrappedRange(sc, so, ec, eo);\n } else {\n let wrappedRange = this.createFromSelection();\n\n if (!wrappedRange && arguments.length === 1) {\n let bodyElement = arguments[0];\n if (dom.isEditable(bodyElement)) {\n bodyElement = bodyElement.lastChild;\n }\n return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);\n }\n return wrappedRange;\n }\n },\n\n createFromBodyElement: function(bodyElement, isCollapseToStart = false) {\n var wrappedRange = this.createFromNode(bodyElement);\n return wrappedRange.collapse(isCollapseToStart);\n },\n\n createFromSelection: function() {\n let sc, so, ec, eo;\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n } else if (dom.isBody(selection.anchorNode)) {\n // Firefox: returns entire body as range on initialization.\n // We won't never need it.\n return null;\n }\n\n const nativeRng = selection.getRangeAt(0);\n sc = nativeRng.startContainer;\n so = nativeRng.startOffset;\n ec = nativeRng.endContainer;\n eo = nativeRng.endOffset;\n } else { // IE8: TextRange\n const textRange = document.selection.createRange();\n const textRangeEnd = textRange.duplicate();\n textRangeEnd.collapse(false);\n const textRangeStart = textRange;\n textRangeStart.collapse(true);\n\n let startPoint = textRangeToPoint(textRangeStart, true);\n let endPoint = textRangeToPoint(textRangeEnd, false);\n\n // same visible point case: range was collapsed.\n if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n endPoint.node.nextSibling === startPoint.node) {\n startPoint = endPoint;\n }\n\n sc = startPoint.cont;\n so = startPoint.offset;\n ec = endPoint.cont;\n eo = endPoint.offset;\n }\n\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from node\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNode: function(node) {\n let sc = node;\n let so = 0;\n let ec = node;\n let eo = dom.nodeLength(ec);\n\n // browsers can't target a picture or void node\n if (dom.isVoid(sc)) {\n so = dom.listPrev(sc).length - 1;\n sc = sc.parentNode;\n }\n if (dom.isBR(ec)) {\n eo = dom.listPrev(ec).length - 1;\n ec = ec.parentNode;\n } else if (dom.isVoid(ec)) {\n eo = dom.listPrev(ec).length;\n ec = ec.parentNode;\n }\n\n return this.create(sc, so, ec, eo);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeBefore: function(node) {\n return this.createFromNode(node).collapse(true);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeAfter: function(node) {\n return this.createFromNode(node).collapse();\n },\n\n /**\n * @method\n *\n * create WrappedRange from bookmark\n *\n * @param {Node} editable\n * @param {Object} bookmark\n * @return {WrappedRange}\n */\n createFromBookmark: function(editable, bookmark) {\n const sc = dom.fromOffsetPath(editable, bookmark.s.path);\n const so = bookmark.s.offset;\n const ec = dom.fromOffsetPath(editable, bookmark.e.path);\n const eo = bookmark.e.offset;\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from paraBookmark\n *\n * @param {Object} bookmark\n * @param {Node[]} paras\n * @return {WrappedRange}\n */\n createFromParaBookmark: function(bookmark, paras) {\n const so = bookmark.s.offset;\n const eo = bookmark.e.offset;\n const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n\n return new WrappedRange(sc, so, ec, eo);\n },\n};\n","import lists from './lists';\nimport func from './func';\n\nconst KEY_MAP = {\n 'BACKSPACE': 8,\n 'TAB': 9,\n 'ENTER': 13,\n 'SPACE': 32,\n 'DELETE': 46,\n\n // Arrow\n 'LEFT': 37,\n 'UP': 38,\n 'RIGHT': 39,\n 'DOWN': 40,\n\n // Number: 0-9\n 'NUM0': 48,\n 'NUM1': 49,\n 'NUM2': 50,\n 'NUM3': 51,\n 'NUM4': 52,\n 'NUM5': 53,\n 'NUM6': 54,\n 'NUM7': 55,\n 'NUM8': 56,\n\n // Alphabet: a-z\n 'B': 66,\n 'E': 69,\n 'I': 73,\n 'J': 74,\n 'K': 75,\n 'L': 76,\n 'R': 82,\n 'S': 83,\n 'U': 85,\n 'V': 86,\n 'Y': 89,\n 'Z': 90,\n\n 'SLASH': 191,\n 'LEFTBRACKET': 219,\n 'BACKSLASH': 220,\n 'RIGHTBRACKET': 221,\n\n // Navigation\n 'HOME': 36,\n 'END': 35,\n 'PAGEUP': 33,\n 'PAGEDOWN': 34,\n};\n\n/**\n * @class core.key\n *\n * Object for keycodes.\n *\n * @singleton\n * @alternateClassName key\n */\nexport default {\n /**\n * @method isEdit\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isEdit: (keyCode) => {\n return lists.contains([\n KEY_MAP.BACKSPACE,\n KEY_MAP.TAB,\n KEY_MAP.ENTER,\n KEY_MAP.SPACE,\n KEY_MAP.DELETE,\n ], keyCode);\n },\n /**\n * @method isMove\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isMove: (keyCode) => {\n return lists.contains([\n KEY_MAP.LEFT,\n KEY_MAP.UP,\n KEY_MAP.RIGHT,\n KEY_MAP.DOWN,\n ], keyCode);\n },\n /**\n * @method isNavigation\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isNavigation: (keyCode) => {\n return lists.contains([\n KEY_MAP.HOME,\n KEY_MAP.END,\n KEY_MAP.PAGEUP,\n KEY_MAP.PAGEDOWN,\n ], keyCode);\n },\n /**\n * @property {Object} nameFromCode\n * @property {String} nameFromCode.8 \"BACKSPACE\"\n */\n nameFromCode: func.invertObject(KEY_MAP),\n code: KEY_MAP,\n};\n","import $ from 'jquery';\n\n/**\n * @method readFileAsDataURL\n *\n * read contents of file as representing URL\n *\n * @param {File} file\n * @return {Promise} - then: dataUrl\n */\nexport function readFileAsDataURL(file) {\n return $.Deferred((deferred) => {\n $.extend(new FileReader(), {\n onload: (e) => {\n const dataURL = e.target.result;\n deferred.resolve(dataURL);\n },\n onerror: (err) => {\n deferred.reject(err);\n },\n }).readAsDataURL(file);\n }).promise();\n}\n\n/**\n * @method createImage\n *\n * create `<image>` from url string\n *\n * @param {String} url\n * @return {Promise} - then: $image\n */\nexport function createImage(url) {\n return $.Deferred((deferred) => {\n const $img = $('<img>');\n\n $img.one('load', () => {\n $img.off('error abort');\n deferred.resolve($img);\n }).one('error abort', () => {\n $img.off('load').detach();\n deferred.reject($img);\n }).css({\n display: 'none',\n }).appendTo(document.body).attr('src', url);\n }).promise();\n}\n","import range from '../core/range';\n\nexport default class History {\n constructor(context) {\n this.stack = [];\n this.stackOffset = -1;\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n this.editable = this.$editable[0];\n }\n\n makeSnapshot() {\n const rng = range.create(this.editable);\n const emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n\n return {\n contents: this.$editable.html(),\n bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark),\n };\n }\n\n applySnapshot(snapshot) {\n if (snapshot.contents !== null) {\n this.$editable.html(snapshot.contents);\n }\n if (snapshot.bookmark !== null) {\n range.createFromBookmark(this.editable, snapshot.bookmark).select();\n }\n }\n\n /**\n * @method rewind\n * Rewinds the history stack back to the first snapshot taken.\n * Leaves the stack intact, so that \"Redo\" can still be used.\n */\n rewind() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n // Return to the first available snapshot.\n this.stackOffset = 0;\n\n // Apply that snapshot.\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n\n /**\n * @method commit\n * Resets history stack, but keeps current editor's content.\n */\n commit() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * @method reset\n * Resets the history stack completely; reverting to an empty editor.\n */\n reset() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Clear the editable area.\n this.$editable.html('');\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * undo\n */\n undo() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n if (this.stackOffset > 0) {\n this.stackOffset--;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * redo\n */\n redo() {\n if (this.stack.length - 1 > this.stackOffset) {\n this.stackOffset++;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * recorded undo\n */\n recordUndo() {\n this.stackOffset++;\n\n // Wash out stack after stackOffset\n if (this.stack.length > this.stackOffset) {\n this.stack = this.stack.slice(0, this.stackOffset);\n }\n\n // Create new snapshot and push it to the end\n this.stack.push(this.makeSnapshot());\n\n // If the stack size reachs to the limit, then slice it\n if (this.stack.length > this.context.options.historyLimit) {\n this.stack.shift();\n this.stackOffset -= 1;\n }\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class Style {\n /**\n * @method jQueryCSS\n *\n * [workaround] for old jQuery\n * passing an array of style properties to .css()\n * will result in an object of property-value pairs.\n * (compability with version < 1.9)\n *\n * @private\n * @param {jQuery} $obj\n * @param {Array} propertyNames - An array of one or more CSS properties.\n * @return {Object}\n */\n jQueryCSS($obj, propertyNames) {\n if (env.jqueryVersion < 1.9) {\n const result = {};\n $.each(propertyNames, (idx, propertyName) => {\n result[propertyName] = $obj.css(propertyName);\n });\n return result;\n }\n return $obj.css(propertyNames);\n }\n\n /**\n * returns style object from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n fromNode($node) {\n const properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n const styleInfo = this.jQueryCSS($node, properties) || {};\n\n const fontSize = $node[0].style.fontSize || styleInfo['font-size'];\n\n styleInfo['font-size'] = parseInt(fontSize, 10);\n styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);\n\n return styleInfo;\n }\n\n /**\n * paragraph level style\n *\n * @param {WrappedRange} rng\n * @param {Object} styleInfo\n */\n stylePara(rng, styleInfo) {\n $.each(rng.nodes(dom.isPara, {\n includeAncestor: true,\n }), (idx, para) => {\n $(para).css(styleInfo);\n });\n }\n\n /**\n * insert and returns styleNodes on range.\n *\n * @param {WrappedRange} rng\n * @param {Object} [options] - options for styleNodes\n * @param {String} [options.nodeName] - default: `SPAN`\n * @param {Boolean} [options.expandClosestSibling] - default: `false`\n * @param {Boolean} [options.onlyPartialContains] - default: `false`\n * @return {Node[]}\n */\n styleNodes(rng, options) {\n rng = rng.splitText();\n\n const nodeName = (options && options.nodeName) || 'SPAN';\n const expandClosestSibling = !!(options && options.expandClosestSibling);\n const onlyPartialContains = !!(options && options.onlyPartialContains);\n\n if (rng.isCollapsed()) {\n return [rng.insertNode(dom.create(nodeName))];\n }\n\n let pred = dom.makePredByNodeName(nodeName);\n const nodes = rng.nodes(dom.isText, {\n fullyContains: true,\n }).map((text) => {\n return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n });\n\n if (expandClosestSibling) {\n if (onlyPartialContains) {\n const nodesInRange = rng.nodes();\n // compose with partial contains predication\n pred = func.and(pred, (node) => {\n return lists.contains(nodesInRange, node);\n });\n }\n\n return nodes.map((node) => {\n const siblings = dom.withClosestSiblings(node, pred);\n const head = lists.head(siblings);\n const tails = lists.tail(siblings);\n $.each(tails, (idx, elem) => {\n dom.appendChildNodes(head, elem.childNodes);\n dom.remove(elem);\n });\n return lists.head(siblings);\n });\n } else {\n return nodes;\n }\n }\n\n /**\n * get current style on cursor\n *\n * @param {WrappedRange} rng\n * @return {Object} - object contains style properties.\n */\n current(rng) {\n const $cont = $(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n let styleInfo = this.fromNode($cont);\n\n // document.queryCommandState for toggle state\n // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n try {\n styleInfo = $.extend(styleInfo, {\n 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'],\n });\n } catch (e) {\n // eslint-disable-next-line\n }\n\n // list-style-type to list-style(unordered, ordered)\n if (!rng.isOnList()) {\n styleInfo['list-style'] = 'none';\n } else {\n const orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n const isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n }\n\n const para = dom.ancestor(rng.sc, dom.isPara);\n if (para && para.style['line-height']) {\n styleInfo['line-height'] = para.style.lineHeight;\n } else {\n const lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n styleInfo['line-height'] = lineHeight.toFixed(1);\n }\n\n styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n styleInfo.range = rng;\n\n return styleInfo;\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport func from '../core/func';\nimport dom from '../core/dom';\nimport range from '../core/range';\n\nexport default class Bullet {\n /**\n * toggle ordered list\n */\n insertOrderedList(editable) {\n this.toggleList('OL', editable);\n }\n\n /**\n * toggle unordered list\n */\n insertUnorderedList(editable) {\n this.toggleList('UL', editable);\n }\n\n /**\n * indent\n */\n indent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n const previousList = this.findList(head.previousSibling);\n if (previousList) {\n paras\n .map(para => previousList.appendChild(para));\n } else {\n this.wrapList(paras, head.parentNode.nodeName);\n paras\n .map((para) => para.parentNode)\n .map((para) => this.appendToPrevious(para));\n }\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n return (parseInt(val, 10) || 0) + 25;\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * outdent\n */\n outdent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n this.releaseList([paras]);\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n val = (parseInt(val, 10) || 0);\n return val > 25 ? val - 25 : '';\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * toggle list\n *\n * @param {String} listName - OL or UL\n */\n toggleList(listName, editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n let paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const bookmark = rng.paraBookmark(paras);\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n // paragraph to list\n if (lists.find(paras, dom.isPurePara)) {\n let wrappedParas = [];\n $.each(clustereds, (idx, paras) => {\n wrappedParas = wrappedParas.concat(this.wrapList(paras, listName));\n });\n paras = wrappedParas;\n // list to paragraph or change list style\n } else {\n const diffLists = rng.nodes(dom.isList, {\n includeAncestor: true,\n }).filter((listNode) => {\n return !$.nodeName(listNode, listName);\n });\n\n if (diffLists.length) {\n $.each(diffLists, (idx, listNode) => {\n dom.replace(listNode, listName);\n });\n } else {\n paras = this.releaseList(clustereds, true);\n }\n }\n\n range.createFromParaBookmark(bookmark, paras).select();\n }\n\n /**\n * @param {Node[]} paras\n * @param {String} listName\n * @return {Node[]}\n */\n wrapList(paras, listName) {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const prevList = dom.isList(head.previousSibling) && head.previousSibling;\n const nextList = dom.isList(last.nextSibling) && last.nextSibling;\n\n const listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n\n // P to LI\n paras = paras.map((para) => {\n return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n });\n\n // append to list(<ul>, <ol>)\n dom.appendChildNodes(listNode, paras);\n\n if (nextList) {\n dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n dom.remove(nextList);\n }\n\n return paras;\n }\n\n /**\n * @method releaseList\n *\n * @param {Array[]} clustereds\n * @param {Boolean} isEscapseToBody\n * @return {Node[]}\n */\n releaseList(clustereds, isEscapseToBody) {\n let releasedParas = [];\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n const parentItem = headList.parentNode;\n\n if (headList.parentNode.nodeName === 'LI') {\n paras.map(para => {\n const newList = this.findNextSiblings(para);\n\n if (parentItem.nextSibling) {\n parentItem.parentNode.insertBefore(\n para,\n parentItem.nextSibling\n );\n } else {\n parentItem.parentNode.appendChild(para);\n }\n\n if (newList.length) {\n this.wrapList(newList, headList.nodeName);\n para.appendChild(newList[0].parentNode);\n }\n });\n\n if (headList.children.length === 0) {\n parentItem.removeChild(headList);\n }\n\n if (parentItem.childNodes.length === 0) {\n parentItem.parentNode.removeChild(parentItem);\n }\n } else {\n const lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n node: last.parentNode,\n offset: dom.position(last) + 1,\n }, {\n isSkipPaddingBlankHTML: true,\n }) : null;\n\n const middleList = dom.splitTree(headList, {\n node: head.parentNode,\n offset: dom.position(head),\n }, {\n isSkipPaddingBlankHTML: true,\n });\n\n paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n : lists.from(middleList.childNodes).filter(dom.isLi);\n\n // LI to P\n if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n paras = paras.map((para) => {\n return dom.replace(para, 'P');\n });\n }\n\n $.each(lists.from(paras).reverse(), (idx, para) => {\n dom.insertAfter(para, headList);\n });\n\n // remove empty lists\n const rootLists = lists.compact([headList, middleList, lastList]);\n $.each(rootLists, (idx, rootList) => {\n const listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n $.each(listNodes.reverse(), (idx, listNode) => {\n if (!dom.nodeLength(listNode)) {\n dom.remove(listNode, true);\n }\n });\n });\n }\n\n releasedParas = releasedParas.concat(paras);\n });\n\n return releasedParas;\n }\n\n /**\n * @method appendToPrevious\n *\n * Appends list to previous list item, if\n * none exist it wraps the list in a new list item.\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n appendToPrevious(node) {\n return node.previousSibling\n ? dom.appendChildNodes(node.previousSibling, [node])\n : this.wrapList([node], 'LI');\n }\n\n /**\n * @method findList\n *\n * Finds an existing list in list item\n *\n * @param {HTMLNode} ListItem\n * @return {Array[]}\n */\n findList(node) {\n return node\n ? lists.find(node.children, child => ['OL', 'UL'].indexOf(child.nodeName) > -1)\n : null;\n }\n\n /**\n * @method findNextSiblings\n *\n * Finds all list item siblings that follow it\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n findNextSiblings(node) {\n const siblings = [];\n while (node.nextSibling) {\n siblings.push(node.nextSibling);\n node = node.nextSibling;\n }\n return siblings;\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport Bullet from '../editing/Bullet';\n\n/**\n * @class editing.Typing\n *\n * Typing\n *\n */\nexport default class Typing {\n constructor(context) {\n // a Bullet instance to toggle lists off\n this.bullet = new Bullet();\n this.options = context.options;\n }\n\n /**\n * insert tab\n *\n * @param {WrappedRange} rng\n * @param {Number} tabsize\n */\n insertTab(rng, tabsize) {\n const tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n rng = rng.deleteContents();\n rng.insertNode(tab, true);\n\n rng = range.create(tab, tabsize);\n rng.select();\n }\n\n /**\n * insert paragraph\n *\n * @param {jQuery} $editable\n * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n *\n * blockquoteBreakingLevel\n * 0 - No break, the new paragraph remains inside the quote\n * 1 - Break the first blockquote in the ancestors list\n * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n */\n insertParagraph(editable, rng) {\n rng = rng || range.create(editable);\n\n // deleteContents on range.\n rng = rng.deleteContents();\n\n // Wrap range if it needs to be wrapped by paragraph\n rng = rng.wrapBodyInlineWithPara();\n\n // finding paragraph\n const splitRoot = dom.ancestor(rng.sc, dom.isPara);\n\n let nextPara;\n // on paragraph: split paragraph\n if (splitRoot) {\n // if it is an empty line with li\n if (dom.isLi(splitRoot) && (dom.isEmpty(splitRoot) || dom.deepestChildIsEmpty(splitRoot))) {\n // toogle UL/OL and escape\n this.bullet.toggleList(splitRoot.parentNode.nodeName);\n return;\n } else {\n let blockquote = null;\n if (this.options.blockquoteBreakingLevel === 1) {\n blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n } else if (this.options.blockquoteBreakingLevel === 2) {\n blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n }\n\n if (blockquote) {\n // We're inside a blockquote and options ask us to break it\n nextPara = $(dom.emptyPara)[0];\n // If the split is right before a <br>, remove it so that there's no \"empty line\"\n // after the split in the new blockquote created\n if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n $(rng.sc.nextSibling).remove();\n }\n const split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n if (split) {\n split.parentNode.insertBefore(nextPara, split);\n } else {\n dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n }\n } else {\n nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n\n // not a blockquote, just insert the paragraph\n let emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n\n $.each(emptyAnchors, (idx, anchor) => {\n dom.remove(anchor);\n });\n\n // replace empty heading, pre or custom-made styleTag with P tag\n if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n nextPara = dom.replace(nextPara, 'p');\n }\n }\n }\n // no paragraph: insert empty paragraph\n } else {\n const next = rng.sc.childNodes[rng.so];\n nextPara = $(dom.emptyPara)[0];\n if (next) {\n rng.sc.insertBefore(nextPara, next);\n } else {\n rng.sc.appendChild(nextPara);\n }\n }\n\n range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport lists from '../core/lists';\n\n/**\n * @class Create a virtual table to create what actions to do in change.\n * @param {object} startPoint Cell selected to apply change.\n * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where\n * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n * @param {object} domTable Dom element of table to make changes.\n */\nconst TableResultAction = function(startPoint, where, action, domTable) {\n const _startPoint = { 'colPos': 0, 'rowPos': 0 };\n const _virtualTable = [];\n const _actionCellList = [];\n\n /// ///////////////////////////////////////////\n // Private functions\n /// ///////////////////////////////////////////\n\n /**\n * Set the startPoint of action.\n */\n function setStartPoint() {\n if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n // Impossible to identify start Cell point\n return;\n }\n _startPoint.colPos = startPoint.cellIndex;\n if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n // Impossible to identify start Row point\n return;\n }\n _startPoint.rowPos = startPoint.parentElement.rowIndex;\n }\n\n /**\n * Define virtual table position info object.\n *\n * @param {int} rowIndex Index position in line of virtual table.\n * @param {int} cellIndex Index position in column of virtual table.\n * @param {object} baseRow Row affected by this position.\n * @param {object} baseCell Cell affected by this position.\n * @param {bool} isSpan Inform if it is an span cell/row.\n */\n function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n const objPosition = {\n 'baseRow': baseRow,\n 'baseCell': baseCell,\n 'isRowSpan': isRowSpan,\n 'isColSpan': isColSpan,\n 'isVirtual': isVirtualCell,\n };\n if (!_virtualTable[rowIndex]) {\n _virtualTable[rowIndex] = [];\n }\n _virtualTable[rowIndex][cellIndex] = objPosition;\n }\n\n /**\n * Create action cell object.\n *\n * @param {object} virtualTableCellObj Object of specific position on virtual table.\n * @param {enum} resultAction Action to be applied in that item.\n */\n function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n return {\n 'baseCell': virtualTableCellObj.baseCell,\n 'action': resultAction,\n 'virtualTable': {\n 'rowIndex': virtualRowPosition,\n 'cellIndex': virtualColPosition,\n },\n };\n }\n\n /**\n * Recover free index of row to append Cell.\n *\n * @param {int} rowIndex Index of row to find free space.\n * @param {int} cellIndex Index of cell to find free space in table.\n */\n function recoverCellIndex(rowIndex, cellIndex) {\n if (!_virtualTable[rowIndex]) {\n return cellIndex;\n }\n if (!_virtualTable[rowIndex][cellIndex]) {\n return cellIndex;\n }\n\n let newCellIndex = cellIndex;\n while (_virtualTable[rowIndex][newCellIndex]) {\n newCellIndex++;\n if (!_virtualTable[rowIndex][newCellIndex]) {\n return newCellIndex;\n }\n }\n }\n\n /**\n * Recover info about row and cell and add information to virtual table.\n *\n * @param {object} row Row to recover information.\n * @param {object} cell Cell to recover information.\n */\n function addCellInfoToVirtual(row, cell) {\n const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n const cellHasColspan = (cell.colSpan > 1);\n const cellHasRowspan = (cell.rowSpan > 1);\n const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n\n // Add span rows to virtual Table.\n const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n if (rowspanNumber > 1) {\n for (let rp = 1; rp < rowspanNumber; rp++) {\n const rowspanIndex = row.rowIndex + rp;\n adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n }\n }\n\n // Add span cols to virtual table.\n const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n if (colspanNumber > 1) {\n for (let cp = 1; cp < colspanNumber; cp++) {\n const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n }\n }\n }\n\n /**\n * Process validation and adjust of start point if needed\n *\n * @param {int} rowIndex\n * @param {int} cellIndex\n * @param {object} cell\n * @param {bool} isSelectedCell\n */\n function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n _startPoint.colPos++;\n }\n }\n\n /**\n * Create virtual table of cells with all cells, including span cells.\n */\n function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getDeleteResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n case TableResultAction.where.Row:\n if (!cell.isVirtual && cell.isRowSpan) {\n return TableResultAction.resultAction.AddCell;\n } else if (cell.isRowSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n }\n return TableResultAction.resultAction.RemoveCell;\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getAddResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isRowSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n case TableResultAction.where.Row:\n if (cell.isRowSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isColSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n }\n return TableResultAction.resultAction.AddCell;\n }\n\n function init() {\n setStartPoint();\n createVirtualTable();\n }\n\n /// ///////////////////////////////////////////\n // Public functions\n /// ///////////////////////////////////////////\n\n /**\n * Recover array os what to do in table.\n */\n this.getActionList = function() {\n const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n\n let actualPosition = 0;\n let canContinue = true;\n while (canContinue) {\n const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n const row = _virtualTable[rowPosition];\n if (!row) {\n canContinue = false;\n return _actionCellList;\n }\n const cell = row[colPosition];\n if (!cell) {\n canContinue = false;\n return _actionCellList;\n }\n\n // Define action to be applied in this cell\n let resultAction = TableResultAction.resultAction.Ignore;\n switch (action) {\n case TableResultAction.requestAction.Add:\n resultAction = getAddResultActionToCell(cell);\n break;\n case TableResultAction.requestAction.Delete:\n resultAction = getDeleteResultActionToCell(cell);\n break;\n }\n _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n actualPosition++;\n }\n\n return _actionCellList;\n };\n\n init();\n};\n/**\n*\n* Where action occours enum.\n*/\nTableResultAction.where = { 'Row': 0, 'Column': 1 };\n/**\n*\n* Requested action to apply enum.\n*/\nTableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n/**\n*\n* Result action to be executed enum.\n*/\nTableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n\n/**\n *\n * @class editing.Table\n *\n * Table\n *\n */\nexport default class Table {\n /**\n * handle tab key\n *\n * @param {WrappedRange} rng\n * @param {Boolean} isShift\n */\n tab(rng, isShift) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const table = dom.ancestor(cell, dom.isTable);\n const cells = dom.listDescendant(table, dom.isCell);\n\n const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n if (nextCell) {\n range.create(nextCell, 0).select();\n }\n }\n\n /**\n * Add a new row\n *\n * @param {WrappedRange} rng\n * @param {String} position (top/bottom)\n * @return {Node}\n */\n addRow(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n\n const currentTr = $(cell).closest('tr');\n const trAttributes = this.recoverAttributes(currentTr);\n const html = $('<tr' + trAttributes + '></tr>');\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let idCell = 0; idCell < actions.length; idCell++) {\n const currentCell = actions[idCell];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n break;\n case TableResultAction.resultAction.SumSpanCount:\n {\n if (position === 'top') {\n const baseCellTr = currentCell.baseCell.parent;\n const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n if (isTopFromRowSpan) {\n const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n html.append(newTd);\n break;\n }\n }\n let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n rowspanNumber++;\n currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n }\n break;\n }\n }\n\n if (position === 'top') {\n currentTr.before(html);\n } else {\n const cellHasRowspan = (cell.rowSpan > 1);\n if (cellHasRowspan) {\n const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n $($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));\n return;\n }\n currentTr.after(html);\n }\n }\n\n /**\n * Add a new col\n *\n * @param {WrappedRange} rng\n * @param {String} position (left/right)\n * @return {Node}\n */\n addCol(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const rowsGroup = $(row).siblings();\n rowsGroup.push(row);\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Add, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n const currentCell = actions[actionIndex];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n if (position === 'right') {\n $(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n case TableResultAction.resultAction.SumSpanCount:\n if (position === 'right') {\n let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n colspanNumber++;\n currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n }\n }\n }\n\n /*\n * Copy attributes from element.\n *\n * @param {object} Element to recover attributes.\n * @return {string} Copied string elements.\n */\n recoverAttributes(el) {\n let resultStr = '';\n\n if (!el) {\n return resultStr;\n }\n\n const attrList = el.attributes || [];\n\n for (let i = 0; i < attrList.length; i++) {\n if (attrList[i].name.toLowerCase() === 'id') {\n continue;\n }\n\n if (attrList[i].specified) {\n resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n }\n }\n\n return resultStr;\n }\n\n /**\n * Delete current row\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteRow(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n const rowPos = row[0].rowIndex;\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n\n const baseCell = actions[actionIndex].baseCell;\n const virtualPosition = actions[actionIndex].virtualTable;\n const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.AddCell:\n {\n const nextRow = row.next('tr')[0];\n if (!nextRow) { continue; }\n const cloneRow = row[0].cells[cellPos];\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n nextRow.cells[cellPos].innerHTML = '';\n } else if (rowspanNumber === 2) {\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].removeAttribute('rowSpan');\n nextRow.cells[cellPos].innerHTML = '';\n }\n }\n }\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n baseCell.setAttribute('rowSpan', rowspanNumber);\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (rowspanNumber === 2) {\n baseCell.removeAttribute('rowSpan');\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n // Do not need remove cell because row will be deleted.\n continue;\n }\n }\n row.remove();\n }\n\n /**\n * Delete current col\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteCol(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n {\n const baseCell = actions[actionIndex].baseCell;\n const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n if (hasColspan) {\n let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n if (colspanNumber > 2) {\n colspanNumber--;\n baseCell.setAttribute('colSpan', colspanNumber);\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (colspanNumber === 2) {\n baseCell.removeAttribute('colSpan');\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n dom.remove(actions[actionIndex].baseCell, true);\n continue;\n }\n }\n }\n\n /**\n * create empty table element\n *\n * @param {Number} rowCount\n * @param {Number} colCount\n * @return {Node}\n */\n createTable(colCount, rowCount, options) {\n const tds = [];\n let tdHTML;\n for (let idxCol = 0; idxCol < colCount; idxCol++) {\n tds.push('<td>' + dom.blank + '</td>');\n }\n tdHTML = tds.join('');\n\n const trs = [];\n let trHTML;\n for (let idxRow = 0; idxRow < rowCount; idxRow++) {\n trs.push('<tr>' + tdHTML + '</tr>');\n }\n trHTML = trs.join('');\n const $table = $('<table>' + trHTML + '</table>');\n if (options && options.tableClassName) {\n $table.addClass(options.tableClassName);\n }\n\n return $table[0];\n }\n\n /**\n * Delete current table\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteTable(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n $(cell).closest('table').remove();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport { readFileAsDataURL, createImage } from '../core/async';\nimport History from '../editing/History';\nimport Style from '../editing/Style';\nimport Typing from '../editing/Typing';\nimport Table from '../editing/Table';\nimport Bullet from '../editing/Bullet';\n\nconst KEY_BOGUS = 'bogus';\n\n/**\n * @class Editor\n */\nexport default class Editor {\n constructor(context) {\n this.context = context;\n\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.editable = this.$editable[0];\n this.lastRange = null;\n this.snapshot = null;\n\n this.style = new Style();\n this.table = new Table();\n this.typing = new Typing(context);\n this.bullet = new Bullet();\n this.history = new History(context);\n\n this.context.memo('help.undo', this.lang.help.undo);\n this.context.memo('help.redo', this.lang.help.redo);\n this.context.memo('help.tab', this.lang.help.tab);\n this.context.memo('help.untab', this.lang.help.untab);\n this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n this.context.memo('help.indent', this.lang.help.indent);\n this.context.memo('help.outdent', this.lang.help.outdent);\n this.context.memo('help.formatPara', this.lang.help.formatPara);\n this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n this.context.memo('help.fontName', this.lang.help.fontName);\n\n // native commands(with execCommand), generate function for execCommand\n const commands = [\n 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n 'formatBlock', 'removeFormat', 'backColor',\n ];\n\n for (let idx = 0, len = commands.length; idx < len; idx++) {\n this[commands[idx]] = ((sCmd) => {\n return (value) => {\n this.beforeCommand();\n document.execCommand(sCmd, false, value);\n this.afterCommand(true);\n };\n })(commands[idx]);\n this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n }\n\n this.fontName = this.wrapCommand((value) => {\n return this.fontStyling('font-family', env.validFontName(value));\n });\n\n this.fontSize = this.wrapCommand((value) => {\n const unit = this.currentStyle()['font-size-unit'];\n return this.fontStyling('font-size', value + unit);\n });\n\n this.fontSizeUnit = this.wrapCommand((value) => {\n const size = this.currentStyle()['font-size'];\n return this.fontStyling('font-size', size + value);\n });\n\n for (let idx = 1; idx <= 6; idx++) {\n this['formatH' + idx] = ((idx) => {\n return () => {\n this.formatBlock('H' + idx);\n };\n })(idx);\n this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n }\n\n this.insertParagraph = this.wrapCommand(() => {\n this.typing.insertParagraph(this.editable);\n });\n\n this.insertOrderedList = this.wrapCommand(() => {\n this.bullet.insertOrderedList(this.editable);\n });\n\n this.insertUnorderedList = this.wrapCommand(() => {\n this.bullet.insertUnorderedList(this.editable);\n });\n\n this.indent = this.wrapCommand(() => {\n this.bullet.indent(this.editable);\n });\n\n this.outdent = this.wrapCommand(() => {\n this.bullet.outdent(this.editable);\n });\n\n /**\n * insertNode\n * insert node\n * @param {Node} node\n */\n this.insertNode = this.wrapCommand((node) => {\n if (this.isLimited($(node).text().length)) {\n return;\n }\n const rng = this.getLastRange();\n rng.insertNode(node);\n this.setLastRange(range.createFromNodeAfter(node).select());\n });\n\n /**\n * insert text\n * @param {String} text\n */\n this.insertText = this.wrapCommand((text) => {\n if (this.isLimited(text.length)) {\n return;\n }\n const rng = this.getLastRange();\n const textNode = rng.insertNode(dom.createText(text));\n this.setLastRange(range.create(textNode, dom.nodeLength(textNode)).select());\n });\n\n /**\n * paste HTML\n * @param {String} markup\n */\n this.pasteHTML = this.wrapCommand((markup) => {\n if (this.isLimited(markup.length)) {\n return;\n }\n markup = this.context.invoke('codeview.purify', markup);\n const contents = this.getLastRange().pasteHTML(markup);\n this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select());\n });\n\n /**\n * formatBlock\n *\n * @param {String} tagName\n */\n this.formatBlock = this.wrapCommand((tagName, $target) => {\n const onApplyCustomStyle = this.options.callbacks.onApplyCustomStyle;\n if (onApplyCustomStyle) {\n onApplyCustomStyle.call(this, $target, this.context, this.onFormatBlock);\n } else {\n this.onFormatBlock(tagName, $target);\n }\n });\n\n /**\n * insert horizontal rule\n */\n this.insertHorizontalRule = this.wrapCommand(() => {\n const hrNode = this.getLastRange().insertNode(dom.create('HR'));\n if (hrNode.nextSibling) {\n this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());\n }\n });\n\n /**\n * lineHeight\n * @param {String} value\n */\n this.lineHeight = this.wrapCommand((value) => {\n this.style.stylePara(this.getLastRange(), {\n lineHeight: value,\n });\n });\n\n /**\n * create link (command)\n *\n * @param {Object} linkInfo\n */\n this.createLink = this.wrapCommand((linkInfo) => {\n let linkUrl = linkInfo.url;\n const linkText = linkInfo.text;\n const isNewWindow = linkInfo.isNewWindow;\n const checkProtocol = linkInfo.checkProtocol;\n let rng = linkInfo.range || this.getLastRange();\n const additionalTextLength = linkText.length - rng.toString().length;\n if (additionalTextLength > 0 && this.isLimited(additionalTextLength)) {\n return;\n }\n const isTextChanged = rng.toString() !== linkText;\n\n // handle spaced urls from input\n if (typeof linkUrl === 'string') {\n linkUrl = linkUrl.trim();\n }\n\n if (this.options.onCreateLink) {\n linkUrl = this.options.onCreateLink(linkUrl);\n } else if (checkProtocol) {\n // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n ? linkUrl : this.options.defaultProtocol + linkUrl;\n }\n\n let anchors = [];\n if (isTextChanged) {\n rng = rng.deleteContents();\n const anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);\n anchors.push(anchor);\n } else {\n anchors = this.style.styleNodes(rng, {\n nodeName: 'A',\n expandClosestSibling: true,\n onlyPartialContains: true,\n });\n }\n\n $.each(anchors, (idx, anchor) => {\n $(anchor).attr('href', linkUrl);\n if (isNewWindow) {\n $(anchor).attr('target', '_blank');\n } else {\n $(anchor).removeAttr('target');\n }\n });\n\n const startRange = range.createFromNodeBefore(lists.head(anchors));\n const startPoint = startRange.getStartPoint();\n const endRange = range.createFromNodeAfter(lists.last(anchors));\n const endPoint = endRange.getEndPoint();\n\n this.setLastRange(\n range.create(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n ).select()\n );\n });\n\n /**\n * setting color\n *\n * @param {Object} sObjColor color code\n * @param {String} sObjColor.foreColor foreground color\n * @param {String} sObjColor.backColor background color\n */\n this.color = this.wrapCommand((colorInfo) => {\n const foreColor = colorInfo.foreColor;\n const backColor = colorInfo.backColor;\n\n if (foreColor) { document.execCommand('foreColor', false, foreColor); }\n if (backColor) { document.execCommand('backColor', false, backColor); }\n });\n\n /**\n * Set foreground color\n *\n * @param {String} colorCode foreground color code\n */\n this.foreColor = this.wrapCommand((colorInfo) => {\n document.execCommand('foreColor', false, colorInfo);\n });\n\n /**\n * insert Table\n *\n * @param {String} dimension of table (ex : \"5x5\")\n */\n this.insertTable = this.wrapCommand((dim) => {\n const dimension = dim.split('x');\n\n const rng = this.getLastRange().deleteContents();\n rng.insertNode(this.table.createTable(dimension[0], dimension[1], this.options));\n });\n\n /**\n * remove media object and Figure Elements if media object is img with Figure.\n */\n this.removeMedia = this.wrapCommand(() => {\n let $target = $(this.restoreTarget()).parent();\n if ($target.closest('figure').length) {\n $target.closest('figure').remove();\n } else {\n $target = $(this.restoreTarget()).detach();\n }\n this.context.triggerEvent('media.delete', $target, this.$editable);\n });\n\n /**\n * float me\n *\n * @param {String} value\n */\n this.floatMe = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n $target.toggleClass('note-float-left', value === 'left');\n $target.toggleClass('note-float-right', value === 'right');\n $target.css('float', (value === 'none' ? '' : value));\n });\n\n /**\n * resize overlay element\n * @param {String} value\n */\n this.resize = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n value = parseFloat(value);\n if (value === 0) {\n $target.css('width', '');\n } else {\n $target.css({\n width: value * 100 + '%',\n height: '',\n });\n }\n });\n }\n\n initialize() {\n // bind custom events\n this.$editable.on('keydown', (event) => {\n if (event.keyCode === key.code.ENTER) {\n this.context.triggerEvent('enter', event);\n }\n this.context.triggerEvent('keydown', event);\n\n // keep a snapshot to limit text on input event\n this.snapshot = this.history.makeSnapshot();\n this.hasKeyShortCut = false;\n if (!event.isDefaultPrevented()) {\n if (this.options.shortcuts) {\n this.hasKeyShortCut = this.handleKeyMap(event);\n } else {\n this.preventDefaultEditableShortCuts(event);\n }\n }\n if (this.isLimited(1, event)) {\n const lastRange = this.getLastRange();\n if (lastRange.eo - lastRange.so === 0) {\n return false;\n }\n }\n this.setLastRange();\n\n // record undo in the key event except keyMap.\n if (this.options.recordEveryKeystroke) {\n if (this.hasKeyShortCut === false) {\n this.history.recordUndo();\n }\n }\n }).on('keyup', (event) => {\n this.setLastRange();\n this.context.triggerEvent('keyup', event);\n }).on('focus', (event) => {\n this.setLastRange();\n this.context.triggerEvent('focus', event);\n }).on('blur', (event) => {\n this.context.triggerEvent('blur', event);\n }).on('mousedown', (event) => {\n this.context.triggerEvent('mousedown', event);\n }).on('mouseup', (event) => {\n this.setLastRange();\n this.history.recordUndo();\n this.context.triggerEvent('mouseup', event);\n }).on('scroll', (event) => {\n this.context.triggerEvent('scroll', event);\n }).on('paste', (event) => {\n this.setLastRange();\n this.context.triggerEvent('paste', event);\n }).on('input', () => {\n // To limit composition characters (e.g. Korean)\n if (this.isLimited(0) && this.snapshot) {\n this.history.applySnapshot(this.snapshot);\n }\n });\n\n this.$editable.attr('spellcheck', this.options.spellCheck);\n\n this.$editable.attr('autocorrect', this.options.spellCheck);\n\n if (this.options.disableGrammar) {\n this.$editable.attr('data-gramm', false);\n }\n\n // init content before set event\n this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n\n this.$editable.on(env.inputEventName, func.debounce(() => {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }, 10));\n\n this.$editable.on('focusin', (event) => {\n this.context.triggerEvent('focusin', event);\n }).on('focusout', (event) => {\n this.context.triggerEvent('focusout', event);\n });\n\n if (this.options.airMode) {\n if (this.options.overrideContextMenu) {\n this.$editor.on('contextmenu', (event) => {\n this.context.triggerEvent('contextmenu', event);\n return false;\n });\n }\n } else {\n if (this.options.width) {\n this.$editor.outerWidth(this.options.width);\n }\n if (this.options.height) {\n this.$editable.outerHeight(this.options.height);\n }\n if (this.options.maxHeight) {\n this.$editable.css('max-height', this.options.maxHeight);\n }\n if (this.options.minHeight) {\n this.$editable.css('min-height', this.options.minHeight);\n }\n }\n\n this.history.recordUndo();\n this.setLastRange();\n }\n\n destroy() {\n this.$editable.off();\n }\n\n handleKeyMap(event) {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n const keys = [];\n\n if (event.metaKey) { keys.push('CMD'); }\n if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }\n if (event.shiftKey) { keys.push('SHIFT'); }\n\n const keyName = key.nameFromCode[event.keyCode];\n if (keyName) {\n keys.push(keyName);\n }\n\n const eventName = keyMap[keys.join('+')];\n\n if (keyName === 'TAB' && !this.options.tabDisable) {\n this.afterCommand();\n } else if (eventName) {\n if (this.context.invoke(eventName) !== false) {\n event.preventDefault();\n // if keyMap action was invoked\n return true;\n }\n } else if (key.isEdit(event.keyCode)) {\n this.afterCommand();\n }\n return false;\n }\n\n preventDefaultEditableShortCuts(event) {\n // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n if ((event.ctrlKey || event.metaKey) &&\n lists.contains([66, 73, 85], event.keyCode)) {\n event.preventDefault();\n }\n }\n\n isLimited(pad, event) {\n pad = pad || 0;\n\n if (typeof event !== 'undefined') {\n if (key.isMove(event.keyCode) ||\n key.isNavigation(event.keyCode) ||\n (event.ctrlKey || event.metaKey) ||\n lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n return false;\n }\n }\n\n if (this.options.maxTextLength > 0) {\n if ((this.$editable.text().length + pad) > this.options.maxTextLength) {\n return true;\n }\n }\n return false;\n }\n /**\n * create range\n * @return {WrappedRange}\n */\n createRange() {\n this.focus();\n this.setLastRange();\n return this.getLastRange();\n }\n\n setLastRange(rng) {\n if (rng) {\n this.lastRange = rng;\n } else {\n this.lastRange = range.create(this.editable);\n\n if ($(this.lastRange.sc).closest('.note-editable').length === 0) {\n this.lastRange = range.createFromBodyElement(this.editable);\n }\n }\n }\n\n getLastRange() {\n if (!this.lastRange) {\n this.setLastRange();\n }\n return this.lastRange;\n }\n\n /**\n * saveRange\n *\n * save current range\n *\n * @param {Boolean} [thenCollapse=false]\n */\n saveRange(thenCollapse) {\n if (thenCollapse) {\n this.getLastRange().collapse().select();\n }\n }\n\n /**\n * restoreRange\n *\n * restore lately range\n */\n restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }\n\n saveTarget(node) {\n this.$editable.data('target', node);\n }\n\n clearTarget() {\n this.$editable.removeData('target');\n }\n\n restoreTarget() {\n return this.$editable.data('target');\n }\n\n /**\n * currentStyle\n *\n * current style\n * @return {Object|Boolean} unfocus\n */\n currentStyle() {\n let rng = range.create();\n if (rng) {\n rng = rng.normalize();\n }\n return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n }\n\n /**\n * style from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n styleFromNode($node) {\n return this.style.fromNode($node);\n }\n\n /**\n * undo\n */\n undo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.undo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /*\n * commit\n */\n commit() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.commit();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * redo\n */\n redo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.redo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * before command\n */\n beforeCommand() {\n this.context.triggerEvent('before.command', this.$editable.html());\n\n // Set styleWithCSS before run a command\n document.execCommand('styleWithCSS', false, this.options.styleWithCSS);\n\n // keep focus on editable before command execution\n this.focus();\n }\n\n /**\n * after command\n * @param {Boolean} isPreventTrigger\n */\n afterCommand(isPreventTrigger) {\n this.normalizeContent();\n this.history.recordUndo();\n if (!isPreventTrigger) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n }\n\n /**\n * handle tab key\n */\n tab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n\n if (!this.isLimited(this.options.tabSize)) {\n this.beforeCommand();\n this.typing.insertTab(rng, this.options.tabSize);\n this.afterCommand();\n }\n }\n }\n\n /**\n * handle shift+tab key\n */\n untab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng, true);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n }\n }\n\n /**\n * run given function between beforeCommand and afterCommand\n */\n wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }\n\n /**\n * insert image\n *\n * @param {String} src\n * @param {String|Function} param\n * @return {Promise}\n */\n insertImage(src, param) {\n return createImage(src, param).then(($image) => {\n this.beforeCommand();\n\n if (typeof param === 'function') {\n param($image);\n } else {\n if (typeof param === 'string') {\n $image.attr('data-filename', param);\n }\n $image.css('width', Math.min(this.$editable.width(), $image.width()));\n }\n\n $image.show();\n this.getLastRange().insertNode($image[0]);\n this.setLastRange(range.createFromNodeAfter($image[0]).select());\n this.afterCommand();\n }).fail((e) => {\n this.context.triggerEvent('image.upload.error', e);\n });\n }\n\n /**\n * insertImages\n * @param {File[]} files\n */\n insertImagesAsDataURL(files) {\n $.each(files, (idx, file) => {\n const filename = file.name;\n if (this.options.maximumImageFileSize && this.options.maximumImageFileSize < file.size) {\n this.context.triggerEvent('image.upload.error', this.lang.image.maximumFileSizeError);\n } else {\n readFileAsDataURL(file).then((dataURL) => {\n return this.insertImage(dataURL, filename);\n }).fail(() => {\n this.context.triggerEvent('image.upload.error');\n });\n }\n });\n }\n\n /**\n * insertImagesOrCallback\n * @param {File[]} files\n */\n insertImagesOrCallback(files) {\n const callbacks = this.options.callbacks;\n // If onImageUpload set,\n if (callbacks.onImageUpload) {\n this.context.triggerEvent('image.upload', files);\n // else insert Image as dataURL\n } else {\n this.insertImagesAsDataURL(files);\n }\n }\n\n /**\n * return selected plain text\n * @return {String} text\n */\n getSelectedText() {\n let rng = this.getLastRange();\n\n // if range on anchor, expand range with anchor\n if (rng.isOnAnchor()) {\n rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n }\n\n return rng.toString();\n }\n\n onFormatBlock(tagName, $target) {\n // [workaround] for MSIE, IE need `<`\n document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n\n // support custom class\n if ($target && $target.length) {\n // find the exact element has given tagName\n if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n $target = $target.find(tagName);\n }\n\n if ($target && $target.length) {\n const className = $target[0].className || '';\n if (className) {\n const currentRange = this.createRange();\n\n const $parent = $([currentRange.sc, currentRange.ec]).closest(tagName);\n $parent.addClass(className);\n }\n }\n }\n }\n\n formatPara() {\n this.formatBlock('P');\n }\n\n fontStyling(target, value) {\n const rng = this.getLastRange();\n\n if (rng !== '') {\n const spans = this.style.styleNodes(rng);\n this.$editor.find('.note-status-output').html('');\n $(spans).css(target, value);\n\n // [workaround] added styled bogus span for style\n // - also bogus character needed for cursor position\n if (rng.isCollapsed()) {\n const firstSpan = lists.head(spans);\n if (firstSpan && !dom.nodeLength(firstSpan)) {\n firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n range.createFromNodeAfter(firstSpan.firstChild).select();\n this.setLastRange();\n this.$editable.data(KEY_BOGUS, firstSpan);\n }\n }\n } else {\n const noteStatusOutput = $.now();\n this.$editor.find('.note-status-output').html('<div id=\"note-status-output-' + noteStatusOutput + '\" class=\"alert alert-info\">' + this.lang.output.noSelection + '</div>');\n setTimeout(function() { $('#note-status-output-' + noteStatusOutput).remove(); }, 5000);\n }\n }\n\n /**\n * unlink\n *\n * @type command\n */\n unlink() {\n let rng = this.getLastRange();\n if (rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n rng = range.createFromNode(anchor);\n rng.select();\n this.setLastRange();\n\n this.beforeCommand();\n document.execCommand('unlink');\n this.afterCommand();\n }\n }\n\n /**\n * returns link info\n *\n * @return {Object}\n * @return {WrappedRange} return.range\n * @return {String} return.text\n * @return {Boolean} [return.isNewWindow=true]\n * @return {String} [return.url=\"\"]\n */\n getLinkInfo() {\n const rng = this.getLastRange().expand(dom.isAnchor);\n // Get the first anchor on range(for edit).\n const $anchor = $(lists.head(rng.nodes(dom.isAnchor)));\n const linkInfo = {\n range: rng,\n text: rng.toString(),\n url: $anchor.length ? $anchor.attr('href') : '',\n };\n\n // When anchor exists,\n if ($anchor.length) {\n // Set isNewWindow by checking its target.\n linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n }\n\n return linkInfo;\n }\n\n addRow(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addRow(rng, position);\n this.afterCommand();\n }\n }\n\n addCol(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addCol(rng, position);\n this.afterCommand();\n }\n }\n\n deleteRow() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteRow(rng);\n this.afterCommand();\n }\n }\n\n deleteCol() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteCol(rng);\n this.afterCommand();\n }\n }\n\n deleteTable() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteTable(rng);\n this.afterCommand();\n }\n }\n\n /**\n * @param {Position} pos\n * @param {jQuery} $target - target element\n * @param {Boolean} [bKeepRatio] - keep ratio\n */\n resizeTo(pos, $target, bKeepRatio) {\n let imageSize;\n if (bKeepRatio) {\n const newRatio = pos.y / pos.x;\n const ratio = $target.data('ratio');\n imageSize = {\n width: ratio > newRatio ? pos.x : pos.y / ratio,\n height: ratio > newRatio ? pos.x * ratio : pos.y,\n };\n } else {\n imageSize = {\n width: pos.x,\n height: pos.y,\n };\n }\n\n $target.css(imageSize);\n }\n\n /**\n * returns whether editable area has focus or not.\n */\n hasFocus() {\n return this.$editable.is(':focus');\n }\n\n /**\n * set focus\n */\n focus() {\n // [workaround] Screen will move when page is scolled in IE.\n // - do focus when not focused\n if (!this.hasFocus()) {\n this.$editable.focus();\n }\n }\n\n /**\n * returns whether contents is empty or not.\n * @return {Boolean}\n */\n isEmpty() {\n return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n }\n\n /**\n * Removes all contents and restores the editable instance to an _emptyPara_.\n */\n empty() {\n this.context.invoke('code', dom.emptyPara);\n }\n\n /**\n * normalize content\n */\n normalizeContent() {\n this.$editable[0].normalize();\n }\n}\n","import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n this.$editable.on('paste', this.pasteByEvent.bind(this));\n }\n\n /**\n * paste by clipboard event\n *\n * @param {Event} event\n */\n pasteByEvent(event) {\n const clipboardData = event.originalEvent.clipboardData;\n\n if (clipboardData && clipboardData.items && clipboardData.items.length) {\n const item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n // paste img file\n this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n event.preventDefault();\n } else if (item.kind === 'string') {\n // paste text with maxTextLength check\n if (this.context.invoke('editor.isLimited', clipboardData.getData('Text').length)) {\n event.preventDefault();\n }\n }\n } else if (window.clipboardData) {\n // for IE\n let text = window.clipboardData.getData('text');\n if (this.context.invoke('editor.isLimited', text.length)) {\n event.preventDefault();\n }\n }\n // Call editor.afterCommand after proceeding default event handler\n setTimeout(() => {\n this.context.invoke('editor.afterCommand');\n }, 10);\n }\n}\n","import $ from 'jquery';\n\nexport default class Dropzone {\n constructor(context) {\n this.context = context;\n this.$eventListener = $(document);\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.documentEventHandlers = {};\n\n this.$dropzone = $([\n '<div class=\"note-dropzone\">',\n '<div class=\"note-dropzone-message\"/>',\n '</div>',\n ].join('')).prependTo(this.$editor);\n }\n\n /**\n * attach Drag and Drop Events\n */\n initialize() {\n if (this.options.disableDragAndDrop) {\n // prevent default drop event\n this.documentEventHandlers.onDrop = (e) => {\n e.preventDefault();\n };\n // do not consider outside of dropzone\n this.$eventListener = this.$dropzone;\n this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n } else {\n this.attachDragAndDropEvent();\n }\n }\n\n /**\n * attach Drag and Drop Events\n */\n attachDragAndDropEvent() {\n let collection = $();\n const $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n\n this.documentEventHandlers.onDragenter = (e) => {\n const isCodeview = this.context.invoke('codeview.isActivated');\n const hasEditorSize = this.$editor.width() > 0 && this.$editor.height() > 0;\n if (!isCodeview && !collection.length && hasEditorSize) {\n this.$editor.addClass('dragover');\n this.$dropzone.width(this.$editor.width());\n this.$dropzone.height(this.$editor.height());\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n }\n collection = collection.add(e.target);\n };\n\n this.documentEventHandlers.onDragleave = (e) => {\n collection = collection.not(e.target);\n\n // If nodeName is BODY, then just make it over (fix for IE)\n if (!collection.length || e.target.nodeName === 'BODY') {\n collection = $();\n this.$editor.removeClass('dragover');\n }\n };\n\n this.documentEventHandlers.onDrop = () => {\n collection = $();\n this.$editor.removeClass('dragover');\n };\n\n // show dropzone on dragenter when dragging a object to document\n // -but only if the editor is visible, i.e. has a positive width and height\n this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n .on('dragleave', this.documentEventHandlers.onDragleave)\n .on('drop', this.documentEventHandlers.onDrop);\n\n // change dropzone's message on hover.\n this.$dropzone.on('dragenter', () => {\n this.$dropzone.addClass('hover');\n $dropzoneMessage.text(this.lang.image.dropImage);\n }).on('dragleave', () => {\n this.$dropzone.removeClass('hover');\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n });\n\n // attach dropImage\n this.$dropzone.on('drop', (event) => {\n const dataTransfer = event.originalEvent.dataTransfer;\n\n // stop the browser from opening the dropped content\n event.preventDefault();\n\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n this.$editable.focus();\n this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n } else {\n $.each(dataTransfer.types, (idx, type) => {\n // skip moz-specific types\n if (type.toLowerCase().indexOf('_moz_') > -1) {\n return;\n }\n const content = dataTransfer.getData(type);\n\n if (type.toLowerCase().indexOf('text') > -1) {\n this.context.invoke('editor.pasteHTML', content);\n } else {\n $(content).each((idx, item) => {\n this.context.invoke('editor.insertNode', item);\n });\n }\n });\n }\n }).on('dragover', false); // prevent default dragover event\n }\n\n destroy() {\n Object.keys(this.documentEventHandlers).forEach((key) => {\n this.$eventListener.off(key.substr(2).toLowerCase(), this.documentEventHandlers[key]);\n });\n this.documentEventHandlers = {};\n }\n}\n","import env from '../core/env';\nimport dom from '../core/dom';\n\nlet CodeMirror;\nif (env.hasCodeMirror) {\n CodeMirror = window.CodeMirror;\n}\n\n/**\n * @class Codeview\n */\nexport default class CodeView {\n constructor(context) {\n this.context = context;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n this.options = context.options;\n }\n\n sync() {\n const isCodeview = this.isActivated();\n if (isCodeview && env.hasCodeMirror) {\n this.$codable.data('cmEditor').save();\n }\n }\n\n /**\n * @return {Boolean}\n */\n isActivated() {\n return this.$editor.hasClass('codeview');\n }\n\n /**\n * toggle codeview\n */\n toggle() {\n if (this.isActivated()) {\n this.deactivate();\n } else {\n this.activate();\n }\n this.context.triggerEvent('codeview.toggled');\n }\n\n /**\n * purify input value\n * @param value\n * @returns {*}\n */\n purify(value) {\n if (this.options.codeviewFilter) {\n // filter code view regex\n value = value.replace(this.options.codeviewFilterRegex, '');\n // allow specific iframe tag\n if (this.options.codeviewIframeFilter) {\n const whitelist = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function(tag) {\n // remove if src attribute is duplicated\n if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n return '';\n }\n for (const src of whitelist) {\n // pass if src is trusted\n if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n return tag;\n }\n }\n return '';\n });\n }\n }\n return value;\n }\n\n /**\n * activate code view\n */\n activate() {\n this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n this.$codable.height(this.$editable.height());\n\n this.context.invoke('toolbar.updateCodeview', true);\n this.$editor.addClass('codeview');\n this.$codable.focus();\n\n // activate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n\n // CodeMirror TernServer\n if (this.options.codemirror.tern) {\n const server = new CodeMirror.TernServer(this.options.codemirror.tern);\n cmEditor.ternServer = server;\n cmEditor.on('cursorActivity', (cm) => {\n server.updateArgHints(cm);\n });\n }\n\n cmEditor.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', cmEditor.getValue(), event);\n });\n cmEditor.on('change', () => {\n this.context.triggerEvent('change.codeview', cmEditor.getValue(), cmEditor);\n });\n\n // CodeMirror hasn't Padding.\n cmEditor.setSize(null, this.$editable.outerHeight());\n this.$codable.data('cmEditor', cmEditor);\n } else {\n this.$codable.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', this.$codable.val(), event);\n });\n this.$codable.on('input', () => {\n this.context.triggerEvent('change.codeview', this.$codable.val(), this.$codable);\n });\n }\n }\n\n /**\n * deactivate code view\n */\n deactivate() {\n // deactivate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = this.$codable.data('cmEditor');\n this.$codable.val(cmEditor.getValue());\n cmEditor.toTextArea();\n }\n\n const value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n const isChange = this.$editable.html() !== value;\n\n this.$editable.html(value);\n this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n this.$editor.removeClass('codeview');\n\n if (isChange) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n this.$editable.focus();\n\n this.context.invoke('toolbar.updateCodeview', false);\n }\n\n destroy() {\n if (this.isActivated()) {\n this.deactivate();\n }\n }\n}\n","import $ from 'jquery';\nconst EDITABLE_PADDING = 24;\n\nexport default class Statusbar {\n constructor(context) {\n this.$document = $(document);\n this.$statusbar = context.layoutInfo.statusbar;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n }\n\n initialize() {\n if (this.options.airMode || this.options.disableResizeEditor) {\n this.destroy();\n return;\n }\n\n this.$statusbar.on('mousedown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const editableTop = this.$editable.offset().top - this.$document.scrollTop();\n const onMouseMove = (event) => {\n let height = event.clientY - (editableTop + EDITABLE_PADDING);\n\n height = (this.options.minheight > 0) ? Math.max(height, this.options.minheight) : height;\n height = (this.options.maxHeight > 0) ? Math.min(height, this.options.maxHeight) : height;\n\n this.$editable.height(height);\n };\n\n this.$document.on('mousemove', onMouseMove).one('mouseup', () => {\n this.$document.off('mousemove', onMouseMove);\n });\n });\n }\n\n destroy() {\n this.$statusbar.off();\n this.$statusbar.addClass('locked');\n }\n}\n","import $ from 'jquery';\n\nexport default class Fullscreen {\n constructor(context) {\n this.context = context;\n\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n\n this.$window = $(window);\n this.$scrollbar = $('html, body');\n\n this.onResize = () => {\n this.resizeTo({\n h: this.$window.height() - this.$toolbar.outerHeight(),\n });\n };\n }\n\n resizeTo(size) {\n this.$editable.css('height', size.h);\n this.$codable.css('height', size.h);\n if (this.$codable.data('cmeditor')) {\n this.$codable.data('cmeditor').setsize(null, size.h);\n }\n }\n\n /**\n * toggle fullscreen\n */\n toggle() {\n this.$editor.toggleClass('fullscreen');\n if (this.isFullscreen()) {\n this.$editable.data('orgHeight', this.$editable.css('height'));\n this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n this.$editable.css('maxHeight', '');\n this.$window.on('resize', this.onResize).trigger('resize');\n this.$scrollbar.css('overflow', 'hidden');\n } else {\n this.$window.off('resize', this.onResize);\n this.resizeTo({ h: this.$editable.data('orgHeight') });\n this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n this.$scrollbar.css('overflow', 'visible');\n }\n\n this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n }\n\n isFullscreen() {\n return this.$editor.hasClass('fullscreen');\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\n\nexport default class Handle {\n constructor(context) {\n this.context = context;\n this.$document = $(document);\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.events = {\n 'summernote.mousedown': (we, e) => {\n if (this.update(e.target, e)) {\n e.preventDefault();\n }\n },\n 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n initialize() {\n this.$handle = $([\n '<div class=\"note-handle\">',\n '<div class=\"note-control-selection\">',\n '<div class=\"note-control-selection-bg\"></div>',\n '<div class=\"note-control-holder note-control-nw\"></div>',\n '<div class=\"note-control-holder note-control-ne\"></div>',\n '<div class=\"note-control-holder note-control-sw\"></div>',\n '<div class=\"',\n (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n ' note-control-se\"></div>',\n (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n '</div>',\n '</div>',\n ].join('')).prependTo(this.$editingArea);\n\n this.$handle.on('mousedown', (event) => {\n if (dom.isControlSizing(event.target)) {\n event.preventDefault();\n event.stopPropagation();\n\n const $target = this.$handle.find('.note-control-selection').data('target');\n const posStart = $target.offset();\n const scrollTop = this.$document.scrollTop();\n\n const onMouseMove = (event) => {\n this.context.invoke('editor.resizeTo', {\n x: event.clientX - posStart.left,\n y: event.clientY - (posStart.top - scrollTop),\n }, $target, !event.shiftKey);\n\n this.update($target[0], event);\n };\n\n this.$document\n .on('mousemove', onMouseMove)\n .one('mouseup', (e) => {\n e.preventDefault();\n this.$document.off('mousemove', onMouseMove);\n this.context.invoke('editor.afterCommand');\n });\n\n if (!$target.data('ratio')) { // original ratio.\n $target.data('ratio', $target.height() / $target.width());\n }\n }\n });\n\n // Listen for scrolling on the handle overlay.\n this.$handle.on('wheel', (e) => {\n e.preventDefault();\n this.update();\n });\n }\n\n destroy() {\n this.$handle.remove();\n }\n\n update(target, event) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isImage = dom.isImg(target);\n const $selection = this.$handle.find('.note-control-selection');\n\n this.context.invoke('imagePopover.update', target, event);\n\n if (isImage) {\n const $image = $(target);\n const position = $image.position();\n const pos = {\n left: position.left + parseInt($image.css('marginLeft'), 10),\n top: position.top + parseInt($image.css('marginTop'), 10),\n };\n\n // exclude margin\n const imageSize = {\n w: $image.outerWidth(false),\n h: $image.outerHeight(false),\n };\n\n $selection.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n width: imageSize.w,\n height: imageSize.h,\n }).data('target', $image); // save current image element.\n\n const origImageObj = new Image();\n origImageObj.src = $image.attr('src');\n\n const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n $selection.find('.note-control-selection-info').text(sizingText);\n this.context.invoke('editor.saveTarget', target);\n } else {\n this.hide();\n }\n\n return isImage;\n }\n\n /**\n * hide\n *\n * @param {jQuery} $handle\n */\n hide() {\n this.context.invoke('editor.clearTarget');\n this.$handle.children().hide();\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport key from '../core/key';\n\nconst defaultScheme = 'http://';\nconst linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n\nexport default class AutoLink {\n constructor(context) {\n this.context = context;\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n initialize() {\n this.lastWordRange = null;\n }\n\n destroy() {\n this.lastWordRange = null;\n }\n\n replace() {\n if (!this.lastWordRange) {\n return;\n }\n\n const keyword = this.lastWordRange.toString();\n const match = keyword.match(linkPattern);\n\n if (match && (match[1] || match[2])) {\n const link = match[1] ? keyword : defaultScheme + keyword;\n const urlText = keyword.replace(/^(?:https?:\\/\\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\\.)?/i, '').split('/')[0];\n const node = $('<a />').html(urlText).attr('href', link)[0];\n if (this.context.options.linkTargetBlank) {\n $(node).attr('target', '_blank');\n }\n\n this.lastWordRange.insertNode(node);\n this.lastWordRange = null;\n this.context.invoke('editor.focus');\n }\n }\n\n handleKeydown(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWordRange = wordRange;\n }\n }\n\n handleKeyup(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n this.replace();\n }\n }\n}\n","import dom from '../core/dom';\n\n/**\n * textarea auto sync.\n */\nexport default class AutoSync {\n constructor(context) {\n this.$note = context.layoutInfo.note;\n this.events = {\n 'summernote.change': () => {\n this.$note.val(context.invoke('code'));\n },\n };\n }\n\n shouldInitialize() {\n return dom.isTextarea(this.$note[0]);\n }\n}\n","import lists from '../core/lists';\nimport dom from '../core/dom';\nimport key from '../core/key';\n\nexport default class AutoReplace {\n constructor(context) {\n this.context = context;\n this.options = context.options.replace || {};\n\n this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n this.previousKeydownCode = null;\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.match;\n }\n\n initialize() {\n this.lastWord = null;\n }\n\n destroy() {\n this.lastWord = null;\n }\n\n replace() {\n if (!this.lastWord) {\n return;\n }\n\n const self = this;\n const keyword = this.lastWord.toString();\n this.options.match(keyword, function(match) {\n if (match) {\n let node = '';\n\n if (typeof match === 'string') {\n node = dom.createText(match);\n } else if (match instanceof jQuery) {\n node = match[0];\n } else if (match instanceof Node) {\n node = match;\n }\n\n if (!node) return;\n self.lastWord.insertNode(node);\n self.lastWord = null;\n self.context.invoke('editor.focus');\n }\n });\n }\n\n handleKeydown(e) {\n // this forces it to remember the last whole word, even if multiple termination keys are pressed\n // before the previous key is let go.\n if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n this.previousKeydownCode = e.keyCode;\n return;\n }\n\n if (lists.contains(this.keys, e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWord = wordRange;\n }\n this.previousKeydownCode = e.keyCode;\n }\n\n handleKeyup(e) {\n if (lists.contains(this.keys, e.keyCode)) {\n this.replace();\n }\n }\n}\n","import $ from 'jquery';\nexport default class Placeholder {\n constructor(context) {\n this.context = context;\n\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n\n if (this.options.inheritPlaceholder === true) {\n // get placeholder value from the original element\n this.options.placeholder = this.context.$note.attr('placeholder') || this.options.placeholder;\n }\n\n this.events = {\n 'summernote.init summernote.change': () => {\n this.update();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.placeholder;\n }\n\n initialize() {\n this.$placeholder = $('<div class=\"note-placeholder\">');\n this.$placeholder.on('click', () => {\n this.context.invoke('focus');\n }).html(this.options.placeholder).prependTo(this.$editingArea);\n\n this.update();\n }\n\n destroy() {\n this.$placeholder.remove();\n }\n\n update() {\n const isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n this.$placeholder.toggle(isShow);\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport env from '../core/env';\n\nexport default class Buttons {\n constructor(context) {\n this.ui = $.summernote.ui;\n this.context = context;\n this.$toolbar = context.layoutInfo.toolbar;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.invertedKeyMap = func.invertObject(\n this.options.keyMap[env.isMac ? 'mac' : 'pc']\n );\n }\n\n representShortcut(editorMethod) {\n let shortcut = this.invertedKeyMap[editorMethod];\n if (!this.options.shortcuts || !shortcut) {\n return '';\n }\n\n if (env.isMac) {\n shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n }\n\n shortcut = shortcut.replace('BACKSLASH', '\\\\')\n .replace('SLASH', '/')\n .replace('LEFTBRACKET', '[')\n .replace('RIGHTBRACKET', ']');\n\n return ' (' + shortcut + ')';\n }\n\n button(o) {\n if (!this.options.tooltip && o.tooltip) {\n delete o.tooltip;\n }\n o.container = this.options.container;\n return this.ui.button(o);\n }\n\n initialize() {\n this.addToolbarButtons();\n this.addImagePopoverButtons();\n this.addLinkPopoverButtons();\n this.addTablePopoverButtons();\n this.fontInstalledMap = {};\n }\n\n destroy() {\n delete this.fontInstalledMap;\n }\n\n isFontInstalled(name) {\n if (!Object.prototype.hasOwnProperty.call(this.fontInstalledMap, name)) {\n this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n lists.contains(this.options.fontNamesIgnoreCheck, name);\n }\n return this.fontInstalledMap[name];\n }\n\n isFontDeservedToAdd(name) {\n name = name.toLowerCase();\n return (name !== '' && this.isFontInstalled(name) && env.genericFontFamilies.indexOf(name) === -1);\n }\n\n colorPalette(className, tooltip, backColor, foreColor) {\n return this.ui.buttonGroup({\n className: 'note-color ' + className,\n children: [\n this.button({\n className: 'note-current-color-button',\n contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n tooltip: tooltip,\n click: (e) => {\n const $button = $(e.currentTarget);\n if (backColor && foreColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n foreColor: $button.attr('data-foreColor'),\n });\n } else if (backColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n });\n } else if (foreColor) {\n this.context.invoke('editor.color', {\n foreColor: $button.attr('data-foreColor'),\n });\n }\n },\n callback: ($button) => {\n const $recentColor = $button.find('.note-recent-color');\n if (backColor) {\n $recentColor.css('background-color', this.options.colorButton.backColor);\n $button.attr('data-backColor', this.options.colorButton.backColor);\n }\n if (foreColor) {\n $recentColor.css('color', this.options.colorButton.foreColor);\n $button.attr('data-foreColor', this.options.colorButton.foreColor);\n } else {\n $recentColor.css('color', 'transparent');\n }\n },\n }),\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('', this.options),\n tooltip: this.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n items: (backColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n this.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n '</div>',\n '<div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n '</div>',\n ].join('') : '') +\n (foreColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n this.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n '</div>', // Fix missing Div, Commented to find easily if it's wrong\n '<div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n '</div>',\n ].join('') : ''),\n callback: ($dropdown) => {\n $dropdown.find('.note-holder').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: this.options.colors,\n colorsName: this.options.colorsName,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n /* TODO: do we have to record recent custom colors within cookies? */\n var customColors = [\n ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n ];\n $dropdown.find('.note-holder-custom').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: customColors,\n colorsName: customColors,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n $dropdown.find('input[type=color]').each((idx, item) => {\n $(item).change(function() {\n const $chip = $dropdown.find('#' + $(this).data('event')).find('.note-color-btn').first();\n const color = this.value.toUpperCase();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $chip.click();\n });\n });\n },\n click: (event) => {\n event.stopPropagation();\n\n const $parent = $('.' + className).find('.note-dropdown-menu');\n const $button = $(event.target);\n const eventName = $button.data('event');\n const value = $button.attr('data-value');\n\n if (eventName === 'openPalette') {\n const $picker = $parent.find('#' + value);\n const $palette = $($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n\n // Shift palette chips\n const $chip = $palette.find('.note-color-btn').last().detach();\n\n // Set chip attributes\n const color = $picker.val();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $palette.prepend($chip);\n $picker.click();\n } else {\n if (lists.contains(['backColor', 'foreColor'], eventName)) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n }\n this.context.invoke('editor.' + eventName, value);\n }\n },\n }),\n ],\n }).render();\n }\n\n addToolbarButtons() {\n this.context.memo('button.style', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n this.ui.icon(this.options.icons.magic), this.options\n ),\n tooltip: this.lang.style.style,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n className: 'dropdown-style',\n items: this.options.styleTags,\n title: this.lang.style.style,\n template: (item) => {\n // TBD: need to be simplified\n if (typeof item === 'string') {\n item = {\n tag: item,\n title: (Object.prototype.hasOwnProperty.call(this.lang.style, item) ? this.lang.style[item] : item),\n };\n }\n\n const tag = item.tag;\n const title = item.title;\n const style = item.style ? ' style=\"' + item.style + '\" ' : '';\n const className = item.className ? ' class=\"' + item.className + '\"' : '';\n\n return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n },\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }),\n ]).render();\n });\n\n for (let styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n const item = this.options.styleTags[styleIdx];\n\n this.context.memo('button.style.' + item, () => {\n return this.button({\n className: 'note-btn-style-' + item,\n contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n tooltip: this.lang.style[item],\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }).render();\n });\n }\n\n this.context.memo('button.bold', () => {\n return this.button({\n className: 'note-btn-bold',\n contents: this.ui.icon(this.options.icons.bold),\n tooltip: this.lang.font.bold + this.representShortcut('bold'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.bold'),\n }).render();\n });\n\n this.context.memo('button.italic', () => {\n return this.button({\n className: 'note-btn-italic',\n contents: this.ui.icon(this.options.icons.italic),\n tooltip: this.lang.font.italic + this.representShortcut('italic'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.italic'),\n }).render();\n });\n\n this.context.memo('button.underline', () => {\n return this.button({\n className: 'note-btn-underline',\n contents: this.ui.icon(this.options.icons.underline),\n tooltip: this.lang.font.underline + this.representShortcut('underline'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.underline'),\n }).render();\n });\n\n this.context.memo('button.clear', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.eraser),\n tooltip: this.lang.font.clear + this.representShortcut('removeFormat'),\n click: this.context.createInvokeHandler('editor.removeFormat'),\n }).render();\n });\n\n this.context.memo('button.strikethrough', () => {\n return this.button({\n className: 'note-btn-strikethrough',\n contents: this.ui.icon(this.options.icons.strikethrough),\n tooltip: this.lang.font.strikethrough + this.representShortcut('strikethrough'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.strikethrough'),\n }).render();\n });\n\n this.context.memo('button.superscript', () => {\n return this.button({\n className: 'note-btn-superscript',\n contents: this.ui.icon(this.options.icons.superscript),\n tooltip: this.lang.font.superscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.superscript'),\n }).render();\n });\n\n this.context.memo('button.subscript', () => {\n return this.button({\n className: 'note-btn-subscript',\n contents: this.ui.icon(this.options.icons.subscript),\n tooltip: this.lang.font.subscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.subscript'),\n }).render();\n });\n\n this.context.memo('button.fontname', () => {\n const styleInfo = this.context.invoke('editor.currentStyle');\n\n if (this.options.addDefaultFonts) {\n // Add 'default' fonts into the fontnames array if not exist\n $.each(styleInfo['font-family'].split(','), (idx, fontname) => {\n fontname = fontname.trim().replace(/['\"]+/g, '');\n if (this.isFontDeservedToAdd(fontname)) {\n if (this.options.fontNames.indexOf(fontname) === -1) {\n this.options.fontNames.push(fontname);\n }\n }\n });\n }\n\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n '<span class=\"note-current-fontname\"/>', this.options\n ),\n tooltip: this.lang.font.name,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontname',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontNames.filter(this.isFontInstalled.bind(this)),\n title: this.lang.font.name,\n template: (item) => {\n return '<span style=\"font-family: ' + env.validFontName(item) + '\">' + item + '</span>';\n },\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontName'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsize', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', this.options),\n tooltip: this.lang.font.size,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsize',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizes,\n title: this.lang.font.size,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSize'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsizeunit', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsizeunit\"/>', this.options),\n tooltip: this.lang.font.sizeunit,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsizeunit',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizeUnits,\n title: this.lang.font.sizeunit,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSizeUnit'),\n }),\n ]).render();\n });\n\n this.context.memo('button.color', () => {\n return this.colorPalette('note-color-all', this.lang.color.recent, true, true);\n });\n\n this.context.memo('button.forecolor', () => {\n return this.colorPalette('note-color-fore', this.lang.color.foreground, false, true);\n });\n\n this.context.memo('button.backcolor', () => {\n return this.colorPalette('note-color-back', this.lang.color.background, true, false);\n });\n\n this.context.memo('button.ul', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unorderedlist),\n tooltip: this.lang.lists.unordered + this.representShortcut('insertUnorderedList'),\n click: this.context.createInvokeHandler('editor.insertUnorderedList'),\n }).render();\n });\n\n this.context.memo('button.ol', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.orderedlist),\n tooltip: this.lang.lists.ordered + this.representShortcut('insertOrderedList'),\n click: this.context.createInvokeHandler('editor.insertOrderedList'),\n }).render();\n });\n\n const justifyLeft = this.button({\n contents: this.ui.icon(this.options.icons.alignLeft),\n tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n click: this.context.createInvokeHandler('editor.justifyLeft'),\n });\n\n const justifyCenter = this.button({\n contents: this.ui.icon(this.options.icons.alignCenter),\n tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n click: this.context.createInvokeHandler('editor.justifyCenter'),\n });\n\n const justifyRight = this.button({\n contents: this.ui.icon(this.options.icons.alignRight),\n tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n click: this.context.createInvokeHandler('editor.justifyRight'),\n });\n\n const justifyFull = this.button({\n contents: this.ui.icon(this.options.icons.alignJustify),\n tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n click: this.context.createInvokeHandler('editor.justifyFull'),\n });\n\n const outdent = this.button({\n contents: this.ui.icon(this.options.icons.outdent),\n tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n click: this.context.createInvokeHandler('editor.outdent'),\n });\n\n const indent = this.button({\n contents: this.ui.icon(this.options.icons.indent),\n tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n click: this.context.createInvokeHandler('editor.indent'),\n });\n\n this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n this.context.memo('button.indent', func.invoke(indent, 'render'));\n\n this.context.memo('button.paragraph', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft), this.options),\n tooltip: this.lang.paragraph.paragraph,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown([\n this.ui.buttonGroup({\n className: 'note-align',\n children: [justifyLeft, justifyCenter, justifyRight, justifyFull],\n }),\n this.ui.buttonGroup({\n className: 'note-list',\n children: [outdent, indent],\n }),\n ]),\n ]).render();\n });\n\n this.context.memo('button.height', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight), this.options),\n tooltip: this.lang.font.height,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n items: this.options.lineHeights,\n checkClassName: this.options.icons.menuCheck,\n className: 'dropdown-line-height',\n title: this.lang.font.height,\n click: this.context.createInvokeHandler('editor.lineHeight'),\n }),\n ]).render();\n });\n\n this.context.memo('button.table', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table), this.options),\n tooltip: this.lang.table.table,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n title: this.lang.table.table,\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: ($node) => {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: this.options.insertTableMaxSize.col + 'em',\n height: this.options.insertTableMaxSize.row + 'em',\n }).mousedown(this.context.createInvokeHandler('editor.insertTable'))\n .on('mousemove', this.tableMoveHandler.bind(this));\n },\n }).render();\n });\n\n this.context.memo('button.link', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.link + this.representShortcut('linkDialog.show'),\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.picture', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.picture),\n tooltip: this.lang.image.image,\n click: this.context.createInvokeHandler('imageDialog.show'),\n }).render();\n });\n\n this.context.memo('button.video', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.video),\n tooltip: this.lang.video.video,\n click: this.context.createInvokeHandler('videoDialog.show'),\n }).render();\n });\n\n this.context.memo('button.hr', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.minus),\n tooltip: this.lang.hr.insert + this.representShortcut('insertHorizontalRule'),\n click: this.context.createInvokeHandler('editor.insertHorizontalRule'),\n }).render();\n });\n\n this.context.memo('button.fullscreen', () => {\n return this.button({\n className: 'btn-fullscreen',\n contents: this.ui.icon(this.options.icons.arrowsAlt),\n tooltip: this.lang.options.fullscreen,\n click: this.context.createInvokeHandler('fullscreen.toggle'),\n }).render();\n });\n\n this.context.memo('button.codeview', () => {\n return this.button({\n className: 'btn-codeview',\n contents: this.ui.icon(this.options.icons.code),\n tooltip: this.lang.options.codeview,\n click: this.context.createInvokeHandler('codeview.toggle'),\n }).render();\n });\n\n this.context.memo('button.redo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.redo),\n tooltip: this.lang.history.redo + this.representShortcut('redo'),\n click: this.context.createInvokeHandler('editor.redo'),\n }).render();\n });\n\n this.context.memo('button.undo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.undo),\n tooltip: this.lang.history.undo + this.representShortcut('undo'),\n click: this.context.createInvokeHandler('editor.undo'),\n }).render();\n });\n\n this.context.memo('button.help', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.question),\n tooltip: this.lang.options.help,\n click: this.context.createInvokeHandler('helpDialog.show'),\n }).render();\n });\n }\n\n /**\n * image: [\n * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n * ['float', ['floatLeft', 'floatRight', 'floatNone']],\n * ['remove', ['removeMedia']],\n * ],\n */\n addImagePopoverButtons() {\n // Image Size Buttons\n this.context.memo('button.resizeFull', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">100%</span>',\n tooltip: this.lang.image.resizeFull,\n click: this.context.createInvokeHandler('editor.resize', '1'),\n }).render();\n });\n this.context.memo('button.resizeHalf', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">50%</span>',\n tooltip: this.lang.image.resizeHalf,\n click: this.context.createInvokeHandler('editor.resize', '0.5'),\n }).render();\n });\n this.context.memo('button.resizeQuarter', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">25%</span>',\n tooltip: this.lang.image.resizeQuarter,\n click: this.context.createInvokeHandler('editor.resize', '0.25'),\n }).render();\n });\n this.context.memo('button.resizeNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.resizeNone,\n click: this.context.createInvokeHandler('editor.resize', '0'),\n }).render();\n });\n\n // Float Buttons\n this.context.memo('button.floatLeft', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatLeft),\n tooltip: this.lang.image.floatLeft,\n click: this.context.createInvokeHandler('editor.floatMe', 'left'),\n }).render();\n });\n\n this.context.memo('button.floatRight', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatRight),\n tooltip: this.lang.image.floatRight,\n click: this.context.createInvokeHandler('editor.floatMe', 'right'),\n }).render();\n });\n\n this.context.memo('button.floatNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.floatNone,\n click: this.context.createInvokeHandler('editor.floatMe', 'none'),\n }).render();\n });\n\n // Remove Buttons\n this.context.memo('button.removeMedia', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.image.remove,\n click: this.context.createInvokeHandler('editor.removeMedia'),\n }).render();\n });\n }\n\n addLinkPopoverButtons() {\n this.context.memo('button.linkDialogShow', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.edit,\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.unlink', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unlink),\n tooltip: this.lang.link.unlink,\n click: this.context.createInvokeHandler('editor.unlink'),\n }).render();\n });\n }\n\n /**\n * table : [\n * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n * ],\n */\n addTablePopoverButtons() {\n this.context.memo('button.addRowUp', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowAbove),\n tooltip: this.lang.table.addRowAbove,\n click: this.context.createInvokeHandler('editor.addRow', 'top'),\n }).render();\n });\n this.context.memo('button.addRowDown', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowBelow),\n tooltip: this.lang.table.addRowBelow,\n click: this.context.createInvokeHandler('editor.addRow', 'bottom'),\n }).render();\n });\n this.context.memo('button.addColLeft', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colBefore),\n tooltip: this.lang.table.addColLeft,\n click: this.context.createInvokeHandler('editor.addCol', 'left'),\n }).render();\n });\n this.context.memo('button.addColRight', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colAfter),\n tooltip: this.lang.table.addColRight,\n click: this.context.createInvokeHandler('editor.addCol', 'right'),\n }).render();\n });\n this.context.memo('button.deleteRow', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowRemove),\n tooltip: this.lang.table.delRow,\n click: this.context.createInvokeHandler('editor.deleteRow'),\n }).render();\n });\n this.context.memo('button.deleteCol', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colRemove),\n tooltip: this.lang.table.delCol,\n click: this.context.createInvokeHandler('editor.deleteCol'),\n }).render();\n });\n this.context.memo('button.deleteTable', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.table.delTable,\n click: this.context.createInvokeHandler('editor.deleteTable'),\n }).render();\n });\n }\n\n build($container, groups) {\n for (let groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n const group = groups[groupIdx];\n const groupName = Array.isArray(group) ? group[0] : group;\n const buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n\n const $group = this.ui.buttonGroup({\n className: 'note-' + groupName,\n }).render();\n\n for (let idx = 0, len = buttons.length; idx < len; idx++) {\n const btn = this.context.memo('button.' + buttons[idx]);\n if (btn) {\n $group.append(typeof btn === 'function' ? btn(this.context) : btn);\n }\n }\n $group.appendTo($container);\n }\n }\n\n /**\n * @param {jQuery} [$container]\n */\n updateCurrentStyle($container) {\n const $cont = $container || this.$toolbar;\n\n const styleInfo = this.context.invoke('editor.currentStyle');\n this.updateBtnStates($cont, {\n '.note-btn-bold': () => {\n return styleInfo['font-bold'] === 'bold';\n },\n '.note-btn-italic': () => {\n return styleInfo['font-italic'] === 'italic';\n },\n '.note-btn-underline': () => {\n return styleInfo['font-underline'] === 'underline';\n },\n '.note-btn-subscript': () => {\n return styleInfo['font-subscript'] === 'subscript';\n },\n '.note-btn-superscript': () => {\n return styleInfo['font-superscript'] === 'superscript';\n },\n '.note-btn-strikethrough': () => {\n return styleInfo['font-strikethrough'] === 'strikethrough';\n },\n });\n\n if (styleInfo['font-family']) {\n const fontNames = styleInfo['font-family'].split(',').map((name) => {\n return name.replace(/[\\'\\\"]/g, '')\n .replace(/\\s+$/, '')\n .replace(/^\\s+/, '');\n });\n const fontName = lists.find(fontNames, this.isFontInstalled.bind(this));\n\n $cont.find('.dropdown-fontname a').each((idx, item) => {\n const $item = $(item);\n // always compare string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontName + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontname').text(fontName).css('font-family', fontName);\n }\n\n if (styleInfo['font-size']) {\n const fontSize = styleInfo['font-size'];\n $cont.find('.dropdown-fontsize a').each((idx, item) => {\n const $item = $(item);\n // always compare with string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontSize + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsize').text(fontSize);\n\n const fontSizeUnit = styleInfo['font-size-unit'];\n $cont.find('.dropdown-fontsizeunit a').each((idx, item) => {\n const $item = $(item);\n const isChecked = ($item.data('value') + '') === (fontSizeUnit + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsizeunit').text(fontSizeUnit);\n }\n\n if (styleInfo['line-height']) {\n const lineHeight = styleInfo['line-height'];\n $cont.find('.dropdown-line-height li a').each((idx, item) => {\n // always compare with string to avoid creating another func.\n const isChecked = ($(item).data('value') + '') === (lineHeight + '');\n this.className = isChecked ? 'checked' : '';\n });\n }\n }\n\n updateBtnStates($container, infos) {\n $.each(infos, (selector, pred) => {\n this.ui.toggleBtnActive($container.find(selector), pred());\n });\n }\n\n tableMoveHandler(event) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n }\n}\n","import $ from 'jquery';\nexport default class Toolbar {\n constructor(context) {\n this.context = context;\n\n this.$window = $(window);\n this.$document = $(document);\n\n this.ui = $.summernote.ui;\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$statusbar = context.layoutInfo.statusbar;\n this.options = context.options;\n\n this.isFollowing = false;\n this.followScroll = this.followScroll.bind(this);\n }\n\n shouldInitialize() {\n return !this.options.airMode;\n }\n\n initialize() {\n this.options.toolbar = this.options.toolbar || [];\n\n if (!this.options.toolbar.length) {\n this.$toolbar.hide();\n } else {\n this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n }\n\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n\n this.changeContainer(false);\n\n this.$note.on('summernote.keyup summernote.mouseup summernote.change', () => {\n this.context.invoke('buttons.updateCurrentStyle');\n });\n\n this.context.invoke('buttons.updateCurrentStyle');\n if (this.options.followingToolbar) {\n this.$window.on('scroll resize', this.followScroll);\n }\n }\n\n destroy() {\n this.$toolbar.children().remove();\n\n if (this.options.followingToolbar) {\n this.$window.off('scroll resize', this.followScroll);\n }\n }\n\n followScroll() {\n if (this.$editor.hasClass('fullscreen')) {\n return false;\n }\n\n const editorHeight = this.$editor.outerHeight();\n const editorWidth = this.$editor.width();\n const toolbarHeight = this.$toolbar.height();\n const statusbarHeight = this.$statusbar.height();\n\n // check if the web app is currently using another static bar\n let otherBarHeight = 0;\n if (this.options.otherStaticBar) {\n otherBarHeight = $(this.options.otherStaticBar).outerHeight();\n }\n\n const currentOffset = this.$document.scrollTop();\n const editorOffsetTop = this.$editor.offset().top;\n const editorOffsetBottom = editorOffsetTop + editorHeight;\n const activateOffset = editorOffsetTop - otherBarHeight;\n const deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n\n if (!this.isFollowing &&\n (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n this.isFollowing = true;\n this.$editable.css({\n marginTop: this.$toolbar.outerHeight(),\n });\n this.$toolbar.css({\n position: 'fixed',\n top: otherBarHeight,\n width: editorWidth,\n zIndex: 1000,\n });\n } else if (this.isFollowing &&\n ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n this.isFollowing = false;\n this.$toolbar.css({\n position: 'relative',\n top: 0,\n width: '100%',\n zIndex: 'auto',\n });\n this.$editable.css({\n marginTop: '',\n });\n }\n }\n\n changeContainer(isFullscreen) {\n if (isFullscreen) {\n this.$toolbar.prependTo(this.$editor);\n } else {\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n }\n if (this.options.followingToolbar) {\n this.followScroll();\n }\n }\n\n updateFullscreen(isFullscreen) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n\n this.changeContainer(isFullscreen);\n }\n\n updateCodeview(isCodeview) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n if (isCodeview) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n activate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, true);\n }\n\n deactivate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, false);\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\n\nexport default class LinkDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-txt-${this.options.id}\" class=\"note-form-label\">${this.lang.link.textToDisplay}</label>`,\n `<input id=\"note-dialog-link-txt-${this.options.id}\" class=\"note-link-text form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-url-${this.options.id}\" class=\"note-form-label\">${this.lang.link.url}</label>`,\n `<input id=\"note-dialog-link-url-${this.options.id}\" class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\"/>`,\n '</div>',\n !this.options.disableLinkTarget\n ? $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-open-in-new-window',\n text: this.lang.link.openInNewWindow,\n checked: true,\n }).render()).html()\n : '',\n $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-use-protocol',\n text: this.lang.link.useProtocol,\n checked: true,\n }).render()).html(),\n ].join('');\n\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.link.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n className: 'link-dialog',\n title: this.lang.link.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n /**\n * toggle update button\n */\n toggleLinkBtn($linkBtn, $linkText, $linkUrl) {\n this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n }\n\n /**\n * Show link dialog and set event handlers on dialog controls.\n *\n * @param {Object} linkInfo\n * @return {Promise}\n */\n showLinkDialog(linkInfo) {\n return $.Deferred((deferred) => {\n const $linkText = this.$dialog.find('.note-link-text');\n const $linkUrl = this.$dialog.find('.note-link-url');\n const $linkBtn = this.$dialog.find('.note-link-btn');\n const $openInNewWindow = this.$dialog\n .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n const $useProtocol = this.$dialog\n .find('.sn-checkbox-use-protocol input[type=checkbox]');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // If no url was given and given text is valid URL then copy that into URL Field\n if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n linkInfo.url = linkInfo.text;\n }\n\n $linkText.on('input paste propertychange', () => {\n // If linktext was modified by input events,\n // cloning text from linkUrl will be stopped.\n linkInfo.text = $linkText.val();\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.text);\n\n $linkUrl.on('input paste propertychange', () => {\n // Display same text on `Text to display` as default\n // when linktext has no text\n if (!linkInfo.text) {\n $linkText.val($linkUrl.val());\n }\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.url);\n\n if (!env.isSupportTouch) {\n $linkUrl.trigger('focus');\n }\n\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n this.bindEnterKey($linkUrl, $linkBtn);\n this.bindEnterKey($linkText, $linkBtn);\n\n const isNewWindowChecked = linkInfo.isNewWindow !== undefined\n ? linkInfo.isNewWindow : this.context.options.linkTargetBlank;\n\n $openInNewWindow.prop('checked', isNewWindowChecked);\n\n const useProtocolChecked = linkInfo.url\n ? false : this.context.options.useProtocol;\n\n $useProtocol.prop('checked', useProtocolChecked);\n\n $linkBtn.one('click', (event) => {\n event.preventDefault();\n\n deferred.resolve({\n range: linkInfo.range,\n url: $linkUrl.val(),\n text: $linkText.val(),\n isNewWindow: $openInNewWindow.is(':checked'),\n checkProtocol: $useProtocol.is(':checked'),\n });\n this.ui.hideDialog(this.$dialog);\n });\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n // detach events\n $linkText.off();\n $linkUrl.off();\n $linkBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n /**\n * @param {Object} layoutInfo\n */\n show() {\n const linkInfo = this.context.invoke('editor.getLinkInfo');\n\n this.context.invoke('editor.saveRange');\n this.showLinkDialog(linkInfo).then((linkInfo) => {\n this.context.invoke('editor.restoreRange');\n this.context.invoke('editor.createLink', linkInfo);\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class LinkPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': () => {\n this.update();\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.link);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-link-popover',\n callback: ($node) => {\n const $content = $node.find('.popover-content,.note-popover-content');\n $content.prepend('<span><a target=\"_blank\"></a> </span>');\n },\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.link);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update() {\n // Prevent focusing on editable when invoke('code') is executed\n if (!this.context.invoke('editor.hasFocus')) {\n this.hide();\n return;\n }\n\n const rng = this.context.invoke('editor.getLastRange');\n if (rng.isCollapsed() && rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n const href = $(anchor).attr('href');\n this.$popover.find('a').attr('href', href).text(href);\n\n const pos = dom.posFromPlaceholder(anchor);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class ImageDialog {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n let imageLimitation = '';\n if (this.options.maximumImageFileSize) {\n const unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n const readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n ' ' + ' KMGTP'[unit] + 'B';\n imageLimitation = `<small>${this.lang.image.maximumFileSize + ' : ' + readableSize}</small>`;\n }\n\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group note-group-select-from-files\">',\n '<label for=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n '<input id=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-image-input form-control-file note-form-control note-input\" ',\n ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>',\n imageLimitation,\n '</div>',\n '<div class=\"form-group note-group-image-url\">',\n '<label for=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.url + '</label>',\n '<input id=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-image-url form-control note-form-control note-input\" type=\"text\"/>',\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.image.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.image.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showImageDialog().then((data) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n if (typeof data === 'string') { // image url\n // If onImageLinkInsert set,\n if (this.options.callbacks.onImageLinkInsert) {\n this.context.triggerEvent('image.link.insert', data);\n } else {\n this.context.invoke('editor.insertImage', data);\n }\n } else { // array of files\n this.context.invoke('editor.insertImagesOrCallback', data);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show image dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showImageDialog() {\n return $.Deferred((deferred) => {\n const $imageInput = this.$dialog.find('.note-image-input');\n const $imageUrl = this.$dialog.find('.note-image-url');\n const $imageBtn = this.$dialog.find('.note-image-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // Cloning imageInput to clear element.\n $imageInput.replaceWith($imageInput.clone().on('change', (event) => {\n deferred.resolve(event.target.files || event.target.value);\n }).val(''));\n\n $imageUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($imageBtn, $imageUrl.val());\n }).val('');\n\n if (!env.isSupportTouch) {\n $imageUrl.trigger('focus');\n }\n\n $imageBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($imageUrl.val());\n });\n\n this.bindEnterKey($imageUrl, $imageBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $imageInput.off();\n $imageUrl.off();\n $imageBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\n/**\n * Image popover module\n * mouse events that show/hide popover will be handled by Handle.js.\n * Handle.js will receive the events and invoke 'imagePopover.update'.\n */\nexport default class ImagePopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n\n this.editable = context.layoutInfo.editable[0];\n this.options = context.options;\n\n this.events = {\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.image);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-image-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n this.context.invoke('buttons.build', $content, this.options.popover.image);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target, event) {\n if (dom.isImg(target)) {\n const position = $(target).offset();\n const containerOffset = $(this.options.container).offset();\n let pos = {};\n if (this.options.popatmouse) {\n pos.left = event.pageX - 20;\n pos.top = event.pageY;\n } else {\n pos = position;\n }\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class TablePopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.mousedown': (we, e) => {\n this.update(e.target);\n },\n 'summernote.keyup summernote.scroll summernote.change': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.table);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-table-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.table);\n\n // [workaround] Disable Firefox's default table editor\n if (env.isFF) {\n document.execCommand('enableInlineTableEditing', false, false);\n }\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isCell = dom.isCell(target);\n\n if (isCell) {\n const pos = dom.posFromPlaceholder(target);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n\n return isCell;\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class VideoDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group row-fluid\">',\n `<label for=\"note-dialog-video-url-${this.options.id}\" class=\"note-form-label\">${this.lang.video.url} <small class=\"text-muted\">${this.lang.video.providers}</small></label>`,\n `<input id=\"note-dialog-video-url-${this.options.id}\" class=\"note-video-url form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.video.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.video.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n createVideoNode(url) {\n // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n const ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n const ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n const ytMatch = url.match(ytRegExp);\n\n const igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n const igMatch = url.match(igRegExp);\n\n const vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n const vMatch = url.match(vRegExp);\n\n const vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n const vimMatch = url.match(vimRegExp);\n\n const dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n const dmMatch = url.match(dmRegExp);\n\n const youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n const youkuMatch = url.match(youkuRegExp);\n\n const qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n const qqMatch = url.match(qqRegExp);\n\n const qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n const qqMatch2 = url.match(qqRegExp2);\n\n const mp4RegExp = /^.+.(mp4|m4v)$/;\n const mp4Match = url.match(mp4RegExp);\n\n const oggRegExp = /^.+.(ogg|ogv)$/;\n const oggMatch = url.match(oggRegExp);\n\n const webmRegExp = /^.+.(webm)$/;\n const webmMatch = url.match(webmRegExp);\n\n const fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n const fbMatch = url.match(fbRegExp);\n\n let $video;\n if (ytMatch && ytMatch[1].length === 11) {\n const youtubeId = ytMatch[1];\n var start = 0;\n if (typeof ytMatch[2] !== 'undefined') {\n const ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n if (ytMatchForStart) {\n for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n }\n }\n }\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n .attr('width', '640').attr('height', '360');\n } else if (igMatch && igMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n .attr('width', '612').attr('height', '710')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else if (vMatch && vMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', vMatch[0] + '/embed/simple')\n .attr('width', '600').attr('height', '600')\n .attr('class', 'vine-embed');\n } else if (vimMatch && vimMatch[3].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n .attr('width', '640').attr('height', '360');\n } else if (dmMatch && dmMatch[2].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n .attr('width', '640').attr('height', '360');\n } else if (youkuMatch && youkuMatch[1].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '498')\n .attr('width', '510')\n .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n const vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '310')\n .attr('width', '500')\n .attr('src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');\n } else if (mp4Match || oggMatch || webmMatch) {\n $video = $('<video controls>')\n .attr('src', url)\n .attr('width', '640').attr('height', '360');\n } else if (fbMatch && fbMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n .attr('width', '560').attr('height', '301')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else {\n // this is not a known video link. Now what, Cat? Now what?\n return false;\n }\n\n $video.addClass('note-video-clip');\n\n return $video[0];\n }\n\n show() {\n const text = this.context.invoke('editor.getSelectedText');\n this.context.invoke('editor.saveRange');\n this.showVideoDialog(text).then((url) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n // build node\n const $node = this.createVideoNode(url);\n\n if ($node) {\n // insert video node\n this.context.invoke('editor.insertNode', $node);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show video dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showVideoDialog(/* text */) {\n return $.Deferred((deferred) => {\n const $videoUrl = this.$dialog.find('.note-video-url');\n const $videoBtn = this.$dialog.find('.note-video-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n $videoUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($videoBtn, $videoUrl.val());\n });\n\n if (!env.isSupportTouch) {\n $videoUrl.trigger('focus');\n }\n\n $videoBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($videoUrl.val());\n });\n\n this.bindEnterKey($videoUrl, $videoBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $videoUrl.off();\n $videoBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\n\nexport default class HelpDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<p class=\"text-center\">',\n '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote @@VERSION@@</a> · ',\n '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n '</p>',\n ].join('');\n\n this.$dialog = this.ui.dialog({\n title: this.lang.options.help,\n fade: this.options.dialogsFade,\n body: this.createShortcutList(),\n footer: body,\n callback: ($node) => {\n $node.find('.modal-body,.note-modal-body').css({\n 'max-height': 300,\n 'overflow': 'scroll',\n });\n },\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n createShortcutList() {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n return Object.keys(keyMap).map((key) => {\n const command = keyMap[key];\n const $row = $('<div><div class=\"help-list-item\"/></div>');\n $row.append($('<label><kbd>' + key + '</kdb></label>').css({\n 'width': 180,\n 'margin-right': 10,\n })).append($('<span/>').html(this.context.memo('help.' + command) || command));\n return $row.html();\n }).join('');\n }\n\n /**\n * show help dialog\n *\n * @return {Promise}\n */\n showHelpDialog() {\n return $.Deferred((deferred) => {\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n deferred.resolve();\n });\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showHelpDialog().then(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\n\nconst AIRMODE_POPOVER_X_OFFSET = -5;\nconst AIRMODE_POPOVER_Y_OFFSET = 5;\n\nexport default class AirPopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.options = context.options;\n\n this.hidable = true;\n this.onContextmenu = false;\n this.pageX = null;\n this.pageY = null;\n\n this.events = {\n 'summernote.contextmenu': (e) => {\n if (this.options.editing) {\n e.preventDefault();\n e.stopPropagation();\n this.onContextmenu = true;\n this.update(true);\n }\n },\n 'summernote.mousedown': (we, e) => {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n },\n 'summernote.keyup summernote.mouseup summernote.scroll': (we, e) => {\n if (this.options.editing && !this.onContextmenu) {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n this.update();\n }\n this.onContextmenu = false;\n },\n 'summernote.disable summernote.change summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n 'summernote.focusout': () => {\n if (!this.$popover.is(':active,:focus')) {\n this.hide();\n }\n },\n };\n }\n\n shouldInitialize() {\n return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-air-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.air);\n\n // disable hiding this popover preemptively by 'summernote.blur' event.\n this.$popover.on('mousedown', () => { this.hidable = false; });\n // (re-)enable hiding after 'summernote.blur' has been handled (aka. ignored).\n this.$popover.on('mouseup', () => { this.hidable = true; });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(forcelyOpen) {\n const styleInfo = this.context.invoke('editor.currentStyle');\n if (styleInfo.range && (!styleInfo.range.isCollapsed() || forcelyOpen)) {\n let rect = {\n left: this.pageX,\n top: this.pageY,\n };\n\n const containerOffset = $(this.options.container).offset();\n rect.top -= containerOffset.top;\n rect.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: Math.max(rect.left, 0) + AIRMODE_POPOVER_X_OFFSET,\n top: rect.top + AIRMODE_POPOVER_Y_OFFSET,\n });\n this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n } else {\n this.hide();\n }\n }\n\n hide() {\n if (this.hidable) {\n this.$popover.hide();\n }\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport key from '../core/key';\n\nconst POPOVER_DIST = 5;\n\nexport default class HintPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.hint = this.options.hint || [];\n this.direction = this.options.hintDirection || 'bottom';\n this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return this.hints.length > 0;\n }\n\n initialize() {\n this.lastWordRange = null;\n this.matchingWord = null;\n this.$popover = this.ui.popover({\n className: 'note-hint-popover',\n hideArrow: true,\n direction: '',\n }).render().appendTo(this.options.container);\n\n this.$popover.hide();\n this.$content = this.$popover.find('.popover-content,.note-popover-content');\n this.$content.on('click', '.note-hint-item', (e) => {\n this.$content.find('.active').removeClass('active');\n $(e.currentTarget).addClass('active');\n this.replace();\n });\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n selectItem($item) {\n this.$content.find('.active').removeClass('active');\n $item.addClass('active');\n\n this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n }\n\n moveDown() {\n const $current = this.$content.find('.note-hint-item.active');\n const $next = $current.next();\n\n if ($next.length) {\n this.selectItem($next);\n } else {\n let $nextGroup = $current.parent().next();\n\n if (!$nextGroup.length) {\n $nextGroup = this.$content.find('.note-hint-group').first();\n }\n\n this.selectItem($nextGroup.find('.note-hint-item').first());\n }\n }\n\n moveUp() {\n const $current = this.$content.find('.note-hint-item.active');\n const $prev = $current.prev();\n\n if ($prev.length) {\n this.selectItem($prev);\n } else {\n let $prevGroup = $current.parent().prev();\n\n if (!$prevGroup.length) {\n $prevGroup = this.$content.find('.note-hint-group').last();\n }\n\n this.selectItem($prevGroup.find('.note-hint-item').last());\n }\n }\n\n replace() {\n const $item = this.$content.find('.note-hint-item.active');\n\n if ($item.length) {\n var node = this.nodeFromItem($item);\n // If matchingWord length = 0 -> capture OK / open hint / but as mention capture \"\" (\\w*)\n if (this.matchingWord !== null && this.matchingWord.length === 0) {\n this.lastWordRange.so = this.lastWordRange.eo;\n // Else si > 0 and normal case -> adjust range \"before\" for correct position of insertion\n } else if (this.matchingWord !== null && this.matchingWord.length > 0 && !this.lastWordRange.isCollapsed()) {\n let rangeCompute = this.lastWordRange.eo - this.lastWordRange.so - this.matchingWord.length;\n if (rangeCompute > 0) {\n this.lastWordRange.so += rangeCompute;\n }\n }\n this.lastWordRange.insertNode(node);\n\n if (this.options.hintSelect === 'next') {\n var blank = document.createTextNode('');\n $(node).after(blank);\n range.createFromNodeBefore(blank).select();\n } else {\n range.createFromNodeAfter(node).select();\n }\n\n this.lastWordRange = null;\n this.hide();\n this.context.invoke('editor.focus');\n }\n }\n\n nodeFromItem($item) {\n const hint = this.hints[$item.data('index')];\n const item = $item.data('item');\n let node = hint.content ? hint.content(item) : item;\n if (typeof node === 'string') {\n node = dom.createText(node);\n }\n return node;\n }\n\n createItemTemplates(hintIdx, items) {\n const hint = this.hints[hintIdx];\n return items.map((item /*, idx */) => {\n const $item = $('<div class=\"note-hint-item\"/>');\n $item.append(hint.template ? hint.template(item) : item + '');\n $item.data({\n 'index': hintIdx,\n 'item': item,\n });\n return $item;\n });\n }\n\n handleKeydown(e) {\n if (!this.$popover.is(':visible')) {\n return;\n }\n\n if (e.keyCode === key.code.ENTER) {\n e.preventDefault();\n this.replace();\n } else if (e.keyCode === key.code.UP) {\n e.preventDefault();\n this.moveUp();\n } else if (e.keyCode === key.code.DOWN) {\n e.preventDefault();\n this.moveDown();\n }\n }\n\n searchKeyword(index, keyword, callback) {\n const hint = this.hints[index];\n if (hint && hint.match.test(keyword) && hint.search) {\n const matches = hint.match.exec(keyword);\n this.matchingWord = matches[0];\n hint.search(matches[1], callback);\n } else {\n callback();\n }\n }\n\n createGroup(idx, keyword) {\n const $group = $('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n this.searchKeyword(idx, keyword, (items) => {\n items = items || [];\n if (items.length) {\n $group.html(this.createItemTemplates(idx, items));\n this.show();\n }\n });\n\n return $group;\n }\n\n handleKeyup(e) {\n if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n let range = this.context.invoke('editor.getLastRange');\n let wordRange, keyword;\n if (this.options.hintMode === 'words') {\n wordRange = range.getWordsRange(range);\n keyword = wordRange.toString();\n\n this.hints.forEach((hint) => {\n if (hint.match.test(keyword)) {\n wordRange = range.getWordsMatchRange(hint.match);\n return false;\n }\n });\n\n if (!wordRange) {\n this.hide();\n return;\n }\n\n keyword = wordRange.toString();\n } else {\n wordRange = range.getWordRange();\n keyword = wordRange.toString();\n }\n\n if (this.hints.length && keyword) {\n this.$content.empty();\n\n const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n const containerOffset = $(this.options.container).offset();\n if (bnd) {\n bnd.top -= containerOffset.top;\n bnd.left -= containerOffset.left;\n\n this.$popover.hide();\n this.lastWordRange = wordRange;\n this.hints.forEach((hint, idx) => {\n if (hint.match.test(keyword)) {\n this.createGroup(idx, keyword).appendTo(this.$content);\n }\n });\n // select first .note-hint-item\n this.$content.find('.note-hint-item:first').addClass('active');\n\n // set position for popover after group is created\n if (this.direction === 'top') {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST,\n });\n } else {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top + bnd.height + POPOVER_DIST,\n });\n }\n }\n } else {\n this.hide();\n }\n }\n }\n\n show() {\n this.$popover.show();\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport './summernote-en-US';\nimport '../summernote';\nimport dom from './core/dom';\nimport range from './core/range';\nimport lists from './core/lists';\nimport Editor from './module/Editor';\nimport Clipboard from './module/Clipboard';\nimport Dropzone from './module/Dropzone';\nimport Codeview from './module/Codeview';\nimport Statusbar from './module/Statusbar';\nimport Fullscreen from './module/Fullscreen';\nimport Handle from './module/Handle';\nimport AutoLink from './module/AutoLink';\nimport AutoSync from './module/AutoSync';\nimport AutoReplace from './module/AutoReplace';\nimport Placeholder from './module/Placeholder';\nimport Buttons from './module/Buttons';\nimport Toolbar from './module/Toolbar';\nimport LinkDialog from './module/LinkDialog';\nimport LinkPopover from './module/LinkPopover';\nimport ImageDialog from './module/ImageDialog';\nimport ImagePopover from './module/ImagePopover';\nimport TablePopover from './module/TablePopover';\nimport VideoDialog from './module/VideoDialog';\nimport HelpDialog from './module/HelpDialog';\nimport AirPopover from './module/AirPopover';\nimport HintPopover from './module/HintPopover';\n\n$.summernote = $.extend($.summernote, {\n version: '@@VERSION@@',\n plugins: {},\n\n dom: dom,\n range: range,\n lists: lists,\n\n options: {\n langInfo: $.summernote.lang['en-US'],\n editing: true,\n modules: {\n 'editor': Editor,\n 'clipboard': Clipboard,\n 'dropzone': Dropzone,\n 'codeview': Codeview,\n 'statusbar': Statusbar,\n 'fullscreen': Fullscreen,\n 'handle': Handle,\n // FIXME: HintPopover must be front of autolink\n // - Script error about range when Enter key is pressed on hint popover\n 'hintPopover': HintPopover,\n 'autoLink': AutoLink,\n 'autoSync': AutoSync,\n 'autoReplace': AutoReplace,\n 'placeholder': Placeholder,\n 'buttons': Buttons,\n 'toolbar': Toolbar,\n 'linkDialog': LinkDialog,\n 'linkPopover': LinkPopover,\n 'imageDialog': ImageDialog,\n 'imagePopover': ImagePopover,\n 'tablePopover': TablePopover,\n 'videoDialog': VideoDialog,\n 'helpDialog': HelpDialog,\n 'airPopover': AirPopover,\n },\n\n buttons: {},\n\n lang: 'en-US',\n\n followingToolbar: false,\n toolbarPosition: 'top',\n otherStaticBar: '',\n\n // toolbar\n toolbar: [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['fontname', ['fontname']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']],\n ],\n\n // popover\n popatmouse: true,\n popover: {\n image: [\n ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n ['float', ['floatLeft', 'floatRight', 'floatNone']],\n ['remove', ['removeMedia']],\n ],\n link: [\n ['link', ['linkDialogShow', 'unlink']],\n ],\n table: [\n ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n ],\n air: [\n ['color', ['color']],\n ['font', ['bold', 'underline', 'clear']],\n ['para', ['ul', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture']],\n ['view', ['fullscreen', 'codeview']],\n ],\n },\n\n // air mode: inline editor\n airMode: false,\n overrideContextMenu: false, // TBD\n\n width: null,\n height: null,\n linkTargetBlank: true,\n useProtocol: true,\n defaultProtocol: 'http://',\n\n focus: false,\n tabDisabled: false,\n tabSize: 4,\n styleWithCSS: false,\n shortcuts: true,\n textareaAutoSync: true,\n tooltip: 'auto',\n container: null,\n maxTextLength: 0,\n blockquoteBreakingLevel: 2,\n spellCheck: true,\n disableGrammar: false,\n placeholder: null,\n inheritPlaceholder: false,\n // TODO: need to be documented\n recordEveryKeystroke: false,\n historyLimit: 200,\n\n // TODO: need to be documented\n hintMode: 'word',\n hintSelect: 'after',\n hintDirection: 'bottom',\n\n styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n fontNames: [\n 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n 'Tahoma', 'Times New Roman', 'Verdana',\n ],\n fontNamesIgnoreCheck: [],\n addDefaultFonts: true,\n\n fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n\n fontSizeUnits: ['px', 'pt'],\n\n // pallete colors(n x n)\n colors: [\n ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n ],\n\n // http://chir.ag/projects/name-that-color/\n colorsName: [\n ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n ],\n\n colorButton: {\n foreColor: '#000000',\n backColor: '#FFFF00',\n },\n\n lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n\n tableClassName: 'table table-bordered',\n\n insertTableMaxSize: {\n col: 10,\n row: 10,\n },\n\n // By default, dialogs are attached in container.\n dialogsInBody: false,\n dialogsFade: false,\n\n maximumImageFileSize: null,\n\n callbacks: {\n onBeforeCommand: null,\n onBlur: null,\n onBlurCodeview: null,\n onChange: null,\n onChangeCodeview: null,\n onDialogShown: null,\n onEnter: null,\n onFocus: null,\n onImageLinkInsert: null,\n onImageUpload: null,\n onImageUploadError: null,\n onInit: null,\n onKeydown: null,\n onKeyup: null,\n onMousedown: null,\n onMouseup: null,\n onPaste: null,\n onScroll: null,\n },\n\n codemirror: {\n mode: 'text/html',\n htmlMode: true,\n lineNumbers: true,\n },\n\n codeviewFilter: false,\n codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n codeviewIframeFilter: true,\n codeviewIframeWhitelistSrc: [],\n codeviewIframeWhitelistSrcBase: [\n 'www.youtube.com',\n 'www.youtube-nocookie.com',\n 'www.facebook.com',\n 'vine.co',\n 'instagram.com',\n 'player.vimeo.com',\n 'www.dailymotion.com',\n 'player.youku.com',\n 'v.qq.com',\n ],\n\n keyMap: {\n pc: {\n 'ENTER': 'insertParagraph',\n 'CTRL+Z': 'undo',\n 'CTRL+Y': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CTRL+B': 'bold',\n 'CTRL+I': 'italic',\n 'CTRL+U': 'underline',\n 'CTRL+SHIFT+S': 'strikethrough',\n 'CTRL+BACKSLASH': 'removeFormat',\n 'CTRL+SHIFT+L': 'justifyLeft',\n 'CTRL+SHIFT+E': 'justifyCenter',\n 'CTRL+SHIFT+R': 'justifyRight',\n 'CTRL+SHIFT+J': 'justifyFull',\n 'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n 'CTRL+SHIFT+NUM8': 'insertOrderedList',\n 'CTRL+LEFTBRACKET': 'outdent',\n 'CTRL+RIGHTBRACKET': 'indent',\n 'CTRL+NUM0': 'formatPara',\n 'CTRL+NUM1': 'formatH1',\n 'CTRL+NUM2': 'formatH2',\n 'CTRL+NUM3': 'formatH3',\n 'CTRL+NUM4': 'formatH4',\n 'CTRL+NUM5': 'formatH5',\n 'CTRL+NUM6': 'formatH6',\n 'CTRL+ENTER': 'insertHorizontalRule',\n 'CTRL+K': 'linkDialog.show',\n },\n\n mac: {\n 'ENTER': 'insertParagraph',\n 'CMD+Z': 'undo',\n 'CMD+SHIFT+Z': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CMD+B': 'bold',\n 'CMD+I': 'italic',\n 'CMD+U': 'underline',\n 'CMD+SHIFT+S': 'strikethrough',\n 'CMD+BACKSLASH': 'removeFormat',\n 'CMD+SHIFT+L': 'justifyLeft',\n 'CMD+SHIFT+E': 'justifyCenter',\n 'CMD+SHIFT+R': 'justifyRight',\n 'CMD+SHIFT+J': 'justifyFull',\n 'CMD+SHIFT+NUM7': 'insertUnorderedList',\n 'CMD+SHIFT+NUM8': 'insertOrderedList',\n 'CMD+LEFTBRACKET': 'outdent',\n 'CMD+RIGHTBRACKET': 'indent',\n 'CMD+NUM0': 'formatPara',\n 'CMD+NUM1': 'formatH1',\n 'CMD+NUM2': 'formatH2',\n 'CMD+NUM3': 'formatH3',\n 'CMD+NUM4': 'formatH4',\n 'CMD+NUM5': 'formatH5',\n 'CMD+NUM6': 'formatH6',\n 'CMD+ENTER': 'insertHorizontalRule',\n 'CMD+K': 'linkDialog.show',\n },\n },\n icons: {\n 'align': 'note-icon-align',\n 'alignCenter': 'note-icon-align-center',\n 'alignJustify': 'note-icon-align-justify',\n 'alignLeft': 'note-icon-align-left',\n 'alignRight': 'note-icon-align-right',\n 'rowBelow': 'note-icon-row-below',\n 'colBefore': 'note-icon-col-before',\n 'colAfter': 'note-icon-col-after',\n 'rowAbove': 'note-icon-row-above',\n 'rowRemove': 'note-icon-row-remove',\n 'colRemove': 'note-icon-col-remove',\n 'indent': 'note-icon-align-indent',\n 'outdent': 'note-icon-align-outdent',\n 'arrowsAlt': 'note-icon-arrows-alt',\n 'bold': 'note-icon-bold',\n 'caret': 'note-icon-caret',\n 'circle': 'note-icon-circle',\n 'close': 'note-icon-close',\n 'code': 'note-icon-code',\n 'eraser': 'note-icon-eraser',\n 'floatLeft': 'note-icon-float-left',\n 'floatRight': 'note-icon-float-right',\n 'font': 'note-icon-font',\n 'frame': 'note-icon-frame',\n 'italic': 'note-icon-italic',\n 'link': 'note-icon-link',\n 'unlink': 'note-icon-chain-broken',\n 'magic': 'note-icon-magic',\n 'menuCheck': 'note-icon-menu-check',\n 'minus': 'note-icon-minus',\n 'orderedlist': 'note-icon-orderedlist',\n 'pencil': 'note-icon-pencil',\n 'picture': 'note-icon-picture',\n 'question': 'note-icon-question',\n 'redo': 'note-icon-redo',\n 'rollback': 'note-icon-rollback',\n 'square': 'note-icon-square',\n 'strikethrough': 'note-icon-strikethrough',\n 'subscript': 'note-icon-subscript',\n 'superscript': 'note-icon-superscript',\n 'table': 'note-icon-table',\n 'textHeight': 'note-icon-text-height',\n 'trash': 'note-icon-trash',\n 'underline': 'note-icon-underline',\n 'undo': 'note-icon-undo',\n 'unorderedlist': 'note-icon-unorderedlist',\n 'video': 'note-icon-video',\n },\n },\n});\n","// extracted by mini-css-extract-plugin","import $ from 'jquery';\nimport renderer from '../base/renderer';\n\nconst editor = renderer.create('<div class=\"note-editor note-frame panel panel-default\"/>');\nconst toolbar = renderer.create('<div class=\"note-toolbar panel-heading\" role=\"toolbar\"></div></div>');\nconst editingArea = renderer.create('<div class=\"note-editing-area\"/>');\nconst codable = renderer.create('<textarea class=\"note-codable\" aria-multiline=\"true\"/>');\nconst editable = renderer.create('<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\nconst statusbar = renderer.create([\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n '<div class=\"note-statusbar\" role=\"status\">',\n '<div class=\"note-resizebar\" aria-label=\"Resize\">',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '</div>',\n '</div>',\n].join(''));\n\nconst airEditor = renderer.create('<div class=\"note-editor note-airframe\"/>');\nconst airEditable = renderer.create([\n '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n].join(''));\n\nconst buttonGroup = renderer.create('<div class=\"note-btn-group btn-group\">');\n\nconst dropdown = renderer.create('<ul class=\"note-dropdown-menu dropdown-menu\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n const option = (typeof item === 'object') ? item.option : undefined;\n\n const dataValue = 'data-value=\"' + value + '\"';\n const dataOption = (option !== undefined) ? ' data-option=\"' + option + '\"' : '';\n return '<li aria-label=\"' + value + '\"><a href=\"#\" ' + (dataValue + dataOption) + '>' + content + '</a></li>';\n }).join('') : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dropdownButtonContents = function(contents, options) {\n return contents + ' ' + icon(options.icons.caret, 'span');\n};\n\nconst dropdownCheck = renderer.create('<ul class=\"note-dropdown-menu dropdown-menu note-check\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n return '<li aria-label=\"' + item + '\"><a href=\"#\" data-value=\"' + value + '\">' + icon(options.checkClassName) + ' ' + content + '</a></li>';\n }).join('') : options.items;\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dialog = renderer.create('<div class=\"modal note-modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function($node, options) {\n if (options.fade) {\n $node.addClass('fade');\n }\n $node.attr({\n 'aria-label': options.title,\n });\n $node.html([\n '<div class=\"modal-dialog\">',\n '<div class=\"modal-content\">',\n (options.title ? '<div class=\"modal-header\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" aria-hidden=\"true\">×</button>' +\n '<h4 class=\"modal-title\">' + options.title + '</h4>' +\n '</div>' : ''),\n '<div class=\"modal-body\">' + options.body + '</div>',\n (options.footer ? '<div class=\"modal-footer\">' + options.footer + '</div>' : ''),\n '</div>',\n '</div>',\n ].join(''));\n});\n\nconst popover = renderer.create([\n '<div class=\"note-popover popover in\">',\n '<div class=\"arrow\"/>',\n '<div class=\"popover-content note-children-container\"/>',\n '</div>',\n].join(''), function($node, options) {\n const direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n\n $node.addClass(direction);\n\n if (options.hideArrow) {\n $node.find('.arrow').hide();\n }\n});\n\nconst checkbox = renderer.create('<div class=\"checkbox\"></div>', function($node, options) {\n $node.html([\n '<label' + (options.id ? ' for=\"note-' + options.id + '\"' : '') + '>',\n '<input type=\"checkbox\"' + (options.id ? ' id=\"note-' + options.id + '\"' : ''),\n (options.checked ? ' checked' : ''),\n ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n (options.text ? options.text : ''),\n '</label>',\n ].join(''));\n});\n\nconst icon = function(iconClassName, tagName) {\n tagName = tagName || 'i';\n return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n};\n\nconst ui = function(editorOptions) {\n return {\n editor: editor,\n toolbar: toolbar,\n editingArea: editingArea,\n codable: codable,\n editable: editable,\n statusbar: statusbar,\n airEditor: airEditor,\n airEditable: airEditable,\n buttonGroup: buttonGroup,\n dropdown: dropdown,\n dropdownButtonContents: dropdownButtonContents,\n dropdownCheck: dropdownCheck,\n dialog: dialog,\n popover: popover,\n checkbox: checkbox,\n icon: icon,\n options: editorOptions,\n\n palette: function($node, options) {\n return renderer.create('<div class=\"note-color-palette\"/>', function($node, options) {\n const contents = [];\n for (let row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n const eventName = options.eventName;\n const colors = options.colors[row];\n const colorsName = options.colorsName[row];\n const buttons = [];\n for (let col = 0, colSize = colors.length; col < colSize; col++) {\n const color = colors[col];\n const colorName = colorsName[col];\n buttons.push([\n '<button type=\"button\" class=\"note-color-btn\"',\n 'style=\"background-color:', color, '\" ',\n 'data-event=\"', eventName, '\" ',\n 'data-value=\"', color, '\" ',\n 'title=\"', colorName, '\" ',\n 'aria-label=\"', colorName, '\" ',\n 'data-toggle=\"button\" tabindex=\"-1\"></button>',\n ].join(''));\n }\n contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n }\n $node.html(contents.join(''));\n\n if (options.tooltip) {\n $node.find('.note-color-btn').tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n });\n }\n })($node, options);\n },\n\n button: function($node, options) {\n return renderer.create('<button type=\"button\" class=\"note-btn btn btn-default btn-sm\" tabindex=\"-1\">', function($node, options) {\n if (options && options.tooltip) {\n $node.attr({\n title: options.tooltip,\n 'aria-label': options.tooltip,\n }).tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n }).on('click', (e) => {\n $(e.currentTarget).tooltip('hide');\n });\n }\n })($node, options);\n },\n\n toggleBtn: function($btn, isEnable) {\n $btn.toggleClass('disabled', !isEnable);\n $btn.attr('disabled', !isEnable);\n },\n\n toggleBtnActive: function($btn, isActive) {\n $btn.toggleClass('active', isActive);\n },\n\n onDialogShown: function($dialog, handler) {\n $dialog.one('shown.bs.modal', handler);\n },\n\n onDialogHidden: function($dialog, handler) {\n $dialog.one('hidden.bs.modal', handler);\n },\n\n showDialog: function($dialog) {\n $dialog.modal('show');\n },\n\n hideDialog: function($dialog) {\n $dialog.modal('hide');\n },\n\n createLayout: function($note) {\n const $editor = (editorOptions.airMode ? airEditor([\n editingArea([\n codable(),\n airEditable(),\n ]),\n ]) : (editorOptions.toolbarPosition === 'bottom'\n ? editor([\n editingArea([\n codable(),\n editable(),\n ]),\n toolbar(),\n statusbar(),\n ])\n : editor([\n toolbar(),\n editingArea([\n codable(),\n editable(),\n ]),\n statusbar(),\n ])\n )).render();\n\n $editor.insertAfter($note);\n\n return {\n note: $note,\n editor: $editor,\n toolbar: $editor.find('.note-toolbar'),\n editingArea: $editor.find('.note-editing-area'),\n editable: $editor.find('.note-editable'),\n codable: $editor.find('.note-codable'),\n statusbar: $editor.find('.note-statusbar'),\n };\n },\n\n removeLayout: function($note, layoutInfo) {\n $note.html(layoutInfo.editable.html());\n layoutInfo.editor.remove();\n $note.show();\n },\n };\n};\n\nexport default ui;\n","import $ from 'jquery';\nimport ui from './ui';\nimport '../base/settings.js';\n\nimport '../../styles/summernote-bs3.scss';\n\n$.summernote = $.extend($.summernote, {\n ui_template: ui,\n interface: 'bs3',\n});\n"],"sourceRoot":""}
File: public/AdminLTE/plugins/summernote/summernote.min.js
Match lines: 1
2|!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jquery"));else if("function"==typeof define&&define.amd)define(["jquery"],e);else{var n="object"==typeof exports?e(require("jquery")):e(t.jQuery);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(t){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=52)}({0:function(e,n){e.exports=t},1:function(t,e,n){"use strict";var o=n(0),i=n.n(o);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var s=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.markup=e,this.children=n,this.options=o,this.callback=i}var e,n,o;return e=t,(n=[{key:"render",value:function(t){var e=i()(this.markup);if(this.options&&this.options.contents&&e.html(this.options.contents),this.options&&this.options.className&&e.addClass(this.options.className),this.options&&this.options.data&&i.a.each(this.options.data,(function(t,n){e.attr("data-"+t,n)})),this.options&&this.options.click&&e.on("click",this.options.click),this.children){var n=e.find(".note-children-container");this.children.forEach((function(t){t.render(n.length?n:e)}))}return this.callback&&this.callback(e,this.options),this.options&&this.options.callback&&this.options.callback(e),t&&t.append(e),e}}])&&a(e.prototype,n),o&&a(e,o),t}();e.a={create:function(t,e){return function(){var n="object"===r(arguments[1])?arguments[1]:arguments[0],o=Array.isArray(arguments[0])?arguments[0]:[];return n&&n.children&&(o=n.children),new s(t,o,n,e)}}}},2:function(t,e){(function(e){t.exports=e}).call(this,{})},3:function(t,e,n){"use strict";var o=n(0),i=n.n(o);i.a.summernote=i.a.summernote||{lang:{}},i.a.extend(i.a.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size",sizeunit:"Font Size Unit"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize full",resizeHalf:"Resize half",resizeQuarter:"Resize quarter",resizeNone:"Original size",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Remove float",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image",original:"Original"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window",useProtocol:"Use default protocol"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Text Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default",cpSelect:"Select"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"},output:{noSelection:"No Selection Made!"}}});var r="function"==typeof define&&n(2),a=["sans-serif","serif","monospace","cursive","fantasy"];function s(t){return-1===i.a.inArray(t.toLowerCase(),a)?"'".concat(t,"'"):t}var l,c=navigator.userAgent,u=/MSIE|Trident/i.test(c);if(u){var d=/MSIE (\d+[.]\d+)/.exec(c);d&&(l=parseFloat(d[1])),(d=/Trident\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(c))&&(l=parseFloat(d[1]))}var h=/Edge\/\d+/.test(c),f=!!window.CodeMirror,p="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,m=u?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input",v={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:u,isEdge:h,isFF:!h&&/firefox/i.test(c),isPhantom:/PhantomJS/i.test(c),isWebkit:!h&&/webkit/i.test(c),isChrome:!h&&/chrome/i.test(c),isSafari:!h&&/safari/i.test(c)&&!/chrome/i.test(c),browserVersion:l,jqueryVersion:parseFloat(i.a.fn.jquery),isSupportAmd:r,isSupportTouch:p,hasCodeMirror:f,isFontInstalled:function(t){var e="Comic Sans MS"===t?"Courier New":"Comic Sans MS",n=document.createElement("canvas").getContext("2d");n.font="200px '"+e+"'";var o=n.measureText("mmmmmmmmmmwwwww").width;return n.font="200px "+s(t)+', "'+e+'"',o!==n.measureText("mmmmmmmmmmwwwww").width},isW3CRangeSupport:!!document.createRange,inputEventName:m,genericFontFamilies:a,validFontName:s};var g=0;var b={eq:function(t){return function(e){return t===e}},eq2:function(t,e){return t===e},peq2:function(t){return function(e,n){return e[t]===n[t]}},ok:function(){return!0},fail:function(){return!1},self:function(t){return t},not:function(t){return function(){return!t.apply(t,arguments)}},and:function(t,e){return function(n){return t(n)&&e(n)}},invoke:function(t,e){return function(){return t[e].apply(t,arguments)}},resetUniqueId:function(){g=0},uniqueId:function(t){var e=++g+"";return t?t+e:e},rect2bnd:function(t){var e=i()(document);return{top:t.top+e.scrollTop(),left:t.left+e.scrollLeft(),width:t.right-t.left,height:t.bottom-t.top}},invertObject:function(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[t[n]]=n);return e},namespaceToCamel:function(t,e){return(e=e||"")+t.split(".").map((function(t){return t.substring(0,1).toUpperCase()+t.substring(1)})).join("")},debounce:function(t,e,n){var o;return function(){var i=this,r=arguments,a=function(){o=null,n||t.apply(i,r)},s=n&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(i,r)}},isValidUrl:function(t){return/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)}};function y(t){return t[0]}function k(t){return t[t.length-1]}function w(t){return t.slice(1)}function C(t,e){if(t&&t.length&&e){if(t.indexOf)return-1!==t.indexOf(e);if(t.contains)return t.contains(e)}return!1}var x={head:y,last:k,initial:function(t){return t.slice(0,t.length-1)},tail:w,prev:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n-1]}return null},next:function(t,e){if(t&&t.length&&e){var n=t.indexOf(e);return-1===n?null:t[n+1]}return null},find:function(t,e){for(var n=0,o=t.length;n<o;n++){var i=t[n];if(e(i))return i}},contains:C,all:function(t,e){for(var n=0,o=t.length;n<o;n++)if(!e(t[n]))return!1;return!0},sum:function(t,e){return e=e||b.self,t.reduce((function(t,n){return t+e(n)}),0)},from:function(t){for(var e=[],n=t.length,o=-1;++o<n;)e[o]=t[o];return e},isEmpty:function(t){return!t||!t.length},clusterBy:function(t,e){return t.length?w(t).reduce((function(t,n){var o=k(t);return e(k(o),n)?o[o.length]=n:t[t.length]=[n],t}),[[y(t)]]):[]},compact:function(t){for(var e=[],n=0,o=t.length;n<o;n++)t[n]&&e.push(t[n]);return e},unique:function(t){for(var e=[],n=0,o=t.length;n<o;n++)C(e,t[n])||e.push(t[n]);return e}},S=String.fromCharCode(160);function T(t){return t&&i()(t).hasClass("note-editable")}function E(t){return t=t.toUpperCase(),function(e){return e&&e.nodeName.toUpperCase()===t}}function I(t){return t&&3===t.nodeType}function $(t){return t&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(t.nodeName.toUpperCase())}function N(t){return!T(t)&&(t&&/^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))}var P=E("PRE"),R=E("LI");var L=E("TABLE"),A=E("DATA");function F(t){return!(M(t)||D(t)||H(t)||N(t)||L(t)||B(t)||A(t))}function D(t){return t&&/^UL|^OL/.test(t.nodeName.toUpperCase())}var H=E("HR");function z(t){return t&&/^TD|^TH/.test(t.nodeName.toUpperCase())}var B=E("BLOCKQUOTE");function M(t){return z(t)||B(t)||T(t)}var O=E("A");var U=E("BODY");var j=v.isMSIE&&v.browserVersion<11?" ":"<br>";function W(t){return I(t)?t.nodeValue.length:t?t.childNodes.length:0}function K(t){var e=W(t);return 0===e||(!I(t)&&1===e&&t.innerHTML===j||!(!x.all(t.childNodes,I)||""!==t.innerHTML))}function q(t){$(t)||W(t)||(t.innerHTML=j)}function V(t,e){for(;t;){if(e(t))return t;if(T(t))break;t=t.parentNode}return null}function _(t,e){e=e||b.fail;var n=[];return V(t,(function(t){return T(t)||n.push(t),e(t)})),n}function G(t,e){e=e||b.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.nextSibling;return n}function Y(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function Z(t,e){return i.a.each(e,(function(e,n){t.appendChild(n)})),t}function X(t){return 0===t.offset}function Q(t){return t.offset===W(t.node)}function J(t){return X(t)||Q(t)}function tt(t,e){for(;t&&t!==e;){if(0!==nt(t))return!1;t=t.parentNode}return!0}function et(t,e){if(!e)return!1;for(;t&&t!==e;){if(nt(t)!==W(t.parentNode)-1)return!1;t=t.parentNode}return!0}function nt(t){for(var e=0;t=t.previousSibling;)e+=1;return e}function ot(t){return!!(t&&t.childNodes&&t.childNodes.length)}function it(t,e){var n,o;if(0===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)}else ot(t.node)?o=W(n=t.node.childNodes[t.offset-1]):(n=t.node,o=e?0:t.offset-1);return{node:n,offset:o}}function rt(t,e){var n,o;if(K(t.node))return null;if(W(t.node)===t.offset){if(T(t.node))return null;n=t.node.parentNode,o=nt(t.node)+1}else if(ot(t.node)){if(o=0,K(n=t.node.childNodes[t.offset]))return null}else if(n=t.node,o=e?W(t.node):t.offset+1,K(n))return null;return{node:n,offset:o}}function at(t,e){return t.node===e.node&&t.offset===e.offset}function st(t,e){var n=e&&e.isSkipPaddingBlankHTML,o=e&&e.isNotSplitEdgePoint,i=e&&e.isDiscardEmptySplits;if(i&&(n=!0),J(t)&&(I(t.node)||o)){if(X(t))return t.node;if(Q(t))return t.node.nextSibling}if(I(t.node))return t.node.splitText(t.offset);var r=t.node.childNodes[t.offset],a=Y(t.node.cloneNode(!1),t.node);return Z(a,G(r)),n||(q(t.node),q(a)),i&&(K(t.node)&&ut(t.node),K(a))?(ut(a),t.node.nextSibling):a}function lt(t,e,n){var o=_(e.node,b.eq(t));return o.length?1===o.length?st(e,n):o.reduce((function(t,o){return t===e.node&&(t=st(e,n)),st({node:o,offset:t?nt(t):W(o)},n)})):null}function ct(t){return document.createElement(t)}function ut(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var n=t.parentNode;if(!e){for(var o=[],i=0,r=t.childNodes.length;i<r;i++)o.push(t.childNodes[i]);for(var a=0,s=o.length;a<s;a++)n.insertBefore(o[a],t)}n.removeChild(t)}}var dt=E("TEXTAREA");function ht(t,e){var n=dt(t[0])?t.val():t.html();return e?n.replace(/[\n\r]/g,""):n}var ft={NBSP_CHAR:S,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:j,emptyPara:"<p>".concat(j,"</p>"),makePredByNodeName:E,isEditable:T,isControlSizing:function(t){return t&&i()(t).hasClass("note-control-sizing")},isText:I,isElement:function(t){return t&&1===t.nodeType},isVoid:$,isPara:N,isPurePara:function(t){return N(t)&&!R(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:F,isBlock:b.not(F),isBodyInline:function(t){return F(t)&&!V(t,N)},isBody:U,isParaInline:function(t){return F(t)&&!!V(t,N)},isPre:P,isList:D,isTable:L,isData:A,isCell:z,isBlockquote:B,isBodyContainer:M,isAnchor:O,isDiv:E("DIV"),isLi:R,isBR:E("BR"),isSpan:E("SPAN"),isB:E("B"),isU:E("U"),isS:E("S"),isI:E("I"),isImg:E("IMG"),isTextarea:dt,deepestChildIsEmpty:function(t){do{if(null===t.firstElementChild||""===t.firstElementChild.innerHTML)break}while(t=t.firstElementChild);return K(t)},isEmpty:K,isEmptyAnchor:b.and(O,K),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||b.ok;var n=[];return t.previousSibling&&e(t.previousSibling)&&n.push(t.previousSibling),n.push(t),t.nextSibling&&e(t.nextSibling)&&n.push(t.nextSibling),n},nodeLength:W,isLeftEdgePoint:X,isRightEdgePoint:Q,isEdgePoint:J,isLeftEdgeOf:tt,isRightEdgeOf:et,isLeftEdgePointOf:function(t,e){return X(t)&&tt(t.node,e)},isRightEdgePointOf:function(t,e){return Q(t)&&et(t.node,e)},prevPoint:it,nextPoint:rt,isSamePoint:at,isVisiblePoint:function(t){if(I(t.node)||!ot(t.node)||K(t.node))return!0;var e=t.node.childNodes[t.offset-1],n=t.node.childNodes[t.offset];return!(e&&!$(e)||n&&!$(n))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=it(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=rt(t)}return null},isCharPoint:function(t){if(!I(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==S},isSpacePoint:function(t){if(!I(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return" "===e||e===S},walkPoint:function(t,e,n,o){for(var i=t;i&&(n(i),!at(i,e));){i=rt(i,o&&t.node!==i.node&&e.node!==i.node)}},ancestor:V,singleChildAncestor:function(t,e){for(t=t.parentNode;t&&1===W(t);){if(e(t))return t;if(T(t))break;t=t.parentNode}return null},listAncestor:_,lastAncestor:function(t,e){var n=_(t);return x.last(n.filter(e))},listNext:G,listPrev:function(t,e){e=e||b.fail;for(var n=[];t&&!e(t);)n.push(t),t=t.previousSibling;return n},listDescendant:function(t,e){var n=[];return e=e||b.ok,function o(i){t!==i&&e(i)&&n.push(i);for(var r=0,a=i.childNodes.length;r<a;r++)o(i.childNodes[r])}(t),n},commonAncestor:function(t,e){for(var n=_(t),o=e;o;o=o.parentNode)if(n.indexOf(o)>-1)return o;return null},wrap:function(t,e){var n=t.parentNode,o=i()("<"+e+">")[0];return n.insertBefore(o,t),o.appendChild(t),o},insertAfter:Y,appendChildNodes:Z,position:nt,hasChildren:ot,makeOffsetPath:function(t,e){return _(e,b.eq(t)).map(nt).reverse()},fromOffsetPath:function(t,e){for(var n=t,o=0,i=e.length;o<i;o++)n=n.childNodes.length<=e[o]?n.childNodes[n.childNodes.length-1]:n.childNodes[e[o]];return n},splitTree:lt,splitPoint:function(t,e){var n,o,i=e?N:M,r=_(t.node,i),a=x.last(r)||t.node;i(a)?(n=r[r.length-2],o=a):o=(n=a).parentNode;var s=n&<(n,t,{isSkipPaddingBlankHTML:e,isNotSplitEdgePoint:e});return s||o!==t.node||(s=t.node.childNodes[t.offset]),{rightNode:s,container:o}},create:ct,createText:function(t){return document.createTextNode(t)},remove:ut,removeWhile:function(t,e){for(;t&&!T(t)&&e(t);){var n=t.parentNode;ut(t),t=n}},replace:function(t,e){if(t.nodeName.toUpperCase()===e.toUpperCase())return t;var n=ct(e);return t.style.cssText&&(n.style.cssText=t.style.cssText),Z(n,x.from(t.childNodes)),Y(n,t),ut(t),n},html:function(t,e){var n=ht(t);if(e){n=(n=n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g,(function(t,e,n){n=n.toUpperCase();var o=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(n)&&!!e,i=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(n);return t+(o||i?"\n":"")}))).trim()}return n},value:ht,posFromPlaceholder:function(t){var e=i()(t),n=e.offset(),o=e.outerHeight(!0);return{left:n.left,top:n.top+o}},attachEvents:function(t,e){Object.keys(e).forEach((function(n){t.on(n,e[n])}))},detachEvents:function(t,e){Object.keys(e).forEach((function(n){t.off(n,e[n])}))},isCustomStyleTag:function(t){return t&&!I(t)&&x.contains(t.classList,"note-styletag")}};function pt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var mt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$note=e,this.memos={},this.modules={},this.layoutInfo={},this.options=i.a.extend(!0,{},n),i.a.summernote.ui=i.a.summernote.ui_template(this.options),this.ui=i.a.summernote.ui,this.initialize()}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){return this.layoutInfo=this.ui.createLayout(this.$note),this._initialize(),this.$note.hide(),this}},{key:"destroy",value:function(){this._destroy(),this.$note.removeData("summernote"),this.ui.removeLayout(this.$note,this.layoutInfo)}},{key:"reset",value:function(){var t=this.isDisabled();this.code(ft.emptyPara),this._destroy(),this._initialize(),t&&this.disable()}},{key:"_initialize",value:function(){var t=this;this.options.id=b.uniqueId(i.a.now()),this.options.container=this.options.container||this.layoutInfo.editor;var e=i.a.extend({},this.options.buttons);Object.keys(e).forEach((function(n){t.memo("button."+n,e[n])}));var n=i.a.extend({},this.options.modules,i.a.summernote.plugins||{});Object.keys(n).forEach((function(e){t.module(e,n[e],!0)})),Object.keys(this.modules).forEach((function(e){t.initializeModule(e)}))}},{key:"_destroy",value:function(){var t=this;Object.keys(this.modules).reverse().forEach((function(e){t.removeModule(e)})),Object.keys(this.memos).forEach((function(e){t.removeMemo(e)})),this.triggerEvent("destroy",this)}},{key:"code",value:function(t){var e=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),e?this.layoutInfo.codable.val():this.layoutInfo.editable.html();e?this.layoutInfo.codable.val(t):this.layoutInfo.editable.html(t),this.$note.val(t),this.triggerEvent("change",t,this.layoutInfo.editable)}},{key:"isDisabled",value:function(){return"false"===this.layoutInfo.editable.attr("contenteditable")}},{key:"enable",value:function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1),this.options.editing=!0}},{key:"disable",value:function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.options.editing=!1,this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)}},{key:"triggerEvent",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=this.options.callbacks[b.namespaceToCamel(t,"on")];n&&n.apply(this.$note[0],e),this.$note.trigger("summernote."+t,e)}},{key:"initializeModule",value:function(t){var e=this.modules[t];e.shouldInitialize=e.shouldInitialize||b.ok,e.shouldInitialize()&&(e.initialize&&e.initialize(),e.events&&ft.attachEvents(this.$note,e.events))}},{key:"module",value:function(t,e,n){if(1===arguments.length)return this.modules[t];this.modules[t]=new e(this),n||this.initializeModule(t)}},{key:"removeModule",value:function(t){var e=this.modules[t];e.shouldInitialize()&&(e.events&&ft.detachEvents(this.$note,e.events),e.destroy&&e.destroy()),delete this.modules[t]}},{key:"memo",value:function(t,e){if(1===arguments.length)return this.memos[t];this.memos[t]=e}},{key:"removeMemo",value:function(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]}},{key:"createInvokeHandlerAndUpdateState",value:function(t,e){var n=this;return function(o){n.createInvokeHandler(t,e)(o),n.invoke("buttons.updateCurrentStyle")}}},{key:"createInvokeHandler",value:function(t,e){var n=this;return function(o){o.preventDefault();var r=i()(o.target);n.invoke(t,e||r.closest("[data-value]").data("value"),r)}}},{key:"invoke",value:function(){var t=x.head(arguments),e=x.tail(x.from(arguments)),n=t.split("."),o=n.length>1,i=o&&x.head(n),r=o?x.last(n):x.head(n),a=this.modules[i||"editor"];return!i&&this[r]?this[r].apply(this,e):a&&a[r]&&a.shouldInitialize()?a[r].apply(a,e):void 0}}])&&pt(e.prototype,n),o&&pt(e,o),t}();function vt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function gt(t,e){var n,o,i=t.parentElement(),r=document.body.createTextRange(),a=x.from(i.childNodes);for(n=0;n<a.length;n++)if(!ft.isText(a[n])){if(r.moveToElementText(a[n]),r.compareEndPoints("StartToStart",t)>=0)break;o=a[n]}if(0!==n&&ft.isText(a[n-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(o||i),s.collapse(!o),l=o?o.nextSibling:i.firstChild;var c=t.duplicate();c.setEndPoint("StartToStart",s);for(var u=c.text.replace(/[\r\n]/g,"").length;u>l.nodeValue.length&&l.nextSibling;)u-=l.nodeValue.length,l=l.nextSibling;l.nodeValue;e&&l.nextSibling&&ft.isText(l.nextSibling)&&u===l.nodeValue.length&&(u-=l.nodeValue.length,l=l.nextSibling),i=l,n=u}return{cont:i,offset:n}}function bt(t){var e=document.body.createTextRange(),n=function t(e,n){var o,i;if(ft.isText(e)){var r=ft.listPrev(e,b.not(ft.isText)),a=x.last(r).previousSibling;o=a||e.parentNode,n+=x.sum(x.tail(r),ft.nodeLength),i=!a}else{if(o=e.childNodes[n]||e,ft.isText(o))return t(o,0);n=0,i=!1}return{node:o,collapseToStart:i,offset:n}}(t.node,t.offset);return e.moveToElementText(n.node),e.collapse(n.collapseToStart),e.moveStart("character",n.offset),e}i.a.fn.extend({summernote:function(){var t=i.a.type(x.head(arguments)),e="string"===t,n="object"===t,o=i.a.extend({},i.a.summernote.options,n?x.head(arguments):{});o.langInfo=i.a.extend(!0,{},i.a.summernote.lang["en-US"],i.a.summernote.lang[o.lang]),o.icons=i.a.extend(!0,{},i.a.summernote.options.icons,o.icons),o.tooltip="auto"===o.tooltip?!v.isSupportTouch:o.tooltip,this.each((function(t,e){var n=i()(e);if(!n.data("summernote")){var r=new mt(n,o);n.data("summernote",r),n.data("summernote").triggerEvent("init",r.layoutInfo)}}));var r=this.first();if(r.length){var a=r.data("summernote");if(e)return a.invoke.apply(a,x.from(arguments));o.focus&&a.invoke("editor.focus")}return this}});var yt=function(){function t(e,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.sc=e,this.so=n,this.ec=o,this.eo=i,this.isOnEditable=this.makeIsOn(ft.isEditable),this.isOnList=this.makeIsOn(ft.isList),this.isOnAnchor=this.makeIsOn(ft.isAnchor),this.isOnCell=this.makeIsOn(ft.isCell),this.isOnData=this.makeIsOn(ft.isData)}var e,n,o;return e=t,(n=[{key:"nativeRange",value:function(){if(v.isW3CRangeSupport){var t=document.createRange();return t.setStart(this.sc,this.sc.data&&this.so>this.sc.data.length?0:this.so),t.setEnd(this.ec,this.sc.data?Math.min(this.eo,this.sc.data.length):this.eo),t}var e=bt({node:this.sc,offset:this.so});return e.setEndPoint("EndToEnd",bt({node:this.ec,offset:this.eo})),e}},{key:"getPoints",value:function(){return{sc:this.sc,so:this.so,ec:this.ec,eo:this.eo}}},{key:"getStartPoint",value:function(){return{node:this.sc,offset:this.so}}},{key:"getEndPoint",value:function(){return{node:this.ec,offset:this.eo}}},{key:"select",value:function(){var t=this.nativeRange();if(v.isW3CRangeSupport){var e=document.getSelection();e.rangeCount>0&&e.removeAllRanges(),e.addRange(t)}else t.select();return this}},{key:"scrollIntoView",value:function(t){var e=i()(t).height();return t.scrollTop+e<this.sc.offsetTop&&(t.scrollTop+=Math.abs(t.scrollTop+e-this.sc.offsetTop)),this}},{key:"normalize",value:function(){var e=function(t,e){if(!t)return t;if(ft.isVisiblePoint(t)&&(!ft.isEdgePoint(t)||ft.isRightEdgePoint(t)&&!e||ft.isLeftEdgePoint(t)&&e||ft.isRightEdgePoint(t)&&e&&ft.isVoid(t.node.nextSibling)||ft.isLeftEdgePoint(t)&&!e&&ft.isVoid(t.node.previousSibling)||ft.isBlock(t.node)&&ft.isEmpty(t.node)))return t;var n=ft.ancestor(t.node,ft.isBlock),o=!1;if(!o){var i=ft.prevPoint(t)||{node:null};o=(ft.isLeftEdgePointOf(t,n)||ft.isVoid(i.node))&&!e}var r=!1;if(!r){var a=ft.nextPoint(t)||{node:null};r=(ft.isRightEdgePointOf(t,n)||ft.isVoid(a.node))&&e}if(o||r){if(ft.isVisiblePoint(t))return t;e=!e}return(e?ft.nextPointUntil(ft.nextPoint(t),ft.isVisiblePoint):ft.prevPointUntil(ft.prevPoint(t),ft.isVisiblePoint))||t},n=e(this.getEndPoint(),!1),o=this.isCollapsed()?n:e(this.getStartPoint(),!0);return new t(o.node,o.offset,n.node,n.offset)}},{key:"nodes",value:function(t,e){t=t||b.ok;var n=e&&e.includeAncestor,o=e&&e.fullyContains,i=this.getStartPoint(),r=this.getEndPoint(),a=[],s=[];return ft.walkPoint(i,r,(function(e){var i;ft.isEditable(e.node)||(o?(ft.isLeftEdgePoint(e)&&s.push(e.node),ft.isRightEdgePoint(e)&&x.contains(s,e.node)&&(i=e.node)):i=n?ft.ancestor(e.node,t):e.node,i&&t(i)&&a.push(i))}),!0),x.unique(a)}},{key:"commonAncestor",value:function(){return ft.commonAncestor(this.sc,this.ec)}},{key:"expand",value:function(e){var n=ft.ancestor(this.sc,e),o=ft.ancestor(this.ec,e);if(!n&&!o)return new t(this.sc,this.so,this.ec,this.eo);var i=this.getPoints();return n&&(i.sc=n,i.so=0),o&&(i.ec=o,i.eo=ft.nodeLength(o)),new t(i.sc,i.so,i.ec,i.eo)}},{key:"collapse",value:function(e){return e?new t(this.sc,this.so,this.sc,this.so):new t(this.ec,this.eo,this.ec,this.eo)}},{key:"splitText",value:function(){var e=this.sc===this.ec,n=this.getPoints();return ft.isText(this.ec)&&!ft.isEdgePoint(this.getEndPoint())&&this.ec.splitText(this.eo),ft.isText(this.sc)&&!ft.isEdgePoint(this.getStartPoint())&&(n.sc=this.sc.splitText(this.so),n.so=0,e&&(n.ec=n.sc,n.eo=this.eo-this.so)),new t(n.sc,n.so,n.ec,n.eo)}},{key:"deleteContents",value:function(){if(this.isCollapsed())return this;var e=this.splitText(),n=e.nodes(null,{fullyContains:!0}),o=ft.prevPointUntil(e.getStartPoint(),(function(t){return!x.contains(n,t.node)})),r=[];return i.a.each(n,(function(t,e){var n=e.parentNode;o.node!==n&&1===ft.nodeLength(n)&&r.push(n),ft.remove(e,!1)})),i.a.each(r,(function(t,e){ft.remove(e,!1)})),new t(o.node,o.offset,o.node,o.offset).normalize()}},{key:"makeIsOn",value:function(t){return function(){var e=ft.ancestor(this.sc,t);return!!e&&e===ft.ancestor(this.ec,t)}}},{key:"isLeftEdgeOf",value:function(t){if(!ft.isLeftEdgePoint(this.getStartPoint()))return!1;var e=ft.ancestor(this.sc,t);return e&&ft.isLeftEdgeOf(this.sc,e)}},{key:"isCollapsed",value:function(){return this.sc===this.ec&&this.so===this.eo}},{key:"wrapBodyInlineWithPara",value:function(){if(ft.isBodyContainer(this.sc)&&ft.isEmpty(this.sc))return this.sc.innerHTML=ft.emptyPara,new t(this.sc.firstChild,0,this.sc.firstChild,0);var e,n=this.normalize();if(ft.isParaInline(this.sc)||ft.isPara(this.sc))return n;if(ft.isInline(n.sc)){var o=ft.listAncestor(n.sc,b.not(ft.isInline));e=x.last(o),ft.isInline(e)||(e=o[o.length-2]||n.sc.childNodes[n.so])}else e=n.sc.childNodes[n.so>0?n.so-1:0];if(e){var i=ft.listPrev(e,ft.isParaInline).reverse();if((i=i.concat(ft.listNext(e.nextSibling,ft.isParaInline))).length){var r=ft.wrap(x.head(i),"p");ft.appendChildNodes(r,x.tail(i))}}return this.normalize()}},{key:"insertNode",value:function(t){var e=this;(ft.isText(t)||ft.isInline(t))&&(e=this.wrapBodyInlineWithPara().deleteContents());var n=ft.splitPoint(e.getStartPoint(),ft.isInline(t));return n.rightNode?n.rightNode.parentNode.insertBefore(t,n.rightNode):n.container.appendChild(t),t}},{key:"pasteHTML",value:function(t){t=i.a.trim(t);var e=i()("<div></div>").html(t)[0],n=x.from(e.childNodes),o=this;return o.so>=0&&(n=n.reverse()),n=n.map((function(t){return o.insertNode(t)})),o.so>0&&(n=n.reverse()),n}},{key:"toString",value:function(){var t=this.nativeRange();return v.isW3CRangeSupport?t.toString():t.text}},{key:"getWordRange",value:function(e){var n=this.getEndPoint();if(!ft.isCharPoint(n))return this;var o=ft.prevPointUntil(n,(function(t){return!ft.isCharPoint(t)}));return e&&(n=ft.nextPointUntil(n,(function(t){return!ft.isCharPoint(t)}))),new t(o.node,o.offset,n.node,n.offset)}},{key:"getWordsRange",value:function(e){var n=this.getEndPoint(),o=function(t){return!ft.isCharPoint(t)&&!ft.isSpacePoint(t)};if(o(n))return this;var i=ft.prevPointUntil(n,o);return e&&(n=ft.nextPointUntil(n,o)),new t(i.node,i.offset,n.node,n.offset)}},{key:"getWordsMatchRange",value:function(e){var n=this.getEndPoint(),o=ft.prevPointUntil(n,(function(o){if(!ft.isCharPoint(o)&&!ft.isSpacePoint(o))return!0;var i=new t(o.node,o.offset,n.node,n.offset),r=e.exec(i.toString());return r&&0===r.index})),i=new t(o.node,o.offset,n.node,n.offset),r=i.toString(),a=e.exec(r);return a&&a[0].length===r.length?i:null}},{key:"bookmark",value:function(t){return{s:{path:ft.makeOffsetPath(t,this.sc),offset:this.so},e:{path:ft.makeOffsetPath(t,this.ec),offset:this.eo}}}},{key:"paraBookmark",value:function(t){return{s:{path:x.tail(ft.makeOffsetPath(x.head(t),this.sc)),offset:this.so},e:{path:x.tail(ft.makeOffsetPath(x.last(t),this.ec)),offset:this.eo}}}},{key:"getClientRects",value:function(){return this.nativeRange().getClientRects()}}])&&vt(e.prototype,n),o&&vt(e,o),t}(),kt={create:function(t,e,n,o){if(4===arguments.length)return new yt(t,e,n,o);if(2===arguments.length)return new yt(t,e,n=t,o=e);var i=this.createFromSelection();if(!i&&1===arguments.length){var r=arguments[0];return ft.isEditable(r)&&(r=r.lastChild),this.createFromBodyElement(r,ft.emptyPara===arguments[0].innerHTML)}return i},createFromBodyElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.createFromNode(t);return n.collapse(e)},createFromSelection:function(){var t,e,n,o;if(v.isW3CRangeSupport){var i=document.getSelection();if(!i||0===i.rangeCount)return null;if(ft.isBody(i.anchorNode))return null;var r=i.getRangeAt(0);t=r.startContainer,e=r.startOffset,n=r.endContainer,o=r.endOffset}else{var a=document.selection.createRange(),s=a.duplicate();s.collapse(!1);var l=a;l.collapse(!0);var c=gt(l,!0),u=gt(s,!1);ft.isText(c.node)&&ft.isLeftEdgePoint(c)&&ft.isTextNode(u.node)&&ft.isRightEdgePoint(u)&&u.node.nextSibling===c.node&&(c=u),t=c.cont,e=c.offset,n=u.cont,o=u.offset}return new yt(t,e,n,o)},createFromNode:function(t){var e=t,n=0,o=t,i=ft.nodeLength(o);return ft.isVoid(e)&&(n=ft.listPrev(e).length-1,e=e.parentNode),ft.isBR(o)?(i=ft.listPrev(o).length-1,o=o.parentNode):ft.isVoid(o)&&(i=ft.listPrev(o).length,o=o.parentNode),this.create(e,n,o,i)},createFromNodeBefore:function(t){return this.createFromNode(t).collapse(!0)},createFromNodeAfter:function(t){return this.createFromNode(t).collapse()},createFromBookmark:function(t,e){var n=ft.fromOffsetPath(t,e.s.path),o=e.s.offset,i=ft.fromOffsetPath(t,e.e.path),r=e.e.offset;return new yt(n,o,i,r)},createFromParaBookmark:function(t,e){var n=t.s.offset,o=t.e.offset,i=ft.fromOffsetPath(x.head(e),t.s.path),r=ft.fromOffsetPath(x.last(e),t.e.path);return new yt(i,n,r,o)}},wt={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221,HOME:36,END:35,PAGEUP:33,PAGEDOWN:34},Ct={isEdit:function(t){return x.contains([wt.BACKSPACE,wt.TAB,wt.ENTER,wt.SPACE,wt.DELETE],t)},isMove:function(t){return x.contains([wt.LEFT,wt.UP,wt.RIGHT,wt.DOWN],t)},isNavigation:function(t){return x.contains([wt.HOME,wt.END,wt.PAGEUP,wt.PAGEDOWN],t)},nameFromCode:b.invertObject(wt),code:wt};function xt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var St=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stack=[],this.stackOffset=-1,this.context=e,this.$editable=e.layoutInfo.editable,this.editable=this.$editable[0]}var e,n,o;return e=t,(n=[{key:"makeSnapshot",value:function(){var t=kt.create(this.editable);return{contents:this.$editable.html(),bookmark:t&&t.isOnEditable()?t.bookmark(this.editable):{s:{path:[],offset:0},e:{path:[],offset:0}}}}},{key:"applySnapshot",value:function(t){null!==t.contents&&this.$editable.html(t.contents),null!==t.bookmark&&kt.createFromBookmark(this.editable,t.bookmark).select()}},{key:"rewind",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset=0,this.applySnapshot(this.stack[this.stackOffset])}},{key:"commit",value:function(){this.stack=[],this.stackOffset=-1,this.recordUndo()}},{key:"reset",value:function(){this.stack=[],this.stackOffset=-1,this.$editable.html(""),this.recordUndo()}},{key:"undo",value:function(){this.$editable.html()!==this.stack[this.stackOffset].contents&&this.recordUndo(),this.stackOffset>0&&(this.stackOffset--,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"redo",value:function(){this.stack.length-1>this.stackOffset&&(this.stackOffset++,this.applySnapshot(this.stack[this.stackOffset]))}},{key:"recordUndo",value:function(){this.stackOffset++,this.stack.length>this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(this.makeSnapshot()),this.stack.length>this.context.options.historyLimit&&(this.stack.shift(),this.stackOffset-=1)}}])&&xt(e.prototype,n),o&&xt(e,o),t}();function Tt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Et=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"jQueryCSS",value:function(t,e){if(v.jqueryVersion<1.9){var n={};return i.a.each(e,(function(e,o){n[o]=t.css(o)})),n}return t.css(e)}},{key:"fromNode",value:function(t){var e=this.jQueryCSS(t,["font-family","font-size","text-align","list-style-type","line-height"])||{},n=t[0].style.fontSize||e["font-size"];return e["font-size"]=parseInt(n,10),e["font-size-unit"]=n.match(/[a-z%]+$/),e}},{key:"stylePara",value:function(t,e){i.a.each(t.nodes(ft.isPara,{includeAncestor:!0}),(function(t,n){i()(n).css(e)}))}},{key:"styleNodes",value:function(t,e){t=t.splitText();var n=e&&e.nodeName||"SPAN",o=!(!e||!e.expandClosestSibling),r=!(!e||!e.onlyPartialContains);if(t.isCollapsed())return[t.insertNode(ft.create(n))];var a=ft.makePredByNodeName(n),s=t.nodes(ft.isText,{fullyContains:!0}).map((function(t){return ft.singleChildAncestor(t,a)||ft.wrap(t,n)}));if(o){if(r){var l=t.nodes();a=b.and(a,(function(t){return x.contains(l,t)}))}return s.map((function(t){var e=ft.withClosestSiblings(t,a),n=x.head(e),o=x.tail(e);return i.a.each(o,(function(t,e){ft.appendChildNodes(n,e.childNodes),ft.remove(e)})),x.head(e)}))}return s}},{key:"current",value:function(t){var e=i()(ft.isElement(t.sc)?t.sc:t.sc.parentNode),n=this.fromNode(e);try{n=i.a.extend(n,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||n["font-family"]})}catch(t){}if(t.isOnList()){var o=["circle","disc","disc-leading-zero","square"].indexOf(n["list-style-type"])>-1;n["list-style"]=o?"unordered":"ordered"}else n["list-style"]="none";var r=ft.ancestor(t.sc,ft.isPara);if(r&&r.style["line-height"])n["line-height"]=r.style.lineHeight;else{var a=parseInt(n["line-height"],10)/parseInt(n["font-size"],10);n["line-height"]=a.toFixed(1)}return n.anchor=t.isOnAnchor()&&ft.ancestor(t.sc,ft.isAnchor),n.ancestors=ft.listAncestor(t.sc,ft.isEditable),n.range=t,n}}])&&Tt(e.prototype,n),o&&Tt(e,o),t}();function It(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var $t=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"insertOrderedList",value:function(t){this.toggleList("OL",t)}},{key:"insertUnorderedList",value:function(t){this.toggleList("UL",t)}},{key:"indent",value:function(t){var e=this,n=kt.create(t).wrapBodyInlineWithPara(),o=n.nodes(ft.isPara,{includeAncestor:!0}),r=x.clusterBy(o,b.peq2("parentNode"));i.a.each(r,(function(t,n){var o=x.head(n);if(ft.isLi(o)){var r=e.findList(o.previousSibling);r?n.map((function(t){return r.appendChild(t)})):(e.wrapList(n,o.parentNode.nodeName),n.map((function(t){return t.parentNode})).map((function(t){return e.appendToPrevious(t)})))}else i.a.each(n,(function(t,e){i()(e).css("marginLeft",(function(t,e){return(parseInt(e,10)||0)+25}))}))})),n.select()}},{key:"outdent",value:function(t){var e=this,n=kt.create(t).wrapBodyInlineWithPara(),o=n.nodes(ft.isPara,{includeAncestor:!0}),r=x.clusterBy(o,b.peq2("parentNode"));i.a.each(r,(function(t,n){var o=x.head(n);ft.isLi(o)?e.releaseList([n]):i.a.each(n,(function(t,e){i()(e).css("marginLeft",(function(t,e){return(e=parseInt(e,10)||0)>25?e-25:""}))}))})),n.select()}},{key:"toggleList",value:function(t,e){var n=this,o=kt.create(e).wrapBodyInlineWithPara(),r=o.nodes(ft.isPara,{includeAncestor:!0}),a=o.paraBookmark(r),s=x.clusterBy(r,b.peq2("parentNode"));if(x.find(r,ft.isPurePara)){var l=[];i.a.each(s,(function(e,o){l=l.concat(n.wrapList(o,t))})),r=l}else{var c=o.nodes(ft.isList,{includeAncestor:!0}).filter((function(e){return!i.a.nodeName(e,t)}));c.length?i.a.each(c,(function(e,n){ft.replace(n,t)})):r=this.releaseList(s,!0)}kt.createFromParaBookmark(a,r).select()}},{key:"wrapList",value:function(t,e){var n=x.head(t),o=x.last(t),i=ft.isList(n.previousSibling)&&n.previousSibling,r=ft.isList(o.nextSibling)&&o.nextSibling,a=i||ft.insertAfter(ft.create(e||"UL"),o);return t=t.map((function(t){return ft.isPurePara(t)?ft.replace(t,"LI"):t})),ft.appendChildNodes(a,t),r&&(ft.appendChildNodes(a,x.from(r.childNodes)),ft.remove(r)),t}},{key:"releaseList",value:function(t,e){var n=this,o=[];return i.a.each(t,(function(t,r){var a=x.head(r),s=x.last(r),l=e?ft.lastAncestor(a,ft.isList):a.parentNode,c=l.parentNode;if("LI"===l.parentNode.nodeName)r.map((function(t){var e=n.findNextSiblings(t);c.nextSibling?c.parentNode.insertBefore(t,c.nextSibling):c.parentNode.appendChild(t),e.length&&(n.wrapList(e,l.nodeName),t.appendChild(e[0].parentNode))})),0===l.children.length&&c.removeChild(l),0===c.childNodes.length&&c.parentNode.removeChild(c);else{var u=l.childNodes.length>1?ft.splitTree(l,{node:s.parentNode,offset:ft.position(s)+1},{isSkipPaddingBlankHTML:!0}):null,d=ft.splitTree(l,{node:a.parentNode,offset:ft.position(a)},{isSkipPaddingBlankHTML:!0});r=e?ft.listDescendant(d,ft.isLi):x.from(d.childNodes).filter(ft.isLi),!e&&ft.isList(l.parentNode)||(r=r.map((function(t){return ft.replace(t,"P")}))),i.a.each(x.from(r).reverse(),(function(t,e){ft.insertAfter(e,l)}));var h=x.compact([l,d,u]);i.a.each(h,(function(t,e){var n=[e].concat(ft.listDescendant(e,ft.isList));i.a.each(n.reverse(),(function(t,e){ft.nodeLength(e)||ft.remove(e,!0)}))}))}o=o.concat(r)})),o}},{key:"appendToPrevious",value:function(t){return t.previousSibling?ft.appendChildNodes(t.previousSibling,[t]):this.wrapList([t],"LI")}},{key:"findList",value:function(t){return t?x.find(t.children,(function(t){return["OL","UL"].indexOf(t.nodeName)>-1})):null}},{key:"findNextSiblings",value:function(t){for(var e=[];t.nextSibling;)e.push(t.nextSibling),t=t.nextSibling;return e}}])&&It(e.prototype,n),o&&It(e,o),t}();function Nt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Pt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bullet=new $t,this.options=e.options}var e,n,o;return e=t,(n=[{key:"insertTab",value:function(t,e){var n=ft.createText(new Array(e+1).join(ft.NBSP_CHAR));(t=t.deleteContents()).insertNode(n,!0),(t=kt.create(n,e)).select()}},{key:"insertParagraph",value:function(t,e){e=(e=(e=e||kt.create(t)).deleteContents()).wrapBodyInlineWithPara();var n,o=ft.ancestor(e.sc,ft.isPara);if(o){if(ft.isLi(o)&&(ft.isEmpty(o)||ft.deepestChildIsEmpty(o)))return void this.bullet.toggleList(o.parentNode.nodeName);var r=null;if(1===this.options.blockquoteBreakingLevel?r=ft.ancestor(o,ft.isBlockquote):2===this.options.blockquoteBreakingLevel&&(r=ft.lastAncestor(o,ft.isBlockquote)),r){n=i()(ft.emptyPara)[0],ft.isRightEdgePoint(e.getStartPoint())&&ft.isBR(e.sc.nextSibling)&&i()(e.sc.nextSibling).remove();var a=ft.splitTree(r,e.getStartPoint(),{isDiscardEmptySplits:!0});a?a.parentNode.insertBefore(n,a):ft.insertAfter(n,r)}else{n=ft.splitTree(o,e.getStartPoint());var s=ft.listDescendant(o,ft.isEmptyAnchor);s=s.concat(ft.listDescendant(n,ft.isEmptyAnchor)),i.a.each(s,(function(t,e){ft.remove(e)})),(ft.isHeading(n)||ft.isPre(n)||ft.isCustomStyleTag(n))&&ft.isEmpty(n)&&(n=ft.replace(n,"p"))}}else{var l=e.sc.childNodes[e.so];n=i()(ft.emptyPara)[0],l?e.sc.insertBefore(n,l):e.sc.appendChild(n)}kt.create(n,0).normalize().select().scrollIntoView(t)}}])&&Nt(e.prototype,n),o&&Nt(e,o),t}();function Rt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Lt=function t(e,n,o,i){var r={colPos:0,rowPos:0},a=[],s=[];function l(t,e,n,o,i,r,s){var l={baseRow:n,baseCell:o,isRowSpan:i,isColSpan:r,isVirtual:s};a[t]||(a[t]=[]),a[t][e]=l}function c(t,e,n,o){return{baseCell:t.baseCell,action:e,virtualTable:{rowIndex:n,cellIndex:o}}}function u(t,e){if(!a[t])return e;if(!a[t][e])return e;for(var n=e;a[t][n];)if(n++,!a[t][n])return n}function d(t,e){var n=u(t.rowIndex,e.cellIndex),o=e.colSpan>1,i=e.rowSpan>1,a=t.rowIndex===r.rowPos&&e.cellIndex===r.colPos;l(t.rowIndex,n,t,e,i,o,!1);var s=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(s>1)for(var c=1;c<s;c++){var d=t.rowIndex+c;h(d,n,e,a),l(d,n,t,e,!0,o,!0)}var f=e.attributes.colSpan?parseInt(e.attributes.colSpan.value,10):0;if(f>1)for(var p=1;p<f;p++){var m=u(t.rowIndex,n+p);h(t.rowIndex,m,e,a),l(t.rowIndex,m,t,e,i,!0,!0)}}function h(t,e,n,o){t===r.rowPos&&r.colPos>=n.cellIndex&&n.cellIndex<=e&&!o&&r.colPos++}function f(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SubtractSpanCount;break;case t.where.Row:if(!e.isVirtual&&e.isRowSpan)return t.resultAction.AddCell;if(e.isRowSpan)return t.resultAction.SubtractSpanCount}return t.resultAction.RemoveCell}function p(e){switch(n){case t.where.Column:if(e.isColSpan)return t.resultAction.SumSpanCount;if(e.isRowSpan&&e.isVirtual)return t.resultAction.Ignore;break;case t.where.Row:if(e.isRowSpan)return t.resultAction.SumSpanCount;if(e.isColSpan&&e.isVirtual)return t.resultAction.Ignore}return t.resultAction.AddCell}this.getActionList=function(){for(var e=n===t.where.Row?r.rowPos:-1,i=n===t.where.Column?r.colPos:-1,l=0,u=!0;u;){var d=e>=0?e:l,h=i>=0?i:l,m=a[d];if(!m)return u=!1,s;var v=m[h];if(!v)return u=!1,s;var g=t.resultAction.Ignore;switch(o){case t.requestAction.Add:g=p(v);break;case t.requestAction.Delete:g=f(v)}s.push(c(v,g,d,h)),l++}return s},e&&e.tagName&&("td"===e.tagName.toLowerCase()||"th"===e.tagName.toLowerCase())&&(r.colPos=e.cellIndex,e.parentElement&&e.parentElement.tagName&&"tr"===e.parentElement.tagName.toLowerCase()&&(r.rowPos=e.parentElement.rowIndex)),function(){for(var t=i.rows,e=0;e<t.length;e++)for(var n=t[e].cells,o=0;o<n.length;o++)d(t[e],n[o])}()};Lt.where={Row:0,Column:1},Lt.requestAction={Add:0,Delete:1},Lt.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var At=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,o;return e=t,(n=[{key:"tab",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=ft.ancestor(n,ft.isTable),i=ft.listDescendant(o,ft.isCell),r=x[e?"prev":"next"](i,n);r&&kt.create(r,0).select()}},{key:"addRow",value:function(t,e){for(var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=i()(n).closest("tr"),r=this.recoverAttributes(o),a=i()("<tr"+r+"></tr>"),s=new Lt(n,Lt.where.Row,Lt.requestAction.Add,i()(o).closest("table")[0]).getActionList(),l=0;l<s.length;l++){var c=s[l],u=this.recoverAttributes(c.baseCell);switch(c.action){case Lt.resultAction.AddCell:a.append("<td"+u+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("top"===e&&(c.baseCell.parent?c.baseCell.closest("tr").rowIndex:0)<=o[0].rowIndex){var d=i()("<div></div>").append(i()("<td"+u+">"+ft.blank+"</td>").removeAttr("rowspan")).html();a.append(d);break}var h=parseInt(c.baseCell.rowSpan,10);h++,c.baseCell.setAttribute("rowSpan",h)}}if("top"===e)o.before(a);else{if(n.rowSpan>1){var f=o[0].rowIndex+(n.rowSpan-2);return void i()(i()(o).parent().find("tr")[f]).after(i()(a))}o.after(a)}}},{key:"addCol",value:function(t,e){var n=ft.ancestor(t.commonAncestor(),ft.isCell),o=i()(n).closest("tr");i()(o).siblings().push(o);for(var r=new Lt(n,Lt.where.Column,Lt.requestAction.Add,i()(o).closest("table")[0]).getActionList(),a=0;a<r.length;a++){var s=r[a],l=this.recoverAttributes(s.baseCell);switch(s.action){case Lt.resultAction.AddCell:"right"===e?i()(s.baseCell).after("<td"+l+">"+ft.blank+"</td>"):i()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>");break;case Lt.resultAction.SumSpanCount:if("right"===e){var c=parseInt(s.baseCell.colSpan,10);c++,s.baseCell.setAttribute("colSpan",c)}else i()(s.baseCell).before("<td"+l+">"+ft.blank+"</td>")}}}},{key:"recoverAttributes",value:function(t){var e="";if(!t)return e;for(var n=t.attributes||[],o=0;o<n.length;o++)"id"!==n[o].name.toLowerCase()&&n[o].specified&&(e+=" "+n[o].name+"='"+n[o].value+"'");return e}},{key:"deleteRow",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=i()(e).closest("tr"),o=n.children("td, th").index(i()(e)),r=n[0].rowIndex,a=new Lt(e,Lt.where.Row,Lt.requestAction.Delete,i()(n).closest("table")[0]).getActionList(),s=0;s<a.length;s++)if(a[s]){var l=a[s].baseCell,c=a[s].virtualTable,u=l.rowSpan&&l.rowSpan>1,d=u?parseInt(l.rowSpan,10):0;switch(a[s].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.AddCell:var h=n.next("tr")[0];if(!h)continue;var f=n[0].cells[o];u&&(d>2?(d--,h.insertBefore(f,h.cells[o]),h.cells[o].setAttribute("rowSpan",d),h.cells[o].innerHTML=""):2===d&&(h.insertBefore(f,h.cells[o]),h.cells[o].removeAttribute("rowSpan"),h.cells[o].innerHTML=""));continue;case Lt.resultAction.SubtractSpanCount:u&&(d>2?(d--,l.setAttribute("rowSpan",d),c.rowIndex!==r&&l.cellIndex===o&&(l.innerHTML="")):2===d&&(l.removeAttribute("rowSpan"),c.rowIndex!==r&&l.cellIndex===o&&(l.innerHTML="")));continue;case Lt.resultAction.RemoveCell:continue}}n.remove()}},{key:"deleteCol",value:function(t){for(var e=ft.ancestor(t.commonAncestor(),ft.isCell),n=i()(e).closest("tr"),o=n.children("td, th").index(i()(e)),r=new Lt(e,Lt.where.Column,Lt.requestAction.Delete,i()(n).closest("table")[0]).getActionList(),a=0;a<r.length;a++)if(r[a])switch(r[a].action){case Lt.resultAction.Ignore:continue;case Lt.resultAction.SubtractSpanCount:var s=r[a].baseCell;if(s.colSpan&&s.colSpan>1){var l=s.colSpan?parseInt(s.colSpan,10):0;l>2?(l--,s.setAttribute("colSpan",l),s.cellIndex===o&&(s.innerHTML="")):2===l&&(s.removeAttribute("colSpan"),s.cellIndex===o&&(s.innerHTML=""))}continue;case Lt.resultAction.RemoveCell:ft.remove(r[a].baseCell,!0);continue}}},{key:"createTable",value:function(t,e,n){for(var o,r=[],a=0;a<t;a++)r.push("<td>"+ft.blank+"</td>");o=r.join("");for(var s,l=[],c=0;c<e;c++)l.push("<tr>"+o+"</tr>");s=l.join("");var u=i()("<table>"+s+"</table>");return n&&n.tableClassName&&u.addClass(n.tableClassName),u[0]}},{key:"deleteTable",value:function(t){var e=ft.ancestor(t.commonAncestor(),ft.isCell);i()(e).closest("table").remove()}}])&&Rt(e.prototype,n),o&&Rt(e,o),t}();function Ft(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Dt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$note=e.layoutInfo.note,this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.options=e.options,this.lang=this.options.langInfo,this.editable=this.$editable[0],this.lastRange=null,this.snapshot=null,this.style=new Et,this.table=new At,this.typing=new Pt(e),this.bullet=new $t,this.history=new St(e),this.context.memo("help.undo",this.lang.help.undo),this.context.memo("help.redo",this.lang.help.redo),this.context.memo("help.tab",this.lang.help.tab),this.context.memo("help.untab",this.lang.help.untab),this.context.memo("help.insertParagraph",this.lang.help.insertParagraph),this.context.memo("help.insertOrderedList",this.lang.help.insertOrderedList),this.context.memo("help.insertUnorderedList",this.lang.help.insertUnorderedList),this.context.memo("help.indent",this.lang.help.indent),this.context.memo("help.outdent",this.lang.help.outdent),this.context.memo("help.formatPara",this.lang.help.formatPara),this.context.memo("help.insertHorizontalRule",this.lang.help.insertHorizontalRule),this.context.memo("help.fontName",this.lang.help.fontName);for(var o=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor"],r=0,a=o.length;r<a;r++)this[o[r]]=function(t){return function(e){n.beforeCommand(),document.execCommand(t,!1,e),n.afterCommand(!0)}}(o[r]),this.context.memo("help."+o[r],this.lang.help[o[r]]);this.fontName=this.wrapCommand((function(t){return n.fontStyling("font-family",v.validFontName(t))})),this.fontSize=this.wrapCommand((function(t){var e=n.currentStyle()["font-size-unit"];return n.fontStyling("font-size",t+e)})),this.fontSizeUnit=this.wrapCommand((function(t){var e=n.currentStyle()["font-size"];return n.fontStyling("font-size",e+t)}));for(var s=1;s<=6;s++)this["formatH"+s]=function(t){return function(){n.formatBlock("H"+t)}}(s),this.context.memo("help.formatH"+s,this.lang.help["formatH"+s]);this.insertParagraph=this.wrapCommand((function(){n.typing.insertParagraph(n.editable)})),this.insertOrderedList=this.wrapCommand((function(){n.bullet.insertOrderedList(n.editable)})),this.insertUnorderedList=this.wrapCommand((function(){n.bullet.insertUnorderedList(n.editable)})),this.indent=this.wrapCommand((function(){n.bullet.indent(n.editable)})),this.outdent=this.wrapCommand((function(){n.bullet.outdent(n.editable)})),this.insertNode=this.wrapCommand((function(t){n.isLimited(i()(t).text().length)||(n.getLastRange().insertNode(t),n.setLastRange(kt.createFromNodeAfter(t).select()))})),this.insertText=this.wrapCommand((function(t){if(!n.isLimited(t.length)){var e=n.getLastRange().insertNode(ft.createText(t));n.setLastRange(kt.create(e,ft.nodeLength(e)).select())}})),this.pasteHTML=this.wrapCommand((function(t){if(!n.isLimited(t.length)){t=n.context.invoke("codeview.purify",t);var e=n.getLastRange().pasteHTML(t);n.setLastRange(kt.createFromNodeAfter(x.last(e)).select())}})),this.formatBlock=this.wrapCommand((function(t,e){var o=n.options.callbacks.onApplyCustomStyle;o?o.call(n,e,n.context,n.onFormatBlock):n.onFormatBlock(t,e)})),this.insertHorizontalRule=this.wrapCommand((function(){var t=n.getLastRange().insertNode(ft.create("HR"));t.nextSibling&&n.setLastRange(kt.create(t.nextSibling,0).normalize().select())})),this.lineHeight=this.wrapCommand((function(t){n.style.stylePara(n.getLastRange(),{lineHeight:t})})),this.createLink=this.wrapCommand((function(t){var e=t.url,o=t.text,r=t.isNewWindow,a=t.checkProtocol,s=t.range||n.getLastRange(),l=o.length-s.toString().length;if(!(l>0&&n.isLimited(l))){var c=s.toString()!==o;"string"==typeof e&&(e=e.trim()),n.options.onCreateLink?e=n.options.onCreateLink(e):a&&(e=/^([A-Za-z][A-Za-z0-9+-.]*\:|#|\/)/.test(e)?e:n.options.defaultProtocol+e);var u=[];if(c){var d=(s=s.deleteContents()).insertNode(i()("<A>"+o+"</A>")[0]);u.push(d)}else u=n.style.styleNodes(s,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});i.a.each(u,(function(t,n){i()(n).attr("href",e),r?i()(n).attr("target","_blank"):i()(n).removeAttr("target")}));var h=kt.createFromNodeBefore(x.head(u)).getStartPoint(),f=kt.createFromNodeAfter(x.last(u)).getEndPoint();n.setLastRange(kt.create(h.node,h.offset,f.node,f.offset).select())}})),this.color=this.wrapCommand((function(t){var e=t.foreColor,n=t.backColor;e&&document.execCommand("foreColor",!1,e),n&&document.execCommand("backColor",!1,n)})),this.foreColor=this.wrapCommand((function(t){document.execCommand("foreColor",!1,t)})),this.insertTable=this.wrapCommand((function(t){var e=t.split("x");n.getLastRange().deleteContents().insertNode(n.table.createTable(e[0],e[1],n.options))})),this.removeMedia=this.wrapCommand((function(){var t=i()(n.restoreTarget()).parent();t.closest("figure").length?t.closest("figure").remove():t=i()(n.restoreTarget()).detach(),n.context.triggerEvent("media.delete",t,n.$editable)})),this.floatMe=this.wrapCommand((function(t){var e=i()(n.restoreTarget());e.toggleClass("note-float-left","left"===t),e.toggleClass("note-float-right","right"===t),e.css("float","none"===t?"":t)})),this.resize=this.wrapCommand((function(t){var e=i()(n.restoreTarget());0===(t=parseFloat(t))?e.css("width",""):e.css({width:100*t+"%",height:""})}))}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.$editable.on("keydown",(function(e){if(e.keyCode===Ct.code.ENTER&&t.context.triggerEvent("enter",e),t.context.triggerEvent("keydown",e),t.snapshot=t.history.makeSnapshot(),t.hasKeyShortCut=!1,e.isDefaultPrevented()||(t.options.shortcuts?t.hasKeyShortCut=t.handleKeyMap(e):t.preventDefaultEditableShortCuts(e)),t.isLimited(1,e)){var n=t.getLastRange();if(n.eo-n.so==0)return!1}t.setLastRange(),t.options.recordEveryKeystroke&&!1===t.hasKeyShortCut&&t.history.recordUndo()})).on("keyup",(function(e){t.setLastRange(),t.context.triggerEvent("keyup",e)})).on("focus",(function(e){t.setLastRange(),t.context.triggerEvent("focus",e)})).on("blur",(function(e){t.context.triggerEvent("blur",e)})).on("mousedown",(function(e){t.context.triggerEvent("mousedown",e)})).on("mouseup",(function(e){t.setLastRange(),t.history.recordUndo(),t.context.triggerEvent("mouseup",e)})).on("scroll",(function(e){t.context.triggerEvent("scroll",e)})).on("paste",(function(e){t.setLastRange(),t.context.triggerEvent("paste",e)})).on("input",(function(){t.isLimited(0)&&t.snapshot&&t.history.applySnapshot(t.snapshot)})),this.$editable.attr("spellcheck",this.options.spellCheck),this.$editable.attr("autocorrect",this.options.spellCheck),this.options.disableGrammar&&this.$editable.attr("data-gramm",!1),this.$editable.html(ft.html(this.$note)||ft.emptyPara),this.$editable.on(v.inputEventName,b.debounce((function(){t.context.triggerEvent("change",t.$editable.html(),t.$editable)}),10)),this.$editable.on("focusin",(function(e){t.context.triggerEvent("focusin",e)})).on("focusout",(function(e){t.context.triggerEvent("focusout",e)})),this.options.airMode?this.options.overrideContextMenu&&this.$editor.on("contextmenu",(function(e){return t.context.triggerEvent("contextmenu",e),!1})):(this.options.width&&this.$editor.outerWidth(this.options.width),this.options.height&&this.$editable.outerHeight(this.options.height),this.options.maxHeight&&this.$editable.css("max-height",this.options.maxHeight),this.options.minHeight&&this.$editable.css("min-height",this.options.minHeight)),this.history.recordUndo(),this.setLastRange()}},{key:"destroy",value:function(){this.$editable.off()}},{key:"handleKeyMap",value:function(t){var e=this.options.keyMap[v.isMac?"mac":"pc"],n=[];t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT");var o=Ct.nameFromCode[t.keyCode];o&&n.push(o);var i=e[n.join("+")];if("TAB"!==o||this.options.tabDisable)if(i){if(!1!==this.context.invoke(i))return t.preventDefault(),!0}else Ct.isEdit(t.keyCode)&&this.afterCommand();else this.afterCommand();return!1}},{key:"preventDefaultEditableShortCuts",value:function(t){(t.ctrlKey||t.metaKey)&&x.contains([66,73,85],t.keyCode)&&t.preventDefault()}},{key:"isLimited",value:function(t,e){return t=t||0,(void 0===e||!(Ct.isMove(e.keyCode)||Ct.isNavigation(e.keyCode)||e.ctrlKey||e.metaKey||x.contains([Ct.code.BACKSPACE,Ct.code.DELETE],e.keyCode)))&&this.options.maxTextLength>0&&this.$editable.text().length+t>this.options.maxTextLength}},{key:"createRange",value:function(){return this.focus(),this.setLastRange(),this.getLastRange()}},{key:"setLastRange",value:function(t){t?this.lastRange=t:(this.lastRange=kt.create(this.editable),0===i()(this.lastRange.sc).closest(".note-editable").length&&(this.lastRange=kt.createFromBodyElement(this.editable)))}},{key:"getLastRange",value:function(){return this.lastRange||this.setLastRange(),this.lastRange}},{key:"saveRange",value:function(t){t&&this.getLastRange().collapse().select()}},{key:"restoreRange",value:function(){this.lastRange&&(this.lastRange.select(),this.focus())}},{key:"saveTarget",value:function(t){this.$editable.data("target",t)}},{key:"clearTarget",value:function(){this.$editable.removeData("target")}},{key:"restoreTarget",value:function(){return this.$editable.data("target")}},{key:"currentStyle",value:function(){var t=kt.create();return t&&(t=t.normalize()),t?this.style.current(t):this.style.fromNode(this.$editable)}},{key:"styleFromNode",value:function(t){return this.style.fromNode(t)}},{key:"undo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.undo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"commit",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.commit(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"redo",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),this.history.redo(),this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"beforeCommand",value:function(){this.context.triggerEvent("before.command",this.$editable.html()),document.execCommand("styleWithCSS",!1,this.options.styleWithCSS),this.focus()}},{key:"afterCommand",value:function(t){this.normalizeContent(),this.history.recordUndo(),t||this.context.triggerEvent("change",this.$editable.html(),this.$editable)}},{key:"tab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t);else{if(0===this.options.tabSize)return!1;this.isLimited(this.options.tabSize)||(this.beforeCommand(),this.typing.insertTab(t,this.options.tabSize),this.afterCommand())}}},{key:"untab",value:function(){var t=this.getLastRange();if(t.isCollapsed()&&t.isOnCell())this.table.tab(t,!0);else if(0===this.options.tabSize)return!1}},{key:"wrapCommand",value:function(t){return function(){this.beforeCommand(),t.apply(this,arguments),this.afterCommand()}}},{key:"insertImage",value:function(t,e){var n,o=this;return(n=t,i.a.Deferred((function(t){var e=i()("<img>");e.one("load",(function(){e.off("error abort"),t.resolve(e)})).one("error abort",(function(){e.off("load").detach(),t.reject(e)})).css({display:"none"}).appendTo(document.body).attr("src",n)})).promise()).then((function(t){o.beforeCommand(),"function"==typeof e?e(t):("string"==typeof e&&t.attr("data-filename",e),t.css("width",Math.min(o.$editable.width(),t.width()))),t.show(),o.getLastRange().insertNode(t[0]),o.setLastRange(kt.createFromNodeAfter(t[0]).select()),o.afterCommand()})).fail((function(t){o.context.triggerEvent("image.upload.error",t)}))}},{key:"insertImagesAsDataURL",value:function(t){var e=this;i.a.each(t,(function(t,n){var o=n.name;e.options.maximumImageFileSize&&e.options.maximumImageFileSize<n.size?e.context.triggerEvent("image.upload.error",e.lang.image.maximumFileSizeError):function(t){return i.a.Deferred((function(e){i.a.extend(new FileReader,{onload:function(t){var n=t.target.result;e.resolve(n)},onerror:function(t){e.reject(t)}}).readAsDataURL(t)})).promise()}(n).then((function(t){return e.insertImage(t,o)})).fail((function(){e.context.triggerEvent("image.upload.error")}))}))}},{key:"insertImagesOrCallback",value:function(t){this.options.callbacks.onImageUpload?this.context.triggerEvent("image.upload",t):this.insertImagesAsDataURL(t)}},{key:"getSelectedText",value:function(){var t=this.getLastRange();return t.isOnAnchor()&&(t=kt.createFromNode(ft.ancestor(t.sc,ft.isAnchor))),t.toString()}},{key:"onFormatBlock",value:function(t,e){if(document.execCommand("FormatBlock",!1,v.isMSIE?"<"+t+">":t),e&&e.length&&(e[0].tagName.toUpperCase()!==t.toUpperCase()&&(e=e.find(t)),e&&e.length)){var n=e[0].className||"";if(n){var o=this.createRange();i()([o.sc,o.ec]).closest(t).addClass(n)}}}},{key:"formatPara",value:function(){this.formatBlock("P")}},{key:"fontStyling",value:function(t,e){var n=this.getLastRange();if(""!==n){var o=this.style.styleNodes(n);if(this.$editor.find(".note-status-output").html(""),i()(o).css(t,e),n.isCollapsed()){var r=x.head(o);r&&!ft.nodeLength(r)&&(r.innerHTML=ft.ZERO_WIDTH_NBSP_CHAR,kt.createFromNodeAfter(r.firstChild).select(),this.setLastRange(),this.$editable.data("bogus",r))}}else{var a=i.a.now();this.$editor.find(".note-status-output").html('<div id="note-status-output-'+a+'" class="alert alert-info">'+this.lang.output.noSelection+"</div>"),setTimeout((function(){i()("#note-status-output-"+a).remove()}),5e3)}}},{key:"unlink",value:function(){var t=this.getLastRange();if(t.isOnAnchor()){var e=ft.ancestor(t.sc,ft.isAnchor);(t=kt.createFromNode(e)).select(),this.setLastRange(),this.beforeCommand(),document.execCommand("unlink"),this.afterCommand()}}},{key:"getLinkInfo",value:function(){var t=this.getLastRange().expand(ft.isAnchor),e=i()(x.head(t.nodes(ft.isAnchor))),n={range:t,text:t.toString(),url:e.length?e.attr("href"):""};return e.length&&(n.isNewWindow="_blank"===e.attr("target")),n}},{key:"addRow",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addRow(e,t),this.afterCommand())}},{key:"addCol",value:function(t){var e=this.getLastRange(this.$editable);e.isCollapsed()&&e.isOnCell()&&(this.beforeCommand(),this.table.addCol(e,t),this.afterCommand())}},{key:"deleteRow",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteRow(t),this.afterCommand())}},{key:"deleteCol",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteCol(t),this.afterCommand())}},{key:"deleteTable",value:function(){var t=this.getLastRange(this.$editable);t.isCollapsed()&&t.isOnCell()&&(this.beforeCommand(),this.table.deleteTable(t),this.afterCommand())}},{key:"resizeTo",value:function(t,e,n){var o;if(n){var i=t.y/t.x,r=e.data("ratio");o={width:r>i?t.x:t.y/r,height:r>i?t.x*r:t.y}}else o={width:t.x,height:t.y};e.css(o)}},{key:"hasFocus",value:function(){return this.$editable.is(":focus")}},{key:"focus",value:function(){this.hasFocus()||this.$editable.focus()}},{key:"isEmpty",value:function(){return ft.isEmpty(this.$editable[0])||ft.emptyPara===this.$editable.html()}},{key:"empty",value:function(){this.context.invoke("code",ft.emptyPara)}},{key:"normalizeContent",value:function(){this.$editable[0].normalize()}}])&&Ft(e.prototype,n),o&&Ft(e,o),t}();function Ht(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var zt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editable=e.layoutInfo.editable}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.$editable.on("paste",this.pasteByEvent.bind(this))}},{key:"pasteByEvent",value:function(t){var e=this,n=t.originalEvent.clipboardData;if(n&&n.items&&n.items.length){var o=n.items.length>1?n.items[1]:x.head(n.items);"file"===o.kind&&-1!==o.type.indexOf("image/")?(this.context.invoke("editor.insertImagesOrCallback",[o.getAsFile()]),t.preventDefault()):"string"===o.kind&&this.context.invoke("editor.isLimited",n.getData("Text").length)&&t.preventDefault()}else if(window.clipboardData){var i=window.clipboardData.getData("text");this.context.invoke("editor.isLimited",i.length)&&t.preventDefault()}setTimeout((function(){e.context.invoke("editor.afterCommand")}),10)}}])&&Ht(e.prototype,n),o&&Ht(e,o),t}();function Bt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Mt,Ot=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$eventListener=i()(document),this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.options=e.options,this.lang=this.options.langInfo,this.documentEventHandlers={},this.$dropzone=i()(['<div class="note-dropzone">','<div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(this.$editor)}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.options.disableDragAndDrop?(this.documentEventHandlers.onDrop=function(t){t.preventDefault()},this.$eventListener=this.$dropzone,this.$eventListener.on("drop",this.documentEventHandlers.onDrop)):this.attachDragAndDropEvent()}},{key:"attachDragAndDropEvent",value:function(){var t=this,e=i()(),n=this.$dropzone.find(".note-dropzone-message");this.documentEventHandlers.onDragenter=function(o){var i=t.context.invoke("codeview.isActivated"),r=t.$editor.width()>0&&t.$editor.height()>0;i||e.length||!r||(t.$editor.addClass("dragover"),t.$dropzone.width(t.$editor.width()),t.$dropzone.height(t.$editor.height()),n.text(t.lang.image.dragImageHere)),e=e.add(o.target)},this.documentEventHandlers.onDragleave=function(n){(e=e.not(n.target)).length&&"BODY"!==n.target.nodeName||(e=i()(),t.$editor.removeClass("dragover"))},this.documentEventHandlers.onDrop=function(){e=i()(),t.$editor.removeClass("dragover")},this.$eventListener.on("dragenter",this.documentEventHandlers.onDragenter).on("dragleave",this.documentEventHandlers.onDragleave).on("drop",this.documentEventHandlers.onDrop),this.$dropzone.on("dragenter",(function(){t.$dropzone.addClass("hover"),n.text(t.lang.image.dropImage)})).on("dragleave",(function(){t.$dropzone.removeClass("hover"),n.text(t.lang.image.dragImageHere)})),this.$dropzone.on("drop",(function(e){var n=e.originalEvent.dataTransfer;e.preventDefault(),n&&n.files&&n.files.length?(t.$editable.focus(),t.context.invoke("editor.insertImagesOrCallback",n.files)):i.a.each(n.types,(function(e,o){if(!(o.toLowerCase().indexOf("_moz_")>-1)){var r=n.getData(o);o.toLowerCase().indexOf("text")>-1?t.context.invoke("editor.pasteHTML",r):i()(r).each((function(e,n){t.context.invoke("editor.insertNode",n)}))}}))})).on("dragover",!1)}},{key:"destroy",value:function(){var t=this;Object.keys(this.documentEventHandlers).forEach((function(e){t.$eventListener.off(e.substr(2).toLowerCase(),t.documentEventHandlers[e])})),this.documentEventHandlers={}}}])&&Bt(e.prototype,n),o&&Bt(e,o),t}();function Ut(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}v.hasCodeMirror&&(Mt=window.CodeMirror);var jt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editor=e.layoutInfo.editor,this.$editable=e.layoutInfo.editable,this.$codable=e.layoutInfo.codable,this.options=e.options}var e,n,o;return e=t,(n=[{key:"sync",value:function(){this.isActivated()&&v.hasCodeMirror&&this.$codable.data("cmEditor").save()}},{key:"isActivated",value:function(){return this.$editor.hasClass("codeview")}},{key:"toggle",value:function(){this.isActivated()?this.deactivate():this.activate(),this.context.triggerEvent("codeview.toggled")}},{key:"purify",value:function(t){if(this.options.codeviewFilter&&(t=t.replace(this.options.codeviewFilterRegex,""),this.options.codeviewIframeFilter)){var e=this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);t=t.replace(/(<iframe.*?>.*?(?:<\/iframe>)?)/gi,(function(t){if(/<.+src(?==?('|"|\s)?)[\s\S]+src(?=('|"|\s)?)[^>]*?>/i.test(t))return"";var n=!0,o=!1,i=void 0;try{for(var r,a=e[Symbol.iterator]();!(n=(r=a.next()).done);n=!0){var s=r.value;if(new RegExp('src="(https?:)?//'+s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+'/(.+)"').test(t))return t}}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return""}))}return t}},{key:"activate",value:function(){var t=this;if(this.$codable.val(ft.html(this.$editable,this.options.prettifyHtml)),this.$codable.height(this.$editable.height()),this.context.invoke("toolbar.updateCodeview",!0),this.$editor.addClass("codeview"),this.$codable.focus(),v.hasCodeMirror){var e=Mt.fromTextArea(this.$codable[0],this.options.codemirror);if(this.options.codemirror.tern){var n=new Mt.TernServer(this.options.codemirror.tern);e.ternServer=n,e.on("cursorActivity",(function(t){n.updateArgHints(t)}))}e.on("blur",(function(n){t.context.triggerEvent("blur.codeview",e.getValue(),n)})),e.on("change",(function(){t.context.triggerEvent("change.codeview",e.getValue(),e)})),e.setSize(null,this.$editable.outerHeight()),this.$codable.data("cmEditor",e)}else this.$codable.on("blur",(function(e){t.context.triggerEvent("blur.codeview",t.$codable.val(),e)})),this.$codable.on("input",(function(){t.context.triggerEvent("change.codeview",t.$codable.val(),t.$codable)}))}},{key:"deactivate",value:function(){if(v.hasCodeMirror){var t=this.$codable.data("cmEditor");this.$codable.val(t.getValue()),t.toTextArea()}var e=this.purify(ft.value(this.$codable,this.options.prettifyHtml)||ft.emptyPara),n=this.$editable.html()!==e;this.$editable.html(e),this.$editable.height(this.options.height?this.$codable.height():"auto"),this.$editor.removeClass("codeview"),n&&this.context.triggerEvent("change",this.$editable.html(),this.$editable),this.$editable.focus(),this.context.invoke("toolbar.updateCodeview",!1)}},{key:"destroy",value:function(){this.isActivated()&&this.deactivate()}}])&&Ut(e.prototype,n),o&&Ut(e,o),t}();function Wt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Kt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$document=i()(document),this.$statusbar=e.layoutInfo.statusbar,this.$editable=e.layoutInfo.editable,this.options=e.options}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.options.airMode||this.options.disableResizeEditor?this.destroy():this.$statusbar.on("mousedown",(function(e){e.preventDefault(),e.stopPropagation();var n=t.$editable.offset().top-t.$document.scrollTop(),o=function(e){var o=e.clientY-(n+24);o=t.options.minheight>0?Math.max(o,t.options.minheight):o,o=t.options.maxHeight>0?Math.min(o,t.options.maxHeight):o,t.$editable.height(o)};t.$document.on("mousemove",o).one("mouseup",(function(){t.$document.off("mousemove",o)}))}))}},{key:"destroy",value:function(){this.$statusbar.off(),this.$statusbar.addClass("locked")}}])&&Wt(e.prototype,n),o&&Wt(e,o),t}();function qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Vt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editor=e.layoutInfo.editor,this.$toolbar=e.layoutInfo.toolbar,this.$editable=e.layoutInfo.editable,this.$codable=e.layoutInfo.codable,this.$window=i()(window),this.$scrollbar=i()("html, body"),this.onResize=function(){n.resizeTo({h:n.$window.height()-n.$toolbar.outerHeight()})}}var e,n,o;return e=t,(n=[{key:"resizeTo",value:function(t){this.$editable.css("height",t.h),this.$codable.css("height",t.h),this.$codable.data("cmeditor")&&this.$codable.data("cmeditor").setsize(null,t.h)}},{key:"toggle",value:function(){this.$editor.toggleClass("fullscreen"),this.isFullscreen()?(this.$editable.data("orgHeight",this.$editable.css("height")),this.$editable.data("orgMaxHeight",this.$editable.css("maxHeight")),this.$editable.css("maxHeight",""),this.$window.on("resize",this.onResize).trigger("resize"),this.$scrollbar.css("overflow","hidden")):(this.$window.off("resize",this.onResize),this.resizeTo({h:this.$editable.data("orgHeight")}),this.$editable.css("maxHeight",this.$editable.css("orgMaxHeight")),this.$scrollbar.css("overflow","visible")),this.context.invoke("toolbar.updateFullscreen",this.isFullscreen())}},{key:"isFullscreen",value:function(){return this.$editor.hasClass("fullscreen")}}])&&qt(e.prototype,n),o&&qt(e,o),t}();function _t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Gt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$document=i()(document),this.$editingArea=e.layoutInfo.editingArea,this.options=e.options,this.lang=this.options.langInfo,this.events={"summernote.mousedown":function(t,e){n.update(e.target,e)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()},"summernote.codeview.toggled":function(){n.update()}}}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this;this.$handle=i()(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',this.options.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',this.options.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(this.$editingArea),this.$handle.on("mousedown",(function(e){if(ft.isControlSizing(e.target)){e.preventDefault(),e.stopPropagation();var n=t.$handle.find(".note-control-selection").data("target"),o=n.offset(),i=t.$document.scrollTop(),r=function(e){t.context.invoke("editor.resizeTo",{x:e.clientX-o.left,y:e.clientY-(o.top-i)},n,!e.shiftKey),t.update(n[0],e)};t.$document.on("mousemove",r).one("mouseup",(function(e){e.preventDefault(),t.$document.off("mousemove",r),t.context.invoke("editor.afterCommand")})),n.data("ratio")||n.data("ratio",n.height()/n.width())}})),this.$handle.on("wheel",(function(e){e.preventDefault(),t.update()}))}},{key:"destroy",value:function(){this.$handle.remove()}},{key:"update",value:function(t,e){if(this.context.isDisabled())return!1;var n=ft.isImg(t),o=this.$handle.find(".note-control-selection");if(this.context.invoke("imagePopover.update",t,e),n){var r=i()(t),a=r.position(),s={left:a.left+parseInt(r.css("marginLeft"),10),top:a.top+parseInt(r.css("marginTop"),10)},l={w:r.outerWidth(!1),h:r.outerHeight(!1)};o.css({display:"block",left:s.left,top:s.top,width:l.w,height:l.h}).data("target",r);var c=new Image;c.src=r.attr("src");var u=l.w+"x"+l.h+" ("+this.lang.image.original+": "+c.width+"x"+c.height+")";o.find(".note-control-selection-info").text(u),this.context.invoke("editor.saveTarget",t)}else this.hide();return n}},{key:"hide",value:function(){this.context.invoke("editor.clearTarget"),this.$handle.children().hide()}}])&&_t(e.prototype,n),o&&_t(e,o),t}();function Yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Zt=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i,Xt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){this.lastWordRange=null}},{key:"destroy",value:function(){this.lastWordRange=null}},{key:"replace",value:function(){if(this.lastWordRange){var t=this.lastWordRange.toString(),e=t.match(Zt);if(e&&(e[1]||e[2])){var n=e[1]?t:"http://"+t,o=t.replace(/^(?:https?:\/\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\.)?/i,"").split("/")[0],r=i()("<a />").html(o).attr("href",n)[0];this.context.options.linkTargetBlank&&i()(r).attr("target","_blank"),this.lastWordRange.insertNode(r),this.lastWordRange=null,this.context.invoke("editor.focus")}}}},{key:"handleKeydown",value:function(t){if(x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWordRange=e}}},{key:"handleKeyup",value:function(t){x.contains([Ct.code.ENTER,Ct.code.SPACE],t.keyCode)&&this.replace()}}])&&Yt(e.prototype,n),o&&Yt(e,o),t}();function Qt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Jt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$note=e.layoutInfo.note,this.events={"summernote.change":function(){n.$note.val(e.invoke("code"))}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return ft.isTextarea(this.$note[0])}}])&&Qt(e.prototype,n),o&&Qt(e,o),t}();function te(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ee=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.options=e.options.replace||{},this.keys=[Ct.code.ENTER,Ct.code.SPACE,Ct.code.PERIOD,Ct.code.COMMA,Ct.code.SEMICOLON,Ct.code.SLASH],this.previousKeydownCode=null,this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!!this.options.match}},{key:"initialize",value:function(){this.lastWord=null}},{key:"destroy",value:function(){this.lastWord=null}},{key:"replace",value:function(){if(this.lastWord){var t=this,e=this.lastWord.toString();this.options.match(e,(function(e){if(e){var n="";if("string"==typeof e?n=ft.createText(e):e instanceof jQuery?n=e[0]:e instanceof Node&&(n=e),!n)return;t.lastWord.insertNode(n),t.lastWord=null,t.context.invoke("editor.focus")}}))}}},{key:"handleKeydown",value:function(t){if(this.previousKeydownCode&&x.contains(this.keys,this.previousKeydownCode))this.previousKeydownCode=t.keyCode;else{if(x.contains(this.keys,t.keyCode)){var e=this.context.invoke("editor.createRange").getWordRange();this.lastWord=e}this.previousKeydownCode=t.keyCode}}},{key:"handleKeyup",value:function(t){x.contains(this.keys,t.keyCode)&&this.replace()}}])&&te(e.prototype,n),o&&te(e,o),t}();function ne(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var oe=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$editingArea=e.layoutInfo.editingArea,this.options=e.options,!0===this.options.inheritPlaceholder&&(this.options.placeholder=this.context.$note.attr("placeholder")||this.options.placeholder),this.events={"summernote.init summernote.change":function(){n.update()},"summernote.codeview.toggled":function(){n.update()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!!this.options.placeholder}},{key:"initialize",value:function(){var t=this;this.$placeholder=i()('<div class="note-placeholder">'),this.$placeholder.on("click",(function(){t.context.invoke("focus")})).html(this.options.placeholder).prependTo(this.$editingArea),this.update()}},{key:"destroy",value:function(){this.$placeholder.remove()}},{key:"update",value:function(){var t=!this.context.invoke("codeview.isActivated")&&this.context.invoke("editor.isEmpty");this.$placeholder.toggle(t)}}])&&ne(e.prototype,n),o&&ne(e,o),t}();function ie(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var re=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.ui=i.a.summernote.ui,this.context=e,this.$toolbar=e.layoutInfo.toolbar,this.options=e.options,this.lang=this.options.langInfo,this.invertedKeyMap=b.invertObject(this.options.keyMap[v.isMac?"mac":"pc"])}var e,n,o;return e=t,(n=[{key:"representShortcut",value:function(t){var e=this.invertedKeyMap[t];return this.options.shortcuts&&e?(v.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""}},{key:"button",value:function(t){return!this.options.tooltip&&t.tooltip&&delete t.tooltip,t.container=this.options.container,this.ui.button(t)}},{key:"initialize",value:function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}}},{key:"destroy",value:function(){delete this.fontInstalledMap}},{key:"isFontInstalled",value:function(t){return Object.prototype.hasOwnProperty.call(this.fontInstalledMap,t)||(this.fontInstalledMap[t]=v.isFontInstalled(t)||x.contains(this.options.fontNamesIgnoreCheck,t)),this.fontInstalledMap[t]}},{key:"isFontDeservedToAdd",value:function(t){return""!==(t=t.toLowerCase())&&this.isFontInstalled(t)&&-1===v.genericFontFamilies.indexOf(t)}},{key:"colorPalette",value:function(t,e,n,o){var r=this;return this.ui.buttonGroup({className:"note-color "+t,children:[this.button({className:"note-current-color-button",contents:this.ui.icon(this.options.icons.font+" note-recent-color"),tooltip:e,click:function(t){var e=i()(t.currentTarget);n&&o?r.context.invoke("editor.color",{backColor:e.attr("data-backColor"),foreColor:e.attr("data-foreColor")}):n?r.context.invoke("editor.color",{backColor:e.attr("data-backColor")}):o&&r.context.invoke("editor.color",{foreColor:e.attr("data-foreColor")})},callback:function(t){var e=t.find(".note-recent-color");n&&(e.css("background-color",r.options.colorButton.backColor),t.attr("data-backColor",r.options.colorButton.backColor)),o?(e.css("color",r.options.colorButton.foreColor),t.attr("data-foreColor",r.options.colorButton.foreColor)):e.css("color","transparent")}}),this.button({className:"dropdown-toggle",contents:this.ui.dropdownButtonContents("",this.options),tooltip:this.lang.color.more,data:{toggle:"dropdown"}}),this.ui.dropdown({items:(n?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.background+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="backColor" data-value="inherit">',this.lang.color.transparent,"</button>","</div>",'<div class="note-holder" data-event="backColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="backColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="backColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.backColor+'" data-event="backColorPalette">',"</div>",'<div class="note-holder-custom" id="backColorPalette" data-event="backColor"/>',"</div>"].join(""):"")+(o?['<div class="note-palette">','<div class="note-palette-title">'+this.lang.color.foreground+"</div>","<div>",'<button type="button" class="note-color-reset btn btn-light" data-event="removeFormat" data-value="foreColor">',this.lang.color.resetToDefault,"</button>","</div>",'<div class="note-holder" data-event="foreColor"/>',"<div>",'<button type="button" class="note-color-select btn btn-light" data-event="openPalette" data-value="foreColorPicker">',this.lang.color.cpSelect,"</button>",'<input type="color" id="foreColorPicker" class="note-btn note-color-select-btn" value="'+this.options.colorButton.foreColor+'" data-event="foreColorPalette">',"</div>",'<div class="note-holder-custom" id="foreColorPalette" data-event="foreColor"/>',"</div>"].join(""):""),callback:function(t){t.find(".note-holder").each((function(t,e){var n=i()(e);n.append(r.ui.palette({colors:r.options.colors,colorsName:r.options.colorsName,eventName:n.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())}));var e=[["#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF"]];t.find(".note-holder-custom").each((function(t,n){var o=i()(n);o.append(r.ui.palette({colors:e,colorsName:e,eventName:o.data("event"),container:r.options.container,tooltip:r.options.tooltip}).render())})),t.find("input[type=color]").each((function(e,n){i()(n).change((function(){var e=t.find("#"+i()(this).data("event")).find(".note-color-btn").first(),n=this.value.toUpperCase();e.css("background-color",n).attr("aria-label",n).attr("data-value",n).attr("data-original-title",n),e.click()}))}))},click:function(e){e.stopPropagation();var n=i()("."+t).find(".note-dropdown-menu"),o=i()(e.target),a=o.data("event"),s=o.attr("data-value");if("openPalette"===a){var l=n.find("#"+s),c=i()(n.find("#"+l.data("event")).find(".note-color-row")[0]),u=c.find(".note-color-btn").last().detach(),d=l.val();u.css("background-color",d).attr("aria-label",d).attr("data-value",d).attr("data-original-title",d),c.prepend(u),l.click()}else{if(x.contains(["backColor","foreColor"],a)){var h="backColor"===a?"background-color":"color",f=o.closest(".note-color").find(".note-recent-color"),p=o.closest(".note-color").find(".note-current-color-button");f.css(h,s),p.attr("data-"+a,s)}r.context.invoke("editor."+a,s)}}})]}).render()}},{key:"addToolbarButtons",value:function(){var t=this;this.context.memo("button.style",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.magic),t.options),tooltip:t.lang.style.style,data:{toggle:"dropdown"}}),t.ui.dropdown({className:"dropdown-style",items:t.options.styleTags,title:t.lang.style.style,template:function(e){"string"==typeof e&&(e={tag:e,title:Object.prototype.hasOwnProperty.call(t.lang.style,e)?t.lang.style[e]:e});var n=e.tag,o=e.title;return"<"+n+(e.style?' style="'+e.style+'" ':"")+(e.className?' class="'+e.className+'"':"")+">"+o+"</"+n+">"},click:t.context.createInvokeHandler("editor.formatBlock")})]).render()}));for(var e=function(e,n){var o=t.options.styleTags[e];t.context.memo("button.style."+o,(function(){return t.button({className:"note-btn-style-"+o,contents:'<div data-value="'+o+'">'+o.toUpperCase()+"</div>",tooltip:t.lang.style[o],click:t.context.createInvokeHandler("editor.formatBlock")}).render()}))},n=0,o=this.options.styleTags.length;n<o;n++)e(n);this.context.memo("button.bold",(function(){return t.button({className:"note-btn-bold",contents:t.ui.icon(t.options.icons.bold),tooltip:t.lang.font.bold+t.representShortcut("bold"),click:t.context.createInvokeHandlerAndUpdateState("editor.bold")}).render()})),this.context.memo("button.italic",(function(){return t.button({className:"note-btn-italic",contents:t.ui.icon(t.options.icons.italic),tooltip:t.lang.font.italic+t.representShortcut("italic"),click:t.context.createInvokeHandlerAndUpdateState("editor.italic")}).render()})),this.context.memo("button.underline",(function(){return t.button({className:"note-btn-underline",contents:t.ui.icon(t.options.icons.underline),tooltip:t.lang.font.underline+t.representShortcut("underline"),click:t.context.createInvokeHandlerAndUpdateState("editor.underline")}).render()})),this.context.memo("button.clear",(function(){return t.button({contents:t.ui.icon(t.options.icons.eraser),tooltip:t.lang.font.clear+t.representShortcut("removeFormat"),click:t.context.createInvokeHandler("editor.removeFormat")}).render()})),this.context.memo("button.strikethrough",(function(){return t.button({className:"note-btn-strikethrough",contents:t.ui.icon(t.options.icons.strikethrough),tooltip:t.lang.font.strikethrough+t.representShortcut("strikethrough"),click:t.context.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()})),this.context.memo("button.superscript",(function(){return t.button({className:"note-btn-superscript",contents:t.ui.icon(t.options.icons.superscript),tooltip:t.lang.font.superscript,click:t.context.createInvokeHandlerAndUpdateState("editor.superscript")}).render()})),this.context.memo("button.subscript",(function(){return t.button({className:"note-btn-subscript",contents:t.ui.icon(t.options.icons.subscript),tooltip:t.lang.font.subscript,click:t.context.createInvokeHandlerAndUpdateState("editor.subscript")}).render()})),this.context.memo("button.fontname",(function(){var e=t.context.invoke("editor.currentStyle");return t.options.addDefaultFonts&&i.a.each(e["font-family"].split(","),(function(e,n){n=n.trim().replace(/['"]+/g,""),t.isFontDeservedToAdd(n)&&-1===t.options.fontNames.indexOf(n)&&t.options.fontNames.push(n)})),t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontname"/>',t.options),tooltip:t.lang.font.name,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontname",checkClassName:t.options.icons.menuCheck,items:t.options.fontNames.filter(t.isFontInstalled.bind(t)),title:t.lang.font.name,template:function(t){return'<span style="font-family: '+v.validFontName(t)+'">'+t+"</span>"},click:t.context.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()})),this.context.memo("button.fontsize",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontsize"/>',t.options),tooltip:t.lang.font.size,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsize",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizes,title:t.lang.font.size,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()})),this.context.memo("button.fontsizeunit",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents('<span class="note-current-fontsizeunit"/>',t.options),tooltip:t.lang.font.sizeunit,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({className:"dropdown-fontsizeunit",checkClassName:t.options.icons.menuCheck,items:t.options.fontSizeUnits,title:t.lang.font.sizeunit,click:t.context.createInvokeHandlerAndUpdateState("editor.fontSizeUnit")})]).render()})),this.context.memo("button.color",(function(){return t.colorPalette("note-color-all",t.lang.color.recent,!0,!0)})),this.context.memo("button.forecolor",(function(){return t.colorPalette("note-color-fore",t.lang.color.foreground,!1,!0)})),this.context.memo("button.backcolor",(function(){return t.colorPalette("note-color-back",t.lang.color.background,!0,!1)})),this.context.memo("button.ul",(function(){return t.button({contents:t.ui.icon(t.options.icons.unorderedlist),tooltip:t.lang.lists.unordered+t.representShortcut("insertUnorderedList"),click:t.context.createInvokeHandler("editor.insertUnorderedList")}).render()})),this.context.memo("button.ol",(function(){return t.button({contents:t.ui.icon(t.options.icons.orderedlist),tooltip:t.lang.lists.ordered+t.representShortcut("insertOrderedList"),click:t.context.createInvokeHandler("editor.insertOrderedList")}).render()}));var r=this.button({contents:this.ui.icon(this.options.icons.alignLeft),tooltip:this.lang.paragraph.left+this.representShortcut("justifyLeft"),click:this.context.createInvokeHandler("editor.justifyLeft")}),a=this.button({contents:this.ui.icon(this.options.icons.alignCenter),tooltip:this.lang.paragraph.center+this.representShortcut("justifyCenter"),click:this.context.createInvokeHandler("editor.justifyCenter")}),s=this.button({contents:this.ui.icon(this.options.icons.alignRight),tooltip:this.lang.paragraph.right+this.representShortcut("justifyRight"),click:this.context.createInvokeHandler("editor.justifyRight")}),l=this.button({contents:this.ui.icon(this.options.icons.alignJustify),tooltip:this.lang.paragraph.justify+this.representShortcut("justifyFull"),click:this.context.createInvokeHandler("editor.justifyFull")}),c=this.button({contents:this.ui.icon(this.options.icons.outdent),tooltip:this.lang.paragraph.outdent+this.representShortcut("outdent"),click:this.context.createInvokeHandler("editor.outdent")}),u=this.button({contents:this.ui.icon(this.options.icons.indent),tooltip:this.lang.paragraph.indent+this.representShortcut("indent"),click:this.context.createInvokeHandler("editor.indent")});this.context.memo("button.justifyLeft",b.invoke(r,"render")),this.context.memo("button.justifyCenter",b.invoke(a,"render")),this.context.memo("button.justifyRight",b.invoke(s,"render")),this.context.memo("button.justifyFull",b.invoke(l,"render")),this.context.memo("button.outdent",b.invoke(c,"render")),this.context.memo("button.indent",b.invoke(u,"render")),this.context.memo("button.paragraph",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.alignLeft),t.options),tooltip:t.lang.paragraph.paragraph,data:{toggle:"dropdown"}}),t.ui.dropdown([t.ui.buttonGroup({className:"note-align",children:[r,a,s,l]}),t.ui.buttonGroup({className:"note-list",children:[c,u]})])]).render()})),this.context.memo("button.height",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.textHeight),t.options),tooltip:t.lang.font.height,data:{toggle:"dropdown"}}),t.ui.dropdownCheck({items:t.options.lineHeights,checkClassName:t.options.icons.menuCheck,className:"dropdown-line-height",title:t.lang.font.height,click:t.context.createInvokeHandler("editor.lineHeight")})]).render()})),this.context.memo("button.table",(function(){return t.ui.buttonGroup([t.button({className:"dropdown-toggle",contents:t.ui.dropdownButtonContents(t.ui.icon(t.options.icons.table),t.options),tooltip:t.lang.table.table,data:{toggle:"dropdown"}}),t.ui.dropdown({title:t.lang.table.table,className:"note-table",items:['<div class="note-dimension-picker">','<div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>','<div class="note-dimension-picker-highlighted"/>','<div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(e){e.find(".note-dimension-picker-mousecatcher").css({width:t.options.insertTableMaxSize.col+"em",height:t.options.insertTableMaxSize.row+"em"}).mousedown(t.context.createInvokeHandler("editor.insertTable")).on("mousemove",t.tableMoveHandler.bind(t))}}).render()})),this.context.memo("button.link",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.link+t.representShortcut("linkDialog.show"),click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.picture",(function(){return t.button({contents:t.ui.icon(t.options.icons.picture),tooltip:t.lang.image.image,click:t.context.createInvokeHandler("imageDialog.show")}).render()})),this.context.memo("button.video",(function(){return t.button({contents:t.ui.icon(t.options.icons.video),tooltip:t.lang.video.video,click:t.context.createInvokeHandler("videoDialog.show")}).render()})),this.context.memo("button.hr",(function(){return t.button({contents:t.ui.icon(t.options.icons.minus),tooltip:t.lang.hr.insert+t.representShortcut("insertHorizontalRule"),click:t.context.createInvokeHandler("editor.insertHorizontalRule")}).render()})),this.context.memo("button.fullscreen",(function(){return t.button({className:"btn-fullscreen",contents:t.ui.icon(t.options.icons.arrowsAlt),tooltip:t.lang.options.fullscreen,click:t.context.createInvokeHandler("fullscreen.toggle")}).render()})),this.context.memo("button.codeview",(function(){return t.button({className:"btn-codeview",contents:t.ui.icon(t.options.icons.code),tooltip:t.lang.options.codeview,click:t.context.createInvokeHandler("codeview.toggle")}).render()})),this.context.memo("button.redo",(function(){return t.button({contents:t.ui.icon(t.options.icons.redo),tooltip:t.lang.history.redo+t.representShortcut("redo"),click:t.context.createInvokeHandler("editor.redo")}).render()})),this.context.memo("button.undo",(function(){return t.button({contents:t.ui.icon(t.options.icons.undo),tooltip:t.lang.history.undo+t.representShortcut("undo"),click:t.context.createInvokeHandler("editor.undo")}).render()})),this.context.memo("button.help",(function(){return t.button({contents:t.ui.icon(t.options.icons.question),tooltip:t.lang.options.help,click:t.context.createInvokeHandler("helpDialog.show")}).render()}))}},{key:"addImagePopoverButtons",value:function(){var t=this;this.context.memo("button.resizeFull",(function(){return t.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:t.lang.image.resizeFull,click:t.context.createInvokeHandler("editor.resize","1")}).render()})),this.context.memo("button.resizeHalf",(function(){return t.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:t.lang.image.resizeHalf,click:t.context.createInvokeHandler("editor.resize","0.5")}).render()})),this.context.memo("button.resizeQuarter",(function(){return t.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:t.lang.image.resizeQuarter,click:t.context.createInvokeHandler("editor.resize","0.25")}).render()})),this.context.memo("button.resizeNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.resizeNone,click:t.context.createInvokeHandler("editor.resize","0")}).render()})),this.context.memo("button.floatLeft",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatLeft),tooltip:t.lang.image.floatLeft,click:t.context.createInvokeHandler("editor.floatMe","left")}).render()})),this.context.memo("button.floatRight",(function(){return t.button({contents:t.ui.icon(t.options.icons.floatRight),tooltip:t.lang.image.floatRight,click:t.context.createInvokeHandler("editor.floatMe","right")}).render()})),this.context.memo("button.floatNone",(function(){return t.button({contents:t.ui.icon(t.options.icons.rollback),tooltip:t.lang.image.floatNone,click:t.context.createInvokeHandler("editor.floatMe","none")}).render()})),this.context.memo("button.removeMedia",(function(){return t.button({contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.image.remove,click:t.context.createInvokeHandler("editor.removeMedia")}).render()}))}},{key:"addLinkPopoverButtons",value:function(){var t=this;this.context.memo("button.linkDialogShow",(function(){return t.button({contents:t.ui.icon(t.options.icons.link),tooltip:t.lang.link.edit,click:t.context.createInvokeHandler("linkDialog.show")}).render()})),this.context.memo("button.unlink",(function(){return t.button({contents:t.ui.icon(t.options.icons.unlink),tooltip:t.lang.link.unlink,click:t.context.createInvokeHandler("editor.unlink")}).render()}))}},{key:"addTablePopoverButtons",value:function(){var t=this;this.context.memo("button.addRowUp",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowAbove),tooltip:t.lang.table.addRowAbove,click:t.context.createInvokeHandler("editor.addRow","top")}).render()})),this.context.memo("button.addRowDown",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowBelow),tooltip:t.lang.table.addRowBelow,click:t.context.createInvokeHandler("editor.addRow","bottom")}).render()})),this.context.memo("button.addColLeft",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colBefore),tooltip:t.lang.table.addColLeft,click:t.context.createInvokeHandler("editor.addCol","left")}).render()})),this.context.memo("button.addColRight",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colAfter),tooltip:t.lang.table.addColRight,click:t.context.createInvokeHandler("editor.addCol","right")}).render()})),this.context.memo("button.deleteRow",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.rowRemove),tooltip:t.lang.table.delRow,click:t.context.createInvokeHandler("editor.deleteRow")}).render()})),this.context.memo("button.deleteCol",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.colRemove),tooltip:t.lang.table.delCol,click:t.context.createInvokeHandler("editor.deleteCol")}).render()})),this.context.memo("button.deleteTable",(function(){return t.button({className:"btn-md",contents:t.ui.icon(t.options.icons.trash),tooltip:t.lang.table.delTable,click:t.context.createInvokeHandler("editor.deleteTable")}).render()}))}},{key:"build",value:function(t,e){for(var n=0,o=e.length;n<o;n++){for(var i=e[n],r=Array.isArray(i)?i[0]:i,a=Array.isArray(i)?1===i.length?[i[0]]:i[1]:[i],s=this.ui.buttonGroup({className:"note-"+r}).render(),l=0,c=a.length;l<c;l++){var u=this.context.memo("button."+a[l]);u&&s.append("function"==typeof u?u(this.context):u)}s.appendTo(t)}}},{key:"updateCurrentStyle",value:function(t){var e=this,n=t||this.$toolbar,o=this.context.invoke("editor.currentStyle");if(this.updateBtnStates(n,{".note-btn-bold":function(){return"bold"===o["font-bold"]},".note-btn-italic":function(){return"italic"===o["font-italic"]},".note-btn-underline":function(){return"underline"===o["font-underline"]},".note-btn-subscript":function(){return"subscript"===o["font-subscript"]},".note-btn-superscript":function(){return"superscript"===o["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===o["font-strikethrough"]}}),o["font-family"]){var r=o["font-family"].split(",").map((function(t){return t.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")})),a=x.find(r,this.isFontInstalled.bind(this));n.find(".dropdown-fontname a").each((function(t,e){var n=i()(e),o=n.data("value")+""==a+"";n.toggleClass("checked",o)})),n.find(".note-current-fontname").text(a).css("font-family",a)}if(o["font-size"]){var s=o["font-size"];n.find(".dropdown-fontsize a").each((function(t,e){var n=i()(e),o=n.data("value")+""==s+"";n.toggleClass("checked",o)})),n.find(".note-current-fontsize").text(s);var l=o["font-size-unit"];n.find(".dropdown-fontsizeunit a").each((function(t,e){var n=i()(e),o=n.data("value")+""==l+"";n.toggleClass("checked",o)})),n.find(".note-current-fontsizeunit").text(l)}if(o["line-height"]){var c=o["line-height"];n.find(".dropdown-line-height li a").each((function(t,n){var o=i()(n).data("value")+""==c+"";e.className=o?"checked":""}))}}},{key:"updateBtnStates",value:function(t,e){var n=this;i.a.each(e,(function(e,o){n.ui.toggleBtnActive(t.find(e),o())}))}},{key:"tableMoveHandler",value:function(t){var e,n=i()(t.target.parentNode),o=n.next(),r=n.find(".note-dimension-picker-mousecatcher"),a=n.find(".note-dimension-picker-highlighted"),s=n.find(".note-dimension-picker-unhighlighted");if(void 0===t.offsetX){var l=i()(t.target).offset();e={x:t.pageX-l.left,y:t.pageY-l.top}}else e={x:t.offsetX,y:t.offsetY};var c=Math.ceil(e.x/18)||1,u=Math.ceil(e.y/18)||1;a.css({width:c+"em",height:u+"em"}),r.data("value",c+"x"+u),c>3&&c<this.options.insertTableMaxSize.col&&s.css({width:c+1+"em"}),u>3&&u<this.options.insertTableMaxSize.row&&s.css({height:u+1+"em"}),o.html(c+" x "+u)}}])&&ie(e.prototype,n),o&&ie(e,o),t}();function ae(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var se=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.$window=i()(window),this.$document=i()(document),this.ui=i.a.summernote.ui,this.$note=e.layoutInfo.note,this.$editor=e.layoutInfo.editor,this.$toolbar=e.layoutInfo.toolbar,this.$editable=e.layoutInfo.editable,this.$statusbar=e.layoutInfo.statusbar,this.options=e.options,this.isFollowing=!1,this.followScroll=this.followScroll.bind(this)}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!this.options.airMode}},{key:"initialize",value:function(){var t=this;this.options.toolbar=this.options.toolbar||[],this.options.toolbar.length?this.context.invoke("buttons.build",this.$toolbar,this.options.toolbar):this.$toolbar.hide(),this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.changeContainer(!1),this.$note.on("summernote.keyup summernote.mouseup summernote.change",(function(){t.context.invoke("buttons.updateCurrentStyle")})),this.context.invoke("buttons.updateCurrentStyle"),this.options.followingToolbar&&this.$window.on("scroll resize",this.followScroll)}},{key:"destroy",value:function(){this.$toolbar.children().remove(),this.options.followingToolbar&&this.$window.off("scroll resize",this.followScroll)}},{key:"followScroll",value:function(){if(this.$editor.hasClass("fullscreen"))return!1;var t=this.$editor.outerHeight(),e=this.$editor.width(),n=this.$toolbar.height(),o=this.$statusbar.height(),r=0;this.options.otherStaticBar&&(r=i()(this.options.otherStaticBar).outerHeight());var a=this.$document.scrollTop(),s=this.$editor.offset().top,l=s-r,c=s+t-r-n-o;!this.isFollowing&&a>l&&a<c-n?(this.isFollowing=!0,this.$editable.css({marginTop:this.$toolbar.outerHeight()}),this.$toolbar.css({position:"fixed",top:r,width:e,zIndex:1e3})):this.isFollowing&&(a<l||a>c)&&(this.isFollowing=!1,this.$toolbar.css({position:"relative",top:0,width:"100%",zIndex:"auto"}),this.$editable.css({marginTop:""}))}},{key:"changeContainer",value:function(t){t?this.$toolbar.prependTo(this.$editor):this.options.toolbarContainer&&this.$toolbar.appendTo(this.options.toolbarContainer),this.options.followingToolbar&&this.followScroll()}},{key:"updateFullscreen",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-fullscreen"),t),this.changeContainer(t)}},{key:"updateCodeview",value:function(t){this.ui.toggleBtnActive(this.$toolbar.find(".btn-codeview"),t),t?this.deactivate():this.activate()}},{key:"activate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!0)}},{key:"deactivate",value:function(t){var e=this.$toolbar.find("button");t||(e=e.not(".btn-codeview").not(".btn-fullscreen")),this.ui.toggleBtn(e,!1)}}])&&ae(e.prototype,n),o&&ae(e,o),t}();function le(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ce=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo,e.memo("help.linkDialog.show",this.options.langInfo.help["linkDialog.show"])}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group">','<label for="note-dialog-link-txt-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.textToDisplay,"</label>"),'<input id="note-dialog-link-txt-'.concat(this.options.id,'" class="note-link-text form-control note-form-control note-input" type="text"/>'),"</div>",'<div class="form-group note-form-group">','<label for="note-dialog-link-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.link.url,"</label>"),'<input id="note-dialog-link-url-'.concat(this.options.id,'" class="note-link-url form-control note-form-control note-input" type="text" value="http://"/>'),"</div>",this.options.disableLinkTarget?"":i()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-open-in-new-window",text:this.lang.link.openInNewWindow,checked:!0}).render()).html(),i()("<div/>").append(this.ui.checkbox({className:"sn-checkbox-use-protocol",text:this.lang.link.useProtocol,checked:!0}).render()).html()].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-link-btn",'" value="').concat(this.lang.link.insert,'" disabled>');this.$dialog=this.ui.dialog({className:"link-dialog",title:this.lang.link.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"toggleLinkBtn",value:function(t,e,n){this.ui.toggleBtn(t,e.val()&&n.val())}},{key:"showLinkDialog",value:function(t){var e=this;return i.a.Deferred((function(n){var o=e.$dialog.find(".note-link-text"),i=e.$dialog.find(".note-link-url"),r=e.$dialog.find(".note-link-btn"),a=e.$dialog.find(".sn-checkbox-open-in-new-window input[type=checkbox]"),s=e.$dialog.find(".sn-checkbox-use-protocol input[type=checkbox]");e.ui.onDialogShown(e.$dialog,(function(){e.context.triggerEvent("dialog.shown"),!t.url&&b.isValidUrl(t.text)&&(t.url=t.text),o.on("input paste propertychange",(function(){t.text=o.val(),e.toggleLinkBtn(r,o,i)})).val(t.text),i.on("input paste propertychange",(function(){t.text||o.val(i.val()),e.toggleLinkBtn(r,o,i)})).val(t.url),v.isSupportTouch||i.trigger("focus"),e.toggleLinkBtn(r,o,i),e.bindEnterKey(i,r),e.bindEnterKey(o,r);var l=void 0!==t.isNewWindow?t.isNewWindow:e.context.options.linkTargetBlank;a.prop("checked",l);var c=!t.url&&e.context.options.useProtocol;s.prop("checked",c),r.one("click",(function(r){r.preventDefault(),n.resolve({range:t.range,url:i.val(),text:o.val(),isNewWindow:a.is(":checked"),checkProtocol:s.is(":checked")}),e.ui.hideDialog(e.$dialog)}))})),e.ui.onDialogHidden(e.$dialog,(function(){o.off(),i.off(),r.off(),"pending"===n.state()&&n.reject()})),e.ui.showDialog(e.$dialog)})).promise()}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getLinkInfo");this.context.invoke("editor.saveRange"),this.showLinkDialog(e).then((function(e){t.context.invoke("editor.restoreRange"),t.context.invoke("editor.createLink",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}}])&&le(e.prototype,n),o&&le(e,o),t}();function ue(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var de=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){n.update()},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.link)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a> </span>')}}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.link),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(){if(this.context.invoke("editor.hasFocus")){var t=this.context.invoke("editor.getLastRange");if(t.isCollapsed()&&t.isOnAnchor()){var e=ft.ancestor(t.sc,ft.isAnchor),n=i()(e).attr("href");this.$popover.find("a").attr("href",n).text(n);var o=ft.posFromPlaceholder(e),r=i()(this.options.container).offset();o.top-=r.top,o.left-=r.left,this.$popover.css({display:"block",left:o.left,top:o.top})}else this.hide()}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&ue(e.prototype,n),o&&ue(e,o),t}();function he(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var fe=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t="";if(this.options.maximumImageFileSize){var e=Math.floor(Math.log(this.options.maximumImageFileSize)/Math.log(1024)),n=1*(this.options.maximumImageFileSize/Math.pow(1024,e)).toFixed(2)+" "+" KMGTP"[e]+"B";t="<small>".concat(this.lang.image.maximumFileSize+" : "+n,"</small>")}var o=this.options.dialogsInBody?this.$body:this.options.container,i=['<div class="form-group note-form-group note-group-select-from-files">','<label for="note-dialog-image-file-'+this.options.id+'" class="note-form-label">'+this.lang.image.selectFromFiles+"</label>",'<input id="note-dialog-image-file-'+this.options.id+'" class="note-image-input form-control-file note-form-control note-input" ',' type="file" name="files" accept="image/*" multiple="multiple"/>',t,"</div>",'<div class="form-group note-group-image-url">','<label for="note-dialog-image-url-'+this.options.id+'" class="note-form-label">'+this.lang.image.url+"</label>",'<input id="note-dialog-image-url-'+this.options.id+'" class="note-image-url form-control note-form-control note-input" type="text"/>',"</div>"].join(""),r='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-image-btn",'" value="').concat(this.lang.image.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.image.insert,fade:this.options.dialogsFade,body:i,footer:r}).render().appendTo(o)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showImageDialog().then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange"),"string"==typeof e?t.options.callbacks.onImageLinkInsert?t.context.triggerEvent("image.link.insert",e):t.context.invoke("editor.insertImage",e):t.context.invoke("editor.insertImagesOrCallback",e)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showImageDialog",value:function(){var t=this;return i.a.Deferred((function(e){var n=t.$dialog.find(".note-image-input"),o=t.$dialog.find(".note-image-url"),i=t.$dialog.find(".note-image-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.replaceWith(n.clone().on("change",(function(t){e.resolve(t.target.files||t.target.value)})).val("")),o.on("input paste propertychange",(function(){t.ui.toggleBtn(i,o.val())})).val(""),v.isSupportTouch||o.trigger("focus"),i.click((function(t){t.preventDefault(),e.resolve(o.val())})),t.bindEnterKey(o,i)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),i.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&he(e.prototype,n),o&&he(e,o),t}();function pe(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var me=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.editable=e.layoutInfo.editable[0],this.options=e.options,this.events={"summernote.disable summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.image)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-image-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.image),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t,e){if(ft.isImg(t)){var n=i()(t).offset(),o=i()(this.options.container).offset(),r={};this.options.popatmouse?(r.left=e.pageX-20,r.top=e.pageY):r=n,r.top-=o.top,r.left-=o.left,this.$popover.css({display:"block",left:r.left,top:r.top})}else this.hide()}},{key:"hide",value:function(){this.$popover.hide()}}])&&pe(e.prototype,n),o&&pe(e,o),t}();function ve(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ge=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.events={"summernote.mousedown":function(t,e){n.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){n.update()},"summernote.disable summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return!x.isEmpty(this.options.popover.table)}},{key:"initialize",value:function(){this.$popover=this.ui.popover({className:"note-table-popover"}).render().appendTo(this.options.container);var t=this.$popover.find(".popover-content,.note-popover-content");this.context.invoke("buttons.build",t,this.options.popover.table),v.isFF&&document.execCommand("enableInlineTableEditing",!1,!1),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){if(this.context.isDisabled())return!1;var e=ft.isCell(t);if(e){var n=ft.posFromPlaceholder(t),o=i()(this.options.container).offset();n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:n.left,top:n.top})}else this.hide();return e}},{key:"hide",value:function(){this.$popover.hide()}}])&&ve(e.prototype,n),o&&ve(e,o),t}();function be(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var ye=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<div class="form-group note-form-group row-fluid">','<label for="note-dialog-video-url-'.concat(this.options.id,'" class="note-form-label">').concat(this.lang.video.url,' <small class="text-muted">').concat(this.lang.video.providers,"</small></label>"),'<input id="note-dialog-video-url-'.concat(this.options.id,'" class="note-video-url form-control note-form-control note-input" type="text"/>'),"</div>"].join(""),n='<input type="button" href="#" class="'.concat("btn btn-primary note-btn note-btn-primary note-video-btn",'" value="').concat(this.lang.video.insert,'" disabled>');this.$dialog=this.ui.dialog({title:this.lang.video.insert,fade:this.options.dialogsFade,body:e,footer:n}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"bindEnterKey",value:function(t,e){t.on("keypress",(function(t){t.keyCode===Ct.code.ENTER&&(t.preventDefault(),e.trigger("click"))}))}},{key:"createVideoNode",value:function(t){var e,n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?$/),o=t.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),r=t.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),a=t.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),s=t.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),l=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),c=t.match(/\/\/v\.qq\.com.*?vid=(.+)/),u=t.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),d=t.match(/^.+.(mp4|m4v)$/),h=t.match(/^.+.(ogg|ogv)$/),f=t.match(/^.+.(webm)$/),p=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/);if(n&&11===n[1].length){var m=n[1],v=0;if(void 0!==n[2]){var g=n[2].match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);if(g)for(var b=[3600,60,1],y=0,k=b.length;y<k;y++)v+=void 0!==g[y+1]?b[y]*parseInt(g[y+1],10):0}e=i()("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+m+(v>0?"?start="+v:"")).attr("width","640").attr("height","360")}else if(o&&o[0].length)e=i()("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+o[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(r&&r[0].length)e=i()("<iframe>").attr("frameborder",0).attr("src",r[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(a&&a[3].length)e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+a[3]).attr("width","640").attr("height","360");else if(s&&s[2].length)e=i()("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+s[2]).attr("width","640").attr("height","360");else if(l&&l[1].length)e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+l[1]);else if(c&&c[1].length||u&&u[2].length){var w=c&&c[1].length?c[1]:u[2];e=i()("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","https://v.qq.com/iframe/player.html?vid="+w+"&auto=0")}else if(d||h||f)e=i()("<video controls>").attr("src",t).attr("width","640").attr("height","360");else{if(!p||!p[0].length)return!1;e=i()("<iframe>").attr("frameborder",0).attr("src","https://www.facebook.com/plugins/video.php?href="+encodeURIComponent(p[0])+"&show_text=0&width=560").attr("width","560").attr("height","301").attr("scrolling","no").attr("allowtransparency","true")}return e.addClass("note-video-clip"),e[0]}},{key:"show",value:function(){var t=this,e=this.context.invoke("editor.getSelectedText");this.context.invoke("editor.saveRange"),this.showVideoDialog(e).then((function(e){t.ui.hideDialog(t.$dialog),t.context.invoke("editor.restoreRange");var n=t.createVideoNode(e);n&&t.context.invoke("editor.insertNode",n)})).fail((function(){t.context.invoke("editor.restoreRange")}))}},{key:"showVideoDialog",value:function(){var t=this;return i.a.Deferred((function(e){var n=t.$dialog.find(".note-video-url"),o=t.$dialog.find(".note-video-btn");t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),n.on("input paste propertychange",(function(){t.ui.toggleBtn(o,n.val())})),v.isSupportTouch||n.trigger("focus"),o.click((function(t){t.preventDefault(),e.resolve(n.val())})),t.bindEnterKey(n,o)})),t.ui.onDialogHidden(t.$dialog,(function(){n.off(),o.off(),"pending"===e.state()&&e.reject()})),t.ui.showDialog(t.$dialog)}))}}])&&be(e.prototype,n),o&&be(e,o),t}();function ke(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var we=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$body=i()(document.body),this.$editor=e.layoutInfo.editor,this.options=e.options,this.lang=this.options.langInfo}var e,n,o;return e=t,(n=[{key:"initialize",value:function(){var t=this.options.dialogsInBody?this.$body:this.options.container,e=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.16</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=this.ui.dialog({title:this.lang.options.help,fade:this.options.dialogsFade,body:this.createShortcutList(),footer:e,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(t)}},{key:"destroy",value:function(){this.ui.hideDialog(this.$dialog),this.$dialog.remove()}},{key:"createShortcutList",value:function(){var t=this,e=this.options.keyMap[v.isMac?"mac":"pc"];return Object.keys(e).map((function(n){var o=e[n],r=i()('<div><div class="help-list-item"/></div>');return r.append(i()("<label><kbd>"+n+"</kdb></label>").css({width:180,"margin-right":10})).append(i()("<span/>").html(t.context.memo("help."+o)||o)),r.html()})).join("")}},{key:"showHelpDialog",value:function(){var t=this;return i.a.Deferred((function(e){t.ui.onDialogShown(t.$dialog,(function(){t.context.triggerEvent("dialog.shown"),e.resolve()})),t.ui.showDialog(t.$dialog)})).promise()}},{key:"show",value:function(){var t=this;this.context.invoke("editor.saveRange"),this.showHelpDialog().then((function(){t.context.invoke("editor.restoreRange")}))}}])&&ke(e.prototype,n),o&&ke(e,o),t}();function Ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var xe=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.options=e.options,this.hidable=!0,this.onContextmenu=!1,this.pageX=null,this.pageY=null,this.events={"summernote.contextmenu":function(t){n.options.editing&&(t.preventDefault(),t.stopPropagation(),n.onContextmenu=!0,n.update(!0))},"summernote.mousedown":function(t,e){n.pageX=e.pageX,n.pageY=e.pageY},"summernote.keyup summernote.mouseup summernote.scroll":function(t,e){n.options.editing&&!n.onContextmenu&&(n.pageX=e.pageX,n.pageY=e.pageY,n.update()),n.onContextmenu=!1},"summernote.disable summernote.change summernote.dialog.shown summernote.blur":function(){n.hide()},"summernote.focusout":function(){n.$popover.is(":active,:focus")||n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return this.options.airMode&&!x.isEmpty(this.options.popover.air)}},{key:"initialize",value:function(){var t=this;this.$popover=this.ui.popover({className:"note-air-popover"}).render().appendTo(this.options.container);var e=this.$popover.find(".popover-content");this.context.invoke("buttons.build",e,this.options.popover.air),this.$popover.on("mousedown",(function(){t.hidable=!1})),this.$popover.on("mouseup",(function(){t.hidable=!0}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"update",value:function(t){var e=this.context.invoke("editor.currentStyle");if(!e.range||e.range.isCollapsed()&&!t)this.hide();else{var n={left:this.pageX,top:this.pageY},o=i()(this.options.container).offset();n.top-=o.top,n.left-=o.left,this.$popover.css({display:"block",left:Math.max(n.left,0)+-5,top:n.top+5}),this.context.invoke("buttons.updateCurrentStyle",this.$popover)}}},{key:"hide",value:function(){this.hidable&&this.$popover.hide()}}])&&Ce(e.prototype,n),o&&Ce(e,o),t}();function Se(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var Te=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.context=e,this.ui=i.a.summernote.ui,this.$editable=e.layoutInfo.editable,this.options=e.options,this.hint=this.options.hint||[],this.direction=this.options.hintDirection||"bottom",this.hints=Array.isArray(this.hint)?this.hint:[this.hint],this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||n.handleKeyup(e)},"summernote.keydown":function(t,e){n.handleKeydown(e)},"summernote.disable summernote.dialog.shown summernote.blur":function(){n.hide()}}}var e,n,o;return e=t,(n=[{key:"shouldInitialize",value:function(){return this.hints.length>0}},{key:"initialize",value:function(){var t=this;this.lastWordRange=null,this.matchingWord=null,this.$popover=this.ui.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo(this.options.container),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",(function(e){t.$content.find(".active").removeClass("active"),i()(e.currentTarget).addClass("active"),t.replace()})),this.$popover.on("mousedown",(function(t){t.preventDefault()}))}},{key:"destroy",value:function(){this.$popover.remove()}},{key:"selectItem",value:function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2}},{key:"moveDown",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.next();if(e.length)this.selectItem(e);else{var n=t.parent().next();n.length||(n=this.$content.find(".note-hint-group").first()),this.selectItem(n.find(".note-hint-item").first())}}},{key:"moveUp",value:function(){var t=this.$content.find(".note-hint-item.active"),e=t.prev();if(e.length)this.selectItem(e);else{var n=t.parent().prev();n.length||(n=this.$content.find(".note-hint-group").last()),this.selectItem(n.find(".note-hint-item").last())}}},{key:"replace",value:function(){var t=this.$content.find(".note-hint-item.active");if(t.length){var e=this.nodeFromItem(t);if(null!==this.matchingWord&&0===this.matchingWord.length)this.lastWordRange.so=this.lastWordRange.eo;else if(null!==this.matchingWord&&this.matchingWord.length>0&&!this.lastWordRange.isCollapsed()){var n=this.lastWordRange.eo-this.lastWordRange.so-this.matchingWord.length;n>0&&(this.lastWordRange.so+=n)}if(this.lastWordRange.insertNode(e),"next"===this.options.hintSelect){var o=document.createTextNode("");i()(e).after(o),kt.createFromNodeBefore(o).select()}else kt.createFromNodeAfter(e).select();this.lastWordRange=null,this.hide(),this.context.invoke("editor.focus")}}},{key:"nodeFromItem",value:function(t){var e=this.hints[t.data("index")],n=t.data("item"),o=e.content?e.content(n):n;return"string"==typeof o&&(o=ft.createText(o)),o}},{key:"createItemTemplates",value:function(t,e){var n=this.hints[t];return e.map((function(e){var o=i()('<div class="note-hint-item"/>');return o.append(n.template?n.template(e):e+""),o.data({index:t,item:e}),o}))}},{key:"handleKeydown",value:function(t){this.$popover.is(":visible")&&(t.keyCode===Ct.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===Ct.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===Ct.code.DOWN&&(t.preventDefault(),this.moveDown()))}},{key:"searchKeyword",value:function(t,e,n){var o=this.hints[t];if(o&&o.match.test(e)&&o.search){var i=o.match.exec(e);this.matchingWord=i[0],o.search(i[1],n)}else n()}},{key:"createGroup",value:function(t,e){var n=this,o=i()('<div class="note-hint-group note-hint-group-'+t+'"/>');return this.searchKeyword(t,e,(function(e){(e=e||[]).length&&(o.html(n.createItemTemplates(t,e)),n.show())})),o}},{key:"handleKeyup",value:function(t){var e=this;if(!x.contains([Ct.code.ENTER,Ct.code.UP,Ct.code.DOWN],t.keyCode)){var n,o,r=this.context.invoke("editor.getLastRange");if("words"===this.options.hintMode){if(n=r.getWordsRange(r),o=n.toString(),this.hints.forEach((function(t){if(t.match.test(o))return n=r.getWordsMatchRange(t.match),!1})),!n)return void this.hide();o=n.toString()}else n=r.getWordRange(),o=n.toString();if(this.hints.length&&o){this.$content.empty();var a=b.rect2bnd(x.last(n.getClientRects())),s=i()(this.options.container).offset();a&&(a.top-=s.top,a.left-=s.left,this.$popover.hide(),this.lastWordRange=n,this.hints.forEach((function(t,n){t.match.test(o)&&e.createGroup(n,o).appendTo(e.$content)})),this.$content.find(".note-hint-item:first").addClass("active"),"top"===this.direction?this.$popover.css({left:a.left,top:a.top-this.$popover.outerHeight()-5}):this.$popover.css({left:a.left,top:a.top+a.height+5}))}else this.hide()}}},{key:"show",value:function(){this.$popover.show()}},{key:"hide",value:function(){this.$popover.hide()}}])&&Se(e.prototype,n),o&&Se(e,o),t}();i.a.summernote=i.a.extend(i.a.summernote,{version:"0.8.16",plugins:{},dom:ft,range:kt,lists:x,options:{langInfo:i.a.summernote.lang["en-US"],editing:!0,modules:{editor:Dt,clipboard:zt,dropzone:Ot,codeview:jt,statusbar:Kt,fullscreen:Vt,handle:Gt,hintPopover:Te,autoLink:Xt,autoSync:Jt,autoReplace:ee,placeholder:oe,buttons:re,toolbar:se,linkDialog:ce,linkPopover:de,imageDialog:fe,imagePopover:me,tablePopover:ge,videoDialog:ye,helpDialog:we,airPopover:xe},buttons:{},lang:"en-US",followingToolbar:!1,toolbarPosition:"top",otherStaticBar:"",toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popatmouse:!0,popover:{image:[["resize",["resizeFull","resizeHalf","resizeQuarter","resizeNone"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]],["view",["fullscreen","codeview"]]]},airMode:!1,overrideContextMenu:!1,width:null,height:null,linkTargetBlank:!0,useProtocol:!0,defaultProtocol:"http://",focus:!1,tabDisabled:!1,tabSize:4,styleWithCSS:!1,shortcuts:!0,textareaAutoSync:!0,tooltip:"auto",container:null,maxTextLength:0,blockquoteBreakingLevel:2,spellCheck:!0,disableGrammar:!1,placeholder:null,inheritPlaceholder:!1,recordEveryKeystroke:!1,historyLimit:200,hintMode:"word",hintSelect:"after",hintDirection:"bottom",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],addDefaultFonts:!0,fontSizes:["8","9","10","11","12","14","18","24","36"],fontSizeUnits:["px","pt"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],colorsName:[["Black","Tundora","Dove Gray","Star Dust","Pale Slate","Gallery","Alabaster","White"],["Red","Orange Peel","Yellow","Green","Cyan","Blue","Electric Violet","Magenta"],["Azalea","Karry","Egg White","Zanah","Botticelli","Tropical Blue","Mischka","Twilight"],["Tonys Pink","Peach Orange","Cream Brulee","Sprout","Casper","Perano","Cold Purple","Careys Pink"],["Mandy","Rajah","Dandelion","Olivine","Gulf Stream","Viking","Blue Marguerite","Puce"],["Guardsman Red","Fire Bush","Golden Dream","Chelsea Cucumber","Smalt Blue","Boston Blue","Butterfly Bush","Cadillac"],["Sangria","Mai Tai","Buddha Gold","Forest Green","Eden","Venice Blue","Meteorite","Claret"],["Rosewood","Cinnamon","Olive","Parsley","Tiber","Midnight Blue","Valentino","Loulou"]],colorButton:{foreColor:"#000000",backColor:"#FFFF00"},lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onBeforeCommand:null,onBlur:null,onBlurCodeview:null,onChange:null,onChangeCodeview:null,onDialogShown:null,onEnter:null,onFocus:null,onImageLinkInsert:null,onImageUpload:null,onImageUploadError:null,onInit:null,onKeydown:null,onKeyup:null,onMousedown:null,onMouseup:null,onPaste:null,onScroll:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},codeviewFilter:!1,codeviewFilterRegex:/<\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,codeviewIframeFilter:!0,codeviewIframeWhitelistSrc:[],codeviewIframeWhitelistSrcBase:["www.youtube.com","www.youtube-nocookie.com","www.facebook.com","vine.co","instagram.com","player.vimeo.com","www.dailymotion.com","player.youku.com","v.qq.com"],keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",floatLeft:"note-icon-float-left",floatRight:"note-icon-float-right",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",rollback:"note-icon-rollback",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})},4:function(t,e,n){},52:function(t,e,n){"use strict";n.r(e);var o=n(0),i=n.n(o),r=n(1);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=r.a.create('<div class="note-editor note-frame panel panel-default"/>'),l=r.a.create('<div class="note-toolbar panel-heading" role="toolbar"></div></div>'),c=r.a.create('<div class="note-editing-area"/>'),u=r.a.create('<textarea class="note-codable" aria-multiline="true"/>'),d=r.a.create('<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>'),h=r.a.create(['<output class="note-status-output" role="status" aria-live="polite"/>','<div class="note-statusbar" role="status">','<div class="note-resizebar" aria-label="Resize">','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>','<div class="note-icon-bar"/>',"</div>","</div>"].join("")),f=r.a.create('<div class="note-editor note-airframe"/>'),p=r.a.create(['<div class="note-editable" contentEditable="true" role="textbox" aria-multiline="true"/>','<output class="note-status-output" role="status" aria-live="polite"/>'].join("")),m=r.a.create('<div class="note-btn-group btn-group">'),v=r.a.create('<ul class="note-dropdown-menu dropdown-menu">',(function(t,e){var n=Array.isArray(e.items)?e.items.map((function(t){var n="string"==typeof t?t:t.value||"",o=e.template?e.template(t):t,i="object"===a(t)?t.option:void 0;return'<li aria-label="'+n+'"><a href="#" '+('data-value="'+n+'"'+(void 0!==i?' data-option="'+i+'"':""))+">"+o+"</a></li>"})).join(""):e.items;t.html(n).attr({"aria-label":e.title})})),g=function(t,e){return t+" "+C(e.icons.caret,"span")},b=r.a.create('<ul class="note-dropdown-menu dropdown-menu note-check">',(function(t,e){var n=Array.isArray(e.items)?e.items.map((function(t){var n="string"==typeof t?t:t.value||"",o=e.template?e.template(t):t;return'<li aria-label="'+t+'"><a href="#" data-value="'+n+'">'+C(e.checkClassName)+" "+o+"</a></li>"})).join(""):e.items;t.html(n).attr({"aria-label":e.title})})),y=r.a.create('<div class="modal note-modal" aria-hidden="false" tabindex="-1" role="dialog"/>',(function(t,e){e.fade&&t.addClass("fade"),t.attr({"aria-label":e.title}),t.html(['<div class="modal-dialog">','<div class="modal-content">',e.title?'<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close" aria-hidden="true">×</button><h4 class="modal-title">'+e.title+"</h4></div>":"",'<div class="modal-body">'+e.body+"</div>",e.footer?'<div class="modal-footer">'+e.footer+"</div>":"","</div>","</div>"].join(""))})),k=r.a.create(['<div class="note-popover popover in">','<div class="arrow"/>','<div class="popover-content note-children-container"/>',"</div>"].join(""),(function(t,e){var n=void 0!==e.direction?e.direction:"bottom";t.addClass(n),e.hideArrow&&t.find(".arrow").hide()})),w=r.a.create('<div class="checkbox"></div>',(function(t,e){t.html(["<label"+(e.id?' for="note-'+e.id+'"':"")+">",'<input type="checkbox"'+(e.id?' id="note-'+e.id+'"':""),e.checked?" checked":"",' aria-checked="'+(e.checked?"true":"false")+'"/>',e.text?e.text:"","</label>"].join(""))})),C=function(t,e){return"<"+(e=e||"i")+' class="'+t+'"/>'},x=function(t){return{editor:s,toolbar:l,editingArea:c,codable:u,editable:d,statusbar:h,airEditor:f,airEditable:p,buttonGroup:m,dropdown:v,dropdownButtonContents:g,dropdownCheck:b,dialog:y,popover:k,checkbox:w,icon:C,options:t,palette:function(e,n){return r.a.create('<div class="note-color-palette"/>',(function(e,n){for(var o=[],i=0,r=n.colors.length;i<r;i++){for(var a=n.eventName,s=n.colors[i],l=n.colorsName[i],c=[],u=0,d=s.length;u<d;u++){var h=s[u],f=l[u];c.push(['<button type="button" class="note-color-btn"','style="background-color:',h,'" ','data-event="',a,'" ','data-value="',h,'" ','title="',f,'" ','aria-label="',f,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}o.push('<div class="note-color-row">'+c.join("")+"</div>")}e.html(o.join("")),n.tooltip&&e.find(".note-color-btn").tooltip({container:n.container||t.container,trigger:"hover",placement:"bottom"})}))(e,n)},button:function(e,n){return r.a.create('<button type="button" class="note-btn btn btn-default btn-sm" tabindex="-1">',(function(e,n){n&&n.tooltip&&e.attr({title:n.tooltip,"aria-label":n.tooltip}).tooltip({container:n.container||t.container,trigger:"hover",placement:"bottom"}).on("click",(function(t){i()(t.currentTarget).tooltip("hide")}))}))(e,n)},toggleBtn:function(t,e){t.toggleClass("disabled",!e),t.attr("disabled",!e)},toggleBtnActive:function(t,e){t.toggleClass("active",e)},onDialogShown:function(t,e){t.one("shown.bs.modal",e)},onDialogHidden:function(t,e){t.one("hidden.bs.modal",e)},showDialog:function(t){t.modal("show")},hideDialog:function(t){t.modal("hide")},createLayout:function(e){var n=(t.airMode?f([c([u(),p()])]):"bottom"===t.toolbarPosition?s([c([u(),d()]),l(),h()]):s([l(),c([u(),d()]),h()])).render();return n.insertAfter(e),{note:e,editor:n,toolbar:n.find(".note-toolbar"),editingArea:n.find(".note-editing-area"),editable:n.find(".note-editable"),codable:n.find(".note-codable"),statusbar:n.find(".note-statusbar")}},removeLayout:function(t,e){t.html(e.editable.html()),e.editor.remove(),t.show()}}};n(3),n(4);i.a.summernote=i.a.extend(i.a.summernote,{ui_template:x,interface:"bs3"})}})}));
File: public/AdminLTE/plugins/summernote/summernote.min.js.map
Match lines: 1
1|{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///external {\"root\":\"jQuery\",\"commonjs2\":\"jquery\",\"commonjs\":\"jquery\",\"amd\":\"jquery\"}","webpack:///./src/js/base/renderer.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./src/js/base/summernote-en-US.js","webpack:///./src/js/base/core/env.js","webpack:///./src/js/base/core/func.js","webpack:///./src/js/base/core/lists.js","webpack:///./src/js/base/core/dom.js","webpack:///./src/js/base/Context.js","webpack:///./src/js/base/core/range.js","webpack:///./src/js/summernote.js","webpack:///./src/js/base/core/key.js","webpack:///./src/js/base/editing/History.js","webpack:///./src/js/base/editing/Style.js","webpack:///./src/js/base/editing/Bullet.js","webpack:///./src/js/base/editing/Typing.js","webpack:///./src/js/base/editing/Table.js","webpack:///./src/js/base/module/Editor.js","webpack:///./src/js/base/core/async.js","webpack:///./src/js/base/module/Clipboard.js","webpack:///./src/js/base/module/Codeview.js","webpack:///./src/js/base/module/Dropzone.js","webpack:///./src/js/base/module/Statusbar.js","webpack:///./src/js/base/module/Fullscreen.js","webpack:///./src/js/base/module/Handle.js","webpack:///./src/js/base/module/AutoLink.js","webpack:///./src/js/base/module/AutoSync.js","webpack:///./src/js/base/module/AutoReplace.js","webpack:///./src/js/base/module/Placeholder.js","webpack:///./src/js/base/module/Buttons.js","webpack:///./src/js/base/module/Toolbar.js","webpack:///./src/js/base/module/LinkDialog.js","webpack:///./src/js/base/module/LinkPopover.js","webpack:///./src/js/base/module/ImageDialog.js","webpack:///./src/js/base/module/ImagePopover.js","webpack:///./src/js/base/module/TablePopover.js","webpack:///./src/js/base/module/VideoDialog.js","webpack:///./src/js/base/module/HelpDialog.js","webpack:///./src/js/base/module/AirPopover.js","webpack:///./src/js/base/module/HintPopover.js","webpack:///./src/js/base/settings.js","webpack:///./src/js/bs3/ui.js","webpack:///./src/js/bs3/settings.js"],"names":["root","factory","exports","module","require","define","amd","a","i","window","__WEBPACK_EXTERNAL_MODULE__0__","installedModules","__webpack_require__","moduleId","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Renderer","markup","children","options","callback","this","$parent","$node","$","contents","html","className","addClass","data","each","k","v","attr","click","on","$container","find","forEach","child","render","length","append","arguments","Array","isArray","__webpack_amd_options__","summernote","lang","extend","font","bold","italic","underline","clear","height","strikethrough","subscript","superscript","size","sizeunit","image","insert","resizeFull","resizeHalf","resizeQuarter","resizeNone","floatLeft","floatRight","floatNone","shapeRounded","shapeCircle","shapeThumbnail","shapeNone","dragImageHere","dropImage","selectFromFiles","maximumFileSize","maximumFileSizeError","url","remove","original","video","videoLink","providers","link","unlink","edit","textToDisplay","openInNewWindow","useProtocol","table","addRowAbove","addRowBelow","addColLeft","addColRight","delRow","delCol","delTable","hr","style","blockquote","pre","h1","h2","h3","h4","h5","h6","lists","unordered","ordered","help","fullscreen","codeview","paragraph","outdent","indent","left","center","right","justify","color","recent","more","background","foreground","transparent","setTransparent","reset","resetToDefault","cpSelect","shortcut","shortcuts","close","textFormatting","action","paragraphFormatting","documentStyle","extraKeys","history","undo","redo","specialChar","select","output","noSelection","isSupportAmd","genericFontFamilies","validFontName","fontName","inArray","toLowerCase","browserVersion","userAgent","navigator","isMSIE","test","matches","exec","parseFloat","isEdge","hasCodeMirror","CodeMirror","isSupportTouch","MaxTouchPoints","msMaxTouchPoints","inputEventName","isMac","appVersion","indexOf","isFF","isPhantom","isWebkit","isChrome","isSafari","jqueryVersion","fn","jquery","isFontInstalled","testFontName","context","document","createElement","getContext","testSize","originalWidth","measureText","width","isW3CRangeSupport","createRange","idCounter","eq","itemA","itemB","eq2","peq2","propName","ok","fail","self","not","f","apply","and","fA","fB","item","invoke","obj","method","resetUniqueId","uniqueId","prefix","id","rect2bnd","rect","$document","top","scrollTop","scrollLeft","bottom","invertObject","inverted","namespaceToCamel","namespace","split","map","substring","toUpperCase","join","debounce","func","wait","immediate","timeout","args","later","callNow","clearTimeout","setTimeout","isValidUrl","head","array","last","tail","slice","contains","initial","prev","idx","next","pred","len","all","sum","reduce","memo","from","collection","result","isEmpty","clusterBy","aLast","compact","aResult","push","unique","results","NBSP_CHAR","String","fromCharCode","isEditable","node","hasClass","makePredByNodeName","nodeName","isText","nodeType","isVoid","isPara","isPre","isLi","isTable","isData","isInline","isBodyContainer","isList","isHr","isBlockquote","isCell","isAnchor","isBody","blankHTML","env","nodeLength","nodeValue","childNodes","innerHTML","paddingBlankHTML","ancestor","parentNode","listAncestor","ancestors","el","listNext","nodes","nextSibling","insertAfter","preceding","parent","insertBefore","appendChild","appendChildNodes","aChild","isLeftEdgePoint","point","offset","isRightEdgePoint","isEdgePoint","isLeftEdgeOf","position","isRightEdgeOf","previousSibling","hasChildren","prevPoint","isSkipInnerOffset","nextPoint","isSamePoint","pointA","pointB","splitNode","isSkipPaddingBlankHTML","isNotSplitEdgePoint","isDiscardEmptySplits","splitText","childNode","clone","cloneNode","splitTree","isRemoveChild","removeNode","removeChild","isTextarea","stripLinebreaks","val","replace","ZERO_WIDTH_NBSP_CHAR","blank","emptyPara","isControlSizing","isElement","isPurePara","isHeading","isBlock","isBodyInline","isParaInline","isDiv","isBR","isSpan","isB","isU","isS","isI","isImg","deepestChildIsEmpty","firstElementChild","isEmptyAnchor","isClosestSibling","nodeA","nodeB","withClosestSiblings","siblings","isLeftEdgePointOf","isRightEdgePointOf","isVisiblePoint","leftNode","rightNode","prevPointUntil","nextPointUntil","isCharPoint","ch","charAt","isSpacePoint","walkPoint","startPoint","endPoint","handler","singleChildAncestor","lastAncestor","filter","listPrev","listDescendant","descendants","fnWalk","current","commonAncestor","wrap","wrapperName","wrapper","makeOffsetPath","reverse","fromOffsetPath","offsets","splitPoint","splitRoot","container","topAncestor","pivot","createText","text","createTextNode","removeWhile","newNode","cssText","isNewlineOnBlock","match","endSlash","isEndOfInlineContainer","isBlockNode","trim","posFromPlaceholder","placeholder","$placeholder","pos","outerHeight","attachEvents","events","keys","detachEvents","off","isCustomStyleTag","classList","Context","$note","memos","layoutInfo","ui","ui_template","initialize","createLayout","_initialize","hide","_destroy","removeData","removeLayout","disabled","isDisabled","code","dom","disable","now","editor","buttons","plugins","initializeModule","removeModule","removeMemo","triggerEvent","isActivated","undefined","codable","editable","editing","callbacks","trigger","shouldInitialize","ModuleClass","withoutIntialize","destroy","event","createInvokeHandler","preventDefault","$target","target","closest","splits","hasSeparator","moduleName","methodName","textRangeToPoint","textRange","isStart","prevContainer","parentElement","tester","body","createTextRange","moveToElementText","compareEndPoints","textRangeStart","curTextNode","collapse","firstChild","pointTester","duplicate","setEndPoint","textCount","cont","pointToTextRange","info","textRangeInfo","isCollapseToStart","prevTextNodes","collapseToStart","moveStart","type","isExternalAPICalled","hasInitOptions","langInfo","icons","tooltip","note","first","focus","WrappedRange","sc","so","ec","eo","isOnEditable","makeIsOn","isOnList","isOnAnchor","isOnCell","isOnData","w3cRange","setStart","setEnd","Math","min","nativeRng","nativeRange","selection","getSelection","rangeCount","removeAllRanges","addRange","offsetTop","abs","getVisiblePoint","isLeftToRight","block","hasRightNode","hasLeftNode","getEndPoint","isCollapsed","getStartPoint","includeAncestor","fullyContains","leftEdgeNodes","startAncestor","endAncestor","boundaryPoints","getPoints","isSameContainer","rng","emptyParents","normalize","inlineSiblings","concat","para","wrapBodyInlineWithPara","deleteContents","contentsContainer","insertNode","toString","findAfter","isNotTextPoint","regex","index","path","e","paras","getClientRects","wrappedRange","createFromSelection","bodyElement","lastChild","createFromBodyElement","createFromNode","anchorNode","getRangeAt","startContainer","startOffset","endContainer","endOffset","textRangeEnd","isTextNode","createFromNodeBefore","createFromNodeAfter","createFromBookmark","bookmark","createFromParaBookmark","KEY_MAP","isEdit","keyCode","BACKSPACE","TAB","ENTER","SPACE","DELETE","isMove","LEFT","UP","RIGHT","DOWN","isNavigation","HOME","END","PAGEUP","PAGEDOWN","nameFromCode","History","stack","stackOffset","$editable","range","snapshot","recordUndo","applySnapshot","makeSnapshot","historyLimit","shift","Style","$obj","propertyNames","propertyName","css","styleInfo","jQueryCSS","fontSize","parseInt","expandClosestSibling","onlyPartialContains","nodesInRange","tails","elem","$cont","fromNode","queryCommandState","queryCommandValue","isUnordered","lineHeight","toFixed","anchor","Bullet","toggleList","clustereds","previousList","findList","wrapList","appendToPrevious","releaseList","listName","paraBookmark","wrappedParas","diffLists","listNode","prevList","nextList","isEscapseToBody","releasedParas","headList","parentItem","newList","findNextSiblings","lastList","middleList","rootLists","rootList","listNodes","Typing","bullet","tabsize","tab","nextPara","blockquoteBreakingLevel","emptyAnchors","scrollIntoView","TableResultAction","where","domTable","_startPoint","_virtualTable","_actionCellList","setVirtualTablePosition","rowIndex","cellIndex","baseRow","baseCell","isRowSpan","isColSpan","isVirtualCell","objPosition","getActionCell","virtualTableCellObj","resultAction","virtualRowPosition","virtualColPosition","recoverCellIndex","newCellIndex","addCellInfoToVirtual","row","cell","cellHasColspan","colSpan","cellHasRowspan","rowSpan","isThisSelectedCell","rowPos","colPos","rowspanNumber","attributes","rp","rowspanIndex","adjustStartPoint","colspanNumber","cp","cellspanIndex","isSelectedCell","getDeleteResultActionToCell","Column","SubtractSpanCount","Row","isVirtual","AddCell","RemoveCell","getAddResultActionToCell","SumSpanCount","Ignore","getActionList","fixedRow","fixedCol","actualPosition","canContinue","rowPosition","colPosition","requestAction","Add","Delete","tagName","rows","cells","createVirtualTable","Table","isShift","nextCell","currentTr","trAttributes","recoverAttributes","actions","idCell","currentCell","tdAttributes","newTd","removeAttr","setAttribute","before","lastTrIndex","after","actionIndex","resultStr","attrList","specified","cellPos","virtualPosition","virtualTable","hasRowspan","nextRow","cloneRow","removeAttribute","colCount","rowCount","tdHTML","tds","idxCol","trHTML","trs","idxRow","$table","tableClassName","Editor","$editor","lastRange","typing","untab","insertParagraph","insertOrderedList","insertUnorderedList","formatPara","insertHorizontalRule","commands","sCmd","beforeCommand","execCommand","afterCommand","wrapCommand","fontStyling","unit","currentStyle","fontSizeUnit","formatBlock","isLimited","getLastRange","setLastRange","insertText","textNode","pasteHTML","onApplyCustomStyle","onFormatBlock","hrNode","stylePara","createLink","linkInfo","linkUrl","linkText","isNewWindow","checkProtocol","additionalTextLength","isTextChanged","onCreateLink","defaultProtocol","anchors","styleNodes","colorInfo","foreColor","backColor","insertTable","dim","dimension","createTable","removeMedia","restoreTarget","detach","floatMe","toggleClass","resize","hasKeyShortCut","isDefaultPrevented","handleKeyMap","preventDefaultEditableShortCuts","recordEveryKeystroke","spellCheck","disableGrammar","airMode","overrideContextMenu","outerWidth","maxHeight","minHeight","keyMap","metaKey","ctrlKey","altKey","shiftKey","keyName","eventName","tabDisable","pad","maxTextLength","thenCollapse","commit","styleWithCSS","isPreventTrigger","normalizeContent","tabSize","insertTab","src","param","Deferred","deferred","$img","one","resolve","reject","display","appendTo","promise","then","$image","show","files","file","filename","maximumImageFileSize","FileReader","onload","dataURL","onerror","err","readAsDataURL","readFileAsDataURL","insertImage","onImageUpload","insertImagesAsDataURL","currentRange","spans","firstSpan","noteStatusOutput","expand","$anchor","addRow","addCol","deleteRow","deleteCol","deleteTable","bKeepRatio","imageSize","newRatio","y","x","ratio","is","hasFocus","Clipboard","pasteByEvent","clipboardData","originalEvent","items","kind","getAsFile","getData","Dropzone","$eventListener","documentEventHandlers","$dropzone","prependTo","disableDragAndDrop","onDrop","attachDragAndDropEvent","$dropzoneMessage","onDragenter","isCodeview","hasEditorSize","add","onDragleave","removeClass","dataTransfer","types","content","substr","CodeView","$codable","save","deactivate","activate","codeviewFilter","codeviewFilterRegex","codeviewIframeFilter","whitelist","codeviewIframeWhitelistSrc","codeviewIframeWhitelistSrcBase","tag","RegExp","prettifyHtml","cmEditor","fromTextArea","codemirror","tern","server","TernServer","ternServer","cm","updateArgHints","getValue","setSize","toTextArea","purify","isChange","Statusbar","$statusbar","statusbar","disableResizeEditor","stopPropagation","editableTop","onMouseMove","clientY","minheight","max","Fullscreen","$toolbar","toolbar","$window","$scrollbar","onResize","resizeTo","h","setsize","isFullscreen","Handle","$editingArea","editingArea","we","update","$handle","disableResizeImage","posStart","clientX","isImage","$selection","w","origImageObj","Image","sizingText","linkPattern","AutoLink","handleKeyup","handleKeydown","lastWordRange","keyword","urlText","linkTargetBlank","wordRange","getWordRange","AutoSync","AutoReplace","PERIOD","COMMA","SEMICOLON","SLASH","previousKeydownCode","lastWord","jQuery","Node","Placeholder","inheritPlaceholder","isShow","toggle","Buttons","invertedKeyMap","editorMethod","button","addToolbarButtons","addImagePopoverButtons","addLinkPopoverButtons","addTablePopoverButtons","fontInstalledMap","fontNamesIgnoreCheck","buttonGroup","icon","$button","currentTarget","$recentColor","colorButton","dropdownButtonContents","dropdown","$dropdown","$holder","palette","colors","colorsName","customColors","change","$chip","$picker","$palette","prepend","$color","$currentButton","magic","styleTags","title","template","styleIdx","styleLen","representShortcut","createInvokeHandlerAndUpdateState","eraser","addDefaultFonts","fontname","isFontDeservedToAdd","fontNames","dropdownCheck","checkClassName","menuCheck","fontSizes","fontSizeUnits","colorPalette","unorderedlist","orderedlist","justifyLeft","alignLeft","justifyCenter","alignCenter","justifyRight","alignRight","justifyFull","alignJustify","textHeight","lineHeights","insertTableMaxSize","col","mousedown","tableMoveHandler","picture","minus","arrowsAlt","question","rollback","trash","rowAbove","rowBelow","colBefore","colAfter","rowRemove","colRemove","groups","groupIdx","groupLen","group","groupName","$group","btn","updateBtnStates","$item","isChecked","infos","selector","toggleBtnActive","posOffset","$dimensionDisplay","$catcher","$highlighted","$unhighlighted","offsetX","posCatcher","pageX","pageY","offsetY","ceil","Toolbar","isFollowing","followScroll","toolbarContainer","changeContainer","followingToolbar","editorHeight","editorWidth","toolbarHeight","statusbarHeight","otherBarHeight","otherStaticBar","currentOffset","editorOffsetTop","activateOffset","deactivateOffsetBottom","marginTop","zIndex","isIncludeCodeview","$btn","toggleBtn","LinkDialog","$body","dialogsInBody","disableLinkTarget","checkbox","checked","footer","$dialog","dialog","fade","dialogsFade","hideDialog","$input","$linkBtn","$linkText","$linkUrl","$openInNewWindow","$useProtocol","onDialogShown","toggleLinkBtn","bindEnterKey","isNewWindowChecked","prop","useProtocolChecked","onDialogHidden","state","showDialog","showLinkDialog","LinkPopover","popover","$popover","$content","href","containerOffset","ImageDialog","imageLimitation","floor","log","readableSize","pow","showImageDialog","onImageLinkInsert","$imageInput","$imageUrl","$imageBtn","replaceWith","ImagePopover","popatmouse","TablePopover","VideoDialog","$video","ytMatch","igMatch","vMatch","vimMatch","dmMatch","youkuMatch","qqMatch","qqMatch2","mp4Match","oggMatch","webmMatch","fbMatch","youtubeId","start","ytMatchForStart","vid","encodeURIComponent","showVideoDialog","createVideoNode","$videoUrl","$videoBtn","HelpDialog","createShortcutList","command","$row","showHelpDialog","AirPopover","hidable","onContextmenu","air","forcelyOpen","HintPopover","hint","direction","hintDirection","hints","matchingWord","hideArrow","innerHeight","$current","$next","selectItem","$nextGroup","$prev","$prevGroup","nodeFromItem","rangeCompute","hintSelect","hintIdx","moveUp","moveDown","search","searchKeyword","createItemTemplates","hintMode","getWordsRange","getWordsMatchRange","empty","bnd","createGroup","version","Codeview","toolbarPosition","tabDisabled","textareaAutoSync","onBeforeCommand","onBlur","onBlurCodeview","onChange","onChangeCodeview","onEnter","onFocus","onImageUploadError","onInit","onKeydown","onKeyup","onMousedown","onMouseup","onPaste","onScroll","htmlMode","lineNumbers","pc","mac","renderer","airEditor","airEditable","option","caret","iconClassName","editorOptions","rowSize","colSize","colorName","placement","isEnable","isActive","modal","interface"],"mappings":";CAAA,SAA2CA,EAAMC,GAChD,GAAsB,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,gBAC7B,GAAqB,mBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,CAAC,UAAWJ,OACf,CACJ,IAAIM,EAAuB,iBAAZL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mBre,IAGjCsxB,WAAY,SAASnB,GACnBA,EAAQ6I,MAAM,SAGhBzI,WAAY,SAASJ,GACnBA,EAAQ6I,MAAM,SAGhB31B,aAAc,SAASN,GACrB,IAAM6V,GAAW6f,EAAc/b,QAAU0b,EAAU,CACjDxS,EAAY,CACVlhB,IACA2zB,QAEoC,WAAlCI,EAAc5B,gBAChB5yB,EAAO,CACP2hB,EAAY,CACVlhB,IACAC,MAEFugB,IACAV,MAEAvgB,EAAO,CACPihB,IACAU,EAAY,CACVlhB,IACAC,MAEF6f,OAEDn6B,SAIH,OAFAuuB,EAAQ3d,YAAY8H,GAEb,CACL8E,KAAM9E,EACNkB,OAAQ2U,EACRsM,QAAStM,EAAQ1uB,KAAK,iBACtB07B,YAAahN,EAAQ1uB,KAAK,sBAC1Bya,SAAUiU,EAAQ1uB,KAAK,kBACvBwa,QAASkU,EAAQ1uB,KAAK,iBACtBs6B,UAAW5L,EAAQ1uB,KAAK,qBAI5BwZ,aAAc,SAASX,EAAOE,GAC5BF,EAAMxZ,KAAK0Z,EAAW0B,SAASpb,QAC/B0Z,EAAWgB,OAAOpX,SAClBkW,EAAM8b,U,UC9OZx1B,IAAEuB,WAAavB,IAAEyB,OAAOzB,IAAEuB,WAAY,CACpCuY,YAAaD,EACb+1B,UAAW","file":"summernote.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"jquery\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"jquery\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"jquery\")) : factory(root[\"jQuery\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 52);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","import $ from 'jquery';\n\nclass Renderer {\n constructor(markup, children, options, callback) {\n this.markup = markup;\n this.children = children;\n this.options = options;\n this.callback = callback;\n }\n\n render($parent) {\n const $node = $(this.markup);\n\n if (this.options && this.options.contents) {\n $node.html(this.options.contents);\n }\n\n if (this.options && this.options.className) {\n $node.addClass(this.options.className);\n }\n\n if (this.options && this.options.data) {\n $.each(this.options.data, (k, v) => {\n $node.attr('data-' + k, v);\n });\n }\n\n if (this.options && this.options.click) {\n $node.on('click', this.options.click);\n }\n\n if (this.children) {\n const $container = $node.find('.note-children-container');\n this.children.forEach((child) => {\n child.render($container.length ? $container : $node);\n });\n }\n\n if (this.callback) {\n this.callback($node, this.options);\n }\n\n if (this.options && this.options.callback) {\n this.options.callback($node);\n }\n\n if ($parent) {\n $parent.append($node);\n }\n\n return $node;\n }\n}\n\nexport default {\n create: (markup, callback) => {\n return function() {\n const options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n let children = Array.isArray(arguments[0]) ? arguments[0] : [];\n if (options && options.children) {\n children = options.children;\n }\n return new Renderer(markup, children, options, callback);\n };\n },\n};\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","import $ from 'jquery';\n\n$.summernote = $.summernote || {\n lang: {},\n};\n\n$.extend($.summernote.lang, {\n 'en-US': {\n font: {\n bold: 'Bold',\n italic: 'Italic',\n underline: 'Underline',\n clear: 'Remove Font Style',\n height: 'Line Height',\n name: 'Font Family',\n strikethrough: 'Strikethrough',\n subscript: 'Subscript',\n superscript: 'Superscript',\n size: 'Font Size',\n sizeunit: 'Font Size Unit',\n },\n image: {\n image: 'Picture',\n insert: 'Insert Image',\n resizeFull: 'Resize full',\n resizeHalf: 'Resize half',\n resizeQuarter: 'Resize quarter',\n resizeNone: 'Original size',\n floatLeft: 'Float Left',\n floatRight: 'Float Right',\n floatNone: 'Remove float',\n shapeRounded: 'Shape: Rounded',\n shapeCircle: 'Shape: Circle',\n shapeThumbnail: 'Shape: Thumbnail',\n shapeNone: 'Shape: None',\n dragImageHere: 'Drag image or text here',\n dropImage: 'Drop image or Text',\n selectFromFiles: 'Select from files',\n maximumFileSize: 'Maximum file size',\n maximumFileSizeError: 'Maximum file size exceeded.',\n url: 'Image URL',\n remove: 'Remove Image',\n original: 'Original',\n },\n video: {\n video: 'Video',\n videoLink: 'Video Link',\n insert: 'Insert Video',\n url: 'Video URL',\n providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)',\n },\n link: {\n link: 'Link',\n insert: 'Insert Link',\n unlink: 'Unlink',\n edit: 'Edit',\n textToDisplay: 'Text to display',\n url: 'To what URL should this link go?',\n openInNewWindow: 'Open in new window',\n useProtocol: 'Use default protocol',\n },\n table: {\n table: 'Table',\n addRowAbove: 'Add row above',\n addRowBelow: 'Add row below',\n addColLeft: 'Add column left',\n addColRight: 'Add column right',\n delRow: 'Delete row',\n delCol: 'Delete column',\n delTable: 'Delete table',\n },\n hr: {\n insert: 'Insert Horizontal Rule',\n },\n style: {\n style: 'Style',\n p: 'Normal',\n blockquote: 'Quote',\n pre: 'Code',\n h1: 'Header 1',\n h2: 'Header 2',\n h3: 'Header 3',\n h4: 'Header 4',\n h5: 'Header 5',\n h6: 'Header 6',\n },\n lists: {\n unordered: 'Unordered list',\n ordered: 'Ordered list',\n },\n options: {\n help: 'Help',\n fullscreen: 'Full Screen',\n codeview: 'Code View',\n },\n paragraph: {\n paragraph: 'Paragraph',\n outdent: 'Outdent',\n indent: 'Indent',\n left: 'Align left',\n center: 'Align center',\n right: 'Align right',\n justify: 'Justify full',\n },\n color: {\n recent: 'Recent Color',\n more: 'More Color',\n background: 'Background Color',\n foreground: 'Text Color',\n transparent: 'Transparent',\n setTransparent: 'Set transparent',\n reset: 'Reset',\n resetToDefault: 'Reset to default',\n cpSelect: 'Select',\n },\n shortcut: {\n shortcuts: 'Keyboard shortcuts',\n close: 'Close',\n textFormatting: 'Text formatting',\n action: 'Action',\n paragraphFormatting: 'Paragraph formatting',\n documentStyle: 'Document Style',\n extraKeys: 'Extra keys',\n },\n help: {\n 'insertParagraph': 'Insert Paragraph',\n 'undo': 'Undoes the last command',\n 'redo': 'Redoes the last command',\n 'tab': 'Tab',\n 'untab': 'Untab',\n 'bold': 'Set a bold style',\n 'italic': 'Set a italic style',\n 'underline': 'Set a underline style',\n 'strikethrough': 'Set a strikethrough style',\n 'removeFormat': 'Clean a style',\n 'justifyLeft': 'Set left align',\n 'justifyCenter': 'Set center align',\n 'justifyRight': 'Set right align',\n 'justifyFull': 'Set full align',\n 'insertUnorderedList': 'Toggle unordered list',\n 'insertOrderedList': 'Toggle ordered list',\n 'outdent': 'Outdent on current paragraph',\n 'indent': 'Indent on current paragraph',\n 'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n 'formatH1': 'Change current block\\'s format as H1',\n 'formatH2': 'Change current block\\'s format as H2',\n 'formatH3': 'Change current block\\'s format as H3',\n 'formatH4': 'Change current block\\'s format as H4',\n 'formatH5': 'Change current block\\'s format as H5',\n 'formatH6': 'Change current block\\'s format as H6',\n 'insertHorizontalRule': 'Insert horizontal rule',\n 'linkDialog.show': 'Show Link Dialog',\n },\n history: {\n undo: 'Undo',\n redo: 'Redo',\n },\n specialChar: {\n specialChar: 'SPECIAL CHARACTERS',\n select: 'Select Special characters',\n },\n output: {\n noSelection: 'No Selection Made!',\n },\n },\n});\n","import $ from 'jquery';\nconst isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n\n/**\n * returns whether font is installed or not.\n *\n * @param {String} fontName\n * @return {Boolean}\n */\nconst genericFontFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n\nfunction validFontName(fontName) {\n return ($.inArray(fontName.toLowerCase(), genericFontFamilies) === -1) ? `'${fontName}'` : fontName;\n}\n\nfunction isFontInstalled(fontName) {\n const testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n const testText = 'mmmmmmmmmmwwwww';\n const testSize = '200px';\n\n var canvas = document.createElement('canvas');\n var context = canvas.getContext('2d');\n\n context.font = testSize + \" '\" + testFontName + \"'\";\n const originalWidth = context.measureText(testText).width;\n\n context.font = testSize + ' ' + validFontName(fontName) + ', \"' + testFontName + '\"';\n const width = context.measureText(testText).width;\n\n return originalWidth !== width;\n}\n\nconst userAgent = navigator.userAgent;\nconst isMSIE = /MSIE|Trident/i.test(userAgent);\nlet browserVersion;\nif (isMSIE) {\n let matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n if (matches) {\n browserVersion = parseFloat(matches[1]);\n }\n}\n\nconst isEdge = /Edge\\/\\d+/.test(userAgent);\n\nlet hasCodeMirror = !!window.CodeMirror;\n\nconst isSupportTouch =\n (('ontouchstart' in window) ||\n (navigator.MaxTouchPoints > 0) ||\n (navigator.msMaxTouchPoints > 0));\n\n// [workaround] IE doesn't have input events for contentEditable\n// - see: https://goo.gl/4bfIvA\nconst inputEventName = (isMSIE) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n\n/**\n * @class core.env\n *\n * Object which check platform and agent\n *\n * @singleton\n * @alternateClassName env\n */\nexport default {\n isMac: navigator.appVersion.indexOf('Mac') > -1,\n isMSIE,\n isEdge,\n isFF: !isEdge && /firefox/i.test(userAgent),\n isPhantom: /PhantomJS/i.test(userAgent),\n isWebkit: !isEdge && /webkit/i.test(userAgent),\n isChrome: !isEdge && /chrome/i.test(userAgent),\n isSafari: !isEdge && /safari/i.test(userAgent) && (!/chrome/i.test(userAgent)),\n browserVersion,\n jqueryVersion: parseFloat($.fn.jquery),\n isSupportAmd,\n isSupportTouch,\n hasCodeMirror,\n isFontInstalled,\n isW3CRangeSupport: !!document.createRange,\n inputEventName,\n genericFontFamilies,\n validFontName,\n};\n","import $ from 'jquery';\n\n/**\n * @class core.func\n *\n * func utils (for high-order func's arg)\n *\n * @singleton\n * @alternateClassName func\n */\nfunction eq(itemA) {\n return function(itemB) {\n return itemA === itemB;\n };\n}\n\nfunction eq2(itemA, itemB) {\n return itemA === itemB;\n}\n\nfunction peq2(propName) {\n return function(itemA, itemB) {\n return itemA[propName] === itemB[propName];\n };\n}\n\nfunction ok() {\n return true;\n}\n\nfunction fail() {\n return false;\n}\n\nfunction not(f) {\n return function() {\n return !f.apply(f, arguments);\n };\n}\n\nfunction and(fA, fB) {\n return function(item) {\n return fA(item) && fB(item);\n };\n}\n\nfunction self(a) {\n return a;\n}\n\nfunction invoke(obj, method) {\n return function() {\n return obj[method].apply(obj, arguments);\n };\n}\n\nlet idCounter = 0;\n\n/**\n * reset globally-unique id\n *\n */\nfunction resetUniqueId() {\n idCounter = 0;\n}\n\n/**\n * generate a globally-unique id\n *\n * @param {String} [prefix]\n */\nfunction uniqueId(prefix) {\n const id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n\n/**\n * returns bnd (bounds) from rect\n *\n * - IE Compatibility Issue: http://goo.gl/sRLOAo\n * - Scroll Issue: http://goo.gl/sNjUc\n *\n * @param {Rect} rect\n * @return {Object} bounds\n * @return {Number} bounds.top\n * @return {Number} bounds.left\n * @return {Number} bounds.width\n * @return {Number} bounds.height\n */\nfunction rect2bnd(rect) {\n const $document = $(document);\n return {\n top: rect.top + $document.scrollTop(),\n left: rect.left + $document.scrollLeft(),\n width: rect.right - rect.left,\n height: rect.bottom - rect.top,\n };\n}\n\n/**\n * returns a copy of the object where the keys have become the values and the values the keys.\n * @param {Object} obj\n * @return {Object}\n */\nfunction invertObject(obj) {\n const inverted = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n inverted[obj[key]] = key;\n }\n }\n return inverted;\n}\n\n/**\n * @param {String} namespace\n * @param {String} [prefix]\n * @return {String}\n */\nfunction namespaceToCamel(namespace, prefix) {\n prefix = prefix || '';\n return prefix + namespace.split('.').map(function(name) {\n return name.substring(0, 1).toUpperCase() + name.substring(1);\n }).join('');\n}\n\n/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing.\n * @param {Function} func\n * @param {Number} wait\n * @param {Boolean} immediate\n * @return {Function}\n */\nfunction debounce(func, wait, immediate) {\n let timeout;\n return function() {\n const context = this;\n const args = arguments;\n const later = () => {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n const callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/**\n *\n * @param {String} url\n * @return {Boolean}\n */\nfunction isValidUrl(url) {\n const expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n return expression.test(url);\n}\n\nexport default {\n eq,\n eq2,\n peq2,\n ok,\n fail,\n self,\n not,\n and,\n invoke,\n resetUniqueId,\n uniqueId,\n rect2bnd,\n invertObject,\n namespaceToCamel,\n debounce,\n isValidUrl,\n};\n","import func from './func';\n\n/**\n * returns the first item of an array.\n *\n * @param {Array} array\n */\nfunction head(array) {\n return array[0];\n}\n\n/**\n * returns the last item of an array.\n *\n * @param {Array} array\n */\nfunction last(array) {\n return array[array.length - 1];\n}\n\n/**\n * returns everything but the last entry of the array.\n *\n * @param {Array} array\n */\nfunction initial(array) {\n return array.slice(0, array.length - 1);\n}\n\n/**\n * returns the rest of the items in an array.\n *\n * @param {Array} array\n */\nfunction tail(array) {\n return array.slice(1);\n}\n\n/**\n * returns item of array\n */\nfunction find(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n const item = array[idx];\n if (pred(item)) {\n return item;\n }\n }\n}\n\n/**\n * returns true if all of the values in the array pass the predicate truth test.\n */\nfunction all(array, pred) {\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * returns true if the value is present in the list.\n */\nfunction contains(array, item) {\n if (array && array.length && item) {\n if (array.indexOf) {\n return array.indexOf(item) !== -1;\n } else if (array.contains) {\n // `DOMTokenList` doesn't implement `.indexOf`, but it implements `.contains`\n return array.contains(item);\n }\n }\n return false;\n}\n\n/**\n * get sum from a list\n *\n * @param {Array} array - array\n * @param {Function} fn - iterator\n */\nfunction sum(array, fn) {\n fn = fn || func.self;\n return array.reduce(function(memo, v) {\n return memo + fn(v);\n }, 0);\n}\n\n/**\n * returns a copy of the collection with array type.\n * @param {Collection} collection - collection eg) node.childNodes, ...\n */\nfunction from(collection) {\n const result = [];\n const length = collection.length;\n let idx = -1;\n while (++idx < length) {\n result[idx] = collection[idx];\n }\n return result;\n}\n\n/**\n * returns whether list is empty or not\n */\nfunction isEmpty(array) {\n return !array || !array.length;\n}\n\n/**\n * cluster elements by predicate function.\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n * @param {Array[]}\n */\nfunction clusterBy(array, fn) {\n if (!array.length) { return []; }\n const aTail = tail(array);\n return aTail.reduce(function(memo, v) {\n const aLast = last(memo);\n if (fn(last(aLast), v)) {\n aLast[aLast.length] = v;\n } else {\n memo[memo.length] = [v];\n }\n return memo;\n }, [[head(array)]]);\n}\n\n/**\n * returns a copy of the array with all false values removed\n *\n * @param {Array} array - array\n * @param {Function} fn - predicate function for cluster rule\n */\nfunction compact(array) {\n const aResult = [];\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (array[idx]) { aResult.push(array[idx]); }\n }\n return aResult;\n}\n\n/**\n * produces a duplicate-free version of the array\n *\n * @param {Array} array\n */\nfunction unique(array) {\n const results = [];\n\n for (let idx = 0, len = array.length; idx < len; idx++) {\n if (!contains(results, array[idx])) {\n results.push(array[idx]);\n }\n }\n\n return results;\n}\n\n/**\n * returns next item.\n * @param {Array} array\n */\nfunction next(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx + 1];\n }\n return null;\n}\n\n/**\n * returns prev item.\n * @param {Array} array\n */\nfunction prev(array, item) {\n if (array && array.length && item) {\n const idx = array.indexOf(item);\n return idx === -1 ? null : array[idx - 1];\n }\n return null;\n}\n\n/**\n * @class core.list\n *\n * list utils\n *\n * @singleton\n * @alternateClassName list\n */\nexport default {\n head,\n last,\n initial,\n tail,\n prev,\n next,\n find,\n contains,\n all,\n sum,\n from,\n isEmpty,\n clusterBy,\n compact,\n unique,\n};\n","import $ from 'jquery';\nimport func from './func';\nimport lists from './lists';\nimport env from './env';\n\nconst NBSP_CHAR = String.fromCharCode(160);\nconst ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n\n/**\n * @method isEditable\n *\n * returns whether node is `note-editable` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEditable(node) {\n return node && $(node).hasClass('note-editable');\n}\n\n/**\n * @method isControlSizing\n *\n * returns whether node is `note-control-sizing` or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isControlSizing(node) {\n return node && $(node).hasClass('note-control-sizing');\n}\n\n/**\n * @method makePredByNodeName\n *\n * returns predicate which judge whether nodeName is same\n *\n * @param {String} nodeName\n * @return {Function}\n */\nfunction makePredByNodeName(nodeName) {\n nodeName = nodeName.toUpperCase();\n return function(node) {\n return node && node.nodeName.toUpperCase() === nodeName;\n };\n}\n\n/**\n * @method isText\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is text(3)\n */\nfunction isText(node) {\n return node && node.nodeType === 3;\n}\n\n/**\n * @method isElement\n *\n *\n *\n * @param {Node} node\n * @return {Boolean} true if node's type is element(1)\n */\nfunction isElement(node) {\n return node && node.nodeType === 1;\n}\n\n/**\n * ex) br, col, embed, hr, img, input, ...\n * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n */\nfunction isVoid(node) {\n return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n}\n\nfunction isPara(node) {\n if (isEditable(node)) {\n return false;\n }\n\n // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nfunction isHeading(node) {\n return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n}\n\nconst isPre = makePredByNodeName('PRE');\n\nconst isLi = makePredByNodeName('LI');\n\nfunction isPurePara(node) {\n return isPara(node) && !isLi(node);\n}\n\nconst isTable = makePredByNodeName('TABLE');\n\nconst isData = makePredByNodeName('DATA');\n\nfunction isInline(node) {\n return !isBodyContainer(node) &&\n !isList(node) &&\n !isHr(node) &&\n !isPara(node) &&\n !isTable(node) &&\n !isBlockquote(node) &&\n !isData(node);\n}\n\nfunction isList(node) {\n return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n}\n\nconst isHr = makePredByNodeName('HR');\n\nfunction isCell(node) {\n return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n}\n\nconst isBlockquote = makePredByNodeName('BLOCKQUOTE');\n\nfunction isBodyContainer(node) {\n return isCell(node) || isBlockquote(node) || isEditable(node);\n}\n\nconst isAnchor = makePredByNodeName('A');\n\nfunction isParaInline(node) {\n return isInline(node) && !!ancestor(node, isPara);\n}\n\nfunction isBodyInline(node) {\n return isInline(node) && !ancestor(node, isPara);\n}\n\nconst isBody = makePredByNodeName('BODY');\n\n/**\n * returns whether nodeB is closest sibling of nodeA\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n * @return {Boolean}\n */\nfunction isClosestSibling(nodeA, nodeB) {\n return nodeA.nextSibling === nodeB ||\n nodeA.previousSibling === nodeB;\n}\n\n/**\n * returns array of closest siblings with node\n *\n * @param {Node} node\n * @param {function} [pred] - predicate function\n * @return {Node[]}\n */\nfunction withClosestSiblings(node, pred) {\n pred = pred || func.ok;\n\n const siblings = [];\n if (node.previousSibling && pred(node.previousSibling)) {\n siblings.push(node.previousSibling);\n }\n siblings.push(node);\n if (node.nextSibling && pred(node.nextSibling)) {\n siblings.push(node.nextSibling);\n }\n return siblings;\n}\n\n/**\n * blank HTML for cursor position\n * - [workaround] old IE only works with \n * - [workaround] IE11 and other browser works with bogus br\n */\nconst blankHTML = env.isMSIE && env.browserVersion < 11 ? ' ' : '<br>';\n\n/**\n * @method nodeLength\n *\n * returns #text's text size or element's childNodes size\n *\n * @param {Node} node\n */\nfunction nodeLength(node) {\n if (isText(node)) {\n return node.nodeValue.length;\n }\n\n if (node) {\n return node.childNodes.length;\n }\n\n return 0;\n}\n\n/**\n * returns whether deepest child node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction deepestChildIsEmpty(node) {\n do {\n if (node.firstElementChild === null || node.firstElementChild.innerHTML === '') break;\n } while ((node = node.firstElementChild));\n\n return isEmpty(node);\n}\n\n/**\n * returns whether node is empty or not.\n *\n * @param {Node} node\n * @return {Boolean}\n */\nfunction isEmpty(node) {\n const len = nodeLength(node);\n\n if (len === 0) {\n return true;\n } else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n // ex) <p><br></p>, <span><br></span>\n return true;\n } else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n // ex) <p></p>, <span></span>\n return true;\n }\n\n return false;\n}\n\n/**\n * padding blankHTML if node is empty (for cursor position)\n */\nfunction paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}\n\n/**\n * find nearest ancestor predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction ancestor(node, pred) {\n while (node) {\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * find nearest ancestor only single child blood line and predicate hit\n *\n * @param {Node} node\n * @param {Function} pred - predicate function\n */\nfunction singleChildAncestor(node, pred) {\n node = node.parentNode;\n\n while (node) {\n if (nodeLength(node) !== 1) { break; }\n if (pred(node)) { return node; }\n if (isEditable(node)) { break; }\n\n node = node.parentNode;\n }\n return null;\n}\n\n/**\n * returns new array of ancestor nodes (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listAncestor(node, pred) {\n pred = pred || func.fail;\n\n const ancestors = [];\n ancestor(node, function(el) {\n if (!isEditable(el)) {\n ancestors.push(el);\n }\n\n return pred(el);\n });\n return ancestors;\n}\n\n/**\n * find farthest ancestor predicate hit\n */\nfunction lastAncestor(node, pred) {\n const ancestors = listAncestor(node);\n return lists.last(ancestors.filter(pred));\n}\n\n/**\n * returns common ancestor node between two nodes.\n *\n * @param {Node} nodeA\n * @param {Node} nodeB\n */\nfunction commonAncestor(nodeA, nodeB) {\n const ancestors = listAncestor(nodeA);\n for (let n = nodeB; n; n = n.parentNode) {\n if (ancestors.indexOf(n) > -1) return n;\n }\n return null; // difference document area\n}\n\n/**\n * listing all previous siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [optional] pred - predicate function\n */\nfunction listPrev(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.previousSibling;\n }\n return nodes;\n}\n\n/**\n * listing next siblings (until predicate hit).\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listNext(node, pred) {\n pred = pred || func.fail;\n\n const nodes = [];\n while (node) {\n if (pred(node)) { break; }\n nodes.push(node);\n node = node.nextSibling;\n }\n return nodes;\n}\n\n/**\n * listing descendant nodes\n *\n * @param {Node} node\n * @param {Function} [pred] - predicate function\n */\nfunction listDescendant(node, pred) {\n const descendants = [];\n pred = pred || func.ok;\n\n // start DFS(depth first search) with node\n (function fnWalk(current) {\n if (node !== current && pred(current)) {\n descendants.push(current);\n }\n for (let idx = 0, len = current.childNodes.length; idx < len; idx++) {\n fnWalk(current.childNodes[idx]);\n }\n })(node);\n\n return descendants;\n}\n\n/**\n * wrap node with new tag.\n *\n * @param {Node} node\n * @param {Node} tagName of wrapper\n * @return {Node} - wrapper\n */\nfunction wrap(node, wrapperName) {\n const parent = node.parentNode;\n const wrapper = $('<' + wrapperName + '>')[0];\n\n parent.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n}\n\n/**\n * insert node after preceding\n *\n * @param {Node} node\n * @param {Node} preceding - predicate function\n */\nfunction insertAfter(node, preceding) {\n const next = preceding.nextSibling;\n let parent = preceding.parentNode;\n if (next) {\n parent.insertBefore(node, next);\n } else {\n parent.appendChild(node);\n }\n return node;\n}\n\n/**\n * append elements.\n *\n * @param {Node} node\n * @param {Collection} aChild\n */\nfunction appendChildNodes(node, aChild) {\n $.each(aChild, function(idx, child) {\n node.appendChild(child);\n });\n return node;\n}\n\n/**\n * returns whether boundaryPoint is left edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isLeftEdgePoint(point) {\n return point.offset === 0;\n}\n\n/**\n * returns whether boundaryPoint is right edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isRightEdgePoint(point) {\n return point.offset === nodeLength(point.node);\n}\n\n/**\n * returns whether boundaryPoint is edge or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isEdgePoint(point) {\n return isLeftEdgePoint(point) || isRightEdgePoint(point);\n}\n\n/**\n * returns whether node is left edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgeOf(node, ancestor) {\n while (node && node !== ancestor) {\n if (position(node) !== 0) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether node is right edge of ancestor or not.\n *\n * @param {Node} node\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgeOf(node, ancestor) {\n if (!ancestor) {\n return false;\n }\n while (node && node !== ancestor) {\n if (position(node) !== nodeLength(node.parentNode) - 1) {\n return false;\n }\n node = node.parentNode;\n }\n\n return true;\n}\n\n/**\n * returns whether point is left edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isLeftEdgePointOf(point, ancestor) {\n return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns whether point is right edge of ancestor or not.\n * @param {BoundaryPoint} point\n * @param {Node} ancestor\n * @return {Boolean}\n */\nfunction isRightEdgePointOf(point, ancestor) {\n return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n}\n\n/**\n * returns offset from parent.\n *\n * @param {Node} node\n */\nfunction position(node) {\n let offset = 0;\n while ((node = node.previousSibling)) {\n offset += 1;\n }\n return offset;\n}\n\nfunction hasChildren(node) {\n return !!(node && node.childNodes && node.childNodes.length);\n}\n\n/**\n * returns previous boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction prevPoint(point, isSkipInnerOffset) {\n let node;\n let offset;\n\n if (point.offset === 0) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node);\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset - 1];\n offset = nodeLength(node);\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? 0 : point.offset - 1;\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns next boundaryPoint\n *\n * @param {BoundaryPoint} point\n * @param {Boolean} isSkipInnerOffset\n * @return {BoundaryPoint}\n */\nfunction nextPoint(point, isSkipInnerOffset) {\n let node, offset;\n\n if (isEmpty(point.node)) {\n return null;\n }\n\n if (nodeLength(point.node) === point.offset) {\n if (isEditable(point.node)) {\n return null;\n }\n\n node = point.node.parentNode;\n offset = position(point.node) + 1;\n } else if (hasChildren(point.node)) {\n node = point.node.childNodes[point.offset];\n offset = 0;\n if (isEmpty(node)) {\n return null;\n }\n } else {\n node = point.node;\n offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n\n if (isEmpty(node)) {\n return null;\n }\n }\n\n return {\n node: node,\n offset: offset,\n };\n}\n\n/**\n * returns whether pointA and pointB is same or not.\n *\n * @param {BoundaryPoint} pointA\n * @param {BoundaryPoint} pointB\n * @return {Boolean}\n */\nfunction isSamePoint(pointA, pointB) {\n return pointA.node === pointB.node && pointA.offset === pointB.offset;\n}\n\n/**\n * returns whether point is visible (can set cursor) or not.\n *\n * @param {BoundaryPoint} point\n * @return {Boolean}\n */\nfunction isVisiblePoint(point) {\n if (isText(point.node) || !hasChildren(point.node) || isEmpty(point.node)) {\n return true;\n }\n\n const leftNode = point.node.childNodes[point.offset - 1];\n const rightNode = point.node.childNodes[point.offset];\n if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n return true;\n }\n\n return false;\n}\n\n/**\n * @method prevPointUtil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction prevPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = prevPoint(point);\n }\n\n return null;\n}\n\n/**\n * @method nextPointUntil\n *\n * @param {BoundaryPoint} point\n * @param {Function} pred\n * @return {BoundaryPoint}\n */\nfunction nextPointUntil(point, pred) {\n while (point) {\n if (pred(point)) {\n return point;\n }\n\n point = nextPoint(point);\n }\n\n return null;\n}\n\n/**\n * returns whether point has character or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isCharPoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n}\n\n/**\n * returns whether point has space or not.\n *\n * @param {Point} point\n * @return {Boolean}\n */\nfunction isSpacePoint(point) {\n if (!isText(point.node)) {\n return false;\n }\n\n const ch = point.node.nodeValue.charAt(point.offset - 1);\n return ch === ' ' || ch === NBSP_CHAR;\n}\n\n/**\n * @method walkPoint\n *\n * @param {BoundaryPoint} startPoint\n * @param {BoundaryPoint} endPoint\n * @param {Function} handler\n * @param {Boolean} isSkipInnerOffset\n */\nfunction walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n let point = startPoint;\n\n while (point) {\n handler(point);\n\n if (isSamePoint(point, endPoint)) {\n break;\n }\n\n const isSkipOffset = isSkipInnerOffset &&\n startPoint.node !== point.node &&\n endPoint.node !== point.node;\n point = nextPoint(point, isSkipOffset);\n }\n}\n\n/**\n * @method makeOffsetPath\n *\n * return offsetPath(array of offset) from ancestor\n *\n * @param {Node} ancestor - ancestor node\n * @param {Node} node\n */\nfunction makeOffsetPath(ancestor, node) {\n const ancestors = listAncestor(node, func.eq(ancestor));\n return ancestors.map(position).reverse();\n}\n\n/**\n * @method fromOffsetPath\n *\n * return element from offsetPath(array of offset)\n *\n * @param {Node} ancestor - ancestor node\n * @param {array} offsets - offsetPath\n */\nfunction fromOffsetPath(ancestor, offsets) {\n let current = ancestor;\n for (let i = 0, len = offsets.length; i < len; i++) {\n if (current.childNodes.length <= offsets[i]) {\n current = current.childNodes[current.childNodes.length - 1];\n } else {\n current = current.childNodes[offsets[i]];\n }\n }\n return current;\n}\n\n/**\n * @method splitNode\n *\n * split element or #text\n *\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitNode(point, options) {\n let isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n const isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n const isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n\n if (isDiscardEmptySplits) {\n isSkipPaddingBlankHTML = true;\n }\n\n // edge case\n if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n if (isLeftEdgePoint(point)) {\n return point.node;\n } else if (isRightEdgePoint(point)) {\n return point.node.nextSibling;\n }\n }\n\n // split #text\n if (isText(point.node)) {\n return point.node.splitText(point.offset);\n } else {\n const childNode = point.node.childNodes[point.offset];\n const clone = insertAfter(point.node.cloneNode(false), point.node);\n appendChildNodes(clone, listNext(childNode));\n\n if (!isSkipPaddingBlankHTML) {\n paddingBlankHTML(point.node);\n paddingBlankHTML(clone);\n }\n\n if (isDiscardEmptySplits) {\n if (isEmpty(point.node)) {\n remove(point.node);\n }\n if (isEmpty(clone)) {\n remove(clone);\n return point.node.nextSibling;\n }\n }\n\n return clone;\n }\n}\n\n/**\n * @method splitTree\n *\n * split tree by point\n *\n * @param {Node} root - split root\n * @param {BoundaryPoint} point\n * @param {Object} [options]\n * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n * @return {Node} right node of boundaryPoint\n */\nfunction splitTree(root, point, options) {\n // ex) [#text, <span>, <p>]\n const ancestors = listAncestor(point.node, func.eq(root));\n\n if (!ancestors.length) {\n return null;\n } else if (ancestors.length === 1) {\n return splitNode(point, options);\n }\n\n return ancestors.reduce(function(node, parent) {\n if (node === point.node) {\n node = splitNode(point, options);\n }\n\n return splitNode({\n node: parent,\n offset: node ? position(node) : nodeLength(parent),\n }, options);\n });\n}\n\n/**\n * split point\n *\n * @param {Point} point\n * @param {Boolean} isInline\n * @return {Object}\n */\nfunction splitPoint(point, isInline) {\n // find splitRoot, container\n // - inline: splitRoot is a child of paragraph\n // - block: splitRoot is a child of bodyContainer\n const pred = isInline ? isPara : isBodyContainer;\n const ancestors = listAncestor(point.node, pred);\n const topAncestor = lists.last(ancestors) || point.node;\n\n let splitRoot, container;\n if (pred(topAncestor)) {\n splitRoot = ancestors[ancestors.length - 2];\n container = topAncestor;\n } else {\n splitRoot = topAncestor;\n container = splitRoot.parentNode;\n }\n\n // if splitRoot is exists, split with splitTree\n let pivot = splitRoot && splitTree(splitRoot, point, {\n isSkipPaddingBlankHTML: isInline,\n isNotSplitEdgePoint: isInline,\n });\n\n // if container is point.node, find pivot with point.offset\n if (!pivot && container === point.node) {\n pivot = point.node.childNodes[point.offset];\n }\n\n return {\n rightNode: pivot,\n container: container,\n };\n}\n\nfunction create(nodeName) {\n return document.createElement(nodeName);\n}\n\nfunction createText(text) {\n return document.createTextNode(text);\n}\n\n/**\n * @method remove\n *\n * remove node, (isRemoveChild: remove child or not)\n *\n * @param {Node} node\n * @param {Boolean} isRemoveChild\n */\nfunction remove(node, isRemoveChild) {\n if (!node || !node.parentNode) { return; }\n if (node.removeNode) { return node.removeNode(isRemoveChild); }\n\n const parent = node.parentNode;\n if (!isRemoveChild) {\n const nodes = [];\n for (let i = 0, len = node.childNodes.length; i < len; i++) {\n nodes.push(node.childNodes[i]);\n }\n\n for (let i = 0, len = nodes.length; i < len; i++) {\n parent.insertBefore(nodes[i], node);\n }\n }\n\n parent.removeChild(node);\n}\n\n/**\n * @method removeWhile\n *\n * @param {Node} node\n * @param {Function} pred\n */\nfunction removeWhile(node, pred) {\n while (node) {\n if (isEditable(node) || !pred(node)) {\n break;\n }\n\n const parent = node.parentNode;\n remove(node);\n node = parent;\n }\n}\n\n/**\n * @method replace\n *\n * replace node with provided nodeName\n *\n * @param {Node} node\n * @param {String} nodeName\n * @return {Node} - new node\n */\nfunction replace(node, nodeName) {\n if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n return node;\n }\n\n const newNode = create(nodeName);\n\n if (node.style.cssText) {\n newNode.style.cssText = node.style.cssText;\n }\n\n appendChildNodes(newNode, lists.from(node.childNodes));\n insertAfter(newNode, node);\n remove(node);\n\n return newNode;\n}\n\nconst isTextarea = makePredByNodeName('TEXTAREA');\n\n/**\n * @param {jQuery} $node\n * @param {Boolean} [stripLinebreaks] - default: false\n */\nfunction value($node, stripLinebreaks) {\n const val = isTextarea($node[0]) ? $node.val() : $node.html();\n if (stripLinebreaks) {\n return val.replace(/[\\n\\r]/g, '');\n }\n return val;\n}\n\n/**\n * @method html\n *\n * get the HTML contents of node\n *\n * @param {jQuery} $node\n * @param {Boolean} [isNewlineOnBlock]\n */\nfunction html($node, isNewlineOnBlock) {\n let markup = value($node);\n\n if (isNewlineOnBlock) {\n const regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n markup = markup.replace(regexTag, function(match, endSlash, name) {\n name = name.toUpperCase();\n const isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n !!endSlash;\n const isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n\n return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n });\n markup = markup.trim();\n }\n\n return markup;\n}\n\nfunction posFromPlaceholder(placeholder) {\n const $placeholder = $(placeholder);\n const pos = $placeholder.offset();\n const height = $placeholder.outerHeight(true); // include margin\n\n return {\n left: pos.left,\n top: pos.top + height,\n };\n}\n\nfunction attachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.on(key, events[key]);\n });\n}\n\nfunction detachEvents($node, events) {\n Object.keys(events).forEach(function(key) {\n $node.off(key, events[key]);\n });\n}\n\n/**\n * @method isCustomStyleTag\n *\n * assert if a node contains a \"note-styletag\" class,\n * which implies that's a custom-made style tag node\n *\n * @param {Node} an HTML DOM node\n */\nfunction isCustomStyleTag(node) {\n return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n}\n\nexport default {\n /** @property {String} NBSP_CHAR */\n NBSP_CHAR,\n /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n ZERO_WIDTH_NBSP_CHAR,\n /** @property {String} blank */\n blank: blankHTML,\n /** @property {String} emptyPara */\n emptyPara: `<p>${blankHTML}</p>`,\n makePredByNodeName,\n isEditable,\n isControlSizing,\n isText,\n isElement,\n isVoid,\n isPara,\n isPurePara,\n isHeading,\n isInline,\n isBlock: func.not(isInline),\n isBodyInline,\n isBody,\n isParaInline,\n isPre,\n isList,\n isTable,\n isData,\n isCell,\n isBlockquote,\n isBodyContainer,\n isAnchor,\n isDiv: makePredByNodeName('DIV'),\n isLi,\n isBR: makePredByNodeName('BR'),\n isSpan: makePredByNodeName('SPAN'),\n isB: makePredByNodeName('B'),\n isU: makePredByNodeName('U'),\n isS: makePredByNodeName('S'),\n isI: makePredByNodeName('I'),\n isImg: makePredByNodeName('IMG'),\n isTextarea,\n deepestChildIsEmpty,\n isEmpty,\n isEmptyAnchor: func.and(isAnchor, isEmpty),\n isClosestSibling,\n withClosestSiblings,\n nodeLength,\n isLeftEdgePoint,\n isRightEdgePoint,\n isEdgePoint,\n isLeftEdgeOf,\n isRightEdgeOf,\n isLeftEdgePointOf,\n isRightEdgePointOf,\n prevPoint,\n nextPoint,\n isSamePoint,\n isVisiblePoint,\n prevPointUntil,\n nextPointUntil,\n isCharPoint,\n isSpacePoint,\n walkPoint,\n ancestor,\n singleChildAncestor,\n listAncestor,\n lastAncestor,\n listNext,\n listPrev,\n listDescendant,\n commonAncestor,\n wrap,\n insertAfter,\n appendChildNodes,\n position,\n hasChildren,\n makeOffsetPath,\n fromOffsetPath,\n splitTree,\n splitPoint,\n create,\n createText,\n remove,\n removeWhile,\n replace,\n html,\n value,\n posFromPlaceholder,\n attachEvents,\n detachEvents,\n isCustomStyleTag,\n};\n","import $ from 'jquery';\nimport func from './core/func';\nimport lists from './core/lists';\nimport dom from './core/dom';\n\nexport default class Context {\n /**\n * @param {jQuery} $note\n * @param {Object} options\n */\n constructor($note, options) {\n this.$note = $note;\n\n this.memos = {};\n this.modules = {};\n this.layoutInfo = {};\n this.options = $.extend(true, {}, options);\n\n // init ui with options\n $.summernote.ui = $.summernote.ui_template(this.options);\n this.ui = $.summernote.ui;\n\n this.initialize();\n }\n\n /**\n * create layout and initialize modules and other resources\n */\n initialize() {\n this.layoutInfo = this.ui.createLayout(this.$note);\n this._initialize();\n this.$note.hide();\n return this;\n }\n\n /**\n * destroy modules and other resources and remove layout\n */\n destroy() {\n this._destroy();\n this.$note.removeData('summernote');\n this.ui.removeLayout(this.$note, this.layoutInfo);\n }\n\n /**\n * destory modules and other resources and initialize it again\n */\n reset() {\n const disabled = this.isDisabled();\n this.code(dom.emptyPara);\n this._destroy();\n this._initialize();\n\n if (disabled) {\n this.disable();\n }\n }\n\n _initialize() {\n // set own id\n this.options.id = func.uniqueId($.now());\n // set default container for tooltips, popovers, and dialogs\n this.options.container = this.options.container || this.layoutInfo.editor;\n\n // add optional buttons\n const buttons = $.extend({}, this.options.buttons);\n Object.keys(buttons).forEach((key) => {\n this.memo('button.' + key, buttons[key]);\n });\n\n const modules = $.extend({}, this.options.modules, $.summernote.plugins || {});\n\n // add and initialize modules\n Object.keys(modules).forEach((key) => {\n this.module(key, modules[key], true);\n });\n\n Object.keys(this.modules).forEach((key) => {\n this.initializeModule(key);\n });\n }\n\n _destroy() {\n // destroy modules with reversed order\n Object.keys(this.modules).reverse().forEach((key) => {\n this.removeModule(key);\n });\n\n Object.keys(this.memos).forEach((key) => {\n this.removeMemo(key);\n });\n // trigger custom onDestroy callback\n this.triggerEvent('destroy', this);\n }\n\n code(html) {\n const isActivated = this.invoke('codeview.isActivated');\n\n if (html === undefined) {\n this.invoke('codeview.sync');\n return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n } else {\n if (isActivated) {\n this.layoutInfo.codable.val(html);\n } else {\n this.layoutInfo.editable.html(html);\n }\n this.$note.val(html);\n this.triggerEvent('change', html, this.layoutInfo.editable);\n }\n }\n\n isDisabled() {\n return this.layoutInfo.editable.attr('contenteditable') === 'false';\n }\n\n enable() {\n this.layoutInfo.editable.attr('contenteditable', true);\n this.invoke('toolbar.activate', true);\n this.triggerEvent('disable', false);\n this.options.editing = true;\n }\n\n disable() {\n // close codeview if codeview is opend\n if (this.invoke('codeview.isActivated')) {\n this.invoke('codeview.deactivate');\n }\n this.layoutInfo.editable.attr('contenteditable', false);\n this.options.editing = false;\n this.invoke('toolbar.deactivate', true);\n\n this.triggerEvent('disable', true);\n }\n\n triggerEvent() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n if (callback) {\n callback.apply(this.$note[0], args);\n }\n this.$note.trigger('summernote.' + namespace, args);\n }\n\n initializeModule(key) {\n const module = this.modules[key];\n module.shouldInitialize = module.shouldInitialize || func.ok;\n if (!module.shouldInitialize()) {\n return;\n }\n\n // initialize module\n if (module.initialize) {\n module.initialize();\n }\n\n // attach events\n if (module.events) {\n dom.attachEvents(this.$note, module.events);\n }\n }\n\n module(key, ModuleClass, withoutIntialize) {\n if (arguments.length === 1) {\n return this.modules[key];\n }\n\n this.modules[key] = new ModuleClass(this);\n\n if (!withoutIntialize) {\n this.initializeModule(key);\n }\n }\n\n removeModule(key) {\n const module = this.modules[key];\n if (module.shouldInitialize()) {\n if (module.events) {\n dom.detachEvents(this.$note, module.events);\n }\n\n if (module.destroy) {\n module.destroy();\n }\n }\n\n delete this.modules[key];\n }\n\n memo(key, obj) {\n if (arguments.length === 1) {\n return this.memos[key];\n }\n this.memos[key] = obj;\n }\n\n removeMemo(key) {\n if (this.memos[key] && this.memos[key].destroy) {\n this.memos[key].destroy();\n }\n\n delete this.memos[key];\n }\n\n /**\n * Some buttons need to change their visual style immediately once they get pressed\n */\n createInvokeHandlerAndUpdateState(namespace, value) {\n return (event) => {\n this.createInvokeHandler(namespace, value)(event);\n this.invoke('buttons.updateCurrentStyle');\n };\n }\n\n createInvokeHandler(namespace, value) {\n return (event) => {\n event.preventDefault();\n const $target = $(event.target);\n this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n };\n }\n\n invoke() {\n const namespace = lists.head(arguments);\n const args = lists.tail(lists.from(arguments));\n\n const splits = namespace.split('.');\n const hasSeparator = splits.length > 1;\n const moduleName = hasSeparator && lists.head(splits);\n const methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n\n const module = this.modules[moduleName || 'editor'];\n if (!moduleName && this[methodName]) {\n return this[methodName].apply(this, args);\n } else if (module && module[methodName] && module.shouldInitialize()) {\n return module[methodName].apply(module, args);\n }\n }\n}\n","import $ from 'jquery';\nimport env from './env';\nimport func from './func';\nimport lists from './lists';\nimport dom from './dom';\n\n/**\n * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n *\n * @param {TextRange} textRange\n * @param {Boolean} isStart\n * @return {BoundaryPoint}\n *\n * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n */\nfunction textRangeToPoint(textRange, isStart) {\n let container = textRange.parentElement();\n let offset;\n\n const tester = document.body.createTextRange();\n let prevContainer;\n const childNodes = lists.from(container.childNodes);\n for (offset = 0; offset < childNodes.length; offset++) {\n if (dom.isText(childNodes[offset])) {\n continue;\n }\n tester.moveToElementText(childNodes[offset]);\n if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n break;\n }\n prevContainer = childNodes[offset];\n }\n\n if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n const textRangeStart = document.body.createTextRange();\n let curTextNode = null;\n textRangeStart.moveToElementText(prevContainer || container);\n textRangeStart.collapse(!prevContainer);\n curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n\n const pointTester = textRange.duplicate();\n pointTester.setEndPoint('StartToStart', textRangeStart);\n let textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n\n while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n // [workaround] enforce IE to re-reference curTextNode, hack\n const dummy = curTextNode.nodeValue; // eslint-disable-line\n\n if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n textCount === curTextNode.nodeValue.length) {\n textCount -= curTextNode.nodeValue.length;\n curTextNode = curTextNode.nextSibling;\n }\n\n container = curTextNode;\n offset = textCount;\n }\n\n return {\n cont: container,\n offset: offset,\n };\n}\n\n/**\n * return TextRange from boundary point (inspired by google closure-library)\n * @param {BoundaryPoint} point\n * @return {TextRange}\n */\nfunction pointToTextRange(point) {\n const textRangeInfo = function(container, offset) {\n let node, isCollapseToStart;\n\n if (dom.isText(container)) {\n const prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n const prevContainer = lists.last(prevTextNodes).previousSibling;\n node = prevContainer || container.parentNode;\n offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n isCollapseToStart = !prevContainer;\n } else {\n node = container.childNodes[offset] || container;\n if (dom.isText(node)) {\n return textRangeInfo(node, 0);\n }\n\n offset = 0;\n isCollapseToStart = false;\n }\n\n return {\n node: node,\n collapseToStart: isCollapseToStart,\n offset: offset,\n };\n };\n\n const textRange = document.body.createTextRange();\n const info = textRangeInfo(point.node, point.offset);\n\n textRange.moveToElementText(info.node);\n textRange.collapse(info.collapseToStart);\n textRange.moveStart('character', info.offset);\n return textRange;\n}\n\n/**\n * Wrapped Range\n *\n * @constructor\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n */\nclass WrappedRange {\n constructor(sc, so, ec, eo) {\n this.sc = sc;\n this.so = so;\n this.ec = ec;\n this.eo = eo;\n\n // isOnEditable: judge whether range is on editable or not\n this.isOnEditable = this.makeIsOn(dom.isEditable);\n // isOnList: judge whether range is on list node or not\n this.isOnList = this.makeIsOn(dom.isList);\n // isOnAnchor: judge whether range is on anchor node or not\n this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n // isOnCell: judge whether range is on cell node or not\n this.isOnCell = this.makeIsOn(dom.isCell);\n // isOnData: judge whether range is on data node or not\n this.isOnData = this.makeIsOn(dom.isData);\n }\n\n // nativeRange: get nativeRange from sc, so, ec, eo\n nativeRange() {\n if (env.isW3CRangeSupport) {\n const w3cRange = document.createRange();\n w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n\n return w3cRange;\n } else {\n const textRange = pointToTextRange({\n node: this.sc,\n offset: this.so,\n });\n\n textRange.setEndPoint('EndToEnd', pointToTextRange({\n node: this.ec,\n offset: this.eo,\n }));\n\n return textRange;\n }\n }\n\n getPoints() {\n return {\n sc: this.sc,\n so: this.so,\n ec: this.ec,\n eo: this.eo,\n };\n }\n\n getStartPoint() {\n return {\n node: this.sc,\n offset: this.so,\n };\n }\n\n getEndPoint() {\n return {\n node: this.ec,\n offset: this.eo,\n };\n }\n\n /**\n * select update visible range\n */\n select() {\n const nativeRng = this.nativeRange();\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (selection.rangeCount > 0) {\n selection.removeAllRanges();\n }\n selection.addRange(nativeRng);\n } else {\n nativeRng.select();\n }\n\n return this;\n }\n\n /**\n * Moves the scrollbar to start container(sc) of current range\n *\n * @return {WrappedRange}\n */\n scrollIntoView(container) {\n const height = $(container).height();\n if (container.scrollTop + height < this.sc.offsetTop) {\n container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n }\n\n return this;\n }\n\n /**\n * @return {WrappedRange}\n */\n normalize() {\n /**\n * @param {BoundaryPoint} point\n * @param {Boolean} isLeftToRight - true: prefer to choose right node\n * - false: prefer to choose left node\n * @return {BoundaryPoint}\n */\n const getVisiblePoint = function(point, isLeftToRight) {\n if (!point) {\n return point;\n }\n\n // Just use the given point [XXX:Adhoc]\n // - case 01. if the point is on the middle of the node\n // - case 02. if the point is on the right edge and prefer to choose left node\n // - case 03. if the point is on the left edge and prefer to choose right node\n // - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n // - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n // - case 06. if the point is on the block node and there is no children\n if (dom.isVisiblePoint(point)) {\n if (!dom.isEdgePoint(point) ||\n (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n return point;\n }\n }\n\n // point on block's edge\n const block = dom.ancestor(point.node, dom.isBlock);\n let hasRightNode = false;\n\n if (!hasRightNode) {\n const prevPoint = dom.prevPoint(point) || { node: null };\n hasRightNode = (dom.isLeftEdgePointOf(point, block) || dom.isVoid(prevPoint.node)) && !isLeftToRight;\n }\n\n let hasLeftNode = false;\n if (!hasLeftNode) {\n const nextPoint = dom.nextPoint(point) || { node: null };\n hasLeftNode = (dom.isRightEdgePointOf(point, block) || dom.isVoid(nextPoint.node)) && isLeftToRight;\n }\n\n if (hasRightNode || hasLeftNode) {\n // returns point already on visible point\n if (dom.isVisiblePoint(point)) {\n return point;\n }\n // reverse direction\n isLeftToRight = !isLeftToRight;\n }\n\n const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n return nextPoint || point;\n };\n\n const endPoint = getVisiblePoint(this.getEndPoint(), false);\n const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns matched nodes on range\n *\n * @param {Function} [pred] - predicate function\n * @param {Object} [options]\n * @param {Boolean} [options.includeAncestor]\n * @param {Boolean} [options.fullyContains]\n * @return {Node[]}\n */\n nodes(pred, options) {\n pred = pred || func.ok;\n\n const includeAncestor = options && options.includeAncestor;\n const fullyContains = options && options.fullyContains;\n\n // TODO compare points and sort\n const startPoint = this.getStartPoint();\n const endPoint = this.getEndPoint();\n\n const nodes = [];\n const leftEdgeNodes = [];\n\n dom.walkPoint(startPoint, endPoint, function(point) {\n if (dom.isEditable(point.node)) {\n return;\n }\n\n let node;\n if (fullyContains) {\n if (dom.isLeftEdgePoint(point)) {\n leftEdgeNodes.push(point.node);\n }\n if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n node = point.node;\n }\n } else if (includeAncestor) {\n node = dom.ancestor(point.node, pred);\n } else {\n node = point.node;\n }\n\n if (node && pred(node)) {\n nodes.push(node);\n }\n }, true);\n\n return lists.unique(nodes);\n }\n\n /**\n * returns commonAncestor of range\n * @return {Element} - commonAncestor\n */\n commonAncestor() {\n return dom.commonAncestor(this.sc, this.ec);\n }\n\n /**\n * returns expanded range by pred\n *\n * @param {Function} pred - predicate function\n * @return {WrappedRange}\n */\n expand(pred) {\n const startAncestor = dom.ancestor(this.sc, pred);\n const endAncestor = dom.ancestor(this.ec, pred);\n\n if (!startAncestor && !endAncestor) {\n return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n }\n\n const boundaryPoints = this.getPoints();\n\n if (startAncestor) {\n boundaryPoints.sc = startAncestor;\n boundaryPoints.so = 0;\n }\n\n if (endAncestor) {\n boundaryPoints.ec = endAncestor;\n boundaryPoints.eo = dom.nodeLength(endAncestor);\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * @param {Boolean} isCollapseToStart\n * @return {WrappedRange}\n */\n collapse(isCollapseToStart) {\n if (isCollapseToStart) {\n return new WrappedRange(this.sc, this.so, this.sc, this.so);\n } else {\n return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n }\n }\n\n /**\n * splitText on range\n */\n splitText() {\n const isSameContainer = this.sc === this.ec;\n const boundaryPoints = this.getPoints();\n\n if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n this.ec.splitText(this.eo);\n }\n\n if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n boundaryPoints.sc = this.sc.splitText(this.so);\n boundaryPoints.so = 0;\n\n if (isSameContainer) {\n boundaryPoints.ec = boundaryPoints.sc;\n boundaryPoints.eo = this.eo - this.so;\n }\n }\n\n return new WrappedRange(\n boundaryPoints.sc,\n boundaryPoints.so,\n boundaryPoints.ec,\n boundaryPoints.eo\n );\n }\n\n /**\n * delete contents on range\n * @return {WrappedRange}\n */\n deleteContents() {\n if (this.isCollapsed()) {\n return this;\n }\n\n const rng = this.splitText();\n const nodes = rng.nodes(null, {\n fullyContains: true,\n });\n\n // find new cursor point\n const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {\n return !lists.contains(nodes, point.node);\n });\n\n const emptyParents = [];\n $.each(nodes, function(idx, node) {\n // find empty parents\n const parent = node.parentNode;\n if (point.node !== parent && dom.nodeLength(parent) === 1) {\n emptyParents.push(parent);\n }\n dom.remove(node, false);\n });\n\n // remove empty parents\n $.each(emptyParents, function(idx, node) {\n dom.remove(node, false);\n });\n\n return new WrappedRange(\n point.node,\n point.offset,\n point.node,\n point.offset\n ).normalize();\n }\n\n /**\n * makeIsOn: return isOn(pred) function\n */\n makeIsOn(pred) {\n return function() {\n const ancestor = dom.ancestor(this.sc, pred);\n return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n };\n }\n\n /**\n * @param {Function} pred\n * @return {Boolean}\n */\n isLeftEdgeOf(pred) {\n if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n return false;\n }\n\n const node = dom.ancestor(this.sc, pred);\n return node && dom.isLeftEdgeOf(this.sc, node);\n }\n\n /**\n * returns whether range was collapsed or not\n */\n isCollapsed() {\n return this.sc === this.ec && this.so === this.eo;\n }\n\n /**\n * wrap inline nodes which children of body with paragraph\n *\n * @return {WrappedRange}\n */\n wrapBodyInlineWithPara() {\n if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n this.sc.innerHTML = dom.emptyPara;\n return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n }\n\n /**\n * [workaround] firefox often create range on not visible point. so normalize here.\n * - firefox: |<p>text</p>|\n * - chrome: <p>|text|</p>\n */\n const rng = this.normalize();\n if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n return rng;\n }\n\n // find inline top ancestor\n let topAncestor;\n if (dom.isInline(rng.sc)) {\n const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n topAncestor = lists.last(ancestors);\n if (!dom.isInline(topAncestor)) {\n topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n }\n } else {\n topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n }\n\n if (topAncestor) {\n // siblings not in paragraph\n let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n\n // wrap with paragraph\n if (inlineSiblings.length) {\n const para = dom.wrap(lists.head(inlineSiblings), 'p');\n dom.appendChildNodes(para, lists.tail(inlineSiblings));\n }\n }\n\n return this.normalize();\n }\n\n /**\n * insert node at current cursor\n *\n * @param {Node} node\n * @return {Node}\n */\n insertNode(node) {\n let rng = this;\n\n if (dom.isText(node) || dom.isInline(node)) {\n rng = this.wrapBodyInlineWithPara().deleteContents();\n }\n\n const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n if (info.rightNode) {\n info.rightNode.parentNode.insertBefore(node, info.rightNode);\n } else {\n info.container.appendChild(node);\n }\n\n return node;\n }\n\n /**\n * insert html at current cursor\n */\n pasteHTML(markup) {\n markup = $.trim(markup);\n\n const contentsContainer = $('<div></div>').html(markup)[0];\n let childNodes = lists.from(contentsContainer.childNodes);\n\n // const rng = this.wrapBodyInlineWithPara().deleteContents();\n const rng = this;\n\n if (rng.so >= 0) {\n childNodes = childNodes.reverse();\n }\n childNodes = childNodes.map(function(childNode) {\n return rng.insertNode(childNode);\n });\n if (rng.so > 0) {\n childNodes = childNodes.reverse();\n }\n return childNodes;\n }\n\n /**\n * returns text in range\n *\n * @return {String}\n */\n toString() {\n const nativeRng = this.nativeRange();\n return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n }\n\n /**\n * returns range for word before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordRange(findAfter) {\n let endPoint = this.getEndPoint();\n\n if (!dom.isCharPoint(endPoint)) {\n return this;\n }\n\n const startPoint = dom.prevPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, function(point) {\n return !dom.isCharPoint(point);\n });\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor\n *\n * @param {Boolean} [findAfter] - find after cursor, default: false\n * @return {WrappedRange}\n */\n getWordsRange(findAfter) {\n var endPoint = this.getEndPoint();\n\n var isNotTextPoint = function(point) {\n return !dom.isCharPoint(point) && !dom.isSpacePoint(point);\n };\n\n if (isNotTextPoint(endPoint)) {\n return this;\n }\n\n var startPoint = dom.prevPointUntil(endPoint, isNotTextPoint);\n\n if (findAfter) {\n endPoint = dom.nextPointUntil(endPoint, isNotTextPoint);\n }\n\n return new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n }\n\n /**\n * returns range for words before cursor that match with a Regex\n *\n * example:\n * range: 'hi @Peter Pan'\n * regex: '/@[a-z ]+/i'\n * return range: '@Peter Pan'\n *\n * @param {RegExp} [regex]\n * @return {WrappedRange|null}\n */\n getWordsMatchRange(regex) {\n var endPoint = this.getEndPoint();\n\n var startPoint = dom.prevPointUntil(endPoint, function(point) {\n if (!dom.isCharPoint(point) && !dom.isSpacePoint(point)) {\n return true;\n }\n var rng = new WrappedRange(\n point.node,\n point.offset,\n endPoint.node,\n endPoint.offset\n );\n var result = regex.exec(rng.toString());\n return result && result.index === 0;\n });\n\n var rng = new WrappedRange(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n );\n\n var text = rng.toString();\n var result = regex.exec(text);\n\n if (result && result[0].length === text.length) {\n return rng;\n } else {\n return null;\n }\n }\n\n /**\n * create offsetPath bookmark\n *\n * @param {Node} editable\n */\n bookmark(editable) {\n return {\n s: {\n path: dom.makeOffsetPath(editable, this.sc),\n offset: this.so,\n },\n e: {\n path: dom.makeOffsetPath(editable, this.ec),\n offset: this.eo,\n },\n };\n }\n\n /**\n * create offsetPath bookmark base on paragraph\n *\n * @param {Node[]} paras\n */\n paraBookmark(paras) {\n return {\n s: {\n path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n offset: this.so,\n },\n e: {\n path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n offset: this.eo,\n },\n };\n }\n\n /**\n * getClientRects\n * @return {Rect[]}\n */\n getClientRects() {\n const nativeRng = this.nativeRange();\n return nativeRng.getClientRects();\n }\n}\n\n/**\n * Data structure\n * * BoundaryPoint: a point of dom tree\n * * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n *\n * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n */\nexport default {\n /**\n * create Range Object From arguments or Browser Selection\n *\n * @param {Node} sc - start container\n * @param {Number} so - start offset\n * @param {Node} ec - end container\n * @param {Number} eo - end offset\n * @return {WrappedRange}\n */\n create: function(sc, so, ec, eo) {\n if (arguments.length === 4) {\n return new WrappedRange(sc, so, ec, eo);\n } else if (arguments.length === 2) { // collapsed\n ec = sc;\n eo = so;\n return new WrappedRange(sc, so, ec, eo);\n } else {\n let wrappedRange = this.createFromSelection();\n\n if (!wrappedRange && arguments.length === 1) {\n let bodyElement = arguments[0];\n if (dom.isEditable(bodyElement)) {\n bodyElement = bodyElement.lastChild;\n }\n return this.createFromBodyElement(bodyElement, dom.emptyPara === arguments[0].innerHTML);\n }\n return wrappedRange;\n }\n },\n\n createFromBodyElement: function(bodyElement, isCollapseToStart = false) {\n var wrappedRange = this.createFromNode(bodyElement);\n return wrappedRange.collapse(isCollapseToStart);\n },\n\n createFromSelection: function() {\n let sc, so, ec, eo;\n if (env.isW3CRangeSupport) {\n const selection = document.getSelection();\n if (!selection || selection.rangeCount === 0) {\n return null;\n } else if (dom.isBody(selection.anchorNode)) {\n // Firefox: returns entire body as range on initialization.\n // We won't never need it.\n return null;\n }\n\n const nativeRng = selection.getRangeAt(0);\n sc = nativeRng.startContainer;\n so = nativeRng.startOffset;\n ec = nativeRng.endContainer;\n eo = nativeRng.endOffset;\n } else { // IE8: TextRange\n const textRange = document.selection.createRange();\n const textRangeEnd = textRange.duplicate();\n textRangeEnd.collapse(false);\n const textRangeStart = textRange;\n textRangeStart.collapse(true);\n\n let startPoint = textRangeToPoint(textRangeStart, true);\n let endPoint = textRangeToPoint(textRangeEnd, false);\n\n // same visible point case: range was collapsed.\n if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n endPoint.node.nextSibling === startPoint.node) {\n startPoint = endPoint;\n }\n\n sc = startPoint.cont;\n so = startPoint.offset;\n ec = endPoint.cont;\n eo = endPoint.offset;\n }\n\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from node\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNode: function(node) {\n let sc = node;\n let so = 0;\n let ec = node;\n let eo = dom.nodeLength(ec);\n\n // browsers can't target a picture or void node\n if (dom.isVoid(sc)) {\n so = dom.listPrev(sc).length - 1;\n sc = sc.parentNode;\n }\n if (dom.isBR(ec)) {\n eo = dom.listPrev(ec).length - 1;\n ec = ec.parentNode;\n } else if (dom.isVoid(ec)) {\n eo = dom.listPrev(ec).length;\n ec = ec.parentNode;\n }\n\n return this.create(sc, so, ec, eo);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeBefore: function(node) {\n return this.createFromNode(node).collapse(true);\n },\n\n /**\n * create WrappedRange from node after position\n *\n * @param {Node} node\n * @return {WrappedRange}\n */\n createFromNodeAfter: function(node) {\n return this.createFromNode(node).collapse();\n },\n\n /**\n * @method\n *\n * create WrappedRange from bookmark\n *\n * @param {Node} editable\n * @param {Object} bookmark\n * @return {WrappedRange}\n */\n createFromBookmark: function(editable, bookmark) {\n const sc = dom.fromOffsetPath(editable, bookmark.s.path);\n const so = bookmark.s.offset;\n const ec = dom.fromOffsetPath(editable, bookmark.e.path);\n const eo = bookmark.e.offset;\n return new WrappedRange(sc, so, ec, eo);\n },\n\n /**\n * @method\n *\n * create WrappedRange from paraBookmark\n *\n * @param {Object} bookmark\n * @param {Node[]} paras\n * @return {WrappedRange}\n */\n createFromParaBookmark: function(bookmark, paras) {\n const so = bookmark.s.offset;\n const eo = bookmark.e.offset;\n const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n\n return new WrappedRange(sc, so, ec, eo);\n },\n};\n","import $ from 'jquery';\nimport env from './base/core/env';\nimport lists from './base/core/lists';\nimport Context from './base/Context';\n\n$.fn.extend({\n /**\n * Summernote API\n *\n * @param {Object|String}\n * @return {this}\n */\n summernote: function() {\n const type = $.type(lists.head(arguments));\n const isExternalAPICalled = type === 'string';\n const hasInitOptions = type === 'object';\n\n const options = $.extend({}, $.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n\n // Update options\n options.langInfo = $.extend(true, {}, $.summernote.lang['en-US'], $.summernote.lang[options.lang]);\n options.icons = $.extend(true, {}, $.summernote.options.icons, options.icons);\n options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n\n this.each((idx, note) => {\n const $note = $(note);\n if (!$note.data('summernote')) {\n const context = new Context($note, options);\n $note.data('summernote', context);\n $note.data('summernote').triggerEvent('init', context.layoutInfo);\n }\n });\n\n const $note = this.first();\n if ($note.length) {\n const context = $note.data('summernote');\n if (isExternalAPICalled) {\n return context.invoke.apply(context, lists.from(arguments));\n } else if (options.focus) {\n context.invoke('editor.focus');\n }\n }\n\n return this;\n },\n});\n","import lists from './lists';\nimport func from './func';\n\nconst KEY_MAP = {\n 'BACKSPACE': 8,\n 'TAB': 9,\n 'ENTER': 13,\n 'SPACE': 32,\n 'DELETE': 46,\n\n // Arrow\n 'LEFT': 37,\n 'UP': 38,\n 'RIGHT': 39,\n 'DOWN': 40,\n\n // Number: 0-9\n 'NUM0': 48,\n 'NUM1': 49,\n 'NUM2': 50,\n 'NUM3': 51,\n 'NUM4': 52,\n 'NUM5': 53,\n 'NUM6': 54,\n 'NUM7': 55,\n 'NUM8': 56,\n\n // Alphabet: a-z\n 'B': 66,\n 'E': 69,\n 'I': 73,\n 'J': 74,\n 'K': 75,\n 'L': 76,\n 'R': 82,\n 'S': 83,\n 'U': 85,\n 'V': 86,\n 'Y': 89,\n 'Z': 90,\n\n 'SLASH': 191,\n 'LEFTBRACKET': 219,\n 'BACKSLASH': 220,\n 'RIGHTBRACKET': 221,\n\n // Navigation\n 'HOME': 36,\n 'END': 35,\n 'PAGEUP': 33,\n 'PAGEDOWN': 34,\n};\n\n/**\n * @class core.key\n *\n * Object for keycodes.\n *\n * @singleton\n * @alternateClassName key\n */\nexport default {\n /**\n * @method isEdit\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isEdit: (keyCode) => {\n return lists.contains([\n KEY_MAP.BACKSPACE,\n KEY_MAP.TAB,\n KEY_MAP.ENTER,\n KEY_MAP.SPACE,\n KEY_MAP.DELETE,\n ], keyCode);\n },\n /**\n * @method isMove\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isMove: (keyCode) => {\n return lists.contains([\n KEY_MAP.LEFT,\n KEY_MAP.UP,\n KEY_MAP.RIGHT,\n KEY_MAP.DOWN,\n ], keyCode);\n },\n /**\n * @method isNavigation\n *\n * @param {Number} keyCode\n * @return {Boolean}\n */\n isNavigation: (keyCode) => {\n return lists.contains([\n KEY_MAP.HOME,\n KEY_MAP.END,\n KEY_MAP.PAGEUP,\n KEY_MAP.PAGEDOWN,\n ], keyCode);\n },\n /**\n * @property {Object} nameFromCode\n * @property {String} nameFromCode.8 \"BACKSPACE\"\n */\n nameFromCode: func.invertObject(KEY_MAP),\n code: KEY_MAP,\n};\n","import range from '../core/range';\n\nexport default class History {\n constructor(context) {\n this.stack = [];\n this.stackOffset = -1;\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n this.editable = this.$editable[0];\n }\n\n makeSnapshot() {\n const rng = range.create(this.editable);\n const emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n\n return {\n contents: this.$editable.html(),\n bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark),\n };\n }\n\n applySnapshot(snapshot) {\n if (snapshot.contents !== null) {\n this.$editable.html(snapshot.contents);\n }\n if (snapshot.bookmark !== null) {\n range.createFromBookmark(this.editable, snapshot.bookmark).select();\n }\n }\n\n /**\n * @method rewind\n * Rewinds the history stack back to the first snapshot taken.\n * Leaves the stack intact, so that \"Redo\" can still be used.\n */\n rewind() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n // Return to the first available snapshot.\n this.stackOffset = 0;\n\n // Apply that snapshot.\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n\n /**\n * @method commit\n * Resets history stack, but keeps current editor's content.\n */\n commit() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * @method reset\n * Resets the history stack completely; reverting to an empty editor.\n */\n reset() {\n // Clear the stack.\n this.stack = [];\n\n // Restore stackOffset to its original value.\n this.stackOffset = -1;\n\n // Clear the editable area.\n this.$editable.html('');\n\n // Record our first snapshot (of nothing).\n this.recordUndo();\n }\n\n /**\n * undo\n */\n undo() {\n // Create snap shot if not yet recorded\n if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n this.recordUndo();\n }\n\n if (this.stackOffset > 0) {\n this.stackOffset--;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * redo\n */\n redo() {\n if (this.stack.length - 1 > this.stackOffset) {\n this.stackOffset++;\n this.applySnapshot(this.stack[this.stackOffset]);\n }\n }\n\n /**\n * recorded undo\n */\n recordUndo() {\n this.stackOffset++;\n\n // Wash out stack after stackOffset\n if (this.stack.length > this.stackOffset) {\n this.stack = this.stack.slice(0, this.stackOffset);\n }\n\n // Create new snapshot and push it to the end\n this.stack.push(this.makeSnapshot());\n\n // If the stack size reachs to the limit, then slice it\n if (this.stack.length > this.context.options.historyLimit) {\n this.stack.shift();\n this.stackOffset -= 1;\n }\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class Style {\n /**\n * @method jQueryCSS\n *\n * [workaround] for old jQuery\n * passing an array of style properties to .css()\n * will result in an object of property-value pairs.\n * (compability with version < 1.9)\n *\n * @private\n * @param {jQuery} $obj\n * @param {Array} propertyNames - An array of one or more CSS properties.\n * @return {Object}\n */\n jQueryCSS($obj, propertyNames) {\n if (env.jqueryVersion < 1.9) {\n const result = {};\n $.each(propertyNames, (idx, propertyName) => {\n result[propertyName] = $obj.css(propertyName);\n });\n return result;\n }\n return $obj.css(propertyNames);\n }\n\n /**\n * returns style object from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n fromNode($node) {\n const properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n const styleInfo = this.jQueryCSS($node, properties) || {};\n\n const fontSize = $node[0].style.fontSize || styleInfo['font-size'];\n\n styleInfo['font-size'] = parseInt(fontSize, 10);\n styleInfo['font-size-unit'] = fontSize.match(/[a-z%]+$/);\n\n return styleInfo;\n }\n\n /**\n * paragraph level style\n *\n * @param {WrappedRange} rng\n * @param {Object} styleInfo\n */\n stylePara(rng, styleInfo) {\n $.each(rng.nodes(dom.isPara, {\n includeAncestor: true,\n }), (idx, para) => {\n $(para).css(styleInfo);\n });\n }\n\n /**\n * insert and returns styleNodes on range.\n *\n * @param {WrappedRange} rng\n * @param {Object} [options] - options for styleNodes\n * @param {String} [options.nodeName] - default: `SPAN`\n * @param {Boolean} [options.expandClosestSibling] - default: `false`\n * @param {Boolean} [options.onlyPartialContains] - default: `false`\n * @return {Node[]}\n */\n styleNodes(rng, options) {\n rng = rng.splitText();\n\n const nodeName = (options && options.nodeName) || 'SPAN';\n const expandClosestSibling = !!(options && options.expandClosestSibling);\n const onlyPartialContains = !!(options && options.onlyPartialContains);\n\n if (rng.isCollapsed()) {\n return [rng.insertNode(dom.create(nodeName))];\n }\n\n let pred = dom.makePredByNodeName(nodeName);\n const nodes = rng.nodes(dom.isText, {\n fullyContains: true,\n }).map((text) => {\n return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n });\n\n if (expandClosestSibling) {\n if (onlyPartialContains) {\n const nodesInRange = rng.nodes();\n // compose with partial contains predication\n pred = func.and(pred, (node) => {\n return lists.contains(nodesInRange, node);\n });\n }\n\n return nodes.map((node) => {\n const siblings = dom.withClosestSiblings(node, pred);\n const head = lists.head(siblings);\n const tails = lists.tail(siblings);\n $.each(tails, (idx, elem) => {\n dom.appendChildNodes(head, elem.childNodes);\n dom.remove(elem);\n });\n return lists.head(siblings);\n });\n } else {\n return nodes;\n }\n }\n\n /**\n * get current style on cursor\n *\n * @param {WrappedRange} rng\n * @return {Object} - object contains style properties.\n */\n current(rng) {\n const $cont = $(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n let styleInfo = this.fromNode($cont);\n\n // document.queryCommandState for toggle state\n // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n try {\n styleInfo = $.extend(styleInfo, {\n 'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n 'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n 'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n 'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n 'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n 'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n 'font-family': document.queryCommandValue('fontname') || styleInfo['font-family'],\n });\n } catch (e) {\n // eslint-disable-next-line\n }\n\n // list-style-type to list-style(unordered, ordered)\n if (!rng.isOnList()) {\n styleInfo['list-style'] = 'none';\n } else {\n const orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n const isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n }\n\n const para = dom.ancestor(rng.sc, dom.isPara);\n if (para && para.style['line-height']) {\n styleInfo['line-height'] = para.style.lineHeight;\n } else {\n const lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n styleInfo['line-height'] = lineHeight.toFixed(1);\n }\n\n styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n styleInfo.range = rng;\n\n return styleInfo;\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport func from '../core/func';\nimport dom from '../core/dom';\nimport range from '../core/range';\n\nexport default class Bullet {\n /**\n * toggle ordered list\n */\n insertOrderedList(editable) {\n this.toggleList('OL', editable);\n }\n\n /**\n * toggle unordered list\n */\n insertUnorderedList(editable) {\n this.toggleList('UL', editable);\n }\n\n /**\n * indent\n */\n indent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n const previousList = this.findList(head.previousSibling);\n if (previousList) {\n paras\n .map(para => previousList.appendChild(para));\n } else {\n this.wrapList(paras, head.parentNode.nodeName);\n paras\n .map((para) => para.parentNode)\n .map((para) => this.appendToPrevious(para));\n }\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n return (parseInt(val, 10) || 0) + 25;\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * outdent\n */\n outdent(editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n const paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n if (dom.isLi(head)) {\n this.releaseList([paras]);\n } else {\n $.each(paras, (idx, para) => {\n $(para).css('marginLeft', (idx, val) => {\n val = (parseInt(val, 10) || 0);\n return val > 25 ? val - 25 : '';\n });\n });\n }\n });\n\n rng.select();\n }\n\n /**\n * toggle list\n *\n * @param {String} listName - OL or UL\n */\n toggleList(listName, editable) {\n const rng = range.create(editable).wrapBodyInlineWithPara();\n\n let paras = rng.nodes(dom.isPara, { includeAncestor: true });\n const bookmark = rng.paraBookmark(paras);\n const clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n\n // paragraph to list\n if (lists.find(paras, dom.isPurePara)) {\n let wrappedParas = [];\n $.each(clustereds, (idx, paras) => {\n wrappedParas = wrappedParas.concat(this.wrapList(paras, listName));\n });\n paras = wrappedParas;\n // list to paragraph or change list style\n } else {\n const diffLists = rng.nodes(dom.isList, {\n includeAncestor: true,\n }).filter((listNode) => {\n return !$.nodeName(listNode, listName);\n });\n\n if (diffLists.length) {\n $.each(diffLists, (idx, listNode) => {\n dom.replace(listNode, listName);\n });\n } else {\n paras = this.releaseList(clustereds, true);\n }\n }\n\n range.createFromParaBookmark(bookmark, paras).select();\n }\n\n /**\n * @param {Node[]} paras\n * @param {String} listName\n * @return {Node[]}\n */\n wrapList(paras, listName) {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const prevList = dom.isList(head.previousSibling) && head.previousSibling;\n const nextList = dom.isList(last.nextSibling) && last.nextSibling;\n\n const listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n\n // P to LI\n paras = paras.map((para) => {\n return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n });\n\n // append to list(<ul>, <ol>)\n dom.appendChildNodes(listNode, paras);\n\n if (nextList) {\n dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n dom.remove(nextList);\n }\n\n return paras;\n }\n\n /**\n * @method releaseList\n *\n * @param {Array[]} clustereds\n * @param {Boolean} isEscapseToBody\n * @return {Node[]}\n */\n releaseList(clustereds, isEscapseToBody) {\n let releasedParas = [];\n\n $.each(clustereds, (idx, paras) => {\n const head = lists.head(paras);\n const last = lists.last(paras);\n\n const headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n const parentItem = headList.parentNode;\n\n if (headList.parentNode.nodeName === 'LI') {\n paras.map(para => {\n const newList = this.findNextSiblings(para);\n\n if (parentItem.nextSibling) {\n parentItem.parentNode.insertBefore(\n para,\n parentItem.nextSibling\n );\n } else {\n parentItem.parentNode.appendChild(para);\n }\n\n if (newList.length) {\n this.wrapList(newList, headList.nodeName);\n para.appendChild(newList[0].parentNode);\n }\n });\n\n if (headList.children.length === 0) {\n parentItem.removeChild(headList);\n }\n\n if (parentItem.childNodes.length === 0) {\n parentItem.parentNode.removeChild(parentItem);\n }\n } else {\n const lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n node: last.parentNode,\n offset: dom.position(last) + 1,\n }, {\n isSkipPaddingBlankHTML: true,\n }) : null;\n\n const middleList = dom.splitTree(headList, {\n node: head.parentNode,\n offset: dom.position(head),\n }, {\n isSkipPaddingBlankHTML: true,\n });\n\n paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n : lists.from(middleList.childNodes).filter(dom.isLi);\n\n // LI to P\n if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n paras = paras.map((para) => {\n return dom.replace(para, 'P');\n });\n }\n\n $.each(lists.from(paras).reverse(), (idx, para) => {\n dom.insertAfter(para, headList);\n });\n\n // remove empty lists\n const rootLists = lists.compact([headList, middleList, lastList]);\n $.each(rootLists, (idx, rootList) => {\n const listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n $.each(listNodes.reverse(), (idx, listNode) => {\n if (!dom.nodeLength(listNode)) {\n dom.remove(listNode, true);\n }\n });\n });\n }\n\n releasedParas = releasedParas.concat(paras);\n });\n\n return releasedParas;\n }\n\n /**\n * @method appendToPrevious\n *\n * Appends list to previous list item, if\n * none exist it wraps the list in a new list item.\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n appendToPrevious(node) {\n return node.previousSibling\n ? dom.appendChildNodes(node.previousSibling, [node])\n : this.wrapList([node], 'LI');\n }\n\n /**\n * @method findList\n *\n * Finds an existing list in list item\n *\n * @param {HTMLNode} ListItem\n * @return {Array[]}\n */\n findList(node) {\n return node\n ? lists.find(node.children, child => ['OL', 'UL'].indexOf(child.nodeName) > -1)\n : null;\n }\n\n /**\n * @method findNextSiblings\n *\n * Finds all list item siblings that follow it\n *\n * @param {HTMLNode} ListItem\n * @return {HTMLNode}\n */\n findNextSiblings(node) {\n const siblings = [];\n while (node.nextSibling) {\n siblings.push(node.nextSibling);\n node = node.nextSibling;\n }\n return siblings;\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport Bullet from '../editing/Bullet';\n\n/**\n * @class editing.Typing\n *\n * Typing\n *\n */\nexport default class Typing {\n constructor(context) {\n // a Bullet instance to toggle lists off\n this.bullet = new Bullet();\n this.options = context.options;\n }\n\n /**\n * insert tab\n *\n * @param {WrappedRange} rng\n * @param {Number} tabsize\n */\n insertTab(rng, tabsize) {\n const tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n rng = rng.deleteContents();\n rng.insertNode(tab, true);\n\n rng = range.create(tab, tabsize);\n rng.select();\n }\n\n /**\n * insert paragraph\n *\n * @param {jQuery} $editable\n * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n *\n * blockquoteBreakingLevel\n * 0 - No break, the new paragraph remains inside the quote\n * 1 - Break the first blockquote in the ancestors list\n * 2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n */\n insertParagraph(editable, rng) {\n rng = rng || range.create(editable);\n\n // deleteContents on range.\n rng = rng.deleteContents();\n\n // Wrap range if it needs to be wrapped by paragraph\n rng = rng.wrapBodyInlineWithPara();\n\n // finding paragraph\n const splitRoot = dom.ancestor(rng.sc, dom.isPara);\n\n let nextPara;\n // on paragraph: split paragraph\n if (splitRoot) {\n // if it is an empty line with li\n if (dom.isLi(splitRoot) && (dom.isEmpty(splitRoot) || dom.deepestChildIsEmpty(splitRoot))) {\n // toogle UL/OL and escape\n this.bullet.toggleList(splitRoot.parentNode.nodeName);\n return;\n } else {\n let blockquote = null;\n if (this.options.blockquoteBreakingLevel === 1) {\n blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n } else if (this.options.blockquoteBreakingLevel === 2) {\n blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n }\n\n if (blockquote) {\n // We're inside a blockquote and options ask us to break it\n nextPara = $(dom.emptyPara)[0];\n // If the split is right before a <br>, remove it so that there's no \"empty line\"\n // after the split in the new blockquote created\n if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n $(rng.sc.nextSibling).remove();\n }\n const split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n if (split) {\n split.parentNode.insertBefore(nextPara, split);\n } else {\n dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n }\n } else {\n nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n\n // not a blockquote, just insert the paragraph\n let emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n\n $.each(emptyAnchors, (idx, anchor) => {\n dom.remove(anchor);\n });\n\n // replace empty heading, pre or custom-made styleTag with P tag\n if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n nextPara = dom.replace(nextPara, 'p');\n }\n }\n }\n // no paragraph: insert empty paragraph\n } else {\n const next = rng.sc.childNodes[rng.so];\n nextPara = $(dom.emptyPara)[0];\n if (next) {\n rng.sc.insertBefore(nextPara, next);\n } else {\n rng.sc.appendChild(nextPara);\n }\n }\n\n range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport lists from '../core/lists';\n\n/**\n * @class Create a virtual table to create what actions to do in change.\n * @param {object} startPoint Cell selected to apply change.\n * @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where\n * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n * @param {object} domTable Dom element of table to make changes.\n */\nconst TableResultAction = function(startPoint, where, action, domTable) {\n const _startPoint = { 'colPos': 0, 'rowPos': 0 };\n const _virtualTable = [];\n const _actionCellList = [];\n\n /// ///////////////////////////////////////////\n // Private functions\n /// ///////////////////////////////////////////\n\n /**\n * Set the startPoint of action.\n */\n function setStartPoint() {\n if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n // Impossible to identify start Cell point\n return;\n }\n _startPoint.colPos = startPoint.cellIndex;\n if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n // Impossible to identify start Row point\n return;\n }\n _startPoint.rowPos = startPoint.parentElement.rowIndex;\n }\n\n /**\n * Define virtual table position info object.\n *\n * @param {int} rowIndex Index position in line of virtual table.\n * @param {int} cellIndex Index position in column of virtual table.\n * @param {object} baseRow Row affected by this position.\n * @param {object} baseCell Cell affected by this position.\n * @param {bool} isSpan Inform if it is an span cell/row.\n */\n function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n const objPosition = {\n 'baseRow': baseRow,\n 'baseCell': baseCell,\n 'isRowSpan': isRowSpan,\n 'isColSpan': isColSpan,\n 'isVirtual': isVirtualCell,\n };\n if (!_virtualTable[rowIndex]) {\n _virtualTable[rowIndex] = [];\n }\n _virtualTable[rowIndex][cellIndex] = objPosition;\n }\n\n /**\n * Create action cell object.\n *\n * @param {object} virtualTableCellObj Object of specific position on virtual table.\n * @param {enum} resultAction Action to be applied in that item.\n */\n function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n return {\n 'baseCell': virtualTableCellObj.baseCell,\n 'action': resultAction,\n 'virtualTable': {\n 'rowIndex': virtualRowPosition,\n 'cellIndex': virtualColPosition,\n },\n };\n }\n\n /**\n * Recover free index of row to append Cell.\n *\n * @param {int} rowIndex Index of row to find free space.\n * @param {int} cellIndex Index of cell to find free space in table.\n */\n function recoverCellIndex(rowIndex, cellIndex) {\n if (!_virtualTable[rowIndex]) {\n return cellIndex;\n }\n if (!_virtualTable[rowIndex][cellIndex]) {\n return cellIndex;\n }\n\n let newCellIndex = cellIndex;\n while (_virtualTable[rowIndex][newCellIndex]) {\n newCellIndex++;\n if (!_virtualTable[rowIndex][newCellIndex]) {\n return newCellIndex;\n }\n }\n }\n\n /**\n * Recover info about row and cell and add information to virtual table.\n *\n * @param {object} row Row to recover information.\n * @param {object} cell Cell to recover information.\n */\n function addCellInfoToVirtual(row, cell) {\n const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n const cellHasColspan = (cell.colSpan > 1);\n const cellHasRowspan = (cell.rowSpan > 1);\n const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n\n // Add span rows to virtual Table.\n const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n if (rowspanNumber > 1) {\n for (let rp = 1; rp < rowspanNumber; rp++) {\n const rowspanIndex = row.rowIndex + rp;\n adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n }\n }\n\n // Add span cols to virtual table.\n const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n if (colspanNumber > 1) {\n for (let cp = 1; cp < colspanNumber; cp++) {\n const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n }\n }\n }\n\n /**\n * Process validation and adjust of start point if needed\n *\n * @param {int} rowIndex\n * @param {int} cellIndex\n * @param {object} cell\n * @param {bool} isSelectedCell\n */\n function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n _startPoint.colPos++;\n }\n }\n\n /**\n * Create virtual table of cells with all cells, including span cells.\n */\n function createVirtualTable() {\n const rows = domTable.rows;\n for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n const cells = rows[rowIndex].cells;\n for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n }\n }\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getDeleteResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n case TableResultAction.where.Row:\n if (!cell.isVirtual && cell.isRowSpan) {\n return TableResultAction.resultAction.AddCell;\n } else if (cell.isRowSpan) {\n return TableResultAction.resultAction.SubtractSpanCount;\n }\n break;\n }\n return TableResultAction.resultAction.RemoveCell;\n }\n\n /**\n * Get action to be applied on the cell.\n *\n * @param {object} cell virtual table cell to apply action\n */\n function getAddResultActionToCell(cell) {\n switch (where) {\n case TableResultAction.where.Column:\n if (cell.isColSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isRowSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n case TableResultAction.where.Row:\n if (cell.isRowSpan) {\n return TableResultAction.resultAction.SumSpanCount;\n } else if (cell.isColSpan && cell.isVirtual) {\n return TableResultAction.resultAction.Ignore;\n }\n break;\n }\n return TableResultAction.resultAction.AddCell;\n }\n\n function init() {\n setStartPoint();\n createVirtualTable();\n }\n\n /// ///////////////////////////////////////////\n // Public functions\n /// ///////////////////////////////////////////\n\n /**\n * Recover array os what to do in table.\n */\n this.getActionList = function() {\n const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n\n let actualPosition = 0;\n let canContinue = true;\n while (canContinue) {\n const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n const row = _virtualTable[rowPosition];\n if (!row) {\n canContinue = false;\n return _actionCellList;\n }\n const cell = row[colPosition];\n if (!cell) {\n canContinue = false;\n return _actionCellList;\n }\n\n // Define action to be applied in this cell\n let resultAction = TableResultAction.resultAction.Ignore;\n switch (action) {\n case TableResultAction.requestAction.Add:\n resultAction = getAddResultActionToCell(cell);\n break;\n case TableResultAction.requestAction.Delete:\n resultAction = getDeleteResultActionToCell(cell);\n break;\n }\n _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n actualPosition++;\n }\n\n return _actionCellList;\n };\n\n init();\n};\n/**\n*\n* Where action occours enum.\n*/\nTableResultAction.where = { 'Row': 0, 'Column': 1 };\n/**\n*\n* Requested action to apply enum.\n*/\nTableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n/**\n*\n* Result action to be executed enum.\n*/\nTableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n\n/**\n *\n * @class editing.Table\n *\n * Table\n *\n */\nexport default class Table {\n /**\n * handle tab key\n *\n * @param {WrappedRange} rng\n * @param {Boolean} isShift\n */\n tab(rng, isShift) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const table = dom.ancestor(cell, dom.isTable);\n const cells = dom.listDescendant(table, dom.isCell);\n\n const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n if (nextCell) {\n range.create(nextCell, 0).select();\n }\n }\n\n /**\n * Add a new row\n *\n * @param {WrappedRange} rng\n * @param {String} position (top/bottom)\n * @return {Node}\n */\n addRow(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n\n const currentTr = $(cell).closest('tr');\n const trAttributes = this.recoverAttributes(currentTr);\n const html = $('<tr' + trAttributes + '></tr>');\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let idCell = 0; idCell < actions.length; idCell++) {\n const currentCell = actions[idCell];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n break;\n case TableResultAction.resultAction.SumSpanCount:\n {\n if (position === 'top') {\n const baseCellTr = currentCell.baseCell.parent;\n const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n if (isTopFromRowSpan) {\n const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n html.append(newTd);\n break;\n }\n }\n let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n rowspanNumber++;\n currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n }\n break;\n }\n }\n\n if (position === 'top') {\n currentTr.before(html);\n } else {\n const cellHasRowspan = (cell.rowSpan > 1);\n if (cellHasRowspan) {\n const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n $($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));\n return;\n }\n currentTr.after(html);\n }\n }\n\n /**\n * Add a new col\n *\n * @param {WrappedRange} rng\n * @param {String} position (left/right)\n * @return {Node}\n */\n addCol(rng, position) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const rowsGroup = $(row).siblings();\n rowsGroup.push(row);\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Add, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n const currentCell = actions[actionIndex];\n const tdAttributes = this.recoverAttributes(currentCell.baseCell);\n switch (currentCell.action) {\n case TableResultAction.resultAction.AddCell:\n if (position === 'right') {\n $(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n case TableResultAction.resultAction.SumSpanCount:\n if (position === 'right') {\n let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n colspanNumber++;\n currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n } else {\n $(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n }\n break;\n }\n }\n }\n\n /*\n * Copy attributes from element.\n *\n * @param {object} Element to recover attributes.\n * @return {string} Copied string elements.\n */\n recoverAttributes(el) {\n let resultStr = '';\n\n if (!el) {\n return resultStr;\n }\n\n const attrList = el.attributes || [];\n\n for (let i = 0; i < attrList.length; i++) {\n if (attrList[i].name.toLowerCase() === 'id') {\n continue;\n }\n\n if (attrList[i].specified) {\n resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n }\n }\n\n return resultStr;\n }\n\n /**\n * Delete current row\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteRow(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n const rowPos = row[0].rowIndex;\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Row,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n\n const baseCell = actions[actionIndex].baseCell;\n const virtualPosition = actions[actionIndex].virtualTable;\n const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.AddCell:\n {\n const nextRow = row.next('tr')[0];\n if (!nextRow) { continue; }\n const cloneRow = row[0].cells[cellPos];\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n nextRow.cells[cellPos].innerHTML = '';\n } else if (rowspanNumber === 2) {\n nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n nextRow.cells[cellPos].removeAttribute('rowSpan');\n nextRow.cells[cellPos].innerHTML = '';\n }\n }\n }\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n if (hasRowspan) {\n if (rowspanNumber > 2) {\n rowspanNumber--;\n baseCell.setAttribute('rowSpan', rowspanNumber);\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (rowspanNumber === 2) {\n baseCell.removeAttribute('rowSpan');\n if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n // Do not need remove cell because row will be deleted.\n continue;\n }\n }\n row.remove();\n }\n\n /**\n * Delete current col\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteCol(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n const row = $(cell).closest('tr');\n const cellPos = row.children('td, th').index($(cell));\n\n const vTable = new TableResultAction(cell, TableResultAction.where.Column,\n TableResultAction.requestAction.Delete, $(row).closest('table')[0]);\n const actions = vTable.getActionList();\n\n for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n if (!actions[actionIndex]) {\n continue;\n }\n switch (actions[actionIndex].action) {\n case TableResultAction.resultAction.Ignore:\n continue;\n case TableResultAction.resultAction.SubtractSpanCount:\n {\n const baseCell = actions[actionIndex].baseCell;\n const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n if (hasColspan) {\n let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n if (colspanNumber > 2) {\n colspanNumber--;\n baseCell.setAttribute('colSpan', colspanNumber);\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n } else if (colspanNumber === 2) {\n baseCell.removeAttribute('colSpan');\n if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }\n }\n }\n }\n continue;\n case TableResultAction.resultAction.RemoveCell:\n dom.remove(actions[actionIndex].baseCell, true);\n continue;\n }\n }\n }\n\n /**\n * create empty table element\n *\n * @param {Number} rowCount\n * @param {Number} colCount\n * @return {Node}\n */\n createTable(colCount, rowCount, options) {\n const tds = [];\n let tdHTML;\n for (let idxCol = 0; idxCol < colCount; idxCol++) {\n tds.push('<td>' + dom.blank + '</td>');\n }\n tdHTML = tds.join('');\n\n const trs = [];\n let trHTML;\n for (let idxRow = 0; idxRow < rowCount; idxRow++) {\n trs.push('<tr>' + tdHTML + '</tr>');\n }\n trHTML = trs.join('');\n const $table = $('<table>' + trHTML + '</table>');\n if (options && options.tableClassName) {\n $table.addClass(options.tableClassName);\n }\n\n return $table[0];\n }\n\n /**\n * Delete current table\n *\n * @param {WrappedRange} rng\n * @return {Node}\n */\n deleteTable(rng) {\n const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n $(cell).closest('table').remove();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport { readFileAsDataURL, createImage } from '../core/async';\nimport History from '../editing/History';\nimport Style from '../editing/Style';\nimport Typing from '../editing/Typing';\nimport Table from '../editing/Table';\nimport Bullet from '../editing/Bullet';\n\nconst KEY_BOGUS = 'bogus';\n\n/**\n * @class Editor\n */\nexport default class Editor {\n constructor(context) {\n this.context = context;\n\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.editable = this.$editable[0];\n this.lastRange = null;\n this.snapshot = null;\n\n this.style = new Style();\n this.table = new Table();\n this.typing = new Typing(context);\n this.bullet = new Bullet();\n this.history = new History(context);\n\n this.context.memo('help.undo', this.lang.help.undo);\n this.context.memo('help.redo', this.lang.help.redo);\n this.context.memo('help.tab', this.lang.help.tab);\n this.context.memo('help.untab', this.lang.help.untab);\n this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n this.context.memo('help.indent', this.lang.help.indent);\n this.context.memo('help.outdent', this.lang.help.outdent);\n this.context.memo('help.formatPara', this.lang.help.formatPara);\n this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n this.context.memo('help.fontName', this.lang.help.fontName);\n\n // native commands(with execCommand), generate function for execCommand\n const commands = [\n 'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n 'formatBlock', 'removeFormat', 'backColor',\n ];\n\n for (let idx = 0, len = commands.length; idx < len; idx++) {\n this[commands[idx]] = ((sCmd) => {\n return (value) => {\n this.beforeCommand();\n document.execCommand(sCmd, false, value);\n this.afterCommand(true);\n };\n })(commands[idx]);\n this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n }\n\n this.fontName = this.wrapCommand((value) => {\n return this.fontStyling('font-family', env.validFontName(value));\n });\n\n this.fontSize = this.wrapCommand((value) => {\n const unit = this.currentStyle()['font-size-unit'];\n return this.fontStyling('font-size', value + unit);\n });\n\n this.fontSizeUnit = this.wrapCommand((value) => {\n const size = this.currentStyle()['font-size'];\n return this.fontStyling('font-size', size + value);\n });\n\n for (let idx = 1; idx <= 6; idx++) {\n this['formatH' + idx] = ((idx) => {\n return () => {\n this.formatBlock('H' + idx);\n };\n })(idx);\n this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n }\n\n this.insertParagraph = this.wrapCommand(() => {\n this.typing.insertParagraph(this.editable);\n });\n\n this.insertOrderedList = this.wrapCommand(() => {\n this.bullet.insertOrderedList(this.editable);\n });\n\n this.insertUnorderedList = this.wrapCommand(() => {\n this.bullet.insertUnorderedList(this.editable);\n });\n\n this.indent = this.wrapCommand(() => {\n this.bullet.indent(this.editable);\n });\n\n this.outdent = this.wrapCommand(() => {\n this.bullet.outdent(this.editable);\n });\n\n /**\n * insertNode\n * insert node\n * @param {Node} node\n */\n this.insertNode = this.wrapCommand((node) => {\n if (this.isLimited($(node).text().length)) {\n return;\n }\n const rng = this.getLastRange();\n rng.insertNode(node);\n this.setLastRange(range.createFromNodeAfter(node).select());\n });\n\n /**\n * insert text\n * @param {String} text\n */\n this.insertText = this.wrapCommand((text) => {\n if (this.isLimited(text.length)) {\n return;\n }\n const rng = this.getLastRange();\n const textNode = rng.insertNode(dom.createText(text));\n this.setLastRange(range.create(textNode, dom.nodeLength(textNode)).select());\n });\n\n /**\n * paste HTML\n * @param {String} markup\n */\n this.pasteHTML = this.wrapCommand((markup) => {\n if (this.isLimited(markup.length)) {\n return;\n }\n markup = this.context.invoke('codeview.purify', markup);\n const contents = this.getLastRange().pasteHTML(markup);\n this.setLastRange(range.createFromNodeAfter(lists.last(contents)).select());\n });\n\n /**\n * formatBlock\n *\n * @param {String} tagName\n */\n this.formatBlock = this.wrapCommand((tagName, $target) => {\n const onApplyCustomStyle = this.options.callbacks.onApplyCustomStyle;\n if (onApplyCustomStyle) {\n onApplyCustomStyle.call(this, $target, this.context, this.onFormatBlock);\n } else {\n this.onFormatBlock(tagName, $target);\n }\n });\n\n /**\n * insert horizontal rule\n */\n this.insertHorizontalRule = this.wrapCommand(() => {\n const hrNode = this.getLastRange().insertNode(dom.create('HR'));\n if (hrNode.nextSibling) {\n this.setLastRange(range.create(hrNode.nextSibling, 0).normalize().select());\n }\n });\n\n /**\n * lineHeight\n * @param {String} value\n */\n this.lineHeight = this.wrapCommand((value) => {\n this.style.stylePara(this.getLastRange(), {\n lineHeight: value,\n });\n });\n\n /**\n * create link (command)\n *\n * @param {Object} linkInfo\n */\n this.createLink = this.wrapCommand((linkInfo) => {\n let linkUrl = linkInfo.url;\n const linkText = linkInfo.text;\n const isNewWindow = linkInfo.isNewWindow;\n const checkProtocol = linkInfo.checkProtocol;\n let rng = linkInfo.range || this.getLastRange();\n const additionalTextLength = linkText.length - rng.toString().length;\n if (additionalTextLength > 0 && this.isLimited(additionalTextLength)) {\n return;\n }\n const isTextChanged = rng.toString() !== linkText;\n\n // handle spaced urls from input\n if (typeof linkUrl === 'string') {\n linkUrl = linkUrl.trim();\n }\n\n if (this.options.onCreateLink) {\n linkUrl = this.options.onCreateLink(linkUrl);\n } else if (checkProtocol) {\n // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n ? linkUrl : this.options.defaultProtocol + linkUrl;\n }\n\n let anchors = [];\n if (isTextChanged) {\n rng = rng.deleteContents();\n const anchor = rng.insertNode($('<A>' + linkText + '</A>')[0]);\n anchors.push(anchor);\n } else {\n anchors = this.style.styleNodes(rng, {\n nodeName: 'A',\n expandClosestSibling: true,\n onlyPartialContains: true,\n });\n }\n\n $.each(anchors, (idx, anchor) => {\n $(anchor).attr('href', linkUrl);\n if (isNewWindow) {\n $(anchor).attr('target', '_blank');\n } else {\n $(anchor).removeAttr('target');\n }\n });\n\n const startRange = range.createFromNodeBefore(lists.head(anchors));\n const startPoint = startRange.getStartPoint();\n const endRange = range.createFromNodeAfter(lists.last(anchors));\n const endPoint = endRange.getEndPoint();\n\n this.setLastRange(\n range.create(\n startPoint.node,\n startPoint.offset,\n endPoint.node,\n endPoint.offset\n ).select()\n );\n });\n\n /**\n * setting color\n *\n * @param {Object} sObjColor color code\n * @param {String} sObjColor.foreColor foreground color\n * @param {String} sObjColor.backColor background color\n */\n this.color = this.wrapCommand((colorInfo) => {\n const foreColor = colorInfo.foreColor;\n const backColor = colorInfo.backColor;\n\n if (foreColor) { document.execCommand('foreColor', false, foreColor); }\n if (backColor) { document.execCommand('backColor', false, backColor); }\n });\n\n /**\n * Set foreground color\n *\n * @param {String} colorCode foreground color code\n */\n this.foreColor = this.wrapCommand((colorInfo) => {\n document.execCommand('foreColor', false, colorInfo);\n });\n\n /**\n * insert Table\n *\n * @param {String} dimension of table (ex : \"5x5\")\n */\n this.insertTable = this.wrapCommand((dim) => {\n const dimension = dim.split('x');\n\n const rng = this.getLastRange().deleteContents();\n rng.insertNode(this.table.createTable(dimension[0], dimension[1], this.options));\n });\n\n /**\n * remove media object and Figure Elements if media object is img with Figure.\n */\n this.removeMedia = this.wrapCommand(() => {\n let $target = $(this.restoreTarget()).parent();\n if ($target.closest('figure').length) {\n $target.closest('figure').remove();\n } else {\n $target = $(this.restoreTarget()).detach();\n }\n this.context.triggerEvent('media.delete', $target, this.$editable);\n });\n\n /**\n * float me\n *\n * @param {String} value\n */\n this.floatMe = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n $target.toggleClass('note-float-left', value === 'left');\n $target.toggleClass('note-float-right', value === 'right');\n $target.css('float', (value === 'none' ? '' : value));\n });\n\n /**\n * resize overlay element\n * @param {String} value\n */\n this.resize = this.wrapCommand((value) => {\n const $target = $(this.restoreTarget());\n value = parseFloat(value);\n if (value === 0) {\n $target.css('width', '');\n } else {\n $target.css({\n width: value * 100 + '%',\n height: '',\n });\n }\n });\n }\n\n initialize() {\n // bind custom events\n this.$editable.on('keydown', (event) => {\n if (event.keyCode === key.code.ENTER) {\n this.context.triggerEvent('enter', event);\n }\n this.context.triggerEvent('keydown', event);\n\n // keep a snapshot to limit text on input event\n this.snapshot = this.history.makeSnapshot();\n this.hasKeyShortCut = false;\n if (!event.isDefaultPrevented()) {\n if (this.options.shortcuts) {\n this.hasKeyShortCut = this.handleKeyMap(event);\n } else {\n this.preventDefaultEditableShortCuts(event);\n }\n }\n if (this.isLimited(1, event)) {\n const lastRange = this.getLastRange();\n if (lastRange.eo - lastRange.so === 0) {\n return false;\n }\n }\n this.setLastRange();\n\n // record undo in the key event except keyMap.\n if (this.options.recordEveryKeystroke) {\n if (this.hasKeyShortCut === false) {\n this.history.recordUndo();\n }\n }\n }).on('keyup', (event) => {\n this.setLastRange();\n this.context.triggerEvent('keyup', event);\n }).on('focus', (event) => {\n this.setLastRange();\n this.context.triggerEvent('focus', event);\n }).on('blur', (event) => {\n this.context.triggerEvent('blur', event);\n }).on('mousedown', (event) => {\n this.context.triggerEvent('mousedown', event);\n }).on('mouseup', (event) => {\n this.setLastRange();\n this.history.recordUndo();\n this.context.triggerEvent('mouseup', event);\n }).on('scroll', (event) => {\n this.context.triggerEvent('scroll', event);\n }).on('paste', (event) => {\n this.setLastRange();\n this.context.triggerEvent('paste', event);\n }).on('input', () => {\n // To limit composition characters (e.g. Korean)\n if (this.isLimited(0) && this.snapshot) {\n this.history.applySnapshot(this.snapshot);\n }\n });\n\n this.$editable.attr('spellcheck', this.options.spellCheck);\n\n this.$editable.attr('autocorrect', this.options.spellCheck);\n\n if (this.options.disableGrammar) {\n this.$editable.attr('data-gramm', false);\n }\n\n // init content before set event\n this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n\n this.$editable.on(env.inputEventName, func.debounce(() => {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }, 10));\n\n this.$editable.on('focusin', (event) => {\n this.context.triggerEvent('focusin', event);\n }).on('focusout', (event) => {\n this.context.triggerEvent('focusout', event);\n });\n\n if (this.options.airMode) {\n if (this.options.overrideContextMenu) {\n this.$editor.on('contextmenu', (event) => {\n this.context.triggerEvent('contextmenu', event);\n return false;\n });\n }\n } else {\n if (this.options.width) {\n this.$editor.outerWidth(this.options.width);\n }\n if (this.options.height) {\n this.$editable.outerHeight(this.options.height);\n }\n if (this.options.maxHeight) {\n this.$editable.css('max-height', this.options.maxHeight);\n }\n if (this.options.minHeight) {\n this.$editable.css('min-height', this.options.minHeight);\n }\n }\n\n this.history.recordUndo();\n this.setLastRange();\n }\n\n destroy() {\n this.$editable.off();\n }\n\n handleKeyMap(event) {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n const keys = [];\n\n if (event.metaKey) { keys.push('CMD'); }\n if (event.ctrlKey && !event.altKey) { keys.push('CTRL'); }\n if (event.shiftKey) { keys.push('SHIFT'); }\n\n const keyName = key.nameFromCode[event.keyCode];\n if (keyName) {\n keys.push(keyName);\n }\n\n const eventName = keyMap[keys.join('+')];\n\n if (keyName === 'TAB' && !this.options.tabDisable) {\n this.afterCommand();\n } else if (eventName) {\n if (this.context.invoke(eventName) !== false) {\n event.preventDefault();\n // if keyMap action was invoked\n return true;\n }\n } else if (key.isEdit(event.keyCode)) {\n this.afterCommand();\n }\n return false;\n }\n\n preventDefaultEditableShortCuts(event) {\n // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n if ((event.ctrlKey || event.metaKey) &&\n lists.contains([66, 73, 85], event.keyCode)) {\n event.preventDefault();\n }\n }\n\n isLimited(pad, event) {\n pad = pad || 0;\n\n if (typeof event !== 'undefined') {\n if (key.isMove(event.keyCode) ||\n key.isNavigation(event.keyCode) ||\n (event.ctrlKey || event.metaKey) ||\n lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n return false;\n }\n }\n\n if (this.options.maxTextLength > 0) {\n if ((this.$editable.text().length + pad) > this.options.maxTextLength) {\n return true;\n }\n }\n return false;\n }\n /**\n * create range\n * @return {WrappedRange}\n */\n createRange() {\n this.focus();\n this.setLastRange();\n return this.getLastRange();\n }\n\n setLastRange(rng) {\n if (rng) {\n this.lastRange = rng;\n } else {\n this.lastRange = range.create(this.editable);\n\n if ($(this.lastRange.sc).closest('.note-editable').length === 0) {\n this.lastRange = range.createFromBodyElement(this.editable);\n }\n }\n }\n\n getLastRange() {\n if (!this.lastRange) {\n this.setLastRange();\n }\n return this.lastRange;\n }\n\n /**\n * saveRange\n *\n * save current range\n *\n * @param {Boolean} [thenCollapse=false]\n */\n saveRange(thenCollapse) {\n if (thenCollapse) {\n this.getLastRange().collapse().select();\n }\n }\n\n /**\n * restoreRange\n *\n * restore lately range\n */\n restoreRange() {\n if (this.lastRange) {\n this.lastRange.select();\n this.focus();\n }\n }\n\n saveTarget(node) {\n this.$editable.data('target', node);\n }\n\n clearTarget() {\n this.$editable.removeData('target');\n }\n\n restoreTarget() {\n return this.$editable.data('target');\n }\n\n /**\n * currentStyle\n *\n * current style\n * @return {Object|Boolean} unfocus\n */\n currentStyle() {\n let rng = range.create();\n if (rng) {\n rng = rng.normalize();\n }\n return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n }\n\n /**\n * style from node\n *\n * @param {jQuery} $node\n * @return {Object}\n */\n styleFromNode($node) {\n return this.style.fromNode($node);\n }\n\n /**\n * undo\n */\n undo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.undo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /*\n * commit\n */\n commit() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.commit();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * redo\n */\n redo() {\n this.context.triggerEvent('before.command', this.$editable.html());\n this.history.redo();\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n /**\n * before command\n */\n beforeCommand() {\n this.context.triggerEvent('before.command', this.$editable.html());\n\n // Set styleWithCSS before run a command\n document.execCommand('styleWithCSS', false, this.options.styleWithCSS);\n\n // keep focus on editable before command execution\n this.focus();\n }\n\n /**\n * after command\n * @param {Boolean} isPreventTrigger\n */\n afterCommand(isPreventTrigger) {\n this.normalizeContent();\n this.history.recordUndo();\n if (!isPreventTrigger) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n }\n\n /**\n * handle tab key\n */\n tab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n\n if (!this.isLimited(this.options.tabSize)) {\n this.beforeCommand();\n this.typing.insertTab(rng, this.options.tabSize);\n this.afterCommand();\n }\n }\n }\n\n /**\n * handle shift+tab key\n */\n untab() {\n const rng = this.getLastRange();\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.table.tab(rng, true);\n } else {\n if (this.options.tabSize === 0) {\n return false;\n }\n }\n }\n\n /**\n * run given function between beforeCommand and afterCommand\n */\n wrapCommand(fn) {\n return function() {\n this.beforeCommand();\n fn.apply(this, arguments);\n this.afterCommand();\n };\n }\n\n /**\n * insert image\n *\n * @param {String} src\n * @param {String|Function} param\n * @return {Promise}\n */\n insertImage(src, param) {\n return createImage(src, param).then(($image) => {\n this.beforeCommand();\n\n if (typeof param === 'function') {\n param($image);\n } else {\n if (typeof param === 'string') {\n $image.attr('data-filename', param);\n }\n $image.css('width', Math.min(this.$editable.width(), $image.width()));\n }\n\n $image.show();\n this.getLastRange().insertNode($image[0]);\n this.setLastRange(range.createFromNodeAfter($image[0]).select());\n this.afterCommand();\n }).fail((e) => {\n this.context.triggerEvent('image.upload.error', e);\n });\n }\n\n /**\n * insertImages\n * @param {File[]} files\n */\n insertImagesAsDataURL(files) {\n $.each(files, (idx, file) => {\n const filename = file.name;\n if (this.options.maximumImageFileSize && this.options.maximumImageFileSize < file.size) {\n this.context.triggerEvent('image.upload.error', this.lang.image.maximumFileSizeError);\n } else {\n readFileAsDataURL(file).then((dataURL) => {\n return this.insertImage(dataURL, filename);\n }).fail(() => {\n this.context.triggerEvent('image.upload.error');\n });\n }\n });\n }\n\n /**\n * insertImagesOrCallback\n * @param {File[]} files\n */\n insertImagesOrCallback(files) {\n const callbacks = this.options.callbacks;\n // If onImageUpload set,\n if (callbacks.onImageUpload) {\n this.context.triggerEvent('image.upload', files);\n // else insert Image as dataURL\n } else {\n this.insertImagesAsDataURL(files);\n }\n }\n\n /**\n * return selected plain text\n * @return {String} text\n */\n getSelectedText() {\n let rng = this.getLastRange();\n\n // if range on anchor, expand range with anchor\n if (rng.isOnAnchor()) {\n rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n }\n\n return rng.toString();\n }\n\n onFormatBlock(tagName, $target) {\n // [workaround] for MSIE, IE need `<`\n document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n\n // support custom class\n if ($target && $target.length) {\n // find the exact element has given tagName\n if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n $target = $target.find(tagName);\n }\n\n if ($target && $target.length) {\n const className = $target[0].className || '';\n if (className) {\n const currentRange = this.createRange();\n\n const $parent = $([currentRange.sc, currentRange.ec]).closest(tagName);\n $parent.addClass(className);\n }\n }\n }\n }\n\n formatPara() {\n this.formatBlock('P');\n }\n\n fontStyling(target, value) {\n const rng = this.getLastRange();\n\n if (rng !== '') {\n const spans = this.style.styleNodes(rng);\n this.$editor.find('.note-status-output').html('');\n $(spans).css(target, value);\n\n // [workaround] added styled bogus span for style\n // - also bogus character needed for cursor position\n if (rng.isCollapsed()) {\n const firstSpan = lists.head(spans);\n if (firstSpan && !dom.nodeLength(firstSpan)) {\n firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n range.createFromNodeAfter(firstSpan.firstChild).select();\n this.setLastRange();\n this.$editable.data(KEY_BOGUS, firstSpan);\n }\n }\n } else {\n const noteStatusOutput = $.now();\n this.$editor.find('.note-status-output').html('<div id=\"note-status-output-' + noteStatusOutput + '\" class=\"alert alert-info\">' + this.lang.output.noSelection + '</div>');\n setTimeout(function() { $('#note-status-output-' + noteStatusOutput).remove(); }, 5000);\n }\n }\n\n /**\n * unlink\n *\n * @type command\n */\n unlink() {\n let rng = this.getLastRange();\n if (rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n rng = range.createFromNode(anchor);\n rng.select();\n this.setLastRange();\n\n this.beforeCommand();\n document.execCommand('unlink');\n this.afterCommand();\n }\n }\n\n /**\n * returns link info\n *\n * @return {Object}\n * @return {WrappedRange} return.range\n * @return {String} return.text\n * @return {Boolean} [return.isNewWindow=true]\n * @return {String} [return.url=\"\"]\n */\n getLinkInfo() {\n const rng = this.getLastRange().expand(dom.isAnchor);\n // Get the first anchor on range(for edit).\n const $anchor = $(lists.head(rng.nodes(dom.isAnchor)));\n const linkInfo = {\n range: rng,\n text: rng.toString(),\n url: $anchor.length ? $anchor.attr('href') : '',\n };\n\n // When anchor exists,\n if ($anchor.length) {\n // Set isNewWindow by checking its target.\n linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n }\n\n return linkInfo;\n }\n\n addRow(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addRow(rng, position);\n this.afterCommand();\n }\n }\n\n addCol(position) {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.addCol(rng, position);\n this.afterCommand();\n }\n }\n\n deleteRow() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteRow(rng);\n this.afterCommand();\n }\n }\n\n deleteCol() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteCol(rng);\n this.afterCommand();\n }\n }\n\n deleteTable() {\n const rng = this.getLastRange(this.$editable);\n if (rng.isCollapsed() && rng.isOnCell()) {\n this.beforeCommand();\n this.table.deleteTable(rng);\n this.afterCommand();\n }\n }\n\n /**\n * @param {Position} pos\n * @param {jQuery} $target - target element\n * @param {Boolean} [bKeepRatio] - keep ratio\n */\n resizeTo(pos, $target, bKeepRatio) {\n let imageSize;\n if (bKeepRatio) {\n const newRatio = pos.y / pos.x;\n const ratio = $target.data('ratio');\n imageSize = {\n width: ratio > newRatio ? pos.x : pos.y / ratio,\n height: ratio > newRatio ? pos.x * ratio : pos.y,\n };\n } else {\n imageSize = {\n width: pos.x,\n height: pos.y,\n };\n }\n\n $target.css(imageSize);\n }\n\n /**\n * returns whether editable area has focus or not.\n */\n hasFocus() {\n return this.$editable.is(':focus');\n }\n\n /**\n * set focus\n */\n focus() {\n // [workaround] Screen will move when page is scolled in IE.\n // - do focus when not focused\n if (!this.hasFocus()) {\n this.$editable.focus();\n }\n }\n\n /**\n * returns whether contents is empty or not.\n * @return {Boolean}\n */\n isEmpty() {\n return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n }\n\n /**\n * Removes all contents and restores the editable instance to an _emptyPara_.\n */\n empty() {\n this.context.invoke('code', dom.emptyPara);\n }\n\n /**\n * normalize content\n */\n normalizeContent() {\n this.$editable[0].normalize();\n }\n}\n","import $ from 'jquery';\n\n/**\n * @method readFileAsDataURL\n *\n * read contents of file as representing URL\n *\n * @param {File} file\n * @return {Promise} - then: dataUrl\n */\nexport function readFileAsDataURL(file) {\n return $.Deferred((deferred) => {\n $.extend(new FileReader(), {\n onload: (e) => {\n const dataURL = e.target.result;\n deferred.resolve(dataURL);\n },\n onerror: (err) => {\n deferred.reject(err);\n },\n }).readAsDataURL(file);\n }).promise();\n}\n\n/**\n * @method createImage\n *\n * create `<image>` from url string\n *\n * @param {String} url\n * @return {Promise} - then: $image\n */\nexport function createImage(url) {\n return $.Deferred((deferred) => {\n const $img = $('<img>');\n\n $img.one('load', () => {\n $img.off('error abort');\n deferred.resolve($img);\n }).one('error abort', () => {\n $img.off('load').detach();\n deferred.reject($img);\n }).css({\n display: 'none',\n }).appendTo(document.body).attr('src', url);\n }).promise();\n}\n","import lists from '../core/lists';\n\nexport default class Clipboard {\n constructor(context) {\n this.context = context;\n this.$editable = context.layoutInfo.editable;\n }\n\n initialize() {\n this.$editable.on('paste', this.pasteByEvent.bind(this));\n }\n\n /**\n * paste by clipboard event\n *\n * @param {Event} event\n */\n pasteByEvent(event) {\n const clipboardData = event.originalEvent.clipboardData;\n\n if (clipboardData && clipboardData.items && clipboardData.items.length) {\n const item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n // paste img file\n this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n event.preventDefault();\n } else if (item.kind === 'string') {\n // paste text with maxTextLength check\n if (this.context.invoke('editor.isLimited', clipboardData.getData('Text').length)) {\n event.preventDefault();\n }\n }\n } else if (window.clipboardData) {\n // for IE\n let text = window.clipboardData.getData('text');\n if (this.context.invoke('editor.isLimited', text.length)) {\n event.preventDefault();\n }\n }\n // Call editor.afterCommand after proceeding default event handler\n setTimeout(() => {\n this.context.invoke('editor.afterCommand');\n }, 10);\n }\n}\n","import env from '../core/env';\nimport dom from '../core/dom';\n\nlet CodeMirror;\nif (env.hasCodeMirror) {\n CodeMirror = window.CodeMirror;\n}\n\n/**\n * @class Codeview\n */\nexport default class CodeView {\n constructor(context) {\n this.context = context;\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n this.options = context.options;\n }\n\n sync() {\n const isCodeview = this.isActivated();\n if (isCodeview && env.hasCodeMirror) {\n this.$codable.data('cmEditor').save();\n }\n }\n\n /**\n * @return {Boolean}\n */\n isActivated() {\n return this.$editor.hasClass('codeview');\n }\n\n /**\n * toggle codeview\n */\n toggle() {\n if (this.isActivated()) {\n this.deactivate();\n } else {\n this.activate();\n }\n this.context.triggerEvent('codeview.toggled');\n }\n\n /**\n * purify input value\n * @param value\n * @returns {*}\n */\n purify(value) {\n if (this.options.codeviewFilter) {\n // filter code view regex\n value = value.replace(this.options.codeviewFilterRegex, '');\n // allow specific iframe tag\n if (this.options.codeviewIframeFilter) {\n const whitelist = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function(tag) {\n // remove if src attribute is duplicated\n if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n return '';\n }\n for (const src of whitelist) {\n // pass if src is trusted\n if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n return tag;\n }\n }\n return '';\n });\n }\n }\n return value;\n }\n\n /**\n * activate code view\n */\n activate() {\n this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n this.$codable.height(this.$editable.height());\n\n this.context.invoke('toolbar.updateCodeview', true);\n this.$editor.addClass('codeview');\n this.$codable.focus();\n\n // activate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n\n // CodeMirror TernServer\n if (this.options.codemirror.tern) {\n const server = new CodeMirror.TernServer(this.options.codemirror.tern);\n cmEditor.ternServer = server;\n cmEditor.on('cursorActivity', (cm) => {\n server.updateArgHints(cm);\n });\n }\n\n cmEditor.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', cmEditor.getValue(), event);\n });\n cmEditor.on('change', () => {\n this.context.triggerEvent('change.codeview', cmEditor.getValue(), cmEditor);\n });\n\n // CodeMirror hasn't Padding.\n cmEditor.setSize(null, this.$editable.outerHeight());\n this.$codable.data('cmEditor', cmEditor);\n } else {\n this.$codable.on('blur', (event) => {\n this.context.triggerEvent('blur.codeview', this.$codable.val(), event);\n });\n this.$codable.on('input', () => {\n this.context.triggerEvent('change.codeview', this.$codable.val(), this.$codable);\n });\n }\n }\n\n /**\n * deactivate code view\n */\n deactivate() {\n // deactivate CodeMirror as codable\n if (env.hasCodeMirror) {\n const cmEditor = this.$codable.data('cmEditor');\n this.$codable.val(cmEditor.getValue());\n cmEditor.toTextArea();\n }\n\n const value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n const isChange = this.$editable.html() !== value;\n\n this.$editable.html(value);\n this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n this.$editor.removeClass('codeview');\n\n if (isChange) {\n this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n }\n\n this.$editable.focus();\n\n this.context.invoke('toolbar.updateCodeview', false);\n }\n\n destroy() {\n if (this.isActivated()) {\n this.deactivate();\n }\n }\n}\n","import $ from 'jquery';\n\nexport default class Dropzone {\n constructor(context) {\n this.context = context;\n this.$eventListener = $(document);\n this.$editor = context.layoutInfo.editor;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.documentEventHandlers = {};\n\n this.$dropzone = $([\n '<div class=\"note-dropzone\">',\n '<div class=\"note-dropzone-message\"/>',\n '</div>',\n ].join('')).prependTo(this.$editor);\n }\n\n /**\n * attach Drag and Drop Events\n */\n initialize() {\n if (this.options.disableDragAndDrop) {\n // prevent default drop event\n this.documentEventHandlers.onDrop = (e) => {\n e.preventDefault();\n };\n // do not consider outside of dropzone\n this.$eventListener = this.$dropzone;\n this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n } else {\n this.attachDragAndDropEvent();\n }\n }\n\n /**\n * attach Drag and Drop Events\n */\n attachDragAndDropEvent() {\n let collection = $();\n const $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n\n this.documentEventHandlers.onDragenter = (e) => {\n const isCodeview = this.context.invoke('codeview.isActivated');\n const hasEditorSize = this.$editor.width() > 0 && this.$editor.height() > 0;\n if (!isCodeview && !collection.length && hasEditorSize) {\n this.$editor.addClass('dragover');\n this.$dropzone.width(this.$editor.width());\n this.$dropzone.height(this.$editor.height());\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n }\n collection = collection.add(e.target);\n };\n\n this.documentEventHandlers.onDragleave = (e) => {\n collection = collection.not(e.target);\n\n // If nodeName is BODY, then just make it over (fix for IE)\n if (!collection.length || e.target.nodeName === 'BODY') {\n collection = $();\n this.$editor.removeClass('dragover');\n }\n };\n\n this.documentEventHandlers.onDrop = () => {\n collection = $();\n this.$editor.removeClass('dragover');\n };\n\n // show dropzone on dragenter when dragging a object to document\n // -but only if the editor is visible, i.e. has a positive width and height\n this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n .on('dragleave', this.documentEventHandlers.onDragleave)\n .on('drop', this.documentEventHandlers.onDrop);\n\n // change dropzone's message on hover.\n this.$dropzone.on('dragenter', () => {\n this.$dropzone.addClass('hover');\n $dropzoneMessage.text(this.lang.image.dropImage);\n }).on('dragleave', () => {\n this.$dropzone.removeClass('hover');\n $dropzoneMessage.text(this.lang.image.dragImageHere);\n });\n\n // attach dropImage\n this.$dropzone.on('drop', (event) => {\n const dataTransfer = event.originalEvent.dataTransfer;\n\n // stop the browser from opening the dropped content\n event.preventDefault();\n\n if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n this.$editable.focus();\n this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n } else {\n $.each(dataTransfer.types, (idx, type) => {\n // skip moz-specific types\n if (type.toLowerCase().indexOf('_moz_') > -1) {\n return;\n }\n const content = dataTransfer.getData(type);\n\n if (type.toLowerCase().indexOf('text') > -1) {\n this.context.invoke('editor.pasteHTML', content);\n } else {\n $(content).each((idx, item) => {\n this.context.invoke('editor.insertNode', item);\n });\n }\n });\n }\n }).on('dragover', false); // prevent default dragover event\n }\n\n destroy() {\n Object.keys(this.documentEventHandlers).forEach((key) => {\n this.$eventListener.off(key.substr(2).toLowerCase(), this.documentEventHandlers[key]);\n });\n this.documentEventHandlers = {};\n }\n}\n","import $ from 'jquery';\nconst EDITABLE_PADDING = 24;\n\nexport default class Statusbar {\n constructor(context) {\n this.$document = $(document);\n this.$statusbar = context.layoutInfo.statusbar;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n }\n\n initialize() {\n if (this.options.airMode || this.options.disableResizeEditor) {\n this.destroy();\n return;\n }\n\n this.$statusbar.on('mousedown', (event) => {\n event.preventDefault();\n event.stopPropagation();\n\n const editableTop = this.$editable.offset().top - this.$document.scrollTop();\n const onMouseMove = (event) => {\n let height = event.clientY - (editableTop + EDITABLE_PADDING);\n\n height = (this.options.minheight > 0) ? Math.max(height, this.options.minheight) : height;\n height = (this.options.maxHeight > 0) ? Math.min(height, this.options.maxHeight) : height;\n\n this.$editable.height(height);\n };\n\n this.$document.on('mousemove', onMouseMove).one('mouseup', () => {\n this.$document.off('mousemove', onMouseMove);\n });\n });\n }\n\n destroy() {\n this.$statusbar.off();\n this.$statusbar.addClass('locked');\n }\n}\n","import $ from 'jquery';\n\nexport default class Fullscreen {\n constructor(context) {\n this.context = context;\n\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$codable = context.layoutInfo.codable;\n\n this.$window = $(window);\n this.$scrollbar = $('html, body');\n\n this.onResize = () => {\n this.resizeTo({\n h: this.$window.height() - this.$toolbar.outerHeight(),\n });\n };\n }\n\n resizeTo(size) {\n this.$editable.css('height', size.h);\n this.$codable.css('height', size.h);\n if (this.$codable.data('cmeditor')) {\n this.$codable.data('cmeditor').setsize(null, size.h);\n }\n }\n\n /**\n * toggle fullscreen\n */\n toggle() {\n this.$editor.toggleClass('fullscreen');\n if (this.isFullscreen()) {\n this.$editable.data('orgHeight', this.$editable.css('height'));\n this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n this.$editable.css('maxHeight', '');\n this.$window.on('resize', this.onResize).trigger('resize');\n this.$scrollbar.css('overflow', 'hidden');\n } else {\n this.$window.off('resize', this.onResize);\n this.resizeTo({ h: this.$editable.data('orgHeight') });\n this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n this.$scrollbar.css('overflow', 'visible');\n }\n\n this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n }\n\n isFullscreen() {\n return this.$editor.hasClass('fullscreen');\n }\n}\n","import $ from 'jquery';\nimport dom from '../core/dom';\n\nexport default class Handle {\n constructor(context) {\n this.context = context;\n this.$document = $(document);\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n this.events = {\n 'summernote.mousedown': (we, e) => {\n if (this.update(e.target, e)) {\n e.preventDefault();\n }\n },\n 'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n initialize() {\n this.$handle = $([\n '<div class=\"note-handle\">',\n '<div class=\"note-control-selection\">',\n '<div class=\"note-control-selection-bg\"></div>',\n '<div class=\"note-control-holder note-control-nw\"></div>',\n '<div class=\"note-control-holder note-control-ne\"></div>',\n '<div class=\"note-control-holder note-control-sw\"></div>',\n '<div class=\"',\n (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n ' note-control-se\"></div>',\n (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n '</div>',\n '</div>',\n ].join('')).prependTo(this.$editingArea);\n\n this.$handle.on('mousedown', (event) => {\n if (dom.isControlSizing(event.target)) {\n event.preventDefault();\n event.stopPropagation();\n\n const $target = this.$handle.find('.note-control-selection').data('target');\n const posStart = $target.offset();\n const scrollTop = this.$document.scrollTop();\n\n const onMouseMove = (event) => {\n this.context.invoke('editor.resizeTo', {\n x: event.clientX - posStart.left,\n y: event.clientY - (posStart.top - scrollTop),\n }, $target, !event.shiftKey);\n\n this.update($target[0], event);\n };\n\n this.$document\n .on('mousemove', onMouseMove)\n .one('mouseup', (e) => {\n e.preventDefault();\n this.$document.off('mousemove', onMouseMove);\n this.context.invoke('editor.afterCommand');\n });\n\n if (!$target.data('ratio')) { // original ratio.\n $target.data('ratio', $target.height() / $target.width());\n }\n }\n });\n\n // Listen for scrolling on the handle overlay.\n this.$handle.on('wheel', (e) => {\n e.preventDefault();\n this.update();\n });\n }\n\n destroy() {\n this.$handle.remove();\n }\n\n update(target, event) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isImage = dom.isImg(target);\n const $selection = this.$handle.find('.note-control-selection');\n\n this.context.invoke('imagePopover.update', target, event);\n\n if (isImage) {\n const $image = $(target);\n const position = $image.position();\n const pos = {\n left: position.left + parseInt($image.css('marginLeft'), 10),\n top: position.top + parseInt($image.css('marginTop'), 10),\n };\n\n // exclude margin\n const imageSize = {\n w: $image.outerWidth(false),\n h: $image.outerHeight(false),\n };\n\n $selection.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n width: imageSize.w,\n height: imageSize.h,\n }).data('target', $image); // save current image element.\n\n const origImageObj = new Image();\n origImageObj.src = $image.attr('src');\n\n const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n $selection.find('.note-control-selection-info').text(sizingText);\n this.context.invoke('editor.saveTarget', target);\n } else {\n this.hide();\n }\n\n return isImage;\n }\n\n /**\n * hide\n *\n * @param {jQuery} $handle\n */\n hide() {\n this.context.invoke('editor.clearTarget');\n this.$handle.children().hide();\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport key from '../core/key';\n\nconst defaultScheme = 'http://';\nconst linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|tel:|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n\nexport default class AutoLink {\n constructor(context) {\n this.context = context;\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n initialize() {\n this.lastWordRange = null;\n }\n\n destroy() {\n this.lastWordRange = null;\n }\n\n replace() {\n if (!this.lastWordRange) {\n return;\n }\n\n const keyword = this.lastWordRange.toString();\n const match = keyword.match(linkPattern);\n\n if (match && (match[1] || match[2])) {\n const link = match[1] ? keyword : defaultScheme + keyword;\n const urlText = keyword.replace(/^(?:https?:\\/\\/)?(?:tel?:?)?(?:mailto?:?)?(?:www\\.)?/i, '').split('/')[0];\n const node = $('<a />').html(urlText).attr('href', link)[0];\n if (this.context.options.linkTargetBlank) {\n $(node).attr('target', '_blank');\n }\n\n this.lastWordRange.insertNode(node);\n this.lastWordRange = null;\n this.context.invoke('editor.focus');\n }\n }\n\n handleKeydown(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWordRange = wordRange;\n }\n }\n\n handleKeyup(e) {\n if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n this.replace();\n }\n }\n}\n","import dom from '../core/dom';\n\n/**\n * textarea auto sync.\n */\nexport default class AutoSync {\n constructor(context) {\n this.$note = context.layoutInfo.note;\n this.events = {\n 'summernote.change': () => {\n this.$note.val(context.invoke('code'));\n },\n };\n }\n\n shouldInitialize() {\n return dom.isTextarea(this.$note[0]);\n }\n}\n","import lists from '../core/lists';\nimport dom from '../core/dom';\nimport key from '../core/key';\n\nexport default class AutoReplace {\n constructor(context) {\n this.context = context;\n this.options = context.options.replace || {};\n\n this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n this.previousKeydownCode = null;\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.match;\n }\n\n initialize() {\n this.lastWord = null;\n }\n\n destroy() {\n this.lastWord = null;\n }\n\n replace() {\n if (!this.lastWord) {\n return;\n }\n\n const self = this;\n const keyword = this.lastWord.toString();\n this.options.match(keyword, function(match) {\n if (match) {\n let node = '';\n\n if (typeof match === 'string') {\n node = dom.createText(match);\n } else if (match instanceof jQuery) {\n node = match[0];\n } else if (match instanceof Node) {\n node = match;\n }\n\n if (!node) return;\n self.lastWord.insertNode(node);\n self.lastWord = null;\n self.context.invoke('editor.focus');\n }\n });\n }\n\n handleKeydown(e) {\n // this forces it to remember the last whole word, even if multiple termination keys are pressed\n // before the previous key is let go.\n if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n this.previousKeydownCode = e.keyCode;\n return;\n }\n\n if (lists.contains(this.keys, e.keyCode)) {\n const wordRange = this.context.invoke('editor.createRange').getWordRange();\n this.lastWord = wordRange;\n }\n this.previousKeydownCode = e.keyCode;\n }\n\n handleKeyup(e) {\n if (lists.contains(this.keys, e.keyCode)) {\n this.replace();\n }\n }\n}\n","import $ from 'jquery';\nexport default class Placeholder {\n constructor(context) {\n this.context = context;\n\n this.$editingArea = context.layoutInfo.editingArea;\n this.options = context.options;\n\n if (this.options.inheritPlaceholder === true) {\n // get placeholder value from the original element\n this.options.placeholder = this.context.$note.attr('placeholder') || this.options.placeholder;\n }\n\n this.events = {\n 'summernote.init summernote.change': () => {\n this.update();\n },\n 'summernote.codeview.toggled': () => {\n this.update();\n },\n };\n }\n\n shouldInitialize() {\n return !!this.options.placeholder;\n }\n\n initialize() {\n this.$placeholder = $('<div class=\"note-placeholder\">');\n this.$placeholder.on('click', () => {\n this.context.invoke('focus');\n }).html(this.options.placeholder).prependTo(this.$editingArea);\n\n this.update();\n }\n\n destroy() {\n this.$placeholder.remove();\n }\n\n update() {\n const isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n this.$placeholder.toggle(isShow);\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport env from '../core/env';\n\nexport default class Buttons {\n constructor(context) {\n this.ui = $.summernote.ui;\n this.context = context;\n this.$toolbar = context.layoutInfo.toolbar;\n this.options = context.options;\n this.lang = this.options.langInfo;\n this.invertedKeyMap = func.invertObject(\n this.options.keyMap[env.isMac ? 'mac' : 'pc']\n );\n }\n\n representShortcut(editorMethod) {\n let shortcut = this.invertedKeyMap[editorMethod];\n if (!this.options.shortcuts || !shortcut) {\n return '';\n }\n\n if (env.isMac) {\n shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n }\n\n shortcut = shortcut.replace('BACKSLASH', '\\\\')\n .replace('SLASH', '/')\n .replace('LEFTBRACKET', '[')\n .replace('RIGHTBRACKET', ']');\n\n return ' (' + shortcut + ')';\n }\n\n button(o) {\n if (!this.options.tooltip && o.tooltip) {\n delete o.tooltip;\n }\n o.container = this.options.container;\n return this.ui.button(o);\n }\n\n initialize() {\n this.addToolbarButtons();\n this.addImagePopoverButtons();\n this.addLinkPopoverButtons();\n this.addTablePopoverButtons();\n this.fontInstalledMap = {};\n }\n\n destroy() {\n delete this.fontInstalledMap;\n }\n\n isFontInstalled(name) {\n if (!Object.prototype.hasOwnProperty.call(this.fontInstalledMap, name)) {\n this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n lists.contains(this.options.fontNamesIgnoreCheck, name);\n }\n return this.fontInstalledMap[name];\n }\n\n isFontDeservedToAdd(name) {\n name = name.toLowerCase();\n return (name !== '' && this.isFontInstalled(name) && env.genericFontFamilies.indexOf(name) === -1);\n }\n\n colorPalette(className, tooltip, backColor, foreColor) {\n return this.ui.buttonGroup({\n className: 'note-color ' + className,\n children: [\n this.button({\n className: 'note-current-color-button',\n contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n tooltip: tooltip,\n click: (e) => {\n const $button = $(e.currentTarget);\n if (backColor && foreColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n foreColor: $button.attr('data-foreColor'),\n });\n } else if (backColor) {\n this.context.invoke('editor.color', {\n backColor: $button.attr('data-backColor'),\n });\n } else if (foreColor) {\n this.context.invoke('editor.color', {\n foreColor: $button.attr('data-foreColor'),\n });\n }\n },\n callback: ($button) => {\n const $recentColor = $button.find('.note-recent-color');\n if (backColor) {\n $recentColor.css('background-color', this.options.colorButton.backColor);\n $button.attr('data-backColor', this.options.colorButton.backColor);\n }\n if (foreColor) {\n $recentColor.css('color', this.options.colorButton.foreColor);\n $button.attr('data-foreColor', this.options.colorButton.foreColor);\n } else {\n $recentColor.css('color', 'transparent');\n }\n },\n }),\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('', this.options),\n tooltip: this.lang.color.more,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n items: (backColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n this.lang.color.transparent,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"backColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n '</div>',\n '<div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n '</div>',\n ].join('') : '') +\n (foreColor ? [\n '<div class=\"note-palette\">',\n '<div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n '<div>',\n '<button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n this.lang.color.resetToDefault,\n '</button>',\n '</div>',\n '<div class=\"note-holder\" data-event=\"foreColor\"/>',\n '<div>',\n '<button type=\"button\" class=\"note-color-select btn btn-light\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n this.lang.color.cpSelect,\n '</button>',\n '<input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n '</div>', // Fix missing Div, Commented to find easily if it's wrong\n '<div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n '</div>',\n ].join('') : ''),\n callback: ($dropdown) => {\n $dropdown.find('.note-holder').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: this.options.colors,\n colorsName: this.options.colorsName,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n /* TODO: do we have to record recent custom colors within cookies? */\n var customColors = [\n ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n ];\n $dropdown.find('.note-holder-custom').each((idx, item) => {\n const $holder = $(item);\n $holder.append(this.ui.palette({\n colors: customColors,\n colorsName: customColors,\n eventName: $holder.data('event'),\n container: this.options.container,\n tooltip: this.options.tooltip,\n }).render());\n });\n $dropdown.find('input[type=color]').each((idx, item) => {\n $(item).change(function() {\n const $chip = $dropdown.find('#' + $(this).data('event')).find('.note-color-btn').first();\n const color = this.value.toUpperCase();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $chip.click();\n });\n });\n },\n click: (event) => {\n event.stopPropagation();\n\n const $parent = $('.' + className).find('.note-dropdown-menu');\n const $button = $(event.target);\n const eventName = $button.data('event');\n const value = $button.attr('data-value');\n\n if (eventName === 'openPalette') {\n const $picker = $parent.find('#' + value);\n const $palette = $($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n\n // Shift palette chips\n const $chip = $palette.find('.note-color-btn').last().detach();\n\n // Set chip attributes\n const color = $picker.val();\n $chip.css('background-color', color)\n .attr('aria-label', color)\n .attr('data-value', color)\n .attr('data-original-title', color);\n $palette.prepend($chip);\n $picker.click();\n } else {\n if (lists.contains(['backColor', 'foreColor'], eventName)) {\n const key = eventName === 'backColor' ? 'background-color' : 'color';\n const $color = $button.closest('.note-color').find('.note-recent-color');\n const $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n\n $color.css(key, value);\n $currentButton.attr('data-' + eventName, value);\n }\n this.context.invoke('editor.' + eventName, value);\n }\n },\n }),\n ],\n }).render();\n }\n\n addToolbarButtons() {\n this.context.memo('button.style', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n this.ui.icon(this.options.icons.magic), this.options\n ),\n tooltip: this.lang.style.style,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n className: 'dropdown-style',\n items: this.options.styleTags,\n title: this.lang.style.style,\n template: (item) => {\n // TBD: need to be simplified\n if (typeof item === 'string') {\n item = {\n tag: item,\n title: (Object.prototype.hasOwnProperty.call(this.lang.style, item) ? this.lang.style[item] : item),\n };\n }\n\n const tag = item.tag;\n const title = item.title;\n const style = item.style ? ' style=\"' + item.style + '\" ' : '';\n const className = item.className ? ' class=\"' + item.className + '\"' : '';\n\n return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n },\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }),\n ]).render();\n });\n\n for (let styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n const item = this.options.styleTags[styleIdx];\n\n this.context.memo('button.style.' + item, () => {\n return this.button({\n className: 'note-btn-style-' + item,\n contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n tooltip: this.lang.style[item],\n click: this.context.createInvokeHandler('editor.formatBlock'),\n }).render();\n });\n }\n\n this.context.memo('button.bold', () => {\n return this.button({\n className: 'note-btn-bold',\n contents: this.ui.icon(this.options.icons.bold),\n tooltip: this.lang.font.bold + this.representShortcut('bold'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.bold'),\n }).render();\n });\n\n this.context.memo('button.italic', () => {\n return this.button({\n className: 'note-btn-italic',\n contents: this.ui.icon(this.options.icons.italic),\n tooltip: this.lang.font.italic + this.representShortcut('italic'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.italic'),\n }).render();\n });\n\n this.context.memo('button.underline', () => {\n return this.button({\n className: 'note-btn-underline',\n contents: this.ui.icon(this.options.icons.underline),\n tooltip: this.lang.font.underline + this.representShortcut('underline'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.underline'),\n }).render();\n });\n\n this.context.memo('button.clear', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.eraser),\n tooltip: this.lang.font.clear + this.representShortcut('removeFormat'),\n click: this.context.createInvokeHandler('editor.removeFormat'),\n }).render();\n });\n\n this.context.memo('button.strikethrough', () => {\n return this.button({\n className: 'note-btn-strikethrough',\n contents: this.ui.icon(this.options.icons.strikethrough),\n tooltip: this.lang.font.strikethrough + this.representShortcut('strikethrough'),\n click: this.context.createInvokeHandlerAndUpdateState('editor.strikethrough'),\n }).render();\n });\n\n this.context.memo('button.superscript', () => {\n return this.button({\n className: 'note-btn-superscript',\n contents: this.ui.icon(this.options.icons.superscript),\n tooltip: this.lang.font.superscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.superscript'),\n }).render();\n });\n\n this.context.memo('button.subscript', () => {\n return this.button({\n className: 'note-btn-subscript',\n contents: this.ui.icon(this.options.icons.subscript),\n tooltip: this.lang.font.subscript,\n click: this.context.createInvokeHandlerAndUpdateState('editor.subscript'),\n }).render();\n });\n\n this.context.memo('button.fontname', () => {\n const styleInfo = this.context.invoke('editor.currentStyle');\n\n if (this.options.addDefaultFonts) {\n // Add 'default' fonts into the fontnames array if not exist\n $.each(styleInfo['font-family'].split(','), (idx, fontname) => {\n fontname = fontname.trim().replace(/['\"]+/g, '');\n if (this.isFontDeservedToAdd(fontname)) {\n if (this.options.fontNames.indexOf(fontname) === -1) {\n this.options.fontNames.push(fontname);\n }\n }\n });\n }\n\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(\n '<span class=\"note-current-fontname\"/>', this.options\n ),\n tooltip: this.lang.font.name,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontname',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontNames.filter(this.isFontInstalled.bind(this)),\n title: this.lang.font.name,\n template: (item) => {\n return '<span style=\"font-family: ' + env.validFontName(item) + '\">' + item + '</span>';\n },\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontName'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsize', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', this.options),\n tooltip: this.lang.font.size,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsize',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizes,\n title: this.lang.font.size,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSize'),\n }),\n ]).render();\n });\n\n this.context.memo('button.fontsizeunit', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents('<span class=\"note-current-fontsizeunit\"/>', this.options),\n tooltip: this.lang.font.sizeunit,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n className: 'dropdown-fontsizeunit',\n checkClassName: this.options.icons.menuCheck,\n items: this.options.fontSizeUnits,\n title: this.lang.font.sizeunit,\n click: this.context.createInvokeHandlerAndUpdateState('editor.fontSizeUnit'),\n }),\n ]).render();\n });\n\n this.context.memo('button.color', () => {\n return this.colorPalette('note-color-all', this.lang.color.recent, true, true);\n });\n\n this.context.memo('button.forecolor', () => {\n return this.colorPalette('note-color-fore', this.lang.color.foreground, false, true);\n });\n\n this.context.memo('button.backcolor', () => {\n return this.colorPalette('note-color-back', this.lang.color.background, true, false);\n });\n\n this.context.memo('button.ul', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unorderedlist),\n tooltip: this.lang.lists.unordered + this.representShortcut('insertUnorderedList'),\n click: this.context.createInvokeHandler('editor.insertUnorderedList'),\n }).render();\n });\n\n this.context.memo('button.ol', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.orderedlist),\n tooltip: this.lang.lists.ordered + this.representShortcut('insertOrderedList'),\n click: this.context.createInvokeHandler('editor.insertOrderedList'),\n }).render();\n });\n\n const justifyLeft = this.button({\n contents: this.ui.icon(this.options.icons.alignLeft),\n tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n click: this.context.createInvokeHandler('editor.justifyLeft'),\n });\n\n const justifyCenter = this.button({\n contents: this.ui.icon(this.options.icons.alignCenter),\n tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n click: this.context.createInvokeHandler('editor.justifyCenter'),\n });\n\n const justifyRight = this.button({\n contents: this.ui.icon(this.options.icons.alignRight),\n tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n click: this.context.createInvokeHandler('editor.justifyRight'),\n });\n\n const justifyFull = this.button({\n contents: this.ui.icon(this.options.icons.alignJustify),\n tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n click: this.context.createInvokeHandler('editor.justifyFull'),\n });\n\n const outdent = this.button({\n contents: this.ui.icon(this.options.icons.outdent),\n tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n click: this.context.createInvokeHandler('editor.outdent'),\n });\n\n const indent = this.button({\n contents: this.ui.icon(this.options.icons.indent),\n tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n click: this.context.createInvokeHandler('editor.indent'),\n });\n\n this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n this.context.memo('button.indent', func.invoke(indent, 'render'));\n\n this.context.memo('button.paragraph', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.alignLeft), this.options),\n tooltip: this.lang.paragraph.paragraph,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown([\n this.ui.buttonGroup({\n className: 'note-align',\n children: [justifyLeft, justifyCenter, justifyRight, justifyFull],\n }),\n this.ui.buttonGroup({\n className: 'note-list',\n children: [outdent, indent],\n }),\n ]),\n ]).render();\n });\n\n this.context.memo('button.height', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.textHeight), this.options),\n tooltip: this.lang.font.height,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdownCheck({\n items: this.options.lineHeights,\n checkClassName: this.options.icons.menuCheck,\n className: 'dropdown-line-height',\n title: this.lang.font.height,\n click: this.context.createInvokeHandler('editor.lineHeight'),\n }),\n ]).render();\n });\n\n this.context.memo('button.table', () => {\n return this.ui.buttonGroup([\n this.button({\n className: 'dropdown-toggle',\n contents: this.ui.dropdownButtonContents(this.ui.icon(this.options.icons.table), this.options),\n tooltip: this.lang.table.table,\n data: {\n toggle: 'dropdown',\n },\n }),\n this.ui.dropdown({\n title: this.lang.table.table,\n className: 'note-table',\n items: [\n '<div class=\"note-dimension-picker\">',\n '<div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n '<div class=\"note-dimension-picker-highlighted\"/>',\n '<div class=\"note-dimension-picker-unhighlighted\"/>',\n '</div>',\n '<div class=\"note-dimension-display\">1 x 1</div>',\n ].join(''),\n }),\n ], {\n callback: ($node) => {\n const $catcher = $node.find('.note-dimension-picker-mousecatcher');\n $catcher.css({\n width: this.options.insertTableMaxSize.col + 'em',\n height: this.options.insertTableMaxSize.row + 'em',\n }).mousedown(this.context.createInvokeHandler('editor.insertTable'))\n .on('mousemove', this.tableMoveHandler.bind(this));\n },\n }).render();\n });\n\n this.context.memo('button.link', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.link + this.representShortcut('linkDialog.show'),\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.picture', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.picture),\n tooltip: this.lang.image.image,\n click: this.context.createInvokeHandler('imageDialog.show'),\n }).render();\n });\n\n this.context.memo('button.video', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.video),\n tooltip: this.lang.video.video,\n click: this.context.createInvokeHandler('videoDialog.show'),\n }).render();\n });\n\n this.context.memo('button.hr', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.minus),\n tooltip: this.lang.hr.insert + this.representShortcut('insertHorizontalRule'),\n click: this.context.createInvokeHandler('editor.insertHorizontalRule'),\n }).render();\n });\n\n this.context.memo('button.fullscreen', () => {\n return this.button({\n className: 'btn-fullscreen',\n contents: this.ui.icon(this.options.icons.arrowsAlt),\n tooltip: this.lang.options.fullscreen,\n click: this.context.createInvokeHandler('fullscreen.toggle'),\n }).render();\n });\n\n this.context.memo('button.codeview', () => {\n return this.button({\n className: 'btn-codeview',\n contents: this.ui.icon(this.options.icons.code),\n tooltip: this.lang.options.codeview,\n click: this.context.createInvokeHandler('codeview.toggle'),\n }).render();\n });\n\n this.context.memo('button.redo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.redo),\n tooltip: this.lang.history.redo + this.representShortcut('redo'),\n click: this.context.createInvokeHandler('editor.redo'),\n }).render();\n });\n\n this.context.memo('button.undo', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.undo),\n tooltip: this.lang.history.undo + this.representShortcut('undo'),\n click: this.context.createInvokeHandler('editor.undo'),\n }).render();\n });\n\n this.context.memo('button.help', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.question),\n tooltip: this.lang.options.help,\n click: this.context.createInvokeHandler('helpDialog.show'),\n }).render();\n });\n }\n\n /**\n * image: [\n * ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n * ['float', ['floatLeft', 'floatRight', 'floatNone']],\n * ['remove', ['removeMedia']],\n * ],\n */\n addImagePopoverButtons() {\n // Image Size Buttons\n this.context.memo('button.resizeFull', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">100%</span>',\n tooltip: this.lang.image.resizeFull,\n click: this.context.createInvokeHandler('editor.resize', '1'),\n }).render();\n });\n this.context.memo('button.resizeHalf', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">50%</span>',\n tooltip: this.lang.image.resizeHalf,\n click: this.context.createInvokeHandler('editor.resize', '0.5'),\n }).render();\n });\n this.context.memo('button.resizeQuarter', () => {\n return this.button({\n contents: '<span class=\"note-fontsize-10\">25%</span>',\n tooltip: this.lang.image.resizeQuarter,\n click: this.context.createInvokeHandler('editor.resize', '0.25'),\n }).render();\n });\n this.context.memo('button.resizeNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.resizeNone,\n click: this.context.createInvokeHandler('editor.resize', '0'),\n }).render();\n });\n\n // Float Buttons\n this.context.memo('button.floatLeft', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatLeft),\n tooltip: this.lang.image.floatLeft,\n click: this.context.createInvokeHandler('editor.floatMe', 'left'),\n }).render();\n });\n\n this.context.memo('button.floatRight', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.floatRight),\n tooltip: this.lang.image.floatRight,\n click: this.context.createInvokeHandler('editor.floatMe', 'right'),\n }).render();\n });\n\n this.context.memo('button.floatNone', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.rollback),\n tooltip: this.lang.image.floatNone,\n click: this.context.createInvokeHandler('editor.floatMe', 'none'),\n }).render();\n });\n\n // Remove Buttons\n this.context.memo('button.removeMedia', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.image.remove,\n click: this.context.createInvokeHandler('editor.removeMedia'),\n }).render();\n });\n }\n\n addLinkPopoverButtons() {\n this.context.memo('button.linkDialogShow', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.link),\n tooltip: this.lang.link.edit,\n click: this.context.createInvokeHandler('linkDialog.show'),\n }).render();\n });\n\n this.context.memo('button.unlink', () => {\n return this.button({\n contents: this.ui.icon(this.options.icons.unlink),\n tooltip: this.lang.link.unlink,\n click: this.context.createInvokeHandler('editor.unlink'),\n }).render();\n });\n }\n\n /**\n * table : [\n * ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n * ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n * ],\n */\n addTablePopoverButtons() {\n this.context.memo('button.addRowUp', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowAbove),\n tooltip: this.lang.table.addRowAbove,\n click: this.context.createInvokeHandler('editor.addRow', 'top'),\n }).render();\n });\n this.context.memo('button.addRowDown', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowBelow),\n tooltip: this.lang.table.addRowBelow,\n click: this.context.createInvokeHandler('editor.addRow', 'bottom'),\n }).render();\n });\n this.context.memo('button.addColLeft', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colBefore),\n tooltip: this.lang.table.addColLeft,\n click: this.context.createInvokeHandler('editor.addCol', 'left'),\n }).render();\n });\n this.context.memo('button.addColRight', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colAfter),\n tooltip: this.lang.table.addColRight,\n click: this.context.createInvokeHandler('editor.addCol', 'right'),\n }).render();\n });\n this.context.memo('button.deleteRow', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.rowRemove),\n tooltip: this.lang.table.delRow,\n click: this.context.createInvokeHandler('editor.deleteRow'),\n }).render();\n });\n this.context.memo('button.deleteCol', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.colRemove),\n tooltip: this.lang.table.delCol,\n click: this.context.createInvokeHandler('editor.deleteCol'),\n }).render();\n });\n this.context.memo('button.deleteTable', () => {\n return this.button({\n className: 'btn-md',\n contents: this.ui.icon(this.options.icons.trash),\n tooltip: this.lang.table.delTable,\n click: this.context.createInvokeHandler('editor.deleteTable'),\n }).render();\n });\n }\n\n build($container, groups) {\n for (let groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n const group = groups[groupIdx];\n const groupName = Array.isArray(group) ? group[0] : group;\n const buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n\n const $group = this.ui.buttonGroup({\n className: 'note-' + groupName,\n }).render();\n\n for (let idx = 0, len = buttons.length; idx < len; idx++) {\n const btn = this.context.memo('button.' + buttons[idx]);\n if (btn) {\n $group.append(typeof btn === 'function' ? btn(this.context) : btn);\n }\n }\n $group.appendTo($container);\n }\n }\n\n /**\n * @param {jQuery} [$container]\n */\n updateCurrentStyle($container) {\n const $cont = $container || this.$toolbar;\n\n const styleInfo = this.context.invoke('editor.currentStyle');\n this.updateBtnStates($cont, {\n '.note-btn-bold': () => {\n return styleInfo['font-bold'] === 'bold';\n },\n '.note-btn-italic': () => {\n return styleInfo['font-italic'] === 'italic';\n },\n '.note-btn-underline': () => {\n return styleInfo['font-underline'] === 'underline';\n },\n '.note-btn-subscript': () => {\n return styleInfo['font-subscript'] === 'subscript';\n },\n '.note-btn-superscript': () => {\n return styleInfo['font-superscript'] === 'superscript';\n },\n '.note-btn-strikethrough': () => {\n return styleInfo['font-strikethrough'] === 'strikethrough';\n },\n });\n\n if (styleInfo['font-family']) {\n const fontNames = styleInfo['font-family'].split(',').map((name) => {\n return name.replace(/[\\'\\\"]/g, '')\n .replace(/\\s+$/, '')\n .replace(/^\\s+/, '');\n });\n const fontName = lists.find(fontNames, this.isFontInstalled.bind(this));\n\n $cont.find('.dropdown-fontname a').each((idx, item) => {\n const $item = $(item);\n // always compare string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontName + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontname').text(fontName).css('font-family', fontName);\n }\n\n if (styleInfo['font-size']) {\n const fontSize = styleInfo['font-size'];\n $cont.find('.dropdown-fontsize a').each((idx, item) => {\n const $item = $(item);\n // always compare with string to avoid creating another func.\n const isChecked = ($item.data('value') + '') === (fontSize + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsize').text(fontSize);\n\n const fontSizeUnit = styleInfo['font-size-unit'];\n $cont.find('.dropdown-fontsizeunit a').each((idx, item) => {\n const $item = $(item);\n const isChecked = ($item.data('value') + '') === (fontSizeUnit + '');\n $item.toggleClass('checked', isChecked);\n });\n $cont.find('.note-current-fontsizeunit').text(fontSizeUnit);\n }\n\n if (styleInfo['line-height']) {\n const lineHeight = styleInfo['line-height'];\n $cont.find('.dropdown-line-height li a').each((idx, item) => {\n // always compare with string to avoid creating another func.\n const isChecked = ($(item).data('value') + '') === (lineHeight + '');\n this.className = isChecked ? 'checked' : '';\n });\n }\n }\n\n updateBtnStates($container, infos) {\n $.each(infos, (selector, pred) => {\n this.ui.toggleBtnActive($container.find(selector), pred());\n });\n }\n\n tableMoveHandler(event) {\n const PX_PER_EM = 18;\n const $picker = $(event.target.parentNode); // target is mousecatcher\n const $dimensionDisplay = $picker.next();\n const $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n const $highlighted = $picker.find('.note-dimension-picker-highlighted');\n const $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n\n let posOffset;\n // HTML5 with jQuery - e.offsetX is undefined in Firefox\n if (event.offsetX === undefined) {\n const posCatcher = $(event.target).offset();\n posOffset = {\n x: event.pageX - posCatcher.left,\n y: event.pageY - posCatcher.top,\n };\n } else {\n posOffset = {\n x: event.offsetX,\n y: event.offsetY,\n };\n }\n\n const dim = {\n c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n r: Math.ceil(posOffset.y / PX_PER_EM) || 1,\n };\n\n $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n $catcher.data('value', dim.c + 'x' + dim.r);\n\n if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n $unhighlighted.css({ width: dim.c + 1 + 'em' });\n }\n\n if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n $unhighlighted.css({ height: dim.r + 1 + 'em' });\n }\n\n $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n }\n}\n","import $ from 'jquery';\nexport default class Toolbar {\n constructor(context) {\n this.context = context;\n\n this.$window = $(window);\n this.$document = $(document);\n\n this.ui = $.summernote.ui;\n this.$note = context.layoutInfo.note;\n this.$editor = context.layoutInfo.editor;\n this.$toolbar = context.layoutInfo.toolbar;\n this.$editable = context.layoutInfo.editable;\n this.$statusbar = context.layoutInfo.statusbar;\n this.options = context.options;\n\n this.isFollowing = false;\n this.followScroll = this.followScroll.bind(this);\n }\n\n shouldInitialize() {\n return !this.options.airMode;\n }\n\n initialize() {\n this.options.toolbar = this.options.toolbar || [];\n\n if (!this.options.toolbar.length) {\n this.$toolbar.hide();\n } else {\n this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n }\n\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n\n this.changeContainer(false);\n\n this.$note.on('summernote.keyup summernote.mouseup summernote.change', () => {\n this.context.invoke('buttons.updateCurrentStyle');\n });\n\n this.context.invoke('buttons.updateCurrentStyle');\n if (this.options.followingToolbar) {\n this.$window.on('scroll resize', this.followScroll);\n }\n }\n\n destroy() {\n this.$toolbar.children().remove();\n\n if (this.options.followingToolbar) {\n this.$window.off('scroll resize', this.followScroll);\n }\n }\n\n followScroll() {\n if (this.$editor.hasClass('fullscreen')) {\n return false;\n }\n\n const editorHeight = this.$editor.outerHeight();\n const editorWidth = this.$editor.width();\n const toolbarHeight = this.$toolbar.height();\n const statusbarHeight = this.$statusbar.height();\n\n // check if the web app is currently using another static bar\n let otherBarHeight = 0;\n if (this.options.otherStaticBar) {\n otherBarHeight = $(this.options.otherStaticBar).outerHeight();\n }\n\n const currentOffset = this.$document.scrollTop();\n const editorOffsetTop = this.$editor.offset().top;\n const editorOffsetBottom = editorOffsetTop + editorHeight;\n const activateOffset = editorOffsetTop - otherBarHeight;\n const deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n\n if (!this.isFollowing &&\n (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n this.isFollowing = true;\n this.$editable.css({\n marginTop: this.$toolbar.outerHeight(),\n });\n this.$toolbar.css({\n position: 'fixed',\n top: otherBarHeight,\n width: editorWidth,\n zIndex: 1000,\n });\n } else if (this.isFollowing &&\n ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n this.isFollowing = false;\n this.$toolbar.css({\n position: 'relative',\n top: 0,\n width: '100%',\n zIndex: 'auto',\n });\n this.$editable.css({\n marginTop: '',\n });\n }\n }\n\n changeContainer(isFullscreen) {\n if (isFullscreen) {\n this.$toolbar.prependTo(this.$editor);\n } else {\n if (this.options.toolbarContainer) {\n this.$toolbar.appendTo(this.options.toolbarContainer);\n }\n }\n if (this.options.followingToolbar) {\n this.followScroll();\n }\n }\n\n updateFullscreen(isFullscreen) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n\n this.changeContainer(isFullscreen);\n }\n\n updateCodeview(isCodeview) {\n this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n if (isCodeview) {\n this.deactivate();\n } else {\n this.activate();\n }\n }\n\n activate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, true);\n }\n\n deactivate(isIncludeCodeview) {\n let $btn = this.$toolbar.find('button');\n if (!isIncludeCodeview) {\n $btn = $btn.not('.btn-codeview').not('.btn-fullscreen');\n }\n this.ui.toggleBtn($btn, false);\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\nimport func from '../core/func';\n\nexport default class LinkDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n\n context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-txt-${this.options.id}\" class=\"note-form-label\">${this.lang.link.textToDisplay}</label>`,\n `<input id=\"note-dialog-link-txt-${this.options.id}\" class=\"note-link-text form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n '<div class=\"form-group note-form-group\">',\n `<label for=\"note-dialog-link-url-${this.options.id}\" class=\"note-form-label\">${this.lang.link.url}</label>`,\n `<input id=\"note-dialog-link-url-${this.options.id}\" class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\"/>`,\n '</div>',\n !this.options.disableLinkTarget\n ? $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-open-in-new-window',\n text: this.lang.link.openInNewWindow,\n checked: true,\n }).render()).html()\n : '',\n $('<div/>').append(this.ui.checkbox({\n className: 'sn-checkbox-use-protocol',\n text: this.lang.link.useProtocol,\n checked: true,\n }).render()).html(),\n ].join('');\n\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.link.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n className: 'link-dialog',\n title: this.lang.link.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n /**\n * toggle update button\n */\n toggleLinkBtn($linkBtn, $linkText, $linkUrl) {\n this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n }\n\n /**\n * Show link dialog and set event handlers on dialog controls.\n *\n * @param {Object} linkInfo\n * @return {Promise}\n */\n showLinkDialog(linkInfo) {\n return $.Deferred((deferred) => {\n const $linkText = this.$dialog.find('.note-link-text');\n const $linkUrl = this.$dialog.find('.note-link-url');\n const $linkBtn = this.$dialog.find('.note-link-btn');\n const $openInNewWindow = this.$dialog\n .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n const $useProtocol = this.$dialog\n .find('.sn-checkbox-use-protocol input[type=checkbox]');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // If no url was given and given text is valid URL then copy that into URL Field\n if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n linkInfo.url = linkInfo.text;\n }\n\n $linkText.on('input paste propertychange', () => {\n // If linktext was modified by input events,\n // cloning text from linkUrl will be stopped.\n linkInfo.text = $linkText.val();\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.text);\n\n $linkUrl.on('input paste propertychange', () => {\n // Display same text on `Text to display` as default\n // when linktext has no text\n if (!linkInfo.text) {\n $linkText.val($linkUrl.val());\n }\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n }).val(linkInfo.url);\n\n if (!env.isSupportTouch) {\n $linkUrl.trigger('focus');\n }\n\n this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n this.bindEnterKey($linkUrl, $linkBtn);\n this.bindEnterKey($linkText, $linkBtn);\n\n const isNewWindowChecked = linkInfo.isNewWindow !== undefined\n ? linkInfo.isNewWindow : this.context.options.linkTargetBlank;\n\n $openInNewWindow.prop('checked', isNewWindowChecked);\n\n const useProtocolChecked = linkInfo.url\n ? false : this.context.options.useProtocol;\n\n $useProtocol.prop('checked', useProtocolChecked);\n\n $linkBtn.one('click', (event) => {\n event.preventDefault();\n\n deferred.resolve({\n range: linkInfo.range,\n url: $linkUrl.val(),\n text: $linkText.val(),\n isNewWindow: $openInNewWindow.is(':checked'),\n checkProtocol: $useProtocol.is(':checked'),\n });\n this.ui.hideDialog(this.$dialog);\n });\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n // detach events\n $linkText.off();\n $linkUrl.off();\n $linkBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n /**\n * @param {Object} layoutInfo\n */\n show() {\n const linkInfo = this.context.invoke('editor.getLinkInfo');\n\n this.context.invoke('editor.saveRange');\n this.showLinkDialog(linkInfo).then((linkInfo) => {\n this.context.invoke('editor.restoreRange');\n this.context.invoke('editor.createLink', linkInfo);\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class LinkPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.keyup summernote.mouseup summernote.change summernote.scroll': () => {\n this.update();\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.link);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-link-popover',\n callback: ($node) => {\n const $content = $node.find('.popover-content,.note-popover-content');\n $content.prepend('<span><a target=\"_blank\"></a> </span>');\n },\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.link);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update() {\n // Prevent focusing on editable when invoke('code') is executed\n if (!this.context.invoke('editor.hasFocus')) {\n this.hide();\n return;\n }\n\n const rng = this.context.invoke('editor.getLastRange');\n if (rng.isCollapsed() && rng.isOnAnchor()) {\n const anchor = dom.ancestor(rng.sc, dom.isAnchor);\n const href = $(anchor).attr('href');\n this.$popover.find('a').attr('href', href).text(href);\n\n const pos = dom.posFromPlaceholder(anchor);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class ImageDialog {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n let imageLimitation = '';\n if (this.options.maximumImageFileSize) {\n const unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n const readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n ' ' + ' KMGTP'[unit] + 'B';\n imageLimitation = `<small>${this.lang.image.maximumFileSize + ' : ' + readableSize}</small>`;\n }\n\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group note-group-select-from-files\">',\n '<label for=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n '<input id=\"note-dialog-image-file-' + this.options.id + '\" class=\"note-image-input form-control-file note-form-control note-input\" ',\n ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\"/>',\n imageLimitation,\n '</div>',\n '<div class=\"form-group note-group-image-url\">',\n '<label for=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-form-label\">' + this.lang.image.url + '</label>',\n '<input id=\"note-dialog-image-url-' + this.options.id + '\" class=\"note-image-url form-control note-form-control note-input\" type=\"text\"/>',\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.image.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.image.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showImageDialog().then((data) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n if (typeof data === 'string') { // image url\n // If onImageLinkInsert set,\n if (this.options.callbacks.onImageLinkInsert) {\n this.context.triggerEvent('image.link.insert', data);\n } else {\n this.context.invoke('editor.insertImage', data);\n }\n } else { // array of files\n this.context.invoke('editor.insertImagesOrCallback', data);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show image dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showImageDialog() {\n return $.Deferred((deferred) => {\n const $imageInput = this.$dialog.find('.note-image-input');\n const $imageUrl = this.$dialog.find('.note-image-url');\n const $imageBtn = this.$dialog.find('.note-image-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n // Cloning imageInput to clear element.\n $imageInput.replaceWith($imageInput.clone().on('change', (event) => {\n deferred.resolve(event.target.files || event.target.value);\n }).val(''));\n\n $imageUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($imageBtn, $imageUrl.val());\n }).val('');\n\n if (!env.isSupportTouch) {\n $imageUrl.trigger('focus');\n }\n\n $imageBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($imageUrl.val());\n });\n\n this.bindEnterKey($imageUrl, $imageBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $imageInput.off();\n $imageUrl.off();\n $imageBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\n/**\n * Image popover module\n * mouse events that show/hide popover will be handled by Handle.js.\n * Handle.js will receive the events and invoke 'imagePopover.update'.\n */\nexport default class ImagePopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n\n this.editable = context.layoutInfo.editable[0];\n this.options = context.options;\n\n this.events = {\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.image);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-image-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n this.context.invoke('buttons.build', $content, this.options.popover.image);\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target, event) {\n if (dom.isImg(target)) {\n const position = $(target).offset();\n const containerOffset = $(this.options.container).offset();\n let pos = {};\n if (this.options.popatmouse) {\n pos.left = event.pageX - 20;\n pos.top = event.pageY;\n } else {\n pos = position;\n }\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\n\nexport default class TablePopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.options = context.options;\n this.events = {\n 'summernote.mousedown': (we, e) => {\n this.update(e.target);\n },\n 'summernote.keyup summernote.scroll summernote.change': () => {\n this.update();\n },\n 'summernote.disable summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return !lists.isEmpty(this.options.popover.table);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-table-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content,.note-popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.table);\n\n // [workaround] Disable Firefox's default table editor\n if (env.isFF) {\n document.execCommand('enableInlineTableEditing', false, false);\n }\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(target) {\n if (this.context.isDisabled()) {\n return false;\n }\n\n const isCell = dom.isCell(target);\n\n if (isCell) {\n const pos = dom.posFromPlaceholder(target);\n const containerOffset = $(this.options.container).offset();\n pos.top -= containerOffset.top;\n pos.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: pos.left,\n top: pos.top,\n });\n } else {\n this.hide();\n }\n\n return isCell;\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\nimport key from '../core/key';\n\nexport default class VideoDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<div class=\"form-group note-form-group row-fluid\">',\n `<label for=\"note-dialog-video-url-${this.options.id}\" class=\"note-form-label\">${this.lang.video.url} <small class=\"text-muted\">${this.lang.video.providers}</small></label>`,\n `<input id=\"note-dialog-video-url-${this.options.id}\" class=\"note-video-url form-control note-form-control note-input\" type=\"text\"/>`,\n '</div>',\n ].join('');\n const buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n const footer = `<input type=\"button\" href=\"#\" class=\"${buttonClass}\" value=\"${this.lang.video.insert}\" disabled>`;\n\n this.$dialog = this.ui.dialog({\n title: this.lang.video.insert,\n fade: this.options.dialogsFade,\n body: body,\n footer: footer,\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n bindEnterKey($input, $btn) {\n $input.on('keypress', (event) => {\n if (event.keyCode === key.code.ENTER) {\n event.preventDefault();\n $btn.trigger('click');\n }\n });\n }\n\n createVideoNode(url) {\n // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n const ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n const ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n const ytMatch = url.match(ytRegExp);\n\n const igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n const igMatch = url.match(igRegExp);\n\n const vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n const vMatch = url.match(vRegExp);\n\n const vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n const vimMatch = url.match(vimRegExp);\n\n const dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n const dmMatch = url.match(dmRegExp);\n\n const youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n const youkuMatch = url.match(youkuRegExp);\n\n const qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n const qqMatch = url.match(qqRegExp);\n\n const qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n const qqMatch2 = url.match(qqRegExp2);\n\n const mp4RegExp = /^.+.(mp4|m4v)$/;\n const mp4Match = url.match(mp4RegExp);\n\n const oggRegExp = /^.+.(ogg|ogv)$/;\n const oggMatch = url.match(oggRegExp);\n\n const webmRegExp = /^.+.(webm)$/;\n const webmMatch = url.match(webmRegExp);\n\n const fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n const fbMatch = url.match(fbRegExp);\n\n let $video;\n if (ytMatch && ytMatch[1].length === 11) {\n const youtubeId = ytMatch[1];\n var start = 0;\n if (typeof ytMatch[2] !== 'undefined') {\n const ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n if (ytMatchForStart) {\n for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n }\n }\n }\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n .attr('width', '640').attr('height', '360');\n } else if (igMatch && igMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n .attr('width', '612').attr('height', '710')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else if (vMatch && vMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', vMatch[0] + '/embed/simple')\n .attr('width', '600').attr('height', '600')\n .attr('class', 'vine-embed');\n } else if (vimMatch && vimMatch[3].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n .attr('width', '640').attr('height', '360');\n } else if (dmMatch && dmMatch[2].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n .attr('width', '640').attr('height', '360');\n } else if (youkuMatch && youkuMatch[1].length) {\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '498')\n .attr('width', '510')\n .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n } else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n const vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n .attr('frameborder', 0)\n .attr('height', '310')\n .attr('width', '500')\n .attr('src', 'https://v.qq.com/iframe/player.html?vid=' + vid + '&auto=0');\n } else if (mp4Match || oggMatch || webmMatch) {\n $video = $('<video controls>')\n .attr('src', url)\n .attr('width', '640').attr('height', '360');\n } else if (fbMatch && fbMatch[0].length) {\n $video = $('<iframe>')\n .attr('frameborder', 0)\n .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n .attr('width', '560').attr('height', '301')\n .attr('scrolling', 'no')\n .attr('allowtransparency', 'true');\n } else {\n // this is not a known video link. Now what, Cat? Now what?\n return false;\n }\n\n $video.addClass('note-video-clip');\n\n return $video[0];\n }\n\n show() {\n const text = this.context.invoke('editor.getSelectedText');\n this.context.invoke('editor.saveRange');\n this.showVideoDialog(text).then((url) => {\n // [workaround] hide dialog before restore range for IE range focus\n this.ui.hideDialog(this.$dialog);\n this.context.invoke('editor.restoreRange');\n\n // build node\n const $node = this.createVideoNode(url);\n\n if ($node) {\n // insert video node\n this.context.invoke('editor.insertNode', $node);\n }\n }).fail(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n\n /**\n * show video dialog\n *\n * @param {jQuery} $dialog\n * @return {Promise}\n */\n showVideoDialog(/* text */) {\n return $.Deferred((deferred) => {\n const $videoUrl = this.$dialog.find('.note-video-url');\n const $videoBtn = this.$dialog.find('.note-video-btn');\n\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n\n $videoUrl.on('input paste propertychange', () => {\n this.ui.toggleBtn($videoBtn, $videoUrl.val());\n });\n\n if (!env.isSupportTouch) {\n $videoUrl.trigger('focus');\n }\n\n $videoBtn.click((event) => {\n event.preventDefault();\n deferred.resolve($videoUrl.val());\n });\n\n this.bindEnterKey($videoUrl, $videoBtn);\n });\n\n this.ui.onDialogHidden(this.$dialog, () => {\n $videoUrl.off();\n $videoBtn.off();\n\n if (deferred.state() === 'pending') {\n deferred.reject();\n }\n });\n\n this.ui.showDialog(this.$dialog);\n });\n }\n}\n","import $ from 'jquery';\nimport env from '../core/env';\n\nexport default class HelpDialog {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$body = $(document.body);\n this.$editor = context.layoutInfo.editor;\n this.options = context.options;\n this.lang = this.options.langInfo;\n }\n\n initialize() {\n const $container = this.options.dialogsInBody ? this.$body : this.options.container;\n const body = [\n '<p class=\"text-center\">',\n '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote @@VERSION@@</a> · ',\n '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n '</p>',\n ].join('');\n\n this.$dialog = this.ui.dialog({\n title: this.lang.options.help,\n fade: this.options.dialogsFade,\n body: this.createShortcutList(),\n footer: body,\n callback: ($node) => {\n $node.find('.modal-body,.note-modal-body').css({\n 'max-height': 300,\n 'overflow': 'scroll',\n });\n },\n }).render().appendTo($container);\n }\n\n destroy() {\n this.ui.hideDialog(this.$dialog);\n this.$dialog.remove();\n }\n\n createShortcutList() {\n const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n return Object.keys(keyMap).map((key) => {\n const command = keyMap[key];\n const $row = $('<div><div class=\"help-list-item\"/></div>');\n $row.append($('<label><kbd>' + key + '</kdb></label>').css({\n 'width': 180,\n 'margin-right': 10,\n })).append($('<span/>').html(this.context.memo('help.' + command) || command));\n return $row.html();\n }).join('');\n }\n\n /**\n * show help dialog\n *\n * @return {Promise}\n */\n showHelpDialog() {\n return $.Deferred((deferred) => {\n this.ui.onDialogShown(this.$dialog, () => {\n this.context.triggerEvent('dialog.shown');\n deferred.resolve();\n });\n this.ui.showDialog(this.$dialog);\n }).promise();\n }\n\n show() {\n this.context.invoke('editor.saveRange');\n this.showHelpDialog().then(() => {\n this.context.invoke('editor.restoreRange');\n });\n }\n}\n","import $ from 'jquery';\nimport lists from '../core/lists';\n\nconst AIRMODE_POPOVER_X_OFFSET = -5;\nconst AIRMODE_POPOVER_Y_OFFSET = 5;\n\nexport default class AirPopover {\n constructor(context) {\n this.context = context;\n this.ui = $.summernote.ui;\n this.options = context.options;\n\n this.hidable = true;\n this.onContextmenu = false;\n this.pageX = null;\n this.pageY = null;\n\n this.events = {\n 'summernote.contextmenu': (e) => {\n if (this.options.editing) {\n e.preventDefault();\n e.stopPropagation();\n this.onContextmenu = true;\n this.update(true);\n }\n },\n 'summernote.mousedown': (we, e) => {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n },\n 'summernote.keyup summernote.mouseup summernote.scroll': (we, e) => {\n if (this.options.editing && !this.onContextmenu) {\n this.pageX = e.pageX;\n this.pageY = e.pageY;\n this.update();\n }\n this.onContextmenu = false;\n },\n 'summernote.disable summernote.change summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n 'summernote.focusout': () => {\n if (!this.$popover.is(':active,:focus')) {\n this.hide();\n }\n },\n };\n }\n\n shouldInitialize() {\n return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n }\n\n initialize() {\n this.$popover = this.ui.popover({\n className: 'note-air-popover',\n }).render().appendTo(this.options.container);\n const $content = this.$popover.find('.popover-content');\n\n this.context.invoke('buttons.build', $content, this.options.popover.air);\n\n // disable hiding this popover preemptively by 'summernote.blur' event.\n this.$popover.on('mousedown', () => { this.hidable = false; });\n // (re-)enable hiding after 'summernote.blur' has been handled (aka. ignored).\n this.$popover.on('mouseup', () => { this.hidable = true; });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n update(forcelyOpen) {\n const styleInfo = this.context.invoke('editor.currentStyle');\n if (styleInfo.range && (!styleInfo.range.isCollapsed() || forcelyOpen)) {\n let rect = {\n left: this.pageX,\n top: this.pageY,\n };\n\n const containerOffset = $(this.options.container).offset();\n rect.top -= containerOffset.top;\n rect.left -= containerOffset.left;\n\n this.$popover.css({\n display: 'block',\n left: Math.max(rect.left, 0) + AIRMODE_POPOVER_X_OFFSET,\n top: rect.top + AIRMODE_POPOVER_Y_OFFSET,\n });\n this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n } else {\n this.hide();\n }\n }\n\n hide() {\n if (this.hidable) {\n this.$popover.hide();\n }\n }\n}\n","import $ from 'jquery';\nimport func from '../core/func';\nimport lists from '../core/lists';\nimport dom from '../core/dom';\nimport range from '../core/range';\nimport key from '../core/key';\n\nconst POPOVER_DIST = 5;\n\nexport default class HintPopover {\n constructor(context) {\n this.context = context;\n\n this.ui = $.summernote.ui;\n this.$editable = context.layoutInfo.editable;\n this.options = context.options;\n this.hint = this.options.hint || [];\n this.direction = this.options.hintDirection || 'bottom';\n this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n\n this.events = {\n 'summernote.keyup': (we, e) => {\n if (!e.isDefaultPrevented()) {\n this.handleKeyup(e);\n }\n },\n 'summernote.keydown': (we, e) => {\n this.handleKeydown(e);\n },\n 'summernote.disable summernote.dialog.shown summernote.blur': () => {\n this.hide();\n },\n };\n }\n\n shouldInitialize() {\n return this.hints.length > 0;\n }\n\n initialize() {\n this.lastWordRange = null;\n this.matchingWord = null;\n this.$popover = this.ui.popover({\n className: 'note-hint-popover',\n hideArrow: true,\n direction: '',\n }).render().appendTo(this.options.container);\n\n this.$popover.hide();\n this.$content = this.$popover.find('.popover-content,.note-popover-content');\n this.$content.on('click', '.note-hint-item', (e) => {\n this.$content.find('.active').removeClass('active');\n $(e.currentTarget).addClass('active');\n this.replace();\n });\n\n this.$popover.on('mousedown', (e) => { e.preventDefault(); });\n }\n\n destroy() {\n this.$popover.remove();\n }\n\n selectItem($item) {\n this.$content.find('.active').removeClass('active');\n $item.addClass('active');\n\n this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n }\n\n moveDown() {\n const $current = this.$content.find('.note-hint-item.active');\n const $next = $current.next();\n\n if ($next.length) {\n this.selectItem($next);\n } else {\n let $nextGroup = $current.parent().next();\n\n if (!$nextGroup.length) {\n $nextGroup = this.$content.find('.note-hint-group').first();\n }\n\n this.selectItem($nextGroup.find('.note-hint-item').first());\n }\n }\n\n moveUp() {\n const $current = this.$content.find('.note-hint-item.active');\n const $prev = $current.prev();\n\n if ($prev.length) {\n this.selectItem($prev);\n } else {\n let $prevGroup = $current.parent().prev();\n\n if (!$prevGroup.length) {\n $prevGroup = this.$content.find('.note-hint-group').last();\n }\n\n this.selectItem($prevGroup.find('.note-hint-item').last());\n }\n }\n\n replace() {\n const $item = this.$content.find('.note-hint-item.active');\n\n if ($item.length) {\n var node = this.nodeFromItem($item);\n // If matchingWord length = 0 -> capture OK / open hint / but as mention capture \"\" (\\w*)\n if (this.matchingWord !== null && this.matchingWord.length === 0) {\n this.lastWordRange.so = this.lastWordRange.eo;\n // Else si > 0 and normal case -> adjust range \"before\" for correct position of insertion\n } else if (this.matchingWord !== null && this.matchingWord.length > 0 && !this.lastWordRange.isCollapsed()) {\n let rangeCompute = this.lastWordRange.eo - this.lastWordRange.so - this.matchingWord.length;\n if (rangeCompute > 0) {\n this.lastWordRange.so += rangeCompute;\n }\n }\n this.lastWordRange.insertNode(node);\n\n if (this.options.hintSelect === 'next') {\n var blank = document.createTextNode('');\n $(node).after(blank);\n range.createFromNodeBefore(blank).select();\n } else {\n range.createFromNodeAfter(node).select();\n }\n\n this.lastWordRange = null;\n this.hide();\n this.context.invoke('editor.focus');\n }\n }\n\n nodeFromItem($item) {\n const hint = this.hints[$item.data('index')];\n const item = $item.data('item');\n let node = hint.content ? hint.content(item) : item;\n if (typeof node === 'string') {\n node = dom.createText(node);\n }\n return node;\n }\n\n createItemTemplates(hintIdx, items) {\n const hint = this.hints[hintIdx];\n return items.map((item /*, idx */) => {\n const $item = $('<div class=\"note-hint-item\"/>');\n $item.append(hint.template ? hint.template(item) : item + '');\n $item.data({\n 'index': hintIdx,\n 'item': item,\n });\n return $item;\n });\n }\n\n handleKeydown(e) {\n if (!this.$popover.is(':visible')) {\n return;\n }\n\n if (e.keyCode === key.code.ENTER) {\n e.preventDefault();\n this.replace();\n } else if (e.keyCode === key.code.UP) {\n e.preventDefault();\n this.moveUp();\n } else if (e.keyCode === key.code.DOWN) {\n e.preventDefault();\n this.moveDown();\n }\n }\n\n searchKeyword(index, keyword, callback) {\n const hint = this.hints[index];\n if (hint && hint.match.test(keyword) && hint.search) {\n const matches = hint.match.exec(keyword);\n this.matchingWord = matches[0];\n hint.search(matches[1], callback);\n } else {\n callback();\n }\n }\n\n createGroup(idx, keyword) {\n const $group = $('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n this.searchKeyword(idx, keyword, (items) => {\n items = items || [];\n if (items.length) {\n $group.html(this.createItemTemplates(idx, items));\n this.show();\n }\n });\n\n return $group;\n }\n\n handleKeyup(e) {\n if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n let range = this.context.invoke('editor.getLastRange');\n let wordRange, keyword;\n if (this.options.hintMode === 'words') {\n wordRange = range.getWordsRange(range);\n keyword = wordRange.toString();\n\n this.hints.forEach((hint) => {\n if (hint.match.test(keyword)) {\n wordRange = range.getWordsMatchRange(hint.match);\n return false;\n }\n });\n\n if (!wordRange) {\n this.hide();\n return;\n }\n\n keyword = wordRange.toString();\n } else {\n wordRange = range.getWordRange();\n keyword = wordRange.toString();\n }\n\n if (this.hints.length && keyword) {\n this.$content.empty();\n\n const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n const containerOffset = $(this.options.container).offset();\n if (bnd) {\n bnd.top -= containerOffset.top;\n bnd.left -= containerOffset.left;\n\n this.$popover.hide();\n this.lastWordRange = wordRange;\n this.hints.forEach((hint, idx) => {\n if (hint.match.test(keyword)) {\n this.createGroup(idx, keyword).appendTo(this.$content);\n }\n });\n // select first .note-hint-item\n this.$content.find('.note-hint-item:first').addClass('active');\n\n // set position for popover after group is created\n if (this.direction === 'top') {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST,\n });\n } else {\n this.$popover.css({\n left: bnd.left,\n top: bnd.top + bnd.height + POPOVER_DIST,\n });\n }\n }\n } else {\n this.hide();\n }\n }\n }\n\n show() {\n this.$popover.show();\n }\n\n hide() {\n this.$popover.hide();\n }\n}\n","import $ from 'jquery';\nimport './summernote-en-US';\nimport '../summernote';\nimport dom from './core/dom';\nimport range from './core/range';\nimport lists from './core/lists';\nimport Editor from './module/Editor';\nimport Clipboard from './module/Clipboard';\nimport Dropzone from './module/Dropzone';\nimport Codeview from './module/Codeview';\nimport Statusbar from './module/Statusbar';\nimport Fullscreen from './module/Fullscreen';\nimport Handle from './module/Handle';\nimport AutoLink from './module/AutoLink';\nimport AutoSync from './module/AutoSync';\nimport AutoReplace from './module/AutoReplace';\nimport Placeholder from './module/Placeholder';\nimport Buttons from './module/Buttons';\nimport Toolbar from './module/Toolbar';\nimport LinkDialog from './module/LinkDialog';\nimport LinkPopover from './module/LinkPopover';\nimport ImageDialog from './module/ImageDialog';\nimport ImagePopover from './module/ImagePopover';\nimport TablePopover from './module/TablePopover';\nimport VideoDialog from './module/VideoDialog';\nimport HelpDialog from './module/HelpDialog';\nimport AirPopover from './module/AirPopover';\nimport HintPopover from './module/HintPopover';\n\n$.summernote = $.extend($.summernote, {\n version: '@@VERSION@@',\n plugins: {},\n\n dom: dom,\n range: range,\n lists: lists,\n\n options: {\n langInfo: $.summernote.lang['en-US'],\n editing: true,\n modules: {\n 'editor': Editor,\n 'clipboard': Clipboard,\n 'dropzone': Dropzone,\n 'codeview': Codeview,\n 'statusbar': Statusbar,\n 'fullscreen': Fullscreen,\n 'handle': Handle,\n // FIXME: HintPopover must be front of autolink\n // - Script error about range when Enter key is pressed on hint popover\n 'hintPopover': HintPopover,\n 'autoLink': AutoLink,\n 'autoSync': AutoSync,\n 'autoReplace': AutoReplace,\n 'placeholder': Placeholder,\n 'buttons': Buttons,\n 'toolbar': Toolbar,\n 'linkDialog': LinkDialog,\n 'linkPopover': LinkPopover,\n 'imageDialog': ImageDialog,\n 'imagePopover': ImagePopover,\n 'tablePopover': TablePopover,\n 'videoDialog': VideoDialog,\n 'helpDialog': HelpDialog,\n 'airPopover': AirPopover,\n },\n\n buttons: {},\n\n lang: 'en-US',\n\n followingToolbar: false,\n toolbarPosition: 'top',\n otherStaticBar: '',\n\n // toolbar\n toolbar: [\n ['style', ['style']],\n ['font', ['bold', 'underline', 'clear']],\n ['fontname', ['fontname']],\n ['color', ['color']],\n ['para', ['ul', 'ol', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture', 'video']],\n ['view', ['fullscreen', 'codeview', 'help']],\n ],\n\n // popover\n popatmouse: true,\n popover: {\n image: [\n ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n ['float', ['floatLeft', 'floatRight', 'floatNone']],\n ['remove', ['removeMedia']],\n ],\n link: [\n ['link', ['linkDialogShow', 'unlink']],\n ],\n table: [\n ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n ],\n air: [\n ['color', ['color']],\n ['font', ['bold', 'underline', 'clear']],\n ['para', ['ul', 'paragraph']],\n ['table', ['table']],\n ['insert', ['link', 'picture']],\n ['view', ['fullscreen', 'codeview']],\n ],\n },\n\n // air mode: inline editor\n airMode: false,\n overrideContextMenu: false, // TBD\n\n width: null,\n height: null,\n linkTargetBlank: true,\n useProtocol: true,\n defaultProtocol: 'http://',\n\n focus: false,\n tabDisabled: false,\n tabSize: 4,\n styleWithCSS: false,\n shortcuts: true,\n textareaAutoSync: true,\n tooltip: 'auto',\n container: null,\n maxTextLength: 0,\n blockquoteBreakingLevel: 2,\n spellCheck: true,\n disableGrammar: false,\n placeholder: null,\n inheritPlaceholder: false,\n // TODO: need to be documented\n recordEveryKeystroke: false,\n historyLimit: 200,\n\n // TODO: need to be documented\n hintMode: 'word',\n hintSelect: 'after',\n hintDirection: 'bottom',\n\n styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n\n fontNames: [\n 'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n 'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n 'Tahoma', 'Times New Roman', 'Verdana',\n ],\n fontNamesIgnoreCheck: [],\n addDefaultFonts: true,\n\n fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n\n fontSizeUnits: ['px', 'pt'],\n\n // pallete colors(n x n)\n colors: [\n ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n ],\n\n // http://chir.ag/projects/name-that-color/\n colorsName: [\n ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n ],\n\n colorButton: {\n foreColor: '#000000',\n backColor: '#FFFF00',\n },\n\n lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n\n tableClassName: 'table table-bordered',\n\n insertTableMaxSize: {\n col: 10,\n row: 10,\n },\n\n // By default, dialogs are attached in container.\n dialogsInBody: false,\n dialogsFade: false,\n\n maximumImageFileSize: null,\n\n callbacks: {\n onBeforeCommand: null,\n onBlur: null,\n onBlurCodeview: null,\n onChange: null,\n onChangeCodeview: null,\n onDialogShown: null,\n onEnter: null,\n onFocus: null,\n onImageLinkInsert: null,\n onImageUpload: null,\n onImageUploadError: null,\n onInit: null,\n onKeydown: null,\n onKeyup: null,\n onMousedown: null,\n onMouseup: null,\n onPaste: null,\n onScroll: null,\n },\n\n codemirror: {\n mode: 'text/html',\n htmlMode: true,\n lineNumbers: true,\n },\n\n codeviewFilter: false,\n codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n codeviewIframeFilter: true,\n codeviewIframeWhitelistSrc: [],\n codeviewIframeWhitelistSrcBase: [\n 'www.youtube.com',\n 'www.youtube-nocookie.com',\n 'www.facebook.com',\n 'vine.co',\n 'instagram.com',\n 'player.vimeo.com',\n 'www.dailymotion.com',\n 'player.youku.com',\n 'v.qq.com',\n ],\n\n keyMap: {\n pc: {\n 'ENTER': 'insertParagraph',\n 'CTRL+Z': 'undo',\n 'CTRL+Y': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CTRL+B': 'bold',\n 'CTRL+I': 'italic',\n 'CTRL+U': 'underline',\n 'CTRL+SHIFT+S': 'strikethrough',\n 'CTRL+BACKSLASH': 'removeFormat',\n 'CTRL+SHIFT+L': 'justifyLeft',\n 'CTRL+SHIFT+E': 'justifyCenter',\n 'CTRL+SHIFT+R': 'justifyRight',\n 'CTRL+SHIFT+J': 'justifyFull',\n 'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n 'CTRL+SHIFT+NUM8': 'insertOrderedList',\n 'CTRL+LEFTBRACKET': 'outdent',\n 'CTRL+RIGHTBRACKET': 'indent',\n 'CTRL+NUM0': 'formatPara',\n 'CTRL+NUM1': 'formatH1',\n 'CTRL+NUM2': 'formatH2',\n 'CTRL+NUM3': 'formatH3',\n 'CTRL+NUM4': 'formatH4',\n 'CTRL+NUM5': 'formatH5',\n 'CTRL+NUM6': 'formatH6',\n 'CTRL+ENTER': 'insertHorizontalRule',\n 'CTRL+K': 'linkDialog.show',\n },\n\n mac: {\n 'ENTER': 'insertParagraph',\n 'CMD+Z': 'undo',\n 'CMD+SHIFT+Z': 'redo',\n 'TAB': 'tab',\n 'SHIFT+TAB': 'untab',\n 'CMD+B': 'bold',\n 'CMD+I': 'italic',\n 'CMD+U': 'underline',\n 'CMD+SHIFT+S': 'strikethrough',\n 'CMD+BACKSLASH': 'removeFormat',\n 'CMD+SHIFT+L': 'justifyLeft',\n 'CMD+SHIFT+E': 'justifyCenter',\n 'CMD+SHIFT+R': 'justifyRight',\n 'CMD+SHIFT+J': 'justifyFull',\n 'CMD+SHIFT+NUM7': 'insertUnorderedList',\n 'CMD+SHIFT+NUM8': 'insertOrderedList',\n 'CMD+LEFTBRACKET': 'outdent',\n 'CMD+RIGHTBRACKET': 'indent',\n 'CMD+NUM0': 'formatPara',\n 'CMD+NUM1': 'formatH1',\n 'CMD+NUM2': 'formatH2',\n 'CMD+NUM3': 'formatH3',\n 'CMD+NUM4': 'formatH4',\n 'CMD+NUM5': 'formatH5',\n 'CMD+NUM6': 'formatH6',\n 'CMD+ENTER': 'insertHorizontalRule',\n 'CMD+K': 'linkDialog.show',\n },\n },\n icons: {\n 'align': 'note-icon-align',\n 'alignCenter': 'note-icon-align-center',\n 'alignJustify': 'note-icon-align-justify',\n 'alignLeft': 'note-icon-align-left',\n 'alignRight': 'note-icon-align-right',\n 'rowBelow': 'note-icon-row-below',\n 'colBefore': 'note-icon-col-before',\n 'colAfter': 'note-icon-col-after',\n 'rowAbove': 'note-icon-row-above',\n 'rowRemove': 'note-icon-row-remove',\n 'colRemove': 'note-icon-col-remove',\n 'indent': 'note-icon-align-indent',\n 'outdent': 'note-icon-align-outdent',\n 'arrowsAlt': 'note-icon-arrows-alt',\n 'bold': 'note-icon-bold',\n 'caret': 'note-icon-caret',\n 'circle': 'note-icon-circle',\n 'close': 'note-icon-close',\n 'code': 'note-icon-code',\n 'eraser': 'note-icon-eraser',\n 'floatLeft': 'note-icon-float-left',\n 'floatRight': 'note-icon-float-right',\n 'font': 'note-icon-font',\n 'frame': 'note-icon-frame',\n 'italic': 'note-icon-italic',\n 'link': 'note-icon-link',\n 'unlink': 'note-icon-chain-broken',\n 'magic': 'note-icon-magic',\n 'menuCheck': 'note-icon-menu-check',\n 'minus': 'note-icon-minus',\n 'orderedlist': 'note-icon-orderedlist',\n 'pencil': 'note-icon-pencil',\n 'picture': 'note-icon-picture',\n 'question': 'note-icon-question',\n 'redo': 'note-icon-redo',\n 'rollback': 'note-icon-rollback',\n 'square': 'note-icon-square',\n 'strikethrough': 'note-icon-strikethrough',\n 'subscript': 'note-icon-subscript',\n 'superscript': 'note-icon-superscript',\n 'table': 'note-icon-table',\n 'textHeight': 'note-icon-text-height',\n 'trash': 'note-icon-trash',\n 'underline': 'note-icon-underline',\n 'undo': 'note-icon-undo',\n 'unorderedlist': 'note-icon-unorderedlist',\n 'video': 'note-icon-video',\n },\n },\n});\n","import $ from 'jquery';\nimport renderer from '../base/renderer';\n\nconst editor = renderer.create('<div class=\"note-editor note-frame panel panel-default\"/>');\nconst toolbar = renderer.create('<div class=\"note-toolbar panel-heading\" role=\"toolbar\"></div></div>');\nconst editingArea = renderer.create('<div class=\"note-editing-area\"/>');\nconst codable = renderer.create('<textarea class=\"note-codable\" aria-multiline=\"true\"/>');\nconst editable = renderer.create('<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\nconst statusbar = renderer.create([\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n '<div class=\"note-statusbar\" role=\"status\">',\n '<div class=\"note-resizebar\" aria-label=\"Resize\">',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '<div class=\"note-icon-bar\"/>',\n '</div>',\n '</div>',\n].join(''));\n\nconst airEditor = renderer.create('<div class=\"note-editor note-airframe\"/>');\nconst airEditable = renderer.create([\n '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n '<output class=\"note-status-output\" role=\"status\" aria-live=\"polite\"/>',\n].join(''));\n\nconst buttonGroup = renderer.create('<div class=\"note-btn-group btn-group\">');\n\nconst dropdown = renderer.create('<ul class=\"note-dropdown-menu dropdown-menu\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n const option = (typeof item === 'object') ? item.option : undefined;\n\n const dataValue = 'data-value=\"' + value + '\"';\n const dataOption = (option !== undefined) ? ' data-option=\"' + option + '\"' : '';\n return '<li aria-label=\"' + value + '\"><a href=\"#\" ' + (dataValue + dataOption) + '>' + content + '</a></li>';\n }).join('') : options.items;\n\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dropdownButtonContents = function(contents, options) {\n return contents + ' ' + icon(options.icons.caret, 'span');\n};\n\nconst dropdownCheck = renderer.create('<ul class=\"note-dropdown-menu dropdown-menu note-check\">', function($node, options) {\n const markup = Array.isArray(options.items) ? options.items.map(function(item) {\n const value = (typeof item === 'string') ? item : (item.value || '');\n const content = options.template ? options.template(item) : item;\n return '<li aria-label=\"' + item + '\"><a href=\"#\" data-value=\"' + value + '\">' + icon(options.checkClassName) + ' ' + content + '</a></li>';\n }).join('') : options.items;\n $node.html(markup).attr({ 'aria-label': options.title });\n});\n\nconst dialog = renderer.create('<div class=\"modal note-modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function($node, options) {\n if (options.fade) {\n $node.addClass('fade');\n }\n $node.attr({\n 'aria-label': options.title,\n });\n $node.html([\n '<div class=\"modal-dialog\">',\n '<div class=\"modal-content\">',\n (options.title ? '<div class=\"modal-header\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" aria-hidden=\"true\">×</button>' +\n '<h4 class=\"modal-title\">' + options.title + '</h4>' +\n '</div>' : ''),\n '<div class=\"modal-body\">' + options.body + '</div>',\n (options.footer ? '<div class=\"modal-footer\">' + options.footer + '</div>' : ''),\n '</div>',\n '</div>',\n ].join(''));\n});\n\nconst popover = renderer.create([\n '<div class=\"note-popover popover in\">',\n '<div class=\"arrow\"/>',\n '<div class=\"popover-content note-children-container\"/>',\n '</div>',\n].join(''), function($node, options) {\n const direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n\n $node.addClass(direction);\n\n if (options.hideArrow) {\n $node.find('.arrow').hide();\n }\n});\n\nconst checkbox = renderer.create('<div class=\"checkbox\"></div>', function($node, options) {\n $node.html([\n '<label' + (options.id ? ' for=\"note-' + options.id + '\"' : '') + '>',\n '<input type=\"checkbox\"' + (options.id ? ' id=\"note-' + options.id + '\"' : ''),\n (options.checked ? ' checked' : ''),\n ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n (options.text ? options.text : ''),\n '</label>',\n ].join(''));\n});\n\nconst icon = function(iconClassName, tagName) {\n tagName = tagName || 'i';\n return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n};\n\nconst ui = function(editorOptions) {\n return {\n editor: editor,\n toolbar: toolbar,\n editingArea: editingArea,\n codable: codable,\n editable: editable,\n statusbar: statusbar,\n airEditor: airEditor,\n airEditable: airEditable,\n buttonGroup: buttonGroup,\n dropdown: dropdown,\n dropdownButtonContents: dropdownButtonContents,\n dropdownCheck: dropdownCheck,\n dialog: dialog,\n popover: popover,\n checkbox: checkbox,\n icon: icon,\n options: editorOptions,\n\n palette: function($node, options) {\n return renderer.create('<div class=\"note-color-palette\"/>', function($node, options) {\n const contents = [];\n for (let row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n const eventName = options.eventName;\n const colors = options.colors[row];\n const colorsName = options.colorsName[row];\n const buttons = [];\n for (let col = 0, colSize = colors.length; col < colSize; col++) {\n const color = colors[col];\n const colorName = colorsName[col];\n buttons.push([\n '<button type=\"button\" class=\"note-color-btn\"',\n 'style=\"background-color:', color, '\" ',\n 'data-event=\"', eventName, '\" ',\n 'data-value=\"', color, '\" ',\n 'title=\"', colorName, '\" ',\n 'aria-label=\"', colorName, '\" ',\n 'data-toggle=\"button\" tabindex=\"-1\"></button>',\n ].join(''));\n }\n contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n }\n $node.html(contents.join(''));\n\n if (options.tooltip) {\n $node.find('.note-color-btn').tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n });\n }\n })($node, options);\n },\n\n button: function($node, options) {\n return renderer.create('<button type=\"button\" class=\"note-btn btn btn-default btn-sm\" tabindex=\"-1\">', function($node, options) {\n if (options && options.tooltip) {\n $node.attr({\n title: options.tooltip,\n 'aria-label': options.tooltip,\n }).tooltip({\n container: options.container || editorOptions.container,\n trigger: 'hover',\n placement: 'bottom',\n }).on('click', (e) => {\n $(e.currentTarget).tooltip('hide');\n });\n }\n })($node, options);\n },\n\n toggleBtn: function($btn, isEnable) {\n $btn.toggleClass('disabled', !isEnable);\n $btn.attr('disabled', !isEnable);\n },\n\n toggleBtnActive: function($btn, isActive) {\n $btn.toggleClass('active', isActive);\n },\n\n onDialogShown: function($dialog, handler) {\n $dialog.one('shown.bs.modal', handler);\n },\n\n onDialogHidden: function($dialog, handler) {\n $dialog.one('hidden.bs.modal', handler);\n },\n\n showDialog: function($dialog) {\n $dialog.modal('show');\n },\n\n hideDialog: function($dialog) {\n $dialog.modal('hide');\n },\n\n createLayout: function($note) {\n const $editor = (editorOptions.airMode ? airEditor([\n editingArea([\n codable(),\n airEditable(),\n ]),\n ]) : (editorOptions.toolbarPosition === 'bottom'\n ? editor([\n editingArea([\n codable(),\n editable(),\n ]),\n toolbar(),\n statusbar(),\n ])\n : editor([\n toolbar(),\n editingArea([\n codable(),\n editable(),\n ]),\n statusbar(),\n ])\n )).render();\n\n $editor.insertAfter($note);\n\n return {\n note: $note,\n editor: $editor,\n toolbar: $editor.find('.note-toolbar'),\n editingArea: $editor.find('.note-editing-area'),\n editable: $editor.find('.note-editable'),\n codable: $editor.find('.note-codable'),\n statusbar: $editor.find('.note-statusbar'),\n };\n },\n\n removeLayout: function($note, layoutInfo) {\n $note.html(layoutInfo.editable.html());\n layoutInfo.editor.remove();\n $note.show();\n },\n };\n};\n\nexport default ui;\n","import $ from 'jquery';\nimport ui from './ui';\nimport '../base/settings.js';\n\nimport '../../styles/summernote-bs3.scss';\n\n$.summernote = $.extend($.summernote, {\n ui_template: ui,\n interface: 'bs3',\n});\n"],"sourceRoot":""}
File: public/build/768.84d2aa43.js
Match lines: 1
2|(self.webpackChunk=self.webpackChunk||[]).push([[768],{311(e,t,r){"use strict";r.d(t,{A:()=>x});var n=r(31327),i=r(98517),A=r(51084),o=r(80386),a=r(80442),s=r(88468),u=r(36254);const c=function(){function e(){}return e.parseLong=function(e,t){return void 0===t&&(t=void 0),parseInt(e,t)},e}();var l,f=r(79874),d=r(43074),h=(l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},l(e,t)},function(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return h(t,e),t.kind="NullPointerException",t}(d.A);const g=p;const y=function(){function e(){}return e.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},e.prototype.writeBytesOffset=function(e,t,r){if(null==e)throw new g;if(t<0||t>e.length||r<0||t+r>e.length||t+r<0)throw new f.A;if(0!==r)for(var n=0;n<r;n++)this.write(e[t+n])},e.prototype.flush=function(){},e.prototype.close=function(){},e}();var v=r(57149),m=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),w=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return m(t,e),t}(d.A);const b=w;var B=r(92819),C=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const E=function(e){function t(t){void 0===t&&(t=32);var r=e.call(this)||this;if(r.count=0,t<0)throw new v.A("Negative initial size: "+t);return r.buf=new Uint8Array(t),r}return C(t,e),t.prototype.ensureCapacity=function(e){e-this.buf.length>0&&this.grow(e)},t.prototype.grow=function(e){var t=this.buf.length<<1;if(t-e<0&&(t=e),t<0){if(e<0)throw new b;t=u.A.MAX_VALUE}this.buf=a.A.copyOfUint8Array(this.buf,t)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,t,r){if(t<0||t>e.length||r<0||t+r-e.length>0)throw new f.A;this.ensureCapacity(this.count+r),B.A.arraycopy(e,t,this.buf,this.count,r),this.count+=r},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return a.A.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?"string"==typeof e?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(y);var S,I,O=r(43334);function F(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==r.g)return r.g.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function _(e){if(void 0===I&&(I=F()),null===I)throw new Error("BigInt is not supported!");return I(e)}!function(e){e[e.ALPHA=0]="ALPHA",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.PUNCT=3]="PUNCT",e[e.ALPHA_SHIFT=4]="ALPHA_SHIFT",e[e.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(S||(S={}));const x=function(){function e(){}return e.decode=function(t,r){var a=new s.A(""),u=i.A.ISO8859_1;a.enableDecoding(u);for(var c=1,l=t[c++],f=new o.A;c<t[0];){switch(l){case e.TEXT_COMPACTION_MODE_LATCH:c=e.textCompaction(t,c,a);break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:c=e.byteCompaction(l,t,u,c,a);break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(t[c++]);break;case e.NUMERIC_COMPACTION_MODE_LATCH:c=e.numericCompaction(t,c,a);break;case e.ECI_CHARSET:i.A.getCharacterSetECIByValue(t[c++]);break;case e.ECI_GENERAL_PURPOSE:c+=2;break;case e.ECI_USER_DEFINED:c++;break;case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:c=e.decodeMacroBlock(t,c,f);break;case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:throw new n.A;default:c--,c=e.textCompaction(t,c,a)}if(!(c<t.length))throw n.A.getFormatInstance();l=t[c++]}if(0===a.length())throw n.A.getFormatInstance();var d=new A.A(null,a.toString(),null,r);return d.setOther(f),d},e.decodeMacroBlock=function(t,r,i){if(r+e.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw n.A.getFormatInstance();for(var A=new Int32Array(e.NUMBER_OF_SEQUENCE_CODEWORDS),o=0;o<e.NUMBER_OF_SEQUENCE_CODEWORDS;o++,r++)A[o]=t[r];i.setSegmentIndex(u.A.parseInt(e.decodeBase900toBase10(A,e.NUMBER_OF_SEQUENCE_CODEWORDS)));var l=new s.A;r=e.textCompaction(t,r,l),i.setFileId(l.toString());var f=-1;for(t[r]===e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(f=r+1);r<t[0];)switch(t[r]){case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++r]){case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var d=new s.A;r=e.textCompaction(t,r+1,d),i.setFileName(d.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var h=new s.A;r=e.textCompaction(t,r+1,h),i.setSender(h.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var p=new s.A;r=e.textCompaction(t,r+1,p),i.setAddressee(p.toString());break;case e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var g=new s.A;r=e.numericCompaction(t,r+1,g),i.setSegmentCount(u.A.parseInt(g.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var y=new s.A;r=e.numericCompaction(t,r+1,y),i.setTimestamp(c.parseLong(y.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var v=new s.A;r=e.numericCompaction(t,r+1,v),i.setChecksum(u.A.parseInt(v.toString()));break;case e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var m=new s.A;r=e.numericCompaction(t,r+1,m),i.setFileSize(c.parseLong(m.toString()));break;default:throw n.A.getFormatInstance()}break;case e.MACRO_PDF417_TERMINATOR:r++,i.setLastSegment(!0);break;default:throw n.A.getFormatInstance()}if(-1!==f){var w=r-f;i.isLastSegment()&&w--,i.setOptionalData(a.A.copyOfRange(t,f,f+w))}return r},e.textCompaction=function(t,r,n){for(var i=new Int32Array(2*(t[0]-r)),A=new Int32Array(2*(t[0]-r)),o=0,a=!1;r<t[0]&&!a;){var s=t[r++];if(s<e.TEXT_COMPACTION_MODE_LATCH)i[o]=s/30,i[o+1]=s%30,o+=2;else switch(s){case e.TEXT_COMPACTION_MODE_LATCH:i[o++]=e.TEXT_COMPACTION_MODE_LATCH;break;case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:r--,a=!0;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[o]=e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,s=t[r++],A[o]=s,o++}}return e.decodeTextCompaction(i,A,o,n),r},e.decodeTextCompaction=function(t,r,n,i){for(var A=S.ALPHA,o=S.ALPHA,a=0;a<n;){var s=t[a],u="";switch(A){case S.ALPHA:if(s<26)u=String.fromCharCode(65+s);else switch(s){case 26:u=" ";break;case e.LL:A=S.LOWER;break;case e.ML:A=S.MIXED;break;case e.PS:o=A,A=S.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[a]);break;case e.TEXT_COMPACTION_MODE_LATCH:A=S.ALPHA}break;case S.LOWER:if(s<26)u=String.fromCharCode(97+s);else switch(s){case 26:u=" ";break;case e.AS:o=A,A=S.ALPHA_SHIFT;break;case e.ML:A=S.MIXED;break;case e.PS:o=A,A=S.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[a]);break;case e.TEXT_COMPACTION_MODE_LATCH:A=S.ALPHA}break;case S.MIXED:if(s<e.PL)u=e.MIXED_CHARS[s];else switch(s){case e.PL:A=S.PUNCT;break;case 26:u=" ";break;case e.LL:A=S.LOWER;break;case e.AL:A=S.ALPHA;break;case e.PS:o=A,A=S.PUNCT_SHIFT;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[a]);break;case e.TEXT_COMPACTION_MODE_LATCH:A=S.ALPHA}break;case S.PUNCT:if(s<e.PAL)u=e.PUNCT_CHARS[s];else switch(s){case e.PAL:A=S.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[a]);break;case e.TEXT_COMPACTION_MODE_LATCH:A=S.ALPHA}break;case S.ALPHA_SHIFT:if(A=o,s<26)u=String.fromCharCode(65+s);else switch(s){case 26:u=" ";break;case e.TEXT_COMPACTION_MODE_LATCH:A=S.ALPHA}break;case S.PUNCT_SHIFT:if(A=o,s<e.PAL)u=e.PUNCT_CHARS[s];else switch(s){case e.PAL:A=S.ALPHA;break;case e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[a]);break;case e.TEXT_COMPACTION_MODE_LATCH:A=S.ALPHA}}""!==u&&i.append(u),a++}},e.byteCompaction=function(t,r,n,i,A){var o=new E,a=0,s=0,u=!1;switch(t){case e.BYTE_COMPACTION_MODE_LATCH:for(var c=new Int32Array(6),l=r[i++];i<r[0]&&!u;)switch(c[a++]=l,s=900*s+l,l=r[i++]){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,u=!0;break;default:if(a%5==0&&a>0){for(var f=0;f<6;++f)o.write(Number(_(s)>>_(8*(5-f))));s=0,a=0}}i===r[0]&&l<e.TEXT_COMPACTION_MODE_LATCH&&(c[a++]=l);for(var d=0;d<a;d++)o.write(c[d]);break;case e.BYTE_COMPACTION_MODE_LATCH_6:for(;i<r[0]&&!u;){var h=r[i++];if(h<e.TEXT_COMPACTION_MODE_LATCH)a++,s=900*s+h;else switch(h){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.NUMERIC_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:i--,u=!0}if(a%5==0&&a>0){for(f=0;f<6;++f)o.write(Number(_(s)>>_(8*(5-f))));s=0,a=0}}}return A.append(O.A.decode(o.toByteArray(),n)),i},e.numericCompaction=function(t,r,n){for(var i=0,A=!1,o=new Int32Array(e.MAX_NUMERIC_CODEWORDS);r<t[0]&&!A;){var a=t[r++];if(r===t[0]&&(A=!0),a<e.TEXT_COMPACTION_MODE_LATCH)o[i]=a,i++;else switch(a){case e.TEXT_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH:case e.BYTE_COMPACTION_MODE_LATCH_6:case e.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case e.MACRO_PDF417_TERMINATOR:r--,A=!0}(i%e.MAX_NUMERIC_CODEWORDS===0||a===e.NUMERIC_COMPACTION_MODE_LATCH||A)&&i>0&&(n.append(e.decodeBase900toBase10(o,i)),i=0)}return r},e.decodeBase900toBase10=function(t,r){for(var i=_(0),A=0;A<r;A++)i+=e.EXP900[r-A-1]*_(t[A]);var o=i.toString();if("1"!==o.charAt(0))throw new n.A;return o.substring(1)},e.TEXT_COMPACTION_MODE_LATCH=900,e.BYTE_COMPACTION_MODE_LATCH=901,e.NUMERIC_COMPACTION_MODE_LATCH=902,e.BYTE_COMPACTION_MODE_LATCH_6=924,e.ECI_USER_DEFINED=925,e.ECI_GENERAL_PURPOSE=926,e.ECI_CHARSET=927,e.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,e.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,e.MACRO_PDF417_TERMINATOR=922,e.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,e.MAX_NUMERIC_CODEWORDS=15,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,e.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,e.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,e.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,e.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,e.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,e.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,e.PL=25,e.LL=27,e.AS=27,e.ML=28,e.AL=28,e.PS=29,e.PAL=29,e.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",e.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",e.EXP900=F()?function(){var e=[];e[0]=_(1);var t=_(900);e[1]=t;for(var r=2;r<16;r++)e[r]=e[r-1]*t;return e}():[],e.NUMBER_OF_SEQUENCE_CODEWORDS=2,e}()},316(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(18509),i=r(80058),A=r(44905),o=r(54534);t.isIterateeCall=function(e,t,r){return!!A.isObject(r)&&(!!("number"==typeof t&&i.isArrayLike(r)&&n.isIndex(t)&&t<r.length||"string"==typeof t&&t in r)&&o.isEqualsSameValueZero(r[t],e))}},1081(e,t,r){e.exports=r(52810).uniqBy},1103(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},1119(e,t){"use strict";function r(e){return"symbol"==typeof e?1:null===e?2:void 0===e?3:e!=e?4:0}Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.compareValues=(e,t,n)=>{if(e!==t){const i=r(e),A=r(t);if(i===A&&0===i){if(e<t)return"desc"===n?1:-1;if(e>t)return"desc"===n?-1:1}return"desc"===n?A-i:i-A}return 0}},1458(e,t,r){"use strict";r.d(t,{A:()=>H});var n=r(73872),i=r(43407),A=r(31327),o=r(58503),a=r(7758),s=r(50483),u=r(36254),c=r(15511),l=r(93234),f=r(92819),d=r(80442);const h=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}();var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const g=function(){function e(){}return e.detectMultiple=function(t,r,n){var i=t.getBlackMatrix(),A=e.detect(n,i);return A.length||((i=i.clone()).rotate180(),A=e.detect(n,i)),new h(i,A)},e.detect=function(t,r){for(var n,i,A=new Array,o=0,a=0,s=!1;o<r.getHeight();){var u=e.findVertices(r,o,a);if(null!=u[0]||null!=u[3]){if(s=!0,A.push(u),!t)break;null!=u[2]?(a=Math.trunc(u[2].getX()),o=Math.trunc(u[2].getY())):(a=Math.trunc(u[4].getX()),o=Math.trunc(u[4].getY()))}else{if(!s)break;s=!1,a=0;try{for(var c=(n=void 0,p(A)),l=c.next();!l.done;l=c.next()){var f=l.value;null!=f[1]&&(o=Math.trunc(Math.max(o,f[1].getY()))),null!=f[3]&&(o=Math.max(o,Math.trunc(f[3].getY())))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}o+=e.ROW_STEP}}return A},e.findVertices=function(t,r,n){var i=t.getHeight(),A=t.getWidth(),o=new Array(8);return e.copyToResult(o,e.findRowsWithPattern(t,i,A,r,n,e.START_PATTERN),e.INDEXES_START_PATTERN),null!=o[4]&&(n=Math.trunc(o[4].getX()),r=Math.trunc(o[4].getY())),e.copyToResult(o,e.findRowsWithPattern(t,i,A,r,n,e.STOP_PATTERN),e.INDEXES_STOP_PATTERN),o},e.copyToResult=function(e,t,r){for(var n=0;n<r.length;n++)e[r[n]]=t[n]},e.findRowsWithPattern=function(t,r,n,i,A,o){for(var a=new Array(4),s=!1,u=new Int32Array(o.length);i<r;i+=e.ROW_STEP){if(null!=(p=e.findGuardPattern(t,A,i,n,!1,o,u))){for(;i>0;){if(null==(h=e.findGuardPattern(t,A,--i,n,!1,o,u))){i++;break}p=h}a[0]=new l.A(p[0],i),a[1]=new l.A(p[1],i),s=!0;break}}var c=i+1;if(s){for(var f=0,h=Int32Array.from([Math.trunc(a[0].getX()),Math.trunc(a[1].getX())]);c<r;c++){var p;if(null!=(p=e.findGuardPattern(t,h[0],c,n,!1,o,u))&&Math.abs(h[0]-p[0])<e.MAX_PATTERN_DRIFT&&Math.abs(h[1]-p[1])<e.MAX_PATTERN_DRIFT)h=p,f=0;else{if(f>e.SKIPPED_ROW_COUNT_MAX)break;f++}}c-=f+1,a[2]=new l.A(h[0],c),a[3]=new l.A(h[1],c)}return c-i<e.BARCODE_MIN_HEIGHT&&d.A.fill(a,null),a},e.findGuardPattern=function(t,r,n,i,A,o,a){d.A.fillWithin(a,0,a.length,0);for(var s=r,u=0;t.get(s,n)&&s>0&&u++<e.MAX_PIXEL_DRIFT;)s--;for(var c=s,l=0,h=o.length,p=A;c<i;c++){if(t.get(c,n)!==p)a[l]++;else{if(l===h-1){if(e.patternMatchVariance(a,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return new Int32Array([s,c]);s+=a[0]+a[1],f.A.arraycopy(a,2,a,0,l-1),a[l-1]=0,a[l]=0,l--}else l++;a[l]=1,p=!p}}return l===h-1&&e.patternMatchVariance(a,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE?new Int32Array([s,c-1]):null},e.patternMatchVariance=function(e,t,r){for(var n=e.length,i=0,A=0,o=0;o<n;o++)i+=e[o],A+=t[o];if(i<A)return 1/0;var a=i/A;r*=a;for(var s=0,u=0;u<n;u++){var c=e[u],l=t[u]*a,f=c>l?c-l:l-c;if(f>r)return 1/0;s+=f}return s/i},e.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),e.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),e.MAX_AVG_VARIANCE=.42,e.MAX_INDIVIDUAL_VARIANCE=.8,e.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),e.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),e.MAX_PIXEL_DRIFT=3,e.MAX_PATTERN_DRIFT=5,e.SKIPPED_ROW_COUNT_MAX=25,e.ROW_STEP=5,e.BARCODE_MIN_HEIGHT=10,e}();var y=r(28823),v=r(66278);const m=function(){function e(t,r,n,i,A){t instanceof e?this.constructor_2(t):this.constructor_1(t,r,n,i,A)}return e.prototype.constructor_1=function(e,t,r,n,i){var A=null==t||null==r,a=null==n||null==i;if(A&&a)throw new o.A;A?(t=new l.A(0,n.getY()),r=new l.A(0,i.getY())):a&&(n=new l.A(e.getWidth()-1,t.getY()),i=new l.A(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=t,this.bottomLeft=r,this.topRight=n,this.bottomRight=i,this.minX=Math.trunc(Math.min(t.getX(),r.getX())),this.maxX=Math.trunc(Math.max(n.getX(),i.getX())),this.minY=Math.trunc(Math.min(t.getY(),n.getY())),this.maxY=Math.trunc(Math.max(r.getY(),i.getY()))},e.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},e.merge=function(t,r){return null==t?r:null==r?t:new e(t.image,t.topLeft,t.bottomLeft,r.topRight,r.bottomRight)},e.prototype.addMissingRows=function(t,r,n){var i=this.topLeft,A=this.bottomLeft,o=this.topRight,a=this.bottomRight;if(t>0){var s=n?this.topLeft:this.topRight,u=Math.trunc(s.getY()-t);u<0&&(u=0);var c=new l.A(s.getX(),u);n?i=c:o=c}if(r>0){var f=n?this.bottomLeft:this.bottomRight,d=Math.trunc(f.getY()+r);d>=this.image.getHeight()&&(d=this.image.getHeight()-1);var h=new l.A(f.getX(),d);n?A=h:a=h}return new e(this.image,i,A,o,a)},e.prototype.getMinX=function(){return this.minX},e.prototype.getMaxX=function(){return this.maxX},e.prototype.getMinY=function(){return this.minY},e.prototype.getMaxY=function(){return this.maxY},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getBottomRight=function(){return this.bottomRight},e}();const w=function(){function e(e,t,r,n){this.columnCount=e,this.errorCorrectionLevel=n,this.rowCountUpperPart=t,this.rowCountLowerPart=r,this.rowCount=t+r}return e.prototype.getColumnCount=function(){return this.columnCount},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getRowCount=function(){return this.rowCount},e.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},e.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},e}();var b=function(){function e(){this.buffer=""}return e.form=function(e,t){var r=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(e,n,i,A,o,a){if("%%"===e)return"%";if(void 0!==t[++r]){e=A?parseInt(A.substr(1)):void 0;var s,u=o?parseInt(o.substr(1)):void 0;switch(a){case"s":s=t[r];break;case"c":s=t[r][0];break;case"f":s=parseFloat(t[r]).toFixed(e);break;case"p":s=parseFloat(t[r]).toPrecision(e);break;case"e":s=parseFloat(t[r]).toExponential(e);break;case"x":s=parseInt(t[r]).toString(u||16);break;case"d":s=parseFloat(parseInt(t[r],u||10).toPrecision(e)).toFixed(0)}s="object"==typeof s?JSON.stringify(s):(+s).toString(u);for(var c=parseInt(i),l=i&&i[0]+""=="0"?"0":" ";s.length<c;)s=void 0!==n?s+l:l+s;return s}})},e.prototype.format=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this.buffer+=e.form(t,r)},e.prototype.toString=function(){return this.buffer},e}();const B=b;var C=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const E=function(){function e(e){this.boundingBox=new m(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return e.prototype.getCodewordNearby=function(t){var r=this.getCodeword(t);if(null!=r)return r;for(var n=1;n<e.MAX_NEARBY_DISTANCE;n++){var i=this.imageRowToCodewordIndex(t)-n;if(i>=0&&null!=(r=this.codewords[i]))return r;if((i=this.imageRowToCodewordIndex(t)+n)<this.codewords.length&&null!=(r=this.codewords[i]))return r}return null},e.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},e.prototype.setCodeword=function(e,t){this.codewords[this.imageRowToCodewordIndex(e)]=t},e.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.getCodewords=function(){return this.codewords},e.prototype.toString=function(){var e,t,r=new B,n=0;try{for(var i=C(this.codewords),A=i.next();!A.done;A=i.next()){var o=A.value;null!=o?r.format("%3d: %3d|%3d%n",n++,o.getRowNumber(),o.getValue()):r.format("%3d: | %n",n++)}}catch(t){e={error:t}}finally{try{A&&!A.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r.toString()},e.MAX_NEARBY_DISTANCE=5,e}();var S=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},I=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,A=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=A.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=A.return)&&r.call(A)}finally{if(i)throw i.error}}return o};const O=function(){function e(){this.values=new Map}return e.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);null==t&&(t=0),t++,this.values.set(e,t)},e.prototype.getValue=function(){var e,t,r=-1,n=new Array,i=function(e,t){var i=function(){return e},A=function(){return t};A()>r?(r=A(),(n=[]).push(i())):A()===r&&n.push(i())};try{for(var A=S(this.values.entries()),o=A.next();!o.done;o=A.next()){var a=I(o.value,2);i(a[0],a[1])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=A.return)&&t.call(A)}finally{if(e)throw e.error}}return s.A.toIntArray(n)},e.prototype.getConfidence=function(e){return this.values.get(e)},e}();var F,_=(F=function(e,t){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},F(e,t)},function(e,t){function r(){this.constructor=e}F(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),x=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const U=function(e){function t(t,r){var n=e.call(this,t)||this;return n._isLeft=r,n}return _(t,e),t.prototype.setRowNumbers=function(){var e,t;try{for(var r=x(this.getCodewords()),n=r.next();!n.done;n=r.next()){var i=n.value;null!=i&&i.setRowNumberAsRowIndicatorColumn()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var t=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(t,e);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),A=this.imageRowToCodewordIndex(Math.trunc(n.getY())),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),a=-1,s=1,u=0,c=A;c<o;c++)if(null!=t[c]){var l=t[c],f=l.getRowNumber()-a;if(0===f)u++;else if(1===f)s=Math.max(s,u),u=1,a=l.getRowNumber();else if(f<0||l.getRowNumber()>=e.getRowCount()||f>c)t[c]=null;else{for(var d=void 0,h=(d=s>2?(s-2)*f:f)>=c,p=1;p<=d&&!h;p++)h=null!=t[c-p];h?t[c]=null:(a=l.getRowNumber(),u=1)}}},t.prototype.getRowHeights=function(){var e,t,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var i=x(this.getCodewords()),A=i.next();!A.done;A=i.next()){var o=A.value;if(null!=o){var a=o.getRowNumber();if(a>=n.length)continue;n[a]++}}}catch(t){e={error:t}}finally{try{A&&!A.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var t=this.getBoundingBox(),r=this._isLeft?t.getTopLeft():t.getTopRight(),n=this._isLeft?t.getBottomLeft():t.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),A=this.imageRowToCodewordIndex(Math.trunc(n.getY())),o=this.getCodewords(),a=-1,s=1,u=0,c=i;c<A;c++)if(null!=o[c]){var l=o[c];l.setRowNumberAsRowIndicatorColumn();var f=l.getRowNumber()-a;0===f?u++:1===f?(s=Math.max(s,u),u=1,a=l.getRowNumber()):l.getRowNumber()>=e.getRowCount()?o[c]=null:(a=l.getRowNumber(),u=1)}},t.prototype.getBarcodeMetadata=function(){var e,t,r=this.getCodewords(),n=new O,i=new O,A=new O,o=new O;try{for(var a=x(r),u=a.next();!u.done;u=a.next()){var c=u.value;if(null!=c){c.setRowNumberAsRowIndicatorColumn();var l=c.getValue()%30,f=c.getRowNumber();switch(this._isLeft||(f+=2),f%3){case 0:i.setValue(3*l+1);break;case 1:o.setValue(l/3),A.setValue(l%3);break;case 2:n.setValue(l+1)}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}if(0===n.getValue().length||0===i.getValue().length||0===A.getValue().length||0===o.getValue().length||n.getValue()[0]<1||i.getValue()[0]+A.getValue()[0]<s.A.MIN_ROWS_IN_BARCODE||i.getValue()[0]+A.getValue()[0]>s.A.MAX_ROWS_IN_BARCODE)return null;var d=new w(n.getValue()[0],i.getValue()[0],A.getValue()[0],o.getValue()[0]);return this.removeIncorrectCodewords(r,d),d},t.prototype.removeIncorrectCodewords=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(null!=e[r]){var i=n.getValue()%30,A=n.getRowNumber();if(A>t.getRowCount())e[r]=null;else switch(this._isLeft||(A+=2),A%3){case 0:3*i+1!==t.getRowCountUpperPart()&&(e[r]=null);break;case 1:Math.trunc(i/3)===t.getErrorCorrectionLevel()&&i%3===t.getRowCountLowerPart()||(e[r]=null);break;case 2:i+1!==t.getColumnCount()&&(e[r]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+e.prototype.toString.call(this)},t}(E);var Q=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const T=function(){function e(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return e.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e,t=s.A.MAX_CODEWORDS_IN_BARCODE;do{e=t,t=this.adjustRowNumbersAndGetCount()}while(t>0&&t<e);return this.detectionResultColumns},e.prototype.adjustIndicatorColumnRowNumbers=function(e){null!=e&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},e.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(0===e)return 0;for(var t=1;t<this.barcodeColumnCount+1;t++)for(var r=this.detectionResultColumns[t].getCodewords(),n=0;n<r.length;n++)null!=r[n]&&(r[n].hasValidRowNumber()||this.adjustRowNumbers(t,n,r));return e},e.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},e.prototype.adjustRowNumbersFromBothRI=function(){if(null!=this.detectionResultColumns[0]&&null!=this.detectionResultColumns[this.barcodeColumnCount+1])for(var e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(null!=e[r]&&null!=t[r]&&e[r].getRowNumber()===t[r].getRowNumber())for(var n=1;n<=this.barcodeColumnCount;n++){var i=this.detectionResultColumns[n].getCodewords()[r];null!=i&&(i.setRowNumber(e[r].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[n].getCodewords()[r]=null))}},e.prototype.adjustRowNumbersFromRRI=function(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;for(var t=0,r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var i=r[n].getRowNumber(),A=0,o=this.barcodeColumnCount+1;o>0&&A<this.ADJUST_ROW_NUMBER_SKIP;o--){var a=this.detectionResultColumns[o].getCodewords()[n];null!=a&&(A=e.adjustRowNumberIfValid(i,A,a),a.hasValidRowNumber()||t++)}return t},e.prototype.adjustRowNumbersFromLRI=function(){if(null==this.detectionResultColumns[0])return 0;for(var t=0,r=this.detectionResultColumns[0].getCodewords(),n=0;n<r.length;n++)if(null!=r[n])for(var i=r[n].getRowNumber(),A=0,o=1;o<this.barcodeColumnCount+1&&A<this.ADJUST_ROW_NUMBER_SKIP;o++){var a=this.detectionResultColumns[o].getCodewords()[n];null!=a&&(A=e.adjustRowNumberIfValid(i,A,a),a.hasValidRowNumber()||t++)}return t},e.adjustRowNumberIfValid=function(e,t,r){return null==r||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),t=0):++t),t},e.prototype.adjustRowNumbers=function(t,r,n){var i,A;if(null!=this.detectionResultColumns[t-1]){var o=n[r],a=this.detectionResultColumns[t-1].getCodewords(),s=a;null!=this.detectionResultColumns[t+1]&&(s=this.detectionResultColumns[t+1].getCodewords());var u=new Array(14);u[2]=a[r],u[3]=s[r],r>0&&(u[0]=n[r-1],u[4]=a[r-1],u[5]=s[r-1]),r>1&&(u[8]=n[r-2],u[10]=a[r-2],u[11]=s[r-2]),r<n.length-1&&(u[1]=n[r+1],u[6]=a[r+1],u[7]=s[r+1]),r<n.length-2&&(u[9]=n[r+2],u[12]=a[r+2],u[13]=s[r+2]);try{for(var c=Q(u),l=c.next();!l.done;l=c.next()){var f=l.value;if(e.adjustRowNumber(o,f))return}}catch(e){i={error:e}}finally{try{l&&!l.done&&(A=c.return)&&A.call(c)}finally{if(i)throw i.error}}}},e.adjustRowNumber=function(e,t){return null!=t&&(!(!t.hasValidRowNumber()||t.getBucket()!==e.getBucket())&&(e.setRowNumber(t.getRowNumber()),!0))},e.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},e.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},e.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},e.prototype.setBoundingBox=function(e){this.boundingBox=e},e.prototype.getBoundingBox=function(){return this.boundingBox},e.prototype.setDetectionResultColumn=function(e,t){this.detectionResultColumns[e]=t},e.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},e.prototype.toString=function(){var e=this.detectionResultColumns[0];null==e&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var t=new B,r=0;r<e.getCodewords().length;r++){t.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++)if(null!=this.detectionResultColumns[n]){var i=this.detectionResultColumns[n].getCodewords()[r];null!=i?t.format(" %3d|%3d",i.getRowNumber(),i.getValue()):t.format(" | ")}else t.format(" | ");t.format("%n")}return t.toString()},e}();const M=function(){function e(t,r,n,i){this.rowNumber=e.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(r),this.bucket=Math.trunc(n),this.value=Math.trunc(i)}return e.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},e.prototype.isValidRowNumber=function(t){return t!==e.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3},e.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},e.prototype.getWidth=function(){return this.endX-this.startX},e.prototype.getStartX=function(){return this.startX},e.prototype.getEndX=function(){return this.endX},e.prototype.getBucket=function(){return this.bucket},e.prototype.getValue=function(){return this.value},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.setRowNumber=function(e){this.rowNumber=e},e.prototype.toString=function(){return this.rowNumber+"|"+this.value},e.BARCODE_ROW_UNKNOWN=-1,e}();var P=r(48102);const D=function(){function e(){}return e.initialize=function(){for(var t=0;t<s.A.SYMBOL_TABLE.length;t++)for(var r=s.A.SYMBOL_TABLE[t],n=1&r,i=0;i<s.A.BARS_IN_MODULE;i++){for(var A=0;(1&r)===n;)A+=1,r>>=1;n=1&r,e.RATIOS_TABLE[t]||(e.RATIOS_TABLE[t]=new Array(s.A.BARS_IN_MODULE)),e.RATIOS_TABLE[t][s.A.BARS_IN_MODULE-i-1]=Math.fround(A/s.A.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},e.getDecodedValue=function(t){var r=e.getDecodedCodewordValue(e.sampleBitCounts(t));return-1!==r?r:e.getClosestDecodedValue(t)},e.sampleBitCounts=function(e){for(var t=y.A.sum(e),r=new Int32Array(s.A.BARS_IN_MODULE),n=0,i=0,A=0;A<s.A.MODULES_IN_CODEWORD;A++){var o=t/(2*s.A.MODULES_IN_CODEWORD)+A*t/s.A.MODULES_IN_CODEWORD;i+e[n]<=o&&(i+=e[n],n++),r[n]++}return r},e.getDecodedCodewordValue=function(t){var r=e.getBitValue(t);return-1===s.A.getCodeword(r)?-1:r},e.getBitValue=function(e){for(var t=0,r=0;r<e.length;r++)for(var n=0;n<e[r];n++)t=t<<1|(r%2==0?1:0);return Math.trunc(t)},e.getClosestDecodedValue=function(t){var r=y.A.sum(t),n=new Array(s.A.BARS_IN_MODULE);if(r>1)for(var i=0;i<n.length;i++)n[i]=Math.fround(t[i]/r);var A=P.A.MAX_VALUE,o=-1;this.bSymbolTableReady||e.initialize();for(var a=0;a<e.RATIOS_TABLE.length;a++){for(var u=0,c=e.RATIOS_TABLE[a],l=0;l<s.A.BARS_IN_MODULE;l++){var f=Math.fround(c[l]-n[l]);if((u+=Math.fround(f*f))>=A)break}u<A&&(A=u,o=s.A.SYMBOL_TABLE[a])}return o},e.bSymbolTableReady=!1,e.RATIOS_TABLE=new Array(s.A.SYMBOL_TABLE.length).map(function(e){return new Array(s.A.BARS_IN_MODULE)}),e}();var k=r(311),N=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const R=function(){function e(){}return e.decode=function(t,r,n,i,A,a,s){for(var u,c=new m(t,r,n,i,A),l=null,f=null,d=!0;;d=!1){if(null!=r&&(l=e.getRowIndicatorColumn(t,c,r,!0,a,s)),null!=i&&(f=e.getRowIndicatorColumn(t,c,i,!1,a,s)),null==(u=e.merge(l,f)))throw o.A.getNotFoundInstance();var h=u.getBoundingBox();if(!d||null==h||!(h.getMinY()<c.getMinY()||h.getMaxY()>c.getMaxY()))break;c=h}u.setBoundingBox(c);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,l),u.setDetectionResultColumn(p,f);for(var g=null!=l,y=1;y<=p;y++){var v=g?y:p-y;if(void 0===u.getDetectionResultColumn(v)){var w=void 0;w=0===v||v===p?new U(c,0===v):new E(c),u.setDetectionResultColumn(v,w);for(var b=-1,B=b,C=c.getMinY();C<=c.getMaxY();C++){if((b=e.getStartColumn(u,v,C,g))<0||b>c.getMaxX()){if(-1===B)continue;b=B}var S=e.detectCodeword(t,c.getMinX(),c.getMaxX(),g,b,C,a,s);null!=S&&(w.setCodeword(C,S),B=b,a=Math.min(a,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return e.createDecoderResult(u)},e.merge=function(t,r){if(null==t&&null==r)return null;var n=e.getBarcodeMetadata(t,r);if(null==n)return null;var i=m.merge(e.adjustBoundingBox(t),e.adjustBoundingBox(r));return new T(n,i)},e.adjustBoundingBox=function(t){var r,n;if(null==t)return null;var i=t.getRowHeights();if(null==i)return null;var A=e.getMax(i),o=0;try{for(var a=N(i),s=a.next();!s.done;s=a.next()){var u=s.value;if(o+=A-u,u>0)break}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}for(var c=t.getCodewords(),l=0;o>0&&null==c[l];l++)o--;var f=0;for(l=i.length-1;l>=0&&(f+=A-i[l],!(i[l]>0));l--);for(l=c.length-1;f>0&&null==c[l];l--)f--;return t.getBoundingBox().addMissingRows(o,f,t.isLeft())},e.getMax=function(e){var t,r,n=-1;try{for(var i=N(e),A=i.next();!A.done;A=i.next()){var o=A.value;n=Math.max(n,o)}}catch(e){t={error:e}}finally{try{A&&!A.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.getBarcodeMetadata=function(e,t){var r,n;return null==e||null==(r=e.getBarcodeMetadata())?null==t?null:t.getBarcodeMetadata():null==t||null==(n=t.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},e.getRowIndicatorColumn=function(t,r,n,i,A,o){for(var a=new U(r,i),s=0;s<2;s++)for(var u=0===s?1:-1,c=Math.trunc(Math.trunc(n.getX())),l=Math.trunc(Math.trunc(n.getY()));l<=r.getMaxY()&&l>=r.getMinY();l+=u){var f=e.detectCodeword(t,0,t.getWidth(),i,c,l,A,o);null!=f&&(a.setCodeword(l,f),c=i?f.getStartX():f.getEndX())}return a},e.adjustCodewordCount=function(t,r){var n=r[0][1],i=n.getValue(),A=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-e.getNumberOfECCodeWords(t.getBarcodeECLevel());if(0===i.length){if(A<1||A>s.A.MAX_CODEWORDS_IN_BARCODE)throw o.A.getNotFoundInstance();n.setValue(A)}else i[0]!==A&&n.setValue(A)},e.createDecoderResult=function(t){var r=e.createBarcodeMatrix(t);e.adjustCodewordCount(t,r);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),A=[],o=new Array,a=0;a<t.getBarcodeRowCount();a++)for(var u=0;u<t.getBarcodeColumnCount();u++){var c=r[a][u+1].getValue(),l=a*t.getBarcodeColumnCount()+u;0===c.length?n.push(l):1===c.length?i[l]=c[0]:(o.push(l),A.push(c))}for(var f=new Array(A.length),d=0;d<f.length;d++)f[d]=A[d];return e.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),i,s.A.toIntArray(n),s.A.toIntArray(o),f)},e.createDecoderResultFromAmbiguousValues=function(t,r,n,A,o){for(var a=new Int32Array(A.length),s=100;s-- >0;){for(var u=0;u<a.length;u++)r[A[u]]=o[u][a[u]];try{return e.decodeCodewords(r,t,n)}catch(e){if(!(e instanceof i.A))throw e}if(0===a.length)throw i.A.getChecksumInstance();for(u=0;u<a.length;u++){if(a[u]<o[u].length-1){a[u]++;break}if(a[u]=0,u===a.length-1)throw i.A.getChecksumInstance()}}throw i.A.getChecksumInstance()},e.createBarcodeMatrix=function(e){for(var t,r,n,i,A=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),o=0;o<A.length;o++)for(var a=0;a<A[o].length;a++)A[o][a]=new O;var s=0;try{for(var u=N(e.getDetectionResultColumns()),c=u.next();!c.done;c=u.next()){var l=c.value;if(null!=l)try{for(var f=(n=void 0,N(l.getCodewords())),d=f.next();!d.done;d=f.next()){var h=d.value;if(null!=h){var p=h.getRowNumber();if(p>=0){if(p>=A.length)continue;A[p][s].setValue(h.getValue())}}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}s++}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return A},e.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},e.getStartColumn=function(t,r,n,i){var A,o,a=i?1:-1,s=null;if(e.isValidBarcodeColumn(t,r-a)&&(s=t.getDetectionResultColumn(r-a).getCodeword(n)),null!=s)return i?s.getEndX():s.getStartX();if(null!=(s=t.getDetectionResultColumn(r).getCodewordNearby(n)))return i?s.getStartX():s.getEndX();if(e.isValidBarcodeColumn(t,r-a)&&(s=t.getDetectionResultColumn(r-a).getCodewordNearby(n)),null!=s)return i?s.getEndX():s.getStartX();for(var u=0;e.isValidBarcodeColumn(t,r-a);){r-=a;try{for(var c=(A=void 0,N(t.getDetectionResultColumn(r).getCodewords())),l=c.next();!l.done;l=c.next()){var f=l.value;if(null!=f)return(i?f.getEndX():f.getStartX())+a*u*(f.getEndX()-f.getStartX())}}catch(e){A={error:e}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(A)throw A.error}}u++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},e.detectCodeword=function(t,r,n,i,A,o,a,u){A=e.adjustCodewordStartColumn(t,r,n,i,A,o);var c,l=e.getModuleBitCount(t,r,n,i,A,o);if(null==l)return null;var f=y.A.sum(l);if(i)c=A+f;else{for(var d=0;d<l.length/2;d++){var h=l[d];l[d]=l[l.length-1-d],l[l.length-1-d]=h}A=(c=A)-f}if(!e.checkCodewordSkew(f,a,u))return null;var p=D.getDecodedValue(l),g=s.A.getCodeword(p);return-1===g?null:new M(A,c,e.getCodewordBucketNumber(p),g)},e.getModuleBitCount=function(e,t,r,n,i,A){for(var o=i,a=new Int32Array(8),s=0,u=n?1:-1,c=n;(n?o<r:o>=t)&&s<a.length;)e.get(o,A)===c?(a[s]++,o+=u):(s++,c=!c);return s===a.length||o===(n?r:t)&&s===a.length-1?a:null},e.getNumberOfECCodeWords=function(e){return 2<<e},e.adjustCodewordStartColumn=function(t,r,n,i,A,o){for(var a=A,s=i?-1:1,u=0;u<2;u++){for(;(i?a>=r:a<n)&&i===t.get(a,o);){if(Math.abs(A-a)>e.CODEWORD_SKEW_SIZE)return A;a+=s}s=-s,i=!i}return a},e.checkCodewordSkew=function(t,r,n){return r-e.CODEWORD_SKEW_SIZE<=t&&t<=n+e.CODEWORD_SKEW_SIZE},e.decodeCodewords=function(t,r,n){if(0===t.length)throw A.A.getFormatInstance();var i=1<<r+1,o=e.correctErrors(t,n,i);e.verifyCodewordCount(t,i);var a=k.A.decode(t,""+r);return a.setErrorsCorrected(o),a.setErasures(n.length),a},e.correctErrors=function(t,r,n){if(null!=r&&r.length>n/2+e.MAX_ERRORS||n<0||n>e.MAX_EC_CODEWORDS)throw i.A.getChecksumInstance();return e.errorCorrection.decode(t,n,r)},e.verifyCodewordCount=function(e,t){if(e.length<4)throw A.A.getFormatInstance();var r=e[0];if(r>e.length)throw A.A.getFormatInstance();if(0===r){if(!(t<e.length))throw A.A.getFormatInstance();e[0]=e.length-t}},e.getBitCountForCodeword=function(e){for(var t=new Int32Array(8),r=0,n=t.length-1;!((1&e)!==r&&(r=1&e,--n<0));)t[n]++,e>>=1;return t},e.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},e.getCodewordBucketNumber_number=function(t){return e.getCodewordBucketNumber(e.getBitCountForCodeword(t))},e.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},e.toString=function(e){for(var t=new B,r=0;r<e.length;r++){t.format("Row %2d: ",r);for(var n=0;n<e[r].length;n++){var i=e[r][n];0===i.getValue().length?t.format(" ",null):t.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}t.format("%n")}return t.toString()},e.CODEWORD_SKEW_SIZE=2,e.MAX_ERRORS=3,e.MAX_EC_CODEWORDS=512,e.errorCorrection=new v.A,e}();var L=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const H=function(){function e(){}return e.prototype.decode=function(t,r){void 0===r&&(r=null);var n=e.decode(t,r,!1);if(null==n||0===n.length||null==n[0])throw o.A.getNotFoundInstance();return n[0]},e.prototype.decodeMultiple=function(t,r){void 0===r&&(r=null);try{return e.decode(t,r,!0)}catch(e){if(e instanceof A.A||e instanceof i.A)throw o.A.getNotFoundInstance();throw e}},e.decode=function(t,r,i){var A,o,s=new Array,u=g.detectMultiple(t,r,i);try{for(var l=L(u.getPoints()),f=l.next();!f.done;f=l.next()){var d=f.value,h=R.decode(u.getBits(),d[4],d[5],d[6],d[7],e.getMinCodewordWidth(d),e.getMaxCodewordWidth(d)),p=new a.A(h.getText(),h.getRawBytes(),void 0,d,n.A.PDF_417);p.putMetadata(c.A.ERROR_CORRECTION_LEVEL,h.getECLevel());var y=h.getOther();null!=y&&p.putMetadata(c.A.PDF417_EXTRA_METADATA,y),s.push(p)}}catch(e){A={error:e}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(A)throw A.error}}return s.map(function(e){return e})},e.getMaxWidth=function(e,t){return null==e||null==t?0:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMinWidth=function(e,t){return null==e||null==t?u.A.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},e.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(e.getMaxWidth(t[0],t[4]),e.getMaxWidth(t[6],t[2])*s.A.MODULES_IN_CODEWORD/s.A.MODULES_IN_STOP_PATTERN),Math.max(e.getMaxWidth(t[1],t[5]),e.getMaxWidth(t[7],t[3])*s.A.MODULES_IN_CODEWORD/s.A.MODULES_IN_STOP_PATTERN)))},e.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(e.getMinWidth(t[0],t[4]),e.getMinWidth(t[6],t[2])*s.A.MODULES_IN_CODEWORD/s.A.MODULES_IN_STOP_PATTERN),Math.min(e.getMinWidth(t[1],t[5]),e.getMinWidth(t[7],t[3])*s.A.MODULES_IN_CODEWORD/s.A.MODULES_IN_STOP_PATTERN)))},e.prototype.reset=function(){},e}()},1470(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(){}return e.prototype.isCompact=function(){return this.compact},e.prototype.setCompact=function(e){this.compact=e},e.prototype.getSize=function(){return this.size},e.prototype.setSize=function(e){this.size=e},e.prototype.getLayers=function(){return this.layers},e.prototype.setLayers=function(e){this.layers=e},e.prototype.getCodeWords=function(){return this.codeWords},e.prototype.setCodeWords=function(e){this.codeWords=e},e.prototype.getMatrix=function(){return this.matrix},e.prototype.setMatrix=function(e){this.matrix=e},e}()},1688(e,t,r){"use strict";var n=r(46518),i=r(70380);n({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},1846(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}},1863(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.toString=function e(t){if(null==t)return"";if("string"==typeof t)return t;if(Array.isArray(t))return t.map(e).join(",");const r=String(t);return"0"===r&&Object.is(Number(t),-0)?"-0":r}},1932(e,t,r){"use strict";r.d(t,{h4:()=>G});var n=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),A=Symbol.for("immer-state");function o(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var a=Object.getPrototypeOf;function s(e){return!!e&&!!e[A]}function u(e){return!!e&&(f(e)||Array.isArray(e)||!!e[i]||!!e.constructor?.[i]||y(e)||v(e))}var c=Object.prototype.constructor.toString(),l=new WeakMap;function f(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if("function"!=typeof r)return!1;let n=l.get(r);return void 0===n&&(n=Function.toString.call(r),l.set(r,n)),n===c}function d(e,t,r=!0){if(0===h(e)){(r?Reflect.ownKeys(e):Object.keys(e)).forEach(r=>{t(r,e[r],e)})}else e.forEach((r,n)=>t(n,r,e))}function h(e){const t=e[A];return t?t.type_:Array.isArray(e)?1:y(e)?2:v(e)?3:0}function p(e,t){return 2===h(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function g(e,t,r){const n=h(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function y(e){return e instanceof Map}function v(e){return e instanceof Set}function m(e){return e.copy_||e.base_}function w(e,t){if(y(e))return new Map(e);if(v(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=f(e);if(!0===t||"class_only"===t&&!r){const t=Object.getOwnPropertyDescriptors(e);delete t[A];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){const i=r[n],A=t[i];!1===A.writable&&(A.writable=!0,A.configurable=!0),(A.get||A.set)&&(t[i]={configurable:!0,writable:!0,enumerable:A.enumerable,value:e[i]})}return Object.create(a(e),t)}{const t=a(e);if(null!==t&&r)return{...e};const n=Object.create(t);return Object.assign(n,e)}}function b(e,t=!1){return C(e)||s(e)||!u(e)||(h(e)>1&&Object.defineProperties(e,{set:B,add:B,clear:B,delete:B}),Object.freeze(e),t&&Object.values(e).forEach(e=>b(e,!0))),e}var B={value:function(){o(2)}};function C(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var E,S={};function I(e){const t=S[e];return t||o(0),t}function O(){return E}function F(e,t){t&&(I("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _(e){x(e),e.drafts_.forEach(Q),e.drafts_=null}function x(e){e===E&&(E=e.parent_)}function U(e){return E={drafts_:[],parent_:E,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Q(e){const t=e[A];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function T(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[A].modified_&&(_(t),o(4)),u(e)&&(e=M(t,e),t.parent_||D(t,e)),t.patches_&&I("Patches").generateReplacementPatches_(r[A].base_,e,t.patches_,t.inversePatches_)):e=M(t,r,[]),_(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==n?e:void 0}function M(e,t,r){if(C(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[A];if(!i)return d(t,(n,A)=>P(e,i,t,n,A,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return D(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const t=i.copy_;let A=t,o=!1;3===i.type_&&(A=new Set(t),t.clear(),o=!0),d(A,(n,A)=>P(e,i,t,n,A,r,o),n),D(e,t,!1),r&&e.patches_&&I("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function P(e,t,r,n,i,A,o){if(null==i)return;if("object"!=typeof i&&!o)return;const a=C(i);if(!a||o){if(s(i)){const o=M(e,i,A&&t&&3!==t.type_&&!p(t.assigned_,n)?A.concat(n):void 0);if(g(r,n,o),!s(o))return;e.canAutoFreeze_=!1}else o&&r.add(i);if(u(i)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[n]===i&&a)return;M(e,i),t&&t.scope_.parent_||"symbol"==typeof n||!(y(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))||D(e,i)}}}function D(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&b(t,r)}var k={get(e,t){if(t===A)return e;const r=m(e);if(!p(r,t))return function(e,t,r){const n=L(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!u(n)?n:n===R(e.base_,t)?(j(e),e.copy_[t]=V(n,e)):n},has:(e,t)=>t in m(e),ownKeys:e=>Reflect.ownKeys(m(e)),set(e,t,r){const n=L(m(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=R(m(e),t),a=n?.[A];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((i=r)===(o=n)?0!==i||1/i==1/o:i!=i&&o!=o)&&(void 0!==r||p(e.base_,t)))return!0;j(e),H(e)}var i,o;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==R(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,j(e),H(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=m(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){o(11)},getPrototypeOf:e=>a(e.base_),setPrototypeOf(){o(12)}},N={};function R(e,t){const r=e[A];return(r?m(r):e)[t]}function L(e,t){if(!(t in e))return;let r=a(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=a(r)}}function H(e){e.modified_||(e.modified_=!0,e.parent_&&H(e.parent_))}function j(e){e.copy_||(e.copy_=w(e.base_,e.scope_.immer_.useStrictShallowCopy_))}d(k,(e,t)=>{N[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),N.deleteProperty=function(e,t){return N.set.call(this,e,t,void 0)},N.set=function(e,t,r){return k.set.call(this,e[0],t,r,e[0])};function V(e,t){const r=y(e)?I("MapSet").proxyMap_(e,t):v(e)?I("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:O(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,A=k;r&&(i=[n],A=N);const{revoke:o,proxy:a}=Proxy.revocable(i,A);return n.draft_=a,n.revoke_=o,a}(e,t);return(t?t.scope_:O()).drafts_.push(r),r}function K(e){if(!u(e)||C(e))return e;const t=e[A];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=w(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=w(e,!0);return d(r,(e,t)=>{g(r,e,K(t))},n),t&&(t.finalized_=!1),r}var z=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let i;if("function"!=typeof t&&o(6),void 0!==r&&"function"!=typeof r&&o(7),u(e)){const n=U(this),A=V(e,void 0);let o=!0;try{i=t(A),o=!1}finally{o?_(n):x(n)}return F(n,r),T(i,n)}if(!e||"object"!=typeof e){if(i=t(e),void 0===i&&(i=e),i===n&&(i=void 0),this.autoFreeze_&&b(i,!0),r){const t=[],n=[];I("Patches").generateReplacementPatches_(e,i,t,n),r(t,n)}return i}o(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){u(e)||o(8),s(e)&&(e=function(e){s(e)||o(10);return K(e)}(e));const t=U(this),r=V(e,void 0);return r[A].isManual_=!0,x(t),r}finishDraft(e,t){const r=e&&e[A];r&&r.isManual_||o(9);const{scope_:n}=r;return F(n,t),T(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=I("Patches").applyPatches_;return s(e)?n(e,t):this.produce(e,e=>n(e,t))}};z.produce;function G(e){return e}},2293(e,t,r){"use strict";var n=r(28551),i=r(35548),A=r(64117),o=r(78227)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||A(r=n(a)[o])?t:i(r)}},2478(e,t,r){"use strict";var n=r(79504),i=r(48981),A=Math.floor,o=n("".charAt),a=n("".replace),s=n("".slice),u=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,l,f){var d=r+e.length,h=n.length,p=c;return void 0!==l&&(l=i(l),p=u),a(f,p,function(i,a){var u;switch(o(a,0)){case"$":return"$";case"&":return e;case"`":return s(t,0,r);case"'":return s(t,d);case"<":u=l[s(a,1,-1)];break;default:var c=+a;if(0===c)return i;if(c>h){var f=A(c/10);return 0===f?i:f<=h?void 0===n[f-1]?o(a,1):n[f-1]+o(a,1):i}u=n[c-1]}return void 0===u?"":u})}},2613(e,t,r){"use strict";r.d(t,{s:()=>u});var n=r(96540),i=r(12070),A=r(66426),o=r(49082),a=r(65245);function s(e){var{layout:t,margin:r}=e,a=(0,o.j)(),s=(0,i.r)();return(0,n.useEffect)(()=>{s||(a((0,A.JK)(t)),a((0,A.B_)(r)))},[a,s,t,r]),null}var u=(0,n.memo)(s,a.P)},2892(e,t,r){"use strict";var n=r(46518),i=r(96395),A=r(43724),o=r(44576),a=r(19167),s=r(79504),u=r(92796),c=r(39297),l=r(23167),f=r(1625),d=r(10757),h=r(72777),p=r(79039),g=r(38480).f,y=r(77347).f,v=r(24913).f,m=r(31240),w=r(43802).trim,b="Number",B=o[b],C=a[b],E=B.prototype,S=o.TypeError,I=s("".slice),O=s("".charCodeAt),F=function(e){var t,r,n,i,A,o,a,s,u=h(e,"number");if(d(u))throw new S("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=w(u),43===(t=O(u,0))||45===t){if(88===(r=O(u,2))||120===r)return NaN}else if(48===t){switch(O(u,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+u}for(o=(A=I(u,2)).length,a=0;a<o;a++)if((s=O(A,a))<48||s>i)return NaN;return parseInt(A,n)}return+u},_=u(b,!B(" 0o1")||!B("0b1")||B("+0x1")),x=function(e){var t,r=arguments.length<1?0:B(function(e){var t=h(e,"number");return"bigint"==typeof t?t:F(t)}(e));return f(E,t=this)&&p(function(){m(t)})?l(Object(r),this,x):r};x.prototype=E,_&&!i&&(E.constructor=x),n({global:!0,constructor:!0,wrap:!0,forced:_},{Number:x});var U=function(e,t){for(var r,n=A?g(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)c(t,r=n[i])&&!c(e,r)&&v(e,r,y(t,r))};i&&C&&U(a[b],C),(_||i)&&U(a[b],B)},3025(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(1863),i=r(21465);t.toPath=function(e){if(Array.isArray(e))return e.map(i.toKey);if("symbol"==typeof e)return[e];const t=[],r=(e=n.toString(e)).length;if(0===r)return t;let A=0,o="",a="",s=!1;for(46===e.charCodeAt(0)&&(t.push(""),A++);A<r;){const n=e[A];a?"\\"===n&&A+1<r?(A++,o+=e[A]):n===a?a="":o+=n:s?'"'===n||"'"===n?a=n:"]"===n?(s=!1,t.push(o),o=""):o+=n:"["===n?(s=!0,o&&(t.push(o),o="")):"."===n?o&&(t.push(o),o=""):o+=n,A++}return o&&t.push(o),t}},3066(e,t,r){"use strict";r.d(t,{E:()=>o});var n=r(52891),i=r(30970);function A(e){return e.keys().map(t=>function(e,t){const r=function(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}(t);if(r)return function(e,t){const r=e.default;if("function"==typeof r)return{identifier:t,controllerConstructor:r}}(e(t),r)}(e,t)).filter(e=>e)}function o(e){const t=n.lg.start();e&&t.load(A(e));for(const e in i.A)Object.prototype.hasOwnProperty.call(i.A,e)&&t.register(e,i.A[e]);return t}},3072(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,A=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,s=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,p=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,m=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case l:case A:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case u:case f:case g:case p:case s:return e;default:return t}}case i:return t}}}function B(e){return b(e)===l}t.AsyncMode=c,t.ConcurrentMode=l,t.ContextConsumer=u,t.ContextProvider=s,t.Element=n,t.ForwardRef=f,t.Fragment=A,t.Lazy=g,t.Memo=p,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return B(e)||b(e)===c},t.isConcurrentMode=B,t.isContextConsumer=function(e){return b(e)===u},t.isContextProvider=function(e){return b(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===f},t.isFragment=function(e){return b(e)===A},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===p},t.isPortal=function(e){return b(e)===i},t.isProfiler=function(e){return b(e)===a},t.isStrictMode=function(e){return b(e)===o},t.isSuspense=function(e){return b(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===A||e===l||e===a||e===o||e===d||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===p||e.$$typeof===s||e.$$typeof===u||e.$$typeof===f||e.$$typeof===v||e.$$typeof===m||e.$$typeof===w||e.$$typeof===y)},t.typeOf=b},3296(e,t,r){"use strict";r(45806)},3362(e,t,r){"use strict";r(10436),r(16499),r(82003),r(7743),r(51481),r(40280)},3717(e,t,r){"use strict";var n=r(79504),i=2147483647,A=/[^\0-\u007E]/,o=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",s=RangeError,u=n(o.exec),c=Math.floor,l=String.fromCharCode,f=n("".charCodeAt),d=n([].join),h=n([].push),p=n("".replace),g=n("".split),y=n("".toLowerCase),v=function(e){return e+22+75*(e<26)},m=function(e,t,r){var n=0;for(e=r?c(e/700):e>>1,e+=c(e/t);e>455;)e=c(e/35),n+=36;return c(n+36*e/(e+38))},w=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=f(e,r++);if(i>=55296&&i<=56319&&r<n){var A=f(e,r++);56320==(64512&A)?h(t,((1023&i)<<10)+(1023&A)+65536):(h(t,i),r--)}else h(t,i)}return t}(e);var r,n,A=e.length,o=128,u=0,p=72;for(r=0;r<e.length;r++)(n=e[r])<128&&h(t,l(n));var g=t.length,y=g;for(g&&h(t,"-");y<A;){var w=i;for(r=0;r<e.length;r++)(n=e[r])>=o&&n<w&&(w=n);var b=y+1;if(w-o>c((i-u)/b))throw new s(a);for(u+=(w-o)*b,o=w,r=0;r<e.length;r++){if((n=e[r])<o&&++u>i)throw new s(a);if(n===o){for(var B=u,C=36;;){var E=C<=p?1:C>=p+26?26:C-p;if(B<E)break;var S=B-E,I=36-E;h(t,l(v(E+S%I))),B=c(S/I),C+=36}h(t,l(v(B))),p=m(u,b,y===g),u=0,y++}}u++,o++}return d(t,"")};e.exports=function(e){var t,r,n=[],i=g(p(y(e),o,"."),".");for(t=0;t<i.length;t++)r=i[t],h(n,u(A,r)?"xn--"+w(r):r);return d(n,".")}},3844(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(53964);t.cloneDeep=function(e){return n.cloneDeepWithImpl(e,void 0,e,new Map,void 0)}},4146(e,t,r){"use strict";var n=r(73404),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},A={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function s(e){return n.isMemo(e)?o:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=o;var u=Object.defineProperty,c=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(h){var i=d(r);i&&i!==h&&e(t,i,n)}var o=c(r);l&&(o=o.concat(l(r)));for(var a=s(t),p=s(r),g=0;g<o.length;++g){var y=o[g];if(!(A[y]||n&&n[y]||p&&p[y]||a&&a[y])){var v=f(r,y);try{u(t,y,v)}catch(e){}}}}return t}},4217(e,t,r){"use strict";r.d(t,{o:()=>n});var n=(e,t,r,n,i,A,o,a)=>{if(null!=A&&null!=a){var s=o[0],u=null==s?void 0:a(s.positions,A);if(null!=u)return u;var c=null==i?void 0:i[Number(A)];if(c)return"horizontal"===r?{x:c.coordinate,y:(n.top+t)/2}:{x:(n.left+e)/2,y:c.coordinate}}}},4364(e,t,r){"use strict";r.d(t,{F0:()=>n,tQ:()=>A,yU:()=>i});var n="data-recharts-item-index",i="data-recharts-item-id",A=60},4526(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(52185),i=r(36254),A=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const o=function(){function e(e){this.errorCorrectionLevel=n.A.forBits(e>>3&3),this.dataMask=7&e}return e.numBitsDiffering=function(e,t){return i.A.bitCount(e^t)},e.decodeFormatInformation=function(t,r){var n=e.doDecodeFormatInformation(t,r);return null!==n?n:e.doDecodeFormatInformation(t^e.FORMAT_INFO_MASK_QR,r^e.FORMAT_INFO_MASK_QR)},e.doDecodeFormatInformation=function(t,r){var n,i,o=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=A(e.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,l=c[0];if(l===t||l===r)return new e(c[1]);var f=e.numBitsDiffering(t,l);f<o&&(a=c[1],o=f),t!==r&&(f=e.numBitsDiffering(r,l))<o&&(a=c[1],o=f)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o<=3?new e(a):null},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.getDataMask=function(){return this.dataMask},e.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask},e.FORMAT_INFO_MASK_QR=21522,e.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],e}()},4900(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(93234),i=r(89407),A=r(28823),o=r(55182),a=r(73753),s=r(23636),u=r(58503),c=r(50998),l=r(36254),f=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.toResultPoint=function(){return new n.A(this.getX(),this.getY())},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e}();const d=function(){function e(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return e.prototype.detect=function(){return this.detectMirror(!1)},e.prototype.detectMirror=function(e){var t=this.getMatrixCenter(),r=this.getBullsEyeCorners(t);if(e){var n=r[0];r[0]=r[2],r[2]=n}this.extractParameters(r);var A=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),o=this.getMatrixCornerPoints(r);return new i.A(A,o,this.compact,this.nbDataBlocks,this.nbLayers)},e.prototype.extractParameters=function(e){if(!(this.isValidPoint(e[0])&&this.isValidPoint(e[1])&&this.isValidPoint(e[2])&&this.isValidPoint(e[3])))throw new u.A;var t=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(e[0],e[1],t),this.sampleLine(e[1],e[2],t),this.sampleLine(e[2],e[3],t),this.sampleLine(e[3],e[0],t)]);this.shift=this.getRotation(r,t);for(var n=0,i=0;i<4;i++){var A=r[(this.shift+i)%4];this.compact?(n<<=7,n+=A>>1&127):(n<<=10,n+=(A>>2&992)+(A>>1&31))}var o=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(o>>6),this.nbDataBlocks=1+(63&o)):(this.nbLayers=1+(o>>11),this.nbDataBlocks=1+(2047&o))},e.prototype.getRotation=function(e,t){var r=0;e.forEach(function(e,n,i){r=(r<<3)+((e>>t-2<<1)+(1&e))}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(l.A.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new u.A},e.prototype.getCorrectedParameterData=function(e,t){var r,n;t?(r=7,n=2):(r=10,n=4);for(var i=r-n,A=new Int32Array(r),o=r-1;o>=0;--o)A[o]=15&e,e>>=4;try{new s.A(a.A.AZTEC_PARAM).decode(A,i)}catch(e){throw new u.A}var c=0;for(o=0;o<n;o++)c=(c<<4)+A[o];return c},e.prototype.getBullsEyeCorners=function(e){var t=e,r=e,i=e,A=e,o=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(t,o,1,-1),s=this.getFirstDifferent(r,o,1,1),c=this.getFirstDifferent(i,o,-1,1),l=this.getFirstDifferent(A,o,-1,-1);if(this.nbCenterLayers>2){var f=this.distancePoint(l,a)*this.nbCenterLayers/(this.distancePoint(A,t)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(a,s,c,l))break}t=a,r=s,i=c,A=l,o=!o}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new u.A;this.compact=5===this.nbCenterLayers;var d=new n.A(t.getX()+.5,t.getY()-.5),h=new n.A(r.getX()+.5,r.getY()+.5),p=new n.A(i.getX()-.5,i.getY()+.5),g=new n.A(A.getX()-.5,A.getY()-.5);return this.expandSquare([d,h,p,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},e.prototype.getMatrixCenter=function(){var e,t,r,n;try{e=(c=new o.A(this.image).detect())[0],t=c[1],r=c[2],n=c[3]}catch(A){var i=this.image.getWidth()/2,a=this.image.getHeight()/2;e=this.getFirstDifferent(new f(i+7,a-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new f(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new f(i-7,a+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new f(i-7,a-7),!1,-1,-1).toResultPoint()}var s=A.A.round((e.getX()+n.getX()+t.getX()+r.getX())/4),u=A.A.round((e.getY()+n.getY()+t.getY()+r.getY())/4);try{var c;e=(c=new o.A(this.image,15,s,u).detect())[0],t=c[1],r=c[2],n=c[3]}catch(i){e=this.getFirstDifferent(new f(s+7,u-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new f(s+7,u+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new f(s-7,u+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new f(s-7,u-7),!1,-1,-1).toResultPoint()}return s=A.A.round((e.getX()+n.getX()+t.getX()+r.getX())/4),u=A.A.round((e.getY()+n.getY()+t.getY()+r.getY())/4),new f(s,u)},e.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},e.prototype.sampleGrid=function(e,t,r,n,i){var A=c.A.getInstance(),o=this.getDimension(),a=o/2-this.nbCenterLayers,s=o/2+this.nbCenterLayers;return A.sampleGrid(e,o,o,a,a,s,a,s,s,a,s,t.getX(),t.getY(),r.getX(),r.getY(),n.getX(),n.getY(),i.getX(),i.getY())},e.prototype.sampleLine=function(e,t,r){for(var n=0,i=this.distanceResultPoint(e,t),o=i/r,a=e.getX(),s=e.getY(),u=o*(t.getX()-e.getX())/i,c=o*(t.getY()-e.getY())/i,l=0;l<r;l++)this.image.get(A.A.round(a+l*u),A.A.round(s+l*c))&&(n|=1<<r-l-1);return n},e.prototype.isWhiteOrBlackRectangle=function(e,t,r,n){e=new f(e.getX()-3,e.getY()+3),t=new f(t.getX()-3,t.getY()-3),r=new f(r.getX()+3,r.getY()-3),n=new f(n.getX()+3,n.getY()+3);var i=this.getColor(n,e);if(0===i)return!1;var A=this.getColor(e,t);return A===i&&((A=this.getColor(t,r))===i&&(A=this.getColor(r,n))===i)},e.prototype.getColor=function(e,t){for(var r=this.distancePoint(e,t),n=(t.getX()-e.getX())/r,i=(t.getY()-e.getY())/r,o=0,a=e.getX(),s=e.getY(),u=this.image.get(e.getX(),e.getY()),c=Math.ceil(r),l=0;l<c;l++)a+=n,s+=i,this.image.get(A.A.round(a),A.A.round(s))!==u&&o++;var f=o/r;return f>.1&&f<.9?0:f<=.1===u?1:-1},e.prototype.getFirstDifferent=function(e,t,r,n){for(var i=e.getX()+r,A=e.getY()+n;this.isValid(i,A)&&this.image.get(i,A)===t;)i+=r,A+=n;for(i-=r,A-=n;this.isValid(i,A)&&this.image.get(i,A)===t;)i+=r;for(i-=r;this.isValid(i,A)&&this.image.get(i,A)===t;)A+=n;return new f(i,A-=n)},e.prototype.expandSquare=function(e,t,r){var i=r/(2*t),A=e[0].getX()-e[2].getX(),o=e[0].getY()-e[2].getY(),a=(e[0].getX()+e[2].getX())/2,s=(e[0].getY()+e[2].getY())/2,u=new n.A(a+i*A,s+i*o),c=new n.A(a-i*A,s-i*o);return A=e[1].getX()-e[3].getX(),o=e[1].getY()-e[3].getY(),a=(e[1].getX()+e[3].getX())/2,s=(e[1].getY()+e[3].getY())/2,[u,new n.A(a+i*A,s+i*o),c,new n.A(a-i*A,s-i*o)]},e.prototype.isValid=function(e,t){return e>=0&&e<this.image.getWidth()&&t>0&&t<this.image.getHeight()},e.prototype.isValidPoint=function(e){var t=A.A.round(e.getX()),r=A.A.round(e.getY());return this.isValid(t,r)},e.prototype.distancePoint=function(e,t){return A.A.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.distanceResultPoint=function(e,t){return A.A.distance(e.getX(),e.getY(),t.getX(),t.getY())},e.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(l.A.truncDivision(this.nbLayers-4,8)+1)+15},e}()},5180(e,t,r){"use strict";r.d(t,{A$:()=>i,HK:()=>o,Lp:()=>n,et:()=>A});var n=e=>e.layout.width,i=e=>e.layout.height,A=e=>e.layout.scale,o=e=>e.layout.margin},5224(e,t,r){"use strict";r.d(t,{A:()=>d});var n,i=r(73872),A=r(43407),o=r(31327),a=r(58503),s=r(32993),u=r(7758),c=r(93234),l=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const d=function(e){function t(){var t=e.call(this)||this;return t.decodeRowResult="",t.counters=new Int32Array(6),t}return l(t,e),t.prototype.decodeRow=function(e,r,n){var A,o,s,l,d,h,p=this.findAsteriskPattern(r),g=r.getNextSet(p[1]),y=r.getSize(),v=this.counters;v.fill(0),this.decodeRowResult="";do{t.recordPattern(r,g,v);var m=this.toPattern(v);if(m<0)throw new a.A;d=this.patternToChar(m),this.decodeRowResult+=d,h=g;try{for(var w=(A=void 0,f(v)),b=w.next();!b.done;b=w.next()){g+=b.value}}catch(e){A={error:e}}finally{try{b&&!b.done&&(o=w.return)&&o.call(w)}finally{if(A)throw A.error}}g=r.getNextSet(g)}while("*"!==d);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var B=0;try{for(var C=f(v),E=C.next();!E.done;E=C.next()){B+=E.value}}catch(e){s={error:e}}finally{try{E&&!E.done&&(l=C.return)&&l.call(C)}finally{if(s)throw s.error}}if(g===y||!r.get(g))throw new a.A;if(this.decodeRowResult.length<2)throw new a.A;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var S=this.decodeExtended(this.decodeRowResult),I=(p[1]+p[0])/2,O=h+B/2;return new u.A(S,null,0,[new c.A(I,e),new c.A(O,e)],i.A.CODE_93,(new Date).getTime())},t.prototype.findAsteriskPattern=function(e){var r=e.getSize(),n=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,A=n,o=!1,s=i.length,u=0,c=n;c<r;c++)if(e.get(c)!==o)i[u]++;else{if(u===s-1){if(this.toPattern(i)===t.ASTERISK_ENCODING)return new Int32Array([A,c]);A+=i[0]+i[1],i.copyWithin(0,2,2+u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,o=!o}throw new a.A},t.prototype.toPattern=function(e){var t,r,n=0;try{for(var i=f(e),A=i.next();!A.done;A=i.next()){n+=A.value}}catch(e){t={error:e}}finally{try{A&&!A.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}for(var o=0,a=e.length,s=0;s<a;s++){var u=Math.round(9*e[s]/n);if(u<1||u>4)return-1;if(1&s)o<<=u;else for(var c=0;c<u;c++)o=o<<1|1}return o},t.prototype.patternToChar=function(e){for(var r=0;r<t.CHARACTER_ENCODINGS.length;r++)if(t.CHARACTER_ENCODINGS[r]===e)return t.ALPHABET_STRING.charAt(r);throw new a.A},t.prototype.decodeExtended=function(e){for(var t=e.length,r="",n=0;n<t;n++){var i=e.charAt(n);if(i>="a"&&i<="d"){if(n>=t-1)throw new o.A;var A=e.charAt(n+1),a="\0";switch(i){case"d":if(!(A>="A"&&A<="Z"))throw new o.A;a=String.fromCharCode(A.charCodeAt(0)+32);break;case"a":if(!(A>="A"&&A<="Z"))throw new o.A;a=String.fromCharCode(A.charCodeAt(0)-64);break;case"b":if(A>="A"&&A<="E")a=String.fromCharCode(A.charCodeAt(0)-38);else if(A>="F"&&A<="J")a=String.fromCharCode(A.charCodeAt(0)-11);else if(A>="K"&&A<="O")a=String.fromCharCode(A.charCodeAt(0)+16);else if(A>="P"&&A<="T")a=String.fromCharCode(A.charCodeAt(0)+43);else if("U"===A)a="\0";else if("V"===A)a="@";else if("W"===A)a="`";else{if(!(A>="X"&&A<="Z"))throw new o.A;a=String.fromCharCode(127)}break;case"c":if(A>="A"&&A<="O")a=String.fromCharCode(A.charCodeAt(0)-32);else{if("Z"!==A)throw new o.A;a=":"}}r+=a,n++}else r+=i}return r},t.prototype.checkChecksums=function(e){var t=e.length;this.checkOneChecksum(e,t-2,20),this.checkOneChecksum(e,t-1,15)},t.prototype.checkOneChecksum=function(e,r,n){for(var i=1,o=0,a=r-1;a>=0;a--)o+=i*t.ALPHABET_STRING.indexOf(e.charAt(a)),++i>n&&(i=1);if(e.charAt(r)!==t.ALPHABET_STRING[o%47])throw new A.A},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(s.A)},5298(e,t,r){"use strict";r.d(t,{zk:()=>a});var n=r(96540),i=["children"];var A={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},o=(0,n.createContext)(A);function a(e){var{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,i);return n.createElement(o.Provider,{value:r},t)}},5506(e,t,r){"use strict";var n=r(46518),i=r(32357).entries;n({target:"Object",stat:!0},{entries:function(e){return i(e)}})},5508(e,t,r){"use strict";r.d(t,{J:()=>q});var n=r(96540),i=r(71468),A=r(14644),o=r(65307),a=r(26960),s=r(74531),u=r(46446),c=r(66426),l=r(86215);function f(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":"children"===e&&"object"==typeof t&&null!==t?"<<CHILDREN>>":t}var d=r(94115),h=r(92617),p=r(12064),g=r(1932),y=(0,o.Z0)({name:"referenceElements",initialState:{dots:[],areas:[],lines:[]},reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=(0,p.ss)(e).dots.findIndex(e=>e===t.payload);-1!==r&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=(0,p.ss)(e).areas.findIndex(e=>e===t.payload);-1!==r&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push((0,g.h4)(t.payload))},removeLine:(e,t)=>{var r=(0,p.ss)(e).lines.findIndex(e=>e===t.payload);-1!==r&&e.lines.splice(r,1)}}}),{addDot:v,removeDot:m,addArea:w,removeArea:b,addLine:B,removeLine:C}=y.actions,E=y.reducer,S={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},I=(0,o.Z0)({name:"brush",initialState:S,reducers:{setBrushSettings:(e,t)=>null==t.payload?S:t.payload}}),{setBrushSettings:O}=I.actions,F=I.reducer,_=r(91283),x=r(92476),U=(0,o.Z0)({name:"polarAxis",initialState:{radiusAxis:{},angleAxis:{}},reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=(0,g.h4)(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=(0,g.h4)(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:Q,removeRadiusAxis:T,addAngleAxis:M,removeAngleAxis:P}=U.actions,D=U.reducer,k=r(19794),N=r(77232),R=r(73102),L=r(21077),H=(0,o.Z0)({name:"errorBars",initialState:{},reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(e=>e.dataKey===n.dataKey&&e.direction===n.direction?i:e))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(e=>e.dataKey!==n.dataKey||e.direction!==n.direction))}}}),{addErrorBar:j,replaceErrorBar:V,removeErrorBar:K}=H.actions,z=H.reducer,G=r(59938),W=r(85138),X=(0,A.HY)({brush:F,cartesianAxis:d.CA,chartData:u.LV,errorBars:z,graphicalItems:h.iZ,layout:c.Vp,legend:_.CU,options:a.lJ,polarAxis:D,polarOptions:k.J,referenceElements:E,rootProps:x.vE,tooltip:s.En,zIndex:W.v3}),Y=r(12070),Z=r(92649);function q(e){var{preloadedState:t,children:r,reduxStoreName:A}=e,a=(0,Y.r)(),s=(0,n.useRef)(null);if(a)return r;null==s.current&&(s.current=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Chart";return(0,o.U1)({reducer:X,preloadedState:e,middleware:e=>e({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes("es6")}).concat([l.YF.middleware,l.fP.middleware,N.$7.middleware,R.x.middleware,L.k.middleware]),enhancers:e=>{var t=e;return"function"==typeof e&&(t=e()),t.concat((0,o.CF)({type:"raf"}))},devTools:G.m.devToolsEnabled&&{serialize:{replacer:f},name:"recharts-".concat(t)}})}(t,A));var u=Z.E;return n.createElement(i.Kq,{context:u,store:s.current},r)}},5614(e,t,r){"use strict";r.d(t,{Ze:()=>B,dL:()=>b,h8:()=>m,qY:()=>C});var n=r(96540),i=r(20025),A=r.n(i),o=r(91706),a=r(86069),s=r(26470),u=r(59744),c=r(80196),l=r(27132),f=r(60648),d=["valueAccessor"],h=["dataKey","clockWise","id","textBreakAll","zIndex"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(null,arguments)}function g(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var y=e=>Array.isArray(e.value)?A()(e.value):e.value,v=(0,n.createContext)(void 0),m=v.Provider,w=(0,n.createContext)(void 0),b=w.Provider;function B(e){var{valueAccessor:t=y}=e,r=g(e,d),{dataKey:i,clockWise:A,id:m,textBreakAll:b,zIndex:B}=r,C=g(r,h),E=(0,n.useContext)(v),S=(0,n.useContext)(w),I=E||S;return I&&I.length?n.createElement(l.g,{zIndex:null!=B?B:f.I.label},n.createElement(a.W,{className:"recharts-label-list"},I.map((e,A)=>{var a,l=(0,u.uy)(i)?t(e,A):(0,s.kr)(e&&e.payload,i),f=(0,u.uy)(m)?{}:{id:"".concat(m,"-").concat(A)};return n.createElement(o.JU,p({key:"label-".concat(A)},(0,c.a)(e),C,f,{fill:null!==(a=r.fill)&&void 0!==a?a:e.fill,parentViewBox:e.parentViewBox,value:l,textBreakAll:b,viewBox:e.viewBox,index:A,zIndex:0}))}))):null}function C(e){var{label:t}=e;return t?!0===t?n.createElement(B,{key:"labelList-implicit"}):n.isValidElement(t)||(0,o.ZY)(t)?n.createElement(B,{key:"labelList-implicit",content:t}):"object"==typeof t?n.createElement(B,p({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}B.displayName="LabelList"},6228(e,t,r){"use strict";r.d(t,{A:()=>x});var n=r(73872),i=r(23431),A=r(8032),o=r(58503),a=r(7758),s=r(15511),u=r(92819),c=r(43407),l=r(73753),f=r(23636),d=r(31327),h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},p=function(){function e(e,t,r){this.ecCodewords=e,this.ecBlocks=[t],r&&this.ecBlocks.push(r)}return e.prototype.getECCodewords=function(){return this.ecCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e}(),g=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}();const y=function(){function e(e,t,r,n,i,A){var o,a;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=i,this.ecBlocks=A;var s=0,u=A.getECCodewords(),c=A.getECBlocks();try{for(var l=h(c),f=l.next();!f.done;f=l.next()){var d=f.value;s+=d.getCount()*(d.getDataCodewords()+u)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}this.totalCodewords=s}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},e.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},e.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},e.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getECBlocks=function(){return this.ecBlocks},e.getVersionForDimensions=function(t,r){var n,i;if(1&t||1&r)throw new d.A;try{for(var A=h(e.VERSIONS),o=A.next();!o.done;o=A.next()){var a=o.value;if(a.symbolSizeRows===t&&a.symbolSizeColumns===r)return a}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=A.return)&&i.call(A)}finally{if(n)throw n.error}}throw new d.A},e.prototype.toString=function(){return""+this.versionNumber},e.buildVersions=function(){return[new e(1,10,10,8,8,new p(5,new g(1,3))),new e(2,12,12,10,10,new p(7,new g(1,5))),new e(3,14,14,12,12,new p(10,new g(1,8))),new e(4,16,16,14,14,new p(12,new g(1,12))),new e(5,18,18,16,16,new p(14,new g(1,18))),new e(6,20,20,18,18,new p(18,new g(1,22))),new e(7,22,22,20,20,new p(20,new g(1,30))),new e(8,24,24,22,22,new p(24,new g(1,36))),new e(9,26,26,24,24,new p(28,new g(1,44))),new e(10,32,32,14,14,new p(36,new g(1,62))),new e(11,36,36,16,16,new p(42,new g(1,86))),new e(12,40,40,18,18,new p(48,new g(1,114))),new e(13,44,44,20,20,new p(56,new g(1,144))),new e(14,48,48,22,22,new p(68,new g(1,174))),new e(15,52,52,24,24,new p(42,new g(2,102))),new e(16,64,64,14,14,new p(56,new g(2,140))),new e(17,72,72,16,16,new p(36,new g(4,92))),new e(18,80,80,18,18,new p(48,new g(4,114))),new e(19,88,88,20,20,new p(56,new g(4,144))),new e(20,96,96,22,22,new p(68,new g(4,174))),new e(21,104,104,24,24,new p(56,new g(6,136))),new e(22,120,120,18,18,new p(68,new g(6,175))),new e(23,132,132,20,20,new p(62,new g(8,163))),new e(24,144,144,22,22,new p(62,new g(8,156),new g(2,155))),new e(25,8,18,6,16,new p(7,new g(1,5))),new e(26,8,32,6,14,new p(11,new g(1,10))),new e(27,12,26,10,24,new p(14,new g(1,16))),new e(28,12,36,10,16,new p(18,new g(1,22))),new e(29,16,36,14,16,new p(24,new g(1,32))),new e(30,16,48,14,22,new p(28,new g(1,49)))]},e.VERSIONS=e.buildVersions(),e}();var v=r(57149);const m=function(){function e(t){var r=t.getHeight();if(r<8||r>144||1&r)throw new d.A;this.version=e.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new i.A(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return e.prototype.getVersion=function(){return this.version},e.readVersion=function(e){var t=e.getHeight(),r=e.getWidth();return y.getVersionForDimensions(t,r)},e.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,r=4,n=0,i=this.mappingBitMatrix.getHeight(),A=this.mappingBitMatrix.getWidth(),o=!1,a=!1,s=!1,u=!1;do{if(r!==i||0!==n||o)if(r===i-2&&0===n&&3&A&&!a)e[t++]=255&this.readCorner2(i,A),r-=2,n+=2,a=!0;else if(r!==i+4||2!==n||7&A||s)if(r!==i-2||0!==n||4!=(7&A)||u){do{r<i&&n>=0&&!this.readMappingMatrix.get(n,r)&&(e[t++]=255&this.readUtah(r,n,i,A)),r-=2,n+=2}while(r>=0&&n<A);r+=1,n+=3;do{r>=0&&n<A&&!this.readMappingMatrix.get(n,r)&&(e[t++]=255&this.readUtah(r,n,i,A)),r+=2,n-=2}while(r<i&&n>=0);r+=3,n+=1}else e[t++]=255&this.readCorner4(i,A),r-=2,n+=2,u=!0;else e[t++]=255&this.readCorner3(i,A),r-=2,n+=2,s=!0;else e[t++]=255&this.readCorner1(i,A),r-=2,n+=2,o=!0}while(r<i||n<A);if(t!==this.version.getTotalCodewords())throw new d.A;return e},e.prototype.readModule=function(e,t,r,n){return e<0&&(e+=r,t+=4-(r+4&7)),t<0&&(t+=n,e+=4-(n+4&7)),this.readMappingMatrix.set(t,e),this.mappingBitMatrix.get(t,e)},e.prototype.readUtah=function(e,t,r,n){var i=0;return this.readModule(e-2,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e-2,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e-1,t,r,n)&&(i|=1),i<<=1,this.readModule(e,t-2,r,n)&&(i|=1),i<<=1,this.readModule(e,t-1,r,n)&&(i|=1),i<<=1,this.readModule(e,t,r,n)&&(i|=1),i},e.prototype.readCorner1=function(e,t){var r=0;return this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,1,e,t)&&(r|=1),r<<=1,this.readModule(e-1,2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(2,t-1,e,t)&&(r|=1),r<<=1,this.readModule(3,t-1,e,t)&&(r|=1),r},e.prototype.readCorner2=function(e,t){var r=0;return this.readModule(e-3,0,e,t)&&(r|=1),r<<=1,this.readModule(e-2,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(0,t-4,e,t)&&(r|=1),r<<=1,this.readModule(0,t-3,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r},e.prototype.readCorner3=function(e,t){var r=0;return this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(0,t-3,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-3,e,t)&&(r|=1),r<<=1,this.readModule(1,t-2,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r},e.prototype.readCorner4=function(e,t){var r=0;return this.readModule(e-3,0,e,t)&&(r|=1),r<<=1,this.readModule(e-2,0,e,t)&&(r|=1),r<<=1,this.readModule(e-1,0,e,t)&&(r|=1),r<<=1,this.readModule(0,t-2,e,t)&&(r|=1),r<<=1,this.readModule(0,t-1,e,t)&&(r|=1),r<<=1,this.readModule(1,t-1,e,t)&&(r|=1),r<<=1,this.readModule(2,t-1,e,t)&&(r|=1),r<<=1,this.readModule(3,t-1,e,t)&&(r|=1),r},e.prototype.extractDataRegion=function(e){var t=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==t)throw new v.A("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),A=this.version.getDataRegionSizeColumns(),o=t/n|0,a=r/A|0,s=o*n,u=a*A,c=new i.A(u,s),l=0;l<o;++l)for(var f=l*n,d=0;d<a;++d)for(var h=d*A,p=0;p<n;++p)for(var g=l*(n+2)+1+p,y=f+p,m=0;m<A;++m){var w=d*(A+2)+1+m;if(e.get(w,g)){var b=h+m;c.set(b,y)}}return c},e}();var w=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const b=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,r){var n,i,A,o,a=r.getECBlocks(),s=0,u=a.getECBlocks();try{for(var c=w(u),l=c.next();!l.done;l=c.next()){s+=(g=l.value).getCount()}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var f=new Array(s),d=0;try{for(var h=w(u),p=h.next();!p.done;p=h.next())for(var g=p.value,y=0;y<g.getCount();y++){var m=g.getDataCodewords(),b=a.getECCodewords()+m;f[d++]=new e(m,new Uint8Array(b))}}catch(e){A={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(A)throw A.error}}var B=f[0].codewords.length-a.getECCodewords(),C=B-1,E=0;for(y=0;y<C;y++)for(var S=0;S<d;S++)f[S].codewords[y]=t[E++];var I=24===r.getVersionNumber(),O=I?8:d;for(S=0;S<O;S++)f[S].codewords[B-1]=t[E++];var F=f[0].codewords.length;for(y=B;y<F;y++)for(S=0;S<d;S++){var _=I?(S+8)%d:S,x=I&&_>7?y-1:y;f[_].codewords[x]=t[E++]}if(E!==t.length)throw new v.A;return f},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}();var B=r(58346),C=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const E=function(){function e(){this.rsDecoder=new f.A(l.A.DATA_MATRIX_FIELD_256)}return e.prototype.decode=function(e){var t,r,n=new m(e),i=n.getVersion(),A=n.readCodewords(),o=b.getDataBlocks(A,i),a=0;try{for(var s=C(o),u=s.next();!u.done;u=s.next()){a+=u.value.getNumDataCodewords()}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}for(var c=new Uint8Array(a),l=o.length,f=0;f<l;f++){var d=o[f],h=d.getCodewords(),p=d.getNumDataCodewords();this.correctErrors(h,p);for(var g=0;g<p;g++)c[g*l+f]=h[g]}return B.A.decode(c)},e.prototype.correctErrors=function(e,t){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-t)}catch(e){throw new c.A}for(var n=0;n<t;n++)e[n]=r[n]},e}();var S=r(55182),I=r(12122),O=r(50998),F=r(93234);const _=function(){function e(e){this.image=e,this.rectangleDetector=new S.A(this.image)}return e.prototype.detect=function(){var t=this.rectangleDetector.detect(),r=this.detectSolid1(t);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new o.A;var n=(r=this.shiftToModuleCenter(r))[0],i=r[1],A=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(A,a)+1;1&~s||(s+=1),1&~u||(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u));var c=e.sampleGrid(this.image,n,i,A,a,s,u);return new I.A(c,[n,i,A,a])},e.shiftPoint=function(e,t,r){var n=(t.getX()-e.getX())/(r+1),i=(t.getY()-e.getY())/(r+1);return new F.A(e.getX()+n,e.getY()+i)},e.moveAway=function(e,t,r){var n=e.getX(),i=e.getY();return n<t?n-=1:n+=1,i<r?i-=1:i+=1,new F.A(n,i)},e.prototype.detectSolid1=function(e){var t=e[0],r=e[1],n=e[3],i=e[2],A=this.transitionsBetween(t,r),o=this.transitionsBetween(r,n),a=this.transitionsBetween(n,i),s=this.transitionsBetween(i,t),u=A,c=[i,t,r,n];return u>o&&(u=o,c[0]=t,c[1]=r,c[2]=n,c[3]=i),u>a&&(u=a,c[0]=r,c[1]=n,c[2]=i,c[3]=t),u>s&&(c[0]=n,c[1]=i,c[2]=t,c[3]=r),c},e.prototype.detectSolid2=function(t){var r=t[0],n=t[1],i=t[2],A=t[3],o=this.transitionsBetween(r,A),a=e.shiftPoint(n,i,4*(o+1)),s=e.shiftPoint(i,n,4*(o+1));return this.transitionsBetween(a,r)<this.transitionsBetween(s,A)?(t[0]=r,t[1]=n,t[2]=i,t[3]=A):(t[0]=n,t[1]=i,t[2]=A,t[3]=r),t},e.prototype.correctTopRight=function(t){var r=t[0],n=t[1],i=t[2],A=t[3],o=this.transitionsBetween(r,A),a=this.transitionsBetween(n,A),s=e.shiftPoint(r,n,4*(a+1)),u=e.shiftPoint(i,n,4*(o+1));o=this.transitionsBetween(s,A),a=this.transitionsBetween(u,A);var c=new F.A(A.getX()+(i.getX()-n.getX())/(o+1),A.getY()+(i.getY()-n.getY())/(o+1)),l=new F.A(A.getX()+(r.getX()-n.getX())/(a+1),A.getY()+(r.getY()-n.getY())/(a+1));return this.isValid(c)?this.isValid(l)?this.transitionsBetween(s,c)+this.transitionsBetween(u,c)>this.transitionsBetween(s,l)+this.transitionsBetween(u,l)?c:l:c:this.isValid(l)?l:null},e.prototype.shiftToModuleCenter=function(t){var r=t[0],n=t[1],i=t[2],A=t[3],o=this.transitionsBetween(r,A)+1,a=this.transitionsBetween(i,A)+1,s=e.shiftPoint(r,n,4*a),u=e.shiftPoint(i,n,4*o);1&~(o=this.transitionsBetween(s,A)+1)||(o+=1),1&~(a=this.transitionsBetween(u,A)+1)||(a+=1);var c,l,f=(r.getX()+n.getX()+i.getX()+A.getX())/4,d=(r.getY()+n.getY()+i.getY()+A.getY())/4;return r=e.moveAway(r,f,d),n=e.moveAway(n,f,d),i=e.moveAway(i,f,d),A=e.moveAway(A,f,d),s=e.shiftPoint(r,n,4*a),s=e.shiftPoint(s,A,4*o),c=e.shiftPoint(n,r,4*a),c=e.shiftPoint(c,i,4*o),u=e.shiftPoint(i,A,4*a),u=e.shiftPoint(u,n,4*o),l=e.shiftPoint(A,i,4*a),[s,c,u,l=e.shiftPoint(l,r,4*o)]},e.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},e.sampleGrid=function(e,t,r,n,i,A,o){return O.A.getInstance().sampleGrid(e,A,o,.5,.5,A-.5,.5,A-.5,o-.5,.5,o-.5,t.getX(),t.getY(),i.getX(),i.getY(),n.getX(),n.getY(),r.getX(),r.getY())},e.prototype.transitionsBetween=function(e,t){var r=Math.trunc(e.getX()),n=Math.trunc(e.getY()),i=Math.trunc(t.getX()),A=Math.trunc(t.getY()),o=Math.abs(A-n)>Math.abs(i-r);if(o){var a=r;r=n,n=a,a=i,i=A,A=a}for(var s=Math.abs(i-r),u=Math.abs(A-n),c=-s/2,l=n<A?1:-1,f=r<i?1:-1,d=0,h=this.image.get(o?n:r,o?r:n),p=r,g=n;p!==i;p+=f){var y=this.image.get(o?g:p,o?p:g);if(y!==h&&(d++,h=y),(c+=u)>0){if(g===A)break;g+=l,c-=s}}return d},e}();const x=function(){function e(){this.decoder=new E}return e.prototype.decode=function(t,r){var i,o;if(void 0===r&&(r=null),null!=r&&r.has(A.A.PURE_BARCODE)){var c=e.extractPureBits(t.getBlackMatrix());i=this.decoder.decode(c),o=e.NO_POINTS}else{var l=new _(t.getBlackMatrix()).detect();i=this.decoder.decode(l.getBits()),o=l.getPoints()}var f=i.getRawBytes(),d=new a.A(i.getText(),f,8*f.length,o,n.A.DATA_MATRIX,u.A.currentTimeMillis()),h=i.getByteSegments();null!=h&&d.putMetadata(s.A.BYTE_SEGMENTS,h);var p=i.getECLevel();return null!=p&&d.putMetadata(s.A.ERROR_CORRECTION_LEVEL,p),d},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(null==t||null==r)throw new o.A;var n=this.moduleSize(t,e),A=t[1],a=r[1],s=t[0],u=(r[0]-s+1)/n,c=(a-A+1)/n;if(u<=0||c<=0)throw new o.A;var l=n/2;A+=l,s+=l;for(var f=new i.A(u,c),d=0;d<c;d++)for(var h=A+d*n,p=0;p<u;p++)e.get(s+p*n,h)&&f.set(p,d);return f},e.moduleSize=function(e,t){for(var r=t.getWidth(),n=e[0],i=e[1];n<r&&t.get(n,i);)n++;if(n===r)throw new o.A;var A=n-e[0];if(0===A)throw new o.A;return A},e.NO_POINTS=[],e}()},6392(e,t,r){"use strict";r.d(t,{o:()=>n});var n=(e,t)=>e===t||null!=e&&null!=t&&(e[0]===t[0]&&e[1]===t[1])},6634(e,t,r){"use strict";r.d(t,{R:()=>n});var n=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];if("undefined"!=typeof console&&console.warn&&(void 0===t&&console.warn("LogUtils requires an error message argument"),!e))if(void 0===t)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var A=0;console.warn(t.replace(/%s/g,()=>n[A++]))}}},6653(e,t,r){"use strict";r.d(t,{A:()=>h});var n,i=r(73872),A=r(43407),o=r(8032),a=r(31327),s=r(58503),u=r(7758),c=r(93234),l=r(32993),f=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.findStartPattern=function(e){for(var r=e.getSize(),n=e.getNextSet(0),i=0,A=Int32Array.from([0,0,0,0,0,0]),o=n,a=!1,u=n;u<r;u++)if(e.get(u)!==a)A[i]++;else{if(5===i){for(var c=t.MAX_AVG_VARIANCE,f=-1,d=t.CODE_START_A;d<=t.CODE_START_C;d++){var h=l.A.patternMatchVariance(A,t.CODE_PATTERNS[d],t.MAX_INDIVIDUAL_VARIANCE);h<c&&(c=h,f=d)}if(f>=0&&e.isRange(Math.max(0,o-(u-o)/2),o,!1))return Int32Array.from([o,u,f]);o+=A[0]+A[1],(A=A.slice(2,A.length))[i-1]=0,A[i]=0,i--}else i++;A[i]=1,a=!a}throw new s.A},t.decodeCode=function(e,r,n){l.A.recordPattern(e,n,r);for(var i=t.MAX_AVG_VARIANCE,A=-1,o=0;o<t.CODE_PATTERNS.length;o++){var a=t.CODE_PATTERNS[o],u=this.patternMatchVariance(r,a,t.MAX_INDIVIDUAL_VARIANCE);u<i&&(i=u,A=o)}if(A>=0)return A;throw new s.A},t.prototype.decodeRow=function(e,r,n){var l,f=n&&!0===n.get(o.A.ASSUME_GS1),d=t.findStartPattern(r),h=d[2],p=0,g=new Uint8Array(20);switch(g[p++]=h,h){case t.CODE_START_A:l=t.CODE_CODE_A;break;case t.CODE_START_B:l=t.CODE_CODE_B;break;case t.CODE_START_C:l=t.CODE_CODE_C;break;default:throw new a.A}for(var y=!1,v=!1,m="",w=d[0],b=d[1],B=Int32Array.from([0,0,0,0,0,0]),C=0,E=0,S=h,I=0,O=!0,F=!1,_=!1;!y;){var x=v;switch(v=!1,C=E,E=t.decodeCode(r,B,b),g[p++]=E,E!==t.CODE_STOP&&(O=!0),E!==t.CODE_STOP&&(S+=++I*E),w=b,b+=B.reduce(function(e,t){return e+t},0),E){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new a.A}switch(l){case t.CODE_CODE_A:if(E<64)m+=_===F?String.fromCharCode(" ".charCodeAt(0)+E):String.fromCharCode(" ".charCodeAt(0)+E+128),_=!1;else if(E<96)m+=_===F?String.fromCharCode(E-64):String.fromCharCode(E+64),_=!1;else switch(E!==t.CODE_STOP&&(O=!1),E){case t.CODE_FNC_1:f&&(0===m.length?m+="]C1":m+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!F&&_?(F=!0,_=!1):F&&_?(F=!1,_=!1):_=!0;break;case t.CODE_SHIFT:v=!0,l=t.CODE_CODE_B;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:y=!0}break;case t.CODE_CODE_B:if(E<96)m+=_===F?String.fromCharCode(" ".charCodeAt(0)+E):String.fromCharCode(" ".charCodeAt(0)+E+128),_=!1;else switch(E!==t.CODE_STOP&&(O=!1),E){case t.CODE_FNC_1:f&&(0===m.length?m+="]C1":m+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!F&&_?(F=!0,_=!1):F&&_?(F=!1,_=!1):_=!0;break;case t.CODE_SHIFT:v=!0,l=t.CODE_CODE_A;break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_C:l=t.CODE_CODE_C;break;case t.CODE_STOP:y=!0}break;case t.CODE_CODE_C:if(E<100)E<10&&(m+="0"),m+=E;else switch(E!==t.CODE_STOP&&(O=!1),E){case t.CODE_FNC_1:f&&(0===m.length?m+="]C1":m+=String.fromCharCode(29));break;case t.CODE_CODE_A:l=t.CODE_CODE_A;break;case t.CODE_CODE_B:l=t.CODE_CODE_B;break;case t.CODE_STOP:y=!0}}x&&(l=l===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var U=b-w;if(b=r.getNextUnset(b),!r.isRange(b,Math.min(r.getSize(),b+(b-w)/2),!1))throw new s.A;if((S-=I*C)%103!==C)throw new A.A;var Q=m.length;if(0===Q)throw new s.A;Q>0&&O&&(m=l===t.CODE_CODE_C?m.substring(0,Q-2):m.substring(0,Q-1));for(var T=(d[1]+d[0])/2,M=w+U/2,P=g.length,D=new Uint8Array(P),k=0;k<P;k++)D[k]=g[k];var N=[new c.A(T,e),new c.A(M,e)];return new u.A(m,D,0,N,i.A.CODE_128,(new Date).getTime())},t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],t.MAX_AVG_VARIANCE=.25,t.MAX_INDIVIDUAL_VARIANCE=.7,t.CODE_SHIFT=98,t.CODE_CODE_C=99,t.CODE_CODE_B=100,t.CODE_CODE_A=101,t.CODE_FNC_1=102,t.CODE_FNC_2=97,t.CODE_FNC_3=96,t.CODE_FNC_4_A=101,t.CODE_FNC_4_B=100,t.CODE_START_A=103,t.CODE_START_B=104,t.CODE_START_C=105,t.CODE_STOP=106,t}(l.A);const h=d},6858(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.ary=function(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}},7463(e,t){"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<A(i,t)))break e;e[n]=t,e[r]=i,r=n}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,o=i>>>1;n<o;){var a=2*(n+1)-1,s=e[a],u=a+1,c=e[u];if(0>A(s,r))u<i&&0>A(c,s)?(e[n]=c,e[u]=r,n=u):(e[n]=s,e[a]=r,n=a);else{if(!(u<i&&0>A(c,r)))break e;e[n]=c,e[u]=r,n=u}}}return t}function A(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();t.unstable_now=function(){return a.now()-s}}var u=[],c=[],l=1,f=null,d=3,h=!1,p=!1,g=!1,y="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function w(e){for(var t=n(c);null!==t;){if(null===t.callback)i(c);else{if(!(t.startTime<=e))break;i(c),t.sortIndex=t.expirationTime,r(u,t)}t=n(c)}}function b(e){if(g=!1,w(e),!p)if(null!==n(u))p=!0,T(B);else{var t=n(c);null!==t&&M(b,t.startTime-e)}}function B(e,r){p=!1,g&&(g=!1,v(I),I=-1),h=!0;var A=d;try{for(w(r),f=n(u);null!==f&&(!(f.expirationTime>r)||e&&!_());){var o=f.callback;if("function"==typeof o){f.callback=null,d=f.priorityLevel;var a=o(f.expirationTime<=r);r=t.unstable_now(),"function"==typeof a?f.callback=a:f===n(u)&&i(u),w(r)}else i(u);f=n(u)}if(null!==f)var s=!0;else{var l=n(c);null!==l&&M(b,l.startTime-r),s=!1}return s}finally{f=null,d=A,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var C,E=!1,S=null,I=-1,O=5,F=-1;function _(){return!(t.unstable_now()-F<O)}function x(){if(null!==S){var e=t.unstable_now();F=e;var r=!0;try{r=S(!0,e)}finally{r?C():(E=!1,S=null)}}else E=!1}if("function"==typeof m)C=function(){m(x)};else if("undefined"!=typeof MessageChannel){var U=new MessageChannel,Q=U.port2;U.port1.onmessage=x,C=function(){Q.postMessage(null)}}else C=function(){y(x,0)};function T(e){S=e,E||(E=!0,C())}function M(e,r){I=y(function(){e(t.unstable_now())},r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){p||h||(p=!0,T(B))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(e){switch(d){case 1:case 2:case 3:var t=3;break;default:t=d}var r=d;d=t;try{return e()}finally{d=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=d;d=e;try{return t()}finally{d=r}},t.unstable_scheduleCallback=function(e,i,A){var o=t.unstable_now();switch("object"==typeof A&&null!==A?A="number"==typeof(A=A.delay)&&0<A?o+A:o:A=o,e){case 1:var a=-1;break;case 2:a=250;break;case 5:a=1073741823;break;case 4:a=1e4;break;default:a=5e3}return e={id:l++,callback:i,priorityLevel:e,startTime:A,expirationTime:a=A+a,sortIndex:-1},A>o?(e.sortIndex=A,r(c,e),null===n(u)&&e===n(c)&&(g?(v(I),I=-1):g=!0,M(b,A-o))):(e.sortIndex=a,r(u,e),p||h||(p=!0,T(B))),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=d;return function(){var r=d;d=t;try{return e.apply(this,arguments)}finally{d=r}}}},7743(e,t,r){"use strict";var n=r(46518),i=r(69565),A=r(79306),o=r(36043),a=r(1103),s=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{race:function(e){var t=this,r=o.f(t),n=r.reject,u=a(function(){var o=A(t.resolve);s(e,function(e){i(o,t,e).then(r.resolve,n)})});return u.error&&n(u.value),r.promise}})},7758(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(92819);const i=function(){function e(e,t,r,i,A,o){void 0===r&&(r=null==t?0:8*t.length),void 0===o&&(o=n.A.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=r,this.resultPoints=i,this.format=A,this.timestamp=o,this.text=e,this.rawBytes=t,this.numBits=null==r?null==t?0:8*t.length:r,this.resultPoints=i,this.format=A,this.resultMetadata=null,this.timestamp=null==o?n.A.currentTimeMillis():o}return e.prototype.getText=function(){return this.text},e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.getBarcodeFormat=function(){return this.format},e.prototype.getResultMetadata=function(){return this.resultMetadata},e.prototype.putMetadata=function(e,t){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},e.prototype.putAllMetadata=function(e){null!==e&&(null===this.resultMetadata?this.resultMetadata=e:this.resultMetadata=new Map(e))},e.prototype.addResultPoints=function(e){var t=this.resultPoints;if(null===t)this.resultPoints=e;else if(null!==e&&e.length>0){var r=new Array(t.length+e.length);n.A.arraycopy(t,0,r,0,t.length),n.A.arraycopy(e,0,r,t.length,e.length),this.resultPoints=r}},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.toString=function(){return this.text},e}()},7860(e,t,r){"use strict";var n=r(82839);e.exports=/web0s(?!.*chrome)/i.test(n)},7861(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(40717),i=r(3844);t.matches=function(e){return e=i.cloneDeep(e),t=>n.isMatch(t,e)}},8032(e,t,r){"use strict";var n;r.d(t,{A:()=>i}),function(e){e[e.OTHER=0]="OTHER",e[e.PURE_BARCODE=1]="PURE_BARCODE",e[e.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",e[e.TRY_HARDER=3]="TRY_HARDER",e[e.CHARACTER_SET=4]="CHARACTER_SET",e[e.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",e[e.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",e[e.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",e[e.ASSUME_GS1=8]="ASSUME_GS1",e[e.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",e[e.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",e[e.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS"}(n||(n={}));const i=n},8107(e,t,r){"use strict";r.d(t,{n:()=>A});var n=r(96540),i=r(59744);function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"animation-",r=(0,n.useRef)((0,i.NF)(t)),A=(0,n.useRef)(e);return A.current!==e&&(r.current=(0,i.NF)(t),A.current=e),r.current}},8193(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isUnsafeProperty=function(e){return"__proto__"===e}},8194(e,t,r){"use strict";r.d(t,{s:()=>D});var n=r(96540),i=r(40961),A=r(55846),o=r(34164),a=r(49303),s=r(90706),u=r(98940),c=r(77404);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(null,arguments)}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function d(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var h=32,p={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"};function g(e){var t,{data:r,iconType:i,inactiveColor:A}=e,o=16,a=h/6,u=h/3,c=r.inactive?A:r.color,l=null!=i?i:r.type;if("none"===l)return null;if("plainline"===l)return n.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:null===(t=r.payload)||void 0===t?void 0:t.strokeDasharray,x1:0,y1:o,x2:h,y2:o,className:"recharts-legend-icon"});if("line"===l)return n.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(o,"h").concat(u,"\n A").concat(a,",").concat(a,",0,1,1,").concat(2*u,",").concat(o,"\n H").concat(h,"M").concat(2*u,",").concat(o,"\n A").concat(a,",").concat(a,",0,1,1,").concat(u,",").concat(o),className:"recharts-legend-icon"});if("rect"===l)return n.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(4,"h").concat(h,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(n.isValidElement(r.legendIcon)){var p=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},r);return delete p.legendIcon,n.cloneElement(r.legendIcon,p)}return n.createElement(s.i,{fill:c,cx:o,cy:o,size:h,sizeType:"diameter",type:l})}function y(e){var{payload:t,iconSize:r,layout:i,formatter:A,inactiveColor:s,iconType:c}=e,f={x:0,y:0,width:h,height:h},d={display:"horizontal"===i?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((t,i)=>{var h=t.formatter||A,y=(0,o.$)({"recharts-legend-item":!0,["legend-item-".concat(i)]:!0,inactive:t.inactive});if("none"===t.type)return null;var v=t.inactive?s:t.color,m=h?h(t.value,t,i):t.value;return n.createElement("li",l({className:y,style:d,key:"legend-item-".concat(i)},(0,u.XC)(e,t,i)),n.createElement(a.u,{width:r,height:r,viewBox:f,style:p,"aria-label":"".concat(m," legend icon")},n.createElement(g,{data:t,iconType:c,inactiveColor:s})),n.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},m))})}var v=e=>{var t=(0,c.e)(e,p),{payload:r,layout:i,align:A}=t;if(!r||!r.length)return null;var o={padding:0,margin:0,textAlign:"horizontal"===i?A:"left"};return n.createElement("ul",{className:"recharts-default-legend",style:o},n.createElement(y,l({},t,{payload:r})))},m=r(59744),w=r(79799),b=r(49082),B=r(47962);var C=r(66583),E=r(19287),S=r(91283),I=["contextPayload"];function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},O.apply(null,arguments)}function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(Object(r),!0).forEach(function(t){x(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function x(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function U(e){return e.value}function Q(e){var{contextPayload:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,I),i=(0,w.s)(t,e.payloadUniqBy,U),A=_(_({},r),{},{payload:i});return n.isValidElement(e.content)?n.cloneElement(e.content,A):"function"==typeof e.content?n.createElement(e.content,A):n.createElement(v,A)}function T(e){var t=(0,b.j)();return(0,n.useEffect)(()=>{t((0,S.h1)(e))},[t,e]),null}function M(e){var t=(0,b.j)();return(0,n.useEffect)(()=>(t((0,S.hx)(e)),()=>{t((0,S.hx)({width:0,height:0}))}),[t,e]),null}var P={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function D(e){var t=(0,c.e)(e,P),r=(0,b.G)(B.g0),o=(0,A.M)(),a=(0,E.Kp)(),{width:s,height:u,wrapperStyle:l,portal:f}=t,[d,h]=(0,C.V)([r]),p=(0,E.yi)(),g=(0,E.rY)();if(null==p||null==g)return null;var y=p-((null==a?void 0:a.left)||0)-((null==a?void 0:a.right)||0),v=function(e,t,r,n){return"vertical"===e&&(0,m.Et)(t)?{height:t}:"horizontal"===e?{width:r||n}:null}(t.layout,u,s,y),w=f?l:_(_({position:"absolute",width:(null==v?void 0:v.width)||s||"auto",height:(null==v?void 0:v.height)||u||"auto"},function(e,t,r,n,i,A){var o,a,{layout:s,align:u,verticalAlign:c}=t;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(o="center"===u&&"vertical"===s?{left:((n||0)-A.width)/2}:"right"===u?{right:r&&r.right||0}:{left:r&&r.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(a="middle"===c?{top:((i||0)-A.height)/2}:"bottom"===c?{bottom:r&&r.bottom||0}:{top:r&&r.top||0}),_(_({},o),a)}(l,t,a,p,g,d)),l),S=null!=f?f:o;if(null==S||null==r)return null;var I=n.createElement("div",{className:"recharts-legend-wrapper",style:w,ref:h},n.createElement(T,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&n.createElement(M,{width:d.width,height:d.height}),n.createElement(Q,O({},t,v,{margin:a,chartWidth:p,chartHeight:g,contextPayload:r})));return(0,i.createPortal)(I,S)}D.displayName="Legend"},8791(e,t,r){"use strict";r.d(t,{J:()=>x});var n=r(96540),i=r(59744),A=r(77404),o=r(23929);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=(e,t,r)=>e+(t-e)*r,l=e=>{var{from:t,to:r}=e;return t!==r},f=(e,t,r)=>{var n=(0,o.s8)((t,r)=>{if(l(r)){var[n,i]=e(r.from,r.to,r.velocity);return s(s({},r),{},{from:n,velocity:i})}return r},t);return r<1?(0,o.s8)((e,t)=>l(t)&&null!=n[e]?s(s({},t),{},{velocity:c(t.velocity,n[e].velocity,r),from:c(t.from,n[e].from,r)}):t,t):f(e,n,r-1)};function d(e,t,r,n,i,A){var a,u=n.reduce((r,n)=>s(s({},r),{},{[n]:{from:e[n],velocity:0,to:t[n]}}),{}),c=null,d=n=>{a||(a=n);var h=(n-a)/r.dt;u=f(r,u,h),i(s(s(s({},e),t),(0,o.s8)((e,t)=>t.from,u))),a=n,Object.values(u).filter(l).length&&(c=A.setTimeout(d))};return()=>(c=A.setTimeout(d),()=>{var e;null===(e=c)||void 0===e||e()})}const h=(e,t,r,n,i,A)=>{var a=(0,o.mP)(e,t);return null==r?()=>(i(s(s({},e),t)),()=>{}):!0===r.isStepper?d(e,t,r,a,i,A):function(e,t,r,n,i,A,a){var u,l=null,f=i.reduce((r,n)=>{var i=e[n],A=t[n];return null==i||null==A?r:s(s({},r),{},{[n]:[i,A]})},{}),d=i=>{u||(u=i);var h=(i-u)/n,p=(0,o.s8)((e,t)=>c(...t,r(h)),f);if(A(s(s(s({},e),t),p)),h<1)l=a.setTimeout(d);else{var g=(0,o.s8)((e,t)=>c(...t,r(1)),f);A(s(s(s({},e),t),g))}};return()=>(l=a.setTimeout(d),()=>{var e;null===(e=l)||void 0===e||e()})}(e,t,r,n,a,i,A)};var p=1e-4,g=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],y=(e,t)=>e.map((e,r)=>e*t**r).reduce((e,t)=>e+t),v=(e,t)=>r=>{var n=g(e,t);return y(n,r)},m=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(1===t.length)switch(t[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:var n=(e=>{var t,r=e.split("(");if(2!==r.length||"cubic-bezier"!==r[0])return null;var n=null===(t=r[1])||void 0===t||null===(t=t.split(")")[0])||void 0===t?void 0:t.split(",");if(null==n||4!==n.length)return null;var i=n.map(e=>parseFloat(e));return[i[0],i[1],i[2],i[3]]})(t[0]);if(n)return n}return 4===t.length?t:[0,0,1,1]},w=(e,t,r,n)=>{var i,A,o=v(e,r),a=v(t,n),s=(i=e,A=r,e=>{var t=[...g(i,A).map((e,t)=>e*t).slice(1),0];return y(t,e)}),u=e=>e>1?1:e<0?0:e,c=e=>{for(var t=e>1?1:e,r=t,n=0;n<8;++n){var i=o(r)-t,A=s(r);if(Math.abs(i-t)<p||A<p)return a(r);r=u(r-i/A)}return a(r)};return c.isStepper=!1,c},b=function(){return w(...m(...arguments))},B=e=>{if("string"==typeof e)switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return b(e);case"spring":return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{stiff:t=100,damping:r=8,dt:n=17}=e,i=(e,i,A)=>{var o=A+(-(e-i)*t-A*r)*n/1e3,a=A*n/1e3+e;return Math.abs(a-i)<p&&Math.abs(o)<p?[i,0]:[a,o]};return i.isStepper=!0,i.dt=n,i}();default:if("cubic-bezier"===e.split("(")[0])return b(e)}return"function"==typeof e?e:null};class C{setTimeout(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=performance.now(),n=null,i=A=>{A-r>=t?e(A):"function"==typeof requestAnimationFrame&&(n=requestAnimationFrame(i))};return n=requestAnimationFrame(i),()=>{null!=n&&cancelAnimationFrame(n)}}}function E(){return e=new C,t=()=>null,r=!1,n=null,i=A=>{if(!r){if(Array.isArray(A)){if(!A.length)return;var o=A,[a,...s]=o;return"number"==typeof a?void(n=e.setTimeout(i.bind(null,s),a)):(i(a),void(n=e.setTimeout(i.bind(null,s))))}"string"==typeof A&&t(A),"object"==typeof A&&t(A),"function"==typeof A&&A()}},{stop:()=>{r=!0},start:e=>{r=!1,n&&(n(),n=null),i(e)},subscribe:e=>(t=e,()=>{t=()=>null}),getTimeoutController:()=>e};var e,t,r,n,i}var S=(0,n.createContext)(E);var I=r(59938),O={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},F={t:0},_={t:1};function x(e){var t,r,o,a=(0,A.e)(e,O),{isActive:s,canBegin:u,duration:c,easing:l,begin:f,onAnimationEnd:d,onAnimationStart:p,children:g}=a,y="auto"===s?!I.m.isSsr:s,v=(t=a.animationId,r=a.animationManager,o=(0,n.useContext)(S),(0,n.useMemo)(()=>null!=r?r:o(t),[t,r,o])),[m,w]=(0,n.useState)(y?F:_),b=(0,n.useRef)(null);return(0,n.useEffect)(()=>{y||w(_)},[y]),(0,n.useEffect)(()=>{if(!y||!u)return i.lQ;var e=h(F,_,B(l),c,w,v.getTimeoutController());return v.start([p,f,()=>{b.current=e()},c,d]),()=>{v.stop(),b.current&&b.current(),d()}},[y,u,c,l,f,p,d,v]),g(m.t)}},8805(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.uniqBy=function(e,t){const r=new Map;for(let n=0;n<e.length;n++){const i=e[n],A=t(i,n,e);r.has(A)||r.set(A,i)}return Array.from(r.values())}},8813(e,t,r){"use strict";function n(e){return Number.isFinite(e)}function i(e){return"number"==typeof e&&e>0&&Number.isFinite(e)}r.d(t,{F:()=>i,H:()=>n})},9531(e,t,r){"use strict";function n(e){return"stackId"in e&&null!=e.stackId&&null!=e.dataKey}r.d(t,{g:()=>n})},9655(e,t,r){"use strict";r.d(t,{Fq:()=>Ie,L_:()=>be});var n=r(96540),i=r(80305),A=r.n(i),o=r(34164),a=r(25508),s=r(98453),u=r(36189),c=r(26470),l=r(91572),f=r(19287),d=r(41927),h=r(79926),p=r(82695),g=e=>e.graphicalItems.polarItems,y=(0,a.Mz)([d.N,h.E],l.eo),v=(0,a.Mz)([g,l.DP,y],l.ec),m=(0,a.Mz)([v],l.rj),w=(0,a.Mz)([m,s.z3],l.Nk),b=(0,a.Mz)([w,l.DP,v],l.fb),B=((0,a.Mz)([w,l.DP,v],(e,t,r)=>r.length>0?e.flatMap(e=>r.flatMap(r=>{var n;return{value:(0,c.kr)(e,null!==(n=t.dataKey)&&void 0!==n?n:r.dataKey),errorDomain:[]}})).filter(Boolean):null!=(null==t?void 0:t.dataKey)?e.map(e=>({value:(0,c.kr)(e,t.dataKey),errorDomain:[]})):e.map(e=>({value:e,errorDomain:[]}))),()=>{}),C=(0,a.Mz)([w,l.DP,v,l.CH,d.N],l.EZ),E=(0,a.Mz)([l.DP,l.AV,l.Lu,B,C,B,f.fz,d.N],l.wL),S=(0,a.Mz)([l.DP,f.fz,w,b,p.eC,d.N,E],l.tP),I=(0,a.Mz)([S,l.DP,l.xM],l.xp);(0,a.Mz)([l.DP,S,I,d.N],l.g1);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){_(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x=(0,a.Mz)([g,(e,t)=>t],(e,t)=>e.filter(e=>"pie"===e.type).find(e=>e.id===t)),U=[],Q=(e,t,r)=>0===(null==r?void 0:r.length)?U:r,T=(0,a.Mz)([s.z3,x,Q],(e,t,r)=>{var n,{chartData:i}=e;if(null!=t&&((n=null!=(null==t?void 0:t.data)&&t.data.length>0?t.data:i)&&n.length||null==r||(n=r.map(e=>F(F({},t.presentationProps),e.props))),null!=n))return n}),M=(0,a.Mz)([T,x,Q],(e,t,r)=>{if(null!=e&&null!=t)return e.map((e,n)=>{var i,A,o=(0,c.kr)(e,t.nameKey,t.name);return A=null!=r&&null!==(i=r[n])&&void 0!==i&&null!==(i=i.props)&&void 0!==i&&i.fill?r[n].props.fill:"object"==typeof e&&null!=e&&"fill"in e?e.fill:t.fill,{value:(0,c.uM)(o,t.dataKey),color:A,payload:e,type:t.legendType}})}),P=(0,a.Mz)([T,x,Q,u.HZ],(e,t,r,n)=>{if(null!=t&&null!=e)return be({offset:n,pieSettings:t,displayedData:e,cells:r})}),D=r(49082),k=r(86069),N=r(29705),R=r(81174),L=r(72050),H=r(94501),j=r(14040),V=r(59744),K=r(98940),z=r(15079),G=r(58008),W=r(59482),X=r(33032),Y=r(19797),Z=r(4364),q=r(8107),J=r(77404),$=r(55694),ee=r(42678),te=r(55448),re=r(8791),ne=r(5614),ie=r(27132),Ae=r(60648),oe=["key"],ae=["onMouseEnter","onClick","onMouseLeave"],se=["id"],ue=["id"];function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(t){fe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function fe(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},de.apply(null,arguments)}function he(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function pe(e){var t=(0,n.useMemo)(()=>(0,H.aS)(e.children,L.f),[e.children]),r=(0,D.G)(r=>M(r,e.id,t));return null==r?null:n.createElement(Y._,{legendPayload:r})}var ge=n.memo(e=>{var{dataKey:t,nameKey:r,sectors:i,stroke:A,strokeWidth:o,fill:a,name:s,hide:u,tooltipType:l,id:f}=e,d={dataDefinedOnItem:i.map(e=>e.tooltipPayload),positions:i.map(e=>e.tooltipPosition),settings:{stroke:A,strokeWidth:o,fill:a,dataKey:t,nameKey:r,name:(0,c.uM)(s,t),hide:u,type:l,color:a,unit:"",graphicalItemId:f}};return n.createElement(W.r,{tooltipEntrySettings:d})}),ye=(e,t,r)=>{var{top:n,left:i,width:A,height:o}=t,a=(0,j.lY)(A,o),s=i+(0,V.F4)(e.cx,A,A/2),u=n+(0,V.F4)(e.cy,o,o/2),c=(0,V.F4)(e.innerRadius,a,0),l=((e,t,r)=>"function"==typeof t?(0,V.F4)(t(e),r,.8*r):(0,V.F4)(t,r,.8*r))(r,e.outerRadius,a);return{cx:s,cy:u,innerRadius:c,outerRadius:l,maxRadius:e.maxRadius||Math.sqrt(A*A+o*o)/2}};function ve(e){var{sectors:t,props:r,showLabels:i}=e,{label:A,labelLine:a,dataKey:s}=r;if(!i||!A||!t)return null;var u=(0,te.uZ)(r),l=(0,te.ic)(A),f=(0,te.ic)(a),d="object"==typeof A&&"offsetRadius"in A&&"number"==typeof A.offsetRadius&&A.offsetRadius||20,h=t.map((e,t)=>{var r,i,h=(e.startAngle+e.endAngle)/2,p=(0,j.IZ)(e.cx,e.cy,e.outerRadius+d,h),g=le(le(le(le({},u),e),{},{stroke:"none"},l),{},{index:t,textAnchor:(r=p.x,i=e.cx,r>i?"start":r<i?"end":"middle")},p),y=le(le(le(le({},u),e),{},{fill:"none",stroke:e.fill},f),{},{index:t,points:[(0,j.IZ)(e.cx,e.cy,e.outerRadius,h),p],key:"line"});return n.createElement(ie.g,{zIndex:Ae.I.label,key:"label-".concat(e.startAngle,"-").concat(e.endAngle,"-").concat(e.midAngle,"-").concat(t)},n.createElement(k.W,null,a&&((e,t)=>{if(n.isValidElement(e))return n.cloneElement(e,t);if("function"==typeof e)return e(t);var r=(0,o.$)("recharts-pie-label-line","boolean"!=typeof e?e.className:""),{key:i}=t,A=he(t,oe);return n.createElement(N.I,de({},A,{type:"linear",className:r}))})(a,y),((e,t,r)=>{if(n.isValidElement(e))return n.cloneElement(e,t);var i=r;if("function"==typeof e&&(i=e(t),n.isValidElement(i)))return i;var A,a=(0,o.$)("recharts-pie-label-text",(A=e)&&"object"==typeof A&&"className"in A&&"string"==typeof A.className?A.className:"");return n.createElement(R.EY,de({},t,{alignmentBaseline:"middle",className:a}),i)})(A,g,(0,c.kr)(e,s))))});return n.createElement(k.W,{className:"recharts-pie-labels"},h)}function me(e){var{sectors:t,props:r,showLabels:i}=e,{label:A}=r;return"object"==typeof A&&null!=A&&"position"in A?n.createElement(ne.qY,{label:A}):n.createElement(ve,{sectors:t,props:r,showLabels:i})}function we(e){var{sectors:t,activeShape:r,inactiveShape:i,allOtherPieProps:A,shape:o,id:a}=e,s=(0,D.G)(X.A2),u=(0,D.G)(X.Xb),c=(0,D.G)(X.fx),{onMouseEnter:l,onClick:f,onMouseLeave:d}=A,h=he(A,ae),p=(0,G.Cj)(l,A.dataKey,a),g=(0,G.Pg)(d),y=(0,G.Ub)(f,A.dataKey,a);return null==t||0===t.length?null:n.createElement(n.Fragment,null,t.map((e,l)=>{if(0===(null==e?void 0:e.startAngle)&&0===(null==e?void 0:e.endAngle)&&1!==t.length)return null;var f=null==c||c===a,d=String(l)===s&&(null==u||A.dataKey===u)&&f,v=r&&d?r:s?i:null,m=le(le({},e),{},{stroke:e.stroke,tabIndex:-1,[Z.F0]:l,[Z.yU]:a});return n.createElement(k.W,de({key:"sector-".concat(null==e?void 0:e.startAngle,"-").concat(null==e?void 0:e.endAngle,"-").concat(e.midAngle,"-").concat(l),tabIndex:-1,className:"recharts-pie-sector"},(0,K.XC)(h,e,l),{onMouseEnter:p(e,l),onMouseLeave:g(e,l),onClick:y(e,l)}),n.createElement(z.y,de({option:null!=o?o:v,index:l,shapeType:"sector",isActive:d},m)))}))}function be(e){var t,r,n,{pieSettings:i,displayedData:A,cells:o,offset:a}=e,{cornerRadius:s,startAngle:u,endAngle:l,dataKey:f,nameKey:d,tooltipType:h}=i,p=Math.abs(i.minAngle),g=((e,t)=>(0,V.sA)(t-e)*Math.min(Math.abs(t-e),360))(u,l),y=Math.abs(g),v=A.length<=1?0:null!==(t=i.paddingAngle)&&void 0!==t?t:0,m=A.filter(e=>0!==(0,c.kr)(e,f,0)).length,w=y-m*p-(y>=360?m:m-1)*v,b=A.reduce((e,t)=>{var r=(0,c.kr)(t,f,0);return e+((0,V.Et)(r)?r:0)},0);b>0&&(r=A.map((e,t)=>{var r,A=(0,c.kr)(e,f,0),l=(0,c.kr)(e,d,t),y=ye(i,a,e),m=((0,V.Et)(A)?A:0)/b,B=le(le({},e),o&&o[t]&&o[t].props),C=(r=t?n.endAngle+(0,V.sA)(g)*v*(0!==A?1:0):u)+(0,V.sA)(g)*((0!==A?p:0)+m*w),E=(r+C)/2,S=(y.innerRadius+y.outerRadius)/2,I=[{name:l,value:A,payload:B,dataKey:f,type:h,graphicalItemId:i.id}],O=(0,j.IZ)(y.cx,y.cy,S,E);return n=le(le(le(le({},i.presentationProps),{},{percent:m,cornerRadius:"string"==typeof s?parseFloat(s):s,name:l,tooltipPayload:I,midAngle:E,middleRadius:S,tooltipPosition:O},B),y),{},{value:A,dataKey:f,startAngle:r,endAngle:C,payload:B,paddingAngle:(0,V.sA)(g)*v})}));return r}function Be(e){var{showLabels:t,sectors:r,children:i}=e,A=(0,n.useMemo)(()=>t&&r?r.map(e=>({value:e.value,payload:e.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:e.cx,cy:e.cy,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clockWise:!1},fill:e.fill})):[],[r,t]);return n.createElement(ne.dL,{value:t?A:void 0},i)}function Ce(e){var{props:t,previousSectorsRef:r,id:i}=e,{sectors:o,isAnimationActive:a,animationBegin:s,animationDuration:u,animationEasing:c,activeShape:l,inactiveShape:f,onAnimationStart:d,onAnimationEnd:h}=t,p=(0,q.n)(t,"recharts-pie-"),g=r.current,[y,v]=(0,n.useState)(!1),m=(0,n.useCallback)(()=>{"function"==typeof h&&h(),v(!1)},[h]),w=(0,n.useCallback)(()=>{"function"==typeof d&&d(),v(!0)},[d]);return n.createElement(Be,{showLabels:!y,sectors:o},n.createElement(re.J,{animationId:p,begin:s,duration:u,isActive:a,easing:c,onAnimationStart:w,onAnimationEnd:m,key:p},e=>{var a=[],s=o&&o[0],u=null==s?void 0:s.startAngle;return null==o||o.forEach((t,r)=>{var n=g&&g[r],i=r>0?A()(t,"paddingAngle",0):0;if(n){var o=(0,V.GW)(n.endAngle-n.startAngle,t.endAngle-t.startAngle,e),s=le(le({},t),{},{startAngle:u+i,endAngle:u+o+i});a.push(s),u=s.endAngle}else{var{endAngle:c,startAngle:l}=t,f=(0,V.GW)(0,c-l,e),d=le(le({},t),{},{startAngle:u+i,endAngle:u+f+i});a.push(d),u=d.endAngle}}),r.current=a,n.createElement(k.W,null,n.createElement(we,{sectors:a,activeShape:l,inactiveShape:f,allOtherPieProps:t,shape:t.shape,id:i}))}),n.createElement(me,{showLabels:!y,sectors:o,props:t}),t.children)}var Ee={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Ae.I.area};function Se(e){var{id:t}=e,r=he(e,se),{hide:i,className:A,rootTabIndex:a}=e,s=(0,n.useMemo)(()=>(0,H.aS)(e.children,L.f),[e.children]),u=(0,D.G)(e=>P(e,t,s)),c=(0,n.useRef)(null),l=(0,o.$)("recharts-pie",A);return i||null==u?(c.current=null,n.createElement(k.W,{tabIndex:a,className:l})):n.createElement(ie.g,{zIndex:e.zIndex},n.createElement(ge,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:u,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),n.createElement(k.W,{tabIndex:a,className:l},n.createElement(Ce,{props:le(le({},r),{},{sectors:u}),previousSectorsRef:c,id:t})))}function Ie(e){var t=(0,J.e)(e,Ee),{id:r}=t,i=he(t,ue),A=(0,te.uZ)(i);return n.createElement($.x,{id:r,type:"pie"},e=>n.createElement(n.Fragment,null,n.createElement(ee.v,{type:"pie",id:e,data:i.data,dataKey:i.dataKey,hide:i.hide,angleAxisId:0,radiusAxisId:0,name:i.name,nameKey:i.nameKey,tooltipType:i.tooltipType,legendType:i.legendType,fill:i.fill,cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,paddingAngle:i.paddingAngle,minAngle:i.minAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius,cornerRadius:i.cornerRadius,presentationProps:A,maxRadius:t.maxRadius}),n.createElement(pe,de({},i,{id:e})),n.createElement(Se,de({},i,{id:e}))))}Ie.displayName="Pie"},9868(e,t,r){"use strict";var n=r(46518),i=r(79504),A=r(91291),o=r(31240),a=r(72333),s=r(79039),u=RangeError,c=String,l=Math.floor,f=i(a),d=i("".slice),h=i(1.1.toFixed),p=function(e,t,r){return 0===t?r:t%2==1?p(e,t-1,r*e):p(e*e,t/2,r)},g=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=l(i/1e7)},y=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=l(n/t),n=n%t*1e7},v=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=c(e[t]);r=""===r?n:r+f("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:s(function(){return"0.000"!==h(8e-5,3)||"1"!==h(.9,0)||"1.25"!==h(1.255,2)||"1000000000000000128"!==h(0xde0b6b3a7640080,0)})||!s(function(){h({})})},{toFixed:function(e){var t,r,n,i,a=o(this),s=A(e),l=[0,0,0,0,0,0],h="",m="0";if(s<0||s>20)throw new u("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return c(a);if(a<0&&(h="-",a=-a),a>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(a*p(2,69,1))-69)<0?a*p(2,-t,1):a/p(2,t,1),r*=4503599627370496,(t=52-t)>0){for(g(l,0,r),n=s;n>=7;)g(l,1e7,0),n-=7;for(g(l,p(10,n,1),0),n=t-1;n>=23;)y(l,1<<23),n-=23;y(l,1<<n),g(l,1,1),y(l,2),m=v(l)}else g(l,0,r),g(l,1<<-t,0),m=v(l)+f("0",s);return m=s>0?h+((i=m.length)<=s?"0."+f("0",s-i)+m:d(m,0,i-s)+"."+d(m,i-s)):h+m}})},10105(e,t,r){"use strict";var n,i,A=r(73872),o=r(23431),a=r(73608),s=r(33338),u=r(97968),c=(r(32981),r(38538),r(36775),r(77612)),l=(r(86974),r(65587),r(13628)),f=r(89194),d=r(44487),h=r(81062),p=r(43334),g=r(54951),y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},v=function(){function e(e){this.charset=e,this.name=e.name}return e.prototype.canEncode=function(e){try{return null!=p.A.encode(e,this.charset)}catch(e){return!1}},e}(),m=function(){function e(e,t,r){var n,i,A,o,a,s;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(e){return new v(u.A.forName(e))}),this.encoders=[];var c=[];c.push(new v(h.A.ISO_8859_1));for(var l=null!=t&&t.name.startsWith("UTF"),f=0;f<e.length;f++){var d=!1;try{for(var p=(n=void 0,y(c)),g=p.next();!g.done;g=p.next()){var m=g.value,w=e.charAt(f);if(w.charCodeAt(0)===r||m.canEncode(w)){d=!0;break}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}if(!d)try{for(var b=(A=void 0,y(this.ENCODERS)),B=b.next();!B.done;B=b.next()){if((m=B.value).canEncode(e.charAt(f))){c.push(m),d=!0;break}}}catch(e){A={error:e}}finally{try{B&&!B.done&&(o=b.return)&&o.call(b)}finally{if(A)throw A.error}}d||(l=!0)}if(1!==c.length||l){this.encoders=[];var C=0;try{for(var E=y(c),S=E.next();!S.done;S=E.next()){m=S.value;this.encoders[C++]=m}}catch(e){a={error:e}}finally{try{S&&!S.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}}else this.encoders=[c[0]];var I=-1;if(null!=t)for(f=0;f<this.encoders.length;f++)if(null!=this.encoders[f]&&t.name===this.encoders[f].name){I=f;break}this.priorityEncoderIndex=I}return e.prototype.length=function(){return this.encoders.length},e.prototype.getCharsetName=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].name},e.prototype.getCharset=function(e){if(!(e<this.length()))throw new Error("index must be less than length");return this.encoders[e].charset},e.prototype.getECIValue=function(e){return this.encoders[e].charset.getValueIdentifier()},e.prototype.getPriorityEncoderIndex=function(){return this.priorityEncoderIndex},e.prototype.canEncode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return!0},e.prototype.encode=function(e,t){if(!(t<this.length()))throw new Error("index must be less than length");return p.A.encode(g.A.getCharAt(e),this.encoders[t].name)},e}(),w=r(36254),b=r(88468),B=function(){function e(e,t,r){this.fnc1=r;var n=new m(e,t,r);if(1===n.length())for(var i=0;i<this.bytes.length;i++){var A=e.charAt(i).charCodeAt(0);this.bytes[i]=A===r?1e3:A}else this.bytes=this.encodeMinimally(e,n,r)}return e.prototype.getFNC1Character=function(){return this.fnc1},e.prototype.length=function(){return this.bytes.length},e.prototype.haveNCharacters=function(e,t){if(e+t-1>=this.bytes.length)return!1;for(var r=0;r<t;r++)if(this.isECI(e+r))return!1;return!0},e.prototype.charAt=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},e.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw new Error(""+e);for(var r=new b.A,n=e;n<t;n++){if(this.isECI(n))throw new Error("value at "+n+" is not a character but an ECI");r.append(this.charAt(n))}return r.toString()},e.prototype.isECI=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},e.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return 1e3===this.bytes[e]},e.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},e.prototype.addEdge=function(e,t,r){(null==e[t][r.encoderIndex]||e[t][r.encoderIndex].cachedTotalSize>r.cachedTotalSize)&&(e[t][r.encoderIndex]=r)},e.prototype.addEdges=function(e,t,r,n,i,A){var o=e.charAt(n).charCodeAt(0),a=0,s=t.length();t.getPriorityEncoderIndex()>=0&&(o===A||t.canEncode(o,t.getPriorityEncoderIndex()))&&(s=(a=t.getPriorityEncoderIndex())+1);for(var u=a;u<s;u++)(o===A||t.canEncode(o,u))&&this.addEdge(r,n+1,new C(o,t,u,i,A))},e.prototype.encodeMinimally=function(e,t,r){var n=e.length,i=new(C[n+1][t.length()]);this.addEdges(e,t,i,0,null,r);for(var A=1;A<=n;A++){for(var o=0;o<t.length();o++)null!=i[A][o]&&A<n&&this.addEdges(e,t,i,A,i[A][o],r);for(o=0;o<t.length();o++)i[A-1][o]=null}var a=-1,s=w.A.MAX_VALUE;for(o=0;o<t.length();o++)if(null!=i[n][o]){var u=i[n][o];u.cachedTotalSize<s&&(s=u.cachedTotalSize,a=o)}if(a<0)throw new Error('Failed to encode "'+e+'"');for(var c=[],l=i[n][a];null!=l;){if(l.isFNC1())c.unshift(1e3);else{var f=t.encode(l.c,l.encoderIndex);for(A=f.length-1;A>=0;A--)c.unshift(255&f[A])}(null===l.previous?0:l.previous.encoderIndex)!==l.encoderIndex&&c.unshift(256+t.getECIValue(l.encoderIndex)),l=l.previous}var d=[];for(A=0;A<d.length;A++)d[A]=c[A];return d},e}(),C=function(){function e(e,t,r,n,i){this.c=e,this.encoderSet=t,this.encoderIndex=r,this.previous=n,this.fnc1=i,this.c=e===i?1e3:e;var A=this.isFNC1()?1:t.encode(e,r).length;(null===n?0:n.encoderIndex)!==r&&(A+=3),null!=n&&(A+=n.cachedTotalSize),this.cachedTotalSize=A}return e.prototype.isFNC1=function(){return 1e3===this.c},e}(),E=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),S=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},I=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,A=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=A.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=A.return)&&r.call(A)}finally{if(i)throw i.error}}return o},O=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(I(arguments[t]));return e};!function(e){e[e.ASCII=0]="ASCII",e[e.C40=1]="C40",e[e.TEXT=2]="TEXT",e[e.X12=3]="X12",e[e.EDF=4]="EDF",e[e.B256=5]="B256"}(i||(i={}));var F=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],_=function(){function e(){}return e.isExtendedASCII=function(e,t){return e!==t&&e>=128&&e<=255},e.isInC40Shift1Set=function(e){return e<=31},e.isInC40Shift2Set=function(e,t){var r,n;try{for(var i=S(F),A=i.next();!A.done;A=i.next()){if(A.value.charCodeAt(0)===e)return!0}}catch(e){r={error:e}}finally{try{A&&!A.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e===t},e.isInTextShift1Set=function(e){return this.isInC40Shift1Set(e)},e.isInTextShift2Set=function(e,t){return this.isInC40Shift2Set(e,t)},e.encodeHighLevel=function(e,t,r,n){void 0===t&&(t=null),void 0===r&&(r=-1),void 0===n&&(n=0);var i=0;return e.startsWith(d.h_)&&e.endsWith(d.TG)?(i=5,e=e.substring(d.h_.length,e.length-2)):e.startsWith(d.eB)&&e.endsWith(d.TG)&&(i=6,e=e.substring(d.eB.length,e.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,O(this.encode(e,t,r,n,i)))))},e.encode=function(e,t,r,n,i){return this.encodeMinimally(new Q(e,t,r,n,i)).getBytes()},e.addEdge=function(e,t){var r=t.fromPosition+t.characterLength;(null===e[r][t.getEndMode()]||e[r][t.getEndMode()].cachedTotalSize>t.cachedTotalSize)&&(e[r][t.getEndMode()]=t)},e.getNumberOfC40Words=function(t,r,n,i){for(var A=0,o=r;o<t.length();o++){if(t.isECI(o))return i[0]=0,0;var a=t.charAt(o);if(n&&f.A.isNativeC40(a)||!n&&f.A.isNativeText(a))A++;else if(e.isExtendedASCII(a,t.getFNC1Character())){var s=255&a;s>=128&&(n&&f.A.isNativeC40(s-128)||!n&&f.A.isNativeText(s-128))?A+=3:A+=4}else A+=2;if(A%3==0||(A-2)%3==0&&o+1===t.length())return i[0]=o-r+1,Math.ceil(A/3)}return i[0]=0,0},e.addEdges=function(t,r,n,A){var o,a;if(t.isECI(n))this.addEdge(r,new U(t,i.ASCII,n,1,A));else{var s,u=t.charAt(n);if(null===A||A.getEndMode()!==i.EDF){f.A.isDigit(u)&&t.haveNCharacters(n,2)&&f.A.isDigit(t.charAt(n+1))?this.addEdge(r,new U(t,i.ASCII,n,2,A)):this.addEdge(r,new U(t,i.ASCII,n,1,A));var c=[i.C40,i.TEXT];try{for(var l=S(c),d=l.next();!d.done;d=l.next()){var h=d.value,p=[];e.getNumberOfC40Words(t,n,h===i.C40,p)>0&&this.addEdge(r,new U(t,h,n,p[0],A))}}catch(e){o={error:e}}finally{try{d&&!d.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}t.haveNCharacters(n,3)&&f.A.isNativeX12(t.charAt(n))&&f.A.isNativeX12(t.charAt(n+1))&&f.A.isNativeX12(t.charAt(n+2))&&this.addEdge(r,new U(t,i.X12,n,3,A)),this.addEdge(r,new U(t,i.B256,n,1,A))}for(s=0;s<3;s++){var g=n+s;if(!t.haveNCharacters(g,1)||!f.A.isNativeEDIFACT(t.charAt(g)))break;this.addEdge(r,new U(t,i.EDF,n,s+1,A))}3===s&&t.haveNCharacters(n,4)&&f.A.isNativeEDIFACT(t.charAt(n+3))&&this.addEdge(r,new U(t,i.EDF,n,4,A))}},e.encodeMinimally=function(e){var t=e.length(),r=Array(t+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(e,r,0,null);for(var n=1;n<=t;n++){for(var i=0;i<6;i++)null!==r[n][i]&&n<t&&this.addEdges(e,r,n,r[n][i]);for(i=0;i<6;i++)r[n-1][i]=null}var A=-1,o=w.A.MAX_VALUE;for(i=0;i<6;i++)if(null!==r[t][i]){var a=r[t][i],s=i>=1&&i<=3?a.cachedTotalSize+1:a.cachedTotalSize;s<o&&(o=s,A=i)}if(A<0)throw new Error('Failed to encode "'+e+'"');return new x(r[t][A])},e}(),x=function(){function e(e){var t=e.input,r=0,n=[],A=[],o=[];e.mode!==i.C40&&e.mode!==i.TEXT&&e.mode!==i.X12||e.getEndMode()===i.ASCII||(r+=this.prepend(U.getBytes(254),n));for(var a=e;null!==a;)r+=this.prepend(a.getDataBytes(),n),null!==a.previous&&a.getPreviousStartMode()===a.getMode()||(a.getMode()===i.B256&&(r<=249?(n.unshift(r),r++):(n.unshift(r%250),n.unshift(r/250+249),r+=2),A.push(n.length),o.push(r)),this.prepend(a.getLatchBytes(),n),r=0),a=a.previous;5===t.getMacroId()?r+=this.prepend(U.getBytes(236),n):6===t.getMacroId()&&(r+=this.prepend(U.getBytes(237),n)),t.getFNC1Character()>0&&(r+=this.prepend(U.getBytes(232),n));for(var s=0;s<A.length;s++)this.applyRandomPattern(n,n.length-A[s],o[s]);var u=e.getMinSymbolSize(n.length);for(n.length<u&&n.push(129);n.length<u;)n.push(this.randomize253State(n.length+1));this.bytes=new Uint8Array(n.length);for(s=0;s<this.bytes.length;s++)this.bytes[s]=n[s]}return e.prototype.prepend=function(e,t){for(var r=e.length-1;r>=0;r--)t.unshift(e[r]);return e.length},e.prototype.randomize253State=function(e){var t=129+(149*e%253+1);return t<=254?t:t-254},e.prototype.applyRandomPattern=function(e,t,r){for(var n=0;n<r;n++){var i=t+n,A=(255&e[i])+(149*(i+1)%255+1);e[i]=A<=255?A:A-256}},e.prototype.getBytes=function(){return this.bytes},e}(),U=function(){function e(e,t,r,n,A){if(this.input=e,this.mode=t,this.fromPosition=r,this.characterLength=n,this.previous=A,this.allCodewordCapacities=[3,5,8,10,12,16,18,22,30,32,36,44,49,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.squareCodewordCapacities=[3,5,8,12,18,22,30,36,44,62,86,114,144,174,204,280,368,456,576,696,816,1050,1304,1558],this.rectangularCodewordCapacities=[5,10,16,33,32,49],!(r+n<=e.length()))throw new Error("Invalid edge");var o=null!==A?A.cachedTotalSize:0,a=this.getPreviousMode();switch(t){case i.ASCII:o++,(e.isECI(r)||_.isExtendedASCII(e.charAt(r),e.getFNC1Character()))&&o++,a!==i.C40&&a!==i.TEXT&&a!==i.X12||o++;break;case i.B256:o++,(a!==i.B256||250===this.getB256Size())&&o++,a===i.ASCII?o++:a!==i.C40&&a!==i.TEXT&&a!==i.X12||(o+=2);break;case i.C40:case i.TEXT:case i.X12:if(t===i.X12)o+=2;else{o+=2*_.getNumberOfC40Words(e,r,t===i.C40,[])}a===i.ASCII||a===i.B256?o++:a===t||a!==i.C40&&a!==i.TEXT&&a!==i.X12||(o+=2);break;case i.EDF:o+=3,a===i.ASCII||a===i.B256?o++:a!==i.C40&&a!==i.TEXT&&a!==i.X12||(o+=2)}this.cachedTotalSize=o}return e.prototype.getB256Size=function(){for(var e=0,t=this;null!==t&&t.mode===i.B256&&e<=250;)e++,t=t.previous;return e},e.prototype.getPreviousStartMode=function(){return null===this.previous?i.ASCII:this.previous.mode},e.prototype.getPreviousMode=function(){return null===this.previous?i.ASCII:this.previous.getEndMode()},e.prototype.getEndMode=function(){if(this.mode===i.EDF){if(this.characterLength<4)return i.ASCII;if((e=this.getLastASCII())>0&&this.getCodewordsRemaining(this.cachedTotalSize+e)<=2-e)return i.ASCII}if(this.mode===i.C40||this.mode===i.TEXT||this.mode===i.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return i.ASCII;var e;if(1===(e=this.getLastASCII())&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return i.ASCII}return this.mode},e.prototype.getMode=function(){return this.mode},e.prototype.getLastASCII=function(){var e=this.input.length(),t=this.fromPosition+this.characterLength;return e-t>4||t>=e?0:e-t===1?_.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())?0:1:e-t===2?_.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())||_.isExtendedASCII(this.input.charAt(t+1),this.input.getFNC1Character())?0:f.A.isDigit(this.input.charAt(t))&&f.A.isDigit(this.input.charAt(t+1))?1:2:e-t===3?f.A.isDigit(this.input.charAt(t))&&f.A.isDigit(this.input.charAt(t+1))&&!_.isExtendedASCII(this.input.charAt(t+2),this.input.getFNC1Character())||f.A.isDigit(this.input.charAt(t+1))&&f.A.isDigit(this.input.charAt(t+2))&&!_.isExtendedASCII(this.input.charAt(t),this.input.getFNC1Character())?2:0:f.A.isDigit(this.input.charAt(t))&&f.A.isDigit(this.input.charAt(t+1))&&f.A.isDigit(this.input.charAt(t+2))&&f.A.isDigit(this.input.charAt(t+3))?2:0},e.prototype.getMinSymbolSize=function(e){var t,r,n,i,A,o;switch(this.input.getShapeHint()){case 1:try{for(var a=S(this.squareCodewordCapacities),s=a.next();!s.done;s=a.next()){if((d=s.value)>=e)return d}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}break;case 2:try{for(var u=S(this.rectangularCodewordCapacities),c=u.next();!c.done;c=u.next()){if((d=c.value)>=e)return d}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}try{for(var l=S(this.allCodewordCapacities),f=l.next();!f.done;f=l.next()){var d;if((d=f.value)>=e)return d}}catch(e){A={error:e}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(A)throw A.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},e.prototype.getCodewordsRemaining=function(e){return this.getMinSymbolSize(e)-e},e.getBytes=function(e,t){var r=new Uint8Array(t?2:1);return r[0]=e,t&&(r[1]=t),r},e.prototype.setC40Word=function(e,t,r,n,i){var A=1600*(255&r)+40*(255&n)+(255&i)+1;e[t]=A/256,e[t+1]=A%256},e.prototype.getX12Value=function(e){return 13===e?0:42===e?1:62===e?2:32===e?3:e>=48&&e<=57?e-44:e>=65&&e<=90?e-51:e},e.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var e=new Uint8Array(this.characterLength/3*2),t=0;t<e.length;t+=2)this.setC40Word(e,t,this.getX12Value(this.input.charAt(this.fromPosition+t/2*3)),this.getX12Value(this.input.charAt(this.fromPosition+t/2*3+1)),this.getX12Value(this.input.charAt(this.fromPosition+t/2*3+2)));return e},e.prototype.getShiftValue=function(e,t,r){return t&&_.isInC40Shift1Set(e)||!t&&_.isInTextShift1Set(e)?0:t&&_.isInC40Shift2Set(e,r)||!t&&_.isInTextShift2Set(e,r)?1:2},e.prototype.getC40Value=function(e,t,r,n){if(r===n){if(2!==t)throw new Error("FNC1 cannot be used in C40 shift 2");return 27}return e?r<=31?r:32===r?3:r<=47?r-33:r<=57?r-44:r<=64?r-43:r<=90?r-51:r<=95?r-69:r<=127?r-96:r:0===r?0:0===t&&r<=3?r-1:1===t&&r<=31?r:32===r?3:r>=33&&r<=47?r-33:r>=48&&r<=57?r-44:r>=58&&r<=64?r-43:r>=65&&r<=90?r-64:r>=91&&r<=95?r-69:96===r?0:r>=97&&r<=122?r-83:r>=123&&r<=127?r-96:r},e.prototype.getC40Words=function(e,t){for(var r=[],n=0;n<this.characterLength;n++){var i=this.input.charAt(this.fromPosition+n);if(e&&f.A.isNativeC40(i)||!e&&f.A.isNativeText(i))r.push(this.getC40Value(e,0,i,t));else if(_.isExtendedASCII(i,t)){var A=(255&i)-128;if(e&&f.A.isNativeC40(A)||!e&&f.A.isNativeText(A))r.push(1),r.push(30),r.push(this.getC40Value(e,0,A,t));else{r.push(1),r.push(30);o=this.getShiftValue(A,e,t);r.push(o),r.push(this.getC40Value(e,o,A,t))}}else{var o=this.getShiftValue(i,e,t);r.push(o),r.push(this.getC40Value(e,o,i,t))}}if(r.length%3!=0){if((r.length-2)%3!=0||this.fromPosition+this.characterLength!==this.input.length())throw new Error("C40 words must be a multiple of 3");r.push(0)}var a=new Uint8Array(r.length/3*2),s=0;for(n=0;n<r.length;n+=3)this.setC40Word(a,s,255&r[n],255&r[n+1],255&r[n+2]),s+=2;return a},e.prototype.getEDFBytes=function(){for(var e=Math.ceil(this.characterLength/4),t=new Uint8Array(3*e),r=this.fromPosition,n=Math.min(this.fromPosition+this.characterLength-1,this.input.length()-1),i=0;i<e;i+=3){for(var A=[],o=0;o<4;o++)A[o]=r<=n?63&this.input.charAt(r++):r===n+1?31:0;var a=A[0]<<18;a|=A[1]<<12,a|=A[2]<<6,a|=A[3],t[i]=a>>16&255,t[i+1]=a>>8&255,t[i+2]=255&a}return t},e.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case i.ASCII:case i.B256:switch(this.mode){case i.B256:return e.getBytes(231);case i.C40:return e.getBytes(230);case i.TEXT:return e.getBytes(239);case i.X12:return e.getBytes(238);case i.EDF:return e.getBytes(240)}break;case i.C40:case i.TEXT:case i.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case i.ASCII:return e.getBytes(254);case i.B256:return e.getBytes(254,231);case i.C40:return e.getBytes(254,230);case i.TEXT:return e.getBytes(254,239);case i.X12:return e.getBytes(254,238);case i.EDF:return e.getBytes(254,240)}break;case i.EDF:if(this.mode!==i.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},e.prototype.getDataBytes=function(){switch(this.mode){case i.ASCII:return this.input.isECI(this.fromPosition)?e.getBytes(241,this.input.getECIValue(this.fromPosition)+1):_.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?e.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?e.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?e.getBytes(232):e.getBytes(this.input.charAt(this.fromPosition)+1);case i.B256:return e.getBytes(this.input.charAt(this.fromPosition));case i.C40:return this.getC40Words(!0,this.input.getFNC1Character());case i.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case i.X12:return this.getX12Words();case i.EDF:return this.getEDFBytes()}},e}(),Q=function(e){function t(t,r,n,i,A){var o=e.call(this,t,r,n)||this;return o.shape=i,o.macroId=A,o}return E(t,e),t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}(B),T=r(50072);r(28871),r(79801),function(){function e(){}e.prototype.encode=function(e,t,r,n,i){if(void 0===i&&(i=null),""===e.trim())throw new Error("Found empty contents");if(t!==A.A.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+t);if(r<0||n<0)throw new Error("Requested dimensions can't be negative: "+r+"x"+n);var o,s=0,d=null,h=null;if(null!=i){var p=i.get(a.A.DATA_MATRIX_SHAPE);null!=p&&(s=p);var g=i.get(a.A.MIN_SIZE);null!=g&&(d=g);var y=i.get(a.A.MAX_SIZE);null!=y&&(h=y)}if(null!=i&&i.has(a.A.DATA_MATRIX_COMPACT)&&Boolean(i.get(a.A.DATA_MATRIX_COMPACT).toString())){var v=i.has(a.A.GS1_FORMAT)&&Boolean(i.get(a.A.GS1_FORMAT).toString()),m=null;i.has(a.A.CHARACTER_SET)&&(m=u.A.forName(i.get(a.A.CHARACTER_SET).toString())),o=_.encodeHighLevel(e,m,v?29:-1,s)}else{var w=null!=i&&i.has(a.A.FORCE_C40)&&Boolean(i.get(a.A.FORCE_C40).toString());o=f.A.encodeHighLevel(e,s,d,h,w)}var b=T.A.lookup(o.length,s,d,h,!0),B=l.A.encodeECC200(o,b),C=new c.A(B,b.getSymbolDataWidth(),b.getSymbolDataHeight());return C.place(),this.encodeLowLevel(C,b,r,n)},e.prototype.encodeLowLevel=function(e,t,r,n){for(var i=t.getSymbolDataWidth(),A=t.getSymbolDataHeight(),o=new s.A(t.getSymbolWidth(),t.getSymbolHeight()),a=0,u=0;u<A;u++){var c=void 0;if(u%t.matrixHeight===0){c=0;for(var l=0;l<t.getSymbolWidth();l++)o.setBoolean(c,a,l%2==0),c++;a++}c=0;for(l=0;l<i;l++)l%t.matrixWidth===0&&(o.setBoolean(c,a,!0),c++),o.setBoolean(c,a,e.getBit(l,u)),c++,l%t.matrixWidth===t.matrixWidth-1&&(o.setBoolean(c,a,u%2==0),c++);if(a++,u%t.matrixHeight===t.matrixHeight-1){c=0;for(l=0;l<t.getSymbolWidth();l++)o.setBoolean(c,a,!0),c++;a++}}return this.convertByteMatrixToBitMatrix(o,r,n)},e.prototype.convertByteMatrixToBitMatrix=function(e,t,r){var n,i=e.getWidth(),A=e.getHeight(),a=Math.max(t,i),s=Math.max(r,A),u=Math.min(a/i,s/A),c=(a-i*u)/2,l=(s-A*u)/2;r<A||t<i?(c=0,l=0,n=new o.A(i,A)):n=new o.A(t,r),n.clear();for(var f=0,d=l;f<A;f++,d+=u)for(var h=0,p=c;h<i;h++,p+=u)1===e.get(h,f)&&n.setRegion(p,d,u,u);return n}}()},10287(e,t,r){"use strict";r(46518)({target:"Object",stat:!0},{setPrototypeOf:r(52967)})},10436(e,t,r){"use strict";var n,i,A,o,a=r(46518),s=r(96395),u=r(16193),c=r(44576),l=r(19167),f=r(69565),d=r(36840),h=r(52967),p=r(10687),g=r(87633),y=r(79306),v=r(94901),m=r(20034),w=r(90679),b=r(2293),B=r(59225).set,C=r(91955),E=r(90757),S=r(1103),I=r(18265),O=r(91181),F=r(80550),_=r(10916),x=r(36043),U="Promise",Q=_.CONSTRUCTOR,T=_.REJECTION_EVENT,M=_.SUBCLASSING,P=O.getterFor(U),D=O.set,k=F&&F.prototype,N=F,R=k,L=c.TypeError,H=c.document,j=c.process,V=x.f,K=V,z=!!(H&&H.createEvent&&c.dispatchEvent),G="unhandledrejection",W=function(e){var t;return!(!m(e)||!v(t=e.then))&&t},X=function(e,t){var r,n,i,A=t.value,o=1===t.state,a=o?e.ok:e.fail,s=e.resolve,u=e.reject,c=e.domain;try{a?(o||(2===t.rejection&&$(t),t.rejection=1),!0===a?r=A:(c&&c.enter(),r=a(A),c&&(c.exit(),i=!0)),r===e.promise?u(new L("Promise-chain cycle")):(n=W(r))?f(n,r,s,u):s(r)):u(A)}catch(e){c&&!i&&c.exit(),u(e)}},Y=function(e,t){e.notified||(e.notified=!0,C(function(){for(var r,n=e.reactions;r=n.get();)X(r,e);e.notified=!1,t&&!e.rejection&&q(e)}))},Z=function(e,t,r){var n,i;z?((n=H.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!T&&(i=c["on"+e])?i(n):e===G&&E("Unhandled promise rejection",r)},q=function(e){f(B,c,function(){var t,r=e.facade,n=e.value;if(J(e)&&(t=S(function(){u?j.emit("unhandledRejection",n,r):Z(G,r,n)}),e.rejection=u||J(e)?2:1,t.error))throw t.value})},J=function(e){return 1!==e.rejection&&!e.parent},$=function(e){f(B,c,function(){var t=e.facade;u?j.emit("rejectionHandled",t):Z("rejectionhandled",t,e.value)})},ee=function(e,t,r){return function(n){e(t,n,r)}},te=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Y(e,!0))},re=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new L("Promise can't be resolved itself");var n=W(t);n?C(function(){var r={done:!1};try{f(n,t,ee(re,r,e),ee(te,r,e))}catch(t){te(r,t,e)}}):(e.value=t,e.state=1,Y(e,!1))}catch(t){te({done:!1},t,e)}}};if(Q&&(R=(N=function(e){w(this,R),y(e),f(n,this);var t=P(this);try{e(ee(re,t),ee(te,t))}catch(e){te(t,e)}}).prototype,(n=function(e){D(this,{type:U,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:null})}).prototype=d(R,"then",function(e,t){var r=P(this),n=V(b(this,N));return r.parent=!0,n.ok=!v(e)||e,n.fail=v(t)&&t,n.domain=u?j.domain:void 0,0===r.state?r.reactions.add(n):C(function(){X(n,r)}),n.promise}),i=function(){var e=new n,t=P(e);this.promise=e,this.resolve=ee(re,t),this.reject=ee(te,t)},x.f=V=function(e){return e===N||e===A?new i(e):K(e)},!s&&v(F)&&k!==Object.prototype)){o=k.then,M||d(k,"then",function(e,t){var r=this;return new N(function(e,t){f(o,r,e,t)}).then(e,t)},{unsafe:!0});try{delete k.constructor}catch(e){}h&&h(k,R)}a({global:!0,constructor:!0,wrap:!0,forced:Q},{Promise:N}),A=l.Promise,p(N,U,!1,!0),g(U)},10652(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(e,t){this.value=e,this.checksumPortion=t}return e.prototype.getValue=function(){return this.value},e.prototype.getChecksumPortion=function(){return this.checksumPortion},e.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value&&this.checksumPortion===r.checksumPortion},e.prototype.hashCode=function(){return this.value^this.checksumPortion},e}()},10916(e,t,r){"use strict";var n=r(44576),i=r(80550),A=r(94901),o=r(92796),a=r(33706),s=r(78227),u=r(84215),c=r(96395),l=r(39519),f=i&&i.prototype,d=s("species"),h=!1,p=A(n.PromiseRejectionEvent),g=o("Promise",function(){var e=a(i),t=e!==String(i);if(!t&&66===l)return!0;if(c&&(!f.catch||!f.finally))return!0;if(!l||l<51||!/native code/.test(e)){var r=new i(function(e){e(1)}),n=function(e){e(function(){},function(){})};if((r.constructor={})[d]=n,!(h=r.then(function(){})instanceof n))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||p)});e.exports={CONSTRUCTOR:g,REJECTION_EVENT:p,SUBCLASSING:h}},11392(e,t,r){"use strict";var n,i=r(46518),A=r(27476),o=r(77347).f,a=r(18014),s=r(655),u=r(60511),c=r(67750),l=r(41436),f=r(96395),d=A("".slice),h=Math.min,p=l("startsWith");i({target:"String",proto:!0,forced:!!(f||p||(n=o(String.prototype,"startsWith"),!n||n.writable))&&!p},{startsWith:function(e){var t=s(c(this));u(e);var r=a(h(arguments.length>1?arguments[1]:void 0,t.length)),n=s(e);return d(t,r,r+n.length)===n}})},11509(e,t,r){"use strict";r.d(t,{i:()=>u});const n=Math.PI,i=2*n,A=1e-6,o=i-A;function a(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class s{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?a:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return a;const r=10**t;return function(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=Math.round(arguments[t]*r)/r+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,n){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(e,t,r,n,i,A){this._append`C${+e},${+t},${+r},${+n},${this._x1=+i},${this._y1=+A}`}arcTo(e,t,r,i,o){if(e=+e,t=+t,r=+r,i=+i,(o=+o)<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,u=r-e,c=i-t,l=a-e,f=s-t,d=l*l+f*f;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>A)if(Math.abs(f*u-c*l)>A&&o){let h=r-a,p=i-s,g=u*u+c*c,y=h*h+p*p,v=Math.sqrt(g),m=Math.sqrt(d),w=o*Math.tan((n-Math.acos((g+d-y)/(2*v*m)))/2),b=w/m,B=w/v;Math.abs(b-1)>A&&this._append`L${e+b*l},${t+b*f}`,this._append`A${o},${o},0,0,${+(f*h>l*p)},${this._x1=e+B*u},${this._y1=t+B*c}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,r,a,s,u){if(e=+e,t=+t,u=!!u,(r=+r)<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),l=r*Math.sin(a),f=e+c,d=t+l,h=1^u,p=u?a-s:s-a;null===this._x1?this._append`M${f},${d}`:(Math.abs(this._x1-f)>A||Math.abs(this._y1-d)>A)&&this._append`L${f},${d}`,r&&(p<0&&(p=p%i+i),p>o?this._append`A${r},${r},0,1,${h},${e-c},${t-l}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:p>A&&this._append`A${r},${r},0,${+(p>=n)},${h},${this._x1=e+r*Math.cos(s)},${this._y1=t+r*Math.sin(s)}`)}rect(e,t,r,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}}function u(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(null==r)t=null;else{const e=Math.floor(r);if(!(e>=0))throw new RangeError(`invalid digits: ${r}`);t=e}return e},()=>new s(t)}},11718(e,t,r){"use strict";r.d(t,{Q:()=>s});var n=r(65245),i=["domain","range"],A=["domain","range"];function o(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function a(e,t){return e===t||!(!Array.isArray(e)||2!==e.length||!Array.isArray(t)||2!==t.length)&&(e[0]===t[0]&&e[1]===t[1])}function s(e,t){if(e===t)return!0;var{domain:r,range:s}=e,u=o(e,i),{domain:c,range:l}=t,f=o(t,A);return!!a(r,c)&&(!!a(s,l)&&(0,n.P)(u,f))}},12008(e,t,r){"use strict";r.d(t,{A:()=>B});var n,i=r(73872),A=r(8032),o=r(7758),a=r(15511),s=r(93234),u=r(32993),c=r(58503),l=r(31327),f=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.decodeRowStringBuffer="",t}return f(t,e),t.findStartGuardPattern=function(e){for(var r,n=!1,i=0,A=Int32Array.from([0,0,0]);!n;){A=Int32Array.from([0,0,0]);var o=(r=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,A))[0],a=o-((i=r[1])-o);a>=0&&(n=e.isRange(a,o,!1))}return r},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var r=e.length;if(0===r)return!1;var n=parseInt(e.charAt(r-1),10);return t.getStandardUPCEANChecksum(e.substring(0,r-1))===n},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,r=0,n=t-1;n>=0;n-=2){if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new l.A;r+=i}r*=3;for(n=t-2;n>=0;n-=2){var i;if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new l.A;r+=i}return(1e3-r)%10},t.decodeEnd=function(e,r){return t.findGuardPattern(e,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,t,r,n){return this.findGuardPattern(e,t,r,n,new Int32Array(n.length))},t.findGuardPattern=function(e,r,n,i,A){for(var o=e.getSize(),a=0,s=r=n?e.getNextUnset(r):e.getNextSet(r),l=i.length,f=n,d=r;d<o;d++)if(e.get(d)!==f)A[a]++;else{if(a===l-1){if(u.A.patternMatchVariance(A,i,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return Int32Array.from([s,d]);s+=A[0]+A[1];for(var h=A.slice(2,A.length),p=0;p<a-1;p++)A[p]=h[p];A[a-1]=0,A[a]=0,a--}else a++;A[a]=1,f=!f}throw new c.A},t.decodeDigit=function(e,r,n,i){this.recordPattern(e,n,r);for(var A=this.MAX_AVG_VARIANCE,o=-1,a=i.length,s=0;s<a;s++){var l=i[s],f=u.A.patternMatchVariance(r,l,t.MAX_INDIVIDUAL_VARIANCE);f<A&&(A=f,o=s)}if(o>=0)return o;throw new c.A},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(u.A);const h=d;var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const g=function(){function e(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,r,n){var A=this.decodeRowStringBuffer,a=this.decodeMiddle(r,n,A),u=A.toString(),c=e.parseExtensionString(u),l=[new s.A((n[0]+n[1])/2,t),new s.A(a,t)],f=new o.A(u,null,0,l,i.A.UPC_EAN_EXTENSION,(new Date).getTime());return null!=c&&f.putAllMetadata(c),f},e.prototype.decodeMiddle=function(t,r,n){var i,A,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var a=t.getSize(),s=r[1],u=0,l=0;l<5&&s<a;l++){var f=h.decodeDigit(t,o,s,h.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+f%10);try{for(var d=(i=void 0,p(o)),g=d.next();!g.done;g=d.next()){s+=g.value}}catch(e){i={error:e}}finally{try{g&&!g.done&&(A=d.return)&&A.call(d)}finally{if(i)throw i.error}}f>=10&&(u|=1<<4-l),4!==l&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(5!==n.length)throw new c.A;var y=this.determineCheckDigit(u);if(e.extensionChecksum(n.toString())!==y)throw new c.A;return s},e.extensionChecksum=function(e){for(var t=e.length,r=0,n=t-2;n>=0;n-=2)r+=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0);r*=3;for(n=t-1;n>=0;n-=2)r+=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},e.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new c.A},e.parseExtensionString=function(t){if(5!==t.length)return null;var r=e.parseExtension5String(t);return null==r?null:new Map([[a.A.SUGGESTED_PRICE,r]])},e.parseExtension5String=function(e){var t;switch(e.charAt(0)){case"0":t="£";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t=""}var r=parseInt(e.substring(1)),n=r%100;return t+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},e}();var y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const v=function(){function e(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return e.prototype.decodeRow=function(t,r,n){var A=this.decodeRowStringBuffer,a=this.decodeMiddle(r,n,A),u=A.toString(),c=e.parseExtensionString(u),l=[new s.A((n[0]+n[1])/2,t),new s.A(a,t)],f=new o.A(u,null,0,l,i.A.UPC_EAN_EXTENSION,(new Date).getTime());return null!=c&&f.putAllMetadata(c),f},e.prototype.decodeMiddle=function(e,t,r){var n,i,A=this.decodeMiddleCounters;A[0]=0,A[1]=0,A[2]=0,A[3]=0;for(var o=e.getSize(),a=t[1],s=0,u=0;u<2&&a<o;u++){var l=h.decodeDigit(e,A,a,h.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var f=(n=void 0,y(A)),d=f.next();!d.done;d=f.next()){a+=d.value}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}l>=10&&(s|=1<<1-u),1!==u&&(a=e.getNextSet(a),a=e.getNextUnset(a))}if(2!==r.length)throw new c.A;if(parseInt(r.toString())%4!==s)throw new c.A;return a},e.parseExtensionString=function(e){return 2!==e.length?null:new Map([[a.A.ISSUE_NUMBER,parseInt(e)]])},e}();const m=function(){function e(){}return e.decodeRow=function(e,t,r){var n=h.findGuardPattern(t,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new g).decodeRow(e,t,n)}catch(r){return(new v).decodeRow(e,t,n)}},e.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),e}();var w=r(43407),b=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const B=function(e){function t(){var r=e.call(this)||this;r.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(e){return Int32Array.from(e)});for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],A=new Int32Array(i.length),o=0;o<i.length;o++)A[o]=i[i.length-o-1];t.L_AND_G_PATTERNS[n]=A}return r}return b(t,e),t.prototype.decodeRow=function(e,r,n){var u=t.findStartGuardPattern(r),f=null==n?null:n.get(A.A.NEED_RESULT_POINT_CALLBACK);if(null!=f){var d=new s.A((u[0]+u[1])/2,e);f.foundPossibleResultPoint(d)}var h=this.decodeMiddle(r,u,this.decodeRowStringBuffer),p=h.rowOffset,g=h.resultString;if(null!=f){var y=new s.A(p,e);f.foundPossibleResultPoint(y)}var v=t.decodeEnd(r,p);if(null!=f){var b=new s.A((v[0]+v[1])/2,e);f.foundPossibleResultPoint(b)}var B=v[1],C=B+(B-v[0]);if(C>=r.getSize()||!r.isRange(B,C,!1))throw new c.A;var E=g.toString();if(E.length<8)throw new l.A;if(!t.checkChecksum(E))throw new w.A;var S=(u[1]+u[0])/2,I=(v[1]+v[0])/2,O=this.getBarcodeFormat(),F=[new s.A(S,e),new s.A(I,e)],_=new o.A(E,null,0,F,O,(new Date).getTime()),x=0;try{var U=m.decodeRow(e,r,v[1]);_.putMetadata(a.A.UPC_EAN_EXTENSION,U.getText()),_.putAllMetadata(U.getResultMetadata()),_.addResultPoints(U.getResultPoints()),x=U.getText().length}catch(e){}var Q=null==n?null:n.get(A.A.ALLOWED_EAN_EXTENSIONS);if(null!=Q){var T=!1;for(var M in Q)if(x.toString()===M){T=!0;break}if(!T)throw new c.A}return O===i.A.EAN_13||i.A.UPC_A,_},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var r=e.length;if(0===r)return!1;var n=parseInt(e.charAt(r-1),10);return t.getStandardUPCEANChecksum(e.substring(0,r-1))===n},t.getStandardUPCEANChecksum=function(e){for(var t=e.length,r=0,n=t-1;n>=0;n-=2){if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new l.A;r+=i}r*=3;for(n=t-2;n>=0;n-=2){var i;if((i=e.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||i>9)throw new l.A;r+=i}return(1e3-r)%10},t.decodeEnd=function(e,r){return t.findGuardPattern(e,r,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(h)},12049(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getTag=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}},12064(e,t,r){"use strict";r.d(t,{Qx:()=>p,a6:()=>g,jM:()=>pe,ss:()=>fe});var n=Symbol.for("immer-nothing"),i=Symbol.for("immer-draftable"),A=Symbol.for("immer-state");function o(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var a=Object,s=a.getPrototypeOf,u="constructor",c="prototype",l="configurable",f="enumerable",d="writable",h="value",p=e=>!!e&&!!e[A];function g(e){return!!e&&(m(e)||S(e)||!!e[i]||!!e[u]?.[i]||I(e)||O(e))}var y=a[c][u].toString(),v=new WeakMap;function m(e){if(!e||!F(e))return!1;const t=s(e);if(null===t||t===a[c])return!0;const r=a.hasOwnProperty.call(t,u)&&t[u];if(r===Object)return!0;if(!_(r))return!1;let n=v.get(r);return void 0===n&&(n=Function.toString.call(r),v.set(r,n)),n===y}function w(e,t,r=!0){if(0===b(e)){(r?Reflect.ownKeys(e):a.keys(e)).forEach(r=>{t(r,e[r],e)})}else e.forEach((r,n)=>t(n,r,e))}function b(e){const t=e[A];return t?t.type_:S(e)?1:I(e)?2:O(e)?3:0}var B=(e,t,r=b(e))=>2===r?e.has(t):a[c].hasOwnProperty.call(e,t),C=(e,t,r=b(e))=>2===r?e.get(t):e[t],E=(e,t,r,n=b(e))=>{2===n?e.set(t,r):3===n?e.add(r):e[t]=r};var S=Array.isArray,I=e=>e instanceof Map,O=e=>e instanceof Set,F=e=>"object"==typeof e,_=e=>"function"==typeof e,x=e=>"boolean"==typeof e;var U=e=>e.copy_||e.base_,Q=e=>e.modified_?e.copy_:e.base_;function T(e,t){if(I(e))return new Map(e);if(O(e))return new Set(e);if(S(e))return Array[c].slice.call(e);const r=m(e);if(!0===t||"class_only"===t&&!r){const t=a.getOwnPropertyDescriptors(e);delete t[A];let r=Reflect.ownKeys(t);for(let n=0;n<r.length;n++){const i=r[n],A=t[i];!1===A[d]&&(A[d]=!0,A[l]=!0),(A.get||A.set)&&(t[i]={[l]:!0,[d]:!0,[f]:A[f],[h]:e[i]})}return a.create(s(e),t)}{const t=s(e);if(null!==t&&r)return{...e};const n=a.create(t);return a.assign(n,e)}}function M(e,t=!1){return D(e)||p(e)||!g(e)||(b(e)>1&&a.defineProperties(e,{set:P,add:P,clear:P,delete:P}),a.freeze(e),t&&w(e,(e,t)=>{M(t,!0)},!1)),e}var P={[h]:function(){o(2)}};function D(e){return null===e||!F(e)||a.isFrozen(e)}var k="MapSet",N="Patches",R="ArrayMethods",L={};function H(e){const t=L[e];return t||o(0),t}var j,V=e=>!!L[e];var K=()=>j;function z(e,t){t&&(e.patchPlugin_=H(N),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function G(e){W(e),e.drafts_.forEach(Y),e.drafts_=null}function W(e){e===j&&(j=e.parent_)}var X=e=>j={drafts_:[],parent_:j,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:V(k)?H(k):void 0,arrayMethodsPlugin_:V(R)?H(R):void 0};function Y(e){const t=e[A];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Z(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(void 0!==e&&e!==r){r[A].modified_&&(G(t),o(4)),g(e)&&(e=q(t,e));const{patchPlugin_:n}=t;n&&n.generateReplacementPatches_(r[A].base_,e,t)}else e=q(t,r);return function(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&M(t,r)}(t,e,!0),G(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==n?e:void 0}function q(e,t){if(D(t))return t;const r=t[A];if(!r){return ie(t,e.handledSet_,e)}if(!$(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:t}=r;if(t)for(;t.length>0;){t.pop()(e)}re(r,e)}return r.copy_}function J(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var $=(e,t)=>e.scope_===t,ee=[];function te(e,t,r,n){const i=U(e),A=e.type_;if(void 0!==n){if(C(i,n,A)===t)return void E(i,n,r,A)}if(!e.draftLocations_){const t=e.draftLocations_=new Map;w(i,(e,r)=>{if(p(r)){const n=t.get(r)||[];n.push(e),t.set(r,n)}})}const o=e.draftLocations_.get(t)??ee;for(const e of o)E(i,e,r,A)}function re(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const n=r.getPath(e);n&&r.generatePatches_(e,n,t)}J(e)}}function ne(e,t,r){const{scope_:n}=e;if(p(r)){const i=r[A];$(i,n)&&i.callbacks_.push(function(){ce(e);const n=Q(i);te(e,r,n,t)})}else g(r)&&e.callbacks_.push(function(){const i=U(e);3===e.type_?i.has(r)&&ie(r,n.handledSet_,n):C(i,t,e.type_)===r&&n.drafts_.length>1&&!0===(e.assigned_.get(t)??!1)&&e.copy_&&ie(C(e.copy_,t,e.type_),n.handledSet_,n)})}function ie(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||p(e)||t.has(e)||!g(e)||D(e)||(t.add(e),w(e,(n,i)=>{if(p(i)){const t=i[A];if($(t,r)){const r=Q(t);E(e,n,r,e.type_),J(t)}}else g(i)&&ie(i,t,r)})),e}var Ae={get(e,t){if(t===A)return e;let r=e.scope_.arrayMethodsPlugin_;const n=1===e.type_&&"string"==typeof t;if(n&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=U(e);if(!B(i,t,e.type_))return function(e,t,r){const n=se(t,r);return n?h in n?n[h]:n.get?.call(e.draft_):void 0}(e,i,t);const o=i[t];if(e.finalized_||!g(o))return o;if(n&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&function(e){const t=+e;return Number.isInteger(t)&&String(t)===e}(t))return o;if(o===ae(e.base_,t)){ce(e);const r=1===e.type_?+t:t,n=le(e.scope_,o,e,r);return e.copy_[r]=n}return o},has:(e,t)=>t in U(e),ownKeys:e=>Reflect.ownKeys(U(e)),set(e,t,r){const n=se(U(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=ae(U(e),t),a=n?.[A];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(((i=r)===(o=n)?0!==i||1/i==1/o:i!=i&&o!=o)&&(void 0!==r||B(e.base_,t,e.type_)))return!0;ce(e),ue(e)}var i,o;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),ne(e,t,r)),!0},deleteProperty:(e,t)=>(ce(e),void 0!==ae(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),ue(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=U(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{[d]:!0,[l]:1!==e.type_||"length"!==t,[f]:n[f],[h]:r[t]}:n},defineProperty(){o(11)},getPrototypeOf:e=>s(e.base_),setPrototypeOf(){o(12)}},oe={};for(let e in Ae){let t=Ae[e];oe[e]=function(){const e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function ae(e,t){const r=e[A];return(r?U(r):e)[t]}function se(e,t){if(!(t in e))return;let r=s(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=s(r)}}function ue(e){e.modified_||(e.modified_=!0,e.parent_&&ue(e.parent_))}function ce(e){e.copy_||(e.assigned_=new Map,e.copy_=T(e.base_,e.scope_.immer_.useStrictShallowCopy_))}oe.deleteProperty=function(e,t){return oe.set.call(this,e,t,void 0)},oe.set=function(e,t,r){return Ae.set.call(this,e[0],t,r,e[0])};function le(e,t,r,n){const[i,A]=I(t)?H(k).proxyMap_(t,r):O(t)?H(k).proxySet_(t,r):function(e,t){const r=S(e),n={type_:r?1:0,scope_:t?t.scope_:K(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,A=Ae;r&&(i=[n],A=oe);const{revoke:o,proxy:a}=Proxy.revocable(i,A);return n.draft_=a,n.revoke_=o,[a,n]}(t,r);return(r?.scope_??K()).drafts_.push(i),A.callbacks_=r?.callbacks_??[],A.key_=n,r&&void 0!==n?function(e,t,r){e.callbacks_.push(function(n){const i=t;if(!i||!$(i,n))return;n.mapSetPlugin_?.fixSetContents(i);const A=Q(i);te(e,i.draft_??i,A,r),re(i,n)})}(r,A,n):A.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(A);const{patchPlugin_:t}=e;A.modified_&&t&&t.generatePatches_(A,[],e)}),i}function fe(e){return p(e)||o(10),de(e)}function de(e){if(!g(e)||D(e))return e;const t=e[A];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=T(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=T(e,!0);return w(r,(e,t)=>{E(r,e,de(t))},n),t&&(t.finalized_=!1),r}var he=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{if(_(e)&&!_(t)){const r=t;t=e;const n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}let i;if(_(t)||o(6),void 0===r||_(r)||o(7),g(e)){const n=X(this),A=le(n,e,void 0);let o=!0;try{i=t(A),o=!1}finally{o?G(n):W(n)}return z(n,r),Z(i,n)}if(!e||!F(e)){if(i=t(e),void 0===i&&(i=e),i===n&&(i=void 0),this.autoFreeze_&&M(i,!0),r){const t=[],n=[];H(N).generateReplacementPatches_(e,i,{patches_:t,inversePatches_:n}),r(t,n)}return i}o(1)},this.produceWithPatches=(e,t)=>{if(_(e))return(t,...r)=>this.produceWithPatches(t,t=>e(t,...r));let r,n;return[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},x(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),x(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),x(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){g(e)||o(8),p(e)&&(e=fe(e));const t=X(this),r=le(t,e,void 0);return r[A].isManual_=!0,W(t),r}finishDraft(e,t){const r=e&&e[A];r&&r.isManual_||o(9);const{scope_:n}=r;return z(n,t),Z(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=H(N).applyPatches_;return p(e)?n(e,t):this.produce(e,e=>n(e,t))}},pe=he.produce},12070(e,t,r){"use strict";r.d(t,{r:()=>A});var n=r(96540),i=(0,n.createContext)(null),A=()=>null!=(0,n.useContext)(i)},12122(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(e,t){this.bits=e,this.points=t}return e.prototype.getBits=function(){return this.bits},e.prototype.getPoints=function(){return this.points},e}()},13628(e,t,r){"use strict";r.d(t,{A:()=>A});var n=r(88468),i=r(44487);const A=function(){function e(){}return e.encodeECC200=function(e,t){if(e.length!==t.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var r=new n.A;r.append(e);var i=t.getInterleavedBlockCount();if(1===i){var A=this.createECCBlock(e,t.getErrorCodewords());r.append(A)}else{for(var o=[],a=[],s=0;s<i;s++)o[s]=t.getDataLengthForInterleavedBlock(s+1),a[s]=t.getErrorLengthForInterleavedBlock(s+1);for(var u=0;u<i;u++){for(var c=new n.A,l=u;l<t.getDataCapacity();l+=i)c.append(e.charAt(l));A=this.createECCBlock(c.toString(),a[u]);for(var f=0,d=u;d<a[u]*i;d+=i)r.setCharAt(t.getDataCapacity()+d,A.charAt(f++))}}return r.toString()},e.createECCBlock=function(e,t){for(var r=-1,n=0;n<i.gE.length;n++)if(i.gE[n]===t){r=n;break}if(r<0)throw new Error("Illegal number of error correction codewords specified: "+t);var A=i.XQ[r],o=[];for(n=0;n<t;n++)o[n]=0;for(n=0;n<e.length;n++){for(var a=o[t-1]^e.charAt(n).charCodeAt(0),s=t-1;s>0;s--)0!==a&&0!==A[s]?o[s]=o[s-1]^i.KX[(i.$9[a]+i.$9[A[s]])%255]:o[s]=o[s-1];0!==a&&0!==A[0]?o[0]=i.KX[(i.$9[a]+i.$9[A[0]])%255]:o[0]=0}var u=[];for(n=0;n<t;n++)u[n]=o[t-n-1];return u.map(function(e){return String.fromCharCode(e)}).join("")},e}()},13719(e,t,r){"use strict";r.d(t,{A:()=>l});var n=r(82299),i=r(98517),A=r(51084),o=r(54951),a=r(31327),s=r(88468),u=r(43334),c=r(18262);const l=function(){function e(){}return e.decode=function(t,r,o,u){var l=new n.A(t),f=new s.A,d=new Array,h=-1,p=-1;try{var g=null,y=!1,v=void 0;do{if(l.available()<4)v=c.A.TERMINATOR;else{var m=l.readBits(4);v=c.A.forBits(m)}switch(v){case c.A.TERMINATOR:break;case c.A.FNC1_FIRST_POSITION:case c.A.FNC1_SECOND_POSITION:y=!0;break;case c.A.STRUCTURED_APPEND:if(l.available()<16)throw new a.A;h=l.readBits(8),p=l.readBits(8);break;case c.A.ECI:var w=e.parseECIValue(l);if(null===(g=i.A.getCharacterSetECIByValue(w)))throw new a.A;break;case c.A.HANZI:var b=l.readBits(4),B=l.readBits(v.getCharacterCountBits(r));b===e.GB2312_SUBSET&&e.decodeHanziSegment(l,f,B);break;default:var C=l.readBits(v.getCharacterCountBits(r));switch(v){case c.A.NUMERIC:e.decodeNumericSegment(l,f,C);break;case c.A.ALPHANUMERIC:e.decodeAlphanumericSegment(l,f,C,y);break;case c.A.BYTE:e.decodeByteSegment(l,f,C,g,d,u);break;case c.A.KANJI:e.decodeKanjiSegment(l,f,C);break;default:throw new a.A}}}while(v!==c.A.TERMINATOR)}catch(e){throw new a.A}return new A.A(t,f.toString(),0===d.length?null:d,null===o?null:o.toString(),h,p)},e.decodeHanziSegment=function(e,t,r){if(13*r>e.available())throw new a.A;for(var n=new Uint8Array(2*r),i=0;r>0;){var A=e.readBits(13),s=A/96<<8&4294967295|A%96;s+=s<959?41377:42657,n[i]=s>>8&255,n[i+1]=255&s,i+=2,r--}try{t.append(u.A.decode(n,o.A.GB2312))}catch(e){throw new a.A(e)}},e.decodeKanjiSegment=function(e,t,r){if(13*r>e.available())throw new a.A;for(var n=new Uint8Array(2*r),i=0;r>0;){var A=e.readBits(13),s=A/192<<8&4294967295|A%192;s+=s<7936?33088:49472,n[i]=s>>8,n[i+1]=s,i+=2,r--}try{t.append(u.A.decode(n,o.A.SHIFT_JIS))}catch(e){throw new a.A(e)}},e.decodeByteSegment=function(e,t,r,n,i,A){if(8*r>e.available())throw new a.A;for(var s,c=new Uint8Array(r),l=0;l<r;l++)c[l]=e.readBits(8);s=null===n?o.A.guessEncoding(c,A):n.getName();try{t.append(u.A.decode(c,s))}catch(e){throw new a.A(e)}i.push(c)},e.toAlphaNumericChar=function(t){if(t>=e.ALPHANUMERIC_CHARS.length)throw new a.A;return e.ALPHANUMERIC_CHARS[t]},e.decodeAlphanumericSegment=function(t,r,n,i){for(var A=r.length();n>1;){if(t.available()<11)throw new a.A;var o=t.readBits(11);r.append(e.toAlphaNumericChar(Math.floor(o/45))),r.append(e.toAlphaNumericChar(o%45)),n-=2}if(1===n){if(t.available()<6)throw new a.A;r.append(e.toAlphaNumericChar(t.readBits(6)))}if(i)for(var s=A;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,String.fromCharCode(29)))},e.decodeNumericSegment=function(t,r,n){for(;n>=3;){if(t.available()<10)throw new a.A;var i=t.readBits(10);if(i>=1e3)throw new a.A;r.append(e.toAlphaNumericChar(Math.floor(i/100))),r.append(e.toAlphaNumericChar(Math.floor(i/10)%10)),r.append(e.toAlphaNumericChar(i%10)),n-=3}if(2===n){if(t.available()<7)throw new a.A;var A=t.readBits(7);if(A>=100)throw new a.A;r.append(e.toAlphaNumericChar(Math.floor(A/10))),r.append(e.toAlphaNumericChar(A%10))}else if(1===n){if(t.available()<4)throw new a.A;var o=t.readBits(4);if(o>=10)throw new a.A;r.append(e.toAlphaNumericChar(o))}},e.parseECIValue=function(e){var t=e.readBits(8);if(!(128&t))return 127&t;if(128==(192&t))return(63&t)<<8&4294967295|e.readBits(8);if(192==(224&t))return(31&t)<<16&4294967295|e.readBits(16);throw new a.A},e.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.GB2312_SUBSET=1,e}()},14040(e,t,r){"use strict";r.d(t,{IZ:()=>s,Kg:()=>o,lY:()=>u,yy:()=>f});r(96540);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){A(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=Math.PI/180,a=e=>180*e/Math.PI,s=(e,t,r,n)=>({x:e+Math.cos(-o*n)*r,y:t+Math.sin(-o*n)*r}),u=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0,width:0,height:0,brushBottom:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(t-(r.top||0)-(r.bottom||0)))/2},c=(e,t)=>{var{x:r,y:n}=e,{cx:i,cy:A}=t,o=((e,t)=>{var{x:r,y:n}=e,{x:i,y:A}=t;return Math.sqrt((r-i)**2+(n-A)**2)})({x:r,y:n},{x:i,y:A});if(o<=0)return{radius:o,angle:0};var s=(r-i)/o,u=Math.acos(s);return n>A&&(u=2*Math.PI-u),{radius:o,angle:a(u),angleInRadian:u}},l=(e,t)=>{var{startAngle:r,endAngle:n}=t,i=Math.floor(r/360),A=Math.floor(n/360);return e+360*Math.min(i,A)},f=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:A,angle:o}=c({x:r,y:n},t),{innerRadius:a,outerRadius:s}=t;if(A<a||A>s)return null;if(0===A)return null;var u,{startAngle:f,endAngle:d}=(e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),i=Math.floor(r/360),A=Math.min(n,i);return{startAngle:t-360*A,endAngle:r-360*A}})(t),h=o;if(f<=d){for(;h>d;)h-=360;for(;h<f;)h+=360;u=h>=f&&h<=d}else{for(;h>f;)h-=360;for(;h<d;)h+=360;u=h>=d&&h<=f}return u?i(i({},t),{},{radius:A,angle:l(h,t)}):null}},14644(e,t,r){"use strict";function n(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}r.d(t,{HY:()=>u,Qd:()=>a,Tw:()=>l,Zz:()=>c,ve:()=>f,y$:()=>s});var i=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),A=()=>Math.random().toString(36).substring(7).split("").join("."),o={INIT:`@@redux/INIT${A()}`,REPLACE:`@@redux/REPLACE${A()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${A()}`};function a(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function s(e,t,r){if("function"!=typeof e)throw new Error(n(2));if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(n(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(n(1));return r(s)(e,t)}let A=e,u=t,c=new Map,l=c,f=0,d=!1;function h(){l===c&&(l=new Map,c.forEach((e,t)=>{l.set(t,e)}))}function p(){if(d)throw new Error(n(3));return u}function g(e){if("function"!=typeof e)throw new Error(n(4));if(d)throw new Error(n(5));let t=!0;h();const r=f++;return l.set(r,e),function(){if(t){if(d)throw new Error(n(6));t=!1,h(),l.delete(r),c=null}}}function y(e){if(!a(e))throw new Error(n(7));if(void 0===e.type)throw new Error(n(8));if("string"!=typeof e.type)throw new Error(n(17));if(d)throw new Error(n(9));try{d=!0,u=A(u,e)}finally{d=!1}return(c=l).forEach(e=>{e()}),e}y({type:o.INIT});return{dispatch:y,subscribe:g,getState:p,replaceReducer:function(e){if("function"!=typeof e)throw new Error(n(10));A=e,y({type:o.REPLACE})},[i]:function(){const e=g;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(n(11));function r(){const e=t;e.next&&e.next(p())}r();return{unsubscribe:e(r)}},[i](){return this}}}}}function u(e){const t=Object.keys(e),r={};for(let n=0;n<t.length;n++){const i=t[n];0,"function"==typeof e[i]&&(r[i]=e[i])}const i=Object.keys(r);let A;try{!function(e){Object.keys(e).forEach(t=>{const r=e[t];if(void 0===r(void 0,{type:o.INIT}))throw new Error(n(12));if(void 0===r(void 0,{type:o.PROBE_UNKNOWN_ACTION()}))throw new Error(n(13))})}(r)}catch(e){A=e}return function(e={},t){if(A)throw A;let o=!1;const a={};for(let A=0;A<i.length;A++){const s=i[A],u=r[s],c=e[s],l=u(c,t);if(void 0===l){t&&t.type;throw new Error(n(14))}a[s]=l,o=o||l!==c}return o=o||i.length!==Object.keys(e).length,o?a:e}}function c(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function l(...e){return t=>(r,i)=>{const A=t(r,i);let o=()=>{throw new Error(n(15))};const a={getState:A.getState,dispatch:(e,...t)=>o(e,...t)},s=e.map(e=>e(a));return o=c(...s)(A.dispatch),{...A,dispatch:o}}}function f(e){return a(e)&&"type"in e&&"string"==typeof e.type}},15072(e,t,r){"use strict";r.d(t,{E:()=>g});var n=r(24880),i=r(79757),A=r(26261),o=r(66500),a=class extends o.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const A=t.queryKey,o=t.queryHash??(0,n.F$)(A,t);let a=this.get(o);return a||(a=new i.X({client:e,queryKey:A,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(A)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){A.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>(0,n.MK)(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n.MK)(e,t)):t}notify(e){A.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){A.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){A.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},s=r(36158),u=class extends o.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#r=new Map,this.#n=0}#t;#r;#n;build(e,t,r){const n=new s.s({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#t.add(e);const t=c(e);if("string"==typeof t){const r=this.#r.get(t);r?r.push(e):this.#r.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=c(e);if("string"==typeof t){const r=this.#r.get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#r.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=c(e);if("string"==typeof t){const r=this.#r.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}return!0}runNext(e){const t=c(e);if("string"==typeof t){const r=this.#r.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){A.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#r.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>(0,n.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.nJ)(e,t))}notify(e){A.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return A.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.lQ))))}};function c(e){return e.options.scope?.id}var l=r(29658),f=r(96035);function d(e){return{onFetch:(t,r)=>{const i=t.options,A=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const c=async()=>{let r=!1;const c=(0,n.ZM)(t.options,t.fetchOptions),l=async(e,i,A)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);const o=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:A?"backward":"forward",meta:t.options.meta};var o;return o=e,(0,n.ox)(o,()=>t.signal,()=>r=!0),e})(),a=await c(o),{maxPages:s}=t.options,u=A?n.ZZ:n.y9;return{pages:u(e.pages,a,s),pageParams:u(e.pageParams,i,s)}};if(A&&o.length){const e="backward"===A,t={pages:o,pageParams:a},r=(e?p:h)(i,t);s=await l(t,r,e)}else{const t=e??o.length;do{const e=0===u?a[0]??i.initialPageParam:h(i,s);if(u>0&&null==e)break;s=await l(s,e),u++}while(u<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function p(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var g=class{#i;#A;#o;#a;#s;#u;#c;#l;constructor(e={}){this.#i=e.queryCache||new a,this.#A=e.mutationCache||new u,this.#o=e.defaultOptions||{},this.#a=new Map,this.#s=new Map,this.#u=0}mount(){this.#u++,1===this.#u&&(this.#c=l.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onFocus())}),this.#l=f.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#i.onOnline())}))}unmount(){this.#u--,0===this.#u&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#i.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#A.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#i.build(this,t),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.d2)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#i.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),A=this.#i.get(i.queryHash),o=A?.state.data,a=(0,n.Zw)(t,o);if(void 0!==a)return this.#i.build(this,i).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return A.jG.batch(()=>this.#i.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#i.get(t.queryHash)?.state}removeQueries(e){const t=this.#i;A.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=this.#i;return A.jG.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=A.jG.batch(()=>this.#i.findAll(e).map(e=>e.cancel(r)));return Promise.all(i).then(n.lQ).catch(n.lQ)}invalidateQueries(e,t={}){return A.jG.batch(()=>(this.#i.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},i=A.jG.batch(()=>this.#i.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(i).then(n.lQ)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#i.build(this,t);return r.isStaleByTime((0,n.d2)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=d(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}ensureInfiniteQueryData(e){return e.behavior=d(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.t.isOnline()?this.#A.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#i}getMutationCache(){return this.#A}getDefaultOptions(){return this.#o}setDefaultOptions(e){this.#o=e}setQueryDefaults(e,t){this.#a.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],r={};return t.forEach(t=>{(0,n.Cp)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#s.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],r={};return t.forEach(t=>{(0,n.Cp)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#o.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#o.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#i.clear(),this.#A.clear()}}},15079(e,t,r){"use strict";r.d(t,{y:()=>k});var n,i,A,o,a,s=r(96540),u=r(92938),c=r.n(u),l=r(34723),f=r(34164),d=r(77404),h=r(8791),p=r(8107),g=r(59744),y=r(23929),v=r(80196),m=r(56905);function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(t){B(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function B(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},C.apply(null,arguments)}function E(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var S=(e,t,r,s,u)=>{var c,l=r-s;return c=(0,m.Y)(n||(n=E(["M ",",",""])),e,t),c+=(0,m.Y)(i||(i=E(["L ",",",""])),e+r,t),c+=(0,m.Y)(A||(A=E(["L ",",",""])),e+r-l/2,t+u),c+=(0,m.Y)(o||(o=E(["L ",",",""])),e+r-l/2-s,t+u),c+=(0,m.Y)(a||(a=E(["L ",","," Z"])),e,t)},I={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},O=e=>{var t=(0,d.e)(e,I),{x:r,y:n,upperWidth:i,lowerWidth:A,height:o,className:a}=t,{animationEasing:u,animationDuration:c,animationBegin:l,isUpdateAnimationActive:m}=t,w=(0,s.useRef)(null),[B,E]=(0,s.useState)(-1),O=(0,s.useRef)(i),F=(0,s.useRef)(A),_=(0,s.useRef)(o),x=(0,s.useRef)(r),U=(0,s.useRef)(n),Q=(0,p.n)(e,"trapezoid-");if((0,s.useEffect)(()=>{if(w.current&&w.current.getTotalLength)try{var e=w.current.getTotalLength();e&&E(e)}catch(e){}},[]),r!==+r||n!==+n||i!==+i||A!==+A||o!==+o||0===i&&0===A||0===o)return null;var T=(0,f.$)("recharts-trapezoid",a);if(!m)return s.createElement("g",null,s.createElement("path",C({},(0,v.a)(t),{className:T,d:S(r,n,i,A,o)})));var M=O.current,P=F.current,D=_.current,k=x.current,N=U.current,R="0px ".concat(-1===B?1:B,"px"),L="".concat(B,"px 0px"),H=(0,y.dl)(["strokeDasharray"],c,u);return s.createElement(h.J,{animationId:Q,key:Q,canBegin:B>0,duration:c,easing:u,isActive:m,begin:l},e=>{var a=(0,g.GW)(M,i,e),u=(0,g.GW)(P,A,e),c=(0,g.GW)(D,o,e),l=(0,g.GW)(k,r,e),f=(0,g.GW)(N,n,e);w.current&&(O.current=a,F.current=u,_.current=c,x.current=l,U.current=f);var d=e>0?{transition:H,strokeDasharray:L}:{strokeDasharray:R};return s.createElement("path",C({},(0,v.a)(t),{className:T,d:S(l,f,a,u,c),ref:w,style:b(b({},d),t.style)}))})},F=r(58522),_=r(86069),x=r(90706),U=r(29705),Q=["option","shapeType","activeClassName"];function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach(function(t){P(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return s.createElement(l.M,r);case"trapezoid":return s.createElement(O,r);case"sector":return s.createElement(F.h,r);case"symbols":if(function(e){return"symbols"===e}(t))return s.createElement(x.i,r);break;case"curve":return s.createElement(U.I,r);default:return null}}function k(e){var t,{option:r,shapeType:n,activeClassName:i="recharts-active-shape"}=e,A=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Q);if((0,s.isValidElement)(r))t=(0,s.cloneElement)(r,M(M({},A),function(e){return(0,s.isValidElement)(e)?e.props:e}(r)));else if("function"==typeof r)t=r(A,A.index);else if(c()(r)&&"boolean"!=typeof r){var o=function(e,t){return M(M({},t),e)}(r,A);t=s.createElement(D,{shapeType:n,elementProps:o})}else{var a=A;t=s.createElement(D,{shapeType:n,elementProps:a})}return A.isActive?s.createElement(_.W,{className:i},t):t}},15086(e,t,r){"use strict";var n=r(46518),i=r(59213).some;n({target:"Array",proto:!0,forced:!r(34598)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},15287(e,t){"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,g={};function y(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||h}function v(){}function m(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||h}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)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")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var w=m.prototype=new v;w.constructor=m,p(w,y.prototype),w.isPureReactComponent=!0;var b=Array.isArray,B=Object.prototype.hasOwnProperty,C={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var i,A={},o=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(o=""+t.key),t)B.call(t,i)&&!E.hasOwnProperty(i)&&(A[i]=t[i]);var s=arguments.length-2;if(1===s)A.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];A.children=u}if(e&&e.defaultProps)for(i in s=e.defaultProps)void 0===A[i]&&(A[i]=s[i]);return{$$typeof:r,type:e,key:o,ref:a,props:A,_owner:C.current}}function I(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var O=/\/+/g;function F(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function _(e,t,i,A,o){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var s=!1;if(null===e)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case r:case n:s=!0}}if(s)return o=o(s=e),e=""===A?"."+F(s,0):A,b(o)?(i="",null!=e&&(i=e.replace(O,"$&/")+"/"),_(o,t,i,"",function(e){return e})):null!=o&&(I(o)&&(o=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,i+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(O,"$&/")+"/")+e)),t.push(o)),1;if(s=0,A=""===A?".":A+":",b(e))for(var u=0;u<e.length;u++){var c=A+F(a=e[u],u);s+=_(a,t,i,c,o)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"==typeof c)for(e=c.call(e),u=0;!(a=e.next()).done;)s+=_(a=a.value,t,i,c=A+F(a,u++),o);else if("object"===a)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function x(e,t,r){if(null==e)return e;var n=[],i=0;return _(e,n,"","",function(e){return t.call(r,e,i++)}),n}function U(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var Q={current:null},T={transition:null},M={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:T,ReactCurrentOwner:C};function P(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:x,forEach:function(e,t,r){x(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return x(e,function(){t++}),t},toArray:function(e){return x(e,function(e){return e})||[]},only:function(e){if(!I(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=o,t.PureComponent=m,t.StrictMode=A,t.Suspense=c,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,t.act=P,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=p({},e.props),A=e.key,o=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(o=t.ref,a=C.current),void 0!==t.key&&(A=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(u in t)B.call(t,u)&&!E.hasOwnProperty(u)&&(i[u]=void 0===t[u]&&void 0!==s?s[u]:t[u])}var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){s=Array(u);for(var c=0;c<u;c++)s[c]=arguments[c+2];i.children=s}return{$$typeof:r,type:e.type,key:A,ref:o,props:i,_owner:a}},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:u,render:e}},t.isValidElement=I,t.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:U}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=T.transition;T.transition={};try{e()}finally{T.transition=t}},t.unstable_act=P,t.useCallback=function(e,t){return Q.current.useCallback(e,t)},t.useContext=function(e){return Q.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return Q.current.useDeferredValue(e)},t.useEffect=function(e,t){return Q.current.useEffect(e,t)},t.useId=function(){return Q.current.useId()},t.useImperativeHandle=function(e,t,r){return Q.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return Q.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return Q.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return Q.current.useMemo(e,t)},t.useReducer=function(e,t,r){return Q.current.useReducer(e,t,r)},t.useRef=function(e){return Q.current.useRef(e)},t.useState=function(e){return Q.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return Q.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return Q.current.useTransition()},t.version="18.3.1"},15482(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(8032),i=r(73872),A=r(26818),o=r(59363),a=r(68271),s=r(6228),u=r(58503),c=r(1458),l=r(77247),f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const d=function(){function e(){}return e.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},e.prototype.decodeWithState=function(e){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(e)},e.prototype.setHints=function(e){this.hints=e;var t=null!=e&&void 0!==e.get(n.A.TRY_HARDER),r=null==e?null:e.get(n.A.POSSIBLE_FORMATS),u=new Array;if(null!=r){var l=r.some(function(e){return e===i.A.UPC_A||e===i.A.UPC_E||e===i.A.EAN_13||e===i.A.EAN_8||e===i.A.CODABAR||e===i.A.CODE_39||e===i.A.CODE_93||e===i.A.CODE_128||e===i.A.ITF||e===i.A.RSS_14||e===i.A.RSS_EXPANDED});l&&!t&&u.push(new a.A(e)),r.includes(i.A.QR_CODE)&&u.push(new A.A),r.includes(i.A.DATA_MATRIX)&&u.push(new s.A),r.includes(i.A.AZTEC)&&u.push(new o.A),r.includes(i.A.PDF_417)&&u.push(new c.A),l&&t&&u.push(new a.A(e))}0===u.length&&(t||u.push(new a.A(e)),u.push(new A.A),u.push(new s.A),u.push(new o.A),u.push(new c.A),t&&u.push(new a.A(e))),this.readers=u},e.prototype.reset=function(){var e,t;if(null!==this.readers)try{for(var r=f(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.decodeInternal=function(e){var t,r;if(null===this.readers)throw new l.A("No readers where selected, nothing can be read.");try{for(var n=f(this.readers),i=n.next();!i.done;i=n.next()){var A=i.value;try{return A.decode(e,this.hints)}catch(e){if(e instanceof l.A)continue}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}throw new u.A("No MultiFormat Readers were able to detect the code.")},e}()},15511(e,t,r){"use strict";var n;r.d(t,{A:()=>i}),function(e){e[e.OTHER=0]="OTHER",e[e.ORIENTATION=1]="ORIENTATION",e[e.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",e[e.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",e[e.ISSUE_NUMBER=4]="ISSUE_NUMBER",e[e.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",e[e.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",e[e.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",e[e.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",e[e.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",e[e.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(n||(n={}));const i=n},15575(e,t,r){"use strict";var n=r(46518),i=r(44576),A=r(79472)(i.setInterval,!0);n({global:!0,bind:!0,forced:i.setInterval!==A},{setInterval:A})},15747(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="ArgumentException",t}(i.A);const a=o},15906(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(23431),i=r(4526),A=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(){function e(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=t}return e.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},e.prototype.getNumBlocks=function(){var e,t,r=0,n=this.ecBlocks;try{for(var i=A(n),o=i.next();!o.done;o=i.next()){r+=o.value.getCount()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},e.prototype.getECBlocks=function(){return this.ecBlocks},e}();const a=o;const s=function(){function e(e,t){this.count=e,this.dataCodewords=t}return e.prototype.getCount=function(){return this.count},e.prototype.getDataCodewords=function(){return this.dataCodewords},e}();var u=r(31327),c=r(57149),l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},f=function(){function e(e,t){for(var r,n,i=[],A=2;A<arguments.length;A++)i[A-2]=arguments[A];this.versionNumber=e,this.alignmentPatternCenters=t,this.ecBlocks=i;var o=0,a=i[0].getECCodewordsPerBlock(),s=i[0].getECBlocks();try{for(var u=l(s),c=u.next();!c.done;c=u.next()){var f=c.value;o+=f.getCount()*(f.getDataCodewords()+a)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}this.totalCodewords=o}return e.prototype.getVersionNumber=function(){return this.versionNumber},e.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},e.prototype.getTotalCodewords=function(){return this.totalCodewords},e.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},e.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},e.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new u.A;try{return this.getVersionForNumber((e-17)/4)}catch(e){throw new u.A}},e.getVersionForNumber=function(t){if(t<1||t>40)throw new c.A;return e.VERSIONS[t-1]},e.decodeVersionInformation=function(t){for(var r=Number.MAX_SAFE_INTEGER,n=0,A=0;A<e.VERSION_DECODE_INFO.length;A++){var o=e.VERSION_DECODE_INFO[A];if(o===t)return e.getVersionForNumber(A+7);var a=i.A.numBitsDiffering(t,o);a<r&&(n=A+7,r=a)}return r<=3?e.getVersionForNumber(n):null},e.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),t=new n.A(e);t.setRegion(0,0,9,9),t.setRegion(e-8,0,8,9),t.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,i=0;i<r;i++)for(var A=this.alignmentPatternCenters[i]-2,o=0;o<r;o++)0===i&&(0===o||o===r-1)||i===r-1&&0===o||t.setRegion(this.alignmentPatternCenters[o]-2,A,5,5);return t.setRegion(6,9,1,e-17),t.setRegion(9,6,e-17,1),this.versionNumber>6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},e.prototype.toString=function(){return""+this.versionNumber},e.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),e.VERSIONS=[new e(1,new Int32Array(0),new a(7,new s(1,19)),new a(10,new s(1,16)),new a(13,new s(1,13)),new a(17,new s(1,9))),new e(2,Int32Array.from([6,18]),new a(10,new s(1,34)),new a(16,new s(1,28)),new a(22,new s(1,22)),new a(28,new s(1,16))),new e(3,Int32Array.from([6,22]),new a(15,new s(1,55)),new a(26,new s(1,44)),new a(18,new s(2,17)),new a(22,new s(2,13))),new e(4,Int32Array.from([6,26]),new a(20,new s(1,80)),new a(18,new s(2,32)),new a(26,new s(2,24)),new a(16,new s(4,9))),new e(5,Int32Array.from([6,30]),new a(26,new s(1,108)),new a(24,new s(2,43)),new a(18,new s(2,15),new s(2,16)),new a(22,new s(2,11),new s(2,12))),new e(6,Int32Array.from([6,34]),new a(18,new s(2,68)),new a(16,new s(4,27)),new a(24,new s(4,19)),new a(28,new s(4,15))),new e(7,Int32Array.from([6,22,38]),new a(20,new s(2,78)),new a(18,new s(4,31)),new a(18,new s(2,14),new s(4,15)),new a(26,new s(4,13),new s(1,14))),new e(8,Int32Array.from([6,24,42]),new a(24,new s(2,97)),new a(22,new s(2,38),new s(2,39)),new a(22,new s(4,18),new s(2,19)),new a(26,new s(4,14),new s(2,15))),new e(9,Int32Array.from([6,26,46]),new a(30,new s(2,116)),new a(22,new s(3,36),new s(2,37)),new a(20,new s(4,16),new s(4,17)),new a(24,new s(4,12),new s(4,13))),new e(10,Int32Array.from([6,28,50]),new a(18,new s(2,68),new s(2,69)),new a(26,new s(4,43),new s(1,44)),new a(24,new s(6,19),new s(2,20)),new a(28,new s(6,15),new s(2,16))),new e(11,Int32Array.from([6,30,54]),new a(20,new s(4,81)),new a(30,new s(1,50),new s(4,51)),new a(28,new s(4,22),new s(4,23)),new a(24,new s(3,12),new s(8,13))),new e(12,Int32Array.from([6,32,58]),new a(24,new s(2,92),new s(2,93)),new a(22,new s(6,36),new s(2,37)),new a(26,new s(4,20),new s(6,21)),new a(28,new s(7,14),new s(4,15))),new e(13,Int32Array.from([6,34,62]),new a(26,new s(4,107)),new a(22,new s(8,37),new s(1,38)),new a(24,new s(8,20),new s(4,21)),new a(22,new s(12,11),new s(4,12))),new e(14,Int32Array.from([6,26,46,66]),new a(30,new s(3,115),new s(1,116)),new a(24,new s(4,40),new s(5,41)),new a(20,new s(11,16),new s(5,17)),new a(24,new s(11,12),new s(5,13))),new e(15,Int32Array.from([6,26,48,70]),new a(22,new s(5,87),new s(1,88)),new a(24,new s(5,41),new s(5,42)),new a(30,new s(5,24),new s(7,25)),new a(24,new s(11,12),new s(7,13))),new e(16,Int32Array.from([6,26,50,74]),new a(24,new s(5,98),new s(1,99)),new a(28,new s(7,45),new s(3,46)),new a(24,new s(15,19),new s(2,20)),new a(30,new s(3,15),new s(13,16))),new e(17,Int32Array.from([6,30,54,78]),new a(28,new s(1,107),new s(5,108)),new a(28,new s(10,46),new s(1,47)),new a(28,new s(1,22),new s(15,23)),new a(28,new s(2,14),new s(17,15))),new e(18,Int32Array.from([6,30,56,82]),new a(30,new s(5,120),new s(1,121)),new a(26,new s(9,43),new s(4,44)),new a(28,new s(17,22),new s(1,23)),new a(28,new s(2,14),new s(19,15))),new e(19,Int32Array.from([6,30,58,86]),new a(28,new s(3,113),new s(4,114)),new a(26,new s(3,44),new s(11,45)),new a(26,new s(17,21),new s(4,22)),new a(26,new s(9,13),new s(16,14))),new e(20,Int32Array.from([6,34,62,90]),new a(28,new s(3,107),new s(5,108)),new a(26,new s(3,41),new s(13,42)),new a(30,new s(15,24),new s(5,25)),new a(28,new s(15,15),new s(10,16))),new e(21,Int32Array.from([6,28,50,72,94]),new a(28,new s(4,116),new s(4,117)),new a(26,new s(17,42)),new a(28,new s(17,22),new s(6,23)),new a(30,new s(19,16),new s(6,17))),new e(22,Int32Array.from([6,26,50,74,98]),new a(28,new s(2,111),new s(7,112)),new a(28,new s(17,46)),new a(30,new s(7,24),new s(16,25)),new a(24,new s(34,13))),new e(23,Int32Array.from([6,30,54,78,102]),new a(30,new s(4,121),new s(5,122)),new a(28,new s(4,47),new s(14,48)),new a(30,new s(11,24),new s(14,25)),new a(30,new s(16,15),new s(14,16))),new e(24,Int32Array.from([6,28,54,80,106]),new a(30,new s(6,117),new s(4,118)),new a(28,new s(6,45),new s(14,46)),new a(30,new s(11,24),new s(16,25)),new a(30,new s(30,16),new s(2,17))),new e(25,Int32Array.from([6,32,58,84,110]),new a(26,new s(8,106),new s(4,107)),new a(28,new s(8,47),new s(13,48)),new a(30,new s(7,24),new s(22,25)),new a(30,new s(22,15),new s(13,16))),new e(26,Int32Array.from([6,30,58,86,114]),new a(28,new s(10,114),new s(2,115)),new a(28,new s(19,46),new s(4,47)),new a(28,new s(28,22),new s(6,23)),new a(30,new s(33,16),new s(4,17))),new e(27,Int32Array.from([6,34,62,90,118]),new a(30,new s(8,122),new s(4,123)),new a(28,new s(22,45),new s(3,46)),new a(30,new s(8,23),new s(26,24)),new a(30,new s(12,15),new s(28,16))),new e(28,Int32Array.from([6,26,50,74,98,122]),new a(30,new s(3,117),new s(10,118)),new a(28,new s(3,45),new s(23,46)),new a(30,new s(4,24),new s(31,25)),new a(30,new s(11,15),new s(31,16))),new e(29,Int32Array.from([6,30,54,78,102,126]),new a(30,new s(7,116),new s(7,117)),new a(28,new s(21,45),new s(7,46)),new a(30,new s(1,23),new s(37,24)),new a(30,new s(19,15),new s(26,16))),new e(30,Int32Array.from([6,26,52,78,104,130]),new a(30,new s(5,115),new s(10,116)),new a(28,new s(19,47),new s(10,48)),new a(30,new s(15,24),new s(25,25)),new a(30,new s(23,15),new s(25,16))),new e(31,Int32Array.from([6,30,56,82,108,134]),new a(30,new s(13,115),new s(3,116)),new a(28,new s(2,46),new s(29,47)),new a(30,new s(42,24),new s(1,25)),new a(30,new s(23,15),new s(28,16))),new e(32,Int32Array.from([6,34,60,86,112,138]),new a(30,new s(17,115)),new a(28,new s(10,46),new s(23,47)),new a(30,new s(10,24),new s(35,25)),new a(30,new s(19,15),new s(35,16))),new e(33,Int32Array.from([6,30,58,86,114,142]),new a(30,new s(17,115),new s(1,116)),new a(28,new s(14,46),new s(21,47)),new a(30,new s(29,24),new s(19,25)),new a(30,new s(11,15),new s(46,16))),new e(34,Int32Array.from([6,34,62,90,118,146]),new a(30,new s(13,115),new s(6,116)),new a(28,new s(14,46),new s(23,47)),new a(30,new s(44,24),new s(7,25)),new a(30,new s(59,16),new s(1,17))),new e(35,Int32Array.from([6,30,54,78,102,126,150]),new a(30,new s(12,121),new s(7,122)),new a(28,new s(12,47),new s(26,48)),new a(30,new s(39,24),new s(14,25)),new a(30,new s(22,15),new s(41,16))),new e(36,Int32Array.from([6,24,50,76,102,128,154]),new a(30,new s(6,121),new s(14,122)),new a(28,new s(6,47),new s(34,48)),new a(30,new s(46,24),new s(10,25)),new a(30,new s(2,15),new s(64,16))),new e(37,Int32Array.from([6,28,54,80,106,132,158]),new a(30,new s(17,122),new s(4,123)),new a(28,new s(29,46),new s(14,47)),new a(30,new s(49,24),new s(10,25)),new a(30,new s(24,15),new s(46,16))),new e(38,Int32Array.from([6,32,58,84,110,136,162]),new a(30,new s(4,122),new s(18,123)),new a(28,new s(13,46),new s(32,47)),new a(30,new s(48,24),new s(14,25)),new a(30,new s(42,15),new s(32,16))),new e(39,Int32Array.from([6,26,54,82,110,138,166]),new a(30,new s(20,117),new s(4,118)),new a(28,new s(40,47),new s(7,48)),new a(30,new s(43,24),new s(22,25)),new a(30,new s(10,15),new s(67,16))),new e(40,Int32Array.from([6,30,58,86,114,142,170]),new a(30,new s(19,118),new s(6,119)),new a(28,new s(18,47),new s(31,48)),new a(30,new s(34,24),new s(34,25)),new a(30,new s(20,15),new s(61,16)))],e}();const d=f},16193(e,t,r){"use strict";var n=r(84215);e.exports="NODE"===n},16499(e,t,r){"use strict";var n=r(46518),i=r(69565),A=r(79306),o=r(36043),a=r(1103),s=r(72652);n({target:"Promise",stat:!0,forced:r(90537)},{all:function(e){var t=this,r=o.f(t),n=r.resolve,u=r.reject,c=a(function(){var r=A(t.resolve),o=[],a=0,c=1;s(e,function(e){var A=a++,s=!1;c++,i(r,t,e).then(function(e){s||(s=!0,o[A]=e,--c||n(o))},u)}),--c||n(o)});return c.error&&u(c.value),r.promise}})},17324(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(95112),i=r(18509),A=r(82984),o=r(3025);t.has=function(e,t){let r;if(r=Array.isArray(t)?t:"string"==typeof t&&n.isDeepKey(t)&&null==e?.[t]?o.toPath(t):[t],0===r.length)return!1;let a=e;for(let e=0;e<r.length;e++){const t=r[e];if(null==a||!Object.hasOwn(a,t)){if(!((Array.isArray(a)||A.isArguments(a))&&i.isIndex(t)&&t<a.length))return!1}a=a[t]}return!0}},18262(e,t,r){"use strict";r.d(t,{A:()=>A});var n,i=r(57149);!function(e){e[e.TERMINATOR=0]="TERMINATOR",e[e.NUMERIC=1]="NUMERIC",e[e.ALPHANUMERIC=2]="ALPHANUMERIC",e[e.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",e[e.BYTE=4]="BYTE",e[e.ECI=5]="ECI",e[e.KANJI=6]="KANJI",e[e.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",e[e.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",e[e.HANZI=9]="HANZI"}(n||(n={}));const A=function(){function e(t,r,n,i){this.value=t,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=i,e.FOR_BITS.set(i,this),e.FOR_VALUE.set(t,this)}return e.forBits=function(t){var r=e.FOR_BITS.get(t);if(void 0===r)throw new i.A;return r},e.prototype.getCharacterCountBits=function(e){var t,r=e.getVersionNumber();return t=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[t]},e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.prototype.toString=function(){return this.stringValue},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.TERMINATOR=new e(n.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),e.NUMERIC=new e(n.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),e.ALPHANUMERIC=new e(n.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),e.STRUCTURED_APPEND=new e(n.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),e.BYTE=new e(n.BYTE,"BYTE",Int32Array.from([8,16,16]),4),e.ECI=new e(n.ECI,"ECI",Int32Array.from([0,0,0]),7),e.KANJI=new e(n.KANJI,"KANJI",Int32Array.from([8,10,12]),8),e.FNC1_FIRST_POSITION=new e(n.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),e.FNC1_SECOND_POSITION=new e(n.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),e.HANZI=new e(n.HANZI,"HANZI",Int32Array.from([8,10,12]),13),e}()},18265(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},18351(e,t,r){"use strict";r.d(t,{x:()=>n});var n=e=>e.options.tooltipPayloadSearcher},18509(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const r=/^(?:0|[1-9]\d*)$/;t.isIndex=function(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return r.test(e)}}},19287(e,t,r){"use strict";r.d(t,{A3:()=>B,Kp:()=>v,SG:()=>b,W7:()=>p,WX:()=>w,fz:()=>m,qC:()=>f,rY:()=>y,sk:()=>d,yi:()=>g});var n=r(96540),i=r(49082),A=r(66426),o=r(36189),a=r(5180),s=r(12070),u=r(76461),c=r(28482),l=r(8813);function f(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var d=()=>{var e,t=(0,s.r)(),r=(0,i.G)(o.Ds),n=(0,i.G)(u.U),A=null===(e=(0,i.G)(u.C))||void 0===e?void 0:e.padding;return t&&n&&A?{width:n.width-A.left-A.right,height:n.height-A.top-A.bottom,x:A.left,y:A.top}:r},h={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},p=()=>{var e;return null!==(e=(0,i.G)(o.HZ))&&void 0!==e?e:h},g=()=>(0,i.G)(a.Lp),y=()=>(0,i.G)(a.A$),v=()=>(0,i.G)(e=>e.layout.margin),m=e=>e.layout.layoutType,w=()=>(0,i.G)(m),b=()=>void 0!==w(),B=e=>{var t=(0,i.j)(),r=(0,s.r)(),{width:o,height:a}=e,u=(0,c.w)(),f=o,d=a;return u&&(f=u.width>0?u.width:o,d=u.height>0?u.height:a),(0,n.useEffect)(()=>{!r&&(0,l.F)(f)&&(0,l.F)(d)&&t((0,A.gX)({width:f,height:d}))},[t,r,f,d]),null}},19495(e,t,r){"use strict";r.d(t,{I:()=>n});var n=(e,t)=>{if(e&&t)return null!=e&&e.reversed?[t[1],t[0]]:t}},19504(e,t,r){"use strict";r.d(t,{A:()=>d});var n,i=r(73872),A=r(43407),o=r(31327),a=r(58503),s=r(32993),u=r(7758),c=r(93234),l=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const d=function(e){function t(t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.call(this)||this;return n.usingCheckDigit=t,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return l(t,e),t.prototype.decodeRow=function(e,r,n){var o,s,l,d,h=this.counters;h.fill(0),this.decodeRowResult="";var p,g,y=t.findAsteriskPattern(r,h),v=r.getNextSet(y[1]),m=r.getSize();do{t.recordPattern(r,v,h);var w=t.toNarrowWidePattern(h);if(w<0)throw new a.A;p=t.patternToChar(w),this.decodeRowResult+=p,g=v;try{for(var b=(o=void 0,f(h)),B=b.next();!B.done;B=b.next()){v+=B.value}}catch(e){o={error:e}}finally{try{B&&!B.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}v=r.getNextSet(v)}while("*"!==p);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var C,E=0;try{for(var S=f(h),I=S.next();!I.done;I=S.next()){E+=I.value}}catch(e){l={error:e}}finally{try{I&&!I.done&&(d=S.return)&&d.call(S)}finally{if(l)throw l.error}}if(v!==m&&2*(v-g-E)<E)throw new a.A;if(this.usingCheckDigit){for(var O=this.decodeRowResult.length-1,F=0,_=0;_<O;_++)F+=t.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(_));if(this.decodeRowResult.charAt(O)!==t.ALPHABET_STRING.charAt(F%43))throw new A.A;this.decodeRowResult=this.decodeRowResult.substring(0,O)}if(0===this.decodeRowResult.length)throw new a.A;C=this.extendedMode?t.decodeExtended(this.decodeRowResult):this.decodeRowResult;var x=(y[1]+y[0])/2,U=g+E/2;return new u.A(C,null,0,[new c.A(x,e),new c.A(U,e)],i.A.CODE_39,(new Date).getTime())},t.findAsteriskPattern=function(e,r){for(var n=e.getSize(),i=e.getNextSet(0),A=0,o=i,s=!1,u=r.length,c=i;c<n;c++)if(e.get(c)!==s)r[A]++;else{if(A===u-1){if(this.toNarrowWidePattern(r)===t.ASTERISK_ENCODING&&e.isRange(Math.max(0,o-Math.floor((c-o)/2)),o,!1))return[o,c];o+=r[0]+r[1],r.copyWithin(0,2,2+A-1),r[A-1]=0,r[A]=0,A--}else A++;r[A]=1,s=!s}throw new a.A},t.toNarrowWidePattern=function(e){var t,r,n,i=e.length,A=0;do{var o=2147483647;try{for(var a=(t=void 0,f(e)),s=a.next();!s.done;s=a.next()){(d=s.value)<o&&d>A&&(o=d)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}A=o,n=0;for(var u=0,c=0,l=0;l<i;l++){(d=e[l])>A&&(c|=1<<i-1-l,n++,u+=d)}if(3===n){for(l=0;l<i&&n>0;l++){var d;if((d=e[l])>A&&(n--,2*d>=u))return-1}return c}}while(n>3);return-1},t.patternToChar=function(e){for(var r=0;r<t.CHARACTER_ENCODINGS.length;r++)if(t.CHARACTER_ENCODINGS[r]===e)return t.ALPHABET_STRING.charAt(r);if(e===t.ASTERISK_ENCODING)return"*";throw new a.A},t.decodeExtended=function(e){for(var t=e.length,r="",n=0;n<t;n++){var i=e.charAt(n);if("+"===i||"$"===i||"%"===i||"/"===i){var A=e.charAt(n+1),a="\0";switch(i){case"+":if(!(A>="A"&&A<="Z"))throw new o.A;a=String.fromCharCode(A.charCodeAt(0)+32);break;case"$":if(!(A>="A"&&A<="Z"))throw new o.A;a=String.fromCharCode(A.charCodeAt(0)-64);break;case"%":if(A>="A"&&A<="E")a=String.fromCharCode(A.charCodeAt(0)-38);else if(A>="F"&&A<="J")a=String.fromCharCode(A.charCodeAt(0)-11);else if(A>="K"&&A<="O")a=String.fromCharCode(A.charCodeAt(0)+16);else if(A>="P"&&A<="T")a=String.fromCharCode(A.charCodeAt(0)+43);else if("U"===A)a="\0";else if("V"===A)a="@";else if("W"===A)a="`";else{if("X"!==A&&"Y"!==A&&"Z"!==A)throw new o.A;a=""}break;case"/":if(A>="A"&&A<="O")a=String.fromCharCode(A.charCodeAt(0)-32);else{if("Z"!==A)throw new o.A;a=":"}}r+=a,n++}else r+=i}return r},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(s.A)},19538(e,t,r){"use strict";r.d(t,{Be:()=>F,Cv:()=>M,D0:()=>D,Gl:()=>_,Dc:()=>P});var n=r(25508),i=r(5180),A=r(36189),o=r(14040),a=r(59744),s=r(60648),u=!0,c=0,l=!1,f="auto",d=!0,h="category",p=(s.I.axis,!1),g=!0,y=0,v="auto",m=!0,w=5,b="number",B=(s.I.axis,r(19495)),C=r(19287),E={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:c,includeHidden:!1,name:void 0,reversed:l,scale:f,tick:d,tickCount:void 0,ticks:void 0,type:h,unit:void 0},S={allowDataOverflow:p,allowDecimals:!1,allowDuplicatedCategory:g,dataKey:void 0,domain:void 0,id:y,includeHidden:!1,name:void 0,reversed:!1,scale:v,tick:m,tickCount:w,ticks:void 0,type:b,unit:void 0},I={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:u,dataKey:void 0,domain:void 0,id:c,includeHidden:!1,name:void 0,reversed:!1,scale:f,tick:d,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},O={allowDataOverflow:p,allowDecimals:!1,allowDuplicatedCategory:g,dataKey:void 0,domain:void 0,id:y,includeHidden:!1,name:void 0,reversed:!1,scale:v,tick:m,tickCount:w,ticks:void 0,type:"category",unit:void 0},F=(e,t)=>null!=e.polarAxis.angleAxis[t]?e.polarAxis.angleAxis[t]:"radial"===e.layout.layoutType?I:E,_=(e,t)=>null!=e.polarAxis.radiusAxis[t]?e.polarAxis.radiusAxis[t]:"radial"===e.layout.layoutType?O:S,x=e=>e.polarOptions,U=(0,n.Mz)([i.Lp,i.A$,A.HZ],o.lY),Q=(0,n.Mz)([x,U],(e,t)=>{if(null!=e)return(0,a.F4)(e.innerRadius,t,0)}),T=(0,n.Mz)([x,U],(e,t)=>{if(null!=e)return(0,a.F4)(e.outerRadius,t,.8*t)}),M=(0,n.Mz)([x],e=>{if(null==e)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]}),P=((0,n.Mz)([F,M],B.I),(0,n.Mz)([U,Q,T],(e,t,r)=>{if(null!=e&&null!=t&&null!=r)return[t,r]})),D=((0,n.Mz)([_,P],B.I),(0,n.Mz)([C.fz,x,Q,T,i.Lp,i.A$],(e,t,r,n,i,A)=>{if(("centric"===e||"radial"===e)&&null!=t&&null!=r&&null!=n){var{cx:o,cy:s,startAngle:u,endAngle:c}=t;return{cx:(0,a.F4)(o,i,i/2),cy:(0,a.F4)(s,A,A/2),innerRadius:r,outerRadius:n,startAngle:u,endAngle:c,clockWise:!1}}}))},19794(e,t,r){"use strict";r.d(t,{J:()=>A,U:()=>i});var n=(0,r(65307).Z0)({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:i}=n.actions,A=n.reducer},19797(e,t,r){"use strict";r.d(t,{A:()=>s,_:()=>u});var n=r(96540),i=r(12070),A=r(19287),o=r(49082),a=r(91283);function s(e){var{legendPayload:t}=e,r=(0,o.j)(),A=(0,i.r)(),s=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{A||(null===s.current?r((0,a.Lx)(t)):s.current!==t&&r((0,a.c5)({prev:s.current,next:t})),s.current=t)},[r,A,t]),(0,n.useLayoutEffect)(()=>()=>{s.current&&(r((0,a.u3)(s.current)),s.current=null)},[r]),null}function u(e){var{legendPayload:t}=e,r=(0,o.j)(),i=(0,o.G)(A.fz),s=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{"centric"!==i&&"radial"!==i||(null===s.current?r((0,a.Lx)(t)):s.current!==t&&r((0,a.c5)({prev:s.current,next:t})),s.current=t)},[r,i,t]),(0,n.useLayoutEffect)(()=>()=>{s.current&&(r((0,a.u3)(s.current)),s.current=null)},[r]),null}},19809(e,t,r){"use strict";r.d(t,{i:()=>a});var n=r(74531);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=(e,t,r,i)=>{if(null==t)return n.k_;var o=function(e,t,r){return"axis"===t?"click"===r?e.axisInteraction.click:e.axisInteraction.hover:"click"===r?e.itemInteraction.click:e.itemInteraction.hover}(e,t,r);if(null==o)return n.k_;if(o.active)return o;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&null!=e.syncInteraction.index)return e.syncInteraction;var a=!0===e.settings.active;if(null!=o.index){if(a)return A(A({},o),{},{active:!0})}else if(null!=i)return{active:!0,coordinate:void 0,dataKey:void 0,index:i,graphicalItemId:void 0};return A(A({},n.k_),{},{coordinate:o.coordinate})}},19888(e,t,r){"use strict";e.exports=r(58493)},19900(e,t,r){"use strict";var n,i=r(92819),A=r(44388),o=r(75359),a=r(57149),s=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});!function(e){function t(t,r,n,i,A,o,s,u){var c=e.call(this,o,s)||this;if(c.yuvData=t,c.dataWidth=r,c.dataHeight=n,c.left=i,c.top=A,i+o>r||A+s>n)throw new a.A("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(o,s),c}s(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new a.A("Requested row is outside the image: "+e);var r=this.getWidth();(null==t||t.length<r)&&(t=new Uint8ClampedArray(r));var n=(e+this.top)*this.dataWidth+this.left;return i.A.arraycopy(this.yuvData,n,t,0,r),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;var r=e*t,n=new Uint8ClampedArray(r),A=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return i.A.arraycopy(this.yuvData,A,n,0,r),n;for(var o=0;o<t;o++){var a=o*e;i.A.arraycopy(this.yuvData,A,n,a,e),A+=this.dataWidth}return n},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,r,n,i){return new t(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+r,n,i,!1)},t.prototype.renderThumbnail=function(){for(var e=this.getWidth()/t.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/t.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(e*r),i=this.yuvData,A=this.top*this.dataWidth+this.left,o=0;o<r;o++){for(var a=o*e,s=0;s<e;s++){var u=255&i[A+s*t.THUMBNAIL_SCALE_FACTOR];n[a+s]=4278190080|65793*u}A+=this.dataWidth*t.THUMBNAIL_SCALE_FACTOR}return n},t.prototype.getThumbnailWidth=function(){return this.getWidth()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.getThumbnailHeight=function(){return this.getHeight()/t.THUMBNAIL_SCALE_FACTOR},t.prototype.reverseHorizontal=function(e,t){for(var r=this.yuvData,n=0,i=this.top*this.dataWidth+this.left;n<t;n++,i+=this.dataWidth)for(var A=i+e/2,o=i,a=i+e-1;o<A;o++,a--){var s=r[o];r[o]=r[a],r[a]=s}},t.prototype.invert=function(){return new o.A(this)},t.THUMBNAIL_SCALE_FACTOR=2}(A.A)},20025(e,t,r){e.exports=r(21334).last},20354(e){e.exports=function(){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};function n(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,A){function o(e){try{s(n.next(e))}catch(e){A(e)}}function a(e){try{s(n.throw(e))}catch(e){A(e)}}function s(e){e.done?r(e.value):i(e.value).then(o,a)}s((n=n.apply(e,t||[])).next())})}function i(e,t){var r,n,i,A,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return A={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function a(e){return function(t){return s([e,t])}}function s(A){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&A[0]?n.return:A[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,A[1])).done)return i;switch(n=0,i&&(A=[2&A[0],i.value]),A[0]){case 0:case 1:i=A;break;case 4:return o.label++,{value:A[1],done:!1};case 5:o.label++,n=A[1],A=[0];continue;case 7:A=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==A[0]&&2!==A[0])){o=0;continue}if(3===A[0]&&(!i||A[1]>i[0]&&A[1]<i[3])){o.label=A[1];break}if(6===A[0]&&o.label<i[1]){o.label=i[1],i=A;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(A);break}i[2]&&o.ops.pop(),o.trys.pop();continue}A=t.call(e,o)}catch(e){A=[6,e],n=0}finally{r=i=0}if(5&A[0])throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}}function A(e,t,r){if(r||2===arguments.length)for(var n,i=0,A=t.length;i<A;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||t)}for(var o=function(){function e(e,t,r,n){this.left=e,this.top=t,this.width=r,this.height=n}return e.prototype.add=function(t,r,n,i){return new e(this.left+t,this.top+r,this.width+n,this.height+i)},e.fromClientRect=function(t,r){return new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height)},e.fromDOMRectList=function(t,r){var n=Array.from(r).find(function(e){return 0!==e.width});return n?new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),a=function(e,t){return o.fromClientRect(e,t.getBoundingClientRect())},s=function(e){var t=e.body,r=e.documentElement;if(!t||!r)throw new Error("Unable to get document size");var n=Math.max(Math.max(t.scrollWidth,r.scrollWidth),Math.max(t.offsetWidth,r.offsetWidth),Math.max(t.clientWidth,r.clientWidth)),i=Math.max(Math.max(t.scrollHeight,r.scrollHeight),Math.max(t.offsetHeight,r.offsetHeight),Math.max(t.clientHeight,r.clientHeight));return new o(0,0,n,i)},u=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var A=e.charCodeAt(r++);56320==(64512&A)?t.push(((1023&i)<<10)+(1023&A)+65536):(t.push(i),r--)}else t.push(i)}return t},c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var n=[],i=-1,A="";++i<r;){var o=e[i];o<=65535?n.push(o):(o-=65536,n.push(55296+(o>>10),o%1024+56320)),(i+1===r||n.length>16384)&&(A+=String.fromCharCode.apply(String,n),n.length=0)}return A},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<l.length;d++)f[l.charCodeAt(d)]=d;for(var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),g=0;g<h.length;g++)p[h.charCodeAt(g)]=g;for(var y=function(e){var t,r,n,i,A,o=.75*e.length,a=e.length,s=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<a;t+=4)r=p[e.charCodeAt(t)],n=p[e.charCodeAt(t+1)],i=p[e.charCodeAt(t+2)],A=p[e.charCodeAt(t+3)],c[s++]=r<<2|n>>4,c[s++]=(15&n)<<4|i>>2,c[s++]=(3&i)<<6|63&A;return u},v=function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r.push(e[n+1]<<8|e[n]);return r},m=function(e){for(var t=e.length,r=[],n=0;n<t;n+=4)r.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return r},w=5,b=11,B=2,C=65536>>w,E=(1<<w)-1,S=C+(1024>>w)+32,I=65536>>b,O=(1<<b-w)-1,F=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},_=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},x=function(e,t){var r=y(e),n=Array.isArray(r)?m(r):new Uint32Array(r),i=Array.isArray(r)?v(r):new Uint16Array(r),A=24,o=F(i,A/2,n[4]/2),a=2===n[5]?F(i,(A+n[4])/2):_(n,Math.ceil((A+n[4])/4));return new U(n[0],n[1],n[2],n[3],o,a)},U=function(){function e(e,t,r,n,i,A){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=i,this.data=A}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>w])<<B)+(e&E),this.data[t];if(e<=65535)return t=((t=this.index[C+(e-55296>>w)])<<B)+(e&E),this.data[t];if(e<this.highStart)return t=S-I+(e>>b),t=this.index[t],t+=e>>w&O,t=((t=this.index[t])<<B)+(e&E),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T="undefined"==typeof Uint8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QWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc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wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAc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AlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAF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AeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQ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wAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBX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UABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUAB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AAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAU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LAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4A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wBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),_e=[ce,ge],xe=[D,k,N,L],Ue=[K,j],Qe=[ae,oe],Te=xe.concat(Ue),Me=[ve,me,we,he,pe],Pe=[Y,W],De=function(e,t){void 0===t&&(t="strict");var r=[],n=[],i=[];return e.forEach(function(e,A){var o=Fe.get(e);if(o>P?(i.push(!0),o-=P):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return n.push(A),r.push(Z);if(o===R||o===z){if(0===A)return n.push(A),r.push(ce);var a=r[A-1];return-1===Te.indexOf(a)?(n.push(n[A-1]),r.push(a)):(n.push(A),r.push(ce))}return n.push(A),o===le?r.push("strict"===t?te:ye):o===Be||o===ue?r.push(ce):o===Ce?e>=131072&&e<=196605||e>=196608&&e<=262141?r.push(ye):r.push(ce):void r.push(o)}),[n,r,i]},ke=function(e,t,r,n){var i=n[r];if(Array.isArray(e)?-1!==e.indexOf(i):e===i)for(var A=r;A<=n.length;){if((s=n[++A])===t)return!0;if(s!==K)break}if(i===K)for(A=r;A>0;){var o=n[--A];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var a=r;a<=n.length;){var s;if((s=n[++a])===t)return!0;if(s!==K)break}if(o!==K)break}return!1},Ne=function(e,t){for(var r=e;r>=0;){var n=t[r];if(n!==K)return n;r--}return 0},Re=function(e,t,r,n,i){if(0===r[n])return Ie;var A=n-1;if(Array.isArray(i)&&!0===i[A])return Ie;var o=A-1,a=A+1,s=t[A],u=o>=0?t[o]:0,c=t[a];if(s===k&&c===N)return Ie;if(-1!==xe.indexOf(s))return Se;if(-1!==xe.indexOf(c))return Ie;if(-1!==Ue.indexOf(c))return Ie;if(Ne(A,t)===j)return Oe;if(Fe.get(e[A])===z)return Ie;if((s===fe||s===de)&&Fe.get(e[a])===z)return Ie;if(s===H||c===H)return Ie;if(s===V)return Ie;if(-1===[K,W,Y].indexOf(s)&&c===V)return Ie;if(-1!==[q,J,$,ie,se].indexOf(c))return Ie;if(Ne(A,t)===re)return Ie;if(ke(ne,re,A,t))return Ie;if(ke([q,J],te,A,t))return Ie;if(ke(G,G,A,t))return Ie;if(s===K)return Oe;if(s===ne||c===ne)return Ie;if(c===Z||s===Z)return Oe;if(-1!==[W,Y,te].indexOf(c)||s===X)return Ie;if(u===ge&&-1!==Pe.indexOf(s))return Ie;if(s===se&&c===ge)return Ie;if(c===ee)return Ie;if(-1!==_e.indexOf(c)&&s===Ae||-1!==_e.indexOf(s)&&c===Ae)return Ie;if(s===ae&&-1!==[ye,fe,de].indexOf(c)||-1!==[ye,fe,de].indexOf(s)&&c===oe)return Ie;if(-1!==_e.indexOf(s)&&-1!==Qe.indexOf(c)||-1!==Qe.indexOf(s)&&-1!==_e.indexOf(c))return Ie;if(-1!==[ae,oe].indexOf(s)&&(c===Ae||-1!==[re,Y].indexOf(c)&&t[a+1]===Ae)||-1!==[re,Y].indexOf(s)&&c===Ae||s===Ae&&-1!==[Ae,se,ie].indexOf(c))return Ie;if(-1!==[Ae,se,ie,q,J].indexOf(c))for(var l=A;l>=0;){if((f=t[l])===Ae)return Ie;if(-1===[se,ie].indexOf(f))break;l--}if(-1!==[ae,oe].indexOf(c))for(l=-1!==[q,J].indexOf(s)?o:A;l>=0;){var f;if((f=t[l])===Ae)return Ie;if(-1===[se,ie].indexOf(f))break;l--}if(ve===s&&-1!==[ve,me,he,pe].indexOf(c)||-1!==[me,he].indexOf(s)&&-1!==[me,we].indexOf(c)||-1!==[we,pe].indexOf(s)&&c===we)return Ie;if(-1!==Me.indexOf(s)&&-1!==[ee,oe].indexOf(c)||-1!==Me.indexOf(c)&&s===ae)return Ie;if(-1!==_e.indexOf(s)&&-1!==_e.indexOf(c))return Ie;if(s===ie&&-1!==_e.indexOf(c))return Ie;if(-1!==_e.concat(Ae).indexOf(s)&&c===re&&-1===Ee.indexOf(e[a])||-1!==_e.concat(Ae).indexOf(c)&&s===J)return Ie;if(s===be&&c===be){for(var d=r[A],h=1;d>0&&t[--d]===be;)h++;if(h%2!=0)return Ie}return s===fe&&c===de?Ie:Oe},Le=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var r=De(e,t.lineBreak),n=r[0],i=r[1],A=r[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(i=i.map(function(e){return-1!==[Ae,ce,Be].indexOf(e)?ye:e}));var o="keep-all"===t.wordBreak?A.map(function(t,r){return t&&e[r]>=19968&&e[r]<=40959}):void 0;return[n,i,o]},He=function(){function e(e,t,r,n){this.codePoints=e,this.required=t===Se,this.start=r,this.end=n}return e.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),je=function(e,t){var r=u(e),n=Le(r,t),i=n[0],A=n[1],o=n[2],a=r.length,s=0,c=0;return{next:function(){if(c>=a)return{done:!0,value:null};for(var e=Ie;c<a&&(e=Re(r,A,i,++c,o))===Ie;);if(e!==Ie||c===a){var t=new He(r,e,s,c);return s=c,{value:t,done:!1}}return{done:!0,value:null}}}},Ve=1,Ke=2,ze=4,Ge=8,We=10,Xe=47,Ye=92,Ze=9,qe=32,Je=34,$e=61,et=35,tt=36,rt=37,nt=39,it=40,At=41,ot=95,at=45,st=33,ut=60,ct=62,lt=64,ft=91,dt=93,ht=61,pt=123,gt=63,yt=125,vt=124,mt=126,wt=128,bt=65533,Bt=42,Ct=43,Et=44,St=58,It=59,Ot=46,Ft=0,_t=8,xt=11,Ut=14,Qt=31,Tt=127,Mt=-1,Pt=48,Dt=97,kt=101,Nt=102,Rt=117,Lt=122,Ht=65,jt=69,Vt=70,Kt=85,zt=90,Gt=function(e){return e>=Pt&&e<=57},Wt=function(e){return e>=55296&&e<=57343},Xt=function(e){return Gt(e)||e>=Ht&&e<=Vt||e>=Dt&&e<=Nt},Yt=function(e){return e>=Dt&&e<=Lt},Zt=function(e){return e>=Ht&&e<=zt},qt=function(e){return Yt(e)||Zt(e)},Jt=function(e){return e>=wt},$t=function(e){return e===We||e===Ze||e===qe},er=function(e){return qt(e)||Jt(e)||e===ot},tr=function(e){return er(e)||Gt(e)||e===at},rr=function(e){return e>=Ft&&e<=_t||e===xt||e>=Ut&&e<=Qt||e===Tt},nr=function(e,t){return e===Ye&&t!==We},ir=function(e,t,r){return e===at?er(t)||nr(t,r):!!er(e)||!(e!==Ye||!nr(e,t))},Ar=function(e,t,r){return e===Ct||e===at?!!Gt(t)||t===Ot&&Gt(r):Gt(e===Ot?t:e)},or=function(e){var t=0,r=1;e[t]!==Ct&&e[t]!==at||(e[t]===at&&(r=-1),t++);for(var n=[];Gt(e[t]);)n.push(e[t++]);var i=n.length?parseInt(c.apply(void 0,n),10):0;e[t]===Ot&&t++;for(var A=[];Gt(e[t]);)A.push(e[t++]);var o=A.length,a=o?parseInt(c.apply(void 0,A),10):0;e[t]!==jt&&e[t]!==kt||t++;var s=1;e[t]!==Ct&&e[t]!==at||(e[t]===at&&(s=-1),t++);for(var u=[];Gt(e[t]);)u.push(e[t++]);var l=u.length?parseInt(c.apply(void 0,u),10):0;return r*(i+a*Math.pow(10,-o))*Math.pow(10,s*l)},ar={type:2},sr={type:3},ur={type:4},cr={type:13},lr={type:8},fr={type:21},dr={type:9},hr={type:10},pr={type:11},gr={type:12},yr={type:14},vr={type:23},mr={type:1},wr={type:25},br={type:24},Br={type:26},Cr={type:27},Er={type:28},Sr={type:29},Ir={type:31},Or={type:32},Fr=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(u(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Or;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case Je:return this.consumeStringToken(Je);case et:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),n=this.peekCodePoint(2);if(tr(t)||nr(r,n)){var i=ir(t,r,n)?Ke:Ve;return{type:5,value:this.consumeName(),flags:i}}break;case tt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),cr;break;case nt:return this.consumeStringToken(nt);case it:return ar;case At:return sr;case Bt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),yr;break;case Ct:if(Ar(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Et:return ur;case at:var A=e,o=this.peekCodePoint(0),a=this.peekCodePoint(1);if(Ar(A,o,a))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(ir(A,o,a))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(o===at&&a===ct)return this.consumeCodePoint(),this.consumeCodePoint(),br;break;case Ot:if(Ar(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Xe:if(this.peekCodePoint(0)===Bt)for(this.consumeCodePoint();;){var s=this.consumeCodePoint();if(s===Bt&&(s=this.consumeCodePoint())===Xe)return this.consumeToken();if(s===Mt)return this.consumeToken()}break;case St:return Br;case It:return Cr;case ut:if(this.peekCodePoint(0)===st&&this.peekCodePoint(1)===at&&this.peekCodePoint(2)===at)return this.consumeCodePoint(),this.consumeCodePoint(),wr;break;case lt:var u=this.peekCodePoint(0),l=this.peekCodePoint(1),f=this.peekCodePoint(2);if(ir(u,l,f))return{type:7,value:this.consumeName()};break;case ft:return Er;case Ye:if(nr(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case dt:return Sr;case ht:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),lr;break;case pt:return pr;case yt:return gr;case Rt:case Kt:var d=this.peekCodePoint(0),h=this.peekCodePoint(1);return d!==Ct||!Xt(h)&&h!==gt||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case vt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),dr;if(this.peekCodePoint(0)===vt)return this.consumeCodePoint(),fr;break;case mt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),hr;break;case Mt:return Or}return $t(e)?(this.consumeWhiteSpace(),Ir):Gt(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):er(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:c(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Xt(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;t===gt&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r)return{type:30,start:parseInt(c.apply(void 0,e.map(function(e){return e===gt?Pt:e})),16),end:parseInt(c.apply(void 0,e.map(function(e){return e===gt?Vt:e})),16)};var n=parseInt(c.apply(void 0,e),16);if(this.peekCodePoint(0)===at&&Xt(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var i=[];Xt(t)&&i.length<6;)i.push(t),t=this.consumeCodePoint();return{type:30,start:n,end:parseInt(c.apply(void 0,i),16)}}return{type:30,start:n,end:n}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&this.peekCodePoint(0)===it?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===it?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Mt)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===nt||t===Je){var r=this.consumeStringToken(this.consumeCodePoint());return 0===r.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Mt||this.peekCodePoint(0)===At)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),vr)}for(;;){var n=this.consumeCodePoint();if(n===Mt||n===At)return{type:22,value:c.apply(void 0,e)};if($t(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Mt||this.peekCodePoint(0)===At?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,e)}):(this.consumeBadUrlRemnants(),vr);if(n===Je||n===nt||n===it||rr(n))return this.consumeBadUrlRemnants(),vr;if(n===Ye){if(!nr(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),vr;e.push(this.consumeEscapedCodePoint())}else e.push(n)}},e.prototype.consumeWhiteSpace=function(){for(;$t(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===At||e===Mt)return;nr(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,r="";e>0;){var n=Math.min(t,e);r+=c.apply(void 0,this._value.splice(0,n)),e-=n}return this._value.shift(),r},e.prototype.consumeStringToken=function(e){for(var t="",r=0;;){var n=this._value[r];if(n===Mt||void 0===n||n===e)return{type:0,value:t+=this.consumeStringSlice(r)};if(n===We)return this._value.splice(0,r),mr;if(n===Ye){var i=this._value[r+1];i!==Mt&&void 0!==i&&(i===We?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):nr(n,i)&&(t+=this.consumeStringSlice(r),t+=c(this.consumeEscapedCodePoint()),r=-1))}r++}},e.prototype.consumeNumber=function(){var e=[],t=ze,r=this.peekCodePoint(0);for(r!==Ct&&r!==at||e.push(this.consumeCodePoint());Gt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(r===Ot&&Gt(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Ge;Gt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),n=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((r===jt||r===kt)&&((n===Ct||n===at)&&Gt(i)||Gt(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=Ge;Gt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[or(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],n=this.peekCodePoint(0),i=this.peekCodePoint(1),A=this.peekCodePoint(2);return ir(n,i,A)?{type:15,number:t,flags:r,unit:this.consumeName()}:n===rt?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Xt(e)){for(var t=c(e);Xt(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());$t(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return 0===r||Wt(r)||r>1114111?bt:r}return e===Mt?bt:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(tr(t))e+=c(t);else{if(!nr(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),_r=function(){function e(e){this._tokens=e}return e.create=function(t){var r=new Fr;return r.write(t),new e(r.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(32===r.type||Nr(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(32===r.type||3===r.type)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?Or:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),xr=function(e){return 15===e.type},Ur=function(e){return 17===e.type},Qr=function(e){return 20===e.type},Tr=function(e){return 0===e.type},Mr=function(e,t){return Qr(e)&&e.value===t},Pr=function(e){return 31!==e.type},Dr=function(e){return 31!==e.type&&4!==e.type},kr=function(e){var t=[],r=[];return e.forEach(function(e){if(4===e.type){if(0===r.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(r),void(r=[])}31!==e.type&&r.push(e)}),r.length&&t.push(r),t},Nr=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},Rr=function(e){return 17===e.type||15===e.type},Lr=function(e){return 16===e.type||Rr(e)},Hr=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},jr={type:17,number:0,flags:ze},Vr={type:16,number:50,flags:ze},Kr={type:16,number:100,flags:ze},zr=function(e,t,r){var n=e[0],i=e[1];return[Gr(n,t),Gr(void 0!==i?i:n,r)]},Gr=function(e,t){if(16===e.type)return e.number/100*t;if(xr(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},Wr="deg",Xr="grad",Yr="rad",Zr="turn",qr={name:"angle",parse:function(e,t){if(15===t.type)switch(t.unit){case Wr:return Math.PI*t.number/180;case Xr:return Math.PI/200*t.number;case Yr:return t.number;case Zr:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")}},Jr=function(e){return 15===e.type&&(e.unit===Wr||e.unit===Xr||e.unit===Yr||e.unit===Zr)},$r=function(e){switch(e.filter(Qr).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[jr,jr];case"to top":case"bottom":return en(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[jr,Kr];case"to right":case"left":return en(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Kr,Kr];case"to bottom":case"top":return en(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Kr,jr];case"to left":case"right":return en(270)}return 0},en=function(e){return Math.PI*e/180},tn={name:"color",parse:function(e,t){if(18===t.type){var r=cn[t.name];if(void 0===r)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return r(e,t.values)}if(5===t.type){if(3===t.value.length){var n=t.value.substring(0,1),i=t.value.substring(1,2),A=t.value.substring(2,3);return An(parseInt(n+n,16),parseInt(i+i,16),parseInt(A+A,16),1)}if(4===t.value.length){n=t.value.substring(0,1),i=t.value.substring(1,2),A=t.value.substring(2,3);var o=t.value.substring(3,4);return An(parseInt(n+n,16),parseInt(i+i,16),parseInt(A+A,16),parseInt(o+o,16)/255)}if(6===t.value.length)return n=t.value.substring(0,2),i=t.value.substring(2,4),A=t.value.substring(4,6),An(parseInt(n,16),parseInt(i,16),parseInt(A,16),1);if(8===t.value.length)return n=t.value.substring(0,2),i=t.value.substring(2,4),A=t.value.substring(4,6),o=t.value.substring(6,8),An(parseInt(n,16),parseInt(i,16),parseInt(A,16),parseInt(o,16)/255)}if(20===t.type){var a=fn[t.value.toUpperCase()];if(void 0!==a)return a}return fn.TRANSPARENT}},rn=function(e){return!(255&e)},nn=function(e){var t=255&e,r=255&e>>8,n=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+n+","+r+","+t/255+")":"rgb("+i+","+n+","+r+")"},An=function(e,t,r,n){return(e<<24|t<<16|r<<8|Math.round(255*n))>>>0},on=function(e,t){if(17===e.type)return e.number;if(16===e.type){var r=3===t?1:255;return 3===t?e.number/100*r:Math.round(e.number/100*r)}return 0},an=function(e,t){var r=t.filter(Dr);if(3===r.length){var n=r.map(on),i=n[0],A=n[1],o=n[2];return An(i,A,o,1)}if(4===r.length){var a=r.map(on),s=(i=a[0],A=a[1],o=a[2],a[3]);return An(i,A,o,s)}return 0};function sn(e,t,r){return r<0&&(r+=1),r>=1&&(r-=1),r<1/6?(t-e)*r*6+e:r<.5?t:r<2/3?6*(t-e)*(2/3-r)+e:e}var un=function(e,t){var r=t.filter(Dr),n=r[0],i=r[1],A=r[2],o=r[3],a=(17===n.type?en(n.number):qr.parse(e,n))/(2*Math.PI),s=Lr(i)?i.number/100:0,u=Lr(A)?A.number/100:0,c=void 0!==o&&Lr(o)?Gr(o,1):1;if(0===s)return An(255*u,255*u,255*u,1);var l=u<=.5?u*(s+1):u+s-u*s,f=2*u-l,d=sn(f,l,a+1/3),h=sn(f,l,a),p=sn(f,l,a-1/3);return An(255*d,255*h,255*p,c)},cn={hsl:un,hsla:un,rgb:an,rgba:an},ln=function(e,t){return tn.parse(e,_r.create(t).parseComponentValue())},fn={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},dn={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Qr(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},hn={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pn=function(e,t){var r=tn.parse(e,t[0]),n=t[1];return n&&Lr(n)?{color:r,stop:n}:{color:r,stop:null}},gn=function(e,t){var r=e[0],n=e[e.length-1];null===r.stop&&(r.stop=jr),null===n.stop&&(n.stop=Kr);for(var i=[],A=0,o=0;o<e.length;o++){var a=e[o].stop;if(null!==a){var s=Gr(a,t);s>A?i.push(s):i.push(A),A=s}else i.push(null)}var u=null;for(o=0;o<i.length;o++){var c=i[o];if(null===c)null===u&&(u=o);else if(null!==u){for(var l=o-u,f=(c-i[u-1])/(l+1),d=1;d<=l;d++)i[u+d-1]=f*d;u=null}}return e.map(function(e,r){return{color:e.color,stop:Math.max(Math.min(1,i[r]/t),0)}})},yn=function(e,t,r){var n=t/2,i=r/2,A=Gr(e[0],t)-n,o=i-Gr(e[1],r);return(Math.atan2(o,A)+2*Math.PI)%(2*Math.PI)},vn=function(e,t,r){var n="number"==typeof e?e:yn(e,t,r),i=Math.abs(t*Math.sin(n))+Math.abs(r*Math.cos(n)),A=t/2,o=r/2,a=i/2,s=Math.sin(n-Math.PI/2)*a,u=Math.cos(n-Math.PI/2)*a;return[i,A-u,A+u,o-s,o+s]},mn=function(e,t){return Math.sqrt(e*e+t*t)},wn=function(e,t,r,n,i){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var A=t[0],o=t[1],a=mn(r-A,n-o);return(i?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},bn=function(e,t,r,n,i){var A=0,o=0;switch(e.size){case 0:0===e.shape?A=o=Math.min(Math.abs(t),Math.abs(t-n),Math.abs(r),Math.abs(r-i)):1===e.shape&&(A=Math.min(Math.abs(t),Math.abs(t-n)),o=Math.min(Math.abs(r),Math.abs(r-i)));break;case 2:if(0===e.shape)A=o=Math.min(mn(t,r),mn(t,r-i),mn(t-n,r),mn(t-n,r-i));else if(1===e.shape){var a=Math.min(Math.abs(r),Math.abs(r-i))/Math.min(Math.abs(t),Math.abs(t-n)),s=wn(n,i,t,r,!0),u=s[0],c=s[1];o=a*(A=mn(u-t,(c-r)/a))}break;case 1:0===e.shape?A=o=Math.max(Math.abs(t),Math.abs(t-n),Math.abs(r),Math.abs(r-i)):1===e.shape&&(A=Math.max(Math.abs(t),Math.abs(t-n)),o=Math.max(Math.abs(r),Math.abs(r-i)));break;case 3:if(0===e.shape)A=o=Math.max(mn(t,r),mn(t,r-i),mn(t-n,r),mn(t-n,r-i));else if(1===e.shape){a=Math.max(Math.abs(r),Math.abs(r-i))/Math.max(Math.abs(t),Math.abs(t-n));var l=wn(n,i,t,r,!1);u=l[0],c=l[1],o=a*(A=mn(u-t,(c-r)/a))}}return Array.isArray(e.size)&&(A=Gr(e.size[0],n),o=2===e.size.length?Gr(e.size[1],i):A),[A,o]},Bn=function(e,t){var r=en(180),n=[];return kr(t).forEach(function(t,i){if(0===i){var A=t[0];if(20===A.type&&-1!==["top","left","right","bottom"].indexOf(A.value))return void(r=$r(t));if(Jr(A))return void(r=(qr.parse(e,A)+en(270))%en(360))}var o=pn(e,t);n.push(o)}),{angle:r,stops:n,type:1}},Cn="closest-side",En="farthest-side",Sn="closest-corner",In="farthest-corner",On="circle",Fn="ellipse",_n="cover",xn="contain",Un=function(e,t){var r=0,n=3,i=[],A=[];return kr(t).forEach(function(t,o){var a=!0;if(0===o?a=t.reduce(function(e,t){if(Qr(t))switch(t.value){case"center":return A.push(Vr),!1;case"top":case"left":return A.push(jr),!1;case"right":case"bottom":return A.push(Kr),!1}else if(Lr(t)||Rr(t))return A.push(t),!1;return e},a):1===o&&(a=t.reduce(function(e,t){if(Qr(t))switch(t.value){case On:return r=0,!1;case Fn:return r=1,!1;case xn:case Cn:return n=0,!1;case En:return n=1,!1;case Sn:return n=2,!1;case _n:case In:return n=3,!1}else if(Rr(t)||Lr(t))return Array.isArray(n)||(n=[]),n.push(t),!1;return e},a)),a){var s=pn(e,t);i.push(s)}}),{size:n,shape:r,stops:i,position:A,type:2}},Qn=function(e){return 1===e.type},Tn=function(e){return 2===e.type},Mn={name:"image",parse:function(e,t){if(22===t.type){var r={url:t.value,type:0};return e.cache.addImage(t.value),r}if(18===t.type){var n=kn[t.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return n(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Pn(e){return!(20===e.type&&"none"===e.value||18===e.type&&!kn[e.name])}var Dn,kn={"linear-gradient":function(e,t){var r=en(180),n=[];return kr(t).forEach(function(t,i){if(0===i){var A=t[0];if(20===A.type&&"to"===A.value)return void(r=$r(t));if(Jr(A))return void(r=qr.parse(e,A))}var o=pn(e,t);n.push(o)}),{angle:r,stops:n,type:1}},"-moz-linear-gradient":Bn,"-ms-linear-gradient":Bn,"-o-linear-gradient":Bn,"-webkit-linear-gradient":Bn,"radial-gradient":function(e,t){var r=0,n=3,i=[],A=[];return kr(t).forEach(function(t,o){var a=!0;if(0===o){var s=!1;a=t.reduce(function(e,t){if(s)if(Qr(t))switch(t.value){case"center":return A.push(Vr),e;case"top":case"left":return A.push(jr),e;case"right":case"bottom":return A.push(Kr),e}else(Lr(t)||Rr(t))&&A.push(t);else if(Qr(t))switch(t.value){case On:return r=0,!1;case Fn:return r=1,!1;case"at":return s=!0,!1;case Cn:return n=0,!1;case _n:case En:return n=1,!1;case xn:case Sn:return n=2,!1;case In:return n=3,!1}else if(Rr(t)||Lr(t))return Array.isArray(n)||(n=[]),n.push(t),!1;return e},a)}if(a){var u=pn(e,t);i.push(u)}}),{size:n,shape:r,stops:i,position:A,type:2}},"-moz-radial-gradient":Un,"-ms-radial-gradient":Un,"-o-radial-gradient":Un,"-webkit-radial-gradient":Un,"-webkit-gradient":function(e,t){var r=en(180),n=[],i=1,A=0,o=3,a=[];return kr(t).forEach(function(t,r){var A=t[0];if(0===r){if(Qr(A)&&"linear"===A.value)return void(i=1);if(Qr(A)&&"radial"===A.value)return void(i=2)}if(18===A.type)if("from"===A.name){var o=tn.parse(e,A.values[0]);n.push({stop:jr,color:o})}else if("to"===A.name)o=tn.parse(e,A.values[0]),n.push({stop:Kr,color:o});else if("color-stop"===A.name){var a=A.values.filter(Dr);if(2===a.length){o=tn.parse(e,a[1]);var s=a[0];Ur(s)&&n.push({stop:{type:16,number:100*s.number,flags:s.flags},color:o})}}}),1===i?{angle:(r+en(180))%en(360),stops:n,type:i}:{size:o,shape:A,stops:n,position:a,type:i}}},Nn={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var r=t[0];return 20===r.type&&"none"===r.value?[]:t.filter(function(e){return Dr(e)&&Pn(e)}).map(function(t){return Mn.parse(e,t)})}},Rn={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(e){if(Qr(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Ln={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return kr(t).map(function(e){return e.filter(Lr)}).map(Hr)}},Hn={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return kr(t).map(function(e){return e.filter(Qr).map(function(e){return e.value}).join(" ")}).map(jn)}},jn=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(Dn||(Dn={}));var Vn,Kn={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return kr(t).map(function(e){return e.filter(zn)})}},zn=function(e){return Qr(e)||Lr(e)},Gn=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Wn=Gn("top"),Xn=Gn("right"),Yn=Gn("bottom"),Zn=Gn("left"),qn=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return Hr(t.filter(Lr))}}},Jn=qn("top-left"),$n=qn("top-right"),ei=qn("bottom-right"),ti=qn("bottom-left"),ri=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},ni=ri("top"),ii=ri("right"),Ai=ri("bottom"),oi=ri("left"),ai=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return xr(t)?t.number:0}}},si=ai("top"),ui=ai("right"),ci=ai("bottom"),li=ai("left"),fi={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},di={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},hi={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(Qr).reduce(function(e,t){return e|pi(t.value)},0)}},pi=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},gi={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},yi={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(Vn||(Vn={}));var vi,mi={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?Vn.STRICT:Vn.NORMAL}},wi={name:"line-height",initialValue:"normal",prefix:!1,type:4},bi=function(e,t){return Qr(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:Lr(e)?Gr(e,t):t},Bi={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Mn.parse(e,t)}},Ci={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Ei={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Si=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Ii=Si("top"),Oi=Si("right"),Fi=Si("bottom"),_i=Si("left"),xi={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(Qr).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Ui={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Qi=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Ti=Qi("top"),Mi=Qi("right"),Pi=Qi("bottom"),Di=Qi("left"),ki={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Ni={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Ri={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Mr(t[0],"none")?[]:kr(t).map(function(t){for(var r={color:fn.TRANSPARENT,offsetX:jr,offsetY:jr,blur:jr},n=0,i=0;i<t.length;i++){var A=t[i];Rr(A)?(0===n?r.offsetX=A:1===n?r.offsetY=A:r.blur=A,n++):r.color=tn.parse(e,A)}return r})}},Li={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Hi={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var r=ji[t.name];if(void 0===r)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return r(t.values)}return null}},ji={matrix:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number});return 6===t.length?t:null},matrix3d:function(e){var t=e.filter(function(e){return 17===e.type}).map(function(e){return e.number}),r=t[0],n=t[1];t[2],t[3];var i=t[4],A=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var o=t[12],a=t[13];return t[14],t[15],16===t.length?[r,n,i,A,o,a]:null}},Vi={type:16,number:50,flags:ze},Ki=[Vi,Vi],zi={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var r=t.filter(Lr);return 2!==r.length?Ki:[r[0],r[1]]}},Gi={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(vi||(vi={}));for(var Wi={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return vi.BREAK_ALL;case"keep-all":return vi.KEEP_ALL;default:return vi.NORMAL}}},Xi={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(Ur(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},Yi={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},Zi={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Ur(t)?t.number:1}},qi={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Ji={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(Qr).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},$i={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var r=[],n=[];return t.forEach(function(e){switch(e.type){case 20:case 0:r.push(e.value);break;case 17:r.push(e.number.toString());break;case 4:n.push(r.join(" ")),r.length=0}}),r.length&&n.push(r.join(" ")),n.map(function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"})}},eA={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},tA={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return Ur(t)?t.number:Qr(t)&&"bold"===t.value?700:400}},rA={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(Qr).map(function(e){return e.value})}},nA={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},iA=function(e,t){return 0!==(e&t)},AA={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var r=t[0];return 20===r.type&&"none"===r.value?[]:t}},oA={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var r=t[0];if(20===r.type&&"none"===r.value)return null;for(var n=[],i=t.filter(Pr),A=0;A<i.length;A++){var o=i[A],a=i[A+1];if(20===o.type){var s=a&&Ur(a)?a.number:1;n.push({counter:o.value,increment:s})}}return n}},aA={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var r=[],n=t.filter(Pr),i=0;i<n.length;i++){var A=n[i],o=n[i+1];if(Qr(A)&&"none"!==A.value){var a=o&&Ur(o)?o.number:0;r.push({counter:A.value,reset:a})}}return r}},sA={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(xr).map(function(t){return Yi.parse(e,t)})}},uA={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var r=t[0];if(20===r.type&&"none"===r.value)return null;var n=[],i=t.filter(Tr);if(i.length%2!=0)return null;for(var A=0;A<i.length;A+=2){var o=i[A].value,a=i[A+1].value;n.push({open:o,close:a})}return n}},cA=function(e,t,r){if(!e)return"";var n=e[Math.min(t,e.length-1)];return n?r?n.open:n.close:""},lA={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Mr(t[0],"none")?[]:kr(t).map(function(t){for(var r={color:255,offsetX:jr,offsetY:jr,blur:jr,spread:jr,inset:!1},n=0,i=0;i<t.length;i++){var A=t[i];Mr(A,"inset")?r.inset=!0:Rr(A)?(0===n?r.offsetX=A:1===n?r.offsetY=A:2===n?r.blur=A:r.spread=A,n++):r.color=tn.parse(e,A)}return r})}},fA={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var r=[0,1,2],n=[];return t.filter(Qr).forEach(function(e){switch(e.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2)}}),r.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n}},dA={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},hA={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return xr(t)?t.number:0}},pA=function(){function e(e,t){var r,n;this.animationDuration=vA(e,sA,t.animationDuration),this.backgroundClip=vA(e,dn,t.backgroundClip),this.backgroundColor=vA(e,hn,t.backgroundColor),this.backgroundImage=vA(e,Nn,t.backgroundImage),this.backgroundOrigin=vA(e,Rn,t.backgroundOrigin),this.backgroundPosition=vA(e,Ln,t.backgroundPosition),this.backgroundRepeat=vA(e,Hn,t.backgroundRepeat),this.backgroundSize=vA(e,Kn,t.backgroundSize),this.borderTopColor=vA(e,Wn,t.borderTopColor),this.borderRightColor=vA(e,Xn,t.borderRightColor),this.borderBottomColor=vA(e,Yn,t.borderBottomColor),this.borderLeftColor=vA(e,Zn,t.borderLeftColor),this.borderTopLeftRadius=vA(e,Jn,t.borderTopLeftRadius),this.borderTopRightRadius=vA(e,$n,t.borderTopRightRadius),this.borderBottomRightRadius=vA(e,ei,t.borderBottomRightRadius),this.borderBottomLeftRadius=vA(e,ti,t.borderBottomLeftRadius),this.borderTopStyle=vA(e,ni,t.borderTopStyle),this.borderRightStyle=vA(e,ii,t.borderRightStyle),this.borderBottomStyle=vA(e,Ai,t.borderBottomStyle),this.borderLeftStyle=vA(e,oi,t.borderLeftStyle),this.borderTopWidth=vA(e,si,t.borderTopWidth),this.borderRightWidth=vA(e,ui,t.borderRightWidth),this.borderBottomWidth=vA(e,ci,t.borderBottomWidth),this.borderLeftWidth=vA(e,li,t.borderLeftWidth),this.boxShadow=vA(e,lA,t.boxShadow),this.color=vA(e,fi,t.color),this.direction=vA(e,di,t.direction),this.display=vA(e,hi,t.display),this.float=vA(e,gi,t.cssFloat),this.fontFamily=vA(e,$i,t.fontFamily),this.fontSize=vA(e,eA,t.fontSize),this.fontStyle=vA(e,nA,t.fontStyle),this.fontVariant=vA(e,rA,t.fontVariant),this.fontWeight=vA(e,tA,t.fontWeight),this.letterSpacing=vA(e,yi,t.letterSpacing),this.lineBreak=vA(e,mi,t.lineBreak),this.lineHeight=vA(e,wi,t.lineHeight),this.listStyleImage=vA(e,Bi,t.listStyleImage),this.listStylePosition=vA(e,Ci,t.listStylePosition),this.listStyleType=vA(e,Ei,t.listStyleType),this.marginTop=vA(e,Ii,t.marginTop),this.marginRight=vA(e,Oi,t.marginRight),this.marginBottom=vA(e,Fi,t.marginBottom),this.marginLeft=vA(e,_i,t.marginLeft),this.opacity=vA(e,Zi,t.opacity);var i=vA(e,xi,t.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=vA(e,Ui,t.overflowWrap),this.paddingTop=vA(e,Ti,t.paddingTop),this.paddingRight=vA(e,Mi,t.paddingRight),this.paddingBottom=vA(e,Pi,t.paddingBottom),this.paddingLeft=vA(e,Di,t.paddingLeft),this.paintOrder=vA(e,fA,t.paintOrder),this.position=vA(e,Ni,t.position),this.textAlign=vA(e,ki,t.textAlign),this.textDecorationColor=vA(e,qi,null!==(r=t.textDecorationColor)&&void 0!==r?r:t.color),this.textDecorationLine=vA(e,Ji,null!==(n=t.textDecorationLine)&&void 0!==n?n:t.textDecoration),this.textShadow=vA(e,Ri,t.textShadow),this.textTransform=vA(e,Li,t.textTransform),this.transform=vA(e,Hi,t.transform),this.transformOrigin=vA(e,zi,t.transformOrigin),this.visibility=vA(e,Gi,t.visibility),this.webkitTextStrokeColor=vA(e,dA,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=vA(e,hA,t.webkitTextStrokeWidth),this.wordBreak=vA(e,Wi,t.wordBreak),this.zIndex=vA(e,Xi,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return rn(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return iA(this.display,4)||iA(this.display,33554432)||iA(this.display,268435456)||iA(this.display,536870912)||iA(this.display,67108864)||iA(this.display,134217728)},e}(),gA=function(){function e(e,t){this.content=vA(e,AA,t.content),this.quotes=vA(e,uA,t.quotes)}return e}(),yA=function(){function e(e,t){this.counterIncrement=vA(e,oA,t.counterIncrement),this.counterReset=vA(e,aA,t.counterReset)}return e}(),vA=function(e,t,r){var n=new Fr,i=null!=r?r.toString():t.initialValue;n.write(i);var A=new _r(n.read());switch(t.type){case 2:var o=A.parseComponentValue();return t.parse(e,Qr(o)?o.value:t.initialValue);case 0:return t.parse(e,A.parseComponentValue());case 1:return t.parse(e,A.parseComponentValues());case 4:return A.parseComponentValue();case 3:switch(t.format){case"angle":return qr.parse(e,A.parseComponentValue());case"color":return tn.parse(e,A.parseComponentValue());case"image":return Mn.parse(e,A.parseComponentValue());case"length":var a=A.parseComponentValue();return Rr(a)?a:jr;case"length-percentage":var s=A.parseComponentValue();return Lr(s)?s:jr;case"time":return Yi.parse(e,A.parseComponentValue())}}},mA="data-html2canvas-debug",wA=function(e){switch(e.getAttribute(mA)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},bA=function(e,t){var r=wA(e);return 1===r||t===r},BA=function(){function e(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,bA(t,3),this.styles=new pA(e,window.getComputedStyle(t,null)),ca(t)&&(this.styles.animationDuration.some(function(e){return e>0})&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=a(this.context,t),bA(t,4)&&(this.flags|=16)}return e}(),CA="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwg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AgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZU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IAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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IA)]=IA;for(var OA=function(e){var t,r,n,i,A,o=.75*e.length,a=e.length,s=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(u)?u:new Uint8Array(u);for(t=0;t<a;t+=4)r=SA[e.charCodeAt(t)],n=SA[e.charCodeAt(t+1)],i=SA[e.charCodeAt(t+2)],A=SA[e.charCodeAt(t+3)],c[s++]=r<<2|n>>4,c[s++]=(15&n)<<4|i>>2,c[s++]=(3&i)<<6|63&A;return u},FA=function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r.push(e[n+1]<<8|e[n]);return r},_A=function(e){for(var t=e.length,r=[],n=0;n<t;n+=4)r.push(e[n+3]<<24|e[n+2]<<16|e[n+1]<<8|e[n]);return r},xA=5,UA=11,QA=2,TA=65536>>xA,MA=(1<<xA)-1,PA=TA+(1024>>xA)+32,DA=65536>>UA,kA=(1<<UA-xA)-1,NA=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},RA=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},LA=function(e,t){var r=OA(e),n=Array.isArray(r)?_A(r):new Uint32Array(r),i=Array.isArray(r)?FA(r):new Uint16Array(r),A=24,o=NA(i,A/2,n[4]/2),a=2===n[5]?NA(i,(A+n[4])/2):RA(n,Math.ceil((A+n[4])/4));return new HA(n[0],n[1],n[2],n[3],o,a)},HA=function(){function e(e,t,r,n,i,A){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=i,this.data=A}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>xA])<<QA)+(e&MA),this.data[t];if(e<=65535)return t=((t=this.index[TA+(e-55296>>xA)])<<QA)+(e&MA),this.data[t];if(e<this.highStart)return t=PA-DA+(e>>UA),t=this.index[t],t+=e>>xA&kA,t=((t=this.index[t])<<QA)+(e&MA),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),jA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",VA="undefined"==typeof Uint8Array?[]:new Uint8Array(256),KA=0;KA<jA.length;KA++)VA[jA.charCodeAt(KA)]=KA;var zA,GA=1,WA=2,XA=3,YA=4,ZA=5,qA=7,JA=8,$A=9,eo=10,to=11,ro=12,no=13,io=14,Ao=15,oo=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var A=e.charCodeAt(r++);56320==(64512&A)?t.push(((1023&i)<<10)+(1023&A)+65536):(t.push(i),r--)}else t.push(i)}return t},ao=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var n=[],i=-1,A="";++i<r;){var o=e[i];o<=65535?n.push(o):(o-=65536,n.push(55296+(o>>10),o%1024+56320)),(i+1===r||n.length>16384)&&(A+=String.fromCharCode.apply(String,n),n.length=0)}return A},so=LA(CA),uo="×",co="÷",lo=function(e){return so.get(e)},fo=function(e,t,r){var n=r-2,i=t[n],A=t[r-1],o=t[r];if(A===WA&&o===XA)return uo;if(A===WA||A===XA||A===YA)return co;if(o===WA||o===XA||o===YA)return co;if(A===JA&&-1!==[JA,$A,to,ro].indexOf(o))return uo;if(!(A!==to&&A!==$A||o!==$A&&o!==eo))return uo;if((A===ro||A===eo)&&o===eo)return uo;if(o===no||o===ZA)return uo;if(o===qA)return uo;if(A===GA)return uo;if(A===no&&o===io){for(;i===ZA;)i=t[--n];if(i===io)return uo}if(A===Ao&&o===Ao){for(var a=0;i===Ao;)a++,i=t[--n];if(a%2==0)return uo}return co},ho=function(e){var t=oo(e),r=t.length,n=0,i=0,A=t.map(lo);return{next:function(){if(n>=r)return{done:!0,value:null};for(var e=uo;n<r&&(e=fo(t,A,++n))===uo;);if(e!==uo||n===r){var o=ao.apply(null,t.slice(i,n));return i=n,{value:o,done:!1}}return{done:!0,value:null}}}},po=function(e){for(var t,r=ho(e),n=[];!(t=r.next()).done;)t.value&&n.push(t.value.slice());return n},go=function(e){var t=123;if(e.createRange){var r=e.createRange();if(r.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height=t+"px",n.style.display="block",e.body.appendChild(n),r.selectNode(n);var i=r.getBoundingClientRect(),A=Math.round(i.height);if(e.body.removeChild(n),A===t)return!0}}return!1},yo=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var r=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var n=t.firstChild,i=u(n.data).map(function(e){return c(e)}),A=0,o={},a=i.every(function(e,t){r.setStart(n,A),r.setEnd(n,A+e.length);var i=r.getBoundingClientRect();A+=e.length;var a=i.x>o.x||i.y>o.y;return o=i,0===t||a});return e.body.removeChild(t),a},vo=function(){return void 0!==(new Image).crossOrigin},mo=function(){return"string"==typeof(new XMLHttpRequest).responseType},wo=function(e){var t=new Image,r=e.createElement("canvas"),n=r.getContext("2d");if(!n)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(t,0,0),r.toDataURL()}catch(e){return!1}return!0},bo=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Bo=function(e){var t=e.createElement("canvas"),r=100;t.width=r,t.height=r;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,r,r);var i=new Image,A=t.toDataURL();i.src=A;var o=Co(r,r,0,0,i);return n.fillStyle="red",n.fillRect(0,0,r,r),Eo(o).then(function(t){n.drawImage(t,0,0);var i=n.getImageData(0,0,r,r).data;n.fillStyle="red",n.fillRect(0,0,r,r);var o=e.createElement("div");return o.style.backgroundImage="url("+A+")",o.style.height=r+"px",bo(i)?Eo(Co(r,r,0,0,o)):Promise.reject(!1)}).then(function(e){return n.drawImage(e,0,0),bo(n.getImageData(0,0,r,r).data)}).catch(function(){return!1})},Co=function(e,t,r,n,i){var A="http://www.w3.org/2000/svg",o=document.createElementNS(A,"svg"),a=document.createElementNS(A,"foreignObject");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",r.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(a),a.appendChild(i),o},Eo=function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){return t(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},So={get SUPPORT_RANGE_BOUNDS(){var e=go(document);return Object.defineProperty(So,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=So.SUPPORT_RANGE_BOUNDS&&yo(document);return Object.defineProperty(So,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=wo(document);return Object.defineProperty(So,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?Bo(document):Promise.resolve(!1);return Object.defineProperty(So,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=vo();return Object.defineProperty(So,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=mo();return Object.defineProperty(So,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(So,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(So,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Io=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),Oo=function(e,t,r,n){var i=Qo(t,r),A=[],a=0;return i.forEach(function(t){if(r.textDecorationLine.length||t.trim().length>0)if(So.SUPPORT_RANGE_BOUNDS){var i=_o(n,a,t.length).getClientRects();if(i.length>1){var s=xo(t),u=0;s.forEach(function(t){A.push(new Io(t,o.fromDOMRectList(e,_o(n,u+a,t.length).getClientRects()))),u+=t.length})}else A.push(new Io(t,o.fromDOMRectList(e,i)))}else{var c=n.splitText(t.length);A.push(new Io(t,Fo(e,n))),n=c}else So.SUPPORT_RANGE_BOUNDS||(n=n.splitText(t.length));a+=t.length}),A},Fo=function(e,t){var r=t.ownerDocument;if(r){var n=r.createElement("html2canvaswrapper");n.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(n,t);var A=a(e,n);return n.firstChild&&i.replaceChild(n.firstChild,n),A}}return o.EMPTY},_o=function(e,t,r){var n=e.ownerDocument;if(!n)throw new Error("Node has no owner document");var i=n.createRange();return i.setStart(e,t),i.setEnd(e,t+r),i},xo=function(e){if(So.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(e){return e.segment})}return po(e)},Uo=function(e,t){if(So.SUPPORT_NATIVE_TEXT_SEGMENTATION){var r=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(r.segment(e)).map(function(e){return e.segment})}return Mo(e,t)},Qo=function(e,t){return 0!==t.letterSpacing?xo(e):Uo(e,t)},To=[32,160,4961,65792,65793,4153,4241],Mo=function(e,t){for(var r,n=je(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),i=[],A=function(){if(r.value){var e=r.value.slice(),t=u(e),n="";t.forEach(function(e){-1===To.indexOf(e)?n+=c(e):(n.length&&i.push(n),i.push(c(e)),n="")}),n.length&&i.push(n)}};!(r=n.next()).done;)A();return i},Po=function(){function e(e,t,r){this.text=Do(t.data,r.textTransform),this.textBounds=Oo(e,this.text,r,t)}return e}(),Do=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(ko,No);case 2:return e.toUpperCase();default:return e}},ko=/(^|\s|:|-|\(|\))([a-z])/g,No=function(e,t,r){return e.length>0?t+r.toUpperCase():e},Ro=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.src=r.currentSrc||r.src,n.intrinsicWidth=r.naturalWidth,n.intrinsicHeight=r.naturalHeight,n.context.cache.addImage(n.src),n}return t(r,e),r}(BA),Lo=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.canvas=r,n.intrinsicWidth=r.width,n.intrinsicHeight=r.height,n}return t(r,e),r}(BA),Ho=function(e){function r(t,r){var n=e.call(this,t,r)||this,i=new XMLSerializer,A=a(t,r);return r.setAttribute("width",A.width+"px"),r.setAttribute("height",A.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(r)),n.intrinsicWidth=r.width.baseVal.value,n.intrinsicHeight=r.height.baseVal.value,n.context.cache.addImage(n.svg),n}return t(r,e),r}(BA),jo=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.value=r.value,n}return t(r,e),r}(BA),Vo=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.start=r.start,n.reversed="boolean"==typeof r.reversed&&!0===r.reversed,n}return t(r,e),r}(BA),Ko=[{type:15,flags:0,unit:"px",number:3}],zo=[{type:16,flags:0,number:50}],Go=function(e){return e.width>e.height?new o(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new o(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},Wo=function(e){var t=e.type===Zo?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t},Xo="checkbox",Yo="radio",Zo="password",qo=707406591,Jo=function(e){function r(t,r){var n=e.call(this,t,r)||this;switch(n.type=r.type.toLowerCase(),n.checked=r.checked,n.value=Wo(r),n.type!==Xo&&n.type!==Yo||(n.styles.backgroundColor=3739148031,n.styles.borderTopColor=n.styles.borderRightColor=n.styles.borderBottomColor=n.styles.borderLeftColor=2779096575,n.styles.borderTopWidth=n.styles.borderRightWidth=n.styles.borderBottomWidth=n.styles.borderLeftWidth=1,n.styles.borderTopStyle=n.styles.borderRightStyle=n.styles.borderBottomStyle=n.styles.borderLeftStyle=1,n.styles.backgroundClip=[0],n.styles.backgroundOrigin=[0],n.bounds=Go(n.bounds)),n.type){case Xo:n.styles.borderTopRightRadius=n.styles.borderTopLeftRadius=n.styles.borderBottomRightRadius=n.styles.borderBottomLeftRadius=Ko;break;case Yo:n.styles.borderTopRightRadius=n.styles.borderTopLeftRadius=n.styles.borderBottomRightRadius=n.styles.borderBottomLeftRadius=zo}return n}return t(r,e),r}(BA),$o=function(e){function r(t,r){var n=e.call(this,t,r)||this,i=r.options[r.selectedIndex||0];return n.value=i&&i.text||"",n}return t(r,e),r}(BA),ea=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.value=r.value,n}return t(r,e),r}(BA),ta=function(e){function r(t,r){var n=e.call(this,t,r)||this;n.src=r.src,n.width=parseInt(r.width,10)||0,n.height=parseInt(r.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){n.tree=Aa(t,r.contentWindow.document.documentElement);var i=r.contentWindow.document.documentElement?ln(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):fn.TRANSPARENT,A=r.contentWindow.document.body?ln(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):fn.TRANSPARENT;n.backgroundColor=rn(i)?rn(A)?n.styles.backgroundColor:A:i}}catch(e){}return n}return t(r,e),r}(BA),ra=["OL","UL","MENU"],na=function(e,t,r,n){for(var i=t.firstChild,A=void 0;i;i=A)if(A=i.nextSibling,sa(i)&&i.data.trim().length>0)r.textNodes.push(new Po(e,i,r.styles));else if(ua(i))if(Ia(i)&&i.assignedNodes)i.assignedNodes().forEach(function(t){return na(e,t,r,n)});else{var o=ia(e,i);o.styles.isVisible()&&(oa(i,o,n)?o.flags|=4:aa(o.styles)&&(o.flags|=2),-1!==ra.indexOf(i.tagName)&&(o.flags|=8),r.elements.push(o),i.slot,i.shadowRoot?na(e,i.shadowRoot,o,n):Ea(i)||ga(i)||Sa(i)||na(e,i,o,n))}},ia=function(e,t){return wa(t)?new Ro(e,t):va(t)?new Lo(e,t):ga(t)?new Ho(e,t):fa(t)?new jo(e,t):da(t)?new Vo(e,t):ha(t)?new Jo(e,t):Sa(t)?new $o(e,t):Ea(t)?new ea(e,t):ba(t)?new ta(e,t):new BA(e,t)},Aa=function(e,t){var r=ia(e,t);return r.flags|=4,na(e,t,r,r),r},oa=function(e,t,r){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ya(e)&&r.styles.isTransparent()},aa=function(e){return e.isPositioned()||e.isFloating()},sa=function(e){return e.nodeType===Node.TEXT_NODE},ua=function(e){return e.nodeType===Node.ELEMENT_NODE},ca=function(e){return ua(e)&&void 0!==e.style&&!la(e)},la=function(e){return"object"==typeof e.className},fa=function(e){return"LI"===e.tagName},da=function(e){return"OL"===e.tagName},ha=function(e){return"INPUT"===e.tagName},pa=function(e){return"HTML"===e.tagName},ga=function(e){return"svg"===e.tagName},ya=function(e){return"BODY"===e.tagName},va=function(e){return"CANVAS"===e.tagName},ma=function(e){return"VIDEO"===e.tagName},wa=function(e){return"IMG"===e.tagName},ba=function(e){return"IFRAME"===e.tagName},Ba=function(e){return"STYLE"===e.tagName},Ca=function(e){return"SCRIPT"===e.tagName},Ea=function(e){return"TEXTAREA"===e.tagName},Sa=function(e){return"SELECT"===e.tagName},Ia=function(e){return"SLOT"===e.tagName},Oa=function(e){return e.tagName.indexOf("-")>0},Fa=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},e.prototype.parse=function(e){var t=this,r=e.counterIncrement,n=e.counterReset,i=!0;null!==r&&r.forEach(function(e){var r=t.counters[e.counter];r&&0!==e.increment&&(i=!1,r.length||r.push(1),r[Math.max(0,r.length-1)]+=e.increment)});var A=[];return i&&n.forEach(function(e){var r=t.counters[e.counter];A.push(e.counter),r||(r=t.counters[e.counter]=[]),r.push(e.reset)}),A},e}(),_a={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},xa={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Ua={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Qa={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Ta=function(e,t,r,n,i,A){return e<t||e>r?Ga(e,i,A.length>0):n.integers.reduce(function(t,r,i){for(;e>=r;)e-=r,t+=n.values[i];return t},"")+A},Ma=function(e,t,r,n){var i="";do{r||e--,i=n(e)+i,e/=t}while(e*t>=t);return i},Pa=function(e,t,r,n,i){var A=r-t+1;return(e<0?"-":"")+(Ma(Math.abs(e),A,n,function(e){return c(Math.floor(e%A)+t)})+i)},Da=function(e,t,r){void 0===r&&(r=". ");var n=t.length;return Ma(Math.abs(e),n,!1,function(e){return t[Math.floor(e%n)]})+r},ka=1,Na=2,Ra=4,La=8,Ha=function(e,t,r,n,i,A){if(e<-9999||e>9999)return Ga(e,4,i.length>0);var o=Math.abs(e),a=i;if(0===o)return t[0]+a;for(var s=0;o>0&&s<=4;s++){var u=o%10;0===u&&iA(A,ka)&&""!==a?a=t[u]+a:u>1||1===u&&0===s||1===u&&1===s&&iA(A,Na)||1===u&&1===s&&iA(A,Ra)&&e>100||1===u&&s>1&&iA(A,La)?a=t[u]+(s>0?r[s-1]:"")+a:1===u&&s>0&&(a=r[s-1]+a),o=Math.floor(o/10)}return(e<0?n:"")+a},ja="十百千萬",Va="拾佰仟萬",Ka="マイナス",za="마이너스",Ga=function(e,t,r){var n=r?". ":"",i=r?"、":"",A=r?", ":"",o=r?" ":"";switch(t){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var a=Pa(e,48,57,!0,n);return a.length<4?"0"+a:a;case 4:return Da(e,"〇一二三四五六七八九",i);case 6:return Ta(e,1,3999,_a,3,n).toLowerCase();case 7:return Ta(e,1,3999,_a,3,n);case 8:return Pa(e,945,969,!1,n);case 9:return Pa(e,97,122,!1,n);case 10:return Pa(e,65,90,!1,n);case 11:return Pa(e,1632,1641,!0,n);case 12:case 49:return Ta(e,1,9999,xa,3,n);case 35:return Ta(e,1,9999,xa,3,n).toLowerCase();case 13:return Pa(e,2534,2543,!0,n);case 14:case 30:return Pa(e,6112,6121,!0,n);case 15:return Da(e,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return Da(e,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Ha(e,"零一二三四五六七八九",ja,"負",i,Na|Ra|La);case 47:return Ha(e,"零壹貳參肆伍陸柒捌玖",Va,"負",i,ka|Na|Ra|La);case 42:return Ha(e,"零一二三四五六七八九",ja,"负",i,Na|Ra|La);case 41:return Ha(e,"零壹贰叁肆伍陆柒捌玖",Va,"负",i,ka|Na|Ra|La);case 26:return Ha(e,"〇一二三四五六七八九","十百千万",Ka,i,0);case 25:return Ha(e,"零壱弐参四伍六七八九","拾百千万",Ka,i,ka|Na|Ra);case 31:return Ha(e,"영일이삼사오육칠팔구","십백천만",za,A,ka|Na|Ra);case 33:return Ha(e,"零一二三四五六七八九","十百千萬",za,A,0);case 32:return Ha(e,"零壹貳參四五六七八九","拾百千",za,A,ka|Na|Ra);case 18:return Pa(e,2406,2415,!0,n);case 20:return Ta(e,1,19999,Qa,3,n);case 21:return Pa(e,2790,2799,!0,n);case 22:return Pa(e,2662,2671,!0,n);case 22:return Ta(e,1,10999,Ua,3,n);case 23:return Da(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Da(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Pa(e,3302,3311,!0,n);case 28:return Da(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return Da(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return Pa(e,3792,3801,!0,n);case 37:return Pa(e,6160,6169,!0,n);case 38:return Pa(e,4160,4169,!0,n);case 39:return Pa(e,2918,2927,!0,n);case 40:return Pa(e,1776,1785,!0,n);case 43:return Pa(e,3046,3055,!0,n);case 44:return Pa(e,3174,3183,!0,n);case 45:return Pa(e,3664,3673,!0,n);case 46:return Pa(e,3872,3881,!0,n);default:return Pa(e,48,57,!0,n)}},Wa="data-html2canvas-ignore",Xa=function(){function e(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new Fa,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var r=this,A=Za(e,t);if(!A.contentWindow)return Promise.reject("Unable to find iframe window");var o=e.defaultView.pageXOffset,a=e.defaultView.pageYOffset,s=A.contentWindow,u=s.document,c=$a(A).then(function(){return n(r,void 0,void 0,function(){var e,r;return i(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(is),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-t.left,s.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(r=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:u.fonts&&u.fonts.ready?[4,u.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,Ja(u)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then(function(){return e(u,r)}).then(function(){return A})]:[2,A]}})})});return u.open(),u.write(rs(document.doctype)+"<html></html>"),ns(this.referenceElement.ownerDocument,o,a),u.replaceChild(u.adoptNode(this.documentElement),u.documentElement),u.close(),c},e.prototype.createElementClone=function(e){if(bA(e,2),va(e))return this.createCanvasClone(e);if(ma(e))return this.createVideoClone(e);if(Ba(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return wa(t)&&(wa(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),Oa(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return ts(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e},""),n=e.cloneNode(!1);return n.textContent=r,n}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var i=e.getContext("2d"),A=n.getContext("2d");if(A)if(!this.options.allowTaint&&i)A.putImageData(i.getImageData(0,0,e.width,e.height),0,0);else{var o=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(o){var a=o.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}A.drawImage(e,0,0)}return n}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return n},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var n=e.ownerDocument.createElement("canvas");return n.width=e.offsetWidth,n.height=e.offsetHeight,n},e.prototype.appendChildNode=function(e,t,r){ua(t)&&(Ca(t)||t.hasAttribute(Wa)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&ua(t)&&Ba(t)||e.appendChild(this.cloneNode(t,r))},e.prototype.cloneChildNodes=function(e,t,r){for(var n=this,i=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;i;i=i.nextSibling)if(ua(i)&&Ia(i)&&"function"==typeof i.assignedNodes){var A=i.assignedNodes();A.length&&A.forEach(function(e){return n.appendChildNode(t,e,r)})}else this.appendChildNode(t,i,r)},e.prototype.cloneNode=function(e,t){if(sa(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&ua(e)&&(ca(e)||la(e))){var n=this.createElementClone(e);n.style.transitionProperty="none";var i=r.getComputedStyle(e),A=r.getComputedStyle(e,":before"),o=r.getComputedStyle(e,":after");this.referenceElement===e&&ca(n)&&(this.clonedReferenceElement=n),ya(n)&&cs(n);var a=this.counters.parse(new yA(this.context,i)),s=this.resolvePseudoContent(e,n,A,zA.BEFORE);Oa(e)&&(t=!0),ma(e)||this.cloneChildNodes(e,n,t),s&&n.insertBefore(s,n.firstChild);var u=this.resolvePseudoContent(e,n,o,zA.AFTER);return u&&n.appendChild(u),this.counters.pop(a),(i&&(this.options.copyStyles||la(e))&&!ba(e)||t)&&ts(i,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(Ea(e)||Sa(e))&&(Ea(n)||Sa(n))&&(n.value=e.value),n}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,r,n){var i=this;if(r){var A=r.content,o=t.ownerDocument;if(o&&A&&"none"!==A&&"-moz-alt-content"!==A&&"none"!==r.display){this.counters.parse(new yA(this.context,r));var a=new gA(this.context,r),s=o.createElement("html2canvaspseudoelement");ts(r,s),a.content.forEach(function(t){if(0===t.type)s.appendChild(o.createTextNode(t.value));else if(22===t.type){var r=o.createElement("img");r.src=t.value,r.style.opacity="1",s.appendChild(r)}else if(18===t.type){if("attr"===t.name){var n=t.values.filter(Qr);n.length&&s.appendChild(o.createTextNode(e.getAttribute(n[0].value)||""))}else if("counter"===t.name){var A=t.values.filter(Dr),u=A[0],c=A[1];if(u&&Qr(u)){var l=i.counters.getCounterValue(u.value),f=c&&Qr(c)?Ei.parse(i.context,c.value):3;s.appendChild(o.createTextNode(Ga(l,f,!1)))}}else if("counters"===t.name){var d=t.values.filter(Dr),h=(u=d[0],d[1]);if(c=d[2],u&&Qr(u)){var p=i.counters.getCounterValues(u.value),g=c&&Qr(c)?Ei.parse(i.context,c.value):3,y=h&&0===h.type?h.value:"",v=p.map(function(e){return Ga(e,g,!1)}).join(y);s.appendChild(o.createTextNode(v))}}}else if(20===t.type)switch(t.value){case"open-quote":s.appendChild(o.createTextNode(cA(a.quotes,i.quoteDepth++,!0)));break;case"close-quote":s.appendChild(o.createTextNode(cA(a.quotes,--i.quoteDepth,!1)));break;default:s.appendChild(o.createTextNode(t.value))}}),s.className=as+" "+ss;var u=n===zA.BEFORE?" "+as:" "+ss;return la(t)?t.className.baseValue+=u:t.className+=u,s}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(zA||(zA={}));var Ya,Za=function(e,t){var r=e.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=t.width.toString(),r.height=t.height.toString(),r.scrolling="no",r.setAttribute(Wa,"true"),e.body.appendChild(r),r},qa=function(e){return new Promise(function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()})},Ja=function(e){return Promise.all([].slice.call(e.images,0).map(qa))},$a=function(e){return new Promise(function(t,r){var n=e.contentWindow;if(!n)return r("No window assigned for iframe");var i=n.document;n.onload=e.onload=function(){n.onload=e.onload=null;var r=setInterval(function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(r),t(e))},50)}})},es=["all","d","content"],ts=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e.item(r);-1===es.indexOf(n)&&t.style.setProperty(n,e.getPropertyValue(n))}return t},rs=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},ns=function(e,t,r){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||r!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,r)},is=function(e){var t=e[0],r=e[1],n=e[2];t.scrollLeft=r,t.scrollTop=n},As=":before",os=":after",as="___html2canvas___pseudoelement_before",ss="___html2canvas___pseudoelement_after",us='{\n content: "" !important;\n display: none !important;\n}',cs=function(e){ls(e,"."+as+As+us+"\n ."+ss+os+us)},ls=function(e,t){var r=e.ownerDocument;if(r){var n=r.createElement("style");n.textContent=t,e.appendChild(n)}},fs=function(){function e(){}return e.getOrigin=function(t){var r=e._link;return r?(r.href=t,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),ds=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:ws(e)||ys(e)?((this._cache[e]=this.loadImage(e)).catch(function(){}),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return n(this,void 0,void 0,function(){var t,r,n,A,o=this;return i(this,function(i){switch(i.label){case 0:return t=fs.isSameOrigin(e),r=!vs(e)&&!0===this._options.useCORS&&So.SUPPORT_CORS_IMAGES&&!t,n=!vs(e)&&!t&&!ws(e)&&"string"==typeof this._options.proxy&&So.SUPPORT_CORS_XHR&&!r,t||!1!==this._options.allowTaint||vs(e)||ws(e)||n||r?(A=e,n?[4,this.proxy(A)]:[3,2]):[2];case 1:A=i.sent(),i.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,(ms(A)||r)&&(n.crossOrigin="anonymous"),n.src=A,!0===n.complete&&setTimeout(function(){return e(n)},500),o._options.imageTimeout>0&&setTimeout(function(){return t("Timed out ("+o._options.imageTimeout+"ms) loading image")},o._options.imageTimeout)})];case 3:return[2,i.sent()]}})})},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(i,A){var o=So.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===o)i(a.response);else{var e=new FileReader;e.addEventListener("load",function(){return i(e.result)},!1),e.addEventListener("error",function(e){return A(e)},!1),e.readAsDataURL(a.response)}else A("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=A;var s=r.indexOf("?")>-1?"&":"?";if(a.open("GET",""+r+s+"url="+encodeURIComponent(e)+"&responseType="+o),"text"!==o&&a instanceof XMLHttpRequest&&(a.responseType=o),t._options.imageTimeout){var u=t._options.imageTimeout;a.timeout=u,a.ontimeout=function(){return A("Timed out ("+u+"ms) proxying "+n)}}a.send()})},e}(),hs=/^data:image\/svg\+xml/i,ps=/^data:image\/.*;base64,/i,gs=/^data:image\/.*/i,ys=function(e){return So.SUPPORT_SVG_DRAWING||!bs(e)},vs=function(e){return gs.test(e)},ms=function(e){return ps.test(e)},ws=function(e){return"blob"===e.substr(0,4)},bs=function(e){return"svg"===e.substr(-3).toLowerCase()||hs.test(e)},Bs=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,r){return new e(this.x+t,this.y+r)},e}(),Cs=function(e,t,r){return new Bs(e.x+(t.x-e.x)*r,e.y+(t.y-e.y)*r)},Es=function(){function e(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}return e.prototype.subdivide=function(t,r){var n=Cs(this.start,this.startControl,t),i=Cs(this.startControl,this.endControl,t),A=Cs(this.endControl,this.end,t),o=Cs(n,i,t),a=Cs(i,A,t),s=Cs(o,a,t);return r?new e(this.start,n,o,s):new e(s,a,A,this.end)},e.prototype.add=function(t,r){return new e(this.start.add(t,r),this.startControl.add(t,r),this.endControl.add(t,r),this.end.add(t,r))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Ss=function(e){return 1===e.type},Is=function(){function e(e){var t=e.styles,r=e.bounds,n=zr(t.borderTopLeftRadius,r.width,r.height),i=n[0],A=n[1],o=zr(t.borderTopRightRadius,r.width,r.height),a=o[0],s=o[1],u=zr(t.borderBottomRightRadius,r.width,r.height),c=u[0],l=u[1],f=zr(t.borderBottomLeftRadius,r.width,r.height),d=f[0],h=f[1],p=[];p.push((i+a)/r.width),p.push((d+c)/r.width),p.push((A+h)/r.height),p.push((s+l)/r.height);var g=Math.max.apply(Math,p);g>1&&(i/=g,A/=g,a/=g,s/=g,c/=g,l/=g,d/=g,h/=g);var y=r.width-a,v=r.height-l,m=r.width-c,w=r.height-h,b=t.borderTopWidth,B=t.borderRightWidth,C=t.borderBottomWidth,E=t.borderLeftWidth,S=Gr(t.paddingTop,e.bounds.width),I=Gr(t.paddingRight,e.bounds.width),O=Gr(t.paddingBottom,e.bounds.width),F=Gr(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||A>0?Os(r.left+E/3,r.top+b/3,i-E/3,A-b/3,Ya.TOP_LEFT):new Bs(r.left+E/3,r.top+b/3),this.topRightBorderDoubleOuterBox=i>0||A>0?Os(r.left+y,r.top+b/3,a-B/3,s-b/3,Ya.TOP_RIGHT):new Bs(r.left+r.width-B/3,r.top+b/3),this.bottomRightBorderDoubleOuterBox=c>0||l>0?Os(r.left+m,r.top+v,c-B/3,l-C/3,Ya.BOTTOM_RIGHT):new Bs(r.left+r.width-B/3,r.top+r.height-C/3),this.bottomLeftBorderDoubleOuterBox=d>0||h>0?Os(r.left+E/3,r.top+w,d-E/3,h-C/3,Ya.BOTTOM_LEFT):new Bs(r.left+E/3,r.top+r.height-C/3),this.topLeftBorderDoubleInnerBox=i>0||A>0?Os(r.left+2*E/3,r.top+2*b/3,i-2*E/3,A-2*b/3,Ya.TOP_LEFT):new Bs(r.left+2*E/3,r.top+2*b/3),this.topRightBorderDoubleInnerBox=i>0||A>0?Os(r.left+y,r.top+2*b/3,a-2*B/3,s-2*b/3,Ya.TOP_RIGHT):new Bs(r.left+r.width-2*B/3,r.top+2*b/3),this.bottomRightBorderDoubleInnerBox=c>0||l>0?Os(r.left+m,r.top+v,c-2*B/3,l-2*C/3,Ya.BOTTOM_RIGHT):new Bs(r.left+r.width-2*B/3,r.top+r.height-2*C/3),this.bottomLeftBorderDoubleInnerBox=d>0||h>0?Os(r.left+2*E/3,r.top+w,d-2*E/3,h-2*C/3,Ya.BOTTOM_LEFT):new Bs(r.left+2*E/3,r.top+r.height-2*C/3),this.topLeftBorderStroke=i>0||A>0?Os(r.left+E/2,r.top+b/2,i-E/2,A-b/2,Ya.TOP_LEFT):new Bs(r.left+E/2,r.top+b/2),this.topRightBorderStroke=i>0||A>0?Os(r.left+y,r.top+b/2,a-B/2,s-b/2,Ya.TOP_RIGHT):new Bs(r.left+r.width-B/2,r.top+b/2),this.bottomRightBorderStroke=c>0||l>0?Os(r.left+m,r.top+v,c-B/2,l-C/2,Ya.BOTTOM_RIGHT):new Bs(r.left+r.width-B/2,r.top+r.height-C/2),this.bottomLeftBorderStroke=d>0||h>0?Os(r.left+E/2,r.top+w,d-E/2,h-C/2,Ya.BOTTOM_LEFT):new Bs(r.left+E/2,r.top+r.height-C/2),this.topLeftBorderBox=i>0||A>0?Os(r.left,r.top,i,A,Ya.TOP_LEFT):new Bs(r.left,r.top),this.topRightBorderBox=a>0||s>0?Os(r.left+y,r.top,a,s,Ya.TOP_RIGHT):new Bs(r.left+r.width,r.top),this.bottomRightBorderBox=c>0||l>0?Os(r.left+m,r.top+v,c,l,Ya.BOTTOM_RIGHT):new Bs(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=d>0||h>0?Os(r.left,r.top+w,d,h,Ya.BOTTOM_LEFT):new Bs(r.left,r.top+r.height),this.topLeftPaddingBox=i>0||A>0?Os(r.left+E,r.top+b,Math.max(0,i-E),Math.max(0,A-b),Ya.TOP_LEFT):new Bs(r.left+E,r.top+b),this.topRightPaddingBox=a>0||s>0?Os(r.left+Math.min(y,r.width-B),r.top+b,y>r.width+B?0:Math.max(0,a-B),Math.max(0,s-b),Ya.TOP_RIGHT):new Bs(r.left+r.width-B,r.top+b),this.bottomRightPaddingBox=c>0||l>0?Os(r.left+Math.min(m,r.width-E),r.top+Math.min(v,r.height-C),Math.max(0,c-B),Math.max(0,l-C),Ya.BOTTOM_RIGHT):new Bs(r.left+r.width-B,r.top+r.height-C),this.bottomLeftPaddingBox=d>0||h>0?Os(r.left+E,r.top+Math.min(w,r.height-C),Math.max(0,d-E),Math.max(0,h-C),Ya.BOTTOM_LEFT):new Bs(r.left+E,r.top+r.height-C),this.topLeftContentBox=i>0||A>0?Os(r.left+E+F,r.top+b+S,Math.max(0,i-(E+F)),Math.max(0,A-(b+S)),Ya.TOP_LEFT):new Bs(r.left+E+F,r.top+b+S),this.topRightContentBox=a>0||s>0?Os(r.left+Math.min(y,r.width+E+F),r.top+b+S,y>r.width+E+F?0:a-E+F,s-(b+S),Ya.TOP_RIGHT):new Bs(r.left+r.width-(B+I),r.top+b+S),this.bottomRightContentBox=c>0||l>0?Os(r.left+Math.min(m,r.width-(E+F)),r.top+Math.min(v,r.height+b+S),Math.max(0,c-(B+I)),l-(C+O),Ya.BOTTOM_RIGHT):new Bs(r.left+r.width-(B+I),r.top+r.height-(C+O)),this.bottomLeftContentBox=d>0||h>0?Os(r.left+E+F,r.top+w,Math.max(0,d-(E+F)),h-(C+O),Ya.BOTTOM_LEFT):new Bs(r.left+E+F,r.top+r.height-(C+O))}return e}();!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Ya||(Ya={}));var Os=function(e,t,r,n,i){var A=(Math.sqrt(2)-1)/3*4,o=r*A,a=n*A,s=e+r,u=t+n;switch(i){case Ya.TOP_LEFT:return new Es(new Bs(e,u),new Bs(e,u-a),new Bs(s-o,t),new Bs(s,t));case Ya.TOP_RIGHT:return new Es(new Bs(e,t),new Bs(e+o,t),new Bs(s,u-a),new Bs(s,u));case Ya.BOTTOM_RIGHT:return new Es(new Bs(s,t),new Bs(s,t+a),new Bs(e+o,u),new Bs(e,u));case Ya.BOTTOM_LEFT:default:return new Es(new Bs(s,u),new Bs(s-o,u),new Bs(e,t+a),new Bs(e,t))}},Fs=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},_s=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},xs=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Us=function(){function e(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6}return e}(),Qs=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Ts=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Ms=function(e){return 0===e.type},Ps=function(e){return 1===e.type},Ds=function(e){return 2===e.type},ks=function(e,t){return e.length===t.length&&e.some(function(e,r){return e===t[r]})},Ns=function(e,t,r,n,i){return e.map(function(e,A){switch(A){case 0:return e.add(t,r);case 1:return e.add(t+n,r);case 2:return e.add(t+n,r+i);case 3:return e.add(t,r+i)}return e})},Rs=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Ls=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new Is(this.container),this.container.styles.opacity<1&&this.effects.push(new Ts(this.container.styles.opacity)),null!==this.container.styles.transform){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new Us(r,n,i))}if(0!==this.container.styles.overflowX){var A=Fs(this.curves),o=xs(this.curves);ks(A,o)?this.effects.push(new Qs(A,6)):(this.effects.push(new Qs(A,2)),this.effects.push(new Qs(o,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),r=this.parent,n=this.effects.slice(0);r;){var i=r.effects.filter(function(e){return!Ps(e)});if(t||0!==r.container.styles.position||!r.parent){if(n.unshift.apply(n,i),t=-1===[2,3].indexOf(r.container.styles.position),0!==r.container.styles.overflowX){var A=Fs(r.curves),o=xs(r.curves);ks(A,o)||n.unshift(new Qs(o,6))}}else n.unshift.apply(n,i);r=r.parent}return n.filter(function(t){return iA(t.target,e)})},e}(),Hs=function(e,t,r,n){e.container.elements.forEach(function(i){var A=iA(i.flags,4),o=iA(i.flags,2),a=new Ls(i,e);iA(i.styles.display,2048)&&n.push(a);var s=iA(i.flags,8)?[]:n;if(A||o){var u=A||i.styles.isPositioned()?r:t,c=new Rs(a);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var l=i.styles.zIndex.order;if(l<0){var f=0;u.negativeZIndex.some(function(e,t){return l>e.element.container.styles.zIndex.order?(f=t,!1):f>0}),u.negativeZIndex.splice(f,0,c)}else if(l>0){var d=0;u.positiveZIndex.some(function(e,t){return l>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0}),u.positiveZIndex.splice(d,0,c)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?u.nonPositionedFloats.push(c):u.nonPositionedInlineLevel.push(c);Hs(a,c,A?c:r,s)}else i.styles.isInlineLevel()?t.inlineLevel.push(a):t.nonInlineLevel.push(a),Hs(a,t,r,s);iA(i.flags,8)&&js(i,s)})},js=function(e,t){for(var r=e instanceof Vo?e.start:1,n=e instanceof Vo&&e.reversed,i=0;i<t.length;i++){var A=t[i];A.container instanceof jo&&"number"==typeof A.container.value&&0!==A.container.value&&(r=A.container.value),A.listValue=Ga(r,A.container.styles.listStyleType,!0),r+=n?-1:1}},Vs=function(e){var t=new Ls(e,null),r=new Rs(t),n=[];return Hs(t,r,r,n),js(t.container,n),r},Ks=function(e,t){switch(t){case 0:return Ys(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return Ys(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return Ys(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return Ys(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},zs=function(e,t){switch(t){case 0:return Ys(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return Ys(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return Ys(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return Ys(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Gs=function(e,t){switch(t){case 0:return Ys(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return Ys(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return Ys(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return Ys(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},Ws=function(e,t){switch(t){case 0:return Xs(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Xs(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Xs(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return Xs(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Xs=function(e,t){var r=[];return Ss(e)?r.push(e.subdivide(.5,!1)):r.push(e),Ss(t)?r.push(t.subdivide(.5,!0)):r.push(t),r},Ys=function(e,t,r,n){var i=[];return Ss(e)?i.push(e.subdivide(.5,!1)):i.push(e),Ss(r)?i.push(r.subdivide(.5,!0)):i.push(r),Ss(n)?i.push(n.subdivide(.5,!0).reverse()):i.push(n),Ss(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},Zs=function(e){var t=e.bounds,r=e.styles;return t.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},qs=function(e){var t=e.styles,r=e.bounds,n=Gr(t.paddingLeft,r.width),i=Gr(t.paddingRight,r.width),A=Gr(t.paddingTop,r.width),o=Gr(t.paddingBottom,r.width);return r.add(n+t.borderLeftWidth,A+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+n+i),-(t.borderTopWidth+t.borderBottomWidth+A+o))},Js=function(e,t){return 0===e?t.bounds:2===e?qs(t):Zs(t)},$s=function(e,t){return 0===e?t.bounds:2===e?qs(t):Zs(t)},eu=function(e,t,r){var n=Js(iu(e.styles.backgroundOrigin,t),e),i=$s(iu(e.styles.backgroundClip,t),e),A=nu(iu(e.styles.backgroundSize,t),r,n),o=A[0],a=A[1],s=zr(iu(e.styles.backgroundPosition,t),n.width-o,n.height-a);return[Au(iu(e.styles.backgroundRepeat,t),s,A,n,i),Math.round(n.left+s[0]),Math.round(n.top+s[1]),o,a]},tu=function(e){return Qr(e)&&e.value===Dn.AUTO},ru=function(e){return"number"==typeof e},nu=function(e,t,r){var n=t[0],i=t[1],A=t[2],o=e[0],a=e[1];if(!o)return[0,0];if(Lr(o)&&a&&Lr(a))return[Gr(o,r.width),Gr(a,r.height)];var s=ru(A);if(Qr(o)&&(o.value===Dn.CONTAIN||o.value===Dn.COVER))return ru(A)?r.width/r.height<A!=(o.value===Dn.COVER)?[r.width,r.width/A]:[r.height*A,r.height]:[r.width,r.height];var u=ru(n),c=ru(i),l=u||c;if(tu(o)&&(!a||tu(a)))return u&&c?[n,i]:s||l?l&&s?[u?n:i*A,c?i:n/A]:[u?n:r.width,c?i:r.height]:[r.width,r.height];if(s){var f=0,d=0;return Lr(o)?f=Gr(o,r.width):Lr(a)&&(d=Gr(a,r.height)),tu(o)?f=d*A:a&&!tu(a)||(d=f/A),[f,d]}var h=null,p=null;if(Lr(o)?h=Gr(o,r.width):a&&Lr(a)&&(p=Gr(a,r.height)),null===h||a&&!tu(a)||(p=u&&c?h/n*i:r.height),null!==p&&tu(o)&&(h=u&&c?p/i*n:r.width),null!==h&&null!==p)return[h,p];throw new Error("Unable to calculate background-size for element")},iu=function(e,t){var r=e[t];return void 0===r?e[0]:r},Au=function(e,t,r,n,i){var A=t[0],o=t[1],a=r[0],s=r[1];switch(e){case 2:return[new Bs(Math.round(n.left),Math.round(n.top+o)),new Bs(Math.round(n.left+n.width),Math.round(n.top+o)),new Bs(Math.round(n.left+n.width),Math.round(s+n.top+o)),new Bs(Math.round(n.left),Math.round(s+n.top+o))];case 3:return[new Bs(Math.round(n.left+A),Math.round(n.top)),new Bs(Math.round(n.left+A+a),Math.round(n.top)),new Bs(Math.round(n.left+A+a),Math.round(n.height+n.top)),new Bs(Math.round(n.left+A),Math.round(n.height+n.top))];case 1:return[new Bs(Math.round(n.left+A),Math.round(n.top+o)),new Bs(Math.round(n.left+A+a),Math.round(n.top+o)),new Bs(Math.round(n.left+A+a),Math.round(n.top+o+s)),new Bs(Math.round(n.left+A),Math.round(n.top+o+s))];default:return[new Bs(Math.round(i.left),Math.round(i.top)),new Bs(Math.round(i.left+i.width),Math.round(i.top)),new Bs(Math.round(i.left+i.width),Math.round(i.height+i.top)),new Bs(Math.round(i.left),Math.round(i.height+i.top))]}},ou="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",au="Hidden Text",su=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),n=this._document.createElement("img"),i=this._document.createElement("span"),A=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",A.appendChild(r),n.src=ou,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",i.style.fontFamily=e,i.style.fontSize=t,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(au)),r.appendChild(i),r.appendChild(n);var o=n.offsetTop-i.offsetTop+2;r.removeChild(i),r.appendChild(this._document.createTextNode(au)),r.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-r.offsetTop+2;return A.removeChild(r),{baseline:o,middle:a}},e.prototype.getMetrics=function(e,t){var r=e+" "+t;return void 0===this._data[r]&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},e}(),uu=function(){function e(e,t){this.context=e,this.options=t}return e}(),cu=1e4,lu=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n._activeEffects=[],n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),r.canvas||(n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px"),n.fontMetrics=new su(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),n}return t(r,e),r.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(e){return t.applyEffect(e)})},r.prototype.applyEffect=function(e){this.ctx.save(),Ds(e)&&(this.ctx.globalAlpha=e.opacity),Ms(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Ps(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},r.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},r.prototype.renderStack=function(e){return n(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},r.prototype.renderNode=function(e){return n(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return iA(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},r.prototype.renderTextWithLetterSpacing=function(e,t,r){var n=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+r):xo(e.text).reduce(function(t,i){return n.ctx.fillText(i,t,e.bounds.top+r),t+n.ctx.measureText(i).width},e.bounds.left)},r.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),r=gu(e.fontFamily).join(", "),n=xr(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,n,r].join(" "),r,n]},r.prototype.renderTextNode=function(e,t){return n(this,void 0,void 0,function(){var r,n,A,o,a,s,u,c,l=this;return i(this,function(i){return r=this.createFontStyle(t),n=r[0],A=r[1],o=r[2],this.ctx.font=n,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(A,o),s=a.baseline,u=a.middle,c=t.paintOrder,e.textBounds.forEach(function(e){c.forEach(function(r){switch(r){case 0:l.ctx.fillStyle=nn(t.color),l.renderTextWithLetterSpacing(e,t.letterSpacing,s);var n=t.textShadow;n.length&&e.text.trim().length&&(n.slice(0).reverse().forEach(function(r){l.ctx.shadowColor=nn(r.color),l.ctx.shadowOffsetX=r.offsetX.number*l.options.scale,l.ctx.shadowOffsetY=r.offsetY.number*l.options.scale,l.ctx.shadowBlur=r.blur.number,l.renderTextWithLetterSpacing(e,t.letterSpacing,s)}),l.ctx.shadowColor="",l.ctx.shadowOffsetX=0,l.ctx.shadowOffsetY=0,l.ctx.shadowBlur=0),t.textDecorationLine.length&&(l.ctx.fillStyle=nn(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(t){switch(t){case 1:l.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+s),e.bounds.width,1);break;case 2:l.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:l.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+u),e.bounds.width,1)}}));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(l.ctx.strokeStyle=nn(t.webkitTextStrokeColor),l.ctx.lineWidth=t.webkitTextStrokeWidth,l.ctx.lineJoin=window.chrome?"miter":"round",l.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+s)),l.ctx.strokeStyle="",l.ctx.lineWidth=0,l.ctx.lineJoin="miter"}})}),[2]})})},r.prototype.renderReplacedElement=function(e,t,r){if(r&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var n=qs(e),i=xs(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(r,0,0,e.intrinsicWidth,e.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},r.prototype.renderNodeContent=function(e){return n(this,void 0,void 0,function(){var t,n,A,a,s,u,c,l,f,d,h,p,g,y,v,m,w,b;return i(this,function(i){switch(i.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,n=e.curves,A=t.styles,a=0,s=t.textNodes,i.label=1;case 1:return a<s.length?(u=s[a],[4,this.renderTextNode(u,A)]):[3,4];case 2:i.sent(),i.label=3;case 3:return a++,[3,1];case 4:if(!(t instanceof Ro))return[3,8];i.label=5;case 5:return i.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return v=i.sent(),this.renderReplacedElement(t,n,v),[3,8];case 7:return i.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Lo&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Ho))return[3,12];i.label=9;case 9:return i.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return v=i.sent(),this.renderReplacedElement(t,n,v),[3,12];case 11:return i.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof ta&&t.tree?[4,new r(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:c=i.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),i.label=14;case 14:if(t instanceof Jo&&(l=Math.min(t.bounds.width,t.bounds.height),t.type===Xo?t.checked&&(this.ctx.save(),this.path([new Bs(t.bounds.left+.39363*l,t.bounds.top+.79*l),new Bs(t.bounds.left+.16*l,t.bounds.top+.5549*l),new Bs(t.bounds.left+.27347*l,t.bounds.top+.44071*l),new Bs(t.bounds.left+.39694*l,t.bounds.top+.5649*l),new Bs(t.bounds.left+.72983*l,t.bounds.top+.23*l),new Bs(t.bounds.left+.84*l,t.bounds.top+.34085*l),new Bs(t.bounds.left+.39363*l,t.bounds.top+.79*l)]),this.ctx.fillStyle=nn(qo),this.ctx.fill(),this.ctx.restore()):t.type===Yo&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+l/2,t.bounds.top+l/2,l/4,0,2*Math.PI,!0),this.ctx.fillStyle=nn(qo),this.ctx.fill(),this.ctx.restore())),fu(t)&&t.value.length){switch(f=this.createFontStyle(A),w=f[0],d=f[1],h=this.fontMetrics.getMetrics(w,d).baseline,this.ctx.font=w,this.ctx.fillStyle=nn(A.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hu(t.styles.textAlign),b=qs(t),p=0,t.styles.textAlign){case 1:p+=b.width/2;break;case 2:p+=b.width}g=b.add(p,0,0,-b.height/2+1),this.ctx.save(),this.path([new Bs(b.left,b.top),new Bs(b.left+b.width,b.top),new Bs(b.left+b.width,b.top+b.height),new Bs(b.left,b.top+b.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Io(t.value,g),A.letterSpacing,h),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!iA(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(y=t.styles.listStyleImage).type)return[3,18];v=void 0,m=y.url,i.label=15;case 15:return i.trys.push([15,17,,18]),[4,this.context.cache.match(m)];case 16:return v=i.sent(),this.ctx.drawImage(v,t.bounds.left-(v.width+10),t.bounds.top),[3,18];case 17:return i.sent(),this.context.logger.error("Error loading list-style-image "+m),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(w=this.createFontStyle(A)[0],this.ctx.font=w,this.ctx.fillStyle=nn(A.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",b=new o(t.bounds.left,t.bounds.top+Gr(t.styles.paddingTop,t.bounds.width),t.bounds.width,bi(A.lineHeight,A.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Io(e.listValue,b),A.letterSpacing,bi(A.lineHeight,A.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),i.label=20;case 20:return[2]}})})},r.prototype.renderStackContent=function(e){return n(this,void 0,void 0,function(){var t,r,n,A,o,a,s,u,c,l,f,d,h,p,g;return i(this,function(i){switch(i.label){case 0:return iA(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:i.sent(),t=0,r=e.negativeZIndex,i.label=2;case 2:return t<r.length?(g=r[t],[4,this.renderStack(g)]):[3,5];case 3:i.sent(),i.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:i.sent(),n=0,A=e.nonInlineLevel,i.label=7;case 7:return n<A.length?(g=A[n],[4,this.renderNode(g)]):[3,10];case 8:i.sent(),i.label=9;case 9:return n++,[3,7];case 10:o=0,a=e.nonPositionedFloats,i.label=11;case 11:return o<a.length?(g=a[o],[4,this.renderStack(g)]):[3,14];case 12:i.sent(),i.label=13;case 13:return o++,[3,11];case 14:s=0,u=e.nonPositionedInlineLevel,i.label=15;case 15:return s<u.length?(g=u[s],[4,this.renderStack(g)]):[3,18];case 16:i.sent(),i.label=17;case 17:return s++,[3,15];case 18:c=0,l=e.inlineLevel,i.label=19;case 19:return c<l.length?(g=l[c],[4,this.renderNode(g)]):[3,22];case 20:i.sent(),i.label=21;case 21:return c++,[3,19];case 22:f=0,d=e.zeroOrAutoZIndexOrTransformedOrOpacity,i.label=23;case 23:return f<d.length?(g=d[f],[4,this.renderStack(g)]):[3,26];case 24:i.sent(),i.label=25;case 25:return f++,[3,23];case 26:h=0,p=e.positiveZIndex,i.label=27;case 27:return h<p.length?(g=p[h],[4,this.renderStack(g)]):[3,30];case 28:i.sent(),i.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},r.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},r.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},r.prototype.formatPath=function(e){var t=this;e.forEach(function(e,r){var n=Ss(e)?e.start:e;0===r?t.ctx.moveTo(n.x,n.y):t.ctx.lineTo(n.x,n.y),Ss(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},r.prototype.renderRepeat=function(e,t,r,n){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(r,n),this.ctx.fill(),this.ctx.translate(-r,-n)},r.prototype.resizeImage=function(e,t,r){var n;if(e.width===t&&e.height===r)return e;var i=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return i.width=Math.max(1,t),i.height=Math.max(1,r),i.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,r),i},r.prototype.renderBackgroundImage=function(e){return n(this,void 0,void 0,function(){var t,r,n,A,o,a;return i(this,function(s){switch(s.label){case 0:t=e.styles.backgroundImage.length-1,r=function(r){var A,o,a,s,u,c,l,f,d,h,p,g,y,v,m,w,b,B,C,E,S,I,O,F,_,x,U,Q,T,M,P;return i(this,function(i){switch(i.label){case 0:if(0!==r.type)return[3,5];A=void 0,o=r.url,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.context.cache.match(o)];case 2:return A=i.sent(),[3,4];case 3:return i.sent(),n.context.logger.error("Error loading background-image "+o),[3,4];case 4:return A&&(a=eu(e,t,[A.width,A.height,A.width/A.height]),w=a[0],I=a[1],O=a[2],C=a[3],E=a[4],v=n.ctx.createPattern(n.resizeImage(A,C,E),"repeat"),n.renderRepeat(w,v,I,O)),[3,6];case 5:Qn(r)?(s=eu(e,t,[null,null,null]),w=s[0],I=s[1],O=s[2],C=s[3],E=s[4],u=vn(r.angle,C,E),c=u[0],l=u[1],f=u[2],d=u[3],h=u[4],(p=document.createElement("canvas")).width=C,p.height=E,g=p.getContext("2d"),y=g.createLinearGradient(l,d,f,h),gn(r.stops,c).forEach(function(e){return y.addColorStop(e.stop,nn(e.color))}),g.fillStyle=y,g.fillRect(0,0,C,E),C>0&&E>0&&(v=n.ctx.createPattern(p,"repeat"),n.renderRepeat(w,v,I,O))):Tn(r)&&(m=eu(e,t,[null,null,null]),w=m[0],b=m[1],B=m[2],C=m[3],E=m[4],S=0===r.position.length?[Vr]:r.position,I=Gr(S[0],C),O=Gr(S[S.length-1],E),F=bn(r,I,O,C,E),_=F[0],x=F[1],_>0&&x>0&&(U=n.ctx.createRadialGradient(b+I,B+O,0,b+I,B+O,_),gn(r.stops,2*_).forEach(function(e){return U.addColorStop(e.stop,nn(e.color))}),n.path(w),n.ctx.fillStyle=U,_!==x?(Q=e.bounds.left+.5*e.bounds.width,T=e.bounds.top+.5*e.bounds.height,P=1/(M=x/_),n.ctx.save(),n.ctx.translate(Q,T),n.ctx.transform(1,0,0,M,0,0),n.ctx.translate(-Q,-T),n.ctx.fillRect(b,P*(B-T)+T,C,E*P),n.ctx.restore()):n.ctx.fill())),i.label=6;case 6:return t--,[2]}})},n=this,A=0,o=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return A<o.length?(a=o[A],[5,r(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return A++,[3,1];case 4:return[2]}})})},r.prototype.renderSolidBorder=function(e,t,r){return n(this,void 0,void 0,function(){return i(this,function(n){return this.path(Ks(r,t)),this.ctx.fillStyle=nn(e),this.ctx.fill(),[2]})})},r.prototype.renderDoubleBorder=function(e,t,r,A){return n(this,void 0,void 0,function(){var n,o;return i(this,function(i){switch(i.label){case 0:return t<3?[4,this.renderSolidBorder(e,r,A)]:[3,2];case 1:return i.sent(),[2];case 2:return n=zs(A,r),this.path(n),this.ctx.fillStyle=nn(e),this.ctx.fill(),o=Gs(A,r),this.path(o),this.ctx.fill(),[2]}})})},r.prototype.renderNodeBackgroundAndBorders=function(e){return n(this,void 0,void 0,function(){var t,r,n,A,o,a,s,u,c=this;return i(this,function(i){switch(i.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,r=!rn(t.backgroundColor)||t.backgroundImage.length,n=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],A=du(iu(t.backgroundClip,0),e.curves),r||t.boxShadow.length?(this.ctx.save(),this.path(A),this.ctx.clip(),rn(t.backgroundColor)||(this.ctx.fillStyle=nn(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:i.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(t){c.ctx.save();var r=Fs(e.curves),n=t.inset?0:cu,i=Ns(r,-n+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(c.path(r),c.ctx.clip(),c.mask(i)):(c.mask(r),c.ctx.clip(),c.path(i)),c.ctx.shadowOffsetX=t.offsetX.number+n,c.ctx.shadowOffsetY=t.offsetY.number,c.ctx.shadowColor=nn(t.color),c.ctx.shadowBlur=t.blur.number,c.ctx.fillStyle=t.inset?nn(t.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()}),i.label=2;case 2:o=0,a=0,s=n,i.label=3;case 3:return a<s.length?0!==(u=s[a]).style&&!rn(u.color)&&u.width>0?2!==u.style?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,o,e.curves,2)]:[3,11]:[3,13];case 4:return i.sent(),[3,11];case 5:return 3!==u.style?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,o,e.curves,3)];case 6:return i.sent(),[3,11];case 7:return 4!==u.style?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,o,e.curves)];case 8:return i.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,o,e.curves)];case 10:i.sent(),i.label=11;case 11:o++,i.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},r.prototype.renderDashedDottedBorder=function(e,t,r,A,o){return n(this,void 0,void 0,function(){var n,a,s,u,c,l,f,d,h,p,g,y,v,m,w,b;return i(this,function(i){return this.ctx.save(),n=Ws(A,r),a=Ks(A,r),2===o&&(this.path(a),this.ctx.clip()),Ss(a[0])?(s=a[0].start.x,u=a[0].start.y):(s=a[0].x,u=a[0].y),Ss(a[1])?(c=a[1].end.x,l=a[1].end.y):(c=a[1].x,l=a[1].y),f=0===r||2===r?Math.abs(s-c):Math.abs(u-l),this.ctx.beginPath(),3===o?this.formatPath(n):this.formatPath(a.slice(0,2)),d=t<3?3*t:2*t,h=t<3?2*t:t,3===o&&(d=t,h=t),p=!0,f<=2*d?p=!1:f<=2*d+h?(d*=g=f/(2*d+h),h*=g):(y=Math.floor((f+h)/(d+h)),v=(f-y*d)/(y-1),h=(m=(f-(y+1)*d)/y)<=0||Math.abs(h-v)<Math.abs(h-m)?v:m),p&&(3===o?this.ctx.setLineDash([0,d+h]):this.ctx.setLineDash([d,h])),3===o?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=nn(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===o&&(Ss(a[0])&&(w=a[3],b=a[0],this.ctx.beginPath(),this.formatPath([new Bs(w.end.x,w.end.y),new Bs(b.start.x,b.start.y)]),this.ctx.stroke()),Ss(a[1])&&(w=a[1],b=a[2],this.ctx.beginPath(),this.formatPath([new Bs(w.end.x,w.end.y),new Bs(b.start.x,b.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},r.prototype.render=function(e){return n(this,void 0,void 0,function(){var t;return i(this,function(r){switch(r.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=nn(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Vs(e),[4,this.renderStack(t)];case 1:return r.sent(),this.applyEffects([]),[2,this.canvas]}})})},r}(uu),fu=function(e){return e instanceof ea||e instanceof $o||e instanceof Jo&&e.type!==Yo&&e.type!==Xo},du=function(e,t){switch(e){case 0:return Fs(t);case 2:return _s(t);default:return xs(t)}},hu=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},pu=["-apple-system","system-ui"],gu=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(e){return-1===pu.indexOf(e)}):e},yu=function(e){function r(t,r){var n=e.call(this,t,r)||this;return n.canvas=r.canvas?r.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=r,n.canvas.width=Math.floor(r.width*r.scale),n.canvas.height=Math.floor(r.height*r.scale),n.canvas.style.width=r.width+"px",n.canvas.style.height=r.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-r.x,-r.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),n}return t(r,e),r.prototype.render=function(e){return n(this,void 0,void 0,function(){var t,r;return i(this,function(n){switch(n.label){case 0:return t=Co(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,vu(t)];case 1:return r=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=nn(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(r,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},r}(uu),vu=function(e){return new Promise(function(t,r){var n=new Image;n.onload=function(){t(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))})},mu=function(){function e(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,A([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,A([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,A([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,A([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),wu=function(){function e(t,r){var n;this.windowBounds=r,this.instanceName="#"+e.instanceCount++,this.logger=new mu({id:this.instanceName,enabled:t.logging}),this.cache=null!==(n=t.cache)&&void 0!==n?n:new ds(this,t)}return e.instanceCount=1,e}(),bu=function(e,t){return void 0===t&&(t={}),Bu(e,t)};"undefined"!=typeof window&&fs.setContext(window);var Bu=function(e,t){return n(void 0,void 0,void 0,function(){var n,A,u,c,l,f,d,h,p,g,y,v,m,w,b,B,C,E,S,I,O,F,_,x,U,Q,T,M,P,D,k,N,R,L,H,j,V,K;return i(this,function(i){switch(i.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(A=n.defaultView))throw new Error("Document is not attached to a Window");return u={allowTaint:null!==(F=t.allowTaint)&&void 0!==F&&F,imageTimeout:null!==(_=t.imageTimeout)&&void 0!==_?_:15e3,proxy:t.proxy,useCORS:null!==(x=t.useCORS)&&void 0!==x&&x},c=r({logging:null===(U=t.logging)||void 0===U||U,cache:t.cache},u),l={windowWidth:null!==(Q=t.windowWidth)&&void 0!==Q?Q:A.innerWidth,windowHeight:null!==(T=t.windowHeight)&&void 0!==T?T:A.innerHeight,scrollX:null!==(M=t.scrollX)&&void 0!==M?M:A.pageXOffset,scrollY:null!==(P=t.scrollY)&&void 0!==P?P:A.pageYOffset},f=new o(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new wu(c,f),h=null!==(D=t.foreignObjectRendering)&&void 0!==D&&D,p={allowTaint:null!==(k=t.allowTaint)&&void 0!==k&&k,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:h,copyStyles:h},d.logger.debug("Starting document clone with size "+f.width+"x"+f.height+" scrolled to "+-f.left+","+-f.top),g=new Xa(d,e,p),(y=g.clonedReferenceElement)?[4,g.toIFrame(n,f)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return v=i.sent(),m=ya(y)||pa(y)?s(y.ownerDocument):a(d,y),w=m.width,b=m.height,B=m.left,C=m.top,E=Cu(d,y,t.backgroundColor),S={canvas:t.canvas,backgroundColor:E,scale:null!==(R=null!==(N=t.scale)&&void 0!==N?N:A.devicePixelRatio)&&void 0!==R?R:1,x:(null!==(L=t.x)&&void 0!==L?L:0)+B,y:(null!==(H=t.y)&&void 0!==H?H:0)+C,width:null!==(j=t.width)&&void 0!==j?j:Math.ceil(w),height:null!==(V=t.height)&&void 0!==V?V:Math.ceil(b)},h?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new yu(d,S).render(y)]):[3,3];case 2:return I=i.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+B+","+C+" with size "+w+"x"+b+" using computed rendering"),d.logger.debug("Starting DOM parsing"),O=Aa(d,y),E===O.styles.backgroundColor&&(O.styles.backgroundColor=fn.TRANSPARENT),d.logger.debug("Starting renderer for element at "+S.x+","+S.y+" with size "+S.width+"x"+S.height),[4,new lu(d,S).render(O)];case 4:I=i.sent(),i.label=5;case 5:return(null===(K=t.removeContainer)||void 0===K||K)&&(Xa.destroy(v)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,I]}})})},Cu=function(e,t,r){var n=t.ownerDocument,i=n.documentElement?ln(e,getComputedStyle(n.documentElement).backgroundColor):fn.TRANSPARENT,A=n.body?ln(e,getComputedStyle(n.body).backgroundColor):fn.TRANSPARENT,o="string"==typeof r?ln(e,r):null===r?fn.TRANSPARENT:4294967295;return t===n.documentElement?rn(i)?rn(A)?o:A:i:o};return bu}()},20954(e,t,r){"use strict";r.d(t,{g:()=>c});var n=r(25508),i=r(19287),A=r(33032),o=r(36189),a=r(49259),s=r(19538),u=r(93569),c=(0,n.Mz)([(e,t)=>t,i.fz,s.D0,u.R,A.gL,A.R4,a.r1,o.HZ],a.aX)},21020(e,t,r){"use strict";var n=r(96540),i=Symbol.for("react.element"),A=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,A={},u=null,c=null;for(n in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,n)&&!s.hasOwnProperty(n)&&(A[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===A[n]&&(A[n]=t[n]);return{$$typeof:i,type:e,key:u,ref:c,props:A,_owner:a.current}}t.Fragment=A,t.jsx=u,t.jsxs=u},21077(e,t,r){"use strict";r.d(t,{e:()=>p,k:()=>g});var n=r(65307),i=r(74531),A=r(20954),o=r(99516),a=r(55978),s=r(4364),u=r(25508),c=r(18351),l=r(23571),f=(0,u.Mz)([l.J],e=>e.tooltipItemPayloads),d=(0,u.Mz)([f,c.x,(e,t)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(e=>e.settings.graphicalItemId===n);if(null!=i){var{positions:A}=i;if(null!=A)return t(A,r)}}),h=r(33032),p=(0,n.VP)("touchMove"),g=(0,n.Nc)();g.startListening({actionCreator:p,effect:(e,t)=>{var r=e.payload;if(null!=r.touches&&0!==r.touches.length){var n=t.getState(),u=(0,a.au)(n,n.tooltip.settings.shared);if("axis"===u){var c=r.touches[0];if(null==c)return;var l=(0,A.g)(n,(0,o.w)({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));null!=(null==l?void 0:l.activeIndex)&&t.dispatch((0,i.Nt)({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate}))}else if("item"===u){var f,p=r.touches[0];if(null==document.elementFromPoint||null==p)return;var g=document.elementFromPoint(p.clientX,p.clientY);if(!g||!g.getAttribute)return;var y=g.getAttribute(s.F0),v=null!==(f=g.getAttribute(s.yU))&&void 0!==f?f:void 0,m=(0,h.AA)(n).find(e=>e.id===v);if(null==y||null==m||null==v)return;var{dataKey:w}=m,b=d(n,y,v);t.dispatch((0,i.RD)({activeDataKey:w,activeIndex:y,activeCoordinate:b,activeGraphicalItemId:v}))}}}})},21334(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(60645),i=r(24483),A=r(80058);t.last=function(e){if(A.isArrayLike(e))return n.last(i.toArray(e))}},21465(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.toKey=function(e){return"string"==typeof e||"symbol"==typeof e?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}},22162(e,t,r){"use strict";var n=r(96540),i=r(19888);var A="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,a=n.useRef,s=n.useEffect,u=n.useMemo,c=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var l=a(null);if(null===l.current){var f={hasValue:!1,value:null};l.current=f}else f=l.current;l=u(function(){function e(e){if(!s){if(s=!0,o=e,e=n(e),void 0!==i&&f.hasValue){var t=f.value;if(i(t,e))return a=t}return a=e}if(t=a,A(o,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(o=e,t):(o=e,a=r)}var o,a,s=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]);var d=o(e,l[0],l[1]);return s(function(){f.hasValue=!0,f.value=d},[d]),c(d),d}},22551(e,t,r){"use strict";var n=r(96540),i=r(69982);function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function s(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var c=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,f=/^[: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]*$/,d={},h={};function p(e,t,r,n,i,A,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=A,this.removeEmptyString=o}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){g[e]=new p(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];g[t]=new p(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){g[e]=new p(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){g[e]=new p(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){g[e]=new p(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){g[e]=new p(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){g[e]=new p(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){g[e]=new p(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){g[e]=new p(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function m(e,t,r,n){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,r,n){if(null==t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!l.call(h,e)||!l.call(d,e)&&(f.test(e)?h[e]=!0:(d[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"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(y,v);g[t]=new p(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(y,v);g[t]=new p(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(y,v);g[t]=new p(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){g[e]=new p(e,1,!1,e.toLowerCase(),null,!1,!1)}),g.xlinkHref=new p("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){g[e]=new p(e,1,!1,e.toLowerCase(),null,!0,!0)});var w=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,b=Symbol.for("react.element"),B=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),O=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),Q=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var M=Symbol.iterator;function P(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=M&&e[M]||e["@@iterator"])?e:null}var D,k=Object.assign;function N(e){if(void 0===D)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);D=t&&t[1]||""}return"\n"+D+e}var R=!1;function L(e,t){if(!e||R)return"";R=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),A=n.stack.split("\n"),o=i.length-1,a=A.length-1;1<=o&&0<=a&&i[o]!==A[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==A[a]){if(1!==o||1!==a)do{if(o--,0>--a||i[o]!==A[a]){var s="\n"+i[o].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=o&&0<=a);break}}}finally{R=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?N(e):""}function H(e){switch(e.tag){case 5:return N(e.type);case 16:return N("Lazy");case 13:return N("Suspense");case 19:return N("SuspenseList");case 0:case 2:case 15:return e=L(e.type,!1);case 11:return e=L(e.type.render,!1);case 1:return e=L(e.type,!0);default:return""}}function j(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case C:return"Fragment";case B:return"Portal";case S:return"Profiler";case E:return"StrictMode";case _:return"Suspense";case x:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case O:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case F:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case U:return null!==(t=e.displayName||null)?t:j(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return j(e(t))}catch(e){}}return null}function V(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=(e=t.render).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 j(t);case 8:return t===E?"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("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function K(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=z(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,A=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,A.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function W(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=z(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function X(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var r=t.checked;return k({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function Z(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=K(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function q(e,t){null!=(t=t.checked)&&m(e,"checked",t,!1)}function J(e,t){q(e,t);var r=K(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,r):t.hasOwnProperty("defaultValue")&&ee(e,t.type,K(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ee(e,t,r){"number"===t&&X(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var te=Array.isArray;function re(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+K(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ne(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(A(91));return k({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(A(92));if(te(r)){if(1<r.length)throw Error(A(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:K(r)}}function Ae(e,t){var r=K(t.value),n=K(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ae(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function se(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ae(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ue,ce,le=(ce=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ue=ue||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction(function(){return ce(e,t)})}:ce);function fe(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var de={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},he=["Webkit","ms","Moz","O"];function pe(e,t,r){return null==t||"boolean"==typeof t||""===t?"":r||"number"!=typeof t||0===t||de.hasOwnProperty(e)&&de[e]?(""+t).trim():t+"px"}function ge(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=pe(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(de).forEach(function(e){he.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),de[t]=de[e]})});var ye=k({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 ve(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(A(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(A(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(A(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(A(62))}}function me(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;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 we=null;function be(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Be=null,Ce=null,Ee=null;function Se(e){if(e=mi(e)){if("function"!=typeof Be)throw Error(A(280));var t=e.stateNode;t&&(t=bi(t),Be(e.stateNode,e.type,t))}}function Ie(e){Ce?Ee?Ee.push(e):Ee=[e]:Ce=e}function Oe(){if(Ce){var e=Ce,t=Ee;if(Ee=Ce=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function Fe(e,t){return e(t)}function _e(){}var xe=!1;function Ue(e,t,r){if(xe)return e(t,r);xe=!0;try{return Fe(e,t,r)}finally{xe=!1,(null!==Ce||null!==Ee)&&(_e(),Oe())}}function Qe(e,t){var r=e.stateNode;if(null===r)return null;var n=bi(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(A(231,t,typeof r));return r}var Te=!1;if(c)try{var Me={};Object.defineProperty(Me,"passive",{get:function(){Te=!0}}),window.addEventListener("test",Me,Me),window.removeEventListener("test",Me,Me)}catch(ce){Te=!1}function Pe(e,t,r,n,i,A,o,a,s){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(e){this.onError(e)}}var De=!1,ke=null,Ne=!1,Re=null,Le={onError:function(e){De=!0,ke=e}};function He(e,t,r,n,i,A,o,a,s){De=!1,ke=null,Pe.apply(Le,arguments)}function je(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function Ve(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ke(e){if(je(e)!==e)throw Error(A(188))}function ze(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=je(e)))throw Error(A(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(n=i.return)){r=n;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===r)return Ke(i),e;if(o===n)return Ke(i),t;o=o.sibling}throw Error(A(188))}if(r.return!==n.return)r=i,n=o;else{for(var a=!1,s=i.child;s;){if(s===r){a=!0,r=i,n=o;break}if(s===n){a=!0,n=i,r=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===r){a=!0,r=o,n=i;break}if(s===n){a=!0,n=o,r=i;break}s=s.sibling}if(!a)throw Error(A(189))}}if(r.alternate!==n)throw Error(A(190))}if(3!==r.tag)throw Error(A(188));return r.stateNode.current===r?e:t}(e))?Ge(e):null}function Ge(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ge(e);if(null!==t)return t;e=e.sibling}return null}var We=i.unstable_scheduleCallback,Xe=i.unstable_cancelCallback,Ye=i.unstable_shouldYield,Ze=i.unstable_requestPaint,qe=i.unstable_now,Je=i.unstable_getCurrentPriorityLevel,$e=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,rt=i.unstable_LowPriority,nt=i.unstable_IdlePriority,it=null,At=null;var ot=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(at(e)/st|0)|0},at=Math.log,st=Math.LN2;var ut=64,ct=4194304;function lt(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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ft(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,A=e.pingedLanes,o=268435455&r;if(0!==o){var a=o&~i;0!==a?n=lt(a):0!==(A&=o)&&(n=lt(A))}else 0!==(o=r&~i)?n=lt(o):0!==A&&(n=lt(A));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(A=t&-t)||16===i&&4194240&A))return t;if(4&n&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-ot(t)),n|=e[r],t&=~i;return n}function dt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;default:return-1}}function ht(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function pt(){var e=ut;return!(4194240&(ut<<=1))&&(ut=64),e}function gt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function yt(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ot(t)]=r}function vt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ot(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var mt=0;function wt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var bt,Bt,Ct,Et,St,It=!1,Ot=[],Ft=null,_t=null,xt=null,Ut=new Map,Qt=new Map,Tt=[],Mt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Pt(e,t){switch(e){case"focusin":case"focusout":Ft=null;break;case"dragenter":case"dragleave":_t=null;break;case"mouseover":case"mouseout":xt=null;break;case"pointerover":case"pointerout":Ut.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qt.delete(t.pointerId)}}function Dt(e,t,r,n,i,A){return null===e||e.nativeEvent!==A?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:A,targetContainers:[i]},null!==t&&(null!==(t=mi(t))&&Bt(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function kt(e){var t=vi(e.target);if(null!==t){var r=je(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=Ve(r)))return e.blockedOn=t,void St(e.priority,function(){Ct(r)})}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Nt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Yt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=mi(r))&&Bt(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);we=n,r.target.dispatchEvent(n),we=null,t.shift()}return!0}function Rt(e,t,r){Nt(e)&&r.delete(t)}function Lt(){It=!1,null!==Ft&&Nt(Ft)&&(Ft=null),null!==_t&&Nt(_t)&&(_t=null),null!==xt&&Nt(xt)&&(xt=null),Ut.forEach(Rt),Qt.forEach(Rt)}function Ht(e,t){e.blockedOn===t&&(e.blockedOn=null,It||(It=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Lt)))}function jt(e){function t(t){return Ht(t,e)}if(0<Ot.length){Ht(Ot[0],e);for(var r=1;r<Ot.length;r++){var n=Ot[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Ft&&Ht(Ft,e),null!==_t&&Ht(_t,e),null!==xt&&Ht(xt,e),Ut.forEach(t),Qt.forEach(t),r=0;r<Tt.length;r++)(n=Tt[r]).blockedOn===e&&(n.blockedOn=null);for(;0<Tt.length&&null===(r=Tt[0]).blockedOn;)kt(r),null===r.blockedOn&&Tt.shift()}var Vt=w.ReactCurrentBatchConfig,Kt=!0;function zt(e,t,r,n){var i=mt,A=Vt.transition;Vt.transition=null;try{mt=1,Wt(e,t,r,n)}finally{mt=i,Vt.transition=A}}function Gt(e,t,r,n){var i=mt,A=Vt.transition;Vt.transition=null;try{mt=4,Wt(e,t,r,n)}finally{mt=i,Vt.transition=A}}function Wt(e,t,r,n){if(Kt){var i=Yt(e,t,r,n);if(null===i)Kn(e,t,n,Xt,r),Pt(e,n);else if(function(e,t,r,n,i){switch(t){case"focusin":return Ft=Dt(Ft,e,t,r,n,i),!0;case"dragenter":return _t=Dt(_t,e,t,r,n,i),!0;case"mouseover":return xt=Dt(xt,e,t,r,n,i),!0;case"pointerover":var A=i.pointerId;return Ut.set(A,Dt(Ut.get(A)||null,e,t,r,n,i)),!0;case"gotpointercapture":return A=i.pointerId,Qt.set(A,Dt(Qt.get(A)||null,e,t,r,n,i)),!0}return!1}(i,e,t,r,n))n.stopPropagation();else if(Pt(e,n),4&t&&-1<Mt.indexOf(e)){for(;null!==i;){var A=mi(i);if(null!==A&&bt(A),null===(A=Yt(e,t,r,n))&&Kn(e,t,n,Xt,r),A===i)break;i=A}null!==i&&n.stopPropagation()}else Kn(e,t,n,null,r)}}var Xt=null;function Yt(e,t,r,n){if(Xt=null,null!==(e=vi(e=be(n))))if(null===(t=je(e)))e=null;else if(13===(r=t.tag)){if(null!==(e=Ve(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Xt=e,null}function Zt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Je()){case $e:return 1;case et:return 4;case tt:case rt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var qt=null,Jt=null,$t=null;function er(){if($t)return $t;var e,t,r=Jt,n=r.length,i="value"in qt?qt.value:qt.textContent,A=i.length;for(e=0;e<n&&r[e]===i[e];e++);var o=n-e;for(t=1;t<=o&&r[n-t]===i[A-t];t++);return $t=i.slice(e,1<t?1-t:void 0)}function tr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rr(){return!0}function nr(){return!1}function ir(e){function t(t,r,n,i,A){for(var o in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=A,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rr:nr,this.isPropagationStopped=nr,this}return k(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),t}var Ar,or,ar,sr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ur=ir(sr),cr=k({},sr,{view:0,detail:0}),lr=ir(cr),fr=k({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ar&&(ar&&"mousemove"===e.type?(Ar=e.screenX-ar.screenX,or=e.screenY-ar.screenY):or=Ar=0,ar=e),Ar)},movementY:function(e){return"movementY"in e?e.movementY:or}}),dr=ir(fr),hr=ir(k({},fr,{dataTransfer:0})),pr=ir(k({},cr,{relatedTarget:0})),gr=ir(k({},sr,{animationName:0,elapsedTime:0,pseudoElement:0})),yr=k({},sr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vr=ir(yr),mr=ir(k({},sr,{data:0})),wr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},br={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Br={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Br[e])&&!!t[e]}function Er(){return Cr}var Sr=k({},cr,{key:function(e){if(e.key){var t=wr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?br[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(e){return"keypress"===e.type?tr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ir=ir(Sr),Or=ir(k({},fr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Fr=ir(k({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er})),_r=ir(k({},sr,{propertyName:0,elapsedTime:0,pseudoElement:0})),xr=k({},fr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ur=ir(xr),Qr=[9,13,27,32],Tr=c&&"CompositionEvent"in window,Mr=null;c&&"documentMode"in document&&(Mr=document.documentMode);var Pr=c&&"TextEvent"in window&&!Mr,Dr=c&&(!Tr||Mr&&8<Mr&&11>=Mr),kr=String.fromCharCode(32),Nr=!1;function Rr(e,t){switch(e){case"keyup":return-1!==Qr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lr(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Hr=!1;var jr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!jr[e.type]:"textarea"===t}function Kr(e,t,r,n){Ie(n),0<(t=Gn(t,"onChange")).length&&(r=new ur("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var zr=null,Gr=null;function Wr(e){Nn(e,0)}function Xr(e){if(W(wi(e)))return e}function Yr(e,t){if("change"===e)return t}var Zr=!1;if(c){var qr;if(c){var Jr="oninput"in document;if(!Jr){var $r=document.createElement("div");$r.setAttribute("oninput","return;"),Jr="function"==typeof $r.oninput}qr=Jr}else qr=!1;Zr=qr&&(!document.documentMode||9<document.documentMode)}function en(){zr&&(zr.detachEvent("onpropertychange",tn),Gr=zr=null)}function tn(e){if("value"===e.propertyName&&Xr(Gr)){var t=[];Kr(t,Gr,e,be(e)),Ue(Wr,t)}}function rn(e,t,r){"focusin"===e?(en(),Gr=r,(zr=t).attachEvent("onpropertychange",tn)):"focusout"===e&&en()}function nn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xr(Gr)}function An(e,t){if("click"===e)return Xr(t)}function on(e,t){if("input"===e||"change"===e)return Xr(t)}var an="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function sn(e,t){if(an(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!l.call(t,i)||!an(e[i],t[i]))return!1}return!0}function un(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cn(e,t){var r,n=un(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=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=un(n)}}function ln(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ln(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fn(){for(var e=window,t=X();t instanceof e.HTMLIFrameElement;){try{var r="string"==typeof t.contentWindow.location.href}catch(e){r=!1}if(!r)break;t=X((e=t.contentWindow).document)}return t}function dn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function hn(e){var t=fn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ln(r.ownerDocument.documentElement,r)){if(null!==n&&dn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,A=Math.min(n.start,i);n=void 0===n.end?A:Math.min(n.end,i),!e.extend&&A>n&&(i=n,n=A,A=i),i=cn(r,A);var o=cn(r,n);i&&o&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),A>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof r.focus&&r.focus(),r=0;r<t.length;r++)(e=t[r]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var pn=c&&"documentMode"in document&&11>=document.documentMode,gn=null,yn=null,vn=null,mn=!1;function wn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;mn||null==gn||gn!==X(n)||("selectionStart"in(n=gn)&&dn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},vn&&sn(vn,n)||(vn=n,0<(n=Gn(yn,"onSelect")).length&&(t=new ur("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=gn)))}function bn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Bn={animationend:bn("Animation","AnimationEnd"),animationiteration:bn("Animation","AnimationIteration"),animationstart:bn("Animation","AnimationStart"),transitionend:bn("Transition","TransitionEnd")},Cn={},En={};function Sn(e){if(Cn[e])return Cn[e];if(!Bn[e])return e;var t,r=Bn[e];for(t in r)if(r.hasOwnProperty(t)&&t in En)return Cn[e]=r[t];return e}c&&(En=document.createElement("div").style,"AnimationEvent"in window||(delete Bn.animationend.animation,delete Bn.animationiteration.animation,delete Bn.animationstart.animation),"TransitionEvent"in window||delete Bn.transitionend.transition);var In=Sn("animationend"),On=Sn("animationiteration"),Fn=Sn("animationstart"),_n=Sn("transitionend"),xn=new Map,Un="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Qn(e,t){xn.set(e,t),s(t,[e])}for(var Tn=0;Tn<Un.length;Tn++){var Mn=Un[Tn];Qn(Mn.toLowerCase(),"on"+(Mn[0].toUpperCase()+Mn.slice(1)))}Qn(In,"onAnimationEnd"),Qn(On,"onAnimationIteration"),Qn(Fn,"onAnimationStart"),Qn("dblclick","onDoubleClick"),Qn("focusin","onFocus"),Qn("focusout","onBlur"),Qn(_n,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dn=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pn));function kn(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,o,a,s,u){if(He.apply(this,arguments),De){if(!De)throw Error(A(198));var c=ke;De=!1,ke=null,Ne||(Ne=!0,Re=c)}}(n,t,void 0,e),e.currentTarget=null}function Nn(e,t){t=!!(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var A=void 0;if(t)for(var o=n.length-1;0<=o;o--){var a=n[o],s=a.instance,u=a.currentTarget;if(a=a.listener,s!==A&&i.isPropagationStopped())break e;kn(i,a,u),A=s}else for(o=0;o<n.length;o++){if(s=(a=n[o]).instance,u=a.currentTarget,a=a.listener,s!==A&&i.isPropagationStopped())break e;kn(i,a,u),A=s}}}if(Ne)throw e=Re,Ne=!1,Re=null,e}function Rn(e,t){var r=t[pi];void 0===r&&(r=t[pi]=new Set);var n=e+"__bubble";r.has(n)||(Vn(t,e,2,!1),r.add(n))}function Ln(e,t,r){var n=0;t&&(n|=4),Vn(r,e,n,t)}var Hn="_reactListening"+Math.random().toString(36).slice(2);function jn(e){if(!e[Hn]){e[Hn]=!0,o.forEach(function(t){"selectionchange"!==t&&(Dn.has(t)||Ln(t,!1,e),Ln(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Hn]||(t[Hn]=!0,Ln("selectionchange",!1,t))}}function Vn(e,t,r,n){switch(Zt(t)){case 1:var i=zt;break;case 4:i=Gt;break;default:i=Wt}r=i.bind(null,t,r,e),i=void 0,!Te||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Kn(e,t,r,n,i){var A=n;if(!(1&t||2&t||null===n))e:for(;;){if(null===n)return;var o=n.tag;if(3===o||4===o){var a=n.stateNode.containerInfo;if(a===i||8===a.nodeType&&a.parentNode===i)break;if(4===o)for(o=n.return;null!==o;){var s=o.tag;if((3===s||4===s)&&((s=o.stateNode.containerInfo)===i||8===s.nodeType&&s.parentNode===i))return;o=o.return}for(;null!==a;){if(null===(o=vi(a)))return;if(5===(s=o.tag)||6===s){n=A=o;continue e}a=a.parentNode}}n=n.return}Ue(function(){var n=A,i=be(r),o=[];e:{var a=xn.get(e);if(void 0!==a){var s=ur,u=e;switch(e){case"keypress":if(0===tr(r))break e;case"keydown":case"keyup":s=Ir;break;case"focusin":u="focus",s=pr;break;case"focusout":u="blur",s=pr;break;case"beforeblur":case"afterblur":s=pr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":s=dr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":s=hr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":s=Fr;break;case In:case On:case Fn:s=gr;break;case _n:s=_r;break;case"scroll":s=lr;break;case"wheel":s=Ur;break;case"copy":case"cut":case"paste":s=vr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":s=Or}var c=!!(4&t),l=!c&&"scroll"===e,f=c?null!==a?a+"Capture":null:a;c=[];for(var d,h=n;null!==h;){var p=(d=h).stateNode;if(5===d.tag&&null!==p&&(d=p,null!==f&&(null!=(p=Qe(h,f))&&c.push(zn(h,p,d)))),l)break;h=h.return}0<c.length&&(a=new s(a,u,null,r,i),o.push({event:a,listeners:c}))}}if(!(7&t)){if(s="mouseout"===e||"pointerout"===e,(!(a="mouseover"===e||"pointerover"===e)||r===we||!(u=r.relatedTarget||r.fromElement)||!vi(u)&&!u[hi])&&(s||a)&&(a=i.window===i?i:(a=i.ownerDocument)?a.defaultView||a.parentWindow:window,s?(s=n,null!==(u=(u=r.relatedTarget||r.toElement)?vi(u):null)&&(u!==(l=je(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(s=null,u=n),s!==u)){if(c=dr,p="onMouseLeave",f="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=Or,p="onPointerLeave",f="onPointerEnter",h="pointer"),l=null==s?a:wi(s),d=null==u?a:wi(u),(a=new c(p,h+"leave",s,r,i)).target=l,a.relatedTarget=d,p=null,vi(i)===n&&((c=new c(f,h+"enter",u,r,i)).target=d,c.relatedTarget=l,p=c),l=p,s&&u)e:{for(f=u,h=0,d=c=s;d;d=Wn(d))h++;for(d=0,p=f;p;p=Wn(p))d++;for(;0<h-d;)c=Wn(c),h--;for(;0<d-h;)f=Wn(f),d--;for(;h--;){if(c===f||null!==f&&c===f.alternate)break e;c=Wn(c),f=Wn(f)}c=null}else c=null;null!==s&&Xn(o,a,s,c,!1),null!==u&&null!==l&&Xn(o,l,u,c,!0)}if("select"===(s=(a=n?wi(n):window).nodeName&&a.nodeName.toLowerCase())||"input"===s&&"file"===a.type)var g=Yr;else if(Vr(a))if(Zr)g=on;else{g=nn;var y=rn}else(s=a.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===a.type||"radio"===a.type)&&(g=An);switch(g&&(g=g(e,n))?Kr(o,g,r,i):(y&&y(e,a,n),"focusout"===e&&(y=a._wrapperState)&&y.controlled&&"number"===a.type&&ee(a,"number",a.value)),y=n?wi(n):window,e){case"focusin":(Vr(y)||"true"===y.contentEditable)&&(gn=y,yn=n,vn=null);break;case"focusout":vn=yn=gn=null;break;case"mousedown":mn=!0;break;case"contextmenu":case"mouseup":case"dragend":mn=!1,wn(o,r,i);break;case"selectionchange":if(pn)break;case"keydown":case"keyup":wn(o,r,i)}var v;if(Tr)e:{switch(e){case"compositionstart":var m="onCompositionStart";break e;case"compositionend":m="onCompositionEnd";break e;case"compositionupdate":m="onCompositionUpdate";break e}m=void 0}else Hr?Rr(e,r)&&(m="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(m="onCompositionStart");m&&(Dr&&"ko"!==r.locale&&(Hr||"onCompositionStart"!==m?"onCompositionEnd"===m&&Hr&&(v=er()):(Jt="value"in(qt=i)?qt.value:qt.textContent,Hr=!0)),0<(y=Gn(n,m)).length&&(m=new mr(m,e,null,r,i),o.push({event:m,listeners:y}),v?m.data=v:null!==(v=Lr(r))&&(m.data=v))),(v=Pr?function(e,t){switch(e){case"compositionend":return Lr(t);case"keypress":return 32!==t.which?null:(Nr=!0,kr);case"textInput":return(e=t.data)===kr&&Nr?null:e;default:return null}}(e,r):function(e,t){if(Hr)return"compositionend"===e||!Tr&&Rr(e,t)?(e=er(),$t=Jt=qt=null,Hr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=Gn(n,"onBeforeInput")).length&&(i=new mr("onBeforeInput","beforeinput",null,r,i),o.push({event:i,listeners:n}),i.data=v))}Nn(o,t)})}function zn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Gn(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,A=i.stateNode;5===i.tag&&null!==A&&(i=A,null!=(A=Qe(e,r))&&n.unshift(zn(e,A,i)),null!=(A=Qe(e,t))&&n.push(zn(e,A,i))),e=e.return}return n}function Wn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Xn(e,t,r,n,i){for(var A=t._reactName,o=[];null!==r&&r!==n;){var a=r,s=a.alternate,u=a.stateNode;if(null!==s&&s===n)break;5===a.tag&&null!==u&&(a=u,i?null!=(s=Qe(r,A))&&o.unshift(zn(r,s,a)):i||null!=(s=Qe(r,A))&&o.push(zn(r,s,a))),r=r.return}0!==o.length&&e.push({event:t,listeners:o})}var Yn=/\r\n?/g,Zn=/\u0000|\uFFFD/g;function qn(e){return("string"==typeof e?e:""+e).replace(Yn,"\n").replace(Zn,"")}function Jn(e,t,r){if(t=qn(t),qn(e)!==t&&r)throw Error(A(425))}function $n(){}var ei=null,ti=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ni="function"==typeof setTimeout?setTimeout:void 0,ii="function"==typeof clearTimeout?clearTimeout:void 0,Ai="function"==typeof Promise?Promise:void 0,oi="function"==typeof queueMicrotask?queueMicrotask:void 0!==Ai?function(e){return Ai.resolve(null).then(e).catch(ai)}:ni;function ai(e){setTimeout(function(){throw e})}function si(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return e.removeChild(i),void jt(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);jt(t)}function ui(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ci(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var li=Math.random().toString(36).slice(2),fi="__reactFiber$"+li,di="__reactProps$"+li,hi="__reactContainer$"+li,pi="__reactEvents$"+li,gi="__reactListeners$"+li,yi="__reactHandles$"+li;function vi(e){var t=e[fi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[hi]||r[fi]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=ci(e);null!==e;){if(r=e[fi])return r;e=ci(e)}return t}r=(e=r).parentNode}return null}function mi(e){return!(e=e[fi]||e[hi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(A(33))}function bi(e){return e[di]||null}var Bi=[],Ci=-1;function Ei(e){return{current:e}}function Si(e){0>Ci||(e.current=Bi[Ci],Bi[Ci]=null,Ci--)}function Ii(e,t){Ci++,Bi[Ci]=e.current,e.current=t}var Oi={},Fi=Ei(Oi),_i=Ei(!1),xi=Oi;function Ui(e,t){var r=e.type.contextTypes;if(!r)return Oi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,A={};for(i in r)A[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=A),A}function Qi(e){return null!=(e=e.childContextTypes)}function Ti(){Si(_i),Si(Fi)}function Mi(e,t,r){if(Fi.current!==Oi)throw Error(A(168));Ii(Fi,t),Ii(_i,r)}function Pi(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!=typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in t))throw Error(A(108,V(e)||"Unknown",i));return k({},r,n)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,xi=Fi.current,Ii(Fi,e),Ii(_i,_i.current),!0}function ki(e,t,r){var n=e.stateNode;if(!n)throw Error(A(169));r?(e=Pi(e,t,xi),n.__reactInternalMemoizedMergedChildContext=e,Si(_i),Si(Fi),Ii(Fi,e)):Si(_i),Ii(_i,r)}var Ni=null,Ri=!1,Li=!1;function Hi(e){null===Ni?Ni=[e]:Ni.push(e)}function ji(){if(!Li&&null!==Ni){Li=!0;var e=0,t=mt;try{var r=Ni;for(mt=1;e<r.length;e++){var n=r[e];do{n=n(!0)}while(null!==n)}Ni=null,Ri=!1}catch(t){throw null!==Ni&&(Ni=Ni.slice(e+1)),We($e,ji),t}finally{mt=t,Li=!1}}return null}var Vi=[],Ki=0,zi=null,Gi=0,Wi=[],Xi=0,Yi=null,Zi=1,qi="";function Ji(e,t){Vi[Ki++]=Gi,Vi[Ki++]=zi,zi=e,Gi=t}function $i(e,t,r){Wi[Xi++]=Zi,Wi[Xi++]=qi,Wi[Xi++]=Yi,Yi=e;var n=Zi;e=qi;var i=32-ot(n)-1;n&=~(1<<i),r+=1;var A=32-ot(t)+i;if(30<A){var o=i-i%5;A=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Zi=1<<32-ot(t)+i|r<<i|n,qi=A+e}else Zi=1<<A|r<<i|n,qi=e}function eA(e){null!==e.return&&(Ji(e,1),$i(e,1,0))}function tA(e){for(;e===zi;)zi=Vi[--Ki],Vi[Ki]=null,Gi=Vi[--Ki],Vi[Ki]=null;for(;e===Yi;)Yi=Wi[--Xi],Wi[Xi]=null,qi=Wi[--Xi],Wi[Xi]=null,Zi=Wi[--Xi],Wi[Xi]=null}var rA=null,nA=null,iA=!1,AA=null;function oA(e,t){var r=xu(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,null===(t=e.deletions)?(e.deletions=[r],e.flags|=16):t.push(r)}function aA(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,rA=e,nA=ui(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,rA=e,nA=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(r=null!==Yi?{id:Zi,overflow:qi}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},(r=xu(18,null,null,0)).stateNode=t,r.return=e,e.child=r,rA=e,nA=null,!0);default:return!1}}function sA(e){return!(!(1&e.mode)||128&e.flags)}function uA(e){if(iA){var t=nA;if(t){var r=t;if(!aA(e,t)){if(sA(e))throw Error(A(418));t=ui(r.nextSibling);var n=rA;t&&aA(e,t)?oA(n,r):(e.flags=-4097&e.flags|2,iA=!1,rA=e)}}else{if(sA(e))throw Error(A(418));e.flags=-4097&e.flags|2,iA=!1,rA=e}}}function cA(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;rA=e}function lA(e){if(e!==rA)return!1;if(!iA)return cA(e),iA=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=nA)){if(sA(e))throw fA(),Error(A(418));for(;t;)oA(e,t),t=ui(t.nextSibling)}if(cA(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(A(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){nA=ui(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}nA=null}}else nA=rA?ui(e.stateNode.nextSibling):null;return!0}function fA(){for(var e=nA;e;)e=ui(e.nextSibling)}function dA(){nA=rA=null,iA=!1}function hA(e){null===AA?AA=[e]:AA.push(e)}var pA=w.ReactCurrentBatchConfig;function gA(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(A(309));var n=r.stateNode}if(!n)throw Error(A(147,e));var i=n,o=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===o?t.ref:(t=function(e){var t=i.refs;null===e?delete t[o]:t[o]=e},t._stringRef=o,t)}if("string"!=typeof e)throw Error(A(284));if(!r._owner)throw Error(A(290,e))}return e}function yA(e,t){throw e=Object.prototype.toString.call(t),Error(A(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vA(e){return(0,e._init)(e._payload)}function mA(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Qu(e,t)).index=0,e.sibling=null,e}function o(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=2,r):n:(t.flags|=2,r):(t.flags|=1048576,r)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function s(e,t,r,n){return null===t||6!==t.tag?((t=Du(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function u(e,t,r,n){var A=r.type;return A===C?l(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===A||"object"==typeof A&&null!==A&&A.$$typeof===Q&&vA(A)===t.type)?((n=i(t,r.props)).ref=gA(e,t,r),n.return=e,n):((n=Tu(r.type,r.key,r.props,null,e.mode,n)).ref=gA(e,t,r),n.return=e,n)}function c(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=ku(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function l(e,t,r,n,A){return null===t||7!==t.tag?((t=Mu(r,e.mode,n,A)).return=e,t):((t=i(t,r)).return=e,t)}function f(e,t,r){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Du(""+t,e.mode,r)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case b:return(r=Tu(t.type,t.key,t.props,null,e.mode,r)).ref=gA(e,null,t),r.return=e,r;case B:return(t=ku(t,e.mode,r)).return=e,t;case Q:return f(e,(0,t._init)(t._payload),r)}if(te(t)||P(t))return(t=Mu(t,e.mode,r,null)).return=e,t;yA(e,t)}return null}function d(e,t,r,n){var i=null!==t?t.key:null;if("string"==typeof r&&""!==r||"number"==typeof r)return null!==i?null:s(e,t,""+r,n);if("object"==typeof r&&null!==r){switch(r.$$typeof){case b:return r.key===i?u(e,t,r,n):null;case B:return r.key===i?c(e,t,r,n):null;case Q:return d(e,t,(i=r._init)(r._payload),n)}if(te(r)||P(r))return null!==i?null:l(e,t,r,n,null);yA(e,r)}return null}function h(e,t,r,n,i){if("string"==typeof n&&""!==n||"number"==typeof n)return s(t,e=e.get(r)||null,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case b:return u(t,e=e.get(null===n.key?r:n.key)||null,n,i);case B:return c(t,e=e.get(null===n.key?r:n.key)||null,n,i);case Q:return h(e,t,r,(0,n._init)(n._payload),i)}if(te(n)||P(n))return l(t,e=e.get(r)||null,n,i,null);yA(t,n)}return null}function p(i,A,a,s){for(var u=null,c=null,l=A,p=A=0,g=null;null!==l&&p<a.length;p++){l.index>p?(g=l,l=null):g=l.sibling;var y=d(i,l,a[p],s);if(null===y){null===l&&(l=g);break}e&&l&&null===y.alternate&&t(i,l),A=o(y,A,p),null===c?u=y:c.sibling=y,c=y,l=g}if(p===a.length)return r(i,l),iA&&Ji(i,p),u;if(null===l){for(;p<a.length;p++)null!==(l=f(i,a[p],s))&&(A=o(l,A,p),null===c?u=l:c.sibling=l,c=l);return iA&&Ji(i,p),u}for(l=n(i,l);p<a.length;p++)null!==(g=h(l,i,p,a[p],s))&&(e&&null!==g.alternate&&l.delete(null===g.key?p:g.key),A=o(g,A,p),null===c?u=g:c.sibling=g,c=g);return e&&l.forEach(function(e){return t(i,e)}),iA&&Ji(i,p),u}function g(i,a,s,u){var c=P(s);if("function"!=typeof c)throw Error(A(150));if(null==(s=c.call(s)))throw Error(A(151));for(var l=c=null,p=a,g=a=0,y=null,v=s.next();null!==p&&!v.done;g++,v=s.next()){p.index>g?(y=p,p=null):y=p.sibling;var m=d(i,p,v.value,u);if(null===m){null===p&&(p=y);break}e&&p&&null===m.alternate&&t(i,p),a=o(m,a,g),null===l?c=m:l.sibling=m,l=m,p=y}if(v.done)return r(i,p),iA&&Ji(i,g),c;if(null===p){for(;!v.done;g++,v=s.next())null!==(v=f(i,v.value,u))&&(a=o(v,a,g),null===l?c=v:l.sibling=v,l=v);return iA&&Ji(i,g),c}for(p=n(i,p);!v.done;g++,v=s.next())null!==(v=h(p,i,g,v.value,u))&&(e&&null!==v.alternate&&p.delete(null===v.key?g:v.key),a=o(v,a,g),null===l?c=v:l.sibling=v,l=v);return e&&p.forEach(function(e){return t(i,e)}),iA&&Ji(i,g),c}return function e(n,A,o,s){if("object"==typeof o&&null!==o&&o.type===C&&null===o.key&&(o=o.props.children),"object"==typeof o&&null!==o){switch(o.$$typeof){case b:e:{for(var u=o.key,c=A;null!==c;){if(c.key===u){if((u=o.type)===C){if(7===c.tag){r(n,c.sibling),(A=i(c,o.props.children)).return=n,n=A;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===Q&&vA(u)===c.type){r(n,c.sibling),(A=i(c,o.props)).ref=gA(n,c,o),A.return=n,n=A;break e}r(n,c);break}t(n,c),c=c.sibling}o.type===C?((A=Mu(o.props.children,n.mode,s,o.key)).return=n,n=A):((s=Tu(o.type,o.key,o.props,null,n.mode,s)).ref=gA(n,A,o),s.return=n,n=s)}return a(n);case B:e:{for(c=o.key;null!==A;){if(A.key===c){if(4===A.tag&&A.stateNode.containerInfo===o.containerInfo&&A.stateNode.implementation===o.implementation){r(n,A.sibling),(A=i(A,o.children||[])).return=n,n=A;break e}r(n,A);break}t(n,A),A=A.sibling}(A=ku(o,n.mode,s)).return=n,n=A}return a(n);case Q:return e(n,A,(c=o._init)(o._payload),s)}if(te(o))return p(n,A,o,s);if(P(o))return g(n,A,o,s);yA(n,o)}return"string"==typeof o&&""!==o||"number"==typeof o?(o=""+o,null!==A&&6===A.tag?(r(n,A.sibling),(A=i(A,o)).return=n,n=A):(r(n,A),(A=Du(o,n.mode,s)).return=n,n=A),a(n)):r(n,A)}}var wA=mA(!0),bA=mA(!1),BA=Ei(null),CA=null,EA=null,SA=null;function IA(){SA=EA=CA=null}function OA(e){var t=BA.current;Si(BA),e._currentValue=t}function FA(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function _A(e,t){CA=e,SA=EA=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ma=!0),e.firstContext=null)}function xA(e){var t=e._currentValue;if(SA!==e)if(e={context:e,memoizedValue:t,next:null},null===EA){if(null===CA)throw Error(A(308));EA=e,CA.dependencies={lanes:0,firstContext:e}}else EA=EA.next=e;return t}var UA=null;function QA(e){null===UA?UA=[e]:UA.push(e)}function TA(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,QA(t)):(r.next=i.next,i.next=r),t.interleaved=r,MA(e,n)}function MA(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var PA=!1;function DA(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kA(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 NA(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function RA(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,2&Os){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,MA(e,r)}return null===(i=n.interleaved)?(t.next=t,QA(n)):(t.next=i.next,i.next=t),n.interleaved=t,MA(e,r)}function LA(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,vt(e,r)}}function HA(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,A=null;if(null!==(r=r.firstBaseUpdate)){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===A?i=A=o:A=A.next=o,r=r.next}while(null!==r);null===A?i=A=t:A=A.next=t}else i=A=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:A,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function jA(e,t,r,n){var i=e.updateQueue;PA=!1;var A=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(null!==a){i.shared.pending=null;var s=a,u=s.next;s.next=null,null===o?A=u:o.next=u,o=s;var c=e.alternate;null!==c&&((a=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===a?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=s))}if(null!==A){var l=i.baseState;for(o=0,c=u=s=null,a=A;;){var f=a.lane,d=a.eventTime;if((n&f)===f){null!==c&&(c=c.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,p=a;switch(f=t,d=r,p.tag){case 1:if("function"==typeof(h=p.payload)){l=h.call(d,l,f);break e}l=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(f="function"==typeof(h=p.payload)?h.call(d,l,f):h))break e;l=k({},l,f);break e;case 2:PA=!0}}null!==a.callback&&0!==a.lane&&(e.flags|=64,null===(f=i.effects)?i.effects=[a]:f.push(a))}else d={eventTime:d,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=d,s=l):c=c.next=d,o|=f;if(null===(a=a.next)){if(null===(a=i.shared.pending))break;a=(f=a).next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}if(null===c&&(s=l),i.baseState=s,i.firstBaseUpdate=u,i.lastBaseUpdate=c,null!==(t=i.shared.interleaved)){i=t;do{o|=i.lane,i=i.next}while(i!==t)}else null===A&&(i.shared.lanes=0);Ps|=o,e.lanes=o,e.memoizedState=l}}function VA(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!=typeof i)throw Error(A(191,i));i.call(n)}}}var KA={},zA=Ei(KA),GA=Ei(KA),WA=Ei(KA);function XA(e){if(e===KA)throw Error(A(174));return e}function YA(e,t){switch(Ii(WA,t),Ii(GA,e),Ii(zA,KA),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:se(null,"");break;default:t=se(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Si(zA),Ii(zA,t)}function ZA(){Si(zA),Si(GA),Si(WA)}function qA(e){XA(WA.current);var t=XA(zA.current),r=se(t,e.type);t!==r&&(Ii(GA,e),Ii(zA,r))}function JA(e){GA.current===e&&(Si(zA),Si(GA))}var $A=Ei(0);function eo(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=[];function ro(){for(var e=0;e<to.length;e++)to[e]._workInProgressVersionPrimary=null;to.length=0}var no=w.ReactCurrentDispatcher,io=w.ReactCurrentBatchConfig,Ao=0,oo=null,ao=null,so=null,uo=!1,co=!1,lo=0,fo=0;function ho(){throw Error(A(321))}function po(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!an(e[r],t[r]))return!1;return!0}function go(e,t,r,n,i,o){if(Ao=o,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,no.current=null===e||null===e.memoizedState?$o:ea,e=r(n,i),co){o=0;do{if(co=!1,lo=0,25<=o)throw Error(A(301));o+=1,so=ao=null,t.updateQueue=null,no.current=ta,e=r(n,i)}while(co)}if(no.current=Jo,t=null!==ao&&null!==ao.next,Ao=0,so=ao=oo=null,uo=!1,t)throw Error(A(300));return e}function yo(){var e=0!==lo;return lo=0,e}function vo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===so?oo.memoizedState=so=e:so=so.next=e,so}function mo(){if(null===ao){var e=oo.alternate;e=null!==e?e.memoizedState:null}else e=ao.next;var t=null===so?oo.memoizedState:so.next;if(null!==t)so=t,ao=e;else{if(null===e)throw Error(A(310));e={memoizedState:(ao=e).memoizedState,baseState:ao.baseState,baseQueue:ao.baseQueue,queue:ao.queue,next:null},null===so?oo.memoizedState=so=e:so=so.next=e}return so}function wo(e,t){return"function"==typeof t?t(e):t}function bo(e){var t=mo(),r=t.queue;if(null===r)throw Error(A(311));r.lastRenderedReducer=e;var n=ao,i=n.baseQueue,o=r.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}n.baseQueue=i=o,r.pending=null}if(null!==i){o=i.next,n=n.baseState;var s=a=null,u=null,c=o;do{var l=c.lane;if((Ao&l)===l)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var f={lane:l,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(s=u=f,a=n):u=u.next=f,oo.lanes|=l,Ps|=l}c=c.next}while(null!==c&&c!==o);null===u?a=n:u.next=s,an(n,t.memoizedState)||(ma=!0),t.memoizedState=n,t.baseState=a,t.baseQueue=u,r.lastRenderedState=n}if(null!==(e=r.interleaved)){i=e;do{o=i.lane,oo.lanes|=o,Ps|=o,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Bo(e){var t=mo(),r=t.queue;if(null===r)throw Error(A(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,o=t.memoizedState;if(null!==i){r.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);an(o,t.memoizedState)||(ma=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function Co(){}function Eo(e,t){var r=oo,n=mo(),i=t(),o=!an(n.memoizedState,i);if(o&&(n.memoizedState=i,ma=!0),n=n.queue,Do(Oo.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||null!==so&&1&so.memoizedState.tag){if(r.flags|=2048,Uo(9,Io.bind(null,r,n,i,t),void 0,null),null===Fs)throw Error(A(349));30&Ao||So(r,t,i)}return i}function So(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=oo.updateQueue)?(t={lastEffect:null,stores:null},oo.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function Io(e,t,r,n){t.value=r,t.getSnapshot=n,Fo(t)&&_o(e)}function Oo(e,t,r){return r(function(){Fo(t)&&_o(e)})}function Fo(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!an(e,r)}catch(e){return!0}}function _o(e){var t=MA(e,1);null!==t&&tu(t,e,1,-1)}function xo(e){var t=vo();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wo,lastRenderedState:e},t.queue=e,e=e.dispatch=Xo.bind(null,oo,e),[t.memoizedState,e]}function Uo(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=oo.updateQueue)?(t={lastEffect:null,stores:null},oo.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Qo(){return mo().memoizedState}function To(e,t,r,n){var i=vo();oo.flags|=e,i.memoizedState=Uo(1|t,r,void 0,void 0===n?null:n)}function Mo(e,t,r,n){var i=mo();n=void 0===n?null:n;var A=void 0;if(null!==ao){var o=ao.memoizedState;if(A=o.destroy,null!==n&&po(n,o.deps))return void(i.memoizedState=Uo(t,r,A,n))}oo.flags|=e,i.memoizedState=Uo(1|t,r,A,n)}function Po(e,t){return To(8390656,8,e,t)}function Do(e,t){return Mo(2048,8,e,t)}function ko(e,t){return Mo(4,2,e,t)}function No(e,t){return Mo(4,4,e,t)}function Ro(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Lo(e,t,r){return r=null!=r?r.concat([e]):null,Mo(4,4,Ro.bind(null,t,e),r)}function Ho(){}function jo(e,t){var r=mo();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&po(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Vo(e,t){var r=mo();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&po(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Ko(e,t,r){return 21&Ao?(an(r,t)||(r=pt(),oo.lanes|=r,Ps|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ma=!0),e.memoizedState=r)}function zo(e,t){var r=mt;mt=0!==r&&4>r?r:4,e(!0);var n=io.transition;io.transition={};try{e(!1),t()}finally{mt=r,io.transition=n}}function Go(){return mo().memoizedState}function Wo(e,t,r){var n=eu(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Yo(e))Zo(t,r);else if(null!==(r=TA(e,t,r,n))){tu(r,e,n,$s()),qo(r,t,n)}}function Xo(e,t,r){var n=eu(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Yo(e))Zo(t,i);else{var A=e.alternate;if(0===e.lanes&&(null===A||0===A.lanes)&&null!==(A=t.lastRenderedReducer))try{var o=t.lastRenderedState,a=A(o,r);if(i.hasEagerState=!0,i.eagerState=a,an(a,o)){var s=t.interleaved;return null===s?(i.next=i,QA(t)):(i.next=s.next,s.next=i),void(t.interleaved=i)}}catch(e){}null!==(r=TA(e,t,i,n))&&(tu(r,e,n,i=$s()),qo(r,t,n))}}function Yo(e){var t=e.alternate;return e===oo||null!==t&&t===oo}function Zo(e,t){co=uo=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function qo(e,t,r){if(4194240&r){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,vt(e,r)}}var Jo={readContext:xA,useCallback:ho,useContext:ho,useEffect:ho,useImperativeHandle:ho,useInsertionEffect:ho,useLayoutEffect:ho,useMemo:ho,useReducer:ho,useRef:ho,useState:ho,useDebugValue:ho,useDeferredValue:ho,useTransition:ho,useMutableSource:ho,useSyncExternalStore:ho,useId:ho,unstable_isNewReconciler:!1},$o={readContext:xA,useCallback:function(e,t){return vo().memoizedState=[e,void 0===t?null:t],e},useContext:xA,useEffect:Po,useImperativeHandle:function(e,t,r){return r=null!=r?r.concat([e]):null,To(4194308,4,Ro.bind(null,t,e),r)},useLayoutEffect:function(e,t){return To(4194308,4,e,t)},useInsertionEffect:function(e,t){return To(4,2,e,t)},useMemo:function(e,t){var r=vo();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=vo();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=Wo.bind(null,oo,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},vo().memoizedState=e},useState:xo,useDebugValue:Ho,useDeferredValue:function(e){return vo().memoizedState=e},useTransition:function(){var e=xo(!1),t=e[0];return e=zo.bind(null,e[1]),vo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=oo,i=vo();if(iA){if(void 0===r)throw Error(A(407));r=r()}else{if(r=t(),null===Fs)throw Error(A(349));30&Ao||So(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,Po(Oo.bind(null,n,o,e),[e]),n.flags|=2048,Uo(9,Io.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=vo(),t=Fs.identifierPrefix;if(iA){var r=qi;t=":"+t+"R"+(r=(Zi&~(1<<32-ot(Zi)-1)).toString(32)+r),0<(r=lo++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=fo++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ea={readContext:xA,useCallback:jo,useContext:xA,useEffect:Do,useImperativeHandle:Lo,useInsertionEffect:ko,useLayoutEffect:No,useMemo:Vo,useReducer:bo,useRef:Qo,useState:function(){return bo(wo)},useDebugValue:Ho,useDeferredValue:function(e){return Ko(mo(),ao.memoizedState,e)},useTransition:function(){return[bo(wo)[0],mo().memoizedState]},useMutableSource:Co,useSyncExternalStore:Eo,useId:Go,unstable_isNewReconciler:!1},ta={readContext:xA,useCallback:jo,useContext:xA,useEffect:Do,useImperativeHandle:Lo,useInsertionEffect:ko,useLayoutEffect:No,useMemo:Vo,useReducer:Bo,useRef:Qo,useState:function(){return Bo(wo)},useDebugValue:Ho,useDeferredValue:function(e){var t=mo();return null===ao?t.memoizedState=e:Ko(t,ao.memoizedState,e)},useTransition:function(){return[Bo(wo)[0],mo().memoizedState]},useMutableSource:Co,useSyncExternalStore:Eo,useId:Go,unstable_isNewReconciler:!1};function ra(e,t){if(e&&e.defaultProps){for(var r in t=k({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}function na(e,t,r,n){r=null==(r=r(n,t=e.memoizedState))?t:k({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var ia={isMounted:function(e){return!!(e=e._reactInternals)&&je(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=$s(),i=eu(e),A=NA(n,i);A.payload=t,null!=r&&(A.callback=r),null!==(t=RA(e,A,i))&&(tu(t,e,i,n),LA(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=$s(),i=eu(e),A=NA(n,i);A.tag=1,A.payload=t,null!=r&&(A.callback=r),null!==(t=RA(e,A,i))&&(tu(t,e,i,n),LA(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=$s(),n=eu(e),i=NA(r,n);i.tag=2,null!=t&&(i.callback=t),null!==(t=RA(e,i,n))&&(tu(t,e,n,r),LA(t,e,n))}};function Aa(e,t,r,n,i,A,o){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,A,o):!t.prototype||!t.prototype.isPureReactComponent||(!sn(r,n)||!sn(i,A))}function oa(e,t,r){var n=!1,i=Oi,A=t.contextType;return"object"==typeof A&&null!==A?A=xA(A):(i=Qi(t)?xi:Fi.current,A=(n=null!=(n=t.contextTypes))?Ui(e,i):Oi),t=new t(r,A),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ia,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=A),t}function aa(e,t,r,n){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ia.enqueueReplaceState(t,t.state,null)}function sa(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},DA(e);var A=t.contextType;"object"==typeof A&&null!==A?i.context=xA(A):(A=Qi(t)?xi:Fi.current,i.context=Ui(e,A)),i.state=e.memoizedState,"function"==typeof(A=t.getDerivedStateFromProps)&&(na(e,t,A,r),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ia.enqueueReplaceState(i,i.state,null),jA(e,r,i,n),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function ua(e,t){try{var r="",n=t;do{r+=H(n),n=n.return}while(n);var i=r}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function ca(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function la(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var fa="function"==typeof WeakMap?WeakMap:Map;function da(e,t,r){(r=NA(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Vs||(Vs=!0,Ks=n),la(0,t)},r}function ha(e,t,r){(r=NA(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"==typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){la(0,t)}}var A=e.stateNode;return null!==A&&"function"==typeof A.componentDidCatch&&(r.callback=function(){la(0,t),"function"!=typeof n&&(null===zs?zs=new Set([this]):zs.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function pa(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new fa;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=Eu.bind(null,e,t,r),t.then(e,e))}function ga(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ya(e,t,r,n,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=NA(-1,1)).tag=2,RA(r,t,1))),r.lanes|=1),e)}var va=w.ReactCurrentOwner,ma=!1;function wa(e,t,r,n){t.child=null===e?bA(t,null,r,n):wA(t,e.child,r,n)}function ba(e,t,r,n,i){r=r.render;var A=t.ref;return _A(t,i),n=go(e,t,r,n,A,i),r=yo(),null===e||ma?(iA&&r&&eA(t),t.flags|=1,wa(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i))}function Ba(e,t,r,n,i){if(null===e){var A=r.type;return"function"!=typeof A||Uu(A)||void 0!==A.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Tu(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=A,Ca(e,t,A,n,i))}if(A=e.child,0===(e.lanes&i)){var o=A.memoizedProps;if((r=null!==(r=r.compare)?r:sn)(o,n)&&e.ref===t.ref)return Va(e,t,i)}return t.flags|=1,(e=Qu(A,n)).ref=t.ref,e.return=t,t.child=e}function Ca(e,t,r,n,i){if(null!==e){var A=e.memoizedProps;if(sn(A,n)&&e.ref===t.ref){if(ma=!1,t.pendingProps=n=A,0===(e.lanes&i))return t.lanes=e.lanes,Va(e,t,i);131072&e.flags&&(ma=!0)}}return Ia(e,t,r,n,i)}function Ea(e,t,r){var n=t.pendingProps,i=n.children,A=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(1&t.mode){if(!(1073741824&r))return e=null!==A?A.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ii(Qs,Us),Us|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==A?A.baseLanes:r,Ii(Qs,Us),Us|=n}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Qs,Us),Us|=r;else null!==A?(n=A.baseLanes|r,t.memoizedState=null):n=r,Ii(Qs,Us),Us|=n;return wa(e,t,i,r),t.child}function Sa(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Ia(e,t,r,n,i){var A=Qi(r)?xi:Fi.current;return A=Ui(t,A),_A(t,i),r=go(e,t,r,n,A,i),n=yo(),null===e||ma?(iA&&n&&eA(t),t.flags|=1,wa(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i))}function Oa(e,t,r,n,i){if(Qi(r)){var A=!0;Di(t)}else A=!1;if(_A(t,i),null===t.stateNode)ja(e,t),oa(t,r,n),sa(t,r,n,i),n=!0;else if(null===e){var o=t.stateNode,a=t.memoizedProps;o.props=a;var s=o.context,u=r.contextType;"object"==typeof u&&null!==u?u=xA(u):u=Ui(t,u=Qi(r)?xi:Fi.current);var c=r.getDerivedStateFromProps,l="function"==typeof c||"function"==typeof o.getSnapshotBeforeUpdate;l||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==n||s!==u)&&aa(t,o,n,u),PA=!1;var f=t.memoizedState;o.state=f,jA(t,n,o,i),s=t.memoizedState,a!==n||f!==s||_i.current||PA?("function"==typeof c&&(na(t,r,c,n),s=t.memoizedState),(a=PA||Aa(t,r,a,n,f,s,u))?(l||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=s),o.props=n,o.state=s,o.context=u,n=a):("function"==typeof o.componentDidMount&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,kA(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ra(t.type,a),o.props=u,l=t.pendingProps,f=o.context,"object"==typeof(s=r.contextType)&&null!==s?s=xA(s):s=Ui(t,s=Qi(r)?xi:Fi.current);var d=r.getDerivedStateFromProps;(c="function"==typeof d||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==l||f!==s)&&aa(t,o,n,s),PA=!1,f=t.memoizedState,o.state=f,jA(t,n,o,i);var h=t.memoizedState;a!==l||f!==h||_i.current||PA?("function"==typeof d&&(na(t,r,d,n),h=t.memoizedState),(u=PA||Aa(t,r,u,n,f,h,s)||!1)?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(n,h,s),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(n,h,s)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=h),o.props=n,o.state=h,o.context=s,n=u):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),n=!1)}return Fa(e,t,r,n,A,i)}function Fa(e,t,r,n,i,A){Sa(e,t);var o=!!(128&t.flags);if(!n&&!o)return i&&ki(t,r,!1),Va(e,t,A);n=t.stateNode,va.current=t;var a=o&&"function"!=typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&o?(t.child=wA(t,e.child,null,A),t.child=wA(t,null,a,A)):wa(e,t,a,A),t.memoizedState=n.state,i&&ki(t,r,!0),t.child}function _a(e){var t=e.stateNode;t.pendingContext?Mi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Mi(0,t.context,!1),YA(e,t.containerInfo)}function xa(e,t,r,n,i){return dA(),hA(i),t.flags|=256,wa(e,t,r,n),t.child}var Ua,Qa,Ta,Ma={dehydrated:null,treeContext:null,retryLane:0};function Pa(e){return{baseLanes:e,cachePool:null,transitions:null}}function Da(e,t,r){var n,i=t.pendingProps,o=$A.current,a=!1,s=!!(128&t.flags);if((n=s)||(n=(null===e||null!==e.memoizedState)&&!!(2&o)),n?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(o|=1),Ii($A,1&o),null===e)return uA(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=i.children,e=i.fallback,a?(i=t.mode,a=t.child,s={mode:"hidden",children:s},1&i||null===a?a=Pu(s,i,0,null):(a.childLanes=0,a.pendingProps=s),e=Mu(e,i,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Pa(r),t.memoizedState=Ma,e):ka(t,s));if(null!==(o=e.memoizedState)&&null!==(n=o.dehydrated))return function(e,t,r,n,i,o,a){if(r)return 256&t.flags?(t.flags&=-257,Na(e,t,a,n=ca(Error(A(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(o=n.fallback,i=t.mode,n=Pu({mode:"visible",children:n.children},i,0,null),(o=Mu(o,i,a,null)).flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,1&t.mode&&wA(t,e.child,null,a),t.child.memoizedState=Pa(a),t.memoizedState=Ma,o);if(!(1&t.mode))return Na(e,t,a,null);if("$!"===i.data){if(n=i.nextSibling&&i.nextSibling.dataset)var s=n.dgst;return n=s,Na(e,t,a,n=ca(o=Error(A(419)),n,void 0))}if(s=0!==(a&e.childLanes),ma||s){if(null!==(n=Fs)){switch(a&-a){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(n.suspendedLanes|a))?0:i)&&i!==o.retryLane&&(o.retryLane=i,MA(e,i),tu(n,e,i,-1))}return hu(),Na(e,t,a,n=ca(Error(A(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Iu.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,nA=ui(i.nextSibling),rA=t,iA=!0,AA=null,null!==e&&(Wi[Xi++]=Zi,Wi[Xi++]=qi,Wi[Xi++]=Yi,Zi=e.id,qi=e.overflow,Yi=t),t=ka(t,n.children),t.flags|=4096,t)}(e,t,s,i,n,o,r);if(a){a=i.fallback,s=t.mode,n=(o=e.child).sibling;var u={mode:"hidden",children:i.children};return 1&s||t.child===o?(i=Qu(o,u)).subtreeFlags=14680064&o.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=u,t.deletions=null),null!==n?a=Qu(n,a):(a=Mu(a,s,r,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,s=null===(s=e.child.memoizedState)?Pa(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~r,t.memoizedState=Ma,i}return e=(a=e.child).sibling,i=Qu(a,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function ka(e,t){return(t=Pu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Na(e,t,r,n){return null!==n&&hA(n),wA(t,e.child,null,r),(e=ka(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ra(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),FA(e.return,t,r)}function La(e,t,r,n,i){var A=e.memoizedState;null===A?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(A.isBackwards=t,A.rendering=null,A.renderingStartTime=0,A.last=n,A.tail=r,A.tailMode=i)}function Ha(e,t,r){var n=t.pendingProps,i=n.revealOrder,A=n.tail;if(wa(e,t,n.children,r),2&(n=$A.current))n=1&n|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ra(e,r,t);else if(19===e.tag)Ra(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ii($A,n),1&t.mode)switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===eo(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),La(t,!1,i,r,A);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===eo(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}La(t,!0,r,null,A);break;case"together":La(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function ja(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Va(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Ps|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(A(153));if(null!==t.child){for(r=Qu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Qu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Ka(e,t){if(!iA)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function za(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Ga(e,t,r){var n=t.pendingProps;switch(tA(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return za(t),null;case 1:case 17:return Qi(t.type)&&Ti(),za(t),null;case 3:return n=t.stateNode,ZA(),Si(_i),Si(Fi),ro(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(lA(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==AA&&(Au(AA),AA=null))),za(t),null;case 5:JA(t);var i=XA(WA.current);if(r=t.type,null!==e&&null!=t.stateNode)Qa(e,t,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(A(166));return za(t),null}if(e=XA(zA.current),lA(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[fi]=t,n[di]=o,e=!!(1&t.mode),r){case"dialog":Rn("cancel",n),Rn("close",n);break;case"iframe":case"object":case"embed":Rn("load",n);break;case"video":case"audio":for(i=0;i<Pn.length;i++)Rn(Pn[i],n);break;case"source":Rn("error",n);break;case"img":case"image":case"link":Rn("error",n),Rn("load",n);break;case"details":Rn("toggle",n);break;case"input":Z(n,o),Rn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},Rn("invalid",n);break;case"textarea":ie(n,o),Rn("invalid",n)}for(var s in ve(r,o),i=null,o)if(o.hasOwnProperty(s)){var u=o[s];"children"===s?"string"==typeof u?n.textContent!==u&&(!0!==o.suppressHydrationWarning&&Jn(n.textContent,u,e),i=["children",u]):"number"==typeof u&&n.textContent!==""+u&&(!0!==o.suppressHydrationWarning&&Jn(n.textContent,u,e),i=["children",""+u]):a.hasOwnProperty(s)&&null!=u&&"onScroll"===s&&Rn("scroll",n)}switch(r){case"input":G(n),$(n,o,!0);break;case"textarea":G(n),oe(n);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(n.onclick=$n)}n=i,t.updateQueue=n,null!==n&&(t.flags|=4)}else{s=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ae(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof n.is?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),"select"===r&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[fi]=t,e[di]=n,Ua(e,t),t.stateNode=e;e:{switch(s=me(r,n),r){case"dialog":Rn("cancel",e),Rn("close",e),i=n;break;case"iframe":case"object":case"embed":Rn("load",e),i=n;break;case"video":case"audio":for(i=0;i<Pn.length;i++)Rn(Pn[i],e);i=n;break;case"source":Rn("error",e),i=n;break;case"img":case"image":case"link":Rn("error",e),Rn("load",e),i=n;break;case"details":Rn("toggle",e),i=n;break;case"input":Z(e,n),i=Y(e,n),Rn("invalid",e);break;case"option":default:i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=k({},n,{value:void 0}),Rn("invalid",e);break;case"textarea":ie(e,n),i=ne(e,n),Rn("invalid",e)}for(o in ve(r,i),u=i)if(u.hasOwnProperty(o)){var c=u[o];"style"===o?ge(e,c):"dangerouslySetInnerHTML"===o?null!=(c=c?c.__html:void 0)&&le(e,c):"children"===o?"string"==typeof c?("textarea"!==r||""!==c)&&fe(e,c):"number"==typeof c&&fe(e,""+c):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(a.hasOwnProperty(o)?null!=c&&"onScroll"===o&&Rn("scroll",e):null!=c&&m(e,o,c,s))}switch(r){case"input":G(e),$(e,n,!1);break;case"textarea":G(e),oe(e);break;case"option":null!=n.value&&e.setAttribute("value",""+K(n.value));break;case"select":e.multiple=!!n.multiple,null!=(o=n.value)?re(e,!!n.multiple,o,!1):null!=n.defaultValue&&re(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof i.onClick&&(e.onclick=$n)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return za(t),null;case 6:if(e&&null!=t.stateNode)Ta(0,t,e.memoizedProps,n);else{if("string"!=typeof n&&null===t.stateNode)throw Error(A(166));if(r=XA(WA.current),XA(zA.current),lA(t)){if(n=t.stateNode,r=t.memoizedProps,n[fi]=t,(o=n.nodeValue!==r)&&null!==(e=rA))switch(e.tag){case 3:Jn(n.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Jn(n.nodeValue,r,!!(1&e.mode))}o&&(t.flags|=4)}else(n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[fi]=t,t.stateNode=n}return za(t),null;case 13:if(Si($A),n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(iA&&null!==nA&&1&t.mode&&!(128&t.flags))fA(),dA(),t.flags|=98560,o=!1;else if(o=lA(t),null!==n&&null!==n.dehydrated){if(null===e){if(!o)throw Error(A(318));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(A(317));o[fi]=t}else dA(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;za(t),o=!1}else null!==AA&&(Au(AA),AA=null),o=!0;if(!o)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((n=null!==n)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,1&t.mode&&(null===e||1&$A.current?0===Ts&&(Ts=3):hu())),null!==t.updateQueue&&(t.flags|=4),za(t),null);case 4:return ZA(),null===e&&jn(t.stateNode.containerInfo),za(t),null;case 10:return OA(t.type._context),za(t),null;case 19:if(Si($A),null===(o=t.memoizedState))return za(t),null;if(n=!!(128&t.flags),null===(s=o.rendering))if(n)Ka(o,!1);else{if(0!==Ts||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(s=eo(e))){for(t.flags|=128,Ka(o,!1),null!==(n=s.updateQueue)&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;null!==r;)e=n,(o=r).flags&=14680066,null===(s=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ii($A,1&$A.current|2),t.child}e=e.sibling}null!==o.tail&&qe()>Hs&&(t.flags|=128,n=!0,Ka(o,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=eo(s))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Ka(o,!0),null===o.tail&&"hidden"===o.tailMode&&!s.alternate&&!iA)return za(t),null}else 2*qe()-o.renderingStartTime>Hs&&1073741824!==r&&(t.flags|=128,n=!0,Ka(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(null!==(r=o.last)?r.sibling=s:t.child=s,o.last=s)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=qe(),t.sibling=null,r=$A.current,Ii($A,n?1&r|2:1&r),t):(za(t),null);case 22:case 23:return cu(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&1&t.mode?!!(1073741824&Us)&&(za(t),6&t.subtreeFlags&&(t.flags|=8192)):za(t),null;case 24:case 25:return null}throw Error(A(156,t.tag))}function Wa(e,t){switch(tA(t),t.tag){case 1:return Qi(t.type)&&Ti(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ZA(),Si(_i),Si(Fi),ro(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return JA(t),null;case 13:if(Si($A),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(A(340));dA()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Si($A),null;case 4:return ZA(),null;case 10:return OA(t.type._context),null;case 22:case 23:return cu(),null;default:return null}}Ua=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Qa=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,XA(zA.current);var A,o=null;switch(r){case"input":i=Y(e,i),n=Y(e,n),o=[];break;case"select":i=k({},i,{value:void 0}),n=k({},n,{value:void 0}),o=[];break;case"textarea":i=ne(e,i),n=ne(e,n),o=[];break;default:"function"!=typeof i.onClick&&"function"==typeof n.onClick&&(e.onclick=$n)}for(c in ve(r,n),r=null,i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var s=i[c];for(A in s)s.hasOwnProperty(A)&&(r||(r={}),r[A]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(a.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var u=n[c];if(s=null!=i?i[c]:void 0,n.hasOwnProperty(c)&&u!==s&&(null!=u||null!=s))if("style"===c)if(s){for(A in s)!s.hasOwnProperty(A)||u&&u.hasOwnProperty(A)||(r||(r={}),r[A]="");for(A in u)u.hasOwnProperty(A)&&s[A]!==u[A]&&(r||(r={}),r[A]=u[A])}else r||(o||(o=[]),o.push(c,r)),r=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,s=s?s.__html:void 0,null!=u&&s!==u&&(o=o||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(o=o||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(a.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Rn("scroll",e),o||s===u||(o=[])):(o=o||[]).push(c,u))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}},Ta=function(e,t,r,n){r!==n&&(t.flags|=4)};var Xa=!1,Ya=!1,Za="function"==typeof WeakSet?WeakSet:Set,qa=null;function Ja(e,t){var r=e.ref;if(null!==r)if("function"==typeof r)try{r(null)}catch(r){Cu(e,t,r)}else r.current=null}function $a(e,t,r){try{r()}catch(r){Cu(e,t,r)}}var es=!1;function ts(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var A=i.destroy;i.destroy=void 0,void 0!==A&&$a(t,r,A)}i=i.next}while(i!==n)}}function rs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ns(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"==typeof t?t(e):t.current=e}}function is(e){var t=e.alternate;null!==t&&(e.alternate=null,is(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[fi],delete t[di],delete t[pi],delete t[gi],delete t[yi])),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 As(e){return 5===e.tag||3===e.tag||4===e.tag}function os(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||As(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function as(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!=(r=r._reactRootContainer)||null!==t.onclick||(t.onclick=$n));else if(4!==n&&null!==(e=e.child))for(as(e,t,r),e=e.sibling;null!==e;)as(e,t,r),e=e.sibling}function ss(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(ss(e,t,r),e=e.sibling;null!==e;)ss(e,t,r),e=e.sibling}var us=null,cs=!1;function ls(e,t,r){for(r=r.child;null!==r;)fs(e,t,r),r=r.sibling}function fs(e,t,r){if(At&&"function"==typeof At.onCommitFiberUnmount)try{At.onCommitFiberUnmount(it,r)}catch(e){}switch(r.tag){case 5:Ya||Ja(r,t);case 6:var n=us,i=cs;us=null,ls(e,t,r),cs=i,null!==(us=n)&&(cs?(e=us,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):us.removeChild(r.stateNode));break;case 18:null!==us&&(cs?(e=us,r=r.stateNode,8===e.nodeType?si(e.parentNode,r):1===e.nodeType&&si(e,r),jt(e)):si(us,r.stateNode));break;case 4:n=us,i=cs,us=r.stateNode.containerInfo,cs=!0,ls(e,t,r),us=n,cs=i;break;case 0:case 11:case 14:case 15:if(!Ya&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var A=i,o=A.destroy;A=A.tag,void 0!==o&&(2&A||4&A)&&$a(r,t,o),i=i.next}while(i!==n)}ls(e,t,r);break;case 1:if(!Ya&&(Ja(r,t),"function"==typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(e){Cu(r,t,e)}ls(e,t,r);break;case 21:ls(e,t,r);break;case 22:1&r.mode?(Ya=(n=Ya)||null!==r.memoizedState,ls(e,t,r),Ya=n):ls(e,t,r);break;default:ls(e,t,r)}}function ds(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Za),t.forEach(function(t){var n=Ou.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))})}}function hs(e,t){var r=t.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n];try{var o=e,a=t,s=a;e:for(;null!==s;){switch(s.tag){case 5:us=s.stateNode,cs=!1;break e;case 3:case 4:us=s.stateNode.containerInfo,cs=!0;break e}s=s.return}if(null===us)throw Error(A(160));fs(o,a,i),us=null,cs=!1;var u=i.alternate;null!==u&&(u.return=null),i.return=null}catch(e){Cu(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)ps(t,e),t=t.sibling}function ps(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(hs(t,e),gs(e),4&n){try{ts(3,e,e.return),rs(3,e)}catch(t){Cu(e,e.return,t)}try{ts(5,e,e.return)}catch(t){Cu(e,e.return,t)}}break;case 1:hs(t,e),gs(e),512&n&&null!==r&&Ja(r,r.return);break;case 5:if(hs(t,e),gs(e),512&n&&null!==r&&Ja(r,r.return),32&e.flags){var i=e.stateNode;try{fe(i,"")}catch(t){Cu(e,e.return,t)}}if(4&n&&null!=(i=e.stateNode)){var o=e.memoizedProps,a=null!==r?r.memoizedProps:o,s=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===s&&"radio"===o.type&&null!=o.name&&q(i,o),me(s,a);var c=me(s,o);for(a=0;a<u.length;a+=2){var l=u[a],f=u[a+1];"style"===l?ge(i,f):"dangerouslySetInnerHTML"===l?le(i,f):"children"===l?fe(i,f):m(i,l,f,c)}switch(s){case"input":J(i,o);break;case"textarea":Ae(i,o);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;null!=h?re(i,!!o.multiple,h,!1):d!==!!o.multiple&&(null!=o.defaultValue?re(i,!!o.multiple,o.defaultValue,!0):re(i,!!o.multiple,o.multiple?[]:"",!1))}i[di]=o}catch(t){Cu(e,e.return,t)}}break;case 6:if(hs(t,e),gs(e),4&n){if(null===e.stateNode)throw Error(A(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(t){Cu(e,e.return,t)}}break;case 3:if(hs(t,e),gs(e),4&n&&null!==r&&r.memoizedState.isDehydrated)try{jt(t.containerInfo)}catch(t){Cu(e,e.return,t)}break;case 4:default:hs(t,e),gs(e);break;case 13:hs(t,e),gs(e),8192&(i=e.child).flags&&(o=null!==i.memoizedState,i.stateNode.isHidden=o,!o||null!==i.alternate&&null!==i.alternate.memoizedState||(Ls=qe())),4&n&&ds(e);break;case 22:if(l=null!==r&&null!==r.memoizedState,1&e.mode?(Ya=(c=Ya)||l,hs(t,e),Ya=c):hs(t,e),gs(e),8192&n){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!l&&1&e.mode)for(qa=e,l=e.child;null!==l;){for(f=qa=l;null!==qa;){switch(h=(d=qa).child,d.tag){case 0:case 11:case 14:case 15:ts(4,d,d.return);break;case 1:Ja(d,d.return);var p=d.stateNode;if("function"==typeof p.componentWillUnmount){n=d,r=d.return;try{t=n,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(e){Cu(n,r,e)}}break;case 5:Ja(d,d.return);break;case 22:if(null!==d.memoizedState){ws(f);continue}}null!==h?(h.return=d,qa=h):ws(f)}l=l.sibling}e:for(l=null,f=e;;){if(5===f.tag){if(null===l){l=f;try{i=f.stateNode,c?"function"==typeof(o=i.style).setProperty?o.setProperty("display","none","important"):o.display="none":(s=f.stateNode,a=null!=(u=f.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,s.style.display=pe("display",a))}catch(t){Cu(e,e.return,t)}}}else if(6===f.tag){if(null===l)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(t){Cu(e,e.return,t)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;l===f&&(l=null),f=f.return}l===f&&(l=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:hs(t,e),gs(e),4&n&&ds(e);case 21:}}function gs(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(As(r)){var n=r;break e}r=r.return}throw Error(A(160))}switch(n.tag){case 5:var i=n.stateNode;32&n.flags&&(fe(i,""),n.flags&=-33),ss(e,os(e),i);break;case 3:case 4:var o=n.stateNode.containerInfo;as(e,os(e),o);break;default:throw Error(A(161))}}catch(t){Cu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function ys(e,t,r){qa=e,vs(e,t,r)}function vs(e,t,r){for(var n=!!(1&e.mode);null!==qa;){var i=qa,A=i.child;if(22===i.tag&&n){var o=null!==i.memoizedState||Xa;if(!o){var a=i.alternate,s=null!==a&&null!==a.memoizedState||Ya;a=Xa;var u=Ya;if(Xa=o,(Ya=s)&&!u)for(qa=i;null!==qa;)s=(o=qa).child,22===o.tag&&null!==o.memoizedState?bs(i):null!==s?(s.return=o,qa=s):bs(i);for(;null!==A;)qa=A,vs(A,t,r),A=A.sibling;qa=i,Xa=a,Ya=u}ms(e)}else 8772&i.subtreeFlags&&null!==A?(A.return=i,qa=A):ms(e)}}function ms(e){for(;null!==qa;){var t=qa;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ya||rs(5,t);break;case 1:var n=t.stateNode;if(4&t.flags&&!Ya)if(null===r)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:ra(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;null!==o&&VA(t,o,n);break;case 3:var a=t.updateQueue;if(null!==a){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}VA(t,a,r)}break;case 5:var s=t.stateNode;if(null===r&&4&t.flags){r=s;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var l=c.memoizedState;if(null!==l){var f=l.dehydrated;null!==f&&jt(f)}}}break;default:throw Error(A(163))}Ya||512&t.flags&&ns(t)}catch(e){Cu(t,t.return,e)}}if(t===e){qa=null;break}if(null!==(r=t.sibling)){r.return=t.return,qa=r;break}qa=t.return}}function ws(e){for(;null!==qa;){var t=qa;if(t===e){qa=null;break}var r=t.sibling;if(null!==r){r.return=t.return,qa=r;break}qa=t.return}}function bs(e){for(;null!==qa;){var t=qa;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{rs(4,t)}catch(e){Cu(t,r,e)}break;case 1:var n=t.stateNode;if("function"==typeof n.componentDidMount){var i=t.return;try{n.componentDidMount()}catch(e){Cu(t,i,e)}}var A=t.return;try{ns(t)}catch(e){Cu(t,A,e)}break;case 5:var o=t.return;try{ns(t)}catch(e){Cu(t,o,e)}}}catch(e){Cu(t,t.return,e)}if(t===e){qa=null;break}var a=t.sibling;if(null!==a){a.return=t.return,qa=a;break}qa=t.return}}var Bs,Cs=Math.ceil,Es=w.ReactCurrentDispatcher,Ss=w.ReactCurrentOwner,Is=w.ReactCurrentBatchConfig,Os=0,Fs=null,_s=null,xs=0,Us=0,Qs=Ei(0),Ts=0,Ms=null,Ps=0,Ds=0,ks=0,Ns=null,Rs=null,Ls=0,Hs=1/0,js=null,Vs=!1,Ks=null,zs=null,Gs=!1,Ws=null,Xs=0,Ys=0,Zs=null,qs=-1,Js=0;function $s(){return 6&Os?qe():-1!==qs?qs:qs=qe()}function eu(e){return 1&e.mode?2&Os&&0!==xs?xs&-xs:null!==pA.transition?(0===Js&&(Js=pt()),Js):0!==(e=mt)?e:e=void 0===(e=window.event)?16:Zt(e.type):1}function tu(e,t,r,n){if(50<Ys)throw Ys=0,Zs=null,Error(A(185));yt(e,r,n),2&Os&&e===Fs||(e===Fs&&(!(2&Os)&&(Ds|=r),4===Ts&&ou(e,xs)),ru(e,n),1===r&&0===Os&&!(1&t.mode)&&(Hs=qe()+500,Ri&&ji()))}function ru(e,t){var r=e.callbackNode;!function(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,A=e.pendingLanes;0<A;){var o=31-ot(A),a=1<<o,s=i[o];-1===s?0!==(a&r)&&0===(a&n)||(i[o]=dt(a,t)):s<=t&&(e.expiredLanes|=a),A&=~a}}(e,t);var n=ft(e,e===Fs?xs:0);if(0===n)null!==r&&Xe(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=r&&Xe(r),1===t)0===e.tag?function(e){Ri=!0,Hi(e)}(au.bind(null,e)):Hi(au.bind(null,e)),oi(function(){!(6&Os)&&ji()}),r=null;else{switch(wt(n)){case 1:r=$e;break;case 4:r=et;break;case 16:default:r=tt;break;case 536870912:r=nt}r=Fu(r,nu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function nu(e,t){if(qs=-1,Js=0,6&Os)throw Error(A(327));var r=e.callbackNode;if(bu()&&e.callbackNode!==r)return null;var n=ft(e,e===Fs?xs:0);if(0===n)return null;if(30&n||0!==(n&e.expiredLanes)||t)t=pu(e,n);else{t=n;var i=Os;Os|=2;var o=du();for(Fs===e&&xs===t||(js=null,Hs=qe()+500,lu(e,t));;)try{yu();break}catch(t){fu(e,t)}IA(),Es.current=o,Os=i,null!==_s?t=0:(Fs=null,xs=0,t=Ts)}if(0!==t){if(2===t&&(0!==(i=ht(e))&&(n=i,t=iu(e,i))),1===t)throw r=Ms,lu(e,0),ou(e,n),ru(e,qe()),r;if(6===t)ou(e,n);else{if(i=e.current.alternate,!(30&n||function(e){for(var t=e;;){if(16384&t.flags){var r=t.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var i=r[n],A=i.getSnapshot;i=i.value;try{if(!an(A(),i))return!1}catch(e){return!1}}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=pu(e,n),2===t&&(o=ht(e),0!==o&&(n=o,t=iu(e,o))),1!==t)))throw r=Ms,lu(e,0),ou(e,n),ru(e,qe()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(A(345));case 2:case 5:wu(e,Rs,js);break;case 3:if(ou(e,n),(130023424&n)===n&&10<(t=Ls+500-qe())){if(0!==ft(e,0))break;if(((i=e.suspendedLanes)&n)!==n){$s(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ni(wu.bind(null,e,Rs,js),t);break}wu(e,Rs,js);break;case 4:if(ou(e,n),(4194240&n)===n)break;for(t=e.eventTimes,i=-1;0<n;){var a=31-ot(n);o=1<<a,(a=t[a])>i&&(i=a),n&=~o}if(n=i,10<(n=(120>(n=qe()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Cs(n/1960))-n)){e.timeoutHandle=ni(wu.bind(null,e,Rs,js),n);break}wu(e,Rs,js);break;default:throw Error(A(329))}}}return ru(e,qe()),e.callbackNode===r?nu.bind(null,e):null}function iu(e,t){var r=Ns;return e.current.memoizedState.isDehydrated&&(lu(e,t).flags|=256),2!==(e=pu(e,t))&&(t=Rs,Rs=r,null!==t&&Au(t)),e}function Au(e){null===Rs?Rs=e:Rs.push.apply(Rs,e)}function ou(e,t){for(t&=~ks,t&=~Ds,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ot(t),n=1<<r;e[r]=-1,t&=~n}}function au(e){if(6&Os)throw Error(A(327));bu();var t=ft(e,0);if(!(1&t))return ru(e,qe()),null;var r=pu(e,t);if(0!==e.tag&&2===r){var n=ht(e);0!==n&&(t=n,r=iu(e,n))}if(1===r)throw r=Ms,lu(e,0),ou(e,t),ru(e,qe()),r;if(6===r)throw Error(A(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wu(e,Rs,js),ru(e,qe()),null}function su(e,t){var r=Os;Os|=1;try{return e(t)}finally{0===(Os=r)&&(Hs=qe()+500,Ri&&ji())}}function uu(e){null!==Ws&&0===Ws.tag&&!(6&Os)&&bu();var t=Os;Os|=1;var r=Is.transition,n=mt;try{if(Is.transition=null,mt=1,e)return e()}finally{mt=n,Is.transition=r,!(6&(Os=t))&&ji()}}function cu(){Us=Qs.current,Si(Qs)}function lu(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ii(r)),null!==_s)for(r=_s.return;null!==r;){var n=r;switch(tA(n),n.tag){case 1:null!=(n=n.type.childContextTypes)&&Ti();break;case 3:ZA(),Si(_i),Si(Fi),ro();break;case 5:JA(n);break;case 4:ZA();break;case 13:case 19:Si($A);break;case 10:OA(n.type._context);break;case 22:case 23:cu()}r=r.return}if(Fs=e,_s=e=Qu(e.current,null),xs=Us=t,Ts=0,Ms=null,ks=Ds=Ps=0,Rs=Ns=null,null!==UA){for(t=0;t<UA.length;t++)if(null!==(n=(r=UA[t]).interleaved)){r.interleaved=null;var i=n.next,A=r.pending;if(null!==A){var o=A.next;A.next=i,n.next=o}r.pending=n}UA=null}return e}function fu(e,t){for(;;){var r=_s;try{if(IA(),no.current=Jo,uo){for(var n=oo.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}uo=!1}if(Ao=0,so=ao=oo=null,co=!1,lo=0,Ss.current=null,null===r||null===r.return){Ts=1,Ms=t,_s=null;break}e:{var o=e,a=r.return,s=r,u=t;if(t=xs,s.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,l=s,f=l.tag;if(!(1&l.mode||0!==f&&11!==f&&15!==f)){var d=l.alternate;d?(l.updateQueue=d.updateQueue,l.memoizedState=d.memoizedState,l.lanes=d.lanes):(l.updateQueue=null,l.memoizedState=null)}var h=ga(a);if(null!==h){h.flags&=-257,ya(h,a,s,0,t),1&h.mode&&pa(o,c,t),u=c;var p=(t=h).updateQueue;if(null===p){var g=new Set;g.add(u),t.updateQueue=g}else p.add(u);break e}if(!(1&t)){pa(o,c,t),hu();break e}u=Error(A(426))}else if(iA&&1&s.mode){var y=ga(a);if(null!==y){!(65536&y.flags)&&(y.flags|=256),ya(y,a,s,0,t),hA(ua(u,s));break e}}o=u=ua(u,s),4!==Ts&&(Ts=2),null===Ns?Ns=[o]:Ns.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t,HA(o,da(0,u,t));break e;case 1:s=u;var v=o.type,m=o.stateNode;if(!(128&o.flags||"function"!=typeof v.getDerivedStateFromError&&(null===m||"function"!=typeof m.componentDidCatch||null!==zs&&zs.has(m)))){o.flags|=65536,t&=-t,o.lanes|=t,HA(o,ha(o,s,t));break e}}o=o.return}while(null!==o)}mu(r)}catch(e){t=e,_s===r&&null!==r&&(_s=r=r.return);continue}break}}function du(){var e=Es.current;return Es.current=Jo,null===e?Jo:e}function hu(){0!==Ts&&3!==Ts&&2!==Ts||(Ts=4),null===Fs||!(268435455&Ps)&&!(268435455&Ds)||ou(Fs,xs)}function pu(e,t){var r=Os;Os|=2;var n=du();for(Fs===e&&xs===t||(js=null,lu(e,t));;)try{gu();break}catch(t){fu(e,t)}if(IA(),Os=r,Es.current=n,null!==_s)throw Error(A(261));return Fs=null,xs=0,Ts}function gu(){for(;null!==_s;)vu(_s)}function yu(){for(;null!==_s&&!Ye();)vu(_s)}function vu(e){var t=Bs(e.alternate,e,Us);e.memoizedProps=e.pendingProps,null===t?mu(e):_s=t,Ss.current=null}function mu(e){var t=e;do{var r=t.alternate;if(e=t.return,32768&t.flags){if(null!==(r=Wa(r,t)))return r.flags&=32767,void(_s=r);if(null===e)return Ts=6,void(_s=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(r=Ga(r,t,Us)))return void(_s=r);if(null!==(t=t.sibling))return void(_s=t);_s=t=e}while(null!==t);0===Ts&&(Ts=5)}function wu(e,t,r){var n=mt,i=Is.transition;try{Is.transition=null,mt=1,function(e,t,r,n){do{bu()}while(null!==Ws);if(6&Os)throw Error(A(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(A(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(function(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-ot(r),A=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~A}}(e,o),e===Fs&&(_s=Fs=null,xs=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Gs||(Gs=!0,Fu(tt,function(){return bu(),null})),o=!!(15990&r.flags),!!(15990&r.subtreeFlags)||o){o=Is.transition,Is.transition=null;var a=mt;mt=1;var s=Os;Os|=4,Ss.current=null,function(e,t){if(ei=Kt,dn(e=fn())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch(e){r=null;break e}var a=0,s=-1,u=-1,c=0,l=0,f=e,d=null;t:for(;;){for(var h;f!==r||0!==i&&3!==f.nodeType||(s=a+i),f!==o||0!==n&&3!==f.nodeType||(u=a+n),3===f.nodeType&&(a+=f.nodeValue.length),null!==(h=f.firstChild);)d=f,f=h;for(;;){if(f===e)break t;if(d===r&&++c===i&&(s=a),d===o&&++l===n&&(u=a),null!==(h=f.nextSibling))break;d=(f=d).parentNode}f=h}r=-1===s||-1===u?null:{start:s,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(ti={focusedElem:e,selectionRange:r},Kt=!1,qa=t;null!==qa;)if(e=(t=qa).child,1028&t.subtreeFlags&&null!==e)e.return=t,qa=e;else for(;null!==qa;){t=qa;try{var p=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==p){var g=p.memoizedProps,y=p.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ra(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(A(163))}}catch(e){Cu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,qa=e;break}qa=t.return}p=es,es=!1}(e,r),ps(r,e),hn(ti),Kt=!!ei,ti=ei=null,e.current=r,ys(r,e,i),Ze(),Os=s,mt=a,Is.transition=o}else e.current=r;if(Gs&&(Gs=!1,Ws=e,Xs=i),o=e.pendingLanes,0===o&&(zs=null),function(e){if(At&&"function"==typeof At.onCommitFiberRoot)try{At.onCommitFiberRoot(it,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),ru(e,qe()),null!==t)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Vs)throw Vs=!1,e=Ks,Ks=null,e;!!(1&Xs)&&0!==e.tag&&bu(),o=e.pendingLanes,1&o?e===Zs?Ys++:(Ys=0,Zs=e):Ys=0,ji()}(e,t,r,n)}finally{Is.transition=i,mt=n}return null}function bu(){if(null!==Ws){var e=wt(Xs),t=Is.transition,r=mt;try{if(Is.transition=null,mt=16>e?16:e,null===Ws)var n=!1;else{if(e=Ws,Ws=null,Xs=0,6&Os)throw Error(A(331));var i=Os;for(Os|=4,qa=e.current;null!==qa;){var o=qa,a=o.child;if(16&qa.flags){var s=o.deletions;if(null!==s){for(var u=0;u<s.length;u++){var c=s[u];for(qa=c;null!==qa;){var l=qa;switch(l.tag){case 0:case 11:case 15:ts(8,l,o)}var f=l.child;if(null!==f)f.return=l,qa=f;else for(;null!==qa;){var d=(l=qa).sibling,h=l.return;if(is(l),l===c){qa=null;break}if(null!==d){d.return=h,qa=d;break}qa=h}}}var p=o.alternate;if(null!==p){var g=p.child;if(null!==g){p.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(null!==g)}}qa=o}}if(2064&o.subtreeFlags&&null!==a)a.return=o,qa=a;else e:for(;null!==qa;){if(2048&(o=qa).flags)switch(o.tag){case 0:case 11:case 15:ts(9,o,o.return)}var v=o.sibling;if(null!==v){v.return=o.return,qa=v;break e}qa=o.return}}var m=e.current;for(qa=m;null!==qa;){var w=(a=qa).child;if(2064&a.subtreeFlags&&null!==w)w.return=a,qa=w;else e:for(a=m;null!==qa;){if(2048&(s=qa).flags)try{switch(s.tag){case 0:case 11:case 15:rs(9,s)}}catch(e){Cu(s,s.return,e)}if(s===a){qa=null;break e}var b=s.sibling;if(null!==b){b.return=s.return,qa=b;break e}qa=s.return}}if(Os=i,ji(),At&&"function"==typeof At.onPostCommitFiberRoot)try{At.onPostCommitFiberRoot(it,e)}catch(e){}n=!0}return n}finally{mt=r,Is.transition=t}}return!1}function Bu(e,t,r){e=RA(e,t=da(0,t=ua(r,t),1),1),t=$s(),null!==e&&(yt(e,1,t),ru(e,t))}function Cu(e,t,r){if(3===e.tag)Bu(e,e,r);else for(;null!==t;){if(3===t.tag){Bu(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof n.componentDidCatch&&(null===zs||!zs.has(n))){t=RA(t,e=ha(t,e=ua(r,e),1),1),e=$s(),null!==t&&(yt(t,1,e),ru(t,e));break}}t=t.return}}function Eu(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=$s(),e.pingedLanes|=e.suspendedLanes&r,Fs===e&&(xs&r)===r&&(4===Ts||3===Ts&&(130023424&xs)===xs&&500>qe()-Ls?lu(e,0):ks|=r),ru(e,t)}function Su(e,t){0===t&&(1&e.mode?(t=ct,!(130023424&(ct<<=1))&&(ct=4194304)):t=1);var r=$s();null!==(e=MA(e,t))&&(yt(e,t,r),ru(e,r))}function Iu(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),Su(e,r)}function Ou(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(A(314))}null!==n&&n.delete(t),Su(e,r)}function Fu(e,t){return We(e,t)}function _u(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xu(e,t,r,n){return new _u(e,t,r,n)}function Uu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Qu(e,t){var r=e.alternate;return null===r?((r=xu(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Tu(e,t,r,n,i,o){var a=2;if(n=e,"function"==typeof e)Uu(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case C:return Mu(r.children,i,o,t);case E:a=8,i|=8;break;case S:return(e=xu(12,r,t,2|i)).elementType=S,e.lanes=o,e;case _:return(e=xu(13,r,t,i)).elementType=_,e.lanes=o,e;case x:return(e=xu(19,r,t,i)).elementType=x,e.lanes=o,e;case T:return Pu(r,i,o,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case I:a=10;break e;case O:a=9;break e;case F:a=11;break e;case U:a=14;break e;case Q:a=16,n=null;break e}throw Error(A(130,null==e?e:typeof e,""))}return(t=xu(a,r,t,i)).elementType=e,t.type=n,t.lanes=o,t}function Mu(e,t,r,n){return(e=xu(7,e,n,t)).lanes=r,e}function Pu(e,t,r,n){return(e=xu(22,e,n,t)).elementType=T,e.lanes=r,e.stateNode={isHidden:!1},e}function Du(e,t,r){return(e=xu(6,e,null,t)).lanes=r,e}function ku(e,t,r){return(t=xu(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Nu(e,t,r,n,i){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=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ru(e,t,r,n,i,A,o,a,s){return e=new Nu(e,t,r,a,s),1===t?(t=1,!0===A&&(t|=8)):t=0,A=xu(3,null,null,t),e.current=A,A.stateNode=e,A.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},DA(A),e}function Lu(e){if(!e)return Oi;e:{if(je(e=e._reactInternals)!==e||1!==e.tag)throw Error(A(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(A(171))}if(1===e.tag){var r=e.type;if(Qi(r))return Pi(e,r,t)}return t}function Hu(e,t,r,n,i,A,o,a,s){return(e=Ru(r,n,!0,e,0,A,0,a,s)).context=Lu(null),r=e.current,(A=NA(n=$s(),i=eu(r))).callback=null!=t?t:null,RA(r,A,i),e.current.lanes=i,yt(e,i,n),ru(e,n),e}function ju(e,t,r,n){var i=t.current,A=$s(),o=eu(i);return r=Lu(r),null===t.context?t.context=r:t.pendingContext=r,(t=NA(A,o)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=RA(i,t,o))&&(tu(e,i,o,A),LA(e,i,o)),o}function Vu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Ku(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function zu(e,t){Ku(e,t),(e=e.alternate)&&Ku(e,t)}Bs=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||_i.current)ma=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return ma=!1,function(e,t,r){switch(t.tag){case 3:_a(t),dA();break;case 5:qA(t);break;case 1:Qi(t.type)&&Di(t);break;case 4:YA(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ii(BA,n._currentValue),n._currentValue=i;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(Ii($A,1&$A.current),t.flags|=128,null):0!==(r&t.child.childLanes)?Da(e,t,r):(Ii($A,1&$A.current),null!==(e=Va(e,t,r))?e.sibling:null);Ii($A,1&$A.current);break;case 19:if(n=0!==(r&t.childLanes),128&e.flags){if(n)return Ha(e,t,r);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ii($A,$A.current),n)break;return null;case 22:case 23:return t.lanes=0,Ea(e,t,r)}return Va(e,t,r)}(e,t,r);ma=!!(131072&e.flags)}else ma=!1,iA&&1048576&t.flags&&$i(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;ja(e,t),e=t.pendingProps;var i=Ui(t,Fi.current);_A(t,r),i=go(null,t,n,e,i,r);var o=yo();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qi(n)?(o=!0,Di(t)):o=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,DA(t),i.updater=ia,t.stateNode=i,i._reactInternals=t,sa(t,n,e,r),t=Fa(null,t,n,!0,o,r)):(t.tag=0,iA&&o&&eA(t),wa(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(ja(e,t),e=t.pendingProps,n=(i=n._init)(n._payload),t.type=n,i=t.tag=function(e){if("function"==typeof e)return Uu(e)?1:0;if(null!=e){if((e=e.$$typeof)===F)return 11;if(e===U)return 14}return 2}(n),e=ra(n,e),i){case 0:t=Ia(null,t,n,e,r);break e;case 1:t=Oa(null,t,n,e,r);break e;case 11:t=ba(null,t,n,e,r);break e;case 14:t=Ba(null,t,n,ra(n.type,e),r);break e}throw Error(A(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,Ia(e,t,n,i=t.elementType===n?i:ra(n,i),r);case 1:return n=t.type,i=t.pendingProps,Oa(e,t,n,i=t.elementType===n?i:ra(n,i),r);case 3:e:{if(_a(t),null===e)throw Error(A(387));n=t.pendingProps,i=(o=t.memoizedState).element,kA(e,t),jA(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated){if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=xa(e,t,n,r,i=ua(Error(A(423)),t));break e}if(n!==i){t=xa(e,t,n,r,i=ua(Error(A(424)),t));break e}for(nA=ui(t.stateNode.containerInfo.firstChild),rA=t,iA=!0,AA=null,r=bA(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(dA(),n===i){t=Va(e,t,r);break e}wa(e,t,n,r)}t=t.child}return t;case 5:return qA(t),null===e&&uA(t),n=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,ri(n,i)?a=null:null!==o&&ri(n,o)&&(t.flags|=32),Sa(e,t),wa(e,t,a,r),t.child;case 6:return null===e&&uA(t),null;case 13:return Da(e,t,r);case 4:return YA(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=wA(t,null,n,r):wa(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,ba(e,t,n,i=t.elementType===n?i:ra(n,i),r);case 7:return wa(e,t,t.pendingProps,r),t.child;case 8:case 12:return wa(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Ii(BA,n._currentValue),n._currentValue=a,null!==o)if(an(o.value,a)){if(o.children===i.children&&!_i.current){t=Va(e,t,r);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var s=o.dependencies;if(null!==s){a=o.child;for(var u=s.firstContext;null!==u;){if(u.context===n){if(1===o.tag){(u=NA(-1,r&-r)).tag=2;var c=o.updateQueue;if(null!==c){var l=(c=c.shared).pending;null===l?u.next=u:(u.next=l.next,l.next=u),c.pending=u}}o.lanes|=r,null!==(u=o.alternate)&&(u.lanes|=r),FA(o.return,r,t),s.lanes|=r;break}u=u.next}}else if(10===o.tag)a=o.type===t.type?null:o.child;else if(18===o.tag){if(null===(a=o.return))throw Error(A(341));a.lanes|=r,null!==(s=a.alternate)&&(s.lanes|=r),FA(a,r,t),a=o.sibling}else a=o.child;if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===t){a=null;break}if(null!==(o=a.sibling)){o.return=a.return,a=o;break}a=a.return}o=a}wa(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,_A(t,r),n=n(i=xA(i)),t.flags|=1,wa(e,t,n,r),t.child;case 14:return i=ra(n=t.type,t.pendingProps),Ba(e,t,n,i=ra(n.type,i),r);case 15:return Ca(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ra(n,i),ja(e,t),t.tag=1,Qi(n)?(e=!0,Di(t)):e=!1,_A(t,r),oa(t,n,i),sa(t,n,i,r),Fa(null,t,n,!0,e,r);case 19:return Ha(e,t,r);case 22:return Ea(e,t,r)}throw Error(A(156,t.tag))};var Gu="function"==typeof reportError?reportError:function(e){console.error(e)};function Wu(e){this._internalRoot=e}function Xu(e){this._internalRoot=e}function Yu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function qu(){}function Ju(e,t,r,n,i){var A=r._reactRootContainer;if(A){var o=A;if("function"==typeof i){var a=i;i=function(){var e=Vu(o);a.call(e)}}ju(t,o,e,i)}else o=function(e,t,r,n,i){if(i){if("function"==typeof n){var A=n;n=function(){var e=Vu(o);A.call(e)}}var o=Hu(t,n,e,0,null,!1,0,"",qu);return e._reactRootContainer=o,e[hi]=o.current,jn(8===e.nodeType?e.parentNode:e),uu(),o}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof n){var a=n;n=function(){var e=Vu(s);a.call(e)}}var s=Ru(e,0,!1,null,0,!1,0,"",qu);return e._reactRootContainer=s,e[hi]=s.current,jn(8===e.nodeType?e.parentNode:e),uu(function(){ju(t,s,r,n)}),s}(r,t,e,i,n);return Vu(o)}Xu.prototype.render=Wu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(A(409));ju(e,t,null,null)},Xu.prototype.unmount=Wu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;uu(function(){ju(null,e,null,null)}),t[hi]=null}},Xu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Tt.length&&0!==t&&t<Tt[r].priority;r++);Tt.splice(r,0,e),0===r&&kt(e)}},bt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=lt(t.pendingLanes);0!==r&&(vt(t,1|r),ru(t,qe()),!(6&Os)&&(Hs=qe()+500,ji()))}break;case 13:uu(function(){var t=MA(e,1);if(null!==t){var r=$s();tu(t,e,1,r)}}),zu(e,1)}},Bt=function(e){if(13===e.tag){var t=MA(e,134217728);if(null!==t)tu(t,e,134217728,$s());zu(e,134217728)}},Ct=function(e){if(13===e.tag){var t=eu(e),r=MA(e,t);if(null!==r)tu(r,e,t,$s());zu(e,t)}},Et=function(){return mt},St=function(e,t){var r=mt;try{return mt=e,t()}finally{mt=r}},Be=function(e,t,r){switch(t){case"input":if(J(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=bi(n);if(!i)throw Error(A(90));W(n),J(n,i)}}}break;case"textarea":Ae(e,r);break;case"select":null!=(t=r.value)&&re(e,!!r.multiple,t,!1)}},Fe=su,_e=uu;var $u={usingClientEntryPoint:!1,Events:[mi,wi,bi,Ie,Oe,su]},ec={findFiberByHostInstance:vi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tc={bundleType:ec.bundleType,version:ec.version,rendererPackageName:ec.rendererPackageName,rendererConfig:ec.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=ze(e))?null:e.stateNode},findFiberByHostInstance:ec.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{it=rc.inject(tc),At=rc}catch(ce){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$u,t.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yu(t))throw Error(A(200));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:B,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,r)},t.createRoot=function(e,t){if(!Yu(e))throw Error(A(299));var r=!1,n="",i=Gu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Ru(e,1,!1,null,0,r,0,n,i),e[hi]=t.current,jn(8===e.nodeType?e.parentNode:e),new Wu(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(A(188));throw e=Object.keys(e).join(","),Error(A(268,e))}return e=null===(e=ze(t))?null:e.stateNode},t.flushSync=function(e){return uu(e)},t.hydrate=function(e,t,r){if(!Zu(t))throw Error(A(200));return Ju(null,e,t,!0,r)},t.hydrateRoot=function(e,t,r){if(!Yu(e))throw Error(A(405));var n=null!=r&&r.hydratedSources||null,i=!1,o="",a=Gu;if(null!=r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(o=r.identifierPrefix),void 0!==r.onRecoverableError&&(a=r.onRecoverableError)),t=Hu(t,null,e,1,null!=r?r:null,i,0,o,a),e[hi]=t.current,jn(e),n)for(e=0;e<n.length;e++)i=(i=(r=n[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Xu(t)},t.render=function(e,t,r){if(!Zu(t))throw Error(A(200));return Ju(null,e,t,!1,r)},t.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(A(40));return!!e._reactRootContainer&&(uu(function(){Ju(null,null,e,!1,function(){e._reactRootContainer=null,e[hi]=null})}),!0)},t.unstable_batchedUpdates=su,t.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Zu(r))throw Error(A(200));if(null==e||void 0===e._reactInternals)throw Error(A(38));return Ju(e,t,r,!1,n)},t.version="18.3.1-next-f1338f8080-20240426"},22593(e,t,r){"use strict";r.d(t,{A:()=>v});var n=r(31327),i=r(59379),A=r(88468);const o=function(){function e(e,t){t?this.decodedInformation=null:(this.finished=e,this.decodedInformation=t)}return e.prototype.getDecodedInformation=function(){return this.decodedInformation},e.prototype.isFinished=function(){return this.finished},e}();const a=function(){function e(e){this.newPosition=e}return e.prototype.getNewPosition=function(){return this.newPosition},e}();var s,u=(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},s(e,t)},function(e,t){function r(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return u(t,e),t.prototype.getValue=function(){return this.value},t.prototype.isFNC1=function(){return this.value===t.FNC1},t.FNC1="$",t}(a);var l=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const f=function(e){function t(t,r,n){var i=e.call(this,t)||this;return n?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=r,i}return l(t,e),t.prototype.getNewString=function(){return this.newString},t.prototype.isRemaining=function(){return this.remaining},t.prototype.getRemainingValue=function(){return this.remainingValue},t}(a);var d=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const h=function(e){function t(t,r,i){var A=e.call(this,t)||this;if(r<0||r>10||i<0||i>10)throw new n.A;return A.firstDigit=r,A.secondDigit=i,A}return d(t,e),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(a);var p=r(58503),g=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const y=function(){function e(){}return e.parseFieldsInGeneralPurpose=function(t){var r,n,i,A,o,a,s,u;if(!t)return null;if(t.length<2)throw new p.A;var c=t.substring(0,2);try{for(var l=g(e.TWO_DIGIT_DATA_LENGTH),f=l.next();!f.done;f=l.next()){if((C=f.value)[0]===c)return C[1]===e.VARIABLE_LENGTH?e.processVariableAI(2,C[2],t):e.processFixedAI(2,C[1],t)}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}if(t.length<3)throw new p.A;var d=t.substring(0,3);try{for(var h=g(e.THREE_DIGIT_DATA_LENGTH),y=h.next();!y.done;y=h.next()){if((C=y.value)[0]===d)return C[1]===e.VARIABLE_LENGTH?e.processVariableAI(3,C[2],t):e.processFixedAI(3,C[1],t)}}catch(e){i={error:e}}finally{try{y&&!y.done&&(A=h.return)&&A.call(h)}finally{if(i)throw i.error}}try{for(var v=g(e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),m=v.next();!m.done;m=v.next()){if((C=m.value)[0]===d)return C[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,C[2],t):e.processFixedAI(4,C[1],t)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}if(t.length<4)throw new p.A;var w=t.substring(0,4);try{for(var b=g(e.FOUR_DIGIT_DATA_LENGTH),B=b.next();!B.done;B=b.next()){var C;if((C=B.value)[0]===w)return C[1]===e.VARIABLE_LENGTH?e.processVariableAI(4,C[2],t):e.processFixedAI(4,C[1],t)}}catch(e){s={error:e}}finally{try{B&&!B.done&&(u=b.return)&&u.call(b)}finally{if(s)throw s.error}}throw new p.A},e.processFixedAI=function(t,r,n){if(n.length<t)throw new p.A;var i=n.substring(0,t);if(n.length<t+r)throw new p.A;var A=n.substring(t,t+r),o=n.substring(t+r),a="("+i+")"+A,s=e.parseFieldsInGeneralPurpose(o);return null==s?a:a+s},e.processVariableAI=function(t,r,n){var i,A=n.substring(0,t);i=n.length<t+r?n.length:t+r;var o=n.substring(t,i),a=n.substring(i),s="("+A+")"+o,u=e.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},e.VARIABLE_LENGTH=[],e.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",e.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",e.VARIABLE_LENGTH,20],["22",e.VARIABLE_LENGTH,29],["30",e.VARIABLE_LENGTH,8],["37",e.VARIABLE_LENGTH,8],["90",e.VARIABLE_LENGTH,30],["91",e.VARIABLE_LENGTH,30],["92",e.VARIABLE_LENGTH,30],["93",e.VARIABLE_LENGTH,30],["94",e.VARIABLE_LENGTH,30],["95",e.VARIABLE_LENGTH,30],["96",e.VARIABLE_LENGTH,30],["97",e.VARIABLE_LENGTH,3],["98",e.VARIABLE_LENGTH,30],["99",e.VARIABLE_LENGTH,30]],e.THREE_DIGIT_DATA_LENGTH=[["240",e.VARIABLE_LENGTH,30],["241",e.VARIABLE_LENGTH,30],["242",e.VARIABLE_LENGTH,6],["250",e.VARIABLE_LENGTH,30],["251",e.VARIABLE_LENGTH,30],["253",e.VARIABLE_LENGTH,17],["254",e.VARIABLE_LENGTH,20],["400",e.VARIABLE_LENGTH,30],["401",e.VARIABLE_LENGTH,30],["402",17],["403",e.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",e.VARIABLE_LENGTH,20],["421",e.VARIABLE_LENGTH,15],["422",3],["423",e.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],e.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",e.VARIABLE_LENGTH,15],["391",e.VARIABLE_LENGTH,18],["392",e.VARIABLE_LENGTH,15],["393",e.VARIABLE_LENGTH,18],["703",e.VARIABLE_LENGTH,30]],e.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",e.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",e.VARIABLE_LENGTH,20],["8003",e.VARIABLE_LENGTH,30],["8004",e.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",e.VARIABLE_LENGTH,30],["8008",e.VARIABLE_LENGTH,12],["8018",18],["8020",e.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",e.VARIABLE_LENGTH,70],["8200",e.VARIABLE_LENGTH,70]],e}();const v=function(){function e(e){this.buffer=new A.A,this.information=e}return e.prototype.decodeAllCodes=function(e,t){for(var r=t,n=null;;){var i=this.decodeGeneralPurposeField(r,n),A=y.parseFieldsInGeneralPurpose(i.getNewString());if(null!=A&&e.append(A),n=i.isRemaining()?""+i.getRemainingValue():null,r===i.getNewPosition())break;r=i.getNewPosition()}return e.toString()},e.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var t=e;t<e+3;++t)if(this.information.get(t))return!0;return this.information.get(e+3)},e.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return new h(this.information.getSize(),0===t?h.FNC1:t-1,h.FNC1)}var r=this.extractNumericValueFromBitArray(e,7);return new h(e+7,(r-8)/11,(r-8)%11)},e.prototype.extractNumericValueFromBitArray=function(t,r){return e.extractNumericValueFromBitArray(this.information,t,r)},e.extractNumericValueFromBitArray=function(e,t,r){for(var n=0,i=0;i<r;++i)e.get(t+i)&&(n|=1<<r-i-1);return n},e.prototype.decodeGeneralPurposeField=function(e,t){this.buffer.setLengthToZero(),null!=t&&this.buffer.append(t),this.current.setPosition(e);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new f(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new f(this.current.getPosition(),this.buffer.toString())},e.prototype.parseBlocks=function(){var e,t;do{var r=this.current.getPosition();if(e=this.current.isAlpha()?(t=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(t=this.parseIsoIec646Block()).isFinished():(t=this.parseNumericBlock()).isFinished(),!(r!==this.current.getPosition())&&!e)break}while(!e);return t.getDecodedInformation()},e.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var t=void 0;return t=e.isSecondDigitFNC1()?new f(this.current.getPosition(),this.buffer.toString()):new f(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new o(!0,t)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1()){t=new f(this.current.getPosition(),this.buffer.toString());return new o(!0,t)}this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new o(!1)},e.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var t=new f(this.current.getPosition(),this.buffer.toString());return new o(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new o(!1)},e.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var t=new f(this.current.getPosition(),this.buffer.toString());return new o(!0,t)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new o(!1)},e.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,8);return n>=232&&n<253},e.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new c(e+5,c.FNC1);if(t>=5&&t<15)return new c(e+5,"0"+(t-5));var r,i=this.extractNumericValueFromBitArray(e,7);if(i>=64&&i<90)return new c(e+7,""+(i+1));if(i>=90&&i<116)return new c(e+7,""+(i+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new n.A}return new c(e+8,r)},e.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},e.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(15===t)return new c(e+5,c.FNC1);if(t>=5&&t<15)return new c(e+5,"0"+(t-5));var r,n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new c(e+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new i.A("Decoding invalid alphanumeric value: "+n)}return new c(e+6,r)},e.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+e<this.information.getSize();++t)if(2===t){if(!this.information.get(e+2))return!1}else if(this.information.get(e+t))return!1;return!0},e.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var t=e;t<e+3;++t)if(this.information.get(t))return!1;return!0},e.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<4&&t+e<this.information.getSize();++t)if(this.information.get(e+t))return!1;return!0},e}()},22608(e,t,r){"use strict";function n(e,t){return!(!Array.isArray(e)||!Array.isArray(t)||0!==e.length||0!==t.length)||e===t}function i(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}r.d(t,{O:()=>n,W:()=>i})},22812(e){"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},23110(e,t,r){"use strict";r.d(t,{A:()=>c});var n,i=r(42893),A=r(23431),o=r(71983),a=r(58503),s=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.sampleGrid=function(e,t,r,n,i,A,a,s,u,c,l,f,d,h,p,g,y,v,m){var w=o.A.quadrilateralToQuadrilateral(n,i,A,a,s,u,c,l,f,d,h,p,g,y,v,m);return this.sampleGridWithTransform(e,t,r,w)},t.prototype.sampleGridWithTransform=function(e,t,r,n){if(t<=0||r<=0)throw new a.A;for(var o=new A.A(t,r),s=new Float32Array(2*t),u=0;u<r;u++){for(var c=s.length,l=u+.5,f=0;f<c;f+=2)s[f]=f/2+.5,s[f+1]=l;n.transformPoints(s),i.A.checkAndNudgePoints(e,s);try{for(f=0;f<c;f+=2)e.get(Math.floor(s[f]),Math.floor(s[f+1]))&&o.set(f/2,u)}catch(e){throw new a.A}}return o},t}(i.A);const c=u},23431(e,t,r){"use strict";r.d(t,{A:()=>s});var n=r(26741),i=r(92819),A=r(80442),o=r(88468),a=r(57149);const s=function(){function e(e,t,r,n){if(this.width=e,this.height=t,this.rowSize=r,this.bits=n,null==t&&(t=e),this.height=t,e<1||t<1)throw new a.A("Both dimensions must be greater than 0");null==r&&(r=Math.floor((e+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return e.parseFromBooleanArray=function(t){for(var r=t.length,n=t[0].length,i=new e(n,r),A=0;A<r;A++)for(var o=t[A],a=0;a<n;a++)o[a]&&i.set(a,A);return i},e.parseFromString=function(t,r,n){if(null===t)throw new a.A("stringRepresentation cannot be null");for(var i=new Array(t.length),A=0,o=0,s=-1,u=0,c=0;c<t.length;)if("\n"===t.charAt(c)||"\r"===t.charAt(c)){if(A>o){if(-1===s)s=A-o;else if(A-o!==s)throw new a.A("row lengths do not match");o=A,u++}c++}else if(t.substring(c,c+r.length)===r)c+=r.length,i[A]=!0,A++;else{if(t.substring(c,c+n.length)!==n)throw new a.A("illegal character encountered: "+t.substring(c));c+=n.length,i[A]=!1,A++}if(A>o){if(-1===s)s=A-o;else if(A-o!==s)throw new a.A("row lengths do not match");u++}for(var l=new e(s,u),f=0;f<A;f++)i[f]&&l.set(Math.floor(f%s),Math.floor(f/s));return l},e.prototype.get=function(e,t){var r=t*this.rowSize+Math.floor(e/32);return!!(this.bits[r]>>>(31&e)&1)},e.prototype.set=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]|=1<<(31&e)&4294967295},e.prototype.unset=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]&=~(1<<(31&e)&4294967295)},e.prototype.flip=function(e,t){var r=t*this.rowSize+Math.floor(e/32);this.bits[r]^=1<<(31&e)&4294967295},e.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new a.A("input matrix dimensions do not match");for(var t=new n.A(Math.floor(this.width/32)+1),r=this.rowSize,i=this.bits,A=0,o=this.height;A<o;A++)for(var s=A*r,u=e.getRow(A,t).getBitArray(),c=0;c<r;c++)i[s+c]^=u[c]},e.prototype.clear=function(){for(var e=this.bits,t=e.length,r=0;r<t;r++)e[r]=0},e.prototype.setRegion=function(e,t,r,n){if(t<0||e<0)throw new a.A("Left and top must be nonnegative");if(n<1||r<1)throw new a.A("Height and width must be at least 1");var i=e+r,A=t+n;if(A>this.height||i>this.width)throw new a.A("The region must fit inside the matrix");for(var o=this.rowSize,s=this.bits,u=t;u<A;u++)for(var c=u*o,l=e;l<i;l++)s[c+Math.floor(l/32)]|=1<<(31&l)&4294967295},e.prototype.getRow=function(e,t){null==t||t.getSize()<this.width?t=new n.A(this.width):t.clear();for(var r=this.rowSize,i=this.bits,A=e*r,o=0;o<r;o++)t.setBulk(32*o,i[A+o]);return t},e.prototype.setRow=function(e,t){i.A.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},e.prototype.rotate180=function(){for(var e=this.getWidth(),t=this.getHeight(),r=new n.A(e),i=new n.A(e),A=0,o=Math.floor((t+1)/2);A<o;A++)r=this.getRow(A,r),i=this.getRow(t-1-A,i),r.reverse(),i.reverse(),this.setRow(A,i),this.setRow(t-1-A,r)},e.prototype.getEnclosingRectangle=function(){for(var e=this.width,t=this.height,r=this.rowSize,n=this.bits,i=e,A=t,o=-1,a=-1,s=0;s<t;s++)for(var u=0;u<r;u++){var c=n[s*r+u];if(0!==c){if(s<A&&(A=s),s>a&&(a=s),32*u<i){for(var l=0;!(c<<31-l&4294967295);)l++;32*u+l<i&&(i=32*u+l)}if(32*u+31>o){for(l=31;c>>>l===0;)l--;32*u+l>o&&(o=32*u+l)}}}return o<i||a<A?null:Int32Array.from([i,A,o-i+1,a-A+1])},e.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,t=this.bits,r=0;r<t.length&&0===t[r];)r++;if(r===t.length)return null;for(var n=r/e,i=r%e*32,A=t[r],o=0;!(A<<31-o&4294967295);)o++;return i+=o,Int32Array.from([i,n])},e.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,t=this.bits,r=t.length-1;r>=0&&0===t[r];)r--;if(r<0)return null;for(var n=Math.floor(r/e),i=32*Math.floor(r%e),A=t[r],o=31;A>>>o===0;)o--;return i+=o,Int32Array.from([i,n])},e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.getRowSize=function(){return this.rowSize},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&A.A.equals(this.bits,r.bits)},e.prototype.hashCode=function(){var e=this.width;return e=31*(e=31*(e=31*(e=31*e+this.width)+this.height)+this.rowSize)+A.A.hashCode(this.bits)},e.prototype.toString=function(e,t,r){return void 0===e&&(e="X "),void 0===t&&(t=" "),void 0===r&&(r="\n"),this.buildToString(e,t,r)},e.prototype.buildToString=function(e,t,r){for(var n=new o.A,i=0,A=this.height;i<A;i++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,i)?e:t);n.append(r)}return n.toString()},e.prototype.clone=function(){return new e(this.width,this.height,this.rowSize,this.bits.slice())},e}()},23495(e,t,r){"use strict";r.d(t,{h:()=>B});var n=r(96540),i=r(34164),A=r(30131),o=r(94115),a=r(49082),s=r(91572),u=r(36189),c=r(12070),l=r(91706),f=r(77404),d=r(11718),h=["dangerouslySetInnerHTML","ticks","scale"],p=["id","scale"];function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(null,arguments)}function y(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function v(e){var t=(0,a.j)(),r=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{null===r.current?t((0,o.cU)(e)):r.current!==e&&t((0,o.hd)({prev:r.current,next:e})),r.current=e},[e,t]),(0,n.useLayoutEffect)(()=>()=>{r.current&&(t((0,o.fR)(r.current)),r.current=null)},[t]),null}var m=e=>{var{yAxisId:t,className:r,width:f,label:d}=e,v=(0,n.useRef)(null),m=(0,n.useRef)(null),w=(0,a.G)(u.c2),b=(0,c.r)(),B=(0,a.j)(),C="yAxis",E=(0,a.G)(e=>(0,s.wP)(e,t)),S=(0,a.G)(e=>(0,s.KR)(e,t)),I=(0,a.G)(e=>(0,s.Zi)(e,C,t,b)),O=(0,a.G)(e=>(0,s.hc)(e,t));if((0,n.useLayoutEffect)(()=>{if("auto"===f&&E&&!(0,l.ZY)(d)&&!(0,n.isValidElement)(d)&&null!=O){var e=v.current;if(e){var r=e.getCalculatedWidth();Math.round(E.width)!==Math.round(r)&&B((0,o.QG)({id:t,width:r}))}}},[I,E,B,d,t,f,O]),null==E||null==S||null==O)return null;var{dangerouslySetInnerHTML:F,ticks:_,scale:x}=e,U=y(e,h),{id:Q,scale:T}=O,M=y(O,p);return n.createElement(A.u,g({},U,M,{ref:v,labelRef:m,x:S.x,y:S.y,tickTextProps:"auto"===f?{width:void 0}:{width:f},width:E.width,height:E.height,className:(0,i.$)("recharts-".concat(C," ").concat(C),r),viewBox:w,ticks:I,axisType:C}))},w={allowDataOverflow:s.cd.allowDataOverflow,allowDecimals:s.cd.allowDecimals,allowDuplicatedCategory:s.cd.allowDuplicatedCategory,angle:s.cd.angle,axisLine:A.F.axisLine,hide:!1,includeHidden:s.cd.includeHidden,interval:s.cd.interval,minTickGap:s.cd.minTickGap,mirror:s.cd.mirror,orientation:s.cd.orientation,padding:s.cd.padding,reversed:s.cd.reversed,scale:s.cd.scale,tick:s.cd.tick,tickCount:s.cd.tickCount,tickLine:A.F.tickLine,tickSize:A.F.tickSize,type:s.cd.type,width:s.cd.width,yAxisId:0},b=e=>{var t=(0,f.e)(e,w);return n.createElement(n.Fragment,null,n.createElement(v,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),n.createElement(m,t))},B=n.memo(b,d.Q);B.displayName="YAxis"},23571(e,t,r){"use strict";r.d(t,{J:()=>n});var n=e=>e.tooltip},23636(e,t,r){"use strict";r.d(t,{A:()=>a});var n=r(73753),i=r(49135),A=r(86931),o=r(59379);const a=function(){function e(e){this.field=e}return e.prototype.decode=function(e,t){for(var r=this.field,o=new i.A(r,e),a=new Int32Array(t),s=!0,u=0;u<t;u++){var c=o.evaluateAt(r.exp(u+r.getGeneratorBase()));a[a.length-1-u]=c,0!==c&&(s=!1)}if(!s){var l=new i.A(r,a),f=this.runEuclideanAlgorithm(r.buildMonomial(t,1),l,t),d=f[0],h=f[1],p=this.findErrorLocations(d),g=this.findErrorMagnitudes(h,p);for(u=0;u<p.length;u++){var y=e.length-1-r.log(p[u]);if(y<0)throw new A.A("Bad error location");e[y]=n.A.addOrSubtract(e[y],g[u])}}},e.prototype.runEuclideanAlgorithm=function(e,t,r){if(e.getDegree()<t.getDegree()){var n=e;e=t,t=n}for(var i=this.field,a=e,s=t,u=i.getZero(),c=i.getOne();s.getDegree()>=(r/2|0);){var l=a,f=u;if(u=c,(a=s).isZero())throw new A.A("r_{i-1} was zero");s=l;for(var d=i.getZero(),h=a.getCoefficient(a.getDegree()),p=i.inverse(h);s.getDegree()>=a.getDegree()&&!s.isZero();){var g=s.getDegree()-a.getDegree(),y=i.multiply(s.getCoefficient(s.getDegree()),p);d=d.addOrSubtract(i.buildMonomial(g,y)),s=s.addOrSubtract(a.multiplyByMonomial(g,y))}if(c=d.multiply(u).addOrSubtract(f),s.getDegree()>=a.getDegree())throw new o.A("Division algorithm failed to reduce polynomial?")}var v=c.getCoefficient(0);if(0===v)throw new A.A("sigmaTilde(0) was zero");var m=i.inverse(v);return[c.multiplyScalar(m),s.multiplyScalar(m)]},e.prototype.findErrorLocations=function(e){var t=e.getDegree();if(1===t)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(t),n=0,i=this.field,o=1;o<i.getSize()&&n<t;o++)0===e.evaluateAt(o)&&(r[n]=i.inverse(o),n++);if(n!==t)throw new A.A("Error locator degree does not match number of roots");return r},e.prototype.findErrorMagnitudes=function(e,t){for(var r=t.length,n=new Int32Array(r),i=this.field,A=0;A<r;A++){for(var o=i.inverse(t[A]),a=1,s=0;s<r;s++)if(A!==s){var u=i.multiply(t[s],o),c=1&u?-2&u:1|u;a=i.multiply(a,c)}n[A]=i.multiply(e.evaluateAt(o),i.inverse(a)),0!==i.getGeneratorBase()&&(n[A]=i.multiply(n[A],o))}return n},e}()},23929(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){A(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function A(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{dl:()=>o,mP:()=>a,s8:()=>s});var o=(e,t,r)=>e.map(e=>{return"".concat((n=e,n.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase())))," ").concat(t,"ms ").concat(r);var n}).join(","),a=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((e,t)=>e.filter(e=>t.includes(e))),s=(e,t)=>Object.keys(t).reduce((r,n)=>i(i({},r),{},{[n]:e(n,t[n])}),{})},24128(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function A(e,t,n,A,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,A||e,o),s=r?r+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],a]:e._events[s].push(a):(e._events[s]=a,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,A=n.length,o=new Array(A);i<A;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,i,A,o){var a=r?r+e:e;if(!this._events[a])return!1;var s,u,c=this._events[a],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,A),!0;case 6:return c.fn.call(c.context,t,n,i,A,o),!0}for(u=1,s=new Array(l-1);u<l;u++)s[u-1]=arguments[u];c.fn.apply(c.context,s)}else{var f,d=c.length;for(u=0;u<d;u++)switch(c[u].once&&this.removeListener(e,c[u].fn,void 0,!0),l){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,t);break;case 3:c[u].fn.call(c[u].context,t,n);break;case 4:c[u].fn.call(c[u].context,t,n,i);break;default:if(!s)for(f=1,s=new Array(l-1);f<l;f++)s[f-1]=arguments[f];c[u].fn.apply(c[u].context,s)}}return!0},a.prototype.on=function(e,t,r){return A(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return A(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,n,i){var A=r?r+e:e;if(!this._events[A])return this;if(!t)return o(this,A),this;var a=this._events[A];if(a.fn)a.fn!==t||i&&!a.once||n&&a.context!==n||o(this,A);else{for(var s=0,u=[],c=a.length;s<c;s++)(a[s].fn!==t||i&&!a[s].once||n&&a[s].context!==n)&&u.push(a[s]);u.length?this._events[A]=1===u.length?u[0]:u:o(this,A)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},24483(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.toArray=function(e){return Array.isArray(e)?e:Array.from(e)}},24599(e,t,r){"use strict";var n=r(46518),i=r(44576),A=r(79472)(i.setTimeout,!0);n({global:!0,bind:!0,forced:i.setTimeout!==A},{setTimeout:A})},24880(e,t,r){"use strict";r.d(t,{Cp:()=>p,EN:()=>h,Eh:()=>c,F$:()=>d,GU:()=>F,MK:()=>l,S$:()=>i,ZM:()=>O,ZZ:()=>S,Zw:()=>o,d2:()=>u,f8:()=>v,gn:()=>a,hT:()=>I,j3:()=>s,lQ:()=>A,nJ:()=>f,ox:()=>_,pl:()=>C,y9:()=>E,yy:()=>B});var n=r(52775),i="undefined"==typeof window||"Deno"in globalThis;function A(){}function o(e,t){return"function"==typeof e?e(t):e}function a(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function l(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:A,queryKey:o,stale:a}=e;if(o)if(n){if(t.queryHash!==d(o,t.options))return!1}else if(!p(t.queryKey,o))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&((!i||i===t.state.fetchStatus)&&!(A&&!A(t)))}function f(e,t){const{exact:r,status:n,predicate:i,mutationKey:A}=e;if(A){if(!t.options.mutationKey)return!1;if(r){if(h(t.options.mutationKey)!==h(A))return!1}else if(!p(t.options.mutationKey,A))return!1}return(!n||t.state.status===n)&&!(i&&!i(t))}function d(e,t){return(t?.queryKeyHashFn||h)(e)}function h(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function p(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>p(e[r],t[r])))}var g=Object.prototype.hasOwnProperty;function y(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=m(e)&&m(t);if(!(n||w(e)&&w(t)))return t;const i=(n?e:Object.keys(e)).length,A=n?t:Object.keys(t),o=A.length,a=n?new Array(o):{};let s=0;for(let u=0;u<o;u++){const o=n?u:A[u],c=e[o],l=t[o];if(c===l){a[o]=c,(n?u<i:g.call(e,o))&&s++;continue}if(null===c||null===l||"object"!=typeof c||"object"!=typeof l){a[o]=l;continue}const f=y(c,l,r+1);a[o]=f,f===c&&s++}return i===o&&s===i?e:a}function v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function m(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!b(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!b(r)&&(!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function b(e){return"[object Object]"===Object.prototype.toString.call(e)}function B(e){return new Promise(t=>{n.zs.setTimeout(t,e)})}function C(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?y(e,t):t}function E(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function S(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var I=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==I?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function F(e,t){return"function"==typeof e?e(...t):!!e}function _(e,t,r){let n,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),i||(i=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}},25259(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(70008);t.throttle=function(e,t=0,r={}){const{leading:i=!0,trailing:A=!0}=r;return n.debounce(e,t,{leading:i,maxWait:t,trailing:A})}},25276(e,t,r){"use strict";var n=r(46518),i=r(27476),A=r(19617).indexOf,o=r(34598),a=i([].indexOf),s=!!a&&1/a([1],1,-0)<0;n({target:"Array",proto:!0,forced:s||!o("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return s?a(this,e,t)||0:A(this,e,t)}})},25440(e,t,r){"use strict";var n=r(18745),i=r(69565),A=r(79504),o=r(89228),a=r(79039),s=r(28551),u=r(94901),c=r(20034),l=r(91291),f=r(18014),d=r(655),h=r(67750),p=r(57829),g=r(55966),y=r(2478),v=r(61034),m=r(56682),w=r(78227)("replace"),b=Math.max,B=Math.min,C=A([].concat),E=A([].push),S=A("".indexOf),I=A("".slice),O=function(e){return void 0===e?e:String(e)},F="$0"==="a".replace(/./,"$0"),_=!!/./[w]&&""===/./[w]("a","$0");o("replace",function(e,t,r){var A=_?"$":"$0";return[function(e,r){var n=h(this),A=c(e)?g(e,w):void 0;return A?i(A,e,n,r):i(t,d(n),e,r)},function(e,i){var o=s(this),a=d(e);if("string"==typeof i&&-1===S(i,A)&&-1===S(i,"$<")){var c=r(t,o,a,i);if(c.done)return c.value}var h=u(i);h||(i=d(i));var g,w=d(v(o)),F=-1!==S(w,"g");F&&(g=-1!==S(w,"u"),o.lastIndex=0);for(var _,x=[];null!==(_=m(o,a))&&(E(x,_),F);){""===d(_[0])&&(o.lastIndex=p(a,f(o.lastIndex),g))}for(var U="",Q=0,T=0;T<x.length;T++){for(var M,P=d((_=x[T])[0]),D=b(B(l(_.index),a.length),0),k=[],N=1;N<_.length;N++)E(k,O(_[N]));var R=_.groups;if(h){var L=C([P],k,D,a);void 0!==R&&E(L,R),M=d(n(i,void 0,L))}else M=y(P,a,D,k,R,i);D>=Q&&(U+=I(a,Q,D)+M,Q=D+P.length)}return U+I(a,Q)}]},!!a(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!F||_)},25508(e,t,r){"use strict";r.d(t,{Mz:()=>c});function n(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}var i=e=>Array.isArray(e)?e:[e];function A(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const r=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${r}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}Symbol(),Object.getPrototypeOf({});var o="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function a(){return{s:0,v:void 0,o:null,p:null}}function s(e,t={}){let r={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:n}=t;let i,A=0;function s(){let t=r;const{length:s}=arguments;for(let e=0,r=s;e<r;e++){const r=arguments[e];if("function"==typeof r||"object"==typeof r&&null!==r){let e=t.o;null===e&&(t.o=e=new WeakMap);const n=e.get(r);void 0===n?(t=a(),e.set(r,t)):t=n}else{let e=t.p;null===e&&(t.p=e=new Map);const n=e.get(r);void 0===n?(t=a(),e.set(r,t)):t=n}}const u=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),A++,n){const e=i?.deref?.()??i;null!=e&&n(e,c)&&(c=e,0!==A&&A--);i="object"==typeof c&&null!==c||"function"==typeof c?new o(c):c}return u.s=1,u.v=c,c}return s.clearCache=()=>{r={s:0,v:void 0,o:null,p:null},s.resetResultsCount()},s.resultsCount=()=>A,s.resetResultsCount=()=>{A=0},s}function u(e,...t){const r="function"==typeof e?{memoize:e,memoizeOptions:t}:e,o=(...e)=>{let t,o=0,a=0,u={},c=e.pop();"object"==typeof c&&(u=c,c=e.pop()),n(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const l={...r,...u},{memoize:f,memoizeOptions:d=[],argsMemoize:h=s,argsMemoizeOptions:p=[],devModeChecks:g={}}=l,y=i(d),v=i(p),m=A(e),w=f(function(){return o++,c.apply(null,arguments)},...y);const b=h(function(){a++;const e=function(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}(m,arguments);return t=w.apply(null,e),t},...v);return Object.assign(b,{resultFunc:c,memoizedResultFunc:w,dependencies:m,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>t,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:h})};return Object.assign(o,{withTypes:()=>o}),o}var c=u(s),l=Object.assign((e,t=c)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const r=Object.keys(e);return t(r.map(t=>e[t]),(...e)=>e.reduce((e,t,n)=>(e[r[n]]=t,e),{}))},{withTypes:()=>l})},26261(e,t,r){"use strict";r.d(t,{jG:()=>i});var n=r(52775).Zq;var i=function(){let e=[],t=0,r=e=>{e()},i=e=>{e()},A=n;const o=n=>{t?e.push(n):A(()=>{r(n)})};return{batch:n=>{let o;t++;try{o=n()}finally{t--,t||(()=>{const t=e;e=[],t.length&&A(()=>{i(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{A=e}}}()},26317(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(57149);const i=function(){function e(e){if(this.binarizer=e,null===e)throw new n.A("Binarizer must be non-null.")}return e.prototype.getWidth=function(){return this.binarizer.getWidth()},e.prototype.getHeight=function(){return this.binarizer.getHeight()},e.prototype.getBlackRow=function(e,t){return this.binarizer.getBlackRow(e,t)},e.prototype.getBlackMatrix=function(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},e.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},e.prototype.crop=function(t,r,n,i){var A=this.binarizer.getLuminanceSource().crop(t,r,n,i);return new e(this.binarizer.createBinarizer(A))},e.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},e.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new e(this.binarizer.createBinarizer(t))},e.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new e(this.binarizer.createBinarizer(t))},e.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(e){return""}},e}()},26470(e,t,r){"use strict";r.d(t,{qx:()=>P,IH:()=>M,s0:()=>w,sr:()=>R,eB:()=>L,YB:()=>S,Hj:()=>D,DW:()=>Q,y2:()=>U,nb:()=>x,PW:()=>B,Mk:()=>T,$8:()=>_,yy:()=>F,Rh:()=>C,GF:()=>k,uM:()=>N,kr:()=>m,_L:()=>b,_f:()=>I});var n=r(60184),i=r.n(n),A=r(80305),o=r.n(A);function a(e,t){if((i=e.length)>1)for(var r,n,i,A=1,o=e[t[0]],a=o.length;A<i;++A)for(n=o,o=e[t[A]],r=0;r<a;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}var s=r(45917),u=r(48946);function c(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function l(e,t){return e[t]}function f(e){const t=[];return t.key=e,t}var d=r(59744),h=r(79195),p=r(8813);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach(function(t){v(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function v(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function m(e,t,r){return(0,d.uy)(e)||(0,d.uy)(t)?r:(0,d.vh)(t)?o()(e,t,r):"function"==typeof t?t(e):r}var w=(e,t,r)=>{if(t&&r){var{width:n,height:i}=r,{align:A,verticalAlign:o,layout:a}=t;if(("vertical"===a||"horizontal"===a&&"middle"===o)&&"center"!==A&&(0,d.Et)(e[A]))return y(y({},e),{},{[A]:e[A]+(n||0)});if(("horizontal"===a||"vertical"===a&&"center"===A)&&"middle"!==o&&(0,d.Et)(e[o]))return y(y({},e),{},{[o]:e[o]+(i||0)})}return e},b=(e,t)=>"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t,B=(e,t,r,n)=>{if(n)return e.map(e=>e.coordinate);var i,A,o=e.map(e=>(e.coordinate===t&&(i=!0),e.coordinate===r&&(A=!0),e.coordinate));return i||o.push(t),A||o.push(r),o},C=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:i,range:A,scale:o,realScaleType:a,isCategorical:s,categoricalDomain:u,tickCount:c,ticks:l,niceTicks:f,axisType:h}=e;if(!o)return null;var p="scaleBand"===a&&o.bandwidth?o.bandwidth()/2:2,g=(t||r)&&"category"===i&&o.bandwidth?o.bandwidth()/p:0;return g="angleAxis"===h&&A&&A.length>=2?2*(0,d.sA)(A[0]-A[1])*g:g,t&&(l||f)?(l||f||[]).map((e,t)=>{var r=n?n.indexOf(e):e;return{coordinate:o(r)+g,value:e,offset:g,index:t}}).filter(e=>!(0,d.M8)(e.coordinate)):s&&u?u.map((e,t)=>({coordinate:o(e)+g,value:e,index:t,offset:g})):o.ticks&&!r&&null!=c?o.ticks(c).map((e,t)=>({coordinate:o(e)+g,value:e,offset:g,index:t})):o.domain().map((e,t)=>({coordinate:o(e)+g,value:n?n[e]:e,index:t,offset:g}))},E=1e-4,S=e=>{var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-E,A=Math.max(n[0],n[1])+E,o=e(t[0]),a=e(t[r-1]);(o<i||o>A||a<i||a>A)&&e.domain([t[0],t[r-1]])}},I=(e,t)=>{if(!t||2!==t.length||!(0,d.Et)(t[0])||!(0,d.Et)(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!(0,d.Et)(e[0])||e[0]<r)&&(i[0]=r),(!(0,d.Et)(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i},O={sign:e=>{var t,r=e.length;if(!(r<=0)){var n=null===(t=e[0])||void 0===t?void 0:t.length;if(!(null==n||n<=0))for(var i=0;i<n;++i)for(var A=0,o=0,a=0;a<r;++a){var s=e[a],u=null==s?void 0:s[i];if(null!=u){var c=u[1],l=u[0],f=(0,d.M8)(c)?l:c;f>=0?(u[0]=A,u[1]=A+f,A=c):(u[0]=o,u[1]=o+f,o=c)}}}},expand:function(e,t){if((n=e.length)>0){for(var r,n,i,A=0,o=e[0].length;A<o;++A){for(i=r=0;r<n;++r)i+=e[r][A][1]||0;if(i)for(r=0;r<n;++r)e[r][A][1]/=i}a(e,t)}},none:a,silhouette:function(e,t){if((r=e.length)>0){for(var r,n=0,i=e[t[0]],A=i.length;n<A;++n){for(var o=0,s=0;o<r;++o)s+=e[o][n][1]||0;i[n][1]+=i[n][0]=-s/2}a(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,i,A=0,o=1;o<n;++o){for(var s=0,u=0,c=0;s<i;++s){for(var l=e[t[s]],f=l[o][1]||0,d=(f-(l[o-1][1]||0))/2,h=0;h<s;++h){var p=e[t[h]];d+=(p[o][1]||0)-(p[o-1][1]||0)}u+=f,c+=d*f}r[o-1][1]+=r[o-1][0]=A,u&&(A-=c/u)}r[o-1][1]+=r[o-1][0]=A,a(e,t)}},positive:e=>{var t,r=e.length;if(!(r<=0)){var n=null===(t=e[0])||void 0===t?void 0:t.length;if(!(null==n||n<=0))for(var i=0;i<n;++i)for(var A=0,o=0;o<r;++o){var a=e[o],s=null==a?void 0:a[i];if(null!=s){var u=(0,d.M8)(s[1])?s[0]:s[1];u>=0?(s[0]=A,s[1]=A+u,A=s[1]):(s[0]=0,s[1]=0)}}}}},F=(e,t,r)=>{var n,i=null!==(n=O[r])&&void 0!==n?n:a,A=function(){var e=(0,u.A)([]),t=c,r=a,n=l;function i(i){var A,o,a=Array.from(e.apply(this,arguments),f),u=a.length,c=-1;for(const e of i)for(A=0,++c;A<u;++A)(a[A][c]=[0,+n(e,a[A].key,c,i)]).data=e;for(A=0,o=(0,s.A)(t(a));A<u;++A)a[o[A]].index=A;return r(a,o),a}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:(0,u.A)(Array.from(t)),i):e},i.value=function(e){return arguments.length?(n="function"==typeof e?e:(0,u.A)(+e),i):n},i.order=function(e){return arguments.length?(t=null==e?c:"function"==typeof e?e:(0,u.A)(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(r=null==e?a:e,i):r},i}().keys(t).value((e,t)=>Number(m(e,t,0))).order(c).offset(i),o=A(e);return o.forEach((r,n)=>{r.forEach((r,i)=>{var A=m(e[i],t[n],0);Array.isArray(A)&&2===A.length&&(0,d.Et)(A[0])&&(0,d.Et)(A[1])&&(r[0]=A[0],r[1]=A[1])})}),o};function _(e){return null==e?void 0:String(e)}function x(e){var{axis:t,ticks:r,bandSize:n,entry:i,index:A,dataKey:o}=e;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!(0,d.uy)(i[t.dataKey])){var a=(0,d.eP)(r,"value",i[t.dataKey]);if(a)return a.coordinate+n/2}return r[A]?r[A].coordinate+n/2:null}var s=m(i,(0,d.uy)(o)?t.dataKey:o);return(0,d.uy)(s)?null:t.scale(s)}var U=e=>{var{axis:t,ticks:r,offset:n,bandSize:i,entry:A,index:o}=e;if("category"===t.type)return r[o]?r[o].coordinate+n:null;var a=m(A,t.dataKey,t.scale.domain()[o]);return(0,d.uy)(a)?null:t.scale(a)-i/2+n},Q=e=>{var{numericAxis:t}=e,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]},T=(e,t,r)=>{var n;if(null!=e)return[(n=Object.keys(e).reduce((n,i)=>{var A=e[i];if(!A)return n;var{stackedData:o}=A,a=o.reduce((e,n)=>{var i,A=(0,h.v)(n,t,r),o=(i=A.flat(2).filter(d.Et),[Math.min(...i),Math.max(...i)]);return(0,p.H)(o[0])&&(0,p.H)(o[1])?[Math.min(e[0],o[0]),Math.max(e[1],o[1])]:e},[1/0,-1/0]);return[Math.min(a[0],n[0]),Math.max(a[1],n[1])]},[1/0,-1/0]))[0]===1/0?0:n[0],n[1]===-1/0?0:n[1]]},M=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,P=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,D=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var A=i()(t,e=>e.coordinate),o=1/0,a=1,s=A.length;a<s;a++){var u=A[a],c=A[a-1];o=Math.min(((null==u?void 0:u.coordinate)||0)-((null==c?void 0:c.coordinate)||0),o)}return o===1/0?0:o}return r?void 0:0};function k(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:A}=e;return y(y({},t),{},{dataKey:r,payload:n,value:i,name:A})}function N(e,t){return e?String(e):"string"==typeof t?t:void 0}var R=(e,t)=>"horizontal"===t?e.chartX:"vertical"===t?e.chartY:void 0,L=(e,t)=>"centric"===t?e.angle:e.radius},26741(e,t,r){"use strict";r.d(t,{A:()=>a});var n=r(57149),i=r(80442),A=r(36254),o=r(92819);const a=function(){function e(t,r){void 0===t?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=null==r?e.makeArray(t):r)}return e.prototype.getSize=function(){return this.size},e.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},e.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var r=e.makeArray(t);o.A.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},e.prototype.get=function(e){return!!(this.bits[Math.floor(e/32)]&1<<(31&e))},e.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},e.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},e.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var r=this.bits,n=Math.floor(e/32),i=r[n];i&=~((1<<(31&e))-1);for(var o=r.length;0===i;){if(++n===o)return t;i=r[n]}var a=32*n+A.A.numberOfTrailingZeros(i);return a>t?t:a},e.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var r=this.bits,n=Math.floor(e/32),i=~r[n];i&=~((1<<(31&e))-1);for(var o=r.length;0===i;){if(++n===o)return t;i=~r[n]}var a=32*n+A.A.numberOfTrailingZeros(i);return a>t?t:a},e.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},e.prototype.setRange=function(e,t){if(t<e||e<0||t>this.size)throw new n.A;if(t!==e){t--;for(var r=Math.floor(e/32),i=Math.floor(t/32),A=this.bits,o=r;o<=i;o++){var a=(2<<(o<i?31:31&t))-(1<<(o>r?0:31&e));A[o]|=a}}},e.prototype.clear=function(){for(var e=this.bits.length,t=this.bits,r=0;r<e;r++)t[r]=0},e.prototype.isRange=function(e,t,r){if(t<e||e<0||t>this.size)throw new n.A;if(t===e)return!0;t--;for(var i=Math.floor(e/32),A=Math.floor(t/32),o=this.bits,a=i;a<=A;a++){var s=(2<<(a<A?31:31&t))-(1<<(a>i?0:31&e))&4294967295;if((o[a]&s)!==(r?s:0))return!1}return!0},e.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},e.prototype.appendBits=function(e,t){if(t<0||t>32)throw new n.A("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var r=t;r>0;r--)this.appendBit(1==(e>>r-1&1))},e.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var r=0;r<t;r++)this.appendBit(e.get(r))},e.prototype.xor=function(e){if(this.size!==e.size)throw new n.A("Sizes don't match");for(var t=this.bits,r=0,i=t.length;r<i;r++)t[r]^=e.bits[r]},e.prototype.toBytes=function(e,t,r,n){for(var i=0;i<n;i++){for(var A=0,o=0;o<8;o++)this.get(e)&&(A|=1<<7-o),e++;t[r+i]=A}},e.prototype.getBitArray=function(){return this.bits},e.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),t=Math.floor((this.size-1)/32),r=t+1,n=this.bits,i=0;i<r;i++){var A=n[i];A=(A=(A=(A=(A=A>>1&1431655765|(1431655765&A)<<1)>>2&858993459|(858993459&A)<<2)>>4&252645135|(252645135&A)<<4)>>8&16711935|(16711935&A)<<8)>>16&65535|(65535&A)<<16,e[t-i]=A}if(this.size!==32*r){var o=32*r-this.size,a=e[0]>>>o;for(i=1;i<r;i++){var s=e[i];a|=s<<32-o,e[i-1]=a,a=s>>>o}e[r-1]=a}this.bits=e},e.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.size===r.size&&i.A.equals(this.bits,r.bits)},e.prototype.hashCode=function(){return 31*this.size+i.A.hashCode(this.bits)},e.prototype.toString=function(){for(var e="",t=0,r=this.size;t<r;t++)7&t||(e+=" "),e+=this.get(t)?"X":".";return e},e.prototype.clone=function(){return new e(this.size,this.bits.slice())},e.prototype.toArray=function(){for(var e=[],t=0,r=this.size;t<r;t++)e.push(this.get(t));return e},e}()},26818(e,t,r){"use strict";r.d(t,{A:()=>L});var n=r(73872),i=r(23431),A=r(8032),o=r(58503),a=r(7758),s=r(15511),u=r(43407),c=r(73753),l=r(23636),f=r(15906),d=r(4526),h=r(29105),p=r(31327);const g=function(){function e(e){var t=e.getHeight();if(t<21||1!=(3&t))throw new p.A;this.bitMatrix=e}return e.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var e=0,t=0;t<6;t++)e=this.copyBit(t,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var r=5;r>=0;r--)e=this.copyBit(8,r,e);var n=this.bitMatrix.getHeight(),i=0,A=n-7;for(r=n-1;r>=A;r--)i=this.copyBit(8,r,i);for(t=n-8;t<n;t++)i=this.copyBit(t,8,i);if(this.parsedFormatInfo=d.A.decodeFormatInformation(e,i),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new p.A},e.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var e=this.bitMatrix.getHeight(),t=Math.floor((e-17)/4);if(t<=6)return f.A.getVersionForNumber(t);for(var r=0,n=e-11,i=5;i>=0;i--)for(var A=e-9;A>=n;A--)r=this.copyBit(A,i,r);var o=f.A.decodeVersionInformation(r);if(null!==o&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;r=0;for(A=5;A>=0;A--)for(i=e-9;i>=n;i--)r=this.copyBit(A,i,r);if(null!==(o=f.A.decodeVersionInformation(r))&&o.getDimensionForVersion()===e)return this.parsedVersion=o,o;throw new p.A},e.prototype.copyBit=function(e,t,r){return(this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t))?r<<1|1:r<<1},e.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),r=h.A.values.get(e.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var i=t.buildFunctionPattern(),A=!0,o=new Uint8Array(t.getTotalCodewords()),a=0,s=0,u=0,c=n-1;c>0;c-=2){6===c&&c--;for(var l=0;l<n;l++)for(var f=A?n-1-l:l,d=0;d<2;d++)i.get(c-d,f)||(u++,s<<=1,this.bitMatrix.get(c-d,f)&&(s|=1),8===u&&(o[a++]=s,u=0,s=0));A=!A}if(a!==t.getTotalCodewords())throw new p.A;return o},e.prototype.remask=function(){if(null!==this.parsedFormatInfo){var e=h.A.values.get(this.parsedFormatInfo.getDataMask()),t=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,t)}},e.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},e.prototype.mirror=function(){for(var e=this.bitMatrix,t=0,r=e.getWidth();t<r;t++)for(var n=t+1,i=e.getHeight();n<i;n++)e.get(t,n)!==e.get(n,t)&&(e.flip(n,t),e.flip(t,n))},e}();var y=r(57149),v=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const m=function(){function e(e,t){this.numDataCodewords=e,this.codewords=t}return e.getDataBlocks=function(t,r,n){var i,A,o,a;if(t.length!==r.getTotalCodewords())throw new y.A;var s=r.getECBlocksForLevel(n),u=0,c=s.getECBlocks();try{for(var l=v(c),f=l.next();!f.done;f=l.next()){u+=(m=f.value).getCount()}}catch(e){i={error:e}}finally{try{f&&!f.done&&(A=l.return)&&A.call(l)}finally{if(i)throw i.error}}var d=new Array(u),h=0;try{for(var p=v(c),g=p.next();!g.done;g=p.next())for(var m=g.value,w=0;w<m.getCount();w++){var b=m.getDataCodewords(),B=s.getECCodewordsPerBlock()+b;d[h++]=new e(b,new Uint8Array(B))}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}for(var C=d[0].codewords.length,E=d.length-1;E>=0;){if(d[E].codewords.length===C)break;E--}E++;var S=C-s.getECCodewordsPerBlock(),I=0;for(w=0;w<S;w++)for(var O=0;O<h;O++)d[O].codewords[w]=t[I++];for(O=E;O<h;O++)d[O].codewords[S]=t[I++];var F=d[0].codewords.length;for(w=S;w<F;w++)for(O=0;O<h;O++){var _=O<E?w:w+1;d[O].codewords[_]=t[I++]}return d},e.prototype.getNumDataCodewords=function(){return this.numDataCodewords},e.prototype.getCodewords=function(){return this.codewords},e}();var w=r(13719);const b=function(){function e(e){this.mirrored=e}return e.prototype.isMirrored=function(){return this.mirrored},e.prototype.applyMirroredCorrection=function(e){if(this.mirrored&&null!==e&&!(e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},e}();var B=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const C=function(){function e(){this.rsDecoder=new l.A(c.A.QR_CODE_FIELD_256)}return e.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(i.A.parseFromBooleanArray(e),t)},e.prototype.decodeBitMatrix=function(e,t){var r=new g(e),n=null;try{return this.decodeBitMatrixParser(r,t)}catch(e){n=e}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,t);return i.setOther(new b(!0)),i}catch(e){if(null!==n)throw n;throw e}},e.prototype.decodeBitMatrixParser=function(e,t){var r,n,i,A,o=e.readVersion(),a=e.readFormatInformation().getErrorCorrectionLevel(),s=e.readCodewords(),u=m.getDataBlocks(s,o,a),c=0;try{for(var l=B(u),f=l.next();!f.done;f=l.next()){c+=(y=f.value).getNumDataCodewords()}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}var d=new Uint8Array(c),h=0;try{for(var p=B(u),g=p.next();!g.done;g=p.next()){var y,v=(y=g.value).getCodewords(),b=y.getNumDataCodewords();this.correctErrors(v,b);for(var C=0;C<b;C++)d[h++]=v[C]}}catch(e){i={error:e}}finally{try{g&&!g.done&&(A=p.return)&&A.call(p)}finally{if(i)throw i.error}}return w.A.decode(d,o,a,t)},e.prototype.correctErrors=function(e,t){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-t)}catch(e){throw new u.A}for(var n=0;n<t;n++)e[n]=r[n]},e}();var E,S=r(28823),I=r(12122),O=r(50998),F=r(71983),_=r(93234),x=(E=function(e,t){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},E(e,t)},function(e,t){function r(){this.constructor=e}E(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const U=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.estimatedModuleSize=n,i}return x(t,e),t.prototype.aboutEquals=function(e,t,r){if(Math.abs(t-this.getY())<=e&&Math.abs(r-this.getX())<=e){var n=Math.abs(e-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,r,n){return new t((this.getX()+r)/2,(this.getY()+e)/2,(this.estimatedModuleSize+n)/2)},t}(_.A);var Q=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const T=function(){function e(e,t,r,n,i,A,o){this.image=e,this.startX=t,this.startY=r,this.width=n,this.height=i,this.moduleSize=A,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return e.prototype.find=function(){for(var e=this.startX,t=this.height,r=e+this.width,n=this.startY+t/2,i=new Int32Array(3),A=this.image,a=0;a<t;a++){var s=n+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var u=e;u<r&&!A.get(u,s);)u++;for(var c=0;u<r;){if(A.get(u,s))if(1===c)i[1]++;else if(2===c){var l;if(this.foundPatternCross(i))if(null!==(l=this.handlePossibleCenter(i,s,u)))return l;i[0]=i[2],i[1]=1,i[2]=0,c=1}else i[++c]++;else 1===c&&c++,i[c]++;u++}if(this.foundPatternCross(i))if(null!==(l=this.handlePossibleCenter(i,s,r)))return l}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new o.A},e.centerFromEnd=function(e,t){return t-e[2]-e[1]/2},e.prototype.foundPatternCross=function(e){for(var t=this.moduleSize,r=t/2,n=0;n<3;n++)if(Math.abs(t-e[n])>=r)return!1;return!0},e.prototype.crossCheckVertical=function(t,r,n,i){var A=this.image,o=A.getHeight(),a=this.crossCheckStateCount;a[0]=0,a[1]=0,a[2]=0;for(var s=t;s>=0&&A.get(r,s)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&!A.get(r,s)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<o&&A.get(r,s)&&a[1]<=n;)a[1]++,s++;if(s===o||a[1]>n)return NaN;for(;s<o&&!A.get(r,s)&&a[2]<=n;)a[2]++,s++;if(a[2]>n)return NaN;var u=a[0]+a[1]+a[2];return 5*Math.abs(u-i)>=2*i?NaN:this.foundPatternCross(a)?e.centerFromEnd(a,s):NaN},e.prototype.handlePossibleCenter=function(t,r,n){var i,A,o=t[0]+t[1]+t[2],a=e.centerFromEnd(t,n),s=this.crossCheckVertical(r,a,2*t[1],o);if(!isNaN(s)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=Q(this.possibleCenters),l=c.next();!l.done;l=c.next()){var f=l.value;if(f.aboutEquals(u,s,a))return f.combineEstimate(s,a,u)}}catch(e){i={error:e}}finally{try{l&&!l.done&&(A=c.return)&&A.call(c)}finally{if(i)throw i.error}}var d=new U(a,s,u);this.possibleCenters.push(d),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},e}();var M=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const P=function(e){function t(t,r,n,i){var A=e.call(this,t,r)||this;return A.estimatedModuleSize=n,A.count=i,void 0===i&&(A.count=1),A}return M(t,e),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,t,r){if(Math.abs(t-this.getY())<=e&&Math.abs(r-this.getX())<=e){var n=Math.abs(e-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,r,n){var i=this.count+1;return new t((this.count*this.getX()+r)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+n)/i,i)},t}(_.A);const D=function(){function e(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return e.prototype.getBottomLeft=function(){return this.bottomLeft},e.prototype.getTopLeft=function(){return this.topLeft},e.prototype.getTopRight=function(){return this.topRight},e}();var k=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const N=function(){function e(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return e.prototype.getImage=function(){return this.image},e.prototype.getPossibleCenters=function(){return this.possibleCenters},e.prototype.find=function(t){var r=null!=t&&void 0!==t.get(A.A.TRY_HARDER),n=null!=t&&void 0!==t.get(A.A.PURE_BARCODE),i=this.image,o=i.getHeight(),a=i.getWidth(),s=Math.floor(3*o/(4*e.MAX_MODULES));(s<e.MIN_SKIP||r)&&(s=e.MIN_SKIP);for(var u=!1,c=new Int32Array(5),l=s-1;l<o&&!u;l+=s){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;for(var f=0,d=0;d<a;d++)if(i.get(d,l))1&~f||f++,c[f]++;else if(1&f)c[f]++;else if(4===f)if(e.foundPatternCross(c)){if(!0!==this.handlePossibleCenter(c,l,d,n)){c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,f=3;continue}if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var h=this.findRowSkip();h>c[2]&&(l+=h-c[2]-s,d=a-1)}f=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,f=3;else c[++f]++;if(e.foundPatternCross(c))!0===this.handlePossibleCenter(c,l,a,n)&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return _.A.orderBestPatterns(p),new D(p)},e.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},e.foundPatternCross=function(e){for(var t=0,r=0;r<5;r++){var n=e[r];if(0===n)return!1;t+=n}if(t<7)return!1;var i=t/7,A=i/2;return Math.abs(i-e[0])<A&&Math.abs(i-e[1])<A&&Math.abs(3*i-e[2])<3*A&&Math.abs(i-e[3])<A&&Math.abs(i-e[4])<A},e.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},e.prototype.crossCheckDiagonal=function(t,r,n,i){for(var A=this.getCrossCheckStateCount(),o=0,a=this.image;t>=o&&r>=o&&a.get(r-o,t-o);)A[2]++,o++;if(t<o||r<o)return!1;for(;t>=o&&r>=o&&!a.get(r-o,t-o)&&A[1]<=n;)A[1]++,o++;if(t<o||r<o||A[1]>n)return!1;for(;t>=o&&r>=o&&a.get(r-o,t-o)&&A[0]<=n;)A[0]++,o++;if(A[0]>n)return!1;var s=a.getHeight(),u=a.getWidth();for(o=1;t+o<s&&r+o<u&&a.get(r+o,t+o);)A[2]++,o++;if(t+o>=s||r+o>=u)return!1;for(;t+o<s&&r+o<u&&!a.get(r+o,t+o)&&A[3]<n;)A[3]++,o++;if(t+o>=s||r+o>=u||A[3]>=n)return!1;for(;t+o<s&&r+o<u&&a.get(r+o,t+o)&&A[4]<n;)A[4]++,o++;if(A[4]>=n)return!1;var c=A[0]+A[1]+A[2]+A[3]+A[4];return Math.abs(c-i)<2*i&&e.foundPatternCross(A)},e.prototype.crossCheckVertical=function(t,r,n,i){for(var A=this.image,o=A.getHeight(),a=this.getCrossCheckStateCount(),s=t;s>=0&&A.get(r,s);)a[2]++,s--;if(s<0)return NaN;for(;s>=0&&!A.get(r,s)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&A.get(r,s)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<o&&A.get(r,s);)a[2]++,s++;if(s===o)return NaN;for(;s<o&&!A.get(r,s)&&a[3]<n;)a[3]++,s++;if(s===o||a[3]>=n)return NaN;for(;s<o&&A.get(r,s)&&a[4]<n;)a[4]++,s++;if(a[4]>=n)return NaN;var u=a[0]+a[1]+a[2]+a[3]+a[4];return 5*Math.abs(u-i)>=2*i?NaN:e.foundPatternCross(a)?e.centerFromEnd(a,s):NaN},e.prototype.crossCheckHorizontal=function(t,r,n,i){for(var A=this.image,o=A.getWidth(),a=this.getCrossCheckStateCount(),s=t;s>=0&&A.get(s,r);)a[2]++,s--;if(s<0)return NaN;for(;s>=0&&!A.get(s,r)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&A.get(s,r)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<o&&A.get(s,r);)a[2]++,s++;if(s===o)return NaN;for(;s<o&&!A.get(s,r)&&a[3]<n;)a[3]++,s++;if(s===o||a[3]>=n)return NaN;for(;s<o&&A.get(s,r)&&a[4]<n;)a[4]++,s++;if(a[4]>=n)return NaN;var u=a[0]+a[1]+a[2]+a[3]+a[4];return 5*Math.abs(u-i)>=i?NaN:e.foundPatternCross(a)?e.centerFromEnd(a,s):NaN},e.prototype.handlePossibleCenter=function(t,r,n,i){var A=t[0]+t[1]+t[2]+t[3]+t[4],o=e.centerFromEnd(t,n),a=this.crossCheckVertical(r,Math.floor(o),t[2],A);if(!isNaN(a)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(a),t[2],A),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(a),Math.floor(o),t[2],A)))){for(var s=A/7,u=!1,c=this.possibleCenters,l=0,f=c.length;l<f;l++){var d=c[l];if(d.aboutEquals(s,a,o)){c[l]=d.combineEstimate(a,o,s),u=!0;break}}if(!u){var h=new P(o,a,s);c.push(h),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(h)}return!0}return!1},e.prototype.findRowSkip=function(){var t,r;if(this.possibleCenters.length<=1)return 0;var n=null;try{for(var i=k(this.possibleCenters),A=i.next();!A.done;A=i.next()){var o=A.value;if(o.getCount()>=e.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-o.getX())-Math.abs(n.getY()-o.getY()))/2);n=o}}}catch(e){t={error:e}}finally{try{A&&!A.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return 0},e.prototype.haveMultiplyConfirmedCenters=function(){var t,r,n,i,A=0,o=0,a=this.possibleCenters.length;try{for(var s=k(this.possibleCenters),u=s.next();!u.done;u=s.next()){(h=u.value).getCount()>=e.CENTER_QUORUM&&(A++,o+=h.getEstimatedModuleSize())}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}if(A<3)return!1;var c=o/a,l=0;try{for(var f=k(this.possibleCenters),d=f.next();!d.done;d=f.next()){var h=d.value;l+=Math.abs(h.getEstimatedModuleSize()-c)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}return l<=.05*o},e.prototype.selectBestPatterns=function(){var e,t,r,n,i=this.possibleCenters.length;if(i<3)throw new o.A;var A,a=this.possibleCenters;if(i>3){var s=0,u=0;try{for(var c=k(this.possibleCenters),l=c.next();!l.done;l=c.next()){var f=l.value.getEstimatedModuleSize();s+=f,u+=f*f}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=c.return)&&t.call(c)}finally{if(e)throw e.error}}A=s/i;var d=Math.sqrt(u/i-A*A);a.sort(function(e,t){var r=Math.abs(t.getEstimatedModuleSize()-A),n=Math.abs(e.getEstimatedModuleSize()-A);return r<n?-1:r>n?1:0});for(var h=Math.max(.2*A,d),p=0;p<a.length&&a.length>3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-A)>h&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var y=k(a),v=y.next();!v.done;v=y.next()){s+=v.value.getEstimatedModuleSize()}}catch(e){r={error:e}}finally{try{v&&!v.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}A=s/a.length,a.sort(function(e,t){if(t.getCount()===e.getCount()){var r=Math.abs(t.getEstimatedModuleSize()-A),n=Math.abs(e.getEstimatedModuleSize()-A);return r<n?1:r>n?-1:0}return t.getCount()-e.getCount()}),a.splice(3)}return[a[0],a[1],a[2]]},e.CENTER_QUORUM=2,e.MIN_SKIP=3,e.MAX_MODULES=57,e}();const R=function(){function e(e){this.image=e}return e.prototype.getImage=function(){return this.image},e.prototype.getResultPointCallback=function(){return this.resultPointCallback},e.prototype.detect=function(e){this.resultPointCallback=null==e?null:e.get(A.A.NEED_RESULT_POINT_CALLBACK);var t=new N(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(t)},e.prototype.processFinderPatternInfo=function(t){var r=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),A=this.calculateModuleSize(r,n,i);if(A<1)throw new o.A("No pattern found in proccess finder.");var a=e.computeDimension(r,n,i,A),s=f.A.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var l=n.getX()-r.getX()+i.getX(),d=n.getY()-r.getY()+i.getY(),h=1-3/u,p=Math.floor(r.getX()+h*(l-r.getX())),g=Math.floor(r.getY()+h*(d-r.getY())),y=4;y<=16;y<<=1)try{c=this.findAlignmentInRegion(A,p,g,y);break}catch(e){if(!(e instanceof o.A))throw e}var v,m=e.createTransform(r,n,i,c,a),w=e.sampleGrid(this.image,m,a);return v=null===c?[i,r,n]:[i,r,n,c],new I.A(w,v)},e.createTransform=function(e,t,r,n,i){var A,o,a,s,u=i-3.5;return null!==n?(A=n.getX(),o=n.getY(),s=a=u-3):(A=t.getX()-e.getX()+r.getX(),o=t.getY()-e.getY()+r.getY(),a=u,s=u),F.A.quadrilateralToQuadrilateral(3.5,3.5,u,3.5,a,s,3.5,u,e.getX(),e.getY(),t.getX(),t.getY(),A,o,r.getX(),r.getY())},e.sampleGrid=function(e,t,r){return O.A.getInstance().sampleGridWithTransform(e,r,r,t)},e.computeDimension=function(e,t,r,n){var i=S.A.round(_.A.distance(e,t)/n),A=S.A.round(_.A.distance(e,r)/n),a=Math.floor((i+A)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new o.A("Dimensions could be not found.")}return a},e.prototype.calculateModuleSize=function(e,t,r){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,r))/2},e.prototype.calculateModuleSizeOneWay=function(e,t){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},e.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,r,n){var i=this.sizeOfBlackWhiteBlackRun(e,t,r,n),A=1,o=e-(r-e);o<0?(A=e/(e-o),o=0):o>=this.image.getWidth()&&(A=(this.image.getWidth()-1-e)/(o-e),o=this.image.getWidth()-1);var a=Math.floor(t-(n-t)*A);return A=1,a<0?(A=t/(t-a),a=0):a>=this.image.getHeight()&&(A=(this.image.getHeight()-1-t)/(a-t),a=this.image.getHeight()-1),o=Math.floor(e+(o-e)*A),(i+=this.sizeOfBlackWhiteBlackRun(e,t,o,a))-1},e.prototype.sizeOfBlackWhiteBlackRun=function(e,t,r,n){var i=Math.abs(n-t)>Math.abs(r-e);if(i){var A=e;e=t,t=A,A=r,r=n,n=A}for(var o=Math.abs(r-e),a=Math.abs(n-t),s=-o/2,u=e<r?1:-1,c=t<n?1:-1,l=0,f=r+u,d=e,h=t;d!==f;d+=u){var p=i?h:d,g=i?d:h;if(1===l===this.image.get(p,g)){if(2===l)return S.A.distance(d,h,e,t);l++}if((s+=a)>0){if(h===n)break;h+=c,s-=o}}return 2===l?S.A.distance(r+u,n,e,t):NaN},e.prototype.findAlignmentInRegion=function(e,t,r,n){var i=Math.floor(n*e),A=Math.max(0,t-i),a=Math.min(this.image.getWidth()-1,t+i);if(a-A<3*e)throw new o.A("Alignment top exceeds estimated module size.");var s=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-s<3*e)throw new o.A("Alignment bottom exceeds estimated module size.");return new T(this.image,A,s,a-A,u-s,e,this.resultPointCallback).find()},e}();const L=function(){function e(){this.decoder=new C}return e.prototype.getDecoder=function(){return this.decoder},e.prototype.decode=function(t,r){var i,o;if(null!=r&&void 0!==r.get(A.A.PURE_BARCODE)){var u=e.extractPureBits(t.getBlackMatrix());i=this.decoder.decodeBitMatrix(u,r),o=e.NO_POINTS}else{var c=new R(t.getBlackMatrix()).detect(r);i=this.decoder.decodeBitMatrix(c.getBits(),r),o=c.getPoints()}i.getOther()instanceof b&&i.getOther().applyMirroredCorrection(o);var l=new a.A(i.getText(),i.getRawBytes(),void 0,o,n.A.QR_CODE,void 0),f=i.getByteSegments();null!==f&&l.putMetadata(s.A.BYTE_SEGMENTS,f);var d=i.getECLevel();return null!==d&&l.putMetadata(s.A.ERROR_CORRECTION_LEVEL,d),i.hasStructuredAppend()&&(l.putMetadata(s.A.STRUCTURED_APPEND_SEQUENCE,i.getStructuredAppendSequenceNumber()),l.putMetadata(s.A.STRUCTURED_APPEND_PARITY,i.getStructuredAppendParity())),l},e.prototype.reset=function(){},e.extractPureBits=function(e){var t=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(null===t||null===r)throw new o.A;var n=this.moduleSize(t,e),A=t[1],a=r[1],s=t[0],u=r[0];if(s>=u||A>=a)throw new o.A;if(a-A!==u-s&&(u=s+(a-A))>=e.getWidth())throw new o.A;var c=Math.round((u-s+1)/n),l=Math.round((a-A+1)/n);if(c<=0||l<=0)throw new o.A;if(l!==c)throw new o.A;var f=Math.floor(n/2);A+=f;var d=(s+=f)+Math.floor((c-1)*n)-u;if(d>0){if(d>f)throw new o.A;s-=d}var h=A+Math.floor((l-1)*n)-a;if(h>0){if(h>f)throw new o.A;A-=h}for(var p=new i.A(c,l),g=0;g<l;g++)for(var y=A+Math.floor(g*n),v=0;v<c;v++)e.get(s+Math.floor(v*n),y)&&p.set(v,g);return p},e.moduleSize=function(e,t){for(var r=t.getHeight(),n=t.getWidth(),i=e[0],A=e[1],a=!0,s=0;i<n&&A<r;){if(a!==t.get(i,A)){if(5===++s)break;a=!a}i++,A++}if(i===n||A===r)throw new o.A;return(i-e[0])/7},e.NO_POINTS=new Array,e}()},26960(e,t,r){"use strict";r.d(t,{dl:()=>u,lJ:()=>s,uN:()=>A});var n=r(65307),i=r(59744);function A(e,t){if(t){var r=Number.parseInt(t,10);if(!(0,i.M8)(r))return null==e?void 0:e[r]}}var o={chartName:"",tooltipPayloadSearcher:void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},a=(0,n.Z0)({name:"options",initialState:o,reducers:{createEventEmitter:e=>{null==e.eventEmitter&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),s=a.reducer,{createEventEmitter:u}=a.actions},27132(e,t,r){"use strict";r.d(t,{g:()=>l});var n=r(96540),i=r(40961),A=r(59744),o=r(49082),a=r(64923),s=r(85138),u=r(19287),c=r(12070);function l(e){var{zIndex:t,children:r}=e,l=(0,u.SG)()&&void 0!==t&&0!==t,f=(0,c.r)(),d=(0,o.j)();(0,n.useLayoutEffect)(()=>l?(d((0,s.wR)({zIndex:t})),()=>{d((0,s.ZV)({zIndex:t}))}):A.lQ,[d,t,l]);var h=(0,o.G)(e=>(0,a.h)(e,t,f));return l?h?(0,i.createPortal)(r,h):null:r}},27208(e,t,r){"use strict";var n=r(46518),i=r(69565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},27337(e,t,r){"use strict";var n=r(46518),i=r(79504),A=r(35610),o=RangeError,a=String.fromCharCode,s=String.fromCodePoint,u=i([].join);n({target:"String",stat:!0,arity:1,forced:!!s&&1!==s.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],A(t,1114111)!==t)throw new o(t+" is not a valid code point");r[i]=t<65536?a(t):a(55296+((t-=65536)>>10),t%1024+56320)}return u(r,"")}})},27562(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="UnsupportedOperationException",t}(i.A);const a=o},28129(e,t,r){"use strict";r.d(t,{q:()=>i});var n=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function i(e){return"string"==typeof e&&n.includes(e)}},28202(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(36440),i=r(83403),A=r(7861),o=r(53036);t.iteratee=function(e){if(null==e)return n.identity;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&2===e.length?o.matchesProperty(e[0],e[1]):A.matches(e);case"string":case"symbol":case"number":return i.property(e)}}},28482(e,t,r){"use strict";r.d(t,{u:()=>E,w:()=>B});var n=r(34164),i=r(96540),A=r(74297),o=r.n(A),a=r(59744),s=r(6634),u=(e,t,r)=>{var{width:n="100%",height:i="100%",aspect:A,maxHeight:o}=r,s=(0,a._3)(n)?e:Number(n),u=(0,a._3)(i)?t:Number(i);return A&&A>0&&(s?u=s/A:u&&(s=u*A),o&&null!=u&&u>o&&(u=o)),{calculatedWidth:s,calculatedHeight:u}},c={width:0,height:0,overflow:"visible"},l={width:0,overflowX:"visible"},f={height:0,overflowY:"visible"},d={},h=e=>{var{width:t,height:r}=e,n=(0,a._3)(t),i=(0,a._3)(r);return n&&i?c:n?l:i?f:d};var p=r(8813);function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(null,arguments)}function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach(function(t){m(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function m(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var w=(0,i.createContext)({width:-1,height:-1});function b(e){var{children:t,width:r,height:n}=e,A=(0,i.useMemo)(()=>({width:r,height:n}),[r,n]);return function(e){return(0,p.F)(e.width)&&(0,p.F)(e.height)}(A)?i.createElement(w.Provider,{value:A},t):null}var B=()=>(0,i.useContext)(w),C=(0,i.forwardRef)((e,t)=>{var{aspect:r,initialDimension:A={width:-1,height:-1},width:c,height:l,minWidth:f=0,minHeight:d,maxHeight:p,children:g,debounce:y=0,id:m,className:w,onResize:B,style:C={}}=e,E=(0,i.useRef)(null),S=(0,i.useRef)();S.current=B,(0,i.useImperativeHandle)(t,()=>E.current);var[I,O]=(0,i.useState)({containerWidth:A.width,containerHeight:A.height}),F=(0,i.useCallback)((e,t)=>{O(r=>{var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}})},[]);(0,i.useEffect)(()=>{if(null==E.current||"undefined"==typeof ResizeObserver)return a.lQ;var e=e=>{var t,{width:r,height:n}=e[0].contentRect;F(r,n),null===(t=S.current)||void 0===t||t.call(S,r,n)};y>0&&(e=o()(e,y,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:r,height:n}=E.current.getBoundingClientRect();return F(r,n),t.observe(E.current),()=>{t.disconnect()}},[F,y]);var{containerWidth:_,containerHeight:x}=I;(0,s.R)(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:U,calculatedHeight:Q}=u(_,x,{width:c,height:l,aspect:r,maxHeight:p});return(0,s.R)(null!=U&&U>0||null!=Q&&Q>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",U,Q,c,l,f,d,r),i.createElement("div",{id:m?"".concat(m):void 0,className:(0,n.$)("recharts-responsive-container",w),style:v(v({},C),{},{width:c,height:l,minWidth:f,minHeight:d,maxHeight:p}),ref:E},i.createElement("div",{style:h({width:c,height:l})},i.createElement(b,{width:U,height:Q},g)))}),E=(0,i.forwardRef)((e,t)=>{var r=B();if((0,p.F)(r.width)&&(0,p.F)(r.height))return e.children;var{width:n,height:A}=function(e){var{width:t,height:r,aspect:n}=e,i=t,A=r;return void 0===i&&void 0===A?(i="100%",A="100%"):void 0===i?i=n&&n>0?void 0:"100%":void 0===A&&(A=n&&n>0?void 0:"100%"),{width:i,height:A}}({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:s}=u(void 0,void 0,{width:n,height:A,aspect:e.aspect,maxHeight:e.maxHeight});return(0,a.Et)(o)&&(0,a.Et)(s)?i.createElement(b,{width:o,height:s},e.children):i.createElement(C,g({},e,{width:n,height:A,ref:t}))})},28706(e,t,r){"use strict";var n=r(46518),i=r(79039),A=r(34376),o=r(20034),a=r(48981),s=r(26198),u=r(96837),c=r(97040),l=r(34527),f=r(1469),d=r(70597),h=r(78227),p=r(39519),g=h("isConcatSpreadable"),y=p>=51||!i(function(){var e=[];return e[g]=!1,e.concat()[0]!==e}),v=function(e){if(!o(e))return!1;var t=e[g];return void 0!==t?!!t:A(e)};n({target:"Array",proto:!0,arity:1,forced:!y||!d("concat")},{concat:function(e){var t,r,n,i,A,o=a(this),d=f(o,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(v(A=-1===t?o:arguments[t]))for(i=s(A),u(h+i),r=0;r<i;r++,h++)r in A&&c(d,h,A[r]);else u(h+1),c(d,h++,A);return l(d,h),d}})},28823(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(){}return e.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},e.distance=function(e,t,r,n){var i=e-r,A=t-n;return Math.sqrt(i*i+A*A)},e.sum=function(e){for(var t=0,r=0,n=e.length;r!==n;r++){t+=e[r]}return t},e}()},28871(e,t,r){"use strict";r.d(t,{_:()=>a});var n,i=r(36775),A=r(44487),o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.getEncodingMode=function(){return A.VL},t.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return t.append(e-97+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e==="`".charCodeAt(0))return t.append(2),t.append(0),2;if(e<="Z".charCodeAt(0))return t.append(2),t.append(e-65+1),2;if(e<=127)return t.append(2),t.append(e-123+27),2;t.append("1");var r=2;return r+=this.encodeChar(e-128,t)},t}(i.S)},29105(e,t,r){"use strict";var n;r.d(t,{A:()=>i}),function(e){e[e.DATA_MASK_000=0]="DATA_MASK_000",e[e.DATA_MASK_001=1]="DATA_MASK_001",e[e.DATA_MASK_010=2]="DATA_MASK_010",e[e.DATA_MASK_011=3]="DATA_MASK_011",e[e.DATA_MASK_100=4]="DATA_MASK_100",e[e.DATA_MASK_101=5]="DATA_MASK_101",e[e.DATA_MASK_110=6]="DATA_MASK_110",e[e.DATA_MASK_111=7]="DATA_MASK_111"}(n||(n={}));const i=function(){function e(e,t){this.value=e,this.isMasked=t}return e.prototype.unmaskBitMatrix=function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)this.isMasked(r,n)&&e.flip(n,r)},e.values=new Map([[n.DATA_MASK_000,new e(n.DATA_MASK_000,function(e,t){return!(e+t&1)})],[n.DATA_MASK_001,new e(n.DATA_MASK_001,function(e,t){return!(1&e)})],[n.DATA_MASK_010,new e(n.DATA_MASK_010,function(e,t){return t%3==0})],[n.DATA_MASK_011,new e(n.DATA_MASK_011,function(e,t){return(e+t)%3==0})],[n.DATA_MASK_100,new e(n.DATA_MASK_100,function(e,t){return!(Math.floor(e/2)+Math.floor(t/3)&1)})],[n.DATA_MASK_101,new e(n.DATA_MASK_101,function(e,t){return e*t%6==0})],[n.DATA_MASK_110,new e(n.DATA_MASK_110,function(e,t){return e*t%6<3})],[n.DATA_MASK_111,new e(n.DATA_MASK_111,function(e,t){return!(e+t+e*t%3&1)})]]),e}()},29467(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(53964),i=r(12049),A=r(99184);t.cloneDeepWith=function(e,t){return n.cloneDeepWith(e,(r,o,a,s)=>{const u=t?.(r,o,a,s);if(void 0!==u)return u;if("object"==typeof e){if(i.getTag(e)===A.objectTag&&"function"!=typeof e.constructor){const t={};return s.set(e,t),n.copyProperties(t,e,a,s),t}switch(Object.prototype.toString.call(e)){case A.numberTag:case A.stringTag:case A.booleanTag:{const t=new e.constructor(e?.valueOf());return n.copyProperties(t,e),t}case A.argumentsTag:{const t={};return n.copyProperties(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}},29658(e,t,r){"use strict";r.d(t,{m:()=>A});var n=r(66500),i=r(24880),A=new class extends n.Q{#f;#d;#h;constructor(){super(),this.#h=e=>{if(!i.S$&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#d||this.setEventListener(this.#h)}onUnsubscribe(){this.hasListeners()||(this.#d?.(),this.#d=void 0)}setEventListener(e){this.#h=e,this.#d?.(),this.#d=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#f!==e&&(this.#f=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#f?this.#f:"hidden"!==globalThis.document?.visibilityState}}},29705(e,t,r){"use strict";r.d(t,{I:()=>G});var n=r(96540);function i(){}function A(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function o(e){this._context=e}function a(e){this._context=e}function s(e){this._context=e}o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:A(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:A(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},a.prototype={areaStart:i,areaEnd:i,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:A(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},s.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:A(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class u{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function c(e){this._context=e}function l(e){this._context=e}function f(e){return new l(e)}function d(e){return e<0?-1:1}function h(e,t,r){var n=e._x1-e._x0,i=t-e._x1,A=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),a=(A*i+o*n)/(n+i);return(d(A)+d(o))*Math.min(Math.abs(A),Math.abs(o),.5*Math.abs(a))||0}function p(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function g(e,t,r){var n=e._x0,i=e._y0,A=e._x1,o=e._y1,a=(A-n)/3;e._context.bezierCurveTo(n+a,i+a*t,A-a,o-a*r,A,o)}function y(e){this._context=e}function v(e){this._context=new m(e)}function m(e){this._context=e}function w(e){this._context=e}function b(e){var t,r,n=e.length-1,i=new Array(n),A=new Array(n),o=new Array(n);for(i[0]=0,A[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,A[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,A[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/A[t-1],A[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/A[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/A[t];for(A[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)A[t]=2*e[t+1]-i[t+1];return[i,A]}function B(e,t){this._context=e,this._t=t}c.prototype={areaStart:i,areaEnd:i,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:g(this,this._t0,p(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,g(this,p(this,r=h(this,e,t)),r);break;default:g(this,this._t0,r=h(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(v.prototype=Object.create(y.prototype)).point=function(e,t){y.prototype.point.call(this,t,e)},m.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,A){this._context.bezierCurveTo(t,e,n,r,A,i)}},w.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=b(e),i=b(t),A=0,o=1;o<r;++A,++o)this._context.bezierCurveTo(n[0][A],i[0][A],n[1][A],i[1][A],e[o],t[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},B.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}};var C=r(45917),E=r(48946),S=r(11509);function I(e){return e[0]}function O(e){return e[1]}function F(e,t){var r=(0,E.A)(!0),n=null,i=f,A=null,o=(0,S.i)(a);function a(a){var s,u,c,l=(a=(0,C.A)(a)).length,f=!1;for(null==n&&(A=i(c=o())),s=0;s<=l;++s)!(s<l&&r(u=a[s],s,a))===f&&((f=!f)?A.lineStart():A.lineEnd()),f&&A.point(+e(u,s,a),+t(u,s,a));if(c)return A=null,c+""||null}return e="function"==typeof e?e:void 0===e?I:(0,E.A)(e),t="function"==typeof t?t:void 0===t?O:(0,E.A)(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,E.A)(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,E.A)(+e),a):t},a.defined=function(e){return arguments.length?(r="function"==typeof e?e:(0,E.A)(!!e),a):r},a.curve=function(e){return arguments.length?(i=e,null!=n&&(A=i(n)),a):i},a.context=function(e){return arguments.length?(null==e?n=A=null:A=i(n=e),a):n},a}function _(e,t,r){var n=null,i=(0,E.A)(!0),A=null,o=f,a=null,s=(0,S.i)(u);function u(u){var c,l,f,d,h,p=(u=(0,C.A)(u)).length,g=!1,y=new Array(p),v=new Array(p);for(null==A&&(a=o(h=s())),c=0;c<=p;++c){if(!(c<p&&i(d=u[c],c,u))===g)if(g=!g)l=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),f=c-1;f>=l;--f)a.point(y[f],v[f]);a.lineEnd(),a.areaEnd()}g&&(y[c]=+e(d,c,u),v[c]=+t(d,c,u),a.point(n?+n(d,c,u):y[c],r?+r(d,c,u):v[c]))}if(h)return a=null,h+""||null}function c(){return F().defined(i).curve(o).context(A)}return e="function"==typeof e?e:void 0===e?I:(0,E.A)(+e),t="function"==typeof t?t:void 0===t?(0,E.A)(0):(0,E.A)(+t),r="function"==typeof r?r:void 0===r?O:(0,E.A)(+r),u.x=function(t){return arguments.length?(e="function"==typeof t?t:(0,E.A)(+t),n=null,u):e},u.x0=function(t){return arguments.length?(e="function"==typeof t?t:(0,E.A)(+t),u):e},u.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:(0,E.A)(+e),u):n},u.y=function(e){return arguments.length?(t="function"==typeof e?e:(0,E.A)(+e),r=null,u):t},u.y0=function(e){return arguments.length?(t="function"==typeof e?e:(0,E.A)(+e),u):t},u.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:(0,E.A)(+e),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(e){return arguments.length?(i="function"==typeof e?e:(0,E.A)(!!e),u):i},u.curve=function(e){return arguments.length?(o=e,null!=A&&(a=o(A)),u):o},u.context=function(e){return arguments.length?(null==e?A=a=null:a=o(A=e),u):A},u}var x=r(34164),U=r(98940),Q=r(59744),T=r(8813),M=r(55448),P=r(19287);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(null,arguments)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach(function(t){R(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function R(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var L={curveBasisClosed:function(e){return new a(e)},curveBasisOpen:function(e){return new s(e)},curveBasis:function(e){return new o(e)},curveBumpX:function(e){return new u(e,!0)},curveBumpY:function(e){return new u(e,!1)},curveLinearClosed:function(e){return new c(e)},curveLinear:f,curveMonotoneX:function(e){return new y(e)},curveMonotoneY:function(e){return new v(e)},curveNatural:function(e){return new w(e)},curveStep:function(e){return new B(e,.5)},curveStepAfter:function(e){return new B(e,1)},curveStepBefore:function(e){return new B(e,0)}},H=e=>(0,T.H)(e.x)&&(0,T.H)(e.y),j=e=>null!=e.base&&H(e.base)&&H(e),V=e=>e.x,K=e=>e.y,z=e=>{var{type:t="linear",points:r=[],baseLine:n,layout:i,connectNulls:A=!1}=e,o=((e,t)=>{if("function"==typeof e)return e;var r="curve".concat((0,Q.Zb)(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?L[r]||f:L["".concat(r).concat("vertical"===t?"Y":"X")]})(t,i),a=A?r.filter(H):r;if(Array.isArray(n)){var s=r.map((e,t)=>N(N({},e),{},{base:n[t]}));return("vertical"===i?_().y(K).x1(V).x0(e=>e.base.x):_().x(V).y1(K).y0(e=>e.base.y)).defined(j).curve(o)(A?s.filter(j):s)}return("vertical"===i&&(0,Q.Et)(n)?_().y(K).x1(V).x0(n):(0,Q.Et)(n)?_().x(V).y1(K).y0(n):F().x(V).y(K)).defined(H).curve(o)(a)},G=e=>{var{className:t,points:r,path:i,pathRef:A}=e,o=(0,P.WX)();if(!(r&&r.length||i))return null;var a={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},s=r&&r.length?z(a):i;return n.createElement("path",D({},(0,M.uZ)(e),(0,U._U)(e),{className:(0,x.$)("recharts-curve",t),d:null===s?void 0:s,ref:A}))}},30131(e,t,r){"use strict";r.d(t,{u:()=>O,F:()=>B});var n=r(96540),i=r(80305),A=r.n(i),o=r(34164),a=r(86069),s=r(81174),u=r(91706),c=r(59744),l=r(98940),f=r(74333),d=r(55448),h=r(77404),p=r(27132),g=r(60648),y=["axisLine","width","height","className","hide","ticks","axisType"];function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(null,arguments)}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(t){b(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function b(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var B={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:g.I.axis};function C(e){var{x:t,y:r,width:i,height:a,orientation:s,mirror:u,axisLine:c,otherSvgProps:l}=e;if(!c)return null;var f=w(w(w({},l),(0,d.uZ)(c)),{},{fill:"none"});if("top"===s||"bottom"===s){var h=+("top"===s&&!u||"bottom"===s&&u);f=w(w({},f),{},{x1:t,y1:r+h*a,x2:t+i,y2:r+h*a})}else{var p=+("left"===s&&!u||"right"===s&&u);f=w(w({},f),{},{x1:t+p*i,y1:r,x2:t+p*i,y2:r+a})}return n.createElement("line",v({},f,{className:(0,o.$)("recharts-cartesian-axis-line",A()(c,"className"))}))}function E(e){var t,{option:r,tickProps:i,value:A}=e,a=(0,o.$)(i.className,"recharts-cartesian-axis-tick-value");if(n.isValidElement(r))t=n.cloneElement(r,w(w({},i),{},{className:a}));else if("function"==typeof r)t=r(w(w({},i),{},{className:a}));else{var u="recharts-cartesian-axis-tick-value";"boolean"!=typeof r&&(u=(0,o.$)(u,null==r?void 0:r.className)),t=n.createElement(s.EY,v({},i,{className:u}),A)}return t}var S=(0,n.forwardRef)((e,t)=>{var{ticks:r=[],tick:i,tickLine:s,stroke:u,tickFormatter:h,unit:y,padding:m,tickTextProps:b,orientation:B,mirror:C,x:S,y:I,width:O,height:F,tickSize:_,tickMargin:x,fontSize:U,letterSpacing:Q,getTicksConfig:T,events:M,axisType:P}=e,D=(0,f.f)(w(w({},T),{},{ticks:r}),U,Q),k=function(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}(B,C),N=function(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}(B,C),R=(0,d.uZ)(T),L=(0,d.ic)(i),H={};"object"==typeof s&&(H=s);var j=w(w({},R),{},{fill:"none"},H),V=D.map(e=>w({entry:e},function(e,t,r,n,i,A,o,a,s){var u,l,f,d,h,p,g=a?-1:1,y=e.tickSize||o,v=(0,c.Et)(e.tickCoord)?e.tickCoord:e.coordinate;switch(A){case"top":u=l=e.coordinate,p=(f=(d=r+ +!a*i)-g*y)-g*s,h=v;break;case"left":f=d=e.coordinate,h=(u=(l=t+ +!a*n)-g*y)-g*s,p=v;break;case"right":f=d=e.coordinate,h=(u=(l=t+ +a*n)+g*y)+g*s,p=v;break;default:u=l=e.coordinate,p=(f=(d=r+ +a*i)+g*y)+g*s,h=v}return{line:{x1:u,y1:f,x2:l,y2:d},tick:{x:h,y:p}}}(e,S,I,O,F,B,_,C,x))),K=V.map(e=>{var{entry:t,line:r}=e;return n.createElement(a.W,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(t.value,"-").concat(t.coordinate,"-").concat(t.tickCoord)},s&&n.createElement("line",v({},j,r,{className:(0,o.$)("recharts-cartesian-axis-tick-line",A()(s,"className"))})))}),z=V.map((e,t)=>{var{entry:r,tick:A}=e,o=w(w(w(w({textAnchor:k,verticalAnchor:N},R),{},{stroke:"none",fill:u},L),A),{},{index:t,payload:r,visibleTicksCount:D.length,tickFormatter:h,padding:m},b);return n.createElement(a.W,v({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(r.value,"-").concat(r.coordinate,"-").concat(r.tickCoord)},(0,l.XC)(M,r,t)),i&&n.createElement(E,{option:i,tickProps:o,value:"".concat("function"==typeof h?h(r.value,t):r.value).concat(y||"")}))});return n.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},z.length>0&&n.createElement(p.g,{zIndex:g.I.label},n.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},z)),K.length>0&&n.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},K))}),I=(0,n.forwardRef)((e,t)=>{var{axisLine:r,width:i,height:A,className:s,hide:c,ticks:l,axisType:f}=e,h=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,y),[g,v]=(0,n.useState)(""),[m,w]=(0,n.useState)(""),b=(0,n.useRef)(null);(0,n.useImperativeHandle)(t,()=>({getCalculatedWidth:()=>{var t;return(e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:A=0}=e,o=0;if(t){Array.from(t).forEach(e=>{if(e){var t=e.getBoundingClientRect();t.width>o&&(o=t.width)}});var a=r?r.getBoundingClientRect().width:0,s=o+(i+A)+a+(r?n:0);return Math.round(s)}return 0})({ticks:b.current,label:null===(t=e.labelRef)||void 0===t?void 0:t.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var B=(0,n.useCallback)(e=>{if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=t;var r=t[0];if(r){var n=window.getComputedStyle(r),i=n.fontSize,A=n.letterSpacing;i===g&&A===m||(v(i),w(A))}}},[g,m]);return c||null!=i&&i<=0||null!=A&&A<=0?null:n.createElement(p.g,{zIndex:e.zIndex},n.createElement(a.W,{className:(0,o.$)("recharts-cartesian-axis",s)},n.createElement(C,{x:e.x,y:e.y,width:i,height:A,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:(0,d.uZ)(e)}),n.createElement(S,{ref:B,axisType:f,events:h,fontSize:g,getTicksConfig:e,height:e.height,letterSpacing:m,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),n.createElement(u.zJ,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},n.createElement(u._I,{label:e.label,labelRef:e.labelRef}),e.children)))}),O=n.forwardRef((e,t)=>{var r=(0,h.e)(e,B);return n.createElement(I,v({},r,{ref:t}))});O.displayName="CartesianAxis"},30237(e,t,r){"use strict";r(6469)("flatMap")},30566(e,t,r){"use strict";var n=r(79504),i=r(79306),A=r(20034),o=r(39297),a=r(67680),s=r(40616),u=Function,c=n([].concat),l=n([].join),f={};e.exports=s?u.bind:function(e){var t=i(this),r=t.prototype,n=a(arguments,1),s=function(){var r=c(n,a(arguments));return this instanceof s?function(e,t,r){if(!o(f,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";f[t]=u("C,a","return new C("+l(n,",")+")")}return f[t](e,r)}(t,r.length,r):t.apply(e,r)};return A(r)&&(s.prototype=r),s}},31240(e,t,r){"use strict";var n=r(79504);e.exports=n(1.1.valueOf)},31327(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.getFormatInstance=function(){return new t},t.kind="FormatException",t}(i.A);const a=o},31754(e,t,r){"use strict";r.d(t,{Q:()=>s,l:()=>a});var n=r(96540),i=r(49082),A=r(91572),o=r(76270);function a(e,t){var r,n,o=(0,i.G)(t=>(0,A.Rl)(t,e)),a=(0,i.G)(e=>(0,A.sf)(e,t)),s=null!==(r=null==o?void 0:o.allowDataOverflow)&&void 0!==r?r:A.PU.allowDataOverflow,u=null!==(n=null==a?void 0:a.allowDataOverflow)&&void 0!==n?n:A.cd.allowDataOverflow;return{needClip:s||u,needClipX:s,needClipY:u}}function s(e){var{xAxisId:t,yAxisId:r,clipPathId:i}=e,A=(0,o.oM)(),{needClipX:s,needClipY:u,needClip:c}=a(t,r);if(!c||!A)return null;var{x:l,y:f,width:d,height:h}=A;return n.createElement("clipPath",{id:"clipPath-".concat(i)},n.createElement("rect",{x:s?l:l-d/2,y:u?f:f-h/2,width:s?d:2*d,height:u?h:2*h}))}},32357(e,t,r){"use strict";var n=r(43724),i=r(79039),A=r(79504),o=r(42787),a=r(71072),s=r(25397),u=A(r(48773).f),c=A([].push),l=n&&i(function(){var e=Object.create(null);return e[2]=2,!u(e,2)}),f=function(e){return function(t){for(var r,i=s(t),A=a(i),f=l&&null===o(i),d=A.length,h=0,p=[];d>h;)r=A[h++],n&&!(f?r in i:u(i,r))||c(p,e?[r,i[r]]:i[r]);return p}};e.exports={entries:f(!0),values:f(!1)}},32945(e,t,r){"use strict";r.d(t,{$:()=>i});var n=r(49082),i=()=>{var e;return null===(e=(0,n.G)(e=>e.rootProps.accessibilityLayer))||void 0===e||e}},32981(e,t,r){"use strict";r.d(t,{a:()=>A});var n=r(44487),i=r(89194),A=function(){function e(){}return e.prototype.getEncodingMode=function(){return n.d2},e.prototype.encode=function(e){if(i.A.determineConsecutiveDigitCount(e.getMessage(),e.pos)>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var t=e.getCurrentChar(),r=i.A.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(r!==this.getEncodingMode())switch(r){case n.mt:return e.writeCodeword(n.ah),void e.signalEncoderChange(n.mt);case n.fG:return e.writeCodeword(n.X7),void e.signalEncoderChange(n.fG);case n.VK:e.writeCodeword(n.Qe),e.signalEncoderChange(n.VK);break;case n.VL:e.writeCodeword(n.dn),e.signalEncoderChange(n.VL);break;case n.uf:e.writeCodeword(n.ij),e.signalEncoderChange(n.uf);break;default:throw new Error("Illegal mode: "+r)}else i.A.isExtendedASCII(t)?(e.writeCodeword(n.gn),e.writeCodeword(t-128+1),e.pos++):(e.writeCodeword(t+1),e.pos++)}},e.prototype.encodeASCIIDigits=function(e,t){if(i.A.isDigit(e)&&i.A.isDigit(t))return 10*(e-48)+(t-48)+130;throw new Error("not digits: "+e+t)},e}()},32993(e,t,r){"use strict";r.d(t,{A:()=>s});var n=r(26741),i=r(8032),A=r(15511),o=r(93234),a=r(58503);const s=function(){function e(){}return e.prototype.decode=function(e,t){try{return this.doDecode(e,t)}catch(d){if(t&&!0===t.get(i.A.TRY_HARDER)&&e.isRotateSupported()){var r=e.rotateCounterClockwise(),n=this.doDecode(r,t),s=n.getResultMetadata(),u=270;null!==s&&!0===s.get(A.A.ORIENTATION)&&(u+=s.get(A.A.ORIENTATION)%360),n.putMetadata(A.A.ORIENTATION,u);var c=n.getResultPoints();if(null!==c)for(var l=r.getHeight(),f=0;f<c.length;f++)c[f]=new o.A(l-c[f].getY()-1,c[f].getX());return n}throw new a.A}},e.prototype.reset=function(){},e.prototype.doDecode=function(e,t){var r,s=e.getWidth(),u=e.getHeight(),c=new n.A(s),l=t&&!0===t.get(i.A.TRY_HARDER),f=Math.max(1,u>>(l?8:5));r=l?u:15;for(var d=Math.trunc(u/2),h=0;h<r;h++){var p=Math.trunc((h+1)/2),g=d+f*(!(1&h)?p:-p);if(g<0||g>=u)break;try{c=e.getBlackRow(g,c)}catch(e){continue}for(var y=function(e){if(1===e&&(c.reverse(),t&&!0===t.get(i.A.NEED_RESULT_POINT_CALLBACK))){var r=new Map;t.forEach(function(e,t){return r.set(t,e)}),r.delete(i.A.NEED_RESULT_POINT_CALLBACK),t=r}try{var n=v.decodeRow(g,c,t);if(1===e){n.putMetadata(A.A.ORIENTATION,180);var a=n.getResultPoints();null!==a&&(a[0]=new o.A(s-a[0].getX()-1,a[0].getY()),a[1]=new o.A(s-a[1].getX()-1,a[1].getY()))}return{value:n}}catch(e){}},v=this,m=0;m<2;m++){var w=y(m);if("object"==typeof w)return w.value}}throw new a.A},e.recordPattern=function(e,t,r){for(var n=r.length,i=0;i<n;i++)r[i]=0;var A=e.getSize();if(t>=A)throw new a.A;for(var o=!e.get(t),s=0,u=t;u<A;){if(e.get(u)!==o)r[s]++;else{if(++s===n)break;r[s]=1,o=!o}u++}if(s!==n&&(s!==n-1||u!==A))throw new a.A},e.recordPatternInReverse=function(t,r,n){for(var i=n.length,A=t.get(r);r>0&&i>=0;)t.get(--r)!==A&&(i--,A=!A);if(i>=0)throw new a.A;e.recordPattern(t,r+1,n)},e.patternMatchVariance=function(e,t,r){for(var n=e.length,i=0,A=0,o=0;o<n;o++)i+=e[o],A+=t[o];if(i<A)return Number.POSITIVE_INFINITY;var a=i/A;r*=a;for(var s=0,u=0;u<n;u++){var c=e[u],l=t[u]*a,f=c>l?c-l:l-c;if(f>r)return Number.POSITIVE_INFINITY;s+=f}return s/i},e}()},33032(e,t,r){"use strict";r.d(t,{BZ:()=>he,eE:()=>me,Xb:()=>pe,JG:()=>Be,fx:()=>ge,A2:()=>de,AA:()=>Q,yn:()=>we,FO:()=>ee,gL:()=>ie,fl:()=>Ae,R4:()=>se,n4:()=>P});var n=r(25508),i=r(91572),A=r(19287),o=r(26470),a=r(98453),s=r(82695),u=r(59744),c=r(19495),l=r(55978),f=r(75403),d=r(19809),h=r(74544),p=r(4217),g=r(5180),y=r(36189),v=r(60523),m=r(18351),w=r(23571),b=r(89596),B=r(86680),C=r(93569),E=r(86907),S=r(9531),I=r(93749),O=r(6392),F=r(22608),_=(0,n.Mz)([i.Dn,A.fz,i.um,s.iO,C.R],i.sr),x=(0,n.Mz)([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),U=(0,n.Mz)([C.R,B.M],i.eo),Q=(0,n.Mz)([x,i.Dn,U],i.ec,{memoizeOptions:{resultEqualityCheck:F.O}}),T=(0,n.Mz)([Q],e=>e.filter(S.g)),M=(0,n.Mz)([Q],i.rj,{memoizeOptions:{resultEqualityCheck:F.O}}),P=(0,n.Mz)([M,a.LF],i.Nk),D=(0,n.Mz)([T,a.LF,i.Dn],E.A),k=(0,n.Mz)([P,i.Dn,Q],i.fb),N=(0,n.Mz)([i.Dn],i.S5),R=(0,n.Mz)([i.Dn],e=>e.allowDataOverflow),L=(0,n.Mz)([N,R],I.f5),H=(0,n.Mz)([Q],e=>e.filter(S.g)),j=(0,n.Mz)([D,H,s.eC,s.Lb],i.MK),V=(0,n.Mz)([j,a.LF,C.R,L],i.pM),K=(0,n.Mz)([Q],i.IO),z=(0,n.Mz)([P,i.Dn,K,i.CH,C.R],i.EZ,{memoizeOptions:{resultEqualityCheck:O.o}}),G=(0,n.Mz)([i.Kr,C.R,B.M],i.P9),W=(0,n.Mz)([G,C.R],i.Oz),X=(0,n.Mz)([i.gT,C.R,B.M],i.P9),Y=(0,n.Mz)([X,C.R],i.q),Z=(0,n.Mz)([i.$X,C.R,B.M],i.P9),q=(0,n.Mz)([Z,C.R],i.bb),J=(0,n.Mz)([W,q,Y],i.yi),$=(0,n.Mz)([i.Dn,N,L,V,z,J,A.fz,C.R],i.wL),ee=(0,n.Mz)([i.Dn,A.fz,P,k,s.eC,C.R,$],i.tP),te=(0,n.Mz)([ee,i.Dn,_],i.xp),re=(0,n.Mz)([i.Dn,ee,te,C.R],i.g1),ne=e=>{var t=(0,C.R)(e),r=(0,B.M)(e);return(0,i.D5)(e,t,r,!1)},ie=(0,n.Mz)([i.Dn,ne],c.I),Ae=(0,n.Mz)([i.Dn,_,re,ie],i.Qn),oe=(0,n.Mz)([A.fz,k,i.Dn,C.R],i.tF),ae=(0,n.Mz)([A.fz,k,i.Dn,C.R],i.iv),se=(0,n.Mz)([A.fz,i.Dn,_,Ae,ne,oe,ae,C.R],(e,t,r,n,i,A,a,s)=>{if(t){var{type:c}=t,l=(0,o._L)(e,s);if(n){var f="scaleBand"===r&&n.bandwidth?n.bandwidth()/2:2,d="category"===c&&n.bandwidth?n.bandwidth()/f:0;return d="angleAxis"===s&&null!=i&&(null==i?void 0:i.length)>=2?2*(0,u.sA)(i[0]-i[1])*d:d,l&&a?a.map((e,t)=>({coordinate:n(e)+d,value:e,index:t,offset:d})):n.domain().map((e,t)=>({coordinate:n(e)+d,value:A?A[e]:e,index:t,offset:d}))}}}),ue=(0,n.Mz)([l.xH,l.Hw,e=>e.tooltip.settings],(e,t,r)=>(0,l.$g)(r.shared,e,t)),ce=e=>e.tooltip.settings.trigger,le=e=>e.tooltip.settings.defaultIndex,fe=(0,n.Mz)([w.J,ue,ce,le],d.i),de=(0,n.Mz)([fe,P,i.K6,ee],h.P),he=(0,n.Mz)([se,de],f.E),pe=(0,n.Mz)([fe],e=>{if(e)return e.dataKey}),ge=(0,n.Mz)([fe],e=>{if(e)return e.graphicalItemId}),ye=(0,n.Mz)([w.J,ue,ce,le],v.q),ve=(0,n.Mz)([g.Lp,g.A$,A.fz,y.HZ,se,le,ye,m.x],p.o),me=(0,n.Mz)([fe,ve],(e,t)=>null!=e&&e.coordinate?e.coordinate:t),we=(0,n.Mz)([fe],e=>{var t;return null!==(t=null==e?void 0:e.active)&&void 0!==t&&t}),be=(0,n.Mz)([ye,de,a.LF,i.K6,he,m.x,ue],b.N),Be=(0,n.Mz)([be],e=>{if(null!=e){var t=e.map(e=>e.payload).filter(e=>null!=e);return Array.from(new Set(t))}})},33097(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(1119),i=r(93998),A=r(3025);t.orderBy=function(e,t,r,o){if(null==e)return[];r=o?void 0:r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=null==t?[null]:[t]),0===t.length&&(t=[null]),Array.isArray(r)||(r=null==r?[]:[r]),r=r.map(e=>String(e));const a=(e,t)=>{let r=e;for(let e=0;e<t.length&&null!=r;++e)r=r[t[e]];return r},s=t.map(e=>(Array.isArray(e)&&1===e.length&&(e=e[0]),null==e||"function"==typeof e||Array.isArray(e)||i.isKey(e)?e:{key:e,path:A.toPath(e)}));return e.map(e=>({original:e,criteria:s.map(t=>((e,t)=>null==t||null==e?t:"object"==typeof e&&"key"in e?Object.hasOwn(t,e.key)?t[e.key]:a(t,e.path):"function"==typeof e?e(t):Array.isArray(e)?a(t,e):"object"==typeof t?t[e]:t)(t,e))})).slice().sort((e,t)=>{for(let i=0;i<s.length;i++){const A=n.compareValues(e.criteria[i],t.criteria[i],r[i]);if(0!==A)return A}return 0}).map(e=>e.original)}},33297(e,t,r){"use strict";r.d(t,{A:()=>c});var n=r(73872),i=r(73608),A=r(23431),o=r(52185),a=r(53637),s=r(57149),u=r(59379);const c=function(){function e(){}return e.prototype.encode=function(t,r,A,u,c){if(0===t.length)throw new s.A("Found empty contents");if(r!==n.A.QR_CODE)throw new s.A("Can only encode QR_CODE, but got "+r);if(A<0||u<0)throw new s.A("Requested dimensions are too small: "+A+"x"+u);var l=o.A.L,f=e.QUIET_ZONE_SIZE;null!==c&&(void 0!==c.get(i.A.ERROR_CORRECTION)&&(l=o.A.fromString(c.get(i.A.ERROR_CORRECTION).toString())),void 0!==c.get(i.A.MARGIN)&&(f=Number.parseInt(c.get(i.A.MARGIN).toString(),10)));var d=a.A.encode(t,l,c);return e.renderResult(d,A,u,f)},e.renderResult=function(e,t,r,n){var i=e.getMatrix();if(null===i)throw new u.A;for(var o=i.getWidth(),a=i.getHeight(),s=o+2*n,c=a+2*n,l=Math.max(t,s),f=Math.max(r,c),d=Math.min(Math.floor(l/s),Math.floor(f/c)),h=Math.floor((l-o*d)/2),p=Math.floor((f-a*d)/2),g=new A.A(l,f),y=0,v=p;y<a;y++,v+=d)for(var m=0,w=h;m<o;m++,w+=d)1===i.get(m,y)&&g.setRegion(w,v,d,d);return g},e.QUIET_ZONE_SIZE=4,e}()},33338(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(80442),i=r(88468),A=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const o=function(){function e(e,t){this.width=e,this.height=t;for(var r=new Array(t),n=0;n!==t;n++)r[n]=new Uint8Array(e);this.bytes=r}return e.prototype.getHeight=function(){return this.height},e.prototype.getWidth=function(){return this.width},e.prototype.get=function(e,t){return this.bytes[t][e]},e.prototype.getArray=function(){return this.bytes},e.prototype.setNumber=function(e,t,r){this.bytes[t][e]=r},e.prototype.setBoolean=function(e,t,r){this.bytes[t][e]=r?1:0},e.prototype.clear=function(e){var t,r;try{for(var i=A(this.bytes),o=i.next();!o.done;o=i.next()){var a=o.value;n.A.fill(a,e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.width!==r.width)return!1;if(this.height!==r.height)return!1;for(var n=0,i=this.height;n<i;++n)for(var A=this.bytes[n],o=r.bytes[n],a=0,s=this.width;a<s;++a)if(A[a]!==o[a])return!1;return!0},e.prototype.toString=function(){for(var e=new i.A,t=0,r=this.height;t<r;++t){for(var n=this.bytes[t],A=0,o=this.width;A<o;++A)switch(n[A]){case 0:e.append(" 0");break;case 1:e.append(" 1");break;default:e.append(" ")}e.append("\n")}return e.toString()},e}()},33771(e,t,r){"use strict";var n=r(46518),i=r(84373),A=r(6469);n({target:"Array",proto:!0},{fill:i}),A("fill")},33904(e,t,r){"use strict";var n=r(44576),i=r(79039),A=r(79504),o=r(655),a=r(43802).trim,s=r(47452),u=A("".charAt),c=n.parseFloat,l=n.Symbol,f=l&&l.iterator,d=1/c(s+"-0")!=-1/0||f&&!i(function(){c(Object(f))});e.exports=d?function(e){var t=a(o(e)),r=c(t);return 0===r&&"-"===u(t,0)?-0:r}:c},33930(e,t,r){"use strict";r.d(t,{I:()=>B});var n=r(29658),i=r(26261),A=r(79757),o=r(66500),a=r(94658),s=r(24880),u=r(52775),c=class extends o.Q{constructor(e,t){super(),this.options=t,this.#p=e,this.#g=null,this.#y=(0,a.T)(),this.bindMethods(),this.setOptions(t)}#p;#v=void 0;#m=void 0;#w=void 0;#b;#B;#y;#g;#C;#E;#S;#I;#O;#F;#_=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#v.addObserver(this),l(this.#v,this.options)?this.#x():this.updateResult(),this.#U())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.#v,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.#v,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#Q(),this.#T(),this.#v.removeObserver(this)}setOptions(e){const t=this.options,r=this.#v;if(this.options=this.#p.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,s.Eh)(this.options.enabled,this.#v))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#M(),this.#v.setOptions(this.options),t._defaulted&&!(0,s.f8)(this.options,t)&&this.#p.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#v,observer:this});const n=this.hasListeners();n&&d(this.#v,r,this.options,t)&&this.#x(),this.updateResult(),!n||this.#v===r&&(0,s.Eh)(this.options.enabled,this.#v)===(0,s.Eh)(t.enabled,this.#v)&&(0,s.d2)(this.options.staleTime,this.#v)===(0,s.d2)(t.staleTime,this.#v)||this.#P();const i=this.#D();!n||this.#v===r&&(0,s.Eh)(this.options.enabled,this.#v)===(0,s.Eh)(t.enabled,this.#v)&&i===this.#F||this.#k(i)}getOptimisticResult(e){const t=this.#p.getQueryCache().build(this.#p,e),r=this.createResult(t,e);return function(e,t){if(!(0,s.f8)(e.getCurrentResult(),t))return!0;return!1}(this,r)&&(this.#w=r,this.#B=this.options,this.#b=this.#v.state),r}getCurrentResult(){return this.#w}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#y.status||this.#y.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#_.add(e)}getCurrentQuery(){return this.#v}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#p.defaultQueryOptions(e),r=this.#p.getQueryCache().build(this.#p,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#x({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#w))}#x(e){this.#M();let t=this.#v.fetch(this.options,e);return e?.throwOnError||(t=t.catch(s.lQ)),t}#P(){this.#Q();const e=(0,s.d2)(this.options.staleTime,this.#v);if(s.S$||this.#w.isStale||!(0,s.gn)(e))return;const t=(0,s.j3)(this.#w.dataUpdatedAt,e)+1;this.#I=u.zs.setTimeout(()=>{this.#w.isStale||this.updateResult()},t)}#D(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#v):this.options.refetchInterval)??!1}#k(e){this.#T(),this.#F=e,!s.S$&&!1!==(0,s.Eh)(this.options.enabled,this.#v)&&(0,s.gn)(this.#F)&&0!==this.#F&&(this.#O=u.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||n.m.isFocused())&&this.#x()},this.#F))}#U(){this.#P(),this.#k(this.#D())}#Q(){this.#I&&(u.zs.clearTimeout(this.#I),this.#I=void 0)}#T(){this.#O&&(u.zs.clearInterval(this.#O),this.#O=void 0)}createResult(e,t){const r=this.#v,n=this.options,i=this.#w,o=this.#b,u=this.#B,c=e!==r?e.state:this.#m,{state:f}=e;let p,g={...f},y=!1;if(t._optimisticResults){const i=this.hasListeners(),o=!i&&l(e,t),a=i&&d(e,r,t,n);(o||a)&&(g={...g,...(0,A.k)(f.data,e.options)}),"isRestoring"===t._optimisticResults&&(g.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:w}=g;p=g.data;let b=!1;if(void 0!==t.placeholderData&&void 0===p&&"pending"===w){let e;i?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(e=i.data,b=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#S?.state.data,this.#S):t.placeholderData,void 0!==e&&(w="success",p=(0,s.pl)(i?.data,e,t),y=!0)}if(t.select&&void 0!==p&&!b)if(i&&p===o?.data&&t.select===this.#C)p=this.#E;else try{this.#C=t.select,p=t.select(p),p=(0,s.pl)(i?.data,p,t),this.#E=p,this.#g=null}catch(e){this.#g=e}this.#g&&(v=this.#g,p=this.#E,m=Date.now(),w="error");const B="fetching"===g.fetchStatus,C="pending"===w,E="error"===w,S=C&&B,I=void 0!==p,O={status:w,fetchStatus:g.fetchStatus,isPending:C,isSuccess:"success"===w,isError:E,isInitialLoading:S,isLoading:S,data:p,dataUpdatedAt:g.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>c.dataUpdateCount||g.errorUpdateCount>c.errorUpdateCount,isFetching:B,isRefetching:B&&!C,isLoadingError:E&&!I,isPaused:"paused"===g.fetchStatus,isPlaceholderData:y,isRefetchError:E&&I,isStale:h(e,t),refetch:this.refetch,promise:this.#y,isEnabled:!1!==(0,s.Eh)(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==O.data,n="error"===O.status&&!t,i=e=>{n?e.reject(O.error):t&&e.resolve(O.data)},A=()=>{const e=this.#y=O.promise=(0,a.T)();i(e)},o=this.#y;switch(o.status){case"pending":e.queryHash===r.queryHash&&i(o);break;case"fulfilled":(n||O.data!==o.value)&&A();break;case"rejected":n&&O.error===o.reason||A()}}return O}updateResult(){const e=this.#w,t=this.createResult(this.#v,this.options);if(this.#b=this.#v.state,this.#B=this.options,void 0!==this.#b.data&&(this.#S=this.#v),(0,s.f8)(t,e))return;this.#w=t;this.#N({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#_.size)return!0;const n=new Set(r??this.#_);return this.options.throwOnError&&n.add("error"),Object.keys(this.#w).some(t=>{const r=t;return this.#w[r]!==e[r]&&n.has(r)})})()})}#M(){const e=this.#p.getQueryCache().build(this.#p,this.options);if(e===this.#v)return;const t=this.#v;this.#v=e,this.#m=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#U()}#N(e){i.jG.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#w)}),this.#p.getQueryCache().notify({query:this.#v,type:"observerResultsUpdated"})})}};function l(e,t){return function(e,t){return!1!==(0,s.Eh)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&f(e,t,t.refetchOnMount)}function f(e,t,r){if(!1!==(0,s.Eh)(t.enabled,e)&&"static"!==(0,s.d2)(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&h(e,t)}return!1}function d(e,t,r,n){return(e!==t||!1===(0,s.Eh)(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&h(e,r)}function h(e,t){return!1!==(0,s.Eh)(t.enabled,e)&&e.isStaleByTime((0,s.d2)(t.staleTime,e))}var p=r(96540),g=r(97665);r(74848);function y(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var v=p.createContext(y()),m=p.createContext(!1),w=(m.Provider,(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()}));function b(e,t,r){const n=p.useContext(m),A=p.useContext(v),o=(0,g.jE)(r),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const u=o.getQueryCache().get(a.queryHash);a._optimisticResults=n?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(a),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?(0,s.GU)(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(a,A,u),(e=>{p.useEffect(()=>{e.clearReset()},[e])})(A);const c=!o.getQueryCache().get(a.queryHash),[l]=p.useState(()=>new t(o,a)),f=l.getOptimisticResult(a),d=!n&&!1!==e.subscribed;if(p.useSyncExternalStore(p.useCallback(e=>{const t=d?l.subscribe(i.jG.batchCalls(e)):s.lQ;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),p.useEffect(()=>{l.setOptions(a)},[a,l]),((e,t)=>e?.suspense&&t.isPending)(a,f))throw w(a,l,A);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&void 0===e.data||(0,s.GU)(r,[e.error,n])))({result:f,errorResetBoundary:A,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw f.error;if(o.getDefaultOptions().queries?._experimental_afterQuery?.(a,f),a.experimental_prefetchInRender&&!s.S$&&((e,t)=>e.isLoading&&e.isFetching&&!t)(f,n)){const e=c?w(a,l,A):u?.promise;e?.catch(s.lQ).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?f:l.trackResult(f)}function B(e,t){return b(e,c,t)}},34164(e,t,r){"use strict";function n(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var A=e.length;for(t=0;t<A;t++)e[t]&&(r=n(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function i(){for(var e,t,r=0,i="",A=arguments.length;r<A;r++)(e=arguments[r])&&(t=n(e))&&(i&&(i+=" "),i+=t);return i}r.d(t,{$:()=>i})},34723(e,t,r){"use strict";r.d(t,{M:()=>Q});var n,i,A,o,a,s,u,c,l,f,d=r(96540),h=r(34164),p=r(77404),g=r(8791),y=r(59744),v=r(8107),m=r(23929),w=r(80196),b=r(56905),B=["radius"],C=["radius"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach(function(t){I(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function I(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},O.apply(null,arguments)}function F(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var x=(e,t,r,d,h)=>{var p,g=(0,b.L)(r),y=(0,b.L)(d),v=Math.min(Math.abs(g)/2,Math.abs(y)/2),m=y>=0?1:-1,w=g>=0?1:-1,B=y>=0&&g>=0||y<0&&g<0?1:0;if(v>0&&h instanceof Array){for(var C=[0,0,0,0],E=0;E<4;E++)C[E]=h[E]>v?v:h[E];p=(0,b.Y)(n||(n=_(["M",",",""])),e,t+m*C[0]),C[0]>0&&(p+=(0,b.Y)(i||(i=_(["A ",",",",0,0,",",",",",""])),C[0],C[0],B,e+w*C[0],t)),p+=(0,b.Y)(A||(A=_(["L ",",",""])),e+r-w*C[1],t),C[1]>0&&(p+=(0,b.Y)(o||(o=_(["A ",",",",0,0,",",\n ",",",""])),C[1],C[1],B,e+r,t+m*C[1])),p+=(0,b.Y)(a||(a=_(["L ",",",""])),e+r,t+d-m*C[2]),C[2]>0&&(p+=(0,b.Y)(s||(s=_(["A ",",",",0,0,",",\n ",",",""])),C[2],C[2],B,e+r-w*C[2],t+d)),p+=(0,b.Y)(u||(u=_(["L ",",",""])),e+w*C[3],t+d),C[3]>0&&(p+=(0,b.Y)(c||(c=_(["A ",",",",0,0,",",\n ",",",""])),C[3],C[3],B,e,t+d-m*C[3])),p+="Z"}else if(v>0&&h===+h&&h>0){var S=Math.min(v,h);p=(0,b.Y)(l||(l=_(["M ",",","\n A ",",",",0,0,",",",",","\n L ",",","\n A ",",",",0,0,",",",",","\n L ",",","\n A ",",",",0,0,",",",",","\n L ",",","\n A ",",",",0,0,",",",","," Z"])),e,t+m*S,S,S,B,e+w*S,t,e+r-w*S,t,S,S,B,e+r,t+m*S,e+r,t+d-m*S,S,S,B,e+r-w*S,t+d,e+w*S,t+d,S,S,B,e,t+d-m*S)}else p=(0,b.Y)(f||(f=_(["M ",","," h "," v "," h "," Z"])),e,t,r,d,-r);return p},U={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Q=e=>{var t=(0,p.e)(e,U),r=(0,d.useRef)(null),[n,i]=(0,d.useState)(-1);(0,d.useEffect)(()=>{if(r.current&&r.current.getTotalLength)try{var e=r.current.getTotalLength();e&&i(e)}catch(e){}},[]);var{x:A,y:o,width:a,height:s,radius:u,className:c}=t,{animationEasing:l,animationDuration:f,animationBegin:E,isAnimationActive:I,isUpdateAnimationActive:_}=t,Q=(0,d.useRef)(a),T=(0,d.useRef)(s),M=(0,d.useRef)(A),P=(0,d.useRef)(o),D=(0,d.useMemo)(()=>({x:A,y:o,width:a,height:s,radius:u}),[A,o,a,s,u]),k=(0,v.n)(D,"rectangle-");if(A!==+A||o!==+o||a!==+a||s!==+s||0===a||0===s)return null;var N=(0,h.$)("recharts-rectangle",c);if(!_){var R=(0,w.a)(t),{radius:L}=R,H=F(R,B);return d.createElement("path",O({},H,{x:(0,b.L)(A),y:(0,b.L)(o),width:(0,b.L)(a),height:(0,b.L)(s),radius:"number"==typeof u?u:void 0,className:N,d:x(A,o,a,s,u)}))}var j=Q.current,V=T.current,K=M.current,z=P.current,G="0px ".concat(-1===n?1:n,"px"),W="".concat(n,"px 0px"),X=(0,m.dl)(["strokeDasharray"],f,"string"==typeof l?l:U.animationEasing);return d.createElement(g.J,{animationId:k,key:k,canBegin:n>0,duration:f,easing:l,isActive:_,begin:E},e=>{var n,i=(0,y.GW)(j,a,e),c=(0,y.GW)(V,s,e),l=(0,y.GW)(K,A,e),f=(0,y.GW)(z,o,e);r.current&&(Q.current=i,T.current=c,M.current=l,P.current=f),n=I?e>0?{transition:X,strokeDasharray:W}:{strokeDasharray:G}:{strokeDasharray:W};var h=(0,w.a)(t),{radius:p}=h,g=F(h,C);return d.createElement("path",O({},g,{radius:"number"==typeof u?u:void 0,className:N,d:x(l,f,i,c,u),ref:r,style:S(S({},n),t.style)}))})}},35548(e,t,r){"use strict";var n=r(33517),i=r(16823),A=TypeError;e.exports=function(e){if(n(e))return e;throw new A(i(e)+" is not a constructor")}},36033(e,t,r){"use strict";r(48523)},36043(e,t,r){"use strict";var n=r(79306),i=TypeError,A=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new A(e)}},36157(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(93234);const i=function(){function e(e,t,r,i,A){this.value=e,this.startEnd=t,this.value=e,this.startEnd=t,this.resultPoints=new Array,this.resultPoints.push(new n.A(r,A)),this.resultPoints.push(new n.A(i,A))}return e.prototype.getValue=function(){return this.value},e.prototype.getStartEnd=function(){return this.startEnd},e.prototype.getResultPoints=function(){return this.resultPoints},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.prototype.hashCode=function(){return this.value},e}()},36158(e,t,r){"use strict";r.d(t,{$:()=>a,s:()=>o});var n=r(26261),i=r(71692),A=r(58904),o=class extends i.k{#p;#R;#A;#L;constructor(e){super(),this.#p=e.client,this.mutationId=e.mutationId,this.#A=e.mutationCache,this.#R=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#R.includes(e)||(this.#R.push(e),this.clearGcTimeout(),this.#A.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#R=this.#R.filter(t=>t!==e),this.scheduleGc(),this.#A.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#R.length||("pending"===this.state.status?this.scheduleGc():this.#A.remove(this))}continue(){return this.#L?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#H({type:"continue"})},r={client:this.#p,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#L=(0,A.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#H({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#H({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#A.canRun(this)});const n="pending"===this.state.status,i=!this.#L.canStart();try{if(n)t();else{this.#H({type:"pending",variables:e,isPaused:i}),await(this.#A.config.onMutate?.(e,this,r));const t=await(this.options.onMutate?.(e,r));t!==this.state.context&&this.#H({type:"pending",context:t,variables:e,isPaused:i})}const A=await this.#L.start();return await(this.#A.config.onSuccess?.(A,e,this.state.context,this,r)),await(this.options.onSuccess?.(A,e,this.state.context,r)),await(this.#A.config.onSettled?.(A,null,this.state.variables,this.state.context,this,r)),await(this.options.onSettled?.(A,null,e,this.state.context,r)),this.#H({type:"success",data:A}),A}catch(t){try{await(this.#A.config.onError?.(t,e,this.state.context,this,r))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,r))}catch(e){Promise.reject(e)}try{await(this.#A.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,r))}catch(e){Promise.reject(e)}throw this.#H({type:"error",error:t}),t}finally{this.#A.runNext(this)}}#H(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.jG.batch(()=>{this.#R.forEach(t=>{t.onMutationUpdate(e)}),this.#A.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},36189(e,t,r){"use strict";r.d(t,{Ds:()=>d,HZ:()=>f,c2:()=>h});var n=r(25508),i=r(47962),A=r(26470),o=r(5180),a=r(68861),s=r(4364);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var f=(0,n.Mz)([o.Lp,o.A$,o.HK,e=>e.brush.height,function(e){return(0,a.W)(e).reduce((e,t)=>"left"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:s.tQ),0)},function(e){return(0,a.W)(e).reduce((e,t)=>"right"!==t.orientation||t.mirror||t.hide?e:e+("number"==typeof t.width?t.width:s.tQ),0)},function(e){return(0,a.h)(e).reduce((e,t)=>"top"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},function(e){return(0,a.h)(e).reduce((e,t)=>"bottom"!==t.orientation||t.mirror||t.hide?e:e+t.height,0)},i.ff,i.dc],(e,t,r,n,i,o,a,s,u,l)=>{var f={left:(r.left||0)+i,right:(r.right||0)+o},d=c(c({},{top:(r.top||0)+a,bottom:(r.bottom||0)+s}),f),h=d.bottom;d.bottom+=n;var p=e-(d=(0,A.s0)(d,u,l)).left-d.right,g=t-d.top-d.bottom;return c(c({brushBottom:h},d),{},{width:Math.max(p,0),height:Math.max(g,0)})}),d=(0,n.Mz)(f,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),h=(0,n.Mz)(o.Lp,o.A$,(e,t)=>({x:0,y:0,width:e,height:t}))},36254(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(){}return e.numberOfTrailingZeros=function(e){var t;if(0===e)return 32;var r=31;return 0!==(t=e<<16)&&(r-=16,e=t),0!==(t=e<<8)&&(r-=8,e=t),0!==(t=e<<4)&&(r-=4,e=t),0!==(t=e<<2)&&(r-=2,e=t),r-(e<<1>>>31)},e.numberOfLeadingZeros=function(e){if(0===e)return 32;var t=1;return e>>>16==0&&(t+=16,e<<=16),e>>>24==0&&(t+=8,e<<=8),e>>>28==0&&(t+=4,e<<=4),e>>>30==0&&(t+=2,e<<=2),t-=e>>>31},e.toHexString=function(e){return e.toString(16)},e.toBinaryString=function(e){return String(parseInt(String(e),2))},e.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},e.truncDivision=function(e,t){return Math.trunc(e/t)},e.parseInt=function(e,t){return void 0===t&&(t=void 0),parseInt(e,t)},e.MIN_VALUE_32_BITS=-2147483648,e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}()},36440(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.identity=function(e){return e}},36775(e,t,r){"use strict";r.d(t,{S:()=>o});var n=r(88468),i=r(89194),A=r(44487),o=function(){function e(){}return e.prototype.getEncodingMode=function(){return A.fG},e.prototype.encodeMaximal=function(e){for(var t=new n.A,r=0,i=e.pos,o=0;e.hasMoreCharacters();){var a=e.getCurrentChar();e.pos++,r=this.encodeChar(a,t),t.length()%3==0&&(i=e.pos,o=t.length())}if(o!==t.length()){var s=Math.floor(t.length()/3*2),u=Math.floor(e.getCodewordCount()+s+1);e.updateSymbolInfo(u);var c=e.getSymbolInfo().getDataCapacity()-u,l=Math.floor(t.length()%3);(2===l&&2!==c||1===l&&(r>3||1!==c))&&(e.pos=i)}t.length()>0&&e.writeCodeword(A.X7),this.handleEOD(e,t)},e.prototype.encode=function(e){for(var t=new n.A;e.hasMoreCharacters();){var r=e.getCurrentChar();e.pos++;var o=this.encodeChar(r,t),a=2*Math.floor(t.length()/3),s=e.getCodewordCount()+a;e.updateSymbolInfo(s);var u=e.getSymbolInfo().getDataCapacity()-s;if(!e.hasMoreCharacters()){var c=new n.A;for(t.length()%3==2&&2!==u&&(o=this.backtrackOneCharacter(e,t,c,o));t.length()%3==1&&(o>3||1!==u);)o=this.backtrackOneCharacter(e,t,c,o);break}if(t.length()%3==0)if(i.A.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(A.d2);break}}this.handleEOD(e,t)},e.prototype.backtrackOneCharacter=function(e,t,r,n){var i=t.length(),A=t.toString().substring(0,i-n);t.setLengthToZero(),t.append(A),e.pos--;var o=e.getCurrentChar();return n=this.encodeChar(o,r),e.resetSymbolInfo(),n},e.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var r=t.toString().substring(3);t.setLengthToZero(),t.append(r)},e.prototype.handleEOD=function(e,t){var r=Math.floor(t.length()/3*2),n=t.length()%3,i=e.getCodewordCount()+r;e.updateSymbolInfo(i);var o=e.getSymbolInfo().getDataCapacity()-i;if(2===n){for(t.append("\0");t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(A.eb)}else if(1===o&&1===n){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(A.eb),e.pos--}else{if(0!==n)throw new Error("Unexpected case. Please report!");for(;t.length()>=3;)this.writeNextTriplet(e,t);(o>0||e.hasMoreCharacters())&&e.writeCodeword(A.eb)}e.signalEncoderChange(A.d2)},e.prototype.encodeChar=function(e,t){if(e===" ".charCodeAt(0))return t.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return t.append(e-48+4),1;if(e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0))return t.append(e-65+14),1;if(e<" ".charCodeAt(0))return t.append(0),t.append(e),2;if(e<="/".charCodeAt(0))return t.append(1),t.append(e-33),2;if(e<="@".charCodeAt(0))return t.append(1),t.append(e-58+15),2;if(e<="_".charCodeAt(0))return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append("1");var r=2;return r+=this.encodeChar(e-128,t)},e.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,r=t/256,i=t%256,A=new n.A;return A.append(r),A.append(i),A.toString()},e}()},38102(e,t,r){"use strict";r.d(t,{A:()=>l});var n,i=r(51084),A=r(73753),o=r(23636),a=r(59379),s=r(31327),u=r(54951),c=r(36254);!function(e){e[e.UPPER=0]="UPPER",e[e.LOWER=1]="LOWER",e[e.MIXED=2]="MIXED",e[e.DIGIT=3]="DIGIT",e[e.PUNCT=4]="PUNCT",e[e.BINARY=5]="BINARY"}(n||(n={}));const l=function(){function e(){}return e.prototype.decode=function(t){this.ddata=t;var r=t.getBits(),n=this.extractBits(r),A=this.correctBits(n),o=e.convertBoolArrayToByteArray(A),a=e.getEncodedData(A),s=new i.A(o,a,null,null);return s.setNumBits(A.length),s},e.highLevelDecode=function(e){return this.getEncodedData(e)},e.getEncodedData=function(t){for(var r=t.length,i=n.UPPER,A=n.UPPER,o="",a=0;a<r;)if(A===n.BINARY){if(r-a<5)break;var s=e.readCode(t,a,5);if(a+=5,0===s){if(r-a<11)break;s=e.readCode(t,a,11)+31,a+=11}for(var c=0;c<s;c++){if(r-a<8){a=r;break}var l=e.readCode(t,a,8);o+=u.A.castAsNonUtf8Char(l),a+=8}A=i}else{var f=A===n.DIGIT?4:5;if(r-a<f)break;l=e.readCode(t,a,f);a+=f;var d=e.getCharacter(A,l);d.startsWith("CTRL_")?(i=A,A=e.getTable(d.charAt(5)),"L"===d.charAt(6)&&(i=A)):(o+=d,A=i)}return o},e.getTable=function(e){switch(e){case"L":return n.LOWER;case"P":return n.PUNCT;case"M":return n.MIXED;case"D":return n.DIGIT;case"B":return n.BINARY;default:return n.UPPER}},e.getCharacter=function(t,r){switch(t){case n.UPPER:return e.UPPER_TABLE[r];case n.LOWER:return e.LOWER_TABLE[r];case n.MIXED:return e.MIXED_TABLE[r];case n.PUNCT:return e.PUNCT_TABLE[r];case n.DIGIT:return e.DIGIT_TABLE[r];default:throw new a.A("Bad table")}},e.prototype.correctBits=function(t){var r,n;this.ddata.getNbLayers()<=2?(n=6,r=A.A.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,r=A.A.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,r=A.A.AZTEC_DATA_10):(n=12,r=A.A.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),a=t.length/n;if(a<i)throw new s.A;for(var u=t.length%n,c=new Int32Array(a),l=0;l<a;l++,u+=n)c[l]=e.readCode(t,u,n);try{new o.A(r).decode(c,a-i)}catch(e){throw new s.A(e)}var f=(1<<n)-1,d=0;for(l=0;l<i;l++){if(0===(g=c[l])||g===f)throw new s.A;1!==g&&g!==f-1||d++}var h=new Array(i*n-d),p=0;for(l=0;l<i;l++){var g;if(1===(g=c[l])||g===f-1)h.fill(g>1,p,p+n-1),p+=n-1;else for(var y=n-1;y>=0;--y)h[p++]=!!(g&1<<y)}return h},e.prototype.extractBits=function(e){var t=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(t?11:14)+4*r,i=new Int32Array(n),A=new Array(this.totalBitsInLayer(r,t));if(t)for(var o=0;o<i.length;o++)i[o]=o;else{var a=n+1+2*c.A.truncDivision(c.A.truncDivision(n,2)-1,15),s=n/2,u=c.A.truncDivision(a,2);for(o=0;o<s;o++){var l=o+c.A.truncDivision(o,15);i[s-o-1]=u-l-1,i[s+o]=u+l+1}}o=0;for(var f=0;o<r;o++){for(var d=4*(r-o)+(t?9:12),h=2*o,p=n-1-h,g=0;g<d;g++)for(var y=2*g,v=0;v<2;v++)A[f+y+v]=e.get(i[h+v],i[h+g]),A[f+2*d+y+v]=e.get(i[h+g],i[p-v]),A[f+4*d+y+v]=e.get(i[p-v],i[p-g]),A[f+6*d+y+v]=e.get(i[p-g],i[h+v]);f+=8*d}return A},e.readCode=function(e,t,r){for(var n=0,i=t;i<t+r;i++)n<<=1,e[i]&&(n|=1);return n},e.readByte=function(t,r){var n=t.length-r;return n>=8?e.readCode(t,r,8):e.readCode(t,r,n)<<8-n},e.convertBoolArrayToByteArray=function(t){for(var r=new Uint8Array((t.length+7)/8),n=0;n<r.length;n++)r[n]=e.readByte(t,8*n);return r},e.prototype.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],e.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],e.MIXED_TABLE=["CTRL_PS"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~","","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],e.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],e.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],e}()},38351(e,t,r){var n;!function(){"use strict";var i,A=1e9,o={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},a=!0,s="[DecimalError] ",u=s+"Invalid argument: ",c=s+"Exponent out of range: ",l=Math.floor,f=Math.pow,d=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=1e7,p=9007199254740991,g=l(1286742750677284.5),y={};function v(e,t){var r,n,i,A,o,s,u,c,l=e.constructor,f=l.precision;if(!e.s||!t.s)return t.s||(t=new l(e)),a?F(t,f):t;if(u=e.d,c=t.d,o=e.e,i=t.e,u=u.slice(),A=o-i){for(A<0?(n=u,A=-A,s=c.length):(n=c,i=o,s=u.length),A>(s=(o=Math.ceil(f/7))>s?o+1:s+1)&&(A=s,n.length=1),n.reverse();A--;)n.push(0);n.reverse()}for((s=u.length)-(A=c.length)<0&&(A=s,n=c,c=u,u=n),r=0;A;)r=(u[--A]=u[A]+c[A]+r)/h|0,u[A]%=h;for(r&&(u.unshift(r),++i),s=u.length;0==u[--s];)u.pop();return t.d=u,t.e=i,a?F(t,f):t}function m(e,t,r){if(e!==~~e||e<t||e>r)throw Error(u+e)}function w(e){var t,r,n,i=e.length-1,A="",o=e[0];if(i>0){for(A+=o,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(A+=S(r)),A+=n;(r=7-(n=(o=e[t])+"").length)&&(A+=S(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return A+o}y.absoluteValue=y.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},y.comparedTo=y.cmp=function(e){var t,r,n,i,A=this;if(e=new A.constructor(e),A.s!==e.s)return A.s||-e.s;if(A.e!==e.e)return A.e>e.e^A.s<0?1:-1;for(t=0,r=(n=A.d.length)<(i=e.d.length)?n:i;t<r;++t)if(A.d[t]!==e.d[t])return A.d[t]>e.d[t]^A.s<0?1:-1;return n===i?0:n>i^A.s<0?1:-1},y.decimalPlaces=y.dp=function(){var e=this,t=e.d.length-1,r=7*(t-e.e);if(t=e.d[t])for(;t%10==0;t/=10)r--;return r<0?0:r},y.dividedBy=y.div=function(e){return b(this,new this.constructor(e))},y.dividedToIntegerBy=y.idiv=function(e){var t=this.constructor;return F(b(this,new t(e),0,1),t.precision)},y.equals=y.eq=function(e){return!this.cmp(e)},y.exponent=function(){return C(this)},y.greaterThan=y.gt=function(e){return this.cmp(e)>0},y.greaterThanOrEqualTo=y.gte=function(e){return this.cmp(e)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return 0===this.s},y.lessThan=y.lt=function(e){return this.cmp(e)<0},y.lessThanOrEqualTo=y.lte=function(e){return this.cmp(e)<1},y.logarithm=y.log=function(e){var t,r=this,n=r.constructor,A=n.precision,o=A+5;if(void 0===e)e=new n(10);else if((e=new n(e)).s<1||e.eq(i))throw Error(s+"NaN");if(r.s<1)throw Error(s+(r.s?"NaN":"-Infinity"));return r.eq(i)?new n(0):(a=!1,t=b(I(r,o),I(e,o),o),a=!0,F(t,A))},y.minus=y.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):v(t,(e.s=-e.s,e))},y.modulo=y.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(!(e=new n(e)).s)throw Error(s+"NaN");return r.s?(a=!1,t=b(r,e,0,1).times(e),a=!0,r.minus(t)):F(new n(r),i)},y.naturalExponential=y.exp=function(){return B(this)},y.naturalLogarithm=y.ln=function(){return I(this)},y.negated=y.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},y.plus=y.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?v(t,e):_(t,(e.s=-e.s,e))},y.precision=y.sd=function(e){var t,r,n,i=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(u+e);if(t=C(i)+1,r=7*(n=i.d.length-1)+1,n=i.d[n]){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r},y.squareRoot=y.sqrt=function(){var e,t,r,n,i,A,o,u=this,c=u.constructor;if(u.s<1){if(!u.s)return new c(0);throw Error(s+"NaN")}for(e=C(u),a=!1,0==(i=Math.sqrt(+u))||i==1/0?(((t=w(u.d)).length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=l((e+1)/2)-(e<0||e%2),n=new c(t=i==1/0?"5e"+e:(t=i.toExponential()).slice(0,t.indexOf("e")+1)+e)):n=new c(i.toString()),i=o=(r=c.precision)+3;;)if(n=(A=n).plus(b(u,A,o+2)).times(.5),w(A.d).slice(0,o)===(t=w(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&"4999"==t){if(F(A,r+1,0),A.times(A).eq(u)){n=A;break}}else if("9999"!=t)break;o+=4}return a=!0,F(n,r)},y.times=y.mul=function(e){var t,r,n,i,A,o,s,u,c,l=this,f=l.constructor,d=l.d,p=(e=new f(e)).d;if(!l.s||!e.s)return new f(0);for(e.s*=l.s,r=l.e+e.e,(u=d.length)<(c=p.length)&&(A=d,d=p,p=A,o=u,u=c,c=o),A=[],n=o=u+c;n--;)A.push(0);for(n=c;--n>=0;){for(t=0,i=u+n;i>n;)s=A[i]+p[n]*d[i-n-1]+t,A[i--]=s%h|0,t=s/h|0;A[i]=(A[i]+t)%h|0}for(;!A[--o];)A.pop();return t?++r:A.shift(),e.d=A,e.e=r,a?F(e,f.precision):e},y.toDecimalPlaces=y.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(m(e,0,A),void 0===t?t=n.rounding:m(t,0,8),F(r,e+C(r)+1,t))},y.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=x(n,!0):(m(e,0,A),void 0===t?t=i.rounding:m(t,0,8),r=x(n=F(new i(n),e+1,t),!0,e+1)),r},y.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return void 0===e?x(i):(m(e,0,A),void 0===t?t=o.rounding:m(t,0,8),r=x((n=F(new o(i),e+C(i)+1,t)).abs(),!1,e+C(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)},y.toInteger=y.toint=function(){var e=this,t=e.constructor;return F(new t(e),C(e)+1,t.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(e){var t,r,n,A,o,u,c=this,f=c.constructor,d=+(e=new f(e));if(!e.s)return new f(i);if(!(c=new f(c)).s){if(e.s<1)throw Error(s+"Infinity");return c}if(c.eq(i))return c;if(n=f.precision,e.eq(i))return F(c,n);if(u=(t=e.e)>=(r=e.d.length-1),o=c.s,u){if((r=d<0?-d:d)<=p){for(A=new f(i),t=Math.ceil(n/7+4),a=!1;r%2&&U((A=A.times(c)).d,t),0!==(r=l(r/2));)U((c=c.times(c)).d,t);return a=!0,e.s<0?new f(i).div(A):F(A,n)}}else if(o<0)throw Error(s+"NaN");return o=o<0&&1&e.d[Math.max(t,r)]?-1:1,c.s=1,a=!1,A=e.times(I(c,n+12)),a=!0,(A=B(A)).s=o,A},y.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return void 0===e?n=x(i,(r=C(i))<=o.toExpNeg||r>=o.toExpPos):(m(e,1,A),void 0===t?t=o.rounding:m(t,0,8),n=x(i=F(new o(i),e,t),e<=(r=C(i))||r<=o.toExpNeg,e)),n},y.toSignificantDigits=y.tosd=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(m(e,1,A),void 0===t?t=r.rounding:m(t,0,8)),F(new r(this),e,t)},y.toString=y.valueOf=y.val=y.toJSON=function(){var e=this,t=C(e),r=e.constructor;return x(e,t<=r.toExpNeg||t>=r.toExpPos)};var b=function(){function e(e,t){var r,n=0,i=e.length;for(e=e.slice();i--;)r=e[i]*t+n,e[i]=r%h|0,n=r/h|0;return n&&e.unshift(n),e}function t(e,t,r,n){var i,A;if(r!=n)A=r>n?1:-1;else for(i=A=0;i<r;i++)if(e[i]!=t[i]){A=e[i]>t[i]?1:-1;break}return A}function r(e,t,r){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*h+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,A,o){var a,u,c,l,f,d,p,g,y,v,m,w,b,B,E,S,I,O,_=n.constructor,x=n.s==i.s?1:-1,U=n.d,Q=i.d;if(!n.s)return new _(n);if(!i.s)throw Error(s+"Division by zero");for(u=n.e-i.e,I=Q.length,E=U.length,g=(p=new _(x)).d=[],c=0;Q[c]==(U[c]||0);)++c;if(Q[c]>(U[c]||0)&&--u,(w=null==A?A=_.precision:o?A+(C(n)-C(i))+1:A)<0)return new _(0);if(w=w/7+2|0,c=0,1==I)for(l=0,Q=Q[0],w++;(c<E||l)&&w--;c++)b=l*h+(U[c]||0),g[c]=b/Q|0,l=b%Q|0;else{for((l=h/(Q[0]+1)|0)>1&&(Q=e(Q,l),U=e(U,l),I=Q.length,E=U.length),B=I,v=(y=U.slice(0,I)).length;v<I;)y[v++]=0;(O=Q.slice()).unshift(0),S=Q[0],Q[1]>=h/2&&++S;do{l=0,(a=t(Q,y,I,v))<0?(m=y[0],I!=v&&(m=m*h+(y[1]||0)),(l=m/S|0)>1?(l>=h&&(l=h-1),1==(a=t(f=e(Q,l),y,d=f.length,v=y.length))&&(l--,r(f,I<d?O:Q,d))):(0==l&&(a=l=1),f=Q.slice()),(d=f.length)<v&&f.unshift(0),r(y,f,v),-1==a&&(a=t(Q,y,I,v=y.length))<1&&(l++,r(y,I<v?O:Q,v)),v=y.length):0===a&&(l++,y=[0]),g[c++]=l,a&&y[0]?y[v++]=U[B]||0:(y=[U[B]],v=1)}while((B++<E||void 0!==y[0])&&w--)}return g[0]||g.shift(),p.e=u,F(p,o?A+C(p)+1:A)}}();function B(e,t){var r,n,A,o,s,u=0,l=0,d=e.constructor,h=d.precision;if(C(e)>16)throw Error(c+C(e));if(!e.s)return new d(i);for(null==t?(a=!1,s=h):s=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),l+=5;for(s+=Math.log(f(2,l))/Math.LN10*2+5|0,r=n=A=new d(i),d.precision=s;;){if(n=F(n.times(e),s),r=r.times(++u),w((o=A.plus(b(n,r,s))).d).slice(0,s)===w(A.d).slice(0,s)){for(;l--;)A=F(A.times(A),s);return d.precision=h,null==t?(a=!0,F(A,h)):A}A=o}}function C(e){for(var t=7*e.e,r=e.d[0];r>=10;r/=10)t++;return t}function E(e,t,r){if(t>e.LN10.sd())throw a=!0,r&&(e.precision=r),Error(s+"LN10 precision limit exceeded");return F(new e(e.LN10),t)}function S(e){for(var t="";e--;)t+="0";return t}function I(e,t){var r,n,A,o,u,c,l,f,d,h=1,p=e,g=p.d,y=p.constructor,v=y.precision;if(p.s<1)throw Error(s+(p.s?"NaN":"-Infinity"));if(p.eq(i))return new y(0);if(null==t?(a=!1,f=v):f=t,p.eq(10))return null==t&&(a=!0),E(y,f);if(f+=10,y.precision=f,n=(r=w(g)).charAt(0),o=C(p),!(Math.abs(o)<15e14))return l=E(y,f+2,v).times(o+""),p=I(new y(n+"."+r.slice(1)),f-10).plus(l),y.precision=v,null==t?(a=!0,F(p,v)):p;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=w((p=p.times(e)).d)).charAt(0),h++;for(o=C(p),n>1?(p=new y("0."+r),o++):p=new y(n+"."+r.slice(1)),c=u=p=b(p.minus(i),p.plus(i),f),d=F(p.times(p),f),A=3;;){if(u=F(u.times(d),f),w((l=c.plus(b(u,new y(A),f))).d).slice(0,f)===w(c.d).slice(0,f))return c=c.times(2),0!==o&&(c=c.plus(E(y,f+2,v).times(o+""))),c=b(c,new y(h),f),y.precision=v,null==t?(a=!0,F(c,v)):c;c=l,A+=2}}function O(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);)++n;for(i=t.length;48===t.charCodeAt(i-1);)--i;if(t=t.slice(n,i)){if(i-=n,r=r-n-1,e.e=l(r/7),e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),a&&(e.e>g||e.e<-g))throw Error(c+r)}else e.s=0,e.e=0,e.d=[0];return e}function F(e,t,r){var n,i,A,o,s,u,d,p,y=e.d;for(o=1,A=y[0];A>=10;A/=10)o++;if((n=t-o)<0)n+=7,i=t,d=y[p=0];else{if((p=Math.ceil((n+1)/7))>=(A=y.length))return e;for(d=A=y[p],o=1;A>=10;A/=10)o++;i=(n%=7)-7+o}if(void 0!==r&&(s=d/(A=f(10,o-i-1))%10|0,u=t<0||void 0!==y[p+1]||d%A,u=r<4?(s||u)&&(0==r||r==(e.s<0?3:2)):s>5||5==s&&(4==r||u||6==r&&(n>0?i>0?d/f(10,o-i):0:y[p-1])%10&1||r==(e.s<0?8:7))),t<1||!y[0])return u?(A=C(e),y.length=1,t=t-A-1,y[0]=f(10,(7-t%7)%7),e.e=l(-t/7)||0):(y.length=1,y[0]=e.e=e.s=0),e;if(0==n?(y.length=p,A=1,p--):(y.length=p+1,A=f(10,7-n),y[p]=i>0?(d/f(10,o-i)%f(10,i)|0)*A:0),u)for(;;){if(0==p){(y[0]+=A)==h&&(y[0]=1,++e.e);break}if(y[p]+=A,y[p]!=h)break;y[p--]=0,A=1}for(n=y.length;0===y[--n];)y.pop();if(a&&(e.e>g||e.e<-g))throw Error(c+C(e));return e}function _(e,t){var r,n,i,A,o,s,u,c,l,f,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),a?F(t,p):t;if(u=e.d,f=t.d,n=t.e,c=e.e,u=u.slice(),o=c-n){for((l=o<0)?(r=u,o=-o,s=f.length):(r=f,n=c,s=u.length),o>(i=Math.max(Math.ceil(p/7),s)+2)&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for((l=(i=u.length)<(s=f.length))&&(s=i),i=0;i<s;i++)if(u[i]!=f[i]){l=u[i]<f[i];break}o=0}for(l&&(r=u,u=f,f=r,t.s=-t.s),s=u.length,i=f.length-s;i>0;--i)u[s++]=0;for(i=f.length;i>o;){if(u[--i]<f[i]){for(A=i;A&&0===u[--A];)u[A]=h-1;--u[A],u[i]+=h}u[i]-=f[i]}for(;0===u[--s];)u.pop();for(;0===u[0];u.shift())--n;return u[0]?(t.d=u,t.e=n,a?F(t,p):t):new d(0)}function x(e,t,r){var n,i=C(e),A=w(e.d),o=A.length;return t?(r&&(n=r-o)>0?A=A.charAt(0)+"."+A.slice(1)+S(n):o>1&&(A=A.charAt(0)+"."+A.slice(1)),A=A+(i<0?"e":"e+")+i):i<0?(A="0."+S(-i-1)+A,r&&(n=r-o)>0&&(A+=S(n))):i>=o?(A+=S(i+1-o),r&&(n=r-i-1)>0&&(A=A+"."+S(n))):((n=i+1)<o&&(A=A.slice(0,n)+"."+A.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(A+="."),A+=S(n))),e.s<0?"-"+A:A}function U(e,t){if(e.length>t)return e.length=t,!0}function Q(e){if(!e||"object"!=typeof e)throw Error(s+"Object expected");var t,r,n,i=["precision",1,A,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if(void 0!==(n=e[r=i[t]])){if(!(l(n)===n&&n>=i[t+1]&&n<=i[t+2]))throw Error(u+r+": "+n);this[r]=n}if(void 0!==(n=e[r="LN10"])){if(n!=Math.LN10)throw Error(u+r+": "+n);this[r]=new this(n)}return this}o=function e(t){var r,n,i;function A(e){var t=this;if(!(t instanceof A))return new A(e);if(t.constructor=A,e instanceof A)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"==typeof e){if(0*e!=0)throw Error(u+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):O(t,e.toString())}if("string"!=typeof e)throw Error(u+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!d.test(e))throw Error(u+e);O(t,e)}if(A.prototype=y,A.ROUND_UP=0,A.ROUND_DOWN=1,A.ROUND_CEIL=2,A.ROUND_FLOOR=3,A.ROUND_HALF_UP=4,A.ROUND_HALF_DOWN=5,A.ROUND_HALF_EVEN=6,A.ROUND_HALF_CEIL=7,A.ROUND_HALF_FLOOR=8,A.clone=e,A.config=A.set=Q,void 0===t&&(t={}),t)for(i=["precision","rounding","toExpNeg","toExpPos","LN10"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return A.config(t),A}(o),o.default=o.Decimal=o,i=new o(1),void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},38538(e,t,r){"use strict";r.d(t,{B:()=>a});var n=r(54951),i=r(88468),A=r(89194),o=r(44487),a=function(){function e(){}return e.prototype.getEncodingMode=function(){return o.mt},e.prototype.encode=function(e){var t=new i.A;for(t.append(0);e.hasMoreCharacters();){var r=e.getCurrentChar();if(t.append(r),e.pos++,A.A.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(o.d2);break}}var a=t.length()-1,s=e.getCodewordCount()+a+1;e.updateSymbolInfo(s);var u=e.getSymbolInfo().getDataCapacity()-s>0;if(e.hasMoreCharacters()||u)if(a<=249)t.setCharAt(0,n.A.getCharAt(a));else{if(!(a<=1555))throw new Error("Message length not in valid ranges: "+a);t.setCharAt(0,n.A.getCharAt(Math.floor(a/250)+249)),t.insert(1,n.A.getCharAt(a%250))}var c=0;for(r=t.length();c<r;c++)e.writeCodeword(this.randomize255State(t.charAt(c).charCodeAt(0),e.getCodewordCount()+1))},e.prototype.randomize255State=function(e,t){var r=e+(149*t%255+1);return r<=255?r:r-256},e}()},40150(e,t,r){"use strict";r(46518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},40217(e,t,r){"use strict";var n,i=r(75359),A=r(44388),o=r(92819),a=r(57149),s=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});!function(e){function t(t,r,n,i,A,o,s){var u=e.call(this,r,n)||this;if(u.dataWidth=i,u.dataHeight=A,u.left=o,u.top=s,4===t.BYTES_PER_ELEMENT){for(var c=r*n,l=new Uint8ClampedArray(c),f=0;f<c;f++){var d=t[f],h=d>>16&255,p=d>>7&510,g=255&d;l[f]=(h+p+g)/4&255}u.luminances=l}else u.luminances=t;if(void 0===i&&(u.dataWidth=r),void 0===A&&(u.dataHeight=n),void 0===o&&(u.left=0),void 0===s&&(u.top=0),u.left+r>u.dataWidth||u.top+n>u.dataHeight)throw new a.A("Crop rectangle does not fit within image data.");return u}s(t,e),t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new a.A("Requested row is outside the image: "+e);var r=this.getWidth();(null==t||t.length<r)&&(t=new Uint8ClampedArray(r));var n=(e+this.top)*this.dataWidth+this.left;return o.A.arraycopy(this.luminances,n,t,0,r),t},t.prototype.getMatrix=function(){var e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;var r=e*t,n=new Uint8ClampedArray(r),i=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return o.A.arraycopy(this.luminances,i,n,0,r),n;for(var A=0;A<t;A++){var a=A*e;o.A.arraycopy(this.luminances,i,n,a,e),i+=this.dataWidth}return n},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,r,n,i){return new t(this.luminances,n,i,this.dataWidth,this.dataHeight,this.left+e,this.top+r)},t.prototype.invert=function(){return new i.A(this)}}(A.A)},40280(e,t,r){"use strict";var n=r(46518),i=r(97751),A=r(96395),o=r(80550),a=r(10916).CONSTRUCTOR,s=r(93438),u=i("Promise"),c=A&&!a;n({target:"Promise",stat:!0,forced:A||a},{resolve:function(e){return s(c&&this===u?o:this,e)}})},40717(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(58273);t.isMatch=function(e,t){return n.isMatchWith(e,t,()=>{})}},40875(e,t,r){"use strict";var n=r(46518),i=r(79039),A=r(48981),o=r(42787),a=r(12211);n({target:"Object",stat:!0,forced:i(function(){o(1)}),sham:!a},{getPrototypeOf:function(e){return o(A(e))}})},40961(e,t,r){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=r(22551)},41927(e,t,r){"use strict";r.d(t,{N:()=>n});var n=(e,t)=>t},42678(e,t,r){"use strict";r.d(t,{p:()=>a,v:()=>s});var n=r(96540),i=r(49082),A=r(92617),o=e=>{var t=(0,i.j)(),r=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{null===r.current?t((0,A.g5)(e)):r.current!==e&&t((0,A.ZF)({prev:r.current,next:e})),r.current=e},[t,e]),(0,n.useLayoutEffect)(()=>()=>{r.current&&(t((0,A.Vi)(r.current)),r.current=null)},[t]),null},a=(0,n.memo)(o);function s(e){var t=(0,i.j)();return(0,n.useLayoutEffect)(()=>(t((0,A.As)(e)),()=>{t((0,A.TK)(e))}),[t,e]),null}},42893(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(58503);const i=function(){function e(){}return e.checkAndNudgePoints=function(e,t){for(var r=e.getWidth(),i=e.getHeight(),A=!0,o=0;o<t.length&&A;o+=2){var a=Math.floor(t[o]),s=Math.floor(t[o+1]);if(a<-1||a>r||s<-1||s>i)throw new n.A;A=!1,-1===a?(t[o]=0,A=!0):a===r&&(t[o]=r-1,A=!0),-1===s?(t[o+1]=0,A=!0):s===i&&(t[o+1]=i-1,A=!0)}A=!0;for(o=t.length-2;o>=0&&A;o-=2){a=Math.floor(t[o]),s=Math.floor(t[o+1]);if(a<-1||a>r||s<-1||s>i)throw new n.A;A=!1,-1===a?(t[o]=0,A=!0):a===r&&(t[o]=r-1,A=!0),-1===s?(t[o+1]=0,A=!0):s===i&&(t[o+1]=i-1,A=!0)}},e}()},43074(e,t,r){"use strict";function n(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}r.d(t,{A:()=>u});var i,A=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(t,r){var i,A,o,a=this.constructor,s=e.call(this,t,r)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),i=s,A=a.prototype,(o=Object.setPrototypeOf)?o(i,A):i.__proto__=A,n(s),s}return A(t,e),t}(Error);var a,s=(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},a(e,t)},function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const u=function(e){function t(t){void 0===t&&(t=void 0);var r=e.call(this,t)||this;return r.message=t,r}return s(t,e),t.prototype.getKind=function(){return this.constructor.kind},t.kind="Exception",t}(o)},43113(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(57149);const i=function(){function e(){}return e.applyMaskPenaltyRule1=function(t){return e.applyMaskPenaltyRule1Internal(t,!0)+e.applyMaskPenaltyRule1Internal(t,!1)},e.applyMaskPenaltyRule2=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),A=t.getHeight(),o=0;o<A-1;o++)for(var a=n[o],s=0;s<i-1;s++){var u=a[s];u===a[s+1]&&u===n[o+1][s]&&u===n[o+1][s+1]&&r++}return e.N2*r},e.applyMaskPenaltyRule3=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),A=t.getHeight(),o=0;o<A;o++)for(var a=0;a<i;a++){var s=n[o];a+6<i&&1===s[a]&&0===s[a+1]&&1===s[a+2]&&1===s[a+3]&&1===s[a+4]&&0===s[a+5]&&1===s[a+6]&&(e.isWhiteHorizontal(s,a-4,a)||e.isWhiteHorizontal(s,a+7,a+11))&&r++,o+6<A&&1===n[o][a]&&0===n[o+1][a]&&1===n[o+2][a]&&1===n[o+3][a]&&1===n[o+4][a]&&0===n[o+5][a]&&1===n[o+6][a]&&(e.isWhiteVertical(n,a,o-4,o)||e.isWhiteVertical(n,a,o+7,o+11))&&r++}return r*e.N3},e.isWhiteHorizontal=function(e,t,r){t=Math.max(t,0),r=Math.min(r,e.length);for(var n=t;n<r;n++)if(1===e[n])return!1;return!0},e.isWhiteVertical=function(e,t,r,n){r=Math.max(r,0),n=Math.min(n,e.length);for(var i=r;i<n;i++)if(1===e[i][t])return!1;return!0},e.applyMaskPenaltyRule4=function(t){for(var r=0,n=t.getArray(),i=t.getWidth(),A=t.getHeight(),o=0;o<A;o++)for(var a=n[o],s=0;s<i;s++)1===a[s]&&r++;var u=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*r-u)/u)*e.N4},e.getDataMaskBit=function(e,t,r){var i,A;switch(e){case 0:i=r+t&1;break;case 1:i=1&r;break;case 2:i=t%3;break;case 3:i=(r+t)%3;break;case 4:i=Math.floor(r/2)+Math.floor(t/3)&1;break;case 5:i=(1&(A=r*t))+A%3;break;case 6:i=(1&(A=r*t))+A%3&1;break;case 7:i=(A=r*t)%3+(r+t&1)&1;break;default:throw new n.A("Invalid mask pattern: "+e)}return 0===i},e.applyMaskPenaltyRule1Internal=function(t,r){for(var n=0,i=r?t.getHeight():t.getWidth(),A=r?t.getWidth():t.getHeight(),o=t.getArray(),a=0;a<i;a++){for(var s=0,u=-1,c=0;c<A;c++){var l=r?o[a][c]:o[c][a];l===u?s++:(s>=5&&(n+=e.N1+(s-5)),s=1,u=l)}s>=5&&(n+=e.N1+(s-5))}return n},e.N1=3,e.N2=3,e.N3=40,e.N4=10,e}()},43334(e,t,r){"use strict";r.d(t,{A:()=>A});var n=r(27562),i=r(98517);const A=function(){function e(){}return e.decode=function(e,t){var r=this.encodingName(t);return this.customDecoder?this.customDecoder(e,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},e.shouldDecodeOnFallback=function(t){return!e.isBrowser()&&"ISO-8859-1"===t},e.encode=function(e,t){var r=this.encodingName(t);return this.customEncoder?this.customEncoder(e,r):"undefined"==typeof TextEncoder?this.encodeFallback(e):(new TextEncoder).encode(e)},e.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},e.encodingName=function(e){return"string"==typeof e?e:e.getName()},e.encodingCharacterSet=function(e){return e instanceof i.A?e:i.A.getCharacterSetECIByName(e)},e.decodeFallback=function(t,r){var A=this.encodingCharacterSet(r);if(e.isDecodeFallbackSupported(A)){for(var o="",a=0,s=t.length;a<s;a++){var u=t[a].toString(16);u.length<2&&(u="0"+u),o+="%"+u}return decodeURIComponent(o)}if(A.equals(i.A.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new n.A("Encoding "+this.encodingName(r)+" not supported by fallback.")},e.isDecodeFallbackSupported=function(e){return e.equals(i.A.UTF8)||e.equals(i.A.ISO8859_1)||e.equals(i.A.ASCII)},e.encodeFallback=function(e){for(var t=btoa(unescape(encodeURIComponent(e))).split(""),r=[],n=0;n<t.length;n++)r.push(t[n].charCodeAt(0));return new Uint8Array(r)},e}()},43407(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(i.A);const a=o},43412(e,t,r){e.exports=r(85012).range},44213(e,t,r){"use strict";var n=r(43724),i=r(79504),A=r(69565),o=r(79039),a=r(71072),s=r(33717),u=r(48773),c=r(48981),l=r(47055),f=Object.assign,d=Object.defineProperty,h=i([].concat);e.exports=!f||o(function(){if(n&&1!==f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach(function(e){t[e]=e}),7!==f({},e)[r]||a(f({},t)).join("")!==i})?function(e,t){for(var r=c(e),i=arguments.length,o=1,f=s.f,d=u.f;i>o;)for(var p,g=l(arguments[o++]),y=f?h(a(g),f(g)):a(g),v=y.length,m=0;v>m;)p=y[m++],n&&!A(d,g,p)||(r[p]=g[p]);return r}:f},44265(e,t,r){"use strict";var n=r(82839);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},44388(e,t,r){"use strict";r.d(t,{A:()=>A});var n=r(88468),i=r(27562);const A=function(){function e(e,t){this.width=e,this.height=t}return e.prototype.getWidth=function(){return this.width},e.prototype.getHeight=function(){return this.height},e.prototype.isCropSupported=function(){return!1},e.prototype.crop=function(e,t,r,n){throw new i.A("This luminance source does not support cropping.")},e.prototype.isRotateSupported=function(){return!1},e.prototype.rotateCounterClockwise=function(){throw new i.A("This luminance source does not support rotation by 90 degrees.")},e.prototype.rotateCounterClockwise45=function(){throw new i.A("This luminance source does not support rotation by 45 degrees.")},e.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),t=new n.A,r=0;r<this.height;r++){for(var i=this.getRow(r,e),A=0;A<this.width;A++){var o=255&i[A],a=void 0;a=o<64?"#":o<128?"+":o<192?".":" ",t.append(a)}t.append("\n")}return t.toString()},e}()},44487(e,t,r){"use strict";var n;r.d(t,{$9:()=>a,KX:()=>s,OM:()=>m,Qe:()=>p,Qw:()=>u,TG:()=>B,VK:()=>I,VL:()=>S,X7:()=>c,XQ:()=>o,ah:()=>l,d2:()=>C,dn:()=>g,eB:()=>b,eb:()=>v,fG:()=>E,gE:()=>A,gn:()=>f,h_:()=>w,ij:()=>y,mD:()=>h,mt:()=>F,tf:()=>d,uf:()=>O});var i,A=[5,7,10,11,12,14,18,20,24,28,36,42,48,56,62,68],o=[[228,48,15,111,62],[23,68,144,134,240,92,254],[28,24,185,166,223,248,116,255,110,61],[175,138,205,12,194,168,39,245,60,97,120],[41,153,158,91,61,42,142,213,97,178,100,242],[156,97,192,252,95,9,157,119,138,45,18,186,83,185],[83,195,100,39,188,75,66,61,241,213,109,129,94,254,225,48,90,188],[15,195,244,9,233,71,168,2,188,160,153,145,253,79,108,82,27,174,186,172],[52,190,88,205,109,39,176,21,155,197,251,223,155,21,5,172,254,124,12,181,184,96,50,193],[211,231,43,97,71,96,103,174,37,151,170,53,75,34,249,121,17,138,110,213,141,136,120,151,233,168,93,255],[245,127,242,218,130,250,162,181,102,120,84,179,220,251,80,182,229,18,2,4,68,33,101,137,95,119,115,44,175,184,59,25,225,98,81,112],[77,193,137,31,19,38,22,153,247,105,122,2,245,133,242,8,175,95,100,9,167,105,214,111,57,121,21,1,253,57,54,101,248,202,69,50,150,177,226,5,9,5],[245,132,172,223,96,32,117,22,238,133,238,231,205,188,237,87,191,106,16,147,118,23,37,90,170,205,131,88,120,100,66,138,186,240,82,44,176,87,187,147,160,175,69,213,92,253,225,19],[175,9,223,238,12,17,220,208,100,29,175,170,230,192,215,235,150,159,36,223,38,200,132,54,228,146,218,234,117,203,29,232,144,238,22,150,201,117,62,207,164,13,137,245,127,67,247,28,155,43,203,107,233,53,143,46],[242,93,169,50,144,210,39,118,202,188,201,189,143,108,196,37,185,112,134,230,245,63,197,190,250,106,185,221,175,64,114,71,161,44,147,6,27,218,51,63,87,10,40,130,188,17,163,31,176,170,4,107,232,7,94,166,224,124,86,47,11,204],[220,228,173,89,251,149,159,56,89,33,147,244,154,36,73,127,213,136,248,180,234,197,158,177,68,122,93,213,15,160,227,236,66,139,153,185,202,167,179,25,220,232,96,210,231,136,223,239,181,241,59,52,172,25,49,232,211,189,64,54,108,153,132,63,96,103,82,186]],a=(n=function(e,t){for(var r=1,n=0;n<255;n++)t[n]=r,e[r]=n,(r*=2)>=256&&(r^=301);return{LOG:e,ALOG:t}}([],[]),n.LOG),s=n.ALOG;!function(e){e[e.FORCE_NONE=0]="FORCE_NONE",e[e.FORCE_SQUARE=1]="FORCE_SQUARE",e[e.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"}(i||(i={}));var u=129,c=230,l=231,f=235,d=236,h=237,p=238,g=239,y=240,v=254,m=254,w="[)>05",b="[)>06",B="",C=0,E=1,S=2,I=3,O=4,F=5},44569(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(88919);t.toFinite=function(e){if(!e)return 0===e?e:0;if((e=n.toNumber(e))===1/0||e===-1/0){return(e<0?-1:1)*Number.MAX_VALUE}return e==e?e:0}},44905(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isObject=function(e){return null!==e&&("object"==typeof e||"function"==typeof e)}},45698(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(22593);const i=function(){function e(e){this.information=e,this.generalDecoder=new n.A(e)}return e.prototype.getInformation=function(){return this.information},e.prototype.getGeneralDecoder=function(){return this.generalDecoder},e}()},45700(e,t,r){"use strict";var n=r(70511),i=r(58242);n("toPrimitive"),i()},45721(e,t,r){"use strict";r.d(t,{b:()=>a});var n=r(96540),i=r(26960),A=r(72685),o=["axis"],a=(0,n.forwardRef)((e,t)=>n.createElement(A.P,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:o,tooltipPayloadSearcher:i.uN,categoricalChartProps:e,ref:t}))},45806(e,t,r){"use strict";r(47764);var n,i=r(46518),A=r(43724),o=r(67416),a=r(44576),s=r(76080),u=r(79504),c=r(36840),l=r(62106),f=r(90679),d=r(39297),h=r(44213),p=r(97916),g=r(67680),y=r(68183).codeAt,v=r(3717),m=r(655),w=r(10687),b=r(22812),B=r(98406),C=r(91181),E=C.set,S=C.getterFor("URL"),I=B.URLSearchParams,O=B.getState,F=a.URL,_=a.TypeError,x=a.parseInt,U=Math.floor,Q=Math.pow,T=u("".charAt),M=u(/./.exec),P=u([].join),D=u(1.1.toString),k=u([].pop),N=u([].push),R=u("".replace),L=u([].shift),H=u("".split),j=u("".slice),V=u("".toLowerCase),K=u([].unshift),z="Invalid scheme",G="Invalid host",W="Invalid port",X=/[a-z]/i,Y=/[\d+-.a-z]/i,Z=/\d/,q=/^0x/i,J=/^[0-7]+$/,$=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,ie=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ae=/[\t\n\r]/g,oe=function(e){var t,r,n,i;if("number"==typeof e){for(t=[],r=0;r<4;r++)K(t,e%256),e=U(e/256);return P(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,i=0,A=0;A<8;A++)0!==e[A]?(i>r&&(t=n,r=i),n=null,i=0):(null===n&&(n=A),++i);return i>r?n:t}(e),r=0;r<8;r++)i&&0===e[r]||(i&&(i=!1),n===r?(t+=r?":":"::",i=!0):(t+=D(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},ae={},se=h({},ae,{" ":1,'"':1,"<":1,">":1,"`":1}),ue=h({},se,{"#":1,"?":1,"{":1,"}":1}),ce=h({},ue,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),le=function(e,t){var r=y(e,0);return r>32&&r<127&&!d(t,e)?e:encodeURIComponent(e)},fe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},de=function(e,t){var r;return 2===e.length&&M(X,T(e,0))&&(":"===(r=T(e,1))||!t&&"|"===r)},he=function(e){var t;return e.length>1&&de(j(e,0,2))&&(2===e.length||"/"===(t=T(e,2))||"\\"===t||"?"===t||"#"===t)},pe=function(e){return"."===e||"%2e"===V(e)},ge=function(e){return".."===(e=V(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},ye={},ve={},me={},we={},be={},Be={},Ce={},Ee={},Se={},Ie={},Oe={},Fe={},_e={},xe={},Ue={},Qe={},Te={},Me={},Pe={},De={},ke={},Ne=function(e,t,r){var n,i,A,o=m(e);if(t){if(i=this.parse(o))throw new _(i);this.searchParams=null}else{if(void 0!==r&&(n=new Ne(r,!0)),i=this.parse(o,null,n))throw new _(i);(A=O(new I)).bindURL(this),this.searchParams=A}};Ne.prototype={type:"URL",parse:function(e,t,r){var i,A,o,a,s=this,u=t||ye,c=0,l="",f=!1,h=!1,y=!1;for(e=m(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=R(e,ne,""),e=R(e,ie,"$1")),e=R(e,Ae,""),i=p(e);c<=i.length;){switch(A=i[c],u){case ye:if(!A||!M(X,A)){if(t)return z;u=me;continue}l+=V(A),u=ve;break;case ve:if(A&&(M(Y,A)||"+"===A||"-"===A||"."===A))l+=V(A);else{if(":"!==A){if(t)return z;l="",u=me,c=0;continue}if(t&&(s.isSpecial()!==d(fe,l)||"file"===l&&(s.includesCredentials()||null!==s.port)||"file"===s.scheme&&!s.host))return;if(s.scheme=l,t)return void(s.isSpecial()&&fe[s.scheme]===s.port&&(s.port=null));l="","file"===s.scheme?u=xe:s.isSpecial()&&r&&r.scheme===s.scheme?u=we:s.isSpecial()?u=Ee:"/"===i[c+1]?(u=be,c++):(s.cannotBeABaseURL=!0,N(s.path,""),u=Pe)}break;case me:if(!r||r.cannotBeABaseURL&&"#"!==A)return z;if(r.cannotBeABaseURL&&"#"===A){s.scheme=r.scheme,s.path=g(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,u=ke;break}u="file"===r.scheme?xe:Be;continue;case we:if("/"!==A||"/"!==i[c+1]){u=Be;continue}u=Se,c++;break;case be:if("/"===A){u=Ie;break}u=Me;continue;case Be:if(s.scheme=r.scheme,A===n)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=g(r.path),s.query=r.query;else if("/"===A||"\\"===A&&s.isSpecial())u=Ce;else if("?"===A)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=g(r.path),s.query="",u=De;else{if("#"!==A){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=g(r.path),s.path.length--,u=Me;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=g(r.path),s.query=r.query,s.fragment="",u=ke}break;case Ce:if(!s.isSpecial()||"/"!==A&&"\\"!==A){if("/"!==A){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,u=Me;continue}u=Ie}else u=Se;break;case Ee:if(u=Se,"/"!==A||"/"!==T(l,c+1))continue;c++;break;case Se:if("/"!==A&&"\\"!==A){u=Ie;continue}break;case Ie:if("@"===A){f&&(l="%40"+l),f=!0,o=p(l);for(var v=0;v<o.length;v++){var w=o[v];if(":"!==w||y){var b=le(w,ce);y?s.password+=b:s.username+=b}else y=!0}l=""}else if(A===n||"/"===A||"?"===A||"#"===A||"\\"===A&&s.isSpecial()){if(f&&""===l)return"Invalid authority";c-=p(l).length+1,l="",u=Oe}else l+=A;break;case Oe:case Fe:if(t&&"file"===s.scheme){u=Qe;continue}if(":"!==A||h){if(A===n||"/"===A||"?"===A||"#"===A||"\\"===A&&s.isSpecial()){if(s.isSpecial()&&""===l)return G;if(t&&""===l&&(s.includesCredentials()||null!==s.port))return;if(a=s.parseHost(l))return a;if(l="",u=Te,t)return;continue}"["===A?h=!0:"]"===A&&(h=!1),l+=A}else{if(""===l)return G;if(a=s.parseHost(l))return a;if(l="",u=_e,t===Fe)return}break;case _e:if(!M(Z,A)){if(A===n||"/"===A||"?"===A||"#"===A||"\\"===A&&s.isSpecial()||t){if(""!==l){var B=x(l,10);if(B>65535)return W;s.port=s.isSpecial()&&B===fe[s.scheme]?null:B,l=""}if(t)return;u=Te;continue}return W}l+=A;break;case xe:if(s.scheme="file","/"===A||"\\"===A)u=Ue;else{if(!r||"file"!==r.scheme){u=Me;continue}switch(A){case n:s.host=r.host,s.path=g(r.path),s.query=r.query;break;case"?":s.host=r.host,s.path=g(r.path),s.query="",u=De;break;case"#":s.host=r.host,s.path=g(r.path),s.query=r.query,s.fragment="",u=ke;break;default:he(P(g(i,c),""))||(s.host=r.host,s.path=g(r.path),s.shortenPath()),u=Me;continue}}break;case Ue:if("/"===A||"\\"===A){u=Qe;break}r&&"file"===r.scheme&&!he(P(g(i,c),""))&&(de(r.path[0],!0)?N(s.path,r.path[0]):s.host=r.host),u=Me;continue;case Qe:if(A===n||"/"===A||"\\"===A||"?"===A||"#"===A){if(!t&&de(l))u=Me;else if(""===l){if(s.host="",t)return;u=Te}else{if(a=s.parseHost(l))return a;if("localhost"===s.host&&(s.host=""),t)return;l="",u=Te}continue}l+=A;break;case Te:if(s.isSpecial()){if(u=Me,"/"!==A&&"\\"!==A)continue}else if(t||"?"!==A)if(t||"#"!==A){if(A!==n&&(u=Me,"/"!==A))continue}else s.fragment="",u=ke;else s.query="",u=De;break;case Me:if(A===n||"/"===A||"\\"===A&&s.isSpecial()||!t&&("?"===A||"#"===A)){if(ge(l)?(s.shortenPath(),"/"===A||"\\"===A&&s.isSpecial()||N(s.path,"")):pe(l)?"/"===A||"\\"===A&&s.isSpecial()||N(s.path,""):("file"===s.scheme&&!s.path.length&&de(l)&&(s.host&&(s.host=""),l=T(l,0)+":"),N(s.path,l)),l="","file"===s.scheme&&(A===n||"?"===A||"#"===A))for(;s.path.length>1&&""===s.path[0];)L(s.path);"?"===A?(s.query="",u=De):"#"===A&&(s.fragment="",u=ke)}else l+=le(A,ue);break;case Pe:"?"===A?(s.query="",u=De):"#"===A?(s.fragment="",u=ke):A!==n&&(s.path[0]+=le(A,ae));break;case De:t||"#"!==A?A!==n&&("'"===A&&s.isSpecial()?s.query+="%27":s.query+="#"===A?"%23":le(A,ae)):(s.fragment="",u=ke);break;case ke:A!==n&&(s.fragment+=le(A,se))}c++}},parseHost:function(e){var t,r,n;if("["===T(e,0)){if("]"!==T(e,e.length-1))return G;if(t=function(e){var t,r,n,i,A,o,a,s=[0,0,0,0,0,0,0,0],u=0,c=null,l=0,f=function(){return T(e,l)};if(":"===f()){if(":"!==T(e,1))return;l+=2,c=++u}for(;f();){if(8===u)return;if(":"!==f()){for(t=r=0;r<4&&M(ee,f());)t=16*t+x(f(),16),l++,r++;if("."===f()){if(0===r)return;if(l-=r,u>6)return;for(n=0;f();){if(i=null,n>0){if(!("."===f()&&n<4))return;l++}if(!M(Z,f()))return;for(;M(Z,f());){if(A=x(f(),10),null===i)i=A;else{if(0===i)return;i=10*i+A}if(i>255)return;l++}s[u]=256*s[u]+i,2!==++n&&4!==n||u++}if(4!==n)return;break}if(":"===f()){if(l++,!f())return}else if(f())return;s[u++]=t}else{if(null!==c)return;l++,c=++u}}if(null!==c)for(o=u-c,u=7;0!==u&&o>0;)a=s[u],s[u--]=s[c+o-1],s[c+--o]=a;else if(8!==u)return;return s}(j(e,1,-1)),!t)return G;this.host=t}else if(this.isSpecial()){if(e=v(e),M(te,e))return G;if(t=function(e){var t,r,n,i,A,o,a,s=H(e,".");if(s.length&&""===s[s.length-1]&&s.length--,(t=s.length)>4)return e;for(r=[],n=0;n<t;n++){if(""===(i=s[n]))return e;if(A=10,i.length>1&&"0"===T(i,0)&&(A=M(q,i)?16:8,i=j(i,8===A?1:2)),""===i)o=0;else{if(!M(10===A?$:8===A?J:ee,i))return e;o=x(i,A)}N(r,o)}for(n=0;n<t;n++)if(o=r[n],n===t-1){if(o>=Q(256,5-t))return null}else if(o>255)return null;for(a=k(r),n=0;n<r.length;n++)a+=r[n]*Q(256,3-n);return a}(e),null===t)return G;this.host=t}else{if(M(re,e))return G;for(t="",r=p(e),n=0;n<r.length;n++)t+=le(r[n],ae);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return d(fe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&de(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,i=e.host,A=e.port,o=e.path,a=e.query,s=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=oe(i),null!==A&&(u+=":"+A)):"file"===t&&(u+="//"),u+=e.cannotBeABaseURL?o[0]:o.length?"/"+P(o,"/"):"",null!==a&&(u+="?"+a),null!==s&&(u+="#"+s),u},setHref:function(e){var t=this.parse(e);if(t)throw new _(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Re(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+oe(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(m(e)+":",ye)},getUsername:function(){return this.username},setUsername:function(e){var t=p(m(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=le(t[r],ce)}},getPassword:function(){return this.password},setPassword:function(e){var t=p(m(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=le(t[r],ce)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?oe(e):oe(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Oe)},getHostname:function(){var e=this.host;return null===e?"":oe(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Fe)},getPort:function(){var e=this.port;return null===e?"":m(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=m(e))?this.port=null:this.parse(e,_e))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+P(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Te))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=m(e))?this.query=null:("?"===T(e,0)&&(e=j(e,1)),this.query="",this.parse(e,De)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=m(e))?("#"===T(e,0)&&(e=j(e,1)),this.fragment="",this.parse(e,ke)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Re=function(e){var t=f(this,Le),r=b(arguments.length,1)>1?arguments[1]:void 0,n=E(t,new Ne(e,!1,r));A||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},Le=Re.prototype,He=function(e,t){return{get:function(){return S(this)[e]()},set:t&&function(e){return S(this)[t](e)},configurable:!0,enumerable:!0}};if(A&&(l(Le,"href",He("serialize","setHref")),l(Le,"origin",He("getOrigin")),l(Le,"protocol",He("getProtocol","setProtocol")),l(Le,"username",He("getUsername","setUsername")),l(Le,"password",He("getPassword","setPassword")),l(Le,"host",He("getHost","setHost")),l(Le,"hostname",He("getHostname","setHostname")),l(Le,"port",He("getPort","setPort")),l(Le,"pathname",He("getPathname","setPathname")),l(Le,"search",He("getSearch","setSearch")),l(Le,"searchParams",He("getSearchParams")),l(Le,"hash",He("getHash","setHash"))),c(Le,"toJSON",function(){return S(this).serialize()},{enumerable:!0}),c(Le,"toString",function(){return S(this).serialize()},{enumerable:!0}),F){var je=F.createObjectURL,Ve=F.revokeObjectURL;je&&c(Re,"createObjectURL",s(je,F)),Ve&&c(Re,"revokeObjectURL",s(Ve,F))}w(Re,"URL"),i({global:!0,constructor:!0,forced:!o,sham:!A},{URL:Re})},45917(e,t,r){"use strict";r.d(t,{A:()=>n});Array.prototype.slice;function n(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}},46121(e,t,r){"use strict";r.d(t,{BrowserQRCodeReader:()=>Q});var n,i=r(15747),A=r(26317),o=r(43407),a=r(65189),s=r(31327),u=r(58503),c=r(75359),l=r(44388),f=r(57149),d=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),h=function(e){function t(r,n){void 0===n&&(n=!1);var i=e.call(this,r.width,r.height)||this;return i.canvas=r,i.tempCanvasElement=null,i.buffer=t.makeBufferFromCanvasImageData(r,n),i}return d(t,e),t.makeBufferFromCanvasImageData=function(e,r){void 0===r&&(r=!1);var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height,r)},t.toGrayscaleBuffer=function(e,r,n,i){void 0===i&&(i=!1);var A=new Uint8ClampedArray(r*n);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX||!i)for(var o=0,a=0,s=e.length;o<s;o+=4,a++){var u=void 0;if(0===e[o+3])u=255;else u=306*e[o]+601*e[o+1]+117*e[o+2]+512>>10;A[a]=u}else{o=0,a=0;for(var c=e.length;o<c;o+=4,a++){u=void 0;if(0===e[o+3])u=255;else u=306*e[o]+601*e[o+1]+117*e[o+2]+512>>10;A[a]=255-u}}return A},t.prototype.getRow=function(e,t){if(e<0||e>=this.getHeight())throw new f.A("Requested row is outside the image: "+e);var r=this.getWidth(),n=e*r;return null===t?t=this.buffer.slice(n,n+r):(t.length<r&&(t=new Uint8ClampedArray(r)),t.set(this.buffer.slice(n,n+r))),t},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(t,r,n,i){return e.prototype.crop.call(this,t,r,n,i),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var r=this.getTempCanvasElement(),n=r.getContext("2d"),i=e*t.DEGREE_TO_RADIANS,A=this.canvas.width,o=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(i))*A+Math.abs(Math.sin(i))*o),s=Math.ceil(Math.abs(Math.sin(i))*A+Math.abs(Math.cos(i))*o);return r.width=a,r.height=s,n.translate(a/2,s/2),n.rotate(i),n.drawImage(this.canvas,A/-2,o/-2),this.buffer=t.makeBufferFromCanvasImageData(r),this},t.prototype.invert=function(){return new c.A(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(l.A),p=function(){function e(e,t,r){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=r||void 0}return e.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},e}(),g=function(e,t,r,n){return new(r||(r=Promise))(function(i,A){function o(e){try{s(n.next(e))}catch(e){A(e)}}function a(e){try{s(n.throw(e))}catch(e){A(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,a)}s((n=n.apply(e,t||[])).next())})},y=function(e,t){var r,n,i,A,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return A={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(A[Symbol.iterator]=function(){return this}),A;function a(A){return function(a){return function(A){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&A[0]?n.return:A[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,A[1])).done)return i;switch(n=0,i&&(A=[2&A[0],i.value]),A[0]){case 0:case 1:i=A;break;case 4:return o.label++,{value:A[1],done:!1};case 5:o.label++,n=A[1],A=[0];continue;case 7:A=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==A[0]&&2!==A[0])){o=0;continue}if(3===A[0]&&(!i||A[1]>i[0]&&A[1]<i[3])){o.label=A[1];break}if(6===A[0]&&o.label<i[1]){o.label=i[1],i=A;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(A);break}i[2]&&o.ops.pop(),o.trys.pop();continue}A=t.call(e,o)}catch(e){A=[6,e],n=0}finally{r=i=0}if(5&A[0])throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}([A,a])}}},v=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},m=function(){function e(e,t,r){void 0===t&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(e.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),e.prototype.listVideoInputDevices=function(){return g(this,void 0,void 0,function(){var e,t,r,n,i,A,o,a,s,u,c,l;return y(this,function(f){switch(f.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=f.sent(),t=[];try{for(r=v(e),n=r.next();!n.done;n=r.next())i=n.value,"videoinput"===(A="video"===i.kind?"videoinput":i.kind)&&(o=i.deviceId||i.id,a=i.label||"Video device "+(t.length+1),s=i.groupId,u={deviceId:o,label:a,kind:A,groupId:s},t.push(u))}catch(e){c={error:e}}finally{try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(c)throw c.error}}return[2,t]}})})},e.prototype.getVideoInputDevices=function(){return g(this,void 0,void 0,function(){return y(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map(function(e){return new p(e.deviceId,e.label)})]}})})},e.prototype.findDeviceById=function(e){return g(this,void 0,void 0,function(){var t;return y(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(t=r.sent())?[2,t.find(function(t){return t.deviceId===e})]:[2,null]}})})},e.prototype.decodeFromInputVideoDevice=function(e,t){return g(this,void 0,void 0,function(){return y(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,r.sent()]}})})},e.prototype.decodeOnceFromVideoDevice=function(e,t){return g(this,void 0,void 0,function(){var r;return y(this,function(n){switch(n.label){case 0:return this.reset(),r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,t)];case 1:return[2,n.sent()]}})})},e.prototype.decodeOnceFromConstraints=function(e,t){return g(this,void 0,void 0,function(){var r;return y(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,t)];case 2:return[2,n.sent()]}})})},e.prototype.decodeOnceFromStream=function(e,t){return g(this,void 0,void 0,function(){var r;return y(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},e.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,r){return g(this,void 0,void 0,function(){return y(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(e,t,r)];case 1:return[2,n.sent()]}})})},e.prototype.decodeFromVideoDevice=function(e,t,r){return g(this,void 0,void 0,function(){var n;return y(this,function(i){switch(i.label){case 0:return n={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,t,r)];case 1:return[2,i.sent()]}})})},e.prototype.decodeFromConstraints=function(e,t,r){return g(this,void 0,void 0,function(){var n;return y(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=i.sent(),[4,this.decodeFromStream(n,t,r)];case 2:return[2,i.sent()]}})})},e.prototype.decodeFromStream=function(e,t,r){return g(this,void 0,void 0,function(){var n;return y(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=i.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,i.sent()]}})})},e.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},e.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},e.prototype.attachStreamToVideo=function(e,t){return g(this,void 0,void 0,function(){var r;return y(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(t),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}})})},e.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(r,n){return t.playVideoOnLoad(e,function(){return r()})})},e.prototype.playVideoOnLoad=function(e,t){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)},e.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},e.prototype.tryPlayVideo=function(e){return g(this,void 0,void 0,function(){return y(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},e.prototype.getMediaElement=function(e,t){var r=document.getElementById(e);if(!r)throw new i.A("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==t.toLowerCase())throw new i.A("element with id '"+e+"' must be an "+t+" element");return r},e.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new i.A("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},e.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new i.A("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},e.prototype.decodeFromVideoContinuously=function(e,t,r){if(void 0===e&&void 0===t)throw new i.A("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,r):this.decodeFromVideoElementContinuously(e,r)},e.prototype.decodeFromImageElement=function(e){if(!e)throw new i.A("An image element must be provided.");this.reset();var t=this.prepareImageElement(e);return this.imageElement=t,this.isImageLoaded(t)?this.decodeOnce(t,!1,!0):this._decodeOnLoadImage(t)},e.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},e.prototype.decodeFromVideoElementContinuously=function(e,t){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,t)},e.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new i.A("A video element must be provided.");this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},e.prototype.decodeFromImageUrl=function(e){if(!e)throw new i.A("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var r=this._decodeOnLoadImage(t);return t.src=e,r},e.prototype.decodeFromVideoUrl=function(e){if(!e)throw new i.A("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),r=this.decodeFromVideoElement(t);return t.src=e,r},e.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new i.A("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,t);return r.src=e,n},e.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(r,n){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(r,n)},e.addEventListener("load",t.imageLoadedListener)})},e.prototype._decodeOnLoadVideo=function(e){return g(this,void 0,void 0,function(){return y(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},e.prototype._decodeOnLoadVideoContinuously=function(e,t){return g(this,void 0,void 0,function(){return y(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,t),[2]}})})},e.prototype.isImageLoaded=function(e){return!!e.complete&&0!==e.naturalWidth},e.prototype.prepareImageElement=function(e){var t;return void 0===e&&((t=document.createElement("img")).width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},e.prototype.prepareVideoElement=function(e){var t;return e||"undefined"==typeof document||((t=document.createElement("video")).width=200,t.height=200),"string"==typeof e&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},e.prototype.decodeOnce=function(e,t,r){var n=this;void 0===t&&(t=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var i=function(A,a){if(n._stopAsyncDecode)return a(new u.A("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{A(n.decode(e))}catch(e){var c=t&&e instanceof u.A,l=e instanceof o.A||e instanceof s.A;if(c||l&&r)return setTimeout(i,n._timeBetweenDecodingAttempts,A,a);a(e)}};return new Promise(function(e,t){return i(e,t)})},e.prototype.decodeContinuously=function(e,t){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(e);t(i,null),setTimeout(n,r.timeBetweenScansMillis)}catch(e){t(null,e);var A=e instanceof o.A||e instanceof s.A,a=e instanceof u.A;(A||a)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},e.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},e.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e);var t=!1;e instanceof HTMLVideoElement?(this.drawFrameOnCanvas(e),t=!0):this.drawImageOnCanvas(e);var r=this.getCaptureCanvas(e),n=new h(r,t),i=new a.A(n);return new A.A(i)},e.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),r=void 0;try{r=t.getContext("2d",{willReadFrequently:!0})}catch(e){r=t.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext},e.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},e.prototype.drawFrameOnCanvas=function(e,t,r){void 0===t&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.drawImageOnCanvas=function(e,t,r){void 0===t&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},e.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},e.prototype.createCaptureCanvas=function(e){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var t,r,n=document.createElement("canvas");return void 0!==e&&(e instanceof HTMLVideoElement?(t=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(t=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),n.style.width=t+"px",n.style.height=r+"px",n.width=t,n.height=r,n},e.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},e.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},e.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},e.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},e.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},e.prototype.addVideoSource=function(e,t){try{e.srcObject=t}catch(r){e.src=URL.createObjectURL(t)}},e.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch(t){e.src=""}this.videoElement.removeAttribute("src")},e}(),w=r(59363),b=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),B=(function(e){function t(t){return void 0===t&&(t=500),e.call(this,new w.A,t)||this}b(t,e)}(m),r(68271)),C=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E=(function(e){function t(t,r){return void 0===t&&(t=500),e.call(this,new B.A(r),t,r)||this}C(t,e)}(m),r(6228)),S=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=(function(e){function t(t){return void 0===t&&(t=500),e.call(this,new E.A,t)||this}S(t,e)}(m),r(15482)),O=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),F=(function(e){function t(t,r){void 0===t&&(t=null),void 0===r&&(r=500);var n=new I.A;return n.setHints(t),e.call(this,n,r)||this}O(t,e),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)}}(m),r(1458)),_=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),x=(function(e){function t(t){return void 0===t&&(t=500),e.call(this,new F.A,t)||this}_(t,e)}(m),r(26818)),U=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Q=function(e){function t(t){return void 0===t&&(t=500),e.call(this,new x.A,t)||this}return U(t,e),t}(m),T=r(73608),M=r(53637),P=r(52185),D=r(59379);!function(){function e(){}e.prototype.write=function(t,r,n,i){if(void 0===i&&(i=null),0===t.length)throw new f.A("Found empty contents");if(r<0||n<0)throw new f.A("Requested dimensions are too small: "+r+"x"+n);var A=P.A.L,o=e.QUIET_ZONE_SIZE;null!==i&&(void 0!==i.get(T.A.ERROR_CORRECTION)&&(A=P.A.fromString(i.get(T.A.ERROR_CORRECTION).toString())),void 0!==i.get(T.A.MARGIN)&&(o=Number.parseInt(i.get(T.A.MARGIN).toString(),10)));var a=M.A.encode(t,A,i);return this.renderResult(a,r,n,o)},e.prototype.writeToDom=function(e,t,r,n,i){void 0===i&&(i=null),"string"==typeof e&&(e=document.querySelector(e));var A=this.write(t,r,n,i);e&&e.appendChild(A)},e.prototype.renderResult=function(e,t,r,n){var i=e.getMatrix();if(null===i)throw new D.A;for(var A=i.getWidth(),o=i.getHeight(),a=A+2*n,s=o+2*n,u=Math.max(t,a),c=Math.max(r,s),l=Math.min(Math.floor(u/a),Math.floor(c/s)),f=Math.floor((u-A*l)/2),d=Math.floor((c-o*l)/2),h=this.createSVGElement(u,c),p=0,g=d;p<o;p++,g+=l)for(var y=0,v=f;y<A;y++,v+=l)if(1===i.get(y,p)){var m=this.createSvgRectElement(v,g,l,l);h.appendChild(m)}return h},e.prototype.createSVGElement=function(t,r){var n=document.createElementNS(e.SVG_NS,"svg");return n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",r.toString()),n},e.prototype.createSvgRectElement=function(t,r,n,i){var A=document.createElementNS(e.SVG_NS,"rect");return A.setAttributeNS(null,"x",t.toString()),A.setAttributeNS(null,"y",r.toString()),A.setAttributeNS(null,"height",n.toString()),A.setAttributeNS(null,"width",i.toString()),A.setAttributeNS(null,"fill","#000000"),A},e.QUIET_ZONE_SIZE=4,e.SVG_NS="http://www.w3.org/2000/svg"}()},46446(e,t,r){"use strict";r.d(t,{LV:()=>s,M:()=>o,hq:()=>A});var n={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},i=(0,r(65307).Z0)({name:"chartData",initialState:n,reducers:{setChartData(e,t){if(e.chartData=t.payload,null==t.payload)return e.dataStartIndex=0,void(e.dataEndIndex=0);t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;null!=r&&(e.dataStartIndex=r),null!=n&&(e.dataEndIndex=n)}}}),{setChartData:A,setDataStartEndIndexes:o,setComputedData:a}=i.actions,s=i.reducer},46539(e,t,r){"use strict";r.d(t,{m:()=>ye});var n=r(96540),i=r(40961),A=r(60184),o=r.n(A),a=r(34164),s=r(59744);function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(null,arguments)}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){f(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function f(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return Array.isArray(e)&&(0,s.vh)(e[0])&&(0,s.vh)(e[1])?e.join(" ~ "):e}var h=e=>{var{separator:t=" : ",contentStyle:r={},itemStyle:i={},labelStyle:A={},payload:c,formatter:f,itemSorter:h,wrapperClassName:p,labelClassName:g,label:y,labelFormatter:v,accessibilityLayer:m=!1}=e,w=l({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},r),b=l({margin:0},A),B=!(0,s.uy)(y),C=B?y:"",E=(0,a.$)("recharts-default-tooltip",p),S=(0,a.$)("recharts-tooltip-label",g);B&&v&&null!=c&&(C=v(y,c));var I=m?{role:"status","aria-live":"assertive"}:{};return n.createElement("div",u({className:E,style:w},I),n.createElement("p",{className:S,style:b},n.isValidElement(C)?C:"".concat(C)),(()=>{if(c&&c.length){var e=(h?o()(c,h):c).map((e,r)=>{if("none"===e.type)return null;var A=e.formatter||f||d,{value:o,name:a}=e,u=o,h=a;if(A){var p=A(o,a,e,r,c);if(Array.isArray(p))[u,h]=p;else{if(null==p)return null;u=p}}var g=l({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},i);return n.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(r),style:g},(0,s.vh)(h)?n.createElement("span",{className:"recharts-tooltip-item-name"},h):null,(0,s.vh)(h)?n.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,n.createElement("span",{className:"recharts-tooltip-item-value"},u),n.createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return n.createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null})())},p="recharts-tooltip-wrapper",g={visibility:"hidden"};function y(e){var{coordinate:t,translateX:r,translateY:n}=e;return(0,a.$)(p,{["".concat(p,"-right")]:(0,s.Et)(r)&&t&&(0,s.Et)(t.x)&&r>=t.x,["".concat(p,"-left")]:(0,s.Et)(r)&&t&&(0,s.Et)(t.x)&&r<t.x,["".concat(p,"-bottom")]:(0,s.Et)(n)&&t&&(0,s.Et)(t.y)&&n>=t.y,["".concat(p,"-top")]:(0,s.Et)(n)&&t&&(0,s.Et)(t.y)&&n<t.y})}function v(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offsetTopLeft:i,position:A,reverseDirection:o,tooltipDimension:a,viewBox:u,viewBoxDimension:c}=e;if(A&&(0,s.Et)(A[n]))return A[n];var l=r[n]-a-(i>0?i:0),f=r[n]+i;if(t[n])return o[n]?l:f;var d=u[n];return null==d?0:o[n]?l<d?Math.max(f,d):Math.max(l,d):null==c?0:f+a>d+c?Math.max(l,d):Math.max(f,d)}function m(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach(function(t){b(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function b(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class B extends n.PureComponent{constructor(){super(...arguments),b(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),b(this,"handleKeyDown",e=>{var t,r,n,i;"Escape"===e.key&&this.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(t=null===(r=this.props.coordinate)||void 0===r?void 0:r.x)&&void 0!==t?t:0,y:null!==(n=null===(i=this.props.coordinate)||void 0===i?void 0:i.y)&&void 0!==n?n:0}})})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var e,t;this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}render(){var{active:e,allowEscapeViewBox:t,animationDuration:r,animationEasing:i,children:A,coordinate:o,hasPayload:a,isAnimationActive:s,offset:u,position:c,reverseDirection:l,useTranslate3d:f,viewBox:d,wrapperStyle:h,lastBoundingBox:p,innerRef:m,hasPortalFromProps:b}=this.props,{cssClasses:B,cssProperties:C}=function(e){var t,r,n,{allowEscapeViewBox:i,coordinate:A,offsetTopLeft:o,position:a,reverseDirection:s,tooltipBox:u,useTranslate3d:c,viewBox:l}=e;return t=u.height>0&&u.width>0&&A?function(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}({translateX:r=v({allowEscapeViewBox:i,coordinate:A,key:"x",offsetTopLeft:o,position:a,reverseDirection:s,tooltipDimension:u.width,viewBox:l,viewBoxDimension:l.width}),translateY:n=v({allowEscapeViewBox:i,coordinate:A,key:"y",offsetTopLeft:o,position:a,reverseDirection:s,tooltipDimension:u.height,viewBox:l,viewBoxDimension:l.height}),useTranslate3d:c}):g,{cssProperties:t,cssClasses:y({translateX:r,translateY:n,coordinate:A})}}({allowEscapeViewBox:t,coordinate:o,offsetTopLeft:u,position:c,reverseDirection:l,tooltipBox:{height:p.height,width:p.width},useTranslate3d:f,viewBox:d}),E=b?{}:w(w({transition:s&&e?"transform ".concat(r,"ms ").concat(i):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&e&&a?"visible":"hidden",position:"absolute",top:0,left:0}),S=w(w({},E),{},{visibility:!this.state.dismissed&&e&&a?"visible":"hidden"},h);return n.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:B,style:S,ref:m},A)}}var C=r(79799),E=r(19287),S=r(32945),I=r(66583),O=r(98940),F=r(29705),_=r(80196),x=["x","y","top","left","width","height","className"];function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},U.apply(null,arguments)}function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M=(e,t,r,n,i,A)=>"M".concat(e,",").concat(i,"v").concat(n,"M").concat(A,",").concat(t,"h").concat(r),P=e=>{var{x:t=0,y:r=0,top:i=0,left:A=0,width:o=0,height:u=0,className:c}=e,l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach(function(t){T(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({x:t,y:r,top:i,left:A,width:o,height:u},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,x));return(0,s.Et)(t)&&(0,s.Et)(r)&&(0,s.Et)(o)&&(0,s.Et)(u)&&(0,s.Et)(i)&&(0,s.Et)(A)?n.createElement("path",U({},(0,_.a)(l),{className:(0,a.$)("recharts-cross",c),d:M(t,r,o,u,i,A)})):null};var D=r(34723),k=r(14040);function N(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:A}=e;return{points:[(0,k.IZ)(t,r,n,i),(0,k.IZ)(t,r,n,A)],cx:t,cy:r,radius:n,startAngle:i,endAngle:A}}var R=r(58522);function L(e,t,r){if("horizontal"===e)return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if("vertical"===e)return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if((0,O.TT)(t)){if("centric"===e){var{cx:n,cy:i,innerRadius:A,outerRadius:o,angle:a}=t,s=(0,k.IZ)(n,i,A,a),u=(0,k.IZ)(n,i,o,a);return[{x:s.x,y:s.y},{x:u.x,y:u.y}]}return N(t)}}var H=r(49082),j=r(26470),V=r(91572),K=r(33032);function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function G(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach(function(t){W(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function W(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var X=()=>{var e=(0,H.G)(V.Dn),t=(0,H.G)(K.R4),r=(0,H.G)(K.fl);return e&&r?(0,j.Hj)(G(G({},e),{},{scale:r}),t):(0,j.Hj)(void 0,t)},Y=r(49259),Z=r(55448),q=r(27132),J=r(60648);function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(null,arguments)}function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach(function(t){re(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function re(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){var{cursor:t,cursorComp:r,cursorProps:i}=e;return(0,n.isValidElement)(t)?(0,n.cloneElement)(t,i):(0,n.createElement)(r,i)}function ie(e){var t,r,i,A,{coordinate:o,payload:s,index:u,offset:c,tooltipAxisBandSize:l,layout:f,cursor:d,tooltipEventType:h,chartName:p}=e,g=o,y=s,v=u;if(!d||!g||"ScatterChart"!==p&&"axis"!==h)return null;if("ScatterChart"===p)r=g,i=P,A=J.I.cursorLine;else if("BarChart"===p)r=function(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-i:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-i,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(f,g,c,l),i=D.M,A=J.I.cursorRectangle;else if("radial"===f&&(0,O.TT)(g)){var{cx:m,cy:w,radius:b,startAngle:B,endAngle:C}=N(g);r={cx:m,cy:w,startAngle:B,endAngle:C,innerRadius:b,outerRadius:b},i=R.h,A=J.I.cursorLine}else r={points:L(f,g,c)},i=F.I,A=J.I.cursorLine;var E="object"==typeof d&&"className"in d?d.className:void 0,S=te(te(te(te({stroke:"#ccc",pointerEvents:"none"},c),r),(0,Z.ic)(d)),{},{payload:y,payloadIndex:v,className:(0,a.$)("recharts-tooltip-cursor",E)});return n.createElement(q.g,{zIndex:null!==(t=e.zIndex)&&void 0!==t?t:A},n.createElement(ne,{cursor:d,cursorComp:i,cursorProps:S}))}function Ae(e){var t=X(),r=(0,E.W7)(),i=(0,E.WX)(),A=(0,Y.fW)();return null==t||null==r||null==i||null==A?null:n.createElement(ie,$({},e,{offset:r,layout:i,tooltipAxisBandSize:t,chartName:A}))}var oe=r(74354),ae=r(74531),se=r(94274),ue=r(55978),ce=r(77404);function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach(function(t){de(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function de(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function he(e){return e.dataKey}var pe=[],ge={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function ye(e){var t,r,A=(0,ce.e)(e,ge),{active:o,allowEscapeViewBox:a,animationDuration:s,animationEasing:u,content:c,filterNull:l,isAnimationActive:f,offset:d,payloadUniqBy:p,position:g,reverseDirection:y,useTranslate3d:v,wrapperStyle:m,cursor:w,shared:b,trigger:O,defaultIndex:F,portal:_,axisId:x}=A,U=(0,H.j)(),Q="number"==typeof F?String(F):F;(0,n.useEffect)(()=>{U((0,ae.UF)({shared:b,trigger:O,axisId:x,active:o,defaultIndex:Q}))},[U,b,O,x,o,Q]);var T=(0,E.sk)(),M=(0,S.$)(),P=(0,ue.Td)(b),{activeIndex:D,isActive:k}=null!==(t=(0,H.G)(e=>(0,Y.yn)(e,P,O,Q)))&&void 0!==t?t:{},N=(0,H.G)(e=>(0,Y.u9)(e,P,O,Q)),R=(0,H.G)(e=>(0,Y.BZ)(e,P,O,Q)),L=(0,H.G)(e=>(0,Y.dS)(e,P,O,Q)),j=N,V=(0,oe.X)(),K=null!==(r=null!=o?o:k)&&void 0!==r&&r,[z,G]=(0,I.V)([j,K]),W="axis"===P?R:void 0;(0,se.m7)(P,O,L,W,D,K);var X=null!=_?_:V;if(null==X||null==T||null==P)return null;var Z=null!=j?j:pe;K||(Z=pe),l&&Z.length&&(Z=(0,C.s)(Z.filter(e=>null!=e.value&&(!0!==e.hide||A.includeHidden)),p,he));var q=Z.length>0,J=n.createElement(B,{allowEscapeViewBox:a,animationDuration:s,animationEasing:u,isAnimationActive:f,active:K,coordinate:L,hasPayload:q,offset:d,position:g,reverseDirection:y,useTranslate3d:v,viewBox:T,wrapperStyle:m,lastBoundingBox:z,innerRef:G,hasPortalFromProps:Boolean(_)},function(e,t){return n.isValidElement(e)?n.cloneElement(e,t):"function"==typeof e?n.createElement(e,t):n.createElement(h,t)}(c,fe(fe({},A),{},{payload:Z,label:W,active:K,activeIndex:D,coordinate:L,accessibilityLayer:M})));return n.createElement(n.Fragment,null,(0,i.createPortal)(J,X),K&&n.createElement(Ae,{cursor:w,tooltipEventType:P,coordinate:L,payload:Z,index:D}))}},46668(e,t,r){"use strict";r.d(t,{yP:()=>Me,LP:()=>Qe});var n=r(96540),i=r(34164),A=r(86069),o=r(72050),a=r(5614),s=r(59744),u=r(94501),c=r(26470),l=r(98940),f="Invariant failed";var d=r(15079);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h.apply(null,arguments)}function p(e){return n.createElement(d.y,h({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(r,n)=>{if((0,s.Et)(e))return e;var i=(0,s.Et)(r)||(0,s.uy)(r);return i?e(r,n):(i||function(e){if(!e)throw new Error(f)}(!1,"minPointSize callback function received a value with type of ".concat(typeof r,". Currently only numbers or null/undefined are supported.")),t)}},y=r(58008),v=r(59482),m=r(5298),w=r(31754),b=r(19287),B=r(25508),C=r(91572),E=r(98453),S=r(36189),I=r(82695),O=r(9531),F=(e,t,r)=>{var n=null!=r?r:e;if(!(0,s.uy)(n))return(0,s.F4)(n,t,0)},_=r(8813);function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach(function(t){Q(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Q(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var T=r(72925),M=r(94115);function P(e,t){var r,n;return null!==(r=null===(n=e.graphicalItems.cartesianItems.find(e=>e.id===t))||void 0===n?void 0:n.xAxisId)&&void 0!==r?r:M.W3}function D(e,t){var r,n;return null!==(r=null===(n=e.graphicalItems.cartesianItems.find(e=>e.id===t))||void 0===n?void 0:n.yAxisId)&&void 0!==r?r:M.W3}var k=(0,B.Mz)([C.ld,(e,t)=>t],(e,t)=>e.filter(e=>"bar"===e.type).find(e=>e.id===t)),N=(0,B.Mz)([k],e=>null==e?void 0:e.maxBarSize),R=(0,B.Mz)([b.fz,C.ld,P,D,(e,t,r)=>r],(e,t,r,n,i)=>t.filter(t=>"horizontal"===e?t.xAxisId===r:t.yAxisId===n).filter(e=>e.isPanorama===i).filter(e=>!1===e.hide).filter(e=>"bar"===e.type)),L=(0,B.Mz)([R,I.x3,(e,t)=>{var r=(0,b.fz)(e),n=P(e,t),i=D(e,t);if(null!=n&&null!=i)return"horizontal"===r?(0,C.BQ)(e,"xAxis",n):(0,C.BQ)(e,"yAxis",i)}],(e,t,r)=>{var n=e.filter(O.g),i=e.filter(e=>null==e.stackId),A=n.reduce((e,t)=>(e[t.stackId]||(e[t.stackId]=[]),e[t.stackId].push(t),e),{});return[...Object.entries(A).map(e=>{var[n,i]=e;return{stackId:n,dataKeys:i.map(e=>e.dataKey),barSize:F(t,r,i[0].barSize)}}),...i.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>null!=e),barSize:F(t,r,e.barSize)}))]}),H=(e,t,r)=>{var n,i,A=(0,b.fz)(e),o=P(e,t),a=D(e,t);if(null!=o&&null!=a)return"horizontal"===A?(n=(0,C.Gx)(e,"xAxis",o,r),i=(0,C.CR)(e,"xAxis",o,r)):(n=(0,C.Gx)(e,"yAxis",a,r),i=(0,C.CR)(e,"yAxis",a,r)),(0,c.Hj)(n,i)},j=(0,B.Mz)([L,I.JN,I._5,I.gY,(e,t,r)=>{var n,i,A=k(e,t);if(null!=A){var o=P(e,t),a=D(e,t);if(null!=o&&null!=a){var u,l,f=(0,b.fz)(e),d=(0,I.JN)(e),{maxBarSize:h}=A,p=(0,s.uy)(h)?d:h;return"horizontal"===f?(u=(0,C.Gx)(e,"xAxis",o,r),l=(0,C.CR)(e,"xAxis",o,r)):(u=(0,C.Gx)(e,"yAxis",a,r),l=(0,C.CR)(e,"yAxis",a,r)),null!==(n=null!==(i=(0,c.Hj)(u,l,!0))&&void 0!==i?i:p)&&void 0!==n?n:0}}},H,N],(e,t,r,n,i,A,o)=>{var a=(0,s.uy)(o)?t:o,u=function(e,t,r,n,i){var A=n.length;if(!(A<1)){var o,a=(0,s.F4)(e,r,0,!0),u=[];if((0,_.H)(n[0].barSize)){var c=!1,l=r/A,f=n.reduce((e,t)=>e+(t.barSize||0),0);(f+=(A-1)*a)>=r&&(f-=(A-1)*a,a=0),f>=r&&l>0&&(c=!0,f=A*(l*=.9));var d={offset:((r-f)/2|0)-a,size:0};o=n.reduce((e,t)=>{var r,n=[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:d.offset+d.size+a,size:c?l:null!==(r=t.barSize)&&void 0!==r?r:0}}];return d=n[n.length-1].position,n},u)}else{var h=(0,s.F4)(t,r,0,!0);r-2*h-(A-1)*a<=0&&(a=0);var p=(r-2*h-(A-1)*a)/A;p>1&&(p>>=0);var g=(0,_.H)(i)?Math.min(p,i):p;o=n.reduce((e,t,r)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:h+(p+a)*r+(p-g)/2,size:g}}],u)}return o}}(r,n,i!==A?i:A,e,a);return i!==A&&null!=u&&(u=u.map(e=>U(U({},e),{},{position:U(U({},e.position),{},{offset:e.position.offset-i/2})}))),u}),V=(0,B.Mz)([j,k],(e,t)=>{if(null!=e&&null!=t){var r=e.find(e=>e.stackId===t.stackId&&null!=t.dataKey&&e.dataKeys.includes(t.dataKey));if(null!=r)return r.position}}),K=(0,B.Mz)([(e,t,r)=>{var n=(0,b.fz)(e),i=P(e,t),A=D(e,t);if(null!=i&&null!=A)return"horizontal"===n?(0,C.TC)(e,"yAxis",A,r):(0,C.TC)(e,"xAxis",i,r)},k],(e,t)=>{var r=(0,T.x)(t);if(e&&null!=r&&null!=t){var{stackId:n}=t;if(null!=n){var i=e[n];if(i){var{stackedData:A}=i;if(A)return A.find(e=>e.key===r)}}}}),z=(0,B.Mz)([S.HZ,S.c2,(e,t,r)=>{var n=P(e,t);if(null!=n)return(0,C.Gx)(e,"xAxis",n,r)},(e,t,r)=>{var n=D(e,t);if(null!=n)return(0,C.Gx)(e,"yAxis",n,r)},(e,t,r)=>{var n=P(e,t);if(null!=n)return(0,C.CR)(e,"xAxis",n,r)},(e,t,r)=>{var n=D(e,t);if(null!=n)return(0,C.CR)(e,"yAxis",n,r)},V,b.fz,E.rN,H,K,k,(e,t,r,n)=>n],(e,t,r,n,i,A,o,a,s,u,c,l,f)=>{var{chartData:d,dataStartIndex:h,dataEndIndex:p}=s;if(null!=l&&null!=o&&null!=t&&("horizontal"===a||"vertical"===a)&&null!=r&&null!=n&&null!=i&&null!=A&&null!=u){var g,{data:y}=l;if(null!=(g=null!=y&&y.length>0?y:null==d?void 0:d.slice(h,p+1)))return Qe({layout:a,barSettings:l,pos:o,parentViewBox:t,bandSize:u,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:A,stackedData:c,displayedData:g,offset:e,cells:f,dataStartIndex:h})}}),G=r(49082),W=r(12070),X=r(33032),Y=r(19797),Z=r(8107),q=r(77404),J=r(55694),$=r(42678),ee=r(55448),te=r(8791),re=r(27132),ne=r(60648);var ie=r(65245),Ae=["index"];function oe(){return oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oe.apply(null,arguments)}var ae=(0,n.createContext)(void 0),se=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),ue=e=>{var{index:t}=e,r=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Ae),i=(e=>{var t=(0,n.useContext)(ae);if(null!=t){var{stackId:r}=t;return"url(#".concat(se(r,e),")")}})(t);return n.createElement(A.W,oe({className:"recharts-bar-stack-layer",clipPath:i},r))},ce=["onMouseEnter","onMouseLeave","onClick"],le=["value","background","tooltipPosition"],fe=["id"],de=["onMouseEnter","onClick","onMouseLeave"];function he(){return he=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},he.apply(null,arguments)}function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach(function(t){ye(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ye(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ve(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var me=e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:A}=e;return[{inactive:A,dataKey:t,type:i,color:n,value:(0,c.uM)(r,t),payload:e}]},we=n.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:i,fill:A,name:o,hide:a,unit:s,tooltipType:u,id:l}=e,f={dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:r,strokeWidth:i,fill:A,dataKey:t,nameKey:void 0,name:(0,c.uM)(o,t),hide:a,type:u,color:A,unit:s,graphicalItemId:l}};return n.createElement(v.r,{tooltipEntrySettings:f})});function be(e){var t=(0,G.G)(X.A2),{data:r,dataKey:i,background:A,allOtherBarProps:o}=e,{onMouseEnter:a,onMouseLeave:s,onClick:u}=o,c=ve(o,ce),f=(0,y.Cj)(a,i,o.id),d=(0,y.Pg)(s),h=(0,y.Ub)(u,i,o.id);if(!A||null==r)return null;var g,v,m=(0,ee.ic)(A);return n.createElement(re.g,{zIndex:(g=A,v=ne.I.barBackground,g&&"object"==typeof g&&"zIndex"in g&&"number"==typeof g.zIndex&&(0,_.H)(g.zIndex)?g.zIndex:v)},r.map((e,r)=>{var{value:o,background:a,tooltipPosition:s}=e,u=ve(e,le);if(!a)return null;var g=f(e,r),y=d(e,r),v=h(e,r),w=ge(ge(ge(ge(ge({option:A,isActive:String(r)===t},u),{},{fill:"#eee"},a),m),(0,l.XC)(c,e,r)),{},{onMouseEnter:g,onMouseLeave:y,onClick:v,dataKey:i,index:r,className:"recharts-bar-background-rectangle"});return n.createElement(p,he({key:"background-bar-".concat(r)},w))}))}function Be(e){var{showLabels:t,children:r,rects:i}=e,A=null==i?void 0:i.map(e=>{var t={x:e.x,y:e.y,width:e.width,lowerWidth:e.width,upperWidth:e.width,height:e.height};return ge(ge({},t),{},{value:e.value,payload:e.payload,parentViewBox:e.parentViewBox,viewBox:t,fill:e.fill})});return n.createElement(a.h8,{value:t?A:void 0},r)}function Ce(e){var{shape:t,activeBar:r,baseProps:i,entry:A,index:o,dataKey:a}=e,s=(0,G.G)(X.A2),u=(0,G.G)(X.Xb),c=r&&String(o)===s&&(null==u||a===u),l=c?r:t;return c?n.createElement(re.g,{zIndex:ne.I.activeBar},n.createElement(p,he({},i,{name:String(i.name)},A,{isActive:c,option:l,index:o,dataKey:a}))):n.createElement(p,he({},i,{name:String(i.name)},A,{isActive:c,option:l,index:o,dataKey:a}))}function Ee(e){var{shape:t,baseProps:r,entry:i,index:A,dataKey:o}=e;return n.createElement(p,he({},r,{name:String(r.name)},i,{isActive:!1,option:t,index:A,dataKey:o}))}function Se(e){var t,{data:r,props:i}=e,A=null!==(t=(0,ee.uZ)(i))&&void 0!==t?t:{},{id:o}=A,a=ve(A,fe),{shape:s,dataKey:u,activeBar:c}=i,{onMouseEnter:f,onClick:d,onMouseLeave:h}=i,p=ve(i,de),g=(0,y.Cj)(f,u,o),v=(0,y.Pg)(h),m=(0,y.Ub)(d,u,o);return r?n.createElement(n.Fragment,null,r.map((e,t)=>n.createElement(ue,he({index:t,key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value,"-").concat(t),className:"recharts-bar-rectangle"},(0,l.XC)(p,e,t),{onMouseEnter:g(e,t),onMouseLeave:v(e,t),onClick:m(e,t)}),c?n.createElement(Ce,{shape:s,activeBar:c,baseProps:a,entry:e,index:t,dataKey:u}):n.createElement(Ee,{shape:s,baseProps:a,entry:e,index:t,dataKey:u})))):null}function Ie(e){var{props:t,previousRectanglesRef:r}=e,{data:i,layout:o,isAnimationActive:u,animationBegin:c,animationDuration:l,animationEasing:f,onAnimationEnd:d,onAnimationStart:h}=t,p=r.current,g=(0,Z.n)(t,"recharts-bar-"),[y,v]=(0,n.useState)(!1),m=!y,w=(0,n.useCallback)(()=>{"function"==typeof d&&d(),v(!1)},[d]),b=(0,n.useCallback)(()=>{"function"==typeof h&&h(),v(!0)},[h]);return n.createElement(Be,{showLabels:m,rects:i},n.createElement(te.J,{animationId:g,begin:c,duration:l,isActive:u,easing:f,onAnimationEnd:w,onAnimationStart:b,key:g},e=>{var a=1===e?i:null==i?void 0:i.map((t,r)=>{var n=p&&p[r];if(n)return ge(ge({},t),{},{x:(0,s.GW)(n.x,t.x,e),y:(0,s.GW)(n.y,t.y,e),width:(0,s.GW)(n.width,t.width,e),height:(0,s.GW)(n.height,t.height,e)});if("horizontal"===o){var i=(0,s.GW)(0,t.height,e),A=(0,s.GW)(t.stackedBarStart,t.y,e);return ge(ge({},t),{},{y:A,height:i})}var a=(0,s.GW)(0,t.width,e),u=(0,s.GW)(t.stackedBarStart,t.x,e);return ge(ge({},t),{},{width:a,x:u})});return e>0&&(r.current=null!=a?a:null),null==a?null:n.createElement(A.W,null,n.createElement(Se,{props:t,data:a}))}),n.createElement(a.qY,{label:t.label}),t.children)}function Oe(e){var t=(0,n.useRef)(null);return n.createElement(Ie,{previousRectanglesRef:t,props:e})}var Fe=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:(0,c.kr)(e,t)}};class _e extends n.PureComponent{render(){var{hide:e,data:t,dataKey:r,className:o,xAxisId:a,yAxisId:s,needClip:u,background:c,id:l}=this.props;if(e||null==t)return null;var f=(0,i.$)("recharts-bar",o),d=l;return n.createElement(A.W,{className:f,id:l},u&&n.createElement("defs",null,n.createElement(w.Q,{clipPathId:d,xAxisId:a,yAxisId:s})),n.createElement(A.W,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(d,")"):void 0},n.createElement(be,{data:t,dataKey:r,background:c,allOtherBarProps:this.props}),n.createElement(Oe,this.props)))}}var xe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:0,xAxisId:0,yAxisId:0,zIndex:ne.I.bar};function Ue(e){var t,{xAxisId:r,yAxisId:i,hide:A,legendType:a,minPointSize:s,activeBar:c,animationBegin:l,animationDuration:f,animationEasing:d,isAnimationActive:h}=e,{needClip:p}=(0,w.l)(r,i),g=(0,b.WX)(),y=(0,W.r)(),v=(0,u.aS)(e.children,o.f),B=(0,G.G)(t=>z(t,e.id,y,v));if("vertical"!==g&&"horizontal"!==g)return null;var C=null==B?void 0:B[0];return t=null==C||null==C.height||null==C.width?0:"vertical"===g?C.height/2:C.width/2,n.createElement(m.zk,{xAxisId:r,yAxisId:i,data:B,dataPointFormatter:Fe,errorBarOffset:t},n.createElement(_e,he({},e,{layout:g,needClip:p,data:B,xAxisId:r,yAxisId:i,hide:A,legendType:a,minPointSize:s,activeBar:c,animationBegin:l,animationDuration:f,animationEasing:d,isAnimationActive:h})))}function Qe(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:i,bandSize:A,xAxis:o,yAxis:a,xAxisTicks:u,yAxisTicks:l,stackedData:f,displayedData:d,offset:h,cells:p,parentViewBox:y,dataStartIndex:v}=e,m="horizontal"===t?a:o,w=f?m.scale.domain():null,b=(0,c.DW)({numericAxis:m}),B=m.scale(b);return d.map((e,d)=>{var m,C,E,S,I,O;if(f){var F=f[d+v];if(null==F)return null;m=(0,c._f)(F,w)}else m=(0,c.kr)(e,r),Array.isArray(m)||(m=[b,m]);var _=g(n,0)(m[1],d);if("horizontal"===t){var x,[U,Q]=[a.scale(m[0]),a.scale(m[1])];C=(0,c.y2)({axis:o,ticks:u,bandSize:A,offset:i.offset,entry:e,index:d}),E=null!==(x=null!=Q?Q:U)&&void 0!==x?x:void 0,S=i.size;var T=U-Q;if(I=(0,s.M8)(T)?0:T,O={x:C,y:h.top,width:S,height:h.height},Math.abs(_)>0&&Math.abs(I)<Math.abs(_)){var M=(0,s.sA)(I||_)*(Math.abs(_)-Math.abs(I));E-=M,I+=M}}else{var[P,D]=[o.scale(m[0]),o.scale(m[1])];if(C=P,E=(0,c.y2)({axis:a,ticks:l,bandSize:A,offset:i.offset,entry:e,index:d}),S=D-P,I=i.size,O={x:h.left,y:E,width:h.width,height:I},Math.abs(_)>0&&Math.abs(S)<Math.abs(_))S+=(0,s.sA)(S||_)*(Math.abs(_)-Math.abs(S))}return null==C||null==E||null==S||null==I?null:ge(ge({},e),{},{stackedBarStart:B,x:C,y:E,width:S,height:I,value:f?m:m[1],payload:e,background:O,tooltipPosition:{x:C+S/2,y:E+I/2},parentViewBox:y},p&&p[d]&&p[d].props)}).filter(Boolean)}function Te(e){var t,r,i=(0,q.e)(e,xe),A=(t=i.stackId,null!=(r=(0,n.useContext)(ae))?r.stackId:null!=t?(0,c.$8)(t):void 0),o=(0,W.r)();return n.createElement(J.x,{id:i.id,type:"bar"},e=>n.createElement(n.Fragment,null,n.createElement(Y.A,{legendPayload:me(i)}),n.createElement(we,{dataKey:i.dataKey,stroke:i.stroke,strokeWidth:i.strokeWidth,fill:i.fill,name:i.name,hide:i.hide,unit:i.unit,tooltipType:i.tooltipType,id:e}),n.createElement($.p,{type:"bar",id:e,data:void 0,xAxisId:i.xAxisId,yAxisId:i.yAxisId,zAxisId:0,dataKey:i.dataKey,stackId:A,hide:i.hide,barSize:i.barSize,minPointSize:i.minPointSize,maxBarSize:i.maxBarSize,isPanorama:o}),n.createElement(re.g,{zIndex:i.zIndex},n.createElement(Ue,he({},i,{id:e})))))}var Me=n.memo(Te,ie.P);Me.displayName="Bar"},47962(e,t,r){"use strict";r.d(t,{dc:()=>a,ff:()=>o,g0:()=>s});var n=r(25508),i=r(60184),A=r.n(i),o=e=>e.legend.settings,a=e=>e.legend.size,s=(0,n.Mz)([e=>e.legend.payload,o],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?A()(n,r):n})},48102(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(){}return e.floatToIntBits=function(e){return e},e.MAX_VALUE=Number.MAX_SAFE_INTEGER,e}()},48408(e,t,r){"use strict";r(98406)},48523(e,t,r){"use strict";r(16468)("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},r(86938))},48695(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isPlainObject=function(e){if("object"!=typeof e)return!1;if(null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){const t=e[Symbol.toStringTag];if(null==t)return!1;return!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},48946(e,t,r){"use strict";function n(e){return function(){return e}}r.d(t,{A:()=>n})},49082(e,t,r){"use strict";r.d(t,{G:()=>l,j:()=>a});var n=r(69242),i=r(96540),A=r(92649),o=e=>e,a=()=>{var e=(0,i.useContext)(A.E);return e?e.store.dispatch:o},s=()=>{},u=()=>s,c=(e,t)=>e===t;function l(e){var t=(0,i.useContext)(A.E);return(0,n.useSyncExternalStoreWithSelector)(t?t.subscription.addNestedSub:u,t?t.store.getState:s,t?t.store.getState:s,t?e:s,c)}},49135(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(92679),i=r(92819),A=r(57149);const o=function(){function e(e,t){if(0===t.length)throw new A.A;this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),i.A.arraycopy(t,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){if(0===e)return this.getCoefficient(0);var t,r=this.coefficients;if(1===e){t=0;for(var i=0,A=r.length;i!==A;i++){var o=r[i];t=n.A.addOrSubtract(t,o)}return t}t=r[0];var a=r.length,s=this.field;for(i=1;i<a;i++)t=n.A.addOrSubtract(s.multiply(e,t),r[i]);return t},e.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new A.A("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;var r=this.coefficients,o=t.coefficients;if(r.length>o.length){var a=r;r=o,o=a}var s=new Int32Array(o.length),u=o.length-r.length;i.A.arraycopy(o,0,s,0,u);for(var c=u;c<o.length;c++)s[c]=n.A.addOrSubtract(r[c-u],o[c]);return new e(this.field,s)},e.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new A.A("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var r=this.coefficients,i=r.length,o=t.coefficients,a=o.length,s=new Int32Array(i+a-1),u=this.field,c=0;c<i;c++)for(var l=r[c],f=0;f<a;f++)s[c+f]=n.A.addOrSubtract(s[c+f],u.multiply(l,o[f]));return new e(u,s)},e.prototype.multiplyScalar=function(t){if(0===t)return this.field.getZero();if(1===t)return this;for(var r=this.coefficients.length,n=this.field,i=new Int32Array(r),A=this.coefficients,o=0;o<r;o++)i[o]=n.multiply(A[o],t);return new e(n,i)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new A.A;if(0===r)return this.field.getZero();for(var n=this.coefficients,i=n.length,o=new Int32Array(i+t),a=this.field,s=0;s<i;s++)o[s]=a.multiply(n[s],r);return new e(a,o)},e.prototype.divide=function(e){if(!this.field.equals(e.field))throw new A.A("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new A.A("Divide by 0");for(var t=this.field,r=t.getZero(),n=this,i=e.getCoefficient(e.getDegree()),o=t.inverse(i);n.getDegree()>=e.getDegree()&&!n.isZero();){var a=n.getDegree()-e.getDegree(),s=t.multiply(n.getCoefficient(n.getDegree()),o),u=e.multiplyByMonomial(a,s),c=t.buildMonomial(a,s);r=r.addOrSubtract(c),n=n.addOrSubtract(u)}return[r,n]},e.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var r=this.getCoefficient(t);if(0!==r){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),0===t||1!==r){var n=this.field.log(r);0===n?e+="1":1===n?e+="a":(e+="a^",e+=n)}0!==t&&(1===t?e+="x":(e+="x^",e+=t))}}return e},e}()},49259(e,t,r){"use strict";r.d(t,{aX:()=>K,dS:()=>R,BZ:()=>L,pg:()=>N,yn:()=>j,r1:()=>T,dp:()=>D,u9:()=>H,fW:()=>_});var n=r(25508),i=r(60184),A=r.n(i),o=r(49082),a=r(26470),s=r(98453),u=r(33032),c=r(91572),l=r(82695),f=r(19287),d=r(36189),h=r(5180),p=r(75403),g=r(19809),y=r(74544),v=r(4217),m=r(60523),w=r(18351),b=r(23571),B=r(89596),C=r(14040),E=r(59744);function S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?S(Object(r),!0).forEach(function(t){O(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function O(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var F=(e,t,r,n,i)=>{var A,o=null!==(A=null==t?void 0:t.length)&&void 0!==A?A:0;if(o<=1||null==e)return 0;if("angleAxis"===n&&null!=i&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var a=0;a<o;a++){var s,u,c,l,f,d=a>0?null===(s=r[a-1])||void 0===s?void 0:s.coordinate:null===(u=r[o-1])||void 0===u?void 0:u.coordinate,h=null===(c=r[a])||void 0===c?void 0:c.coordinate,p=a>=o-1?null===(l=r[0])||void 0===l?void 0:l.coordinate:null===(f=r[a+1])||void 0===f?void 0:f.coordinate,g=void 0;if(null!=d&&null!=h&&null!=p)if((0,E.sA)(h-d)!==(0,E.sA)(p-h)){var y=[];if((0,E.sA)(p-h)===(0,E.sA)(i[1]-i[0])){g=p;var v=h+i[1]-i[0];y[0]=Math.min(v,(v+d)/2),y[1]=Math.max(v,(v+d)/2)}else{g=d;var m=p+i[1]-i[0];y[0]=Math.min(h,(m+h)/2),y[1]=Math.max(h,(m+h)/2)}var w,b=[Math.min(h,(g+h)/2),Math.max(h,(g+h)/2)];if(e>b[0]&&e<=b[1]||e>=y[0]&&e<=y[1])return null===(w=r[a])||void 0===w?void 0:w.index}else{var B,C=Math.min(d,p),S=Math.max(d,p);if(e>(C+h)/2&&e<=(S+h)/2)return null===(B=r[a])||void 0===B?void 0:B.index}}else if(t)for(var I=0;I<o;I++){var O=t[I];if(null!=O){var F=t[I+1],_=t[I-1];if(0===I&&null!=F&&e<=(O.coordinate+F.coordinate)/2)return O.index;if(I===o-1&&null!=_&&e>(O.coordinate+_.coordinate)/2)return O.index;if(I>0&&I<o-1&&null!=_&&null!=F&&e>(O.coordinate+_.coordinate)/2&&e<=(O.coordinate+F.coordinate)/2)return O.index}}return-1},_=()=>(0,o.G)(l.iO),x=(e,t)=>t,U=(e,t,r)=>r,Q=(e,t,r,n)=>n,T=(0,n.Mz)(u.R4,e=>A()(e,e=>e.coordinate)),M=(0,n.Mz)([b.J,x,U,Q],g.i),P=(0,n.Mz)([M,u.n4,c.K6,u.FO],y.P),D=(e,t,r)=>{if(null!=t){var n=(0,b.J)(e);return"axis"===t?"hover"===r?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:"hover"===r?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},k=(0,n.Mz)([b.J,x,U,Q],m.q),N=(0,n.Mz)([h.Lp,h.A$,f.fz,d.HZ,u.R4,Q,k,w.x],v.o),R=(0,n.Mz)([M,N],(e,t)=>{var r;return null!==(r=e.coordinate)&&void 0!==r?r:t}),L=(0,n.Mz)([u.R4,P],p.E),H=(0,n.Mz)([k,P,s.LF,c.K6,L,w.x,x],B.N),j=(0,n.Mz)([M,P],(e,t)=>({isActive:e.active&&null!=t,activeIndex:t})),V=(e,t,r,n,i,A,o)=>{if(e&&n&&i&&A&&r){var s=(0,C.yy)(e,r);if(s){var u=(0,a.eB)(s,t),c=F(u,o,A,n,i),l=((e,t,r,n)=>{var i=t.find(e=>e&&e.index===r);if(i){if("centric"===e){var A=i.coordinate,{radius:o}=n;return I(I(I({},n),(0,C.IZ)(n.cx,n.cy,o,A)),{},{angle:A,radius:o})}var a=i.coordinate,{angle:s}=n;return I(I(I({},n),(0,C.IZ)(n.cx,n.cy,a,s)),{},{angle:s,radius:a})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}})(t,A,c,s);return{activeIndex:String(c),activeCoordinate:l}}}},K=(e,t,r,n,i,A,o,s)=>{if(e&&t&&n&&i&&A)return"horizontal"===t||"vertical"===t?((e,t,r,n,i,A,o)=>{if(e&&r&&n&&i&&function(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}(e,o)){var s=(0,a.sr)(e,t),u=F(s,A,i,r,n),c=((e,t,r,n)=>{var i=t.find(e=>e&&e.index===r);if(i){if("horizontal"===e)return{x:i.coordinate,y:n.chartY};if("vertical"===e)return{x:n.chartX,y:i.coordinate}}return{x:0,y:0}})(t,i,u,e);return{activeIndex:String(u),activeCoordinate:c}}})(e,t,n,i,A,o,s):V(e,t,r,n,i,A,o)}},49303(e,t,r){"use strict";r.d(t,{u:()=>s});var n=r(96540),i=r(34164),A=r(80196),o=["children","width","height","viewBox","className","style","title","desc"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(null,arguments)}var s=(0,n.forwardRef)((e,t)=>{var{children:r,width:s,height:u,viewBox:c,className:l,style:f,title:d,desc:h}=e,p=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,o),g=c||{width:s,height:u,x:0,y:0},y=(0,i.$)("recharts-surface",l);return n.createElement("svg",a({},(0,A.a)(p),{className:y,width:s,height:u,style:f,viewBox:"".concat(g.x," ").concat(g.y," ").concat(g.width," ").concat(g.height),ref:t}),n.createElement("title",null,d),n.createElement("desc",null,h),r)})},49785(e,t,r){"use strict";r.d(t,{mN:()=>_e,xI:()=>G});var n=r(96540),i=e=>"checkbox"===e.type,A=e=>e instanceof Date,o=e=>null==e;const a=e=>"object"==typeof e;var s=e=>!o(e)&&!Array.isArray(e)&&a(e)&&!A(e),u=e=>s(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,c=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),l="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function f(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(l&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||s(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return s(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=f(e[t]));return n}var d=e=>/^\w*$/.test(e),h=e=>void 0===e,p=e=>Array.isArray(e)?e.filter(Boolean):[],g=e=>p(e.replace(/["|']|\]/g,"").split(/\.|\[/)),y=(e,t,r)=>{if(!t||!s(e))return r;const n=(d(t)?[t]:g(t)).reduce((e,t)=>o(e)?e:e[t],e);return h(n)||n===e?h(e[t])?r:e[t]:n},v=e=>"boolean"==typeof e,m=e=>"function"==typeof e,w=(e,t,r)=>{let n=-1;const i=d(t)?[t]:g(t),A=i.length,o=A-1;for(;++n<A;){const t=i[n];let A=r;if(n!==o){const r=e[t];A=s(r)||Array.isArray(r)?r:isNaN(+i[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=A,e=e[t]}};const b="blur",B="focusout",C="change",E="onBlur",S="onChange",I="onSubmit",O="onTouched",F="all",_="max",x="min",U="maxLength",Q="minLength",T="pattern",M="required",P="validate",D=n.createContext(null);D.displayName="HookFormControlContext";const k=()=>n.useContext(D);var N=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const A in e)Object.defineProperty(i,A,{get:()=>{const i=A;return t._proxyFormState[i]!==F&&(t._proxyFormState[i]=!n||F),r&&(r[i]=!0),e[i]}});return i};const R="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function L(e){const t=k(),{control:r=t,disabled:i,name:A,exact:o}=e||{},[a,s]=n.useState(r._formState),u=n.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return R(()=>r._subscribe({name:A,formState:u.current,exact:o,callback:e=>{!i&&s({...r._formState,...e})}}),[A,i,o]),n.useEffect(()=>{u.current.isValid&&r._setValid(!0)},[r]),n.useMemo(()=>N(a,r,u.current,!1),[a,r])}var H=e=>"string"==typeof e,j=(e,t,r,n,i)=>H(e)?(n&&t.watch.add(e),y(r,e,i)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),y(r,e))):(n&&(t.watchAll=!0),r),V=e=>o(e)||!a(e);function K(e,t,r=new WeakSet){if(V(e)||V(t))return Object.is(e,t);if(A(e)&&A(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const n=e[o];if(!i.includes(o))return!1;if("ref"!==o){const e=t[o];if(A(n)&&A(e)||s(n)&&s(e)||Array.isArray(n)&&Array.isArray(e)?!K(n,e,r):!Object.is(n,e))return!1}}return!0}function z(e){const t=k(),{control:r=t,name:i,defaultValue:A,disabled:o,exact:a,compute:s}=e||{},u=n.useRef(A),c=n.useRef(s),l=n.useRef(void 0),f=n.useRef(r),d=n.useRef(i);c.current=s;const[h,p]=n.useState(()=>{const e=r._getWatch(i,u.current);return c.current?c.current(e):e}),g=n.useCallback(e=>{const t=j(i,r._names,e||r._formValues,!1,u.current);return c.current?c.current(t):t},[r._formValues,r._names,i]),y=n.useCallback(e=>{if(!o){const t=j(i,r._names,e||r._formValues,!1,u.current);if(c.current){const e=c.current(t);K(e,l.current)||(p(e),l.current=e)}else p(t)}},[r._formValues,r._names,o,i]);R(()=>(f.current===r&&K(d.current,i)||(f.current=r,d.current=i,y()),r._subscribe({name:i,formState:{values:!0},exact:a,callback:e=>{y(e.values)}})),[r,a,i,y]),n.useEffect(()=>r._removeUnmounted());const v=f.current!==r,m=d.current,w=n.useMemo(()=>{if(o)return null;const e=!v&&!K(m,i);return v||e?g():null},[o,v,i,m,g]);return null!==w?w:h}const G=e=>e.render(function(e){const t=k(),{name:r,disabled:i,control:A=t,shouldUnregister:o,defaultValue:a,exact:s=!0}=e,l=c(A._names.array,r),d=n.useMemo(()=>y(A._formValues,r,y(A._defaultValues,r,a)),[A,r,a]),p=z({control:A,name:r,defaultValue:d,exact:s}),g=L({control:A,name:r,exact:s}),B=n.useRef(e),E=n.useRef(void 0),S=n.useRef(A.register(r,{...e.rules,value:p,...v(e.disabled)?{disabled:e.disabled}:{}}));B.current=e;const I=n.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!y(g.errors,r)},isDirty:{enumerable:!0,get:()=>!!y(g.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!y(g.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!y(g.validatingFields,r)},error:{enumerable:!0,get:()=>y(g.errors,r)}}),[g,r]),O=n.useCallback(e=>S.current.onChange({target:{value:u(e),name:r},type:C}),[r]),F=n.useCallback(()=>S.current.onBlur({target:{value:y(A._formValues,r),name:r},type:b}),[r,A._formValues]),_=n.useCallback(e=>{const t=y(A._fields,r);t&&t._f&&e&&(t._f.ref={focus:()=>m(e.focus)&&e.focus(),select:()=>m(e.select)&&e.select(),setCustomValidity:t=>m(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>m(e.reportValidity)&&e.reportValidity()})},[A._fields,r]),x=n.useMemo(()=>({name:r,value:p,...v(i)||g.disabled?{disabled:g.disabled||i}:{},onChange:O,onBlur:F,ref:_}),[r,i,g.disabled,O,F,_,p]);return n.useEffect(()=>{const e=A._options.shouldUnregister||o,t=E.current;t&&t!==r&&!l&&A.unregister(t),A.register(r,{...B.current.rules,...v(B.current.disabled)?{disabled:B.current.disabled}:{}});const n=(e,t)=>{const r=y(A._fields,e);r&&r._f&&(r._f.mount=t)};if(n(r,!0),e){const e=f(y(A._options.defaultValues,r,B.current.defaultValue));w(A._defaultValues,r,e),h(y(A._formValues,r))&&w(A._formValues,r,e)}return!l&&A.register(r),E.current=r,()=>{(l?e&&!A._state.action:e)?A.unregister(r):n(r,!1)}},[r,A,l,o]),n.useEffect(()=>{A._setDisabledField({disabled:i,name:r})},[i,r,A]),n.useMemo(()=>({field:x,formState:g,fieldState:I}),[x,g,I])}(e)),W=n.createContext(null);W.displayName="HookFormContext";var X=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},Y=e=>Array.isArray(e)?e:[e],Z=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function q(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const i=e[n],A=t[n];if(i&&s(i)&&A){const e=q(i,A);s(e)&&(r[n]=e)}else e[n]&&(r[n]=A)}return r}var J=e=>s(e)&&!Object.keys(e).length,$=e=>"file"===e.type,ee=e=>{if(!l)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},te=e=>"select-multiple"===e.type,re=e=>"radio"===e.type,ne=e=>ee(e)&&e.isConnected;function ie(e,t){const r=Array.isArray(t)?t:d(t)?[t]:g(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=h(e)?n++:e[t[n++]];return e}(e,r),i=r.length-1,A=r[i];return n&&delete n[A],0!==i&&(s(n)&&J(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!h(e[t]))return!1;return!0}(n))&&ie(e,r.slice(0,-1)),e}function Ae(e){return Array.isArray(e)||s(e)&&!(e=>{for(const t in e)if(m(e[t]))return!0;return!1})(e)}function oe(e,t={}){for(const r in e){const n=e[r];Ae(n)?(t[r]=Array.isArray(n)?[]:{},oe(n,t[r])):h(n)||(t[r]=!0)}return t}function ae(e,t,r){r||(r=oe(t));for(const n in e){const i=e[n];if(Ae(i))h(t)||V(r[n])?r[n]=oe(i,Array.isArray(i)?[]:{}):ae(i,o(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!K(i,e)}}return r}const se={value:!1,isValid:!1},ue={value:!0,isValid:!0};var ce=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!h(e[0].attributes.value)?h(e[0].value)||""===e[0].value?ue:{value:e[0].value,isValid:!0}:ue:se}return se},le=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>h(e)?e:t?""===e?NaN:e?+e:e:r&&H(e)?new Date(e):n?n(e):e;const fe={isValid:!1,value:null};var de=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,fe):fe;function he(e){const t=e.ref;return $(t)?t.files:re(t)?de(e.refs).value:te(t)?[...t.selectedOptions].map(({value:e})=>e):i(t)?ce(e.refs).value:le(h(t.value)?e.ref.value:t.value,e)}var pe=e=>e instanceof RegExp,ge=e=>h(e)?e:pe(e)?e.source:s(e)?pe(e.value)?e.value.source:e.value:e,ye=e=>({isOnSubmit:!e||e===I,isOnBlur:e===E,isOnChange:e===S,isOnAll:e===F,isOnTouch:e===O});const ve="AsyncFunction";var me=e=>!!e&&!!e.validate&&!!(m(e.validate)&&e.validate.constructor.name===ve||s(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===ve)),we=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const be=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const r=y(e,i);if(r){const{_f:e,...A}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(be(A,t))break}else if(s(A)&&be(A,t))break}}};function Be(e,t,r){const n=y(e,r);if(n||d(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const n=i.join("."),A=y(t,n),o=y(e,n);if(A&&!Array.isArray(A)&&r!==n)return{name:r};if(o&&o.type)return{name:n,error:o};if(o&&o.root&&o.root.type)return{name:`${n}.root`,error:o.root};i.pop()}return{name:r}}var Ce=(e,t,r)=>{const n=Y(y(e,r));return w(n,"root",t[r]),w(e,r,n),e};function Ee(e,t,r="validate"){if(H(e)||Array.isArray(e)&&e.every(H)||v(e)&&!e)return{type:r,message:H(e)?e:"",ref:t}}var Se=e=>s(e)&&!pe(e)?e:{value:e,message:""},Ie=async(e,t,r,n,A,a)=>{const{ref:u,refs:c,required:l,maxLength:f,minLength:d,min:p,max:g,pattern:w,validate:b,name:B,valueAsNumber:C,mount:E}=e._f,S=y(r,B);if(!E||t.has(B))return{};const I=c?c[0]:u,O=e=>{A&&I.reportValidity&&(I.setCustomValidity(v(e)?"":e||""),I.reportValidity())},F={},D=re(u),k=i(u),N=D||k,R=(C||$(u))&&h(u.value)&&h(S)||ee(u)&&""===u.value||""===S||Array.isArray(S)&&!S.length,L=X.bind(null,B,n,F),j=(e,t,r,n=U,i=Q)=>{const A=e?t:r;F[B]={type:e?n:i,message:A,ref:u,...L(e?n:i,A)}};if(a?!Array.isArray(S)||!S.length:l&&(!N&&(R||o(S))||v(S)&&!S||k&&!ce(c).isValid||D&&!de(c).isValid)){const{value:e,message:t}=H(l)?{value:!!l,message:l}:Se(l);if(e&&(F[B]={type:M,message:t,ref:I,...L(M,t)},!n))return O(t),F}if(!(R||o(p)&&o(g))){let e,t;const r=Se(g),i=Se(p);if(o(S)||isNaN(S)){const n=u.valueAsDate||new Date(S),A=e=>new Date((new Date).toDateString()+" "+e),o="time"==u.type,a="week"==u.type;H(r.value)&&S&&(e=o?A(S)>A(r.value):a?S>r.value:n>new Date(r.value)),H(i.value)&&S&&(t=o?A(S)<A(i.value):a?S<i.value:n<new Date(i.value))}else{const n=u.valueAsNumber||(S?+S:S);o(r.value)||(e=n>r.value),o(i.value)||(t=n<i.value)}if((e||t)&&(j(!!e,r.message,i.message,_,x),!n))return O(F[B].message),F}if((f||d)&&!R&&(H(S)||a&&Array.isArray(S))){const e=Se(f),t=Se(d),r=!o(e.value)&&S.length>+e.value,i=!o(t.value)&&S.length<+t.value;if((r||i)&&(j(r,e.message,t.message),!n))return O(F[B].message),F}if(w&&!R&&H(S)){const{value:e,message:t}=Se(w);if(pe(e)&&!S.match(e)&&(F[B]={type:T,message:t,ref:u,...L(T,t)},!n))return O(t),F}if(b)if(m(b)){const e=Ee(await b(S,r),I);if(e&&(F[B]={...e,...L(P,e.message)},!n))return O(e.message),F}else if(s(b)){let e={};for(const t in b){if(!J(e)&&!n)break;const i=Ee(await b[t](S,r),I,t);i&&(e={...i,...L(t,i.message)},O(i.message),n&&(F[B]=e))}if(!J(e)&&(F[B]={ref:I,...e},!n))return F}return O(!0),F};const Oe={mode:I,reValidateMode:S,shouldFocusError:!0};function Fe(e={}){let t,r={...Oe,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:m(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},d=(s(r.defaultValues)||s(r.values))&&f(r.defaultValues||r.values)||{},g=r.shouldUnregister?{}:f(d),C={action:!1,mount:!1,watch:!1,keepIsValid:!1},E={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},S=0;const I={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},O={...I};let _={...O};const x={array:Z(),state:Z()},U=r.criteriaMode===F,Q=async e=>{if(!C.keepIsValid&&!r.disabled&&(O.isValid||_.isValid||e)){let e;r.resolver?(e=J((await k()).errors),T()):e=await N(a,!0),e!==n.isValid&&x.state.next({isValid:e})}},T=(e,t)=>{!r.disabled&&(O.isValidating||O.validatingFields||_.isValidating||_.validatingFields)&&((e||Array.from(E.mount)).forEach(e=>{e&&(t?w(n.validatingFields,e,t):ie(n.validatingFields,e))}),x.state.next({validatingFields:n.validatingFields,isValidating:!J(n.validatingFields)}))},M=(e,t,r,n)=>{const i=y(a,e);if(i){const A=y(g,e,h(r)?y(d,e):r);h(A)||n&&n.defaultChecked||t?w(g,e,t?A:he(i._f)):V(e,A),C.mount&&!C.action&&Q()}},P=(e,t,i,A,o)=>{let a=!1,s=!1;const u={name:e};if(!r.disabled){if(!i||A){(O.isDirty||_.isDirty)&&(s=n.isDirty,n.isDirty=u.isDirty=R(),a=s!==u.isDirty);const r=K(y(d,e),t);s=!!y(n.dirtyFields,e),r?ie(n.dirtyFields,e):w(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,a=a||(O.dirtyFields||_.dirtyFields)&&s!==!r}if(i){const t=y(n.touchedFields,e);t||(w(n.touchedFields,e,i),u.touchedFields=n.touchedFields,a=a||(O.touchedFields||_.touchedFields)&&t!==i)}a&&o&&x.state.next(u)}return a?u:{}},D=(e,i,A,o)=>{const a=y(n.errors,e),s=(O.isValid||_.isValid)&&v(i)&&n.isValid!==i;var u;if(r.delayError&&A?(u=()=>((e,t)=>{w(n.errors,e,t),x.state.next({errors:n.errors})})(e,A),t=e=>{clearTimeout(S),S=setTimeout(u,e)},t(r.delayError)):(clearTimeout(S),t=null,A?w(n.errors,e,A):ie(n.errors,e)),(A?!K(a,A):a)||!J(o)||s){const t={...o,...s&&v(i)?{isValid:i}:{},errors:n.errors,name:e};n={...n,...t},x.state.next(t)}},k=async e=>{T(e,!0);const t=await r.resolver(g,r.context,((e,t,r,n)=>{const i={};for(const r of e){const e=y(t,r);e&&w(i,r,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}})(e||E.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},N=async(t,i,A={valid:!0})=>{for(const o in t){const a=t[o];if(a){const{_f:t,...o}=a;if(t){const o=E.array.has(t.name),s=a._f&&me(a._f);s&&O.validatingFields&&T([t.name],!0);const u=await Ie(a,E.disabled,g,U,r.shouldUseNativeValidation&&!i,o);if(s&&O.validatingFields&&T([t.name]),u[t.name]&&(A.valid=!1,i||e.shouldUseNativeValidation))break;!i&&(y(u,t.name)?o?Ce(n.errors,u,t.name):w(n.errors,t.name,u[t.name]):ie(n.errors,t.name))}!J(o)&&await N(o,i,A)}}return A.valid},R=(e,t)=>!r.disabled&&(e&&t&&w(g,e,t),!K(oe(),d)),L=(e,t,r)=>j(e,E,{...C.mount?g:h(t)?d:H(e)?{[e]:t}:t},r,t),V=(e,t,r={})=>{const n=y(a,e);let A=t;if(n){const r=n._f;r&&(!r.disabled&&w(g,e,le(t,r)),A=ee(r.ref)&&o(t)?"":t,te(r.ref)?[...r.ref.options].forEach(e=>e.selected=A.includes(e.value)):r.refs?i(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(A)?e.checked=!!A.find(t=>t===e.value):e.checked=A===e.value||!!A)}):r.refs.forEach(e=>e.checked=e.value===A):$(r.ref)?r.ref.value="":(r.ref.value=A,r.ref.type||x.state.next({name:e,values:f(g)})))}(r.shouldDirty||r.shouldTouch)&&P(e,A,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&Ae(e)},z=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const i=t[n],o=e+"."+n,u=y(a,o);(E.array.has(e)||s(i)||u&&!u._f)&&!A(i)?z(o,i,r):V(o,i,r)}},G=(e,t,r={})=>{const i=y(a,e),A=E.array.has(e),s=f(t);w(g,e,s),A?(x.array.next({name:e,values:f(g)}),(O.isDirty||O.dirtyFields||_.isDirty||_.dirtyFields)&&r.shouldDirty&&x.state.next({name:e,dirtyFields:ae(d,g),isDirty:R(e,s)})):!i||i._f||o(s)?V(e,s,r):z(e,s,r),we(e,E)?x.state.next({...n,name:e,values:f(g)}):x.state.next({name:C.mount?e:void 0,values:f(g)})},W=async e=>{C.mount=!0;const i=e.target;let o=i.name,s=!0;const c=y(a,o),l=e=>{s=Number.isNaN(e)||A(e)&&isNaN(e.getTime())||K(e,y(g,o,e))},d=ye(r.mode),h=ye(r.reValidateMode);if(c){let A,v;const m=i.type?he(c._f):u(e),C=e.type===b||e.type===B,S=!((p=c._f).mount&&(p.required||p.min||p.max||p.maxLength||p.minLength||p.pattern||p.validate)||r.resolver||y(n.errors,o)||c._f.deps)||((e,t,r,n,i)=>!i.isOnAll&&(!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:!(r?n.isOnChange:i.isOnChange)||e))(C,y(n.touchedFields,o),n.isSubmitted,h,d),I=we(o,E,C);w(g,o,m),C?i&&i.readOnly||(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const F=P(o,m,C),M=!J(F)||I;if(!C&&x.state.next({name:o,type:e.type,values:f(g)}),S)return(O.isValid||_.isValid)&&("onBlur"===r.mode?C&&Q():C||Q()),M&&x.state.next({name:o,...I?{}:F});if(!C&&I&&x.state.next({...n}),r.resolver){const{errors:e}=await k([o]);if(T([o]),l(m),s){const t=Be(n.errors,a,o),r=Be(e,a,t.name||o);A=r.error,o=r.name,v=J(e)}}else T([o],!0),A=(await Ie(c,E.disabled,g,U,r.shouldUseNativeValidation))[o],T([o]),l(m),s&&(A?v=!1:(O.isValid||_.isValid)&&(v=await N(a,!0)));s&&(c._f.deps&&(!Array.isArray(c._f.deps)||c._f.deps.length>0)&&Ae(c._f.deps),D(o,v,A,F))}var p},X=(e,t)=>{if(y(n.errors,t)&&e.focus)return e.focus(),1},Ae=async(e,t={})=>{let i,A;const o=Y(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await k(e);if(T(e),e)for(const r of e){const e=y(t,r);e?w(n.errors,r,e):ie(n.errors,r)}else n.errors=t;return t})(h(e)?e:o);i=J(t),A=e?!o.some(e=>y(t,e)):i}else e?(A=(await Promise.all(o.map(async e=>{const t=y(a,e);return await N(t&&t._f?{[e]:t}:t)}))).every(Boolean),(A||n.isValid)&&Q()):A=i=await N(a);return x.state.next({...!H(e)||(O.isValid||_.isValid)&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!A&&be(a,X,e?o:E.mount),A},oe=(e,t)=>{let r={...C.mount?g:d};return t&&(r=q(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),h(e)?r:H(e)?y(r,e):e.map(e=>y(r,e))},se=(e,t)=>({invalid:!!y((t||n).errors,e),isDirty:!!y((t||n).dirtyFields,e),error:y((t||n).errors,e),isValidating:!!y(n.validatingFields,e),isTouched:!!y((t||n).touchedFields,e)}),ue=(e,t,r)=>{const i=(y(a,e,{_f:{}})._f||{}).ref,A=y(n.errors,e)||{},{ref:o,message:s,type:u,...c}=A;w(n.errors,e,{...c,...t,ref:i}),x.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},ce=e=>x.state.subscribe({next:t=>{var r,i,A;r=e.name,i=t.name,A=e.exact,r&&i&&r!==i&&!Y(r).some(e=>e&&(A?e===i:e.startsWith(i)||i.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:i,...A}=e;return J(A)||Object.keys(A).length>=Object.keys(t).length||Object.keys(A).find(e=>t[e]===(!n||F))})(t,e.formState||O,_e,e.reRenderRoot)||e.callback({values:{...g},...n,...t,defaultValues:d})}}).unsubscribe,fe=(e,t={})=>{for(const i of e?Y(e):E.mount)E.mount.delete(i),E.array.delete(i),t.keepValue||(ie(a,i),ie(g,i)),!t.keepError&&ie(n.errors,i),!t.keepDirty&&ie(n.dirtyFields,i),!t.keepTouched&&ie(n.touchedFields,i),!t.keepIsValidating&&ie(n.validatingFields,i),!r.shouldUnregister&&!t.keepDefaultValue&&ie(d,i);x.state.next({values:f(g)}),x.state.next({...n,...t.keepDirty?{isDirty:R()}:{}}),!t.keepIsValid&&Q()},de=({disabled:e,name:t})=>{if(v(e)&&C.mount||e||E.disabled.has(t)){const r=E.disabled.has(t)!==!!e;e?E.disabled.add(t):E.disabled.delete(t),r&&C.mount&&!C.action&&Q()}},pe=(e,t={})=>{let n=y(a,e);const A=v(t.disabled)||v(r.disabled);return w(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),E.mount.add(e),n?de({disabled:v(t.disabled)?t.disabled:r.disabled,name:e}):M(e,!0,t.value),{...A?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:ge(t.min),max:ge(t.max),minLength:ge(t.minLength),maxLength:ge(t.maxLength),pattern:ge(t.pattern)}:{},name:e,onChange:W,onBlur:W,ref:A=>{if(A){pe(e,t),n=y(a,e);const r=h(A.value)&&A.querySelectorAll&&A.querySelectorAll("input,select,textarea")[0]||A,o=(e=>re(e)||i(e))(r),s=n._f.refs||[];if(o?s.find(e=>e===r):r===n._f.ref)return;w(a,e,{_f:{...n._f,...o?{refs:[...s.filter(ne),r,...Array.isArray(y(d,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),M(e,!1,void 0,r)}else n=y(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!c(E.array,e)||!C.action)&&E.unMount.add(e)}}},ve=()=>r.shouldFocusError&&be(a,X,E.mount),Ee=(e,t)=>async i=>{let A;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let o=f(g);if(x.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await k();T(),n.errors=e,o=f(t)}else await N(a);if(E.disabled.size)for(const e of E.disabled)ie(o,e);if(ie(n.errors,"root"),J(n.errors)){x.state.next({errors:{}});try{await e(o,i)}catch(e){A=e}}else t&&await t({...n.errors},i),ve(),setTimeout(ve);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:J(n.errors)&&!A,submitCount:n.submitCount+1,errors:n.errors}),A)throw A},Se=(e,t={})=>{const i=e?f(e):d,A=f(i),o=J(e),s=o?d:A;if(t.keepDefaultValues||(d=i),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...E.mount,...Object.keys(ae(d,g))]);for(const t of Array.from(e)){const e=y(n.dirtyFields,t),r=y(g,t),i=y(s,t);e&&!h(r)?w(s,t,r):e||h(i)||G(t,i)}}else{if(l&&h(e))for(const e of E.mount){const t=y(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(ee(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of E.mount)G(e,y(s,e));else a={}}g=r.shouldUnregister?t.keepDefaultValues?f(d):{}:f(s),x.array.next({values:{...s}}),x.state.next({values:{...s}})}E={mount:t.keepDirtyValues?E.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},C.mount=!O.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!J(s),C.watch=!!r.shouldUnregister,C.keepIsValid=!!t.keepIsValid,C.action=!1,t.keepErrors||(n.errors={}),x.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!o&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||K(e,d))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:o?{}:t.keepDirtyValues?t.keepDefaultValues&&g?ae(d,g):n.dirtyFields:t.keepDefaultValues&&e?ae(d,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:d})},Fe=(e,t)=>Se(m(e)?e(g):e,{...r.resetOptions,...t}),_e=e=>{n={...n,...e}},xe={control:{register:pe,unregister:fe,getFieldState:se,handleSubmit:Ee,setError:ue,_subscribe:ce,_runSchema:k,_updateIsValidating:T,_focusError:ve,_getWatch:L,_getDirty:R,_setValid:Q,_setFieldArray:(e,t=[],i,A,o=!0,s=!0)=>{if(A&&i&&!r.disabled){if(C.action=!0,s&&Array.isArray(y(a,e))){const t=i(y(a,e),A.argA,A.argB);o&&w(a,e,t)}if(s&&Array.isArray(y(n.errors,e))){const t=i(y(n.errors,e),A.argA,A.argB);o&&w(n.errors,e,t),((e,t)=>{!p(y(e,t)).length&&ie(e,t)})(n.errors,e)}if((O.touchedFields||_.touchedFields)&&s&&Array.isArray(y(n.touchedFields,e))){const t=i(y(n.touchedFields,e),A.argA,A.argB);o&&w(n.touchedFields,e,t)}(O.dirtyFields||_.dirtyFields)&&(n.dirtyFields=ae(d,g)),x.state.next({name:e,isDirty:R(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else w(g,e,t)},_setDisabledField:de,_setErrors:e=>{n.errors=e,x.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>p(y(C.mount?g:d,e,r.shouldUnregister?y(d,e,[]):[])),_reset:Se,_resetDefaultValues:()=>m(r.defaultValues)&&r.defaultValues().then(e=>{Fe(e,r.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of E.unMount){const t=y(a,e);t&&(t._f.refs?t._f.refs.every(e=>!ne(e)):!ne(t._f.ref))&&fe(e)}E.unMount=new Set},_disableForm:e=>{v(e)&&(x.state.next({disabled:e}),be(a,(t,r)=>{const n=y(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:x,_proxyFormState:O,get _fields(){return a},get _formValues(){return g},get _state(){return C},set _state(e){C=e},get _defaultValues(){return d},get _names(){return E},set _names(e){E=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(C.mount=!0,_={..._,...e.formState},ce({...e,formState:{...I,...e.formState}})),trigger:Ae,register:pe,handleSubmit:Ee,watch:(e,t)=>m(e)?x.state.subscribe({next:r=>"values"in r&&e(L(void 0,t),r)}):L(e,t,!0),setValue:G,getValues:oe,reset:Fe,resetField:(e,t={})=>{y(a,e)&&(h(t.defaultValue)?G(e,f(y(d,e))):(G(e,t.defaultValue),w(d,e,f(t.defaultValue))),t.keepTouched||ie(n.touchedFields,e),t.keepDirty||(ie(n.dirtyFields,e),n.isDirty=t.defaultValue?R(e,f(y(d,e))):R()),t.keepError||(ie(n.errors,e),O.isValid&&Q()),x.state.next({...n}))},clearErrors:e=>{e&&Y(e).forEach(e=>ie(n.errors,e)),x.state.next({errors:e?n.errors:{}})},unregister:fe,setError:ue,setFocus:(e,t={})=>{const r=y(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&m(e.select)&&e.select()})}},getFieldState:se};return{...xe,formControl:xe}}function _e(e={}){const t=n.useRef(void 0),r=n.useRef(void 0),[i,A]=n.useState({isDirty:!1,isValidating:!1,isLoading:m(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:m(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!m(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...n}=Fe(e);t.current={...n,formState:i}}const o=t.current.control;return o._options=e,R(()=>{const e=o._subscribe({formState:o._proxyFormState,callback:()=>A({...o._formState}),reRenderRoot:!0});return A(e=>({...e,isReady:!0})),o._formState.isReady=!0,e},[o]),n.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),n.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),n.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),n.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),n.useEffect(()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),n.useEffect(()=>{var t;e.values&&!K(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),(null===(t=o._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||o._setValid(),r.current=e.values,A(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),n.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=n.useMemo(()=>N(i,o),[o,i]),t.current}},50072(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),A=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(){function e(e,t,r,n,i,A,o,a){void 0===o&&(o=0),void 0===a&&(a=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=r,this.matrixWidth=n,this.matrixHeight=i,this.dataRegions=A,this.rsBlockData=o,this.rsBlockError=a}return e.lookup=function(e,t,r,n,i){var o,a;void 0===t&&(t=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===i&&(i=!0);try{for(var s=A(u),c=s.next();!c.done;c=s.next()){var l=c.value;if((1!==t||!l.rectangular)&&((2!==t||l.rectangular)&&(null==r||!(l.getSymbolWidth()<r.getWidth()||l.getSymbolHeight()<r.getHeight()))&&(null==n||!(l.getSymbolWidth()>n.getWidth()||l.getSymbolHeight()>n.getHeight()))&&e<=l.dataCapacity))return l}}catch(e){o={error:e}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(o)throw o.error}}if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);return null},e.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},e.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},e.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},e.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},e.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},e.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},e.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},e.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},e.prototype.getDataCapacity=function(){return this.dataCapacity},e.prototype.getErrorCodewords=function(){return this.errorCodewords},e.prototype.getDataLengthForInterleavedBlock=function(e){return this.rsBlockData},e.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},e}();const a=o;var s=function(e){function t(){return e.call(this,!1,1558,620,22,22,36,-1,62)||this}return i(t,e),t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(o),u=[new o(!1,3,5,8,8,1),new o(!1,5,7,10,10,1),new o(!0,5,7,16,6,1),new o(!1,8,10,12,12,1),new o(!0,10,11,14,6,2),new o(!1,12,12,14,14,1),new o(!0,16,14,24,10,1),new o(!1,18,14,16,16,1),new o(!1,22,18,18,18,1),new o(!0,22,18,16,10,2),new o(!1,30,20,20,20,1),new o(!0,32,24,16,14,2),new o(!1,36,24,22,22,1),new o(!1,44,28,24,24,1),new o(!0,49,28,22,14,2),new o(!1,62,36,14,14,4),new o(!1,86,42,16,16,4),new o(!1,114,48,18,18,4),new o(!1,144,56,20,20,4),new o(!1,174,68,22,22,4),new o(!1,204,84,24,24,4,102,42),new o(!1,280,112,14,14,16,140,56),new o(!1,368,144,16,16,16,92,36),new o(!1,456,192,18,18,16,114,48),new o(!1,576,224,20,20,16,144,56),new o(!1,696,272,22,22,16,174,68),new o(!1,816,336,24,24,16,136,56),new o(!1,1050,408,18,18,36,175,68),new o(!1,1304,496,20,20,36,163,62),new s]},50113(e,t,r){"use strict";var n=r(46518),i=r(59213).find,A=r(6469),o="find",a=!0;o in[]&&Array(1)[o](function(){a=!1}),n({target:"Array",proto:!0,forced:a},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),A(o)},50483(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(80442),i=r(28823),A=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const o=function(){function e(){}return e.prototype.PDF417Common=function(){},e.getBitCountSum=function(e){return i.A.sum(e)},e.toIntArray=function(t){var r,n;if(null==t||!t.length)return e.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),o=0;try{for(var a=A(t),s=a.next();!s.done;s=a.next()){var u=s.value;i[o++]=u}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},e.getCodeword=function(t){var r=n.A.binarySearch(e.SYMBOL_TABLE,262143&t);return r<0?-1:(e.CODEWORD_TABLE[r]-1)%e.NUMBER_OF_CODEWORDS},e.NUMBER_OF_CODEWORDS=929,e.MAX_CODEWORDS_IN_BARCODE=e.NUMBER_OF_CODEWORDS-1,e.MIN_ROWS_IN_BARCODE=3,e.MAX_ROWS_IN_BARCODE=90,e.MODULES_IN_CODEWORD=17,e.MODULES_IN_STOP_PATTERN=18,e.BARS_IN_MODULE=8,e.EMPTY_INT_ARRAY=new Int32Array([]),e.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),e.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),e}()},50735(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(88468);const i=function(){function e(){this.maskPattern=-1}return e.prototype.getMode=function(){return this.mode},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getVersion=function(){return this.version},e.prototype.getMaskPattern=function(){return this.maskPattern},e.prototype.getMatrix=function(){return this.matrix},e.prototype.toString=function(){var e=new n.A;return e.append("<<\n"),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append("\n ecLevel: "),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append("\n version: "),e.append(this.version?this.version.toString():"null"),e.append("\n maskPattern: "),e.append(this.maskPattern.toString()),this.matrix?(e.append("\n matrix:\n"),e.append(this.matrix.toString())):e.append("\n matrix: null\n"),e.append(">>\n"),e.toString()},e.prototype.setMode=function(e){this.mode=e},e.prototype.setECLevel=function(e){this.ecLevel=e},e.prototype.setVersion=function(e){this.version=e},e.prototype.setMaskPattern=function(e){this.maskPattern=e},e.prototype.setMatrix=function(e){this.matrix=e},e.isValidMaskPattern=function(t){return t>=0&&t<e.NUM_MASK_PATTERNS},e.NUM_MASK_PATTERNS=8,e}()},50998(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(23110);const i=function(){function e(){}return e.setGridSampler=function(t){e.gridSampler=t},e.getInstance=function(){return e.gridSampler},e.gridSampler=new n.A,e}()},51084(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(e,t,r,n,i,A){void 0===i&&(i=-1),void 0===A&&(A=-1),this.rawBytes=e,this.text=t,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=A,this.numBits=null==e?0:8*e.length}return e.prototype.getRawBytes=function(){return this.rawBytes},e.prototype.getNumBits=function(){return this.numBits},e.prototype.setNumBits=function(e){this.numBits=e},e.prototype.getText=function(){return this.text},e.prototype.getByteSegments=function(){return this.byteSegments},e.prototype.getECLevel=function(){return this.ecLevel},e.prototype.getErrorsCorrected=function(){return this.errorsCorrected},e.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},e.prototype.getErasures=function(){return this.erasures},e.prototype.setErasures=function(e){this.erasures=e},e.prototype.getOther=function(){return this.other},e.prototype.setOther=function(e){this.other=e},e.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},e.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},e.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},e}()},51481(e,t,r){"use strict";var n=r(46518),i=r(36043);n({target:"Promise",stat:!0,forced:r(10916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},52185(e,t,r){"use strict";r.d(t,{A:()=>o});var n,i=r(15747),A=r(57149);!function(e){e[e.L=0]="L",e[e.M=1]="M",e[e.Q=2]="Q",e[e.H=3]="H"}(n||(n={}));const o=function(){function e(t,r,n){this.value=t,this.stringValue=r,this.bits=n,e.FOR_BITS.set(n,this),e.FOR_VALUE.set(t,this)}return e.prototype.getValue=function(){return this.value},e.prototype.getBits=function(){return this.bits},e.fromString=function(t){switch(t){case"L":return e.L;case"M":return e.M;case"Q":return e.Q;case"H":return e.H;default:throw new i.A(t+"not available")}},e.prototype.toString=function(){return this.stringValue},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.value===r.value},e.forBits=function(t){if(t<0||t>=e.FOR_BITS.size)throw new A.A;return e.FOR_BITS.get(t)},e.FOR_BITS=new Map,e.FOR_VALUE=new Map,e.L=new e(n.L,"L",1),e.M=new e(n.M,"M",0),e.Q=new e(n.Q,"Q",3),e.H=new e(n.H,"H",2),e}()},52520(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isPrimitive=function(e){return null==e||"object"!=typeof e&&"function"!=typeof e}},52703(e,t,r){"use strict";var n=r(44576),i=r(79039),A=r(79504),o=r(655),a=r(43802).trim,s=r(47452),u=n.parseInt,c=n.Symbol,l=c&&c.iterator,f=/^[+-]?0x/i,d=A(f.exec),h=8!==u(s+"08")||22!==u(s+"0x16")||l&&!i(function(){u(Object(l))});e.exports=h?function(e,t){var r=a(o(e));return u(r,t>>>0||(d(f,r)?16:10))}:u},52775(e,t,r){"use strict";r.d(t,{Zq:()=>A,zs:()=>i});var n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i=new class{#j=n;#V=!1;setTimeoutProvider(e){this.#j=e}setTimeout(e,t){return this.#j.setTimeout(e,t)}clearTimeout(e){this.#j.clearTimeout(e)}setInterval(e,t){return this.#j.setInterval(e,t)}clearInterval(e){this.#j.clearInterval(e)}};function A(e){setTimeout(e,0)}},52810(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(8805),i=r(6858),A=r(36440),o=r(78161),a=r(28202);t.uniqBy=function(e,t=A.identity){return o.isArrayLikeObject(e)?n.uniqBy(Array.from(e),i.ary(a.iteratee(t),1)):[]}},52891(e,t,r){"use strict";r.d(t,{lg:()=>$,xI:()=>ue});class n{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{const r=e.index,n=t.index;return r<n?-1:r>n?1:0})}}class i{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:r,eventOptions:n}=e,i=this.fetchEventListenerMapForEventTarget(t),A=this.cacheKey(r,n);i.delete(A),0==i.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){const n=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,r);let A=n.get(i);return A||(A=this.createEventListener(e,t,r),n.set(i,A)),A}createEventListener(e,t,r){const i=new n(e,t,r);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const r=[e];return Object.keys(t).sort().forEach(e=>{r.push(`${t[e]?"":"!"}${e}`)}),r.join(":")}}const A={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:r})=>!t||r===e.target},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function a(e){return"window"==e?window:"document"==e?document:void 0}function s(e){return e.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function u(e){return s(e.replace(/--/g,"-").replace(/__/g,"_"))}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e){return e.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function f(e){return null!=e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const h=["meta","ctrl","alt","shift"];class p{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||function(e){const t=e.tagName.toLowerCase();if(t in g)return g[t](e)}(e)||y("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||y("missing identifier"),this.methodName=r.methodName||y("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(o)||[];let r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:a(t[4]),eventName:r,eventOptions:t[7]?(i=t[7],i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n};var i}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const r=t.filter(e=>!h.includes(e))[0];return!!r&&(d(this.keyMappings,r)||y(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:r,value:n}of Array.from(this.element.attributes)){const i=r.match(t),A=i&&i[1];A&&(e[s(A)]=v(n))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[r,n,i,A]=h.map(e=>t.includes(e));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==i||e.shiftKey!==A}}const g={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function y(e){throw new Error(e)}function v(e){try{return JSON.parse(e)}catch(t){return e}}class m{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context;let i=!0;for(const[A,o]of Object.entries(this.eventOptions))if(A in r){const a=r[A];i=i&&a({name:A,value:o,event:e,element:t,controller:n})}return i}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(t){const{identifier:r,controller:n,element:i,index:A}=this,o={identifier:r,controller:n,element:i,index:A,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class w{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class b{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new w(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function B(e,t,r){E(e,t).add(r)}function C(e,t,r){E(e,t).delete(r),function(e,t){const r=e.get(t);null!=r&&0==r.size&&e.delete(t)}(e,t)}function E(e,t){let r=e.get(t);return r||(r=new Set,e.set(t,r)),r}class S{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e.concat(Array.from(t)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e+t.size,0)}add(e,t){B(this.valuesByKey,e,t)}delete(e,t){C(this.valuesByKey,e,t)}has(e,t){const r=this.valuesByKey.get(e);return null!=r&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(t=>t.has(e))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([e,t])=>e)}}class I{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new w(e,this),this.delegate=r,this.matchesByElement=new S}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter(e=>this.matchElement(e));return r.concat(n)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){const{selector:r}=this;if(r){const t=this.matchElement(e),n=this.matchesByElement.has(r,e);t&&!n?this.selectorMatched(e,r):!t&&n&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class O{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const r=this.delegate.getStringMapKeyForAttribute(e);if(null!=r){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);const n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),null==n){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(r,e,t)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class F{constructor(e,t,r){this.attributeObserver=new b(e,t,this),this.delegate=r,this.tokensByElement=new S}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(e=>this.tokenMatched(e))}tokensUnmatched(e){e.forEach(e=>this.tokenUnmatched(e))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=function(e,t){const r=Math.max(e.length,t.length);return Array.from({length:r},(r,n)=>[e[n],t[n]])}(t,r).findIndex(([e,t])=>{return n=t,!((r=e)&&n&&r.index==n.index&&r.content==n.content);var r,n});return-1==n?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,r){return e.trim().split(/\s+/).filter(e=>e.length).map((e,n)=>({element:t,attributeName:r,content:e,index:n}))}(e.getAttribute(t)||"",e,t)}}class _{constructor(e,t,r){this.tokenListObserver=new F(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){const{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class x{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new _(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new m(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){const t=p.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class U{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new O(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){const n=this.valueDescriptorNameMap[t];null!==e&&(null===r&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){const n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)null==r||this.controller.data.has(e)||this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){const n=`${e}Changed`,i=this.receiver[n];if("function"==typeof i){const n=this.valueDescriptorNameMap[e];try{const e=n.reader(t);let A=r;r&&(A=n.reader(r)),i.call(this.receiver,e,A)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${n.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{const r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){const t=`has${c(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class Q{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new S}start(){this.tokenListObserver||(this.tokenListObserver=new F(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(r=this.tokenListObserver)||void 0===r||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(r=this.tokenListObserver)||void 0===r||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function T(e,t){const r=P(e);return Array.from(r.reduce((e,r)=>(function(e,t){const r=e[t];return Array.isArray(r)?r:[]}(r,t).forEach(t=>e.add(t)),e),new Set))}function M(e,t){return P(e).reduce((e,r)=>(e.push(...function(e,t){const r=e[t];return r?Object.keys(r).map(e=>[e,r[e]]):[]}(r,t)),e),[])}function P(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class D{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new S,this.outletElementsByName=new S,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:r}){const n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){const n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){const r=this.selector(t),n=this.hasOutlet(e,t),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!r&&(n&&i&&e.matches(r))}elementMatchedAttribute(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){const r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),null===(n=this.selectorObserverMap.get(r))||void 0===n||n.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),null===(n=this.selectorObserverMap.get(r))||void 0===n||n.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),r=new I(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),r=new b(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){const e=new S;return this.router.modules.forEach(t=>{T(t.definition.controllerConstructor,"outlets").forEach(r=>e.add(r,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(t=>t.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class k{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:r,controller:n,element:i}=this;t=Object.assign({identifier:r,controller:n,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new x(this,this.dispatcher),this.valueObserver=new U(this,this.controller),this.targetObserver=new Q(this,this),this.outletObserver=new D(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){const{identifier:n,controller:i,element:A}=this;r=Object.assign({identifier:n,controller:i,element:A},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${u(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${u(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const r=this.controller;"function"==typeof r[e]&&r[e](...t)}}function N(e){return function(e,t){const r=L(e),n=function(e,t){return R(t).reduce((r,n)=>{const i=function(e,t,r){const n=Object.getOwnPropertyDescriptor(e,r);if(!n||!("value"in n)){const e=Object.getOwnPropertyDescriptor(t,r).value;return n&&(e.get=n.get||e.get,e.set=n.set||e.set),e}}(e,t,n);return i&&Object.assign(r,{[n]:i}),r},{})}(e.prototype,t);return Object.defineProperties(r.prototype,n),r}(e,function(e){const t=T(e,"blessings");return t.reduce((t,r)=>{const n=r(e);for(const e in n){const r=t[e]||{};t[e]=Object.assign(r,n[e])}return t},{})}(e))}const R="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,L=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e(function(){this.a.call(this)});t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class H{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:N(e.controllerConstructor)}}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new k(this,e),this.contextsByScope.set(e,t)),t}}class j{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return t.match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class V{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${l(e)}`}}class K{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}}function z(e,t){return`[${e}~="${t}"]`}class G{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)],[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return z(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(t=>this.deprecate(t,e))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return z(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:r}=this,n=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${i}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class W{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findOutlet(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllOutlets(t)],[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(r=>this.matchesElement(r,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(r=>this.matchesElement(r,e,t))}matchesElement(e,t,r){const n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}}class X{constructor(e,t,r,n){this.targets=new G(this),this.classes=new j(this),this.data=new V(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new K(n),this.outlets=new W(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return z(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new X(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class Y{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new _(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){const r=this.fetchScopesByIdentifierForElement(e);let n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){const r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),1==r&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),1==r&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class Z{constructor(e){this.application=e,this.scopeObserver=new Y(this.element,this.schema,this),this.scopesByIdentifier=new S,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new H(this.application,e);this.connectModule(t);const r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(t=>t.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){const r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new X(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.connectContextForScope(t))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.disconnectContextForScope(t))}}const q={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},J("abcdefghijklmnopqrstuvwxyz".split("").map(e=>[e,e]))),J("0123456789".split("").map(e=>[e,e])))};function J(e){return e.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}class ${constructor(e=document.documentElement,t=q){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,r={})=>{this.debug&&this.logFormattedMessage(e,t,r)},this.element=e,this.schema=t,this.dispatcher=new i(this),this.router=new Z(this),this.actionDescriptorFilters=Object.assign({},A)}static start(e,t){const r=new this(e,t);return r.start(),r}async start(){await new Promise(e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",()=>e()):e()}),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>this.router.unloadIdentifier(e))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){const r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error("%s\n\n%o\n\n%o",t,e,r),null===(n=window.onerror)||void 0===n||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}}function ee(e,t,r){return e.application.getControllerForElementAndIdentifier(t,r)}function te(e,t,r){let n=ee(e,t,r);return n||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,r),n=ee(e,t,r),n||void 0)}function re([e,t],r){return function(e){const{token:t,typeDefinition:r}=e,n=`${l(t)}-value`,i=function(e){const{controller:t,token:r,typeDefinition:n}=e,i={controller:t,token:r,typeObject:n},A=function(e){const{controller:t,token:r,typeObject:n}=e,i=f(n.type),A=f(n.default),o=i&&A,a=i&&!A,s=!i&&A,u=ne(n.type),c=ie(e.typeObject.default);if(a)return u;if(s)return c;if(u!==c){throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${r}`:r}" must match the defined type "${u}". The provided default value of "${n.default}" is of type "${c}".`)}if(o)return u}(i),o=ie(n),a=ne(n),s=A||o||a;if(s)return s;const u=t?`${t}.${n}`:r;throw new Error(`Unknown value type "${u}" for "${r}" value`)}(e);return{type:i,key:n,name:s(n),get defaultValue(){return function(e){const t=ne(e);if(t)return Ae[t];const r=d(e,"default"),n=d(e,"type"),i=e;if(r)return i.default;if(n){const{type:e}=i,t=ne(e);if(t)return Ae[t]}return e}(r)},get hasCustomDefaultValue(){return void 0!==ie(r)},reader:oe[i],writer:ae[i]||ae.default}}({controller:r,token:e,typeDefinition:t})}function ne(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function ie(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const Ae={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},oe={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${ie(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${ie(t)}"`);return t},string:e=>e},ae={default:function(e){return`${e}`},array:se,object:se};function se(e){return JSON.stringify(e)}class ue{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:n=this.identifier,bubbles:i=!0,cancelable:A=!0}={}){const o=new CustomEvent(n?`${n}:${e}`:e,{detail:r,bubbles:i,cancelable:A});return t.dispatchEvent(o),o}}ue.blessings=[function(e){return T(e,"classes").reduce((e,t)=>{return Object.assign(e,(r=t,{[`${r}Class`]:{get(){const{classes:e}=this;if(e.has(r))return e.get(r);{const t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${c(r)}Class`]:{get(){return this.classes.has(r)}}}));var r},{})},function(e){return T(e,"targets").reduce((e,t)=>{return Object.assign(e,(r=t,{[`${r}Target`]:{get(){const e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${c(r)}Target`]:{get(){return this.targets.has(r)}}}));var r},{})},function(e){const t=M(e,"values"),r={valueDescriptorMap:{get(){return t.reduce((e,t)=>{const r=re(t,this.identifier),n=this.data.getAttributeNameForKey(r.key);return Object.assign(e,{[n]:r})},{})}}};return t.reduce((e,t)=>Object.assign(e,function(e,t){const r=re(e,t),{key:n,name:i,reader:A,writer:o}=r;return{[i]:{get(){const e=this.data.get(n);return null!==e?A(e):r.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,o(e))}},[`has${c(i)}`]:{get(){return this.data.has(n)||r.hasCustomDefaultValue}}}}(t)),r)},function(e){return T(e,"outlets").reduce((e,t)=>Object.assign(e,function(e){const t=u(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),r=this.outlets.getSelectorForOutletName(e);if(t){const r=te(this,t,e);if(r)return r;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map(t=>{const r=te(this,t,e);if(r)return r;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)}).filter(e=>e):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),r=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${c(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t)),{})}],ue.targets=[],ue.outlets=[],ue.values={}},53030(e,t,r){"use strict";r.d(t,{A:()=>u});var n,i=r(82389),A=r(26741),o=r(23431),a=r(58503),s=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const u=function(e){function t(r){var n=e.call(this,r)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return s(t,e),t.prototype.getBlackRow=function(e,r){var n=this.getLuminanceSource(),i=n.getWidth();null==r||r.getSize()<i?r=new A.A(i):r.clear(),this.initArrays(i);for(var o=n.getRow(e,this.luminances),a=this.buckets,s=0;s<i;s++)a[(255&o[s])>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(a);if(i<3)for(s=0;s<i;s++)(255&o[s])<u&&r.set(s);else{var c=255&o[0],l=255&o[1];for(s=1;s<i-1;s++){var f=255&o[s+1];(4*l-c-f)/2<u&&r.set(s),c=l,l=f}}return r},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),r=e.getWidth(),n=e.getHeight(),i=new o.A(r,n);this.initArrays(r);for(var A=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=e.getRow(s,this.luminances),c=Math.floor(4*r/5),l=Math.floor(r/5);l<c;l++){A[(255&u[l])>>t.LUMINANCE_SHIFT]++}var f=t.estimateBlackPoint(A),d=e.getMatrix();for(a=0;a<n;a++){var h=a*r;for(l=0;l<r;l++){(255&d[h+l])<f&&i.set(l,a)}}return i},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var r=this.buckets,n=0;n<t.LUMINANCE_BUCKETS;n++)r[n]=0},t.estimateBlackPoint=function(e){for(var r=e.length,n=0,i=0,A=0,o=0;o<r;o++)e[o]>A&&(i=o,A=e[o]),e[o]>n&&(n=e[o]);var s=0,u=0;for(o=0;o<r;o++){var c=o-i;(h=e[o]*c*c)>u&&(s=o,u=h)}if(i>s){var l=i;i=s,s=l}if(s-i<=r/16)throw new a.A;var f=s-1,d=-1;for(o=s-1;o>i;o--){var h,p=o-i;(h=p*p*(s-o)*(n-e[o]))>d&&(f=o,d=h)}return f<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(i.A)},53036(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(40717),i=r(21465),A=r(73923),o=r(54200),a=r(17324);t.matchesProperty=function(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=i.toKey(e)}return t=A.cloneDeep(t),function(r){const i=o.get(r,e);return void 0===i?a.has(r,e):void 0===t?void 0===i:n.isMatch(i,t)}}},53482(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function A(e,t,r){return(t=i(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){A(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,A,o,a=[],s=!0,u=!1;try{if(A=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=A.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}r.d(t,{Ay:()=>Un});var f=r(96540),d=r.t(f,2),h=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(null,arguments)}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}function w(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function b(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var B=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),C=Math.abs,E=String.fromCharCode,S=Object.assign;function I(e){return e.trim()}function O(e,t,r){return e.replace(t,r)}function F(e,t){return e.indexOf(t)}function _(e,t){return 0|e.charCodeAt(t)}function x(e,t,r){return e.slice(t,r)}function U(e){return e.length}function Q(e){return e.length}function T(e,t){return t.push(e),e}var M=1,P=1,D=0,k=0,N=0,R="";function L(e,t,r,n,i,A,o){return{value:e,root:t,parent:r,type:n,props:i,children:A,line:M,column:P,length:o,return:""}}function H(e,t){return S(L("",null,null,"",null,null,0),e,{length:-e.length},t)}function j(){return N=k>0?_(R,--k):0,P--,10===N&&(P=1,M--),N}function V(){return N=k<D?_(R,k++):0,P++,10===N&&(P=1,M++),N}function K(){return _(R,k)}function z(){return k}function G(e,t){return x(R,e,t)}function W(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function X(e){return M=P=1,D=U(R=e),k=0,[]}function Y(e){return R="",e}function Z(e){return I(G(k-1,$(91===e?e+2:40===e?e+1:e)))}function q(e){for(;(N=K())&&N<33;)V();return W(e)>2||W(N)>3?"":" "}function J(e,t){for(;--t&&V()&&!(N<48||N>102||N>57&&N<65||N>70&&N<97););return G(e,z()+(t<6&&32==K()&&32==V()))}function $(e){for(;V();)switch(N){case e:return k;case 34:case 39:34!==e&&39!==e&&$(N);break;case 40:41===e&&$(e);break;case 92:V()}return k}function ee(e,t){for(;V()&&e+N!==57&&(e+N!==84||47!==K()););return"/*"+G(t,k-1)+"*"+E(47===e?e:V())}function te(e){for(;!W(K());)V();return G(e,k)}var re="-ms-",ne="-moz-",ie="-webkit-",Ae="comm",oe="rule",ae="decl",se="@keyframes";function ue(e,t){for(var r="",n=Q(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function ce(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case ae:return e.return=e.return||e.value;case Ae:return"";case se:return e.return=e.value+"{"+ue(e.children,n)+"}";case oe:e.value=e.props.join(",")}return U(r=ue(e.children,n))?e.return=e.value+"{"+r+"}":""}function le(e){return Y(fe("",null,null,null,[""],e=X(e),0,[0],e))}function fe(e,t,r,n,i,A,o,a,s){for(var u=0,c=0,l=o,f=0,d=0,h=0,p=1,g=1,y=1,v=0,m="",w=i,b=A,B=n,C=m;g;)switch(h=v,v=V()){case 40:if(108!=h&&58==_(C,l-1)){-1!=F(C+=O(Z(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:C+=Z(v);break;case 9:case 10:case 13:case 32:C+=q(h);break;case 92:C+=J(z()-1,7);continue;case 47:switch(K()){case 42:case 47:T(he(ee(V(),z()),t,r),s);break;default:C+="/"}break;case 123*p:a[u++]=U(C)*y;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+c:-1==y&&(C=O(C,/\f/g,"")),d>0&&U(C)-l&&T(d>32?pe(C+";",n,r,l-1):pe(O(C," ","")+";",n,r,l-2),s);break;case 59:C+=";";default:if(T(B=de(C,t,r,u,c,i,a,m,w=[],b=[],l),A),123===v)if(0===c)fe(C,t,B,B,w,A,l,a,b);else switch(99===f&&110===_(C,3)?100:f){case 100:case 108:case 109:case 115:fe(e,B,B,n&&T(de(e,B,B,0,0,i,a,m,i,w=[],l),b),i,b,l,a,n?w:b);break;default:fe(C,B,B,B,[""],b,0,a,b)}}u=c=d=0,p=y=1,m=C="",l=o;break;case 58:l=1+U(C),d=h;default:if(p<1)if(123==v)--p;else if(125==v&&0==p++&&125==j())continue;switch(C+=E(v),v*p){case 38:y=c>0?1:(C+="\f",-1);break;case 44:a[u++]=(U(C)-1)*y,y=1;break;case 64:45===K()&&(C+=Z(V())),f=K(),c=l=U(m=C+=te(z())),v++;break;case 45:45===h&&2==U(C)&&(p=0)}}return A}function de(e,t,r,n,i,A,o,a,s,u,c){for(var l=i-1,f=0===i?A:[""],d=Q(f),h=0,p=0,g=0;h<n;++h)for(var y=0,v=x(e,l+1,l=C(p=o[h])),m=e;y<d;++y)(m=I(p>0?f[y]+" "+v:O(v,/&\f/g,f[y])))&&(s[g++]=m);return L(e,t,r,0===i?oe:a,s,u,c)}function he(e,t,r){return L(e,t,r,Ae,E(N),x(e,2,-2),0)}function pe(e,t,r,n){return L(e,t,r,ae,x(e,0,n),x(e,n+1,-1),n)}var ge=function(e,t,r){for(var n=0,i=0;n=i,i=K(),38===n&&12===i&&(t[r]=1),!W(i);)V();return G(e,k)},ye=function(e,t){return Y(function(e,t){var r=-1,n=44;do{switch(W(n)){case 0:38===n&&12===K()&&(t[r]=1),e[r]+=ge(k-1,t,r);break;case 2:e[r]+=Z(n);break;case 4:if(44===n){e[++r]=58===K()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=E(n)}}while(n=V());return e}(X(e),t))},ve=new WeakMap,me=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ve.get(r))&&!n){ve.set(e,!0);for(var i=[],A=ye(t,i),o=r.props,a=0,s=0;a<A.length;a++)for(var u=0;u<o.length;u++,s++)e.props[s]=i[a]?A[a].replace(/&\f/g,o[u]):o[u]+" "+A[a]}}},we=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function be(e,t){switch(function(e,t){return 45^_(e,0)?(((t<<2^_(e,0))<<2^_(e,1))<<2^_(e,2))<<2^_(e,3):0}(e,t)){case 5103:return ie+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ie+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ie+e+ne+e+re+e+e;case 6828:case 4268:return ie+e+re+e+e;case 6165:return ie+e+re+"flex-"+e+e;case 5187:return ie+e+O(e,/(\w+).+(:[^]+)/,ie+"box-$1$2"+re+"flex-$1$2")+e;case 5443:return ie+e+re+"flex-item-"+O(e,/flex-|-self/,"")+e;case 4675:return ie+e+re+"flex-line-pack"+O(e,/align-content|flex-|-self/,"")+e;case 5548:return ie+e+re+O(e,"shrink","negative")+e;case 5292:return ie+e+re+O(e,"basis","preferred-size")+e;case 6060:return ie+"box-"+O(e,"-grow","")+ie+e+re+O(e,"grow","positive")+e;case 4554:return ie+O(e,/([^-])(transform)/g,"$1"+ie+"$2")+e;case 6187:return O(O(O(e,/(zoom-|grab)/,ie+"$1"),/(image-set)/,ie+"$1"),e,"")+e;case 5495:case 3959:return O(e,/(image-set\([^]*)/,ie+"$1$`$1");case 4968:return O(O(e,/(.+:)(flex-)?(.*)/,ie+"box-pack:$3"+re+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ie+e+e;case 4095:case 3583:case 4068:case 2532:return O(e,/(.+)-inline(.+)/,ie+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(U(e)-1-t>6)switch(_(e,t+1)){case 109:if(45!==_(e,t+4))break;case 102:return O(e,/(.+:)(.+)-([^]+)/,"$1"+ie+"$2-$3$1"+ne+(108==_(e,t+3)?"$3":"$2-$3"))+e;case 115:return~F(e,"stretch")?be(O(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==_(e,t+1))break;case 6444:switch(_(e,U(e)-3-(~F(e,"!important")&&10))){case 107:return O(e,":",":"+ie)+e;case 101:return O(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ie+(45===_(e,14)?"inline-":"")+"box$3$1"+ie+"$2$3$1"+re+"$2box$3")+e}break;case 5936:switch(_(e,t+11)){case 114:return ie+e+re+O(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ie+e+re+O(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ie+e+re+O(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ie+e+re+e+e}return e}var Be=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case ae:e.return=be(e.value,e.length);break;case se:return ue([H(e,{value:O(e.value,"@","@"+ie)})],n);case oe:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ue([H(e,{props:[O(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return ue([H(e,{props:[O(t,/:(plac\w+)/,":"+ie+"input-$1")]}),H(e,{props:[O(t,/:(plac\w+)/,":-moz-$1")]}),H(e,{props:[O(t,/:(plac\w+)/,re+"input-$1")]})],n)}return""})}}],Ce=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var n,i,A=e.stylisPlugins||Be,o={},a=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)o[t[r]]=!0;a.push(e)});var s,u,c,l,f=[ce,(l=function(e){s.insert(e)},function(e){e.root||(e=e.return)&&l(e)})],d=(u=[me,we].concat(A,f),c=Q(u),function(e,t,r,n){for(var i="",A=0;A<c;A++)i+=u[A](e,t,r,n)||"";return i});i=function(e,t,r,n){s=r,ue(le(e?e+"{"+t.styles+"}":t.styles),d),n&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new B({key:t,container:n,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:i};return h.sheet.hydrate(a),h};var Ee=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)};var Se={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Ie(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var Oe=/[A-Z]|^ms/g,Fe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,_e=function(e){return 45===e.charCodeAt(1)},xe=function(e){return null!=e&&"boolean"!=typeof e},Ue=Ie(function(e){return _e(e)?e:e.replace(Oe,"-$&").toLowerCase()}),Qe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Fe,function(e,t,r){return Me={name:t,styles:r,next:Me},t})}return 1===Se[e]||_e(e)||"number"!=typeof t||0===t?t:t+"px"};function Te(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var i=r;if(1===i.anim)return Me={name:i.name,styles:i.styles,next:Me},i.name;var A=r;if(void 0!==A.styles){var o=A.next;if(void 0!==o)for(;void 0!==o;)Me={name:o.name,styles:o.styles,next:Me},o=o.next;return A.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Te(e,t,r[i])+";";else for(var A in r){var o=r[A];if("object"!=typeof o){var a=o;null!=t&&void 0!==t[a]?n+=A+"{"+t[a]+"}":xe(a)&&(n+=Ue(A)+":"+Qe(A,a)+";")}else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var s=Te(e,t,o);switch(A){case"animation":case"animationName":n+=Ue(A)+":"+s+";";break;default:n+=A+"{"+s+"}"}}else for(var u=0;u<o.length;u++)xe(o[u])&&(n+=Ue(A)+":"+Qe(A,o[u])+";")}return n}(e,t,r);case"function":if(void 0!==e){var a=Me,s=r(e);return Me=a,Te(e,t,s)}}var u=r;if(null==t)return u;var c=t[u];return void 0!==c?c:u}var Me,Pe=/label:\s*([^\s;{]+)\s*(;|$)/g;function De(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";Me=void 0;var A=e[0];null==A||void 0===A.raw?(n=!1,i+=Te(r,t,A)):i+=A[0];for(var o=1;o<e.length;o++){if(i+=Te(r,t,e[o]),n)i+=A[o]}Pe.lastIndex=0;for(var a,s="";null!==(a=Pe.exec(i));)s+="-"+a[1];var u=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+s;return{name:u,styles:i,next:Me}}var ke=!!d.useInsertionEffect&&d.useInsertionEffect,Ne=ke||function(e){return e()},Re=(ke||f.useLayoutEffect,f.createContext("undefined"!=typeof HTMLElement?Ce({key:"css"}):null)),Le=(Re.Provider,function(e){return(0,f.forwardRef)(function(t,r){var n=(0,f.useContext)(Re);return e(t,n,r)})}),He=f.createContext({});var je,Ve,Ke={}.hasOwnProperty,ze="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ge=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return Ee(t,r,n),Ne(function(){return function(e,t,r){Ee(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)}),null},We=Le(function(e,t,r){var n=e.css;"string"==typeof n&&void 0!==t.registered[n]&&(n=t.registered[n]);var i=e[ze],A=[n],o="";"string"==typeof e.className?o=function(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")}),n}(t.registered,A,e.className):null!=e.className&&(o=e.className+" ");var a=De(A,void 0,f.useContext(He));o+=t.key+"-"+a.name;var s={};for(var u in e)Ke.call(e,u)&&"css"!==u&&u!==ze&&(s[u]=e[u]);return s.className=o,r&&(s.ref=r),f.createElement(f.Fragment,null,f.createElement(Ge,{cache:t,serialized:a,isStringTag:"string"==typeof i}),f.createElement(i,s))}),Xe=We,Ye=(r(4146),function(e,t){var r=arguments;if(null==t||!Ke.call(t,"css"))return f.createElement.apply(void 0,r);var n=r.length,i=new Array(n);i[0]=Xe,i[1]=function(e,t){var r={};for(var n in t)Ke.call(t,n)&&(r[n]=t[n]);return r[ze]=e,r}(e,t);for(var A=2;A<n;A++)i[A]=r[A];return f.createElement.apply(null,i)});je=Ye||(Ye={}),Ve||(Ve=je.JSX||(je.JSX={}));function Ze(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return De(t)}var qe=r(40961);const Je=Math.min,$e=Math.max,et=Math.round,tt=Math.floor,rt=e=>({x:e,y:e});function nt(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function it(){return"undefined"!=typeof window}function At(e){return st(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function at(e){var t;return null==(t=(st(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function st(e){return!!it()&&(e instanceof Node||e instanceof ot(e).Node)}function ut(e){return!!it()&&(e instanceof Element||e instanceof ot(e).Element)}function ct(e){return!!it()&&(e instanceof HTMLElement||e instanceof ot(e).HTMLElement)}function lt(e){return!(!it()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot)}function ft(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=gt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==i&&"contents"!==i}let dt;function ht(){return null==dt&&(dt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dt}function pt(e){return/^(html|body|#document)$/.test(At(e))}function gt(e){return ot(e).getComputedStyle(e)}function yt(e){if("html"===At(e))return e;const t=e.assignedSlot||e.parentNode||lt(e)&&e.host||at(e);return lt(t)?t.host:t}function vt(e){const t=yt(e);return pt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&ft(t)?t:vt(t)}function mt(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const i=vt(e),A=i===(null==(n=e.ownerDocument)?void 0:n.body),o=ot(i);if(A){const e=wt(o);return t.concat(o,o.visualViewport||[],ft(i)?i:[],e&&r?mt(e):[])}return t.concat(i,mt(i,[],r))}function wt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bt(e){const t=gt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=ct(e),A=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=et(r)!==A||et(n)!==o;return a&&(r=A,n=o),{width:r,height:n,$:a}}function Bt(e){return ut(e)?e:e.contextElement}function Ct(e){const t=Bt(e);if(!ct(t))return rt(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:A}=bt(t);let o=(A?et(r.width):r.width)/n,a=(A?et(r.height):r.height)/i;return o&&Number.isFinite(o)||(o=1),a&&Number.isFinite(a)||(a=1),{x:o,y:a}}const Et=rt(0);function St(e){const t=ot(e);return ht()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Et}function It(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const i=e.getBoundingClientRect(),A=Bt(e);let o=rt(1);t&&(n?ut(n)&&(o=Ct(n)):o=Ct(e));const a=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==ot(e))&&t}(A,r,n)?St(A):rt(0);let s=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,c=i.width/o.x,l=i.height/o.y;if(A){const e=ot(A),t=n&&ut(n)?ot(n):n;let r=e,i=wt(r);for(;i&&n&&t!==r;){const e=Ct(i),t=i.getBoundingClientRect(),n=gt(i),A=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;s*=e.x,u*=e.y,c*=e.x,l*=e.y,s+=A,u+=o,r=ot(i),i=wt(r)}}return nt({width:c,height:l,x:s,y:u})}function Ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ft(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:i=!0,ancestorResize:A=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,u=Bt(e),c=i||A?[...u?mt(u):[],...t?mt(t):[]]:[];c.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),A&&e.addEventListener("resize",r)});const l=u&&a?function(e,t){let r,n=null;const i=at(e);function A(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function o(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),A();const u=e.getBoundingClientRect(),{left:c,top:l,width:f,height:d}=u;if(a||t(),!f||!d)return;const h={rootMargin:-tt(l)+"px "+-tt(i.clientWidth-(c+f))+"px "+-tt(i.clientHeight-(l+d))+"px "+-tt(c)+"px",threshold:$e(0,Je(1,s))||1};let p=!0;function g(t){const n=t[0].intersectionRatio;if(n!==s){if(!p)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==n||Ot(u,e.getBoundingClientRect())||o(),p=!1}try{n=new IntersectionObserver(g,{...h,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),A}(u,r):null;let f,d=-1,h=null;o&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),u&&!s&&h.observe(u),t&&h.observe(t));let p=s?It(e):null;return s&&function t(){const n=It(e);p&&!Ot(p,n)&&r();p=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;c.forEach(e=>{i&&e.removeEventListener("scroll",r),A&&e.removeEventListener("resize",r)}),null==l||l(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(f)}}var _t=f.useLayoutEffect,xt=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ut=function(){};function Qt(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Tt(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];var A=[].concat(n);if(t&&e)for(var o in t)t.hasOwnProperty(o)&&t[o]&&A.push("".concat(Qt(e,o)));return A.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var Mt=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===n(e)&&null!==e?[e]:[];var t},Pt=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,a({},l(e,xt))},Dt=function(e,t,r){var n=e.cx,i=e.getStyles,A=e.getClassNames,o=e.className;return{css:i(t,e),className:n(null!=r?r:{},A(t,e),o)}};function kt(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Nt(e){return kt(e)?window.pageYOffset:e.scrollTop}function Rt(e,t){kt(e)?window.scrollTo(0,t):e.scrollTop=t}function Lt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ut,i=Nt(e),A=t-i,o=0;!function t(){var a,s=A*((a=(a=o+=10)/r-1)*a*a+1)+i;Rt(e,s),o<r?window.requestAnimationFrame(t):n(e)}()}function Ht(e,t){var r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),i=t.offsetHeight/3;n.bottom+i>r.bottom?Rt(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):n.top-i<r.top&&Rt(e,Math.max(t.offsetTop-i,0))}function jt(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var Vt=!1,Kt={get passive(){return Vt=!0}},zt="undefined"!=typeof window?window:{};zt.addEventListener&&zt.removeEventListener&&(zt.addEventListener("p",Ut,Kt),zt.removeEventListener("p",Ut,!1));var Gt=Vt;function Wt(e){return null!=e}function Xt(e,t,r){return e?t:r}var Yt=["children","innerProps"],Zt=["children","innerProps"];function qt(e){var t=e.maxHeight,r=e.menuEl,n=e.minHeight,i=e.placement,A=e.shouldScroll,o=e.isFixedPosition,a=e.controlHeight,s=function(e){var t=getComputedStyle(e),r="absolute"===t.position,n=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!r||"static"!==t.position)&&n.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}(r),u={placement:"bottom",maxHeight:t};if(!r||!r.offsetParent)return u;var c,l=s.getBoundingClientRect().height,f=r.getBoundingClientRect(),d=f.bottom,h=f.height,p=f.top,g=r.offsetParent.getBoundingClientRect().top,y=o?window.innerHeight:kt(c=s)?window.innerHeight:c.clientHeight,v=Nt(s),m=parseInt(getComputedStyle(r).marginBottom,10),w=parseInt(getComputedStyle(r).marginTop,10),b=g-w,B=y-p,C=b+v,E=l-v-p,S=d-y+v+m,I=v+p-w,O=160;switch(i){case"auto":case"bottom":if(B>=h)return{placement:"bottom",maxHeight:t};if(E>=h&&!o)return A&&Lt(s,S,O),{placement:"bottom",maxHeight:t};if(!o&&E>=n||o&&B>=n)return A&&Lt(s,S,O),{placement:"bottom",maxHeight:o?B-m:E-m};if("auto"===i||o){var F=t,_=o?b:C;return _>=n&&(F=Math.min(_-m-a,t)),{placement:"top",maxHeight:F}}if("bottom"===i)return A&&Rt(s,S),{placement:"bottom",maxHeight:t};break;case"top":if(b>=h)return{placement:"top",maxHeight:t};if(C>=h&&!o)return A&&Lt(s,I,O),{placement:"top",maxHeight:t};if(!o&&C>=n||o&&b>=n){var x=t;return(!o&&C>=n||o&&b>=n)&&(x=o?b-w:C-w),A&&Lt(s,I,O),{placement:"top",maxHeight:x}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}var Jt,$t=function(e){return"auto"===e?"bottom":e},er=(0,f.createContext)(null),tr=function(e){var t=e.children,r=e.minMenuHeight,n=e.maxMenuHeight,i=e.menuPlacement,A=e.menuPosition,o=e.menuShouldScrollIntoView,s=e.theme,u=((0,f.useContext)(er)||{}).setPortalPlacement,l=(0,f.useRef)(null),d=c((0,f.useState)(n),2),h=d[0],p=d[1],g=c((0,f.useState)(null),2),y=g[0],v=g[1],m=s.spacing.controlHeight;return _t(function(){var e=l.current;if(e){var t="fixed"===A,a=qt({maxHeight:n,menuEl:e,minHeight:r,placement:i,shouldScroll:o&&!t,isFixedPosition:t,controlHeight:m});p(a.maxHeight),v(a.placement),null==u||u(a.placement)}},[n,i,A,o,r,u,m]),t({ref:l,placerProps:a(a({},e),{},{placement:y||$t(i),maxHeight:h})})},rr=function(e){var t=e.children,r=e.innerRef,n=e.innerProps;return Ye("div",p({},Dt(e,"menu",{menu:!0}),{ref:r},n),t)},nr=function(e,t){var r=e.theme,n=r.spacing.baseUnit,i=r.colors;return a({textAlign:"center"},t?{}:{color:i.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px")})},ir=nr,Ar=nr,or=["size"],ar=["innerProps","isRtl","size"];var sr,ur,cr={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},lr=function(e){var t=e.size,r=l(e,or);return Ye("svg",p({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:cr},r))},fr=function(e){return Ye(lr,p({size:20},e),Ye("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},dr=function(e){return Ye(lr,p({size:20},e),Ye("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},hr=function(e,t){var r=e.isFocused,n=e.theme,i=n.spacing.baseUnit,A=n.colors;return a({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?A.neutral60:A.neutral20,padding:2*i,":hover":{color:r?A.neutral80:A.neutral40}})},pr=hr,gr=hr,yr=function(){var e=Ze.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(Jt||(sr=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],ur||(ur=sr.slice(0)),Jt=Object.freeze(Object.defineProperties(sr,{raw:{value:Object.freeze(ur)}})))),vr=function(e){var t=e.delay,r=e.offset;return Ye("span",{css:Ze({animation:"".concat(yr," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},mr=function(e){var t=e.children,r=e.isDisabled,n=e.isFocused,i=e.innerRef,A=e.innerProps,o=e.menuIsOpen;return Ye("div",p({ref:i},Dt(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":n,"control--menu-is-open":o}),A,{"aria-disabled":r||void 0}),t)},wr=["data"],br=function(e){var t=e.children,r=e.cx,n=e.getStyles,i=e.getClassNames,A=e.Heading,o=e.headingProps,a=e.innerProps,s=e.label,u=e.theme,c=e.selectProps;return Ye("div",p({},Dt(e,"group",{group:!0}),a),Ye(A,p({},o,{selectProps:c,theme:u,getStyles:n,getClassNames:i,cx:r}),s),Ye("div",null,t))},Br=["innerRef","isDisabled","isHidden","inputClassName"],Cr={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Er={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":a({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Cr)},Sr=function(e){return a({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Cr)},Ir=function(e){var t=e.children,r=e.innerProps;return Ye("div",r,t)};var Or=function(e){var t=e.children,r=e.components,n=e.data,i=e.innerProps,A=e.isDisabled,o=e.removeProps,s=e.selectProps,u=r.Container,c=r.Label,l=r.Remove;return Ye(u,{data:n,innerProps:a(a({},Dt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":A})),i),selectProps:s},Ye(c,{data:n,innerProps:a({},Dt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Ye(l,{data:n,innerProps:a(a({},Dt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},o),selectProps:s}))},Fr={ClearIndicator:function(e){var t=e.children,r=e.innerProps;return Ye("div",p({},Dt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||Ye(fr,null))},Control:mr,DropdownIndicator:function(e){var t=e.children,r=e.innerProps;return Ye("div",p({},Dt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||Ye(dr,null))},DownChevron:dr,CrossIcon:fr,Group:br,GroupHeading:function(e){var t=Pt(e);t.data;var r=l(t,wr);return Ye("div",p({},Dt(e,"groupHeading",{"group-heading":!0}),r))},IndicatorsContainer:function(e){var t=e.children,r=e.innerProps;return Ye("div",p({},Dt(e,"indicatorsContainer",{indicators:!0}),r),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Ye("span",p({},t,Dt(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,r=e.value,n=Pt(e),i=n.innerRef,A=n.isDisabled,o=n.isHidden,a=n.inputClassName,s=l(n,Br);return Ye("div",p({},Dt(e,"input",{"input-container":!0}),{"data-value":r||""}),Ye("input",p({className:t({input:!0},a),ref:i,style:Sr(o),disabled:A},s)))},LoadingIndicator:function(e){var t=e.innerProps,r=e.isRtl,n=e.size,i=void 0===n?4:n,A=l(e,ar);return Ye("div",p({},Dt(a(a({},A),{},{innerProps:t,isRtl:r,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Ye(vr,{delay:0,offset:r}),Ye(vr,{delay:160,offset:!0}),Ye(vr,{delay:320,offset:!r}))},Menu:rr,MenuList:function(e){var t=e.children,r=e.innerProps,n=e.innerRef,i=e.isMulti;return Ye("div",p({},Dt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":i}),{ref:n},r),t)},MenuPortal:function(e){var t=e.appendTo,r=e.children,n=e.controlElement,i=e.innerProps,A=e.menuPlacement,o=e.menuPosition,s=(0,f.useRef)(null),u=(0,f.useRef)(null),l=c((0,f.useState)($t(A)),2),d=l[0],h=l[1],g=(0,f.useMemo)(function(){return{setPortalPlacement:h}},[]),y=c((0,f.useState)(null),2),v=y[0],m=y[1],w=(0,f.useCallback)(function(){if(n){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(n),t="fixed"===o?0:window.pageYOffset,r=e[d]+t;r===(null==v?void 0:v.offset)&&e.left===(null==v?void 0:v.rect.left)&&e.width===(null==v?void 0:v.rect.width)||m({offset:r,rect:e})}},[n,o,d,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);_t(function(){w()},[w]);var b=(0,f.useCallback)(function(){"function"==typeof u.current&&(u.current(),u.current=null),n&&s.current&&(u.current=Ft(n,s.current,w,{elementResize:"ResizeObserver"in window}))},[n,w]);_t(function(){b()},[b]);var B=(0,f.useCallback)(function(e){s.current=e,b()},[b]);if(!t&&"fixed"!==o||!v)return null;var C=Ye("div",p({ref:B},Dt(a(a({},e),{},{offset:v.offset,position:o,rect:v.rect}),"menuPortal",{"menu-portal":!0}),i),r);return Ye(er.Provider,{value:g},t?(0,qe.createPortal)(C,t):C)},LoadingMessage:function(e){var t=e.children,r=void 0===t?"Loading...":t,n=e.innerProps,i=l(e,Zt);return Ye("div",p({},Dt(a(a({},i),{},{children:r,innerProps:n}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),r)},NoOptionsMessage:function(e){var t=e.children,r=void 0===t?"No options":t,n=e.innerProps,i=l(e,Yt);return Ye("div",p({},Dt(a(a({},i),{},{children:r,innerProps:n}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),r)},MultiValue:Or,MultiValueContainer:Ir,MultiValueLabel:Ir,MultiValueRemove:function(e){var t=e.children,r=e.innerProps;return Ye("div",p({role:"button"},r),t||Ye(fr,{size:14}))},Option:function(e){var t=e.children,r=e.isDisabled,n=e.isFocused,i=e.isSelected,A=e.innerRef,o=e.innerProps;return Ye("div",p({},Dt(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":n,"option--is-selected":i}),{ref:A,"aria-disabled":r},o),t)},Placeholder:function(e){var t=e.children,r=e.innerProps;return Ye("div",p({},Dt(e,"placeholder",{placeholder:!0}),r),t)},SelectContainer:function(e){var t=e.children,r=e.innerProps,n=e.isDisabled,i=e.isRtl;return Ye("div",p({},Dt(e,"container",{"--is-disabled":n,"--is-rtl":i}),r),t)},SingleValue:function(e){var t=e.children,r=e.isDisabled,n=e.innerProps;return Ye("div",p({},Dt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),n),t)},ValueContainer:function(e){var t=e.children,r=e.innerProps,n=e.isMulti,i=e.hasValue;return Ye("div",p({},Dt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":i}),r),t)}},_r=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function xr(e,t){return e===t||!(!_r(e)||!_r(t))}function Ur(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!xr(e[r],t[r]))return!1;return!0}for(var Qr={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Tr=function(e){return Ye("span",p({css:Qr},e))},Mr={guidance:function(e){var t=e.isSearchable,r=e.isMulti,n=e.tabSelectsValue,i=e.context,A=e.isInitialFocus;switch(i){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(n?", press Tab to select the option and exit the menu":"",".");case"input":return A?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,r=e.label,n=void 0===r?"":r,i=e.labels,A=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(i.length>1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return"option ".concat(n,A?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,n=e.options,i=e.label,A=void 0===i?"":i,o=e.selectValue,a=e.isDisabled,s=e.isSelected,u=e.isAppleDevice,c=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&o)return"value ".concat(A," focused, ").concat(c(o,r),".");if("menu"===t&&u){var l=a?" disabled":"",f="".concat(s?" selected":"").concat(l);return"".concat(A).concat(f,", ").concat(c(n,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},Pr=function(e){var t=e.ariaSelection,r=e.focusedOption,n=e.focusedValue,i=e.focusableOptions,A=e.isFocused,o=e.selectValue,s=e.selectProps,u=e.id,c=e.isAppleDevice,l=s.ariaLiveMessages,d=s.getOptionLabel,h=s.inputValue,p=s.isMulti,g=s.isOptionDisabled,y=s.isSearchable,v=s.menuIsOpen,m=s.options,w=s.screenReaderStatus,b=s.tabSelectsValue,B=s.isLoading,C=s["aria-label"],E=s["aria-live"],S=(0,f.useMemo)(function(){return a(a({},Mr),l||{})},[l]),I=(0,f.useMemo)(function(){var e,r="";if(t&&S.onChange){var n=t.option,i=t.options,A=t.removedValue,s=t.removedValues,u=t.value,c=A||n||(e=u,Array.isArray(e)?null:e),l=c?d(c):"",f=i||s||void 0,h=f?f.map(d):[],p=a({isDisabled:c&&g(c,o),label:l,labels:h},t);r=S.onChange(p)}return r},[t,S,g,o,d]),O=(0,f.useMemo)(function(){var e="",t=r||n,A=!!(r&&o&&o.includes(r));if(t&&S.onFocus){var a={focused:t,label:d(t),isDisabled:g(t,o),isSelected:A,options:i,context:t===r?"menu":"value",selectValue:o,isAppleDevice:c};e=S.onFocus(a)}return e},[r,n,d,g,S,i,o,c]),F=(0,f.useMemo)(function(){var e="";if(v&&m.length&&!B&&S.onFilter){var t=w({count:i.length});e=S.onFilter({inputValue:h,resultsMessage:t})}return e},[i,h,v,S,m,w,B]),_="initial-input-focus"===(null==t?void 0:t.action),x=(0,f.useMemo)(function(){var e="";if(S.guidance){var t=n?"value":v?"menu":"input";e=S.guidance({"aria-label":C,context:t,isDisabled:r&&g(r,o),isMulti:p,isSearchable:y,tabSelectsValue:b,isInitialFocus:_})}return e},[C,r,n,p,g,y,v,S,o,b,_]),U=Ye(f.Fragment,null,Ye("span",{id:"aria-selection"},I),Ye("span",{id:"aria-focused"},O),Ye("span",{id:"aria-results"},F),Ye("span",{id:"aria-guidance"},x));return Ye(f.Fragment,null,Ye(Tr,{id:u},_&&U),Ye(Tr,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},A&&!_&&U))},Dr=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],kr=new RegExp("["+Dr.map(function(e){return e.letters}).join("")+"]","g"),Nr={},Rr=0;Rr<Dr.length;Rr++)for(var Lr=Dr[Rr],Hr=0;Hr<Lr.letters.length;Hr++)Nr[Lr.letters[Hr]]=Lr.base;var jr=function(e){return e.replace(kr,function(e){return Nr[e]})},Vr=function(e,t){void 0===t&&(t=Ur);var r=null;function n(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(r&&r.lastThis===this&&t(n,r.lastArgs))return r.lastResult;var A=e.apply(this,n);return r={lastResult:A,lastArgs:n,lastThis:this},A}return n.clear=function(){r=null},n}(jr),Kr=function(e){return e.replace(/^\s+|\s+$/g,"")},zr=function(e){return"".concat(e.label," ").concat(e.value)},Gr=["innerRef"];function Wr(e){var t=e.innerRef,r=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=Object.entries(e).filter(function(e){var t=c(e,1)[0];return!r.includes(t)});return i.reduce(function(e,t){var r=c(t,2),n=r[0],i=r[1];return e[n]=i,e},{})}(l(e,Gr),"onExited","in","enter","exit","appear");return Ye("input",p({ref:t},r,{css:Ze({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Xr=["boxSizing","height","overflow","paddingRight","position"],Yr={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Zr(e){e.cancelable&&e.preventDefault()}function qr(e){e.stopPropagation()}function Jr(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;0===e?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function $r(){return"ontouchstart"in window||navigator.maxTouchPoints}var en=!("undefined"==typeof window||!window.document||!window.document.createElement),tn=0,rn={capture:!1,passive:!1};var nn=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},An={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function on(e){var t=e.children,r=e.lockEnabled,n=e.captureEnabled,i=function(e){var t=e.isEnabled,r=e.onBottomArrive,n=e.onBottomLeave,i=e.onTopArrive,A=e.onTopLeave,o=(0,f.useRef)(!1),a=(0,f.useRef)(!1),s=(0,f.useRef)(0),u=(0,f.useRef)(null),c=(0,f.useCallback)(function(e,t){if(null!==u.current){var s=u.current,c=s.scrollTop,l=s.scrollHeight,f=s.clientHeight,d=u.current,h=t>0,p=l-f-c,g=!1;p>t&&o.current&&(n&&n(e),o.current=!1),h&&a.current&&(A&&A(e),a.current=!1),h&&t>p?(r&&!o.current&&r(e),d.scrollTop=l,g=!0,o.current=!0):!h&&-t>c&&(i&&!a.current&&i(e),d.scrollTop=0,g=!0,a.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[r,n,i,A]),l=(0,f.useCallback)(function(e){c(e,e.deltaY)},[c]),d=(0,f.useCallback)(function(e){s.current=e.changedTouches[0].clientY},[]),h=(0,f.useCallback)(function(e){var t=s.current-e.changedTouches[0].clientY;c(e,t)},[c]),p=(0,f.useCallback)(function(e){if(e){var t=!!Gt&&{passive:!1};e.addEventListener("wheel",l,t),e.addEventListener("touchstart",d,t),e.addEventListener("touchmove",h,t)}},[h,d,l]),g=(0,f.useCallback)(function(e){e&&(e.removeEventListener("wheel",l,!1),e.removeEventListener("touchstart",d,!1),e.removeEventListener("touchmove",h,!1))},[h,d,l]);return(0,f.useEffect)(function(){if(t){var e=u.current;return p(e),function(){g(e)}}},[t,p,g]),function(e){u.current=e}}({isEnabled:void 0===n||n,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),A=function(e){var t=e.isEnabled,r=e.accountForScrollbars,n=void 0===r||r,i=(0,f.useRef)({}),A=(0,f.useRef)(null),o=(0,f.useCallback)(function(e){if(en){var t=document.body,r=t&&t.style;if(n&&Xr.forEach(function(e){var t=r&&r[e];i.current[e]=t}),n&&tn<1){var A=parseInt(i.current.paddingRight,10)||0,o=document.body?document.body.clientWidth:0,a=window.innerWidth-o+A||0;Object.keys(Yr).forEach(function(e){var t=Yr[e];r&&(r[e]=t)}),r&&(r.paddingRight="".concat(a,"px"))}t&&$r()&&(t.addEventListener("touchmove",Zr,rn),e&&(e.addEventListener("touchstart",Jr,rn),e.addEventListener("touchmove",qr,rn))),tn+=1}},[n]),a=(0,f.useCallback)(function(e){if(en){var t=document.body,r=t&&t.style;tn=Math.max(tn-1,0),n&&tn<1&&Xr.forEach(function(e){var t=i.current[e];r&&(r[e]=t)}),t&&$r()&&(t.removeEventListener("touchmove",Zr,rn),e&&(e.removeEventListener("touchstart",Jr,rn),e.removeEventListener("touchmove",qr,rn)))}},[n]);return(0,f.useEffect)(function(){if(t){var e=A.current;return o(e),function(){a(e)}}},[t,o,a]),function(e){A.current=e}}({isEnabled:r});return Ye(f.Fragment,null,r&&Ye("div",{onClick:nn,css:An}),t(function(e){i(e),A(e)}))}var an={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},sn=function(e){var t=e.name,r=e.onFocus;return Ye("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:an,value:"",onChange:function(){}})};function un(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function cn(){return un(/^Mac/i)}function ln(){return un(/^iPhone/i)||un(/^iPad/i)||cn()&&navigator.maxTouchPoints>1}var fn={clearIndicator:gr,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var r=e.isDisabled,n=e.isFocused,i=e.theme,A=i.colors,o=i.borderRadius;return a({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:i.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?A.neutral5:A.neutral0,borderColor:r?A.neutral10:n?A.primary:A.neutral20,borderRadius:o,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(A.primary):void 0,"&:hover":{borderColor:n?A.primary:A.neutral30}})},dropdownIndicator:pr,group:function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:2*r.baseUnit,paddingTop:2*r.baseUnit}},groupHeading:function(e,t){var r=e.theme,n=r.colors,i=r.spacing;return a({label:"group",cursor:"default",display:"block"},t?{}:{color:n.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*i.baseUnit,paddingRight:3*i.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var r=e.isDisabled,n=e.theme,i=n.spacing.baseUnit,A=n.colors;return a({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?A.neutral10:A.neutral20,marginBottom:2*i,marginTop:2*i})},input:function(e,t){var r=e.isDisabled,n=e.value,i=e.theme,A=i.spacing,o=i.colors;return a(a({visibility:r?"hidden":"visible",transform:n?"translateZ(0)":""},Er),t?{}:{margin:A.baseUnit/2,paddingBottom:A.baseUnit/2,paddingTop:A.baseUnit/2,color:o.neutral80})},loadingIndicator:function(e,t){var r=e.isFocused,n=e.size,i=e.theme,A=i.colors,o=i.spacing.baseUnit;return a({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?A.neutral60:A.neutral20,padding:2*o})},loadingMessage:Ar,menu:function(e,t){var r,n=e.placement,i=e.theme,o=i.borderRadius,s=i.spacing,u=i.colors;return a((A(r={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),A(r,"position","absolute"),A(r,"width","100%"),A(r,"zIndex",1),r),t?{}:{backgroundColor:u.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},menuList:function(e,t){var r=e.maxHeight,n=e.theme.spacing.baseUnit;return a({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:n,paddingTop:n})},menuPortal:function(e){var t=e.rect,r=e.offset,n=e.position;return{left:t.left,position:n,top:r,width:t.width,zIndex:1}},multiValue:function(e,t){var r=e.theme,n=r.spacing,i=r.borderRadius,A=r.colors;return a({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:A.neutral10,borderRadius:i/2,margin:n.baseUnit/2})},multiValueLabel:function(e,t){var r=e.theme,n=r.borderRadius,i=r.colors,A=e.cropWithEllipsis;return a({overflow:"hidden",textOverflow:A||void 0===A?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:n/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var r=e.theme,n=r.spacing,i=r.borderRadius,A=r.colors,o=e.isFocused;return a({alignItems:"center",display:"flex"},t?{}:{borderRadius:i/2,backgroundColor:o?A.dangerLight:void 0,paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:A.dangerLight,color:A.danger}})},noOptionsMessage:ir,option:function(e,t){var r=e.isDisabled,n=e.isFocused,i=e.isSelected,A=e.theme,o=A.spacing,s=A.colors;return a({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:i?s.primary:n?s.primary25:"transparent",color:r?s.neutral20:i?s.neutral0:"inherit",padding:"".concat(2*o.baseUnit,"px ").concat(3*o.baseUnit,"px"),":active":{backgroundColor:r?void 0:i?s.primary:s.primary50}})},placeholder:function(e,t){var r=e.theme,n=r.spacing,i=r.colors;return a({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:i.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},singleValue:function(e,t){var r=e.isDisabled,n=e.theme,i=n.spacing,A=n.colors;return a({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?A.neutral40:A.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},valueContainer:function(e,t){var r=e.theme.spacing,n=e.isMulti,i=e.hasValue,A=e.selectProps.controlShouldRenderValue;return a({alignItems:"center",display:n&&i&&A?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(2*r.baseUnit,"px")})}};var dn,hn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},pn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:jt(),captureMenuScroll:!jt(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var r=a({ignoreCase:!0,ignoreAccents:!0,stringify:zr,trim:!0,matchFrom:"any"},dn),n=r.ignoreCase,i=r.ignoreAccents,A=r.stringify,o=r.trim,s=r.matchFrom,u=o?Kr(t):t,c=o?Kr(A(e)):A(e);return n&&(u=u.toLowerCase(),c=c.toLowerCase()),i&&(u=Vr(u),c=jr(c)),"start"===s?c.substr(0,u.length)===u:c.indexOf(u)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function gn(e,t,r,n){return{type:"option",data:t,isDisabled:En(e,t,r),isSelected:Sn(e,t,r),label:Bn(e,t),value:Cn(e,t),index:n}}function yn(e,t){return e.options.map(function(r,n){if("options"in r){var i=r.options.map(function(r,n){return gn(e,r,t,n)}).filter(function(t){return wn(e,t)});return i.length>0?{type:"group",data:r,options:i,index:n}:void 0}var A=gn(e,r,t,n);return wn(e,A)?A:void 0}).filter(Wt)}function vn(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,b(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function mn(e,t){return e.reduce(function(e,r){return"group"===r.type?e.push.apply(e,b(r.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(r.index,"-").concat(e.index)}}))):e.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),e},[])}function wn(e,t){var r=e.inputValue,n=void 0===r?"":r,i=t.data,A=t.isSelected,o=t.label,a=t.value;return(!On(e)||!A)&&In(e,{label:o,value:a,data:i},n)}var bn=function(e,t){var r;return(null===(r=e.find(function(e){return e.data===t}))||void 0===r?void 0:r.id)||null},Bn=function(e,t){return e.getOptionLabel(t)},Cn=function(e,t){return e.getOptionValue(t)};function En(e,t,r){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,r)}function Sn(e,t,r){if(r.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,r);var n=Cn(e,t);return r.some(function(t){return Cn(e,t)===n})}function In(e,t,r){return!e.filterOption||e.filterOption(t,r)}var On=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},Fn=1,_n=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(r,e);var t=function(e){var t=m();return function(){var r,n=v(e);if(t){var i=v(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return w(this,r)}}(r);function r(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(n=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},n.blockOptionHover=!1,n.isComposing=!1,n.commonProps=void 0,n.initialTouchX=0,n.initialTouchY=0,n.openAfterFocus=!1,n.scrollToFocusedOptionOnUpdate=!1,n.userIsDragging=void 0,n.controlRef=null,n.getControlRef=function(e){n.controlRef=e},n.focusedOptionRef=null,n.getFocusedOptionRef=function(e){n.focusedOptionRef=e},n.menuListRef=null,n.getMenuListRef=function(e){n.menuListRef=e},n.inputRef=null,n.getInputRef=function(e){n.inputRef=e},n.focus=n.focusInput,n.blur=n.blurInput,n.onChange=function(e,t){var r=n.props,i=r.onChange,A=r.name;t.name=A,n.ariaOnChange(e,t),i(e,t)},n.setValue=function(e,t,r){var i=n.props,A=i.closeMenuOnSelect,o=i.isMulti,a=i.inputValue;n.onInputChange("",{action:"set-value",prevInputValue:a}),A&&(n.setState({inputIsHiddenAfterUpdate:!o}),n.onMenuClose()),n.setState({clearFocusValueOnUpdate:!0}),n.onChange(e,{action:t,option:r})},n.selectOption=function(e){var t=n.props,r=t.blurInputOnSelect,i=t.isMulti,A=t.name,o=n.state.selectValue,a=i&&n.isOptionSelected(e,o),s=n.isOptionDisabled(e,o);if(a){var u=n.getOptionValue(e);n.setValue(o.filter(function(e){return n.getOptionValue(e)!==u}),"deselect-option",e)}else{if(s)return void n.ariaOnChange(e,{action:"select-option",option:e,name:A});i?n.setValue([].concat(b(o),[e]),"select-option",e):n.setValue(e,"select-option")}r&&n.blurInput()},n.removeValue=function(e){var t=n.props.isMulti,r=n.state.selectValue,i=n.getOptionValue(e),A=r.filter(function(e){return n.getOptionValue(e)!==i}),o=Xt(t,A,A[0]||null);n.onChange(o,{action:"remove-value",removedValue:e}),n.focusInput()},n.clearValue=function(){var e=n.state.selectValue;n.onChange(Xt(n.props.isMulti,[],null),{action:"clear",removedValues:e})},n.popValue=function(){var e=n.props.isMulti,t=n.state.selectValue,r=t[t.length-1],i=t.slice(0,t.length-1),A=Xt(e,i,i[0]||null);r&&n.onChange(A,{action:"pop-value",removedValue:r})},n.getFocusedOptionId=function(e){return bn(n.state.focusableOptionsWithIds,e)},n.getFocusableOptionsWithIds=function(){return mn(yn(n.props,n.state.selectValue),n.getElementId("option"))},n.getValue=function(){return n.state.selectValue},n.cx=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Tt.apply(void 0,[n.props.classNamePrefix].concat(t))},n.getOptionLabel=function(e){return Bn(n.props,e)},n.getOptionValue=function(e){return Cn(n.props,e)},n.getStyles=function(e,t){var r=n.props.unstyled,i=fn[e](t,r);i.boxSizing="border-box";var A=n.props.styles[e];return A?A(i,t):i},n.getClassNames=function(e,t){var r,i;return null===(r=(i=n.props.classNames)[e])||void 0===r?void 0:r.call(i,t)},n.getElementId=function(e){return"".concat(n.state.instancePrefix,"-").concat(e)},n.getComponents=function(){return e=n.props,a(a({},Fr),e.components);var e},n.buildCategorizedOptions=function(){return yn(n.props,n.state.selectValue)},n.getCategorizedOptions=function(){return n.props.menuIsOpen?n.buildCategorizedOptions():[]},n.buildFocusableOptions=function(){return vn(n.buildCategorizedOptions())},n.getFocusableOptions=function(){return n.props.menuIsOpen?n.buildFocusableOptions():[]},n.ariaOnChange=function(e,t){n.setState({ariaSelection:a({value:e},t)})},n.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),n.focusInput())},n.onMenuMouseMove=function(e){n.blockOptionHover=!1},n.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=n.props.openMenuOnClick;n.state.isFocused?n.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&n.onMenuClose():t&&n.openMenu("first"):(t&&(n.openAfterFocus=!0),n.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},n.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||n.props.isDisabled)){var t=n.props,r=t.isMulti,i=t.menuIsOpen;n.focusInput(),i?(n.setState({inputIsHiddenAfterUpdate:!r}),n.onMenuClose()):n.openMenu("first"),e.preventDefault()}},n.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(n.clearValue(),e.preventDefault(),n.openAfterFocus=!1,"touchend"===e.type?n.focusInput():setTimeout(function(){return n.focusInput()}))},n.onScroll=function(e){"boolean"==typeof n.props.closeMenuOnScroll?e.target instanceof HTMLElement&&kt(e.target)&&n.props.onMenuClose():"function"==typeof n.props.closeMenuOnScroll&&n.props.closeMenuOnScroll(e)&&n.props.onMenuClose()},n.onCompositionStart=function(){n.isComposing=!0},n.onCompositionEnd=function(){n.isComposing=!1},n.onTouchStart=function(e){var t=e.touches,r=t&&t.item(0);r&&(n.initialTouchX=r.clientX,n.initialTouchY=r.clientY,n.userIsDragging=!1)},n.onTouchMove=function(e){var t=e.touches,r=t&&t.item(0);if(r){var i=Math.abs(r.clientX-n.initialTouchX),A=Math.abs(r.clientY-n.initialTouchY);n.userIsDragging=i>5||A>5}},n.onTouchEnd=function(e){n.userIsDragging||(n.controlRef&&!n.controlRef.contains(e.target)&&n.menuListRef&&!n.menuListRef.contains(e.target)&&n.blurInput(),n.initialTouchX=0,n.initialTouchY=0)},n.onControlTouchEnd=function(e){n.userIsDragging||n.onControlMouseDown(e)},n.onClearIndicatorTouchEnd=function(e){n.userIsDragging||n.onClearIndicatorMouseDown(e)},n.onDropdownIndicatorTouchEnd=function(e){n.userIsDragging||n.onDropdownIndicatorMouseDown(e)},n.handleInputChange=function(e){var t=n.props.inputValue,r=e.currentTarget.value;n.setState({inputIsHiddenAfterUpdate:!1}),n.onInputChange(r,{action:"input-change",prevInputValue:t}),n.props.menuIsOpen||n.onMenuOpen()},n.onInputFocus=function(e){n.props.onFocus&&n.props.onFocus(e),n.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(n.openAfterFocus||n.props.openMenuOnFocus)&&n.openMenu("first"),n.openAfterFocus=!1},n.onInputBlur=function(e){var t=n.props.inputValue;n.menuListRef&&n.menuListRef.contains(document.activeElement)?n.inputRef.focus():(n.props.onBlur&&n.props.onBlur(e),n.onInputChange("",{action:"input-blur",prevInputValue:t}),n.onMenuClose(),n.setState({focusedValue:null,isFocused:!1}))},n.onOptionHover=function(e){if(!n.blockOptionHover&&n.state.focusedOption!==e){var t=n.getFocusableOptions().indexOf(e);n.setState({focusedOption:e,focusedOptionId:t>-1?n.getFocusedOptionId(e):null})}},n.shouldHideSelectedOptions=function(){return On(n.props)},n.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),n.focus()},n.onKeyDown=function(e){var t=n.props,r=t.isMulti,i=t.backspaceRemovesValue,A=t.escapeClearsValue,o=t.inputValue,a=t.isClearable,s=t.isDisabled,u=t.menuIsOpen,c=t.onKeyDown,l=t.tabSelectsValue,f=t.openMenuOnFocus,d=n.state,h=d.focusedOption,p=d.focusedValue,g=d.selectValue;if(!(s||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(n.blockOptionHover=!0,e.key){case"ArrowLeft":if(!r||o)return;n.focusValue("previous");break;case"ArrowRight":if(!r||o)return;n.focusValue("next");break;case"Delete":case"Backspace":if(o)return;if(p)n.removeValue(p);else{if(!i)return;r?n.popValue():a&&n.clearValue()}break;case"Tab":if(n.isComposing)return;if(e.shiftKey||!u||!l||!h||f&&n.isOptionSelected(h,g))return;n.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(u){if(!h)return;if(n.isComposing)return;n.selectOption(h);break}return;case"Escape":u?(n.setState({inputIsHiddenAfterUpdate:!1}),n.onInputChange("",{action:"menu-close",prevInputValue:o}),n.onMenuClose()):a&&A&&n.clearValue();break;case" ":if(o)return;if(!u){n.openMenu("first");break}if(!h)return;n.selectOption(h);break;case"ArrowUp":u?n.focusOption("up"):n.openMenu("last");break;case"ArrowDown":u?n.focusOption("down"):n.openMenu("first");break;case"PageUp":if(!u)return;n.focusOption("pageup");break;case"PageDown":if(!u)return;n.focusOption("pagedown");break;case"Home":if(!u)return;n.focusOption("first");break;case"End":if(!u)return;n.focusOption("last");break;default:return}e.preventDefault()}},n.state.instancePrefix="react-select-"+(n.props.instanceId||++Fn),n.state.selectValue=Mt(e.value),e.menuIsOpen&&n.state.selectValue.length){var i=n.getFocusableOptionsWithIds(),A=n.buildFocusableOptions(),o=A.indexOf(n.state.selectValue[0]);n.state.focusableOptionsWithIds=i,n.state.focusedOption=A[o],n.state.focusedOptionId=bn(i,A[o])}return n}return function(e,t,r){t&&g(e.prototype,t),r&&g(e,r),Object.defineProperty(e,"prototype",{writable:!1})}(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Ht(this.menuListRef,this.focusedOptionRef),(cn()||ln())&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isDisabled,n=t.menuIsOpen,i=this.state.isFocused;(i&&!r&&e.isDisabled||i&&n&&!e.menuIsOpen)&&this.focusInput(),i&&r&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):i||r||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ht(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,r=this.state,n=r.selectValue,i=r.isFocused,A=this.buildFocusableOptions(),o="first"===e?0:A.length-1;if(!this.props.isMulti){var a=A.indexOf(n[0]);a>-1&&(o=a)}this.scrollToFocusedOptionOnUpdate=!(i&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:A[o],focusedOptionId:this.getFocusedOptionId(A[o])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,r=t.selectValue,n=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var i=r.indexOf(n);n||(i=-1);var A=r.length-1,o=-1;if(r.length){switch(e){case"previous":o=0===i?0:-1===i?A:i-1;break;case"next":i>-1&&i<A&&(o=i+1)}this.setState({inputIsHidden:-1!==o,focusedValue:r[o]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,r=this.state.focusedOption,n=this.getFocusableOptions();if(n.length){var i=0,A=n.indexOf(r);r||(A=-1),"up"===e?i=A>0?A-1:n.length-1:"down"===e?i=(A+1)%n.length:"pageup"===e?(i=A-t)<0&&(i=0):"pagedown"===e?(i=A+t)>n.length-1&&(i=n.length-1):"last"===e&&(i=n.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:n[i],focusedValue:null,focusedOptionId:this.getFocusedOptionId(n[i])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(hn):a(a({},hn),this.props.theme):hn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,r=this.getStyles,n=this.getClassNames,i=this.getValue,A=this.selectOption,o=this.setValue,a=this.props,s=a.isMulti,u=a.isRtl,c=a.options;return{clearValue:e,cx:t,getStyles:r,getClassNames:n,getValue:i,hasValue:this.hasValue(),isMulti:s,isRtl:u,options:c,selectOption:A,selectProps:a,setValue:o,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,r=e.isMulti;return void 0===t?r:t}},{key:"isOptionDisabled",value:function(e,t){return En(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Sn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return In(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var r=this.props.inputValue,n=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:r,selectValue:n})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,r=e.isSearchable,n=e.inputId,i=e.inputValue,A=e.tabIndex,o=e.form,s=e.menuIsOpen,u=e.required,c=this.getComponents().Input,l=this.state,d=l.inputIsHidden,h=l.ariaSelection,g=this.commonProps,y=n||this.getElementId("input"),v=a(a(a({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":u,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},s&&{"aria-controls":this.getElementId("listbox")}),!r&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==h?void 0:h.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return r?f.createElement(c,p({},g,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:y,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:A,form:o,type:"text",value:i},v)):f.createElement(Wr,p({id:y,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ut,onFocus:this.onInputFocus,disabled:t,tabIndex:A,inputMode:"none",form:o,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),r=t.MultiValue,n=t.MultiValueContainer,i=t.MultiValueLabel,A=t.MultiValueRemove,o=t.SingleValue,a=t.Placeholder,s=this.commonProps,u=this.props,c=u.controlShouldRenderValue,l=u.isDisabled,d=u.isMulti,h=u.inputValue,g=u.placeholder,y=this.state,v=y.selectValue,m=y.focusedValue,w=y.isFocused;if(!this.hasValue()||!c)return h?null:f.createElement(a,p({},s,{key:"placeholder",isDisabled:l,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),g);if(d)return v.map(function(t,o){var a=t===m,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return f.createElement(r,p({},s,{components:{Container:n,Label:i,Remove:A},isFocused:a,isDisabled:l,key:u,index:o,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(h)return null;var b=v[0];return f.createElement(o,p({},s,{data:b,isDisabled:l}),this.formatOptionLabel(b,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,r=this.props,n=r.isDisabled,i=r.isLoading,A=this.state.isFocused;if(!this.isClearable()||!e||n||!this.hasValue()||i)return null;var o={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(e,p({},t,{innerProps:o,isFocused:A}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,r=this.props,n=r.isDisabled,i=r.isLoading,A=this.state.isFocused;if(!e||!i)return null;return f.createElement(e,p({},t,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:A}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,r=e.IndicatorSeparator;if(!t||!r)return null;var n=this.commonProps,i=this.props.isDisabled,A=this.state.isFocused;return f.createElement(r,p({},n,{isDisabled:i,isFocused:A}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,r=this.props.isDisabled,n=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return f.createElement(e,p({},t,{innerProps:i,isDisabled:r,isFocused:n}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),r=t.Group,n=t.GroupHeading,i=t.Menu,A=t.MenuList,o=t.MenuPortal,a=t.LoadingMessage,s=t.NoOptionsMessage,u=t.Option,c=this.commonProps,l=this.state.focusedOption,d=this.props,h=d.captureMenuScroll,g=d.inputValue,y=d.isLoading,v=d.loadingMessage,m=d.minMenuHeight,w=d.maxMenuHeight,b=d.menuIsOpen,B=d.menuPlacement,C=d.menuPosition,E=d.menuPortalTarget,S=d.menuShouldBlockScroll,I=d.menuShouldScrollIntoView,O=d.noOptionsMessage,F=d.onMenuScrollToTop,_=d.onMenuScrollToBottom;if(!b)return null;var x,U=function(t,r){var n=t.type,i=t.data,A=t.isDisabled,o=t.isSelected,a=t.label,s=t.value,d=l===i,h=A?void 0:function(){return e.onOptionHover(i)},g=A?void 0:function(){return e.selectOption(i)},y="".concat(e.getElementId("option"),"-").concat(r),v={id:y,onClick:g,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:o};return f.createElement(u,p({},c,{innerProps:v,data:i,isDisabled:A,isSelected:o,key:y,label:a,type:n,value:s,isFocused:d,innerRef:d?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())x=this.getCategorizedOptions().map(function(t){if("group"===t.type){var i=t.data,A=t.options,o=t.index,a="".concat(e.getElementId("group"),"-").concat(o),s="".concat(a,"-heading");return f.createElement(r,p({},c,{key:a,data:i,options:A,Heading:n,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return U(e,"".concat(o,"-").concat(e.index))}))}if("option"===t.type)return U(t,"".concat(t.index))});else if(y){var Q=v({inputValue:g});if(null===Q)return null;x=f.createElement(a,c,Q)}else{var T=O({inputValue:g});if(null===T)return null;x=f.createElement(s,c,T)}var M={minMenuHeight:m,maxMenuHeight:w,menuPlacement:B,menuPosition:C,menuShouldScrollIntoView:I},P=f.createElement(tr,p({},c,M),function(t){var r=t.ref,n=t.placerProps,o=n.placement,a=n.maxHeight;return f.createElement(i,p({},c,M,{innerRef:r,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:y,placement:o}),f.createElement(on,{captureEnabled:h,onTopArrive:F,onBottomArrive:_,lockEnabled:S},function(t){return f.createElement(A,p({},c,{innerRef:function(r){e.getMenuListRef(r),t(r)},innerProps:{role:"listbox","aria-multiselectable":c.isMulti,id:e.getElementId("listbox")},isLoading:y,maxHeight:a,focusedOption:l}),x)}))});return E||"fixed"===C?f.createElement(o,p({},c,{appendTo:E,controlElement:this.controlRef,menuPlacement:B,menuPosition:C}),P):P}},{key:"renderFormField",value:function(){var e=this,t=this.props,r=t.delimiter,n=t.isDisabled,i=t.isMulti,A=t.name,o=t.required,a=this.state.selectValue;if(o&&!this.hasValue()&&!n)return f.createElement(sn,{name:A,onFocus:this.onValueInputFocus});if(A&&!n){if(i){if(r){var s=a.map(function(t){return e.getOptionValue(t)}).join(r);return f.createElement("input",{name:A,type:"hidden",value:s})}var u=a.length>0?a.map(function(t,r){return f.createElement("input",{key:"i-".concat(r),name:A,type:"hidden",value:e.getOptionValue(t)})}):f.createElement("input",{name:A,type:"hidden",value:""});return f.createElement("div",null,u)}var c=a[0]?this.getOptionValue(a[0]):"";return f.createElement("input",{name:A,type:"hidden",value:c})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,r=t.ariaSelection,n=t.focusedOption,i=t.focusedValue,A=t.isFocused,o=t.selectValue,a=this.getFocusableOptions();return f.createElement(Pr,p({},e,{id:this.getElementId("live-region"),ariaSelection:r,focusedOption:n,focusedValue:i,isFocused:A,selectValue:o,focusableOptions:a,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,r=e.IndicatorsContainer,n=e.SelectContainer,i=e.ValueContainer,A=this.props,o=A.className,a=A.id,s=A.isDisabled,u=A.menuIsOpen,c=this.state.isFocused,l=this.commonProps=this.getCommonProps();return f.createElement(n,p({},l,{className:o,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:c}),this.renderLiveRegion(),f.createElement(t,p({},l,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:c,menuIsOpen:u}),f.createElement(i,p({},l,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),f.createElement(r,p({},l,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=t.prevProps,n=t.clearFocusValueOnUpdate,i=t.inputIsHiddenAfterUpdate,A=t.ariaSelection,o=t.isFocused,s=t.prevWasFocused,u=t.instancePrefix,c=e.options,l=e.value,f=e.menuIsOpen,d=e.inputValue,h=e.isMulti,p=Mt(l),g={};if(r&&(l!==r.value||c!==r.options||f!==r.menuIsOpen||d!==r.inputValue)){var y=f?function(e,t){return vn(yn(e,t))}(e,p):[],v=f?mn(yn(e,p),"".concat(u,"-option")):[],m=n?function(e,t){var r=e.focusedValue,n=e.selectValue.indexOf(r);if(n>-1){if(t.indexOf(r)>-1)return r;if(n<t.length)return t[n]}return null}(t,p):null,w=function(e,t){var r=e.focusedOption;return r&&t.indexOf(r)>-1?r:t[0]}(t,y);g={selectValue:p,focusedOption:w,focusedOptionId:bn(v,w),focusableOptionsWithIds:v,focusedValue:m,clearFocusValueOnUpdate:!1}}var b=null!=i&&e!==r?{inputIsHidden:i,inputIsHiddenAfterUpdate:void 0}:{},B=A,C=o&&s;return o&&!C&&(B={value:Xt(h,p,p[0]||null),options:p,action:"initial-input-focus"},C=!s),"initial-input-focus"===(null==A?void 0:A.action)&&(B=null),a(a(a({},g),b),{},{prevProps:e,ariaSelection:B,prevWasFocused:C})}}]),r}(f.Component);_n.defaultProps=pn;var xn=(0,f.forwardRef)(function(e,t){var r=function(e){var t=e.defaultInputValue,r=void 0===t?"":t,n=e.defaultMenuIsOpen,i=void 0!==n&&n,A=e.defaultValue,o=void 0===A?null:A,s=e.inputValue,u=e.menuIsOpen,d=e.onChange,p=e.onInputChange,g=e.onMenuClose,y=e.onMenuOpen,v=e.value,m=l(e,h),w=c((0,f.useState)(void 0!==s?s:r),2),b=w[0],B=w[1],C=c((0,f.useState)(void 0!==u?u:i),2),E=C[0],S=C[1],I=c((0,f.useState)(void 0!==v?v:o),2),O=I[0],F=I[1],_=(0,f.useCallback)(function(e,t){"function"==typeof d&&d(e,t),F(e)},[d]),x=(0,f.useCallback)(function(e,t){var r;"function"==typeof p&&(r=p(e,t)),B(void 0!==r?r:e)},[p]),U=(0,f.useCallback)(function(){"function"==typeof y&&y(),S(!0)},[y]),Q=(0,f.useCallback)(function(){"function"==typeof g&&g(),S(!1)},[g]),T=void 0!==s?s:b,M=void 0!==u?u:E,P=void 0!==v?v:O;return a(a({},m),{},{inputValue:T,menuIsOpen:M,onChange:_,onInputChange:x,onMenuClose:Q,onMenuOpen:U,value:P})}(e);return f.createElement(_n,p({ref:t},r))}),Un=xn},53637(e,t,r){"use strict";r.d(t,{A:()=>v});var n=r(73608),i=r(26741),A=r(98517),o=r(73753),a=r(93516),s=r(18262),u=r(15906),c=r(43113),l=r(33338),f=r(50735),d=r(55512),h=r(43334);const p=function(){function e(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return e.prototype.getDataBytes=function(){return this.dataBytes},e.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},e}();var g=r(97483),y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const v=function(){function e(){}return e.calculateMaskPenalty=function(e){return c.A.applyMaskPenaltyRule1(e)+c.A.applyMaskPenaltyRule2(e)+c.A.applyMaskPenaltyRule3(e)+c.A.applyMaskPenaltyRule4(e)},e.encode=function(t,r,o){void 0===o&&(o=null);var a=e.DEFAULT_BYTE_MODE_ENCODING,c=null!==o&&void 0!==o.get(n.A.CHARACTER_SET);c&&(a=o.get(n.A.CHARACTER_SET).toString());var h=this.chooseMode(t,a),p=new i.A;if(h===s.A.BYTE&&(c||e.DEFAULT_BYTE_MODE_ENCODING!==a)){var y=A.A.getCharacterSetECIByName(a);void 0!==y&&this.appendECI(y,p)}this.appendModeInfo(h,p);var v,m=new i.A;if(this.appendBytes(t,h,m,a),null!==o&&void 0!==o.get(n.A.QR_VERSION)){var w=Number.parseInt(o.get(n.A.QR_VERSION).toString(),10);v=u.A.getVersionForNumber(w);var b=this.calculateBitsNeeded(h,p,m,v);if(!this.willFit(b,v,r))throw new g.A("Data too big for requested version")}else v=this.recommendVersion(r,h,p,m);var B=new i.A;B.appendBitArray(p);var C=h===s.A.BYTE?m.getSizeInBytes():t.length;this.appendLengthInfo(C,v,h,B),B.appendBitArray(m);var E=v.getECBlocksForLevel(r),S=v.getTotalCodewords()-E.getTotalECCodewords();this.terminateBits(S,B);var I=this.interleaveWithECBytes(B,v.getTotalCodewords(),S,E.getNumBlocks()),O=new f.A;O.setECLevel(r),O.setMode(h),O.setVersion(v);var F=v.getDimensionForVersion(),_=new l.A(F,F),x=this.chooseMaskPattern(I,r,v,_);return O.setMaskPattern(x),d.A.buildMatrix(I,r,v,x,_),O.setMatrix(_),O},e.recommendVersion=function(e,t,r,n){var i=this.calculateBitsNeeded(t,r,n,u.A.getVersionForNumber(1)),A=this.chooseVersion(i,e),o=this.calculateBitsNeeded(t,r,n,A);return this.chooseVersion(o,e)},e.calculateBitsNeeded=function(e,t,r,n){return t.getSize()+e.getCharacterCountBits(n)+r.getSize()},e.getAlphanumericCode=function(t){return t<e.ALPHANUMERIC_TABLE.length?e.ALPHANUMERIC_TABLE[t]:-1},e.chooseMode=function(t,r){if(void 0===r&&(r=null),A.A.SJIS.getName()===r&&this.isOnlyDoubleByteKanji(t))return s.A.KANJI;for(var n=!1,i=!1,o=0,a=t.length;o<a;++o){var u=t.charAt(o);if(e.isDigit(u))n=!0;else{if(-1===this.getAlphanumericCode(u.charCodeAt(0)))return s.A.BYTE;i=!0}}return i?s.A.ALPHANUMERIC:n?s.A.NUMERIC:s.A.BYTE},e.isOnlyDoubleByteKanji=function(e){var t;try{t=h.A.encode(e,A.A.SJIS)}catch(e){return!1}var r=t.length;if(r%2!=0)return!1;for(var n=0;n<r;n+=2){var i=255&t[n];if((i<129||i>159)&&(i<224||i>235))return!1}return!0},e.chooseMaskPattern=function(e,t,r,n){for(var i=Number.MAX_SAFE_INTEGER,A=-1,o=0;o<f.A.NUM_MASK_PATTERNS;o++){d.A.buildMatrix(e,t,r,o,n);var a=this.calculateMaskPenalty(n);a<i&&(i=a,A=o)}return A},e.chooseVersion=function(t,r){for(var n=1;n<=40;n++){var i=u.A.getVersionForNumber(n);if(e.willFit(t,i,r))return i}throw new g.A("Data too big")},e.willFit=function(e,t,r){return t.getTotalCodewords()-t.getECBlocksForLevel(r).getTotalECCodewords()>=(e+7)/8},e.terminateBits=function(e,t){var r=8*e;if(t.getSize()>r)throw new g.A("data bits cannot fit in the QR Code"+t.getSize()+" > "+r);for(var n=0;n<4&&t.getSize()<r;++n)t.appendBit(!1);var i=7&t.getSize();if(i>0)for(n=i;n<8;n++)t.appendBit(!1);var A=e-t.getSizeInBytes();for(n=0;n<A;++n)t.appendBits(1&n?17:236,8);if(t.getSize()!==r)throw new g.A("Bits size does not equal capacity")},e.getNumDataBytesAndNumECBytesForBlockID=function(e,t,r,n,i,A){if(n>=r)throw new g.A("Block ID too large");var o=e%r,a=r-o,s=Math.floor(e/r),u=s+1,c=Math.floor(t/r),l=c+1,f=s-c,d=u-l;if(f!==d)throw new g.A("EC bytes mismatch");if(r!==a+o)throw new g.A("RS blocks mismatch");if(e!==(c+f)*a+(l+d)*o)throw new g.A("Total bytes mismatch");n<a?(i[0]=c,A[0]=f):(i[0]=l,A[0]=d)},e.interleaveWithECBytes=function(t,r,n,A){var o,a,s,u;if(t.getSizeInBytes()!==n)throw new g.A("Number of bits and data bytes does not match");for(var c=0,l=0,f=0,d=new Array,h=0;h<A;++h){var v=new Int32Array(1),m=new Int32Array(1);e.getNumDataBytesAndNumECBytesForBlockID(r,n,A,h,v,m);var w=v[0],b=new Uint8Array(w);t.toBytes(8*c,b,0,w);var B=e.generateECBytes(b,m[0]);d.push(new p(b,B)),l=Math.max(l,w),f=Math.max(f,B.length),c+=v[0]}if(n!==c)throw new g.A("Data bytes does not match offset");var C=new i.A;for(h=0;h<l;++h)try{for(var E=(o=void 0,y(d)),S=E.next();!S.done;S=E.next()){h<(b=S.value.getDataBytes()).length&&C.appendBits(b[h],8)}}catch(e){o={error:e}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}for(h=0;h<f;++h)try{for(var I=(s=void 0,y(d)),O=I.next();!O.done;O=I.next()){h<(B=O.value.getErrorCorrectionBytes()).length&&C.appendBits(B[h],8)}}catch(e){s={error:e}}finally{try{O&&!O.done&&(u=I.return)&&u.call(I)}finally{if(s)throw s.error}}if(r!==C.getSizeInBytes())throw new g.A("Interleaving error: "+r+" and "+C.getSizeInBytes()+" differ.");return C},e.generateECBytes=function(e,t){for(var r=e.length,n=new Int32Array(r+t),i=0;i<r;i++)n[i]=255&e[i];new a.A(o.A.QR_CODE_FIELD_256).encode(n,t);var A=new Uint8Array(t);for(i=0;i<t;i++)A[i]=n[r+i];return A},e.appendModeInfo=function(e,t){t.appendBits(e.getBits(),4)},e.appendLengthInfo=function(e,t,r,n){var i=r.getCharacterCountBits(t);if(e>=1<<i)throw new g.A(e+" is bigger than "+((1<<i)-1));n.appendBits(e,i)},e.appendBytes=function(t,r,n,i){switch(r){case s.A.NUMERIC:e.appendNumericBytes(t,n);break;case s.A.ALPHANUMERIC:e.appendAlphanumericBytes(t,n);break;case s.A.BYTE:e.append8BitBytes(t,n,i);break;case s.A.KANJI:e.appendKanjiBytes(t,n);break;default:throw new g.A("Invalid mode: "+r)}},e.getDigit=function(e){return e.charCodeAt(0)-48},e.isDigit=function(t){var r=e.getDigit(t);return r>=0&&r<=9},e.appendNumericBytes=function(t,r){for(var n=t.length,i=0;i<n;){var A=e.getDigit(t.charAt(i));if(i+2<n){var o=e.getDigit(t.charAt(i+1)),a=e.getDigit(t.charAt(i+2));r.appendBits(100*A+10*o+a,10),i+=3}else if(i+1<n){o=e.getDigit(t.charAt(i+1));r.appendBits(10*A+o,7),i+=2}else r.appendBits(A,4),i++}},e.appendAlphanumericBytes=function(t,r){for(var n=t.length,i=0;i<n;){var A=e.getAlphanumericCode(t.charCodeAt(i));if(-1===A)throw new g.A;if(i+1<n){var o=e.getAlphanumericCode(t.charCodeAt(i+1));if(-1===o)throw new g.A;r.appendBits(45*A+o,11),i+=2}else r.appendBits(A,6),i++}},e.append8BitBytes=function(e,t,r){var n;try{n=h.A.encode(e,r)}catch(e){throw new g.A(e)}for(var i=0,A=n.length;i!==A;i++){var o=n[i];t.appendBits(o,8)}},e.appendKanjiBytes=function(e,t){var r;try{r=h.A.encode(e,A.A.SJIS)}catch(e){throw new g.A(e)}for(var n=r.length,i=0;i<n;i+=2){var o=(255&r[i])<<8&4294967295|255&r[i+1],a=-1;if(o>=33088&&o<=40956?a=o-33088:o>=57408&&o<=60351&&(a=o-49472),-1===a)throw new g.A("Invalid byte sequence");var s=192*(a>>8)+(255&a);t.appendBits(s,13)}},e.appendECI=function(e,t){t.appendBits(s.A.ECI.getBits(),4),t.appendBits(e.getValue(),8)},e.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),e.DEFAULT_BYTE_MODE_ENCODING=A.A.UTF8.getName(),e}()},53640(e,t,r){"use strict";var n=r(28551),i=r(84270),A=TypeError;e.exports=function(e){if(n(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw new A("Incorrect hint");return i(this,e)}},53964(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(86012),i=r(12049),A=r(99184),o=r(52520),a=r(83908);function s(e,t,r,n=new Map,c=void 0){const l=c?.(e,t,r,n);if(void 0!==l)return l;if(o.isPrimitive(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const t=new Array(e.length);n.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,r,n,c);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){const t=new Map;n.set(e,t);for(const[i,A]of e)t.set(i,s(A,i,r,n,c));return t}if(e instanceof Set){const t=new Set;n.set(e,t);for(const i of e)t.add(s(i,void 0,r,n,c));return t}if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return e.subarray();if(a.isTypedArray(e)){const t=new(Object.getPrototypeOf(e).constructor)(e.length);n.set(e,t);for(let i=0;i<e.length;i++)t[i]=s(e[i],i,r,n,c);return t}if(e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,t),u(t,e,r,n,c),t}if("undefined"!=typeof File&&e instanceof File){const t=new File([e],e.name,{type:e.type});return n.set(e,t),u(t,e,r,n,c),t}if("undefined"!=typeof Blob&&e instanceof Blob){const t=new Blob([e],{type:e.type});return n.set(e,t),u(t,e,r,n,c),t}if(e instanceof Error){const t=new e.constructor;return n.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,u(t,e,r,n,c),t}if(e instanceof Boolean){const t=new Boolean(e.valueOf());return n.set(e,t),u(t,e,r,n,c),t}if(e instanceof Number){const t=new Number(e.valueOf());return n.set(e,t),u(t,e,r,n,c),t}if(e instanceof String){const t=new String(e.valueOf());return n.set(e,t),u(t,e,r,n,c),t}if("object"==typeof e&&function(e){switch(i.getTag(e)){case A.argumentsTag:case A.arrayTag:case A.arrayBufferTag:case A.dataViewTag:case A.booleanTag:case A.dateTag:case A.float32ArrayTag:case A.float64ArrayTag:case A.int8ArrayTag:case A.int16ArrayTag:case A.int32ArrayTag:case A.mapTag:case A.numberTag:case A.objectTag:case A.regexpTag:case A.setTag:case A.stringTag:case A.symbolTag:case A.uint8ArrayTag:case A.uint8ClampedArrayTag:case A.uint16ArrayTag:case A.uint32ArrayTag:return!0;default:return!1}}(e)){const t=Object.create(Object.getPrototypeOf(e));return n.set(e,t),u(t,e,r,n,c),t}return e}function u(e,t,r=e,i,A){const o=[...Object.keys(t),...n.getSymbols(t)];for(let n=0;n<o.length;n++){const a=o[n],u=Object.getOwnPropertyDescriptor(e,a);(null==u||u.writable)&&(e[a]=s(t[a],a,r,i,A))}}t.cloneDeepWith=function(e,t){return s(e,void 0,e,new Map,t)},t.cloneDeepWithImpl=s,t.copyProperties=u},54200(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(8193),i=r(95112),A=r(21465),o=r(3025);t.get=function e(t,r,a){if(null==t)return a;switch(typeof r){case"string":{if(n.isUnsafeProperty(r))return a;const A=t[r];return void 0===A?i.isDeepKey(r)?e(t,o.toPath(r),a):a:A}case"number":case"symbol":{"number"==typeof r&&(r=A.toKey(r));const e=t[r];return void 0===e?a:e}default:{if(Array.isArray(r))return function(e,t,r){if(0===t.length)return r;let i=e;for(let e=0;e<t.length;e++){if(null==i)return r;if(n.isUnsafeProperty(t[e]))return r;i=i[t[e]]}if(void 0===i)return r;return i}(t,r,a);if(r=Object.is(r?.valueOf(),-0)?"-0":String(r),n.isUnsafeProperty(r))return a;const e=t[r];return void 0===e?a:e}}}},54259(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(33097),i=r(75711),A=r(316);t.sortBy=function(e,...t){const r=t.length;return r>1&&A.isIterateeCall(e,t[0],t[1])?t=[]:r>2&&A.isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),n.orderBy(e,i.flatten(t),["asc"])}},54405(e,t){"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case o:case A:case c:case l:case h:return e;default:switch(e=e&&e.$$typeof){case s:case u:case d:case f:case a:return e;default:return t}}case n:return t}}}t.zv=function(e){return g(e)===i}},54534(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isEqualsSameValueZero=function(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}},54951(e,t,r){"use strict";r.d(t,{A:()=>a});var n=r(8032),i=r(98517),A=r(43334),o=function(){function e(){}return e.castAsNonUtf8Char=function(e,t){void 0===t&&(t=null);var r=t?t.getName():this.ISO88591;return A.A.decode(new Uint8Array([e]),r)},e.guessEncoding=function(t,r){if(null!=r&&void 0!==r.get(n.A.CHARACTER_SET))return r.get(n.A.CHARACTER_SET).toString();for(var i=t.length,A=!0,o=!0,a=!0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,p=0,g=0,y=0,v=0,m=t.length>3&&239===t[0]&&187===t[1]&&191===t[2],w=0;w<i&&(A||o||a);w++){var b=255&t[w];a&&(s>0?128&b?s--:a=!1:128&b&&(64&b?(s++,32&b?(s++,16&b?(s++,8&b?a=!1:l++):c++):u++):a=!1)),A&&(b>127&&b<160?A=!1:b>159&&(b<192||215===b||247===b)&&v++),o&&(f>0?b<64||127===b||b>252?o=!1:f--:128===b||160===b||b>239?o=!1:b>160&&b<224?(d++,p=0,++h>g&&(g=h)):b>127?(f++,h=0,++p>y&&(y=p)):(h=0,p=0))}return a&&s>0&&(a=!1),o&&f>0&&(o=!1),a&&(m||u+c+l>0)?e.UTF8:o&&(e.ASSUME_SHIFT_JIS||g>=3||y>=3)?e.SHIFT_JIS:A&&o?2===g&&2===d||10*v>=i?e.SHIFT_JIS:e.ISO88591:A?e.ISO88591:o?e.SHIFT_JIS:a?e.UTF8:e.PLATFORM_DEFAULT_ENCODING},e.format=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(e,r,i,A,o,a){if("%%"===e)return"%";if(void 0!==t[++n]){e=A?parseInt(A.substr(1)):void 0;var s,u=o?parseInt(o.substr(1)):void 0;switch(a){case"s":s=t[n];break;case"c":s=t[n][0];break;case"f":s=parseFloat(t[n]).toFixed(e);break;case"p":s=parseFloat(t[n]).toPrecision(e);break;case"e":s=parseFloat(t[n]).toExponential(e);break;case"x":s=parseInt(t[n]).toString(u||16);break;case"d":s=parseFloat(parseInt(t[n],u||10).toPrecision(e)).toFixed(0)}s="object"==typeof s?JSON.stringify(s):(+s).toString(u);for(var c=parseInt(i),l=i&&i[0]+""=="0"?"0":" ";s.length<c;)s=void 0!==r?s+l:l+s;return s}})},e.getBytes=function(e,t){return A.A.encode(e,t)},e.getCharCode=function(e,t){return void 0===t&&(t=0),e.charCodeAt(t)},e.getCharAt=function(e){return String.fromCharCode(e)},e.SHIFT_JIS=i.A.SJIS.getName(),e.GB2312="GB2312",e.ISO88591=i.A.ISO8859_1.getName(),e.EUC_JP="EUC_JP",e.UTF8=i.A.UTF8.getName(),e.PLATFORM_DEFAULT_ENCODING=e.UTF8,e.ASSUME_SHIFT_JIS=!1,e}();const a=o},55182(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(93234),i=r(28823),A=r(58503);const o=function(){function e(t,r,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),null==r&&(r=e.INIT_SIZE),null==n&&(n=t.getWidth()/2|0),null==i&&(i=t.getHeight()/2|0);var o=r/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new A.A}return e.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,r=this.upInit,n=this.downInit,i=!1,o=!0,a=!1,s=!1,u=!1,c=!1,l=!1,f=this.width,d=this.height;o;){o=!1;for(var h=!0;(h||!s)&&t<f;)(h=this.containsBlackPoint(r,n,t,!1))?(t++,o=!0,s=!0):s||t++;if(t>=f){i=!0;break}for(var p=!0;(p||!u)&&n<d;)(p=this.containsBlackPoint(e,t,n,!0))?(n++,o=!0,u=!0):u||n++;if(n>=d){i=!0;break}for(var g=!0;(g||!c)&&e>=0;)(g=this.containsBlackPoint(r,n,e,!1))?(e--,o=!0,c=!0):c||e--;if(e<0){i=!0;break}for(var y=!0;(y||!l)&&r>=0;)(y=this.containsBlackPoint(e,t,r,!0))?(r--,o=!0,l=!0):l||r--;if(r<0){i=!0;break}o&&(a=!0)}if(!i&&a){for(var v=t-e,m=null,w=1;null===m&&w<v;w++)m=this.getBlackPointOnSegment(e,n-w,e+w,n);if(null==m)throw new A.A;var b=null;for(w=1;null===b&&w<v;w++)b=this.getBlackPointOnSegment(e,r+w,e+w,r);if(null==b)throw new A.A;var B=null;for(w=1;null===B&&w<v;w++)B=this.getBlackPointOnSegment(t,r+w,t-w,r);if(null==B)throw new A.A;var C=null;for(w=1;null===C&&w<v;w++)C=this.getBlackPointOnSegment(t,n-w,t-w,n);if(null==C)throw new A.A;return this.centerEdges(C,m,B,b)}throw new A.A},e.prototype.getBlackPointOnSegment=function(e,t,r,A){for(var o=i.A.round(i.A.distance(e,t,r,A)),a=(r-e)/o,s=(A-t)/o,u=this.image,c=0;c<o;c++){var l=i.A.round(e+c*a),f=i.A.round(t+c*s);if(u.get(l,f))return new n.A(l,f)}return null},e.prototype.centerEdges=function(t,r,i,A){var o=t.getX(),a=t.getY(),s=r.getX(),u=r.getY(),c=i.getX(),l=i.getY(),f=A.getX(),d=A.getY(),h=e.CORR;return o<this.width/2?[new n.A(f-h,d+h),new n.A(s+h,u+h),new n.A(c-h,l-h),new n.A(o+h,a-h)]:[new n.A(f+h,d+h),new n.A(s+h,u-h),new n.A(c-h,l+h),new n.A(o-h,a-h)]},e.prototype.containsBlackPoint=function(e,t,r,n){var i=this.image;if(n){for(var A=e;A<=t;A++)if(i.get(A,r))return!0}else for(var o=e;o<=t;o++)if(i.get(r,o))return!0;return!1},e.INIT_SIZE=10,e.CORR=1,e}()},55448(e,t,r){"use strict";r.d(t,{Rw:()=>A,Xc:()=>o,ic:()=>s,uZ:()=>a});var n=r(96540),i=new Set(["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"]);function A(e){return"string"==typeof e&&i.has(e)}function o(e){return"string"==typeof e&&e.startsWith("data-")}function a(e){if("object"!=typeof e||null===e)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(A(r)||o(r))&&(t[r]=e[r]);return t}function s(e){return null==e?null:(0,n.isValidElement)(e)&&"object"==typeof e.props&&null!==e.props?a(e.props):"object"!=typeof e||Array.isArray(e)?null:a(e)}},55512(e,t,r){"use strict";r.d(t,{A:()=>u});var n=r(26741),i=r(36254),A=r(50735),o=r(43113),a=r(97483),s=r(57149);const u=function(){function e(){}return e.clearMatrix=function(e){e.clear(255)},e.buildMatrix=function(t,r,n,i,A){e.clearMatrix(A),e.embedBasicPatterns(n,A),e.embedTypeInfo(r,i,A),e.maybeEmbedVersionInfo(n,A),e.embedDataBits(t,i,A)},e.embedBasicPatterns=function(t,r){e.embedPositionDetectionPatternsAndSeparators(r),e.embedDarkDotAtLeftBottomCorner(r),e.maybeEmbedPositionAdjustmentPatterns(t,r),e.embedTimingPatterns(r)},e.embedTypeInfo=function(t,r,i){var A=new n.A;e.makeTypeInfoBits(t,r,A);for(var o=0,a=A.getSize();o<a;++o){var s=A.get(A.getSize()-1-o),u=e.TYPE_INFO_COORDINATES[o],c=u[0],l=u[1];if(i.setBoolean(c,l,s),o<8){var f=i.getWidth()-o-1,d=8;i.setBoolean(f,d,s)}else{f=8,d=i.getHeight()-7+(o-8);i.setBoolean(f,d,s)}}},e.maybeEmbedVersionInfo=function(t,r){if(!(t.getVersionNumber()<7)){var i=new n.A;e.makeVersionInfoBits(t,i);for(var A=17,o=0;o<6;++o)for(var a=0;a<3;++a){var s=i.get(A);A--,r.setBoolean(o,r.getHeight()-11+a,s),r.setBoolean(r.getHeight()-11+a,o,s)}}},e.embedDataBits=function(t,r,n){for(var i=0,A=-1,s=n.getWidth()-1,u=n.getHeight()-1;s>0;){for(6===s&&(s-=1);u>=0&&u<n.getHeight();){for(var c=0;c<2;++c){var l=s-c;if(e.isEmpty(n.get(l,u))){var f=void 0;i<t.getSize()?(f=t.get(i),++i):f=!1,255!==r&&o.A.getDataMaskBit(r,l,u)&&(f=!f),n.setBoolean(l,u,f)}}u+=A}u+=A=-A,s-=2}if(i!==t.getSize())throw new a.A("Not all bits consumed: "+i+"/"+t.getSize())},e.findMSBSet=function(e){return 32-i.A.numberOfLeadingZeros(e)},e.calculateBCHCode=function(t,r){if(0===r)throw new s.A("0 polynomial");var n=e.findMSBSet(r);for(t<<=n-1;e.findMSBSet(t)>=n;)t^=r<<e.findMSBSet(t)-n;return t},e.makeTypeInfoBits=function(t,r,i){if(!A.A.isValidMaskPattern(r))throw new a.A("Invalid mask pattern");var o=t.getBits()<<3|r;i.appendBits(o,5);var s=e.calculateBCHCode(o,e.TYPE_INFO_POLY);i.appendBits(s,10);var u=new n.A;if(u.appendBits(e.TYPE_INFO_MASK_PATTERN,15),i.xor(u),15!==i.getSize())throw new a.A("should not happen but we got: "+i.getSize())},e.makeVersionInfoBits=function(t,r){r.appendBits(t.getVersionNumber(),6);var n=e.calculateBCHCode(t.getVersionNumber(),e.VERSION_INFO_POLY);if(r.appendBits(n,12),18!==r.getSize())throw new a.A("should not happen but we got: "+r.getSize())},e.isEmpty=function(e){return 255===e},e.embedTimingPatterns=function(t){for(var r=8;r<t.getWidth()-8;++r){var n=(r+1)%2;e.isEmpty(t.get(r,6))&&t.setNumber(r,6,n),e.isEmpty(t.get(6,r))&&t.setNumber(6,r,n)}},e.embedDarkDotAtLeftBottomCorner=function(e){if(0===e.get(8,e.getHeight()-8))throw new a.A;e.setNumber(8,e.getHeight()-8,1)},e.embedHorizontalSeparationPattern=function(t,r,n){for(var i=0;i<8;++i){if(!e.isEmpty(n.get(t+i,r)))throw new a.A;n.setNumber(t+i,r,0)}},e.embedVerticalSeparationPattern=function(t,r,n){for(var i=0;i<7;++i){if(!e.isEmpty(n.get(t,r+i)))throw new a.A;n.setNumber(t,r+i,0)}},e.embedPositionAdjustmentPattern=function(t,r,n){for(var i=0;i<5;++i)for(var A=e.POSITION_ADJUSTMENT_PATTERN[i],o=0;o<5;++o)n.setNumber(t+o,r+i,A[o])},e.embedPositionDetectionPattern=function(t,r,n){for(var i=0;i<7;++i)for(var A=e.POSITION_DETECTION_PATTERN[i],o=0;o<7;++o)n.setNumber(t+o,r+i,A[o])},e.embedPositionDetectionPatternsAndSeparators=function(t){var r=e.POSITION_DETECTION_PATTERN[0].length;e.embedPositionDetectionPattern(0,0,t),e.embedPositionDetectionPattern(t.getWidth()-r,0,t),e.embedPositionDetectionPattern(0,t.getWidth()-r,t);e.embedHorizontalSeparationPattern(0,7,t),e.embedHorizontalSeparationPattern(t.getWidth()-8,7,t),e.embedHorizontalSeparationPattern(0,t.getWidth()-8,t);e.embedVerticalSeparationPattern(7,0,t),e.embedVerticalSeparationPattern(t.getHeight()-7-1,0,t),e.embedVerticalSeparationPattern(7,t.getHeight()-7,t)},e.maybeEmbedPositionAdjustmentPatterns=function(t,r){if(!(t.getVersionNumber()<2))for(var n=t.getVersionNumber()-1,i=e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n],A=0,o=i.length;A!==o;A++){var a=i[A];if(a>=0)for(var s=0;s!==o;s++){var u=i[s];u>=0&&e.isEmpty(r.get(u,a))&&e.embedPositionAdjustmentPattern(u-2,a-2,r)}}},e.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),e.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),e.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),e.VERSION_INFO_POLY=7973,e.TYPE_INFO_POLY=1335,e.TYPE_INFO_MASK_PATTERN=21522,e}()},55694(e,t,r){"use strict";r.d(t,{x:()=>u});var n,i=r(96540),A=r.t(i,2),o=r(59744),a=null!==(n=A["useId".toString()])&&void 0!==n?n:()=>{var[e]=i.useState(()=>(0,o.NF)("uid-"));return e};var s=(0,i.createContext)(void 0),u=e=>{var{id:t,type:r,children:n}=e,A=function(e,t){var r=a();return t||(e?"".concat(e,"-").concat(r):r)}("recharts-".concat(r),t);return i.createElement(s.Provider,{value:A},n(A))}},55846(e,t,r){"use strict";r.d(t,{M:()=>A,t:()=>i});var n=r(96540),i=(0,n.createContext)(null),A=()=>(0,n.useContext)(i)},55978(e,t,r){"use strict";r.d(t,{$g:()=>o,Hw:()=>A,Td:()=>s,au:()=>a,xH:()=>i});var n=r(49082),i=e=>e.options.defaultTooltipEventType,A=e=>e.options.validateTooltipEventTypes;function o(e,t,r){if(null==e)return t;var n=e?"axis":"item";return null==r?t:r.includes(n)?n:t}function a(e,t){return o(t,i(e),A(e))}function s(e){return(0,n.G)(t=>a(t,e))}},56682(e,t,r){"use strict";var n=r(69565),i=r(28551),A=r(94901),o=r(22195),a=r(57323),s=TypeError;e.exports=function(e,t){var r=e.exec;if(A(r)){var u=n(r,e,t);return null!==u&&i(u),u}if("RegExp"===o(e))return n(a,e,t);throw new s("RegExp#exec called on incompatible receiver")}},56905(e,t,r){"use strict";r.d(t,{L:()=>n,Y:()=>i});function n(e){var t=10**(arguments.length>1&&void 0!==arguments[1]?arguments[1]:4),r=Math.round(e*t)/t;return Object.is(r,-0)?0:r}function i(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return e.reduce((e,t,i)=>{var A=r[i-1];return"string"==typeof A?e+A+t:void 0!==A?e+n(A)+t:e+t},"")}},57097(e,t,r){"use strict";r.d(t,{n:()=>c});var n=r(96540),i=r(36158),A=r(26261),o=r(66500),a=r(24880),s=class extends o.Q{#p;#w=void 0;#K;#z;constructor(e,t){super(),this.#p=e,this.setOptions(t),this.bindMethods(),this.#G()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#p.defaultMutationOptions(e),(0,a.f8)(this.options,t)||this.#p.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#K,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,a.EN)(t.mutationKey)!==(0,a.EN)(this.options.mutationKey)?this.reset():"pending"===this.#K?.state.status&&this.#K.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#K?.removeObserver(this)}onMutationUpdate(e){this.#G(),this.#N(e)}getCurrentResult(){return this.#w}reset(){this.#K?.removeObserver(this),this.#K=void 0,this.#G(),this.#N()}mutate(e,t){return this.#z=t,this.#K?.removeObserver(this),this.#K=this.#p.getMutationCache().build(this.#p,this.options),this.#K.addObserver(this),this.#K.execute(e)}#G(){const e=this.#K?.state??(0,i.$)();this.#w={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#N(e){A.jG.batch(()=>{if(this.#z&&this.hasListeners()){const t=this.#w.variables,r=this.#w.context,n={client:this.#p,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===e?.type){try{this.#z.onSuccess?.(e.data,t,r,n)}catch(e){Promise.reject(e)}try{this.#z.onSettled?.(e.data,null,t,r,n)}catch(e){Promise.reject(e)}}else if("error"===e?.type){try{this.#z.onError?.(e.error,t,r,n)}catch(e){Promise.reject(e)}try{this.#z.onSettled?.(void 0,e.error,t,r,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#w)})})}},u=r(97665);function c(e,t){const r=(0,u.jE)(t),[i]=n.useState(()=>new s(r,e));n.useEffect(()=>{i.setOptions(e)},[i,e]);const o=n.useSyncExternalStore(n.useCallback(e=>i.subscribe(A.jG.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=n.useCallback((e,t)=>{i.mutate(e,t).catch(a.lQ)},[i]);if(o.error&&(0,a.GU)(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}},57149(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="IllegalArgumentException",t}(i.A);const a=o},57829(e,t,r){"use strict";var n=r(68183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},57994(e,t,r){"use strict";var n=r(33297),i=r(73872),A=r(57149);!function(){function e(){}e.prototype.encode=function(e,t,r,o,a){if(t!==i.A.QR_CODE)throw new A.A("No encoder available for format "+t);return(new n.A).encode(e,t,r,o,a)}}()},58008(e,t,r){"use strict";r.d(t,{Cj:()=>A,Pg:()=>o,Ub:()=>a});var n=r(49082),i=r(74531),A=(e,t,r)=>{var A=(0,n.j)();return(n,o)=>a=>{null==e||e(n,o,a),A((0,i.RD)({activeIndex:String(o),activeDataKey:t,activeCoordinate:n.tooltipPosition,activeGraphicalItemId:r}))}},o=e=>{var t=(0,n.j)();return(r,n)=>A=>{null==e||e(r,n,A),t((0,i.oP)())}},a=(e,t,r)=>{var A=(0,n.j)();return(n,o)=>a=>{null==e||e(n,o,a),A((0,i.ML)({activeIndex:String(o),activeDataKey:t,activeCoordinate:n.tooltipPosition,activeGraphicalItemId:r}))}}},58273(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(44905),i=r(52520),A=r(54534);function o(e,t,r,u){if(t===e)return!0;switch(typeof t){case"object":return function(e,t,r,n){if(null==t)return!0;if(Array.isArray(t))return a(e,t,r,n);if(t instanceof Map)return function(e,t,r,n){if(0===t.size)return!0;if(!(e instanceof Map))return!1;for(const[i,A]of t.entries()){if(!1===r(e.get(i),A,i,e,t,n))return!1}return!0}(e,t,r,n);if(t instanceof Set)return s(e,t,r,n);const A=Object.keys(t);if(null==e||i.isPrimitive(e))return 0===A.length;if(0===A.length)return!0;if(n?.has(t))return n.get(t)===e;n?.set(t,e);try{for(let o=0;o<A.length;o++){const a=A[o];if(!i.isPrimitive(e)&&!(a in e))return!1;if(void 0===t[a]&&void 0!==e[a])return!1;if(null===t[a]&&null!==e[a])return!1;if(!r(e[a],t[a],a,e,t,n))return!1}return!0}finally{n?.delete(t)}}(e,t,r,u);case"function":return Object.keys(t).length>0?o(e,{...t},r,u):A.isEqualsSameValueZero(e,t);default:return n.isObject(e)?"string"!=typeof t||""===t:A.isEqualsSameValueZero(e,t)}}function a(e,t,r,n){if(0===t.length)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let A=0;A<t.length;A++){const o=t[A];let a=!1;for(let s=0;s<e.length;s++){if(i.has(s))continue;let u=!1;if(r(e[s],o,A,e,t,n)&&(u=!0),u){i.add(s),a=!0;break}}if(!a)return!1}return!0}function s(e,t,r,n){return 0===t.size||e instanceof Set&&a([...e],[...t],r,n)}t.isMatchWith=function e(t,r,n){return"function"!=typeof n?e(t,r,()=>{}):o(t,r,function e(t,r,i,A,a,s){const u=n(t,r,i,A,a,s);return void 0!==u?Boolean(u):o(t,r,e,s)},new Map)},t.isSetMatch=s},58346(e,t,r){"use strict";r.d(t,{A:()=>l});var n,i=r(51084),A=r(82299),o=r(88468),a=r(43334),s=r(54951),u=r(31327),c=r(59379);!function(e){e[e.PAD_ENCODE=0]="PAD_ENCODE",e[e.ASCII_ENCODE=1]="ASCII_ENCODE",e[e.C40_ENCODE=2]="C40_ENCODE",e[e.TEXT_ENCODE=3]="TEXT_ENCODE",e[e.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",e[e.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",e[e.BASE256_ENCODE=6]="BASE256_ENCODE"}(n||(n={}));const l=function(){function e(){}return e.decode=function(e){var t=new A.A(e),r=new o.A,a=new o.A,s=new Array,c=n.ASCII_ENCODE;do{if(c===n.ASCII_ENCODE)c=this.decodeAsciiSegment(t,r,a);else{switch(c){case n.C40_ENCODE:this.decodeC40Segment(t,r);break;case n.TEXT_ENCODE:this.decodeTextSegment(t,r);break;case n.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,r);break;case n.EDIFACT_ENCODE:this.decodeEdifactSegment(t,r);break;case n.BASE256_ENCODE:this.decodeBase256Segment(t,r,s);break;default:throw new u.A}c=n.ASCII_ENCODE}}while(c!==n.PAD_ENCODE&&t.available()>0);return a.length()>0&&r.append(a.toString()),new i.A(e,r.toString(),0===s.length?null:s,null)},e.decodeAsciiSegment=function(e,t,r){var i=!1;do{var A=e.readBits(8);if(0===A)throw new u.A;if(A<=128)return i&&(A+=128),t.append(String.fromCharCode(A-1)),n.ASCII_ENCODE;if(129===A)return n.PAD_ENCODE;if(A<=229){var o=A-130;o<10&&t.append("0"),t.append(""+o)}else switch(A){case 230:return n.C40_ENCODE;case 231:return n.BASE256_ENCODE;case 232:t.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:i=!0;break;case 236:t.append("[)>05"),r.insert(0,"");break;case 237:t.append("[)>06"),r.insert(0,"");break;case 238:return n.ANSIX12_ENCODE;case 239:return n.TEXT_ENCODE;case 240:return n.EDIFACT_ENCODE;default:if(254!==A||0!==e.available())throw new u.A}}while(e.available()>0);return n.ASCII_ENCODE},e.decodeC40Segment=function(e,t){var r=!1,n=[],i=0;do{if(8===e.available())return;var A=e.readBits(8);if(254===A)return;this.parseTwoBytes(A,e.readBits(8),n);for(var o=0;o<3;o++){var a=n[o];switch(i){case 0:if(a<3)i=a+1;else{if(!(a<this.C40_BASIC_SET_CHARS.length))throw new u.A;var s=this.C40_BASIC_SET_CHARS[a];r?(t.append(String.fromCharCode(s.charCodeAt(0)+128)),r=!1):t.append(s)}break;case 1:r?(t.append(String.fromCharCode(a+128)),r=!1):t.append(String.fromCharCode(a)),i=0;break;case 2:if(a<this.C40_SHIFT2_SET_CHARS.length){s=this.C40_SHIFT2_SET_CHARS[a];r?(t.append(String.fromCharCode(s.charCodeAt(0)+128)),r=!1):t.append(s)}else switch(a){case 27:t.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new u.A}i=0;break;case 3:r?(t.append(String.fromCharCode(a+224)),r=!1):t.append(String.fromCharCode(a+96)),i=0;break;default:throw new u.A}}}while(e.available()>0)},e.decodeTextSegment=function(e,t){var r=!1,n=[],i=0;do{if(8===e.available())return;var A=e.readBits(8);if(254===A)return;this.parseTwoBytes(A,e.readBits(8),n);for(var o=0;o<3;o++){var a=n[o];switch(i){case 0:if(a<3)i=a+1;else{if(!(a<this.TEXT_BASIC_SET_CHARS.length))throw new u.A;var s=this.TEXT_BASIC_SET_CHARS[a];r?(t.append(String.fromCharCode(s.charCodeAt(0)+128)),r=!1):t.append(s)}break;case 1:r?(t.append(String.fromCharCode(a+128)),r=!1):t.append(String.fromCharCode(a)),i=0;break;case 2:if(a<this.TEXT_SHIFT2_SET_CHARS.length){s=this.TEXT_SHIFT2_SET_CHARS[a];r?(t.append(String.fromCharCode(s.charCodeAt(0)+128)),r=!1):t.append(s)}else switch(a){case 27:t.append(String.fromCharCode(29));break;case 30:r=!0;break;default:throw new u.A}i=0;break;case 3:if(!(a<this.TEXT_SHIFT3_SET_CHARS.length))throw new u.A;s=this.TEXT_SHIFT3_SET_CHARS[a];r?(t.append(String.fromCharCode(s.charCodeAt(0)+128)),r=!1):t.append(s),i=0;break;default:throw new u.A}}}while(e.available()>0)},e.decodeAnsiX12Segment=function(e,t){var r=[];do{if(8===e.available())return;var n=e.readBits(8);if(254===n)return;this.parseTwoBytes(n,e.readBits(8),r);for(var i=0;i<3;i++){var A=r[i];switch(A){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(A<14)t.append(String.fromCharCode(A+44));else{if(!(A<40))throw new u.A;t.append(String.fromCharCode(A+51))}}}}while(e.available()>0)},e.parseTwoBytes=function(e,t,r){var n=(e<<8)+t-1,i=Math.floor(n/1600);r[0]=i,n-=1600*i,i=Math.floor(n/40),r[1]=i,r[2]=n-40*i},e.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var n=e.readBits(6);if(31===n){var i=8-e.getBitOffset();return void(8!==i&&e.readBits(i))}32&n||(n|=64),t.append(String.fromCharCode(n))}}while(e.available()>0)},e.decodeBase256Segment=function(e,t,r){var n,i=1+e.getByteOffset(),A=this.unrandomize255State(e.readBits(8),i++);if((n=0===A?e.available()/8|0:A<250?A:250*(A-249)+this.unrandomize255State(e.readBits(8),i++))<0)throw new u.A;for(var o=new Uint8Array(n),l=0;l<n;l++){if(e.available()<8)throw new u.A;o[l]=this.unrandomize255State(e.readBits(8),i++)}r.push(o);try{t.append(a.A.decode(o,s.A.ISO88591))}catch(e){throw new c.A("Platform does not support required encoding: "+e.message)}},e.unrandomize255State=function(e,t){var r=e-(149*t%255+1);return r>=0?r:r+256},e.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],e.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],e.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],e.TEXT_SHIFT2_SET_CHARS=e.C40_SHIFT2_SET_CHARS,e.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],e}()},58493(e,t,r){"use strict";var n=r(96540);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},A=n.useState,o=n.useEffect,a=n.useLayoutEffect,s=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=A({inst:{value:r,getSnapshot:t}}),i=n[0].inst,c=n[1];return a(function(){i.value=r,i.getSnapshot=t,u(i)&&c({inst:i})},[e,r,t]),o(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),s(r),r};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:c},58503(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}(i.A);const a=o},58522(e,t,r){"use strict";r.d(t,{h:()=>B});var n,i,A,o,a,s,u,c=r(96540),l=r(34164),f=r(14040),d=r(59744),h=r(77404),p=r(80196),g=r(56905);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(null,arguments)}function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var m=e=>{var{cx:t,cy:r,radius:n,angle:i,sign:A,isExternal:o,cornerRadius:a,cornerIsExternal:s}=e,u=a*(o?1:-1)+n,c=Math.asin(a/u)/f.Kg,l=s?i:i+A*c,d=s?i-A*c:i;return{center:(0,f.IZ)(t,r,u,l),circleTangency:(0,f.IZ)(t,r,n,l),lineTangency:(0,f.IZ)(t,r,u*Math.cos(c*f.Kg),d),theta:c}},w=e=>{var{cx:t,cy:r,innerRadius:o,outerRadius:a,startAngle:s,endAngle:u}=e,c=((e,t)=>(0,d.sA)(t-e)*Math.min(Math.abs(t-e),359.999))(s,u),l=s+c,h=(0,f.IZ)(t,r,a,s),p=(0,f.IZ)(t,r,a,l),y=(0,g.Y)(n||(n=v(["M ",",","\n A ",",",",0,\n ",",",",\n ",",","\n "])),h.x,h.y,a,a,+(Math.abs(c)>180),+(s>l),p.x,p.y);if(o>0){var m=(0,f.IZ)(t,r,o,s),w=(0,f.IZ)(t,r,o,l);y+=(0,g.Y)(i||(i=v(["L ",",","\n A ",",",",0,\n ",",",",\n ",","," Z"])),w.x,w.y,o,o,+(Math.abs(c)>180),+(s<=l),m.x,m.y)}else y+=(0,g.Y)(A||(A=v(["L ",","," Z"])),t,r);return y},b={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},B=e=>{var t=(0,h.e)(e,b),{cx:r,cy:n,innerRadius:i,outerRadius:A,cornerRadius:f,forceCornerRadius:B,cornerIsExternal:C,startAngle:E,endAngle:S,className:I}=t;if(A<i||E===S)return null;var O,F=(0,l.$)("recharts-sector",I),_=A-i,x=(0,d.F4)(f,_,0,!0);return O=x>0&&Math.abs(E-S)<360?(e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,cornerRadius:A,forceCornerRadius:c,cornerIsExternal:l,startAngle:f,endAngle:h}=e,p=(0,d.sA)(h-f),{circleTangency:y,lineTangency:b,theta:B}=m({cx:t,cy:r,radius:i,angle:f,sign:p,cornerRadius:A,cornerIsExternal:l}),{circleTangency:C,lineTangency:E,theta:S}=m({cx:t,cy:r,radius:i,angle:h,sign:-p,cornerRadius:A,cornerIsExternal:l}),I=l?Math.abs(f-h):Math.abs(f-h)-B-S;if(I<0)return c?(0,g.Y)(o||(o=v(["M ",",","\n a",",",",0,0,1,",",0\n a",",",",0,0,1,",",0\n "])),b.x,b.y,A,A,2*A,A,A,2*-A):w({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:f,endAngle:h});var O=(0,g.Y)(a||(a=v(["M ",",","\n A",",",",0,0,",",",",","\n A",",",",0,",",",",",",","\n A",",",",0,0,",",",",","\n "])),b.x,b.y,A,A,+(p<0),y.x,y.y,i,i,+(I>180),+(p<0),C.x,C.y,A,A,+(p<0),E.x,E.y);if(n>0){var{circleTangency:F,lineTangency:_,theta:x}=m({cx:t,cy:r,radius:n,angle:f,sign:p,isExternal:!0,cornerRadius:A,cornerIsExternal:l}),{circleTangency:U,lineTangency:Q,theta:T}=m({cx:t,cy:r,radius:n,angle:h,sign:-p,isExternal:!0,cornerRadius:A,cornerIsExternal:l}),M=l?Math.abs(f-h):Math.abs(f-h)-x-T;if(M<0&&0===A)return"".concat(O,"L").concat(t,",").concat(r,"Z");O+=(0,g.Y)(s||(s=v(["L",",","\n A",",",",0,0,",",",",","\n A",",",",0,",",",",",",","\n A",",",",0,0,",",",",","Z"])),Q.x,Q.y,A,A,+(p<0),U.x,U.y,n,n,+(M>180),+(p>0),F.x,F.y,A,A,+(p<0),_.x,_.y)}else O+=(0,g.Y)(u||(u=v(["L",",","Z"])),t,r);return O})({cx:r,cy:n,innerRadius:i,outerRadius:A,cornerRadius:Math.min(x,_/2),forceCornerRadius:B,cornerIsExternal:C,startAngle:E,endAngle:S}):w({cx:r,cy:n,innerRadius:i,outerRadius:A,startAngle:E,endAngle:S}),c.createElement("path",y({},(0,p.a)(t),{className:F,d:O}))}},58904(e,t,r){"use strict";r.d(t,{II:()=>c,cc:()=>u,v_:()=>s});var n=r(29658),i=r(96035),A=r(94658),o=r(24880);function a(e){return Math.min(1e3*2**e,3e4)}function s(e){return"online"!==(e??"online")||i.t.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let t,r=!1,c=0;const l=(0,A.T)(),f=()=>"pending"!==l.status,d=()=>n.m.isFocused()&&("always"===e.networkMode||i.t.isOnline())&&e.canRun(),h=()=>s(e.networkMode)&&e.canRun(),p=e=>{f()||(t?.(),l.resolve(e))},g=e=>{f()||(t?.(),l.reject(e))},y=()=>new Promise(r=>{t=e=>{(f()||d())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,f()||e.onContinue?.()}),v=()=>{if(f())return;let t;const n=0===c?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if(f())return;const n=e.retry??(o.S$?0:3),i=e.retryDelay??a,A="function"==typeof i?i(c,t):i,s=!0===n||"number"==typeof n&&c<n||"function"==typeof n&&n(c,t);!r&&s?(c++,e.onFail?.(c,t),(0,o.yy)(A).then(()=>d()?void 0:y()).then(()=>{r?g(t):v()})):g(t)})};return{promise:l,status:()=>l.status,cancel:t=>{if(!f()){const r=new u(t);g(r),e.onCancel?.(r)}},continue:()=>(t?.(),l),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:h,start:()=>(h()?v():y().then(v),l)}}},58940(e,t,r){"use strict";var n=r(46518),i=r(52703);n({global:!0,forced:parseInt!==i},{parseInt:i})},59089(e,t,r){"use strict";var n=r(46518),i=r(79504),A=Date,o=i(A.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new A)}})},59181(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isLength=function(e){return Number.isSafeInteger(e)&&e>=0}},59225(e,t,r){"use strict";var n,i,A,o,a=r(44576),s=r(18745),u=r(76080),c=r(94901),l=r(39297),f=r(79039),d=r(20397),h=r(67680),p=r(4055),g=r(22812),y=r(89544),v=r(16193),m=a.setImmediate,w=a.clearImmediate,b=a.process,B=a.Dispatch,C=a.Function,E=a.MessageChannel,S=a.String,I=0,O={},F="onreadystatechange";f(function(){n=a.location});var _=function(e){if(l(O,e)){var t=O[e];delete O[e],t()}},x=function(e){return function(){_(e)}},U=function(e){_(e.data)},Q=function(e){a.postMessage(S(e),n.protocol+"//"+n.host)};m&&w||(m=function(e){g(arguments.length,1);var t=c(e)?e:C(e),r=h(arguments,1);return O[++I]=function(){s(t,void 0,r)},i(I),I},w=function(e){delete O[e]},v?i=function(e){b.nextTick(x(e))}:B&&B.now?i=function(e){B.now(x(e))}:E&&!y?(o=(A=new E).port2,A.port1.onmessage=U,i=u(o.postMessage,o)):a.addEventListener&&c(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!f(Q)?(i=Q,a.addEventListener("message",U,!1)):i=F in p("script")?function(e){d.appendChild(p("script"))[F]=function(){d.removeChild(this),_(e)}}:function(e){setTimeout(x(e),0)}),e.exports={set:m,clear:w}},59363(e,t,r){"use strict";r.d(t,{A:()=>c});var n=r(7758),i=r(73872),A=r(8032),o=r(15511),a=r(92819),s=r(38102),u=r(4900);const c=function(){function e(){}return e.prototype.decode=function(e,t){void 0===t&&(t=null);var r=null,A=new u.A(e.getBlackMatrix()),c=null,l=null;try{c=(f=A.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(t,c),l=(new s.A).decode(f)}catch(e){r=e}if(null==l)try{var f;c=(f=A.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(t,c),l=(new s.A).decode(f)}catch(e){if(null!=r)throw r;throw e}var d=new n.A(l.getText(),l.getRawBytes(),l.getNumBits(),c,i.A.AZTEC,a.A.currentTimeMillis()),h=l.getByteSegments();null!=h&&d.putMetadata(o.A.BYTE_SEGMENTS,h);var p=l.getECLevel();return null!=p&&d.putMetadata(o.A.ERROR_CORRECTION_LEVEL,p),d},e.prototype.reportFoundResultPoints=function(e,t){if(null!=e){var r=e.get(A.A.NEED_RESULT_POINT_CALLBACK);null!=r&&t.forEach(function(e,t,n){r.foundPossibleResultPoint(e)})}},e.prototype.reset=function(){},e}()},59379(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="IllegalStateException",t}(i.A);const a=o},59482(e,t,r){"use strict";r.d(t,{r:()=>a});var n=r(96540),i=r(49082),A=r(74531),o=r(12070);function a(e){var{tooltipEntrySettings:t}=e,r=(0,i.j)(),a=(0,o.r)(),s=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{a||(null===s.current?r((0,A.Ix)(t)):s.current!==t&&r((0,A.Zp)({prev:s.current,next:t})),s.current=t)},[t,r,a]),(0,n.useLayoutEffect)(()=>()=>{s.current&&(r((0,A.XB)(s.current)),s.current=null)},[r]),null}},59744(e,t,r){"use strict";r.d(t,{CG:()=>h,Et:()=>u,F4:()=>d,GW:()=>p,M8:()=>a,NF:()=>f,Zb:()=>v,_3:()=>s,eP:()=>g,lQ:()=>w,n9:()=>m,sA:()=>o,uy:()=>y,vh:()=>c});var n=r(80305),i=r.n(n),A=r(56905),o=e=>0===e?0:e>0?1:-1,a=e=>"number"==typeof e&&e!=+e,s=e=>"string"==typeof e&&e.indexOf("%")===e.length-1,u=e=>("number"==typeof e||e instanceof Number)&&!a(e),c=e=>u(e)||"string"==typeof e,l=0,f=e=>{var t=++l;return"".concat(e||"").concat(t)},d=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!u(e)&&"string"!=typeof e)return n;if(s(e)){if(null==t)return n;var A=e.indexOf("%");r=t*parseFloat(e.slice(0,A))/100}else r=+e;return a(r)&&(r=n),i&&null!=t&&r>t&&(r=t),r},h=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[String(e[n])])return!0;r[String(e[n])]=!0}return!1};function p(e,t,r){return u(e)&&u(t)?(0,A.L)(e+r*(t-e)):t}function g(e,t,r){if(e&&e.length)return e.find(e=>e&&("function"==typeof t?t(e):i()(e,t))===r)}var y=e=>null==e,v=e=>y(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function m(e){return null!=e}function w(){}},59904(e,t,r){"use strict";r(46518)({target:"Object",stat:!0,sham:!r(43724)},{create:r(2360)})},59938(e,t,r){"use strict";r.d(t,{m:()=>n});var n={devToolsEnabled:!0,isSsr:!("undefined"!=typeof window&&window.document&&Boolean(window.document.createElement)&&window.setTimeout)}},60184(e,t,r){e.exports=r(54259).sortBy},60196(e,t,r){"use strict";r.d(t,{$:()=>_});var n,i=r(59379),A=r(22593),o=r(45698),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const s=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.encodeCompressedGtin=function(e,t){e.append("(01)");var r=e.length();e.append("9"),this.encodeCompressedGtinWithoutAI(e,t,r)},t.prototype.encodeCompressedGtinWithoutAI=function(e,r,n){for(var i=0;i<4;++i){var A=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*i,10);A/100==0&&e.append("0"),A/10==0&&e.append("0"),e.append(A)}t.appendCheckDigit(e,n)},t.appendCheckDigit=function(e,t){for(var r=0,n=0;n<13;n++){var i=e.charAt(n+t).charCodeAt(0)-"0".charCodeAt(0);r+=1&n?i:3*i}10===(r=10-r%10)&&(r=0),e.append(r)},t.GTIN_SIZE=40,t}(o.A);var u=r(88468),c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const l=function(e){function t(t){return e.call(this,t)||this}return c(t,e),t.prototype.parseInformation=function(){var e=new u.A;e.append("(01)");var r=e.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE,4);return e.append(n),this.encodeCompressedGtinWithoutAI(e,t.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE+44)},t.HEADER_SIZE=4,t}(s);var f=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const d=function(e){function t(t){return e.call(this,t)||this}return f(t,e),t.prototype.parseInformation=function(){var e=new u.A;return this.getGeneralDecoder().decodeAllCodes(e,t.HEADER_SIZE)},t.HEADER_SIZE=5,t}(o.A);var h=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const p=function(e){function t(t){return e.call(this,t)||this}return h(t,e),t.prototype.encodeCompressedWeight=function(e,t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t,r);this.addWeightCode(e,n);for(var i=this.checkWeight(n),A=1e5,o=0;o<5;++o)i/A===0&&e.append("0"),A/=10;e.append(i)},t}(s);var g=r(58503),y=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const v=function(e){function t(t){return e.call(this,t)||this}return y(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+p.GTIN_SIZE+t.WEIGHT_SIZE)throw new g.A;var e=new u.A;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+p.GTIN_SIZE,t.WEIGHT_SIZE),e.toString()},t.HEADER_SIZE=5,t.WEIGHT_SIZE=15,t}(p);var m=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const w=function(e){function t(t){return e.call(this,t)||this}return m(t,e),t.prototype.addWeightCode=function(e,t){e.append("(3103)")},t.prototype.checkWeight=function(e){return e},t}(v);var b=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const B=function(e){function t(t){return e.call(this,t)||this}return b(t,e),t.prototype.addWeightCode=function(e,t){t<1e4?e.append("(3202)"):e.append("(3203)")},t.prototype.checkWeight=function(e){return e<1e4?e:e-1e4},t}(v);var C=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const E=function(e){function t(t){return e.call(this,t)||this}return C(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+s.GTIN_SIZE)throw new g.A;var e=new u.A;this.encodeCompressedGtin(e,t.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+s.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(392"),e.append(r),e.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+s.GTIN_SIZE+t.LAST_DIGIT_SIZE,null);return e.append(n.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t}(s);var S=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const I=function(e){function t(t){return e.call(this,t)||this}return S(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()<t.HEADER_SIZE+s.GTIN_SIZE)throw new g.A;var e=new u.A;this.encodeCompressedGtin(e,t.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+s.GTIN_SIZE,t.LAST_DIGIT_SIZE);e.append("(393"),e.append(r),e.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(t.HEADER_SIZE+s.GTIN_SIZE+t.LAST_DIGIT_SIZE,t.FIRST_THREE_DIGITS_SIZE);n/100==0&&e.append("0"),n/10==0&&e.append("0"),e.append(n);var i=this.getGeneralDecoder().decodeGeneralPurposeField(t.HEADER_SIZE+s.GTIN_SIZE+t.LAST_DIGIT_SIZE+t.FIRST_THREE_DIGITS_SIZE,null);return e.append(i.getNewString()),e.toString()},t.HEADER_SIZE=8,t.LAST_DIGIT_SIZE=2,t.FIRST_THREE_DIGITS_SIZE=10,t}(s);var O=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const F=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dateCode=n,i.firstAIdigits=r,i}return O(t,e),t.prototype.parseInformation=function(){if(this.getInformation().getSize()!==t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE+t.DATE_SIZE)throw new g.A;var e=new u.A;return this.encodeCompressedGtin(e,t.HEADER_SIZE),this.encodeCompressedWeight(e,t.HEADER_SIZE+t.GTIN_SIZE,t.WEIGHT_SIZE),this.encodeCompressedDate(e,t.HEADER_SIZE+t.GTIN_SIZE+t.WEIGHT_SIZE),e.toString()},t.prototype.encodeCompressedDate=function(e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,t.DATE_SIZE);if(38400!==n){e.append("("),e.append(this.dateCode),e.append(")");var i=n%32,A=(n/=32)%12+1,o=n/=12;o/10==0&&e.append("0"),e.append(o),A/10==0&&e.append("0"),e.append(A),i/10==0&&e.append("0"),e.append(i)}},t.prototype.addWeightCode=function(e,t){e.append("("),e.append(this.firstAIdigits),e.append(t/1e5),e.append(")")},t.prototype.checkWeight=function(e){return e%1e5},t.HEADER_SIZE=8,t.WEIGHT_SIZE=20,t.DATE_SIZE=16,t}(p);function _(e){try{if(e.get(1))return new l(e);if(!e.get(2))return new d(e);switch(A.A.extractNumericValueFromBitArray(e,1,4)){case 4:return new w(e);case 5:return new B(e)}switch(A.A.extractNumericValueFromBitArray(e,1,5)){case 12:return new E(e);case 13:return new I(e)}switch(A.A.extractNumericValueFromBitArray(e,1,7)){case 56:return new F(e,"310","11");case 57:return new F(e,"320","11");case 58:return new F(e,"310","13");case 59:return new F(e,"320","13");case 60:return new F(e,"310","15");case 61:return new F(e,"320","15");case 62:return new F(e,"310","17");case 63:return new F(e,"320","17")}}catch(t){throw console.log(t),new i.A("unknown decoder: "+e)}}},60523(e,t,r){"use strict";r.d(t,{q:()=>n});var n=(e,t,r,n)=>{if("axis"===t)return e.tooltipItemPayloads;if(0===e.tooltipItemPayloads.length)return[];var i;if(null==(i="hover"===r?e.itemInteraction.hover.graphicalItemId:e.itemInteraction.click.graphicalItemId)&&null!=n){var A=e.tooltipItemPayloads[0];return null!=A?[A]:[]}return e.tooltipItemPayloads.filter(e=>{var t;return(null===(t=e.settings)||void 0===t?void 0:t.graphicalItemId)===i})}},60533(e,t,r){"use strict";var n=r(79504),i=r(18014),A=r(655),o=r(72333),a=r(67750),s=n(o),u=n("".slice),c=Math.ceil,l=function(e){return function(t,r,n){var o,l,f=A(a(t)),d=i(r),h=f.length,p=void 0===n?" ":A(n);return d<=h||""===p?f:((l=s(p,c((o=d-h)/p.length))).length>o&&(l=u(l,0,o)),e?f+l:l+f)}};e.exports={start:l(!1),end:l(!0)}},60645(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.last=function(e){return e[e.length-1]}},60648(e,t,r){"use strict";r.d(t,{I:()=>n});var n={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3}},60739(e,t,r){"use strict";var n=r(46518),i=r(79039),A=r(48981),o=r(72777);n({target:"Date",proto:!0,arity:1,forced:i(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})},{toJSON:function(e){var t=A(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},60825(e,t,r){"use strict";var n=r(46518),i=r(97751),A=r(18745),o=r(30566),a=r(35548),s=r(28551),u=r(20034),c=r(2360),l=r(79039),f=i("Reflect","construct"),d=Object.prototype,h=[].push,p=l(function(){function e(){}return!(f(function(){},[],e)instanceof e)}),g=!l(function(){f(function(){})}),y=p||g;n({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){a(e),s(t);var r=arguments.length<3?e:a(arguments[2]);if(g&&!p)return f(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return A(h,n,t),new(A(o,e,n))}var i=r.prototype,l=c(u(i)?i:d),y=A(e,l,t);return u(y)?y:l}})},61366(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isSymbol=function(e){return"symbol"==typeof e||e instanceof Symbol}},61511(e,t,r){"use strict";r.d(t,{A:()=>u});var n,i=r(73872),A=r(12008),o=r(58503),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const u=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return a(t,e),t.prototype.decodeMiddle=function(e,r,n){var i,o,a,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var l=e.getSize(),f=r[1],d=0,h=0;h<6&&f<l;h++){var p=A.A.decodeDigit(e,c,f,A.A.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+p%10);try{for(var g=(i=void 0,s(c)),y=g.next();!y.done;y=g.next()){f+=y.value}}catch(e){i={error:e}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}p>=10&&(d|=1<<5-h)}n=t.determineFirstDigit(n,d),f=A.A.findGuardPattern(e,f,!0,A.A.MIDDLE_PATTERN,new Int32Array(A.A.MIDDLE_PATTERN.length).fill(0))[1];for(h=0;h<6&&f<l;h++){p=A.A.decodeDigit(e,c,f,A.A.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+p);try{for(var v=(a=void 0,s(c)),m=v.next();!m.done;m=v.next()){f+=m.value}}catch(e){a={error:e}}finally{try{m&&!m.done&&(u=v.return)&&u.call(v)}finally{if(a)throw a.error}}}return{rowOffset:f,resultString:n}},t.prototype.getBarcodeFormat=function(){return i.A.EAN_13},t.determineFirstDigit=function(e,t){for(var r=0;r<10;r++)if(t===this.FIRST_DIGIT_ENCODINGS[r])return e=String.fromCharCode("0".charCodeAt(0)+r)+e;throw new o.A},t.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],t}(A.A)},61691(e,t,r){"use strict";r.d(t,{A:()=>S});const n=function(){function e(){}return e.singletonList=function(e){return[e]},e.min=function(e,t){return e.sort(t)[0]},e}();var i=r(26741);const A=function(){function e(e){this.previous=e}return e.prototype.getPrevious=function(){return this.previous},e}();var o,a=r(36254),s=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},o(e,t)},function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const u=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.value=r,i.bitCount=n,i}return s(t,e),t.prototype.appendTo=function(e,t){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,r){return new t(this,e,r)},t.prototype.addBinaryShift=function(e,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,r)},t.prototype.toString=function(){var e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+a.A.toBinaryString(e|1<<this.bitCount).substring(1)+">"},t}(A);var c=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const l=function(e){function t(t,r,n){var i=e.call(this,t,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=n,i}return c(t,e),t.prototype.appendTo=function(e,t){for(var r=0;r<this.binaryShiftByteCount;r++)(0===r||31===r&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):0===r?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+r],8)},t.prototype.addBinaryShift=function(e,r){return new t(this,e,r)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},t}(u);function f(e,t,r){return new u(e,t,r)}var d=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],h=new u(null,0,0),p=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],g=r(80442),y=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var v=function(e){var t,r;try{for(var n=y(e),i=n.next();!i.done;i=n.next()){var A=i.value;g.A.fill(A,-1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e[0][4]=0,e[1][4]=0,e[1][0]=28,e[3][4]=0,e[2][4]=0,e[2][0]=15,e}(g.A.createInt32Array(6,6)),m=r(54951),w=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const b=function(){function e(e,t,r,n){this.token=e,this.mode=t,this.binaryShiftByteCount=r,this.bitCount=n}return e.prototype.getMode=function(){return this.mode},e.prototype.getToken=function(){return this.token},e.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},e.prototype.getBitCount=function(){return this.bitCount},e.prototype.latchAndAppend=function(t,r){var n=this.bitCount,i=this.token;if(t!==this.mode){var A=p[this.mode][t];i=f(i,65535&A,A>>16),n+=A>>16}var o=2===t?4:5;return new e(i=f(i,r,o),t,0,n+o)},e.prototype.shiftAndAppend=function(t,r){var n=this.token,i=2===this.mode?4:5;return n=f(n,v[this.mode][t],i),new e(n=f(n,r,5),this.mode,0,this.bitCount+i+5)},e.prototype.addBinaryShiftChar=function(t){var r=this.token,n=this.mode,i=this.bitCount;if(4===this.mode||2===this.mode){var A=p[n][0];r=f(r,65535&A,A>>16),i+=A>>16,n=0}var o=0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8,a=new e(r,n,this.binaryShiftByteCount+1,i+o);return 2078===a.binaryShiftByteCount&&(a=a.endBinaryShift(t+1)),a},e.prototype.endBinaryShift=function(t){if(0===this.binaryShiftByteCount)return this;var r=this.token;return new e(r=function(e,t,r){return new l(e,t,r)}(r,t-this.binaryShiftByteCount,this.binaryShiftByteCount),this.mode,0,this.bitCount)},e.prototype.isBetterThanOrEqualTo=function(t){var r=this.bitCount+(p[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?r+=e.calculateBinaryShiftCost(t)-e.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(r+=10),r<=t.bitCount},e.prototype.toBitArray=function(e){for(var t,r,n=[],A=this.endBinaryShift(e.length).token;null!==A;A=A.getPrevious())n.unshift(A);var o=new i.A;try{for(var a=w(n),s=a.next();!s.done;s=a.next()){s.value.appendTo(o,e)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return o},e.prototype.toString=function(){return m.A.format("%s bits=%d bytes=%d",d[this.mode],this.bitCount,this.binaryShiftByteCount)},e.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},e.INITIAL_STATE=new e(h,0,0,0),e}();var B=function(e){var t=m.A.getCharCode(" "),r=m.A.getCharCode("."),n=m.A.getCharCode(",");e[0][t]=1;for(var i=m.A.getCharCode("Z"),A=m.A.getCharCode("A"),o=A;o<=i;o++)e[0][o]=o-A+2;e[1][t]=1;var a=m.A.getCharCode("z"),s=m.A.getCharCode("a");for(o=s;o<=a;o++)e[1][o]=o-s+2;e[2][t]=1;var u=m.A.getCharCode("9"),c=m.A.getCharCode("0");for(o=c;o<=u;o++)e[2][o]=o-c+2;e[2][n]=12,e[2][r]=13;for(var l=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],f=0;f<l.length;f++)e[3][m.A.getCharCode(l[f])]=f;var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<d.length;f++)m.A.getCharCode(d[f])>0&&(e[4][m.A.getCharCode(d[f])]=f);return e}(g.A.createInt32Array(5,256)),C=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(){function e(e){this.text=e}return e.prototype.encode=function(){for(var t=m.A.getCharCode(" "),r=m.A.getCharCode("\n"),i=n.singletonList(b.INITIAL_STATE),A=0;A<this.text.length;A++){var o=void 0,a=A+1<this.text.length?this.text[A+1]:0;switch(this.text[A]){case m.A.getCharCode("\r"):o=a===r?2:0;break;case m.A.getCharCode("."):o=a===t?3:0;break;case m.A.getCharCode(","):o=a===t?4:0;break;case m.A.getCharCode(":"):o=a===t?5:0;break;default:o=0}o>0?(i=e.updateStateListForPair(i,A,o),A++):i=this.updateStateListForChar(i,A)}return n.min(i,function(e,t){return e.getBitCount()-t.getBitCount()}).toBitArray(this.text)},e.prototype.updateStateListForChar=function(t,r){var n,i,A=[];try{for(var o=C(t),a=o.next();!a.done;a=o.next()){var s=a.value;this.updateStateForChar(s,r,A)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e.simplifyStates(A)},e.prototype.updateStateForChar=function(e,t,r){for(var n=255&this.text[t],i=B[e.getMode()][n]>0,A=null,o=0;o<=4;o++){var a=B[o][n];if(a>0){if(null==A&&(A=e.endBinaryShift(t)),!i||o===e.getMode()||2===o){var s=A.latchAndAppend(o,a);r.push(s)}if(!i&&v[e.getMode()][o]>=0){var u=A.shiftAndAppend(o,a);r.push(u)}}}if(e.getBinaryShiftByteCount()>0||0===B[e.getMode()][n]){var c=e.addBinaryShiftChar(t);r.push(c)}},e.updateStateListForPair=function(e,t,r){var n,i,A=[];try{for(var o=C(e),a=o.next();!a.done;a=o.next()){var s=a.value;this.updateStateForPair(s,t,r,A)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return this.simplifyStates(A)},e.updateStateForPair=function(e,t,r,n){var i=e.endBinaryShift(t);if(n.push(i.latchAndAppend(4,r)),4!==e.getMode()&&n.push(i.shiftAndAppend(4,r)),3===r||4===r){var A=i.latchAndAppend(2,16-r).latchAndAppend(2,1);n.push(A)}if(e.getBinaryShiftByteCount()>0){var o=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);n.push(o)}},e.simplifyStates=function(e){var t,r,n,i,A=[];try{for(var o=C(e),a=o.next();!a.done;a=o.next()){var s=a.value,u=!0,c=function(e){if(e.isBetterThanOrEqualTo(s))return u=!1,"break";s.isBetterThanOrEqualTo(e)&&(A=A.filter(function(t){return t!==e}))};try{for(var l=(n=void 0,C(A)),f=l.next();!f.done;f=l.next()){if("break"===c(f.value))break}}catch(e){n={error:e}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}u&&A.push(s)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return A},e}();const S=E},62495(e,t,r){"use strict";r.d(t,{BrowserQRCodeReader:()=>n.BrowserQRCodeReader});var n=r(46121);r(15747),r(76458),r(43407),r(43074),r(31327),r(57149),r(59379),r(58503),r(77247),r(86931),r(27562),r(97483),r(73872),r(82389),r(26317),r(8032),r(75359),r(44388),r(15482),r(57994),r(19900),r(7758),r(15511),r(40217),r(93234),r(92819),r(88468),r(43334),r(97968),r(80442),r(81062),r(36254),r(26741),r(23431),r(82299),r(98517),r(51084),r(23110),r(12122),r(73608),r(53030),r(42893),r(50998),r(65189),r(71983),r(54951),r(28823),r(55182),r(73753),r(49135),r(23636),r(93516),r(6228),r(58346),r(77612),r(13628),r(89194),r(50072),r(44487),r(10105),r(1458),r(80386),r(311),r(66278),r(26818),r(33297),r(52185),r(4526),r(15906),r(18262),r(13719),r(29105),r(53637),r(50735),r(55512),r(33338),r(43113),r(59363),r(68131),r(89407),r(71622),r(61691),r(1470),r(38102),r(4900),r(32993),r(61511),r(6653),r(99378),r(19504),r(5224),r(93710),r(81488),r(45698),r(60196),r(68271),r(82205)},64923(e,t,r){"use strict";r.d(t,{I:()=>a,h:()=>o});var n=r(25508),i=r(22608),A=r(60648),o=(0,n.Mz)(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(null!=t){var n=e[t];if(null!=n)return r?n.panoramaElement:n.element}}),a=(0,n.Mz)(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(e=>parseInt(e,10)).concat(Object.values(A.I));return Array.from(new Set(t)).sort((e,t)=>e-t)},{memoizeOptions:{resultEqualityCheck:i.W}})},64994(e,t,r){"use strict";r.d(t,{A:()=>i});var n=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const i=function(){function e(){}return e.getRSSvalue=function(t,r,i){var A,o,a=0;try{for(var s=n(t),u=s.next();!u.done;u=s.next()){a+=u.value}}catch(e){A={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(A)throw A.error}}for(var c=0,l=0,f=t.length,d=0;d<f-1;d++){var h=void 0;for(h=1,l|=1<<d;h<t[d];h++,l&=~(1<<d)){var p=e.combins(a-h-1,f-d-2);if(i&&0===l&&a-h-(f-d-1)>=f-d-1&&(p-=e.combins(a-h-(f-d),f-d-2)),f-d-1>1){for(var g=0,y=a-h-(f-d-2);y>r;y--)g+=e.combins(a-h-y-1,f-d-3);p-=g*(f-1-d)}else a-h>r&&p--;c+=p}a-=h}return c},e.combins=function(e,t){var r,n;e-t>t?(n=t,r=e-t):(n=e-t,r=t);for(var i=1,A=1,o=e;o>r;o--)i*=o,A<=n&&(i/=A,A++);for(;A<=n;)i/=A,A++;return i},e}()},65189(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(53030),A=r(23431),o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const a=function(e){function t(t){var r=e.call(this,t)||this;return r.matrix=null,r}return o(t,e),t.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),i=r.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var o=r.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;0!==(n&t.BLOCK_SIZE_MASK)&&a++;var s=i>>t.BLOCK_SIZE_POWER;0!==(i&t.BLOCK_SIZE_MASK)&&s++;var u=t.calculateBlackPoints(o,a,s,n,i),c=new A.A(n,i);t.calculateThresholdForBlock(o,a,s,n,i,u,c),this.matrix=c}else this.matrix=e.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,r,n,i,A,o,a){for(var s=A-t.BLOCK_SIZE,u=i-t.BLOCK_SIZE,c=0;c<n;c++){var l=c<<t.BLOCK_SIZE_POWER;l>s&&(l=s);for(var f=t.cap(c,2,n-3),d=0;d<r;d++){var h=d<<t.BLOCK_SIZE_POWER;h>u&&(h=u);for(var p=t.cap(d,2,r-3),g=0,y=-2;y<=2;y++){var v=o[f+y];g+=v[p-2]+v[p-1]+v[p]+v[p+1]+v[p+2]}var m=g/25;t.thresholdBlock(e,h,l,m,i,a)}}},t.cap=function(e,t,r){return e<t?t:e>r?r:e},t.thresholdBlock=function(e,r,n,i,A,o){for(var a=0,s=n*A+r;a<t.BLOCK_SIZE;a++,s+=A)for(var u=0;u<t.BLOCK_SIZE;u++)(255&e[s+u])<=i&&o.set(r+u,n+a)},t.calculateBlackPoints=function(e,r,n,i,A){for(var o=A-t.BLOCK_SIZE,a=i-t.BLOCK_SIZE,s=new Array(n),u=0;u<n;u++){s[u]=new Int32Array(r);var c=u<<t.BLOCK_SIZE_POWER;c>o&&(c=o);for(var l=0;l<r;l++){var f=l<<t.BLOCK_SIZE_POWER;f>a&&(f=a);for(var d=0,h=255,p=0,g=0,y=c*i+f;g<t.BLOCK_SIZE;g++,y+=i){for(var v=0;v<t.BLOCK_SIZE;v++){var m=255&e[y+v];d+=m,m<h&&(h=m),m>p&&(p=m)}if(p-h>t.MIN_DYNAMIC_RANGE)for(g++,y+=i;g<t.BLOCK_SIZE;g++,y+=i)for(v=0;v<t.BLOCK_SIZE;v++)d+=255&e[y+v]}var w=d>>2*t.BLOCK_SIZE_POWER;if(p-h<=t.MIN_DYNAMIC_RANGE&&(w=h/2,u>0&&l>0)){var b=(s[u-1][l]+2*s[u][l-1]+s[u-1][l-1])/4;h<b&&(w=b)}s[u][l]=w}}return s},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=5*t.BLOCK_SIZE,t.MIN_DYNAMIC_RANGE=24,t}(i.A)},65245(e,t,r){"use strict";r.d(t,{P:()=>o});var n=r(71468),i=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function A(e,t){return null==e&&null==t||("number"==typeof e&&"number"==typeof t?e===t||e!=e&&t!=t:e===t)}function o(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var o of r)if(i.has(o)){if(null==e[o]&&null==t[o])continue;if(!(0,n.bN)(e[o],t[o]))return!1}else if(!A(e[o],t[o]))return!1;return!0}},65307(e,t,r){"use strict";r.d(t,{CF:()=>g,U1:()=>y,VP:()=>u,Nc:()=>re,Z0:()=>E,aA:()=>h});var n=r(12064),i=r(14644);function A(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var o=A(),a=A,s="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?i.Zz:i.Zz.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function u(e,t){function r(...r){if(t){let n=t(...r);if(!n)throw new Error(ne(0));return{type:e,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:e,payload:r[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>(0,i.ve)(t)&&t.type===e,r}var c=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function l(e){return(0,n.a6)(e)?(0,n.jM)(e,()=>{}):e}function f(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var d="RTK_autoBatch",h=()=>e=>({payload:e,meta:{[d]:!0}}),p=e=>t=>{setTimeout(t,e)},g=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,A=!1,o=!1;const a=new Set,s="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:p(10):"callback"===e.type?e.queueNotification:p(e.timeout),u=()=>{o=!1,A&&(A=!1,a.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){const t=n.subscribe(()=>i&&e());return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return i=!e?.meta?.[d],A=!i,A&&(o||(o=!0,s(u))),n.dispatch(e)}finally{i=!0}}})};function y(e){const t=function(e){const{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{};let A=new c;return t&&("boolean"==typeof t?A.push(o):A.push(a(t.extraArgument))),A},{reducer:r,middleware:n,devTools:A=!0,duplicateMiddlewareCheck:u=!0,preloadedState:l,enhancers:f}=e||{};let d,h;if("function"==typeof r)d=r;else{if(!(0,i.Qd)(r))throw new Error(ne(1));d=(0,i.HY)(r)}h="function"==typeof n?n(t):t();let p=i.Zz;A&&(p=s({trace:!1,..."object"==typeof A&&A}));const y=(e=>function(t){const{autoBatch:r=!0}=t??{};let n=new c(e);return r&&n.push(g("object"==typeof r?r:void 0)),n})((0,i.Tw)(...h));const v=p(..."function"==typeof f?f(y):y());return(0,i.y$)(d,l,v)}function v(e){const t={},r=[];let n;const i={addCase(e,r){const n="string"==typeof e?e:e.type;if(!n)throw new Error(ne(28));if(n in t)throw new Error(ne(29));return t[n]=r,i},addAsyncThunk:(e,n)=>(n.pending&&(t[e.pending.type]=n.pending),n.rejected&&(t[e.rejected.type]=n.rejected),n.fulfilled&&(t[e.fulfilled.type]=n.fulfilled),n.settled&&r.push({matcher:e.settled,reducer:n.settled}),i),addMatcher:(e,t)=>(r.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(n=e,i)};return e(i),[t,r,n]}var m=(e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};var w=Symbol.for("rtk-slice-createasyncthunk");function b(e,t){return`${e}/${t}`}function B({creators:e}={}){const t=e?.asyncThunk?.[w];return function(e){const{name:r,reducerPath:i=r}=e;if(!r)throw new Error(ne(11));const A=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(A),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const r="string"==typeof e?e:e.type;if(!r)throw new Error(ne(12));if(r in a.sliceCaseReducersByType)throw new Error(ne(13));return a.sliceCaseReducersByType[r]=t,s},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(a.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,s)};function c(){const[t={},r=[],i]="function"==typeof e.extraReducers?v(e.extraReducers):[e.extraReducers],A={...t,...a.sliceCaseReducersByType};return function(e,t){let r,[i,A,o]=v(t);if("function"==typeof e)r=()=>l(e());else{const t=l(e);r=()=>t}function a(e=r(),t){let a=[i[t.type],...A.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===a.filter(e=>!!e).length&&(a=[o]),a.reduce((e,r)=>{if(r){if((0,n.Qx)(e)){const n=r(e,t);return void 0===n?e:n}if((0,n.a6)(e))return(0,n.jM)(e,e=>r(e,t));{const n=r(e,t);if(void 0===n){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}}return e},e)}return a.getInitialState=r,a}(e.initialState,e=>{for(let t in A)e.addCase(t,A[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);i&&e.addDefaultCase(i)})}o.forEach(n=>{const i=A[n],o={reducerName:n,type:b(r,n),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:r},n,i){let A,o;if("reducer"in n){if(r&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(n))throw new Error(ne(17));A=n.reducer,o=n.prepare}else A=n;i.addCase(e,A).exposeCaseReducer(t,A).exposeAction(t,o?u(e,o):u(e))}(o,i,s):function({type:e,reducerName:t},r,n,i){if(!i)throw new Error(ne(18));const{payloadCreator:A,fulfilled:o,pending:a,rejected:s,settled:u,options:c}=r,l=i(e,A,c);n.exposeAction(t,l),o&&n.addCase(l.fulfilled,o);a&&n.addCase(l.pending,a);s&&n.addCase(l.rejected,s);u&&n.addMatcher(l.settled,u);n.exposeCaseReducer(t,{fulfilled:o||S,pending:a||S,rejected:s||S,settled:u||S})}(o,i,s,t)});const d=e=>e,h=new Map,p=new WeakMap;let g;function y(e,t){return g||(g=c()),g(e,t)}function m(){return g||(g=c()),g.getInitialState()}function w(t,r=!1){function n(e){let i=e[t];return void 0===i&&r&&(i=f(p,n,m)),i}function i(t=d){const n=f(h,r,()=>new WeakMap);return f(n,t,()=>{const n={};for(const[i,A]of Object.entries(e.selectors??{}))n[i]=C(A,t,()=>f(p,t,m),r);return n})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}const B={name:r,reducer:y,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:m,...w(i),injectInto(e,{reducerPath:t,...r}={}){const n=t??i;return e.inject({reducerPath:n,reducer:y},r),{...B,...w(n,!0)}}};return B}}function C(e,t,r,n){function i(i,...A){let o=t(i);return void 0===o&&n&&(o=r()),e(o,...A)}return i.unwrapped=e,i}var E=B();function S(){}var I="listener",O="completed",F="cancelled",_=`task-${F}`,x=`task-${O}`,U=`${I}-${F}`,Q=`${I}-${O}`,T=class{constructor(e){this.code=e,this.message=`task ${F} (reason: ${e})`}name="TaskAbortError";message},M=(e,t)=>{if("function"!=typeof e)throw new TypeError(ne(32))},P=()=>{},D=(e,t=P)=>(e.catch(t),e),k=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),N=e=>{if(e.aborted)throw new T(e.reason)};function R(e,t){let r=P;return new Promise((n,i)=>{const A=()=>i(new T(e.reason));e.aborted?A():(r=k(e,A),t.finally(()=>r()).then(n,i))}).finally(()=>{r=P})}var L=e=>t=>D(R(e,t).then(t=>(N(e),t))),H=e=>{const t=L(e);return e=>t(new Promise(t=>setTimeout(t,e)))},{assign:j}=Object,V={},K="listenerMiddleware",z=(e,t)=>(r,n)=>{M(r);const i=new AbortController;var A;A=i,k(e,()=>A.abort(e.reason));const o=(async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(e){return{status:e instanceof T?"cancelled":"rejected",error:e}}finally{t?.()}})(async()=>{N(e),N(i.signal);const t=await r({pause:L(i.signal),delay:H(i.signal),signal:i.signal});return N(i.signal),t},()=>i.abort(x));return n?.autoJoin&&t.push(o.catch(P)),{result:L(e)(o),cancel(){i.abort(_)}}},G=(e,t)=>(r,n)=>D((async(r,n)=>{N(t);let i=()=>{};const A=[new Promise((t,n)=>{let A=e({predicate:r,effect:(e,r)=>{r.unsubscribe(),t([e,r.getState(),r.getOriginalState()])}});i=()=>{A(),n()}})];null!=n&&A.push(new Promise(e=>setTimeout(e,n,null)));try{const e=await R(t,Promise.race(A));return N(t),e}finally{i()}})(r,n)),W=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:A}=e;if(t)i=u(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(ne(21));return M(A),{predicate:i,type:t,effect:A}},X=j(e=>{const{type:t,predicate:r,effect:n}=W(e);return{id:m(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(ne(22))}}},{withTypes:()=>X}),Y=(e,t)=>{const{type:r,effect:n,predicate:i}=W(t);return Array.from(e.values()).find(e=>("string"==typeof r?e.type===r:e.predicate===i)&&e.effect===n)},Z=e=>{e.pending.forEach(e=>{e.abort(U)})},q=(e,t,r)=>{try{e(t,r)}catch(e){setTimeout(()=>{throw e},0)}},J=j(u(`${K}/add`),{withTypes:()=>J}),$=u(`${K}/removeAll`),ee=j(u(`${K}/remove`),{withTypes:()=>ee}),te=(...e)=>{console.error(`${K}/error`,...e)},re=(e={})=>{const t=new Map,r=new Map,{extra:n,onError:A=te}=e;M(A);const o=e=>(e=>(e.unsubscribe=()=>t.delete(e.id),t.set(e.id,e),t=>{e.unsubscribe(),t?.cancelActive&&Z(e)}))(Y(t,e)??X(e));j(o,{withTypes:()=>o});const a=e=>{const r=Y(t,e);return r&&(r.unsubscribe(),e.cancelActive&&Z(r)),!!r};j(a,{withTypes:()=>a});const s=async(e,i,a,s)=>{const u=new AbortController,c=G(o,u.signal),l=[];try{e.pending.add(u),(e=>{const t=r.get(e)??0;r.set(e,t+1)})(e),await Promise.resolve(e.effect(i,j({},a,{getOriginalState:s,condition:(e,t)=>c(e,t).then(Boolean),take:c,delay:H(u.signal),pause:L(u.signal),extra:n,signal:u.signal,fork:z(u.signal,l),unsubscribe:e.unsubscribe,subscribe:()=>{t.set(e.id,e)},cancelActiveListeners:()=>{e.pending.forEach((e,t,r)=>{e!==u&&(e.abort(U),r.delete(e))})},cancel:()=>{u.abort(U),e.pending.delete(u)},throwIfCancelled:()=>{N(u.signal)}})))}catch(e){e instanceof T||q(A,e,{raisedBy:"effect"})}finally{await Promise.all(l),u.abort(Q),(e=>{const t=r.get(e)??1;1===t?r.delete(e):r.set(e,t-1)})(e),e.pending.delete(u)}},u=((e,t)=>()=>{for(const e of t.keys())Z(e);e.clear()})(t,r);return{middleware:e=>r=>n=>{if(!(0,i.ve)(n))return r(n);if(J.match(n))return o(n.payload);if($.match(n))return void u();if(ee.match(n))return a(n.payload);let c=e.getState();const l=()=>{if(c===V)throw new Error(ne(23));return c};let f;try{if(f=r(n),t.size>0){const r=e.getState(),i=Array.from(t.values());for(const t of i){let i=!1;try{i=t.predicate(n,r,c)}catch(e){i=!1,q(A,e,{raisedBy:"predicate"})}i&&s(t,n,e,l)}}}finally{c=V}return f},startListening:o,stopListening:a,clearListeners:u}};Symbol.for("rtk-state-proxy-original");function ne(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}},65587(e,t,r){"use strict";r.d(t,{Q:()=>A});var n=r(88468),i=r(50072),A=function(){function e(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split("").map(function(e){return e.charCodeAt(0)}),r=new n.A,i=0,A=t.length;i<A;i++){var o=String.fromCharCode(255&t[i]);if("?"===o&&"?"!==e.charAt(i))throw new Error("Message contains characters outside ISO-8859-1 encoding.");r.append(o)}this.msg=r.toString(),this.shape=0,this.codewords=new n.A,this.newEncoding=-1}return e.prototype.setSymbolShape=function(e){this.shape=e},e.prototype.setSizeConstraints=function(e,t){this.minSize=e,this.maxSize=t},e.prototype.getMessage=function(){return this.msg},e.prototype.setSkipAtEnd=function(e){this.skipAtEnd=e},e.prototype.getCurrentChar=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCurrent=function(){return this.msg.charCodeAt(this.pos)},e.prototype.getCodewords=function(){return this.codewords},e.prototype.writeCodewords=function(e){this.codewords.append(e)},e.prototype.writeCodeword=function(e){this.codewords.append(e)},e.prototype.getCodewordCount=function(){return this.codewords.length()},e.prototype.getNewEncoding=function(){return this.newEncoding},e.prototype.signalEncoderChange=function(e){this.newEncoding=e},e.prototype.resetEncoderSignal=function(){this.newEncoding=-1},e.prototype.hasMoreCharacters=function(){return this.pos<this.getTotalMessageCharCount()},e.prototype.getTotalMessageCharCount=function(){return this.msg.length-this.skipAtEnd},e.prototype.getRemainingCharacters=function(){return this.getTotalMessageCharCount()-this.pos},e.prototype.getSymbolInfo=function(){return this.symbolInfo},e.prototype.updateSymbolInfo=function(e){void 0===e&&(e=this.getCodewordCount()),(null==this.symbolInfo||e>this.symbolInfo.getDataCapacity())&&(this.symbolInfo=i.A.lookup(e,this.shape,this.minSize,this.maxSize,!0))},e.prototype.resetSymbolInfo=function(){this.symbolInfo=null},e}()},66278(e,t,r){"use strict";r.d(t,{A:()=>g});var n=r(43407),i=r(57149),A=r(92819),o=r(88468),a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const s=function(){function e(e,t){if(0===t.length)throw new i.A;this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;n===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-n),A.A.arraycopy(t,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=t}return e.prototype.getCoefficients=function(){return this.coefficients},e.prototype.getDegree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.evaluateAt=function(e){var t,r;if(0===e)return this.getCoefficient(0);if(1===e){var n=0;try{for(var i=a(this.coefficients),A=i.next();!A.done;A=i.next()){var o=A.value;n=this.field.add(n,o)}}catch(e){t={error:e}}finally{try{A&&!A.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}for(var s=this.coefficients[0],u=this.coefficients.length,c=1;c<u;c++)s=this.field.add(this.field.multiply(e,s),this.coefficients[c]);return s},e.prototype.add=function(t){if(!this.field.equals(t.field))throw new i.A("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;var r=this.coefficients,n=t.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var a=new Int32Array(n.length),s=n.length-r.length;A.A.arraycopy(n,0,a,0,s);for(var u=s;u<n.length;u++)a[u]=this.field.add(r[u-s],n[u]);return new e(this.field,a)},e.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new i.A("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},e.prototype.multiply=function(t){return t instanceof e?this.multiplyOther(t):this.multiplyScalar(t)},e.prototype.multiplyOther=function(t){if(!this.field.equals(t.field))throw new i.A("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new e(this.field,new Int32Array([0]));for(var r=this.coefficients,n=r.length,A=t.coefficients,o=A.length,a=new Int32Array(n+o-1),s=0;s<n;s++)for(var u=r[s],c=0;c<o;c++)a[s+c]=this.field.add(a[s+c],this.field.multiply(u,A[c]));return new e(this.field,a)},e.prototype.negative=function(){for(var t=this.coefficients.length,r=new Int32Array(t),n=0;n<t;n++)r[n]=this.field.subtract(0,this.coefficients[n]);return new e(this.field,r)},e.prototype.multiplyScalar=function(t){if(0===t)return new e(this.field,new Int32Array([0]));if(1===t)return this;for(var r=this.coefficients.length,n=new Int32Array(r),i=0;i<r;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,n)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new i.A;if(0===r)return new e(this.field,new Int32Array([0]));for(var n=this.coefficients.length,A=new Int32Array(n+t),o=0;o<n;o++)A[o]=this.field.multiply(this.coefficients[o],r);return new e(this.field,A)},e.prototype.toString=function(){for(var e=new o.A,t=this.getDegree();t>=0;t--){var r=this.getCoefficient(t);0!==r&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),0!==t&&1===r||e.append(r),0!==t&&(1===t?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()},e}();var u=r(50483),c=r(76458),l=function(){function e(){}return e.prototype.add=function(e,t){return(e+t)%this.modulus},e.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(0===e)throw new i.A;return this.logTable[e]},e.prototype.inverse=function(e){if(0===e)throw new c.A;return this.expTable[this.modulus-this.logTable[e]-1]},e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},e.prototype.getSize=function(){return this.modulus},e.prototype.equals=function(e){return e===this},e}();var f,d=(f=function(e,t){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},f(e,t)},function(e,t){function r(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const h=function(e){function t(t,r){var n=e.call(this)||this;n.modulus=t,n.expTable=new Int32Array(t),n.logTable=new Int32Array(t);for(var i=1,A=0;A<t;A++)n.expTable[A]=i,i=i*r%t;for(A=0;A<t-1;A++)n.logTable[n.expTable[A]]=A;return n.zero=new s(n,new Int32Array([0])),n.one=new s(n,new Int32Array([1])),n}return d(t,e),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new i.A;if(0===t)return this.zero;var r=new Int32Array(e+1);return r[0]=t,new s(this,r)},t.PDF417_GF=new t(u.A.NUMBER_OF_CODEWORDS,3),t}(l);var p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const g=function(){function e(){this.field=h.PDF417_GF}return e.prototype.decode=function(e,t,r){for(var i,A,o=new s(this.field,e),a=new Int32Array(t),u=!1,c=t;c>0;c--){var l=o.evaluateAt(this.field.exp(c));a[t-c]=l,0!==l&&(u=!0)}if(!u)return 0;var f=this.field.getOne();if(null!=r)try{for(var d=p(r),h=d.next();!h.done;h=d.next()){var g=h.value,y=this.field.exp(e.length-1-g),v=new s(this.field,new Int32Array([this.field.subtract(0,y),1]));f=f.multiply(v)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(A=d.return)&&A.call(d)}finally{if(i)throw i.error}}var m=new s(this.field,a),w=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),m,t),b=w[0],B=w[1],C=this.findErrorLocations(b),E=this.findErrorMagnitudes(B,b,C);for(c=0;c<C.length;c++){var S=e.length-1-this.field.log(C[c]);if(S<0)throw n.A.getChecksumInstance();e[S]=this.field.subtract(e[S],E[c])}return C.length},e.prototype.runEuclideanAlgorithm=function(e,t,r){if(e.getDegree()<t.getDegree()){var i=e;e=t,t=i}for(var A=e,o=t,a=this.field.getZero(),s=this.field.getOne();o.getDegree()>=Math.round(r/2);){var u=A,c=a;if(a=s,(A=o).isZero())throw n.A.getChecksumInstance();o=u;for(var l=this.field.getZero(),f=A.getCoefficient(A.getDegree()),d=this.field.inverse(f);o.getDegree()>=A.getDegree()&&!o.isZero();){var h=o.getDegree()-A.getDegree(),p=this.field.multiply(o.getCoefficient(o.getDegree()),d);l=l.add(this.field.buildMonomial(h,p)),o=o.subtract(A.multiplyByMonomial(h,p))}s=l.multiply(a).subtract(c).negative()}var g=s.getCoefficient(0);if(0===g)throw n.A.getChecksumInstance();var y=this.field.inverse(g);return[s.multiply(y),o.multiply(y)]},e.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),r=new Int32Array(t),i=0,A=1;A<this.field.getSize()&&i<t;A++)0===e.evaluateAt(A)&&(r[i]=this.field.inverse(A),i++);if(i!==t)throw n.A.getChecksumInstance();return r},e.prototype.findErrorMagnitudes=function(e,t,r){for(var n=t.getDegree(),i=new Int32Array(n),A=1;A<=n;A++)i[n-A]=this.field.multiply(A,t.getCoefficient(A));var o=new s(this.field,i),a=r.length,u=new Int32Array(a);for(A=0;A<a;A++){var c=this.field.inverse(r[A]),l=this.field.subtract(0,e.evaluateAt(c)),f=this.field.inverse(o.evaluateAt(c));u[A]=this.field.multiply(l,f)}return u},e}()},66426(e,t,r){"use strict";r.d(t,{B_:()=>i,JK:()=>A,Vp:()=>s,gX:()=>o,hF:()=>a});var n=(0,r(65307).Z0)({name:"chartLayout",initialState:{layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,A;e.margin.top=null!==(r=t.payload.top)&&void 0!==r?r:0,e.margin.right=null!==(n=t.payload.right)&&void 0!==n?n:0,e.margin.bottom=null!==(i=t.payload.bottom)&&void 0!==i?i:0,e.margin.left=null!==(A=t.payload.left)&&void 0!==A?A:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:i,setLayout:A,setChartSize:o,setScale:a}=n.actions,s=n.reducer},66500(e,t,r){"use strict";r.d(t,{Q:()=>n});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},66583(e,t,r){"use strict";r.d(t,{V:()=>i});var n=r(96540);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],[t,r]=(0,n.useState)({height:0,left:0,top:0,width:0}),i=(0,n.useCallback)(e=>{if(null!=e){var n=e.getBoundingClientRect(),i={height:n.height,left:n.left,top:n.top,width:n.width};(Math.abs(i.height-t.height)>1||Math.abs(i.left-t.left)>1||Math.abs(i.top-t.top)>1||Math.abs(i.width-t.width)>1)&&r({height:i.height,left:i.left,top:i.top,width:i.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,i]}},67416(e,t,r){"use strict";var n=r(79039),i=r(78227),A=r(43724),o=r(96395),a=i("iterator");e.exports=!n(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(e,r){t.delete("b"),n+=r+e}),r.delete("a",2),r.delete("b",void 0),o&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(o||!A)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host})},67945(e,t,r){"use strict";var n=r(46518),i=r(43724),A=r(96801).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==A,sham:!i},{defineProperties:A})},67965(e,t,r){"use strict";r.d(t,{TK:()=>a});var n=r(96540),i=r(46446),A=r(49082),o=r(12070),a=e=>{var{chartData:t}=e,r=(0,A.j)(),a=(0,o.r)();return(0,n.useEffect)(()=>a?()=>{}:(r((0,i.hq)(t)),()=>{r((0,i.hq)(void 0))}),[t,r,a]),null}},68131(e,t,r){"use strict";var n=r(73872),i=r(73608),A=r(71622),o=r(23431),a=r(97968),s=r(81062),u=r(36254),c=r(59379),l=r(57149),f=r(54951);!function(){function e(){}e.prototype.encode=function(e,t,r,n){return this.encodeWithHints(e,t,r,n,null)},e.prototype.encodeWithHints=function(t,r,n,o,c){var l=s.A.ISO_8859_1,f=A.A.DEFAULT_EC_PERCENT,d=A.A.DEFAULT_AZTEC_LAYERS;return null!=c&&(c.has(i.A.CHARACTER_SET)&&(l=a.A.forName(c.get(i.A.CHARACTER_SET).toString())),c.has(i.A.ERROR_CORRECTION)&&(f=u.A.parseInt(c.get(i.A.ERROR_CORRECTION).toString())),c.has(i.A.AZTEC_LAYERS)&&(d=u.A.parseInt(c.get(i.A.AZTEC_LAYERS).toString()))),e.encodeLayers(t,r,n,o,l,f,d)},e.encodeLayers=function(t,r,i,o,a,s,u){if(r!==n.A.AZTEC)throw new l.A("Can only encode AZTEC, but got "+r);var c=A.A.encode(f.A.getBytes(t,a),s,u);return e.renderResult(c,i,o)},e.renderResult=function(e,t,r){var n=e.getMatrix();if(null==n)throw new c.A;for(var i=n.getWidth(),A=n.getHeight(),a=Math.max(t,i),s=Math.max(r,A),u=Math.min(a/i,s/A),l=(a-i*u)/2,f=(s-A*u)/2,d=new o.A(a,s),h=0,p=f;h<A;h++,p+=u)for(var g=0,y=l;g<i;g++,y+=u)n.get(g,h)&&d.setRegion(y,p,u,u);return d}}()},68132(e,t,r){"use strict";r.d(t,{L:()=>Z});var n=r(96540),i=r(19287),A=r(32945),o=r(12070),a=r(49303),s=r(49082),u=r(76461),c=r(8813),l=r(85138),f=r(64923);function d(e){var{zIndex:t,isPanorama:r}=e,i=(0,n.useRef)(null),A=(0,s.j)();return(0,n.useLayoutEffect)(()=>(i.current&&A((0,l.WO)({zIndex:t,element:i.current,isPanorama:r})),()=>{A((0,l.B8)({zIndex:t,isPanorama:r}))}),[A,t,r]),n.createElement("g",{tabIndex:-1,ref:i})}function h(e){var{children:t,isPanorama:r}=e,i=(0,s.G)(f.I);if(!i||0===i.length)return t;var A=i.filter(e=>e<0),o=i.filter(e=>e>0);return n.createElement(n.Fragment,null,A.map(e=>n.createElement(d,{key:e,zIndex:e,isPanorama:r})),t,o.map(e=>n.createElement(d,{key:e,zIndex:e,isPanorama:r})))}var p=["children"];function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g.apply(null,arguments)}var y={width:"100%",height:"100%",display:"block"},v=(0,n.forwardRef)((e,t)=>{var r=(0,i.yi)(),o=(0,i.rY)(),s=(0,A.$)();if(!(0,c.F)(r)||!(0,c.F)(o))return null;var u,l,{children:f,otherAttributes:d,title:h,desc:p}=e;return null!=d&&(u="number"==typeof d.tabIndex?d.tabIndex:s?0:void 0,l="string"==typeof d.role?d.role:s?"application":void 0),n.createElement(a.u,g({},d,{title:h,desc:p,role:l,tabIndex:u,width:r,height:o,style:y,ref:t}),f)}),m=e=>{var{children:t}=e,r=(0,s.G)(u.U);if(!r)return null;var{width:i,height:A,y:o,x:c}=r;return n.createElement(a.u,{width:i,height:A,x:c,y:o},t)},w=(0,n.forwardRef)((e,t)=>{var{children:r}=e,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,p);return(0,o.r)()?n.createElement(m,null,n.createElement(h,{isPanorama:!0},r)):n.createElement(v,g({ref:t},i),n.createElement(h,{isPanorama:!1},r))}),b=r(34164),B=r(74531),C=r(86215),E=r(94274),S=r(77232),I=r(5180),O=r(66426);var F=r(73102),_=r(21077),x=r(74354),U=r(55846),Q=r(28482),T=r(59744);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach(function(t){D(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function D(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k.apply(null,arguments)}var N=()=>((0,E.l3)(),null);function R(e){if("number"==typeof e)return e;if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var L=(0,n.forwardRef)((e,t)=>{var r,A,o=(0,n.useRef)(null),[a,s]=(0,n.useState)({containerWidth:R(null===(r=e.style)||void 0===r?void 0:r.width),containerHeight:R(null===(A=e.style)||void 0===A?void 0:A.height)}),u=(0,n.useCallback)((e,t)=>{s(r=>{var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}})},[]),c=(0,n.useCallback)(e=>{if("function"==typeof t&&t(e),null!=e&&"undefined"!=typeof ResizeObserver){var{width:r,height:n}=e.getBoundingClientRect();u(r,n);var i=new ResizeObserver(e=>{var{width:t,height:r}=e[0].contentRect;u(t,r)});i.observe(e),o.current=i}},[t,u]);return(0,n.useEffect)(()=>()=>{var e=o.current;null!=e&&e.disconnect()},[u]),n.createElement(n.Fragment,null,n.createElement(i.A3,{width:a.containerWidth,height:a.containerHeight}),n.createElement("div",k({ref:c},e)))}),H=(0,n.forwardRef)((e,t)=>{var{width:r,height:A}=e,[o,a]=(0,n.useState)({containerWidth:R(r),containerHeight:R(A)}),s=(0,n.useCallback)((e,t)=>{a(r=>{var n=Math.round(e),i=Math.round(t);return r.containerWidth===n&&r.containerHeight===i?r:{containerWidth:n,containerHeight:i}})},[]),u=(0,n.useCallback)(e=>{if("function"==typeof t&&t(e),null!=e){var{width:r,height:n}=e.getBoundingClientRect();s(r,n)}},[t,s]);return n.createElement(n.Fragment,null,n.createElement(i.A3,{width:o.containerWidth,height:o.containerHeight}),n.createElement("div",k({ref:u},e)))}),j=(0,n.forwardRef)((e,t)=>{var{width:r,height:A}=e;return n.createElement(n.Fragment,null,n.createElement(i.A3,{width:r,height:A}),n.createElement("div",k({ref:t},e)))}),V=(0,n.forwardRef)((e,t)=>{var{width:r,height:i}=e;return(0,T._3)(r)||(0,T._3)(i)?n.createElement(H,k({},e,{ref:t})):n.createElement(j,k({},e,{ref:t}))});var K=(0,n.forwardRef)((e,t)=>{var{children:r,className:i,height:A,onClick:o,onContextMenu:a,onDoubleClick:u,onMouseDown:l,onMouseEnter:f,onMouseLeave:d,onMouseMove:h,onMouseUp:p,onTouchEnd:g,onTouchMove:y,onTouchStart:v,style:m,width:w,responsive:E,dispatchTouchEvents:T=!0}=e,M=(0,n.useRef)(null),D=(0,s.j)(),[k,R]=(0,n.useState)(null),[H,j]=(0,n.useState)(null),K=function(){var e=(0,s.j)(),[t,r]=(0,n.useState)(null),i=(0,s.G)(I.et);return(0,n.useEffect)(()=>{if(null!=t){var r=t.getBoundingClientRect().width/t.offsetWidth;(0,c.H)(r)&&r!==i&&e((0,O.hF)(r))}},[t,e,i]),r}(),z=(0,Q.w)(),G=(null==z?void 0:z.width)>0?z.width:w,W=(null==z?void 0:z.height)>0?z.height:A,X=(0,n.useCallback)(e=>{K(e),"function"==typeof t&&t(e),R(e),j(e),null!=e&&(M.current=e)},[K,t,R,j]),Y=(0,n.useCallback)(e=>{D((0,C.ky)(e)),D((0,F.y)({handler:o,reactEvent:e}))},[D,o]),Z=(0,n.useCallback)(e=>{D((0,C.dj)(e)),D((0,F.y)({handler:f,reactEvent:e}))},[D,f]),q=(0,n.useCallback)(e=>{D((0,B.xS)()),D((0,F.y)({handler:d,reactEvent:e}))},[D,d]),J=(0,n.useCallback)(e=>{D((0,C.dj)(e)),D((0,F.y)({handler:h,reactEvent:e}))},[D,h]),$=(0,n.useCallback)(()=>{D((0,S.Ru)())},[D]),ee=(0,n.useCallback)(e=>{D((0,S.uZ)(e.key))},[D]),te=(0,n.useCallback)(e=>{D((0,F.y)({handler:a,reactEvent:e}))},[D,a]),re=(0,n.useCallback)(e=>{D((0,F.y)({handler:u,reactEvent:e}))},[D,u]),ne=(0,n.useCallback)(e=>{D((0,F.y)({handler:l,reactEvent:e}))},[D,l]),ie=(0,n.useCallback)(e=>{D((0,F.y)({handler:p,reactEvent:e}))},[D,p]),Ae=(0,n.useCallback)(e=>{D((0,F.y)({handler:v,reactEvent:e}))},[D,v]),oe=(0,n.useCallback)(e=>{T&&D((0,_.e)(e)),D((0,F.y)({handler:y,reactEvent:e}))},[D,T,y]),ae=(0,n.useCallback)(e=>{D((0,F.y)({handler:g,reactEvent:e}))},[D,g]),se=function(e){return!0===e?L:V}(E);return n.createElement(x.$.Provider,{value:k},n.createElement(U.t.Provider,{value:H},n.createElement(se,{width:null!=G?G:null==m?void 0:m.width,height:null!=W?W:null==m?void 0:m.height,className:(0,b.$)("recharts-wrapper",i),style:P({position:"relative",cursor:"default",width:G,height:W},m),onClick:Y,onContextMenu:te,onDoubleClick:re,onFocus:$,onKeyDown:ee,onMouseDown:ne,onMouseEnter:Z,onMouseLeave:q,onMouseMove:J,onMouseUp:ie,onTouchEnd:ae,onTouchMove:oe,onTouchStart:Ae,ref:X},n.createElement(N,null),r)))}),z=r(76270),G=(0,n.createContext)(void 0),W=e=>{var{children:t}=e,[r]=(0,n.useState)("".concat((0,T.NF)("recharts"),"-clip")),i=(0,z.oM)();if(null==i)return null;var{x:A,y:o,width:a,height:s}=i;return n.createElement(G.Provider,{value:r},n.createElement("defs",null,n.createElement("clipPath",{id:r},n.createElement("rect",{x:A,y:o,height:s,width:a}))),t)},X=r(55448),Y=["width","height","responsive","children","className","style","compact","title","desc"];var Z=(0,n.forwardRef)((e,t)=>{var{width:r,height:A,responsive:o,children:a,className:s,style:u,compact:c,title:l,desc:f}=e,d=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,Y),h=(0,X.uZ)(d);return c?n.createElement(n.Fragment,null,n.createElement(i.A3,{width:r,height:A}),n.createElement(w,{otherAttributes:h,title:l,desc:f},a)):n.createElement(K,{className:s,style:u,width:r,height:A,responsive:null!=o&&o,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},n.createElement(w,{otherAttributes:h,title:l,desc:f,ref:t},n.createElement(W,null,a)))})},68156(e,t,r){"use strict";var n=r(46518),i=r(60533).start;n({target:"String",proto:!0,forced:r(83063)},{padStart:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},68271(e,t,r){"use strict";r.d(t,{A:()=>Q});var n,i=r(73872),A=r(8032),o=r(58503),a=r(6653),s=r(19504),u=r(5224),c=r(99378),l=r(7758),f=r(32993),d=r(61511),h=r(12008),p=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),g=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const y=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return p(t,e),t.prototype.decodeMiddle=function(e,t,r){var n,i,A,o,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=t[1],c=0;c<4&&u<s;c++){var l=h.A.decodeDigit(e,a,u,h.A.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l);try{for(var f=(n=void 0,g(a)),d=f.next();!d.done;d=f.next()){u+=d.value}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}u=h.A.findGuardPattern(e,u,!0,h.A.MIDDLE_PATTERN,new Int32Array(h.A.MIDDLE_PATTERN.length).fill(0))[1];for(c=0;c<4&&u<s;c++){l=h.A.decodeDigit(e,a,u,h.A.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l);try{for(var p=(A=void 0,g(a)),y=p.next();!y.done;y=p.next()){u+=y.value}}catch(e){A={error:e}}finally{try{y&&!y.done&&(o=p.return)&&o.call(p)}finally{if(A)throw A.error}}}return{rowOffset:u,resultString:r}},t.prototype.getBarcodeFormat=function(){return i.A.EAN_8},t}(h.A);var v=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.ean13Reader=new d.A,t}return v(t,e),t.prototype.getBarcodeFormat=function(){return i.A.UPC_A},t.prototype.decode=function(e,t){return this.maybeReturnResult(this.ean13Reader.decode(e))},t.prototype.decodeRow=function(e,t,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(e,t,r))},t.prototype.decodeMiddle=function(e,t,r){return this.ean13Reader.decodeMiddle(e,t,r)},t.prototype.maybeReturnResult=function(e){var t=e.getText();if("0"===t.charAt(0)){var r=new l.A(t.substring(1),null,null,e.getResultPoints(),i.A.UPC_A);return null!=e.getResultMetadata()&&r.putAllMetadata(e.getResultMetadata()),r}throw new o.A},t.prototype.reset=function(){this.ean13Reader.reset()},t}(h.A);const w=m;var b=r(88468),B=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),C=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const E=function(e){function t(){var t=e.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return B(t,e),t.prototype.decodeMiddle=function(e,r,n){var i,A,o=this.decodeMiddleCounters.map(function(e){return e});o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var a=e.getSize(),s=r[1],u=0,c=0;c<6&&s<a;c++){var l=t.decodeDigit(e,o,s,t.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var f=(i=void 0,C(o)),d=f.next();!d.done;d=f.next()){s+=d.value}}catch(e){i={error:e}}finally{try{d&&!d.done&&(A=f.return)&&A.call(f)}finally{if(i)throw i.error}}l>=10&&(u|=1<<5-c)}return t.determineNumSysAndCheckDigit(new b.A(n),u),s},t.prototype.decodeEnd=function(e,r){return t.findGuardPatternWithoutCounters(e,r,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return h.A.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,t){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(t===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return e.insert(0,"0"+r),void e.append("0"+n);throw o.A.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return i.A.UPC_E},t.convertUPCEtoUPCA=function(e){var t=e.slice(1,7).split("").map(function(e){return e.charCodeAt(0)}),r=new b.A;r.append(e.charAt(0));var n=t[5];switch(n){case 0:case 1:case 2:r.appendChars(t,0,2),r.append(n),r.append("0000"),r.appendChars(t,2,3);break;case 3:r.appendChars(t,0,3),r.append("00000"),r.appendChars(t,3,2);break;case 4:r.appendChars(t,0,4),r.append("00000"),r.append(t[4]);break;default:r.appendChars(t,0,5),r.append("0000"),r.append(n)}return e.length>=8&&r.append(e.charAt(7)),r.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(h.A);var S=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),I=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const O=function(e){function t(t){var r=e.call(this)||this,n=null==t?null:t.get(A.A.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(i.A.EAN_13)>-1&&o.push(new d.A),n.indexOf(i.A.UPC_A)>-1&&o.push(new w),n.indexOf(i.A.EAN_8)>-1&&o.push(new y),n.indexOf(i.A.UPC_E)>-1&&o.push(new E)),0===o.length&&(o.push(new d.A),o.push(new w),o.push(new y),o.push(new E)),r.readers=o,r}return S(t,e),t.prototype.decodeRow=function(e,t,r){var n,a;try{for(var s=I(this.readers),u=s.next();!u.done;u=s.next()){var c=u.value;try{var f=c.decodeRow(e,t,r),d=f.getBarcodeFormat()===i.A.EAN_13&&"0"===f.getText().charAt(0),h=null==r?null:r.get(A.A.POSSIBLE_FORMATS),p=null==h||h.includes(i.A.UPC_A);if(d&&p){var g=f.getRawBytes(),y=new l.A(f.getText().substring(1),g,g?g.length:null,f.getResultPoints(),i.A.UPC_A);return y.putAllMetadata(f.getResultMetadata()),y}return f}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(n)throw n.error}}throw new o.A},t.prototype.reset=function(){var e,t;try{for(var r=I(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},t}(f.A);var F=r(82205),_=r(81488),x=r(93710),U=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const Q=function(e){function t(t){var r=e.call(this)||this;r.readers=[];var n=t?t.get(A.A.POSSIBLE_FORMATS):null,o=t&&void 0!==t.get(A.A.ASSUME_CODE_39_CHECK_DIGIT),l=t&&void 0!==t.get(A.A.ENABLE_CODE_39_EXTENDED_MODE);return n&&((n.includes(i.A.EAN_13)||n.includes(i.A.UPC_A)||n.includes(i.A.EAN_8)||n.includes(i.A.UPC_E))&&r.readers.push(new O(t)),n.includes(i.A.CODE_39)&&r.readers.push(new s.A(o,l)),n.includes(i.A.CODE_93)&&r.readers.push(new u.A),n.includes(i.A.CODE_128)&&r.readers.push(new a.A),n.includes(i.A.ITF)&&r.readers.push(new c.A),n.includes(i.A.CODABAR)&&r.readers.push(new F.A),n.includes(i.A.RSS_14)&&r.readers.push(new x.A),n.includes(i.A.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new _.A))),0===r.readers.length&&(r.readers.push(new O(t)),r.readers.push(new s.A),r.readers.push(new u.A),r.readers.push(new O(t)),r.readers.push(new a.A),r.readers.push(new c.A),r.readers.push(new x.A)),r}return U(t,e),t.prototype.decodeRow=function(e,t,r){for(var n=0;n<this.readers.length;n++)try{return this.readers[n].decodeRow(e,t,r)}catch(e){}throw new o.A},t.prototype.reset=function(){this.readers.forEach(function(e){return e.reset()})},t}(f.A)},68861(e,t,r){"use strict";r.d(t,{W:()=>A,h:()=>i});var n=r(25508),i=(0,n.Mz)(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),A=(0,n.Mz)(e=>e.cartesianAxis.yAxis,e=>Object.values(e))},69107(e,t,r){"use strict";r.d(t,{d:()=>D});var n=r(96540),i=r(6634),A=r(59744),o=r(26470),a=r(74333),s=r(30131),u=r(19287),c=r(91572),l=r(49082),f=r(12070),d=r(77404),h=r(55448),p=r(8813),g=r(27132),y=r(60648),v=["x1","y1","x2","y2","key"],m=["offset"],w=["xAxisId","yAxisId"],b=["xAxisId","yAxisId"];function B(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?B(Object(r),!0).forEach(function(t){E(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function E(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S.apply(null,arguments)}function I(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var O=e=>{var{fill:t}=e;if(!t||"none"===t)return null;var{fillOpacity:r,x:i,y:A,width:o,height:a,ry:s}=e;return n.createElement("rect",{x:i,y:A,ry:s,width:o,height:a,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function F(e){var t,{option:r,lineItemProps:i}=e;if(n.isValidElement(r))t=n.cloneElement(r,i);else if("function"==typeof r)t=r(i);else{var A,{x1:o,y1:a,x2:s,y2:u,key:c}=i,l=I(i,v),f=null!==(A=(0,h.uZ)(l))&&void 0!==A?A:{},{offset:d}=f,p=I(f,m);t=n.createElement("line",S({},p,{x1:o,y1:a,x2:s,y2:u,fill:"none",key:c}))}return t}function _(e){var{x:t,width:r,horizontal:i=!0,horizontalPoints:A}=e;if(!i||!A||!A.length)return null;var{xAxisId:o,yAxisId:a}=e,s=I(e,w),u=A.map((e,A)=>{var o=C(C({},s),{},{x1:t,y1:e,x2:t+r,y2:e,key:"line-".concat(A),index:A});return n.createElement(F,{key:"line-".concat(A),option:i,lineItemProps:o})});return n.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function x(e){var{y:t,height:r,vertical:i=!0,verticalPoints:A}=e;if(!i||!A||!A.length)return null;var{xAxisId:o,yAxisId:a}=e,s=I(e,b),u=A.map((e,A)=>{var o=C(C({},s),{},{x1:e,y1:t,x2:e,y2:t+r,key:"line-".concat(A),index:A});return n.createElement(F,{option:i,lineItemProps:o,key:"line-".concat(A)})});return n.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function U(e){var{horizontalFill:t,fillOpacity:r,x:i,y:A,width:o,height:a,horizontalPoints:s,horizontal:u=!0}=e;if(!u||!t||!t.length||null==s)return null;var c=s.map(e=>Math.round(e+A-A)).sort((e,t)=>e-t);A!==c[0]&&c.unshift(0);var l=c.map((e,s)=>{var u=!c[s+1]?A+a-e:c[s+1]-e;if(u<=0)return null;var l=s%t.length;return n.createElement("rect",{key:"react-".concat(s),y:e,x:i,height:u,width:o,stroke:"none",fill:t[l],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return n.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},l)}function Q(e){var{vertical:t=!0,verticalFill:r,fillOpacity:i,x:A,y:o,width:a,height:s,verticalPoints:u}=e;if(!t||!r||!r.length)return null;var c=u.map(e=>Math.round(e+A-A)).sort((e,t)=>e-t);A!==c[0]&&c.unshift(0);var l=c.map((e,t)=>{var u=!c[t+1]?A+a-e:c[t+1]-e;if(u<=0)return null;var l=t%r.length;return n.createElement("rect",{key:"react-".concat(t),x:e,y:o,width:u,height:s,stroke:"none",fill:r[l],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return n.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},l)}var T=(e,t)=>{var{xAxis:r,width:n,height:i,offset:A}=e;return(0,o.PW)((0,a.f)(C(C(C({},s.F),r),{},{ticks:(0,o.Rh)(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),A.left,A.left+A.width,t)},M=(e,t)=>{var{yAxis:r,width:n,height:i,offset:A}=e;return(0,o.PW)((0,a.f)(C(C(C({},s.F),r),{},{ticks:(0,o.Rh)(r,!0),viewBox:{x:0,y:0,width:n,height:i}})),A.top,A.top+A.height,t)},P={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:y.I.grid};function D(e){var t=(0,u.yi)(),r=(0,u.rY)(),o=(0,u.W7)(),a=C(C({},(0,d.e)(e,P)),{},{x:(0,A.Et)(e.x)?e.x:o.left,y:(0,A.Et)(e.y)?e.y:o.top,width:(0,A.Et)(e.width)?e.width:o.width,height:(0,A.Et)(e.height)?e.height:o.height}),{xAxisId:s,yAxisId:h,x:y,y:v,width:m,height:w,syncWithTicks:b,horizontalValues:B,verticalValues:E}=a,I=(0,f.r)(),F=(0,l.G)(e=>(0,c.ZB)(e,"xAxis",s,I)),D=(0,l.G)(e=>(0,c.ZB)(e,"yAxis",h,I));if(!((0,p.F)(m)&&(0,p.F)(w)&&(0,A.Et)(y)&&(0,A.Et)(v)))return null;var k=a.verticalCoordinatesGenerator||T,N=a.horizontalCoordinatesGenerator||M,{horizontalPoints:R,verticalPoints:L}=a;if(!(R&&R.length||"function"!=typeof N)){var H=B&&B.length,j=N({yAxis:D?C(C({},D),{},{ticks:H?B:D.ticks}):void 0,width:null!=t?t:m,height:null!=r?r:w,offset:o},!!H||b);(0,i.R)(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(R=j)}if(!(L&&L.length||"function"!=typeof k)){var V=E&&E.length,K=k({xAxis:F?C(C({},F),{},{ticks:V?E:F.ticks}):void 0,width:null!=t?t:m,height:null!=r?r:w,offset:o},!!V||b);(0,i.R)(Array.isArray(K),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof K,"]")),Array.isArray(K)&&(L=K)}return n.createElement(g.g,{zIndex:a.zIndex},n.createElement("g",{className:"recharts-cartesian-grid"},n.createElement(O,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),n.createElement(U,S({},a,{horizontalPoints:R})),n.createElement(Q,S({},a,{verticalPoints:L})),n.createElement(_,S({},a,{offset:o,horizontalPoints:R,xAxis:F,yAxis:D})),n.createElement(x,S({},a,{offset:o,verticalPoints:L,xAxis:F,yAxis:D}))))}D.displayName="CartesianGrid"},69242(e,t,r){"use strict";e.exports=r(22162)},69264(e,t,r){"use strict";r.d(t,{p:()=>o});var n=r(96540),i=r(92476),A=r(49082);function o(e){var t=(0,A.j)();return(0,n.useEffect)(()=>{t((0,i.mZ)(e))},[t,e]),null}},69786(e,t,r){"use strict";r.d(t,{N1:()=>Se,lF:()=>Ce});var n=r(96540),i=r(34164),A=r(86069),o=r(5614),a=r(98940),s=r(55448),u=r(59744);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(null,arguments)}var l=e=>{var{cx:t,cy:r,r:A,className:o}=e,l=(0,i.$)("recharts-dot",o);return(0,u.Et)(t)&&(0,u.Et)(r)&&(0,u.Et)(A)?n.createElement("circle",c({},(0,s.uZ)(e),(0,a._U)(e),{className:l,cx:t,cy:r,r:A})):null},f=r(94501),d=r(80196),h=r(27132),p=r(60648),g=["points"];function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach(function(t){m(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function m(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w.apply(null,arguments)}function b(e){var{option:t,dotProps:r,className:A}=e;if((0,n.isValidElement)(t))return(0,n.cloneElement)(t,r);if("function"==typeof t)return t(r);var o=(0,i.$)(A,"boolean"!=typeof t?t.className:""),a=null!=r?r:{},{points:s}=a,u=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(a,g);return n.createElement(l,w({},u,{className:o}))}function B(e){var{points:t,dot:r,className:i,dotClassName:o,dataKey:a,baseProps:s,needClip:u,clipPathId:c,zIndex:l=p.I.scatter}=e;if(!function(e,t){return null!=e&&(!!t||1===e.length)}(t,r))return null;var g=(0,f.y$)(r),y=(0,d.y)(r),m=t.map((e,i)=>{var A,u,c=v(v(v({r:3},s),y),{},{index:i,cx:null!==(A=e.x)&&void 0!==A?A:void 0,cy:null!==(u=e.y)&&void 0!==u?u:void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return n.createElement(b,{key:"dot-".concat(i),option:r,dotProps:c,className:o})}),B={};return u&&null!=c&&(B.clipPath="url(#clipPath-".concat(g?"":"dots-").concat(c,")")),n.createElement(h.g,{zIndex:l},n.createElement(A.W,w({className:i},B),m))}var C=r(26470),E=r(49082),S=r(33032),I=r(76270);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach(function(t){_(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var x=e=>{var{point:t,childIndex:r,mainColor:i,activeDot:o,dataKey:u,clipPath:c}=e;if(!1===o||null==t.x||null==t.y)return null;var f,d=F(F(F({},{index:r,dataKey:u,cx:t.x,cy:t.y,r:4,fill:null!=i?i:"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value}),(0,s.ic)(o)),(0,a._U)(o));return f=(0,n.isValidElement)(o)?(0,n.cloneElement)(o,d):"function"==typeof o?o(d):n.createElement(l,d),n.createElement(A.W,{className:"recharts-active-dot",clipPath:c},f)};function U(e){var{points:t,mainColor:r,activeDot:i,itemDataKey:A,clipPath:o,zIndex:a=p.I.activeDot}=e,s=(0,E.G)(S.A2),c=(0,I.EI)();if(null==t||null==c)return null;var l=t.find(e=>c.includes(e.payload));return(0,u.uy)(l)?null:n.createElement(h.g,{zIndex:a},n.createElement(x,{point:l,childIndex:Number(s),mainColor:r,dataKey:A,activeDot:i,clipPath:o}))}var Q=r(59482),T=r(5298),M=r(31754),P=r(19287),D=r(12070),k=r(25508),N=r(98453),R=r(91572),L=(e,t,r,n)=>(0,R.Gx)(e,"xAxis",t,n),H=(e,t,r,n)=>(0,R.CR)(e,"xAxis",t,n),j=(e,t,r,n)=>(0,R.Gx)(e,"yAxis",r,n),V=(e,t,r,n)=>(0,R.CR)(e,"yAxis",r,n),K=(0,k.Mz)([P.fz,L,j,H,V],(e,t,r,n,i)=>(0,C._L)(e,"xAxis")?(0,C.Hj)(t,n,!1):(0,C.Hj)(r,i,!1));function z(e){return"line"===e.type}var G=(0,k.Mz)([R.ld,(e,t,r,n,i)=>i],(e,t)=>e.filter(z).find(e=>e.id===t)),W=(0,k.Mz)([P.fz,L,j,H,V,G,K,N.k$],(e,t,r,n,i,A,o,a)=>{var{chartData:s,dataStartIndex:u,dataEndIndex:c}=a;if(null!=A&&null!=t&&null!=r&&null!=n&&null!=i&&0!==n.length&&0!==i.length&&null!=o&&("horizontal"===e||"vertical"===e)){var l,{dataKey:f,data:d}=A;if(null!=(l=null!=d&&d.length>0?d:null==s?void 0:s.slice(u,c+1)))return Ce({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataKey:f,bandSize:o,displayedData:l})}}),X=r(19797),Y=r(8107),Z=r(77404),q=r(55694),J=r(42678),$=r(8791);var ee=r(15079),te=r(65245),re=["id"],ne=["type","layout","connectNulls","needClip","shape"],ie=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ae.apply(null,arguments)}function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach(function(t){se(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function se(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ue(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var ce=e=>{var{dataKey:t,name:r,stroke:n,legendType:i,hide:A}=e;return[{inactive:A,dataKey:t,type:i,color:n,value:(0,C.uM)(r,t),payload:e}]},le=n.memo(e=>{var{dataKey:t,data:r,stroke:i,strokeWidth:A,fill:o,name:a,hide:s,unit:u,tooltipType:c,id:l}=e,f={dataDefinedOnItem:r,positions:void 0,settings:{stroke:i,strokeWidth:A,fill:o,dataKey:t,nameKey:void 0,name:(0,C.uM)(a,t),hide:s,type:c,color:i,unit:u,graphicalItemId:l}};return n.createElement(Q.r,{tooltipEntrySettings:f})}),fe=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function de(e,t){for(var r=e.length%2!=0?[...e,0]:e,n=[],i=0;i<t;++i)n=[...n,...r];return n}function he(e){var{clipPathId:t,points:r,props:i}=e,{dot:A,dataKey:o,needClip:a}=i,{id:u}=i,c=ue(i,re),l=(0,s.uZ)(c);return n.createElement(B,{points:r,dot:A,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:l,needClip:a,clipPathId:t})}function pe(e){var{showLabels:t,children:r,points:i}=e,A=(0,n.useMemo)(()=>null==i?void 0:i.map(e=>{var t,r,n={x:null!==(t=e.x)&&void 0!==t?t:0,y:null!==(r=e.y)&&void 0!==r?r:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ae(ae({},n),{},{value:e.value,payload:e.payload,viewBox:n,parentViewBox:void 0,fill:void 0})}),[i]);return n.createElement(o.h8,{value:t?A:void 0},r)}function ge(e){var{clipPathId:t,pathRef:r,points:i,strokeDasharray:A,props:o}=e,{type:a,layout:s,connectNulls:u,needClip:c,shape:l}=o,f=ue(o,ne),h=ae(ae({},(0,d.a)(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:c?"url(#clipPath-".concat(t,")"):void 0,points:i,type:a,layout:s,connectNulls:u,strokeDasharray:null!=A?A:o.strokeDasharray});return n.createElement(n.Fragment,null,(null==i?void 0:i.length)>1&&n.createElement(ee.y,Ae({shapeType:"curve",option:l},h,{pathRef:r})),n.createElement(he,{points:i,clipPathId:t,props:o}))}function ye(e){var{clipPathId:t,props:r,pathRef:i,previousPointsRef:A,longestAnimatedLengthRef:a}=e,{points:s,strokeDasharray:c,isAnimationActive:l,animationBegin:f,animationDuration:d,animationEasing:h,animateNewValues:p,width:g,height:y,onAnimationEnd:v,onAnimationStart:m}=r,w=A.current,b=(0,Y.n)(s,"recharts-line-"),B=(0,n.useRef)(b),[C,E]=(0,n.useState)(!1),S=!C,I=(0,n.useCallback)(()=>{"function"==typeof v&&v(),E(!1)},[v]),O=(0,n.useCallback)(()=>{"function"==typeof m&&m(),E(!0)},[m]),F=function(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}(i.current),_=(0,n.useRef)(0);B.current!==b&&(_.current=a.current,B.current=b);var x=_.current;return n.createElement(pe,{points:s,showLabels:S},r.children,n.createElement($.J,{animationId:b,begin:f,duration:d,isActive:l,easing:h,onAnimationEnd:I,onAnimationStart:O,key:b},e=>{var o,f=(0,u.GW)(x,F+x,e),d=Math.min(f,F);if(l)if(c){var h="".concat(c).split(/[,\s]+/gim).map(e=>parseFloat(e));o=((e,t,r)=>{var n=r.reduce((e,t)=>e+t);if(!n)return fe(t,e);for(var i=Math.floor(e/n),A=e%n,o=t-e,a=[],s=0,u=0;s<r.length;u+=r[s],++s)if(u+r[s]>A){a=[...r.slice(0,s),A-u];break}var c=a.length%2==0?[0,o]:[o];return[...de(r,i),...a,...c].map(e=>"".concat(e,"px")).join(", ")})(d,F,h)}else o=fe(F,d);else o=null==c?void 0:String(c);if(e>0&&F>0&&(A.current=s,a.current=Math.max(a.current,d)),w){var v=w.length/s.length,m=1===e?s:s.map((t,r)=>{var n=Math.floor(r*v);if(w[n]){var i=w[n];return ae(ae({},t),{},{x:(0,u.GW)(i.x,t.x,e),y:(0,u.GW)(i.y,t.y,e)})}return ae(ae({},t),{},p?{x:(0,u.GW)(2*g,t.x,e),y:(0,u.GW)(y/2,t.y,e)}:{x:t.x,y:t.y})});return A.current=m,n.createElement(ge,{props:r,points:m,clipPathId:t,pathRef:i,strokeDasharray:o})}return n.createElement(ge,{props:r,points:s,clipPathId:t,pathRef:i,strokeDasharray:o})}),n.createElement(o.qY,{label:r.label}))}function ve(e){var{clipPathId:t,props:r}=e,i=(0,n.useRef)(null),A=(0,n.useRef)(0),o=(0,n.useRef)(null);return n.createElement(ye,{props:r,clipPathId:t,previousPointsRef:i,longestAnimatedLengthRef:A,pathRef:o})}var me=(e,t)=>{var r,n;return{x:null!==(r=e.x)&&void 0!==r?r:void 0,y:null!==(n=e.y)&&void 0!==n?n:void 0,value:e.value,errorVal:(0,C.kr)(e.payload,t)}};class we extends n.Component{render(){var{hide:e,dot:t,points:r,className:o,xAxisId:a,yAxisId:u,top:c,left:l,width:d,height:p,id:g,needClip:y,zIndex:v}=this.props;if(e)return null;var m=(0,i.$)("recharts-line",o),w=g,{r:b,strokeWidth:B}=function(e){var t=(0,s.ic)(e);if(null!=t){var{r,strokeWidth:n}=t,i=Number(r),A=Number(n);return(Number.isNaN(i)||i<0)&&(i=3),(Number.isNaN(A)||A<0)&&(A=2),{r:i,strokeWidth:A}}return{r:3,strokeWidth:2}}(t),C=(0,f.y$)(t),E=2*b+B,S=y?"url(#clipPath-".concat(C?"":"dots-").concat(w,")"):void 0;return n.createElement(h.g,{zIndex:v},n.createElement(A.W,{className:m},y&&n.createElement("defs",null,n.createElement(M.Q,{clipPathId:w,xAxisId:a,yAxisId:u}),!C&&n.createElement("clipPath",{id:"clipPath-dots-".concat(w)},n.createElement("rect",{x:l-E/2,y:c-E/2,width:d+E,height:p+E}))),n.createElement(T.zk,{xAxisId:a,yAxisId:u,data:r,dataPointFormatter:me,errorBarOffset:0},n.createElement(ve,{props:this.props,clipPathId:w}))),n.createElement(U,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:S}))}}var be={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:p.I.line,type:"linear"};function Be(e){var t=(0,Z.e)(e,be),{activeDot:r,animateNewValues:i,animationBegin:A,animationDuration:o,animationEasing:a,connectNulls:s,dot:u,hide:c,isAnimationActive:l,label:f,legendType:d,xAxisId:h,yAxisId:p,id:g}=t,y=ue(t,ie),{needClip:v}=(0,M.l)(h,p),m=(0,I.oM)(),w=(0,P.WX)(),b=(0,D.r)(),B=(0,E.G)(e=>W(e,h,p,b,g));if("horizontal"!==w&&"vertical"!==w||null==B||null==m)return null;var{height:C,width:S,x:O,y:F}=m;return n.createElement(we,Ae({},y,{id:g,connectNulls:s,dot:u,activeDot:r,animateNewValues:i,animationBegin:A,animationDuration:o,animationEasing:a,isAnimationActive:l,hide:c,label:f,legendType:d,xAxisId:h,yAxisId:p,points:B,layout:w,height:C,width:S,left:O,top:F,needClip:v}))}function Ce(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:A,dataKey:o,bandSize:a,displayedData:s}=e;return s.map((e,s)=>{var c=(0,C.kr)(e,o);if("horizontal"===t)return{x:(0,C.nb)({axis:r,ticks:i,bandSize:a,entry:e,index:s}),y:(0,u.uy)(c)?null:n.scale(c),value:c,payload:e};var l=(0,u.uy)(c)?null:r.scale(c),f=(0,C.nb)({axis:n,ticks:A,bandSize:a,entry:e,index:s});return null==l||null==f?null:{x:l,y:f,value:c,payload:e}}).filter(Boolean)}function Ee(e){var t=(0,Z.e)(e,be),r=(0,D.r)();return n.createElement(q.x,{id:t.id,type:"line"},e=>n.createElement(n.Fragment,null,n.createElement(X.A,{legendPayload:ce(t)}),n.createElement(le,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),n.createElement(J.p,{type:"line",id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),n.createElement(Be,Ae({},t,{id:e}))))}var Se=n.memo(Ee,te.P);Se.displayName="Line"},69982(e,t,r){"use strict";e.exports=r(7463)},70008(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(76773);t.debounce=function(e,t=0,r={}){"object"!=typeof r&&(r={});const{leading:i=!1,trailing:A=!0,maxWait:o}=r,a=Array(2);let s;i&&(a[0]="leading"),A&&(a[1]="trailing");let u=null;const c=n.debounce(function(...t){s=e.apply(this,t),u=null},t,{edges:a}),l=function(...t){return null!=o&&(null===u&&(u=Date.now()),Date.now()-u>=o)?(s=e.apply(this,t),u=Date.now(),c.cancel(),c.schedule(),s):(c.apply(this,t),s)};return l.cancel=c.cancel,l.flush=()=>(c.flush(),s),l}},70259(e,t,r){"use strict";var n=r(34376),i=r(26198),A=r(96837),o=r(76080),a=r(97040),s=function(e,t,r,u,c,l,f,d){for(var h,p,g=c,y=0,v=!!f&&o(f,d);y<u;)y in r&&(h=v?v(r[y],y,t):r[y],l>0&&n(h)?(p=i(h),g=s(e,t,h,p,g,l-1)-1):(A(g+1),a(e,g,h)),g++),y++;return g};e.exports=s},70380(e,t,r){"use strict";var n=r(79504),i=r(79039),A=r(60533).start,o=RangeError,a=isFinite,s=Math.abs,u=Date.prototype,c=u.toISOString,l=n(u.getTime),f=n(u.getUTCDate),d=n(u.getUTCFullYear),h=n(u.getUTCHours),p=n(u.getUTCMilliseconds),g=n(u.getUTCMinutes),y=n(u.getUTCMonth),v=n(u.getUTCSeconds);e.exports=i(function(){return"0385-07-25T07:06:39.999Z"!==c.call(new Date(-50000000000001))})||!i(function(){c.call(new Date(NaN))})?function(){if(!a(l(this)))throw new o("Invalid time value");var e=this,t=d(e),r=p(e),n=t<0?"-":t>9999?"+":"";return n+A(s(t),n?6:4,0)+"-"+A(y(e)+1,2,0)+"-"+A(f(e),2,0)+"T"+A(h(e),2,0)+":"+A(g(e),2,0)+":"+A(v(e),2,0)+"."+A(r,3,0)+"Z"}:c},71083(e,t,r){"use strict";r.d(t,{A:()=>Bt});var n={};function i(e,t){return function(){return e.apply(t,arguments)}}r.r(n),r.d(n,{hasBrowserEnv:()=>de,hasStandardBrowserEnv:()=>pe,hasStandardBrowserWebWorkerEnv:()=>ge,navigator:()=>he,origin:()=>ye});const{toString:A}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:a,toStringTag:s}=Symbol,u=(c=Object.create(null),e=>{const t=A.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const l=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,h=f("undefined");function p(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const g=l("ArrayBuffer");const y=f("string"),v=f("function"),m=f("number"),w=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==u(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||s in e||a in e)},B=l("Date"),C=l("File"),E=l("Blob"),S=l("FileList"),I=l("URLSearchParams"),[O,F,_,x]=["ReadableStream","Request","Response","Headers"].map(l);function U(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),d(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{if(p(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),A=i.length;let o;for(n=0;n<A;n++)o=i[n],t.call(null,e[o],o,e)}}function Q(e,t){if(p(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,M=e=>!h(e)&&e!==T;const P=(D="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>D&&e instanceof D);var D;const k=l("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),R=l("RegExp"),L=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};U(r,(r,i)=>{let A;!1!==(A=t(r,i,e))&&(n[i]=A||r)}),Object.defineProperties(e,n)};const H=l("AsyncFunction"),j=(V="function"==typeof setImmediate,K=v(T.postMessage),V?setImmediate:K?(z=`axios@${Math.random()}`,G=[],T.addEventListener("message",({source:e,data:t})=>{e===T&&t===z&&G.length&&G.shift()()},!1),e=>{G.push(e),T.postMessage(z,"*")}):e=>setTimeout(e));var V,K,z,G;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(T):"undefined"!=typeof process&&process.nextTick||j,X={isArray:d,isArrayBuffer:g,isBuffer:p,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||v(e.append)&&("formdata"===(t=u(e))||"object"===t&&v(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&g(e.buffer),t},isString:y,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:b,isEmptyObject:e=>{if(!w(e)||p(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:O,isRequest:F,isResponse:_,isHeaders:x,isUndefined:h,isDate:B,isFile:C,isBlob:E,isRegExp:R,isFunction:v,isStream:e=>w(e)&&v(e.pipe),isURLSearchParams:I,isTypedArray:P,isFileList:S,forEach:U,merge:function e(){const{caseless:t,skipUndefined:r}=M(this)&&this||{},n={},i=(i,A)=>{const o=t&&Q(n,A)||A;b(n[o])&&b(i)?n[o]=e(n[o],i):b(i)?n[o]=e({},i):d(i)?n[o]=i.slice():r&&h(i)||(n[o]=i)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&U(arguments[e],i);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(U(t,(t,n)=>{r&&v(t)?e[n]=i(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let i,A,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),A=i.length;A-- >0;)a=i[A],n&&!n(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==r&&o(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:l,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!m(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[a]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:k,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:L,freezeMethods:e=>{L(e,(t,r)=>{if(v(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];v(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return d(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Q,global:T,isContextDefined:M,isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[s]&&e[a])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(p(e))return e;if(!("toJSON"in e)){t[n]=e;const i=d(e)?[]:{};return U(e,(e,t)=>{const A=r(e,n+1);!h(A)&&(i[t]=A)}),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:H,isThenable:e=>e&&(w(e)||v(e))&&v(e.then)&&v(e.catch),setImmediate:j,asap:W,isIterable:e=>null!=e&&v(e[a])};function Y(e,t,r,n,i){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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}X.inherits(Y,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:X.toJSONObject(this.config),code:this.code,status:this.status}}});const Z=Y.prototype,q={};["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=>{q[e]={value:e}}),Object.defineProperties(Y,q),Object.defineProperty(Z,"isAxiosError",{value:!0}),Y.from=(e,t,r,n,i,A)=>{const o=Object.create(Z);X.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",s=null==t&&e?e.code:t;return Y.call(o,a,s,r,n,i),e&&null==o.cause&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",A&&Object.assign(o,A),o};const J=Y;function $(e){return X.isPlainObject(e)||X.isArray(e)}function ee(e){return X.endsWith(e,"[]")?e.slice(0,-2):e}function te(e,t,r){return e?e.concat(t).map(function(e,t){return e=ee(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const re=X.toFlatObject(X,{},null,function(e){return/^is[A-Z]/.test(e)});const ne=function(e,t,r){if(!X.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=X.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!X.isUndefined(t[e])})).metaTokens,i=r.visitor||u,A=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&X.isSpecCompliantForm(t);if(!X.isFunction(i))throw new TypeError("visitor must be a function");function s(e){if(null===e)return"";if(X.isDate(e))return e.toISOString();if(X.isBoolean(e))return e.toString();if(!a&&X.isBlob(e))throw new J("Blob is not supported. Use a Buffer instead.");return X.isArrayBuffer(e)||X.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,i){let a=e;if(e&&!i&&"object"==typeof e)if(X.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(X.isArray(e)&&function(e){return X.isArray(e)&&!e.some($)}(e)||(X.isFileList(e)||X.endsWith(r,"[]"))&&(a=X.toArray(e)))return r=ee(r),a.forEach(function(e,n){!X.isUndefined(e)&&null!==e&&t.append(!0===o?te([r],n,A):null===o?r:r+"[]",s(e))}),!1;return!!$(e)||(t.append(te(i,r,A),s(e)),!1)}const c=[],l=Object.assign(re,{defaultVisitor:u,convertValue:s,isVisitable:$});if(!X.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!X.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),X.forEach(r,function(r,A){!0===(!(X.isUndefined(r)||null===r)&&i.call(t,r,X.isString(A)?A.trim():A,n,l))&&e(r,n?n.concat(A):[A])}),c.pop()}}(e),t};function ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ae(e,t){this._pairs=[],e&&ne(e,this,t)}const oe=Ae.prototype;oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ie)}:ie;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const ae=Ae;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ue(e,t,r){if(!t)return e;const n=r&&r.encode||se;X.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let A;if(A=i?i(t,r):X.isURLSearchParams(t)?t.toString():new ae(t,r).toString(n),A){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+A}return e}const ce=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){X.forEach(this.handlers,function(t){null!==t&&e(t)})}},le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ae,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},de="undefined"!=typeof window&&"undefined"!=typeof document,he="object"==typeof navigator&&navigator||void 0,pe=de&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),ge="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ye=de&&window.location.href||"http://localhost",ve={...n,...fe};const me=function(e){function t(e,r,n,i){let A=e[i++];if("__proto__"===A)return!0;const o=Number.isFinite(+A),a=i>=e.length;if(A=!A&&X.isArray(n)?n.length:A,a)return X.hasOwnProp(n,A)?n[A]=[n[A],r]:n[A]=r,!o;n[A]&&X.isObject(n[A])||(n[A]=[]);return t(e,r,n[A],i)&&X.isArray(n[A])&&(n[A]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let A;for(n=0;n<i;n++)A=r[n],t[A]=e[A];return t}(n[A])),!o}if(X.isFormData(e)&&X.isFunction(e.entries)){const r={};return X.forEachEntry(e,(e,n)=>{t(function(e){return X.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null};const we={transitional:le,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=X.isObject(e);i&&X.isHTMLForm(e)&&(e=new FormData(e));if(X.isFormData(e))return n?JSON.stringify(me(e)):e;if(X.isArrayBuffer(e)||X.isBuffer(e)||X.isStream(e)||X.isFile(e)||X.isBlob(e)||X.isReadableStream(e))return e;if(X.isArrayBufferView(e))return e.buffer;if(X.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let A;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ne(e,new ve.classes.URLSearchParams,{visitor:function(e,t,r,n){return ve.isNode&&X.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((A=X.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ne(A?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(X.isString(e))try{return(t||JSON.parse)(e),X.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||we.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(X.isResponse(e)||X.isReadableStream(e))return e;if(e&&X.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw J.from(e,J.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ve.classes.FormData,Blob:ve.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],e=>{we.headers[e]={}});const be=we,Be=X.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"]),Ce=Symbol("internals");function Ee(e){return e&&String(e).trim().toLowerCase()}function Se(e){return!1===e||null==e?e:X.isArray(e)?e.map(Se):String(e)}function Ie(e,t,r,n,i){return X.isFunction(n)?n.call(this,t,r):(i&&(t=r),X.isString(t)?X.isString(n)?-1!==t.indexOf(n):X.isRegExp(n)?n.test(t):void 0:void 0)}class Oe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Ee(t);if(!i)throw new Error("header name must be a non-empty string");const A=X.findKey(n,i);(!A||void 0===n[A]||!0===r||void 0===r&&!1!==n[A])&&(n[A||t]=Se(e))}const A=(e,t)=>X.forEach(e,(e,r)=>i(e,r,t));if(X.isPlainObject(e)||e instanceof this.constructor)A(e,t);else if(X.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))A((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&Be[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(X.isObject(e)&&X.isIterable(e)){let r,n,i={};for(const t of e){if(!X.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[n=t[0]]=(r=i[n])?X.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}A(i,t)}else null!=e&&i(t,e,r);return this}get(e,t){if(e=Ee(e)){const r=X.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(X.isFunction(t))return t.call(this,e,r);if(X.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ee(e)){const r=X.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ie(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Ee(e)){const i=X.findKey(r,e);!i||t&&!Ie(0,r[i],i,t)||(delete r[i],n=!0)}}return X.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Ie(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return X.forEach(this,(n,i)=>{const A=X.findKey(r,i);if(A)return t[A]=Se(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(i):String(i).trim();o!==i&&delete t[i],t[o]=Se(n),r[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return X.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&X.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Ce]=this[Ce]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Ee(e);t[n]||(!function(e,t){const r=X.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})})}(r,e),t[n]=!0)}return X.isArray(e)?e.forEach(n):n(e),this}}Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),X.reduceDescriptors(Oe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),X.freezeMethods(Oe);const Fe=Oe;function _e(e,t){const r=this||be,n=t||r,i=Fe.from(n.headers);let A=n.data;return X.forEach(e,function(e){A=e.call(r,A,i.normalize(),t?t.status:void 0)}),i.normalize(),A}function xe(e){return!(!e||!e.__CANCEL__)}function Ue(e,t,r){J.call(this,null==e?"canceled":e,J.ERR_CANCELED,t,r),this.name="CanceledError"}X.inherits(Ue,J,{__CANCEL__:!0});const Qe=Ue;function Te(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new J("Request failed with status code "+r.status,[J.ERR_BAD_REQUEST,J.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Me=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,A=0,o=0;return t=void 0!==t?t:1e3,function(a){const s=Date.now(),u=n[o];i||(i=s),r[A]=a,n[A]=s;let c=o,l=0;for(;c!==A;)l+=r[c++],c%=e;if(A=(A+1)%e,A===o&&(o=(o+1)%e),s-i<t)return;const f=u&&s-u;return f?Math.round(1e3*l/f):void 0}};const Pe=function(e,t){let r,n,i=0,A=1e3/t;const o=(t,A=Date.now())=>{i=A,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=A?o(e,t):(r=e,n||(n=setTimeout(()=>{n=null,o(r)},A-a)))},()=>r&&o(r)]},De=(e,t,r=3)=>{let n=0;const i=Me(50,250);return Pe(r=>{const A=r.loaded,o=r.lengthComputable?r.total:void 0,a=A-n,s=i(a);n=A;e({loaded:A,total:o,progress:o?A/o:void 0,bytes:a,rate:s||void 0,estimated:s&&o&&A<=o?(o-A)/s:void 0,event:r,lengthComputable:null!=o,[t?"download":"upload"]:!0})},r)},ke=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ne=e=>(...t)=>X.asap(()=>e(...t)),Re=ve.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ve.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ve.origin),ve.navigator&&/(msie|trident)/i.test(ve.navigator.userAgent)):()=>!0,Le=ve.hasStandardBrowserEnv?{write(e,t,r,n,i,A,o){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];X.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),X.isString(n)&&a.push(`path=${n}`),X.isString(i)&&a.push(`domain=${i}`),!0===A&&a.push("secure"),X.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function He(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const je=e=>e instanceof Fe?{...e}:e;function Ve(e,t){t=t||{};const r={};function n(e,t,r,n){return X.isPlainObject(e)&&X.isPlainObject(t)?X.merge.call({caseless:n},e,t):X.isPlainObject(t)?X.merge({},t):X.isArray(t)?t.slice():t}function i(e,t,r,i){return X.isUndefined(t)?X.isUndefined(e)?void 0:n(void 0,e,0,i):n(e,t,0,i)}function A(e,t){if(!X.isUndefined(t))return n(void 0,t)}function o(e,t){return X.isUndefined(t)?X.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,i,A){return A in t?n(r,i):A in e?n(void 0,r):void 0}const s={url:A,method:A,data:A,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,r)=>i(je(e),je(t),0,!0)};return X.forEach(Object.keys({...e,...t}),function(n){const A=s[n]||i,o=A(e[n],t[n],n);X.isUndefined(o)&&A!==a||(r[n]=o)}),r}const Ke=e=>{const t=Ve({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:A,headers:o,auth:a}=t;if(t.headers=o=Fe.from(o),t.url=ue(He(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),X.isFormData(r))if(ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(X.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&o.set(e,r)})}if(ve.hasStandardBrowserEnv&&(n&&X.isFunction(n)&&(n=n(t)),n||!1!==n&&Re(t.url))){const e=i&&A&&Le.read(A);e&&o.set(i,e)}return t},ze="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Ke(e);let i=n.data;const A=Fe.from(n.headers).normalize();let o,a,s,u,c,{responseType:l,onUploadProgress:f,onDownloadProgress:d}=n;function h(){u&&u(),c&&c(),n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let p=new XMLHttpRequest;function g(){if(!p)return;const n=Fe.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());Te(function(e){t(e),h()},function(e){r(e),h()},{data:l&&"text"!==l&&"json"!==l?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p}),p=null}p.open(n.method.toUpperCase(),n.url,!0),p.timeout=n.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(r(new J("Request aborted",J.ECONNABORTED,e,p)),p=null)},p.onerror=function(t){const n=t&&t.message?t.message:"Network Error",i=new J(n,J.ERR_NETWORK,e,p);i.event=t||null,r(i),p=null},p.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const i=n.transitional||le;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new J(t,i.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,p)),p=null},void 0===i&&A.setContentType(null),"setRequestHeader"in p&&X.forEach(A.toJSON(),function(e,t){p.setRequestHeader(t,e)}),X.isUndefined(n.withCredentials)||(p.withCredentials=!!n.withCredentials),l&&"json"!==l&&(p.responseType=n.responseType),d&&([s,c]=De(d,!0),p.addEventListener("progress",s)),f&&p.upload&&([a,u]=De(f),p.upload.addEventListener("progress",a),p.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(o=t=>{p&&(r(!t||t.type?new Qe(null,e,p):t),p.abort(),p=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);y&&-1===ve.protocols.indexOf(y)?r(new J("Unsupported protocol "+y+":",J.ERR_BAD_REQUEST,e)):p.send(i||null)})},Ge=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const i=function(e){if(!r){r=!0,o();const t=e instanceof Error?e:this.reason;n.abort(t instanceof J?t:new Qe(t instanceof Error?t.message:t))}};let A=t&&setTimeout(()=>{A=null,i(new J(`timeout ${t} of ms exceeded`,J.ETIMEDOUT))},t);const o=()=>{e&&(A&&clearTimeout(A),A=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=n;return a.unsubscribe=()=>X.asap(o),a}},We=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let n,i=0;for(;i<r;)n=i+t,yield e.slice(i,n),i=n},Xe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},Ye=(e,t,r,n)=>{const i=async function*(e,t){for await(const r of Xe(e))yield*We(r,t)}(e,t);let A,o=0,a=e=>{A||(A=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await i.next();if(t)return a(),void e.close();let A=n.byteLength;if(r){let e=o+=A;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},{isFunction:Ze}=X,qe=(({Request:e,Response:t})=>({Request:e,Response:t}))(X.global),{ReadableStream:Je,TextEncoder:$e}=X.global,et=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},tt=e=>{e=X.merge.call({skipUndefined:!0},qe,e);const{fetch:t,Request:r,Response:n}=e,i=t?Ze(t):"function"==typeof fetch,A=Ze(r),o=Ze(n);if(!i)return!1;const a=i&&Ze(Je),s=i&&("function"==typeof $e?(u=new $e,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const c=A&&a&&et(()=>{let e=!1;const t=new r(ve.origin,{body:new Je,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l=o&&a&&et(()=>X.isReadableStream(new n("").body)),f={stream:l&&(e=>e.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new J(`Response type '${e}' is not supported`,J.ERR_NOT_SUPPORT,r)})});const d=async(e,t)=>{const n=X.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(X.isBlob(e))return e.size;if(X.isSpecCompliantForm(e)){const t=new r(ve.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return X.isArrayBufferView(e)||X.isArrayBuffer(e)?e.byteLength:(X.isURLSearchParams(e)&&(e+=""),X.isString(e)?(await s(e)).byteLength:void 0)})(t):n};return async e=>{let{url:i,method:o,data:a,signal:s,cancelToken:u,timeout:h,onDownloadProgress:p,onUploadProgress:g,responseType:y,headers:v,withCredentials:m="same-origin",fetchOptions:w}=Ke(e),b=t||fetch;y=y?(y+"").toLowerCase():"text";let B=Ge([s,u&&u.toAbortSignal()],h),C=null;const E=B&&B.unsubscribe&&(()=>{B.unsubscribe()});let S;try{if(g&&c&&"get"!==o&&"head"!==o&&0!==(S=await d(v,a))){let e,t=new r(i,{method:"POST",body:a,duplex:"half"});if(X.isFormData(a)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=ke(S,De(Ne(g)));a=Ye(t.body,65536,e,r)}}X.isString(m)||(m=m?"include":"omit");const t=A&&"credentials"in r.prototype,s={...w,signal:B,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:t?m:void 0};C=A&&new r(i,s);let u=await(A?b(C,w):b(i,s));const h=l&&("stream"===y||"response"===y);if(l&&(p||h&&E)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=X.toFiniteNumber(u.headers.get("content-length")),[r,i]=p&&ke(t,De(Ne(p),!0))||[];u=new n(Ye(u.body,65536,r,()=>{i&&i(),E&&E()}),e)}y=y||"text";let I=await f[X.findKey(f,y)||"text"](u,e);return!h&&E&&E(),await new Promise((t,r)=>{Te(t,r,{data:I,headers:Fe.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:C})})}catch(t){if(E&&E(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new J("Network Error",J.ERR_NETWORK,e,C),{cause:t.cause||t});throw J.from(t,t&&t.code,e,C)}}},rt=new Map,nt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,A=[n,i,r];let o,a,s=A.length,u=rt;for(;s--;)o=A[s],a=u.get(o),void 0===a&&u.set(o,a=s?new Map:tt(t)),u=a;return a},it=(nt(),{http:null,xhr:ze,fetch:{get:nt}});X.forEach(it,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const At=e=>`- ${e}`,ot=e=>X.isFunction(e)||null===e||!1===e;const at={getAdapter:function(e,t){e=X.isArray(e)?e:[e];const{length:r}=e;let n,i;const A={};for(let o=0;o<r;o++){let r;if(n=e[o],i=n,!ot(n)&&(i=it[(r=String(n)).toLowerCase()],void 0===i))throw new J(`Unknown adapter '${r}'`);if(i&&(X.isFunction(i)||(i=i.get(t))))break;A[r||"#"+o]=i}if(!i){const e=Object.entries(A).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(At).join("\n"):" "+At(e[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return i},adapters:it};function st(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qe(null,e)}function ut(e){st(e),e.headers=Fe.from(e.headers),e.data=_e.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return at.getAdapter(e.adapter||be.adapter,e)(e).then(function(t){return st(e),t.data=_e.call(e,e.transformResponse,t),t.headers=Fe.from(t.headers),t},function(t){return xe(t)||(st(e),t&&t.response&&(t.response.data=_e.call(e,e.transformResponse,t.response),t.response.headers=Fe.from(t.response.headers))),Promise.reject(t)})}const ct="1.13.2",lt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ft={};lt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+ct+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,A)=>{if(!1===e)throw new J(n(i," has been removed"+(t?" in "+t:"")),J.ERR_DEPRECATED);return t&&!ft[i]&&(ft[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,A)}},lt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const dt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const A=n[i],o=t[A];if(o){const t=e[A],r=void 0===t||o(t,A,e);if(!0!==r)throw new J("option "+A+" must be "+r,J.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new J("Unknown option "+A,J.ERR_BAD_OPTION)}},validators:lt},ht=dt.validators;class pt{constructor(e){this.defaults=e||{},this.interceptors={request:new ce,response:new ce}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ve(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;void 0!==r&&dt.assertOptions(r,{silentJSONParsing:ht.transitional(ht.boolean),forcedJSONParsing:ht.transitional(ht.boolean),clarifyTimeoutError:ht.transitional(ht.boolean)},!1),null!=n&&(X.isFunction(n)?t.paramsSerializer={serialize:n}:dt.assertOptions(n,{encode:ht.function,serialize:ht.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),dt.assertOptions(t,{baseUrl:ht.spelling("baseURL"),withXsrfToken:ht.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let A=i&&X.merge(i.common,i[t.method]);i&&X.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Fe.concat(A,i);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const s=[];let u;this.interceptors.response.forEach(function(e){s.push(e.fulfilled,e.rejected)});let c,l=0;if(!a){const e=[ut.bind(this),void 0];for(e.unshift(...o),e.push(...s),c=e.length,u=Promise.resolve(t);l<c;)u=u.then(e[l++],e[l++]);return u}c=o.length;let f=t;for(;l<c;){const e=o[l++],t=o[l++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=ut.call(this,f)}catch(e){return Promise.reject(e)}for(l=0,c=s.length;l<c;)u=u.then(s[l++],s[l++]);return u}getUri(e){return ue(He((e=Ve(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}X.forEach(["delete","get","head","options"],function(e){pt.prototype[e]=function(t,r){return this.request(Ve(r||{},{method:e,url:t,data:(r||{}).data}))}}),X.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,i){return this.request(Ve(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}pt.prototype[e]=t(),pt.prototype[e+"Form"]=t(!0)});const gt=pt;class yt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,i){r.reason||(r.reason=new Qe(e,n,i),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new yt(function(t){e=t}),cancel:e}}}const vt=yt;const mt={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(mt).forEach(([e,t])=>{mt[t]=e});const wt=mt;const bt=function e(t){const r=new gt(t),n=i(gt.prototype.request,r);return X.extend(n,gt.prototype,r,{allOwnKeys:!0}),X.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ve(t,r))},n}(be);bt.Axios=gt,bt.CanceledError=Qe,bt.CancelToken=vt,bt.isCancel=xe,bt.VERSION=ct,bt.toFormData=ne,bt.AxiosError=J,bt.Cancel=bt.CanceledError,bt.all=function(e){return Promise.all(e)},bt.spread=function(e){return function(t){return e.apply(null,t)}},bt.isAxiosError=function(e){return X.isObject(e)&&!0===e.isAxiosError},bt.mergeConfig=Ve,bt.AxiosHeaders=Fe,bt.formToJSON=e=>me(X.isHTMLForm(e)?new FormData(e):e),bt.getAdapter=at.getAdapter,bt.HttpStatusCode=wt,bt.default=bt;const Bt=bt},71468(e,t,r){"use strict";r.d(t,{Kq:()=>g,bN:()=>l});var n=r(96540);r(78418);function i(e){e()}var A={notify(){},get:()=>[]};function o(e,t){let r,n=A,o=0,a=!1;function s(){l.onStateChange&&l.onStateChange()}function u(){o++,r||(r=t?t.addNestedSub(s):e.subscribe(s),n=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){i(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){const t=[];let r=e;for(;r;)t.push(r),r=r.next;return t},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){n&&null!==e&&(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}())}function c(){o--,r&&0===o&&(r(),r=void 0,n.clear(),n=A)}const l={addNestedSub:function(e){u();const t=n.subscribe(e);let r=!1;return()=>{r||(r=!0,t(),c())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:s,isSubscribed:function(){return a},trySubscribe:function(){a||(a=!0,u())},tryUnsubscribe:function(){a&&(a=!1,c())},getListeners:()=>n};return l}var a=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),s=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),u=(()=>a||s?n.useLayoutEffect:n.useEffect)();function c(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function l(e,t){if(c(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!c(e[r[n]],t[r[n]]))return!1;return!0}Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var f=Symbol.for("react-redux-context"),d="undefined"!=typeof globalThis?globalThis:{};function h(){if(!n.createContext)return{};const e=d[f]??=new Map;let t=e.get(n.createContext);return t||(t=n.createContext(null),e.set(n.createContext,t)),t}var p=h();var g=function(e){const{children:t,context:r,serverState:i,store:A}=e,a=n.useMemo(()=>{const e=o(A);return{store:A,subscription:e,getServerState:i?()=>i:void 0}},[A,i]),s=n.useMemo(()=>A.getState(),[A]);u(()=>{const{subscription:e}=a;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),s!==A.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[a,s]);const c=r||p;return n.createElement(c.Provider,{value:a},t)}},71622(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(26741),i=r(57149),A=r(54951),o=r(23431),a=r(1470),s=r(93516),u=r(73753),c=r(61691),l=r(36254),f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const d=function(){function e(){}return e.encodeBytes=function(t){return e.encode(t,e.DEFAULT_EC_PERCENT,e.DEFAULT_AZTEC_LAYERS)},e.encode=function(t,r,n){var s,u,f,d,h,p=new c.A(t).encode(),g=l.A.truncDivision(p.getSize()*r,100)+11,y=p.getSize()+g;if(n!==e.DEFAULT_AZTEC_LAYERS){if(s=n<0,(u=Math.abs(n))>(s?e.MAX_NB_BITS_COMPACT:e.MAX_NB_BITS))throw new i.A(A.A.format("Illegal value %s for layers",n));var v=(f=e.totalBitsInLayer(u,s))-f%(d=e.WORD_SIZE[u]);if((h=e.stuffBits(p,d)).getSize()+g>v)throw new i.A("Data to large for user specified layer");if(s&&h.getSize()>64*d)throw new i.A("Data to large for user specified layer")}else{d=0,h=null;for(var m=0;;m++){if(m>e.MAX_NB_BITS)throw new i.A("Data too large for an Aztec code");if(u=(s=m<=3)?m+1:m,!(y>(f=e.totalBitsInLayer(u,s)))){null!=h&&d===e.WORD_SIZE[u]||(d=e.WORD_SIZE[u],h=e.stuffBits(p,d));v=f-f%d;if(!(s&&h.getSize()>64*d)&&h.getSize()+g<=v)break}}}var w,b=e.generateCheckWords(h,f,d),B=h.getSize()/d,C=e.generateModeMessage(s,u,B),E=(s?11:14)+4*u,S=new Int32Array(E);if(s){w=E;for(m=0;m<S.length;m++)S[m]=m}else{w=E+1+2*l.A.truncDivision(l.A.truncDivision(E,2)-1,15);var I=l.A.truncDivision(E,2),O=l.A.truncDivision(w,2);for(m=0;m<I;m++){var F=m+l.A.truncDivision(m,15);S[I-m-1]=O-F-1,S[I+m]=O+F+1}}for(var _=new o.A(w),x=(m=0,0);m<u;m++){for(var U=4*(u-m)+(s?9:12),Q=0;Q<U;Q++)for(var T=2*Q,M=0;M<2;M++)b.get(x+T+M)&&_.set(S[2*m+M],S[2*m+Q]),b.get(x+2*U+T+M)&&_.set(S[2*m+Q],S[E-1-2*m-M]),b.get(x+4*U+T+M)&&_.set(S[E-1-2*m-M],S[E-1-2*m-Q]),b.get(x+6*U+T+M)&&_.set(S[E-1-2*m-Q],S[2*m+M]);x+=8*U}if(e.drawModeMessage(_,s,w,C),s)e.drawBullsEye(_,l.A.truncDivision(w,2),5);else{e.drawBullsEye(_,l.A.truncDivision(w,2),7);for(m=0,Q=0;m<l.A.truncDivision(E,2)-1;m+=15,Q+=16)for(M=1&l.A.truncDivision(w,2);M<w;M+=2)_.set(l.A.truncDivision(w,2)-Q,M),_.set(l.A.truncDivision(w,2)+Q,M),_.set(M,l.A.truncDivision(w,2)-Q),_.set(M,l.A.truncDivision(w,2)+Q)}var P=new a.A;return P.setCompact(s),P.setSize(w),P.setLayers(u),P.setCodeWords(B),P.setMatrix(_),P},e.drawBullsEye=function(e,t,r){for(var n=0;n<r;n+=2)for(var i=t-n;i<=t+n;i++)e.set(i,t-n),e.set(i,t+n),e.set(t-n,i),e.set(t+n,i);e.set(t-r,t-r),e.set(t-r+1,t-r),e.set(t-r,t-r+1),e.set(t+r,t-r),e.set(t+r,t-r+1),e.set(t+r,t+r-1)},e.generateModeMessage=function(t,r,i){var A=new n.A;return t?(A.appendBits(r-1,2),A.appendBits(i-1,6),A=e.generateCheckWords(A,28,4)):(A.appendBits(r-1,5),A.appendBits(i-1,11),A=e.generateCheckWords(A,40,4)),A},e.drawModeMessage=function(e,t,r,n){var i=l.A.truncDivision(r,2);if(t)for(var A=0;A<7;A++){var o=i-3+A;n.get(A)&&e.set(o,i-5),n.get(A+7)&&e.set(i+5,o),n.get(20-A)&&e.set(o,i+5),n.get(27-A)&&e.set(i-5,o)}else for(A=0;A<10;A++){o=i-5+A+l.A.truncDivision(A,5);n.get(A)&&e.set(o,i-7),n.get(A+10)&&e.set(i+7,o),n.get(29-A)&&e.set(o,i+7),n.get(39-A)&&e.set(i-7,o)}},e.generateCheckWords=function(t,r,i){var A,o,a=t.getSize()/i,u=new s.A(e.getGF(i)),c=l.A.truncDivision(r,i),d=e.bitsToWords(t,i,c);u.encode(d,c-a);var h=r%i,p=new n.A;p.appendBits(0,h);try{for(var g=f(Array.from(d)),y=g.next();!y.done;y=g.next()){var v=y.value;p.appendBits(v,i)}}catch(e){A={error:e}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(A)throw A.error}}return p},e.bitsToWords=function(e,t,r){var n,i,A=new Int32Array(r);for(n=0,i=e.getSize()/t;n<i;n++){for(var o=0,a=0;a<t;a++)o|=e.get(n*t+a)?1<<t-a-1:0;A[n]=o}return A},e.getGF=function(e){switch(e){case 4:return u.A.AZTEC_PARAM;case 6:return u.A.AZTEC_DATA_6;case 8:return u.A.AZTEC_DATA_8;case 10:return u.A.AZTEC_DATA_10;case 12:return u.A.AZTEC_DATA_12;default:throw new i.A("Unsupported word size "+e)}},e.stuffBits=function(e,t){for(var r=new n.A,i=e.getSize(),A=(1<<t)-2,o=0;o<i;o+=t){for(var a=0,s=0;s<t;s++)(o+s>=i||e.get(o+s))&&(a|=1<<t-1-s);(a&A)===A?(r.appendBits(a&A,t),o--):0===(a&A)?(r.appendBits(1|a,t),o--):r.appendBits(a,t)}return r},e.totalBitsInLayer=function(e,t){return((t?88:112)+16*e)*e},e.DEFAULT_EC_PERCENT=33,e.DEFAULT_AZTEC_LAYERS=0,e.MAX_NB_BITS=32,e.MAX_NB_BITS_COMPACT=4,e.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]),e}()},71692(e,t,r){"use strict";r.d(t,{k:()=>A});var n=r(52775),i=r(24880),A=class{#W;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.gn)(this.gcTime)&&(this.#W=n.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i.S$?1/0:3e5))}clearGcTimeout(){this.#W&&(n.zs.clearTimeout(this.#W),this.#W=void 0)}}},71761(e,t,r){"use strict";var n=r(69565),i=r(79504),A=r(89228),o=r(28551),a=r(20034),s=r(18014),u=r(655),c=r(67750),l=r(55966),f=r(57829),d=r(61034),h=r(56682),p=i("".indexOf);A("match",function(e,t,r){return[function(t){var r=c(this),i=a(t)?l(t,e):void 0;return i?n(i,t,r):new RegExp(t)[e](u(r))},function(e){var n=o(this),i=u(e),A=r(t,n,i);if(A.done)return A.value;var a=u(d(n));if(-1===p(a,"g"))return h(n,i);var c=-1!==p(a,"u");n.lastIndex=0;for(var l,g=[],y=0;null!==(l=h(n,i));){var v=u(l[0]);g[y]=v,""===v&&(n.lastIndex=f(i,s(n.lastIndex),c)),y++}return 0===y?null:g}]})},71983(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(e,t,r,n,i,A,o,a,s){this.a11=e,this.a21=t,this.a31=r,this.a12=n,this.a22=i,this.a32=A,this.a13=o,this.a23=a,this.a33=s}return e.quadrilateralToQuadrilateral=function(t,r,n,i,A,o,a,s,u,c,l,f,d,h,p,g){var y=e.quadrilateralToSquare(t,r,n,i,A,o,a,s);return e.squareToQuadrilateral(u,c,l,f,d,h,p,g).times(y)},e.prototype.transformPoints=function(e){for(var t=e.length,r=this.a11,n=this.a12,i=this.a13,A=this.a21,o=this.a22,a=this.a23,s=this.a31,u=this.a32,c=this.a33,l=0;l<t;l+=2){var f=e[l],d=e[l+1],h=i*f+a*d+c;e[l]=(r*f+A*d+s)/h,e[l+1]=(n*f+o*d+u)/h}},e.prototype.transformPointsWithValues=function(e,t){for(var r=this.a11,n=this.a12,i=this.a13,A=this.a21,o=this.a22,a=this.a23,s=this.a31,u=this.a32,c=this.a33,l=e.length,f=0;f<l;f++){var d=e[f],h=t[f],p=i*d+a*h+c;e[f]=(r*d+A*h+s)/p,t[f]=(n*d+o*h+u)/p}},e.squareToQuadrilateral=function(t,r,n,i,A,o,a,s){var u=t-n+A-a,c=r-i+o-s;if(0===u&&0===c)return new e(n-t,A-n,t,i-r,o-i,r,0,0,1);var l=n-A,f=a-A,d=i-o,h=s-o,p=l*h-f*d,g=(u*h-f*c)/p,y=(l*c-u*d)/p;return new e(n-t+g*n,a-t+y*a,t,i-r+g*i,s-r+y*s,r,g,y,1)},e.quadrilateralToSquare=function(t,r,n,i,A,o,a,s){return e.squareToQuadrilateral(t,r,n,i,A,o,a,s).buildAdjoint()},e.prototype.buildAdjoint=function(){return new e(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},e.prototype.times=function(t){return new e(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)},e}()},72050(e,t,r){"use strict";r.d(t,{f:()=>n});var n=e=>null;n.displayName="Cell"},72333(e,t,r){"use strict";var n=r(91291),i=r(655),A=r(67750),o=RangeError;e.exports=function(e){var t=i(A(this)),r="",a=n(e);if(a<0||a===1/0)throw new o("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(r+=t);return r}},72685(e,t,r){"use strict";r.d(t,{P:()=>f});var n=r(96540),i=r(5508),A=r(67965),o=r(2613),a=r(69264),s=r(68132),u=r(77404);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(null,arguments)}var l={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:{top:5,right:5,bottom:5,left:5},responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},f=(0,n.forwardRef)(function(e,t){var r,f=(0,u.e)(e.categoricalChartProps,l),{chartName:d,defaultTooltipEventType:h,validateTooltipEventTypes:p,tooltipPayloadSearcher:g,categoricalChartProps:y}=e,v={chartName:d,defaultTooltipEventType:h,validateTooltipEventTypes:p,tooltipPayloadSearcher:g,eventEmitter:void 0};return n.createElement(i.J,{preloadedState:{options:v},reduxStoreName:null!==(r=y.id)&&void 0!==r?r:d},n.createElement(A.TK,{chartData:y.data}),n.createElement(o.s,{layout:f.layout,margin:f.margin}),n.createElement(a.p,{baseValue:f.baseValue,accessibilityLayer:f.accessibilityLayer,barCategoryGap:f.barCategoryGap,maxBarSize:f.maxBarSize,stackOffset:f.stackOffset,barGap:f.barGap,barSize:f.barSize,syncId:f.syncId,syncMethod:f.syncMethod,className:f.className,reverseStackOrder:f.reverseStackOrder}),n.createElement(s.L,c({},f,{ref:t})))})},72712(e,t,r){"use strict";var n=r(46518),i=r(80926).left,A=r(34598),o=r(39519);n({target:"Array",proto:!0,forced:!r(16193)&&o>79&&o<83||!A("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},72747(e,t,r){"use strict";r.d(t,{Pu:()=>d});var n=r(59938);function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=o({},{cacheSize:2e3,enableCache:!0}),u=new class{constructor(e){i(this,"cache",new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return void 0!==t&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;null!=r&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}}(s.cacheSize),c={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},l="recharts_measurement_span";var f=(e,t)=>{try{var r=document.getElementById(l);r||((r=document.createElement("span")).setAttribute("id",l),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,c,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch(e){return{width:0,height:0}}},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||n.m.isSsr)return{width:0,height:0};if(!s.enableCache)return f(e,t);var r=function(e,t){var r=t.fontSize||"",n=t.fontFamily||"",i=t.fontWeight||"",A=t.fontStyle||"",o=t.letterSpacing||"",a=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(A,"|").concat(o,"|").concat(a)}(e,t),i=u.get(r);if(i)return i;var A=f(e,t);return u.set(r,A),A}},72925(e,t,r){"use strict";function n(e){return null==e?void 0:e.id}r.d(t,{x:()=>n})},73102(e,t,r){"use strict";r.d(t,{x:()=>o,y:()=>A});var n=r(65307),i=r(33032),A=(0,n.VP)("externalEvent"),o=(0,n.Nc)(),a=new Map;o.startListening({actionCreator:A,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(null!=r){n.persist();var A=n.type,o=a.get(A);void 0!==o&&cancelAnimationFrame(o);var s=requestAnimationFrame(()=>{try{var e=t.getState(),o={activeCoordinate:(0,i.eE)(e),activeDataKey:(0,i.Xb)(e),activeIndex:(0,i.A2)(e),activeLabel:(0,i.BZ)(e),activeTooltipIndex:(0,i.A2)(e),isTooltipActive:(0,i.yn)(e)};r(o,n)}finally{a.delete(A)}});a.set(A,s)}}})},73404(e,t,r){"use strict";e.exports=r(3072)},73608(e,t,r){"use strict";var n;r.d(t,{A:()=>i}),function(e){e[e.ERROR_CORRECTION=0]="ERROR_CORRECTION",e[e.CHARACTER_SET=1]="CHARACTER_SET",e[e.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",e[e.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",e[e.MIN_SIZE=4]="MIN_SIZE",e[e.MAX_SIZE=5]="MAX_SIZE",e[e.MARGIN=6]="MARGIN",e[e.PDF417_COMPACT=7]="PDF417_COMPACT",e[e.PDF417_COMPACTION=8]="PDF417_COMPACTION",e[e.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",e[e.AZTEC_LAYERS=10]="AZTEC_LAYERS",e[e.QR_VERSION=11]="QR_VERSION",e[e.GS1_FORMAT=12]="GS1_FORMAT",e[e.FORCE_C40=13]="FORCE_C40"}(n||(n={}));const i=n},73753(e,t,r){"use strict";r.d(t,{A:()=>c});var n,i=r(49135),A=r(92679),o=r(36254),a=r(57149),s=r(76458),u=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const c=function(e){function t(t,r,n){var A=e.call(this)||this;A.primitive=t,A.size=r,A.generatorBase=n;for(var o=new Int32Array(r),a=1,s=0;s<r;s++)o[s]=a,(a*=2)>=r&&(a^=t,a&=r-1);A.expTable=o;var u=new Int32Array(r);for(s=0;s<r-1;s++)u[o[s]]=s;return A.logTable=u,A.zero=new i.A(A,Int32Array.from([0])),A.one=new i.A(A,Int32Array.from([1])),A}return u(t,e),t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,t){if(e<0)throw new a.A;if(0===t)return this.zero;var r=new Int32Array(e+1);return r[0]=t,new i.A(this,r)},t.prototype.inverse=function(e){if(0===e)throw new s.A;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return"GF(0x"+o.A.toHexString(this.primitive)+","+this.size+")"},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(A.A)},73872(e,t,r){"use strict";var n;r.d(t,{A:()=>i}),function(e){e[e.AZTEC=0]="AZTEC",e[e.CODABAR=1]="CODABAR",e[e.CODE_39=2]="CODE_39",e[e.CODE_93=3]="CODE_93",e[e.CODE_128=4]="CODE_128",e[e.DATA_MATRIX=5]="DATA_MATRIX",e[e.EAN_8=6]="EAN_8",e[e.EAN_13=7]="EAN_13",e[e.ITF=8]="ITF",e[e.MAXICODE=9]="MAXICODE",e[e.PDF_417=10]="PDF_417",e[e.QR_CODE=11]="QR_CODE",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(n||(n={}));const i=n},73923(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(29467);t.cloneDeep=function(e){return n.cloneDeepWith(e)}},74297(e,t,r){e.exports=r(25259).throttle},74333(e,t,r){"use strict";r.d(t,{f:()=>h});var n=r(59744),i=r(72747),A=r(59938);function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class a{static create(e){return new a(e)}constructor(e){this.scale=e}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(e){var{bandAware:t,position:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var n=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+n;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(e)+i}if(t){var A=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+A}return this.scale(e)}}isInRange(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}o(a,"EPS",1e-4);function s(e,t){if(t<1)return[];if(1===t)return e;for(var r=[],n=0;n<e.length;n+=t){var i=e[n];void 0!==i&&r.push(i)}return r}function u(e,t,r){return function(e){var{width:t,height:r}=e,n=function(e){return(e%180+180)%180}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),i=n*Math.PI/180,A=Math.atan(r/t),o=i>A&&i<Math.PI-A?r/Math.sin(i):t/Math.cos(i);return Math.abs(o)}({width:e.width+t.width,height:e.height+t.height},r)}function c(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var A=r();return e*(t-e*A/2-n)>=0&&e*(t+e*A/2-i)<=0}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){d(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e,t,r){var o,{tick:a,ticks:l,viewBox:d,minTickGap:h,orientation:p,interval:g,tickFormatter:y,unit:v,angle:m}=e;if(!l||!l.length||!a)return[];if((0,n.Et)(g)||A.m.isSsr)return null!==(o=function(e,t){return s(e,t+1)}(l,(0,n.Et)(g)?g:0))&&void 0!==o?o:[];var w=[],b="top"===p||"bottom"===p?"width":"height",B=v&&"width"===b?(0,i.Pu)(v,{fontSize:t,letterSpacing:r}):{width:0,height:0},C=(e,n)=>{var A="function"==typeof y?y(e.value,n):e.value;return"width"===b?u((0,i.Pu)(A,{fontSize:t,letterSpacing:r}),B,m):(0,i.Pu)(A,{fontSize:t,letterSpacing:r})[b]},E=l.length>=2?(0,n.sA)(l[1].coordinate-l[0].coordinate):1,S=function(e,t,r){var n="width"===r,{x:i,y:A,width:o,height:a}=e;return 1===t?{start:n?i:A,end:n?i+o:A+a}:{start:n?i+o:A+a,end:n?i:A}}(d,E,b);return"equidistantPreserveStart"===g?function(e,t,r,n,i){for(var A,o=(n||[]).slice(),{start:a,end:u}=t,l=0,f=1,d=a,h=function(){var t=null==n?void 0:n[l];if(void 0===t)return{v:s(n,f)};var A,o=l,h=()=>(void 0===A&&(A=r(t,o)),A),p=t.coordinate,g=0===l||c(e,p,h,d,u);g||(l=0,d=a,f+=1),g&&(d=p+e*(h()/2+i),l+=f)};f<=o.length;)if(A=h())return A.v;return[]}(E,S,C,l,h):"equidistantPreserveEnd"===g?function(e,t,r,n,i){var A=(n||[]).slice().length;if(0===A)return[];for(var{start:o,end:a}=t,s=1;s<=A;s++){for(var u=(A-1)%s,l=o,f=!0,d=function(){var t,A=n[h],o=h,s=()=>(void 0===t&&(t=r(A,o)),t),d=A.coordinate,p=h===u||c(e,d,s,l,a);if(!p)return f=!1,1;p&&(l=d+e*(s()/2+i))},h=u;h<A&&!d();h+=s);if(f){for(var p=[],g=u;g<A;g+=s)p.push(n[g]);return p}}return[]}(E,S,C,l,h):(w="preserveStart"===g||"preserveStartEnd"===g?function(e,t,r,n,i,A){var o=(n||[]).slice(),a=o.length,{start:s,end:u}=t;if(A){var l=n[a-1],d=r(l,a-1),h=e*(l.coordinate+e*d/2-u);o[a-1]=l=f(f({},l),{},{tickCoord:h>0?l.coordinate-h*e:l.coordinate}),null!=l.tickCoord&&c(e,l.tickCoord,()=>d,s,u)&&(u=l.tickCoord-e*(d/2+i),o[a-1]=f(f({},l),{},{isShow:!0}))}for(var p=A?a-1:a,g=function(t){var n,A=o[t],a=()=>(void 0===n&&(n=r(A,t)),n);if(0===t){var l=e*(A.coordinate-e*a()/2-s);o[t]=A=f(f({},A),{},{tickCoord:l<0?A.coordinate-l*e:A.coordinate})}else o[t]=A=f(f({},A),{},{tickCoord:A.coordinate});null!=A.tickCoord&&c(e,A.tickCoord,a,s,u)&&(s=A.tickCoord+e*(a()/2+i),o[t]=f(f({},A),{},{isShow:!0}))},y=0;y<p;y++)g(y);return o}(E,S,C,l,h,"preserveStartEnd"===g):function(e,t,r,n,i){for(var A=(n||[]).slice(),o=A.length,{start:a}=t,{end:s}=t,u=function(t){var n,u=A[t],l=()=>(void 0===n&&(n=r(u,t)),n);if(t===o-1){var d=e*(u.coordinate+e*l()/2-s);A[t]=u=f(f({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate})}else A[t]=u=f(f({},u),{},{tickCoord:u.coordinate});null!=u.tickCoord&&c(e,u.tickCoord,l,a,s)&&(s=u.tickCoord-e*(l()/2+i),A[t]=f(f({},u),{},{isShow:!0}))},l=o-1;l>=0;l--)u(l);return A}(E,S,C,l,h),w.filter(e=>e.isShow))}},74354(e,t,r){"use strict";r.d(t,{$:()=>i,X:()=>A});var n=r(96540),i=(0,n.createContext)(null),A=()=>(0,n.useContext)(i)},74531(e,t,r){"use strict";r.d(t,{E1:()=>m,En:()=>b,Ix:()=>u,ML:()=>g,Nt:()=>y,RD:()=>d,UF:()=>f,XB:()=>l,Zp:()=>c,jF:()=>v,k_:()=>o,o4:()=>w,oP:()=>h,xS:()=>p});var n=r(65307),i=r(12064),A=r(1932),o={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},a={itemInteraction:{click:o,hover:o},axisInteraction:{click:o,hover:o},keyboardInteraction:o,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},s=(0,n.Z0)({name:"tooltip",initialState:a,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push((0,A.h4)(t.payload))},prepare:(0,n.aA)()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,o=(0,i.ss)(e).tooltipItemPayloads.indexOf((0,A.h4)(r));o>-1&&(e.tooltipItemPayloads[o]=(0,A.h4)(n))},prepare:(0,n.aA)()},removeTooltipEntrySettings:{reducer(e,t){var r=(0,i.ss)(e).tooltipItemPayloads.indexOf((0,A.h4)(t.payload));r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:(0,n.aA)()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:u,replaceTooltipEntrySettings:c,removeTooltipEntrySettings:l,setTooltipSettingsState:f,setActiveMouseOverItemIndex:d,mouseLeaveItem:h,mouseLeaveChart:p,setActiveClickItemIndex:g,setMouseOverAxisIndex:y,setMouseClickAxisIndex:v,setSyncInteraction:m,setKeyboardInteraction:w}=s.actions,b=s.reducer},74544(e,t,r){"use strict";r.d(t,{P:()=>a});var n=r(8813),i=r(26470),A=r(93749);function o(e,t){var r=function(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}(e),n=t[0],i=t[1];if(void 0===r)return!1;var A=Math.min(n,i),o=Math.max(n,i);return r>=A&&r<=o}var a=(e,t,r,a)=>{var s=null==e?void 0:e.index;if(null==s)return null;var u=Number(s);if(!(0,n.H)(u))return s;var c=1/0;t.length>0&&(c=t.length-1);var l=Math.max(0,Math.min(u,c)),f=t[l];return null==f||function(e,t,r){if(null==r||null==t)return!0;var n=(0,i.kr)(e,t);return null==n||!(0,A.JH)(r)||o(n,r)}(f,r,a)?String(l):null}},74848(e,t,r){"use strict";e.exports=r(21020)},75359(e,t,r){"use strict";r.d(t,{A:()=>o});var n,i=r(44388),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const o=function(e){function t(t){var r=e.call(this,t.getWidth(),t.getHeight())||this;return r.delegate=t,r}return A(t,e),t.prototype.getRow=function(e,t){for(var r=this.delegate.getRow(e,t),n=this.getWidth(),i=0;i<n;i++)r[i]=255-(255&r[i]);return r},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(t),n=0;n<t;n++)r[n]=255-(255&e[n]);return r},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,r,n,i){return new t(this.delegate.crop(e,r,n,i))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(i.A)},75403(e,t,r){"use strict";r.d(t,{E:()=>i});var n=r(59744),i=(e,t)=>{var r,i=Number(t);if(!(0,n.M8)(i)&&null!=t)return i>=0?null==e||null===(r=e[i])||void 0===r?void 0:r.value:void 0}},75548(e,t,r){"use strict";r.d(t,{r:()=>C});var n=r(96540),i=r(26960),A=r(5508),o=r(67965),a=r(2613),s=r(69264),u=r(49082),c=r(19794);function l(e){var t=(0,u.j)();return(0,n.useEffect)(()=>{t((0,c.U)(e))},[t,e]),null}var f=r(68132),d=r(77404),h=["layout"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(null,arguments)}var g={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},y=(0,n.forwardRef)(function(e,t){var r,i=(0,d.e)(e.categoricalChartProps,g),{layout:u}=i,c=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(i,h),{chartName:y,defaultTooltipEventType:v,validateTooltipEventTypes:m,tooltipPayloadSearcher:w}=e,b={chartName:y,defaultTooltipEventType:v,validateTooltipEventTypes:m,tooltipPayloadSearcher:w,eventEmitter:void 0};return n.createElement(A.J,{preloadedState:{options:b},reduxStoreName:null!==(r=i.id)&&void 0!==r?r:y},n.createElement(o.TK,{chartData:i.data}),n.createElement(a.s,{layout:u,margin:i.margin}),n.createElement(s.p,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),n.createElement(l,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),n.createElement(f.L,p({},c,{ref:t})))});function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){w(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function w(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=["item"],B=m(m({},g),{},{layout:"centric",startAngle:0,endAngle:360}),C=(0,n.forwardRef)((e,t)=>{var r=(0,d.e)(e,B);return n.createElement(y,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:b,tooltipPayloadSearcher:i.uN,categoricalChartProps:r,ref:t})})},75711(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.flatten=function(e,t=1){const r=[],n=Math.floor(t),i=(e,t)=>{for(let A=0;A<e.length;A++){const o=e[A];Array.isArray(o)&&t<n?i(o,t+1):r.push(o)}};return i(e,0),r}},76031(e,t,r){"use strict";r(15575),r(24599)},76270(e,t,r){"use strict";r.d(t,{EI:()=>l,oM:()=>c});var n=r(49082),i=r(33032),A=r(25508),o=r(36189),a=(0,A.Mz)([o.HZ],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),s=r(5180),u=(0,A.Mz)([a,s.Lp,s.A$],(e,t,r)=>{if(e&&null!=t&&null!=r)return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),c=()=>(0,n.G)(u),l=()=>(0,n.G)(i.JG)},76314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=e(t);return t[2]?"@media ".concat(t[2]," {").concat(r,"}"):r}).join("")},t.i=function(e,r,n){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(n)for(var A=0;A<this.length;A++){var o=this[A][0];null!=o&&(i[o]=!0)}for(var a=0;a<e.length;a++){var s=[].concat(e[a]);n&&i[s[0]]||(r&&(s[2]?s[2]="".concat(r," and ").concat(s[2]):s[2]=r),t.push(s))}},t}},76458(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="ArithmeticException",t}(i.A);const a=o},76461(e,t,r){"use strict";r.d(t,{C:()=>a,U:()=>s});var n=r(25508),i=r(36189),A=r(5180),o=r(59744),a=e=>e.brush,s=(0,n.Mz)([a,i.HZ,A.HK],(e,t,r)=>({height:e.height,x:(0,o.Et)(e.x)?e.x:t.left,y:(0,o.Et)(e.y)?e.y:t.top+t.height+t.brushBottom-((null==r?void 0:r.bottom)||0),width:(0,o.Et)(e.width)?e.width:t.width}))},76773(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.debounce=function(e,t,{signal:r,edges:n}={}){let i,A=null;const o=null!=n&&n.includes("leading"),a=null==n||n.includes("trailing"),s=()=>{null!==A&&(e.apply(i,A),i=void 0,A=null)};let u=null;const c=()=>{null!=u&&clearTimeout(u),u=setTimeout(()=>{u=null,a&&s(),l()},t)},l=()=>{null!==u&&(clearTimeout(u),u=null),i=void 0,A=null},f=function(...e){if(r?.aborted)return;i=this,A=e;const t=null==u;c(),o&&t&&s()};return f.schedule=c,f.cancel=l,f.flush=()=>{s()},r?.addEventListener("abort",l,{once:!0}),f}},77232(e,t,r){"use strict";r.d(t,{$7:()=>l,Ru:()=>c,uZ:()=>u});var n=r(65307),i=r(74531),A=r(33032),o=r(49259),a=r(91572),s=r(74544),u=(0,n.VP)("keyDown"),c=(0,n.VP)("focus"),l=(0,n.Nc)();l.startListening({actionCreator:u,effect:(e,t)=>{var r=t.getState();if(!1!==r.rootProps.accessibilityLayer){var{keyboardInteraction:n}=r.tooltip,u=e.payload;if("ArrowRight"===u||"ArrowLeft"===u||"Enter"===u){var c=(0,s.P)(n,(0,A.n4)(r),(0,a.K6)(r),(0,A.FO)(r)),l=null==c?-1:Number(c);if(Number.isFinite(l)&&!(l<0)){var f=(0,A.R4)(r);if("Enter"!==u){var d=l+("ArrowRight"===u?1:-1)*("left-to-right"===(0,a._y)(r)?1:-1);if(!(null==f||d>=f.length||d<0)){var h=(0,o.pg)(r,"axis","hover",String(d));t.dispatch((0,i.o4)({active:!0,activeIndex:d.toString(),activeCoordinate:h}))}}else{var p=(0,o.pg)(r,"axis","hover",String(n.index));t.dispatch((0,i.o4)({active:!n.active,activeIndex:n.index,activeCoordinate:p}))}}}}}}),l.startListening({actionCreator:c,effect:(e,t)=>{var r=t.getState();if(!1!==r.rootProps.accessibilityLayer){var{keyboardInteraction:n}=r.tooltip;if(!n.active&&null==n.index){var A=(0,o.pg)(r,"axis","hover",String("0"));t.dispatch((0,i.o4)({active:!0,activeIndex:"0",activeCoordinate:A}))}}}})},77247(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="ReaderException",t}(i.A);const a=o},77404(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A(e,t){var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e),A=t;return Object.keys(t).reduce((e,t)=>(void 0===e[t]&&void 0!==A[t]&&(e[t]=A[t]),e),r)}r.d(t,{e:()=>A})},77612(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(80442);const i=function(){function e(e,t,r){this.codewords=e,this.numcols=t,this.numrows=r,this.bits=new Uint8Array(t*r),n.A.fill(this.bits,2)}return e.prototype.getNumrows=function(){return this.numrows},e.prototype.getNumcols=function(){return this.numcols},e.prototype.getBits=function(){return this.bits},e.prototype.getBit=function(e,t){return 1===this.bits[t*this.numcols+e]},e.prototype.setBit=function(e,t,r){this.bits[t*this.numcols+e]=r?1:0},e.prototype.noBit=function(e,t){return 2===this.bits[t*this.numcols+e]},e.prototype.place=function(){var e=0,t=4,r=0;do{t===this.numrows&&0===r&&this.corner1(e++),t===this.numrows-2&&0===r&&this.numcols%4!=0&&this.corner2(e++),t===this.numrows-2&&0===r&&this.numcols%8==4&&this.corner3(e++),t===this.numrows+4&&2===r&&this.numcols%8==0&&this.corner4(e++);do{t<this.numrows&&r>=0&&this.noBit(r,t)&&this.utah(t,r,e++),t-=2,r+=2}while(t>=0&&r<this.numcols);t++,r+=3;do{t>=0&&r<this.numcols&&this.noBit(r,t)&&this.utah(t,r,e++),t+=2,r-=2}while(t<this.numrows&&r>=0);t+=3,r++}while(t<this.numrows||r<this.numcols);this.noBit(this.numcols-1,this.numrows-1)&&(this.setBit(this.numcols-1,this.numrows-1,!0),this.setBit(this.numcols-2,this.numrows-2,!0))},e.prototype.module=function(e,t,r,n){e<0&&(e+=this.numrows,t+=4-(this.numrows+4)%8),t<0&&(t+=this.numcols,e+=4-(this.numcols+4)%8);var i=this.codewords.charCodeAt(r);i&=1<<8-n,this.setBit(t,e,0!==i)},e.prototype.utah=function(e,t,r){this.module(e-2,t-2,r,1),this.module(e-2,t-1,r,2),this.module(e-1,t-2,r,3),this.module(e-1,t-1,r,4),this.module(e-1,t,r,5),this.module(e,t-2,r,6),this.module(e,t-1,r,7),this.module(e,t,r,8)},e.prototype.corner1=function(e){this.module(this.numrows-1,0,e,1),this.module(this.numrows-1,1,e,2),this.module(this.numrows-1,2,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-1,e,6),this.module(2,this.numcols-1,e,7),this.module(3,this.numcols-1,e,8)},e.prototype.corner2=function(e){this.module(this.numrows-3,0,e,1),this.module(this.numrows-2,0,e,2),this.module(this.numrows-1,0,e,3),this.module(0,this.numcols-4,e,4),this.module(0,this.numcols-3,e,5),this.module(0,this.numcols-2,e,6),this.module(0,this.numcols-1,e,7),this.module(1,this.numcols-1,e,8)},e.prototype.corner3=function(e){this.module(this.numrows-3,0,e,1),this.module(this.numrows-2,0,e,2),this.module(this.numrows-1,0,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-1,e,6),this.module(2,this.numcols-1,e,7),this.module(3,this.numcols-1,e,8)},e.prototype.corner4=function(e){this.module(this.numrows-1,0,e,1),this.module(this.numrows-1,this.numcols-1,e,2),this.module(0,this.numcols-3,e,3),this.module(0,this.numcols-2,e,4),this.module(0,this.numcols-1,e,5),this.module(1,this.numcols-3,e,6),this.module(1,this.numcols-2,e,7),this.module(1,this.numcols-1,e,8)},e}()},77984(e,t,r){"use strict";r.d(t,{W:()=>b});var n=r(96540),i=r(34164),A=r(30131),o=r(49082),a=r(94115),s=r(91572),u=r(36189),c=r(12070),l=r(77404),f=r(11718),d=["dangerouslySetInnerHTML","ticks","scale"],h=["id","scale"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p.apply(null,arguments)}function g(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function y(e){var t=(0,o.j)(),r=(0,n.useRef)(null);return(0,n.useLayoutEffect)(()=>{null===r.current?t((0,a.Vi)(e)):r.current!==e&&t((0,a.m2)({prev:r.current,next:e})),r.current=e},[e,t]),(0,n.useLayoutEffect)(()=>()=>{r.current&&(t((0,a.MC)(r.current)),r.current=null)},[t]),null}var v=e=>{var{xAxisId:t,className:r}=e,a=(0,o.G)(u.c2),l=(0,c.r)(),f="xAxis",y=(0,o.G)(e=>(0,s.Zi)(e,f,t,l)),v=(0,o.G)(e=>(0,s.Lw)(e,t)),m=(0,o.G)(e=>(0,s.L$)(e,t)),w=(0,o.G)(e=>(0,s.y7)(e,t));if(null==v||null==m||null==w)return null;var{dangerouslySetInnerHTML:b,ticks:B,scale:C}=e,E=g(e,d),{id:S,scale:I}=w,O=g(w,h);return n.createElement(A.u,p({},E,O,{x:m.x,y:m.y,width:v.width,height:v.height,className:(0,i.$)("recharts-".concat(f," ").concat(f),r),viewBox:a,ticks:y,axisType:f}))},m={allowDataOverflow:s.PU.allowDataOverflow,allowDecimals:s.PU.allowDecimals,allowDuplicatedCategory:s.PU.allowDuplicatedCategory,angle:s.PU.angle,axisLine:A.F.axisLine,height:s.PU.height,hide:!1,includeHidden:s.PU.includeHidden,interval:s.PU.interval,minTickGap:s.PU.minTickGap,mirror:s.PU.mirror,orientation:s.PU.orientation,padding:s.PU.padding,reversed:s.PU.reversed,scale:s.PU.scale,tick:s.PU.tick,tickCount:s.PU.tickCount,tickLine:A.F.tickLine,tickSize:A.F.tickSize,type:s.PU.type,xAxisId:0},w=e=>{var t=(0,l.e)(e,m);return n.createElement(n.Fragment,null,n.createElement(y,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),n.createElement(v,t))},b=n.memo(w,f.Q);b.displayName="XAxis"},78161(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(80058),i=r(1846);t.isArrayLikeObject=function(e){return i.isObjectLike(e)&&n.isArrayLike(e)}},78350(e,t,r){"use strict";var n=r(46518),i=r(70259),A=r(79306),o=r(48981),a=r(26198),s=r(1469);n({target:"Array",proto:!0},{flatMap:function(e){var t,r=o(this),n=a(r);return A(e),t=s(r,0),i(t,r,r,n,0,1,e,arguments.length>1?arguments[1]:void 0),t}})},78418(e,t,r){"use strict";r(85160)},78459(e,t,r){"use strict";var n=r(46518),i=r(33904);n({global:!0,forced:parseFloat!==i},{parseFloat:i})},79195(e,t,r){"use strict";function n(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}r.d(t,{v:()=>n})},79432(e,t,r){"use strict";var n=r(46518),i=r(48981),A=r(71072);n({target:"Object",stat:!0,forced:r(79039)(function(){A(1)})},{keys:function(e){return A(i(e))}})},79472(e,t,r){"use strict";var n,i=r(44576),A=r(18745),o=r(94901),a=r(84215),s=r(82839),u=r(67680),c=r(22812),l=i.Function,f=/MSIE .\./.test(s)||"BUN"===a&&((n=i.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));e.exports=function(e,t){var r=t?2:1;return f?function(n,i){var a=c(arguments.length,1)>r,s=o(n)?n:l(n),f=a?u(arguments,r):[],d=a?function(){A(s,this,f)}:s;return t?e(d,i):e(d)}:e}},79757(e,t,r){"use strict";r.d(t,{X:()=>a,k:()=>s});var n=r(24880),i=r(26261),A=r(58904),o=r(71692),a=class extends o.k{#X;#Y;#Z;#p;#L;#o;#q;constructor(e){super(),this.#q=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#p=e.client,this.#Z=this.#p.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#X=c(this.options),this.state=e.state??this.#X,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#L?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=c(this.options);void 0!==e.data&&(this.setState(u(e.data,e.dataUpdatedAt)),this.#X=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#Z.remove(this)}setData(e,t){const r=(0,n.pl)(this.state.data,e,this.options);return this.#H({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#H({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#L?.promise;return this.#L?.cancel(e),t?t.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#X)}isActive(){return this.observers.some(e=>!1!==(0,n.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,n.d2)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,n.j3)(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#L?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#L?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#Z.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#L&&(this.#q?this.#L.cancel({revert:!0}):this.#L.cancelRetry()),this.scheduleGc()),this.#Z.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#H({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#L?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#L)return this.#L.continueRetry(),this.#L.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#q=!0,r.signal)})},o=()=>{const e=(0,n.ZM)(this.options,t),r=(()=>{const e={client:this.#p,queryKey:this.queryKey,meta:this.meta};return i(e),e})();return this.#q=!1,this.options.persister?this.options.persister(e,r,this):e(r)},a=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#p,state:this.state,fetchFn:o};return i(e),e})();this.options.behavior?.onFetch(a,this),this.#Y=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===a.fetchOptions?.meta||this.#H({type:"fetch",meta:a.fetchOptions?.meta}),this.#L=(0,A.II)({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof A.cc&&e.revert&&this.setState({...this.#Y,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#H({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#H({type:"pause"})},onContinue:()=>{this.#H({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const e=await this.#L.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#Z.config.onSuccess?.(e,this),this.#Z.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof A.cc){if(e.silent)return this.#L.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#H({type:"error",error:e}),this.#Z.config.onError?.(e,this),this.#Z.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#H(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...s(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...u(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#Y=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.jG.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#Z.notify({query:this,type:"updated",action:e})})}};function s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,A.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function u(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},79799(e,t,r){"use strict";r.d(t,{s:()=>A});var n=r(1081),i=r.n(n);function A(e,t,r){return!0===t?i()(e,r):"function"==typeof t?i()(e,t):e}},79801(e,t,r){"use strict";r.d(t,{y:()=>c});var n,i=r(54951),A=r(88468),o=r(36775),a=r(89194),s=r(44487),u=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.getEncodingMode=function(){return s.VK},t.prototype.encode=function(e){for(var t=new A.A;e.hasMoreCharacters();){var r=e.getCurrentChar();if(e.pos++,this.encodeChar(r,t),t.length()%3==0)if(this.writeNextTriplet(e,t),a.A.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(s.d2);break}}this.handleEOD(e,t)},t.prototype.encodeChar=function(e,t){switch(e){case 13:t.append(0);break;case"*".charCodeAt(0):t.append(1);break;case">".charCodeAt(0):t.append(2);break;case" ".charCodeAt(0):t.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?t.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?t.append(e-65+14):a.A.illegalCharacter(i.A.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,t){e.updateSymbolInfo();var r=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),n=t.length();e.pos-=n,(e.getRemainingCharacters()>1||r>1||e.getRemainingCharacters()!==r)&&e.writeCodeword(s.OM),e.getNewEncoding()<0&&e.signalEncoderChange(s.d2)},t}(o.S)},79874(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="IndexOutOfBoundsException",t}(i.A);const a=o},79926(e,t,r){"use strict";r.d(t,{E:()=>n});var n=(e,t,r)=>r},80058(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(59181);t.isArrayLike=function(e){return null!=e&&"function"!=typeof e&&n.isLength(e.length)}},80196(e,t,r){"use strict";r.d(t,{a:()=>o,y:()=>a});var n=r(96540),i=r(28129),A=r(55448);function o(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&((0,A.Rw)(r)||(0,A.Xc)(r)||(0,i.q)(r))&&(t[r]=e[r]);return t}function a(e){return null==e?null:(0,n.isValidElement)(e)?o(e.props):"object"!=typeof e||Array.isArray(e)?null:o(e)}},80305(e,t,r){e.exports=r(54200).get},80386(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return e.prototype.getSegmentIndex=function(){return this.segmentIndex},e.prototype.setSegmentIndex=function(e){this.segmentIndex=e},e.prototype.getFileId=function(){return this.fileId},e.prototype.setFileId=function(e){this.fileId=e},e.prototype.getOptionalData=function(){return this.optionalData},e.prototype.setOptionalData=function(e){this.optionalData=e},e.prototype.isLastSegment=function(){return this.lastSegment},e.prototype.setLastSegment=function(e){this.lastSegment=e},e.prototype.getSegmentCount=function(){return this.segmentCount},e.prototype.setSegmentCount=function(e){this.segmentCount=e},e.prototype.getSender=function(){return this.sender||null},e.prototype.setSender=function(e){this.sender=e},e.prototype.getAddressee=function(){return this.addressee||null},e.prototype.setAddressee=function(e){this.addressee=e},e.prototype.getFileName=function(){return this.fileName},e.prototype.setFileName=function(e){this.fileName=e},e.prototype.getFileSize=function(){return this.fileSize},e.prototype.setFileSize=function(e){this.fileSize=e},e.prototype.getChecksum=function(){return this.checksum},e.prototype.setChecksum=function(e){this.checksum=e},e.prototype.getTimestamp=function(){return this.timestamp},e.prototype.setTimestamp=function(e){this.timestamp=e},e}()},80442(e,t,r){"use strict";r.d(t,{A:()=>l});var n,i=r(92819),A=r(57149),o=r(79874),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const s=function(e){function t(t,r){void 0===t&&(t=void 0),void 0===r&&(r=void 0);var n=e.call(this,r)||this;return n.index=t,n.message=r,n}return a(t,e),t.kind="ArrayIndexOutOfBoundsException",t}(o.A);var u=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c=function(){function e(){}return e.fill=function(e,t){for(var r=0,n=e.length;r<n;r++)e[r]=t},e.fillWithin=function(t,r,n,i){e.rangeCheck(t.length,r,n);for(var A=r;A<n;A++)t[A]=i},e.rangeCheck=function(e,t,r){if(t>r)throw new A.A("fromIndex("+t+") > toIndex("+r+")");if(t<0)throw new s(t);if(r>e)throw new s(r)},e.asList=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},e.create=function(e,t,r){return Array.from({length:e}).map(function(e){return Array.from({length:t}).fill(r)})},e.createInt32Array=function(e,t,r){return Array.from({length:e}).map(function(e){return Int32Array.from({length:t}).fill(r)})},e.equals=function(e,t){if(!e)return!1;if(!t)return!1;if(!e.length)return!1;if(!t.length)return!1;if(e.length!==t.length)return!1;for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0},e.hashCode=function(e){var t,r;if(null===e)return 0;var n=1;try{for(var i=u(e),A=i.next();!A.done;A=i.next()){n=31*n+A.value}}catch(e){t={error:e}}finally{try{A&&!A.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n},e.fillUint8Array=function(e,t){for(var r=0;r!==e.length;r++)e[r]=t},e.copyOf=function(e,t){return e.slice(0,t)},e.copyOfUint8Array=function(e,t){if(e.length<=t){var r=new Uint8Array(t);return r.set(e),r}return e.slice(0,t)},e.copyOfRange=function(e,t,r){var n=r-t,A=new Int32Array(n);return i.A.arraycopy(e,t,A,0,n),A},e.binarySearch=function(t,r,n){void 0===n&&(n=e.numberComparator);for(var i=0,A=t.length-1;i<=A;){var o=A+i>>1,a=n(r,t[o]);if(a>0)i=o+1;else{if(!(a<0))return o;A=o-1}}return-i-1},e.numberComparator=function(e,t){return e-t},e}();const l=c},80550(e,t,r){"use strict";var n=r(44576);e.exports=n.Promise},80926(e,t,r){"use strict";var n=r(79306),i=r(48981),A=r(47055),o=r(26198),a=TypeError,s="Reduce of empty array with no initial value",u=function(e){return function(t,r,u,c){var l=i(t),f=A(l),d=o(l);if(n(r),0===d&&u<2)throw new a(s);var h=e?d-1:0,p=e?-1:1;if(u<2)for(;;){if(h in f){c=f[h],h+=p;break}if(h+=p,e?h<0:d<=h)throw new a(s)}for(;e?h>=0:d>h;h+=p)h in f&&(c=r(c,f[h],h,l));return c}};e.exports={left:u(!1),right:u(!0)}},81062(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(98517);const i=function(){function e(){}return e.ISO_8859_1=n.A.ISO8859_1,e}()},81174(e,t,r){"use strict";r.d(t,{EY:()=>L,fU:()=>Q});var n=r(96540),i=r(34164),A=r(59744),o=r(59938),a=r(72747);var s=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,u=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,c=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,l=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,f={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},d=["cm","mm","pt","pc","in","Q","px"];var h,p,g,y="NaN";class v{static parse(e){var t,[,r,n]=null!==(t=l.exec(e))&&void 0!==t?t:[];return null==r?v.NaN:new v(parseFloat(r),null!=n?n:"")}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,(0,A.M8)(e)&&(this.unit=""),""===t||c.test(t)||(this.num=NaN,this.unit=""),function(e){return d.includes(e)}(t)&&(this.num=function(e,t){return e*f[t]}(e,t),this.unit="px")}add(e){return this.unit!==e.unit?new v(NaN,""):new v(this.num+e.num,this.unit)}subtract(e){return this.unit!==e.unit?new v(NaN,""):new v(this.num-e.num,this.unit)}multiply(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new v(NaN,""):new v(this.num*e.num,this.unit||e.unit)}divide(e){return""!==this.unit&&""!==e.unit&&this.unit!==e.unit?new v(NaN,""):new v(this.num/e.num,this.unit||e.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return(0,A.M8)(this.num)}}function m(e){if(null==e||e.includes(y))return y;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,A]=null!==(r=s.exec(t))&&void 0!==r?r:[],o=v.parse(null!=n?n:""),a=v.parse(null!=A?A:""),c="*"===i?o.multiply(a):o.divide(a);if(c.isNaN())return y;t=t.replace(s,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var l,[,f,d,h]=null!==(l=u.exec(t))&&void 0!==l?l:[],p=v.parse(null!=f?f:""),g=v.parse(null!=h?h:""),m="+"===d?p.add(g):p.subtract(g);if(m.isNaN())return y;t=t.replace(u,m.toString())}return t}h=v,p="NaN",g=new v(NaN,""),(p=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(p))in h?Object.defineProperty(h,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):h[p]=g;var w=/\(([^()]*)\)/;function b(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t,r=e;null!=(t=w.exec(r));){var[,n]=t;r=r.replace(w,m(n))}return r}(t),t=m(t)}function B(e){var t=function(e){try{return b(e)}catch(e){return y}}(e.slice(5,-1));return t===y?"":t}var C=r(80196),E=r(77404),S=r(8813),I=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],O=["dx","dy","angle","className","breakAll"];function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},F.apply(null,arguments)}function _(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var x=/[ \f\n\r\t\v\u2028\u2029]+/,U=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];return(0,A.uy)(t)||(i=r?t.toString().split(""):t.toString().split(x)),{wordsWithComputedWidth:i.map(e=>({word:e,width:(0,a.Pu)(e,n).width})),spaceWidth:r?0:(0,a.Pu)(" ",n).width}}catch(e){return null}};function Q(e){return"start"===e||"middle"===e||"end"===e||"inherit"===e}var T=(e,t,r,n)=>e.reduce((e,i)=>{var{word:A,width:o}=i,a=e[e.length-1];if(a&&null!=o&&(null==t||n||a.width+o+r<Number(t)))a.words.push(A),a.width+=o+r;else{var s={words:[A],width:o};e.push(s)}return e},[]),M=e=>e.reduce((e,t)=>e.width>t.width?e:t),P=(e,t,r,n,i,A,o,a)=>{var s=e.slice(0,t),u=U({breakAll:r,style:n,children:s+"…"});if(!u)return[!1,[]];var c=T(u.wordsWithComputedWidth,A,o,a);return[c.length>i||M(c).width>Number(A),c]},D=e=>[{words:(0,A.uy)(e)?[]:e.toString().split(x),width:void 0}],k=e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:s}=e;if((t||r)&&!o.m.isSsr){var u=U({breakAll:a,children:n,style:i});if(!u)return D(n);var{wordsWithComputedWidth:c,spaceWidth:l}=u;return((e,t,r,n,i)=>{var{maxLines:o,children:a,style:s,breakAll:u}=e,c=(0,A.Et)(o),l=String(a),f=T(t,n,r,i);if(!c||i)return f;if(!(f.length>o||M(f).width>Number(n)))return f;for(var d,h=0,p=l.length-1,g=0;h<=p&&g<=l.length-1;){var y=Math.floor((h+p)/2),v=y-1,[m,w]=P(l,v,u,s,o,n,r,i),[b]=P(l,y,u,s,o,n,r,i);if(m||b||(h=y+1),m&&b&&(p=y-1),!m&&b){d=w;break}g++}return d||f})({breakAll:a,children:n,maxLines:s,style:i},c,l,t,Boolean(r))}return D(n)},N="#808080",R={angle:0,breakAll:!1,capHeight:"0.71em",fill:N,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},L=(0,n.forwardRef)((e,t)=>{var r=(0,E.e)(e,R),{x:o,y:a,lineHeight:s,capHeight:u,fill:c,scaleToFit:l,textAnchor:f,verticalAnchor:d}=r,h=_(r,I),p=(0,n.useMemo)(()=>k({breakAll:h.breakAll,children:h.children,maxLines:h.maxLines,scaleToFit:l,style:h.style,width:h.width}),[h.breakAll,h.children,h.maxLines,l,h.style,h.width]),{dx:g,dy:y,angle:v,className:m,breakAll:w}=h,b=_(h,O);if(!(0,A.vh)(o)||!(0,A.vh)(a)||0===p.length)return null;var x,U=Number(o)+((0,A.Et)(g)?g:0),Q=Number(a)+((0,A.Et)(y)?y:0);if(!(0,S.H)(U)||!(0,S.H)(Q))return null;switch(d){case"start":x=B("calc(".concat(u,")"));break;case"middle":x=B("calc(".concat((p.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:x=B("calc(".concat(p.length-1," * -").concat(s,")"))}var T=[];if(l){var M=p[0].width,{width:P}=h;T.push("scale(".concat((0,A.Et)(P)&&(0,A.Et)(M)?P/M:1,")"))}return v&&T.push("rotate(".concat(v,", ").concat(U,", ").concat(Q,")")),T.length&&(b.transform=T.join(" ")),n.createElement("text",F({},(0,C.a)(b),{ref:t,x:U,y:Q,className:(0,i.$)("recharts-text",m),textAnchor:f,fill:c.includes("url")?N:c}),p.map((e,t)=>{var r=e.words.join(w?"":" ");return n.createElement("tspan",{x:U,dy:0===t?x:s,key:"".concat(r,"-").concat(t)},r)}))});L.displayName="Text"},81278(e,t,r){"use strict";var n=r(46518),i=r(43724),A=r(35031),o=r(25397),a=r(77347),s=r(97040);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),i=a.f,u=A(n),c={},l=0;u.length>l;)void 0!==(r=i(n,t=u[l++]))&&s(c,t,r);return c}})},81488(e,t,r){"use strict";r.d(t,{A:()=>b});var n=r(73872),i=r(28823),A=r(58503),o=r(7758),a=r(92819),s=r(91110),u=r(10652),c=r(36157),l=r(64994),f=r(26741);const d=function(){function e(){}return e.buildBitArray=function(e){var t=2*e.length-1;null==e[e.length-1].getRightChar()&&(t-=1);for(var r=12*t,n=new f.A(r),i=0,A=e[0].getRightChar().getValue(),o=11;o>=0;--o)A&1<<o&&n.set(i),i++;for(o=1;o<e.length;++o){for(var a=e[o],s=a.getLeftChar().getValue(),u=11;u>=0;--u)s&1<<u&&n.set(i),i++;if(null!==a.getRightChar()){var c=a.getRightChar().getValue();for(u=11;u>=0;--u)c&1<<u&&n.set(i),i++}}return n},e}();var h=r(60196);const p=function(){function e(e,t,r,n){this.leftchar=e,this.rightchar=t,this.finderpattern=r,this.maybeLast=n}return e.prototype.mayBeLast=function(){return this.maybeLast},e.prototype.getLeftChar=function(){return this.leftchar},e.prototype.getRightChar=function(){return this.rightchar},e.prototype.getFinderPattern=function(){return this.finderpattern},e.prototype.mustBeLast=function(){return null==this.rightchar},e.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},e.equals=function(t,r){return t instanceof e&&(e.equalsOrNull(t.leftchar,r.leftchar)&&e.equalsOrNull(t.rightchar,r.rightchar)&&e.equalsOrNull(t.finderpattern,r.finderpattern))},e.equalsOrNull=function(t,r){return null===t?null===r:e.equals(t,r)},e.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},e}();const g=function(){function e(e,t,r){this.pairs=e,this.rowNumber=t,this.wasReversed=r}return e.prototype.getPairs=function(){return this.pairs},e.prototype.getRowNumber=function(){return this.rowNumber},e.prototype.isReversed=function(){return this.wasReversed},e.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},e.prototype.toString=function(){return"{ "+this.pairs+" }"},e.prototype.equals=function(t,r){return t instanceof e&&(this.checkEqualitity(t,r)&&t.wasReversed===r.wasReversed)},e.prototype.checkEqualitity=function(e,t){var r;if(e&&t)return e.forEach(function(e,n){t.forEach(function(t){e.getLeftChar().getValue()===t.getLeftChar().getValue()&&e.getRightChar().getValue()===t.getRightChar().getValue()&&e.getFinderPatter().getValue()===t.getFinderPatter().getValue()&&(r=!0)})}),r},e}();var y,v=(y=function(e,t){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},y(e,t)},function(e,t){function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),m=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},w=function(e){function t(){var r=null!==e&&e.apply(this,arguments)||this;return r.pairs=new Array(t.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return v(t,e),t.prototype.decodeRow=function(e,r,n){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,r))}catch(e){}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,r))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,t){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(t,this.pairs,e))}catch(e){if(e instanceof A.A){if(!this.pairs.length)throw new A.A;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(e,!1),r){var i=this.checkRowsBoolean(!1);if(null!=i)return i;if(null!=(i=this.checkRowsBoolean(!0)))return i}throw new A.A},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var t=null;try{t=this.checkRows(new Array,0)}catch(e){console.log(e)}return e&&(this.rows=this.rows.reverse()),t},t.prototype.checkRows=function(e,r){for(var n,i,o=r;o<this.rows.length;o++){var a=this.rows[o];this.pairs.length=0;try{for(var s=(n=void 0,m(e)),u=s.next();!u.done;u=s.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),t.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var l=new Array(e);l.push(a);try{return this.checkRows(l,o+1)}catch(e){console.log(e)}}}throw new A.A},t.isValidSequence=function(e){var r,n;try{for(var i=m(t.FINDER_PATTERN_SEQUENCES),A=i.next();!A.done;A=i.next()){var o=A.value;if(!(e.length>o.length)){for(var a=!0,s=0;s<e.length;s++)if(e[s].getFinderPattern().getValue()!==o[s]){a=!1;break}if(a)return!0}}}catch(e){r={error:e}}finally{try{A&&!A.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return!1},t.prototype.storeRow=function(e,r){for(var n=0,i=!1,A=!1;n<this.rows.length;){var o=this.rows[n];if(o.getRowNumber()>e){A=o.isEquivalent(this.pairs);break}i=o.isEquivalent(this.pairs),n++}A||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new g(this.pairs,e,r)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,t){var r,n,i,A,o,a;try{for(var s=m(t),u=s.next();!u.done;u=s.next()){var c=u.value;if(c.getPairs().length!==e.length){try{for(var l=(i=void 0,m(c.getPairs())),f=l.next();!f.done;f=l.next()){var d=f.value,h=!1;try{for(var g=(o=void 0,m(e)),y=g.next();!y.done;y=g.next()){var v=y.value;if(p.equals(d,v)){h=!0;break}}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}h||!1}}catch(e){i={error:e}}finally{try{f&&!f.done&&(A=l.return)&&A.call(l)}finally{if(i)throw i.error}}}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},t.isPartialRow=function(e,t){var r,n,i,A,o,a;try{for(var s=m(t),u=s.next();!u.done;u=s.next()){var c=u.value,l=!0;try{for(var f=(i=void 0,m(e)),d=f.next();!d.done;d=f.next()){var h=d.value,p=!1;try{for(var g=(o=void 0,m(c.getPairs())),y=g.next();!y.done;y=g.next()){var v=y.value;if(h.equals(v)){p=!0;break}}}catch(e){o={error:e}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}if(!p){l=!1;break}}}catch(e){i={error:e}}finally{try{d&&!d.done&&(A=f.return)&&A.call(f)}finally{if(i)throw i.error}}if(l)return!0}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var t=d.buildBitArray(e),r=(0,h.$)(t).parseInformation(),i=e[0].getFinderPattern().getResultPoints(),A=e[e.length-1].getFinderPattern().getResultPoints(),a=[i[0],i[1],A[0],A[1]];return new o.A(r,null,null,a,n.A.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),t=e.getLeftChar(),r=e.getRightChar();if(null===r)return!1;for(var n=r.getChecksumPortion(),i=2,A=1;A<this.pairs.size();++A){var o=this.pairs.get(A);n+=o.getLeftChar().getChecksumPortion(),i++;var a=o.getRightChar();null!=a&&(n+=a.getChecksumPortion(),i++)}return 211*(i-4)+(n%=211)===t.getValue()},t.getNextSecondBar=function(e,t){var r;return e.get(t)?(r=e.getNextUnset(t),r=e.getNextSet(r)):(r=e.getNextSet(t),r=e.getNextUnset(r)),r},t.prototype.retrieveNextPair=function(e,r,n){var i,o=r.length%2==0;this.startFromEven&&(o=!o);var a=!0,s=-1;do{this.findNextPair(e,r,s),null===(i=this.parseFoundFinderPattern(e,n,o))?s=t.getNextSecondBar(e,this.startEnd[0]):a=!1}while(a);var u,c=this.decodeDataCharacter(e,i,o,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new A.A;try{u=this.decodeDataCharacter(e,i,o,!1)}catch(e){u=null,console.log(e)}return new p(c,u,i,!0)},t.prototype.isEmptyPair=function(e){return 0===e.length},t.prototype.findNextPair=function(e,r,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var o,a=e.getSize();if(n>=0)o=n;else if(this.isEmptyPair(r))o=0;else{o=r[r.length-1].getFinderPattern().getStartEnd()[1]}var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;o<a&&(u=!e.get(o));)o++;for(var c=0,l=o,f=o;f<a;f++)if(e.get(f)!==u)i[c]++;else{if(3===c){if(s&&t.reverseCounters(i),t.isFinderPattern(i))return this.startEnd[0]=l,void(this.startEnd[1]=f);s&&t.reverseCounters(i),l+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,c--}else c++;i[c]=1,u=!u}throw new A.A},t.reverseCounters=function(e){for(var t=e.length,r=0;r<t/2;++r){var n=e[r];e[r]=e[t-r-1],e[t-r-1]=n}},t.prototype.parseFoundFinderPattern=function(e,r,n){var i,A,o;if(n){for(var s=this.startEnd[0]-1;s>=0&&!e.get(s);)s--;s++,i=this.startEnd[0]-s,A=s,o=this.startEnd[1]}else A=this.startEnd[0],i=(o=e.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,l=this.getDecodeFinderCounters();a.A.arraycopy(l,0,l,1,l.length-1),l[0]=i;try{u=this.parseFinderValue(l,t.FINDER_PATTERNS)}catch(e){return null}return new c.A(u,[A,o],A,o,r)},t.prototype.decodeDataCharacter=function(e,r,n,o){for(var a=this.getDataCharacterCounters(),s=0;s<a.length;s++)a[s]=0;if(o)t.recordPatternInReverse(e,r.getStartEnd()[0],a);else{t.recordPattern(e,r.getStartEnd()[1],a);for(var c=0,f=a.length-1;c<f;c++,f--){var d=a[c];a[c]=a[f],a[f]=d}}var h=i.A.sum(new Int32Array(a))/17,p=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(h-p)/p>.3)throw new A.A;var g=this.getOddCounts(),y=this.getEvenCounts(),v=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors();for(c=0;c<a.length;c++){var w=1*a[c]/h,b=w+.5;if(b<1){if(w<.3)throw new A.A;b=1}else if(b>8){if(w>8.7)throw new A.A;b=8}var B=c/2;1&c?(y[B]=b,m[B]=w-b):(g[B]=b,v[B]=w-b)}this.adjustOddEvenCounts(17);var C=4*r.getValue()+(n?0:2)+(o?0:1)-1,E=0,S=0;for(c=g.length-1;c>=0;c--){if(t.isNotA1left(r,n,o)){var I=t.WEIGHTS[C][2*c];S+=g[c]*I}E+=g[c]}var O=0;for(c=y.length-1;c>=0;c--)if(t.isNotA1left(r,n,o)){I=t.WEIGHTS[C][2*c+1];O+=y[c]*I}var F=S+O;if(1&E||E>13||E<4)throw new A.A;var _=(13-E)/2,x=t.SYMBOL_WIDEST[_],U=9-x,Q=l.A.getRSSvalue(g,x,!0),T=l.A.getRSSvalue(y,U,!1),M=Q*t.EVEN_TOTAL_SUBSET[_]+T+t.GSUM[_];return new u.A(M,F)},t.isNotA1left=function(e,t,r){return!(0===e.getValue()&&t&&r)},t.prototype.adjustOddEvenCounts=function(e){var r=i.A.sum(new Int32Array(this.getOddCounts())),n=i.A.sum(new Int32Array(this.getEvenCounts())),o=!1,a=!1;r>13?a=!0:r<4&&(o=!0);var s=!1,u=!1;n>13?u=!0:n<4&&(s=!0);var c=r+n-e,l=!(1&~r),f=!(1&n);if(1===c)if(l){if(f)throw new A.A;a=!0}else{if(!f)throw new A.A;u=!0}else if(-1===c)if(l){if(f)throw new A.A;o=!0}else{if(!f)throw new A.A;s=!0}else{if(0!==c)throw new A.A;if(l){if(!f)throw new A.A;r<n?(o=!0,u=!0):(a=!0,s=!0)}else if(f)throw new A.A}if(o){if(a)throw new A.A;t.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&t.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(u)throw new A.A;t.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&t.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.SYMBOL_WIDEST=[7,5,4,3,1],t.EVEN_TOTAL_SUBSET=[4,20,52,104,204],t.GSUM=[0,348,1388,2948,3988],t.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],t.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],t.FINDER_PAT_A=0,t.FINDER_PAT_B=1,t.FINDER_PAT_C=2,t.FINDER_PAT_D=3,t.FINDER_PAT_E=4,t.FINDER_PAT_F=5,t.FINDER_PATTERN_SEQUENCES=[[t.FINDER_PAT_A,t.FINDER_PAT_A],[t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B],[t.FINDER_PAT_A,t.FINDER_PAT_C,t.FINDER_PAT_B,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_C],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_E,t.FINDER_PAT_B,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F],[t.FINDER_PAT_A,t.FINDER_PAT_A,t.FINDER_PAT_B,t.FINDER_PAT_B,t.FINDER_PAT_C,t.FINDER_PAT_D,t.FINDER_PAT_D,t.FINDER_PAT_E,t.FINDER_PAT_E,t.FINDER_PAT_F,t.FINDER_PAT_F]],t.MAX_PAIRS=11,t}(s.A);const b=w},82003(e,t,r){"use strict";var n=r(46518),i=r(96395),A=r(10916).CONSTRUCTOR,o=r(80550),a=r(97751),s=r(94901),u=r(36840),c=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:A,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&s(o)){var l=a("Promise").prototype.catch;c.catch!==l&&u(c,"catch",l,{unsafe:!0})}},82205(e,t,r){"use strict";r.d(t,{A:()=>l});var n,i=r(73872),A=r(58503),o=r(32993),a=r(7758),s=r(93234),u=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},t}return u(t,e),t.prototype.decodeRow=function(e,t,r){var n=this.getValidRowData(t);if(!n)throw new A.A;var o=this.codaBarDecodeRow(n.row);if(!o)throw new A.A;return new a.A(o,null,0,[new s.A(n.left,e),new s.A(n.right,e)],i.A.CODABAR,(new Date).getTime())},t.prototype.getValidRowData=function(e){var t=e.toArray(),r=t.indexOf(!0);if(-1===r)return null;var n=t.lastIndexOf(!0);if(n<=r)return null;for(var i=[],A=(t=t.slice(r,n+1))[0],o=1,a=1;a<t.length;a++)t[a]===A?o++:(A=t[a],i.push(o),o=1);return i.push(o),i.length<23&&(i.length+1)%8!=0?null:{row:i,left:r,right:n}},t.prototype.codaBarDecodeRow=function(e){for(var t=[],r=Math.ceil(e.reduce(function(e,t){return(e+t)/2},0));e.length>0;){var n=e.splice(0,8).splice(0,7).map(function(e){return e<r?"n":"w"}).join("");if(void 0===this.CODA_BAR_CHAR_SET[n])return null;t.push(this.CODA_BAR_CHAR_SET[n])}var i=t.join("");return this.validCodaBarString(i)?i:null},t.prototype.validCodaBarString=function(e){return/^[A-D].{1,}[A-D]$/.test(e)},t}(o.A);const l=c},82299(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(57149);const i=function(){function e(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return e.prototype.getBitOffset=function(){return this.bitOffset},e.prototype.getByteOffset=function(){return this.byteOffset},e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new n.A(""+e);var t=0,r=this.bitOffset,i=this.byteOffset,A=this.bytes;if(r>0){var o=8-r,a=e<o?e:o,s=255>>8-a<<(u=o-a);t=(A[i]&s)>>u,e-=a,8===(r+=a)&&(r=0,i++)}if(e>0){for(;e>=8;)t=t<<8|255&A[i],i++,e-=8;if(e>0){var u;s=255>>(u=8-e)<<u;t=t<<e|(A[i]&s)>>u,r+=e}}return this.bitOffset=r,this.byteOffset=i,t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}()},82389(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(e){this.source=e}return e.prototype.getLuminanceSource=function(){return this.source},e.prototype.getWidth=function(){return this.source.getWidth()},e.prototype.getHeight=function(){return this.source.getHeight()},e}()},82695(e,t,r){"use strict";r.d(t,{JN:()=>n,Lb:()=>s,_5:()=>i,eC:()=>a,gY:()=>A,hX:()=>l,iO:()=>u,lZ:()=>c,pH:()=>f,x3:()=>o});var n=e=>e.rootProps.maxBarSize,i=e=>e.rootProps.barGap,A=e=>e.rootProps.barCategoryGap,o=e=>e.rootProps.barSize,a=e=>e.rootProps.stackOffset,s=e=>e.rootProps.reverseStackOrder,u=e=>e.options.chartName,c=e=>e.rootProps.syncId,l=e=>e.rootProps.syncMethod,f=e=>e.options.eventEmitter},82984(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(12049);t.isArguments=function(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===n.getTag(e)}},83063(e,t,r){"use strict";var n=r(82839);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},83403(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(54200);t.property=function(e){return function(t){return n.get(t,e)}}},83851(e,t,r){"use strict";var n=r(46518),i=r(79039),A=r(25397),o=r(77347).f,a=r(43724);n({target:"Object",stat:!0,forced:!a||i(function(){o(1)}),sham:!a},{getOwnPropertyDescriptor:function(e,t){return o(A(e),t)}})},83908(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isTypedArray=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}},84185(e,t,r){"use strict";var n=r(46518),i=r(43724),A=r(24913).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==A,sham:!i},{defineProperty:A})},84215(e,t,r){"use strict";var n=r(44576),i=r(82839),A=r(22195),o=function(e){return i.slice(0,e.length)===e};e.exports=o("Bun/")?"BUN":o("Cloudflare-Workers")?"CLOUDFLARE":o("Deno/")?"DENO":o("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===A(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},84373(e,t,r){"use strict";var n=r(48981),i=r(35610),A=r(26198);e.exports=function(e){for(var t=n(this),r=A(t),o=arguments.length,a=i(o>1?arguments[1]:void 0,r),s=o>2?arguments[2]:void 0,u=void 0===s?r:i(s,r);u>a;)t[a++]=e;return t}},85012(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(316),i=r(44569);t.range=function(e,t,r){r&&"number"!=typeof r&&n.isIterateeCall(e,t,r)&&(t=r=void 0),e=i.toFinite(e),void 0===t?(t=e,e=0):t=i.toFinite(t),r=void 0===r?e<t?1:-1:i.toFinite(r);const A=Math.max(Math.ceil((t-e)/(r||1)),0),o=new Array(A);for(let t=0;t<A;t++)o[t]=e,e+=r;return o}},85072(e,t,r){"use strict";var n,i=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},A=function(){var e={};return function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}e[t]=r}return e[t]}}(),o=[];function a(e){for(var t=-1,r=0;r<o.length;r++)if(o[r].identifier===e){t=r;break}return t}function s(e,t){for(var r={},n=[],i=0;i<e.length;i++){var A=e[i],s=t.base?A[0]+t.base:A[0],u=r[s]||0,c="".concat(s," ").concat(u);r[s]=u+1;var l=a(c),f={css:A[1],media:A[2],sourceMap:A[3]};-1!==l?(o[l].references++,o[l].updater(f)):o.push({identifier:c,updater:g(f,t),references:1}),n.push(c)}return n}function u(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var i=r.nc;i&&(n.nonce=i)}if(Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])}),"function"==typeof e.insert)e.insert(t);else{var o=A(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var c,l=(c=[],function(e,t){return c[e]=t,c.filter(Boolean).join("\n")});function f(e,t,r,n){var i=r?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=l(t,i);else{var A=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(A,o[t]):e.appendChild(A)}}function d(e,t,r){var n=r.css,i=r.media,A=r.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),A&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(A))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var h=null,p=0;function g(e,t){var r,n,i;if(t.singleton){var A=p++;r=h||(h=u(t)),n=f.bind(null,r,A,!1),i=f.bind(null,r,A,!0)}else r=u(t),n=d.bind(null,r,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(r)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var r=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<r.length;n++){var i=a(r[n]);o[i].references--}for(var A=s(e,t),u=0;u<r.length;u++){var c=a(r[u]);0===o[c].references&&(o[c].updater(),o.splice(c,1))}r=A}}}},85138(e,t,r){"use strict";r.d(t,{B8:()=>p,WO:()=>h,ZV:()=>d,v3:()=>g,wR:()=>f});var n=r(65307),i=r(1932),A=r(60648);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u={zIndexMap:Object.values(A.I).reduce((e,t)=>a(a({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),{})},c=new Set(Object.values(A.I));var l=(0,n.Z0)({name:"zIndex",initialState:u,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:(0,n.aA)()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!function(e){return c.has(e)}(r)&&delete e.zIndexMap[r])},prepare:(0,n.aA)()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:A}=t.payload;e.zIndexMap[r]?A?e.zIndexMap[r].panoramaElement=(0,i.h4)(n):e.zIndexMap[r].element=(0,i.h4)(n):e.zIndexMap[r]={consumers:0,element:A?void 0:(0,i.h4)(n),panoramaElement:A?(0,i.h4)(n):void 0}},prepare:(0,n.aA)()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:(0,n.aA)()}}}),{registerZIndexPortal:f,unregisterZIndexPortal:d,registerZIndexPortalElement:h,unregisterZIndexPortalElement:p}=l.actions,g=l.reducer},85160(e,t,r){"use strict";var n=r(96540);var i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},A=n.useSyncExternalStore,o=n.useRef,a=n.useEffect,s=n.useMemo,u=n.useDebugValue},86012(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.getSymbols=function(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}},86069(e,t,r){"use strict";r.d(t,{W:()=>s});var n=r(96540),i=r(34164),A=r(80196),o=["children","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(null,arguments)}var s=n.forwardRef((e,t)=>{var{children:r,className:s}=e,u=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,o),c=(0,i.$)("recharts-layer",s);return n.createElement("g",a({className:c},(0,A.a)(u),{ref:t}),r)})},86215(e,t,r){"use strict";r.d(t,{YF:()=>u,dj:()=>c,fP:()=>l,ky:()=>s});var n=r(65307),i=r(74531),A=r(20954),o=r(55978),a=r(99516),s=(0,n.VP)("mouseClick"),u=(0,n.Nc)();u.startListening({actionCreator:s,effect:(e,t)=>{var r=e.payload,n=(0,A.g)(t.getState(),(0,a.w)(r));null!=(null==n?void 0:n.activeIndex)&&t.dispatch((0,i.jF)({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var c=(0,n.VP)("mouseMove"),l=(0,n.Nc)(),f=null;l.startListening({actionCreator:c,effect:(e,t)=>{var r=e.payload;null!==f&&cancelAnimationFrame(f);var n=(0,a.w)(r);f=requestAnimationFrame(()=>{var e=t.getState();if("axis"===(0,o.au)(e,e.tooltip.settings.shared)){var r=(0,A.g)(e,n);null!=(null==r?void 0:r.activeIndex)?t.dispatch((0,i.Nt)({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate})):t.dispatch((0,i.xS)())}f=null})}})},86680(e,t,r){"use strict";r.d(t,{M:()=>n});var n=e=>e.tooltip.settings.axisId},86907(e,t,r){"use strict";r.d(t,{A:()=>A});var n=r(72925),i=r(26470);function A(e,t,r){var{chartData:A=[]}=t,{allowDuplicatedCategory:o,dataKey:a}=r,s=new Map;return e.forEach(e=>{var t,r=null!==(t=e.data)&&void 0!==t?t:A;if(null!=r&&0!==r.length){var u=(0,n.x)(e);r.forEach((t,r)=>{var n,A=null==a||o?r:String((0,i.kr)(t,a,null)),c=(0,i.kr)(t,e.dataKey,0);n=s.has(A)?s.get(A):{},Object.assign(n,{[u]:c}),s.set(A,n)})}}),Array.from(s.values())}},86931(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="ReedSolomonException",t}(i.A);const a=o},86974(e,t,r){"use strict";r.d(t,{b:()=>a});var n=r(54951),i=r(88468),A=r(44487),o=r(89194),a=function(){function e(){}return e.prototype.getEncodingMode=function(){return A.uf},e.prototype.encode=function(e){for(var t=new i.A;e.hasMoreCharacters();){var r=e.getCurrentChar();if(this.encodeChar(r,t),e.pos++,t.length()>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var a=t.toString().substring(4);if(t.setLengthToZero(),t.append(a),o.A.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode()){e.signalEncoderChange(A.d2);break}}}t.append(n.A.getCharAt(31)),this.handleEOD(e,t)},e.prototype.handleEOD=function(e,t){try{var r=t.length();if(0===r)return;if(1===r){e.updateSymbolInfo();var n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=e.getRemainingCharacters();if(i>n&&(e.updateSymbolInfo(e.getCodewordCount()+1),n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),i<=n&&n<=2)return}if(r>4)throw new Error("Count must not exceed 4");var o=r-1,a=this.encodeToCodewords(t.toString()),s=!e.hasMoreCharacters()&&o<=2;if(o<=2)e.updateSymbolInfo(e.getCodewordCount()+o),(n=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount())>=3&&(s=!1,e.updateSymbolInfo(e.getCodewordCount()+a.length));s?(e.resetSymbolInfo(),e.pos-=o):e.writeCodewords(a)}finally{e.signalEncoderChange(A.d2)}},e.prototype.encodeChar=function(e,t){e>=" ".charCodeAt(0)&&e<="?".charCodeAt(0)?t.append(e):e>="@".charCodeAt(0)&&e<="^".charCodeAt(0)?t.append(n.A.getCharAt(e-64)):o.A.illegalCharacter(n.A.getCharAt(e))},e.prototype.encodeToCodewords=function(e){var t=e.length;if(0===t)throw new Error("StringBuilder must not be empty");var r=(e.charAt(0).charCodeAt(0)<<18)+((t>=2?e.charAt(1).charCodeAt(0):0)<<12)+((t>=3?e.charAt(2).charCodeAt(0):0)<<6)+(t>=4?e.charAt(3).charCodeAt(0):0),n=r>>16&255,A=r>>8&255,o=255&r,a=new i.A;return a.append(n),t>=2&&a.append(A),t>=3&&a.append(o),a.toString()},e}()},88224(e,t,r){"use strict";r.d(t,{E:()=>a});var n=r(96540),i=r(26960),A=r(72685),o=["axis","item"],a=(0,n.forwardRef)((e,t)=>n.createElement(A.P,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:o,tooltipPayloadSearcher:i.uN,categoricalChartProps:e,ref:t}))},88431(e,t,r){"use strict";var n=r(46518),i=r(59213).every;n({target:"Array",proto:!0,forced:!r(34598)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},88468(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(54951);const i=function(){function e(e){void 0===e&&(e=""),this.value=e}return e.prototype.enableDecoding=function(e){return this.encoding=e,this},e.prototype.append=function(e){return"string"==typeof e?this.value+=e.toString():this.encoding?this.value+=n.A.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},e.prototype.appendChars=function(e,t,r){for(var n=t;t<t+r;n++)this.append(e[n]);return this},e.prototype.length=function(){return this.value.length},e.prototype.charAt=function(e){return this.value.charAt(e)},e.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},e.prototype.setCharAt=function(e,t){this.value=this.value.substr(0,e)+t+this.value.substr(e+1)},e.prototype.substring=function(e,t){return this.value.substring(e,t)},e.prototype.setLengthToZero=function(){this.value=""},e.prototype.toString=function(){return this.value},e.prototype.insert=function(e,t){this.value=this.value.substring(0,e)+t+this.value.substring(e)},e}()},88919(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(61366);t.toNumber=function(e){return n.isSymbol(e)?NaN:Number(e)}},89194(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(32981),i=r(38538),A=r(36775),o=r(44487),a=r(86974),s=r(65587),u=r(79801),c=r(28871),l=r(80442),f=r(36254);const d=function(){function e(){}return e.randomize253State=function(e){var t=149*e%253+1,r=o.Qw+t;return r<=254?r:r-254},e.encodeHighLevel=function(e,t,r,l,f){void 0===t&&(t=0),void 0===r&&(r=null),void 0===l&&(l=null),void 0===f&&(f=!1);var d=new A.S,h=[new n.a,d,new c._,new u.y,new a.b,new i.B],p=new s.Q(e);p.setSymbolShape(t),p.setSizeConstraints(r,l),e.startsWith(o.h_)&&e.endsWith(o.TG)?(p.writeCodeword(o.tf),p.setSkipAtEnd(2),p.pos+=o.h_.length):e.startsWith(o.eB)&&e.endsWith(o.TG)&&(p.writeCodeword(o.mD),p.setSkipAtEnd(2),p.pos+=o.eB.length);var g=o.d2;for(f&&(d.encodeMaximal(p),g=p.getNewEncoding(),p.resetEncoderSignal());p.hasMoreCharacters();)h[g].encode(p),p.getNewEncoding()>=0&&(g=p.getNewEncoding(),p.resetEncoderSignal());var y=p.getCodewordCount();p.updateSymbolInfo();var v=p.getSymbolInfo().getDataCapacity();y<v&&g!==o.d2&&g!==o.mt&&g!==o.uf&&p.writeCodeword("þ");var m=p.getCodewords();for(m.length()<v&&m.append(o.Qw);m.length()<v;)m.append(this.randomize253State(m.length()+1));return p.getCodewords().toString()},e.lookAheadTest=function(e,t,r){var n=this.lookAheadTestIntern(e,t,r);if(r===o.VK&&n===o.VK){for(var i=Math.min(t+3,e.length),A=t;A<i;A++)if(!this.isNativeX12(e.charCodeAt(A)))return o.d2}else if(r===o.uf&&n===o.uf)for(i=Math.min(t+4,e.length),A=t;A<i;A++)if(!this.isNativeEDIFACT(e.charCodeAt(A)))return o.d2;return n},e.lookAheadTestIntern=function(e,t,r){if(t>=e.length)return r;var n;r===o.d2?n=[0,1,1,1,1,1.25]:(n=[1,2,2,2,2,2.25])[r]=0;for(var i=0,A=new Uint8Array(6),a=[];;){if(t+i===e.length){l.A.fill(A,0),l.A.fill(a,0);var s=this.findMinimums(n,a,f.A.MAX_VALUE,A),u=this.getMinimumCount(A);if(a[o.d2]===s)return o.d2;if(1===u){if(A[o.mt]>0)return o.mt;if(A[o.uf]>0)return o.uf;if(A[o.VL]>0)return o.VL;if(A[o.VK]>0)return o.VK}return o.fG}var c=e.charCodeAt(t+i);if(i++,this.isDigit(c)?n[o.d2]+=.5:this.isExtendedASCII(c)?(n[o.d2]=Math.ceil(n[o.d2]),n[o.d2]+=2):(n[o.d2]=Math.ceil(n[o.d2]),n[o.d2]++),this.isNativeC40(c)?n[o.fG]+=2/3:this.isExtendedASCII(c)?n[o.fG]+=8/3:n[o.fG]+=4/3,this.isNativeText(c)?n[o.VL]+=2/3:this.isExtendedASCII(c)?n[o.VL]+=8/3:n[o.VL]+=4/3,this.isNativeX12(c)?n[o.VK]+=2/3:this.isExtendedASCII(c)?n[o.VK]+=13/3:n[o.VK]+=10/3,this.isNativeEDIFACT(c)?n[o.uf]+=3/4:this.isExtendedASCII(c)?n[o.uf]+=4.25:n[o.uf]+=3.25,this.isSpecialB256(c)?n[o.mt]+=4:n[o.mt]++,i>=4){if(l.A.fill(A,0),l.A.fill(a,0),this.findMinimums(n,a,f.A.MAX_VALUE,A),a[o.d2]<this.min(a[o.mt],a[o.fG],a[o.VL],a[o.VK],a[o.uf]))return o.d2;if(a[o.mt]<a[o.d2]||a[o.mt]+1<this.min(a[o.fG],a[o.VL],a[o.VK],a[o.uf]))return o.mt;if(a[o.uf]+1<this.min(a[o.mt],a[o.fG],a[o.VL],a[o.VK],a[o.d2]))return o.uf;if(a[o.VL]+1<this.min(a[o.mt],a[o.fG],a[o.uf],a[o.VK],a[o.d2]))return o.VL;if(a[o.VK]+1<this.min(a[o.mt],a[o.fG],a[o.uf],a[o.VL],a[o.d2]))return o.VK;if(a[o.fG]+1<this.min(a[o.d2],a[o.mt],a[o.uf],a[o.VL])){if(a[o.fG]<a[o.VK])return o.fG;if(a[o.fG]===a[o.VK]){for(var d=t+i+1;d<e.length;){var h=e.charCodeAt(d);if(this.isX12TermSep(h))return o.VK;if(!this.isNativeX12(h))break;d++}return o.fG}}}}},e.min=function(e,t,r,n,i){var A=Math.min(e,Math.min(t,Math.min(r,n)));return void 0===i?A:Math.min(A,i)},e.findMinimums=function(e,t,r,n){for(var i=0;i<6;i++){var A=t[i]=Math.ceil(e[i]);r>A&&(r=A,l.A.fill(n,0)),r===A&&(n[i]=n[i]+1)}return r},e.getMinimumCount=function(e){for(var t=0,r=0;r<6;r++)t+=e[r];return t||0},e.isDigit=function(e){return e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)},e.isExtendedASCII=function(e){return e>=128&&e<=255},e.isNativeC40=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},e.isNativeText=function(e){return e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)},e.isNativeX12=function(e){return this.isX12TermSep(e)||e===" ".charCodeAt(0)||e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)||e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)},e.isX12TermSep=function(e){return 13===e||e==="*".charCodeAt(0)||e===">".charCodeAt(0)},e.isNativeEDIFACT=function(e){return e>=" ".charCodeAt(0)&&e<="^".charCodeAt(0)},e.isSpecialB256=function(e){return!1},e.determineConsecutiveDigitCount=function(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n<r&&this.isDigit(e.charCodeAt(n));)n++;return n-t},e.illegalCharacter=function(e){var t=f.A.toHexString(e.charCodeAt(0));throw t="0000".substring(0,4-t.length)+t,new Error("Illegal character: "+e+" (0x"+t+")")},e}()},89228(e,t,r){"use strict";r(27495);var n=r(69565),i=r(36840),A=r(57323),o=r(79039),a=r(78227),s=r(66699),u=a("species"),c=RegExp.prototype;e.exports=function(e,t,r,l){var f=a(e),d=!o(function(){var t={};return t[f]=function(){return 7},7!==""[e](t)}),h=d&&!o(function(){var t=!1,r=/a/;if("split"===e){var n={};n[u]=function(){return r},(r={constructor:n,flags:""})[f]=/./[f]}return r.exec=function(){return t=!0,null},r[f](""),!t});if(!d||!h||r){var p=/./[f],g=t(f,""[e],function(e,t,r,i,o){var a=t.exec;return a===A||a===c.exec?d&&!o?{done:!0,value:n(p,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}});i(String.prototype,e,g[0]),i(c,f,g[1])}l&&s(c[f],"sham",!0)}},89407(e,t,r){"use strict";r.d(t,{A:()=>o});var n,i=r(12122),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const o=function(e){function t(t,r,n,i,A){var o=e.call(this,t,r)||this;return o.compact=n,o.nbDatablocks=i,o.nbLayers=A,o}return A(t,e),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(i.A)},89544(e,t,r){"use strict";var n=r(82839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},89572(e,t,r){"use strict";var n=r(39297),i=r(36840),A=r(53640),o=r(78227)("toPrimitive"),a=Date.prototype;n(a,o)||i(a,o,A)},89596(e,t,r){"use strict";r.d(t,{N:()=>u});var n=r(59744),i=r(26470),A=r(79195);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=(e,t,r,o,s,u,c)=>{if(null!=t&&null!=u){var{chartData:l,computedData:f,dataStartIndex:d,dataEndIndex:h}=r;return e.reduce((e,r)=>{var p,g,y,{dataDefinedOnItem:v,settings:m}=r,w=function(e,t){return null!=e?e:t}(v,l),b=Array.isArray(w)?(0,A.v)(w,d,h):w,B=null!==(p=null==m?void 0:m.dataKey)&&void 0!==p?p:o,C=null==m?void 0:m.nameKey;(g=o&&Array.isArray(b)&&!Array.isArray(b[0])&&"axis"===c?(0,n.eP)(b,o,s):u(b,t,f,C),Array.isArray(g))?g.forEach(t=>{var r=a(a({},m),{},{name:t.name,unit:t.unit,color:void 0,fill:void 0});e.push((0,i.GF)({tooltipEntrySettings:r,dataKey:t.dataKey,payload:t.payload,value:(0,i.kr)(t.payload,t.dataKey),name:t.name}))}):e.push((0,i.GF)({tooltipEntrySettings:m,dataKey:B,payload:g,value:(0,i.kr)(g,B),name:null!==(y=(0,i.kr)(g,C))&&void 0!==y?y:null==m?void 0:m.name}));return e},[])}}},90537(e,t,r){"use strict";var n=r(80550),i=r(84428),A=r(10916).CONSTRUCTOR;e.exports=A||!i(function(e){n.all(e).then(void 0,function(){})})},90706(e,t,r){"use strict";r.d(t,{i:()=>N});var n=r(96540);Math.abs,Math.atan2;const i=Math.cos,A=(Math.max,Math.min,Math.sin),o=Math.sqrt,a=Math.PI,s=2*a;const u={draw(e,t){const r=o(t/a);e.moveTo(r,0),e.arc(0,0,r,0,s)}},c={draw(e,t){const r=o(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},l=o(1/3),f=2*l,d={draw(e,t){const r=o(t/f),n=r*l;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},h={draw(e,t){const r=o(t),n=-r/2;e.rect(n,n,r,r)}},p=A(a/10)/A(7*a/10),g=A(s/10)*p,y=-i(s/10)*p,v={draw(e,t){const r=o(.8908130915292852*t),n=g*r,a=y*r;e.moveTo(0,-r),e.lineTo(n,a);for(let t=1;t<5;++t){const o=s*t/5,u=i(o),c=A(o);e.lineTo(c*r,-u*r),e.lineTo(u*n-c*a,c*n+u*a)}e.closePath()}},m=o(3),w={draw(e,t){const r=-o(t/(3*m));e.moveTo(0,2*r),e.lineTo(-m*r,-r),e.lineTo(m*r,-r),e.closePath()}},b=-.5,B=o(3)/2,C=1/o(12),E=3*(C/2+1),S={draw(e,t){const r=o(t/E),n=r/2,i=r*C,A=n,a=r*C+r,s=-A,u=a;e.moveTo(n,i),e.lineTo(A,a),e.lineTo(s,u),e.lineTo(b*n-B*i,B*n+b*i),e.lineTo(b*A-B*a,B*A+b*a),e.lineTo(b*s-B*u,B*s+b*u),e.lineTo(b*n+B*i,b*i-B*n),e.lineTo(b*A+B*a,b*a-B*A),e.lineTo(b*s+B*u,b*u-B*s),e.closePath()}};var I=r(48946),O=r(11509);o(3),o(3);var F=r(34164),_=r(59744),x=r(80196),U=["type","size","sizeType"];function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Q.apply(null,arguments)}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach(function(t){P(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var D={symbolCircle:u,symbolCross:c,symbolDiamond:d,symbolSquare:h,symbolStar:v,symbolTriangle:w,symbolWye:S},k=Math.PI/180,N=e=>{var{type:t="circle",size:r=64,sizeType:i="area"}=e,A=M(M({},function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,U)),{},{type:t,size:r,sizeType:i}),o="circle";"string"==typeof t&&(o=t);var{className:a,cx:s,cy:c}=A,l=(0,x.a)(A);return(0,_.Et)(s)&&(0,_.Et)(c)&&(0,_.Et)(r)?n.createElement("path",Q({},l,{className:(0,F.$)("recharts-symbols",a),transform:"translate(".concat(s,", ").concat(c,")"),d:(()=>{var e=(e=>{var t="symbol".concat((0,_.Zb)(e));return D[t]||u})(o),t=function(e,t){let r=null,n=(0,O.i)(i);function i(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return e="function"==typeof e?e:(0,I.A)(e||u),t="function"==typeof t?t:(0,I.A)(void 0===t?64:+t),i.type=function(t){return arguments.length?(e="function"==typeof t?t:(0,I.A)(t),i):e},i.size=function(e){return arguments.length?(t="function"==typeof e?e:(0,I.A)(+e),i):t},i.context=function(e){return arguments.length?(r=null==e?null:e,i):r},i}().type(e).size(((e,t,r)=>{if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*k;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.tan(n)**2);case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}})(r,i,o)),n=t();if(null!==n)return n})()})):null};N.registerSymbol=(e,t)=>{D["symbol".concat((0,_.Zb)(e))]=t}},90744(e,t,r){"use strict";var n=r(69565),i=r(79504),A=r(89228),o=r(28551),a=r(20034),s=r(67750),u=r(2293),c=r(57829),l=r(18014),f=r(655),d=r(55966),h=r(56682),p=r(58429),g=r(79039),y=p.UNSUPPORTED_Y,v=Math.min,m=i([].push),w=i("".slice),b=!g(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}),B="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;A("split",function(e,t,r){var i="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:n(t,this,e,r)}:t;return[function(t,r){var A=s(this),o=a(t)?d(t,e):void 0;return o?n(o,t,A,r):n(i,f(A),t,r)},function(e,n){var A=o(this),a=f(e);if(!B){var s=r(i,A,a,n,i!==t);if(s.done)return s.value}var d=u(A,RegExp),p=A.unicode,g=(A.ignoreCase?"i":"")+(A.multiline?"m":"")+(A.unicode?"u":"")+(y?"g":"y"),b=new d(y?"^(?:"+A.source+")":A,g),C=void 0===n?4294967295:n>>>0;if(0===C)return[];if(0===a.length)return null===h(b,a)?[a]:[];for(var E=0,S=0,I=[];S<a.length;){b.lastIndex=y?0:S;var O,F=h(b,y?w(a,S):a);if(null===F||(O=v(l(b.lastIndex+(y?S:0)),a.length))===E)S=c(a,S,p);else{if(m(I,w(a,E,S)),I.length===C)return I;for(var _=1;_<=F.length-1;_++)if(m(I,F[_]),I.length===C)return I;S=E=O}}return m(I,w(a,E)),I}]},B||!b,y)},90757(e){"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},91110(e,t,r){"use strict";r.d(t,{A:()=>u});var n,i=r(28823),A=r(58503),o=r(32993),a=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const u=function(e){function t(){var t=e.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=new Array(4),t.evenRoundingErrors=new Array(4),t.oddCounts=new Array(t.dataCharacterCounters.length/2),t.evenCounts=new Array(t.dataCharacterCounters.length/2),t}return a(t,e),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,r){for(var n=0;n<r.length;n++)if(o.A.patternMatchVariance(e,r[n],t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return n;throw new A.A},t.count=function(e){return i.A.sum(new Int32Array(e))},t.increment=function(e,t){for(var r=0,n=t[0],i=1;i<e.length;i++)t[i]>n&&(n=t[i],r=i);e[r]++},t.decrement=function(e,t){for(var r=0,n=t[0],i=1;i<e.length;i++)t[i]<n&&(n=t[i],r=i);e[r]--},t.isFinderPattern=function(e){var r,n,i=e[0]+e[1],A=i/(i+e[2]+e[3]);if(A>=t.MIN_FINDER_PATTERN_RATIO&&A<=t.MAX_FINDER_PATTERN_RATIO){var o=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;try{for(var u=s(e),c=u.next();!c.done;c=u.next()){var l=c.value;l>a&&(a=l),l<o&&(o=l)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return a<10*o}return!1},t.MAX_AVG_VARIANCE=.2,t.MAX_INDIVIDUAL_VARIANCE=.45,t.MIN_FINDER_PATTERN_RATIO=9.5/12,t.MAX_FINDER_PATTERN_RATIO=12.5/14,t}(o.A)},91283(e,t,r){"use strict";r.d(t,{CU:()=>f,Lx:()=>u,c5:()=>c,h1:()=>s,hx:()=>a,u3:()=>l});var n=r(65307),i=r(12064),A=r(1932),o=(0,n.Z0)({name:"legend",initialState:{settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push((0,A.h4)(t.payload))},prepare:(0,n.aA)()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,o=(0,i.ss)(e).payload.indexOf((0,A.h4)(r));o>-1&&(e.payload[o]=(0,A.h4)(n))},prepare:(0,n.aA)()},removeLegendPayload:{reducer(e,t){var r=(0,i.ss)(e).payload.indexOf((0,A.h4)(t.payload));r>-1&&e.payload.splice(r,1)},prepare:(0,n.aA)()}}}),{setLegendSize:a,setLegendSettings:s,addLegendPayload:u,replaceLegendPayload:c,removeLegendPayload:l}=o.actions,f=o.reducer},91572(e,t,r){"use strict";r.d(t,{fb:()=>FA,q:()=>Ao,tP:()=>ho,g1:()=>bo,iv:()=>Wo,Nk:()=>IA,EZ:()=>WA,pM:()=>RA,Oz:()=>no,tF:()=>zo,rj:()=>EA,ec:()=>mA,bb:()=>ao,xp:()=>mo,wL:()=>co,sr:()=>go,Qn:()=>vo,MK:()=>kA,IO:()=>BA,P9:()=>qA,S5:()=>HA,PU:()=>AA,cd:()=>sA,eo:()=>gA,yi:()=>GA,CH:()=>zA,ZB:()=>Yo,D5:()=>_o,Gx:()=>Jo,DP:()=>dA,BQ:()=>Ko,_y:()=>ea,AV:()=>jA,Lu:()=>VA,um:()=>pA,xM:()=>yo,gT:()=>$A,Kr:()=>ZA,$X:()=>to,TC:()=>NA,Zi:()=>Zo,CR:()=>qo,Dn:()=>MA,K6:()=>PA,ld:()=>yA,L$:()=>Ho,Rl:()=>aA,y7:()=>oA,Lw:()=>No,KR:()=>jo,sf:()=>cA,hc:()=>uA,wP:()=>Vo});var n={};r.r(n),r.d(n,{scaleBand:()=>g,scaleDiverging:()=>li,scaleDivergingLog:()=>fi,scaleDivergingPow:()=>hi,scaleDivergingSqrt:()=>pi,scaleDivergingSymlog:()=>di,scaleIdentity:()=>it,scaleImplicit:()=>h,scaleLinear:()=>nt,scaleLog:()=>dt,scaleOrdinal:()=>p,scalePoint:()=>v,scalePow:()=>Bt,scaleQuantile:()=>Mt,scaleQuantize:()=>Pt,scaleRadial:()=>St,scaleSequential:()=>ii,scaleSequentialLog:()=>Ai,scaleSequentialPow:()=>ai,scaleSequentialQuantile:()=>ui,scaleSequentialSqrt:()=>si,scaleSequentialSymlog:()=>oi,scaleSqrt:()=>Ct,scaleSymlog:()=>yt,scaleThreshold:()=>Dt,scaleTime:()=>ei,scaleUtc:()=>ti,tickFormat:()=>tt});var i=r(25508),A=r(43412),o=r.n(A);function a(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function s(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}class u extends Map{constructor(e,t=d){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,r]of e)this.set(t,r)}get(e){return super.get(c(this,e))}has(e){return super.has(c(this,e))}set(e,t){return super.set(l(this,e),t)}delete(e){return super.delete(f(this,e))}}Set;function c({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function l({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function f({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function d(e){return null!==e&&"object"==typeof e?e.valueOf():e}const h=Symbol("implicit");function p(){var e=new u,t=[],r=[],n=h;function i(i){let A=e.get(i);if(void 0===A){if(n!==h)return n;e.set(i,A=t.push(i)-1)}return r[A%r.length]}return i.domain=function(r){if(!arguments.length)return t.slice();t=[],e=new u;for(const n of r)e.has(n)||e.set(n,t.push(n)-1);return i},i.range=function(e){return arguments.length?(r=Array.from(e),i):r.slice()},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return p(t,r).unknown(n)},a.apply(i,arguments),i}function g(){var e,t,r=p().unknown(void 0),n=r.domain,i=r.range,A=0,o=1,s=!1,u=0,c=0,l=.5;function f(){var r=n().length,a=o<A,f=a?o:A,d=a?A:o;e=(d-f)/Math.max(1,r-u+2*c),s&&(e=Math.floor(e)),f+=(d-f-e*(r-u))*l,t=e*(1-u),s&&(f=Math.round(f),t=Math.round(t));var h=function(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),A=new Array(i);++n<i;)A[n]=e+n*r;return A}(r).map(function(t){return f+e*t});return i(a?h.reverse():h)}return delete r.unknown,r.domain=function(e){return arguments.length?(n(e),f()):n()},r.range=function(e){return arguments.length?([A,o]=e,A=+A,o=+o,f()):[A,o]},r.rangeRound=function(e){return[A,o]=e,A=+A,o=+o,s=!0,f()},r.bandwidth=function(){return t},r.step=function(){return e},r.round=function(e){return arguments.length?(s=!!e,f()):s},r.padding=function(e){return arguments.length?(u=Math.min(1,c=+e),f()):u},r.paddingInner=function(e){return arguments.length?(u=Math.min(1,e),f()):u},r.paddingOuter=function(e){return arguments.length?(c=+e,f()):c},r.align=function(e){return arguments.length?(l=Math.max(0,Math.min(1,e)),f()):l},r.copy=function(){return g(n(),[A,o]).round(s).paddingInner(u).paddingOuter(c).align(l)},a.apply(f(),arguments)}function y(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return y(t())},e}function v(){return y(g.apply(null,arguments).paddingInner(1))}const m=Math.sqrt(50),w=Math.sqrt(10),b=Math.sqrt(2);function B(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),A=n/Math.pow(10,i),o=A>=m?10:A>=w?5:A>=b?2:1;let a,s,u;return i<0?(u=Math.pow(10,-i)/o,a=Math.round(e*u),s=Math.round(t*u),a/u<e&&++a,s/u>t&&--s,u=-u):(u=Math.pow(10,i)*o,a=Math.round(e/u),s=Math.round(t/u),a*u<e&&++a,s*u>t&&--s),s<a&&.5<=r&&r<2?B(e,t,2*r):[a,s,u]}function C(e,t,r){if(!((r=+r)>0))return[];if((e=+e)===(t=+t))return[e];const n=t<e,[i,A,o]=n?B(t,e,r):B(e,t,r);if(!(A>=i))return[];const a=A-i+1,s=new Array(a);if(n)if(o<0)for(let e=0;e<a;++e)s[e]=(A-e)/-o;else for(let e=0;e<a;++e)s[e]=(A-e)*o;else if(o<0)for(let e=0;e<a;++e)s[e]=(i+e)/-o;else for(let e=0;e<a;++e)s[e]=(i+e)*o;return s}function E(e,t,r){return B(e=+e,t=+t,r=+r)[2]}function S(e,t,r){r=+r;const n=(t=+t)<(e=+e),i=n?E(t,e,r):E(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function I(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function O(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function F(e){let t,r,n;function i(e,n,i=0,A=e.length){if(i<A){if(0!==t(n,n))return A;do{const t=i+A>>>1;r(e[t],n)<0?i=t+1:A=t}while(i<A)}return i}return 2!==e.length?(t=I,r=(t,r)=>I(e(t),r),n=(t,r)=>e(t)-r):(t=e===I||e===O?e:_,r=e,n=e),{left:i,center:function(e,t,r=0,A=e.length){const o=i(e,t,r,A-1);return o>r&&n(e[o-1],t)>-n(e[o],t)?o-1:o},right:function(e,n,i=0,A=e.length){if(i<A){if(0!==t(n,n))return A;do{const t=i+A>>>1;r(e[t],n)<=0?i=t+1:A=t}while(i<A)}return i}}}function _(){return 0}function x(e){return null===e?NaN:+e}const U=F(I),Q=U.right,T=(U.left,F(x).center,Q);function M(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function P(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function D(){}var k=.7,N=1/k,R="\\s*([+-]?\\d+)\\s*",L="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",H="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",j=/^#([0-9a-f]{3,8})$/,V=new RegExp(`^rgb\\(${R},${R},${R}\\)$`),K=new RegExp(`^rgb\\(${H},${H},${H}\\)$`),z=new RegExp(`^rgba\\(${R},${R},${R},${L}\\)$`),G=new RegExp(`^rgba\\(${H},${H},${H},${L}\\)$`),W=new RegExp(`^hsl\\(${L},${H},${H}\\)$`),X=new RegExp(`^hsla\\(${L},${H},${H},${L}\\)$`),Y={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Z(){return this.rgb().formatHex()}function q(){return this.rgb().formatRgb()}function J(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=j.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?$(t):3===r?new re(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?ee(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?ee(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=V.exec(e))?new re(t[1],t[2],t[3],1):(t=K.exec(e))?new re(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=z.exec(e))?ee(t[1],t[2],t[3],t[4]):(t=G.exec(e))?ee(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=W.exec(e))?se(t[1],t[2]/100,t[3]/100,1):(t=X.exec(e))?se(t[1],t[2]/100,t[3]/100,t[4]):Y.hasOwnProperty(e)?$(Y[e]):"transparent"===e?new re(NaN,NaN,NaN,0):null}function $(e){return new re(e>>16&255,e>>8&255,255&e,1)}function ee(e,t,r,n){return n<=0&&(e=t=r=NaN),new re(e,t,r,n)}function te(e,t,r,n){return 1===arguments.length?((i=e)instanceof D||(i=J(i)),i?new re((i=i.rgb()).r,i.g,i.b,i.opacity):new re):new re(e,t,r,null==n?1:n);var i}function re(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function ne(){return`#${ae(this.r)}${ae(this.g)}${ae(this.b)}`}function ie(){const e=Ae(this.opacity);return`${1===e?"rgb(":"rgba("}${oe(this.r)}, ${oe(this.g)}, ${oe(this.b)}${1===e?")":`, ${e})`}`}function Ae(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function oe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ae(e){return((e=oe(e))<16?"0":"")+e.toString(16)}function se(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ce(e,t,r,n)}function ue(e){if(e instanceof ce)return new ce(e.h,e.s,e.l,e.opacity);if(e instanceof D||(e=J(e)),!e)return new ce;if(e instanceof ce)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),A=Math.max(t,r,n),o=NaN,a=A-i,s=(A+i)/2;return a?(o=t===A?(r-n)/a+6*(r<n):r===A?(n-t)/a+2:(t-r)/a+4,a/=s<.5?A+i:2-A-i,o*=60):a=s>0&&s<1?0:o,new ce(o,a,s,e.opacity)}function ce(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function le(e){return(e=(e||0)%360)<0?e+360:e}function fe(e){return Math.max(0,Math.min(1,e||0))}function de(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function he(e,t,r,n,i){var A=e*e,o=A*e;return((1-3*e+3*A-o)*t+(4-6*A+3*o)*r+(1+3*e+3*A-3*o)*n+o*i)/6}M(D,J,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Z,formatHex:Z,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ue(this).formatHsl()},formatRgb:q,toString:q}),M(re,te,P(D,{brighter(e){return e=null==e?N:Math.pow(N,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?k:Math.pow(k,e),new re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new re(oe(this.r),oe(this.g),oe(this.b),Ae(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ne,formatHex:ne,formatHex8:function(){return`#${ae(this.r)}${ae(this.g)}${ae(this.b)}${ae(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ie,toString:ie})),M(ce,function(e,t,r,n){return 1===arguments.length?ue(e):new ce(e,t,r,null==n?1:n)},P(D,{brighter(e){return e=null==e?N:Math.pow(N,e),new ce(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?k:Math.pow(k,e),new ce(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new re(de(e>=240?e-240:e+120,i,n),de(e,i,n),de(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ce(le(this.h),fe(this.s),fe(this.l),Ae(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ae(this.opacity);return`${1===e?"hsl(":"hsla("}${le(this.h)}, ${100*fe(this.s)}%, ${100*fe(this.l)}%${1===e?")":`, ${e})`}`}}));const pe=e=>()=>e;function ge(e,t){return function(r){return e+r*t}}function ye(e){return 1===(e=+e)?ve:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):pe(isNaN(t)?r:t)}}function ve(e,t){var r=t-e;return r?ge(e,r):pe(isNaN(e)?t:e)}const me=function e(t){var r=ye(t);function n(e,t){var n=r((e=te(e)).r,(t=te(t)).r),i=r(e.g,t.g),A=r(e.b,t.b),o=ve(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=A(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function we(e){return function(t){var r,n,i=t.length,A=new Array(i),o=new Array(i),a=new Array(i);for(r=0;r<i;++r)n=te(t[r]),A[r]=n.r||0,o[r]=n.g||0,a[r]=n.b||0;return A=e(A),o=e(o),a=e(a),n.opacity=1,function(e){return n.r=A(e),n.g=o(e),n.b=a(e),n+""}}}we(function(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],A=e[n+1],o=n>0?e[n-1]:2*i-A,a=n<t-1?e[n+2]:2*A-i;return he((r-n/t)*t,o,i,A,a)}}),we(function(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],A=e[n%t],o=e[(n+1)%t],a=e[(n+2)%t];return he((r-n/t)*t,i,A,o,a)}});function be(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,A=new Array(i),o=new Array(n);for(r=0;r<i;++r)A[r]=_e(e[r],t[r]);for(;r<n;++r)o[r]=t[r];return function(e){for(r=0;r<i;++r)o[r]=A[r](e);return o}}function Be(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Ce(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Ee(e,t){var r,n={},i={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=_e(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}var Se=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ie=new RegExp(Se.source,"g");function Oe(e,t){var r,n,i,A=Se.lastIndex=Ie.lastIndex=0,o=-1,a=[],s=[];for(e+="",t+="";(r=Se.exec(e))&&(n=Ie.exec(t));)(i=n.index)>A&&(i=t.slice(A,i),a[o]?a[o]+=i:a[++o]=i),(r=r[0])===(n=n[0])?a[o]?a[o]+=n:a[++o]=n:(a[++o]=null,s.push({i:o,x:Ce(r,n)})),A=Ie.lastIndex;return A<t.length&&(i=t.slice(A),a[o]?a[o]+=i:a[++o]=i),a.length<2?s[0]?function(e){return function(t){return e(t)+""}}(s[0].x):function(e){return function(){return e}}(t):(t=s.length,function(e){for(var r,n=0;n<t;++n)a[(r=s[n]).i]=r.x(e);return a.join("")})}function Fe(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,i=t.slice();return function(A){for(r=0;r<n;++r)i[r]=e[r]*(1-A)+t[r]*A;return i}}function _e(e,t){var r,n,i=typeof t;return null==t||"boolean"===i?pe(t):("number"===i?Ce:"string"===i?(r=J(t))?(t=r,me):Oe:t instanceof J?me:t instanceof Date?Be:(n=t,!ArrayBuffer.isView(n)||n instanceof DataView?Array.isArray(t)?be:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Ee:Ce:Fe))(e,t)}function xe(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Ue(e){return+e}var Qe=[0,1];function Te(e){return e}function Me(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:(r=isNaN(t)?NaN:.5,function(){return r});var r}function Pe(e,t,r){var n=e[0],i=e[1],A=t[0],o=t[1];return i<n?(n=Me(i,n),A=r(o,A)):(n=Me(n,i),A=r(A,o)),function(e){return A(n(e))}}function De(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),A=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=Me(e[o],e[o+1]),A[o]=r(t[o],t[o+1]);return function(t){var r=T(e,t,1,n)-1;return A[r](i[r](t))}}function ke(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ne(){var e,t,r,n,i,A,o=Qe,a=Qe,s=_e,u=Te;function c(){var e,t,r,s=Math.min(o.length,a.length);return u!==Te&&(e=o[0],t=o[s-1],e>t&&(r=e,e=t,t=r),u=function(r){return Math.max(e,Math.min(t,r))}),n=s>2?De:Pe,i=A=null,l}function l(t){return null==t||isNaN(t=+t)?r:(i||(i=n(o.map(e),a,s)))(e(u(t)))}return l.invert=function(r){return u(t((A||(A=n(a,o.map(e),Ce)))(r)))},l.domain=function(e){return arguments.length?(o=Array.from(e,Ue),c()):o.slice()},l.range=function(e){return arguments.length?(a=Array.from(e),c()):a.slice()},l.rangeRound=function(e){return a=Array.from(e),s=xe,c()},l.clamp=function(e){return arguments.length?(u=!!e||Te,c()):u!==Te},l.interpolate=function(e){return arguments.length?(s=e,c()):s},l.unknown=function(e){return arguments.length?(r=e,l):r},function(r,n){return e=r,t=n,c()}}function Re(){return Ne()(Te,Te)}var Le,He=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function je(e){if(!(t=He.exec(e)))throw new Error("invalid format: "+e);var t;return new Ve({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Ve(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function Ke(e,t){if(!isFinite(e)||0===e)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ze(e){return(e=Ke(Math.abs(e)))?e[1]:NaN}function Ge(e,t){var r=Ke(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}je.prototype=Ve.prototype,Ve.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const We={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Ge(100*e,t),r:Ge,s:function(e,t){var r=Ke(e,t);if(!r)return Le=void 0,e.toPrecision(t);var n=r[0],i=r[1],A=i-(Le=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=n.length;return A===o?n:A>o?n+new Array(A-o+1).join("0"):A>0?n.slice(0,A)+"."+n.slice(A):"0."+new Array(1-A).join("0")+Ke(e,Math.max(0,t+A-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Xe(e){return e}var Ye,Ze,qe,Je=Array.prototype.map,$e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function et(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?Xe:(t=Je.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var i=e.length,A=[],o=0,a=t[0],s=0;i>0&&a>0&&(s+a+1>n&&(a=Math.max(1,n-s)),A.push(e.substring(i-=a,i+a)),!((s+=a+1)>n));)a=t[o=(o+1)%t.length];return A.reverse().join(r)}),i=void 0===e.currency?"":e.currency[0]+"",A=void 0===e.currency?"":e.currency[1]+"",o=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?Xe:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(Je.call(e.numerals,String)),s=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function l(e,t){var r=(e=je(e)).fill,l=e.align,f=e.sign,d=e.symbol,h=e.zero,p=e.width,g=e.comma,y=e.precision,v=e.trim,m=e.type;"n"===m?(g=!0,m="g"):We[m]||(void 0===y&&(y=12),v=!0,m="g"),(h||"0"===r&&"="===l)&&(h=!0,r="0",l="=");var w=(t&&void 0!==t.prefix?t.prefix:"")+("$"===d?i:"#"===d&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b=("$"===d?A:/[%p]/.test(m)?s:"")+(t&&void 0!==t.suffix?t.suffix:""),B=We[m],C=/[defgprs%]/.test(m);function E(e){var t,i,A,s=w,d=b;if("c"===m)d=B(e)+d,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:B(Math.abs(e),y),v&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(!+e[n])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),E&&0===+e&&"+"!==f&&(E=!1),s=(E?"("===f?f:u:"-"===f||"("===f?"":f)+s,d=("s"!==m||isNaN(e)||void 0===Le?"":$e[8+Le/3])+d+(E&&"("===f?")":""),C)for(t=-1,i=e.length;++t<i;)if(48>(A=e.charCodeAt(t))||A>57){d=(46===A?o+e.slice(t+1):e.slice(t))+d,e=e.slice(0,t);break}}g&&!h&&(e=n(e,1/0));var S=s.length+e.length+d.length,I=S<p?new Array(p-S+1).join(r):"";switch(g&&h&&(e=n(I+e,I.length?p-d.length:1/0),I=""),l){case"<":e=s+e+d+I;break;case"=":e=s+I+e+d;break;case"^":e=I.slice(0,S=I.length>>1)+s+e+d+I.slice(S);break;default:e=I+s+e+d}return a(e)}return y=void 0===y?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),E.toString=function(){return e+""},E}return{format:l,formatPrefix:function(e,t){var r=3*Math.max(-8,Math.min(8,Math.floor(ze(t)/3))),n=Math.pow(10,-r),i=l(((e=je(e)).type="f",e),{suffix:$e[8+r/3]});return function(e){return i(n*e)}}}}function tt(e,t,r,n){var i,A=S(e,t,r);switch((n=je(null==n?",f":n)).type){case"s":var o=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ze(t)/3)))-ze(Math.abs(e)))}(A,o))||(n.precision=i),qe(n,o);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ze(t)-ze(e))+1}(A,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(e){return Math.max(0,-ze(Math.abs(e)))}(A))||(n.precision=i-2*("%"===n.type))}return Ze(n)}function rt(e){var t=e.domain;return e.ticks=function(e){var r=t();return C(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return tt(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,i,A=t(),o=0,a=A.length-1,s=A[o],u=A[a],c=10;for(u<s&&(i=s,s=u,u=i,i=o,o=a,a=i);c-- >0;){if((i=E(s,u,r))===n)return A[o]=s,A[a]=u,t(A);if(i>0)s=Math.floor(s/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,u=Math.floor(u*i)/i}n=i}return e},e}function nt(){var e=Re();return e.copy=function(){return ke(e,nt())},a.apply(e,arguments),rt(e)}function it(e){var t;function r(e){return null==e||isNaN(e=+e)?t:e}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,Ue),r):e.slice()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return it(e).unknown(t)},e=arguments.length?Array.from(e,Ue):[0,1],rt(r)}function At(e,t){var r,n=0,i=(e=e.slice()).length-1,A=e[n],o=e[i];return o<A&&(r=n,n=i,i=r,r=A,A=o,o=r),e[n]=t.floor(A),e[i]=t.ceil(o),e}function ot(e){return Math.log(e)}function at(e){return Math.exp(e)}function st(e){return-Math.log(-e)}function ut(e){return-Math.exp(-e)}function ct(e){return isFinite(e)?+("1e"+e):e<0?0:e}function lt(e){return(t,r)=>-e(-t,r)}function ft(e){const t=e(ot,at),r=t.domain;let n,i,A=10;function o(){return n=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(A),i=function(e){return 10===e?ct:e===Math.E?Math.exp:t=>Math.pow(e,t)}(A),r()[0]<0?(n=lt(n),i=lt(i),e(st,ut)):e(ot,at),t}return t.base=function(e){return arguments.length?(A=+e,o()):A},t.domain=function(e){return arguments.length?(r(e),o()):r()},t.ticks=e=>{const t=r();let o=t[0],a=t[t.length-1];const s=a<o;s&&([o,a]=[a,o]);let u,c,l=n(o),f=n(a);const d=null==e?10:+e;let h=[];if(!(A%1)&&f-l<d){if(l=Math.floor(l),f=Math.ceil(f),o>0){for(;l<=f;++l)for(u=1;u<A;++u)if(c=l<0?u/i(-l):u*i(l),!(c<o)){if(c>a)break;h.push(c)}}else for(;l<=f;++l)for(u=A-1;u>=1;--u)if(c=l>0?u/i(-l):u*i(l),!(c<o)){if(c>a)break;h.push(c)}2*h.length<d&&(h=C(o,a,d))}else h=C(l,f,Math.min(f-l,d)).map(i);return s?h.reverse():h},t.tickFormat=(e,r)=>{if(null==e&&(e=10),null==r&&(r=10===A?"s":","),"function"!=typeof r&&(A%1||null!=(r=je(r)).precision||(r.trim=!0),r=Ze(r)),e===1/0)return r;const o=Math.max(1,A*e/t.ticks().length);return e=>{let t=e/i(Math.round(n(e)));return t*A<A-.5&&(t*=A),t<=o?r(e):""}},t.nice=()=>r(At(r(),{floor:e=>i(Math.floor(n(e))),ceil:e=>i(Math.ceil(n(e)))})),t}function dt(){const e=ft(Ne()).domain([1,10]);return e.copy=()=>ke(e,dt()).base(e.base()),a.apply(e,arguments),e}function ht(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function pt(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function gt(e){var t=1,r=e(ht(t),pt(t));return r.constant=function(r){return arguments.length?e(ht(t=+r),pt(t)):t},rt(r)}function yt(){var e=gt(Ne());return e.copy=function(){return ke(e,yt()).constant(e.constant())},a.apply(e,arguments)}function vt(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function mt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function wt(e){return e<0?-e*e:e*e}function bt(e){var t=e(Te,Te),r=1;return t.exponent=function(t){return arguments.length?1===(r=+t)?e(Te,Te):.5===r?e(mt,wt):e(vt(r),vt(1/r)):r},rt(t)}function Bt(){var e=bt(Ne());return e.copy=function(){return ke(e,Bt()).exponent(e.exponent())},a.apply(e,arguments),e}function Ct(){return Bt.apply(null,arguments).exponent(.5)}function Et(e){return Math.sign(e)*e*e}function St(){var e,t=Re(),r=[0,1],n=!1;function i(r){var i=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(r));return isNaN(i)?e:n?Math.round(i):i}return i.invert=function(e){return t.invert(Et(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain()},i.range=function(e){return arguments.length?(t.range((r=Array.from(e,Ue)).map(Et)),i):r.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(e){return arguments.length?(t.clamp(e),i):t.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return St(t.domain(),r).round(n).clamp(t.clamp()).unknown(e)},a.apply(i,arguments),rt(i)}function It(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function Ot(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function Ft(e=I){if(e===I)return _t;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||0===n?n:(0===e(r,r))-(0===e(t,t))}}function _t(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function xt(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=void 0===i?_t:Ft(i);n>r;){if(n-r>600){const A=n-r+1,o=t-r+1,a=Math.log(A),s=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*s*(A-s)/A)*(o-A/2<0?-1:1);xt(e,t,Math.max(r,Math.floor(t-o*s/A+u)),Math.min(n,Math.floor(t+(A-o)*s/A+u)),i)}const A=e[t];let o=r,a=n;for(Ut(e,r,t),i(e[n],A)>0&&Ut(e,r,n);o<a;){for(Ut(e,o,a),++o,--a;i(e[o],A)<0;)++o;for(;i(e[a],A)>0;)--a}0===i(e[r],A)?Ut(e,r,a):(++a,Ut(e,a,n)),a<=t&&(r=a+1),t<=a&&(n=a-1)}return e}function Ut(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Qt(e,t,r){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let r=-1;for(let n of e)null!=(n=t(n,++r,e))&&(n=+n)>=n&&(yield n)}}(e,r)),(n=e.length)&&!isNaN(t=+t)){if(t<=0||n<2)return Ot(e);if(t>=1)return It(e);var n,i=(n-1)*t,A=Math.floor(i),o=It(xt(e,A).subarray(0,A+1));return o+(Ot(e.subarray(A+1))-o)*(i-A)}}function Tt(e,t,r=x){if((n=e.length)&&!isNaN(t=+t)){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,A=Math.floor(i),o=+r(e[A],A,e);return o+(+r(e[A+1],A+1,e)-o)*(i-A)}}function Mt(){var e,t=[],r=[],n=[];function i(){var e=0,i=Math.max(1,r.length);for(n=new Array(i-1);++e<i;)n[e-1]=Tt(t,e/i);return A}function A(t){return null==t||isNaN(t=+t)?e:r[T(n,t)]}return A.invertExtent=function(e){var i=r.indexOf(e);return i<0?[NaN,NaN]:[i>0?n[i-1]:t[0],i<n.length?n[i]:t[t.length-1]]},A.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let r of e)null==r||isNaN(r=+r)||t.push(r);return t.sort(I),i()},A.range=function(e){return arguments.length?(r=Array.from(e),i()):r.slice()},A.unknown=function(t){return arguments.length?(e=t,A):e},A.quantiles=function(){return n.slice()},A.copy=function(){return Mt().domain(t).range(r).unknown(e)},a.apply(A,arguments)}function Pt(){var e,t=0,r=1,n=1,i=[.5],A=[0,1];function o(t){return null!=t&&t<=t?A[T(i,t,0,n)]:e}function s(){var e=-1;for(i=new Array(n);++e<n;)i[e]=((e+1)*r-(e-n)*t)/(n+1);return o}return o.domain=function(e){return arguments.length?([t,r]=e,t=+t,r=+r,s()):[t,r]},o.range=function(e){return arguments.length?(n=(A=Array.from(e)).length-1,s()):A.slice()},o.invertExtent=function(e){var o=A.indexOf(e);return o<0?[NaN,NaN]:o<1?[t,i[0]]:o>=n?[i[n-1],r]:[i[o-1],i[o]]},o.unknown=function(t){return arguments.length?(e=t,o):o},o.thresholds=function(){return i.slice()},o.copy=function(){return Pt().domain([t,r]).range(A).unknown(e)},a.apply(rt(o),arguments)}function Dt(){var e,t=[.5],r=[0,1],n=1;function i(i){return null!=i&&i<=i?r[T(t,i,0,n)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),n=Math.min(t.length,r.length-1),i):t.slice()},i.range=function(e){return arguments.length?(r=Array.from(e),n=Math.min(t.length,r.length-1),i):r.slice()},i.invertExtent=function(e){var n=r.indexOf(e);return[t[n-1],t[n]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return Dt().domain(t).range(r).unknown(e)},a.apply(i,arguments)}Ye=et({thousands:",",grouping:[3],currency:["$",""]}),Ze=Ye.format,qe=Ye.formatPrefix;const kt=1e3,Nt=6e4,Rt=36e5,Lt=864e5,Ht=6048e5,jt=2592e6,Vt=31536e6,Kt=new Date,zt=new Date;function Gt(e,t,r,n){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=r=>(e(r=new Date(r-1)),t(r,1),e(r),r),i.round=e=>{const t=i(e),r=i.ceil(e);return e-t<r-e?t:r},i.offset=(e,r)=>(t(e=new Date(+e),null==r?1:Math.floor(r)),e),i.range=(r,n,A)=>{const o=[];if(r=i.ceil(r),A=null==A?1:Math.floor(A),!(r<n&&A>0))return o;let a;do{o.push(a=new Date(+r)),t(r,A),e(r)}while(a<r&&r<n);return o},i.filter=r=>Gt(t=>{if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)},(e,n)=>{if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););}),r&&(i.count=(t,n)=>(Kt.setTime(+t),zt.setTime(+n),e(Kt),e(zt),Math.floor(r(Kt,zt))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(n?t=>n(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const Wt=Gt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Wt.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?Gt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Wt:null);Wt.range;const Xt=Gt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*kt)},(e,t)=>(t-e)/kt,e=>e.getUTCSeconds()),Yt=(Xt.range,Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kt)},(e,t)=>{e.setTime(+e+t*Nt)},(e,t)=>(t-e)/Nt,e=>e.getMinutes())),Zt=(Yt.range,Gt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Nt)},(e,t)=>(t-e)/Nt,e=>e.getUTCMinutes())),qt=(Zt.range,Gt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kt-e.getMinutes()*Nt)},(e,t)=>{e.setTime(+e+t*Rt)},(e,t)=>(t-e)/Rt,e=>e.getHours())),Jt=(qt.range,Gt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Rt)},(e,t)=>(t-e)/Rt,e=>e.getUTCHours())),$t=(Jt.range,Gt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Nt)/Lt,e=>e.getDate()-1)),er=($t.range,Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Lt,e=>e.getUTCDate()-1)),tr=(er.range,Gt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Lt,e=>Math.floor(e/Lt)));tr.range;function rr(e){return Gt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Nt)/Ht)}const nr=rr(0),ir=rr(1),Ar=rr(2),or=rr(3),ar=rr(4),sr=rr(5),ur=rr(6);nr.range,ir.range,Ar.range,or.range,ar.range,sr.range,ur.range;function cr(e){return Gt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Ht)}const lr=cr(0),fr=cr(1),dr=cr(2),hr=cr(3),pr=cr(4),gr=cr(5),yr=cr(6),vr=(lr.range,fr.range,dr.range,hr.range,pr.range,gr.range,yr.range,Gt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth())),mr=(vr.range,Gt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth())),wr=(mr.range,Gt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()));wr.every=e=>isFinite(e=Math.floor(e))&&e>0?Gt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)}):null;wr.range;const br=Gt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());br.every=e=>isFinite(e=Math.floor(e))&&e>0?Gt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)}):null;br.range;function Br(e,t,r,n,i,A){const o=[[Xt,1,kt],[Xt,5,5e3],[Xt,15,15e3],[Xt,30,3e4],[A,1,Nt],[A,5,3e5],[A,15,9e5],[A,30,18e5],[i,1,Rt],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,Lt],[n,2,1728e5],[r,1,Ht],[t,1,jt],[t,3,7776e6],[e,1,Vt]];function a(t,r,n){const i=Math.abs(r-t)/n,A=F(([,,e])=>e).right(o,i);if(A===o.length)return e.every(S(t/Vt,r/Vt,n));if(0===A)return Wt.every(Math.max(S(t,r,n),1));const[a,s]=o[i/o[A-1][2]<o[A][2]/i?A-1:A];return a.every(s)}return[function(e,t,r){const n=t<e;n&&([e,t]=[t,e]);const i=r&&"function"==typeof r.range?r:a(e,t,r),A=i?i.range(e,+t+1):[];return n?A.reverse():A},a]}const[Cr,Er]=Br(br,mr,lr,tr,Jt,Zt),[Sr,Ir]=Br(wr,vr,nr,$t,qt,Yt);function Or(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Fr(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _r(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}var xr,Ur,Qr,Tr={"-":"",_:" ",0:"0"},Mr=/^\s*\d+/,Pr=/^%/,Dr=/[\\^$*+?|[\]().{}]/g;function kr(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",A=i.length;return n+(A<r?new Array(r-A+1).join(t)+i:i)}function Nr(e){return e.replace(Dr,"\\$&")}function Rr(e){return new RegExp("^(?:"+e.map(Nr).join("|")+")","i")}function Lr(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Hr(e,t,r){var n=Mr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function jr(e,t,r){var n=Mr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Vr(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Kr(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function zr(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Gr(e,t,r){var n=Mr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Wr(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Xr(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Yr(e,t,r){var n=Mr.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function Zr(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function qr(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Jr(e,t,r){var n=Mr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function $r(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function en(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function tn(e,t,r){var n=Mr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function rn(e,t,r){var n=Mr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function nn(e,t,r){var n=Mr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function An(e,t,r){var n=Pr.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function on(e,t,r){var n=Mr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function an(e,t,r){var n=Mr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function sn(e,t){return kr(e.getDate(),t,2)}function un(e,t){return kr(e.getHours(),t,2)}function cn(e,t){return kr(e.getHours()%12||12,t,2)}function ln(e,t){return kr(1+$t.count(wr(e),e),t,3)}function fn(e,t){return kr(e.getMilliseconds(),t,3)}function dn(e,t){return fn(e,t)+"000"}function hn(e,t){return kr(e.getMonth()+1,t,2)}function pn(e,t){return kr(e.getMinutes(),t,2)}function gn(e,t){return kr(e.getSeconds(),t,2)}function yn(e){var t=e.getDay();return 0===t?7:t}function vn(e,t){return kr(nr.count(wr(e)-1,e),t,2)}function mn(e){var t=e.getDay();return t>=4||0===t?ar(e):ar.ceil(e)}function wn(e,t){return e=mn(e),kr(ar.count(wr(e),e)+(4===wr(e).getDay()),t,2)}function bn(e){return e.getDay()}function Bn(e,t){return kr(ir.count(wr(e)-1,e),t,2)}function Cn(e,t){return kr(e.getFullYear()%100,t,2)}function En(e,t){return kr((e=mn(e)).getFullYear()%100,t,2)}function Sn(e,t){return kr(e.getFullYear()%1e4,t,4)}function In(e,t){var r=e.getDay();return kr((e=r>=4||0===r?ar(e):ar.ceil(e)).getFullYear()%1e4,t,4)}function On(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+kr(t/60|0,"0",2)+kr(t%60,"0",2)}function Fn(e,t){return kr(e.getUTCDate(),t,2)}function _n(e,t){return kr(e.getUTCHours(),t,2)}function xn(e,t){return kr(e.getUTCHours()%12||12,t,2)}function Un(e,t){return kr(1+er.count(br(e),e),t,3)}function Qn(e,t){return kr(e.getUTCMilliseconds(),t,3)}function Tn(e,t){return Qn(e,t)+"000"}function Mn(e,t){return kr(e.getUTCMonth()+1,t,2)}function Pn(e,t){return kr(e.getUTCMinutes(),t,2)}function Dn(e,t){return kr(e.getUTCSeconds(),t,2)}function kn(e){var t=e.getUTCDay();return 0===t?7:t}function Nn(e,t){return kr(lr.count(br(e)-1,e),t,2)}function Rn(e){var t=e.getUTCDay();return t>=4||0===t?pr(e):pr.ceil(e)}function Ln(e,t){return e=Rn(e),kr(pr.count(br(e),e)+(4===br(e).getUTCDay()),t,2)}function Hn(e){return e.getUTCDay()}function jn(e,t){return kr(fr.count(br(e)-1,e),t,2)}function Vn(e,t){return kr(e.getUTCFullYear()%100,t,2)}function Kn(e,t){return kr((e=Rn(e)).getUTCFullYear()%100,t,2)}function zn(e,t){return kr(e.getUTCFullYear()%1e4,t,4)}function Gn(e,t){var r=e.getUTCDay();return kr((e=r>=4||0===r?pr(e):pr.ceil(e)).getUTCFullYear()%1e4,t,4)}function Wn(){return"+0000"}function Xn(){return"%"}function Yn(e){return+e}function Zn(e){return Math.floor(+e/1e3)}function qn(e){return new Date(e)}function Jn(e){return e instanceof Date?+e:+new Date(+e)}function $n(e,t,r,n,i,A,o,a,s,u){var c=Re(),l=c.invert,f=c.domain,d=u(".%L"),h=u(":%S"),p=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),v=u("%b %d"),m=u("%B"),w=u("%Y");function b(e){return(s(e)<e?d:a(e)<e?h:o(e)<e?p:A(e)<e?g:n(e)<e?i(e)<e?y:v:r(e)<e?m:w)(e)}return c.invert=function(e){return new Date(l(e))},c.domain=function(e){return arguments.length?f(Array.from(e,Jn)):f().map(qn)},c.ticks=function(t){var r=f();return e(r[0],r[r.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?b:u(t)},c.nice=function(e){var r=f();return e&&"function"==typeof e.range||(e=t(r[0],r[r.length-1],null==e?10:e)),e?f(At(r,e)):c},c.copy=function(){return ke(c,$n(e,t,r,n,i,A,o,a,s,u))},c}function ei(){return a.apply($n(Sr,Ir,wr,vr,nr,$t,qt,Yt,Xt,Ur).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ti(){return a.apply($n(Cr,Er,br,mr,lr,er,Jt,Zt,Xt,Qr).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ri(){var e,t,r,n,i,A=0,o=1,a=Te,s=!1;function u(t){return null==t||isNaN(t=+t)?i:a(0===r?.5:(t=(n(t)-e)*r,s?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var r,n;return arguments.length?([r,n]=t,a=e(r,n),u):[a(0),a(1)]}}return u.domain=function(i){return arguments.length?([A,o]=i,e=n(A=+A),t=n(o=+o),r=e===t?0:1/(t-e),u):[A,o]},u.clamp=function(e){return arguments.length?(s=!!e,u):s},u.interpolator=function(e){return arguments.length?(a=e,u):a},u.range=c(_e),u.rangeRound=c(xe),u.unknown=function(e){return arguments.length?(i=e,u):i},function(i){return n=i,e=i(A),t=i(o),r=e===t?0:1/(t-e),u}}function ni(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function ii(){var e=rt(ri()(Te));return e.copy=function(){return ni(e,ii())},s.apply(e,arguments)}function Ai(){var e=ft(ri()).domain([1,10]);return e.copy=function(){return ni(e,Ai()).base(e.base())},s.apply(e,arguments)}function oi(){var e=gt(ri());return e.copy=function(){return ni(e,oi()).constant(e.constant())},s.apply(e,arguments)}function ai(){var e=bt(ri());return e.copy=function(){return ni(e,ai()).exponent(e.exponent())},s.apply(e,arguments)}function si(){return ai.apply(null,arguments).exponent(.5)}function ui(){var e=[],t=Te;function r(r){if(null!=r&&!isNaN(r=+r))return t((T(e,r,1)-1)/(e.length-1))}return r.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let r of t)null==r||isNaN(r=+r)||e.push(r);return e.sort(I),r},r.interpolator=function(e){return arguments.length?(t=e,r):t},r.range=function(){return e.map((r,n)=>t(n/(e.length-1)))},r.quantiles=function(t){return Array.from({length:t+1},(r,n)=>Qt(e,n/t))},r.copy=function(){return ui(t).domain(e)},s.apply(r,arguments)}function ci(){var e,t,r,n,i,A,o,a=0,s=.5,u=1,c=1,l=Te,f=!1;function d(e){return isNaN(e=+e)?o:(e=.5+((e=+A(e))-t)*(c*e<c*t?n:i),l(f?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var r,n,i;return arguments.length?([r,n,i]=t,l=function(e,t){void 0===t&&(t=e,e=_e);for(var r=0,n=t.length-1,i=t[0],A=new Array(n<0?0:n);r<n;)A[r]=e(i,i=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return A[t](e-t)}}(e,[r,n,i]),d):[l(0),l(.5),l(1)]}}return d.domain=function(o){return arguments.length?([a,s,u]=o,e=A(a=+a),t=A(s=+s),r=A(u=+u),n=e===t?0:.5/(t-e),i=t===r?0:.5/(r-t),c=t<e?-1:1,d):[a,s,u]},d.clamp=function(e){return arguments.length?(f=!!e,d):f},d.interpolator=function(e){return arguments.length?(l=e,d):l},d.range=h(_e),d.rangeRound=h(xe),d.unknown=function(e){return arguments.length?(o=e,d):o},function(o){return A=o,e=o(a),t=o(s),r=o(u),n=e===t?0:.5/(t-e),i=t===r?0:.5/(r-t),c=t<e?-1:1,d}}function li(){var e=rt(ci()(Te));return e.copy=function(){return ni(e,li())},s.apply(e,arguments)}function fi(){var e=ft(ci()).domain([.1,1,10]);return e.copy=function(){return ni(e,fi()).base(e.base())},s.apply(e,arguments)}function di(){var e=gt(ci());return e.copy=function(){return ni(e,di()).constant(e.constant())},s.apply(e,arguments)}function hi(){var e=bt(ci());return e.copy=function(){return ni(e,hi()).exponent(e.exponent())},s.apply(e,arguments)}function pi(){return hi.apply(null,arguments).exponent(.5)}!function(e){xr=function(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,A=e.days,o=e.shortDays,a=e.months,s=e.shortMonths,u=Rr(i),c=Lr(i),l=Rr(A),f=Lr(A),d=Rr(o),h=Lr(o),p=Rr(a),g=Lr(a),y=Rr(s),v=Lr(s),m={a:function(e){return o[e.getDay()]},A:function(e){return A[e.getDay()]},b:function(e){return s[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:sn,e:sn,f:dn,g:En,G:In,H:un,I:cn,j:ln,L:fn,m:hn,M:pn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Yn,s:Zn,S:gn,u:yn,U:vn,V:wn,w:bn,W:Bn,x:null,X:null,y:Cn,Y:Sn,Z:On,"%":Xn},w={a:function(e){return o[e.getUTCDay()]},A:function(e){return A[e.getUTCDay()]},b:function(e){return s[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:Fn,e:Fn,f:Tn,g:Kn,G:Gn,H:_n,I:xn,j:Un,L:Qn,m:Mn,M:Pn,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Yn,s:Zn,S:Dn,u:kn,U:Nn,V:Ln,w:Hn,W:jn,x:null,X:null,y:Vn,Y:zn,Z:Wn,"%":Xn},b={a:function(e,t,r){var n=d.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){var n=l.exec(t.slice(r));return n?(e.w=f.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){var n=y.exec(t.slice(r));return n?(e.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){var n=p.exec(t.slice(r));return n?(e.m=g.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,r,n){return E(e,t,r,n)},d:qr,e:qr,f:nn,g:Wr,G:Gr,H:$r,I:$r,j:Jr,L:rn,m:Zr,M:en,p:function(e,t,r){var n=u.exec(t.slice(r));return n?(e.p=c.get(n[0].toLowerCase()),r+n[0].length):-1},q:Yr,Q:on,s:an,S:tn,u:jr,U:Vr,V:Kr,w:Hr,W:zr,x:function(e,t,n){return E(e,r,t,n)},X:function(e,t,r){return E(e,n,t,r)},y:Wr,Y:Gr,Z:Xr,"%":An};function B(e,t){return function(r){var n,i,A,o=[],a=-1,s=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++a<u;)37===e.charCodeAt(a)&&(o.push(e.slice(s,a)),null!=(i=Tr[n=e.charAt(++a)])?n=e.charAt(++a):i="e"===n?" ":"0",(A=t[n])&&(n=A(r,i)),o.push(n),s=a+1);return o.push(e.slice(s,a)),o.join("")}}function C(e,t){return function(r){var n,i,A=_r(1900,void 0,1);if(E(A,e,r+="",0)!=r.length)return null;if("Q"in A)return new Date(A.Q);if("s"in A)return new Date(1e3*A.s+("L"in A?A.L:0));if(t&&!("Z"in A)&&(A.Z=0),"p"in A&&(A.H=A.H%12+12*A.p),void 0===A.m&&(A.m="q"in A?A.q:0),"V"in A){if(A.V<1||A.V>53)return null;"w"in A||(A.w=1),"Z"in A?(i=(n=Fr(_r(A.y,0,1))).getUTCDay(),n=i>4||0===i?fr.ceil(n):fr(n),n=er.offset(n,7*(A.V-1)),A.y=n.getUTCFullYear(),A.m=n.getUTCMonth(),A.d=n.getUTCDate()+(A.w+6)%7):(i=(n=Or(_r(A.y,0,1))).getDay(),n=i>4||0===i?ir.ceil(n):ir(n),n=$t.offset(n,7*(A.V-1)),A.y=n.getFullYear(),A.m=n.getMonth(),A.d=n.getDate()+(A.w+6)%7)}else("W"in A||"U"in A)&&("w"in A||(A.w="u"in A?A.u%7:"W"in A?1:0),i="Z"in A?Fr(_r(A.y,0,1)).getUTCDay():Or(_r(A.y,0,1)).getDay(),A.m=0,A.d="W"in A?(A.w+6)%7+7*A.W-(i+5)%7:A.w+7*A.U-(i+6)%7);return"Z"in A?(A.H+=A.Z/100|0,A.M+=A.Z%100,Fr(A)):Or(A)}}function E(e,t,r,n){for(var i,A,o=0,a=t.length,s=r.length;o<a;){if(n>=s)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(A=b[i in Tr?t.charAt(o++):i])||(n=A(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return m.x=B(r,m),m.X=B(n,m),m.c=B(t,m),w.x=B(r,w),w.X=B(n,w),w.c=B(t,w),{format:function(e){var t=B(e+="",m);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=B(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}(e),Ur=xr.format,xr.parse,Qr=xr.utcFormat,xr.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var gi,yi=r(19287),vi=r(26470),mi=r(98453),wi=r(93749),bi=r(59744),Bi=r(8813),Ci=r(38351),Ei=r.n(Ci),Si=e=>e,Ii={"@@functional/placeholder":!0},Oi=e=>e===Ii,Fi=e=>function t(){return 0===arguments.length||1===arguments.length&&Oi(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},_i=(e,t)=>1===e?t:Fi(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var A=n.filter(e=>e!==Ii).length;return A>=e?t(...n):_i(e-A,Fi(function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var A=n.map(e=>Oi(e)?r.shift():e);return t(...A,...r)}))}),xi=(e,t)=>{for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},Ui=_i((gi=(e,t)=>Array.isArray(t)?t.map(e):Object.keys(t).map(e=>t[e]).map(e)).length,gi);function Qi(e){return 0===e?1:Math.floor(new(Ei())(e).abs().log(10).toNumber())+1}function Ti(e,t,r){for(var n=new(Ei())(e),i=0,A=[];n.lt(t)&&i<1e5;)A.push(n.toNumber()),n=n.add(r),i++;return A}var Mi=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},Pi=(e,t,r)=>{if(e.lte(0))return new(Ei())(0);var n=Qi(e.toNumber()),i=new(Ei())(10).pow(n),A=e.div(i),o=1!==n?.05:.1,a=new(Ei())(Math.ceil(A.div(o).toNumber())).add(r).mul(o).mul(i);return t?new(Ei())(a.toNumber()):new(Ei())(Math.ceil(a.toNumber()))},Di=(e,t,r)=>{var n=new(Ei())(1),i=new(Ei())(e);if(!i.isint()&&r){var A=Math.abs(e);A<1?(n=new(Ei())(10).pow(Qi(e)-1),i=new(Ei())(Math.floor(i.div(n).toNumber())).mul(n)):A>1&&(i=new(Ei())(Math.floor(e)))}else 0===e?i=new(Ei())(Math.floor((t-1)/2)):r||(i=new(Ei())(Math.floor(e)));var o=Math.floor((t-1)/2),a=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.length)return Si;var n=t.reverse(),i=n[0],A=n.slice(1);return function(){return A.reduce((e,t)=>t(e),i(...arguments))}}(Ui(e=>i.add(new(Ei())(e-o).mul(n)).toNumber()),xi);return a(0,t)},ki=function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new(Ei())(0),tickMin:new(Ei())(0),tickMax:new(Ei())(0)};var A,o=Pi(new(Ei())(t).sub(e).div(r-1),n,i);A=e<=0&&t>=0?new(Ei())(0):(A=new(Ei())(e).add(t).div(2)).sub(new(Ei())(A).mod(o));var a=Math.ceil(A.sub(e).div(o).toNumber()),s=Math.ceil(new(Ei())(t).sub(A).div(o).toNumber()),u=a+s+1;return u>r?ki(e,t,r,n,i+1):(u<r&&(s=t>0?s+(r-u):s,a=t>0?a:a+(r-u)),{step:o,tickMin:A.sub(new(Ei())(a).mul(o)),tickMax:A.add(new(Ei())(s).mul(o))})},Ni=r(5180),Ri=r(68861),Li=r(36189),Hi=r(76461),ji=r(82695),Vi=r(19538),Ki=r(41927),zi=r(79926),Gi=r(19495),Wi=r(4364),Xi=r(72925),Yi=r(86907),Zi=r(9531),qi=r(6392),Ji=r(22608),$i=r(93569),eA=r(86680);function tA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function rA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tA(Object(r),!0).forEach(function(t){nA(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function nA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var iA=[0,"auto"],AA={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},oA=(e,t)=>e.cartesianAxis.xAxis[t],aA=(e,t)=>{var r=oA(e,t);return null==r?AA:r},sA={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:iA,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:Wi.tQ},uA=(e,t)=>e.cartesianAxis.yAxis[t],cA=(e,t)=>{var r=uA(e,t);return null==r?sA:r},lA={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},fA=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return null==r?lA:r},dA=(e,t,r)=>{switch(t){case"xAxis":return aA(e,r);case"yAxis":return cA(e,r);case"zAxis":return fA(e,r);case"angleAxis":return(0,Vi.Be)(e,r);case"radiusAxis":return(0,Vi.Gl)(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},hA=(e,t,r)=>{switch(t){case"xAxis":return aA(e,r);case"yAxis":return cA(e,r);case"angleAxis":return(0,Vi.Be)(e,r);case"radiusAxis":return(0,Vi.Gl)(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},pA=e=>e.graphicalItems.cartesianItems.some(e=>"bar"===e.type)||e.graphicalItems.polarItems.some(e=>"radialBar"===e.type);function gA(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var yA=e=>e.graphicalItems.cartesianItems,vA=(0,i.Mz)([Ki.N,zi.E],gA),mA=(e,t,r)=>e.filter(r).filter(e=>!0===(null==t?void 0:t.includeHidden)||!e.hide),wA=(0,i.Mz)([yA,dA,vA],mA,{memoizeOptions:{resultEqualityCheck:Ji.O}}),bA=(0,i.Mz)([wA],e=>e.filter(e=>"area"===e.type||"bar"===e.type).filter(Zi.g)),BA=e=>e.filter(e=>!("stackId"in e)||void 0===e.stackId),CA=(0,i.Mz)([wA],BA),EA=e=>e.map(e=>e.data).filter(Boolean).flat(1),SA=(0,i.Mz)([wA],EA,{memoizeOptions:{resultEqualityCheck:Ji.O}}),IA=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},OA=(0,i.Mz)([SA,mi.k$],IA),FA=(e,t,r)=>null!=(null==t?void 0:t.dataKey)?e.map(e=>({value:(0,vi.kr)(e,t.dataKey)})):r.length>0?r.map(e=>e.dataKey).flatMap(t=>e.map(e=>({value:(0,vi.kr)(e,t)}))):e.map(e=>({value:e})),_A=(0,i.Mz)([OA,dA,wA],FA);function xA(e,t){switch(e){case"xAxis":return"x"===t.direction;case"yAxis":return"y"===t.direction;default:return!1}}function UA(e){if((0,bi.vh)(e)||e instanceof Date){var t=Number(e);if((0,Bi.H)(t))return t}}function QA(e){if(Array.isArray(e)){var t=[UA(e[0]),UA(e[1])];return(0,wi.JH)(t)?t:void 0}var r=UA(e);if(null!=r)return[r,r]}function TA(e){return e.map(UA).filter(bi.n9)}var MA=e=>{var t=(0,$i.R)(e),r=(0,eA.M)(e);return hA(e,t,r)},PA=(0,i.Mz)([MA],e=>null==e?void 0:e.dataKey),DA=(0,i.Mz)([bA,mi.k$,MA],Yi.A),kA=(e,t,r,n)=>{var i=t.reduce((e,t)=>{if(null==t.stackId)return e;var r=e[t.stackId];return null==r&&(r=[]),r.push(t),e[t.stackId]=r,e},{});return Object.fromEntries(Object.entries(i).map(t=>{var[i,A]=t,o=n?[...A].reverse():A,a=o.map(Xi.x);return[i,{stackedData:(0,vi.yy)(e,a,r),graphicalItems:o}]}))},NA=(0,i.Mz)([DA,bA,ji.eC,ji.Lb],kA),RA=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:A}=t;if(null==n&&"zAxis"!==r){var o=(0,vi.Mk)(e,i,A);if(null==o||0!==o[0]||0!==o[1])return o}},LA=(0,i.Mz)([dA],e=>e.allowDataOverflow),HA=e=>{var t;if(null==e||!("domain"in e))return iA;if(null!=e.domain)return e.domain;if("ticks"in e&&null!=e.ticks){if("number"===e.type){var r=TA(e.ticks);return[Math.min(...r),Math.max(...r)]}if("category"===e.type)return e.ticks.map(String)}return null!==(t=null==e?void 0:e.domain)&&void 0!==t?t:iA},jA=(0,i.Mz)([dA],HA),VA=(0,i.Mz)([jA,LA],wi.f5),KA=(0,i.Mz)([NA,mi.LF,Ki.N,VA],RA,{memoizeOptions:{resultEqualityCheck:qi.o}}),zA=e=>e.errorBars,GA=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.filter(Boolean);if(0!==n.length){var i=n.flat();return[Math.min(...i),Math.max(...i)]}},WA=(e,t,r,n,i)=>{var A,o;if(r.length>0&&e.forEach(e=>{r.forEach(r=>{var a,s,u=null===(a=n[r.id])||void 0===a?void 0:a.filter(e=>xA(i,e)),c=(0,vi.kr)(e,null!==(s=t.dataKey)&&void 0!==s?s:r.dataKey),l=function(e,t,r){return!r||"number"!=typeof t||(0,bi.M8)(t)?[]:r.length?TA(r.flatMap(r=>{var n,i,A=(0,vi.kr)(e,r.dataKey);if(Array.isArray(A)?[n,i]=A:n=i=A,(0,Bi.H)(n)&&(0,Bi.H)(i))return[t-n,t+i]})):[]}(e,c,u);if(l.length>=2){var f=Math.min(...l),d=Math.max(...l);(null==A||f<A)&&(A=f),(null==o||d>o)&&(o=d)}var h=QA(c);null!=h&&(A=null==A?h[0]:Math.min(A,h[0]),o=null==o?h[1]:Math.max(o,h[1]))})}),null!=(null==t?void 0:t.dataKey)&&e.forEach(e=>{var r=QA((0,vi.kr)(e,t.dataKey));null!=r&&(A=null==A?r[0]:Math.min(A,r[0]),o=null==o?r[1]:Math.max(o,r[1]))}),(0,Bi.H)(A)&&(0,Bi.H)(o))return[A,o]},XA=(0,i.Mz)([OA,dA,CA,zA,Ki.N],WA,{memoizeOptions:{resultEqualityCheck:qi.o}});function YA(e){var{value:t}=e;if((0,bi.vh)(t)||t instanceof Date)return t}var ZA=e=>e.referenceElements.dots,qA=(e,t,r)=>e.filter(e=>"extendDomain"===e.ifOverflow).filter(e=>"xAxis"===t?e.xAxisId===r:e.yAxisId===r),JA=(0,i.Mz)([ZA,Ki.N,zi.E],qA),$A=e=>e.referenceElements.areas,eo=(0,i.Mz)([$A,Ki.N,zi.E],qA),to=e=>e.referenceElements.lines,ro=(0,i.Mz)([to,Ki.N,zi.E],qA),no=(e,t)=>{if(null!=e){var r=TA(e.map(e=>"xAxis"===t?e.x:e.y));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},io=(0,i.Mz)(JA,Ki.N,no),Ao=(e,t)=>{if(null!=e){var r=TA(e.flatMap(e=>["xAxis"===t?e.x1:e.y1,"xAxis"===t?e.x2:e.y2]));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},oo=(0,i.Mz)([eo,Ki.N],Ao);var ao=(e,t)=>{if(null!=e){var r=e.flatMap(e=>"xAxis"===t?function(e){var t;if(null!=e.x)return TA([e.x]);var r=null===(t=e.segment)||void 0===t?void 0:t.map(e=>e.x);return null==r||0===r.length?[]:TA(r)}(e):function(e){var t;if(null!=e.y)return TA([e.y]);var r=null===(t=e.segment)||void 0===t?void 0:t.map(e=>e.y);return null==r||0===r.length?[]:TA(r)}(e));if(0!==r.length)return[Math.min(...r),Math.max(...r)]}},so=(0,i.Mz)([ro,Ki.N],ao),uo=(0,i.Mz)(io,so,oo,(e,t,r)=>GA(e,r,t)),co=(e,t,r,n,i,A,o,a)=>{if(null!=r)return r;var s="vertical"===o&&"xAxis"===a||"horizontal"===o&&"yAxis"===a?GA(n,A,i):GA(A,i);return(0,wi.v1)(t,s,e.allowDataOverflow)},lo=(0,i.Mz)([dA,jA,VA,KA,XA,uo,yi.fz,Ki.N],co,{memoizeOptions:{resultEqualityCheck:qi.o}}),fo=[0,1],ho=(e,t,r,n,i,A,a)=>{if(null!=e&&null!=r&&0!==r.length||void 0!==a){var s,{dataKey:u,type:c}=e,l=(0,vi._L)(t,A);return l&&null==u?o()(0,null!==(s=null==r?void 0:r.length)&&void 0!==s?s:0):"category"===c?((e,t,r)=>{var n=e.map(YA).filter(e=>null!=e);return r&&(null==t.dataKey||t.allowDuplicatedCategory&&(0,bi.CG)(n))?o()(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))})(n,e,l):"expand"===i?fo:a}},po=(0,i.Mz)([dA,yi.fz,OA,_A,ji.eC,Ki.N,lo],ho),go=(e,t,r,i,A)=>{if(null!=e){var{scale:o,type:a}=e;if("auto"===o)return"radial"===t&&"radiusAxis"===A?"band":"radial"===t&&"angleAxis"===A?"linear":"category"===a&&i&&(i.indexOf("LineChart")>=0||i.indexOf("AreaChart")>=0||i.indexOf("ComposedChart")>=0&&!r)?"point":"category"===a?"band":"linear";if("string"==typeof o){var s="scale".concat((0,bi.Zb)(o));return s in n?s:"point"}}},yo=(0,i.Mz)([dA,yi.fz,pA,ji.iO,Ki.N],go);function vo(e,t,r,i){if(null!=r&&null!=i){if("function"==typeof e.scale)return e.scale.copy().domain(r).range(i);var A=function(e){if(null!=e){if(e in n)return n[e]();var t="scale".concat((0,bi.Zb)(e));return t in n?n[t]():void 0}}(t);if(null!=A){var o=A.domain(r).range(i);return(0,vi.YB)(o),o}}}var mo=(e,t,r)=>{var n=HA(t);if("auto"===r||"linear"===r)return null!=t&&t.tickCount&&Array.isArray(n)&&("auto"===n[0]||"auto"===n[1])&&(0,wi.JH)(e)?function(e){var[t,r]=e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],A=Math.max(n,2),[o,a]=Mi([t,r]);if(o===-1/0||a===1/0){var s=a===1/0?[o,...xi(0,n-1).map(()=>1/0)]:[...xi(0,n-1).map(()=>-1/0),a];return t>r?s.reverse():s}if(o===a)return Di(o,n,i);var{step:u,tickMin:c,tickMax:l}=ki(o,a,A,i,0),f=Ti(c,l.add(new(Ei())(.1).mul(u)),u);return t>r?f.reverse():f}(e,t.tickCount,t.allowDecimals):null!=t&&t.tickCount&&"number"===t.type&&(0,wi.JH)(e)?function(e,t){var[r,n]=e,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],[A,o]=Mi([r,n]);if(A===-1/0||o===1/0)return[r,n];if(A===o)return[A];var a=Math.max(t,2),s=Pi(new(Ei())(o).sub(A).div(a-1),i,0),u=[...Ti(new(Ei())(A),new(Ei())(o),s),o];return!1===i&&(u=u.map(e=>Math.round(e))),r>n?u.reverse():u}(e,t.tickCount,t.allowDecimals):void 0},wo=(0,i.Mz)([po,hA,yo],mo),bo=(e,t,r,n)=>{if("angleAxis"!==n&&"number"===(null==e?void 0:e.type)&&(0,wi.JH)(t)&&Array.isArray(r)&&r.length>0){var i=t[0],A=r[0],o=t[1],a=r[r.length-1];return[Math.min(i,A),Math.max(o,a)]}return t},Bo=(0,i.Mz)([dA,po,wo,Ki.N],bo),Co=(0,i.Mz)(_A,dA,(e,t)=>{if(t&&"number"===t.type){var r=1/0,n=Array.from(TA(e.map(e=>e.value))).sort((e,t)=>e-t),i=n[0],A=n[n.length-1];if(null==i||null==A)return 1/0;var o=A-i;if(0===o)return 1/0;for(var a=0;a<n.length-1;a++){var s=n[a],u=n[a+1];if(null!=s&&null!=u){var c=u-s;r=Math.min(r,c)}}return r/o}}),Eo=(0,i.Mz)(Co,yi.fz,ji.gY,Li.HZ,(e,t,r,n,i)=>i,(e,t,r,n,i)=>{if(!(0,Bi.H)(e))return 0;var A="vertical"===t?n.height:n.width;if("gap"===i)return e*A/2;if("no-gap"===i){var o=(0,bi.F4)(r,e*A),a=e*A/2;return a-o-(a-o)/A*o}return 0}),So=(0,i.Mz)(aA,(e,t,r)=>{var n=aA(e,t);return null==n||"string"!=typeof n.padding?0:Eo(e,"xAxis",t,r,n.padding)},(e,t)=>{var r,n;if(null==e)return{left:0,right:0};var{padding:i}=e;return"string"==typeof i?{left:t,right:t}:{left:(null!==(r=i.left)&&void 0!==r?r:0)+t,right:(null!==(n=i.right)&&void 0!==n?n:0)+t}}),Io=(0,i.Mz)(cA,(e,t,r)=>{var n=cA(e,t);return null==n||"string"!=typeof n.padding?0:Eo(e,"yAxis",t,r,n.padding)},(e,t)=>{var r,n;if(null==e)return{top:0,bottom:0};var{padding:i}=e;return"string"==typeof i?{top:t,bottom:t}:{top:(null!==(r=i.top)&&void 0!==r?r:0)+t,bottom:(null!==(n=i.bottom)&&void 0!==n?n:0)+t}}),Oo=(0,i.Mz)([Li.HZ,So,Hi.U,Hi.C,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:A}=n;return i?[A.left,r.width-A.right]:[e.left+t.left,e.left+e.width-t.right]}),Fo=(0,i.Mz)([Li.HZ,yi.fz,Io,Hi.U,Hi.C,(e,t,r)=>r],(e,t,r,n,i,A)=>{var{padding:o}=i;return A?[n.height-o.bottom,o.top]:"horizontal"===t?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),_o=(e,t,r,n)=>{var i;switch(t){case"xAxis":return Oo(e,r,n);case"yAxis":return Fo(e,r,n);case"zAxis":return null===(i=fA(e,r))||void 0===i?void 0:i.range;case"angleAxis":return(0,Vi.Cv)(e);case"radiusAxis":return(0,Vi.Dc)(e,r);default:return}},xo=(0,i.Mz)([dA,_o],Gi.I),Uo=(0,i.Mz)([dA,yo,Bo,xo],vo);(0,i.Mz)([wA,zA,Ki.N],(e,t,r)=>e.flatMap(e=>t[e.id]).filter(Boolean).filter(e=>xA(r,e)));function Qo(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var To=(e,t)=>t,Mo=(e,t,r)=>r,Po=(0,i.Mz)(Ri.h,To,Mo,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(Qo)),Do=(0,i.Mz)(Ri.W,To,Mo,(e,t,r)=>e.filter(e=>e.orientation===t).filter(e=>e.mirror===r).sort(Qo)),ko=(e,t)=>({width:e.width,height:t.height}),No=(0,i.Mz)(Li.HZ,aA,ko),Ro=(0,i.Mz)(Ni.A$,Li.HZ,Po,To,Mo,(e,t,r,n,i)=>{var A,o={};return r.forEach(r=>{var a=ko(t,r);null==A&&(A=((e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}})(t,n,e));var s="top"===n&&!i||"bottom"===n&&i;o[r.id]=A-Number(s)*a.height,A+=(s?-1:1)*a.height}),o}),Lo=(0,i.Mz)(Ni.Lp,Li.HZ,Do,To,Mo,(e,t,r,n,i)=>{var A,o={};return r.forEach(r=>{var a=((e,t)=>({width:"number"==typeof t.width?t.width:Wi.tQ,height:e.height}))(t,r);null==A&&(A=((e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}})(t,n,e));var s="left"===n&&!i||"right"===n&&i;o[r.id]=A-Number(s)*a.width,A+=(s?-1:1)*a.width}),o}),Ho=(0,i.Mz)([Li.HZ,aA,(e,t)=>{var r=aA(e,t);if(null!=r)return Ro(e,r.orientation,r.mirror)},(e,t)=>t],(e,t,r,n)=>{if(null!=t){var i=null==r?void 0:r[n];return null==i?{x:e.left,y:0}:{x:e.left,y:i}}}),jo=(0,i.Mz)([Li.HZ,cA,(e,t)=>{var r=cA(e,t);if(null!=r)return Lo(e,r.orientation,r.mirror)},(e,t)=>t],(e,t,r,n)=>{if(null!=t){var i=null==r?void 0:r[n];return null==i?{x:0,y:e.top}:{x:i,y:e.top}}}),Vo=(0,i.Mz)(Li.HZ,cA,(e,t)=>({width:"number"==typeof t.width?t.width:Wi.tQ,height:e.height})),Ko=(e,t,r)=>{switch(t){case"xAxis":return No(e,r).width;case"yAxis":return Vo(e,r).height;default:return}},zo=(e,t,r,n)=>{if(null!=r){var{allowDuplicatedCategory:i,type:A,dataKey:o}=r,a=(0,vi._L)(e,n),s=t.map(e=>e.value);return o&&a&&"category"===A&&i&&(0,bi.CG)(s)?s:void 0}},Go=(0,i.Mz)([yi.fz,_A,dA,Ki.N],zo),Wo=(e,t,r,n)=>{if(null!=r&&null!=r.dataKey){var{type:i,scale:A}=r;return!(0,vi._L)(e,n)||"number"!==i&&"auto"===A?void 0:t.map(e=>e.value)}},Xo=(0,i.Mz)([yi.fz,_A,hA,Ki.N],Wo),Yo=(0,i.Mz)([yi.fz,(e,t,r)=>{switch(t){case"xAxis":return aA(e,r);case"yAxis":return cA(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},yo,Uo,Go,Xo,_o,wo,Ki.N],(e,t,r,n,i,A,o,a,s)=>{if(null!=t){var u=(0,vi._L)(e,s);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:s,categoricalDomain:A,duplicateDomain:i,isCategorical:u,niceTicks:a,range:o,realScaleType:r,scale:n}}}),Zo=(0,i.Mz)([yi.fz,hA,yo,Uo,wo,_o,Go,Xo,Ki.N],(e,t,r,n,i,A,o,a,s)=>{if(null!=t&&null!=n){var u=(0,vi._L)(e,s),{type:c,ticks:l,tickCount:f}=t,d="scaleBand"===r&&"function"==typeof n.bandwidth?n.bandwidth()/2:2,h="category"===c&&n.bandwidth?n.bandwidth()/d:0;h="angleAxis"===s&&null!=A&&A.length>=2?2*(0,bi.sA)(A[0]-A[1])*h:h;var p=l||i;return p?p.map((e,t)=>{var r=o?o.indexOf(e):e;return{index:t,coordinate:n(r)+h,value:e,offset:h}}).filter(e=>(0,Bi.H)(e.coordinate)):u&&a?a.map((e,t)=>({coordinate:n(e)+h,value:e,index:t,offset:h})).filter(e=>(0,Bi.H)(e.coordinate)):n.ticks?n.ticks(f).map(e=>({coordinate:n(e)+h,value:e,offset:h})):n.domain().map((e,t)=>({coordinate:n(e)+h,value:o?o[e]:e,index:t,offset:h}))}}),qo=(0,i.Mz)([yi.fz,hA,Uo,_o,Go,Xo,Ki.N],(e,t,r,n,i,A,o)=>{if(null!=t&&null!=r&&null!=n&&n[0]!==n[1]){var a=(0,vi._L)(e,o),{tickCount:s}=t,u=0;return u="angleAxis"===o&&(null==n?void 0:n.length)>=2?2*(0,bi.sA)(n[0]-n[1])*u:u,a&&A?A.map((e,t)=>({coordinate:r(e)+u,value:e,index:t,offset:u})):r.ticks?r.ticks(s).map(e=>({coordinate:r(e)+u,value:e,offset:u})):r.domain().map((e,t)=>({coordinate:r(e)+u,value:i?i[e]:e,index:t,offset:u}))}}),Jo=(0,i.Mz)(dA,Uo,(e,t)=>{if(null!=e&&null!=t)return rA(rA({},e),{},{scale:t})}),$o=(0,i.Mz)([dA,yo,po,xo],vo),ea=((0,i.Mz)((e,t,r)=>fA(e,r),$o,(e,t)=>{if(null!=e&&null!=t)return rA(rA({},e),{},{scale:t})}),(0,i.Mz)([yi.fz,Ri.h,Ri.W],(e,t,r)=>{switch(e){case"horizontal":return t.some(e=>e.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(e=>e.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}))},91706(e,t,r){"use strict";r.d(t,{JU:()=>U,ZY:()=>O,_I:()=>T,zJ:()=>C});var n=r(96540),i=r(34164),A=r(81174),o=r(59744),a=r(14040),s=r(19287),u=r(49082),c=r(19538),l=r(77404),f=r(80196),d=r(27132),h=r(60648),p=["labelRef"],g=["content"];function y(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){w(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function w(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},b.apply(null,arguments)}var B=(0,n.createContext)(null),C=e=>{var{x:t,y:r,upperWidth:i,lowerWidth:A,width:o,height:a,children:s}=e,u=(0,n.useMemo)(()=>({x:t,y:r,upperWidth:i,lowerWidth:A,width:o,height:a}),[t,r,i,A,o,a]);return n.createElement(B.Provider,{value:u},s)},E=()=>{var e=(0,n.useContext)(B),t=(0,s.sk)();return e||(0,s.qC)(t)},S=(0,n.createContext)(null),I=()=>{var e=(0,n.useContext)(S),t=(0,u.G)(c.D0);return e||t},O=e=>null!=e&&"function"==typeof e,F=(e,t,r,A,s)=>{var u,c,{offset:l,className:f}=e,{cx:d,cy:h,innerRadius:p,outerRadius:g,startAngle:y,endAngle:v,clockWise:m}=s,w=(p+g)/2,B=((e,t)=>(0,o.sA)(t-e)*Math.min(Math.abs(t-e),360))(y,v),C=B>=0?1:-1;switch(t){case"insideStart":u=y+C*l,c=m;break;case"insideEnd":u=v-C*l,c=!m;break;case"end":u=v+C*l,c=m;break;default:throw new Error("Unsupported position ".concat(t))}c=B<=0?c:!c;var E=(0,a.IZ)(d,h,w,u),S=(0,a.IZ)(d,h,w,u+359*(c?1:-1)),I="M".concat(E.x,",").concat(E.y,"\n A").concat(w,",").concat(w,",0,1,").concat(c?0:1,",\n ").concat(S.x,",").concat(S.y),O=(0,o.uy)(e.id)?(0,o.NF)("recharts-radial-line-"):e.id;return n.createElement("text",b({},A,{dominantBaseline:"central",className:(0,i.$)("recharts-radial-bar-label",f)}),n.createElement("defs",null,n.createElement("path",{id:O,d:I})),n.createElement("textPath",{xlinkHref:"#".concat(O)},r))},_=e=>"cx"in e&&(0,o.Et)(e.cx),x={angle:0,offset:5,zIndex:h.I.label,position:"middle",textBreakAll:!1};function U(e){var t,r,u,c=(0,l.e)(e,x),{viewBox:h,position:v,value:w,children:B,content:C,className:S="",textBreakAll:O,labelRef:U}=c,Q=I(),T=E();if(!(t=null==h?"center"===v?T:null!=Q?Q:T:_(h)?h:(0,s.qC)(h))||(0,o.uy)(w)&&(0,o.uy)(B)&&!(0,n.isValidElement)(C)&&"function"!=typeof C)return null;var M=m(m({},c),{},{viewBox:t});if((0,n.isValidElement)(C)){var{labelRef:P}=M,D=y(M,p);return(0,n.cloneElement)(C,D)}if("function"==typeof C){var{content:k}=M,N=y(M,g);if(r=(0,n.createElement)(C,N),(0,n.isValidElement)(r))return r}else r=(e=>{var{value:t,formatter:r}=e,n=(0,o.uy)(e.children)?t:e.children;return"function"==typeof r?r(n):n})(c);var R=(0,f.a)(c);if(_(t)){if("insideStart"===v||"insideEnd"===v||"end"===v)return F(c,v,r,R,t);u=((e,t,r)=>{var{cx:n,cy:i,innerRadius:A,outerRadius:o,startAngle:s,endAngle:u}=e,c=(s+u)/2;if("outside"===r){var{x:l,y:f}=(0,a.IZ)(n,i,o+t,c);return{x:l,y:f,textAnchor:l>=n?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var d=(A+o)/2,{x:h,y:p}=(0,a.IZ)(n,i,d,c);return{x:h,y:p,textAnchor:"middle",verticalAnchor:"middle"}})(t,c.offset,c.position)}else u=((e,t)=>{var r,{parentViewBox:n,offset:i,position:A}=e;null==n||_(n)||(r=n);var{x:a,y:s,upperWidth:u,lowerWidth:c,height:l}=t,f=a,d=a+(u-c)/2,h=(f+d)/2,p=(u+c)/2,g=f+u/2,y=l>=0?1:-1,v=y*i,w=y>0?"end":"start",b=y>0?"start":"end",B=u>=0?1:-1,C=B*i,E=B>0?"end":"start",S=B>0?"start":"end";if("top"===A)return m(m({},{x:f+u/2,y:s-v,textAnchor:"middle",verticalAnchor:w}),r?{height:Math.max(s-r.y,0),width:u}:{});if("bottom"===A)return m(m({},{x:d+c/2,y:s+l+v,textAnchor:"middle",verticalAnchor:b}),r?{height:Math.max(r.y+r.height-(s+l),0),width:c}:{});if("left"===A){var I={x:h-C,y:s+l/2,textAnchor:E,verticalAnchor:"middle"};return m(m({},I),r?{width:Math.max(I.x-r.x,0),height:l}:{})}if("right"===A){var O={x:h+p+C,y:s+l/2,textAnchor:S,verticalAnchor:"middle"};return m(m({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:l}:{})}var F=r?{width:p,height:l}:{};return"insideLeft"===A?m({x:h+C,y:s+l/2,textAnchor:S,verticalAnchor:"middle"},F):"insideRight"===A?m({x:h+p-C,y:s+l/2,textAnchor:E,verticalAnchor:"middle"},F):"insideTop"===A?m({x:f+u/2,y:s+v,textAnchor:"middle",verticalAnchor:b},F):"insideBottom"===A?m({x:d+c/2,y:s+l-v,textAnchor:"middle",verticalAnchor:w},F):"insideTopLeft"===A?m({x:f+C,y:s+v,textAnchor:S,verticalAnchor:b},F):"insideTopRight"===A?m({x:f+u-C,y:s+v,textAnchor:E,verticalAnchor:b},F):"insideBottomLeft"===A?m({x:d+C,y:s+l-v,textAnchor:S,verticalAnchor:w},F):"insideBottomRight"===A?m({x:d+c-C,y:s+l-v,textAnchor:E,verticalAnchor:w},F):A&&"object"==typeof A&&((0,o.Et)(A.x)||(0,o._3)(A.x))&&((0,o.Et)(A.y)||(0,o._3)(A.y))?m({x:a+(0,o.F4)(A.x,p),y:s+(0,o.F4)(A.y,l),textAnchor:"end",verticalAnchor:"end"},F):m({x:g,y:s+l/2,textAnchor:"middle",verticalAnchor:"middle"},F)})(c,t);return n.createElement(d.g,{zIndex:c.zIndex},n.createElement(A.EY,b({ref:U,className:(0,i.$)("recharts-label",S)},R,u,{textAnchor:(0,A.fU)(R.textAnchor)?R.textAnchor:u.textAnchor,breakAll:O}),r))}U.displayName="Label";var Q=(e,t,r)=>{if(!e)return null;var i={viewBox:t,labelRef:r};return!0===e?n.createElement(U,b({key:"label-implicit"},i)):(0,o.vh)(e)?n.createElement(U,b({key:"label-implicit",value:e},i)):(0,n.isValidElement)(e)?e.type===U?(0,n.cloneElement)(e,m({key:"label-implicit"},i)):n.createElement(U,b({key:"label-implicit",content:e},i)):O(e)?n.createElement(U,b({key:"label-implicit",content:e},i)):e&&"object"==typeof e?n.createElement(U,b({},e,{key:"label-implicit"},i)):null};function T(e){var{label:t,labelRef:r}=e,n=E();return Q(t,n,r)||null}},91955(e,t,r){"use strict";var n,i,A,o,a,s=r(44576),u=r(93389),c=r(76080),l=r(59225).set,f=r(18265),d=r(89544),h=r(44265),p=r(7860),g=r(16193),y=s.MutationObserver||s.WebKitMutationObserver,v=s.document,m=s.process,w=s.Promise,b=u("queueMicrotask");if(!b){var B=new f,C=function(){var e,t;for(g&&(e=m.domain)&&e.exit();t=B.get();)try{t()}catch(e){throw B.head&&n(),e}e&&e.enter()};d||g||p||!y||!v?!h&&w&&w.resolve?((o=w.resolve(void 0)).constructor=w,a=c(o.then,o),n=function(){a(C)}):g?n=function(){m.nextTick(C)}:(l=c(l,s),n=function(){l(C)}):(i=!0,A=v.createTextNode(""),new y(C).observe(A,{characterData:!0}),n=function(){A.data=i=!i}),b=function(e){B.head||n(),B.add(e)}}e.exports=b},92476(e,t,r){"use strict";r.d(t,{mZ:()=>a,vE:()=>o});var n=r(65307),i={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},A=(0,n.Z0)({name:"rootProps",initialState:i,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=null!==(r=t.payload.barGap)&&void 0!==r?r:i.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),o=A.reducer,{updateOptions:a}=A.actions},92617(e,t,r){"use strict";r.d(t,{As:()=>c,TK:()=>l,Vi:()=>u,ZF:()=>s,g5:()=>a,iZ:()=>f});var n=r(65307),i=r(12064),A=r(1932),o=(0,n.Z0)({name:"graphicalItems",initialState:{cartesianItems:[],polarItems:[]},reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push((0,A.h4)(t.payload))},prepare:(0,n.aA)()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,o=(0,i.ss)(e).cartesianItems.indexOf((0,A.h4)(r));o>-1&&(e.cartesianItems[o]=(0,A.h4)(n))},prepare:(0,n.aA)()},removeCartesianGraphicalItem:{reducer(e,t){var r=(0,i.ss)(e).cartesianItems.indexOf((0,A.h4)(t.payload));r>-1&&e.cartesianItems.splice(r,1)},prepare:(0,n.aA)()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push((0,A.h4)(t.payload))},prepare:(0,n.aA)()},removePolarGraphicalItem:{reducer(e,t){var r=(0,i.ss)(e).polarItems.indexOf((0,A.h4)(t.payload));r>-1&&e.polarItems.splice(r,1)},prepare:(0,n.aA)()}}}),{addCartesianGraphicalItem:a,replaceCartesianGraphicalItem:s,removeCartesianGraphicalItem:u,addPolarGraphicalItem:c,removePolarGraphicalItem:l}=o.actions,f=o.reducer},92649(e,t,r){"use strict";r.d(t,{E:()=>n});var n=(0,r(96540).createContext)(null)},92679(e,t,r){"use strict";r.d(t,{A:()=>i});var n=r(57149);const i=function(){function e(){}return e.prototype.exp=function(e){return this.expTable[e]},e.prototype.log=function(e){if(0===e)throw new n.A;return this.logTable[e]},e.addOrSubtract=function(e,t){return e^t},e}()},92819(e,t,r){"use strict";r.d(t,{A:()=>n});const n=function(){function e(){}return e.arraycopy=function(e,t,r,n,i){for(;i--;)r[n++]=e[t++]},e.currentTimeMillis=function(){return Date.now()},e}()},92938(e,t,r){e.exports=r(48695).isPlainObject},93234(e,t,r){"use strict";r.d(t,{A:()=>A});var n=r(28823),i=r(48102);const A=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.equals=function(t){if(t instanceof e){var r=t;return this.x===r.x&&this.y===r.y}return!1},e.prototype.hashCode=function(){return 31*i.A.floatToIntBits(this.x)+i.A.floatToIntBits(this.y)},e.prototype.toString=function(){return"("+this.x+","+this.y+")"},e.orderBestPatterns=function(e){var t,r,n,i=this.distance(e[0],e[1]),A=this.distance(e[1],e[2]),o=this.distance(e[0],e[2]);if(A>=i&&A>=o?(r=e[0],t=e[1],n=e[2]):o>=A&&o>=i?(r=e[1],t=e[0],n=e[2]):(r=e[2],t=e[0],n=e[1]),this.crossProductZ(t,r,n)<0){var a=t;t=n,n=a}e[0]=t,e[1]=r,e[2]=n},e.distance=function(e,t){return n.A.distance(e.x,e.y,t.x,t.y)},e.crossProductZ=function(e,t,r){var n=t.x,i=t.y;return(r.x-n)*(e.y-i)-(r.y-i)*(e.x-n)},e}()},93389(e,t,r){"use strict";var n=r(44576),i=r(43724),A=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return n[e];var t=A(n,e);return t&&t.value}},93438(e,t,r){"use strict";var n=r(28551),i=r(20034),A=r(36043);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=A.f(e);return(0,r.resolve)(t),r.promise}},93516(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(49135),i=r(92819),A=r(57149);const o=function(){function e(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new n.A(e,Int32Array.from([1])))}return e.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var r=t[t.length-1],i=this.field,A=t.length;A<=e;A++){var o=r.multiply(new n.A(i,Int32Array.from([1,i.exp(A-1+i.getGeneratorBase())])));t.push(o),r=o}return t[e]},e.prototype.encode=function(e,t){if(0===t)throw new A.A("No error correction bytes");var r=e.length-t;if(r<=0)throw new A.A("No data bytes provided");var o=this.buildGenerator(t),a=new Int32Array(r);i.A.arraycopy(e,0,a,0,r);for(var s=new n.A(this.field,a),u=(s=s.multiplyByMonomial(t,1)).divide(o)[1].getCoefficients(),c=t-u.length,l=0;l<c;l++)e[r+l]=0;i.A.arraycopy(u,0,e,r+c,u.length)},e}()},93569(e,t,r){"use strict";r.d(t,{R:()=>i});var n=r(19287),i=e=>{var t=(0,n.fz)(e);return"horizontal"===t?"xAxis":"vertical"===t?"yAxis":"centric"===t?"angleAxis":"radiusAxis"}},93710(e,t,r){"use strict";r.d(t,{A:()=>B});var n,i=r(91110),A=r(10652),o=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});const a=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.count=0,i.finderPattern=n,i}return o(t,e),t.prototype.getFinderPattern=function(){return this.finderPattern},t.prototype.getCount=function(){return this.count},t.prototype.incrementCount=function(){this.count++},t}(A.A);var s=r(7758),u=r(8032),c=r(58503),l=r(88468),f=r(73872),d=r(93234),h=r(36157),p=r(28823),g=r(64994),y=r(92819),v=r(32993),m=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),w=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return m(t,e),t.prototype.decodeRow=function(e,r,n){var i,A,o,a,s=this.decodePair(r,!1,e,n);t.addOrTally(this.possibleLeftPairs,s),r.reverse();var u=this.decodePair(r,!0,e,n);t.addOrTally(this.possibleRightPairs,u),r.reverse();try{for(var l=w(this.possibleLeftPairs),f=l.next();!f.done;f=l.next()){var d=f.value;if(d.getCount()>1)try{for(var h=(o=void 0,w(this.possibleRightPairs)),p=h.next();!p.done;p=h.next()){var g=p.value;if(g.getCount()>1&&t.checkChecksum(d,g))return t.constructResult(d,g)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}}}catch(e){i={error:e}}finally{try{f&&!f.done&&(A=l.return)&&A.call(l)}finally{if(i)throw i.error}}throw new c.A},t.addOrTally=function(e,t){var r,n;if(null!=t){var i=!1;try{for(var A=w(e),o=A.next();!o.done;o=A.next()){var a=o.value;if(a.getValue()===t.getValue()){a.incrementCount(),i=!0;break}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=A.return)&&n.call(A)}finally{if(r)throw r.error}}i||e.push(t)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,t){for(var r=4537077*e.getValue()+t.getValue(),n=new String(r).toString(),i=new l.A,A=13-n.length;A>0;A--)i.append("0");i.append(n);var o=0;for(A=0;A<13;A++){var a=i.charAt(A).charCodeAt(0)-"0".charCodeAt(0);o+=1&A?a:3*a}10===(o=10-o%10)&&(o=0),i.append(o.toString());var u=e.getFinderPattern().getResultPoints(),c=t.getFinderPattern().getResultPoints();return new s.A(i.toString(),null,0,[u[0],u[1],c[0],c[1]],f.A.RSS_14,(new Date).getTime())},t.checkChecksum=function(e,t){var r=(e.getChecksumPortion()+16*t.getChecksumPortion())%79,n=9*e.getFinderPattern().getValue()+t.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},t.prototype.decodePair=function(e,t,r,n){try{var i=this.findFinderPattern(e,t),A=this.parseFoundFinderPattern(e,r,t,i),o=null==n?null:n.get(u.A.NEED_RESULT_POINT_CALLBACK);if(null!=o){var s=(i[0]+i[1])/2;t&&(s=e.getSize()-1-s),o.foundPossibleResultPoint(new d.A(s,r))}var c=this.decodeDataCharacter(e,A,!0),l=this.decodeDataCharacter(e,A,!1);return new a(1597*c.getValue()+l.getValue(),c.getChecksumPortion()+4*l.getChecksumPortion(),A)}catch(e){return null}},t.prototype.decodeDataCharacter=function(e,r,n){for(var i=this.getDataCharacterCounters(),o=0;o<i.length;o++)i[o]=0;if(n)v.A.recordPatternInReverse(e,r.getStartEnd()[0],i);else{v.A.recordPattern(e,r.getStartEnd()[1]+1,i);for(var a=0,s=i.length-1;a<s;a++,s--){var u=i[a];i[a]=i[s],i[s]=u}}var l=n?16:15,f=p.A.sum(new Int32Array(i))/l,d=this.getOddCounts(),h=this.getEvenCounts(),y=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors();for(a=0;a<i.length;a++){var w=i[a]/f,b=Math.floor(w+.5);b<1?b=1:b>8&&(b=8);var B=Math.floor(a/2);1&a?(h[B]=b,m[B]=w-b):(d[B]=b,y[B]=w-b)}this.adjustOddEvenCounts(n,l);var C=0,E=0;for(a=d.length-1;a>=0;a--)E*=9,E+=d[a],C+=d[a];var S=0,I=0;for(a=h.length-1;a>=0;a--)S*=9,S+=h[a],I+=h[a];var O=E+3*S;if(n){if(1&C||C>12||C<4)throw new c.A;var F=(12-C)/2,_=9-(M=t.OUTSIDE_ODD_WIDEST[F]),x=g.A.getRSSvalue(d,M,!1),U=g.A.getRSSvalue(h,_,!0),Q=t.OUTSIDE_EVEN_TOTAL_SUBSET[F],T=t.OUTSIDE_GSUM[F];return new A.A(x*Q+U+T,O)}if(1&I||I>10||I<4)throw new c.A;F=(10-I)/2,_=9-(M=t.INSIDE_ODD_WIDEST[F]),x=g.A.getRSSvalue(d,M,!0),U=g.A.getRSSvalue(h,_,!1);var M,P=t.INSIDE_ODD_TOTAL_SUBSET[F];T=t.INSIDE_GSUM[F];return new A.A(U*P+x+T,O)},t.prototype.findFinderPattern=function(e,t){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=e.getSize(),A=!1,o=0;o<n&&t!==(A=!e.get(o));)o++;for(var a=0,s=o,u=o;u<n;u++)if(e.get(u)!==A)r[a]++;else{if(3===a){if(i.A.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,A=!A}throw new c.A},t.prototype.parseFoundFinderPattern=function(e,r,n,i){for(var A=e.get(i[0]),o=i[0]-1;o>=0&&A!==e.get(o);)o--;o++;var a=i[0]-o,s=this.getDecodeFinderCounters(),u=new Int32Array(s.length);y.A.arraycopy(s,0,u,1,s.length-1),u[0]=a;var c=this.parseFinderValue(u,t.FINDER_PATTERNS),l=o,f=i[1];return n&&(l=e.getSize()-1-l,f=e.getSize()-1-f),new h.A(c,[o,i[1]],l,f,r)},t.prototype.adjustOddEvenCounts=function(e,t){var r=p.A.sum(new Int32Array(this.getOddCounts())),n=p.A.sum(new Int32Array(this.getEvenCounts())),A=!1,o=!1,a=!1,s=!1;e?(r>12?o=!0:r<4&&(A=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?o=!0:r<5&&(A=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-t,l=(1&r)==(e?1:0),f=!(1&~n);if(1===u)if(l){if(f)throw new c.A;o=!0}else{if(!f)throw new c.A;s=!0}else if(-1===u)if(l){if(f)throw new c.A;A=!0}else{if(!f)throw new c.A;a=!0}else{if(0!==u)throw new c.A;if(l){if(!f)throw new c.A;r<n?(A=!0,s=!0):(o=!0,a=!0)}else if(f)throw new c.A}if(A){if(o)throw new c.A;i.A.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&i.A.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new c.A;i.A.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&i.A.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},t.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],t.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],t.OUTSIDE_GSUM=[0,161,961,2015,2715],t.INSIDE_GSUM=[0,336,1036,1516],t.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],t.INSIDE_ODD_WIDEST=[2,4,6,8],t.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],t}(i.A);const B=b},93749(e,t,r){"use strict";r.d(t,{JH:()=>o,f5:()=>s,v1:()=>u});var n=r(26470),i=r(59744),A=r(8813);function o(e){if(Array.isArray(e)&&2===e.length){var[t,r]=e;if((0,A.H)(t)&&(0,A.H)(r))return!0}return!1}function a(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function s(e,t){if(t&&"function"!=typeof e&&Array.isArray(e)&&2===e.length){var r,n,[i,a]=e;if((0,A.H)(i))r=i;else if("function"==typeof i)return;if((0,A.H)(a))n=a;else if("function"==typeof a)return;var s=[r,n];if(o(s))return s}}function u(e,t,r){if(r||null!=t){if("function"==typeof e&&null!=t)try{var A=e(t,r);if(o(A))return a(A,t,r)}catch(e){}if(Array.isArray(e)&&2===e.length){var s,u,[c,l]=e;if("auto"===c)null!=t&&(s=Math.min(...t));else if((0,i.Et)(c))s=c;else if("function"==typeof c)try{null!=t&&(s=c(null==t?void 0:t[0]))}catch(e){}else if("string"==typeof c&&n.IH.test(c)){var f=n.IH.exec(c);if(null==f||null==f[1]||null==t)s=void 0;else{var d=+f[1];s=t[0]-d}}else s=null==t?void 0:t[0];if("auto"===l)null!=t&&(u=Math.max(...t));else if((0,i.Et)(l))u=l;else if("function"==typeof l)try{null!=t&&(u=l(null==t?void 0:t[1]))}catch(e){}else if("string"==typeof l&&n.qx.test(l)){var h=n.qx.exec(l);if(null==h||null==h[1]||null==t)u=void 0;else{var p=+h[1];u=t[1]+p}}else u=null==t?void 0:t[1];var g=[s,u];if(o(g))return null==t?g:a(g,t,r)}}}},93998(e,t,r){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});const n=r(61366),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;t.isKey=function(e,t){return!Array.isArray(e)&&(!("number"!=typeof e&&"boolean"!=typeof e&&null!=e&&!n.isSymbol(e))||("string"==typeof e&&(A.test(e)||!i.test(e))||null!=t&&Object.hasOwn(t,e)))}},94115(e,t,r){"use strict";r.d(t,{CA:()=>w,MC:()=>f,QG:()=>m,Vi:()=>c,W3:()=>s,cU:()=>d,fR:()=>p,hd:()=>h,m2:()=>l});var n=r(65307),i=r(1932);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=0,u=(0,n.Z0)({name:"cartesianAxis",initialState:{xAxis:{},yAxis:{},zAxis:{}},reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=(0,i.h4)(t.payload)},prepare:(0,n.aA)()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;void 0!==e.xAxis[r.id]&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=(0,i.h4)(n))},prepare:(0,n.aA)()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:(0,n.aA)()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=(0,i.h4)(t.payload)},prepare:(0,n.aA)()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;void 0!==e.yAxis[r.id]&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=(0,i.h4)(n))},prepare:(0,n.aA)()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:(0,n.aA)()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=(0,i.h4)(t.payload)},prepare:(0,n.aA)()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;void 0!==e.zAxis[r.id]&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=(0,i.h4)(n))},prepare:(0,n.aA)()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:(0,n.aA)()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var A=i.widthHistory||[];if(3===A.length&&A[0]===A[2]&&n===A[1]&&n!==i.width&&Math.abs(n-A[0])<=1)return;var a=[...A,n].slice(-3);e.yAxis[r]=o(o({},e.yAxis[r]),{},{width:n,widthHistory:a})}}}}),{addXAxis:c,replaceXAxis:l,removeXAxis:f,addYAxis:d,replaceYAxis:h,removeYAxis:p,addZAxis:g,replaceZAxis:y,removeZAxis:v,updateYAxisWidth:m}=u.actions,w=u.reducer},94170(e,t,r){"use strict";var n=r(46518),i=r(30566);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},94274(e,t,r){"use strict";r.d(t,{l3:()=>B,m7:()=>C});var n=r(96540),i=r(49082),A=r(82695);var o=new(r(24128)),a="recharts.syncEvent.tooltip",s="recharts.syncEvent.brush",u=r(26960),c=r(74531),l=r(49259),f=r(33032);function d(e){return e.tooltip.syncInteraction}var h=r(19287),p=r(46446),g=r(59744),y=["x","y"];function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){w(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function w(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(){var e=(0,i.G)(A.lZ),t=(0,i.G)(A.pH),r=(0,i.j)(),s=(0,i.G)(A.hX),u=(0,i.G)(f.R4),l=(0,h.WX)(),d=(0,h.sk)(),p=(0,i.G)(e=>e.rootProps.className);(0,n.useEffect)(()=>{if(null==e)return g.lQ;var n=(n,i,A)=>{var o;if(t!==A&&e===n)if("index"!==s){if(null!=u){var a;if("function"==typeof s){var f={activeTooltipIndex:null==i.payload.index?void 0:Number(i.payload.index),isTooltipActive:i.payload.active,activeIndex:null==i.payload.index?void 0:Number(i.payload.index),activeLabel:i.payload.label,activeDataKey:i.payload.dataKey,activeCoordinate:i.payload.coordinate},h=s(u,f);a=u[h]}else"value"===s&&(a=u.find(e=>String(e.value)===i.payload.label));var{coordinate:p}=i.payload;if(null!=a&&!1!==i.payload.active&&null!=p&&null!=d){var{x:g,y:v}=p,w=Math.min(g,d.x+d.width),b=Math.min(v,d.y+d.height),B={x:"horizontal"===l?a.coordinate:w,y:"horizontal"===l?b:a.coordinate},C=(0,c.E1)({active:i.payload.active,coordinate:B,dataKey:i.payload.dataKey,index:String(a.index),label:i.payload.label,sourceViewBox:i.payload.sourceViewBox,graphicalItemId:i.payload.graphicalItemId});r(C)}else r((0,c.E1)({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}))}}else if(d&&null!=i&&null!==(o=i.payload)&&void 0!==o&&o.coordinate&&i.payload.sourceViewBox){var E=i.payload.coordinate,{x:S,y:I}=E,O=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(e);for(n=0;n<A.length;n++)r=A[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(E,y),{x:F,y:_,width:x,height:U}=i.payload.sourceViewBox,Q=m(m({},O),{},{x:d.x+(x?(S-F)/x:0)*d.width,y:d.y+(U?(I-_)/U:0)*d.height});r(m(m({},i),{},{payload:m(m({},i.payload),{},{coordinate:Q})}))}else r(i)};return o.on(a,n),()=>{o.off(a,n)}},[p,r,t,e,s,u,l,d])}function B(){var e=(0,i.j)();(0,n.useEffect)(()=>{e((0,u.dl)())},[e]),b(),function(){var e=(0,i.G)(A.lZ),t=(0,i.G)(A.pH),r=(0,i.j)();(0,n.useEffect)(()=>{if(null==e)return g.lQ;var n=(n,i,A)=>{t!==A&&e===n&&r((0,p.M)(i))};return o.on(s,n),()=>{o.off(s,n)}},[r,t,e])}()}function C(e,t,r,s,u,f){var p=(0,i.G)(r=>(0,l.dp)(r,e,t)),g=(0,i.G)(A.pH),y=(0,i.G)(A.lZ),v=(0,i.G)(A.hX),m=(0,i.G)(d),w=null==m?void 0:m.active,b=(0,h.sk)();(0,n.useEffect)(()=>{if(!w&&null!=y&&null!=g){var e=(0,c.E1)({active:f,coordinate:r,dataKey:p,index:u,label:"number"==typeof s?String(s):s,sourceViewBox:b,graphicalItemId:void 0});o.emit(a,y,e,g)}},[w,r,p,u,s,g,y,v,f,b])}},94490(e,t,r){"use strict";var n=r(46518),i=r(79504),A=r(34376),o=i([].reverse),a=[1,2];n({target:"Array",proto:!0,forced:String(a)===String(a.reverse())},{reverse:function(){return A(this)&&(this.length=this.length),o(this)}})},94501(e,t,r){"use strict";r.d(t,{aS:()=>f,y$:()=>d});var n=r(80305),i=r.n(n),A=r(96540),o=r(54405),a=r(59744),s=e=>"string"==typeof e?e:e?e.displayName||e.name||"Component":"",u=null,c=null,l=e=>{if(e===u&&Array.isArray(c))return c;var t=[];return A.Children.forEach(e,e=>{(0,a.uy)(e)||((0,o.zv)(e)?t=t.concat(l(e.props.children)):t.push(e))}),c=t,u=e,t};function f(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map(e=>s(e)):[s(t)],l(e).forEach(e=>{var t=i()(e,"type.displayName")||i()(e,"type.name");t&&-1!==n.indexOf(t)&&r.push(e)}),r}var d=e=>!e||"object"!=typeof e||!("clipDot"in e)||Boolean(e.clipDot)},94658(e,t,r){"use strict";function n(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}r.d(t,{T:()=>n})},95112(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t.isDeepKey=function(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}},96035(e,t,r){"use strict";r.d(t,{t:()=>A});var n=r(66500),i=r(24880),A=new class extends n.Q{#J=!0;#d;#h;constructor(){super(),this.#h=e=>{if(!i.S$&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#d||this.setEventListener(this.#h)}onUnsubscribe(){this.hasListeners()||(this.#d?.(),this.#d=void 0)}setEventListener(e){this.#h=e,this.#d?.(),this.#d=e(this.setOnline.bind(this))}setOnline(e){this.#J!==e&&(this.#J=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#J}}},96540(e,t,r){"use strict";e.exports=r(15287)},96837(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},97483(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(43074),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.kind="WriterException",t}(i.A);const a=o},97665(e,t,r){"use strict";r.d(t,{Ht:()=>a,jE:()=>o});var n=r(96540),i=r(74848),A=n.createContext(void 0),o=e=>{const t=n.useContext(A);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},a=({client:e,children:t})=>(n.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(A.Provider,{value:e,children:t}))},97968(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(98517),A=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t.forName=function(e){return this.getCharacterSetECIByName(e)},t}(i.A);const a=o},98406(e,t,r){"use strict";r(23792),r(27337);var n=r(46518),i=r(44576),A=r(93389),o=r(97751),a=r(69565),s=r(79504),u=r(43724),c=r(67416),l=r(36840),f=r(62106),d=r(56279),h=r(10687),p=r(33994),g=r(91181),y=r(90679),v=r(94901),m=r(39297),w=r(76080),b=r(36955),B=r(28551),C=r(20034),E=r(655),S=r(2360),I=r(6980),O=r(70081),F=r(50851),_=r(62529),x=r(22812),U=r(78227),Q=r(74488),T=U("iterator"),M="URLSearchParams",P=M+"Iterator",D=g.set,k=g.getterFor(M),N=g.getterFor(P),R=A("fetch"),L=A("Request"),H=A("Headers"),j=L&&L.prototype,V=H&&H.prototype,K=i.TypeError,z=i.encodeURIComponent,G=String.fromCharCode,W=o("String","fromCodePoint"),X=parseInt,Y=s("".charAt),Z=s([].join),q=s([].push),J=s("".replace),$=s([].shift),ee=s([].splice),te=s("".split),re=s("".slice),ne=s(/./.exec),ie=/\+/g,Ae=/^[0-9a-f]+$/i,oe=function(e,t){var r=re(e,t,t+2);return ne(Ae,r)?X(r,16):NaN},ae=function(e){for(var t=0,r=128;r>0&&0!==(e&r);r>>=1)t++;return t},se=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ue=function(e){for(var t=(e=J(e,ie," ")).length,r="",n=0;n<t;){var i=Y(e,n);if("%"===i){if("%"===Y(e,n+1)||n+3>t){r+="%",n++;continue}var A=oe(e,n+1);if(A!=A){r+=i,n++;continue}n+=2;var o=ae(A);if(0===o)i=G(A);else{if(1===o||o>4){r+="�",n++;continue}for(var a=[A],s=1;s<o&&!(++n+3>t||"%"!==Y(e,n));){var u=oe(e,n+1);if(u!=u){n+=3;break}if(u>191||u<128)break;q(a,u),n+=2,s++}if(a.length!==o){r+="�";continue}var c=se(a);null===c?r+="�":i=W(c)}}r+=i,n++}return r},ce=/[!'()~]|%20/g,le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(e){return le[e]},de=function(e){return J(z(e),ce,fe)},he=p(function(e,t){D(this,{type:P,target:k(e).entries,index:0,kind:t})},M,function(){var e=N(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,_(void 0,!0);var n=t[r];switch(e.kind){case"keys":return _(n.key,!1);case"values":return _(n.value,!1)}return _([n.key,n.value],!1)},!0),pe=function(e){this.entries=[],this.url=null,void 0!==e&&(C(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?re(e,1):e:E(e)))};pe.prototype={type:M,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,i,A,o,s,u=this.entries,c=F(e);if(c)for(r=(t=O(e,c)).next;!(n=a(r,t)).done;){if(A=(i=O(B(n.value))).next,(o=a(A,i)).done||(s=a(A,i)).done||!a(A,i).done)throw new K("Expected sequence with length 2");q(u,{key:E(o.value),value:E(s.value)})}else for(var l in e)m(e,l)&&q(u,{key:l,value:E(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,i=te(e,"&"),A=0;A<i.length;)(t=i[A++]).length&&(r=te(t,"="),q(n,{key:ue($(r)),value:ue(Z(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],q(r,de(e.key)+"="+de(e.value));return Z(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ge=function(){y(this,ye);var e=D(this,new pe(arguments.length>0?arguments[0]:void 0));u||(this.size=e.entries.length)},ye=ge.prototype;if(d(ye,{append:function(e,t){var r=k(this);x(arguments.length,2),q(r.entries,{key:E(e),value:E(t)}),u||this.size++,r.updateURL()},delete:function(e){for(var t=k(this),r=x(arguments.length,1),n=t.entries,i=E(e),A=r<2?void 0:arguments[1],o=void 0===A?A:E(A),a=0;a<n.length;){var s=n[a];if(s.key!==i||void 0!==o&&s.value!==o)a++;else if(ee(n,a,1),void 0!==o)break}u||(this.size=n.length),t.updateURL()},get:function(e){var t=k(this).entries;x(arguments.length,1);for(var r=E(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){var t=k(this).entries;x(arguments.length,1);for(var r=E(e),n=[],i=0;i<t.length;i++)t[i].key===r&&q(n,t[i].value);return n},has:function(e){for(var t=k(this).entries,r=x(arguments.length,1),n=E(e),i=r<2?void 0:arguments[1],A=void 0===i?i:E(i),o=0;o<t.length;){var a=t[o++];if(a.key===n&&(void 0===A||a.value===A))return!0}return!1},set:function(e,t){var r=k(this);x(arguments.length,1);for(var n,i=r.entries,A=!1,o=E(e),a=E(t),s=0;s<i.length;s++)(n=i[s]).key===o&&(A?ee(i,s--,1):(A=!0,n.value=a));A||q(i,{key:o,value:a}),u||(this.size=i.length),r.updateURL()},sort:function(){var e=k(this);Q(e.entries,function(e,t){return e.key>t.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,r=k(this).entries,n=w(e,arguments.length>1?arguments[1]:void 0),i=0;i<r.length;)n((t=r[i++]).value,t.key,this)},keys:function(){return new he(this,"keys")},values:function(){return new he(this,"values")},entries:function(){return new he(this,"entries")}},{enumerable:!0}),l(ye,T,ye.entries,{name:"entries"}),l(ye,"toString",function(){return k(this).serialize()},{enumerable:!0}),u&&f(ye,"size",{get:function(){return k(this).entries.length},configurable:!0,enumerable:!0}),h(ge,M),n({global:!0,constructor:!0,forced:!c},{URLSearchParams:ge}),!c&&v(H)){var ve=s(V.has),me=s(V.set),we=function(e){if(C(e)){var t,r=e.body;if(b(r)===M)return t=e.headers?new H(e.headers):new H,ve(t,"content-type")||me(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(e,{body:I(0,E(r)),headers:I(0,t)})}return e};if(v(R)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return R(e,arguments.length>1?we(arguments[1]):{})}}),v(L)){var be=function(e){return y(this,j),new L(e,arguments.length>1?we(arguments[1]):{})};j.constructor=be,be.prototype=j,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:be})}}e.exports={URLSearchParams:ge,getState:k}},98453(e,t,r){"use strict";r.d(t,{LF:()=>i,k$:()=>o,rN:()=>a,z3:()=>A});var n=r(25508),i=e=>e.chartData,A=(0,n.Mz)([i],e=>{var t=null!=e.chartData?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),o=(e,t,r,n)=>n?A(e):i(e),a=(e,t,r)=>r?A(e):i(e)},98517(e,t,r){"use strict";r.d(t,{A:()=>a});var n,i=r(31327),A=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(e){e[e.Cp437=0]="Cp437",e[e.ISO8859_1=1]="ISO8859_1",e[e.ISO8859_2=2]="ISO8859_2",e[e.ISO8859_3=3]="ISO8859_3",e[e.ISO8859_4=4]="ISO8859_4",e[e.ISO8859_5=5]="ISO8859_5",e[e.ISO8859_6=6]="ISO8859_6",e[e.ISO8859_7=7]="ISO8859_7",e[e.ISO8859_8=8]="ISO8859_8",e[e.ISO8859_9=9]="ISO8859_9",e[e.ISO8859_10=10]="ISO8859_10",e[e.ISO8859_11=11]="ISO8859_11",e[e.ISO8859_13=12]="ISO8859_13",e[e.ISO8859_14=13]="ISO8859_14",e[e.ISO8859_15=14]="ISO8859_15",e[e.ISO8859_16=15]="ISO8859_16",e[e.SJIS=16]="SJIS",e[e.Cp1250=17]="Cp1250",e[e.Cp1251=18]="Cp1251",e[e.Cp1252=19]="Cp1252",e[e.Cp1256=20]="Cp1256",e[e.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",e[e.UTF8=22]="UTF8",e[e.ASCII=23]="ASCII",e[e.Big5=24]="Big5",e[e.GB18030=25]="GB18030",e[e.EUC_KR=26]="EUC_KR"}(n||(n={}));var o=function(){function e(t,r,n){for(var i,o,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=t,this.name=n,this.values="number"==typeof r?Int32Array.from([r]):r,this.otherEncodingNames=a,e.VALUE_IDENTIFIER_TO_ECI.set(t,this),e.NAME_TO_ECI.set(n,this);for(var u=this.values,c=0,l=u.length;c!==l;c++){var f=u[c];e.VALUES_TO_ECI.set(f,this)}try{for(var d=A(a),h=d.next();!h.done;h=d.next()){var p=h.value;e.NAME_TO_ECI.set(p,this)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}return e.prototype.getValueIdentifier=function(){return this.valueIdentifier},e.prototype.getName=function(){return this.name},e.prototype.getValue=function(){return this.values[0]},e.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new i.A("incorect value");var r=e.VALUES_TO_ECI.get(t);if(void 0===r)throw new i.A("incorect value");return r},e.getCharacterSetECIByName=function(t){var r=e.NAME_TO_ECI.get(t);if(void 0===r)throw new i.A("incorect value");return r},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;return this.getName()===r.getName()},e.VALUE_IDENTIFIER_TO_ECI=new Map,e.VALUES_TO_ECI=new Map,e.NAME_TO_ECI=new Map,e.Cp437=new e(n.Cp437,Int32Array.from([0,2]),"Cp437"),e.ISO8859_1=new e(n.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),e.ISO8859_2=new e(n.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),e.ISO8859_3=new e(n.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),e.ISO8859_4=new e(n.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),e.ISO8859_5=new e(n.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),e.ISO8859_6=new e(n.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),e.ISO8859_7=new e(n.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),e.ISO8859_8=new e(n.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),e.ISO8859_9=new e(n.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),e.ISO8859_10=new e(n.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),e.ISO8859_11=new e(n.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),e.ISO8859_13=new e(n.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),e.ISO8859_14=new e(n.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),e.ISO8859_15=new e(n.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),e.ISO8859_16=new e(n.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),e.SJIS=new e(n.SJIS,20,"SJIS","Shift_JIS"),e.Cp1250=new e(n.Cp1250,21,"Cp1250","windows-1250"),e.Cp1251=new e(n.Cp1251,22,"Cp1251","windows-1251"),e.Cp1252=new e(n.Cp1252,23,"Cp1252","windows-1252"),e.Cp1256=new e(n.Cp1256,24,"Cp1256","windows-1256"),e.UnicodeBigUnmarked=new e(n.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),e.UTF8=new e(n.UTF8,26,"UTF8","UTF-8"),e.ASCII=new e(n.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),e.Big5=new e(n.Big5,28,"Big5"),e.GB18030=new e(n.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),e.EUC_KR=new e(n.EUC_KR,30,"EUC_KR","EUC-KR"),e}();const a=o},98940(e,t,r){"use strict";r.d(t,{TT:()=>A,XC:()=>a,_U:()=>o});var n=r(96540),i=r(28129),A=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,o=(e,t)=>{if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,n.isValidElement)(e)&&(r=e.props),"object"!=typeof r&&"function"!=typeof r)return null;var A={};return Object.keys(r).forEach(e=>{(0,i.q)(e)&&(A[e]=t||(t=>r[e](r,t)))}),A},a=(e,t,r)=>{if(null===e||"object"!=typeof e&&"function"!=typeof e)return null;var n=null;return Object.keys(e).forEach(A=>{var o=e[A];(0,i.q)(A)&&"function"==typeof o&&(n||(n={}),n[A]=((e,t,r)=>n=>(e(t,r,n),null))(o,t,r))}),n}},99184(e,t){"use strict";Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});t.argumentsTag="[object Arguments]",t.arrayBufferTag="[object ArrayBuffer]",t.arrayTag="[object Array]",t.bigInt64ArrayTag="[object BigInt64Array]",t.bigUint64ArrayTag="[object BigUint64Array]",t.booleanTag="[object Boolean]",t.dataViewTag="[object DataView]",t.dateTag="[object Date]",t.errorTag="[object Error]",t.float32ArrayTag="[object Float32Array]",t.float64ArrayTag="[object Float64Array]",t.functionTag="[object Function]",t.int16ArrayTag="[object Int16Array]",t.int32ArrayTag="[object Int32Array]",t.int8ArrayTag="[object Int8Array]",t.mapTag="[object Map]",t.numberTag="[object Number]",t.objectTag="[object Object]",t.regexpTag="[object RegExp]",t.setTag="[object Set]",t.stringTag="[object String]",t.symbolTag="[object Symbol]",t.uint16ArrayTag="[object Uint16Array]",t.uint32ArrayTag="[object Uint32Array]",t.uint8ArrayTag="[object Uint8Array]",t.uint8ClampedArrayTag="[object Uint8ClampedArray]"},99378(e,t,r){"use strict";r.d(t,{A:()=>g});var n,i=r(73872),A=r(8032),o=r(31327),a=r(58503),s=r(7758),u=r(93234),c=r(88468),l=r(92819),f=r(32993),d=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return d(t,e),t.prototype.decodeRow=function(e,r,n){var a,l,f=this.decodeStart(r),d=this.decodeEnd(r),p=new c.A;t.decodeMiddle(r,f[1],d[0],p);var g=p.toString(),y=null;null!=n&&(y=n.get(A.A.ALLOWED_LENGTHS)),null==y&&(y=t.DEFAULT_ALLOWED_LENGTHS);var v=g.length,m=!1,w=0;try{for(var b=h(y),B=b.next();!B.done;B=b.next()){var C=B.value;if(v===C){m=!0;break}C>w&&(w=C)}}catch(e){a={error:e}}finally{try{B&&!B.done&&(l=b.return)&&l.call(b)}finally{if(a)throw a.error}}if(!m&&v>w&&(m=!0),!m)throw new o.A;var E=[new u.A(f[1],e),new u.A(d[0],e)];return new s.A(g,null,0,E,i.A.ITF,(new Date).getTime())},t.decodeMiddle=function(e,r,n,i){var A=new Int32Array(10),o=new Int32Array(5),a=new Int32Array(5);for(A.fill(0),o.fill(0),a.fill(0);r<n;){f.A.recordPattern(e,r,A);for(var s=0;s<5;s++){var u=2*s;o[s]=A[u],a[s]=A[u+1]}var c=t.decodeDigit(o);i.append(c.toString()),c=this.decodeDigit(a),i.append(c.toString()),A.forEach(function(e){r+=e})}},t.prototype.decodeStart=function(e){var r=t.skipWhiteSpace(e),n=t.findGuardPattern(e,r,t.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(e,n[0]),n},t.prototype.validateQuietZone=function(e,t){var r=10*this.narrowLineWidth;r=r<t?r:t;for(var n=t-1;r>0&&n>=0&&!e.get(n);n--)r--;if(0!==r)throw new a.A},t.skipWhiteSpace=function(e){var t=e.getSize(),r=e.getNextSet(0);if(r===t)throw new a.A;return r},t.prototype.decodeEnd=function(e){e.reverse();try{var r=t.skipWhiteSpace(e),n=void 0;try{n=t.findGuardPattern(e,r,t.END_PATTERN_REVERSED[0])}catch(i){i instanceof a.A&&(n=t.findGuardPattern(e,r,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,n[0]);var i=n[0];return n[0]=e.getSize()-n[1],n[1]=e.getSize()-i,n}finally{e.reverse()}},t.findGuardPattern=function(e,r,n){var i=n.length,A=new Int32Array(i),o=e.getSize(),s=!1,u=0,c=r;A.fill(0);for(var d=r;d<o;d++)if(e.get(d)!==s)A[u]++;else{if(u===i-1){if(f.A.patternMatchVariance(A,n,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return[c,d];c+=A[0]+A[1],l.A.arraycopy(A,2,A,0,u-1),A[u-1]=0,A[u]=0,u--}else u++;A[u]=1,s=!s}throw new a.A},t.decodeDigit=function(e){for(var r=t.MAX_AVG_VARIANCE,n=-1,i=t.PATTERNS.length,A=0;A<i;A++){var o=t.PATTERNS[A],s=f.A.patternMatchVariance(e,o,t.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=A):s===r&&(n=-1)}if(n>=0)return n%10;throw new a.A},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(f.A);const g=p},99516(e,t,r){"use strict";r.d(t,{w:()=>n});var n=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}}}}]);
File: public/build/time_management.3cae872e.js
Match lines: 1
2|(self.webpackChunk=self.webpackChunk||[]).push([[550],{195(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(96540);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.isOpen,n=e.onClose,o=e.currentFilters,i=e.onApply,l=e.onClear,u=c((0,a.useState)(o),2),d=u[0],f=u[1];(0,a.useEffect)(function(){f(o)},[o]);return t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"modal-backdrop fade show",style:{zIndex:1040},onClick:function(e){e.stopPropagation(),n()}}),(0,r.jsx)("div",{className:"modal fade show d-block",style:{zIndex:1050},tabIndex:-1,onClick:function(e){e.target===e.currentTarget&&n()},children:(0,r.jsx)("div",{className:"modal-dialog modal-dialog-centered",style:{maxWidth:"400px"},children:(0,r.jsxs)("div",{className:"modal-content",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h5",{className:"modal-title",style:{fontFamily:"Inter",fontSize:"18px",fontWeight:600,color:"#5C5D5D"},children:"Filtros"}),(0,r.jsx)("button",{type:"button",className:"close",onClick:function(e){e.preventDefault(),e.stopPropagation(),n()},"aria-label":"Fechar",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"×"})})]}),(0,r.jsxs)("div",{className:"modal-body",children:[(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"recordType",className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Tipo de Registro"}),(0,r.jsxs)("select",{id:"recordType",className:"form-control",value:d.recordType,onChange:function(e){return f(s(s({},d),{},{recordType:e.target.value}))},style:{fontFamily:"Inter",fontSize:"14px"},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"first_check_in",children:"Primeira Entrada"}),(0,r.jsx)("option",{value:"first_check_out",children:"Primeira Saída"}),(0,r.jsx)("option",{value:"second_check_in",children:"Segunda Entrada"}),(0,r.jsx)("option",{value:"second_check_out",children:"Segunda Saída"})]})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"validatedBy",className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Tipo de Validação"}),(0,r.jsxs)("select",{id:"validatedBy",className:"form-control",value:d.validatedBy,onChange:function(e){return f(s(s({},d),{},{validatedBy:e.target.value}))},style:{fontFamily:"Inter",fontSize:"14px"},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"selfie",children:"Selfie"}),(0,r.jsx)("option",{value:"screenshot",children:"Screenshot"}),(0,r.jsx)("option",{value:"geolocation",children:"Geolocalização"}),(0,r.jsx)("option",{value:"manual",children:"Manual"})]})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"channel",className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Canal"}),(0,r.jsxs)("select",{id:"channel",className:"form-control",value:d.channel,onChange:function(e){return f(s(s({},d),{},{channel:e.target.value}))},style:{fontFamily:"Inter",fontSize:"14px"},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"mobile",children:"App"}),(0,r.jsx)("option",{value:"web",children:"Navegador"}),(0,r.jsx)("option",{value:"sistema",children:"Sistema"})]})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"mode",className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Modo"}),(0,r.jsxs)("select",{id:"mode",className:"form-control",value:d.mode,onChange:function(e){return f(s(s({},d),{},{mode:e.target.value}))},style:{fontFamily:"Inter",fontSize:"14px"},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"individual",children:"Individual"}),(0,r.jsx)("option",{value:"coletivo",children:"Coletivo"})]})]})]}),(0,r.jsxs)("div",{className:"modal-footer",children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel btn-sm",onClick:function(){f({recordType:"",validatedBy:"",channel:"",mode:""}),l(),n()},style:{fontFamily:"Inter"},children:"Limpar Filtros"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary btn-sm",onClick:function(){i(d),n()},style:{fontFamily:"Inter",backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:"Aplicar"})]})]})})})]}):null}},1125(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(74848);function a(e){var t=e.message,n=void 0===t?"Carregando...":t;return(0,r.jsxs)("div",{className:"d-flex justify-content-center align-items-center",style:{padding:"40px"},children:[(0,r.jsx)("div",{className:"spinner-border text-primary",role:"status",children:(0,r.jsx)("span",{className:"sr-only",children:n})}),(0,r.jsx)("span",{style:{marginLeft:"10px",color:"#5C5D5D"},children:n})]})}},1806(e,t,n){"use strict";n.d(t,{A:()=>s,M:()=>l});var r=n(74848),a=n(96540),o=n(40961),i={sm:"modal-sm-custom",md:"",lg:"modal-lg",xl:"modal-xl"};function s(e){var t=e.show,n=e.onClose,s=e.title,l=e.children,c=e.footer,u=e.size,d=void 0===u?"md":u,f=e.className,m=void 0===f?"":f;if((0,a.useEffect)(function(){if(t)return document.body.classList.add("mhs-modal-open"),function(){document.body.classList.remove("mhs-modal-open")}},[t]),!t)return null;var p="sm"===d?"16px":"24px",h=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"modal fade show d-block mhs-modal-base",tabIndex:-1,role:"dialog","aria-modal":"true",onClick:n,children:(0,r.jsx)("div",{className:"modal-dialog modal-dialog-centered mhs-modal-dialog ".concat(i[d]),role:"document",onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:"modal-content mhs-modal-content ".concat(m),children:[(0,r.jsxs)("div",{className:"modal-header mhs-modal-header",style:{padding:p},children:[(0,r.jsx)("h4",{className:"modal-title mhs-modal-title",children:s}),(0,r.jsx)("button",{type:"button",className:"close mhs-modal-close","aria-label":"Close",onClick:n,children:(0,r.jsx)("span",{className:"mhs-modal-close-icon","aria-hidden":"true",children:"×"})})]}),(0,r.jsx)("div",{className:"modal-body mhs-modal-body",style:{padding:p},children:l}),c&&(0,r.jsx)("div",{className:"modal-footer mhs-modal-footer",style:{padding:"16px ".concat(p)},children:c})]})})}),(0,r.jsx)("div",{className:"modal-backdrop fade show mhs-modal-backdrop",onClick:n})]});return(0,o.createPortal)(h,document.body)}var l=function(e){var t=e.onCancel,n=e.onConfirm,a=e.cancelText,o=void 0===a?"Fechar":a,i=e.confirmText,s=void 0===i?"Confirmar":i,l=e.confirmDisabled,c=void 0!==l&&l;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mhs-btn-cancel",onClick:t,children:o}),(0,r.jsx)("button",{type:"button",className:"btn mhs-btn-primary",onClick:n,disabled:c,children:s})]})}},2698(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>l});n(52675),n(89463),n(2259),n(23418),n(74423),n(64346),n(23792),n(34782),n(23288),n(62010),n(9868),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(1806);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=e.isOpen,n=e.onUpload,s=e.onClose,l=i((0,a.useState)(null),2),c=l[0],u=l[1],d=i((0,a.useState)(null),2),f=d[0],m=d[1],p=i((0,a.useState)(null),2),h=p[0],v=p[1],b=i((0,a.useState)(!1),2),y=b[0],g=b[1],x=(0,a.useRef)(null),j=["image/png","image/jpeg","image/jpg"],w=function(e){var t=function(e){return j.includes(e.type)?e.size>5242880?"Arquivo muito grande. Máximo: 5MB.":null:"Formato inválido. Use PNG, JPG ou JPEG."}(e);if(t)v(t);else{v(null),u(e);var n=new FileReader;n.onload=function(e){var t;m(null===(t=e.target)||void 0===t?void 0:t.result)},n.readAsDataURL(e)}},S=function(){var e;null===(e=x.current)||void 0===e||e.click()},N=function(){u(null),m(null),v(null),x.current&&(x.current.value="")},k=function(){N(),s()};return t?(0,r.jsx)(o.A,{show:t,onClose:k,title:"Upload de Screenshot",size:"lg",footer:c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:N,children:"Selecionar Outra"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:function(){c&&(n(c),N())},children:"Confirmar"})]}):(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:k,children:"Cancelar"}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[h&&(0,r.jsxs)("div",{className:"alert d-flex align-items-center",style:{backgroundColor:"#E6F7F9",borderColor:"#17A2B8",color:"#0C5460",gap:"12px"},children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle",style:{color:"#17A2B8",fontSize:"24px"}}),(0,r.jsx)("div",{style:{flex:1},children:h})]}),c?(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("div",{className:"position-relative d-inline-block",children:[(0,r.jsx)("img",{src:f||"",alt:"Preview",className:"img-fluid rounded shadow",style:{maxHeight:"400px"}}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-danger position-absolute top-0 end-0 m-2",onClick:N,title:"Remover imagem",children:(0,r.jsx)("i",{className:"fas fa-times"})})]}),(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("p",{className:"mb-1",children:(0,r.jsx)("strong",{children:c.name})}),(0,r.jsxs)("p",{className:"text-muted small",children:[(c.size/1024/1024).toFixed(2)," MB"]})]}),(0,r.jsx)("div",{className:"alert alert-success mt-3",children:"Imagem selecionada com sucesso!"})]}):(0,r.jsxs)("div",{className:"border border-2 rounded p-5 text-center ".concat(y?"border-primary bg-light":"border-dashed"),style:{borderStyle:"dashed",minHeight:"300px",display:"flex",flexDirection:"column",justifyContent:"center",cursor:"pointer"},onDragEnter:function(e){e.preventDefault(),e.stopPropagation(),g(!0)},onDragLeave:function(e){e.preventDefault(),e.stopPropagation(),g(!1)},onDragOver:function(e){e.preventDefault(),e.stopPropagation()},onDrop:function(e){e.preventDefault(),e.stopPropagation(),g(!1);var t=e.dataTransfer.files[0];t&&w(t)},onClick:S,children:[(0,r.jsx)("i",{className:"fas fa-cloud-upload-alt fa-4x mb-3 ".concat(y?"text-primary":"text-muted")}),(0,r.jsx)("h5",{className:"mb-2",children:y?"Solte a imagem aqui":"Arraste uma imagem ou clique para selecionar"}),(0,r.jsxs)("p",{className:"text-muted mb-3",children:["Formatos aceitos: PNG, JPG, JPEG",(0,r.jsx)("br",{}),"Tamanho máximo: 5MB"]}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:function(e){e.stopPropagation(),S()},children:"Selecionar Arquivo"}),(0,r.jsx)("input",{ref:x,type:"file",accept:"image/png,image/jpeg,image/jpg",onChange:function(e){var t,n=null===(t=e.target.files)||void 0===t?void 0:t[0];n&&w(n)},style:{display:"none"}})]})]})}):null}},2799(e,t,n){"use strict";function r(){return null}n.r(t),n.d(t,{default:()=>r})},4818(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(48598),n(62062),n(34782),n(23288),n(62010),n(9868),n(26099),n(3362),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540);function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){var t=e.projects,s=void 0===t?[]:t,l=i((0,a.useState)(null),2),c=l[0],u=l[1],d=i((0,a.useState)(0),2),f=d[0],m=d[1];(0,a.useEffect)(function(){"undefined"!=typeof window&&n.e(416).then(n.bind(n,59416)).then(function(e){u(function(){return e.default})}).catch(function(e){console.error("Erro ao carregar ApexCharts:",e)})},[]),(0,a.useEffect)(function(){s.length>0&&m(function(e){return e+1})},[s]);var p=(0,a.useMemo)(function(){return 0===s.length?[{name:"Sem dados",data:[[0,0,0]],color:"#E0E0E0"}]:s.map(function(e){return{name:e.name,data:e.data||[[0,0,0]],color:e.color||"#186073"}})},[s]),h=(0,a.useMemo)(function(){if(0===s.length)return{maxBudget:100,minBudget:0,yAxisMax:110,yAxisMin:0,yTickAmount:4,xAxisMax:100,xAxisMin:0,xTickAmount:10};var e=s.map(function(e){return e.budget}),t=Math.max.apply(Math,o(e)),n=Math.min.apply(Math,o(e)),r=Math.ceil(1.2*t),a=Math.max(0,Math.floor(.8*n)),i=.1*t;if(r-a<i){var l=(t+n)/2;a=Math.max(0,l-i/2),r=l+i/2}var c=r>1e3?5:4,u=s.map(function(e){return e.timeSpentPercent||0}),d=Math.max.apply(Math,o(u)),f=Math.min.apply(Math,o(u)),m=Math.min(100,Math.ceil(1.2*d)),p=Math.max(0,Math.floor(.8*f));if(m-p<5){var h=(d+f)/2;p=Math.max(0,h-2.5),m=Math.min(100,h+2.5)}var v=m-p;return{maxBudget:t,minBudget:n,yAxisMax:r,yAxisMin:a,yTickAmount:c,xAxisMax:m,xAxisMin:p,xTickAmount:v>50?10:v>20?5:v>5?4:3}},[s]),v=(h.maxBudget,h.minBudget,h.yAxisMax),b=h.yAxisMin,y=h.yTickAmount,g=h.xAxisMax,x=h.xAxisMin,j=h.xTickAmount,w=(0,a.useMemo)(function(){return{chart:{height:320,type:"bubble",toolbar:{show:!1},zoom:{enabled:!1},id:"project-budget-scatter-".concat(f),animations:{enabled:!0,easing:"easeinout",speed:800}},dataLabels:{enabled:!0,formatter:function(e,t){return t&&t.series&&t.series[t.seriesIndex]?t.series[t.seriesIndex].name:t&&t.w&&t.w.globals&&t.w.globals.seriesNames&&t.w.globals.seriesNames[t.seriesIndex]?t.w.globals.seriesNames[t.seriesIndex]:""},style:{fontSize:"12px",fontFamily:"Inter",fontWeight:500,colors:["#5C5D5D"]}},colors:p.map(function(e){return e.color||"#186073"}),xaxis:{title:{text:"Tempo Gasto (%)",offsetY:6,style:{color:"#5C5D5D",fontSize:"12px",fontFamily:"Inter",fontWeight:400}},min:x,max:g,tickAmount:j,labels:{style:{colors:"#5C5D5D",fontSize:"12px",fontFamily:"Inter"}},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{title:{text:"Orçamento (R$)",rotate:-90,offsetX:0,style:{color:"#5C5D5D",fontSize:"12px",fontFamily:"Inter",fontWeight:400}},min:b,max:v,tickAmount:y,labels:{style:{colors:"#5C5D5D",fontSize:"12px",fontFamily:"Inter"},formatter:function(e){return e>=1e3?"".concat((e/1e3).toFixed(0),"k"):e.toFixed(0)}},axisBorder:{show:!1},axisTicks:{show:!1}},grid:{borderColor:"#E0E0E0",strokeDashArray:3,padding:{bottom:24},xaxis:{lines:{show:!0}},yaxis:{lines:{show:!0}}},tooltip:{enabled:!0,custom:function(e){var t=e.seriesIndex,n=e.dataPointIndex,r=e.w,a=r.globals.seriesNames[t],o=r.globals.initialSeries[t].data[n],i=o[0].toFixed(2),s=o[1],l=o[2],c=s.toLocaleString("pt-BR",{minimumFractionDigits:2,maximumFractionDigits:2});return'\n\t\t\t\t\t<div style="background: white; border: 1px solid #ccc; padding: 10px; border-radius: 4px; font-size: 12px;">\n\t\t\t\t\t\t<p style="margin: 0; font-weight: 600; color: '.concat(r.config.colors[t],';">').concat(a,'</p>\n\t\t\t\t\t\t<p style="margin: 4px 0 0 0; color: #5C5D5D;">Tempo Gasto: ').concat(i,'%</p>\n\t\t\t\t\t\t<p style="margin: 4px 0 0 0; color: #5C5D5D;">Orçamento: R$ ').concat(c,'</p>\n\t\t\t\t\t\t<p style="margin: 4px 0 0 0; color: #5C5D5D;">Membros: ').concat(l,"</p>\n\t\t\t\t\t</div>\n\t\t\t\t")}},legend:{show:!0,position:"bottom",horizontalAlign:"center",offsetY:14,fontSize:"12px",fontFamily:"Inter",fontWeight:400,labels:{colors:"#5C5D5D"},markers:{size:10,shape:"circle"},itemMargin:{horizontal:12,vertical:8}},plotOptions:{bubble:{minBubbleRadius:15,maxBubbleRadius:60,zScaling:!0}},fill:{opacity:.8}}},[p,v,b,y,g,x,j,f]);return c?(0,r.jsx)("div",{style:{width:"100%",marginTop:"10px"},children:(0,r.jsx)(c,{options:w,series:p,type:"bubble",height:320},"project-budget-".concat(f,"-").concat(s.length>0?s.map(function(e){return e.name}).join("-"):"empty"))}):(0,r.jsx)("div",{style:{width:"100%",height:"320px",display:"flex",alignItems:"center",justifyContent:"center",color:"#5C5D5D",fontFamily:"Inter",fontSize:"14px"},children:"Carregando gráfico..."})}},5380(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(62953),n(76031);var r=n(74848),a=n(96540),o=n(1806);function i(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var i=r&&r.prototype instanceof c?r:c,u=Object.create(i.prototype);return s(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,s(m,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,a,"GeneratorFunction"),s(m),s(m,a,"Generator"),s(m,r,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),(i=function(){return{w:o,m:p}})()}function s(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}s=function(e,t,n,r){function o(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},s(e,t,n,r)}function l(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.isOpen,n=e.onConfirm,s=e.onClose,u=e.distanceToleranceKm,d=void 0===u?0:u,f=c((0,a.useState)(null),2),m=f[0],p=f[1],h=c((0,a.useState)(!1),2),v=h[0],b=h[1],y=c((0,a.useState)(null),2),g=y[0],x=y[1],j=(0,a.useRef)(null),w=(0,a.useRef)(null),S=(0,a.useRef)(null);(0,a.useEffect)(function(){t&&!m&&N()},[t]),(0,a.useEffect)(function(){if(m&&j.current){var e=function(){var e,n=(e=i().m(function e(){var n,r;return i().w(function(e){for(;;)switch(e.n){case 0:if(!window.L){e.n=1;break}return t(),e.a(2);case 1:(n=document.createElement("link")).rel="stylesheet",n.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",n.integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=",n.crossOrigin="",document.head.appendChild(n),(r=document.createElement("script")).src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js",r.integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=",r.crossOrigin="",r.onload=function(){return t()},document.body.appendChild(r);case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){l(o,r,a,i,s,"next",e)}function s(e){l(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return n.apply(this,arguments)}}(),t=function(){var e=window.L;if(e&&j.current){w.current&&w.current.remove(),delete e.Icon.Default.prototype._getIconUrl,e.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png"});var t=e.map(j.current).setView([m.lat,m.lng],16);w.current=t,e.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19}).addTo(t),e.marker([m.lat,m.lng]).addTo(t),S.current&&t.removeLayer(S.current);var n=d>0?1e3*d:50,r=e.circle([m.lat,m.lng],{color:"#17A2B8",fillColor:"#17A2B8",fillOpacity:.2,radius:n}).addTo(t);S.current=r,t.fitBounds(r.getBounds(),{padding:[20,20]})}};return e(),function(){w.current&&(w.current.remove(),w.current=null)}}},[m,d]);var N=function(){if(navigator.geolocation){b(!0),x(null);var e=setTimeout(function(){b(!1),x("Tempo esgotado ao tentar obter localização. Tente novamente.")},5e3);navigator.geolocation.getCurrentPosition(function(t){clearTimeout(e);var n={lat:t.coords.latitude,lng:t.coords.longitude};p(n),b(!1)},function(t){switch(clearTimeout(e),b(!1),t.code){case t.PERMISSION_DENIED:x("Permissão de localização negada. Por favor, habilite nas configurações.");break;case t.POSITION_UNAVAILABLE:x("Informações de localização não disponíveis.");break;case t.TIMEOUT:x("Tempo esgotado ao tentar obter localização.");break;default:x("Erro desconhecido ao obter localização.")}},{enableHighAccuracy:!0,timeout:5e3,maximumAge:0})}else x("Geolocalização não é suportada pelo seu navegador.")},k=function(){p(null),x(null),N()},C=function(){p(null),x(null),s()};return t?(0,r.jsx)(o.A,{show:t,onClose:C,title:"Localização",size:"md",footer:g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:C,children:"Cancelar"}),(0,r.jsxs)("button",{type:"button",className:"btn btn-primary",onClick:k,children:[(0,r.jsx)("i",{className:"fas fa-redo me-2"}),"Tentar Novamente"]})]}):m?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:k,children:"Capturar Novamente"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",style:{backgroundColor:"#17A2B8",borderColor:"#17A2B8"},onClick:function(){m&&(n(m),p(null))},children:"Confirmar"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:C,children:"Cancelar"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:N,disabled:v,style:{backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:"Capturar Localização"})]}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[g&&(0,r.jsxs)("div",{className:"alert d-flex align-items-center",style:{backgroundColor:"#E6F7F9",borderColor:"#17A2B8",color:"#0C5460",gap:"12px"},children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle",style:{color:"#17A2B8",fontSize:"24px"}}),(0,r.jsx)("div",{style:{flex:1},children:g})]}),v&&!g&&(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("div",{className:"spinner-border text-primary mb-3"}),(0,r.jsx)("p",{className:"text-muted",children:"Obtendo sua localização..."}),(0,r.jsx)("small",{className:"text-muted",children:"Isso pode levar alguns segundos"})]}),m&&!g&&(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("div",{ref:j,className:"border rounded mb-3",style:{height:"300px",width:"100%",zIndex:0}})}),!v&&!m&&!g&&(0,r.jsx)("div",{className:"text-center py-4",children:(0,r.jsx)("p",{className:"text-muted",children:'Clique em "Capturar Localização" para obter suas coordenadas GPS'})})]})}):null}},7440(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>x});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(58940),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(97665),o=n(33930),i=n(57097),s=(n(94170),n(59904),n(84185),n(40875),n(10287),n(3362),n(52354));function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return c(u,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var i={};function s(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),m=d.prototype=s.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,c(m,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,a,"GeneratorFunction"),c(m),c(m,a,"Generator"),c(m,r,function(){return this}),c(m,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function c(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}c=function(e,t,n,r){function o(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},c(e,t,n,r)}function u(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){u(o,r,a,i,s,"next",e)}function s(e){u(o,r,a,i,s,"throw",e)}i(void 0)})}}function f(){return m.apply(this,arguments)}function m(){return(m=d(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s.F.get("/time-management/notification");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function p(){return(p=d(l().m(function e(t){var n,r;return l().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s.F.put("/time-management/notification",t);case 1:return n=e.v,r=n.data,e.a(2,r.data)}},e)}))).apply(this,arguments)}var h=n(96540),v=n(76336);function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var g=["time-management","notification"];function x(){var e=(0,v.L)().canEdit,t=(0,a.jE)(),n=b((0,h.useState)(!1),2),s=n[0],l=n[1],c=b((0,h.useState)(!1),2),u=c[0],d=c[1],m=b((0,h.useState)(10),2),y=m[0],x=m[1],j=b((0,h.useState)(5),2),w=j[0],S=j[1],N=(0,o.I)({queryKey:g,queryFn:f}),k=N.data;N.isFetching;(0,h.useEffect)(function(){k&&(l(k.enableCheckIn),d(k.enableCheckOut),x(k.notificationCheckIn||10),S(k.notificationCheckOut||5))},[k]);var C=(0,i.n)({mutationFn:function(e){return function(e){return p.apply(this,arguments)}(e)},onSuccess:function(){t.invalidateQueries({queryKey:g})}}),O=function(){k&&C.mutate({enableCheckIn:s,enableCheckOut:u,notificationCheckIn:s?y:0,notificationCheckOut:u?w:0})};return(0,h.useEffect)(function(){k&&O()},[s,u]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-12 col-md-6 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(s?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"notif-checkin",className:"custom-control-input",checked:s,onChange:function(e){return l(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(s?"text-primary":""),htmlFor:"notif-checkin",children:["Enviar notificação antes de",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",style:{fontSize:"0.85rem"},children:"Defina com quantos minutos de antecedência o colaborador receberá uma notificação lembrando da hora de entrada."}),(0,r.jsxs)("div",{className:"input-group mt-auto",children:[(0,r.jsx)("input",{type:"number",className:"form-control",value:y,onChange:function(e){return x(parseInt(e.target.value)||0)},onBlur:O,disabled:!s||!e,min:"0"}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",children:"min"})})]})]})})}),(0,r.jsx)("div",{className:"col-12 col-md-6 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(u?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"notif-checkout",className:"custom-control-input",checked:u,onChange:function(e){return d(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(u?"text-primary":""),htmlFor:"notif-checkout",children:["Enviar notificação antes de",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",style:{fontSize:"0.85rem"},children:"Defina com quantos minutos de antecedência o colaborador receberá uma notificação lembrando da hora de saída."}),(0,r.jsxs)("div",{className:"input-group mt-auto",children:[(0,r.jsx)("input",{type:"number",className:"form-control",value:w,onChange:function(e){return S(parseInt(e.target.value)||0)},onBlur:O,disabled:!u||!e,min:"0"}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",children:"min"})})]})]})})})]}),C.isPending&&(0,r.jsxs)("div",{className:"text-muted mt-2",children:[(0,r.jsx)("i",{className:"fas fa-spinner fa-spin mr-2"}),"Salvando..."]})]})}},8596(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>i});n(64346);var r=n(74848),a=n(68925),o=n(13359);function i(e){var t=e.onRegister,n=e.availableOptions,i=e.onSelectOption,s=e.isNoneMode,l=e.disabled,c=e.shift,u=e.selectedDate,d=e.onDateChange,f=e.shiftError;return(0,r.jsx)("div",{className:"card app-card-surface mt-2",children:(0,r.jsx)("div",{className:"card-body p-0",children:(0,r.jsxs)("div",{className:"row g-0",children:[(0,r.jsx)("div",{className:"col-12 col-sm-6 col-md-5 col-lg-5 col-xl-3 col-xxl-3 ms-point-card-left",children:(0,r.jsx)("div",{className:"p-5 h-100",children:(0,r.jsx)(a.default,{onRegister:t,availableOptions:n,onSelectOption:i,isNoneMode:s,disabled:l})})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-md-7 col-lg-7 col-xl-9 col-xxl-9",children:(0,r.jsx)("div",{className:"p-2 h-100",children:f?(0,r.jsxs)("div",{className:"text-center text-danger py-4",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle me-2"}),"Erro ao carregar dados do turno"]}):c&&c.rows&&Array.isArray(c.rows)?(0,r.jsx)(o.default,{shift:c,selectedDate:u,onDateChange:d}):(0,r.jsxs)("div",{className:"text-center text-muted py-4",children:[(0,r.jsx)("i",{className:"fas fa-info-circle me-2"}),"Nenhum dado disponível para exibir"]})})})]})})})}},9504(e,t,n){"use strict";n.d(t,{vl:()=>c});n(52675),n(89463),n(28706),n(51629),n(74423),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(21699),n(23500),n(76031),n(74848);var r=n(20354),a=n.n(r);function o(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,r,a,o){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return i(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(i(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,i(m,"constructor",d),i(d,"constructor",u),u.displayName="GeneratorFunction",i(d,a,"GeneratorFunction"),i(m),i(m,a,"Generator"),i(m,r,function(){return this}),i(m,"toString",function(){return"[object Generator]"}),(o=function(){return{w:s,m:p}})()}function i(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,t,n,r){function o(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},i(e,t,n,r)}function s(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){s(o,r,a,i,l,"next",e)}function l(e){s(o,r,a,i,l,"throw",e)}i(void 0)})}}var c=function(){var e=l(o().m(function e(t){var n,r,i,s;return o().w(function(e){for(;;)switch(e.n){case 0:if(n=t.dashboardRef,r=t.dateRange,i=t.setIsExporting,n.current){e.n=1;break}return console.error("Elemento do dashboard não encontrado"),e.a(2);case 1:try{i(!0),(s=document.createElement("div")).style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.backgroundColor="rgba(0,0,0,0.5)",s.style.display="flex",s.style.justifyContent="center",s.style.alignItems="center",s.style.zIndex="9999",s.innerHTML='<div style="background: white; padding: 20px; border-radius: 5px;">Gerando imagem do dashboard...</div>',document.body.appendChild(s),setTimeout(l(o().m(function e(){var t,l,c,u;return o().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,a()(n.current,{background:"#FFFFFF",logging:!0,useCORS:!0,allowTaint:!0,onclone:function(e){e.querySelectorAll("button").forEach(function(e){var t;null!==(t=e.textContent)&&void 0!==t&&t.includes("Exportar")&&(e.style.display="none")});var t=e.querySelector("section");t&&(t.style.backgroundColor="#FFFFFF"),e.querySelectorAll(".card").forEach(function(e){e.style.backgroundColor="#FFFFFF"}),e.querySelectorAll(".card-header").forEach(function(e){e.style.backgroundColor="#FFFFFF"}),e.querySelectorAll(".card-body").forEach(function(e){e.style.backgroundColor="#FFFFFF"}),e.querySelectorAll("svg").forEach(function(e){e.querySelectorAll('rect[fill="#F5F6FA"], rect[fill="#f5f6fa"], rect[fill="rgb(245, 246, 250)"]').forEach(function(e){e.setAttribute("fill","#FFFFFF")})}),e.querySelectorAll(".card-header button").forEach(function(e){e.querySelector(".fa-chevron-down")&&(e.style.backgroundColor="#FFFFFF")}),e.querySelectorAll('[style*="background"]').forEach(function(e){var t=e.style,n=t.background||t.backgroundColor;n&&(n.includes("#F5F6FA")||n.includes("#f5f6fa")||n.includes("rgb(245, 246, 250)")||n.includes("rgba(245, 246, 250"))&&(e.style.backgroundColor="#FFFFFF")})}});case 1:t=e.v,l=t.toDataURL("image/png"),(c=document.createElement("a")).href=l,c.download="dashboard-".concat(r.startDate,"-a-").concat(r.endDate,".png"),document.body.appendChild(c),c.click(),document.body.removeChild(c),console.log("Dashboard exportado com sucesso!"),e.n=3;break;case 2:e.p=2,u=e.v,console.error("Erro ao capturar screenshot:",u),alert("Erro ao exportar dashboard. Tente novamente.");case 3:return e.p=3,document.body.removeChild(s),i(!1),e.f(3);case 4:return e.a(2)}},e,null,[[0,2,3,4]])})),500)}catch(e){console.error("Erro ao iniciar exportação:",e),alert("Erro ao iniciar exportação. Tente novamente."),i(!1)}case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()},10280(e,t,n){"use strict";n.d(t,{A:()=>d});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(74423),n(64346),n(23792),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(58940),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(96540);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.value,n=e.label,o=e.variant,i=void 0===o?"white":o,l=e.iconClass,u=e.className,d=void 0===u?"":u,f=e.backgroundColor,m=e.isLoading,p=void 0!==m&&m,h=e.editable,v=void 0!==h&&h,b=e.onValueChange,y=e.isInteger,g=void 0!==y&&y,x=c((0,a.useState)(!1),2),j=x[0],w=x[1],S=c((0,a.useState)(String(t)),2),N=S[0],k=S[1],C=(0,a.useRef)(null),O=function(e){switch(e){case"green":return{boxClass:"bg-teal",textClass:"text-white",borderClass:"border-0"};case"blue":return{boxClass:"bg-info",textClass:"text-white",borderClass:"border-0"};case"red":return{boxClass:"bg-danger",textClass:"text-white",borderClass:"border-0"};case"white":return{boxClass:"bg-white",textClass:"text-muted",borderClass:"border"};case"blue-light":return{boxClass:"bg-success",textClass:"text-white",borderClass:"border"};case"gray":return{boxClass:"bg-light",textClass:"text-muted",borderClass:"border",extraStyle:{backgroundColor:"#898989"}};case"teal-dark":return{boxClass:"bg-primary",textClass:"text-white",borderClass:"border-0",extraStyle:{backgroundColor:"#186073"}};case"cyan":return{boxClass:"bg-info",textClass:"text-white",borderClass:"border-0",extraStyle:{backgroundColor:"#17A2B8"}};case"turquoise":return{boxClass:"bg-success",textClass:"text-white",borderClass:"border-0",extraStyle:{backgroundColor:"#02D6C7"}};case"salmon":return{boxClass:"bg-danger",textClass:"text-white",borderClass:"border-0",extraStyle:{backgroundColor:"#FF6D6D"}};case"dark-gray":return{boxClass:"bg-secondary",textClass:"text-white",borderClass:"border-0",extraStyle:{backgroundColor:"#5C5D5D"}};default:return{boxClass:"bg-light",textClass:"text-muted",borderClass:"border"}}}(i),A=O.boxClass,E=O.textClass,P=O.extraStyle,F=O.borderClass,T=f||["green","blue","red","white","gray","teal-dark","cyan","turquoise","salmon","dark-gray"].includes(i);(0,a.useEffect)(function(){k(String(t))},[t]),(0,a.useEffect)(function(){j&&C.current&&(C.current.focus(),C.current.select())},[j]);var D=function(){v&&!p&&w(!0)},_=function(){if(w(!1),b&&N!==String(t))if(g){var e=parseInt(N);!isNaN(e)&&e>=0?b(e):k(String(t))}else b(N)},I=function(e){"Enter"===e.key?_():"Escape"===e.key&&(k(String(t)),w(!1))},M=function(e){if(e.stopPropagation(),g&&b){var n="number"==typeof t?t:parseInt(String(t));isNaN(n)||b(n+1)}},R=function(e){if(e.stopPropagation(),g&&b){var n="number"==typeof t?t:parseInt(String(t));!isNaN(n)&&n>0&&b(n-1)}};if(T){var z=f?"":function(e){switch(e){case"green":default:return"ms-kpi-card-working";case"blue":return"ms-kpi-card-on-break";case"red":return"ms-kpi-card-absences";case"white":return"ms-kpi-card-license";case"gray":return"ms-kpi-card-pending";case"teal-dark":return"ms-kpi-card-teal-dark";case"cyan":return"ms-kpi-card-cyan";case"turquoise":return"ms-kpi-card-turquoise";case"salmon":return"ms-kpi-card-salmon";case"dark-gray":return"ms-kpi-card-dark-gray"}}(i),L=f||void 0;return(0,r.jsxs)("div",{className:"ms-kpi-card ".concat(z," ").concat(v&&!p?"ms-kpi-card-editing":""),style:L?{background:L}:void 0,children:[(0,r.jsxs)("div",{className:"ms-kpi-card-value-container",children:[j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:C,type:"text",value:N,onChange:function(e){return k(e.target.value)},onBlur:_,onKeyDown:I,className:"ms-kpi-card-input"}),g&&(0,r.jsx)("span",{className:"ms-kpi-card-suffix",children:"h"})]}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("h1",{className:"ms-kpi-card-value",onClick:D,style:{cursor:v&&!p?"pointer":"default"},children:[p?"...":t,v&&g&&!p&&"h"]})}),v&&g&&!p&&!j&&(0,r.jsxs)("div",{className:"ms-kpi-card-controls",children:[(0,r.jsx)("button",{onClick:M,className:"ms-kpi-card-control-button",children:"▲"}),(0,r.jsx)("button",{onClick:R,className:"ms-kpi-card-control-button",children:"▼"})]})]}),(0,r.jsx)("p",{className:"ms-kpi-card-label",children:n})]})}return(0,r.jsxs)("div",{className:"small-box ".concat(A," ").concat(F," ").concat(d),style:s(s({},P),{},{cursor:v&&!p?"pointer":"default",position:"relative"}),children:[(0,r.jsxs)("div",{className:"inner",children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:C,type:"text",value:N,onChange:function(e){return k(e.target.value)},onBlur:_,onKeyDown:I,className:"form-control",style:{fontSize:"28px",fontWeight:"bold",padding:"0 8px",width:"auto",minWidth:"80px",height:"auto"}}),g&&(0,r.jsx)("span",{className:"mb-1 ".concat(E),style:{fontSize:"28px",fontWeight:"bold"},children:"h"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"mb-1 ".concat(E),onClick:D,style:{cursor:v&&!p?"pointer":"default"},children:p?"...":t}),v&&g&&!p&&(0,r.jsx)("span",{className:"mb-1 ".concat(E),style:{fontSize:"28px",fontWeight:"bold",cursor:"pointer"},onClick:D,children:"h"})]}),v&&g&&!p&&!j&&(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginLeft:"4px"},children:[(0,r.jsx)("button",{onClick:M,className:"btn btn-xs",style:{padding:"2px 6px",fontSize:"10px",lineHeight:"1",background:"rgba(255, 255, 255, 0.3)",border:"1px solid rgba(255, 255, 255, 0.5)",color:"white"},children:"▲"}),(0,r.jsx)("button",{onClick:R,className:"btn btn-xs",style:{padding:"2px 6px",fontSize:"10px",lineHeight:"1",background:"rgba(255, 255, 255, 0.3)",border:"1px solid rgba(255, 255, 255, 0.5)",color:"white"},children:"▼"})]})]}),(0,r.jsx)("p",{className:"mb-0 ".concat(E),children:n})]}),l&&(0,r.jsx)("div",{className:"icon",children:(0,r.jsx)("i",{className:l})})]})}},12395(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(76314),a=n.n(r)()(function(e){return e[1]});a.push([e.id,".date-range-badge {\n\tposition: relative;\n\tdisplay: inline-block;\n}\n\n.date-range-badge__button {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 8px 16px;\n\tbackground: #fff;\n\tborder: 1px solid #d1d5db;\n\tborder-radius: 20px;\n\tfont-size: 14px;\n\tcolor: #5C5D5D;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\toutline: none;\n\twhite-space: nowrap;\n}\n\n.date-range-badge__button:hover {\n\tborder-color: #2196F3;\n\tbox-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);\n}\n\n.date-range-badge__icon {\n\tcolor: #2196F3;\n\tfont-size: 14px;\n}\n\n.date-range-badge__text {\n\tfont-weight: 500;\n\tcolor: #333;\n}\n\n.date-range-badge__clear {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 18px;\n\theight: 18px;\n\tpadding: 0;\n\tmargin-left: 4px;\n\tbackground: #e5e7eb;\n\tborder: none;\n\tborder-radius: 50%;\n\tcolor: #6b7280;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\toutline: none;\n}\n\n.date-range-badge__clear:hover {\n\tbackground: #dc2626;\n\tcolor: #fff;\n}\n\n.date-range-badge__clear i {\n\tfont-size: 10px;\n}\n\n.date-range-badge__dropdown {\n\tposition: absolute;\n\ttop: calc(100% + 8px);\n\tright: 0;\n\tmin-width: 400px;\n\tbackground: #fff;\n\tborder: 1px solid #d1d5db;\n\tborder-radius: 8px;\n\tbox-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);\n\tz-index: 1000;\n\tanimation: fadeInDown 0.2s ease;\n}\n\n@keyframes fadeInDown {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(-10px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n\n.date-range-badge__dropdown-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 16px 20px;\n\tborder-bottom: 1px solid #e5e7eb;\n\tfont-weight: 600;\n\tfont-size: 15px;\n\tcolor: #333;\n}\n\n.date-range-badge__dropdown-close {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 24px;\n\tpadding: 0;\n\tbackground: none;\n\tborder: none;\n\tborder-radius: 4px;\n\tcolor: #9ca3af;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\toutline: none;\n}\n\n.date-range-badge__dropdown-close:hover {\n\tbackground: #f3f4f6;\n\tcolor: #ef4444;\n}\n\n.date-range-badge__dropdown-body {\n\tpadding: 20px;\n}\n\n/* Ajustar estilos do DateRangePicker dentro do dropdown */\n.date-range-badge__dropdown-body .date-range-picker__presets-dropdown {\n\tposition: fixed;\n\ttop: auto;\n\tright: auto;\n}\n\n/* Responsivo */\n@media (max-width: 768px) {\n\t.date-range-badge__dropdown {\n\t\tright: 0;\n\t\tleft: auto;\n\t\tmin-width: 320px;\n\t\tmax-width: calc(100vw - 32px);\n\t}\n\t\n\t.date-range-badge__button {\n\t\tfont-size: 13px;\n\t\tpadding: 6px 12px;\n\t}\n}\n\n/* Tema escuro */\n.dark-mode .date-range-badge__button {\n\tbackground-color: #1f2937;\n\tborder-color: #374151;\n\tcolor: #e5e7eb;\n}\n\n.dark-mode .date-range-badge__text {\n\tcolor: #e5e7eb;\n}\n\n.dark-mode .date-range-badge__dropdown {\n\tbackground-color: #1f2937;\n\tborder-color: #374151;\n}\n\n.dark-mode .date-range-badge__dropdown-header {\n\tborder-color: #374151;\n\tcolor: #e5e7eb;\n}\n\n",""]);const o=a},12921(e,t,n){"use strict";n.d(t,{A:()=>d});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(68156),n(62953);var r=n(74848),a=n(96540),o=n(85072),i=n.n(o),s=n(18438),l={insert:"head",singleton:!1};i()(s.A,l);s.A.locals;function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const d=function(e){var t=e.initialStartDate,n=e.initialEndDate,o=e.onChange,i=e.maxDays,s=void 0===i?365:i,l=e.className,u=void 0===l?"":l,d=e.defaultToLastMonth,f=void 0===d||d,m=c((0,a.useState)(t||""),2),p=m[0],h=m[1],v=c((0,a.useState)(n||""),2),b=v[0],y=v[1],g=c((0,a.useState)(""),2),x=g[0],j=g[1],w=c((0,a.useState)(!1),2),S=w[0],N=w[1];(0,a.useEffect)(function(){h(t||""),y(n||""),j("")},[t,n]),(0,a.useEffect)(function(){if(f&&(!t||!n)){var e=new Date,r=new Date;r.setDate(r.getDate()-30);var a=k(r),i=k(e);h(a),y(i),o({startDate:a,endDate:i})}},[]);var k=function(e){var t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)},C=function(e,t){if(!e||!t)return"Por favor, selecione ambas as datas";var n=new Date(e),r=new Date(t);if(n>r)return"A data inicial deve ser anterior ou igual à data final";var a=Math.abs(r.getTime()-n.getTime());return Math.ceil(a/864e5)>s?"O intervalo máximo permitido é de ".concat(s," dias"):null},O=[{label:"Última Semana",getValue:function(){var e=new Date,t=new Date;return t.setDate(t.getDate()-7),{startDate:k(t),endDate:k(e)}}},{label:"Últimos 15 Dias",getValue:function(){var e=new Date,t=new Date;return t.setDate(t.getDate()-15),{startDate:k(t),endDate:k(e)}}},{label:"Último Mês",getValue:function(){var e=new Date,t=new Date;return t.setMonth(t.getMonth()-1),{startDate:k(t),endDate:k(e)}}},{label:"Últimos 3 Meses",getValue:function(){var e=new Date,t=new Date;return t.setMonth(t.getMonth()-3),{startDate:k(t),endDate:k(e)}}},{label:"Mês Atual",getValue:function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0);return{startDate:k(t),endDate:k(n)}}},{label:"Mês Anterior",getValue:function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,1),n=new Date(e.getFullYear(),e.getMonth(),0);return{startDate:k(t),endDate:k(n)}}},{label:"Ano Atual",getValue:function(){var e=new Date,t=new Date(e.getFullYear(),0,1),n=new Date(e.getFullYear(),11,31);return{startDate:k(t),endDate:k(n)}}}],A=function(){if(!p||!b)return 0;var e=new Date(p),t=new Date(b),n=Math.abs(t.getTime()-e.getTime());return Math.ceil(n/864e5)+1};return(0,r.jsxs)("div",{className:"date-range-picker ".concat(u),children:[(0,r.jsxs)("div",{className:"date-range-picker__dates-row",children:[(0,r.jsxs)("div",{className:"date-range-picker__field",children:[(0,r.jsx)("label",{htmlFor:"start-date",className:"date-range-picker__label",children:"Data inicial"}),(0,r.jsx)("input",{type:"date",id:"start-date",className:"date-range-picker__input",value:p,onChange:function(e){var t=e.target.value;h(t);var n=C(t,b);j(n||""),n||o({startDate:t,endDate:b})},max:b||void 0})]}),(0,r.jsxs)("div",{className:"date-range-picker__field",children:[(0,r.jsx)("label",{htmlFor:"end-date",className:"date-range-picker__label",children:"Data final"}),(0,r.jsx)("input",{type:"date",id:"end-date",className:"date-range-picker__input",value:b,onChange:function(e){var t=e.target.value;y(t);var n=C(p,t);j(n||""),n||o({startDate:p,endDate:t})},min:p||void 0})]})]}),(0,r.jsxs)("div",{className:"date-range-picker__bottom-row",children:[(0,r.jsx)("button",{type:"button",className:"date-range-picker__preset-btn",onClick:function(){return N(!S)},title:"Atalhos de período",children:(0,r.jsx)("i",{className:"fas fa-calendar-alt"})}),x?(0,r.jsxs)("div",{className:"date-range-picker__error",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle"}),(0,r.jsx)("span",{children:x})]}):p&&b?(0,r.jsxs)("div",{className:"date-range-picker__info",children:[(0,r.jsx)("i",{className:"fas fa-info-circle"}),(0,r.jsxs)("span",{children:["Período selecionado de ",A()," dia",A()>1?"s":"","."]})]}):null]}),S&&(0,r.jsxs)("div",{className:"date-range-picker__presets-dropdown",children:[(0,r.jsxs)("div",{className:"date-range-picker__presets-header",children:[(0,r.jsx)("span",{children:"Períodos Rápidos"}),(0,r.jsx)("button",{type:"button",className:"date-range-picker__presets-close",onClick:function(){return N(!1)},children:(0,r.jsx)("i",{className:"fas fa-times"})})]}),(0,r.jsx)("div",{className:"date-range-picker__presets-list",children:O.map(function(e,t){return(0,r.jsx)("button",{type:"button",className:"date-range-picker__preset-item",onClick:function(){return function(e){var t=e.getValue(),n=t.startDate,r=t.endDate;h(n),y(r),j(""),N(!1),o({startDate:n,endDate:r})}(e)},children:e.label},t)})})]})]})}},13359(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>f});n(64346),n(62010);var r=n(74848),a=n(88195),o=(n(52675),n(89463),n(2259),n(28706),n(23418),n(23792),n(34782),n(1688),n(23288),n(26099),n(27495),n(38781),n(47764),n(62953),n(76031),n(96540));function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){if(!e)return"";var t=new Date(e+"T00:00:00"),n=["Dom.","Seg.","Ter.","Qua.","Qui.","Sex.","Sáb."][t.getDay()],r=t.getDate(),a=["Jan.","Fev.","Mar.","Abr.","Mai.","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."][t.getMonth()],o=t.getFullYear();return"".concat(n," ").concat(r," de ").concat(a," ").concat(o)}function c(e){var t=e.selectedDate,n=e.onDateChange,a=e.formatDate,s=void 0===a?l:a,c=e.className,u=void 0===c?"":c,d=i((0,o.useState)(!1),2),f=d[0],m=d[1],p=(0,o.useRef)(null),h=function(e){var r=new Date(t+"T00:00:00");r.setDate(r.getDate()+e);var a=r.toISOString().split("T")[0];n(a)};return(0,r.jsxs)("div",{className:"d-flex align-items-center position-relative ".concat(u),style:{gap:8},children:[(0,r.jsx)("button",{type:"button",className:"btn btn-link text-muted p-1",onClick:function(e){e.stopPropagation(),h(-1)},"aria-label":"Dia anterior",children:(0,r.jsx)("i",{className:"fas fa-chevron-left"})}),(0,r.jsx)("div",{className:"tm-date-trigger",style:{fontFamily:"Inter, sans-serif",fontSize:"14px",fontWeight:400,color:"#186073",userSelect:"none",cursor:"pointer"},onClick:function(){m(!f),setTimeout(function(){var e,t;p.current&&(p.current.focus(),null===(e=(t=p.current).showPicker)||void 0===e||e.call(t))},10)},title:"Clique para selecionar data",children:s(t)}),(0,r.jsx)("button",{type:"button",className:"btn btn-link text-muted p-1",onClick:function(e){e.stopPropagation(),h(1)},"aria-label":"Próximo dia",children:(0,r.jsx)("i",{className:"fas fa-chevron-right"})}),(0,r.jsx)("input",{ref:p,type:"date",value:t,onChange:function(e){var t=e.target.value;t&&(n(t),m(!1))},onBlur:function(){return m(!1)},style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:f?"auto":"none"}})]})}function u(e){var t=e.color;return(0,r.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"9",cy:"5",r:"3",stroke:t,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M5 16C5 13.7909 6.79086 12 9 12C11.2091 12 13 13.7909 13 16V19H5V16Z",stroke:t,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M15 12L19 12M19 12L17 10M19 12L17 14",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function d(e){var t=e.color;return(0,r.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{x:"3",y:"5",width:"12",height:"10",rx:"1",stroke:t,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M6 15L6 17L12 17L12 15",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M16 10L20 10M20 10L18 8M20 10L18 12",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function f(e){var t=e.shift,n=e.selectedDate,o=e.onDateChange;if(!t||!t.rows||!Array.isArray(t.rows))return(0,r.jsxs)("div",{className:"text-center text-muted py-4",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle me-2"}),"Dados do turno não disponíveis"]});return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-3",children:[(0,r.jsxs)("span",{children:[(0,r.jsx)("strong",{children:"Turno:"})," ",t.name]}),(0,r.jsx)(c,{selectedDate:n,onDateChange:o})]}),(0,r.jsx)(a.A,{columns:[{key:"icon",label:"",width:"50px",align:"center"},{key:"horario",label:"Horário",width:"auto",align:"left"},{key:"dispositivo",label:"Dispositivo",width:"auto",align:"left"},{key:"canal",label:"Canal",width:"100px",align:"center"}],data:t.rows,emptyMessage:"Nenhum registro encontrado",renderRow:function(e,t){var n=t%2==0,a=e.muted?"#9ca3af":"#000000";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"ms-table-cell-center align-middle",children:n?(0,r.jsx)(u,{color:a}):(0,r.jsx)(d,{color:a})}),(0,r.jsx)("td",{className:"ms-table-cell ".concat(e.muted?"text-muted":""),children:e.label}),(0,r.jsx)("td",{className:"ms-table-cell ".concat(e.muted?"text-muted":""),style:{textTransform:"capitalize"},children:e.device||(0,r.jsx)("span",{className:"text-muted",children:"—"})}),(0,r.jsx)("td",{className:"ms-table-cell-center ".concat(e.muted?"text-muted":""),style:{textTransform:"capitalize"},children:e.mode||(0,r.jsx)("span",{className:"text-muted",children:"—"})})]})}})]})}},14011(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>u});n(52675),n(89463),n(2259),n(28706),n(2008),n(51629),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(26910),n(23288),n(62010),n(26099),n(58940),n(27495),n(38781),n(31415),n(21699),n(47764),n(25440),n(42762),n(23500),n(62953);var r=n(74848),a=n(96540),o=n(33930),i=n(14305),s=n(1806);function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e){var t=e.isOpen,n=e.onClose,c=e.workShift,u=e.onSave,d=e.isSaving,f=void 0!==d&&d,m=l((0,a.useState)(""),2),p=m[0],h=m[1],v=l((0,a.useState)(""),2),b=v[0],y=v[1],g=l((0,a.useState)(new Set),2),x=g[0],j=g[1],w=l((0,a.useState)(!1),2),S=(w[0],w[1]),N=l((0,a.useState)(!1),2),k=N[0],C=N[1],O=(0,a.useRef)(null),A=(0,o.I)({queryKey:["time-management","members-with-shifts"],queryFn:i.bM,staleTime:0,enabled:t}),E=A.data,P=void 0===E?[]:E,F=A.isFetching,T=A.refetch;(0,a.useEffect)(function(){t&&null!=c&&c.id&&T()},[t,null==c?void 0:c.id,T]),(0,a.useEffect)(function(){if(t&&null!=c&&c.id&&0!==P.length){var e=P.filter(function(e){return e.workShiftId===c.id}).map(function(e){return String(e.id)});j(new Set(e)),S(!0)}},[t,null==c?void 0:c.id,P]),(0,a.useEffect)(function(){t||(S(!1),h(""),y(""),C(!1))},[t]),(0,a.useEffect)(function(){t&&null!=c&&c.id&&(S(!1),C(!1))},[null==c?void 0:c.id]);var D=(0,a.useMemo)(function(){return P.filter(function(e){if(e.isRemoved||!e.enabled)return!1;var t=e.workShiftId===(null==c?void 0:c.id);if(!(null===e.workShiftId)&&!t)return!1;var n="".concat(e.firstName||""," ").concat(e.lastName||"").trim().toLowerCase(),r=!p||n.includes(p.toLowerCase()),a=e.teams?e.teams.split(",").map(function(e){return e.trim()}):[],o=!b||a.includes(b);return r&&o})},[P,p,b,null==c?void 0:c.id]),_=(0,a.useMemo)(function(){var e=new Set;return P.forEach(function(t){t.teams&&t.teams.split(",").forEach(function(t){var n=t.trim();n&&e.add(n)})}),Array.from(e).sort()},[P]),I=function(e){C(!0);var t=String(e),n=new Set(x);n.has(t)?n.delete(t):n.add(t),j(n)},M=k&&D.length>0&&x.size>0&&x.size===D.length,R=k&&x.size>0&&x.size<D.length;(0,a.useEffect)(function(){O.current&&(O.current.indeterminate=R)},[R]);var z=function(){h(""),y(""),j(new Set),S(!1),C(!1),n()},L=["#17A2B8","#28A745","#FFC107","#DC3545","#6C757D","#007BFF"];return t?(0,r.jsxs)(s.A,{show:t,onClose:z,title:"".concat((null==c?void 0:c.name)||"Turno"," - Selecionar Membros"),size:"md",className:"assign-members-modal",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:z,disabled:f,style:{fontFamily:"Inter",fontSize:"14px"},children:"Voltar"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:function(){u(Array.from(x)),z()},disabled:0===x.size||f,style:{fontFamily:"Inter",fontSize:"14px",backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:f?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("i",{className:"fas fa-spinner fa-spin mr-1"}),"Atribuindo..."]}):"Atribuir Membro"})]}),children:[(0,r.jsx)("style",{children:"\n\t\t\t\t.assign-members-modal {\n\t\t\t\t\tborder-radius: 8px;\n\t\t\t\t}\n\t\t\t\t.assign-members-modal .table {\n\t\t\t\t\tborder-collapse: collapse;\n\t\t\t\t\tborder-spacing: 0;\n\t\t\t\t}\n\t\t\t\t.assign-members-modal .table thead tr th {\n\t\t\t\t\tpadding: 8px 8px 1px 8px !important;\n\t\t\t\t\tmargin: 0 !important;\n\t\t\t\t\tborder-bottom: 1px solid #dee2e6;\n\t\t\t\t}\n\t\t\t\t.assign-members-modal .table tbody tr td {\n\t\t\t\t\tpadding: 8px !important;\n\t\t\t\t\tmargin: 0 !important;\n\t\t\t\t}\n\t\t\t\t.assign-members-modal .table tbody tr:first-child td {\n\t\t\t\t\tpadding-top: 1px !important;\n\t\t\t\t}\n\t\t\t\t.custom-control-input:checked ~ .custom-control-label::before {\n\t\t\t\t\tbackground-color: #17A2B8;\n\t\t\t\t\tborder-color: #17A2B8;\n\t\t\t\t}\n\t\t\t\t.custom-control-input:checked ~ .custom-control-label::after {\n\t\t\t\t\tbackground-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e\");\n\t\t\t\t}\n\t\t\t\t.custom-control-input:indeterminate ~ .custom-control-label::before {\n\t\t\t\t\tbackground-color: #17A2B8;\n\t\t\t\t\tborder-color: #17A2B8;\n\t\t\t\t}\n\t\t\t\t.custom-control-input:indeterminate ~ .custom-control-label::after {\n\t\t\t\t\tbackground-image: url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M 0 2 L 4 2'/%3e%3c/svg%3e\");\n\t\t\t\t}\n\t\t\t"}),(0,r.jsx)("div",{style:{padding:"24px",overflowX:"hidden"},children:(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("h6",{style:{fontFamily:"Inter",fontSize:"16px",fontWeight:600,color:"#5C5D5D",marginBottom:"8px"},children:"Atribuir Membros"}),(0,r.jsx)("p",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"#6c757d",marginBottom:"16px"},children:"Adicione os membros que utilizarão esse turno como referência para bater o ponto."}),(0,r.jsxs)("div",{className:"row",style:{marginBottom:"20px"},children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"input-group",children:[(0,r.jsx)("div",{className:"input-group-prepend",children:(0,r.jsx)("span",{className:"input-group-text",children:(0,r.jsx)("i",{className:"fas fa-search"})})}),(0,r.jsx)("input",{type:"text",className:"form-control",placeholder:"Buscar por Nome",value:p,onChange:function(e){return h(e.target.value)},style:{fontFamily:"Inter",fontSize:"14px"}})]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("select",{className:"form-control",value:b,onChange:function(e){return y(e.target.value)},style:{fontFamily:"Inter",fontSize:"14px"},children:[(0,r.jsx)("option",{value:"",children:"Filtrar por Equipe"}),_.map(function(e){return(0,r.jsx)("option",{value:e,children:e},e)})]})})]}),(0,r.jsx)("div",{style:{maxHeight:"350px",overflowY:"auto",overflowX:"hidden",border:"1px solid #dee2e6",borderRadius:"4px",marginTop:0},children:(0,r.jsxs)("table",{className:"table table-hover mb-0",style:{tableLayout:"fixed",width:"100%",marginBottom:0},children:[(0,r.jsx)("thead",{style:{position:"sticky",top:0,backgroundColor:"#f8f9fa",zIndex:1},children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{style:{width:"50px",fontFamily:"Inter",fontSize:"14px",textAlign:"center",verticalAlign:"middle",padding:"8px",margin:0},children:(0,r.jsxs)("div",{className:"custom-control custom-checkbox",style:{display:"inline-block"},children:[(0,r.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"select-all-members",checked:M,ref:O,onChange:function(){if(C(!0),x.size===D.length)j(new Set);else{var e=D.map(function(e){return String(e.id)});j(new Set(e))}}}),(0,r.jsx)("label",{className:"custom-control-label",htmlFor:"select-all-members"})]})}),(0,r.jsx)("th",{style:{width:"55%",fontFamily:"Inter",fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:1},children:"Membro"}),(0,r.jsx)("th",{style:{width:"40%",fontFamily:"Inter",fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:1},children:"Equipe"})]})}),(0,r.jsx)("tbody",{style:{margin:0,padding:0},children:F?(0,r.jsx)("tr",{children:(0,r.jsxs)("td",{colSpan:3,className:"text-center py-4",style:{padding:"8px"},children:[(0,r.jsx)("i",{className:"fas fa-spinner fa-spin mr-2"}),"Carregando membros..."]})}):0===D.length?(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:3,className:"text-center py-4 text-muted",children:"Nenhum membro encontrado"})}):D.map(function(e){var t,n,a,o=String(e.id),i=x.has(o),s="".concat(e.firstName||""," ").concat(e.lastName||"").trim(),l=e.email||"",c=(t=e.firstName,n=e.lastName,t&&t.length>0?t[0].toUpperCase():n&&n.length>0?n[0].toUpperCase():"U"),u=(a=parseInt(o.replace(/\D/g,""))%L.length,L[a]);return(0,r.jsxs)("tr",{style:{cursor:"pointer"},onClick:function(){return I(o)},children:[(0,r.jsx)("td",{onClick:function(e){return e.stopPropagation()},style:{textAlign:"center",verticalAlign:"middle",margin:0},children:(0,r.jsxs)("div",{className:"custom-control custom-checkbox",style:{display:"inline-block"},children:[(0,r.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"member-".concat(o),checked:i,onChange:function(){return I(o)}}),(0,r.jsx)("label",{className:"custom-control-label",htmlFor:"member-".concat(o)})]})}),(0,r.jsx)("td",{style:{overflow:"hidden",padding:"8px",margin:0},children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsxs)("div",{style:{position:"relative",marginRight:"12px",flexShrink:0},children:[e.hasCrown&&(0,r.jsx)("img",{src:"/images/employee-advocacy/image.png",alt:"Crown",style:{position:"absolute",top:"-9px",left:"50%",transform:"translateX(-50%)",width:"13px",height:"13px",zIndex:2}}),(0,r.jsx)("div",{className:"rounded-circle d-flex align-items-center justify-content-center text-white",style:{width:"30px",height:"30px",backgroundColor:u,fontSize:"12px",fontWeight:600,border:e.hasCrown?"2px solid #FFD700":"none",boxShadow:e.hasCrown?"0 0 6px rgba(255, 215, 0, 0.5)":"none"},children:c})]}),(0,r.jsxs)("div",{style:{overflow:"hidden",minWidth:0},children:[(0,r.jsx)("div",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s||"Sem nome"}),l&&(0,r.jsx)("div",{style:{fontFamily:"Inter",fontSize:"12px",color:"#6c757d",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l})]})]})}),(0,r.jsx)("td",{style:{overflow:"hidden",padding:"8px",margin:0},children:(0,r.jsx)("div",{className:"d-flex flex-wrap",style:{maxWidth:"100%"},children:e.teams?e.teams.split(",").map(function(e,t){return(0,r.jsx)("span",{className:"badge badge-info mr-1 mb-1",style:{fontFamily:"Inter",fontSize:"11px",fontWeight:500,backgroundColor:"#17A2B8",padding:"4px 8px"},children:e.trim()},t)}):null})})]},e.id)})})]})})]})})]}):null}},14305(e,t,n){"use strict";n.d(t,{LW:()=>v,Nq:()=>y,ZD:()=>p,bM:()=>f,iT:()=>u});n(52675),n(89463),n(25276),n(23792),n(23288),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(38781),n(47764),n(42762),n(62953),n(48408);var r=n(52354),a=["hitTheSpotId"];function o(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function i(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var i=r&&r.prototype instanceof c?r:c,u=Object.create(i.prototype);return s(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,s(m,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,a,"GeneratorFunction"),s(m),s(m,a,"Generator"),s(m,r,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),(i=function(){return{w:o,m:p}})()}function s(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}s=function(e,t,n,r){function o(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},s(e,t,n,r)}function l(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){l(o,r,a,i,s,"next",e)}function s(e){l(o,r,a,i,s,"throw",e)}i(void 0)})}}function u(e){return d.apply(this,arguments)}function d(){return(d=c(i().m(function e(t){var n,a,o,s,l,c;return i().w(function(e){for(;;)switch(e.n){case 0:return n=new URLSearchParams,a=t&&""!==String(t).trim()?String(t):"0",n.append("work_shift_id",a),o=n.toString(),s="/time-management/members/company".concat(o?"?".concat(o):""),e.n=1,r.F.get(s);case 1:return l=e.v,c=l.data,e.a(2,c.data)}},e)}))).apply(this,arguments)}function f(){return m.apply(this,arguments)}function m(){return(m=c(i().m(function e(){var t,n;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/members/with-shifts");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=c(i().m(function e(t){var n,a,o,s,l;return i().w(function(e){for(;;)switch(e.n){case 0:return n=new URLSearchParams,null!=t&&t.start_date&&""!==t.start_date.trim()&&n.append("start_date",t.start_date),null!=t&&t.end_date&&""!==t.end_date.trim()&&n.append("end_date",t.end_date),null!=t&&t.work_shift_id&&""!==t.work_shift_id.trim()&&n.append("work_shift_id",t.work_shift_id),null!=t&&t.member_name&&""!==t.member_name.trim()&&n.append("member_name",t.member_name),null!=t&&t.status&&""!==t.status.trim()&&n.append("status",t.status),null!=t&&t.page&&t.page>0&&n.append("page",t.page.toString()),null!=t&&t.limit&&t.limit>0&&n.append("limit",t.limit.toString()),a=n.toString(),o="/time-management/hit-spot-time/history".concat(a?"?".concat(a):""),e.n=1,r.F.get(o);case 1:return s=e.v,l=s.data,e.a(2,l)}},e)}))).apply(this,arguments)}function v(e){return b.apply(this,arguments)}function b(){return(b=c(i().m(function e(t){var n,a,o,s;return i().w(function(e){for(;;)switch(e.n){case 0:return n=new URLSearchParams,null!=t&&t.start_date&&""!==t.start_date.trim()&&n.append("start_date",t.start_date),null!=t&&t.end_date&&""!==t.end_date.trim()&&n.append("end_date",t.end_date),null!=t&&t.work_shift_id&&""!==t.work_shift_id.trim()&&n.append("work_shift_id",t.work_shift_id),null!=t&&t.member_name&&""!==t.member_name.trim()&&n.append("member_name",t.member_name),null!=t&&t.status&&""!==t.status.trim()&&n.append("status",t.status),a=n.toString(),o="/time-management/hit-spot-time/history/export".concat(a?"?".concat(a):""),e.n=1,r.F.get(o,{responseType:"blob",headers:{Accept:"text/csv"}});case 1:return s=e.v,e.a(2,s.data)}},e)}))).apply(this,arguments)}function y(e){return g.apply(this,arguments)}function g(){return(g=c(i().m(function e(t){var n,s,l,c;return i().w(function(e){for(;;)switch(e.n){case 0:return n=t.hitTheSpotId,s=o(t,a),e.n=1,r.F.put("/time-management/hit-the-spot/".concat(n,"/edit"),s);case 1:return l=e.v,c=l.data,e.a(2,c.data)}},e)}))).apply(this,arguments)}},14463(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>m});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(9868),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(78459),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(96540),o=n(1806);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f={formGroup:{marginBottom:"20px"},label:{display:"block",fontSize:"13px",fontWeight:600,color:"#5C5D5D",marginBottom:"8px"},input:{width:"100%",padding:"10px",border:"1px solid #D1D5DB",borderRadius:"5px",fontSize:"14px",color:"#5C5D5D"},inputGroup:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"15px"},textarea:{width:"100%",padding:"10px",border:"1px solid #D1D5DB",borderRadius:"5px",fontSize:"14px",color:"#5C5D5D",minHeight:"80px",resize:"vertical"},modeToggle:{display:"flex",gap:"10px",marginBottom:"20px"},modeButton:{flex:1,padding:"10px",border:"1px solid #D1D5DB",borderRadius:"5px",backgroundColor:"#FFF",fontSize:"14px",fontWeight:600,color:"#5C5D5D",cursor:"pointer",transition:"all 0.2s"},modeButtonActive:{backgroundColor:"#186073",color:"#FFF",borderColor:"#186073"},infoText:{fontSize:"12px",color:"#6B7280",marginTop:"5px"}};function m(e){var t=e.show,n=e.onClose,i=e.onSubmit,s=e.selectedProject,c=e.selectedActivity,d=e.selectedTask,m=void 0===d?"":d,p=e.workloadHours,h=void 0===p?8:p,v=e.prefilledData,b=void 0===v?null:v,y=e.isReadOnly,g=void 0!==y&&y,x=e.allowProjectSelection,j=void 0!==x&&x,w=e.projectOptions,S=void 0===w?[]:w,N=e.activityOptions,k=void 0===N?[]:N,C=e.selectedProjectId,O=void 0===C?null:C,A=e.selectedActivityId,E=void 0===A?null:A,P=e.suggestedProjectName,F=e.suggestedActivityName,T=e.onProjectChange,D=e.onActivityChange,_=e.alreadyRegisteredMinutes,I=void 0===_?0:_,M=e.dailyLimitHours,R=void 0===M?null:M,z=u((0,a.useState)("time"),2),L=z[0],q=z[1],B=u((0,a.useState)(""),2),G=B[0],H=B[1],W=u((0,a.useState)(""),2),U=W[0],V=W[1],Q=u((0,a.useState)(""),2),K=Q[0],$=Q[1],J=u((0,a.useState)(""),2),Y=J[0],Z=J[1],X=u((0,a.useState)(!1),2),ee=X[0],te=X[1];(0,a.useEffect)(function(){t&&b?(q("time"),H(b.startTime),V(b.endTime),$(b.percentage.toFixed(2)),Z(b.comment||"")):t||(q("time"),H(""),V(""),$(""),Z(""))},[t,b]);var ne=function(e,t){if(!e||!t)return 0;var n=u(e.split(":").map(Number),2),r=n[0],a=n[1],o=u(t.split(":").map(Number),2);return 60*o[0]+o[1]-(60*r+a)},re=function(e,t){var n=ne(e,t),r=60*h;return r>0?n/r*100:0},ae=function(e){return!!R&&I+e>60*R};(0,a.useEffect)(function(){if("time"===L&&G&&U){var e=ne(G,U);te(ae(e))}else if("percentage"===L&&K){var t=60*h,n=Math.round(parseFloat(K)/100*t);te(ae(n))}else te(!1)},[L,G,U,K,I,R]);var oe,ie,se,le;return(0,r.jsxs)(o.A,{show:t,onClose:n,title:g?"Finalizar Contador Automático":"Adicionar Tempo Manual",size:"md",footer:(0,r.jsx)(o.M,{onCancel:n,onConfirm:function(){if("time"===L){if(!G||!U)return void alert("Por favor, preencha horário de início e fim");var e=ne(G,U);if(e<=0)return void alert("Horário de término deve ser maior que horário de início");var t=re(G,U);i({startTime:G,endTime:U,percentage:t,duration:e,comment:Y})}else{if(!K||parseFloat(K)<=0)return void alert("Por favor, informe uma porcentagem válida");var n=parseFloat(K);if(n>100)return void alert("Porcentagem não pode ser maior que 100%");var r=60*h,a=Math.round(n/100*r);i({startTime:"00:00",endTime:"00:00",percentage:n,duration:a,comment:Y})}},cancelText:"Cancelar",confirmText:"Salvar"}),children:[(0,r.jsxs)("div",{style:l(l({},f.formGroup),{},{backgroundColor:"#F8F9FA",padding:"12px",borderRadius:"5px"}),children:[j?(0,r.jsxs)("div",{style:{marginBottom:"12px"},children:[(0,r.jsx)("label",{style:l(l({},f.label),{},{marginBottom:"6px"}),children:"Projeto"}),(0,r.jsxs)("select",{style:l(l({},f.input),{},{backgroundColor:"#FFF"}),value:null!=O?O:"",onChange:function(e){var t=e.target.value,n=t?Number(t):null;null==T||T(n)},disabled:g,children:[(0,r.jsx)("option",{value:"",children:"Selecione um projeto"}),S.map(function(e){return(0,r.jsx)("option",{value:e.id,children:e.name},e.id)})]}),P&&!O&&(0,r.jsxs)("p",{style:l(l({},f.infoText),{},{marginTop:"6px"}),children:["Sugestão original: ",(0,r.jsx)("strong",{children:P})]})]}):(0,r.jsxs)("div",{style:{marginBottom:"5px"},children:[(0,r.jsx)("strong",{style:{fontSize:"13px",color:"#5C5D5D"},children:"Projeto:"})," ",(0,r.jsx)("span",{style:{fontSize:"13px",color:"#5C5D5D"},children:s||"Nenhum"})]}),m&&(0,r.jsxs)("div",{style:{marginBottom:"5px"},children:[(0,r.jsx)("strong",{style:{fontSize:"13px",color:"#5C5D5D"},children:"Tarefa:"})," ",(0,r.jsx)("span",{style:{fontSize:"13px",color:"#5C5D5D"},children:m})]}),j?(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:l(l({},f.label),{},{marginBottom:"6px"}),children:"Atividade"}),(0,r.jsxs)("select",{style:l(l({},f.input),{},{backgroundColor:"#FFF"}),value:null!=E?E:"",onChange:function(e){var t=e.target.value,n=t?Number(t):null;null==D||D(n)},disabled:g,children:[(0,r.jsx)("option",{value:"",children:"Selecione uma atividade"}),k.map(function(e){return(0,r.jsx)("option",{value:e.id,children:e.name},e.id)})]}),F&&!E&&(0,r.jsxs)("p",{style:l(l({},f.infoText),{},{marginTop:"6px"}),children:["Sugestão original: ",(0,r.jsx)("strong",{children:F})]})]}):c&&(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{style:{fontSize:"13px",color:"#5C5D5D"},children:"Atividade:"})," ",(0,r.jsx)("span",{style:{fontSize:"13px",color:"#5C5D5D"},children:c})]})]}),!g&&(0,r.jsxs)("div",{style:f.modeToggle,children:[(0,r.jsx)("button",{type:"button",style:l(l({},f.modeButton),"time"===L?f.modeButtonActive:{}),onClick:function(){return q("time")},children:"Horário Início/Fim"}),(0,r.jsx)("button",{type:"button",style:l(l({},f.modeButton),"percentage"===L?f.modeButtonActive:{}),onClick:function(){return q("percentage")},children:"% do Dia"})]}),"time"===L?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:f.inputGroup,children:[(0,r.jsxs)("div",{style:f.formGroup,children:[(0,r.jsx)("label",{style:f.label,children:"Hora de Início"}),(0,r.jsx)("input",{type:"time",style:l(l({},f.input),g?{backgroundColor:"#F3F4F6",cursor:"not-allowed"}:{}),value:G,onChange:function(e){return H(e.target.value)},disabled:g})]}),(0,r.jsxs)("div",{style:f.formGroup,children:[(0,r.jsx)("label",{style:f.label,children:"Hora de Término"}),(0,r.jsx)("input",{type:"time",style:l(l({},f.input),g?{backgroundColor:"#F3F4F6",cursor:"not-allowed"}:{}),value:U,onChange:function(e){return V(e.target.value)},disabled:g})]})]}),G&&U&&ne(G,U)>0&&(0,r.jsxs)("div",{style:{marginTop:"15px",padding:"12px",backgroundColor:"#E8F4F8",borderRadius:"5px",borderLeft:"3px solid #186073"},children:[(0,r.jsx)("div",{style:{fontSize:"13px",color:"#5C5D5D",marginBottom:"5px"},children:(0,r.jsx)("strong",{children:"Resumo:"})}),(0,r.jsxs)("div",{style:{fontSize:"12px",color:"#5C5D5D",lineHeight:"1.6"},children:[(0,r.jsxs)("div",{children:["Duração: ",(0,r.jsxs)("strong",{children:[Math.floor(ne(G,U)/60),"h ",ne(G,U)%60,"min"]})]}),(0,r.jsxs)("div",{children:["Porcentagem: ",(0,r.jsxs)("strong",{children:[re(G,U).toFixed(2),"%"]})," do dia"]}),(0,r.jsxs)("div",{children:["Base: ",h,"h de carga horária"]})]})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:f.formGroup,children:[(0,r.jsx)("label",{style:f.label,children:"Porcentagem do Dia (%)"}),(0,r.jsx)("input",{type:"number",style:l(l({},f.input),g?{backgroundColor:"#F3F4F6",cursor:"not-allowed"}:{}),value:K,onChange:function(e){return $(e.target.value)},placeholder:"Ex: 25",min:"0",max:"100",step:"0.01",disabled:g}),(0,r.jsxs)("p",{style:f.infoText,children:["Base: ",h,"h por dia (100% = ",60*h," minutos)"]})]}),K&&parseFloat(K)>0&&parseFloat(K)<=100&&(0,r.jsxs)("div",{style:{marginTop:"15px",padding:"12px",backgroundColor:"#E8F4F8",borderRadius:"5px",borderLeft:"3px solid #186073"},children:[(0,r.jsx)("div",{style:{fontSize:"13px",color:"#5C5D5D",marginBottom:"5px"},children:(0,r.jsx)("strong",{children:"Resumo:"})}),(0,r.jsx)("div",{style:{fontSize:"12px",color:"#5C5D5D",lineHeight:"1.6"},children:(oe=60*h,ie=Math.round(parseFloat(K)/100*oe),se=Math.floor(ie/60),le=ie%60,(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:["Porcentagem: ",(0,r.jsxs)("strong",{children:[parseFloat(K).toFixed(2),"%"]})," do dia"]}),(0,r.jsxs)("div",{children:["Duração: ",(0,r.jsxs)("strong",{children:[se,"h ",le,"min"]})," (",ie," minutos)"]}),(0,r.jsxs)("div",{children:["Base: ",h,"h de carga horária"]})]}))})]})]}),(0,r.jsxs)("div",{style:f.formGroup,children:[(0,r.jsx)("label",{style:f.label,children:"Comentário (opcional)"}),(0,r.jsx)("textarea",{style:f.textarea,value:Y,onChange:function(e){return Z(e.target.value)},placeholder:"Adicione observações sobre a atividade..."})]}),ee&&R&&function(){var e=0;if("time"===L&&G&&U)e=ne(G,U);else if("percentage"===L&&K){var t=60*h;e=Math.round(parseFloat(K)/100*t)}var n=I+e,a=function(e){var t=Math.floor(e/60),n=e%60;return n>0?"".concat(t,"h").concat(n,"min"):"".concat(t,"h")};return(0,r.jsx)("div",{className:"alert alert-danger",role:"alert",children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-triangle mr-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{children:"Atenção: Limite de horas excedido!"}),(0,r.jsxs)("div",{className:"mt-2",style:{fontSize:"0.95rem"},children:["• Já registrado hoje: ",(0,r.jsx)("strong",{children:a(I)}),(0,r.jsx)("br",{}),"• Tentando adicionar: ",(0,r.jsx)("strong",{children:a(e)}),(0,r.jsx)("br",{}),"• Total seria: ",(0,r.jsx)("strong",{children:a(n)}),(0,r.jsx)("br",{}),"• Limite diário: ",(0,r.jsxs)("strong",{children:[R,"h"]})]}),(0,r.jsxs)("div",{className:"mt-2 small text-danger",children:[(0,r.jsx)("i",{className:"fas fa-ban mr-1"}),"Esta atividade será bloqueada ao tentar salvar."]})]})]})})}()]})}},14785(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>U});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(68156),n(62953);var r=n(74848),a=n(96540),o=n(33930),i=n(10280);n(45700),n(2008),n(51629),n(89572),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(23500);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=e.label,n=e.isActive,a=e.onClick,o=e.width,i=void 0===o?"80.56px":o,s=e.className,l=void 0===s?"":s;return(0,r.jsx)("button",{onClick:a,className:"btn ".concat(n?"text-white":"btn-outline-info"," ").concat(l),style:c({width:i},n?{backgroundColor:"rgb(23, 162, 184)"}:{}),children:t})}var f=n(30588),m=n(73236),p=(n(94170),n(59904),n(40875),n(10287),n(3362),n(52354));function h(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return v(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(v(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,v(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,v(d,"constructor",c),v(c,"constructor",l),l.displayName="GeneratorFunction",v(c,a,"GeneratorFunction"),v(d),v(d,a,"Generator"),v(d,r,function(){return this}),v(d,"toString",function(){return"[object Generator]"}),(h=function(){return{w:o,m:f}})()}function v(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}v=function(e,t,n,r){function o(t,n){v(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},v(e,t,n,r)}function b(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function y(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){b(o,r,a,i,s,"next",e)}function s(e){b(o,r,a,i,s,"throw",e)}i(void 0)})}}function g(){return(g=y(h().m(function e(t,n){var r,a,o;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/kpis?start_date=".concat(t,"&end_date=").concat(n));case 1:return r=e.v,a=r.data.data,e.a(2,{totalRegistered:{hours:a.total_registered_formatted||"0h",label:"Total de Horas Registradas",source:"timesheet"},dailyAverage:{hours:a.daily_average_formatted||"0h",label:"Média Diária",source:"timesheet"},extraHours:{count:a.extra_hours_formatted||"0h",label:"Total de Horas Extras",source:"timesheet"},missingHours:{hours:a.missing_hours_formatted||"0h",label:"Total de Horas Faltantes",source:"timesheet"}});case 2:return e.p=2,o=e.v,console.error("Erro ao buscar KPIs do Tenant:",o),e.a(2,{totalRegistered:{hours:"...",label:"Total de Horas Registradas",source:"timesheet"},dailyAverage:{hours:"...",label:"Média Diária",source:"timesheet"},extraHours:{count:"...",label:"Total de Horas Extras",source:"timesheet"},missingHours:{hours:"...",label:"Total de Horas Faltantes",source:"timesheet"}})}},e,null,[[0,2]])}))).apply(this,arguments)}function x(){return(x=y(h().m(function e(t,n){var r,a;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/weekly-hours?start_date=".concat(t,"&end_date=").concat(n));case 1:return r=e.v,e.a(2,r.data.data||{timesheet:[],attendance:[]});case 2:return e.p=2,a=e.v,console.error("Erro ao buscar Weekly Hours do Tenant:",a),e.a(2,{timesheet:[],attendance:[]})}},e,null,[[0,2]])}))).apply(this,arguments)}function j(){return(j=y(h().m(function e(t,n){var r,a;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/projects/distribution?start_date=".concat(t,"&end_date=").concat(n));case 1:return r=e.v,e.a(2,r.data.data||[]);case 2:return e.p=2,a=e.v,console.error("Erro ao buscar distribuição de projetos do Tenant:",a),e.a(2,[])}},e,null,[[0,2]])}))).apply(this,arguments)}function w(){return(w=y(h().m(function e(t,n,r,a){var o,i,s;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,o="team"===r?"team_id":"group_id",e.n=1,p.F.get("/api/timesheet-v2/tenant/projects/distribution-pie?start_date=".concat(t,"&end_date=").concat(n,"&").concat(o,"=").concat(a));case 1:return i=e.v,e.a(2,{data:i.data.data||[],filter:i.data.filter||{type:r,id:a,member_count:0}});case 2:return e.p=2,s=e.v,console.error("Erro ao buscar distribuição de projetos por equipe/time:",s),e.a(2,{data:[],filter:{type:r,id:String(a),member_count:0}})}},e,null,[[0,2]])}))).apply(this,arguments)}function S(){return N.apply(this,arguments)}function N(){return(N=y(h().m(function e(){var t,n;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/teams");case 1:return t=e.v,e.a(2,t.data.data||[]);case 2:return e.p=2,n=e.v,console.error("Erro ao buscar equipes:",n),e.a(2,[])}},e,null,[[0,2]])}))).apply(this,arguments)}function k(){return C.apply(this,arguments)}function C(){return(C=y(h().m(function e(){var t,n;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/groups");case 1:return t=e.v,e.a(2,t.data.data||[]);case 2:return e.p=2,n=e.v,console.error("Erro ao buscar times:",n),e.a(2,[])}},e,null,[[0,2]])}))).apply(this,arguments)}function O(){return(O=y(h().m(function e(t,n){var r,a;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/energy-peaks?start_date=".concat(t,"&end_date=").concat(n));case 1:return r=e.v,e.a(2,r.data.data||{timesheet:[],attendance:[]});case 2:return e.p=2,a=e.v,console.error("Erro ao buscar picos de energia do Tenant:",a),e.a(2,{timesheet:[],attendance:[]})}},e,null,[[0,2]])}))).apply(this,arguments)}function A(){return(A=y(h().m(function e(t,n){var r,a;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/projects/budget-map?start_date=".concat(t,"&end_date=").concat(n));case 1:return r=e.v,e.a(2,r.data.data||[]);case 2:return e.p=2,a=e.v,console.error("Erro ao buscar mapa de projetos:",a),e.a(2,[])}},e,null,[[0,2]])}))).apply(this,arguments)}function E(){return(E=y(h().m(function e(t,n,r){var a,o;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/teams/summary?start_date=".concat(t,"&end_date=").concat(n,"&type=").concat(r));case 1:return a=e.v,e.a(2,a.data.data||[]);case 2:return e.p=2,o=e.v,console.error("Erro ao buscar resumo de equipes:",o),e.a(2,[])}},e,null,[[0,2]])}))).apply(this,arguments)}function P(){return(P=y(h().m(function e(t,n,r,a){var o,i,s;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/teams/kpis?start_date=".concat(t,"&end_date=").concat(n,"&type=").concat(r,"&filter_id=").concat(a));case 1:if(o=e.v,!(i=o.data.data)||!("total_registered_formatted"in i)){e.n=2;break}return e.a(2,{totalHoursWorked:{hours:i.total_registered_hours||0,minutes:i.total_registered_minutes||0,formatted:i.total_registered_formatted||"0h00"},totalMissingHours:{hours:i.missing_hours_hours||0,minutes:i.missing_hours_minutes||0,formatted:i.missing_hours_formatted||"0h00"},totalExtraHours:{hours:i.extra_hours_hours||0,minutes:i.extra_hours_minutes||0,formatted:i.extra_hours_formatted||"0h"},workOverload:i.work_overload||0,memberCount:i.member_count||0});case 2:return e.a(2,i||{totalHoursWorked:{hours:0,minutes:0,formatted:"0h00"},totalMissingHours:{hours:0,minutes:0,formatted:"0h00"},totalExtraHours:{hours:0,minutes:0,formatted:"0h00"},workOverload:0,memberCount:0});case 3:return e.p=3,s=e.v,console.error("Erro ao buscar KPIs de equipe:",s),e.a(2,{totalHoursWorked:{hours:0,minutes:0,formatted:"0h00"},totalMissingHours:{hours:0,minutes:0,formatted:"0h00"},totalExtraHours:{hours:0,minutes:0,formatted:"0h00"},workOverload:0,memberCount:0})}},e,null,[[0,3]])}))).apply(this,arguments)}function F(){return(F=y(h().m(function e(t,n){var r,a;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,p.F.get("/api/timesheet-v2/tenant/members/summary?start_date=".concat(t,"&end_date=").concat(n));case 1:return r=e.v,e.a(2,r.data.data||[]);case 2:return e.p=2,a=e.v,console.error("Erro ao buscar resumo de membros:",a),e.a(2,[])}},e,null,[[0,2]])}))).apply(this,arguments)}var T=n(71458),D=n(93628),_=n(80217),I=n(65207),M=n(42328),R=n(49299),z=n(4818),L=n(92801),q=n(72722),B=n(9504),G=n(50860);function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return W(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function U(){var e,t,n,s,l,c,u,p,h,v,b,y,N,C,W=H((0,a.useState)(function(){var e=new Date,t=new Date;t.setDate(t.getDate()-30);var n=function(e){var t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)};return{startDate:n(t),endDate:n(e)}}()),2),U=W[0],V=W[1],Q=H((0,a.useState)("times"),2),K=Q[0],$=Q[1],J=H((0,a.useState)("equipes"),2),Y=J[0],Z=J[1],X=H((0,a.useState)(["task","attendance"]),2),ee=X[0],te=X[1],ne=H((0,a.useState)(["timesheet","attendance"]),2),re=ne[0],ae=ne[1],oe=H((0,a.useState)(null),2),ie=oe[0],se=oe[1],le=(0,a.useRef)(null),ce=H((0,a.useState)(!1),2),ue=ce[0],de=ce[1],fe=(0,o.I)({queryKey:["time-management","teams"],queryFn:S,staleTime:3e5}).data,me=void 0===fe?[]:fe,pe=(0,o.I)({queryKey:["time-management","groups"],queryFn:k,staleTime:3e5}).data,he=void 0===pe?[]:pe,ve="equipes"===K?(null===(e=me[0])||void 0===e?void 0:e.id)||null:(null===(t=he[0])||void 0===t?void 0:t.id)||null,be="equipes"===Y?(null===(n=me[0])||void 0===n?void 0:n.id)||null:(null===(s=he[0])||void 0===s?void 0:s.id)||null,ye=(0,o.I)({queryKey:["time-management","timesheet","projects-distribution",U.startDate,U.endDate],queryFn:function(){return function(e,t){return j.apply(this,arguments)}(U.startDate,U.endDate)},staleTime:6e4,refetchOnWindowFocus:!1}),ge=ye.data,xe=(0,o.I)({queryKey:["time-management","timesheet","projects-distribution-pie",U.startDate,U.endDate,K,ve],queryFn:function(){return ve?function(e,t,n,r){return w.apply(this,arguments)}(U.startDate,U.endDate,"equipes"===K?"team":"group",ve):{data:[],filter:{type:K,id:"",member_count:0}}},enabled:!!ve,staleTime:6e4,refetchOnWindowFocus:!1}),je=xe.data,we=(0,o.I)({queryKey:["time-management","timesheet","weekly-hours",U.startDate,U.endDate],queryFn:function(){return function(e,t){return x.apply(this,arguments)}(U.startDate,U.endDate)},staleTime:6e4,refetchOnWindowFocus:!1}),Se=we.data,Ne=(0,o.I)({queryKey:["time-management","timesheet","energy-peaks",U.startDate,U.endDate],queryFn:function(){return function(e,t){return O.apply(this,arguments)}(U.startDate,U.endDate)},staleTime:6e4,refetchOnWindowFocus:!1}),ke=Ne.data,Ce=(0,o.I)({queryKey:["time-management","timesheet","projects-budget-map",U.startDate,U.endDate],queryFn:function(){return function(e,t){return A.apply(this,arguments)}(U.startDate,U.endDate)},staleTime:6e4,refetchOnWindowFocus:!1}),Oe=Ce.data,Ae=(0,o.I)({queryKey:["time-management","timesheet","teams-summary",U.startDate,U.endDate,Y],queryFn:function(){return function(e,t,n){return E.apply(this,arguments)}(U.startDate,U.endDate,"equipes"===Y?"team":"group")},staleTime:6e4,refetchOnWindowFocus:!1}),Ee=Ae.data,Pe=(0,o.I)({queryKey:["time-management","timesheet","general-kpis",U.startDate,U.endDate],queryFn:function(){return function(e,t){return g.apply(this,arguments)}(U.startDate,U.endDate)},staleTime:6e4,refetchOnWindowFocus:!1}),Fe=Pe.data,Te=(0,o.I)({queryKey:["time-management","timesheet","teams-kpis",U.startDate,U.endDate,Y,be],queryFn:function(){return be?function(e,t,n,r){return P.apply(this,arguments)}(U.startDate,U.endDate,"equipes"===Y?"team":"group",be):null},enabled:!!be,staleTime:6e4,refetchOnWindowFocus:!1}),De=Te.data,_e=(0,o.I)({queryKey:["time-management","timesheet","members-summary",U.startDate,U.endDate],queryFn:function(){return function(e,t){return F.apply(this,arguments)}(U.startDate,U.endDate)},staleTime:6e4,refetchOnWindowFocus:!1}),Ie=_e.data;return ie?(0,r.jsx)(L.A,{title:"Dashboard - ".concat(ie.name),subtitle:"Visão detalhada das horas trabalhadas e performance individual",showBackButton:!0,onBack:function(){return se(null)},showExportButton:!0,onExport:function(){return console.log("Exportar dashboard do colaborador")},userInfo:{name:ie.name,initials:ie.initials,avatarBg:ie.avatarBg},memberId:ie.id}):(0,r.jsxs)("section",{ref:le,className:"options-section-project",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-4 mt-3",children:[(0,r.jsxs)("button",{onClick:function(){(0,B.vl)({dashboardRef:le,dateRange:U,setIsExporting:de})},disabled:ue,className:"btn ml-4",style:{backgroundColor:"#186073",color:"#fff",border:"none",borderRadius:"8px",padding:"10px 20px",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"8px",cursor:ue?"not-allowed":"pointer",opacity:ue?.7:1,transition:"all 0.2s ease"},onMouseEnter:function(e){ue||(e.currentTarget.style.backgroundColor="#134A5A")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#186073"},children:[(0,r.jsx)("i",{className:"fas fa-download"}),ue?"Exportando...":"Exportar"]}),(0,r.jsx)(f.A,{initialStartDate:U.startDate,initialEndDate:U.endDate,onChange:function(e){V(e)},maxDays:365,className:"mr-4"})]}),(0,r.jsxs)(G.A,{title:"",subtitle:"",children:[(0,r.jsxs)("div",{className:"row mb-4",children:[(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:(null==Fe||null===(l=Fe.totalRegistered)||void 0===l?void 0:l.hours)||"",label:"Total de Horas Registradas",variant:"teal-dark",className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:(null==Fe||null===(c=Fe.dailyAverage)||void 0===c?void 0:c.hours)||"",label:"Média Diária",variant:"cyan",className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:(null==Fe||null===(u=Fe.extraHours)||void 0===u?void 0:u.count)||"",label:"Total de Horas Extras",variant:"turquoise",className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:(null==Fe||null===(p=Fe.missingHours)||void 0===p?void 0:p.hours)||"",label:"Total de Horas Faltantes",variant:"salmon",className:"h-100"})})]}),(0,r.jsx)(m.A,{title:"Horas Trabalhadas na Semana",className:"mt-3",headerActions:(0,r.jsx)(q.A,{options:[{value:"task",label:"Referência Por Task"},{value:"attendance",label:"Referência Por Registro de Ponto"}],selectedValues:ee,onChange:te,placeholder:"Selecione os filtros",dropdownStyle:{right:0,left:"auto"}}),children:(0,r.jsx)(T.A,{selectedFilters:ee,weeklyData:(null==Se?void 0:Se.timesheet)||[],attendanceData:(null==Se?void 0:Se.attendance)||[]})}),(0,r.jsx)(m.A,{title:"Horas trabalhadas por projeto",className:"mt-3",children:(0,r.jsx)(D.A,{projects:ge||[]})}),(0,r.jsxs)("div",{className:"row mt-3",children:[(0,r.jsx)("div",{className:"col-12 col-lg-4 mb-3",children:(0,r.jsxs)(m.A,{title:"Distribuição de Horas por Projeto",className:"h-100",children:[(0,r.jsx)("div",{className:"mb-3 d-flex justify-content-end",children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)(d,{label:"Equipe",isActive:"equipes"===K,onClick:function(){return $("equipes")},width:"80.56px",className:"mr-2"}),(0,r.jsx)(d,{label:"Time",isActive:"times"===K,onClick:function(){return $("times")},width:"89.68px"})]})}),(0,r.jsx)(_.default,{viewMode:K,onViewModeChange:$,projects:(null==je?void 0:je.data)||[]})]})}),(0,r.jsx)("div",{className:"col-12 col-lg-8 mb-3",children:(0,r.jsx)(m.A,{title:"Picos de Energia - Horas Registradas por Dia",className:"h-100",headerActions:(0,r.jsx)(q.A,{options:[{value:"timesheet",label:"Por Timesheet"},{value:"attendance",label:"Por Registro de Ponto"}],selectedValues:re,onChange:ae,placeholder:"Selecione os filtros"}),children:(0,r.jsx)(M.A,{selectedFilters:re,timesheetData:(null==ke?void 0:ke.timesheet)||[],attendanceData:(null==ke?void 0:ke.attendance)||[]})})})]}),(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)(m.A,{title:"Mapa de Projetos: Orçamento (R$) e Tempo Gasto (%)",children:(0,r.jsx)(z.default,{projects:Oe||[]})})}),(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("h3",{className:"tm-section-title mb-3",children:"Resumo de Horas Trabalhadas por Equipe & Times"}),(0,r.jsx)(m.A,{title:"Controle de Horas Trabalhadas",className:"",headerActions:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)(d,{label:"Equipe",isActive:"equipes"===Y,onClick:function(){return Z("equipes")},width:"80.56px",className:"mr-2"}),(0,r.jsx)(d,{label:"Time",isActive:"times"===Y,onClick:function(){return Z("times")},width:"89.68px"})]}),children:(0,r.jsx)(R.default,{teams:Ee||[]})})]}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)(I.default,{onCollaboratorClick:se,kpis:De&&(((null===(h=De.totalHoursWorked)||void 0===h?void 0:h.hours)||0)>0||((null===(v=De.totalHoursWorked)||void 0===v?void 0:v.minutes)||0)>0||((null===(b=De.totalMissingHours)||void 0===b?void 0:b.hours)||0)>0||((null===(y=De.totalMissingHours)||void 0===y?void 0:y.minutes)||0)>0||((null===(N=De.totalExtraHours)||void 0===N?void 0:N.hours)||0)>0||((null===(C=De.totalExtraHours)||void 0===C?void 0:C.minutes)||0)>0)?De:Fe?{totalHoursWorked:{hours:0,minutes:0,formatted:Fe.totalRegistered.hours},totalMissingHours:{hours:0,minutes:0,formatted:Fe.missingHours.hours},totalExtraHours:{hours:0,minutes:0,formatted:Fe.extraHours.count},workOverload:0,memberCount:0}:void 0,members:Ie||[]})})]})]})}},15186(e,t,n){"use strict";n.r(t),n.d(t,{NoShiftAssigned:()=>a});var r=n(74848),a=function(){return(0,r.jsxs)("div",{className:"d-flex flex-column align-items-center justify-content-center",style:{minHeight:"500px",padding:"40px 20px"},children:[(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)("img",{src:"/images/time_management/clock.png",alt:"Relógio",style:{width:"120px",height:"120px",objectFit:"contain"}})}),(0,r.jsx)("h4",{style:{fontFamily:"Inter",fontSize:"20px",fontWeight:600,color:"#5C5D5D",marginBottom:"12px",textAlign:"center"},children:"Nenhum turno vinculado"}),(0,r.jsx)("p",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"rgba(92, 93, 93, 0.70)",textAlign:"center",maxWidth:"450px",lineHeight:"1.5",margin:0},children:"Parece que você ainda não está associado a um turno. Procure seu gestor ou RH para habilitar o ponto."})]})}},17147(e,t,n){"use strict";n.r(t),n.d(t,{LocationSection:()=>v});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(78459),n(27495),n(38781),n(47764),n(62953),n(76031);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(55278),l=n(96540),c=n(30786),u=n(76336);function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=["time-management","location"],p=["time-management","can-view-maps"];function h(e){var t=e.location,n=(0,l.useRef)(null),a=(0,l.useRef)(null),o=d((0,l.useState)(!1),2),i=o[0],s=o[1];return(0,l.useEffect)(function(){if(n.current&&t.latitude&&t.longitude&&void 0!==window.google)try{var e=parseFloat(t.latitude),r=parseFloat(t.longitude);if(isNaN(e)||isNaN(r))return void console.error("Coordenadas inválidas:",t.latitude,t.longitude);var o={lat:e,lng:r},i=new window.google.maps.Map(n.current,{zoom:15,center:o,disableDefaultUI:!0,draggable:!1,scrollwheel:!1,disableDoubleClickZoom:!0,zoomControl:!1,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1,gestureHandling:"none"});new window.google.maps.Marker({position:o,map:i}),a.current=i,s(!0);var l=function(){a.current&&(window.google.maps.event.trigger(a.current,"resize"),a.current.setCenter(o))};return window.addEventListener("resize",l),function(){window.removeEventListener("resize",l)}}catch(e){console.error("Erro ao criar mapa:",e)}},[t]),t.latitude&&t.longitude?(0,r.jsxs)("div",{style:{width:"100%",height:"150px",position:"relative"},children:[!i&&(0,r.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f5f5f5",borderRadius:"0 0 8px 8px",borderTop:"1px solid #e0e0e0"},children:(0,r.jsx)("i",{className:"fas fa-spinner fa-spin text-muted"})}),(0,r.jsx)("div",{ref:n,style:{width:"100%",height:"100%",borderRadius:"0 0 8px 8px",cursor:"pointer",borderTop:"1px solid #e0e0e0"},onClick:function(){return window.open(t.google_url,"_blank")},title:"Clique para abrir no Google Maps"})]}):(0,r.jsx)("div",{style:{width:"100%",height:"150px",borderRadius:"0 0 8px 8px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f5f5f5",borderTop:"1px solid #e0e0e0"},children:(0,r.jsx)("small",{className:"text-muted",children:"Sem coordenadas"})})}function v(){var e=(0,u.L)(),t=e.canCreate,n=e.canEdit,f=e.canDelete,v=d((0,l.useState)(!1),2),b=v[0],y=v[1],g=d((0,l.useState)(null),2),x=g[0],j=g[1],w=d((0,l.useState)(!1),2),S=w[0],N=w[1],k=(0,o.jE)(),C=(0,a.I)({queryKey:m,queryFn:s.Eq}),O=C.data,A=void 0===O?[]:O,E=C.isFetching,P=(0,a.I)({queryKey:p,queryFn:s.vD,staleTime:6e4,refetchOnWindowFocus:!1}).data,F=void 0!==P&&P;(0,l.useEffect)(function(){if(F)if(void 0===window.google){var e=window.GOOGLE_MAPS_API_KEY;if(e){if(document.querySelector('script[src*="maps.googleapis.com"]')){var t=setInterval(function(){void 0!==window.google&&(N(!0),clearInterval(t))},100);return function(){return clearInterval(t)}}var n=document.createElement("script");n.src="https://maps.googleapis.com/maps/api/js?key=".concat(e,"&libraries=places"),n.async=!0,n.onload=function(){return N(!0)},document.head.appendChild(n)}else console.error("Google Maps API key não encontrada")}else N(!0)},[F]);var T=(0,i.n)({mutationFn:s.zR,onSuccess:function(){k.invalidateQueries({queryKey:m})}}),D=(0,l.useMemo)(function(){return 0===A.length},[A]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{children:"\n .location-list-scroll { overflow-x: visible !important; }\n .location-list-scroll .card { overflow: visible !important; }\n .location-list-scroll .card-body { overflow: visible !important; }\n .location-list-scroll .d-flex { overflow: visible !important; }\n .location-list-scroll::-webkit-scrollbar {\n width: 6px;\n }\n .location-list-scroll::-webkit-scrollbar-track {\n background: #f1f1f1;\n border-radius: 10px;\n }\n .location-list-scroll::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 10px;\n }\n .location-list-scroll::-webkit-scrollbar-thumb:hover {\n background: #555;\n }\n "}),!D&&(0,r.jsx)("div",{className:"mb-3 location-list-scroll",style:{maxHeight:"600px",overflowY:"auto",overflowX:"visible",paddingRight:"8px"},children:A.map(function(e){return(0,r.jsx)("div",{className:"card mb-3",style:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"visible"},children:(0,r.jsxs)("div",{className:"card-body py-3",style:{overflow:"visible"},children:[(0,r.jsxs)("div",{className:"row no-gutters align-items-center",style:{overflow:"visible"},children:[(0,r.jsx)("div",{className:"col-auto pr-2 d-flex align-items-center justify-content-center",children:(0,r.jsx)("div",{style:{width:40,height:40,backgroundColor:"rgba(23, 162, 184, 0.1)"},className:"d-flex align-items-center justify-content-center rounded",title:"Localização",children:(0,r.jsx)("i",{className:"fas fa-map-marker-alt",style:{fontSize:"1.2rem",color:"#17A2B8"}})})}),(0,r.jsx)("div",{className:"col-12 col-md-4 px-2 d-flex",style:{minWidth:0},children:(0,r.jsxs)("div",{className:"d-flex flex-column justify-content-center w-100",style:{minWidth:0},children:[(0,r.jsxs)("span",{className:"font-weight-bold text-truncate",style:{minWidth:0},children:[e.address,e.number&&", ".concat(e.number)]}),e.neighborhood&&(0,r.jsx)("span",{className:"text-muted text-truncate",style:{fontSize:"0.85rem",minWidth:0},children:e.neighborhood})]})}),(0,r.jsx)("div",{className:"col px-2 d-flex",style:{minWidth:0},children:(0,r.jsxs)("div",{className:"w-100 my-auto text-muted text-truncate text-center",style:{minWidth:0,fontSize:"0.9rem"},children:[e.city||"—",e.country&&", ".concat(e.country)]})}),(0,r.jsxs)("div",{className:"col-auto pl-2 dropdown ml-auto",style:{flexShrink:0,position:"static"},children:[(0,r.jsx)("button",{className:"btn btn-link text-muted p-0","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",style:{fontSize:"1.2rem"},children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),(0,r.jsxs)("div",{className:"dropdown-menu dropdown-menu-right",children:[n&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(){return function(e){j(e),y(!0)}(e)},disabled:T.isPending,children:[(0,r.jsx)("i",{className:"far fa-edit mr-2"}),"Editar"]}),(0,r.jsxs)("a",{className:"dropdown-item",href:e.google_url,target:"_blank",rel:"noopener noreferrer",children:[(0,r.jsx)("i",{className:"fas fa-map-marked-alt mr-2"}),"Ver no Google Maps"]}),f&&(0,r.jsxs)("button",{className:"dropdown-item text-danger",onClick:function(){return function(e){window.confirm('Tem certeza que deseja excluir a localização "'.concat(e.address,'"?'))&&T.mutate(e.id)}(e)},disabled:T.isPending,children:[(0,r.jsx)("i",{className:"far fa-trash-alt mr-2"}),T.isPending?"Excluindo...":"Excluir"]})]})]})]}),F&&(0,r.jsx)("div",{className:"mt-3",style:{marginLeft:"-1.25rem",marginRight:"-1.25rem",marginBottom:"-1.25rem"},children:S?(0,r.jsx)(h,{location:e}):(0,r.jsx)("div",{style:{width:"100%",height:"150px",borderRadius:"0 0 8px 8px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f5f5f5"},children:(0,r.jsx)("i",{className:"fas fa-spinner fa-spin text-muted"})})})]})},e.id)})}),t&&(0,r.jsxs)("div",{className:"text-muted d-flex align-items-center",role:"button",onClick:function(){return y(!0)},style:{cursor:"pointer",fontSize:"0.95rem"},children:[(0,r.jsx)("i",{className:"fas fa-plus mr-2"})," Adicionar Localização",E&&(0,r.jsx)("i",{className:"fas fa-spinner fa-spin ml-2"})]}),b&&(0,r.jsx)(c.default,{show:b,onClose:function(){y(!1),j(null)},editData:x})]})}},17649(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(1806);function i(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var i=r&&r.prototype instanceof c?r:c,u=Object.create(i.prototype);return s(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,s(m,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,a,"GeneratorFunction"),s(m),s(m,a,"Generator"),s(m,r,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),(i=function(){return{w:o,m:p}})()}function s(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}s=function(e,t,n,r){function o(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},s(e,t,n,r)}function l(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.show,n=e.onClose,s=e.hasExistingSatisfaction,u=e.initialSatisfaction,d=e.onConfirmFinalize,f=c((0,a.useState)(null),2),m=f[0],p=f[1],h=Array.from({length:5},function(e,t){return t+1});(0,a.useEffect)(function(){p(t?u:null)},[t,u]);var v=function(){var e,t=(e=i().m(function e(){var t;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,d(m);case 1:n(),e.n=3;break;case 2:e.p=2,t=e.v,console.error("Erro ao concluir finalização do dia:",t),alert("Não foi possível concluir a finalização do dia. Por favor, tente novamente.");case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){l(o,r,a,i,s,"next",e)}function s(e){l(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}(),b=!s&&null===m;return(0,r.jsx)(o.A,{show:t,onClose:n,title:"Satisfação com o Trabalho Realizado",size:"md",footer:(0,r.jsx)(o.M,{onCancel:n,onConfirm:v,cancelText:"Fechar",confirmText:"Finalizar Dia",confirmDisabled:b}),children:(0,r.jsxs)("div",{style:{textAlign:"center"},children:[(0,r.jsx)("p",{style:{marginBottom:"20px",color:"#5C5D5D"},children:"Selecione o ponto que melhor representa como você se sente em relação ao trabalho realizado."}),s&&(0,r.jsx)("p",{style:{marginBottom:"20px",color:"#8A8A8A",fontSize:"13px"},children:"A satisfação já foi registrada. Confirme para finalizar ou escolha um novo ponto para atualizar."}),(0,r.jsx)("div",{style:{position:"relative",margin:"30px 0"},children:(0,r.jsxs)("div",{style:{position:"relative",height:"28px",width:"100%",borderRadius:"6px",overflow:"hidden",boxShadow:"inset 0 0 6px rgba(0,0,0,0.2)",border:"1px solid #d9d9d9"},children:[(0,r.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #FF4D4D 0%, #FF4D4D 20%, #FF8A65 20%, #FF8A65 40%, #FFCA28 40%, #FFCA28 60%, #8BC34A 60%, #8BC34A 80%, #4CAF50 80%, #4CAF50 100%)"}}),(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",zIndex:1},children:h.map(function(e,t){var n=m===e;return(0,r.jsx)("button",{type:"button",onClick:function(){return function(e){p(e)}(e)},style:{flex:1,border:n?"2px dashed #ffffff":"1px solid transparent",backgroundColor:n?"rgba(255,255,255,0.16)":"transparent",cursor:"pointer",borderRight:n||t===h.length-1?"none":"1px solid rgba(255,255,255,0.4)",outline:"none",boxSizing:"border-box",borderRadius:0===t?"6px 0 0 6px":t===h.length-1?"0 6px 6px 0":0,transition:"background-color 0.2s ease, border 0.2s ease"},"aria-label":"Satisfação nível ".concat(e)},e)})}),null!==m&&(0,r.jsx)("div",{style:{position:"absolute",top:"-10px",left:"".concat((m-.5)/5*100,"%"),transform:"translateX(-50%)",width:0,height:0,borderLeft:"8px solid transparent",borderRight:"8px solid transparent",borderBottom:"10px solid #ffffff",zIndex:2}})]})})]})})}},18098(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>G});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(50113),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(94170),n(62010),n(2892),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(68156),n(23500),n(62953);var r=n(74848),a=n(96540),o=n(97665),i=n(33930),s=n(57097),l=n(50860),c=n(8596),u=n(31475),d=n(69511),f=n(46550),m=n(25149),p=n(72810),h=n(15186),v=n(77770),b=n(5380),y=n(2698),g=n(39576),x=n(92454),j=n(67784),w=n(18752),S=n(85231);n(15086);function N(e){return e?"Nenhum canal de registro habilitado para o aplicativo.":"Registro via navegador não habilitado. Use o aplicativo."}var k=n(82942);n(74423),n(21699);function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A(){var e=C((0,a.useState)(!1),2),t=e[0],n=e[1];return(0,a.useEffect)(function(){n(function(){if("undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes("metahuman-app"))return!0;if("undefined"!=typeof window&&window.__IS_APP__)return!0;if("undefined"!=typeof window){var e=!!window.Capacitor,t=!!window.cordova;if(e||t)return!0}return!1}())},[]),{isApp:t,isWeb:!t}}var E=n(47339);function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function F(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return T(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(T(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,T(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,T(d,"constructor",c),T(c,"constructor",l),l.displayName="GeneratorFunction",T(c,a,"GeneratorFunction"),T(d),T(d,a,"Generator"),T(d,r,function(){return this}),T(d,"toString",function(){return"[object Generator]"}),(F=function(){return{w:o,m:f}})()}function T(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}T=function(e,t,n,r){function o(t,n){T(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},T(e,t,n,r)}function D(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function _(e){return function(e){if(Array.isArray(e))return R(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||M(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||M(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){if(e){if("string"==typeof e)return R(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function q(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=P(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=P(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==P(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)}function G(){var e,t,n,C,O,P=I((0,a.useState)(B(new Date)),2),T=P[0],M=P[1],R=I((0,a.useState)(null),2),z=R[0],q=R[1],G=I((0,a.useState)(!1),2),H=G[0],W=G[1],U=I((0,a.useState)(!1),2),V=U[0],Q=U[1],K=I((0,a.useState)(null),2),$=K[0],J=K[1],Y=I((0,a.useState)("ponto"),2),Z=Y[0],X=Y[1],ee=I((0,a.useState)(!1),2),te=ee[0],ne=ee[1],re=I((0,a.useState)(!1),2),ae=re[0],oe=re[1],ie=(0,o.jE)();(0,a.useEffect)(function(){var e=function(){var e=window.innerWidth<=768;ne(e)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var se,le,ce,ue=A().isApp,de=(0,i.I)({queryKey:["professional","shift",T],queryFn:function(){return(0,S.Tp)(T)},staleTime:3e5}),fe=de.data,me=de.isLoading,pe=de.error,he=function(e,t){if(!e)return null;if(!e.rows||!Array.isArray(e.rows))return e;if(!e.clock_in_records||!e.clock_in_records[t])return e;var n=e.clock_in_records[t],r={first_check_in:0,first_check_out:1,second_check_in:2,second_check_out:3},a=e.rows.map(function(e,t){var a=Object.keys(r).find(function(e){return r[e]===t});return a&&n[a]?L(L({},e),{},{mode:n[a].mode}):e});return L(L({},e),{},{rows:a})}(fe,T),ve=fe&&null!==fe.name&&null!==fe.rows,be=(0,i.I)({queryKey:["professional","occurrences",T],queryFn:function(){return(0,S.xP)(T)},staleTime:12e4}),ye=be.data,ge=be.isLoading,xe=function(e,t){return!(!e||!Array.isArray(e)||0===e.length)&&(t?e.some(function(e){return"app"===e.type||"qr"===e.type}):e.some(function(e){return"web"===e.type}))}(null==he?void 0:he.channels,ue),je=((null==he||null===(e=he.rows)||void 0===e?void 0:e.filter(function(e){return!e.muted}).length)||0)>=4,we=(0,k.Q8)(null==he?void 0:he.validate_points,ue),Se=[].concat(_(we),["teste"]),Ne=((0,k.AD)(null==he?void 0:he.validate_points,ue),(0,s.n)({mutationFn:S.X3,onSuccess:function(e){ie.invalidateQueries({queryKey:["professional","shift"]}),ie.invalidateQueries({queryKey:["professional","occurrences"]}),q(null),E.A.success(e.message||"Ponto registrado com sucesso!")},onError:function(e){var t,n=null===(t=e.response)||void 0===t?void 0:t.data,r=(null==n?void 0:n.error)||"Erro ao registrar ponto",a=(null==n?void 0:n.details)||(null==n?void 0:n.message)||"Tente novamente.";E.A.error(a,r)}})),ke=(0,s.n)({mutationFn:function(e){var t=e.occurrenceId,n=e.justification;return(0,S.GB)(t,n)},onSuccess:function(e){ie.invalidateQueries({queryKey:["professional","occurrences"]}),W(!1),J(null);var t=(null==e?void 0:e.message)||"Justificativa adicionada com sucesso!";alert(t)},onError:function(e){var t,n,r;console.error("Erro ao adicionar justificativa - erro completo:",e),console.error("Erro response:",e.response),console.error("Erro response data:",null===(t=e.response)||void 0===t?void 0:t.data);var a=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.error)||(null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||e.message||"Erro ao adicionar justificativa. Tente novamente.";alert(a)}}),Ce=(0,s.n)({mutationFn:function(e){var t=e.occurrenceId,n=e.time;return(0,S.bP)(t,n)},onSuccess:function(e){ie.invalidateQueries({queryKey:["professional","shift"]}),ie.invalidateQueries({queryKey:["professional","occurrences"]}),Q(!1),J(null);var t=(null==e?void 0:e.message)||"Horário editado com sucesso!";alert(t)},onError:function(e){var t,n,r;console.error("Erro ao editar horário - erro completo:",e),console.error("Erro response:",e.response),console.error("Erro response data:",null===(t=e.response)||void 0===t?void 0:t.data);var a=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.error)||(null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||e.message||"Erro ao editar horário. Tente novamente.";alert(a)}}),Oe=function(){if(ue)return"mobile";var e=navigator.userAgent.toLowerCase(),t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e),n=window.innerWidth<=768;return t||n?"mobile":"desktop"},Ae=function(){var e,t=(e=F().m(function e(){var t,n,r,a=arguments;return F().w(function(e){for(;;)switch(e.n){case 0:if(t=a.length>0&&void 0!==a[0]?a[0]:{},n=B(new Date),!(T<n)){e.n=1;break}return alert("Não é permitido registrar ponto em dias anteriores. Por favor, selecione a data de hoje."),e.a(2);case 1:if(!je){e.n=2;break}return alert("Você já registrou os 4 pontos do dia. Não é possível registrar mais pontos."),e.a(2);case 2:r=L({device:Oe(),mode:"individual"},t),Ne.mutate(r);case 3:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){D(o,r,a,i,s,"next",e)}function s(e){D(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}(),Ee=function(){Ae()},Pe=function(e){xe?"none"!==e?q(e):Ae():alert(N(ue))},Fe=function(e){q(null),Ae({selfie:e})},Te=function(e){q(null),Ae({location:e})},De=function(e){q(null),Ae({screenshot:e})},_e=function(e){q(null),Ae({qrcode:e})},Ie=function(e){q(null),Ae({testTime:e})},Me=function(){q(null)},Re=function(e){M(e)},ze=function(e){J(e),W(!0)},Le=function(e){null!=$&&$.id?ke.mutate({occurrenceId:$.id,justification:e}):alert("Erro: Ocorrência não selecionada")},qe=function(e){J(e),Q(!0)},Be=function(e){null!=$&&$.id?Ce.mutate({occurrenceId:$.id,time:e}):alert("Erro: Ocorrência não selecionada")};return te?me?(0,r.jsxs)("section",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",padding:"40px 20px"},children:[(0,r.jsx)("div",{className:"spinner-border text-info",role:"status"}),(0,r.jsx)("p",{style:{marginTop:"20px",color:"#5C5D5D",fontSize:"14px"},children:"Carregando..."})]}):(0,r.jsxs)("section",{style:{minHeight:"100vh",paddingBottom:"20px"},children:[(0,r.jsx)(d.default,{activeTab:Z,onTabChange:X,selectedDate:T,onDateChange:Re}),"ponto"===Z?(0,r.jsxs)(r.Fragment,{children:[pe?(0,r.jsxs)("div",{className:"p-3 text-center text-danger",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle me-2"}),"Erro ao carregar dados do turno"]}):ve?he&&he.rows?(0,r.jsx)(f.default,{rows:he.rows}):null:(0,r.jsx)(h.NoShiftAssigned,{}),ve&&(0,r.jsx)("div",{className:"p-3 mt-3",children:(0,r.jsxs)("button",{onClick:function(){Se.length>0?oe(!0):Ee()},disabled:T<B(new Date)||je||!xe,className:"btn btn-info btn-lg btn-block",children:[(0,r.jsx)("i",{className:"fas fa-clock mr-2"}),"Registrar Ponto"]})})]}):(0,r.jsx)(r.Fragment,{children:ve?ge?(0,r.jsxs)("div",{className:"py-4 px-3 text-center",children:[(0,r.jsx)("div",{className:"spinner-border spinner-border-sm me-2 text-info",role:"status"}),(0,r.jsx)("span",{children:"Carregando..."})]}):ye?(0,r.jsx)(m.default,{items:ye,editPointEnabled:(null==he||null===(se=he.policy)||void 0===se?void 0:se.editPoint)||!1,onAddJustification:ze,onEditPoint:qe}):(0,r.jsx)("div",{className:"py-4 px-3 text-center text-muted",children:"Erro ao carregar ocorrências"}):(0,r.jsx)(h.NoShiftAssigned,{})}),(0,r.jsx)(p.default,{isOpen:ae,onClose:function(){return oe(!1)},options:Se,onSelectOption:function(e){oe(!1),Pe(e)}}),(0,r.jsx)(v.default,{isOpen:"selfie"===z,onCapture:Fe,onClose:Me}),(0,r.jsx)(b.default,{isOpen:"geolocation"===z,onConfirm:Te,onClose:Me,distanceToleranceKm:null==he||null===(le=he.policy)||void 0===le?void 0:le.distanceToleranceKm}),(0,r.jsx)(y.default,{isOpen:"screenshot"===z,onUpload:De,onClose:Me}),(0,r.jsx)(g.default,{isOpen:"qrcode"===z,onScan:_e,onClose:Me,qrcodes:(null==he?void 0:he.qrcodes)||[]}),(0,r.jsx)(x.default,{isOpen:"teste"===z,onConfirm:Ie,onClose:Me}),(0,r.jsx)(j.default,{isOpen:H,onClose:function(){W(!1),J(null)},onSave:Le,occurrenceTitle:null==$?void 0:$.title,existingJustification:null==$?void 0:$.justify,isSaving:ke.isPending}),(0,r.jsx)(w.default,{isOpen:V,onClose:function(){Q(!1),J(null)},onSave:Be,occurrenceTitle:null==$?void 0:$.title,currentTime:null==$?void 0:$.time,pointType:(null==$||null===(ce=$.hitSpotTime)||void 0===ce?void 0:ce.type)||(null==$?void 0:$.type),isSaving:Ce.isPending})]}):me?(0,r.jsx)("section",{className:"content options-section-project",style:{minHeight:"80vh"},children:(0,r.jsxs)("div",{className:"d-flex flex-column align-items-center justify-content-center py-4",children:[(0,r.jsx)("div",{className:"spinner-border text-info",role:"status"}),(0,r.jsx)("p",{className:"mt-3 text-muted small",children:"Carregando..."})]})}):(0,r.jsxs)(l.A,{children:[ve&&!xe&&(0,r.jsxs)("div",{className:"alert alert-warning d-flex align-items-center mb-3",role:"alert",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-triangle me-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{children:"Atenção!"})," ",N(ue)]})]}),me||pe||ve?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.default,{onRegister:Ee,availableOptions:Se,onSelectOption:Pe,isNoneMode:"none"===(null==he||null===(t=he.validate_points)||void 0===t?void 0:t.mode)&&0===Se.length,disabled:T<B(new Date)||je,shift:he||void 0,selectedDate:T,onDateChange:Re,shiftError:!!pe}),z&&(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsx)("div",{className:"card-body",children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("i",{className:"".concat((0,k.JC)(z)," me-3"),style:{color:"#17A1B7",fontSize:"24px"}}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("h6",{className:"mb-0",children:["Coletando: ",(0,k.kC)(z)]}),(0,r.jsx)("small",{className:"text-muted",children:"Complete a validação para continuar"})]})]})})}),(0,r.jsxs)("div",{className:"card app-card-surface mt-4",children:[(0,r.jsx)("div",{className:"card-header d-flex align-items-center",children:(0,r.jsx)("h3",{className:"card-title mb-0",children:"Ocorrências"})}),(0,r.jsx)("div",{className:"card-body p-0",children:ge?(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("div",{className:"spinner-border spinner-border-sm me-2",role:"status"}),(0,r.jsx)("span",{children:"Carregando..."})]}):ye?(0,r.jsx)(u.default,{items:ye,editPointEnabled:(null==he||null===(n=he.policy)||void 0===n?void 0:n.editPoint)||!1,onAddJustification:ze,onEditPoint:qe}):(0,r.jsx)("div",{className:"text-center text-muted py-4",children:"Erro ao carregar ocorrências"})})]})]}):(0,r.jsx)(h.NoShiftAssigned,{}),(0,r.jsx)(v.default,{isOpen:"selfie"===z,onCapture:Fe,onClose:Me}),(0,r.jsx)(b.default,{isOpen:"geolocation"===z,onConfirm:Te,onClose:Me,distanceToleranceKm:null==he||null===(C=he.policy)||void 0===C?void 0:C.distanceToleranceKm}),(0,r.jsx)(y.default,{isOpen:"screenshot"===z,onUpload:De,onClose:Me}),(0,r.jsx)(g.default,{isOpen:"qrcode"===z,onScan:_e,onClose:Me,qrcodes:(null==he?void 0:he.qrcodes)||[]}),(0,r.jsx)(x.default,{isOpen:"teste"===z,onConfirm:Ie,onClose:Me}),(0,r.jsx)(j.default,{isOpen:H,onClose:function(){W(!1),J(null)},onSave:Le,occurrenceTitle:null==$?void 0:$.title,existingJustification:null==$?void 0:$.justify,isSaving:ke.isPending}),(0,r.jsx)(w.default,{isOpen:V,onClose:function(){Q(!1),J(null)},onSave:Be,occurrenceTitle:null==$?void 0:$.title,currentTime:null==$?void 0:$.time,pointType:(null==$||null===(O=$.hitSpotTime)||void 0===O?void 0:O.type)||(null==$?void 0:$.type),isSaving:Ce.isPending})]})}},18438(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(76314),a=n.n(r)()(function(e){return e[1]});a.push([e.id,".date-range-picker {\n\tposition: relative;\n\tfont-family: inherit;\n}\n\n/* Linha 1: Campos de Data */\n.date-range-picker__dates-row {\n\tdisplay: flex;\n\tgap: 12px;\n\tmargin-bottom: 12px;\n}\n\n.date-range-picker__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tflex: 1;\n\tmin-width: 160px;\n}\n\n/* Linha 2: Botão e Info/Erro */\n.date-range-picker__bottom-row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n}\n\n.date-range-picker__label {\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tcolor: #555;\n\tmargin: 0;\n}\n\n.date-range-picker__input {\n\tpadding: 8px 12px;\n\tborder: 1px solid #d1d5db;\n\tborder-radius: 6px;\n\tfont-size: 14px;\n\tcolor: #333;\n\tbackground-color: #fff;\n\ttransition: all 0.2s ease;\n\toutline: none;\n\tcursor: pointer;\n}\n\n.date-range-picker__input:hover {\n\tborder-color: #2196F3;\n}\n\n.date-range-picker__input:focus {\n\tborder-color: #2196F3;\n\tbox-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);\n}\n\n.date-range-picker__preset-btn {\n\tpadding: 10px 14px;\n\tborder: 1px solid #d1d5db;\n\tborder-radius: 8px;\n\tbackground-color: #fff;\n\tcolor: #6b7280;\n\tfont-size: 16px;\n\tcursor: pointer;\n\ttransition: all 0.2s ease;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toutline: none;\n\tflex-shrink: 0;\n\twidth: 40px;\n\theight: 40px;\n}\n\n.date-range-picker__preset-btn:hover {\n\tbackground-color: #f3f4f6;\n\tborder-color: #2196F3;\n\tcolor: #2196F3;\n}\n\n.date-range-picker__preset-btn:active {\n\ttransform: scale(0.98);\n}\n\n.date-range-picker__error {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 10px 16px;\n\tbackground-color: #fee2e2;\n\tborder: 1px solid #fecaca;\n\tborder-radius: 8px;\n\tfont-size: 14px;\n\tcolor: #dc2626;\n\tflex: 1;\n}\n\n.date-range-picker__error i {\n\tfont-size: 14px;\n\tflex-shrink: 0;\n}\n\n.date-range-picker__error span {\n\tfont-weight: 500;\n}\n\n.date-range-picker__info {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 10px 16px;\n\tbackground-color: #186073;\n\tborder: 1px solid #186073;\n\tborder-radius: 8px;\n\tfont-size: 14px;\n\tcolor: #ffffff;\n\tflex: 1;\n}\n\n.date-range-picker__info i {\n\tcolor: #ffffff;\n\tfont-size: 14px;\n\tflex-shrink: 0;\n}\n\n.date-range-picker__info span {\n\tfont-weight: 500;\n\tcolor: #ffffff;\n}\n\n.date-range-picker__presets-dropdown {\n\tposition: absolute;\n\ttop: calc(100% + 8px);\n\tright: 0;\n\tmin-width: 220px;\n\tbackground-color: #fff;\n\tborder: 1px solid #d1d5db;\n\tborder-radius: 8px;\n\tbox-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);\n\tz-index: 1000;\n\tanimation: fadeInDown 0.2s ease;\n}\n\n@keyframes fadeInDown {\n\tfrom {\n\t\topacity: 0;\n\t\ttransform: translateY(-10px);\n\t}\n\tto {\n\t\topacity: 1;\n\t\ttransform: translateY(0);\n\t}\n}\n\n.date-range-picker__presets-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 12px 16px;\n\tborder-bottom: 1px solid #e5e7eb;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tcolor: #333;\n}\n\n.date-range-picker__presets-close {\n\tpadding: 4px;\n\tborder: none;\n\tbackground: none;\n\tcolor: #9ca3af;\n\tcursor: pointer;\n\tfont-size: 14px;\n\ttransition: color 0.2s ease;\n\toutline: none;\n}\n\n.date-range-picker__presets-close:hover {\n\tcolor: #ef4444;\n}\n\n.date-range-picker__presets-list {\n\tpadding: 8px;\n}\n\n.date-range-picker__preset-item {\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 10px 12px;\n\tborder: none;\n\tbackground: none;\n\ttext-align: left;\n\tfont-size: 14px;\n\tcolor: #555;\n\tcursor: pointer;\n\tborder-radius: 6px;\n\ttransition: all 0.2s ease;\n\toutline: none;\n}\n\n.date-range-picker__preset-item:hover {\n\tbackground-color: #f3f4f6;\n\tcolor: #2196F3;\n}\n\n.date-range-picker__preset-item:active {\n\tbackground-color: #e5e7eb;\n}\n\n/* Responsivo */\n@media (max-width: 768px) {\n\t.date-range-picker__dates-row {\n\t\tflex-direction: column;\n\t\tgap: 12px;\n\t}\n\n\t.date-range-picker__field {\n\t\twidth: 100%;\n\t\tmin-width: auto;\n\t}\n\n\t.date-range-picker__bottom-row {\n\t\tflex-direction: column;\n\t\talign-items: stretch;\n\t\tgap: 12px;\n\t}\n\n\t.date-range-picker__preset-btn {\n\t\twidth: 100%;\n\t}\n\n\t.date-range-picker__presets-dropdown {\n\t\tright: 0;\n\t\tleft: 0;\n\t\tmin-width: auto;\n\t}\n}\n\n/* Tema Escuro (se necessário) */\n.dark-mode .date-range-picker__input,\n.dark-mode .date-range-picker__preset-btn {\n\tbackground-color: #1f2937;\n\tborder-color: #374151;\n\tcolor: #e5e7eb;\n}\n\n.dark-mode .date-range-picker__input:hover,\n.dark-mode .date-range-picker__preset-btn:hover {\n\tborder-color: #60a5fa;\n}\n\n.dark-mode .date-range-picker__label {\n\tcolor: #d1d5db;\n}\n\n.dark-mode .date-range-picker__presets-dropdown {\n\tbackground-color: #1f2937;\n\tborder-color: #374151;\n}\n\n.dark-mode .date-range-picker__presets-header {\n\tborder-color: #374151;\n\tcolor: #e5e7eb;\n}\n\n.dark-mode .date-range-picker__preset-item {\n\tcolor: #d1d5db;\n}\n\n.dark-mode .date-range-picker__preset-item:hover {\n\tbackground-color: #374151;\n\tcolor: #60a5fa;\n}\n\n.dark-mode .date-range-picker__info {\n\tbackground-color: #186073;\n\tborder-color: #186073;\n}\n\n",""]);const o=a},18752(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>l});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(58940),n(27495),n(38781),n(47764),n(68156),n(62953);var r=n(74848),a=n(96540),o=n(1806);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=e.isOpen,n=e.onClose,s=e.onSave,l=e.occurrenceTitle,c=void 0===l?"":l,u=e.currentTime,d=void 0===u?null:u,f=e.pointType,m=e.isSaving,p=void 0!==m&&m,h=i((0,a.useState)("00"),2),v=h[0],b=h[1],y=i((0,a.useState)("00"),2),g=y[0],x=y[1],j=i((0,a.useState)("00"),2),w=j[0],S=j[1];(0,a.useEffect)(function(){if(t&&d){var e=d.split(":");e.length>=2&&(b(e[0]||"00"),x(e[1]||"00"),S(e[2]||"00"))}},[t,d]);var N,k=function(){b("00"),x("00"),S("00"),n()};return t?(0,r.jsx)(o.A,{show:t,onClose:k,title:"Editando Ponto",size:"sm",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:k,disabled:p,children:"Fechar"}),(0,r.jsx)("button",{type:"button",className:"btn text-white",onClick:function(){var e=parseInt(v),t=parseInt(g),n=parseInt(w);if(isNaN(e)||e<0||e>23)alert("Hora inválida. Use valores entre 00 e 23.");else if(isNaN(t)||t<0||t>59)alert("Minuto inválido. Use valores entre 00 e 59.");else if(isNaN(n)||n<0||n>59)alert("Segundo inválido. Use valores entre 00 e 59.");else{var r="".concat(String(e).padStart(2,"0"),":").concat(String(t).padStart(2,"0"),":").concat(String(n).padStart(2,"0"));s(r)}},disabled:p,style:{backgroundColor:"rgb(23, 162, 184)"},children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"spinner-border spinner-border-sm me-2"}),"Salvando..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("i",{className:"fas fa-check me-2"}),"Editar Ponto"]})})]}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[f&&(0,r.jsxs)("div",{className:"alert alert-info mb-3",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:600,backgroundColor:"#d1ecf1",borderColor:"#bee5eb",color:"#0c5460"},children:[(0,r.jsx)("i",{className:"fas fa-info-circle me-2"}),"Editando: ",(0,r.jsx)("strong",{children:(N=f,{first_check_in:"Primeira Entrada",first_check_out:"Primeira Saída",second_check_in:"Segunda Entrada",second_check_out:"Segunda Saída"}[N||""]||N||"Ponto")})]}),c&&(0,r.jsxs)("p",{className:"text-muted mb-3",style:{fontFamily:"Inter",fontSize:"14px"},children:["Ocorrência: ",(0,r.jsx)("strong",{children:c})]}),(0,r.jsxs)("div",{className:"alert alert-warning mb-3",style:{fontFamily:"Inter",fontSize:"13px",backgroundColor:"#fff3cd",borderColor:"#ffeaa7",color:"#856404"},children:[(0,r.jsx)("i",{className:"fas fa-exclamation-triangle me-2"}),(0,r.jsx)("strong",{children:"Atenção:"})," Ao editar o ponto, a ocorrência será ",(0,r.jsx)("strong",{children:"removida automaticamente"}),"."]}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-4",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D",marginBottom:"8px"},children:"Horas"}),(0,r.jsx)("input",{type:"number",className:"form-control text-center",min:"0",max:"23",value:v,onChange:function(e){return b(e.target.value)},disabled:p,style:{fontFamily:"Inter",fontSize:"16px",fontWeight:600}})]})}),(0,r.jsx)("div",{className:"col-4",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D",marginBottom:"8px"},children:"Minutos"}),(0,r.jsx)("input",{type:"number",className:"form-control text-center",min:"0",max:"59",value:g,onChange:function(e){return x(e.target.value)},disabled:p,style:{fontFamily:"Inter",fontSize:"16px",fontWeight:600}})]})}),(0,r.jsx)("div",{className:"col-4",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D",marginBottom:"8px"},children:"Segundos"}),(0,r.jsx)("input",{type:"number",className:"form-control text-center",min:"0",max:"59",value:w,onChange:function(e){return S(e.target.value)},disabled:p,style:{fontFamily:"Inter",fontSize:"16px",fontWeight:600}})]})})]}),(0,r.jsxs)("div",{className:"text-center mt-3 mb-3",children:[(0,r.jsxs)("div",{style:{fontFamily:"Inter",fontSize:"24px",fontWeight:700,color:"#17A2B8"},children:[String(v).padStart(2,"0"),":",String(g).padStart(2,"0"),":",String(w).padStart(2,"0")]}),(0,r.jsx)("small",{className:"text-muted",children:"Horário que será registrado"})]})]})}):null}},18851(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(28706),n(68156);var r=n(74848);n(96540);function a(e){return String(e).padStart(2,"0")}function o(e){var t,n,o,i,s=e.title,l=e.seconds,c=e.running,u=e.active,d=e.theme,f=e.onStart,m=e.onPause,p="white"===d?"rgba(255,255,255,0.55)":"rgba(26,26,26,0.31)",h="white"===d?"#101828":"#F2F4F7",v="white"===d?"#344054":"rgba(255,255,255,0.85)";return(0,r.jsxs)("div",{className:"p-4",style:{minWidth:360,width:"100%",maxWidth:520,borderRadius:16,background:p,backdropFilter:"blur(72.95px)",WebkitBackdropFilter:"blur(72.95px)",border:u?"1px solid rgba(24,198,225,.75)":"1px solid rgba(255,255,255,0.18)",boxShadow:u?"0 12px 36px rgba(0,0,0,.28)":"0 8px 24px rgba(0,0,0,.18)",transition:"transform .2s ease, box-shadow .2s ease, border-color .2s ease",transform:u?"scale(1.02)":"scale(0.995)",color:h},children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-1",children:[(0,r.jsx)("div",{className:"font-weight-bold",style:{opacity:.9},children:s}),!u&&(0,r.jsx)("span",{className:"badge badge-light",style:{opacity:.7},children:"inativo"})]}),(0,r.jsxs)("div",{className:"text-center",style:{lineHeight:1.05},children:[(0,r.jsx)("div",{style:{fontWeight:700,fontSize:72,letterSpacing:1},children:(t=l,n=Math.floor(t/3600),o=Math.floor(t%3600/60),i=t%60,n>0?"".concat(a(n),":").concat(a(o),":").concat(a(i)):"".concat(a(o),":").concat(a(i)))}),(0,r.jsx)("div",{style:{color:v,fontSize:13},children:c&&u?"Contando…":u?"Pronto para iniciar":"Selecione para iniciar"})]}),(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-center mt-4",children:u&&c?(0,r.jsxs)("button",{type:"button",className:"btn btn-light px-4",onClick:m,children:[(0,r.jsx)("i",{className:"fas fa-pause mr-2"})," Pausar"]}):(0,r.jsxs)("button",{type:"button",className:"btn btn-primary px-4",onClick:f,children:[(0,r.jsx)("i",{className:"fas fa-play mr-2"})," Iniciar"]})})]})}},19066(e,t,n){"use strict";n.r(t),n.d(t,{PermissionGuard:()=>o,usePermission:()=>i});n(34782);var r=n(74848),a=n(76336);function o(e){var t=e.children,n=e.require,o=e.fallback,i=(0,a.L)();return(0,a.v)()?(0,r.jsxs)("div",{className:"alert alert-danger m-3",role:"alert",children:[(0,r.jsxs)("h4",{className:"alert-heading",children:[(0,r.jsx)("i",{className:"fas fa-ban me-2"}),"Acesso Negado"]}),(0,r.jsx)("p",{children:"Você não tem permissão para visualizar este produto."})]}):n?{view:i.canView,edit:i.canEdit,create:i.canCreate,delete:i.canDelete}[n]?(0,r.jsx)(r.Fragment,{children:t}):o?(0,r.jsx)(r.Fragment,{children:o}):null:(0,r.jsx)(r.Fragment,{children:t})}function i(e){return(0,a.L)()["can".concat(e.charAt(0).toUpperCase()+e.slice(1))]}},19619(e,t,n){"use strict";n.d(t,{c:()=>a,w:()=>r});var r={sem:"none",flex:"flexible",qr:"qrcode",manual:"manual"},a={none:"sem",flexible:"flex",qrcode:"qr",manual:"manual"}},19782(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});n(52675),n(89463),n(2259),n(28706),n(2008),n(23418),n(64346),n(23792),n(62062),n(34782),n(15086),n(1688),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(31415),n(47764),n(62953);var r=n(74848),a=n(97665),o=n(33930),i=n(57097),s=n(96540),l=n(52354);function c(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return u(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),m=d.prototype=s.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return l.prototype=d,u(m,"constructor",d),u(d,"constructor",l),l.displayName="GeneratorFunction",u(d,a,"GeneratorFunction"),u(m),u(m,a,"Generator"),u(m,r,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:p}})()}function u(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function d(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function f(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){d(o,r,a,i,s,"next",e)}function s(e){d(o,r,a,i,s,"throw",e)}i(void 0)})}}function m(){return p.apply(this,arguments)}function p(){return(p=f(c().m(function e(){var t,n;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,l.F.get("/time-management/channels");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function h(){return(h=f(c().m(function e(t){var n,r;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,l.F.post("/time-management/channels",{type:t});case 1:return n=e.v,r=n.data,e.a(2,r.data)}},e)}))).apply(this,arguments)}function v(){return(v=f(c().m(function e(t){return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,l.F.delete("/time-management/channels/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}var b=n(76336);function y(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return g(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(g(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,g(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,g(d,"constructor",c),g(c,"constructor",l),l.displayName="GeneratorFunction",g(c,a,"GeneratorFunction"),g(d),g(d,a,"Generator"),g(d,r,function(){return this}),g(d,"toString",function(){return"[object Generator]"}),(y=function(){return{w:o,m:f}})()}function g(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}g=function(e,t,n,r){function o(t,n){g(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},g(e,t,n,r)}function x(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){w(o,r,a,i,s,"next",e)}function s(e){w(o,r,a,i,s,"throw",e)}i(void 0)})}}var N=[{id:"app",icon:"fas fa-mobile-alt",label:"Aplicativo"},{id:"web",icon:"fas fa-globe",label:"Navegador Web"},{id:"qr",icon:"fas fa-qrcode",label:"QR Code/Link Gerado"}],k=["time-management","channels"];function C(){var e,t,n=(0,b.L)(),l=n.canEdit,c=(n.canCreate,n.canView,n.canDelete,(0,a.jE)()),u=(0,o.I)({queryKey:k,queryFn:m,staleTime:6e4,refetchOnWindowFocus:!1}),d=u.data,f=void 0===d?[]:d,p=u.isLoading,g=u.isFetching,j=(0,i.n)({mutationFn:function(e){return function(e){return h.apply(this,arguments)}(e)},onMutate:(e=S(y().m(function e(t){var n,r;return y().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.cancelQueries({queryKey:k});case 1:if(!(r=null!==(n=c.getQueryData(k))&&void 0!==n?n:[]).some(function(e){return e.type===t})){e.n=2;break}return e.a(2,{prev:r});case 2:return c.setQueryData(k,[].concat(x(r),[{id:"temp-".concat(t),settingManagementTimeId:"temp",type:t,createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString()}])),e.a(2,{prev:r})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,n){null!=n&&n.prev&&c.setQueryData(k,n.prev)},onSuccess:function(e){c.setQueryData(k,function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter(function(t){return t.type!==e.type});return[].concat(x(t),[e])})}}),w=(0,i.n)({mutationFn:function(e){return function(e){return v.apply(this,arguments)}(e)},onMutate:(t=S(y().m(function e(t){var n,r;return y().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c.cancelQueries({queryKey:k});case 1:return r=null!==(n=c.getQueryData(k))&&void 0!==n?n:[],c.setQueryData(k,r.filter(function(e){return e.type!==t})),e.a(2,{prev:r})}},e)})),function(e){return t.apply(this,arguments)}),onError:function(e,t,n){null!=n&&n.prev&&c.setQueryData(k,n.prev)}}),C=(0,s.useMemo)(function(){return new Set(f.map(function(e){return e.type}))},[f]),O=p||g||j.isPending||w.isPending;return(0,r.jsx)("div",{className:"row",children:N.map(function(e){var t=C.has(e.id);return(0,r.jsx)("div",{className:"col-12 col-md-4 mb-2",children:(0,r.jsxs)("button",{type:"button",disabled:O||!l,onClick:function(){return t=e.id,void(l&&(C.has(t)?w.mutate(t):j.mutate(t)));var t},className:"btn btn-block text-left d-flex align-items-center ".concat(t?"border-primary text-primary bg-primary-soft":"border"),title:l?"":"Sem permissão para editar canais",children:[(0,r.jsx)("i",{className:"".concat(e.icon," mr-2 ").concat(t?"text-primary":"")}),e.label,O&&(0,r.jsx)("i",{className:"fas fa-spinner fa-spin ml-auto"}),!l&&(0,r.jsx)("i",{className:"fas fa-lock ml-auto text-muted",style:{fontSize:"0.8rem"}})]})},e.id)})})}},20826(e,t,n){"use strict";n.d(t,{A:()=>a});n(2008),n(74423),n(48598),n(26099),n(21699),n(11392);var r=n(74848);function a(e){var t=e.label,n=e.icon,a=e.variant,o=e.onClick,i=e.className,s=void 0===i?"":i,l=e.disabled,c=void 0!==l&&l,u=e.style,d=n&&(n.includes("/")||n.includes(".")),f=n&&(n.startsWith("fas ")||n.startsWith("far ")||n.startsWith("fab ")),m=["btn","tm-action-button","tm-action-button-".concat(a),n?"tm-action-button-icon":"",c?"disabled":"",s].filter(Boolean).join(" ");return(0,r.jsxs)("button",{onClick:o,className:m,disabled:c,style:u,children:[d?(0,r.jsx)("img",{src:n,alt:""}):f?(0,r.jsx)("i",{className:n}):null,(0,r.jsx)("span",{className:"tm-action-button-preview-text",style:{display:"block",visibility:"visible"},children:t})]})}},22956(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>h});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(5506),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(49785),o=n(96540),i=n(84136);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e){var t=e.isOpen,n=e.onClose,s=e.currentFilters,l=e.onApply,u=e.onClear,m=(0,a.mN)({defaultValues:s}),p=m.register,h=m.handleSubmit,v=m.reset;(0,o.useEffect)(function(){v(s)},[s,v]);if(!t)return null;var b=[{value:"",label:"Todos"}].concat(f(Object.entries(i.L).map(function(e){var t=d(e,2);return{value:t[0],label:t[1]}})));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"modal-backdrop fade show",style:{zIndex:1040},onClick:function(e){e.stopPropagation(),n()}}),(0,r.jsx)("div",{className:"modal fade show d-block",style:{zIndex:1050},tabIndex:-1,onClick:function(e){e.target===e.currentTarget&&n()},children:(0,r.jsx)("div",{className:"modal-dialog modal-dialog-centered",style:{maxWidth:"500px"},children:(0,r.jsxs)("div",{className:"modal-content",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h5",{className:"modal-title",style:{fontFamily:"Inter",fontSize:"18px",fontWeight:600,color:"#5C5D5D"},children:"Filtrar Ocorrências"}),(0,r.jsx)("button",{type:"button",className:"close",onClick:function(e){e.preventDefault(),e.stopPropagation(),n()},"aria-label":"Fechar",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"×"})})]}),(0,r.jsxs)("form",{onSubmit:h(function(e){l(e),n()}),children:[(0,r.jsxs)("div",{className:"modal-body",children:[(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D"},children:"Tipo de Ocorrência"}),(0,r.jsx)("select",c(c({},p("occurrenceType")),{},{className:"form-control",style:{fontFamily:"Inter",fontSize:"14px"},children:b.map(function(e){return(0,r.jsx)("option",{value:e.value,children:e.label},e.value)})}))]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D"},children:"Horário do Ponto"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{className:"col-6",children:[(0,r.jsx)("label",{className:"mb-1",style:{fontFamily:"Inter",fontSize:"12px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Início"}),(0,r.jsx)("input",c(c({type:"time"},p("timeStart")),{},{className:"form-control",style:{fontFamily:"Inter",fontSize:"14px"}}))]}),(0,r.jsxs)("div",{className:"col-6",children:[(0,r.jsx)("label",{className:"mb-1",style:{fontFamily:"Inter",fontSize:"12px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Fim"}),(0,r.jsx)("input",c(c({type:"time"},p("timeEnd")),{},{className:"form-control",style:{fontFamily:"Inter",fontSize:"14px"}}))]})]}),(0,r.jsx)("small",{className:"form-text text-muted",style:{fontFamily:"Inter",fontSize:"12px"},children:"Filtre por período de horário dos pontos registrados"})]}),(0,r.jsxs)("div",{className:"form-group mb-0",children:[(0,r.jsx)("label",{className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:500,color:"#5C5D5D"},children:"Status da Ocorrência"}),(0,r.jsx)("select",c(c({},p("status")),{},{className:"form-control",style:{fontFamily:"Inter",fontSize:"14px"},children:[{value:"",label:"Todos"},{value:"pendente",label:"Pendente"},{value:"resolvido",label:"Resolvido"},{value:"justificado",label:"Justificado"}].map(function(e){return(0,r.jsx)("option",{value:e.value,children:e.label},e.value)})}))]})]}),(0,r.jsxs)("div",{className:"modal-footer",children:[(0,r.jsxs)("button",{type:"button",className:"btn mh-btn-cancel btn-sm",onClick:function(){v({occurrenceType:"",timeStart:"",timeEnd:"",status:""}),u(),n()},style:{fontFamily:"Inter"},children:[(0,r.jsx)("i",{className:"fas fa-times mr-1"}),"Limpar Filtros"]}),(0,r.jsxs)("button",{type:"submit",className:"btn btn-primary btn-sm",style:{fontFamily:"Inter",backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:[(0,r.jsx)("i",{className:"fas fa-check mr-1"}),"Aplicar"]})]})]})]})})})]})}},23696(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>A});n(52675),n(89463),n(2259),n(28706),n(2008),n(50113),n(23418),n(64346),n(23792),n(48598),n(62062),n(34782),n(15086),n(26910),n(1688),n(23288),n(94170),n(62010),n(36033),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(25440),n(90744),n(42762),n(62953),n(3296),n(27208),n(48408);var r=n(74848),a=n(33930),o=n(34559),i=(n(74423),n(21699),n(96540));function s(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.options,n=e.value,a=e.onChange,o=e.placeholder,c=void 0===o?"Selecione...":o,u=e.disabled,d=void 0!==u&&u,f=e.maxHeight,m=void 0===f?300:f,p=l((0,i.useState)(!1),2),h=p[0],v=p[1],b=l((0,i.useState)(""),2),y=b[0],g=b[1],x=l((0,i.useState)(!1),2),j=(x[0],x[1]),w=(0,i.useRef)(null),S=(0,i.useRef)(null),N=(0,i.useMemo)(function(){if(!y.trim())return t;var e=y.toLowerCase().trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"");return t.filter(function(t){return t.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").includes(e)})},[t,y]);(0,i.useMemo)(function(){return n.map(function(e){var n;return null===(n=t.find(function(t){return t.value===e}))||void 0===n?void 0:n.label}).filter(Boolean)},[n,t]);(0,i.useEffect)(function(){var e=function(e){w.current&&!w.current.contains(e.target)&&(v(!1),g(""),j(!1))};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[]);return(0,r.jsxs)("div",{ref:w,className:"multi-select-container",style:{position:"relative",width:"100%"},children:[(0,r.jsxs)("div",{className:"input-group",children:[(0,r.jsx)("input",{ref:S,type:"text",className:"form-control",placeholder:n.length>0?"".concat(n.length," selecionado(s) - Digite para buscar"):c,value:y,onChange:function(e){g(e.target.value),h||v(!0)},onFocus:function(){d||(v(!0),j(!0))},disabled:d,autoComplete:"off",style:{cursor:d?"not-allowed":"text"}}),n.length>0&&(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("button",{type:"button",onClick:function(e){e.stopPropagation(),e.preventDefault(),a([]),g(""),S.current&&S.current.focus()},className:"btn btn-outline-secondary",style:{border:"1px solid #ced4da",borderLeft:"none",background:"transparent",color:"#6c757d",cursor:"pointer",padding:"0 12px",fontSize:"20px",lineHeight:"1",display:"flex",alignItems:"center",justifyContent:"center"},title:"Limpar todos",children:"x"})})]}),h&&(0,r.jsxs)("div",{className:"multi-select-dropdown",onClick:function(e){return e.stopPropagation()},style:{position:"absolute",top:"100%",left:0,right:0,zIndex:9999,backgroundColor:"white",border:"1px solid #ced4da",borderRadius:"4px",marginTop:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",maxWidth:"100%"},children:[(0,r.jsx)("div",{style:{maxHeight:"".concat(m,"px"),overflowY:"auto"},children:N.length>0?N.map(function(e){var t=n.includes(e.value);return(0,r.jsx)("div",{className:"multi-select-option",onClick:function(t){var r;t.stopPropagation(),r=e.value,n.includes(r)?a(n.filter(function(e){return e!==r})):a([].concat(s(n),[r])),g("")},style:{padding:"10px 12px",cursor:"pointer",backgroundColor:t?"#e7f3ff":"white",borderBottom:"1px solid #f0f0f0",fontSize:"14px"},onMouseEnter:function(e){t||(e.currentTarget.style.backgroundColor="#f8f9fa")},onMouseLeave:function(e){t||(e.currentTarget.style.backgroundColor="white")},children:e.label},e.value)}):(0,r.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#6c757d",fontSize:"14px"},children:y.trim()?(0,r.jsxs)(r.Fragment,{children:['Nenhum resultado para "',(0,r.jsx)("strong",{children:y}),'"',(0,r.jsxs)("div",{style:{fontSize:"12px",marginTop:"8px"},children:["Total de membros disponíveis: ",t.length]})]}):"Nenhuma opção disponível"})}),n.length>0&&(0,r.jsxs)("div",{style:{padding:"8px 12px",borderTop:"1px solid #e9ecef",fontSize:"12px",color:"#6c757d",backgroundColor:"#f8f9fa"},children:[n.length," ",1===n.length?"selecionado":"selecionados"]})]})]})}var f=n(80596),m=n(90162),p=n(64466),h=n(96930),v=n(77332),b=n(14305),y=n(70038),g=n(50860),x=n(47339);function j(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return w(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(w(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,w(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,w(d,"constructor",c),w(c,"constructor",l),l.displayName="GeneratorFunction",w(c,a,"GeneratorFunction"),w(d),w(d,a,"Generator"),w(d,r,function(){return this}),w(d,"toString",function(){return"[object Generator]"}),(j=function(){return{w:o,m:f}})()}function w(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}w=function(e,t,n,r){function o(t,n){w(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},w(e,t,n,r)}function S(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function N(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){S(o,r,a,i,s,"next",e)}function s(e){S(o,r,a,i,s,"throw",e)}i(void 0)})}}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){if(e){if("string"==typeof e)return O(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A(){var e=(new Date).toISOString().split("T")[0],t=k((0,i.useState)([]),2),n=t[0],s=t[1],l=k((0,i.useState)(""),2),c=l[0],u=l[1],w=k((0,i.useState)(e),2),S=w[0],O=w[1],A=k((0,i.useState)(e),2),E=A[0],P=A[1],F=k((0,i.useState)(""),2),T=F[0],D=F[1],_=k((0,i.useState)(!1),2),I=_[0],M=_[1],R=k((0,i.useState)(!1),2),z=R[0],L=R[1],q=k((0,i.useState)(null),2),B=q[0],G=q[1],H=k((0,i.useState)(!1),2),W=H[0],U=H[1],V=k((0,i.useState)(null),2),Q=V[0],K=V[1],$=k((0,i.useState)(!1),2),J=$[0],Y=($[1],k((0,i.useState)(!1),2)),Z=Y[0],X=Y[1],ee=k((0,i.useState)(null),2),te=ee[0],ne=ee[1],re=k((0,i.useState)(!1),2),ae=re[0],oe=(re[1],k((0,i.useState)(!1),2)),ie=oe[0],se=oe[1],le=k((0,i.useState)(null),2),ce=le[0],ue=le[1],de=k((0,i.useState)(1),2),fe=de[0],me=de[1],pe=k((0,i.useState)(30),2),he=pe[0],ve=pe[1],be=k((0,i.useState)(!1),2),ye=be[0],ge=be[1],xe=(0,a.I)({queryKey:["time-management","members",c],queryFn:function(){return(0,b.iT)(c||void 0)},staleTime:6e4,refetchOnWindowFocus:!1}),je=xe.data,we=void 0===je?[]:je,Se=xe.isFetching,Ne=(0,a.I)({queryKey:["time-management","work-shifts"],queryFn:y.hY,staleTime:6e4,refetchOnWindowFocus:!1}),ke=Ne.data,Ce=void 0===ke?[]:ke,Oe=Ne.isFetching,Ae=(0,i.useMemo)(function(){if(0!==n.length)return n.map(function(e){var t=we.find(function(t){return String(t.id)===String(e)});return t?[t.firstName,t.lastName].filter(Boolean).join(" ").trim():null}).filter(Boolean).join(",")},[we,n]),Ee=(0,a.I)({queryKey:["time-management","hit-spot-time-history",{member_name:Ae,work_shift_id:c||void 0,start_date:S,end_date:E,status:T,page:fe,limit:he}],queryFn:function(){return(0,b.ZD)({member_name:Ae,work_shift_id:c?String(c):void 0,start_date:S,end_date:E,status:T||void 0,page:fe,limit:he})},staleTime:3e4,refetchOnWindowFocus:!1}),Pe=Ee.data,Fe=Ee.isFetching,Te=Ee.refetch;function De(e){var t,n=e.map(function(e){var t;if(!e.id)return null;if(!0===e.isRemoved||!1===e.enabled)return null;var n=[e.firstName,e.lastName].filter(Boolean).join(" ").trim(),r=(null!==(t=e.role)&&void 0!==t?t:"").trim(),a=n||r||"#".concat(e.id);return{value:e.id,label:a}}).filter(function(e){return!!e}),r=new Map,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=C(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}(n);try{for(a.s();!(t=a.n()).done;){var o=t.value;r.set(o.value,o)}}catch(e){a.e(e)}finally{a.f()}return Array.from(r.values()).sort(function(e,t){return e.label.localeCompare(t.label)})}var _e=(0,i.useMemo)(function(){return De(we)},[we]);var Ie=(0,i.useMemo)(function(){return Ce.map(function(e){return{value:e.id,label:e.name}})},[Ce]),Me=(0,i.useMemo)(function(){return 0===n.length?[]:we.filter(function(e){var t=String(e.id);return n.some(function(e){return String(e)===t})})},[we,n]),Re=(0,i.useMemo)(function(){return null!=Pe&&Pe.data?Pe.data.map(function(e){var t,n;if(null==e||!e.id||null==e||!e.date)return console.warn("⚠️ Registro sem ID ou data:",e),null;var r=(null===(t=e.clockTimes)||void 0===t?void 0:t.length)>0?e.clockTimes.map(function(e){return(null==e?void 0:e.slice(0,5))||"--:--"}):["--:--","--:--","--:--","--:--"],a=(null===(n=e.shiftTimes)||void 0===n?void 0:n.length)>0?e.shiftTimes.join(" - "):"-- - -- - -- - --",o=e.date,i=e.workedHours||"00:00",s=e.justificationType,l="",c="secondary",u="secondary";if(s)switch(s){case"reason":l="Abonado",u="info";break;case"license":l="Licença",u="info";break;case"missing_hours":l="Devendo Horas",u="danger",c="danger";break;case"incomplete":l="Incompleto",u="danger",c="danger";break;case"overtime":l="Horas Extras",u="success",c="success";break;case"on_time":l="Em Dia",u="success";break;case"esquecimento":l="Editado - Esquecimento",u="info";break;case"registro_duplicado":l="Editado - Registro Duplicado",u="info";break;case"ajuste_solicitado":l="Editado - Ajuste Solicitado",u="info";break;default:l=s,u="secondary"}else l="-",u="secondary";return{id:e.id,data:o,memberName:e.memberName,registros:r,previstos:a,horas:i,horasColor:c,status:l,statusColor:u,justificationType:e.justificationType,justificationId:e.justificationId,justification:e.justification,expectedHours:e.expectedHours,hoursDifference:e.hoursDifference,isOvertime:e.isOvertime,isMissingHours:e.isMissingHours,delay:e.delay,missingClockIns:e.missingClockIns}}).filter(function(e){return null!==e}):[]},[Pe]),ze=function(e){s(e),me(1)},Le=function(){var e=N(j().m(function e(){var t,n,r,a,o,i,s;return j().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,M(!0),e.n=1,(0,b.LW)({member_name:Ae,work_shift_id:c?String(c):void 0,start_date:S||void 0,end_date:E||void 0,status:T||void 0});case 1:t=e.v,n=new Date,r=n.toISOString().split("T")[0],a=n.toTimeString().split(" ")[0].replace(/:/g,"-"),o="historico_pontos_".concat(r,"_").concat(a,".csv"),i=window.URL.createObjectURL(t),(s=document.createElement("a")).href=i,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(i),e.n=3;break;case 2:e.p=2,e.v,x.A.error("Erro ao exportar arquivo. Por favor, tente novamente.","Erro na exportação");case 3:return e.p=3,M(!1),e.f(3);case 4:return e.a(2)}},e,null,[[0,2,3,4]])}));return function(){return e.apply(this,arguments)}}(),qe=function(){L(!1),G(null)},Be=function(){var e=N(j().m(function e(t){var n,r,a,o;return j().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,ge(!0),n={hitTheSpotId:B.id,motivo:t.motivo,primeiraEntradaData:t.primeiraEntradaData,primeiraEntradaHora:t.primeiraEntradaHora,primeiraSaidaData:t.primeiraSaidaData,primeiraSaidaHora:t.primeiraSaidaHora,segundaEntradaData:t.segundaEntradaData,segundaEntradaHora:t.segundaEntradaHora,saidaData:t.saidaData,saidaHora:t.saidaHora},e.n=1,(0,b.Nq)(n);case 1:return e.n=2,Te();case 2:qe(),e.n=4;break;case 3:e.p=3,o=e.v,a=(null==o||null===(r=o.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.error)||(null==o?void 0:o.message)||"Erro desconhecido ao salvar edição.",x.A.error(a,"Erro ao salvar edição");case 4:return e.p=4,ge(!1),e.f(4);case 5:return e.a(2)}},e,null,[[0,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),Ge=function(){var e=N(j().m(function e(t){return j().w(function(e){for(;;)switch(e.n){case 0:U(!1),K(null),Te();case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),He=function(){var e=N(j().m(function e(t){return j().w(function(e){for(;;)switch(e.n){case 0:X(!1),ne(null),Te();case 1:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();return(0,r.jsxs)(g.A,{children:[(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsx)("div",{className:"card-body",style:{overflow:"visible"},children:(0,r.jsxs)("div",{className:"form-row",children:[(0,r.jsxs)("div",{className:"form-group col-12 col-lg-4",style:{overflow:"visible"},children:[(0,r.jsx)("label",{className:"mb-1",children:"Turno"}),(0,r.jsx)(o.A,{options:Ie,value:c,placeholder:"Todos os Turnos",size:"md",onChange:function(e){u(e),s([]),me(1)},disabled:Oe,className:"custom-select"})]}),(0,r.jsxs)("div",{className:"form-group col-12 col-lg-4",children:[(0,r.jsx)("label",{className:"mb-1",children:"Membro"}),(0,r.jsx)("div",{className:"input-group",children:(0,r.jsx)(d,{options:_e,value:n,placeholder:"Buscar e Selecionar Membros",onChange:ze,disabled:Se})})]}),(0,r.jsxs)("div",{className:"form-group col-12 col-md-6 col-lg-2",children:[(0,r.jsx)("label",{className:"mb-1",children:"Data Início"}),(0,r.jsx)("input",{type:"date",className:"form-control",value:S,onChange:function(e){O(e.target.value),me(1)},placeholder:"dd/mm/aaaa"})]}),(0,r.jsxs)("div",{className:"form-group col-12 col-md-6 col-lg-2",children:[(0,r.jsx)("label",{className:"mb-1",children:"Data Fim"}),(0,r.jsx)("input",{type:"date",className:"form-control",value:E,onChange:function(e){P(e.target.value),me(1)},placeholder:"dd/mm/aaaa"})]})]})})}),n.length>0&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"mt-3",style:{display:"flex",flexWrap:"wrap",gap:"16px"},children:Me.length>0?Me.map(function(e){var t,a,o,i,s,l,c=[e.firstName,e.lastName].filter(Boolean).join(" ").trim()||"—",u=null!==(t=null!==(a=null!==(o=null==e?void 0:e.email)&&void 0!==o?o:null==e||null===(i=e.user)||void 0===i?void 0:i.email)&&void 0!==a?a:null==e?void 0:e.contactEmail)&&void 0!==t?t:"—",d=c.split(/\s+/).filter(Boolean),f=[null===(s=d[0])||void 0===s?void 0:s[0],null===(l=d[d.length-1])||void 0===l?void 0:l[0]].filter(Boolean).join("").toUpperCase()||"U",m=["#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#98D8C8","#F7DC6F","#BB8FCE","#85C1E2"],p=m[c.charCodeAt(0)%m.length];return(0,r.jsx)("div",{className:"card",style:{flex:"0 0 auto",minWidth:"300px",maxWidth:"400px",border:"1px solid #dee2e6",borderRadius:"8px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)",position:"relative"},children:(0,r.jsx)("div",{className:"card-body p-3",children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsxs)("div",{style:{position:"relative",marginRight:"12px",flexShrink:0},children:[e.hasCrown&&(0,r.jsx)("img",{src:"/images/employee-advocacy/image.png",alt:"Crown",style:{position:"absolute",top:"-10px",left:"50%",transform:"translateX(-50%)",width:"15px",height:"15px",zIndex:2}}),(0,r.jsx)("div",{className:"rounded-circle d-flex align-items-center justify-content-center text-white",style:{width:48,height:48,backgroundColor:p,fontWeight:700,fontSize:"18px",border:e.hasCrown?"2px solid #FFD700":"none",boxShadow:e.hasCrown?"0 0 8px rgba(255, 215, 0, 0.5)":"none"},"aria-label":"Avatar de ".concat(c),title:c,children:f})]}),(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsx)("div",{className:"font-weight-bold text-dark",style:{fontSize:"15px",marginBottom:"2px"},children:c}),(0,r.jsx)("div",{className:"text-muted",style:{fontSize:"13px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u})]}),(0,r.jsx)("button",{type:"button",onClick:function(){return ze(n.filter(function(t){return String(t)!==String(e.id)}))},style:{position:"absolute",top:"8px",right:"8px",background:"transparent",border:"none",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6c757d",fontSize:"20px",lineHeight:"1",padding:"0",transition:"color 0.2s"},onMouseEnter:function(e){e.currentTarget.style.color="#dc3545"},onMouseLeave:function(e){e.currentTarget.style.color="#6c757d"},title:"Remover ".concat(c),children:"x"})]})})},e.id)}):(0,r.jsx)("div",{className:"alert alert-info",style:{width:"100%"},children:"Nenhum membro encontrado para exibir."})})}),(0,r.jsx)(f.default,{data:Re,isLoading:Fe,pagination:null==Pe?void 0:Pe.pagination,onPageChange:function(e){me(e)},onItemsPerPageChange:function(e){ve(e),me(1)},onExportClick:Le,isExporting:I,onEditRecord:function(e){G(e),L(!0)},onAbonarRecord:function(e){K(e),U(!0)},onLicencaRecord:function(e){ne(e),X(!0)},onViewRecord:function(e){ue(e),se(!0)},selectedStatus:T,onStatusChange:function(e){D(e),me(1)}}),(0,r.jsx)(m.default,{isOpen:z,onClose:qe,record:B,onSave:Be,isSaving:ye}),(0,r.jsx)(p.default,{isOpen:W,onClose:function(){U(!1),K(null)},record:Q,onSave:Ge,isSaving:J}),(0,r.jsx)(h.default,{isOpen:Z,onClose:function(){X(!1),ne(null)},record:te,onSave:He,isSaving:ae}),(0,r.jsx)(v.default,{isOpen:ie,onClose:function(){se(!1),ue(null)},record:ce})]})}},25149(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(74423),n(62062),n(26099);var r=n(74848),a=function(e){switch(e){case"leve":return"#28A745";case"moderado":return"#FFC107";case"atencao":return"#17A2B8";case"grave":return"#DC3545";default:return"#6B7280"}};function o(e){var t=e.items,n=e.editPointEnabled,o=e.onAddJustification,i=e.onEditPoint;return t&&0!==t.length?(0,r.jsxs)("div",{style:{padding:"0 20px",paddingBottom:"100px"},children:[(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 70px 60px 80px",gap:"8px",padding:"12px 0",borderBottom:"1px solid #E5E7EB",fontSize:"13px",fontWeight:600,color:"#6B7280",fontFamily:"Inter"},children:[(0,r.jsx)("div",{children:"Ocorrências"}),(0,r.jsx)("div",{style:{textAlign:"center"},children:"Horário"}),(0,r.jsx)("div",{style:{textAlign:"center"},children:"Status"}),(0,r.jsx)("div",{style:{textAlign:"center"},children:"Ações"})]}),t.map(function(e,s){var l,c=n&&(!!(l=e.type)&&["ponto_dia_folga","ponto_duplicado"].includes(l));return(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 70px 60px 80px",gap:"8px",padding:"16px 0",borderBottom:s<t.length-1?"1px solid #F3F4F6":"none",alignItems:"center"},children:[(0,r.jsx)("div",{style:{fontSize:"14px",fontWeight:500,color:"#1F2937",fontFamily:"Inter"},children:e.title}),(0,r.jsx)("div",{style:{fontSize:"13px",color:"#6B7280",textAlign:"center",fontFamily:"Inter"},children:e.time}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.jsx)("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:a(e.status)}})}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"center",gap:"8px"},children:[(0,r.jsx)("button",{onClick:function(){return o(e)},style:{padding:"6px 8px",border:"none",background:"none",cursor:"pointer",color:"#6B7280"},title:"Adicionar Justificativa",children:(0,r.jsx)("i",{className:"fas fa-comment",style:{fontSize:"14px"}})}),c&&(0,r.jsx)("button",{onClick:function(){return i(e)},style:{padding:"6px 8px",border:"none",background:"none",cursor:"pointer",color:"#6B7280"},title:"Editar Ponto",children:(0,r.jsx)("i",{className:"fas fa-pencil-alt",style:{fontSize:"14px"}})})]})]},e.id||s)})]}):(0,r.jsx)("div",{style:{padding:"40px 20px",textAlign:"center"},children:(0,r.jsx)("p",{style:{color:"#9CA3AF",fontSize:"14px",fontFamily:"Inter"},children:"Nenhuma ocorrência registrada"})})}},26071(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>b});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(58940),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(96339),l=n(96540),c=n(76336);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=["time-management","policy"];function b(){var e=(0,c.L)().canEdit,t=(0,o.jE)(),n=p((0,l.useState)(!1),2),u=n[0],d=n[1],m=p((0,l.useState)(8),2),h=m[0],b=m[1],y=(0,a.I)({queryKey:v,queryFn:s.Z}),g=y.data;y.isFetching;(0,l.useEffect)(function(){var e,t;g&&(d(null!==(e=g.blockOvertimeTimesheet)&&void 0!==e&&e),b(null!==(t=g.dailyHoursLimit)&&void 0!==t?t:8))},[g]);var x=(0,i.n)({mutationFn:function(e){return(0,s.E)(e)},onSuccess:function(){t.invalidateQueries({queryKey:v})}}),j=function(){g&&x.mutate(f(f({},g),{},{blockOvertimeTimesheet:u,dailyHoursLimit:u?h:8}))};return(0,l.useEffect)(function(){g&&j()},[u]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("div",{className:"col-12 col-md-6 col-xl-4 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(u?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"timesheet-block",className:"custom-control-input",checked:u,onChange:function(e){return d(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(u?"text-primary":""),htmlFor:"timesheet-block",children:["Bloquear horas extras no timesheet",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",style:{fontSize:"0.85rem"},children:"Quando ativado, o sistema impedirá que o membro registre no timesheet mais horas que o limite diário estabelecido. Use isso para controlar horas extras."}),(0,r.jsxs)("div",{className:"input-group mt-auto",children:[(0,r.jsx)("input",{type:"number",className:"form-control",value:h,onChange:function(e){return b(parseInt(e.target.value)||8)},onBlur:j,disabled:!u||!e,min:"1",max:"24"}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",children:"horas"})})]})]})})})}),x.isPending&&(0,r.jsxs)("div",{className:"text-muted mt-2",children:[(0,r.jsx)("i",{className:"fas fa-spinner fa-spin mr-2"}),"Salvando..."]})]})}},26723(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953),n(76031);var r=n(74848),a=n(96540),o=n(40961),i=n(18851);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){var t=e.open,n=e.onClose,l=(e.clock,e.background),c=e.workMinutes,u=e.breakMinutes,d=s(a.useState("focus"),2),f=d[0],m=d[1],p=s(a.useState(!1),2),h=p[0],v=p[1],b=s(a.useState(60*c),2),y=b[0],g=b[1],x=a.useRef(null);if(a.useEffect(function(){if(t){m("focus"),v(!1),g(60*c);var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[t,c,u]),a.useEffect(function(){if(t&&h)return x.current=window.setInterval(function(){g(function(e){if(e>0)return e-1;var t="focus"===f?"break":"focus";return m(t),60*("focus"===t?c:u)})},1e3),function(){x.current&&window.clearInterval(x.current)}},[t,h,f,c,u]),!t)return null;var j="blue"===l?"/images/tenant/blue_background.png":"white"===l?"/images/tenant/white_background.png":"/images/tenant/black_background.png",w="white"===l?"#0b1520":"#f2f4f7",S="focus"===f?"Foco":"Descanso curto",N=(0,r.jsxs)("div",{className:"position-fixed",style:{inset:0,zIndex:9999,backgroundImage:"url(".concat(j,")"),backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:"#000",pointerEvents:"auto"},role:"dialog","aria-modal":"true",children:[(0,r.jsxs)("div",{style:{position:"fixed",top:12,right:12,display:"flex",gap:8,zIndex:1e4},children:[(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-light",onClick:function(){return v(function(e){return!e})},"aria-label":h?"Pausar":"Iniciar",children:h?(0,r.jsx)("i",{className:"fas fa-pause"}):(0,r.jsx)("i",{className:"fas fa-play"})}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-light",onClick:n,"aria-label":"Fechar modo foco",children:(0,r.jsx)("i",{className:"fas fa-times"})})]}),(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-center text-center",style:{position:"absolute",inset:0,color:w,padding:16,textShadow:"white"===l?"none":"0 1px 12px rgba(0,0,0,.35)"},children:(0,r.jsxs)("div",{style:{maxWidth:560,width:"100%"},children:[(0,r.jsxs)("div",{className:"mb-2",style:{fontSize:18,opacity:.9},children:["Modo Foco ","break"===f?"– Em descanso":""]}),(0,r.jsx)(i.default,{title:S,seconds:y,running:h,active:!0,theme:l,onStart:function(){return v(!0)},onPause:function(){return v(!1)}})]})})]});return(0,o.createPortal)(N,document.body)}},30588(e,t,n){"use strict";n.d(t,{A:()=>f});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(12921),i=n(85072),s=n.n(i),l=n(12395),c={insert:"head",singleton:!1};s()(l.A,c);l.A.locals;function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const f=function(e){var t=e.initialStartDate,n=e.initialEndDate,i=e.onChange,s=e.maxDays,l=void 0===s?365:s,c=e.className,d=void 0===c?"":c,f=u((0,a.useState)({startDate:t||"",endDate:n||""}),2),m=f[0],p=f[1],h=u((0,a.useState)(!1),2),v=h[0],b=h[1],y=(0,a.useRef)(null),g=function(e){if(!e)return"";var t=new Date(e+"T00:00:00"),n=t.getDate(),r=["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"][t.getMonth()];return"".concat(n," de ").concat(r)};(0,a.useEffect)(function(){var e=function(e){y.current&&!y.current.contains(e.target)&&b(!1)};return v&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[v]);var x=m.startDate&&m.endDate?"".concat(g(m.startDate)," à ").concat(g(m.endDate)):"Selecionar período";return(0,r.jsxs)("div",{className:"date-range-badge ".concat(d),ref:y,children:[(0,r.jsxs)("button",{type:"button",className:"date-range-badge__button",onClick:function(){return b(!v)},children:[(0,r.jsx)("i",{className:"fas fa-calendar-alt date-range-badge__icon"}),(0,r.jsx)("span",{className:"date-range-badge__text",children:x})]}),v&&(0,r.jsxs)("div",{className:"date-range-badge__dropdown",children:[(0,r.jsxs)("div",{className:"date-range-badge__dropdown-header",children:[(0,r.jsx)("span",{children:"Selecionar Período"}),(0,r.jsx)("button",{type:"button",className:"date-range-badge__dropdown-close",onClick:function(){return b(!1)},children:(0,r.jsx)("i",{className:"fas fa-times"})})]}),(0,r.jsx)("div",{className:"date-range-badge__dropdown-body",children:(0,r.jsx)(o.A,{initialStartDate:m.startDate,initialEndDate:m.endDate,onChange:function(e){p(e),i(e)},maxDays:l})})]})]})}},30786(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>m});n(52675),n(89463),n(2259),n(28706),n(51629),n(23418),n(74423),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(78459),n(27495),n(38781),n(21699),n(47764),n(23500),n(62953),n(76031);var r=n(74848),a=n(97665),o=n(57097),i=n(49785),s=n(55278),l=n(96540),c=n(1806);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=["time-management","location"];function m(e){var t=e.show,n=e.onClose,d=e.editData,m=(0,a.jE)(),p=!!d,h=(0,l.useRef)(null),v=u((0,l.useState)(null),2),b=v[0],y=v[1],g=u((0,l.useState)(null),2),x=g[0],j=g[1],w=u((0,l.useState)(null),2),S=(w[0],w[1]),N=(0,l.useRef)(null),k=(0,l.useRef)(null),C=(0,i.mN)({defaultValues:{address:"",neighborhood:"",number:"",complement:"",reference:"",city:"",country:"",latitude:"",longitude:""}}),O=(C.register,C.handleSubmit),A=C.watch,E=C.setValue,P=C.reset;C.formState.errors;(0,l.useEffect)(function(){d&&(E("address",d.address||""),E("neighborhood",d.neighborhood||""),E("number",d.number||""),E("complement",d.complement||""),E("reference",d.reference||""),E("city",d.city||""),E("country",d.country||""),E("latitude",d.latitude||""),E("longitude",d.longitude||""))},[d,E]);var F=(0,l.useCallback)(function(e){var t,n="",r="",a="",o="",i="";console.log("Address components:",e.address_components),null===(t=e.address_components)||void 0===t||t.forEach(function(e){var t=e.types;t.includes("street_number")&&(i=e.long_name),!n&&(t.includes("sublocality")||t.includes("neighborhood")||t.includes("sublocality_level_1"))&&(n=e.long_name),r||!t.includes("locality")&&!t.includes("administrative_area_level_2")||(r=e.long_name),t.includes("administrative_area_level_1")&&(a=e.short_name),t.includes("country")&&(o=e.long_name)}),!r&&a&&console.warn("Cidade não encontrada, usando estado:",a),console.log("Componentes extraídos:",{neighborhood:n,city:r,state:a,country:o,number:i}),E("neighborhood",n),E("city",r),E("country",o),i&&E("number",i)},[E]),T=(0,l.useCallback)(function(e,t){void 0!==window.google&&(new window.google.maps.Geocoder).geocode({location:{lat:e,lng:t}},function(n,r){"OK"===r&&n[0]&&(E("address",n[0].formatted_address),E("latitude",e.toString()),E("longitude",t.toString()),F(n[0]))})},[E,F]);(0,l.useEffect)(function(){if(t&&h.current){var e=function(){if(void 0!==window.google){var e=null!=d&&d.latitude?parseFloat(d.latitude):-23.5505,t=null!=d&&d.longitude?parseFloat(d.longitude):-46.6333,n=new window.google.maps.Map(h.current,{zoom:15,center:{lat:e,lng:t},mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1}),r=new window.google.maps.Marker({map:n,draggable:!0,position:{lat:e,lng:t}});if(window.google.maps.event.addListener(r,"dragend",function(){var e=r.getPosition();T(e.lat(),e.lng())}),window.google.maps.event.addListener(n,"click",function(e){var t=e.latLng.lat(),n=e.latLng.lng();r.setPosition({lat:t,lng:n}),T(t,n)}),y(n),j(r),N.current){var a=new window.google.maps.places.Autocomplete(N.current,{types:["address"]});a.addListener("place_changed",function(){var e=a.getPlace();if(e.geometry&&e.geometry.location){var t=e.geometry.location;n.setCenter(t),r.setPosition(t),E("latitude",t.lat().toString()),E("longitude",t.lng().toString()),E("address",e.formatted_address||""),F(e)}}),S(a)}}else console.error("Google Maps não carregado")};if(void 0!==window.google)e();else{var n=window.GOOGLE_MAPS_API_KEY;if(!n)return void console.error("Google Maps API key não encontrada");var r=document.createElement("script");r.src="https://maps.googleapis.com/maps/api/js?key=".concat(n,"&libraries=places"),r.async=!0,r.onload=e,document.head.appendChild(r)}}},[t,d,T]);var D=A("address");(0,l.useEffect)(function(){if(D&&b&&x&&!(D.length<5))return k.current&&clearTimeout(k.current),k.current=setTimeout(function(){void 0!==window.google&&(new window.google.maps.Geocoder).geocode({address:D},function(e,t){if("OK"===t&&e[0]){var n=e[0].geometry.location;b.setCenter(n),x.setPosition(n),E("latitude",n.lat().toString()),E("longitude",n.lng().toString()),F(e[0])}})},1e3),function(){k.current&&clearTimeout(k.current)}},[D,b,x,E]);var _=(0,o.n)({mutationFn:function(e){var t={name:e.address,address:e.address,neighborhood:e.neighborhood||"",number:e.number||"",complement:e.complement||"",reference:e.reference||"",city:e.city,country:e.country,latitude:e.latitude,longitude:e.longitude,google_url:"https://www.google.com/maps?q=".concat(e.latitude,",").concat(e.longitude)};return p&&null!=d&&d.id?(0,s.Nt)(d.id,t):(0,s.yJ)(t)},onSuccess:function(){m.invalidateQueries({queryKey:f}),P(),n()}});return(0,r.jsx)(c.A,{show:t,onClose:n,title:p?"Editando Localização":"Cadastrar Localização",size:"md",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:n,children:"Cancelar"}),(0,r.jsx)("button",{type:"submit",form:"locationForm",className:"btn text-white px-4",style:{backgroundColor:"#17a2b8"},disabled:_.isPending||!D,children:_.isPending?(0,r.jsx)("i",{className:"fas fa-spinner fa-spin"}):p?"Salvar":"Adicionar Localização"})]}),children:(0,r.jsxs)("form",{id:"locationForm",onSubmit:O(function(e){_.mutate(e)}),children:[(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Endereço da Localização"}),(0,r.jsx)("input",{ref:N,type:"text",className:"form-control",placeholder:"Rua Rosariio Sansalone, 285",value:A("address"),onChange:function(e){return E("address",e.target.value)}}),(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mt-2",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("i",{className:"fas fa-search text-muted",style:{fontSize:"0.9rem"}}),(0,r.jsx)("small",{className:"text-muted ml-2",children:"Digite o endereço ou selecione no mapa"})]}),(0,r.jsxs)("small",{className:"text-info",children:[(0,r.jsx)("i",{className:"fas fa-info-circle mr-1"}),"Clique no mapa ou arraste o marcador"]})]})]}),(0,r.jsx)("div",{ref:h,style:{width:"100%",height:"300px",borderRadius:"8px",marginBottom:"20px",cursor:"crosshair",border:"2px solid #e0e0e0"}})]})})}},30970(e,t,n){"use strict";n.d(t,{A:()=>v});n(52675),n(89463),n(2259),n(45700),n(23792),n(89572),n(94170),n(2892),n(59904),n(84185),n(40875),n(10287),n(26099),n(60825),n(47764),n(62953);var r,a=n(96540),o=n(40961),i=n(52891);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function u(e,t,n){return t=f(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var p=o;r=p.createRoot,p.hydrateRoot;var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,(o=[{key:"connect",value:function(){var e=this.propsValue?this.propsValue:null;if(this.dispatchEvent("connect",{component:this.componentValue,props:e}),!this.componentValue)throw new Error("No component specified.");var t=window.resolveReactComponent(this.componentValue);this._renderReactElement(a.createElement(t,e,null)),this.dispatchEvent("mount",{componentName:this.componentValue,component:t,props:e})}},{key:"disconnect",value:function(){this.element.root.unmount(),this.dispatchEvent("unmount",{component:this.componentValue,props:this.propsValue?this.propsValue:null})}},{key:"_renderReactElement",value:function(e){var t=this.element;t.root||(t.root=r(this.element)),t.root.render(e)}},{key:"dispatchEvent",value:function(e,t){this.dispatch(e,{detail:t,prefix:"react"})}}])&&l(n.prototype,o),i&&l(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,i}(i.xI);h.values={component:String,props:Object};const v={"symfony--ux-react--react":h}},31475(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>i});n(74423),n(62062),n(26099);var r=n(74848);function a(e){return"leve"===e?"Leve":"moderado"===e?"Moderado":"atencao"===e?"Atenção":"Grave"}function o(e){if(!e)return!1;return["ponto_dia_folga","ponto_duplicado"].includes(e)}function i(e){var t=e.items,n=e.editPointEnabled,i=void 0!==n&&n,s=e.onAddJustification,l=e.onEditPoint;return(0,r.jsx)("div",{className:"ms-table-occurrences-wrapper",children:(0,r.jsxs)("table",{className:"ms-table-occurrences",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Ocorrências"}),(0,r.jsx)("th",{children:"Horário"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{className:"ms-text-right",children:"Ações"})]})}),(0,r.jsx)("tbody",{children:0===t.length?(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:4,className:"ms-table-occurrences-empty",children:"Sem ocorrências"})}):t.map(function(e){return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.title}),(0,r.jsx)("td",{children:e.time}),(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"ms-table-occurrences-status",children:[(0,r.jsx)("span",{className:"ms-table-occurrences-status-dot",style:{backgroundColor:(t=e.status,"leve"===t?"#01D6C5":"moderado"===t?"#FFE524":"atencao"===t?"#17A2B8":"#DC3545")}}),(0,r.jsx)("span",{children:a(e.status)})]})}),(0,r.jsx)("td",{className:"ms-text-right",children:(0,r.jsxs)("div",{className:"btn-group",children:[(0,r.jsx)("button",{className:"ms-table-occurrences-action-button","data-toggle":"dropdown",type:"button",title:"Ações",children:(0,r.jsx)("i",{className:"fas fa-pencil-alt ms-table-occurrences-action-icon"})}),(0,r.jsxs)("div",{className:"dropdown-menu dropdown-menu-right",children:[(0,r.jsxs)("a",{className:"dropdown-item",href:"#",onClick:function(t){t.preventDefault(),null==s||s(e)},children:[(0,r.jsx)("i",{className:"far fa-comment-dots mr-2"})," Justificativa"]}),i&&o(e.type)&&(0,r.jsxs)("a",{className:"dropdown-item",href:"#",onClick:function(t){t.preventDefault(),null==l||l(e)},children:[(0,r.jsx)("i",{className:"far fa-edit mr-2"})," Editar Ponto"]})]})]})})]},e.id);var t})})]})})}},33384(e,t,n){"use strict";n.r(t),n.d(t,{extractPercentage:()=>d,findActivityByName:()=>p,findProjectByName:()=>m,normalizeName:()=>f,parseDurationToMinutes:()=>u,submitActivityFromCard:()=>h});n(52675),n(89463),n(2259),n(28706),n(50113),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(78459),n(58940),n(3362),n(27495),n(38781),n(21699),n(47764),n(25440),n(42762),n(62953);var r=n(81623),a=n(47339);function o(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,r,a,o){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return i(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(i(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,i(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,i(m,"constructor",d),i(d,"constructor",u),u.displayName="GeneratorFunction",i(d,a,"GeneratorFunction"),i(m),i(m,a,"Generator"),i(m,r,function(){return this}),i(m,"toString",function(){return"[object Generator]"}),(o=function(){return{w:s,m:p}})()}function i(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,t,n,r){function o(t,n){i(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},i(e,t,n,r)}function s(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u=function(e){if(!e)return 0;var t=l(e.split(":").map(function(e){return parseInt(e,10)||0}),2);return 60*t[0]+t[1]},d=function(e){return e&&parseFloat(e.replace("%",""))||0},f=function(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/\s+/g," ").trim():""},m=function(e,t){if(e){var n=f(e);if(n)return t.find(function(e){return f(e.name)===n})||t.find(function(e){return f(e.name).includes(n)})||t.find(function(e){return n.includes(f(e.name))})}},p=function(e,t){if(e){var n=f(e);if(n)return t.find(function(e){return f(e.name)===n})||t.find(function(e){return f(e.name).includes(n)})||t.find(function(e){return n.includes(f(e.name))})}},h=function(){var e,t=(e=o().m(function e(t,n,i,s,l,c,u,d,f,h,v){var b,y,g,x;return o().w(function(e){for(;;)switch(e.n){case 0:if(b=n&&d.find(function(e){return e.id===n})||s&&m(s,d)||c&&m(c,d)){e.n=1;break}throw a.o.error("Selecione um projeto válido para registrar a atividade."),new Error("Projeto não encontrado");case 1:if(y=i&&f.find(function(e){return e.id===i})||l&&p(l,f)||u&&p(u,f)){e.n=2;break}throw a.o.error("Selecione uma atividade válida para registrar."),new Error("Atividade não encontrada");case 2:return g=60*v,x={date:h,project_id:b.id,activity_template_id:y.id,start_time:t.startTime&&"00:00"!==t.startTime?"".concat(h," ").concat(t.startTime,":00"):void 0,end_time:t.endTime&&"00:00"!==t.endTime?"".concat(h," ").concat(t.endTime,":00"):void 0,percentage:t.percentage||void 0,duration:t.duration||0,comment:t.comment||"",activity_name_legacy:y.name,workload_minutes:g},e.n=3,r.Z4.createActivity(x);case 3:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){s(o,r,a,i,l,"next",e)}function l(e){s(o,r,a,i,l,"throw",e)}i(void 0)})});return function(e,n,r,a,o,i,s,l,c,u,d){return t.apply(this,arguments)}}()},34559(e,t,n){"use strict";n.d(t,{A:()=>a});n(28706),n(62062),n(2892),n(26099);var r=n(74848);function a(e){var t=e.options,n=e.value,a=e.placeholder,o=void 0===a?"Selecione uma opção":a,i=e.className,s=void 0===i?"":i,l=e.onChange,c=e.loading,u=void 0!==c&&c,d=e.disabled,f=void 0!==d&&d,m=e.size,p=void 0===m?"md":m,h="sm"===p?"form-control-sm":"lg"===p?"form-control-lg":"";return(0,r.jsxs)("select",{className:"form-control ".concat(h," ").concat(s),value:null!=n?n:"",onChange:function(e){var t=e.target.value;if(l)if(""===t)l("");else{var n=Number(t);l(isNaN(n)?t:n)}},disabled:f||u,children:[(0,r.jsx)("option",{value:"",children:u?"Carregando...":o}),t.map(function(e){return(0,r.jsx)("option",{value:e.value,disabled:e.disabled,children:e.label},e.value)})]})}},34595(e,t,n){"use strict";n.d(t,{Pg:()=>u,SP:()=>v,k1:()=>l,og:()=>f,uQ:()=>p});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(52354);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/generated-links");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function u(e){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.post("/time-management/generated-links",t);case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}function f(e,t){return m.apply(this,arguments)}function m(){return(m=s(a().m(function e(t,n){var o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.put("/time-management/generated-links/".concat(t),n);case 1:return o=e.v,i=o.data,e.a(2,i.data)}},e)}))).apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=s(a().m(function e(t){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.delete("/time-management/generated-links/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}function v(e){return b.apply(this,arguments)}function b(){return(b=s(a().m(function e(t){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.delete("/spaces-control/api/floors/qrcode/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}},34773(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>u});n(52675),n(89463),n(2259),n(45700),n(2008),n(50113),n(51629),n(23792),n(62062),n(89572),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(47764),n(23500),n(62953);var r=n(74848),a=n(49785),o=n(96540);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t,n=e.isOpen,i=e.onClose,s=e.selectedStatus,c=e.onApply,u=e.onClear,d=(0,a.mN)({defaultValues:{status:s}}),f=d.register,m=d.handleSubmit,p=d.watch,h=d.reset;(0,o.useEffect)(function(){h({status:s})},[s,h]);var v=p("status");if(!n)return null;var b=[{value:"",label:"Todos"},{value:"overtime",label:"Horas Extras"},{value:"missing_hours",label:"Devendo Horas"},{value:"on_time",label:"Em Dia"},{value:"incomplete",label:"Incompleto"}],y={overtime:"#28A745",missing_hours:"#DC3545",on_time:"#17A2B8",incomplete:"#6C757D"};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"modal-backdrop fade show",style:{zIndex:1040},onClick:function(e){e.stopPropagation(),i()}}),(0,r.jsx)("div",{className:"modal fade show d-block",style:{zIndex:1050},tabIndex:-1,onClick:function(e){e.target===e.currentTarget&&i()},children:(0,r.jsx)("div",{className:"modal-dialog modal-dialog-centered",style:{maxWidth:"400px"},children:(0,r.jsxs)("div",{className:"modal-content",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h5",{className:"modal-title",style:{fontFamily:"Inter",fontSize:"18px",fontWeight:600,color:"#5C5D5D"},children:"Filtros"}),(0,r.jsx)("button",{type:"button",className:"close",onClick:function(e){e.preventDefault(),e.stopPropagation(),i()},"aria-label":"Fechar",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"×"})})]}),(0,r.jsxs)("form",{onSubmit:m(function(e){c(e.status),i()}),children:[(0,r.jsx)("div",{className:"modal-body",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"mb-2",style:{fontFamily:"Inter",fontSize:"14px",fontWeight:400,color:"rgba(92, 93, 93, 0.60)"},children:"Filtrar por Status"}),(0,r.jsx)("select",l(l({},f("status")),{},{className:"form-control",style:{fontFamily:"Inter",fontSize:"14px"},children:b.map(function(e){return(0,r.jsx)("option",{value:e.value,style:{color:e.value?y[e.value]:void 0},children:e.label},e.value)})})),v&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)("small",{className:"d-inline-block px-2 py-1 rounded",style:{backgroundColor:"".concat(y[v],"20"),color:y[v],fontFamily:"Inter",fontSize:"12px",fontWeight:500},children:null===(t=b.find(function(e){return e.value===v}))||void 0===t?void 0:t.label})})]})}),(0,r.jsxs)("div",{className:"modal-footer",children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel btn-sm",onClick:function(){h({status:""}),u(),i()},style:{fontFamily:"Inter"},children:"Limpar Filtros"}),(0,r.jsx)("button",{type:"submit",className:"btn btn-primary btn-sm",style:{fontFamily:"Inter",backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:"Aplicar"})]})]})]})})})]})}},36279(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>p});n(52675),n(89463),n(2259),n(50113),n(23418),n(64346),n(23792),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(88195),i=n(14463),s=n(47339),l=n(33384);function c(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return u(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),m=d.prototype=s.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return l.prototype=d,u(m,"constructor",d),u(d,"constructor",l),l.displayName="GeneratorFunction",u(d,a,"GeneratorFunction"),u(m),u(m,a,"Generator"),u(m,r,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:p}})()}function u(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function d(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){var t=e.activities,n=e.projetos,u=e.atividadesDisponiveis,m=e.currentDate,p=e.workloadHours,h=e.onActivityAdded,v=f((0,a.useState)(!1),2),b=v[0],y=v[1],g=f((0,a.useState)(null),2),x=g[0],j=g[1],w=f((0,a.useState)(null),2),S=w[0],N=w[1],k=f((0,a.useState)(null),2),C=k[0],O=k[1],A=f((0,a.useState)(""),2),E=A[0],P=A[1],F=f((0,a.useState)(""),2),T=F[0],D=F[1],_=f((0,a.useState)(""),2),I=_[0],M=_[1],R=f((0,a.useState)(""),2),z=R[0],L=R[1],q=function(){y(!1),j(null),N(null),O(null),P(""),D(""),M(""),L("")},B=function(){var e,t=(e=c().m(function e(t){var r,a,o,i;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,l.submitActivityFromCard)(t,S,C,E,T,I,z,n,u,m,p);case 1:s.o.success("Atividade adicionada com sucesso!"),q(),h&&h(),e.n=3;break;case 2:e.p=2,i=e.v,console.error("Erro ao adicionar atividade a partir da atividade prevista:",i),o=(null==i||null===(r=i.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||(null==i||null===(a=i.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.error)||"Erro ao adicionar atividade",s.o.error(o);case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){d(o,r,a,i,s,"next",e)}function s(e){d(o,r,a,i,s,"throw",e)}i(void 0)})});return function(e){return t.apply(this,arguments)}}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsxs)("div",{className:"card-body",children:[(0,r.jsx)("h5",{className:"tm-section-title mb-2",children:"Atividades Previstas"}),(0,r.jsx)(o.A,{columns:[{key:"projeto",label:"Projeto",width:"11%"},{key:"atividade",label:"Atividade",width:"11%"},{key:"inicio",label:"Início",width:"11%",align:"center"},{key:"fim",label:"Fim",width:"11%",align:"center"},{key:"percentDia",label:"% do dia",width:"11%",align:"center"},{key:"status",label:"Status",width:"11%",align:"center"},{key:"prioridade",label:"Prioridade",width:"11%",align:"center"},{key:"duracao",label:"Duração",width:"11%",align:"center"},{key:"acoes",label:"Ações",width:"11%",align:"center"}],data:t,renderRow:function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"ms-table-cell",title:e.projeto,children:e.projeto}),(0,r.jsx)("td",{className:"ms-table-cell",title:e.atividade,children:e.atividade}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.inicio}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.fim}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.percentDia}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:(0,r.jsx)("span",{className:"ms-table-badge ".concat("Em Andamento"===e.status?"ms-table-badge-status-em-andamento":"ms-table-badge-status-a-fazer"),children:e.status})}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:(0,r.jsx)("span",{className:"ms-table-badge ".concat("Alta"===e.prioridade?"ms-table-badge-prioridade-alta":"Média"===e.prioridade?"ms-table-badge-prioridade-media":"ms-table-badge-prioridade-baixa"),children:e.prioridade})}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.duracao}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:(0,r.jsx)("button",{className:"app-icon-button",onClick:function(){return function(e){var t,r,a,o,i=(0,l.findProjectByName)(e.projeto,n),s=(0,l.findActivityByName)(e.atividade,u);M(e.projeto),L(e.atividade),N(null!==(t=null==i?void 0:i.id)&&void 0!==t?t:null),O(null!==(r=null==s?void 0:s.id)&&void 0!==r?r:null),P(null!==(a=null==i?void 0:i.name)&&void 0!==a?a:""),D(null!==(o=null==s?void 0:s.name)&&void 0!==o?o:"");var c={startTime:e.inicio||"00:00",endTime:e.fim||"00:00",percentage:(0,l.extractPercentage)(e.percentDia),duration:(0,l.parseDurationToMinutes)(e.duracao),comment:""};j(c),y(!0)}(e)},title:"Registrar atividade planejada",children:(0,r.jsx)("i",{className:"fas fa-check ms-table-action-icon","aria-hidden":"true"})})})]})},emptyMessage:"Nenhuma atividade prevista para hoje"})]})}),(0,r.jsx)(i.default,{show:b,onClose:q,onSubmit:B,selectedProject:E||I,selectedActivity:T||z,workloadHours:p,prefilledData:x,allowProjectSelection:!0,projectOptions:n,activityOptions:u,selectedProjectId:S,selectedActivityId:C,suggestedProjectName:I,suggestedActivityName:z,onProjectChange:function(e){var t,r;if(null===e)return N(null),void P("");var a=n.find(function(t){return t.id===e});N(null!==(t=null==a?void 0:a.id)&&void 0!==t?t:null),P(null!==(r=null==a?void 0:a.name)&&void 0!==r?r:"")},onActivityChange:function(e){var t,n;if(null===e)return O(null),void D("");var r=u.find(function(t){return t.id===e});O(null!==(t=null==r?void 0:r.id)&&void 0!==t?t:null),D(null!==(n=null==r?void 0:r.name)&&void 0!==n?n:"")}})]})}},39576(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>f});n(52675),n(89463),n(2259),n(28706),n(50113),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(71761),n(23500),n(62953);var r=n(74848),a=n(96540),o=n(62495),i=n(1806);function s(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return l(u,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var i={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(l(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,l(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,l(m,"constructor",d),l(d,"constructor",u),u.displayName="GeneratorFunction",l(d,a,"GeneratorFunction"),l(m),l(m,a,"Generator"),l(m,r,function(){return this}),l(m,"toString",function(){return"[object Generator]"}),(s=function(){return{w:o,m:p}})()}function l(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}l=function(e,t,n,r){function o(t,n){l(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},l(e,t,n,r)}function c(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e){var t=e.isOpen,n=e.onScan,l=e.onClose,d=e.qrcodes,f=void 0===d?[]:d,m=u((0,a.useState)(null),2),p=m[0],h=m[1],v=u((0,a.useState)(""),2),b=v[0],y=v[1],g=(0,a.useRef)(null),x=(0,a.useRef)(null),j=(0,a.useRef)(!1);(0,a.useEffect)(function(){return t?(w(),j.current=!1):S(),function(){S()}},[t]);var w=function(){var e,t=(e=s().m(function e(){var t,n,r;return s().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,console.log("[QRCodeModal] 🚀 Iniciando ZXing scanner..."),console.log("[QRCodeModal] QR Codes autorizados:",f.length),f.forEach(function(e,t){console.log("[QRCodeModal] ".concat(t+1,". ").concat(e.name," (ID: ").concat(e.id,")"))}),h(null),y(""),t=new o.BrowserQRCodeReader,x.current=t,e.n=1,t.decodeFromVideoDevice(null,g.current,function(e,t){if(e&&!j.current){var n=e.getText();console.log("[QRCodeModal] 🎉 QR CODE DETECTADO!"),console.log("[QRCodeModal] Dados:",n),y(n),N(n)}});case 1:console.log("[QRCodeModal] ✅ Scanner ativo e esperando QR Code!"),e.n=3;break;case 2:e.p=2,r=e.v,console.error("[QRCodeModal] ❌ Erro ao iniciar scanner:",r),n="Erro ao acessar câmera. Verifique as permissões.","NotAllowedError"===r.name||"PermissionDeniedError"===r.name?n="Permissão de acesso à câmera negada. Por favor, permita o acesso à câmera nas configurações do navegador e tente novamente.":"NotFoundError"===r.name?n="Nenhuma câmera foi encontrada no seu dispositivo.":"NotReadableError"===r.name?n="A câmera está em uso por outro aplicativo. Feche outros aplicativos e tente novamente.":r.message&&(n=r.message),h(n);case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){c(o,r,a,i,s,"next",e)}function s(e){c(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}(),S=function(){console.log("[QRCodeModal] Parando scanner..."),x.current&&(x.current.reset(),x.current=null),j.current=!1},N=function(e){if(j.current)console.log("[QRCodeModal] Já processado, ignorando...");else{j.current=!0,console.log("[QRCodeModal] ========================================"),console.log("[QRCodeModal] Processando QR Code detectado"),console.log("[QRCodeModal] Dados:",e);var t=k(e);if(console.log("[QRCodeModal] ID extraído:",t),!t)return console.error("[QRCodeModal] ❌ Falha ao extrair ID"),h("QR Code inválido. Formato não reconhecido."),void(j.current=!1);var r=f.find(function(e){return e.id===t});r?(console.log("[QRCodeModal] ✅ QR Code VÁLIDO!"),console.log("[QRCodeModal] Nome:",r.name),S(),n(t)):(console.error("[QRCodeModal] ❌ ID não autorizado!"),console.error("[QRCodeModal] ID lido:",t),console.error("[QRCodeModal] IDs autorizados:",f.map(function(e){return e.id})),h("ID ".concat(t.substring(0,8),"... não autorizado.")),j.current=!1)}},k=function(e){try{var t=e.match(/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/i);return t&&t[1]?t[1]:null}catch(e){return console.error("[extractQRCodeId] Erro:",e),null}},C=function(){S(),h(null),l()};return t?(0,r.jsx)(i.A,{show:t,onClose:C,title:"Ler QR Code",size:"md",footer:(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:C,children:"Cancelar"}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[p&&(0,r.jsxs)("div",{className:"alert d-flex align-items-center mb-3",style:{backgroundColor:"#E6F7F9",borderColor:"#17A2B8",color:"#0C5460",gap:"12px"},children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle",style:{color:"#17A2B8",fontSize:"24px"}}),(0,r.jsx)("div",{style:{flex:1},children:p})]}),0===f.length?(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("i",{className:"fas fa-qrcode fa-4x text-muted mb-3"}),(0,r.jsx)("h5",{className:"text-muted",children:"Nenhum QR Code disponível"}),(0,r.jsx)("p",{className:"text-muted mb-0",children:"Não há QR Codes configurados para registro de ponto."})]}):(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{style:{fontFamily:"Inter",fontSize:"14px",color:"#5C5D5D",marginBottom:"16px"},children:"Aponte a câmera para o QR Code"}),(0,r.jsx)("div",{style:{position:"relative",width:"100%",maxWidth:"500px",margin:"0 auto",borderRadius:"8px",overflow:"hidden",backgroundColor:"#000"},children:(0,r.jsx)("video",{ref:g,style:{width:"100%",height:"auto"}})}),(0,r.jsxs)("div",{className:"alert alert-info mt-3 mb-0",children:[(0,r.jsx)("div",{children:"Posicione o QR Code na frente da câmera"}),f.length>0&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsxs)("small",{className:"text-muted",children:[(0,r.jsx)("strong",{children:f.length})," QR Code(s) autorizado(s)"]})}),b&&(0,r.jsxs)("div",{className:"mt-2 p-2",style:{background:"#d4edda",border:"1px solid #28a745",borderRadius:"4px",fontSize:"11px",wordBreak:"break-all"},children:[(0,r.jsx)("strong",{style:{color:"#155724"},children:"✅ Detectado:"}),(0,r.jsx)("br",{}),(0,r.jsxs)("code",{style:{fontSize:"10px"},children:[b.substring(0,60),"..."]})]})]})]})]})}):null}},39618(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(74848),a=n(1806),o={warningIcon:{fontSize:"56px",color:"#FF6D6D",textAlign:"center",marginBottom:"20px"},message:{fontSize:"16px",color:"#5C5D5D",textAlign:"center",marginBottom:"24px",lineHeight:"1.8"},warningText:{fontSize:"14px",fontWeight:600,color:"#DC2626",textAlign:"center",marginTop:"8px"},activityInfo:{backgroundColor:"#F8F9FA",padding:"16px",borderRadius:"8px",marginBottom:"16px",border:"1px solid #E5E7EB"},infoLabel:{fontSize:"13px",fontWeight:600,color:"#6B7280",marginBottom:"6px"},infoValue:{fontSize:"14px",fontWeight:500,color:"#1F2937"}};function i(e){var t=e.show,n=e.onClose,i=e.onConfirm,s=e.activityName,l=e.projectName;return(0,r.jsxs)(a.A,{show:t,onClose:n,title:"Confirmar Exclusão",size:"md",footer:(0,r.jsx)(a.M,{onCancel:n,onConfirm:i,cancelText:"Cancelar",confirmText:"Excluir"}),children:[(0,r.jsx)("div",{style:o.warningIcon,children:(0,r.jsx)("i",{className:"fas fa-exclamation-triangle"})}),(0,r.jsx)("div",{style:o.message,children:"Tem certeza que deseja excluir esta atividade?"}),(0,r.jsx)("div",{style:o.warningText,children:"⚠️ Esta ação não pode ser desfeita"}),(0,r.jsxs)("div",{style:o.activityInfo,children:[(0,r.jsxs)("div",{style:{marginBottom:"12px"},children:[(0,r.jsx)("div",{style:o.infoLabel,children:"Projeto"}),(0,r.jsx)("div",{style:o.infoValue,children:l})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:o.infoLabel,children:"Atividade"}),(0,r.jsx)("div",{style:o.infoValue,children:s})]})]})]})}},41081(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>p});n(52675),n(89463),n(2259),n(51629),n(23418),n(64346),n(23792),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(5506),n(40875),n(79432),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(42762),n(23500),n(62953),n(76031);var r=n(74848),a=n(96540),o=n(76336);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function s(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(i(e)+" is not iterable")}function l(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,u=Object.create(l.prototype);return c(u,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var i={};function s(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(c(t={},r,function(){return this}),t),m=d.prototype=s.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,c(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,c(m,"constructor",d),c(d,"constructor",u),u.displayName="GeneratorFunction",c(d,a,"GeneratorFunction"),c(m),c(m,a,"Generator"),c(m,r,function(){return this}),c(m,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function c(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}c=function(e,t,n,r){function o(t,n){c(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},c(e,t,n,r)}function u(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(){var e,t=document.getElementById("time-management-permissions-template");return t instanceof HTMLTemplateElement?t.innerHTML.trim():(null===(e=document.getElementById("permissoes-content"))||void 0===e?void 0:e.innerHTML.trim())||""}function p(){var e=(0,a.useRef)(null),t=(0,o.L)(),n=(0,o.v)(),i=d((0,a.useState)(m),1)[0];return(0,a.useEffect)(function(){var e=[];return["/css/time-management/index.css","https://cdn.datatables.net/1.13.4/css/dataTables.dataTables.css","https://cdn.datatables.net/responsive/2.4.0/css/responsive.dataTables.css"].forEach(function(t){if(!document.querySelector('link[href="'.concat(t,'"]'))){var n=document.createElement("link");n.rel="stylesheet",n.href=t,document.head.appendChild(n),e.push(n)}}),function(){e.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},[]),(0,a.useEffect)(function(){var e=["https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js","https://cdn.datatables.net/responsive/2.4.0/js/dataTables.responsive.min.js"],t=[],n=function(){var n,r=(n=l().m(function n(){var r,a,o;return l().w(function(n){for(;;)switch(n.n){case 0:r=l().m(function e(){var n;return l().w(function(e){for(;;)switch(e.n){case 0:if(n=o[a],!document.querySelector('script[src="'.concat(n,'"]'))){e.n=1;break}return e.a(2,1);case 1:return e.n=2,new Promise(function(e,r){var a=document.createElement("script");a.src=n,a.async=!1,a.onload=function(){return e()},a.onerror=function(){return r(new Error("Erro ao carregar ".concat(n)))},document.head.appendChild(a),t.push(a)});case 2:return e.a(2)}},e)}),a=0,o=e;case 1:if(!(a<o.length)){n.n=4;break}return n.d(s(r()),2);case 2:if(!n.v){n.n=3;break}return n.a(3,3);case 3:a++,n.n=1;break;case 4:return n.a(2)}},n)}),function(){var e=this,t=arguments;return new Promise(function(r,a){var o=n.apply(e,t);function i(e){u(o,r,a,i,s,"next",e)}function s(e){u(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return r.apply(this,arguments)}}();return n().catch(function(e){console.error("Erro ao carregar scripts do DataTables:",e)}),function(){t.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},[]),(0,a.useEffect)(function(){if(i&&e.current){new Promise(function(e){var t=function(){void 0!==window.$&&void 0!==window.$.fn.DataTable?e():setTimeout(t,100)};t()}).then(function(){e.current&&(e.current.querySelectorAll("script").forEach(function(e){var t,n=document.createElement("script");Array.from(e.attributes).forEach(function(e){n.setAttribute(e.name,e.value)}),e.src?n.src=e.src:n.textContent=e.textContent,null===(t=e.parentNode)||void 0===t||t.replaceChild(n,e)}),window.setTimeout(function(){var e,t,n,r,a,o;null===(e=(t=window).initAllCustomSelectWrappers)||void 0===e||e.call(t),null===(n=(r=window).initCustomSelects)||void 0===n||n.call(r),null===(a=(o=window).setupDynamicTables)||void 0===a||a.call(o),document.dispatchEvent(new CustomEvent("tabShown"))},50),setTimeout(function(){var e=window.$;if(e&&e.fn.DataTable){var t=window.PRODUCT_SLUG||"time-management";fetch("/permission-tab/data/".concat(t)).then(function(e){return e.json()}).then(function(e){"success"===e.status&&(window.permissionTabMembers={},window.permissionTabTags=e.data.permissionTags,e.data.membersTag.forEach(function(e){window.permissionTabMembers[e.id]=e}))}).catch(function(e){console.error("Erro ao buscar dados de permissões:",e)});var n=setInterval(function(){var e=window.permissionTabMembers;(e?Object.keys(e).length:0)>0&&(clearInterval(n),r())},200);setTimeout(function(){clearInterval(n),r()},2e4)}function r(){document.querySelectorAll(".open-offcanvas-btn").forEach(function(e){var t,n=e.cloneNode(!0);null===(t=e.parentNode)||void 0===t||t.replaceChild(n,e),n.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var t=this.getAttribute("data-id");if(t){var n=window.permissionTabMembers;if(n&&n[t]){var r=document.getElementById("overlay"),a=document.getElementById("customOffcanvas");if(r&&a){var o=n[t],i=document.getElementById("offcanvasAvatar");if(i){var s=o.avatar?"/uploads/photos/".concat(o.avatar):"/images/user-default.png";i.style.backgroundImage="url(".concat(s,")")}var l=document.getElementById("offcanvasName"),c=document.getElementById("offcanvasEmail"),u=document.getElementById("offcanvasRole"),f=document.getElementById("offcanvasStatus"),m=document.getElementById("offcanvasIsRegistered");l&&(l.textContent=o.name||"Não informado"),c&&(c.textContent=o.email||"Não informado"),u&&(u.textContent=o.role||"Sem função atribuída"),f&&(f.className="status-indicator "+(o.active?"active":"inactive")),m&&(m.textContent=o.isRegistered?"Membro Registrado":"Membro Não Registrado");var p=document.getElementById("offcanvasTeams");if(p&&(p.innerHTML="",o.compiled_teams))for(var h=0,v=Object.entries(o.compiled_teams);h<v.length;h++){var b=d(v[h],2),y=(b[0],b[1]),g=document.createElement("span");g.className="team-tag",g.textContent=y,p.appendChild(g)}"function"==typeof window.renderGlobalPermission&&window.renderGlobalPermission(o),"function"==typeof window.renderCustomPermissions&&window.renderCustomPermissions(o),r.style.display="block",a.classList.add("open"),document.body.classList.add("no-scroll"),setTimeout(function(){!function(e){window.positionDropdown=function(e,t){if(e&&t)try{e.style.position="absolute",e.style.top="100%",e.style.right="0",e.style.left="auto",e.style.zIndex="2100",e.style.marginTop="5px"}catch(e){}},window.positionOffcanvasDropdown=function(e,t){if(e&&t)try{e.style.position="absolute",e.style.right="0",e.style.top="100%",e.style.left="auto",e.style.zIndex="2100",e.style.marginTop="5px"}catch(e){}},setTimeout(function(){var t=document.querySelector('#offcanvasGlobalTagPermission button[data-bs-toggle="dropdown"]');if(t||(t=document.querySelector("#offcanvasGlobalTagPermission .tag")),t){var n,r=t.cloneNode(!0);null===(n=t.parentNode)||void 0===n||n.replaceChild(r,t),r.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation();var n=this.nextElementSibling;if(n){var r=n.classList.contains("show");document.querySelectorAll("#customOffcanvas .permissions-dropdown-menu.show").forEach(function(e){e!==n&&e.classList.remove("show")}),n.classList.toggle("show"),n.style.position="absolute",n.style.right="0",n.style.top="100%",n.style.left="auto",n.style.zIndex="2100",n.style.display="block",r||setTimeout(function(){!function(e,t){var n=e.querySelectorAll(".change-permission-global, .dropdown-item");n.forEach(function(n){var r,a=n.cloneNode(!0);null===(r=n.parentNode)||void 0===r||r.replaceChild(a,n),a.addEventListener("click",function(n){var r;n.preventDefault(),n.stopPropagation();var a=this.getAttribute("data-member-id")||t.id,o=this.getAttribute("data-permission-id"),i=(null===(r=this.textContent)||void 0===r?void 0:r.trim())||this.getAttribute("data-permission-name"),s=this.getAttribute("data-permission-color")||this.style.backgroundColor,l=this.getAttribute("data-permission-letter-color")||this.style.color,c=e.previousElementSibling;"function"==typeof window.showSuccessConfirmationModal&&window.showSuccessConfirmationModal("Confirmação de Alteração da Tag de Permissão Global","Essa alteração será aplicada a todos os produtos associados.<br>Você tem certeza?","Confirmar",function(){"function"==typeof window.updateGlobalPermission&&c&&(window.updateGlobalPermission(a,o,c,i,s,l),setTimeout(function(){window.dispatchEvent(new CustomEvent("permissionUpdated"))},1e3))}),e.classList.remove("show")})})}(n,e)},50)}})}},200),setTimeout(function(){document.querySelectorAll("#customPermissionsList .dropdown-toggle").forEach(function(e){var t,n=e.cloneNode(!0);null===(t=e.parentNode)||void 0===t||t.replaceChild(n,e),n.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var t=this.nextElementSibling;if(t){t.classList.contains("show");document.querySelectorAll("#customOffcanvas .permissions-dropdown-menu.show").forEach(function(e){e!==t&&e.classList.remove("show")}),t.classList.toggle("show"),t.style.position="absolute",t.style.right="0",t.style.top="100%",t.style.left="auto",t.style.zIndex="2100"}})}),document.querySelectorAll("#customOffcanvas .change-permission").forEach(function(e){var t,n=e.cloneNode(!0);null===(t=e.parentNode)||void 0===t||t.replaceChild(n,e),n.addEventListener("click",function(e){var t;e.preventDefault(),e.stopPropagation();var n=this.getAttribute("data-member-id"),r=this.getAttribute("data-product-id"),a=this.getAttribute("data-permission-id"),o=this.getAttribute("data-permission-name"),i=this.getAttribute("data-permission-color"),s=this.getAttribute("data-permission-letter-color"),l=null===(t=this.closest(".dropdown"))||void 0===t?void 0:t.querySelector("button");l&&"function"==typeof window.updateCustomPermission&&(window.updateCustomPermission(n,r,a,l,o,i,s),setTimeout(function(){window.dispatchEvent(new CustomEvent("customPermissionUpdated"))},1e3));var c=this.closest(".permissions-dropdown-menu");c&&c.classList.remove("show")})})},100);var t=function(e){e.target.closest("#customOffcanvas .permissions-manager")||document.querySelectorAll("#customOffcanvas .permissions-dropdown-menu.show").forEach(function(e){e.classList.remove("show")})};document.removeEventListener("click",t),document.addEventListener("click",t)}(o)},300)}}else"function"==typeof window.loadGoalsPermissionData&&(window.loadGoalsPermissionData(),setTimeout(function(){var e,n,r;null!==(e=window.permissionTabMembers)&&void 0!==e&&e[t]&&(null===(n=(r=window).openOffcanvas)||void 0===n||n.call(r,t))},1500))}})});var e=document.getElementById("closeOffcanvas"),t=document.getElementById("overlay");if(e){var n,r=e.cloneNode(!0);null===(n=e.parentNode)||void 0===n||n.replaceChild(r,e),r.addEventListener("click",function(){var e=document.getElementById("customOffcanvas"),t=document.getElementById("overlay");e&&e.classList.remove("open"),t&&(t.style.display="none"),document.body.classList.remove("no-scroll")})}if(t){var a,o=t.cloneNode(!0);null===(a=t.parentNode)||void 0===a||a.replaceChild(o,t),o.addEventListener("click",function(){var e=document.getElementById("customOffcanvas");e&&e.classList.remove("open"),this.style.display="none",document.body.classList.remove("no-scroll")})}}},1e3))})}},[i]),n||!t.canView?(0,r.jsxs)("div",{className:"alert alert-danger m-3",role:"alert",children:[(0,r.jsxs)("h4",{className:"alert-heading",children:[(0,r.jsx)("i",{className:"fas fa-ban me-2"}),"Acesso Negado"]}),(0,r.jsx)("p",{children:"Você não tem permissão para visualizar as permissões deste produto."}),(0,r.jsx)("hr",{}),(0,r.jsxs)("p",{className:"mb-0",children:[(0,r.jsx)("strong",{children:"Permissões necessárias:"})," Visualizar"]})]}):i?(0,r.jsx)("div",{ref:e,dangerouslySetInnerHTML:{__html:i||""}}):(0,r.jsxs)("div",{className:"alert alert-danger m-3",role:"alert",children:[(0,r.jsxs)("h4",{className:"alert-heading",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-triangle me-2"}),"Erro ao renderizar permissões"]}),(0,r.jsx)("p",{className:"mb-0",children:"Conteúdo de permissões não encontrado no template da página."})]})}},42328(e,t,n){"use strict";n.d(t,{A:()=>h});n(52675),n(89463),n(2259),n(28706),n(50113),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(26910),n(23288),n(62010),n(9868),n(26099),n(27495),n(38781),n(31415),n(21699),n(47764),n(62953);var r=n(74848),a=n(8194),o=n(46539),i=n(28482),s=n(69107),l=n(69786),c=n(77984),u=n(23495),d=n(45721);function f(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var p=function(e){var t=e.active,n=e.payload,a=e.label;if(t&&n&&n.length){var o,i=null===(o=n[0])||void 0===o?void 0:o.payload,s=(null==i?void 0:i.label)||"Período ".concat(a);return(0,r.jsxs)("div",{style:{backgroundColor:"rgba(255, 255, 255, 0.95)",border:"1px solid #ccc",borderRadius:"6px",padding:"6px 10px",boxShadow:"0 1px 4px rgba(0,0,0,0.1)",fontSize:"11px",lineHeight:"1.4",minWidth:"auto",maxWidth:"180px"},children:[(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:"3px",fontSize:"11px",color:"#333"},children:s}),n.map(function(e,t){var n;return(0,r.jsxs)("div",{style:{margin:"2px 0",color:e.color,fontSize:"10px"},children:[e.name,": ",(0,r.jsxs)("strong",{children:[null===(n=e.value)||void 0===n?void 0:n.toFixed(1),"h"]})]},t)})]})}return null};function h(e){var t,n,m=e.selectedFilters,h=e.timesheetData,v=e.attendanceData,b=m.includes("timesheet"),y=m.includes("attendance"),g="Período";switch((null===(t=h[0])||void 0===t?void 0:t.type)||(null===(n=v[0])||void 0===n?void 0:n.type)||"day"){case"day":g="Dia do Mês";break;case"week":g="Semana";break;case"month":g="Mês"}var x=[].concat(f(h.map(function(e){return e.period})),f(v.map(function(e){return e.period}))),j=Array.from(new Set(x)).sort(function(e,t){return e-t}).map(function(e){var t=h.find(function(t){return t.period===e}),n=v.find(function(t){return t.period===e}),r=(null==t?void 0:t.label)||(null==n?void 0:n.label)||"".concat(e);return{period:e,label:r,timesheetHours:t?t.hours:0,attendanceHours:n?n.hours:0}}),w=Math.max.apply(Math,f(j.map(function(e){return Math.max(e.timesheetHours,e.attendanceHours)})).concat([10])),S=[0,10*Math.ceil(w/10)],N=Array.from({length:4},function(e,t){return Math.round(S[1]/3*t)});return(0,r.jsx)("div",{style:{userSelect:"none",transform:"none",transition:"none"},children:(0,r.jsx)(i.u,{width:"100%",height:300,style:{transform:"none"},children:(0,r.jsxs)(d.b,{data:j,margin:{top:10,right:30,left:0,bottom:30},style:{cursor:"default"},onMouseMove:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},onMouseDown:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},onMouseUp:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},onClick:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},children:[(0,r.jsx)(s.d,{strokeDasharray:"3 3",stroke:"#E0E0E0"}),(0,r.jsx)(c.W,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:11},angle:j.length>15?-45:0,textAnchor:j.length>15?"end":"middle",height:j.length>15?60:40,interval:j.length>20?Math.floor(j.length/15):0,label:{value:g,position:"insideBottom",offset:j.length>15?-20:-5,style:{fill:"#5C5D5D",fontSize:12}}}),(0,r.jsx)(u.h,{ticks:N,domain:S,axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:12},tickFormatter:function(e){return"".concat(e,"h")},label:{value:"Horas Trabalhadas",angle:-90,position:"insideLeft",style:{textAnchor:"middle",fill:"#5C5D5D",fontSize:12,fontWeight:600}}}),(0,r.jsx)(o.m,{content:(0,r.jsx)(p,{})}),(0,r.jsx)(a.s,{verticalAlign:"bottom",height:36,iconType:"line",wrapperStyle:{paddingTop:"20px",fontSize:"12px"},formatter:function(e){return(0,r.jsx)("span",{style:{color:"#5C5D5D",fontSize:"12px"},children:e})}}),b&&(0,r.jsx)(l.N1,{type:"monotone",dataKey:"timesheetHours",name:"Por Timesheet",stroke:"#186073",strokeWidth:2,dot:{fill:"#FFFFFF",r:4,stroke:"#186073",strokeWidth:2},activeDot:{r:5,fill:"#FFFFFF",stroke:"#186073",strokeWidth:2},isAnimationActive:!1}),y&&(0,r.jsx)(l.N1,{type:"monotone",dataKey:"attendanceHours",name:"Por Registro de Ponto",stroke:"#17A1B7",strokeWidth:2,dot:{fill:"#FFFFFF",r:4,stroke:"#17A1B7",strokeWidth:2},activeDot:{r:5,fill:"#FFFFFF",stroke:"#17A1B7",strokeWidth:2},isAnimationActive:!1})]})})})}},42415(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>x});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(34782),n(89572),n(23288),n(94170),n(62010),n(2892),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(23500),n(62953),n(76031),n(3296),n(27208),n(48408);var r=n(74848),a=n(97665),o=n(57097),i=n(49785),s=n(34595),l=n(96540),c=n(1806);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return h(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(h(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,h(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,h(d,"constructor",c),h(c,"constructor",l),l.displayName="GeneratorFunction",h(c,a,"GeneratorFunction"),h(d),h(d,a,"Generator"),h(d,r,function(){return this}),h(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:o,m:f}})()}function h(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}h=function(e,t,n,r){function o(t,n){h(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},h(e,t,n,r)}function v(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var g=["time-management","qrcodes"];function x(e){var t=e.show,u=e.onClose,d=e.editData,m=(0,a.jE)(),h=!!d,y=b((0,l.useState)(!1),2),x=y[0],j=y[1],w=b((0,l.useState)(null),2),S=w[0],N=w[1],k=(0,i.mN)({defaultValues:{name:"",description:"",type:"qrcode",temporary:!1,requireLogin:!1,startDate:"",startTime:"",endDate:"",endTime:""}}),C=k.register,O=k.handleSubmit,A=k.watch,E=k.setValue,P=k.reset;k.formState.errors;(0,l.useEffect)(function(){d&&(E("name",d.name),E("description",d.description||""),E("type",d.type),E("temporary",d.temporary),E("requireLogin",d.requireLogin),E("startDate",d.startDate||""),E("startTime",d.startTime||""),E("endDate",d.endDate||""),E("endTime",d.endTime||""))},[d,E]);var F=A("type"),T=A("name"),D=A("temporary"),_=(0,o.n)({mutationFn:function(e){var t={name:e.name,description:e.description||"",type:e.type,temporary:e.temporary,requireLogin:e.requireLogin,startDate:e.temporary?e.startDate:void 0,startTime:e.temporary?e.startTime:void 0,endDate:e.temporary?e.endDate:void 0,endTime:e.temporary?e.endTime:void 0};return h&&null!=d&&d.id?(0,s.og)(d.id,t):(0,s.Pg)(t)},onSuccess:function(e){m.invalidateQueries({queryKey:g}),N(e),j(!0)}}),I=function(){j(!1),N(null),P(),u()},M=function(){var e,t=(e=p().m(function e(){var t,r,a,o,i,s,l;return p().w(function(e){for(;;)switch(e.p=e.n){case 0:if(null==S||!S.url||"qrcode"!==S.type){e.n=8;break}return e.p=1,e.n=2,n.e(583).then(n.t.bind(n,87583,19));case 2:return t=e.v,e.n=3,t.toDataURL(S.url,{width:512,margin:2,color:{dark:"#000000",light:"#FFFFFF"},errorCorrectionLevel:"H"});case 3:return r=e.v,e.n=4,fetch(r);case 4:return a=e.v,e.n=5,a.blob();case 5:o=e.v,i=window.URL.createObjectURL(o),(s=document.createElement("a")).href=i,s.download="".concat(S.name||"qrcode",".png"),document.body.appendChild(s),s.click(),setTimeout(function(){document.body.removeChild(s),window.URL.revokeObjectURL(i)},100),e.n=7;break;case 6:e.p=6,l=e.v,console.error("Erro ao baixar QR Code:",l),alert("Erro ao gerar QR Code para download");case 7:e.n=9;break;case 8:null!=S&&S.url&&"link"===S.type&&(navigator.clipboard.writeText(S.url),alert("Link copiado para a área de transferência!"));case 9:return e.a(2)}},e,null,[[1,6]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){v(o,r,a,i,s,"next",e)}function s(e){v(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}();return x?(0,r.jsx)(c.A,{show:t,onClose:I,title:"Gerador",size:"md",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:I,children:"Cancelar"}),(0,r.jsx)("button",{type:"button",className:"btn text-white px-4",style:{backgroundColor:"#17a2b8"},onClick:I,children:"Feito"})]}),children:(0,r.jsxs)("div",{className:"text-center",style:{padding:"40px"},children:[(0,r.jsx)("h3",{className:"mb-4",style:{color:"#666",fontWeight:600},children:"Prontinho!"}),(0,r.jsxs)("div",{className:"p-5 mb-3",style:{border:"2px dashed #ddd",borderRadius:"12px",backgroundColor:"#fafafa",cursor:"pointer"},onClick:M,children:[(0,r.jsx)("i",{className:"fas fa-qrcode",style:{fontSize:"4rem",color:"#ccc",marginBottom:"20px"}}),(0,r.jsx)("h5",{className:"font-weight-bold mb-2",children:"qrcode"===F?"QR Code Gerado com Sucesso!":"Link Gerado com Sucesso!"}),(0,r.jsx)("p",{className:"text-muted mb-0",children:"Clique aqui para fazer o download"})]})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.A,{show:t,onClose:u,title:"Gerador",size:"md",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:u,children:"Cancelar"}),(0,r.jsx)("button",{type:"submit",form:"qrcodeForm",className:"btn text-white px-4",style:{backgroundColor:"#17a2b8"},disabled:_.isPending||!T,children:_.isPending?(0,r.jsx)("i",{className:"fas fa-spinner fa-spin"}):"Gerar ".concat("qrcode"===F?"QR Code":"Link")})]}),children:(0,r.jsxs)("form",{id:"qrcodeForm",onSubmit:O(function(e){_.mutate(e)}),children:[(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark mb-3",children:"Gerar"}),(0,r.jsxs)("div",{className:"d-flex",children:[(0,r.jsxs)("div",{className:"form-check mr-4",children:[(0,r.jsx)("input",f(f({className:"form-check-input",type:"radio",value:"qrcode"},C("type",{required:!0})),{},{id:"typeQRCode"})),(0,r.jsx)("label",{className:"form-check-label",htmlFor:"typeQRCode",children:"QR Code"})]}),(0,r.jsxs)("div",{className:"form-check",children:[(0,r.jsx)("input",f(f({className:"form-check-input",type:"radio",value:"link"},C("type",{required:!0})),{},{id:"typeLink"})),(0,r.jsx)("label",{className:"form-check-label",htmlFor:"typeLink",children:"Link"})]})]})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsxs)("label",{className:"font-weight-normal text-dark",children:["Nome do ","qrcode"===F?"QR Code":"Link"]}),(0,r.jsx)("input",f({type:"text",className:"form-control",placeholder:"Digite o nome do ".concat("qrcode"===F?"QR Code":"Link")},C("name",{required:!0})))]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Descrição"}),(0,r.jsx)("textarea",f({className:"form-control",rows:3,placeholder:"Detalhe mais informações sobre esse ".concat("qrcode"===F?"QR Code":"Link")},C("description")))]}),(0,r.jsx)("hr",{className:"my-4"}),(0,r.jsx)("div",{className:"form-group",children:(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark mb-0",children:"Necessário login para validação?"}),(0,r.jsx)("i",{className:"far fa-question-circle ml-2 text-muted",style:{fontSize:"0.9rem"},"data-toggle":"tooltip","data-placement":"top",title:"Se ativado, o usuário precisará estar logado para bater ponto"})]}),(0,r.jsxs)("label",{className:"switch mb-0",children:[(0,r.jsx)("input",f({type:"checkbox"},C("requireLogin"))),(0,r.jsx)("span",{className:"slider round"})]})]})}),(0,r.jsx)("div",{className:"form-group",children:(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark mb-0",children:"Gerar Temporariamente?"}),(0,r.jsxs)("label",{className:"switch mb-0",children:[(0,r.jsx)("input",f({type:"checkbox"},C("temporary"))),(0,r.jsx)("span",{className:"slider round"})]})]})}),D&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Período de Início"}),(0,r.jsx)("input",f({type:"date",className:"form-control",placeholder:"dd/mm/aaaa"},C("startDate",{required:D})))]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:" "}),(0,r.jsx)("input",f({type:"time",className:"form-control",placeholder:"Horas"},C("startTime",{required:D})))]})})]}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Período de Finalização"}),(0,r.jsx)("input",f({type:"date",className:"form-control",placeholder:"dd/mm/aaaa"},C("endDate",{required:D})))]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:" "}),(0,r.jsx)("input",f({type:"time",className:"form-control",placeholder:"Horas"},C("endTime",{required:D})))]})})]})]})]})}),(0,r.jsx)("style",{children:'\n .switch {\n position: relative;\n display: inline-block;\n width: 50px;\n height: 24px;\n }\n\n .switch input {\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n .slider {\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n transition: .4s;\n }\n\n .slider:before {\n position: absolute;\n content: "";\n height: 18px;\n width: 18px;\n left: 3px;\n bottom: 3px;\n background-color: white;\n transition: .4s;\n }\n\n input:checked + .slider {\n background-color: #17a2b8;\n }\n\n input:checked + .slider:before {\n transform: translateX(26px);\n }\n\n .slider.round {\n border-radius: 24px;\n }\n\n .slider.round:before {\n border-radius: 50%;\n }\n '})]})}},43432(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>w});n(23792),n(26099),n(31415),n(47764),n(62953);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(96540),l=n(19782),c=n(7440),u=n(52798),d=n(26071),f=n(46265),m=n(93794),p=n(95226),h=n(47034),v=n(55801),b=n(19619),y=n(17147),g=n(70038),x=n(55278),j=n(50860);function w(){var e,t=(0,o.jE)(),n=(0,a.I)({queryKey:["time-management","validation"],queryFn:v.G8,staleTime:6e4,refetchOnWindowFocus:!1}).data,w=n?b.c[n.mode]:null,S=(0,s.useMemo)(function(){var e;return new Set(null!==(e=null==n?void 0:n.others)&&void 0!==e?e:[])},[n]),N="flex"===w||"manual"===w&&S.has("geolocation"),k="flex"===w||"qr"===w||"manual"===w&&S.has("qrcode"),C=(0,a.I)({queryKey:["time-management","work-shifts"],queryFn:g.hY,staleTime:6e4,refetchOnWindowFocus:!1}).data,O=void 0===C?[]:C,A=(e=null==O?void 0:O.length,(0,a.I)({queryKey:["time-management","can-view-maps"],queryFn:x.vD,staleTime:6e4,refetchOnWindowFocus:!1}).data),E=void 0!==A&&A,P=(0,i.n)({mutationFn:function(e){return(0,x.xD)(e)},onSuccess:function(e){t.setQueryData(["time-management","can-view-maps"],e)}});return(0,r.jsxs)(j.A,{children:[(0,r.jsx)(f.default,{title:"Canais",subtitle:"Selecione os possíveis canais para registro do ponto.",helpTemplate:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner canais-tooltip-inner"></div></div>',help:"<p><strong>Aplicativo Móvel</strong><br/>Os membros da equipe devem utilizar o aplicativo oficial MetaHuman para iOS ou Android para registrar seus pontos. O registro de entrada e saída não é permitido por navegador móvel.</p>\n<p><strong>Navegador Web</strong><br/>Os membros podem acessar a plataforma MetaHuman através de navegadores em dispositivos autorizados para registrar o ponto, utilizando o ambiente web da empresa.</p>\n<p><strong>Link ou QR Code Gerado</strong><br/>Os membros poderão registrar o ponto utilizando um link ou QR Code disponibilizado pela empresa. O link pode ser configurado como fixo ou temporário e o acesso pode exigir login para validação de identidade.</p>\n<p><strong>Print da Tela</strong><br/>Quando o ponto é registrado através do navegador web, pode ser exigida a captura automática de uma imagem (print da tela) no momento do registro.</p>",children:(0,r.jsx)(l.default,{})}),(0,r.jsx)(f.default,{title:"Validação de Ponto",subtitle:"Defina quais validações serão exigidas para registrar o ponto.",help:"<p>Configura os níveis de segurança exigidos para validar o registro de ponto.</p>\n<p>Você pode escolher entre opções pré-configuradas (Essencial, Balanceada, Completa) ou montar uma configuração personalizada</p>",children:(0,r.jsx)(m.default,{})}),(0,r.jsx)(f.default,{title:"Turnos de Trabalho",help:"<p>Configura os diferentes turnos que os colaboradores podem seguir (ex: comercial, noturno, revezamento). Cada turno tem um horário definido de entrada, saída e, opcionalmente, intervalo.</p>\n<p>Fundamental para cruzar com as marcações e identificar atrasos, horas extras ou faltas.</p>",children:(0,r.jsx)(p.default,{})}),N&&(0,r.jsx)(f.default,{title:"Cadastrar Localização",help:"<p>Permite definir endereços autorizados onde o colaborador poderá bater o ponto.</p>\n<p>O sistema usa geolocalização para validar se o registro foi feito dentro do local cadastrado. Exemplo: sede da empresa, filiais, postos de trabalho externos.</p>",right:(0,r.jsx)("button",{type:"button",className:"btn btn-link p-0",onClick:function(){P.mutate(!E)},disabled:P.isPending,title:E?"Ocultar mapas":"Mostrar mapas",style:{fontSize:"1.2rem",color:"#6c757d",transition:"transform 0.3s ease",transform:E?"rotate(90deg)":"rotate(0deg)"},children:P.isPending?(0,r.jsx)("i",{className:"fas fa-spinner fa-spin"}):(0,r.jsx)("i",{className:"fas fa-chevron-right"})}),children:(0,r.jsx)(y.LocationSection,{})}),k&&(0,r.jsx)(f.default,{title:"Cadastrar QR Code/Link",help:"<p>Permite criar QR Codes ou links para facilitar o registro de ponto em locais específicos. Ideal para times em campo, eventos, ou estações fixas.</p>",children:(0,r.jsx)(h.default,{})}),(0,r.jsx)(f.default,{title:"Política de Ponto",help:"<p>O sistema contabiliza o tempo de adiantamento ou atraso apenas após ultrapassado o tempo de tolerância definido.</p><p>Dentro do limite estabelecido, o registro é considerado normal, sem impactar o saldo de horas ou gerar ocorrências automáticas.</p>",children:(0,r.jsx)(u.default,{})}),(0,r.jsx)(f.default,{title:"Limite de Horas no Timesheet",help:"<p>Controla o limite de horas que podem ser registradas no timesheet por dia.</p><p>Quando ativado, o sistema impedirá que os colaboradores registrem mais horas que o limite estabelecido em uma única atividade diária.</p><p>Ideal para controlar horas extras e evitar registros excessivos.</p>",children:(0,r.jsx)(d.default,{})}),(0,r.jsx)(f.default,{title:"Notificações",help:"<p>Configura alertas automáticos enviados para o colaborador.</p>",children:(0,r.jsx)(c.default,{})})]})}},46265(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>l});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23792),n(89572),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(47764),n(23500),n(62953);var r=n(74848);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=a(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==a(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=e.title,n=e.subtitle,a=e.help,o=e.helpTemplate,s=e.right,l=e.children;return(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsxs)("div",{className:"card-body",children:[(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("h3",{className:"card-title mb-0",children:t}),a&&(0,r.jsx)("span",i(i({className:"text-muted ml-2","data-toggle":"tooltip","data-placement":"auto","data-html":"true",title:a},o?{"data-template":o}:{}),{},{children:(0,r.jsx)("i",{className:"far fa-question-circle"})}))]}),s&&(0,r.jsx)("div",{className:"ml-3",children:s})]}),n&&(0,r.jsx)("div",{className:"text-muted mt-1",children:n})]}),l]})})}},46550(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>i});n(28706),n(2008),n(62062),n(26099);var r=n(74848);function a(e){var t=e.color;return(0,r.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"9",cy:"5",r:"3",stroke:t,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M5 16C5 13.7909 6.79086 12 9 12C11.2091 12 13 13.7909 13 16V19H5V16Z",stroke:t,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M15 12L19 12M19 12L17 10M19 12L17 14",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function o(e){var t=e.color;return(0,r.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{x:"3",y:"5",width:"12",height:"10",rx:"1",stroke:t,strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("path",{d:"M6 15L6 17L12 17L12 15",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M16 10L20 10M20 10L18 8M20 10L18 12",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function i(e){var t=e.rows,n=t.filter(function(e){return!e.muted}).length,i=t.length,s=n/i*100;return(0,r.jsxs)("div",{className:"mobile-timeline",style:{padding:"20px",position:"relative",minHeight:"400px"},children:[(0,r.jsx)("div",{style:{position:"absolute",left:"28px",top:"24px",width:"4px",height:"350px",backgroundColor:"#E5E7EB",borderRadius:"2px",zIndex:1}}),(0,r.jsx)("div",{style:{position:"absolute",left:"28px",top:"24px",width:"4px",height:"".concat(s/100*350,"px"),backgroundColor:"#17A2B8",borderRadius:"2px",zIndex:2,transition:"height 0.3s ease-in-out"}}),t.map(function(e,t){var n=!e.muted,a=24+t*(350/(i-1));return(0,r.jsx)("div",{style:{position:"absolute",left:"24px",top:"".concat(a-6,"px"),width:"12px",height:"12px",borderRadius:"50%",backgroundColor:n?"#17A2B8":"#E5E7EB",zIndex:3}},"bullet-".concat(t))}),t.map(function(e,n){var i=n%2==0,s=e.muted?"#9ca3af":"#5C5D5D",l=n===t.length-1;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px",marginBottom:l?"0":"60px",position:"relative",paddingLeft:"48px"},children:[(0,r.jsx)("div",{style:{width:"28px",height:"28px",minWidth:"28px",display:"flex",alignItems:"center",justifyContent:"center"},children:i?(0,r.jsx)(a,{color:s}):(0,r.jsx)(o,{color:s})}),(0,r.jsxs)("div",{style:{flex:1,paddingTop:"2px"},children:[(0,r.jsx)("div",{style:{fontSize:"15px",fontWeight:e.muted?400:500,color:e.muted?"#9CA3AF":"#5C5D5D",fontFamily:"Inter",lineHeight:"1.5",marginBottom:"2px"},children:e.label}),!e.muted&&(e.device||e.mode)&&(0,r.jsx)("div",{style:{fontSize:"11px",color:"#9CA3AF",fontFamily:"Inter",fontWeight:400},children:e.device&&e.mode?"".concat(e.device.toLowerCase()," - ").concat(e.mode.toLowerCase()):(e.device||e.mode||"").toLowerCase()})]})]},n)})]})}},47034(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>b});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(25440),n(11392),n(62953),n(76031),n(3296),n(27208),n(48408);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(34595),l=n(96540),c=n(42415),u=n(76336);function d(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return f(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),m=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return l.prototype=c,f(m,"constructor",c),f(c,"constructor",l),l.displayName="GeneratorFunction",f(c,a,"GeneratorFunction"),f(m),f(m,a,"Generator"),f(m,r,function(){return this}),f(m,"toString",function(){return"[object Generator]"}),(d=function(){return{w:o,m:p}})()}function f(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function m(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=["time-management","qrcodes"];function b(){var e=(0,u.L)(),t=e.canCreate,f=e.canEdit,h=e.canDelete,b=p((0,l.useState)(!1),2),y=b[0],g=b[1],x=p((0,l.useState)(null),2),j=x[0],w=x[1],S=(0,o.jE)(),N=(0,l.useRef)(null),k=(0,l.useRef)(null),C=p((0,l.useState)(0),2),O=C[0],A=C[1],E=(0,a.I)({queryKey:v,queryFn:s.k1}),P=E.data,F=void 0===P?[]:P,T=E.isFetching,D=(0,i.n)({mutationFn:s.uQ,onSuccess:function(){S.invalidateQueries({queryKey:v})}}),_=(0,i.n)({mutationFn:s.SP,onSuccess:function(){S.invalidateQueries({queryKey:v})}}),I=function(){var e,t=(e=d().m(function e(t){var r,a,o,i,s,l,c,u;return d().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!t.url||"qrcode"!==t.type){e.n=7;break}return e.p=1,e.n=2,n.e(583).then(n.t.bind(n,87583,19));case 2:return r=e.v,a=t.url.startsWith("/")?"".concat(window.location.origin).concat(t.url):t.url,e.n=3,r.toDataURL(a,{width:512,margin:2,color:{dark:"#000000",light:"#FFFFFF"},errorCorrectionLevel:"H"});case 3:return o=e.v,e.n=4,fetch(o);case 4:return i=e.v,e.n=5,i.blob();case 5:s=e.v,l=window.URL.createObjectURL(s),(c=document.createElement("a")).href=l,c.download="".concat(t.name||"qrcode",".png"),document.body.appendChild(c),c.click(),setTimeout(function(){document.body.removeChild(c),window.URL.revokeObjectURL(l)},100),e.n=7;break;case 6:e.p=6,u=e.v,console.error("Erro ao baixar QR Code:",u),alert("Erro ao gerar QR Code para download");case 7:return e.a(2)}},e,null,[[1,6]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){m(o,r,a,i,s,"next",e)}function s(e){m(o,r,a,i,s,"throw",e)}i(void 0)})});return function(e){return t.apply(this,arguments)}}(),M=(0,l.useMemo)(function(){return 0===F.length},[F]);(0,l.useEffect)(function(){var e=function(){if(N.current&&k.current){var e=N.current.getBoundingClientRect(),t=k.current.getBoundingClientRect();A(t.left-e.left+t.width/2)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[F]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{children:"\n .qrcode-list-container { overflow: visible !important; overflow-x: visible !important; overflow-y: visible !important; }\n .qrcode-list-container .card { overflow: visible !important; }\n .qrcode-list-container .card-body { overflow: visible !important; }\n .qrcode-list-container .row { overflow: visible !important; }\n @media (max-width: 768px) {\n .qrcode-actions { position: absolute; top: 10px; right: 10px; }\n }\n "}),(0,r.jsx)("div",{className:"position-relative",children:!M&&(0,r.jsx)("div",{style:{position:"absolute",top:-28,left:O,transform:"translateX(-50%)"},className:"text-muted d-none d-md-block",children:"Status"})}),!M&&(0,r.jsx)("div",{className:"mb-3 qrcode-list-container",ref:N,style:{overflow:"visible"},children:F.map(function(e){var t=function(e){if(!e.temporary)return{label:"Ativo",color:"#28a745"};var t=e.endDate?new Date("".concat(e.endDate,"T").concat(e.endTime||"23:59",":00")):null;return t&&new Date>t?{label:"Encerrado",color:"#dc3545"}:{label:"Ativo",color:"#28a745"}}(e);return(0,r.jsx)("div",{className:"card mb-3",style:{border:"1px solid #e0e0e0",borderRadius:"8px",position:"relative",overflow:"visible"},children:(0,r.jsx)("div",{className:"card-body py-3",style:{overflow:"visible"},children:(0,r.jsxs)("div",{className:"row no-gutters align-items-center",style:{overflow:"visible"},children:[(0,r.jsx)("div",{className:"col-auto pr-2 d-flex align-items-center justify-content-center",style:{width:"40px",height:"40px"},children:(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-center bg-primary-soft rounded",style:{width:"40px",height:"40px"},children:"link"===e.type?(0,r.jsx)("i",{className:"fas fa-link text-primary",style:{fontSize:"1.1rem"}}):(0,r.jsx)("i",{className:"fas fa-qrcode text-primary",style:{fontSize:"1.1rem"}})})}),(0,r.jsx)("div",{className:"col-12 col-md-3 px-2 d-flex",style:{minWidth:0},children:(0,r.jsxs)("div",{className:"d-flex flex-column w-100 my-auto",style:{minWidth:0},children:[(0,r.jsx)("span",{className:"font-weight-bold text-truncate",style:{minWidth:0},children:e.name}),"spaces_control"===e.source&&(0,r.jsxs)("small",{className:"text-info",style:{fontSize:"0.75rem"},children:[(0,r.jsx)("i",{className:"fas fa-building mr-1"}),e.buildingName," - ",e.floorName]})]})}),(0,r.jsx)("div",{className:"col-12 col-md-6 px-2 d-flex",style:{minWidth:0},children:(0,r.jsx)("div",{className:"w-100 my-auto text-muted text-truncate text-center",style:{minWidth:0},children:e.description||("spaces_control"===e.source?"QR Code do Controle de Espaços":"")})}),(0,r.jsx)("div",{ref:k,className:"col-auto px-2 d-flex align-items-center",style:{flexShrink:0},children:(0,r.jsx)("span",{className:"badge",style:{backgroundColor:"#f8f9fa",color:t.color,border:"1px solid ".concat(t.color),padding:"6px 10px"},children:t.label})}),(0,r.jsxs)("div",{className:"col-auto pl-2 dropdown qrcode-actions ml-auto",style:{flexShrink:0,position:"static"},children:[(0,r.jsx)("button",{className:"btn btn-link text-muted p-0","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",style:{fontSize:"1.2rem"},children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),(0,r.jsxs)("div",{className:"dropdown-menu dropdown-menu-right",children:[f&&"spaces_control"!==e.source&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(){return function(e){"spaces_control"!==e.source?(w(e),g(!0)):alert("Este QR Code foi criado no Controle de Espaços. Para editá-lo, acesse o módulo de Controle de Espaços.")}(e)},disabled:D.isPending,children:[(0,r.jsx)("i",{className:"far fa-edit mr-2"}),"Editar"]}),"qrcode"===e.type&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(){return I(e)},children:[(0,r.jsx)("i",{className:"fas fa-download mr-2"}),"Baixar QR Code"]}),"link"===e.type&&e.url&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(){navigator.clipboard.writeText(e.url),alert("Link copiado!")},children:[(0,r.jsx)("i",{className:"fas fa-copy mr-2"}),"Copiar Link"]}),h&&(0,r.jsxs)("button",{className:"dropdown-item text-danger",onClick:function(){return function(e){if(window.confirm('Tem certeza que deseja excluir "'.concat(e.name,'"?')))if("spaces_control"===e.source&&e.id.startsWith("floor-")){var t=e.id.replace("floor-","");_.mutate(t)}else D.mutate(e.id)}(e)},disabled:D.isPending||_.isPending,children:[(0,r.jsx)("i",{className:"far fa-trash-alt mr-2"}),D.isPending||_.isPending?"Excluindo...":"Excluir"]})]})]})]})})},e.id)})}),t&&(0,r.jsxs)("div",{className:"text-muted d-flex align-items-center",role:"button",onClick:function(){return g(!0)},style:{cursor:"pointer",fontSize:"0.95rem"},children:[(0,r.jsx)("i",{className:"fas fa-plus mr-2"})," Gerar",T&&(0,r.jsx)("i",{className:"fas fa-spinner fa-spin ml-2"})]}),y&&(0,r.jsx)(c.default,{show:y,onClose:function(){g(!1),w(null)},editData:j})]})}},47339(e,t,n){"use strict";n.d(t,{A:()=>s,o:()=>i});n(28706),n(76031);var r={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},a={success:"fas fa-check-circle",error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",info:"fas fa-info-circle"};function o(e){var t=e.title,n=e.message,o=e.type,i=e.duration,s=void 0===i?3e3:i,l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 20px;\n right: 20px;\n min-width: 300px;\n max-width: 500px;\n background: white;\n border-left: 4px solid ".concat(r[o],";\n border-radius: 4px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n padding: 16px 20px;\n z-index: 9999;\n font-family: 'Inter', sans-serif;\n animation: slideInRight 0.3s ease-out;\n "),l.innerHTML='\n <div style="display: flex; align-items: flex-start; gap: 12px;">\n <i class="'.concat(a[o],'" style="color: ').concat(r[o],'; font-size: 20px; margin-top: 2px;"></i>\n <div style="flex: 1;">\n ').concat(t?'<div style="font-weight: 600; font-size: 14px; color: #333; margin-bottom: 4px;">'.concat(t,"</div>"):"",'\n <div style="font-size: 13px; color: #666; line-height: 1.4;">').concat(n,'</div>\n </div>\n <button onclick="this.parentElement.parentElement.remove()" style="\n background: none;\n border: none;\n color: #999;\n font-size: 18px;\n cursor: pointer;\n padding: 0;\n margin-left: 8px;\n line-height: 1;\n ">×</button>\n </div>\n ');var c=document.createElement("style");c.textContent="\n @keyframes slideInRight {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n @keyframes slideOutRight {\n from {\n transform: translateX(0);\n opacity: 1;\n }\n to {\n transform: translateX(100%);\n opacity: 0;\n }\n }\n ",document.querySelector("style[data-notification-styles]")||(c.setAttribute("data-notification-styles","true"),document.head.appendChild(c)),document.body.appendChild(l),setTimeout(function(){l.style.animation="slideOutRight 0.3s ease-in",setTimeout(function(){l.remove()},300)},s)}var i={success:function(e,t){return o({message:e,type:"success",title:t})},error:function(e,t){return o({message:e,type:"error",title:t})},warning:function(e,t){return o({message:e,type:"warning",title:t})},warn:function(e,t){return o({message:e,type:"warning",title:t})},info:function(e,t){return o({message:e,type:"info",title:t})}};const s=i},48592(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>p});n(52675),n(89463),n(2259),n(50113),n(23418),n(64346),n(23792),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(88195),i=n(14463),s=n(47339),l=n(33384);function c(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return u(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(u(t={},r,function(){return this}),t),m=d.prototype=s.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,u(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return l.prototype=d,u(m,"constructor",d),u(d,"constructor",l),l.displayName="GeneratorFunction",u(d,a,"GeneratorFunction"),u(m),u(m,a,"Generator"),u(m,r,function(){return this}),u(m,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:p}})()}function u(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}u=function(e,t,n,r){function o(t,n){u(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},u(e,t,n,r)}function d(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){var t=e.activities,n=e.projetos,u=e.atividadesDisponiveis,m=e.currentDate,p=e.workloadHours,h=e.onActivityAdded,v=f((0,a.useState)(!1),2),b=v[0],y=v[1],g=f((0,a.useState)(null),2),x=g[0],j=g[1],w=f((0,a.useState)(null),2),S=w[0],N=w[1],k=f((0,a.useState)(null),2),C=k[0],O=k[1],A=f((0,a.useState)(""),2),E=A[0],P=A[1],F=f((0,a.useState)(""),2),T=F[0],D=F[1],_=f((0,a.useState)(""),2),I=_[0],M=_[1],R=f((0,a.useState)(""),2),z=R[0],L=R[1],q=function(){y(!1),j(null),N(null),O(null),P(""),D(""),M(""),L("")},B=function(){var e,t=(e=c().m(function e(t){var r,a,o,i;return c().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,l.submitActivityFromCard)(t,S,C,E,T,I,z,n,u,m,p);case 1:s.o.success("Atividade adicionada com sucesso!"),q(),h&&h(),e.n=3;break;case 2:e.p=2,i=e.v,console.error("Erro ao adicionar atividade a partir do planejamento:",i),o=(null==i||null===(r=i.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||(null==i||null===(a=i.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.error)||"Erro ao adicionar atividade",s.o.error(o);case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){d(o,r,a,i,s,"next",e)}function s(e){d(o,r,a,i,s,"throw",e)}i(void 0)})});return function(e){return t.apply(this,arguments)}}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsxs)("div",{className:"card-body",children:[(0,r.jsx)("h5",{className:"tm-section-title mb-2",children:"Atividades Planejadas"}),(0,r.jsx)(o.A,{columns:[{key:"projeto",label:"Projeto",width:"14%"},{key:"atividade",label:"Atividade",width:"14%"},{key:"inicio",label:"Início",width:"14%",align:"center"},{key:"fim",label:"Fim",width:"14%",align:"center"},{key:"percentDia",label:"% do dia",width:"14%",align:"center"},{key:"duracao",label:"Duração",width:"14%",align:"center"},{key:"acoes",label:"Ações",width:"14%",align:"center"}],data:t,renderRow:function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"ms-table-cell",title:e.projeto,children:e.projeto}),(0,r.jsx)("td",{className:"ms-table-cell",title:e.atividade,children:e.atividade}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.inicio}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.fim}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.percentDia}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.duracao}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:(0,r.jsx)("button",{className:"app-icon-button",onClick:function(){return function(e){var t,r,a,o,i=(0,l.findProjectByName)(e.projeto,n),s=(0,l.findActivityByName)(e.atividade,u);M(e.projeto),L(e.atividade),N(null!==(t=null==i?void 0:i.id)&&void 0!==t?t:null),O(null!==(r=null==s?void 0:s.id)&&void 0!==r?r:null),P(null!==(a=null==i?void 0:i.name)&&void 0!==a?a:""),D(null!==(o=null==s?void 0:s.name)&&void 0!==o?o:"");var c={startTime:e.inicio||"00:00",endTime:e.fim||"00:00",percentage:(0,l.extractPercentage)(e.percentDia),duration:(0,l.parseDurationToMinutes)(e.duracao),comment:""};j(c),y(!0)}(e)},title:"Registrar atividade planejada",children:(0,r.jsx)("i",{className:"fas fa-check ms-table-action-icon","aria-hidden":"true"})})})]})},emptyMessage:"Nenhuma atividade planejada para hoje"})]})}),(0,r.jsx)(i.default,{show:b,onClose:q,onSubmit:B,selectedProject:E||I,selectedActivity:T||z,workloadHours:p,prefilledData:x,allowProjectSelection:!0,projectOptions:n,activityOptions:u,selectedProjectId:S,selectedActivityId:C,suggestedProjectName:I,suggestedActivityName:z,onProjectChange:function(e){var t,r;if(null===e)return N(null),void P("");var a=n.find(function(t){return t.id===e});N(null!==(t=null==a?void 0:a.id)&&void 0!==t?t:null),P(null!==(r=null==a?void 0:a.name)&&void 0!==r?r:"")},onActivityChange:function(e){var t,n;if(null===e)return O(null),void D("");var r=u.find(function(t){return t.id===e});O(null!==(t=null==r?void 0:r.id)&&void 0!==t?t:null),D(null!==(n=null==r?void 0:r.name)&&void 0!==n?n:"")}})]})}},49293(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>y});n(52675),n(89463),n(2259),n(28706),n(50113),n(51629),n(23418),n(64346),n(23792),n(62062),n(72712),n(34782),n(23288),n(62010),n(2892),n(26099),n(58940),n(27495),n(38781),n(47764),n(71761),n(68156),n(23500),n(62953),n(76031);var r=n(74848),a=n(96540),o=n(33930),i=n(88195),s=n(14463),l=n(88821),c=n(39618),u=n(92268),d=n(59261),f=n(75842),m=n(81623),p=n(47339),h=n(96339);function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t=e.projetos,n=e.atividadesDisponiveis,b=e.activities,y=e.currentDate,g=e.workloadHours,x=(e.onActivityEdit,e.onActivityDelete,e.onActivityAction,e.onActivityAdded),j=v((0,a.useState)(""),2),w=j[0],S=j[1],N=v((0,a.useState)(""),2),k=N[0],C=N[1],O=v((0,a.useState)(""),2),A=O[0],E=O[1],P=v((0,a.useState)(!1),2),F=P[0],T=P[1],D=v((0,a.useState)("00:00:00"),2),_=D[0],I=D[1],M=v((0,a.useState)("automatico"),2),R=M[0],z=M[1],L=v((0,a.useState)(!1),2),q=L[0],B=L[1],G=v((0,a.useState)(null),2),H=G[0],W=G[1],U=v((0,a.useState)(null),2),V=U[0],Q=U[1],K=v((0,a.useState)({}),2),$=K[0],J=K[1],Y=v((0,a.useState)({}),2),Z=Y[0],X=Y[1],ee=v((0,a.useState)(null),2),te=ee[0],ne=ee[1],re=v((0,a.useState)(null),2),ae=re[0],oe=re[1],ie=v((0,a.useState)(null),2),se=ie[0],le=ie[1],ce=v((0,a.useState)(!1),2),ue=ce[0],de=ce[1],fe=(0,a.useRef)(null),me=(0,o.I)({queryKey:["time-management","policy"],queryFn:h.Z,staleTime:6e4}).data,pe=(0,a.useMemo)(function(){return b.reduce(function(e,t){var n=t.duracao.match(/(\d+)h?\s*(\d+)?/);return n?e+60*parseInt(n[1]||"0")+parseInt(n[2]||"0"):e},0)},[b]);(0,a.useEffect)(function(){var e={},t={};b.forEach(function(n){e[n.id]=(0,a.createRef)(),t[n.id]=(0,a.createRef)()}),J(e),X(t)},[b]),(0,a.useEffect)(function(){return function(){fe.current&&clearInterval(fe.current)}},[]);var he=function(){return w?!!k||(p.o.warn("Selecione uma atividade primeiro!"),!1):(p.o.warn("Selecione um projeto primeiro!"),!1)},ve=function(){if(he()){T(!0);var e=new Date;oe(e),fe.current=setInterval(function(){var t=(new Date).getTime()-e.getTime(),n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4),a=Math.floor(t%6e4/1e3);I("".concat(n.toString().padStart(2,"0"),":").concat(r.toString().padStart(2,"0"),":").concat(a.toString().padStart(2,"0")))},1e3)}},be=function(e){m.Z4.createActivity(e).then(function(){p.o.success("Atividade adicionada com sucesso!"),B(!1),ue&&(I("00:00:00"),oe(null),le(null),de(!1)),x&&x()}).catch(function(e){var t;if(console.error("Erro ao adicionar atividade:",e),422===(null===(t=e.response)||void 0===t?void 0:t.status)){var n,r,a,o=(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.message)||(null===(r=e.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.error)||"Limite de horas diárias excedido",i=null===(a=e.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.details;p.o.error(o),i&&console.warn("Detalhes do bloqueio:",i)}else{var s,l,c=(null===(s=e.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.message)||(null===(l=e.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.error)||"Erro ao adicionar atividade";p.o.error(c)}})},ye=function(e){C(e)},ge=function(e){console.log("Nova atividade:",e)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsxs)("div",{className:"card-body",children:[(0,r.jsxs)("div",{className:"d-flex justify-content-between align-items-center mb-3 flex-wrap",style:{gap:"8px"},children:[(0,r.jsx)("div",{style:{flex:"1 1 auto",minWidth:0,maxWidth:"100%"},children:(0,r.jsx)(d.default,{selectedProject:w,projetos:t,onProjectChange:function(e){S(e),E("")},selectedActivity:k,selectedTask:A,atividadesDisponiveis:n,onSelectActivity:ye,onSelectTask:E,onAddNewActivity:ge})}),(0,r.jsx)("div",{className:"d-flex align-items-center",style:{gap:"8px",flexShrink:0,flexGrow:0},children:(0,r.jsx)(f.default,{selectedProject:w,selectedActivity:k,onSelectActivity:ye,onAddNewActivity:ge,atividadesDisponiveis:n,counterMode:R,onModeChange:z,onStartCounter:ve,onStopCounter:function(){if(fe.current&&(clearInterval(fe.current),fe.current=null),T(!1),"00:00:00"!==_&&ae){var e=new Date,t=v(_.split(":").map(Number),2),n=60*t[0]+t[1],r=n/(60*g)*100,a=ae.toTimeString().substring(0,5),o=e.toTimeString().substring(0,5);le({startTime:a,endTime:o,percentage:r,duration:n,comment:""}),de(!0),B(!0)}I("00:00:00"),oe(null)},onAddManualTime:function(){he()&&(de(!1),le(null),B(!0))},isCounterRunning:F,counterTime:_})})]}),(0,r.jsx)(i.A,{columns:[{key:"projeto",label:"Projeto",width:"18%"},{key:"atividade",label:"Atividade",width:"18%"},{key:"task",label:"Task",width:"14%"},{key:"inicio",label:"Início",width:"10%"},{key:"fim",label:"Fim",width:"10%"},{key:"percentDia",label:"% do dia",width:"10%"},{key:"duracao",label:"Duração",width:"10%"},{key:"acoes",label:"Ações",width:"10%"}],data:b,renderRow:function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"ms-table-cell",children:e.projeto}),(0,r.jsx)("td",{className:"ms-table-cell",children:e.atividade}),(0,r.jsx)("td",{className:"ms-table-cell",children:e.task||"-"}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.inicio}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.fim}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.percentDia}),(0,r.jsx)("td",{className:"ms-table-cell-center",children:e.duracao}),(0,r.jsxs)("td",{className:"ms-table-cell-center position-relative",children:[(0,r.jsx)("button",{ref:Z[e.id],className:"app-icon-button",onClick:function(){return function(e){S(e.projeto),C(e.atividade),e.task?E(e.task):E(""),ne(e.id)}(e)},title:"Repetir Atividade",children:(0,r.jsx)("img",{src:"/images/icons/Group(3).svg",alt:"Play",className:"ms-table-action-icon"})}),te===e.id&&(0,r.jsx)(u.A,{show:!0,onClose:function(){return ne(null)},position:"bottom",triggerRef:Z[e.id],options:[{label:"Automático",value:"automatico",icon:"fas fa-check",selected:!1},{label:"Manual",value:"manual",icon:"fas fa-check",selected:!1}],onSelect:function(e){return t=e,ne(null),void("automatico"===t?ve():(de(!1),le(null),B(!0)));var t}}),(0,r.jsx)("button",{ref:$[e.id],className:"app-icon-button",onClick:function(){return t=e.id,void W(t);var t},title:"Comentário",children:(0,r.jsx)("img",{src:"/images/icons/Group(4).svg",alt:"Comentário",className:"ms-table-action-icon"})}),H===e.id&&(0,r.jsx)(l.default,{show:!0,onClose:function(){return W(null)},onSave:function(t){return function(e,t){var n={comment:t};m.Z4.updateActivity(e,n).then(function(){p.o.success("Comentário atualizado com sucesso!"),W(null),x&&x()}).catch(function(e){var t,n;console.error("Erro ao atualizar comentário:",e);var r=(null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.message)||(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.error)||"Erro ao atualizar comentário";p.o.error(r)})}(e.id,t)},initialComment:e.comment||"",activityName:e.atividade,triggerRef:$[e.id]}),(0,r.jsx)("button",{className:"app-icon-button",onClick:function(){return function(e){Q({id:e.id,name:e.atividade,project:e.projeto})}(e)},title:"Deletar",children:(0,r.jsx)("img",{src:"/images/icons/Group(5).svg",alt:"Deletar",className:"ms-table-action-icon"})})]})]})},emptyMessage:"Nenhuma atividade registrada hoje"})]})}),(0,r.jsx)(s.default,{show:q,onClose:function(){B(!1),ue&&(I("00:00:00"),oe(null),le(null),de(!1))},onSubmit:function(e){var r=t.find(function(e){return e.name===w});if(r){var a=60*g,o={date:y,project_id:r.id,start_time:e.startTime&&"00:00"!==e.startTime?"".concat(y," ").concat(e.startTime,":00"):void 0,end_time:e.endTime&&"00:00"!==e.endTime?"".concat(y," ").concat(e.endTime,":00"):void 0,percentage:e.percentage||void 0,duration:e.duration||0,comment:e.comment||"",workload_minutes:a};if(A)m.Z4.getProjectTasks(r.id).then(function(e){var t=e.find(function(e){return e.name===A});t&&(o.project_task_id=t.id,o.activity_name_legacy=k),be(o)}).catch(function(e){console.error("Erro ao buscar task:",e),p.o.error("Erro ao buscar task selecionada")});else if(k){var i=n.find(function(e){return e.name===k});i&&(o.activity_template_id=i.id,o.activity_name_legacy=k),be(o)}else p.o.error("Selecione uma tarefa ou atividade!")}else p.o.error("Projeto não encontrado!")},selectedProject:w,selectedActivity:k,selectedTask:A,workloadHours:g,prefilledData:se,isReadOnly:ue,alreadyRegisteredMinutes:pe,dailyLimitHours:null!=me&&me.blockOvertimeTimesheet?null==me?void 0:me.dailyHoursLimit:null}),V&&(0,r.jsx)(c.default,{show:!!V,onClose:function(){return Q(null)},onConfirm:function(){V&&m.Z4.deleteActivity(V.id).then(function(){p.o.success("Atividade excluída com sucesso!"),Q(null),x&&x()}).catch(function(e){var t,n;console.error("Erro ao excluir atividade:",e);var r=(null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.message)||(null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.error)||"Erro ao excluir atividade";p.o.error(r)})},activityName:V.name,projectName:V.project})]})}},49299(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>b});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(28482),o=n(5614),i=n(69107),s=n(46668),l=n(77984),c=n(23495),u=n(88224);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function p(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return v(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e){var t=e.teams,n=void 0===t?[]:t;if(0===n.length)return(0,r.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"200px",color:"#5C5D5D",fontFamily:"Inter",fontSize:"14px"},children:"Sem dados disponíveis"});var d=Math.max.apply(Math,h(n.map(function(e){return e.total})).concat([20])),f=4*Math.ceil(d/4),p=f/5,v=Array.from({length:6},function(e,t){return Math.round(t*p)}),b=n.map(function(e){var t=e.regular+e.extra;return m(m({},e),{},{background:f-t})});return(0,r.jsxs)("div",{children:[(0,r.jsx)(a.u,{width:"100%",height:200,children:(0,r.jsxs)(u.E,{data:b,layout:"vertical",margin:{top:30,right:60,left:80,bottom:10},barSize:32,children:[(0,r.jsx)(i.d,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E0E0E0"}),(0,r.jsx)(l.W,{type:"number",domain:[0,f],ticks:v,axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:12,fontFamily:"Inter"},orientation:"top"}),(0,r.jsx)(c.h,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:12,fontWeight:500,fontFamily:"Inter"},width:70}),(0,r.jsx)(s.yP,{dataKey:"regular",stackId:"team",fill:"#186073",radius:[0,0,0,0],children:(0,r.jsx)(o.Ze,{dataKey:"regular",position:"inside",formatter:function(e){return e>0?"".concat(e,"h"):""},style:{fill:"#FFFFFF",fontSize:11,fontWeight:600,fontFamily:"Inter"}})}),(0,r.jsx)(s.yP,{dataKey:"extra",stackId:"team",fill:"#FF6D6D",radius:[0,0,0,0],children:(0,r.jsx)(o.Ze,{dataKey:"extra",position:"inside",formatter:function(e){return e>0?"".concat(e,"h"):""},style:{fill:"#FFFFFF",fontSize:11,fontWeight:600,fontFamily:"Inter"}})}),(0,r.jsx)(s.yP,{dataKey:"background",stackId:"team",fill:"rgba(214, 219, 237, 0.40)",radius:[0,4,4,0]})]})}),(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-center flex-wrap gap-3 mt-3",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{paddingRight:"12px"},children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:"#186073",borderRadius:"2px",marginRight:"8px"}}),(0,r.jsx)("span",{style:{fontSize:"12px",color:"#5C5D5D",fontFamily:"Inter"},children:"Horas Regulares"})]}),(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{paddingRight:"12px"},children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:"#FF6D6D",borderRadius:"2px",marginRight:"8px"}}),(0,r.jsx)("span",{style:{fontSize:"12px",color:"#5C5D5D",fontFamily:"Inter"},children:"Horas Extras"})]})]})]})}},49791(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>y});n(52675),n(89463),n(2259),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(3362),n(27495),n(38781),n(21699),n(47764),n(71761),n(62953),n(3296),n(27208),n(48408);var r=n(74848),a=n(96540),o=n(94034),i=n(97665),s=new(n(15072).E)({defaultOptions:{queries:{staleTime:0,refetchOnWindowFocus:!1,retry:1},mutations:{retry:0}}}),l=n(76336);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var d=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,18098))}),f=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,65342))}),m=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,52558))}),p=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,57909))}),h=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,23696))}),v=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,43432))});function b(e,t){var n=location.hash.match(/tab=([a-z-]+)$/i),r=null==n?void 0:n[1];return r?t&&!t.includes(r)?e:r:e}function y(){var e=(0,l.L)(),t=e.canView,n=e.canEdit,u=e.canDelete,y=e.canCreate,g=!0===t,x=n||u||y,j=g?"overview":"bater-ponto",w=(0,a.useMemo)(function(){return b(j)},[j]),S=c((0,a.useState)(w),2),N=S[0],k=S[1];(0,a.useEffect)(function(){var e,t;e=N,(t=new URL(location.href)).hash="tab=".concat(e),history.replaceState(null,"",t.toString())},[N]),(0,a.useEffect)(function(){return document.body.classList.add("tm-page-active"),function(){document.body.classList.remove("tm-page-active")}},[]);var C=(0,a.useMemo)(function(){if(g){var e=[{key:"overview",label:"Visão Geral"},{key:"ponto",label:"Controle de Ponto"},{key:"bater-ponto",label:"Bater Ponto"},{key:"timesheet",label:"Timesheet"},{key:"modo-foco",label:"Modo Foco"}];return x&&e.push({key:"settings",label:"Configurações"}),e}return[{key:"bater-ponto",label:"Bater Ponto"},{key:"timesheet",label:"Timesheet"},{key:"modo-foco",label:"Modo Foco"}]},[g,x]);(0,a.useEffect)(function(){var e=C.map(function(e){return e.key}),t=b(j,e);e.includes(N)||k(t)},[N,j,C]),(0,a.useEffect)(function(){var e=function(){return k(b(j,C.map(function(e){return e.key})))};return window.addEventListener("hashchange",e),function(){return window.removeEventListener("hashchange",e)}},[j,C]);return(0,r.jsx)(i.Ht,{client:s,children:(0,r.jsxs)("section",{className:"zero-padding ".concat(g?"":"page"),style:{position:"relative"},children:[(0,r.jsx)(o.A,{items:C,title:"GESTÃO DE TEMPO",activeKey:N,onChange:function(e){return k(e)}}),(0,r.jsx)("div",{className:g?"tm-shell":"",style:{position:"relative",zIndex:1},children:(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)("div",{className:"p-3",children:"Carregando…"}),children:function(){switch(N){case"overview":return(0,r.jsx)(p,{});case"ponto":return(0,r.jsx)(h,{});case"settings":return(0,r.jsx)(v,{});case"bater-ponto":return(0,r.jsx)(d,{});case"timesheet":return(0,r.jsx)(f,{});case"modo-foco":return(0,r.jsx)(m,{});default:return g?(0,r.jsx)(p,{}):(0,r.jsx)(d,{})}}()})})]})})}},50418(e,t,n){"use strict";n.d(t,{Qb:()=>d,py:()=>c});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(71083);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}var l="/time-management/justifications";function c(e){return u.apply(this,arguments)}function u(){return(u=s(a().m(function e(t){var n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.A.post("".concat(l,"/reasons"),t);case 1:return n=e.v,e.a(2,n.data)}},e)}))).apply(this,arguments)}function d(e){return f.apply(this,arguments)}function f(){return(f=s(a().m(function e(t){var n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.A.post("".concat(l,"/licenses"),t);case 1:return n=e.v,e.a(2,n.data)}},e)}))).apply(this,arguments)}},50455(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(42762);var r=n(74848),a=n(1806);function o(e){var t=e.isOpen,n=e.onClose,o=(e.memberName,e.memberInitials),i=void 0===o?"?":o,s=e.justify;if(!t)return null;var l=s&&""!==s.trim(),c=["#F59E0B","#EF4444","#10B981","#3B82F6","#8B5CF6","#EC4899"],u=c[Math.floor(Math.random()*c.length)];return(0,r.jsx)(a.A,{show:t,onClose:n,title:"Justificativa",size:"md",footer:(0,r.jsx)("button",{type:"button",className:"btn btn-secondary btn-sm",onClick:n,style:{fontFamily:"Inter",fontSize:"14px",paddingLeft:"20px",paddingRight:"20px"},children:"Fechar"}),children:(0,r.jsx)("div",{style:{padding:"24px"},children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("div",{className:"rounded-circle text-white d-flex align-items-center justify-content-center flex-shrink-0",style:{width:40,height:40,backgroundColor:u,fontWeight:700,fontSize:"16px"},children:i}),(0,r.jsx)("div",{className:"ml-3 flex-grow-1",children:l?(0,r.jsx)("p",{className:"mb-0",style:{fontFamily:"Inter",fontSize:"14px",color:"#5C5D5D",lineHeight:"1.6",whiteSpace:"pre-wrap"},children:s}):(0,r.jsx)("p",{className:"mb-0 text-muted",style:{fontFamily:"Inter",fontWeight:500,lineHeight:"100%",letterSpacing:"0%"},children:"Ainda não foi fornecida uma justificativa para esta ocorrência."})})]})})})}},50860(e,t,n){"use strict";n.d(t,{A:()=>c});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23792),n(89572),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(47764),n(23500),n(62953);var r=n(74848),a=n(96540);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){var t=e.title,n=e.subtitle,o=e.right,i=e.children,l=e.className,c=e.style;return(0,a.useEffect)(function(){var e=window;e&&e.$&&"function"==typeof e.$.fn.tooltip&&e.$('[data-toggle="tooltip"]').tooltip({container:"body",html:!0,boundary:"viewport",placement:"auto"})},[]),(0,r.jsxs)("section",{className:"content options-section-project ".concat(null!=l?l:""),style:s(s({},c),{},{position:"relative",zIndex:1}),children:[(t||n||o)&&(0,r.jsxs)("div",{className:"d-flex justify-content-between align-items-start mb-3 mt-3",children:[(0,r.jsxs)("div",{children:[t&&(0,r.jsx)("h4",{className:"meta-title mb-2",children:t}),n&&(0,r.jsx)("p",{className:"meta-subtitle mb-0",children:n})]}),o&&(0,r.jsx)("div",{className:"ms-3",children:o})]}),i]})}},52354(e,t,n){"use strict";n.d(t,{F:()=>r});var r=n(71083).A.create({baseURL:"/",timeout:25e3,withCredentials:!0})},52558(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>O});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(2892),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(97665),i=n(33930),s=n(57097),l=n(34559),c=n(69794),u=n(97839),d=n(26723),f=n(50860),m=(n(94170),n(59904),n(84185),n(40875),n(79432),n(10287),n(3362),n(52354));function p(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return h(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(h(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,h(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,h(d,"constructor",c),h(c,"constructor",l),l.displayName="GeneratorFunction",h(c,a,"GeneratorFunction"),h(d),h(d,a,"Generator"),h(d,r,function(){return this}),h(d,"toString",function(){return"[object Generator]"}),(p=function(){return{w:o,m:f}})()}function h(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}h=function(e,t,n,r){function o(t,n){h(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},h(e,t,n,r)}function v(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){v(o,r,a,i,s,"next",e)}function s(e){v(o,r,a,i,s,"throw",e)}i(void 0)})}}var y="/api/time/focus-mode";function g(){return x.apply(this,arguments)}function x(){return(x=b(p().m(function e(){var t,n;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,m.F.get(y);case 1:if(t=e.v,(n=t.data)&&0!==Object.keys(n).length){e.n=2;break}return e.a(2,null);case 2:return e.a(2,n)}},e)}))).apply(this,arguments)}function j(e){return w.apply(this,arguments)}function w(){return(w=b(p().m(function e(t){var n,r;return p().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,m.F.put(y,t);case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}))).apply(this,arguments)}var S=n(20826);function N(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var C=["time-management","focus-mode"];function O(){var e=(0,o.jE)(),t=N(a.useState(!1),2),n=t[0],m=t[1],p=(0,i.I)({queryKey:C,queryFn:g,staleTime:0}),h=p.data,v=(p.isLoading,(0,s.n)({mutationFn:j,onSuccess:function(){return e.invalidateQueries({queryKey:C})}})),b=N(a.useState(""),2),y=b[0],x=b[1],w=N(a.useState(""),2),k=w[0],O=w[1],A=N(a.useState(""),2),E=A[0],P=A[1],F=N(a.useState(""),2),T=F[0],D=F[1],_=N(a.useState(""),2),I=_[0],M=_[1];(0,a.useEffect)(function(){var e,t,n,r,a;h&&(x(null!==(e=h.clock)&&void 0!==e?e:""),O(null!==(t=h.method)&&void 0!==t?t:""),P(null!==(n=h.background)&&void 0!==n?n:""),D(null!==(r=h.workMinutes)&&void 0!==r?r:""),M(null!==(a=h.breakMinutes)&&void 0!==a?a:""))},[h]),(0,a.useEffect)(function(){"pomodoro"===k&&(D(25),M(5)),"regra_52_17"===k&&(D(52),M(17))},[k]);var R="personalizado"===k,z=!(!y||!k||!E||R&&(!T||!I));return(0,r.jsx)("div",{style:{maxWidth:"1400px",margin:"0 auto"},children:(0,r.jsxs)(f.A,{children:[(0,r.jsxs)("div",{className:"card app-card-surface",children:[(0,r.jsxs)("div",{className:"card-body",children:[(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"tm-label d-block mb-1",children:"Tipo de Relógio"}),(0,r.jsx)(l.A,{className:"w-100",options:[{label:"Digital",value:"digital"}],placeholder:"Selecione o tipo de relógio",size:"md",value:y||void 0,onChange:function(e){return x(e)}})]}),(0,r.jsxs)("div",{className:"form-group mt-3",children:[(0,r.jsx)("label",{className:"tm-label d-block mb-1",children:"Métodos de Foco"}),(0,r.jsx)(l.A,{className:"w-100",options:[{label:"Pomodoro (25/5)",value:"pomodoro"},{label:"Regra 52/17",value:"regra_52_17"},{label:"Personalizado",value:"personalizado"}],placeholder:"Selecione o modo que melhor funciona para você",size:"md",value:k||void 0,onChange:function(e){return O(e)}})]}),R&&(0,r.jsxs)("div",{className:"row mt-3",children:[(0,r.jsxs)("div",{className:"col-md-6",children:[(0,r.jsx)("label",{className:"tm-label d-block mb-1",children:"Minutos de foco"}),(0,r.jsx)("input",{type:"number",className:"form-control",placeholder:"Ex.: 30"})]}),(0,r.jsxs)("div",{className:"col-md-6 mt-3 mt-md-0",children:[(0,r.jsx)("label",{className:"tm-label d-block mb-1",children:"Minutos de descanso"}),(0,r.jsx)("input",{type:"number",className:"form-control",placeholder:"Ex.: 5"})]})]}),(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)(u.default,{method:k||""})}),(0,r.jsxs)("div",{className:"mt-4",children:[(0,r.jsx)("label",{className:"tm-label d-block mb-2",children:"Escolha o Plano de Fundo"}),(0,r.jsx)(c.default,{selected:E||"",onSelect:function(e){return P(e)}})]})]}),(0,r.jsxs)("div",{className:"card-footer d-flex justify-content-end gap-2",children:[(0,r.jsx)("button",{className:"btn tm-btn-cancel mr-2",disabled:!z,onClick:function(){return m(!0)},children:"Iniciar"}),(0,r.jsx)(S.A,{label:"Salvar Alterações",variant:"solid",onClick:function(){z&&v.mutate({clock:y,method:k,background:E,workMinutes:""===T?null:Number(T),breakMinutes:""===I?null:Number(I)})},className:"px-3 py-1",style:{height:"38px",paddingLeft:"12px",paddingRight:"12px",paddingTop:"6px",paddingBottom:"6px"}})]})]}),(0,r.jsx)(d.default,{open:n,onClose:function(){return m(!1)},clock:y||"digital",background:E||"black",workMinutes:Number(T||25),breakMinutes:Number(I||5)})]})})}},52798(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>m});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(58940),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(96339),l=n(96540),c=n(76336);function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var f=["time-management","policy"];function m(){var e=(0,c.L)().canEdit,t=(0,o.jE)(),n=u((0,l.useState)(!1),2),d=n[0],m=n[1],p=u((0,l.useState)(!1),2),h=p[0],v=p[1],b=u((0,l.useState)(!1),2),y=b[0],g=b[1],x=u((0,l.useState)(!1),2),j=x[0],w=x[1],S=u((0,l.useState)(5),2),N=S[0],k=S[1],C=u((0,l.useState)(10),2),O=C[0],A=C[1],E=u((0,l.useState)(2),2),P=E[0],F=E[1],T=(0,a.I)({queryKey:f,queryFn:s.Z}),D=T.data;T.isFetching;(0,l.useEffect)(function(){D&&(m(D.enableAdvanceTolerance),v(D.enableDelayTolerance),g(D.enableDistanceTolerance),w(D.editPoint),k(D.advanceTolerance||5),A(D.delayTolerance||10),F(D.distanceTolerance||2))},[D]);var _=(0,i.n)({mutationFn:function(e){return(0,s.E)(e)},onSuccess:function(){t.invalidateQueries({queryKey:f})}}),I=function(){D&&_.mutate({enableAdvanceTolerance:d,enableDelayTolerance:h,enableDistanceTolerance:y,editPoint:j,advanceTolerance:d?N:0,delayTolerance:h?O:0,distanceTolerance:y?P:0})};return(0,l.useEffect)(function(){D&&I()},[d,h,y,j]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-12 col-md-6 col-xl-3 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(d?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"pol-adiant",className:"custom-control-input",checked:d,onChange:function(e){return m(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(d?"text-primary":""),htmlFor:"pol-adiant",children:["Tolerância para adiantamento de",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",style:{fontSize:"0.85rem"},children:"Define quantos minutos antes do horário previsto o colaborador pode bater o ponto sem ser considerado antecipado."}),(0,r.jsxs)("div",{className:"input-group mt-auto",children:[(0,r.jsx)("input",{type:"number",className:"form-control",value:N,onChange:function(e){return k(parseInt(e.target.value)||0)},onBlur:I,disabled:!d||!e,min:"0"}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",children:"min"})})]})]})})}),(0,r.jsx)("div",{className:"col-12 col-md-6 col-xl-3 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(h?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"pol-atraso",className:"custom-control-input",checked:h,onChange:function(e){return v(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(h?"text-primary":""),htmlFor:"pol-atraso",children:["Tolerância para atraso de",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",style:{fontSize:"0.85rem"},children:"Define quantos minutos após o horário previsto o colaborador pode bater o ponto sem ser considerado em atraso."}),(0,r.jsxs)("div",{className:"input-group mt-auto",children:[(0,r.jsx)("input",{type:"number",className:"form-control",value:O,onChange:function(e){return A(parseInt(e.target.value)||0)},onBlur:I,disabled:!h||!e,min:"0"}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",children:"min"})})]})]})})}),(0,r.jsx)("div",{className:"col-12 col-md-6 col-xl-3 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(y?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"pol-dist",className:"custom-control-input",checked:y,onChange:function(e){return g(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(y?"text-primary":""),htmlFor:"pol-dist",children:["Tolerância para distância de",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",style:{fontSize:"0.85rem"},children:"Define o raio de distância permitido em torno do local cadastrado para validar o ponto por geolocalização."}),(0,r.jsxs)("div",{className:"input-group mt-auto",children:[(0,r.jsx)("input",{type:"number",className:"form-control",value:P,onChange:function(e){return F(parseInt(e.target.value)||0)},onBlur:I,disabled:!y||!e,min:"0"}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",children:"km"})})]})]})})}),(0,r.jsx)("div",{className:"col-12 col-md-6 col-xl-3 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(j?"border-primary bg-primary-soft":""),style:{border:"1px solid #e0e0e0",borderRadius:"8px"},children:(0,r.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox mb-2",children:[(0,r.jsx)("input",{type:"checkbox",id:"pol-edicao",className:"custom-control-input",checked:j,onChange:function(e){return w(e.target.checked)},disabled:!e}),(0,r.jsxs)("label",{className:"custom-control-label ".concat(j?"text-primary":""),htmlFor:"pol-edicao",children:["Edição de Ponto",!e&&(0,r.jsx)("i",{className:"fas fa-lock ml-2 text-muted",style:{fontSize:"0.7rem"}})]})]}),(0,r.jsx)("small",{className:"text-muted",style:{fontSize:"0.85rem"},children:"O membro poderá editar seu ponto caso ocorra alguma ocorrência leve."})]})})})]}),_.isPending&&(0,r.jsxs)("div",{className:"text-muted mt-2",children:[(0,r.jsx)("i",{className:"fas fa-spinner fa-spin mr-2"}),"Salvando..."]})]})}},54958(e,t,n){"use strict";var r=n(3066);n(28706),n(51629),n(23792),n(48598),n(62062),n(79432),n(26099),n(27495),n(25440),n(23500),n(62953);var a,o,i;(0,r.E)(n(86628));a=n(97677),i={},(o=a).keys().forEach(function(e){return i[e]=o(e).default}),window.resolveReactComponent=function(e){var t=i["./".concat(e,".jsx")]||i["./".concat(e,".tsx")];if(void 0===t){var n=Object.keys(i).map(function(e){return e.replace("./","").replace(".jsx","").replace(".tsx","")});throw new Error('React controller "'.concat(e,'" does not exist. Possible values: ').concat(n.join(", ")))}return t},console.log("Symfony UX React bootstrap (TS) loaded"),console.log("React UX app.js loaded successfully")},55098(e,t,n){"use strict";n.d(t,{KI:()=>u,Te:()=>v,WS:()=>f,iM:()=>l,rI:()=>p});n(52675),n(89463),n(28706),n(51629),n(23792),n(34782),n(1688),n(23288),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(38781),n(47764),n(23500),n(62953),n(3296),n(27208),n(48408);var r=n(69404);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(e){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(t){var n,o,i,s;return a().w(function(e){for(;;)switch(e.n){case 0:return n=new URLSearchParams,null!=t&&t.start_date&&n.append("start_date",t.start_date),null!=t&&t.end_date&&n.append("end_date",t.end_date),null!=t&&t.types&&t.types.length>0&&t.types.forEach(function(e){n.append("types[]",e)}),null!=t&&t.time_start&&n.append("time_start",t.time_start),null!=t&&t.time_end&&n.append("time_end",t.time_end),null!=t&&t.status&&n.append("status",t.status),null!=t&&t.role&&n.append("role",t.role),null!=t&&t.keyword&&n.append("keyword",t.keyword),null!=t&&t.page&&t.page>0&&n.append("page",t.page.toString()),null!=t&&t.limit&&t.limit>0&&n.append("limit",t.limit.toString()),o=n.toString(),i="/time-management/members-occurrences".concat(o?"?".concat(o):""),e.n=1,r.u.get(i);case 1:return s=e.v,e.a(2,s.data)}},e)}))).apply(this,arguments)}function u(e,t){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t,n){var o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.u.post("/time-management/occurrence/approve?id=".concat(t,"&approved=").concat(n));case 1:return o=e.v,e.a(2,o.data)}},e)}))).apply(this,arguments)}function f(){return m.apply(this,arguments)}function m(){return m=s(a().m(function e(){var t,n,o,i,s,l,c,u=arguments;return a().w(function(e){for(;;)switch(e.n){case 0:return t=u.length>0&&void 0!==u[0]?u[0]:1,n=u.length>1&&void 0!==u[1]?u[1]:10,o=u.length>2?u[2]:void 0,(i=new URLSearchParams).append("page",t.toString()),i.append("limit",n.toString()),null!=o&&o.start_date&&i.append("start_date",o.start_date),null!=o&&o.end_date&&i.append("end_date",o.end_date),null!=o&&o.recordType&&i.append("record_type",o.recordType),null!=o&&o.validatedBy&&i.append("validated_by",o.validatedBy),null!=o&&o.channel&&i.append("channel",o.channel),null!=o&&o.mode&&i.append("mode",o.mode),null!=o&&o.keyword&&i.append("keyword",o.keyword),s=i.toString(),l="/time-management/clock-in-history?".concat(s),e.n=1,r.u.get(l);case 1:return c=e.v,e.a(2,c.data)}},e)})),m.apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=s(a().m(function e(t){var n,o,i,s,l,c,u,d;return a().w(function(e){for(;;)switch(e.n){case 0:return n=new URLSearchParams,null!=t&&t.start_date&&n.append("start_date",t.start_date),null!=t&&t.end_date&&n.append("end_date",t.end_date),null!=t&&t.recordType&&n.append("record_type",t.recordType),null!=t&&t.validatedBy&&n.append("validated_by",t.validatedBy),null!=t&&t.channel&&n.append("channel",t.channel),null!=t&&t.mode&&n.append("mode",t.mode),null!=t&&t.keyword&&n.append("keyword",t.keyword),o=n.toString(),i="/time-management/clock-in-history/export".concat(o?"?".concat(o):""),e.n=1,r.u.get(i,{responseType:"blob"});case 1:s=e.v,l=new Blob([s.data],{type:"text/csv"}),c=window.URL.createObjectURL(l),(u=document.createElement("a")).href=c,d=(new Date).toISOString().slice(0,10),u.download="historico-pontos-".concat(d,".csv"),document.body.appendChild(u),u.click(),document.body.removeChild(u),window.URL.revokeObjectURL(c);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function v(e){return b.apply(this,arguments)}function b(){return(b=s(a().m(function e(t){var n,o,i,s;return a().w(function(e){for(;;)switch(e.n){case 0:return n=new URLSearchParams,t&&n.append("date",t),o=n.toString(),i="/time-management/daily-statistics".concat(o?"?".concat(o):""),e.n=1,r.u.get(i);case 1:return s=e.v,e.a(2,s.data)}},e)}))).apply(this,arguments)}},55278(e,t,n){"use strict";n.d(t,{Eq:()=>f,Nt:()=>v,vD:()=>l,xD:()=>u,yJ:()=>p,zR:()=>y});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(52354);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/can-view-maps");case 1:return t=e.v,n=t.data,e.a(2,n.can_view_maps)}},e)}))).apply(this,arguments)}function u(e){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.put("/time-management/can-view-maps",{can_view_maps:t});case 1:return n=e.v,o=n.data,e.a(2,o.can_view_maps)}},e)}))).apply(this,arguments)}function f(){return m.apply(this,arguments)}function m(){return(m=s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/location");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.post("/time-management/location",t);case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}function v(e,t){return b.apply(this,arguments)}function b(){return(b=s(a().m(function e(t,n){var o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.put("/time-management/location/".concat(t),n);case 1:return o=e.v,i=o.data,e.a(2,i.data)}},e)}))).apply(this,arguments)}function y(e){return g.apply(this,arguments)}function g(){return(g=s(a().m(function e(t){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.delete("/time-management/location/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}},55801(e,t,n){"use strict";n.d(t,{G8:()=>l,Tt:()=>f,iY:()=>u,kc:()=>p});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(52354);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/validation");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function u(e){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.post("/time-management/validation",{mode:t});case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}function f(e){return m.apply(this,arguments)}function m(){return(m=s(a().m(function e(t){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.post("/time-management/validation/others",{type:t});case 1:return e.a(2)}},e)}))).apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=s(a().m(function e(t){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.delete("/time-management/validation/others/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}},57909(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>O});n(52675),n(89463),n(2259),n(28706),n(2008),n(50113),n(78350),n(23418),n(64346),n(23792),n(62062),n(34782),n(30237),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(68156),n(42762),n(62953);var r=n(74848),a=n(96540),o=n(49785),i=n(33930),s=n(10280),l=n(84136),c=n(55098),u=n(69404);function d(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return f(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(f(t={},r,function(){return this}),t),m=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,f(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return l.prototype=c,f(m,"constructor",c),f(c,"constructor",l),l.displayName="GeneratorFunction",f(c,a,"GeneratorFunction"),f(m),f(m,a,"Generator"),f(m,r,function(){return this}),f(m,"toString",function(){return"[object Generator]"}),(d=function(){return{w:o,m:p}})()}function f(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}f=function(e,t,n,r){function o(t,n){f(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},f(e,t,n,r)}function m(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function p(){return h.apply(this,arguments)}function h(){var e;return e=d().m(function e(){var t,n;return d().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.u.get("/time-management/members/roles");case 1:return t=e.v,n=Array.isArray(t.data)?t.data:t.data.data||[],e.a(2,n)}},e)}),h=function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){m(o,r,a,i,s,"next",e)}function s(e){m(o,r,a,i,s,"throw",e)}i(void 0)})},h.apply(this,arguments)}n(76031);function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=v((0,a.useState)(e),2),r=n[0],o=n[1];return(0,a.useEffect)(function(){var n=setTimeout(function(){o(e)},t);return function(){clearTimeout(n)}},[e,t]),r}var g=n(72210),x=n(73215),j=n(50860);function w(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return S(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(S(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,S(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,S(d,"constructor",c),S(c,"constructor",l),l.displayName="GeneratorFunction",S(c,a,"GeneratorFunction"),S(d),S(d,a,"Generator"),S(d,r,function(){return this}),S(d,"toString",function(){return"[object Generator]"}),(w=function(){return{w:o,m:f}})()}function S(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}S=function(e,t,n,r){function o(t,n){S(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},S(e,t,n,r)}function N(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(){var e,t,n,u,d,f,m,h,v,b,S,C,O,A,E,P=(0,o.mN)({defaultValues:{selectedDate:(C=new Date,O=C.getFullYear(),A=String(C.getMonth()+1).padStart(2,"0"),E=String(C.getDate()).padStart(2,"0"),"".concat(O,"-").concat(A,"-").concat(E)),occurrencePage:1,occurrencePageSize:10,historyPage:1,historyPageSize:10,searchKeyword:"",selectedRole:"",roleString:"",occurrenceType:"",timeStart:"",timeEnd:"",status:"",historyRecordType:"",historyValidatedBy:"",historyChannel:"",historyMode:"",historySearchKeyword:""}}),F=P.watch,T=P.setValue,D=k((0,a.useState)(!1),2),_=(D[0],D[1],k((0,a.useState)(!1),2)),I=_[0],M=_[1],R=F("selectedDate"),z=F("occurrencePage"),L=F("occurrencePageSize"),q=F("historyPage"),B=F("historyPageSize"),G=F("searchKeyword"),H=F("selectedRole"),W=F("roleString"),U=F("occurrenceType"),V=F("timeStart"),Q=F("timeEnd"),K=F("status"),$=F("historyRecordType"),J=F("historyValidatedBy"),Y=F("historyChannel"),Z=F("historyMode"),X=F("historySearchKeyword"),ee=y(G,500),te=y(X,500),ne=(0,a.useMemo)(function(){var e={};return R&&(e.start_date=R,e.end_date=R),U&&(e.types=[U]),V&&(e.time_start=V),Q&&(e.time_end=Q),K&&(e.status=K),W&&(e.role=W),ee&&(e.keyword=ee),e.page=z,e.limit=L,e},[R,U,V,Q,K,W,ee,z,L]),re=(0,i.I)({queryKey:["time-management","overview","members-occurrences",ne],queryFn:function(){return(0,c.iM)(ne)},staleTime:6e4,refetchInterval:6e4}),ae=re.data,oe=re.isLoading,ie=(0,i.I)({queryKey:["time-management","member-roles"],queryFn:p,staleTime:3e5}),se=ie.data,le=ie.isLoading,ce=(0,i.I)({queryKey:["time-management","overview","kpis",R],queryFn:function(){return(0,c.Te)(R)},staleTime:3e4,refetchInterval:3e4}),ue=ce.data,de=ce.isLoading,fe=(0,a.useMemo)(function(){var e={page:q,limit:B};return R&&(e.start_date=R,e.end_date=R),$&&(e.recordType=$),J&&(e.validatedBy=J),Y&&(e.channel=Y),Z&&(e.mode=Z),te&&(e.keyword=te),e},[R,q,B,$,J,Y,Z,te]),me=(0,i.I)({queryKey:["time-management","overview","clock-in-history",fe],queryFn:function(){return(0,c.WS)(q,B,fe)},staleTime:6e4,refetchInterval:6e4}),pe=me.data,he=(me.isLoading,(0,a.useMemo)(function(){var e;return null!==(e=null==ae?void 0:ae.data.flatMap(function(e){return e.occurrences.map(function(t){var n="".concat(e.member.firstName," ").concat(e.member.lastName).trim(),r=t.hitSpotTime.time?t.hitSpotTime.time.substring(0,5):"-",a=l.L[t.type]||t.type;return{id:t.id,nome:n,iniciais:void 0,avatarBg:void 0,ocorrencia:a,horario:r,status:(0,l.j)(t.severity),justify:t.justify||null}})}))&&void 0!==e?e:[]},[ae])),ve=(0,a.useMemo)(function(){if(console.log("🔍 rolesData recebida:",se),console.log("🔍 É array?",Array.isArray(se)),!se||!Array.isArray(se))return console.log("⚠️ rolesData não é um array válido"),[];console.log("📊 Roles da API (array):",se);var e=se.filter(function(e){var t=e.role&&""!==e.role.trim();return t||console.log("⚠️ Role inválida filtrada:",e),t}).map(function(e){return{value:e.id,label:e.role}});return console.log("✅ Role options transformadas:",e),e},[se]),be=(0,a.useMemo)(function(){var e;return null!==(e=null==pe?void 0:pe.data.map(function(e){return{id:e.id,nome:e.memberName,data:e.time,tipo:e.recordType,validacao:e.validatedBy,canal:e.channel,modo:e.mode,memberId:e.memberId,type:e.type,status:e.status,latitude:e.latitude,longitude:e.longitude,selfie:e.selfie,print:e.print,createdAt:e.createdAt,updatedAt:e.updatedAt,justificationType:e.justificationType,justificationId:e.justificationId,justification:e.justification}}))&&void 0!==e?e:[]},[pe]),ye=function(){var e,t=(e=w().m(function e(){var t,n;return w().w(function(e){for(;;)switch(e.p=e.n){case 0:return M(!0),e.p=1,t={},$&&(t.recordType=$),J&&(t.validatedBy=J),Y&&(t.channel=Y),Z&&(t.mode=Z),te&&(t.keyword=te),e.n=2,(0,c.rI)(t);case 2:e.n=4;break;case 3:e.p=3,n=e.v,console.error("Erro ao exportar CSV:",n),alert("Erro ao exportar arquivo CSV");case 4:return e.p=4,M(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){N(o,r,a,i,s,"next",e)}function s(e){N(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}(),ge=function(e){var t=new Date(R+"T00:00:00");t.setDate(t.getDate()+e);var n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");T("selectedDate","".concat(n,"-").concat(r,"-").concat(a)),T("occurrencePage",1),T("historyPage",1)};return(0,r.jsxs)(j.A,{children:[(0,r.jsx)("div",{className:"mb-3",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:"16px"},children:(0,r.jsxs)("div",{style:{position:"relative",display:"inline-block"},children:[(0,r.jsx)("input",{ref:function(e){if(e){var t=e.nextElementSibling,n=null==t?void 0:t.querySelector(".tm-date-trigger");n&&!n.onclick&&(n.onclick=function(){e.showPicker?e.showPicker():e.click()})}},type:"date",value:R,onChange:function(e){T("selectedDate",e.target.value),T("occurrencePage",1),T("historyPage",1)},style:{position:"absolute",opacity:0,width:"100%",height:"100%",cursor:"pointer",zIndex:-1,pointerEvents:"none"}}),(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{gap:8},children:[(0,r.jsx)("button",{type:"button",className:"btn btn-link text-muted p-1",onClick:function(e){e.stopPropagation(),ge(-1)},"aria-label":"Dia anterior",children:(0,r.jsx)("i",{className:"fas fa-chevron-left"})}),(0,r.jsx)("div",{className:"tm-date-trigger",style:{fontFamily:"Inter, sans-serif",fontSize:"14px",fontWeight:400,color:"#186073",userSelect:"none"},children:function(e){if(!e)return"";var t=new Date(e+"T00:00:00"),n=["Dom.","Seg.","Ter.","Qua.","Qui.","Sex.","Sáb."][t.getDay()],r=t.getDate(),a=["Jan.","Fev.","Mar.","Abr.","Mai.","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."][t.getMonth()],o=t.getFullYear();return"".concat(n," ").concat(r," de ").concat(a," ").concat(o)}(R)}),(0,r.jsx)("button",{type:"button",className:"btn btn-link text-muted p-1",onClick:function(e){e.stopPropagation(),ge(1)},"aria-label":"Próximo dia",children:(0,r.jsx)("i",{className:"fas fa-chevron-right"})})]})]})}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)("div",{className:"row justify-content-start align-items-stretch",children:[(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg mb-2",children:(0,r.jsx)(s.A,{value:de?"...":null!==(e=null==ue?void 0:ue.working)&&void 0!==e?e:0,label:"Membros trabalhando",variant:"green",className:"rounded-lg elevation-1 h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg mb-2",children:(0,r.jsx)(s.A,{value:de?"...":null!==(t=null==ue?void 0:ue.onBreak)&&void 0!==t?t:0,label:"Membros em pausa",variant:"blue",className:"rounded-lg elevation-1 h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg mb-2",children:(0,r.jsx)(s.A,{value:de?"...":null!==(n=null==ue?void 0:ue.absences)&&void 0!==n?n:0,label:"Ausência no dia",variant:"red",className:"rounded-lg elevation-1 h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg mb-2",children:(0,r.jsx)(s.A,{value:de?"...":null!==(u=null==ue?void 0:ue.onLicense)&&void 0!==u?u:0,label:"Membros em licença",variant:"white",className:"rounded-lg elevation-1 h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg mb-2",children:(0,r.jsx)(s.A,{value:de?"...":null!==(d=null==ue?void 0:ue.pendingOccurrences)&&void 0!==d?d:0,label:"Ocorrências pendentes",variant:"gray",className:"rounded-lg elevation-1 h-100"})})]})}),(0,r.jsx)(g.default,{data:he,title:"Ocorrências",searchKeyword:G,onSearchChange:function(e){return T("searchKeyword",e)},roleOptions:ve,selectedRole:H,onRoleChange:function(e){console.log("Função selecionada (ID):",e),T("selectedRole",e);var t=null==se?void 0:se.find(function(t){return t.id===e}),n=(null==t?void 0:t.role)||"";console.log("Role string para backend:",n),T("roleString",n)},isLoading:oe,isLoadingRoles:le,onApplyFilters:function(e){T("occurrenceType",e.occurrenceType),T("timeStart",e.timeStart),T("timeEnd",e.timeEnd),T("status",e.status),T("occurrencePage",1)},onClearFilters:function(){T("occurrenceType",""),T("timeStart",""),T("timeEnd",""),T("status",""),T("occurrencePage",1)},hasActiveFilters:""!==U||""!==V||""!==Q||""!==K,total:null!==(f=null==ae||null===(m=ae.pagination)||void 0===m?void 0:m.total)&&void 0!==f?f:0,totalPages:null==ae||null===(h=ae.pagination)||void 0===h?void 0:h.totalPages,page:z,pageSize:L,onPageChange:function(e){return T("occurrencePage",e)},onPageSizeChange:function(e){return T("occurrencePageSize",e)}}),(0,r.jsx)(x.default,{data:be,total:null!==(v=null==pe||null===(b=pe.pagination)||void 0===b?void 0:b.total)&&void 0!==v?v:0,totalPages:null==pe||null===(S=pe.pagination)||void 0===S?void 0:S.total_pages,page:q,pageSize:B,onPageChange:function(e){return T("historyPage",e)},onPageSizeChange:function(e){return T("historyPageSize",e)},hasActiveFilters:""!==$||""!==J||""!==Y||""!==Z,searchKeyword:X,onSearchChange:function(e){return T("historySearchKeyword",e)},onExportCSV:ye,isExporting:I,onApplyFilters:function(e){T("historyRecordType",e.recordType),T("historyValidatedBy",e.validatedBy),T("historyChannel",e.channel),T("historyMode",e.mode),T("historyPage",1)},onClearFilters:function(){T("historyRecordType",""),T("historyValidatedBy",""),T("historyChannel",""),T("historyMode",""),T("historyPage",1)}})]})}},59261(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});n(52675),n(89463),n(2259),n(50113),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(33930),i=n(73638);function s(e){var t=e.show,n=e.onClose,a=e.atividades,o=e.selectedActivity,s=e.onSelectActivity,l=e.onAddNew,c=e.triggerRef,u=e.title,d=void 0===u?"Selecionar Atividade":u,f=e.hideAddNew,m=void 0===f||f,p=e.centered,h=void 0!==p&&p;return(0,r.jsxs)(i.A,{show:t,onClose:n,position:"bottom",width:"220px",triggerRef:c,centered:h,children:[(0,r.jsx)("div",{style:{padding:"10px 15px",fontSize:"13px",color:"#5C5D5D",borderBottom:"2px solid #EAEEF3",fontWeight:600},children:d}),(0,r.jsx)("div",{style:{maxHeight:"250px",overflowY:"auto"},children:a.map(function(e){return(0,r.jsx)("div",{style:{padding:"10px 15px",cursor:"pointer",fontSize:"13px",color:"#5C5D5D",borderBottom:"1px solid #EAEEF3",backgroundColor:o===e.name?"#F3F3F3":"transparent"},onClick:function(){s(e.name),n()},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F8F9FA"},onMouseLeave:function(t){return t.currentTarget.style.backgroundColor=o===e.name?"#F3F3F3":"transparent"},children:e.name},e.id)})}),!m&&(0,r.jsxs)("div",{style:{padding:"10px 15px",cursor:"pointer",fontSize:"13px",color:"#17A2B8",fontWeight:600,borderTop:"2px solid #EAEEF3"},onClick:function(){var e=prompt("Nome da nova atividade:");e&&l(e)},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F8F9FA"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor="transparent"},children:[(0,r.jsx)("i",{className:"fas fa-plus",style:{marginRight:"8px"}}),"Adicionar Nova"]})]})}var l=n(81623);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.projetos,n=(e.atividadesDisponiveis,e.selectedProject),u=e.selectedActivity,d=e.selectedTask,f=void 0===d?"":d,m=e.onProjectChange,p=e.onSelectActivity,h=e.onSelectTask,v=e.onAddNewActivity,b=(0,a.useRef)(null),y=(0,a.useRef)(null),g=c((0,a.useState)(!1),2),x=g[0],j=g[1],w=c((0,a.useState)(!1),2),S=w[0],N=w[1],k=t.find(function(e){return e.name===n}),C=null==k?void 0:k.id,O=(0,o.I)({queryKey:["timesheet-project-tasks",C],queryFn:function(){return l.Z4.getProjectTasks(C)},enabled:!!C,staleTime:6e4,refetchOnWindowFocus:!1}).data,A=void 0===O?[]:O,E=(0,o.I)({queryKey:["timesheet-activity-templates"],queryFn:function(){return l.Z4.getActivityTemplates()},enabled:!0,staleTime:6e4,refetchOnWindowFocus:!1}).data,P=void 0===E?[]:E;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{gap:"12px",width:"100%"},children:[(0,r.jsx)("div",{className:"project-select-wrapper",children:(0,r.jsxs)("select",{value:n,onChange:function(e){return m(e.target.value)},children:[(0,r.jsx)("option",{value:"",children:"Está trabalhando em qual projeto?"}),t.map(function(e){return(0,r.jsx)("option",{value:e.name,children:e.name},e.id)})]})}),(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{gap:"8px",flexShrink:0},children:[(0,r.jsxs)(i.d,{children:[(0,r.jsx)("button",{ref:b,onClick:function(){return j(!x)},title:"Selecionar Tarefa",className:"app-icon-button",disabled:!C,style:{backgroundColor:f?"rgba(24, 96, 115, 0.10)":"white",border:f?"1px solid rgba(24, 96, 115, 0.25)":"1px solid rgba(0, 0, 0, 0.15)"},children:(0,r.jsx)("img",{src:f?"/images/icons/Group(7).svg":"/images/icons/price-tag-3-line.png",alt:"Selecionar Tarefa"})}),(0,r.jsx)(s,{show:x,onClose:function(){return j(!1)},atividades:A,selectedActivity:f,onSelectActivity:function(e){h&&h(e),j(!1)},onAddNew:v,triggerRef:b,title:"Selecionar Tarefa",hideAddNew:!0,centered:!0})]}),(0,r.jsxs)(i.d,{children:[(0,r.jsx)("button",{ref:y,onClick:function(){return N(!S)},title:"Selecionar Atividades",className:"app-icon-button",style:{backgroundColor:u?"rgba(24, 96, 115, 0.10)":"white",border:u?"1px solid rgba(24, 96, 115, 0.25)":"1px solid rgba(0, 0, 0, 0.15)"},children:(0,r.jsx)("img",{src:u?"/images/icons/Frame(1).svg":"/images/icons/frame(2).svg",alt:"Selecionar Atividades"})}),(0,r.jsx)(s,{show:S,onClose:function(){return N(!1)},atividades:P,selectedActivity:u,onSelectActivity:function(e){p(e),N(!1)},onAddNew:v,triggerRef:y,title:"Selecionar Atividades",centered:!0})]})]})]})})}},61909(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(52675),n(89463),n(28706),n(78459),n(11392);var r=n(74848),a=n(1806);function o(e){var t=e.isOpen,n=e.onClose,o=e.record;if(!t||!o)return null;var i=function(e){return e.startsWith("data:image")?e:"data:image/jpeg;base64,".concat(e)};return(0,r.jsx)(a.A,{show:t,onClose:n,title:"Visualizando Ponto - ".concat(o.memberName),size:"md",footer:(0,r.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:n,style:{fontFamily:"Inter",fontSize:"14px"},children:"Fechar"}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[(0,r.jsx)("div",{className:"mt-4",children:function(){if(o.selfie)return(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("img",{src:i(o.selfie),alt:"Selfie de validação",className:"img-fluid rounded",style:{maxHeight:"500px",maxWidth:"100%",objectFit:"contain"}}),(0,r.jsx)("div",{className:"mt-3",style:{color:"#6c757d",fontSize:"15px"},children:o.time})]});if(o.print)return(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("img",{src:i(o.print),alt:"Print de tela",className:"img-fluid rounded",style:{maxHeight:"500px",maxWidth:"100%",objectFit:"contain"}}),(0,r.jsx)("div",{className:"mt-3",style:{color:"#6c757d",fontSize:"15px"},children:o.time})]});if("geolocation"===o.validatedBy&&o.latitude&&o.longitude){var e=parseFloat(o.latitude),t=parseFloat(o.longitude),n="https://www.openstreetmap.org/export/embed.html?bbox=".concat(t-.01,",").concat(e-.01,",").concat(t+.01,",").concat(e+.01,"&layer=mapnik&marker=").concat(e,",").concat(t);return(0,r.jsxs)("div",{children:[(0,r.jsx)("iframe",{width:"100%",height:"450",frameBorder:"0",scrolling:"no",marginHeight:0,marginWidth:0,src:n,style:{border:"none",borderRadius:"8px"}}),(0,r.jsxs)("div",{className:"text-center mt-3",style:{color:"#6c757d",fontSize:"15px"},children:["Latitude: ",o.latitude,", Longitude: ",o.longitude]})]})}return"manual"===o.validatedBy||"sistema"===o.channel?(0,r.jsxs)("div",{className:"alert alert-info",role:"alert",children:[(0,r.jsx)("i",{className:"fas fa-info-circle mr-2"}),(0,r.jsx)("strong",{children:"Registro Manual"}),(0,r.jsxs)("p",{className:"mb-0 mt-2",children:["Este registro de ponto foi batido manualmente pelo usuário"," ",(0,r.jsx)("strong",{children:o.memberName})]}),"ausente"===o.status&&(0,r.jsx)("p",{className:"mb-0 mt-2",children:(0,r.jsx)("span",{className:"badge badge-warning",children:"Status: Ausente"})})]}):(0,r.jsxs)("div",{className:"alert alert-secondary",role:"alert",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle mr-2"}),"Nenhuma informação de validação disponível para este registro."]})}()}),o.justification&&(0,r.jsxs)("div",{className:"mt-4 pt-4",style:{borderTop:"1px solid #dee2e6"},children:[(0,r.jsx)("h6",{style:{fontFamily:"Inter",fontSize:"16px",fontWeight:600,color:"#5C5D5D",marginBottom:"16px"},children:function(e){switch(e){case"license":return"Licença";case"reason":return"Abono";default:return e}}(o.justification.type)}),"license"===o.justification.type&&void 0!==o.justification.partialLicense&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:"8px",display:"block"},children:"Licença Parcial"}),(0,r.jsx)("input",{type:"text",className:"form-control",value:o.justification.partialLicense?"Sim":"Não",readOnly:!0,style:{fontFamily:"Inter",fontSize:"14px",backgroundColor:"#f8f9fa",cursor:"not-allowed"}})]}),"license"===o.justification.type&&o.justification.payOffLicense&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:"8px",display:"block"},children:"Motivo"}),(0,r.jsx)("input",{type:"text",className:"form-control",value:function(e){switch(e){case"licenca_maternidade":return"Licença maternidade";case"licenca_medica":return"Licença médica";case"licenca_casamento":return"Licença casamento";case"other":return"Outro";default:return e}}(o.justification.payOffLicense),readOnly:!0,style:{fontFamily:"Inter",fontSize:"14px",backgroundColor:"#f8f9fa",cursor:"not-allowed"}})]}),(o.justification.startPeriod||o.justification.endPeriod)&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:"8px",display:"block"},children:"Período"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{className:"col-6",children:[(0,r.jsxs)("div",{className:"input-group",children:[(0,r.jsx)("input",{type:"text",className:"form-control",value:o.justification.startPeriod||"—",readOnly:!0,style:{fontFamily:"Inter",fontSize:"14px",backgroundColor:"#f8f9fa",cursor:"not-allowed"}}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",style:{backgroundColor:"#f8f9fa"},children:(0,r.jsx)("i",{className:"far fa-calendar-alt"})})})]}),(0,r.jsx)("small",{className:"text-muted",style:{fontFamily:"Inter",fontSize:"12px"},children:"Data de início"})]}),(0,r.jsxs)("div",{className:"col-6",children:[(0,r.jsxs)("div",{className:"input-group",children:[(0,r.jsx)("input",{type:"text",className:"form-control",value:o.justification.endPeriod||"—",readOnly:!0,style:{fontFamily:"Inter",fontSize:"14px",backgroundColor:"#f8f9fa",cursor:"not-allowed"}}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("span",{className:"input-group-text",style:{backgroundColor:"#f8f9fa"},children:(0,r.jsx)("i",{className:"far fa-calendar-alt"})})})]}),(0,r.jsx)("small",{className:"text-muted",style:{fontFamily:"Inter",fontSize:"12px"},children:"Data de finalização"})]})]})]}),o.justification.description&&(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{style:{fontFamily:"Inter",fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:"8px",display:"block"},children:"Descrição"}),(0,r.jsx)("textarea",{className:"form-control",value:o.justification.description,readOnly:!0,rows:3,style:{fontFamily:"Inter",fontSize:"14px",backgroundColor:"#f8f9fa",cursor:"not-allowed",resize:"none"}})]})]})]})})}},64466(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23792),n(89572),n(94170),n(2892),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(10287),n(26099),n(3362),n(47764),n(42762),n(23500),n(62953);var r,a,o=n(74848),i=n(49785),s=n(97665),l=n(57097),c=n(34559);n(23418),n(64346),n(34782),n(23288),n(62010),n(27495),n(38781),n(62062),n(5506);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.MEDICAL_CERTIFICATE="medical_certificate",e.CHILD_MONITORING="child_monitoring",e.SPOUSE_MONITORING="spouse_monitoring",e.UNION_ACTIVITY="union_activity",e.WEATHER_DELAY="weather_delay",e.TRANSPORT_DELAY="transport_delay",e.COMPENSATED_TIME_OFF="compensated_time_off",e.EMPLOYEE_MARRIAGE="employee_marriage",e.COURT_APPEARANCE="court_appearance",e.ELECTORAL_SERVICE="electoral_service",e.MILITARY_SERVICE="military_service",e.BLOOD_DONATION="blood_donation",e.OTHER="other"}(a||(a={}));var p=(m(m(m(m(m(m(m(m(m(m(r={},a.MEDICAL_CERTIFICATE,"Atestado médico"),a.CHILD_MONITORING,"Acompanhamento de filho"),a.SPOUSE_MONITORING,"Acompanhamento de cônjuge"),a.UNION_ACTIVITY,"Atividade sindical"),a.WEATHER_DELAY,"Atraso por chuva"),a.TRANSPORT_DELAY,"Atraso por transporte"),a.COMPENSATED_TIME_OFF,"Compensação de horas"),a.EMPLOYEE_MARRIAGE,"Casamento"),a.COURT_APPEARANCE,"Audiência judicial"),a.ELECTORAL_SERVICE,"Serviço eleitoral"),m(m(m(r,a.MILITARY_SERVICE,"Serviço militar"),a.BLOOD_DONATION,"Doação de sangue"),a.OTHER,"Outro"));var h=n(50418),v=n(96540),b=n(1806),y=n(47339);function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=g(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==g(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return N(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(N(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,N(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,N(d,"constructor",c),N(c,"constructor",l),l.displayName="GeneratorFunction",N(c,a,"GeneratorFunction"),N(d),N(d,a,"Generator"),N(d,r,function(){return this}),N(d,"toString",function(){return"[object Generator]"}),(S=function(){return{w:o,m:f}})()}function N(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}N=function(e,t,n,r){function o(t,n){N(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},N(e,t,n,r)}function k(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function C(e){var t,n,r=e.isOpen,u=e.onClose,f=e.record,m=(e.onSave,(0,s.jE)()),g=(0,i.mN)({mode:"onChange",defaultValues:{tipoAbono:"dia_inteiro",motivo:"",descricao:"",periodoInicioData:"",periodoInicioHora:"",periodoFimData:"",periodoFimHora:""}}),x=g.register,w=g.handleSubmit,N=g.control,C=g.watch,O=g.reset,A=g.formState.errors,E=C("tipoAbono"),P=C("motivo"),F=(0,v.useMemo)(function(){return Object.entries(p).map(function(e){var t=d(e,2);return{value:t[0],label:t[1]}})},[]),T=(0,l.n)({mutationFn:(t=S().m(function e(t){var n;return S().w(function(e){for(;;)switch(e.n){case 0:if(null!=f&&f.id){e.n=1;break}throw new Error("ID do registro (hitTheSpotId) não encontrado");case 1:return console.log(f),n={hitTheSpotId:f.id,timeReason:"dia_inteiro"===t.tipoAbono?"all_day":"a_part_of_the_hour",payOffAbsence:t.motivo,otherText:t.motivo===a.OTHER?t.descricao:void 0,startPeriod:"horas_falta"===t.tipoAbono?"".concat(t.periodoInicioData,"T").concat(t.periodoInicioHora,":00"):void 0,endPeriod:"horas_falta"===t.tipoAbono?"".concat(t.periodoFimData,"T").concat(t.periodoFimHora,":00"):void 0,description:t.descricao||void 0},e.a(2,(0,h.py)(n))}},e)}),n=function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(e){k(o,r,a,i,s,"next",e)}function s(e){k(o,r,a,i,s,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)}),onSuccess:function(e){m.invalidateQueries({queryKey:["time-management","hit-spot-time-history"]}),y.A.success(e.message||"Abono aplicado com sucesso!","Sucesso"),I()},onError:function(e){var t,n=(null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.error)||"Erro ao aplicar abono";y.A.error(n,"Erro")}}),D=T.mutate,_=T.isPending,I=function(){O(),u()};return r?(0,o.jsx)(b.A,{show:r,onClose:I,title:"Abonar",size:"md",footer:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:I,disabled:_,children:"Cancelar"}),(0,o.jsx)("button",{type:"submit",form:"abonarForm",className:"btn btn-primary",disabled:_,style:{backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:_?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("i",{className:"fas fa-spinner fa-spin mr-1"}),"Salvando..."]}):"Aplicar Abono"})]}),children:(0,o.jsxs)("form",{id:"abonarForm",onSubmit:w(function(e){e.motivo?e.motivo!==a.OTHER||e.descricao.trim()?"horas_falta"!==e.tipoAbono||e.periodoInicioData&&e.periodoInicioHora&&e.periodoFimData&&e.periodoFimHora?D(e):y.A.warning("Por favor, preencha o período de início e finalização.","Campo obrigatório"):y.A.warning("Por favor, descreva o motivo.","Campo obrigatório"):y.A.warning("Por favor, selecione o motivo.","Campo obrigatório")}),children:[(0,o.jsxs)("div",{className:"mb-4",children:[(0,o.jsxs)("div",{className:"form-check mb-3",children:[(0,o.jsx)("input",j(j({},x("tipoAbono")),{},{className:"form-check-input",type:"radio",id:"abonarDiaInteiro",value:"dia_inteiro",style:{width:"20px",height:"20px",cursor:"pointer"}})),(0,o.jsx)("label",{className:"form-check-label",htmlFor:"abonarDiaInteiro",style:{fontWeight:400,color:"#5C5D5D",marginLeft:"8px",cursor:"pointer"},children:"Abonar o dia inteiro"})]}),(0,o.jsxs)("div",{className:"form-check",children:[(0,o.jsx)("input",j(j({},x("tipoAbono")),{},{className:"form-check-input",type:"radio",id:"abonarHorasFalta",value:"horas_falta",style:{width:"20px",height:"20px",cursor:"pointer"}})),(0,o.jsx)("label",{className:"form-check-label",htmlFor:"abonarHorasFalta",style:{color:"#5C5D5D",marginLeft:"8px",cursor:"pointer"},children:"Abonar somente as horas em falta do dia"})]})]}),(0,o.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,o.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Selecione o Motivo"}),(0,o.jsx)("p",{children:"Informe o motivo pelo qual este ponto precisa ser ajustado."}),(0,o.jsxs)("div",{className:"row",children:[(0,o.jsxs)("div",{className:P===a.OTHER?"col-4":"col-12",children:[(0,o.jsx)(i.xI,{name:"motivo",control:N,rules:{required:"Motivo é obrigatório"},render:function(e){var t=e.field;return(0,o.jsx)(c.A,{options:F,value:t.value,placeholder:"Motivo*",size:"md",onChange:function(e){t.onChange(e),e!==a.OTHER&&O(function(e){return j(j({},e),{},{descricao:""})})}})}}),A.motivo&&(0,o.jsx)("small",{className:"text-danger d-block mt-1",children:A.motivo.message})]}),P===a.OTHER&&(0,o.jsxs)("div",{className:"col-8",children:[(0,o.jsx)("input",j(j({},x("descricao",{required:P===a.OTHER&&"Descrição é obrigatória"})),{},{type:"text",className:"form-control",placeholder:"Descreva o motivo*",style:{height:"100%"}})),A.descricao&&(0,o.jsx)("small",{className:"text-danger d-block mt-1",children:A.descricao.message})]})]})]}),"horas_falta"===E&&(0,o.jsxs)("div",{className:"row",children:[(0,o.jsxs)("div",{className:"col-6 mb-3",children:[(0,o.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Período de Início"}),(0,o.jsxs)("div",{className:"mb-2",children:[(0,o.jsx)("div",{className:"input-group",children:(0,o.jsx)("input",j(j({},x("periodoInicioData",{required:"horas_falta"===E&&"Data de início obrigatória"})),{},{type:"date",className:"form-control"}))}),A.periodoInicioData&&(0,o.jsx)("small",{className:"text-danger d-block mt-1",children:A.periodoInicioData.message})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("input",j(j({},x("periodoInicioHora",{required:"horas_falta"===E&&"Hora de início obrigatória"})),{},{type:"time",className:"form-control",placeholder:"Horas"})),A.periodoInicioHora&&(0,o.jsx)("small",{className:"text-danger d-block mt-1",children:A.periodoInicioHora.message})]})]}),(0,o.jsxs)("div",{className:"col-6 mb-3",children:[(0,o.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Período de Finalização"}),(0,o.jsxs)("div",{className:"mb-2",children:[(0,o.jsx)("div",{className:"input-group",children:(0,o.jsx)("input",j(j({},x("periodoFimData",{required:"horas_falta"===E&&"Data de fim obrigatória"})),{},{type:"date",className:"form-control"}))}),A.periodoFimData&&(0,o.jsx)("small",{className:"text-danger d-block mt-1",children:A.periodoFimData.message})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("input",j(j({},x("periodoFimHora",{required:"horas_falta"===E&&"Hora de fim obrigatória"})),{},{type:"time",className:"form-control",placeholder:"Horas"})),A.periodoFimHora&&(0,o.jsx)("small",{className:"text-danger d-block mt-1",children:A.periodoFimHora.message})]})]})]})]})}):null}},65207(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(62062),n(62010),n(9868),n(26099);var r=n(74848),a=n(10280);function o(e){var t=e.onCollaboratorClick,n=e.kpis,o=e.members,i=void 0===o?[]:o;if(0===i.length)return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"row mb-4",children:(n?[{label:"Total de Horas Trabalhadas",value:n.totalHoursWorked.formatted,variant:"teal-dark"},{label:"Total de Horas Faltantes",value:n.totalMissingHours.formatted,variant:"salmon"},{label:"Total de Horas Extras",value:n.totalExtraHours.formatted,variant:"turquoise"},{label:"Sobrecarga de Trabalho",value:"".concat(n.workOverload.toFixed(1),"%"),variant:"cyan"}]:[{label:"Total de Horas Trabalhadas",value:"0h00",variant:"teal-dark"},{label:"Total de Horas Faltantes",value:"0h00",variant:"salmon"},{label:"Total de Horas Extras",value:"0h00",variant:"turquoise"},{label:"Sobrecarga de Trabalho",value:"0%",variant:"cyan"}]).map(function(e,t){return(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(a.A,{value:e.value,label:e.label,variant:e.variant,className:"h-100"})},t)})}),(0,r.jsx)("div",{className:"text-center p-5 text-muted",children:"Nenhum membro encontrado para esta equipe/time."})]});var s=n?[{label:"Total de Horas Trabalhadas",value:n.totalHoursWorked.formatted,variant:"teal-dark"},{label:"Total de Horas Faltantes",value:n.totalMissingHours.formatted,variant:"salmon"},{label:"Total de Horas Extras",value:n.totalExtraHours.formatted,variant:"turquoise"},{label:"Sobrecarga de Trabalho",value:"".concat(n.workOverload.toFixed(1),"%"),variant:"cyan"}]:[{label:"Total de Horas Trabalhadas",value:"0h00",variant:"teal-dark"},{label:"Total de Horas Faltantes",value:"0h00",variant:"salmon"},{label:"Total de Horas Extras",value:"0h00",variant:"turquoise"},{label:"Sobrecarga de Trabalho",value:"0%",variant:"cyan"}];return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"row mb-4",children:s.map(function(e,t){return(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(a.A,{value:e.value,label:e.label,variant:e.variant,className:"h-100"})},t)})}),(0,r.jsx)("div",{className:"card app-card-surface mt-3",children:(0,r.jsx)("div",{className:"card-body p-0",children:(0,r.jsx)("div",{className:"ms-table-occurrences-wrapper",children:(0,r.jsxs)("table",{className:"ms-table-occurrences ms-table-occurrences-with-divider",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Colaborador"}),(0,r.jsx)("th",{children:"Carga Horária"}),(0,r.jsx)("th",{children:"Média Diária"}),(0,r.jsx)("th",{children:"Total de Horas"}),(0,r.jsx)("th",{children:"Horas Regulares"}),(0,r.jsx)("th",{children:"Horas Extras"}),(0,r.jsx)("th",{children:"Sobrecarga de Trabalho"}),(0,r.jsx)("th",{className:"ms-text-right",children:"Ações"})]})}),(0,r.jsx)("tbody",{children:0===i.length?(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:8,className:"ms-table-occurrences-empty",children:"Nenhum membro encontrado"})}):i.map(function(e){return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("div",{className:"tm-avatar-32 rounded-circle d-flex align-items-center justify-content-center text-white",style:{background:e.avatarBg},children:e.initials}),(0,r.jsx)("span",{children:e.name})]})}),(0,r.jsx)("td",{children:e.weeklyHours}),(0,r.jsx)("td",{children:e.dailyAverage}),(0,r.jsx)("td",{children:e.totalHours}),(0,r.jsx)("td",{children:e.regularHours}),(0,r.jsx)("td",{children:e.extraHours}),(0,r.jsx)("td",{children:(0,r.jsx)("span",{className:"badge badge-".concat((n=e.badge,{Baixa:"success",Moderada:"warning",Preocupante:"danger"}[n])),children:e.badge})}),(0,r.jsx)("td",{className:"ms-text-right",children:(0,r.jsx)("button",{className:"ms-table-occurrences-action-button",title:"Ver detalhes",onClick:function(){return null==t?void 0:t({id:e.id,name:e.name,initials:e.initials,avatarBg:e.avatarBg})},children:(0,r.jsx)("img",{src:"/images/icons/Group copy.svg",alt:"Ver gráfico",className:"ms-table-occurrences-action-icon",style:{width:"15px",height:"15px"}})})})]},e.id);var n})})]})})})})]})}},65342(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>w});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(62062),n(34782),n(1688),n(23288),n(94170),n(62010),n(2892),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(68156),n(62953);var r=n(74848),a=n(96540),o=n(33930),i=n(20826),s=n(92801),l=n(1125),c=n(50860),u=n(49293),d=n(36279),f=n(48592),m=n(17649),p=n(81623),h=n(10280);function v(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return b(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(b(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,b(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,b(d,"constructor",c),b(c,"constructor",l),l.displayName="GeneratorFunction",b(c,a,"GeneratorFunction"),b(d),b(d,a,"Generator"),b(d,r,function(){return this}),b(d,"toString",function(){return"[object Generator]"}),(v=function(){return{w:o,m:f}})()}function b(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}b=function(e,t,n,r){function o(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},b(e,t,n,r)}function y(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){y(o,r,a,i,s,"next",e)}function s(e){y(o,r,a,i,s,"throw",e)}i(void 0)})}}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(){var e,t,n=x((0,a.useState)(!0),2),b=n[0],y=n[1],j=x((0,a.useState)(new Date),2),w=j[0],S=j[1],N=x((0,a.useState)(8),2),k=N[0],C=N[1],O=x((0,a.useState)(!1),2),A=O[0],E=O[1],P=x((0,a.useState)(!1),2),F=P[0],T=P[1],D=x((0,a.useState)(null),2),_=D[0],I=D[1],M=x((0,a.useState)(!1),2),R=M[0],z=M[1],L=x((0,a.useState)(null),2),q=L[0],B=L[1],G=x((0,a.useState)(!1),2),H=G[0],W=G[1],U=(0,a.useRef)(null),V=function(e){return e.toISOString().split("T")[0]},Q=function(e,t){if(!e||!t)return"00:00";var n=x(e.split(":").map(Number),2),r=n[0],a=n[1],o=x(t.split(":").map(Number),2),i=60*o[0]+o[1]-(60*r+a),s=Math.floor(i/60),l=i%60;return"".concat(String(s).padStart(2,"0"),":").concat(String(l).padStart(2,"0"))},K=(0,o.I)({queryKey:["timesheet-activities",V(w)],queryFn:function(){return p.Ay.getActivities(V(w))},enabled:!0,retry:1,refetchOnWindowFocus:!1}),$=K.data,J=void 0===$?[]:$,Y=K.refetch,Z=K.isLoading,X=K.error,ee=(0,o.I)({queryKey:["timesheet-projects"],queryFn:function(){return p.Ay.getProjects()},enabled:!0,retry:1,refetchOnWindowFocus:!1}),te=ee.data,ne=void 0===te?[]:te,re=(ee.isLoading,ee.error,(0,o.I)({queryKey:["timesheet-activity-templates"],queryFn:function(){return p.Ay.getActivityTemplates()},enabled:!0,retry:1,refetchOnWindowFocus:!1})),ae=re.data,oe=void 0===ae?[]:ae,ie=(re.isLoading,re.error,(0,o.I)({queryKey:["timesheet-scheduled-activities",V(w)],queryFn:function(){return p.Ay.getScheduledActivities(V(w))},enabled:!0,retry:1,refetchOnWindowFocus:!1})),se=ie.data,le=void 0===se?[]:se,ce=ie.refetch,ue=ie.isLoading,de=ie.error,fe=(0,o.I)({queryKey:["timesheet-planned-activities",V(w)],queryFn:function(){return p.Ay.getPlannedActivities(V(w))},enabled:!0,retry:1,refetchOnWindowFocus:!1}),me=fe.data,pe=void 0===me?[]:me,he=fe.refetch,ve=fe.isLoading,be=fe.error,ye=(0,o.I)({queryKey:["timesheet-hours-worked-kpi",V(w)],queryFn:function(){return p.Ay.getHoursWorkedKPI(V(w))},enabled:!0,retry:1,refetchOnWindowFocus:!1}),ge=ye.data,xe=ye.isLoading,je=ye.refetch,we=(0,o.I)({queryKey:["timesheet-workload",V(w)],queryFn:function(){return p.Ay.getWorkload(V(w))},enabled:!0,retry:1,refetchOnWindowFocus:!1}),Se=we.data,Ne=we.isLoading,ke=(0,o.I)({queryKey:["timesheet-day-kpis",V(w)],queryFn:function(){return p.Ay.getDayKPIs(V(w))},enabled:!0,retry:1,refetchOnWindowFocus:!1}),Ce=ke.data,Oe=ke.isLoading,Ae=ke.refetch;(0,a.useEffect)(function(){void 0!==Se&&C(Se)},[Se]);var Ee=function(){var e=g(v().m(function e(t){var n;return v().w(function(e){for(;;)switch(e.p=e.n){case 0:return C(t),e.p=1,e.n=2,p.Ay.updateWorkload(V(w),t);case 2:je(),e.n=4;break;case 3:e.p=3,n=e.v,console.error("Erro ao atualizar carga horária:",n);case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),Pe=J.map(function(e){return{id:e.id,projeto:e.project_name,atividade:e.activity_name||e.activity_template_name||e.activity_name_legacy||"",task:e.project_task_name||"",inicio:e.start_time||"00:00",fim:e.end_time||"00:00",percentDia:"".concat(e.percentage,"%"),duracao:(t=e.duration,n=Math.floor(t/60),r=t%60,"".concat(n.toString().padStart(2,"0"),":").concat(r.toString().padStart(2,"0"))),comment:e.comment||""};var t,n,r}),Fe=ne.map(function(e){return{id:e.id,name:e.name}}),Te=oe.map(function(e){return{id:e.id,name:e.name}});var De=function(){var e=g(v().m(function e(){var t,n;return v().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,p.jZ)(V(w));case 1:return t=e.v,I(t.timesheetDayId),z(t.hasSatisfaction),W(t.isFinalized),B(t.workSatisfaction),y(!t.isFinalized),e.a(2,t);case 2:return e.p=2,n=e.v,console.error("Erro ao verificar status do dia:",n),B(null),e.a(2,null)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();(0,a.useEffect)(function(){console.log("🔄 Carregando atividades para data:",V(w)),Y(),De()},[w,Y]),(0,a.useEffect)(function(){},[J,ne,oe]);var _e,Ie,Me,Re,ze,Le=function(){var e=g(v().m(function e(t){var n,r,a,o,i;return v().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,n=_,H){e.n=2;break}return e.n=1,p.Ay.finalizeDay(V(w));case 1:r=e.v,console.log("Dia finalizado:",w),y(!1),W(!0),null!=r&&r.id&&(n=r.id,I(r.id)),e.n=3;break;case 2:y(!1);case 3:if(n){e.n=5;break}return e.n=4,De();case 4:o=e.v,n=null!==(a=null==o?void 0:o.timesheetDayId)&&void 0!==a?a:null;case 5:if(null===t||!n){e.n=6;break}return e.n=6,(0,p.VU)(n,t);case 6:return e.n=7,De();case 7:e.n=9;break;case 8:throw e.p=8,i=e.v,console.error("Erro ao finalizar dia:",i),i;case 9:return e.a(2)}},e,null,[[0,8]])}));return function(t){return e.apply(this,arguments)}}();return A?(0,r.jsx)(s.A,{title:"Dashboard - Controle de Atividades",subtitle:"Visão detalhada das horas trabalhadas e performance pessoal",showBackButton:!0,onBack:function(){return E(!1)},showExportButton:!0,onExport:function(){return console.log("Exportar dashboard")}}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(c.A,{title:"",subtitle:"",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center mb-3",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center mr-auto",children:[(0,r.jsx)("i",{className:"fas fa-chevron-left ".concat(Z?"text-muted":""," mr-2 ").concat(Z?"":"text-primary"),onClick:Z?void 0:function(){var e=new Date(w);e.setDate(e.getDate()-1),S(e)}}),(0,r.jsxs)("span",{className:"tm-date-label",onClick:function(){U.current&&U.current.showPicker()},title:"Clique para selecionar uma data",children:[(_e=w,Ie=["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"][_e.getDay()],Me=_e.getDate().toString().padStart(2,"0"),Re=["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"][_e.getMonth()],ze=_e.getFullYear(),"".concat(Ie,", ").concat(Me," ").concat(Re,". ").concat(ze)),Z&&(0,r.jsx)("span",{className:"ml-2",children:(0,r.jsx)("i",{className:"fas fa-spinner fa-spin text-primary"})}),(0,r.jsx)("input",{ref:U,type:"date",value:V(w),onChange:function(e){var t=new Date(e.target.value+"T00:00:00");S(t)},className:"sr-only"})]}),(0,r.jsx)("i",{className:"fas fa-chevron-right ".concat(Z?"text-muted":""," ml-2 ").concat(Z?"":"text-primary"),onClick:Z?void 0:function(){var e=new Date(w);e.setDate(e.getDate()+1),S(e)}})]}),(0,r.jsx)(i.A,{label:"Ver Dashboard",icon:"/images/icons/graph.svg",variant:"solid",onClick:function(){return E(!0)}}),(0,r.jsx)(i.A,{label:b?"Finalizar Dia":"Editar Dia",icon:b?"fas fa-check":"fas fa-pen",variant:"outline",onClick:function(){b?T(!0):(y(!0),W(!1))}})]}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)("div",{className:"row justify-content-start align-items-stretch",children:[(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(h.A,{value:null!==(e=null==Ce?void 0:Ce.projetos_desenvolvidos)&&void 0!==e?e:0,label:"Projetos Desenvolvidos",variant:"teal-dark",isLoading:Oe,className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(h.A,{value:null!==(t=null==Ce?void 0:Ce.atividades_desenvolvidas)&&void 0!==t?t:0,label:"Atividades Desenvolvidas",variant:"cyan",isLoading:Oe,className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(h.A,{value:xe?"Carregando...":ge?"".concat(ge.formatted_time," | ").concat(ge.percentage):"00:00h | 0%",label:"Horas Trabalhadas",variant:"turquoise",className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(h.A,{value:k,label:"Carga Horária",variant:"dark-gray",editable:!0,isInteger:!0,isLoading:Ne,onValueChange:function(e){Ee(e)},className:"h-100"})})]})}),Z?(0,r.jsx)(l.A,{message:"Carregando atividades..."}):X?(0,r.jsxs)("div",{className:"alert alert-danger",role:"alert",children:[(0,r.jsx)("strong",{children:"Erro ao carregar atividades:"})," ",X.message,(0,r.jsx)("button",{className:"btn btn-sm btn-outline-danger ml-2",onClick:function(){return Y()},children:"Tentar novamente"})]}):(0,r.jsx)(u.default,{projetos:Fe,atividadesDisponiveis:Te,activities:Pe,currentDate:V(w),workloadHours:k,onActivityEdit:function(e){return console.log("Editar atividade:",e)},onActivityDelete:function(e){return console.log("Deletar atividade:",e)},onActivityAction:function(e){return console.log("Ação adicional:",e)},onActivityAdded:function(){Y(),je(),Ae()}}),ue?(0,r.jsx)(l.A,{message:"Carregando atividades previstas..."}):de?(0,r.jsxs)("div",{className:"alert alert-warning",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-triangle mr-2"}),"Erro ao carregar atividades previstas"]}):(0,r.jsx)(d.default,{activities:le.map(function(e){return{id:e.id,projeto:e.projeto,atividade:e.atividade,inicio:e.inicio,fim:e.fim,percentDia:"".concat(Math.round(e.porcentagem_diaria||0),"%"),status:"A Fazer",prioridade:"Média",duracao:Q(e.inicio,e.fim)}}),projetos:Fe,atividadesDisponiveis:Te,currentDate:V(w),workloadHours:k,onActivityAdded:function(){Y(),ce(),he(),je(),Ae()}}),ve?(0,r.jsx)(l.A,{message:"Carregando atividades planejadas..."}):be?(0,r.jsxs)("div",{className:"alert alert-warning",children:[(0,r.jsx)("i",{className:"fas fa-exclamation-triangle mr-2"}),"Erro ao carregar atividades planejadas"]}):(0,r.jsx)(f.default,{activities:pe.map(function(e){return{id:e.id,projeto:e.projeto,atividade:e.atividade,inicio:e.inicio,fim:e.fim,percentDia:"".concat(Math.round(e.porcentagem_diaria||0),"%"),duracao:Q(e.inicio,e.fim)}}),projetos:Fe,atividadesDisponiveis:Te,currentDate:V(w),workloadHours:k,onActivityAdded:function(){Y(),je(),Ae()}}),(0,r.jsx)(m.default,{show:F,onClose:function(){return T(!1)},hasExistingSatisfaction:R,initialSatisfaction:q,onConfirmFinalize:Le})]})})}},67784(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>l});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(42762),n(62953);var r=n(74848),a=n(96540),o=n(1806);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=e.isOpen,n=e.onClose,s=e.onSave,l=e.occurrenceTitle,c=void 0===l?"":l,u=e.existingJustification,d=void 0===u?null:u,f=e.isSaving,m=void 0!==f&&f,p=i((0,a.useState)(""),2),h=p[0],v=p[1],b=d&&""!==d.trim(),y=function(){b||v(""),n()};return t?(0,r.jsx)(o.A,{show:t,onClose:y,title:"Justificativa",size:"md",footer:b?(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:y,children:"Fechar"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:y,disabled:m,children:"Fechar"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:function(){b||(h.trim()?s(h):alert("Por favor, escreva uma justificativa."))},disabled:m||!h.trim(),style:{backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:m?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"spinner-border spinner-border-sm me-2"}),"Enviando..."]}):(0,r.jsx)(r.Fragment,{children:"Enviar Justificativa"})})]}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[c&&(0,r.jsxs)("p",{className:"text-muted mb-3",style:{fontFamily:"Inter",fontSize:"14px"},children:["Ocorrência: ",(0,r.jsx)("strong",{children:c})]}),(0,r.jsx)("div",{className:"form-group mb-0",children:b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"form-control bg-light",style:{fontFamily:"Inter",fontSize:"14px",minHeight:"100px",whiteSpace:"pre-wrap",color:"#5C5D5D"},children:d}),(0,r.jsxs)("div",{className:"alert alert-info mt-3 mb-0",style:{fontFamily:"Inter",fontSize:"13px"},children:[(0,r.jsx)("i",{className:"fas fa-info-circle me-2"}),"Esta justificativa foi enviada anteriormente e não pode ser editada."]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("textarea",{className:"form-control",rows:4,placeholder:"Escreva sua justificativa",value:h,onChange:function(e){return v(e.target.value)},disabled:m,style:{fontFamily:"Inter",fontSize:"14px",resize:"vertical"}}),(0,r.jsx)("small",{className:"text-muted",style:{fontFamily:"Inter",fontSize:"13px"},children:"Tem certeza de que deseja enviar esta justificativa? Ela não poderá ser editada futuramente."})]})})]})}):null}},68925(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(62062),n(34782),n(1688),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(68156),n(62953),n(76031);var r=n(74848),a=n(96540),o=n(82942);n(85231);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),r=e.getFullYear();return"".concat(["Domingo","Segunda-Feira","Terça-Feira","Quarta-Feira","Quinta-Feira","Sexta-Feira","Sábado"][e.getDay()]," - ").concat(t,"/").concat(n,"/").concat(r)}function c(e){var t=e.onRegister,n=e.availableOptions,s=void 0===n?[]:n,c=e.onSelectOption,u=e.isNoneMode,d=void 0!==u&&u,f=e.disabled,m=void 0!==f&&f,p=(e.onPointCleared,i((0,a.useState)(new Date),2)),h=p[0],v=p[1],b=i((0,a.useState)((new Date).toISOString().split("T")[0]),2),y=(b[0],b[1],i((0,a.useState)(!1),2)),g=(y[0],y[1],i((0,a.useState)(null),2));g[0],g[1];(0,a.useEffect)(function(){var e=setInterval(function(){return v(new Date)},1e3);return function(){return clearInterval(e)}},[]);var x=String(h.getHours()).padStart(2,"0"),j=String(h.getMinutes()).padStart(2,"0"),w=String(h.getSeconds()).padStart(2,"0");return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"ms-clock-card-box",children:[(0,r.jsxs)("div",{className:"ms-clock-card-time",children:[x,":",j,":",w]}),(0,r.jsx)("div",{className:"ms-clock-card-date",children:l(h)})]}),d||0===s.length?(0,r.jsx)("button",{className:"ms-clock-card-register-btn",onClick:t,disabled:m,children:"Registrar Ponto"}):1===s.length?(0,r.jsx)("button",{className:"ms-clock-card-register-btn",onClick:function(){return null==c?void 0:c(s[0])},disabled:m,children:(0,o.kC)(s[0])}):(0,r.jsxs)("div",{className:"btn-group btn-block dropdown ms-clock-card-dropdown-wrapper",children:[(0,r.jsx)("button",{className:"ms-clock-card-register-btn dropdown-toggle","data-toggle":"dropdown",type:"button",disabled:m,children:"Registrar Ponto"}),(0,r.jsx)("div",{className:"dropdown-menu dropdown-menu-right",children:s.map(function(e,t){return(0,r.jsxs)("a",{className:"dropdown-item ".concat(m?"disabled":""),href:"#",onClick:function(t){t.preventDefault(),m||null==c||c(e)},children:[(0,r.jsx)("i",{className:"".concat((0,o.JC)(e)," mr-2")}),(0,o.kC)(e)]},t)})})]})]})}},69404(e,t,n){"use strict";n.d(t,{u:()=>r});var r=n(71083).A.create({baseURL:"/",timeout:25e3,withCredentials:!0})},69511(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(68156),n(62953),n(76031);var r=n(74848),a=n(96540);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e.activeTab,n=e.onTabChange,i=e.selectedDate,s=e.onDateChange,l=o((0,a.useState)(new Date),2),c=l[0],u=l[1],d=o((0,a.useState)(!1),2),f=d[0],m=d[1],p=(0,a.useRef)(null);(0,a.useEffect)(function(){var e=setInterval(function(){return u(new Date)},1e3);return function(){return clearInterval(e)}},[]);var h,v,b,y,g,x,j=String(c.getHours()).padStart(2,"0"),w=String(c.getMinutes()).padStart(2,"0"),S=String(c.getSeconds()).padStart(2,"0");return(0,r.jsxs)("div",{style:{backgroundColor:"#FFFFFF",borderRadius:"0 0 12px 12px",padding:"24px 20px",marginBottom:"16px"},children:[(0,r.jsx)("div",{style:{textAlign:"center",marginBottom:"12px"},children:(0,r.jsxs)("div",{style:{fontSize:"48px",fontWeight:700,lineHeight:1.1,color:"#2E3A46",letterSpacing:".5px",fontFamily:"Inter"},children:[j,":",w,":",S]})}),"ponto"===t&&(0,r.jsxs)("div",{style:{textAlign:"center",marginBottom:"16px",position:"relative"},children:[(0,r.jsxs)("button",{onClick:function(){m(!0),setTimeout(function(){var e,t,n;null===(e=p.current)||void 0===e||e.focus(),null===(t=p.current)||void 0===t||null===(n=t.showPicker)||void 0===n||n.call(t)},10)},style:{background:"none",border:"none",padding:"8px 16px",cursor:"pointer",fontSize:"13px",color:"#17A2B8",fontFamily:"Inter",fontWeight:500,textDecoration:f?"underline":"none"},children:[(0,r.jsx)("i",{className:"far fa-calendar-alt mr-2"}),(h=i,v=new Date(h+"T00:00:00"),b=["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"][v.getDay()],y=v.getDate(),g=v.getMonth()+1,x=v.getFullYear(),"".concat(b,", ").concat(String(y).padStart(2,"0"),"/").concat(String(g).padStart(2,"0"),"/").concat(x))]}),f&&(0,r.jsx)("input",{ref:p,type:"date",value:i,onChange:function(e){var t=e.target.value;t&&(s(t),m(!1))},onBlur:function(){return m(!1)},style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px",fontSize:"14px",border:"1px solid #ced4da",borderRadius:"6px",zIndex:1e3,backgroundColor:"#FFFFFF",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"}})]}),(0,r.jsxs)("div",{style:{display:"flex",borderBottom:"1px solid #E5E7EB"},children:[(0,r.jsx)("button",{onClick:function(){return n("ponto")},style:{flex:1,padding:"12px",border:"none",background:"none",fontSize:"15px",fontWeight:"ponto"===t?600:400,color:"ponto"===t?"#17A2B8":"#6B7280",borderBottom:"ponto"===t?"2px solid #17A2B8":"none",cursor:"pointer",fontFamily:"Inter",transition:"all 0.2s"},children:"Ponto"}),(0,r.jsx)("button",{onClick:function(){return n("ocorrencias")},style:{flex:1,padding:"12px",border:"none",background:"none",fontSize:"15px",fontWeight:"ocorrencias"===t?600:400,color:"ocorrencias"===t?"#17A2B8":"#6B7280",borderBottom:"ocorrencias"===t?"2px solid #17A2B8":"none",cursor:"pointer",fontFamily:"Inter",transition:"all 0.2s"},children:"Ocorrências"})]})]})}},69794(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>l});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var s=[{id:"black",src:"/images/tenant/black_full_card.png",alt:"Fundo preto"},{id:"blue",src:"/images/tenant/blue_full_card.png",alt:"Fundo azul"},{id:"white",src:"/images/tenant/white_full_card.png",alt:"Fundo branco"}];function l(e){var t=e.selected,n=e.onSelect,i=(0,a.useRef)(null),l=o((0,a.useState)(!1),2),c=l[0],u=l[1],d=o((0,a.useState)(0),2),f=d[0],m=d[1],p=o((0,a.useState)(0),2),h=p[0],v=p[1];(0,a.useEffect)(function(){var e=i.current;if(e){var t=function(t){var n,r;u(!0);var a="touches"in t?t.touches[0].pageX:t.pageX;m(a-e.getBoundingClientRect().left),v(e.scrollLeft),null===(n=document.activeElement)||void 0===n||null===(r=n.blur)||void 0===r||r.call(n),e.style.cursor="grabbing"},n=function(){u(!1),i.current&&(i.current.style.cursor="grab")},r=function(e){if(c){e.preventDefault();var t=i.current,n=("touches"in e?e.touches[0].pageX:e.pageX)-t.getBoundingClientRect().left;t.scrollLeft=h-(n-f)}};return e.addEventListener("mousedown",t),e.addEventListener("mouseleave",n),e.addEventListener("mouseup",n),e.addEventListener("mousemove",r),e.addEventListener("touchstart",t,{passive:!1}),e.addEventListener("touchend",n),e.addEventListener("touchmove",r,{passive:!1}),function(){e.removeEventListener("mousedown",t),e.removeEventListener("mouseleave",n),e.removeEventListener("mouseup",n),e.removeEventListener("mousemove",r),e.removeEventListener("touchstart",t),e.removeEventListener("touchend",n),e.removeEventListener("touchmove",r)}}},[c,f,h]),(0,a.useEffect)(function(){var e=i.current;if(e){var t=function(t){Math.abs(t.deltaX)<Math.abs(t.deltaY)&&(e.scrollLeft+=t.deltaY,t.preventDefault())};return e.addEventListener("wheel",t,{passive:!1}),function(){return e.removeEventListener("wheel",t)}}},[]);return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"position-relative",children:(0,r.jsx)("div",{ref:i,className:"d-flex align-items-center justify-content-center",style:{overflowX:"auto",display:"flex",alignItems:"center",scrollSnapType:"x mandatory",WebkitOverflowScrolling:"touch",paddingBottom:8,cursor:"grab",scrollbarWidth:"none"},tabIndex:0,onKeyDown:function(e){var t=i.current;if(t){"ArrowRight"===e.key&&t.scrollBy({left:436,behavior:"smooth"}),"ArrowLeft"===e.key&&t.scrollBy({left:-436,behavior:"smooth"})}},children:s.map(function(e){var a=t===e.id;return(0,r.jsx)("button",{type:"button",onClick:function(){return n(e.id)},className:"btn p-0 border-0",style:{scrollSnapAlign:"center",outline:"none",background:"transparent",userSelect:"none"},"aria-label":"Selecionar plano de fundo ".concat(e.alt),title:e.alt,children:(0,r.jsxs)("div",{className:"position-relative",style:{width:420,maxWidth:"70vw",height:220,borderRadius:16,overflow:"hidden",transform:a?"scale(1.02)":"scale(0.96)",transition:"transform 200ms ease, box-shadow 200ms ease, filter 200ms ease, opacity 200ms ease",filter:a?"none":"blur(2px)",opacity:a?1:.85,border:a?"2px solid rgba(0,123,255,0.6)":"2px solid transparent",cursor:"pointer",margin:"4px"},children:[(0,r.jsx)("img",{src:e.src,alt:e.alt,draggable:!1,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"black"===e.id?"0% 100%":"center",pointerEvents:"none"}}),a&&(0,r.jsx)("span",{className:"position-absolute badge badge-primary",style:{top:8,right:8,borderRadius:12,padding:"2px 8px",fontWeight:600},children:"Selecionado"})]})},e.id)})})}),(0,r.jsx)("div",{className:"d-flex justify-content-center mt-2",children:s.map(function(e){var a=t===e.id;return(0,r.jsx)("span",{onClick:function(){return n(e.id)},className:"mx-1",style:{width:8,height:8,borderRadius:"50%",display:"inline-block",background:a?"#007bff":"rgba(0,0,0,0.2)",cursor:"pointer"},"aria-label":"Ir para ".concat(e.alt),title:e.alt},e.id)})})]})}},70038(e,t,n){"use strict";n.d(t,{b1:()=>p,hY:()=>l,nx:()=>v,z1:()=>u,zS:()=>f});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(52354);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/work-shifts");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function u(e){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.post("/time-management/work-shifts",t);case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}function f(e,t){return m.apply(this,arguments)}function m(){return(m=s(a().m(function e(t,n){var o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.put("/time-management/work-shifts/".concat(t),n);case 1:return o=e.v,i=o.data,e.a(2,i.data)}},e)}))).apply(this,arguments)}function p(e){return h.apply(this,arguments)}function h(){return(h=s(a().m(function e(t){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.delete("/time-management/work-shifts/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}function v(e,t){return b.apply(this,arguments)}function b(){return(b=s(a().m(function e(t,n){var o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.post("/time-management/work-shifts/".concat(t,"/members"),{memberIds:n});case 1:return o=e.v,i=o.data,e.a(2,i.data)}},e)}))).apply(this,arguments)}},71458(e,t,n){"use strict";n.d(t,{A:()=>m});n(52675),n(89463),n(2259),n(28706),n(50113),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(9868),n(26099),n(27495),n(38781),n(21699),n(47764),n(71761),n(62953);var r=n(74848),a=n(46539),o=n(28482),i=n(69107),s=n(46668),l=n(77984),c=n(23495),u=n(88224);function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e){var t=e.selectedFilters,n=e.weeklyData,f=e.attendanceData,m=void 0===f?[]:f,p=t.includes("attendance"),h=t.includes("task"),v=(n.length>0&&n[0].label,[].concat(d(n.map(function(e){return e.total_hours})),d(m.map(function(e){return e.total_hours})))),b=Math.max.apply(Math,d(v).concat([8])),y=10*Math.ceil(b/10)||100,g=n.map(function(e,t){var n=m.find(function(t){return t.period===e.period}),r=h?e.total_hours:0,a=p&&n?n.total_hours:0,o=e.label||"Período ".concat(e.period),i=o;if("week"===e.type){var s=o.match(/^Sem \d+/);i=s?s[0]:o}return{label:i,fullLabel:o,type:e.type||"unknown",byTask:r,byAttendance:a,backgroundTask:Math.max(0,y-r),backgroundAttendance:Math.max(0,y-a)}}),x=g.length<=7?48:g.length<=12?36:24;return(0,r.jsxs)("div",{style:{userSelect:"none",transform:"none",transition:"none"},children:[(0,r.jsx)(o.u,{width:"100%",height:300,style:{transform:"none"},children:(0,r.jsxs)(u.E,{data:g,margin:{top:20,right:30,left:20,bottom:40},barSize:x,barGap:4,style:{cursor:"default"},onMouseMove:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},onMouseDown:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},onMouseUp:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},onClick:function(e){var t;return null==e||null===(t=e.stopPropagation)||void 0===t?void 0:t.call(e)},children:[(0,r.jsx)(i.d,{strokeDasharray:"3 3",vertical:!1,stroke:"#E0E0E0"}),(0,r.jsx)(c.h,{domain:[0,y],axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:12},width:40,tickFormatter:function(e){return"".concat(e,"h")}}),(0,r.jsx)(l.W,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:10},interval:0,angle:g.length>8?-45:0,textAnchor:g.length>8?"end":"middle",height:g.length>8?60:30}),(0,r.jsx)(a.m,{content:(0,r.jsx)(function(e){var t=e.active,n=e.payload;e.label;if(t&&n&&n.length){var a=n[0].payload;return(0,r.jsxs)("div",{style:{background:"rgba(255, 255, 255, 0.95)",border:"1px solid #ccc",borderRadius:"6px",padding:"6px 10px",boxShadow:"0 1px 4px rgba(0,0,0,0.1)",fontSize:"11px",lineHeight:"1.4",minWidth:"auto",maxWidth:"180px"},children:[(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:"3px",fontSize:"11px",color:"#333"},children:a.fullLabel}),h&&a.byTask>0&&(0,r.jsxs)("div",{style:{color:"#17A2B8",fontSize:"10px",margin:"2px 0"},children:["Tarefa: ",(0,r.jsxs)("strong",{children:[a.byTask.toFixed(1),"h"]})]}),p&&a.byAttendance>0&&(0,r.jsxs)("div",{style:{color:"#186073",fontSize:"10px",margin:"2px 0"},children:["Registro: ",(0,r.jsxs)("strong",{children:[a.byAttendance.toFixed(1),"h"]})]})]})}return null},{})}),p&&(0,r.jsx)(s.yP,{dataKey:"byAttendance",fill:"#186073",radius:[4,4,0,0],isAnimationActive:!1}),h&&(0,r.jsx)(s.yP,{dataKey:"byTask",fill:"#17A2B8",radius:[4,4,0,0],isAnimationActive:!1})]})}),(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-center gap-4 mt-3",children:[p&&(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{paddingRight:"12px"},children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:"#186073",borderRadius:"2px",marginRight:"8px"}}),(0,r.jsx)("span",{style:{fontSize:"12px",color:"#5C5D5D"},children:"Por Registro de Ponto"})]}),h&&(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{paddingRight:"12px"},children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:"#17A2B8",borderRadius:"2px",marginRight:"8px"}}),(0,r.jsx)("span",{style:{fontSize:"12px",color:"#5C5D5D"},children:"Por Tarefa"})]})]})]})}},72210(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>g});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(58940),n(27495),n(38781),n(31415),n(47764),n(90744),n(42762),n(23500),n(62953);var r=n(74848),a=n(96540),o=n(97665),i=n(57097),s=n(34559),l=n(50455),c=n(55098),u=n(47339),d=n(76336);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t,n,r=e.trim().split(/\s+/);return((null!==(t=null===(n=r[0])||void 0===n?void 0:n[0])&&void 0!==t?t:"")+(r.length>1?r[r.length-1][0]:"")).toUpperCase()}function g(e){var t,n,f,m,h=e.data,b=e.title,g=e.searchKeyword,x=void 0===g?"":g,j=e.onSearchChange,w=e.roleOptions,S=void 0===w?[]:w,N=e.selectedRole,k=e.onRoleChange,C=e.isLoading,O=void 0!==C&&C,A=e.isLoadingRoles,E=void 0!==A&&A,P=(e.onOpenFilters,e.onApplyFilters),F=e.onClearFilters,T=e.hasActiveFilters,D=void 0!==T&&T,_=e.total,I=e.totalPages,M=e.page,R=void 0===M?1:M,z=e.pageSize,L=void 0===z?10:z,q=e.onPageChange,B=e.onPageSizeChange,G=(0,d.L)().canEdit,H=null!=_?_:h.length,W=Math.ceil(H/L),U=R<(null!=I?I:W),V=(0,o.jE)(),Q=v((0,a.useState)({isOpen:!1}),2),K=Q[0],$=Q[1],J=v((0,a.useState)(new Set),2),Y=(J[0],J[1]),Z=(0,i.n)({mutationFn:function(e){var t=e.occurrenceId,n=e.approved;return(0,c.KI)(t,n)},onSuccess:function(e,t){var n=t.approved?"Justificativa aprovada com sucesso!":"Justificativa rejeitada com sucesso!";u.A.success(n,"Sucesso"),Y(new Set),V.invalidateQueries({queryKey:["time-management","overview","members-occurrences"]})},onError:function(e){var t,n=(null==e||null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.error)||"Erro ao processar justificativa";u.A.error(n,"Erro")}}),X=function(e,t){Z.mutate({occurrenceId:e.id,approved:t})},ee=v((0,a.useState)(!1),2),te=ee[0],ne=ee[1],re=(0,a.useRef)(null),ae=(0,a.useRef)(null),oe=v((0,a.useState)({occurrenceType:"",timeStart:"",timeEnd:"",status:""}),2),ie=oe[0],se=oe[1],le=function(){P&&P(ie),ne(!1)},ce=function(){se({occurrenceType:"",timeStart:"",timeEnd:"",status:""}),F&&F(),ne(!1)};return(0,a.useEffect)(function(){Y(new Set)},[R,h]),(0,a.useEffect)(function(){function e(e){if(te){var t=e.target,n=re.current&&re.current.contains(t),r=ae.current&&ae.current.contains(t);n||r||ne(!1)}}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[te]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{isOpen:K.isOpen,onClose:function(){$({isOpen:!1})},memberName:(null===(t=K.occurrence)||void 0===t?void 0:t.nome)||"",memberInitials:(null===(n=K.occurrence)||void 0===n?void 0:n.iniciais)||y((null===(f=K.occurrence)||void 0===f?void 0:f.nome)||""),justify:null===(m=K.occurrence)||void 0===m?void 0:m.justify}),(0,r.jsxs)("div",{className:"card app-card-surface mt-2",children:[(0,r.jsxs)("div",{className:"card-header app-controls-bar tm-controls-bar",children:[(0,r.jsxs)("div",{className:"d-none d-lg-flex align-items-center w-100",children:[(0,r.jsx)("h3",{className:"card-title mb-0 mr-2",children:b}),(0,r.jsx)("span",{className:"text-muted","data-toggle":"tooltip","data-placement":"top",title:"Lista de ocorrências recentes",children:(0,r.jsx)("i",{className:"far fa-question-circle"})}),(0,r.jsxs)("div",{className:"ml-auto d-flex align-items-center",style:{gap:8},children:[(0,r.jsxs)("div",{className:"app-controls-search",style:{width:220},children:[(0,r.jsx)("i",{className:"fas fa-search mr-2 text-muted"}),(0,r.jsx)("input",{type:"text",className:"form-control",placeholder:"Buscar por membro",value:x,onChange:function(e){return null==j?void 0:j(e.target.value)}})]}),(0,r.jsx)("div",{style:{width:220},children:(0,r.jsx)(s.A,{options:S,value:N,placeholder:"Selecionar função",onChange:k,loading:E})}),(0,r.jsxs)("div",{className:"dropdown",ref:re,children:[(0,r.jsx)("button",{type:"button",className:"app-list-filter-btn ".concat(D?"has-filters":""),onClick:function(){return ne(!te)},title:D?"Filtros ativos":"Filtros",children:(0,r.jsx)("i",{className:"fas fa-filter"})}),te&&(0,r.jsxs)("div",{className:"dropdown-menu app-filter-dropdown show",style:{right:0},children:[(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Tipo de ocorrência"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:ie.occurrenceType,onChange:function(e){return se(p(p({},ie),{},{occurrenceType:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"atraso",children:"Atraso"}),(0,r.jsx)("option",{value:"duplicado",children:"Ponto duplicado"}),(0,r.jsx)("option",{value:"falta",children:"Falta"})]})]}),(0,r.jsxs)("div",{className:"form-row",children:[(0,r.jsxs)("div",{className:"form-group col",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Hora início"}),(0,r.jsx)("input",{type:"time",className:"form-control form-control-sm",value:ie.timeStart,onChange:function(e){return se(p(p({},ie),{},{timeStart:e.target.value}))}})]}),(0,r.jsxs)("div",{className:"form-group col",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Hora fim"}),(0,r.jsx)("input",{type:"time",className:"form-control form-control-sm",value:ie.timeEnd,onChange:function(e){return se(p(p({},ie),{},{timeEnd:e.target.value}))}})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Status"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:ie.status,onChange:function(e){return se(p(p({},ie),{},{status:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"leve",children:"Leve"}),(0,r.jsx)("option",{value:"atencao",children:"Atenção"}),(0,r.jsx)("option",{value:"resolvido",children:"Resolvido"})]})]}),(0,r.jsxs)("div",{className:"d-flex justify-content-between pt-1",children:[(0,r.jsx)("button",{type:"button",className:"btn btn-sm text-muted",onClick:ce,children:"Limpar"}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-primary",onClick:le,children:"Aplicar"})]})]})]})]})]}),(0,r.jsxs)("div",{className:"d-lg-none",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("h3",{className:"card-title mb-0",children:b}),(0,r.jsx)("span",{className:"ml-2 text-muted",title:"Lista de ocorrências recentes",children:(0,r.jsx)("i",{className:"far fa-question-circle"})})]}),(0,r.jsxs)("div",{className:"dropdown",ref:ae,children:[(0,r.jsx)("button",{type:"button",className:"app-list-filter-btn ".concat(D?"has-filters":""),onClick:function(){return ne(!te)},children:(0,r.jsx)("i",{className:"fas fa-filter"})}),te&&(0,r.jsxs)("div",{className:"dropdown-menu app-filter-dropdown show",style:{right:0},children:[(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Tipo de ocorrência"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:ie.occurrenceType,onChange:function(e){return se(p(p({},ie),{},{occurrenceType:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"atraso",children:"Atraso"}),(0,r.jsx)("option",{value:"duplicado",children:"Ponto duplicado"}),(0,r.jsx)("option",{value:"falta",children:"Falta"})]})]}),(0,r.jsxs)("div",{className:"form-row",children:[(0,r.jsxs)("div",{className:"form-group col",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Hora início"}),(0,r.jsx)("input",{type:"time",className:"form-control form-control-sm",value:ie.timeStart,onChange:function(e){return se(p(p({},ie),{},{timeStart:e.target.value}))}})]}),(0,r.jsxs)("div",{className:"form-group col",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Hora fim"}),(0,r.jsx)("input",{type:"time",className:"form-control form-control-sm",value:ie.timeEnd,onChange:function(e){return se(p(p({},ie),{},{timeEnd:e.target.value}))}})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Status"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:ie.status,onChange:function(e){return se(p(p({},ie),{},{status:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"leve",children:"Leve"}),(0,r.jsx)("option",{value:"atencao",children:"Atenção"}),(0,r.jsx)("option",{value:"resolvido",children:"Resolvido"})]})]}),(0,r.jsxs)("div",{className:"d-flex justify-content-between pt-1",children:[(0,r.jsx)("button",{type:"button",className:"btn btn-sm text-muted",onClick:ce,children:"Limpar"}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-primary",onClick:le,children:"Aplicar"})]})]})]})]}),(0,r.jsxs)("div",{className:"d-flex flex-column",children:[(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsxs)("div",{className:"app-controls-search",children:[(0,r.jsx)("i",{className:"fas fa-search mr-2 text-muted"}),(0,r.jsx)("input",{type:"text",className:"form-control",placeholder:"Buscar por membro",value:x,onChange:function(e){return null==j?void 0:j(e.target.value)}})]})}),(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)(s.A,{options:S,value:N,placeholder:"Selecionar função",size:"sm",onChange:k,loading:E,className:""})})]})]})]}),(0,r.jsxs)("div",{className:"card-body p-0",children:[(0,r.jsx)("div",{className:"ms-table-occurrences-wrapper",children:(0,r.jsxs)("table",{className:"ms-table-occurrences ms-table-occurrences-with-divider",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Colaborador"}),(0,r.jsx)("th",{children:"Ocorrências"}),(0,r.jsx)("th",{children:"Horário do ponto"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{className:"ms-text-right",children:"Ações"})]})}),(0,r.jsxs)("tbody",{children:[O?(0,r.jsx)("tr",{children:(0,r.jsxs)("td",{colSpan:5,className:"ms-table-occurrences-empty",children:[(0,r.jsx)("div",{className:"spinner-border text-primary",role:"status",children:(0,r.jsx)("span",{className:"sr-only",children:"Carregando..."})}),(0,r.jsx)("p",{className:"text-muted mt-2 mb-0",children:"Carregando ocorrências..."})]})}):h.map(function(e){var t,n,a,o,i,s=null!==(t=e.iniciais)&&void 0!==t?t:y(e.nome),l=null!==(n=e.avatarBg)&&void 0!==n?n:"bg-secondary";return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("div",{className:"rounded text-white d-inline-flex align-items-center justify-content-center ".concat(l),style:{width:36,height:36,fontWeight:700},children:s}),(0,r.jsx)("span",{className:"ml-2",children:e.nome})]})}),(0,r.jsx)("td",{children:(i=e.ocorrencia,{ponto_duplicado:"Ponto Duplicado",atraso:"Atraso",atraso_severo:"Atraso Severo",saida_antecipada:"Saída Antecipada",ponto_dia_folga:"Ponto em Dia de Folga",ausencia_sem_justificativa:"Ausência sem Justificativa",ausencia_com_justificativa:"Ausência com Justificativa",registro_nao_fechado:"Ponto Não Fechado",sequencia_invalida:"Sequência Inválida"}[i]||i)}),(0,r.jsx)("td",{children:e.horario}),(0,r.jsx)("td",{children:(a=e.status,o={leve:{color:"#01D6C5",label:"Leve"},atencao:{color:"#DC3545",label:"Atenção"},resolvido:{color:"#17A2B8BF",label:"Resolvido"},pendente:{color:"#DC3545",label:"Pendente"}}[a],(0,r.jsxs)("div",{className:"ms-table-occurrences-status",children:[(0,r.jsx)("span",{className:"ms-table-occurrences-status-dot",style:{backgroundColor:o.color}}),(0,r.jsx)("span",{children:o.label})]}))}),(0,r.jsx)("td",{className:"ms-text-right",children:(0,r.jsxs)("div",{className:"btn-group",children:[(0,r.jsx)("button",{type:"button",className:"ms-table-occurrences-action-button","data-toggle":"dropdown","aria-expanded":"false",title:"Mais ações",children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v ms-table-occurrences-action-icon"})}),(0,r.jsxs)("div",{className:"dropdown-menu dropdown-menu-right",role:"menu",children:[(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(t){var n;t.preventDefault(),$({isOpen:!0,occurrence:n=e}),Y(function(e){return new Set(e).add(n.id)})},children:[(0,r.jsx)("i",{className:"far fa-file-alt mr-2"})," Ler Justificativa"]}),G&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(t){t.preventDefault(),X(e,!0)},disabled:Z.isPending||"resolvido"===e.status||"pendente"===e.status,children:[(0,r.jsx)("i",{className:"fas fa-check mr-2"}),Z.isPending?"Processando...":"Aprovar"]}),G&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(t){t.preventDefault(),X(e,!1)},disabled:Z.isPending||"resolvido"===e.status||"pendente"===e.status,children:[(0,r.jsx)("i",{className:"fas fa-times mr-2"}),"Rejeitar"]})]})]})})]},e.id)}),!O&&0===h.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:5,className:"ms-table-occurrences-empty",children:"Nenhuma ocorrência"})})]})]})}),(0,r.jsxs)("div",{className:"app-table-footer",style:{padding:"15px"},children:[(0,r.jsx)("div",{className:"app-table-footer__left",children:(0,r.jsxs)("small",{className:"text-muted",children:["Mostrando ",h.length," de ",H," Resultados"]})}),(0,r.jsx)("nav",{"aria-label":"Navegação da tabela",className:"app-table-footer__center",children:(0,r.jsxs)("ul",{className:"pagination pagination-sm mb-0 app-table-pagination",children:[(0,r.jsx)("li",{className:"page-item ".concat(R<=1?"disabled":""),children:(0,r.jsx)("button",{className:"page-link",onClick:function(){return null==q?void 0:q(Math.max(1,R-1))},"aria-label":"Anterior",disabled:R<=1,children:(0,r.jsx)("span",{"aria-hidden":"true",children:"‹"})})}),(0,r.jsx)("li",{className:"page-item active",children:(0,r.jsx)("span",{className:"page-link",children:R})}),(0,r.jsx)("li",{className:"page-item ".concat(U?"":"disabled"),children:(0,r.jsx)("button",{className:"page-link",onClick:function(){U&&(null==q||q(R+1))},"aria-label":"Próxima",disabled:!U,children:(0,r.jsx)("span",{"aria-hidden":"true",children:"›"})})})]})}),(0,r.jsxs)("div",{className:"d-flex align-items-center app-table-footer__right",children:[(0,r.jsx)("span",{className:"text-muted mr-2",children:"Resultados por página"}),(0,r.jsx)("select",{className:"custom-select custom-select-sm",style:{width:72},value:L,onChange:function(e){return null==B?void 0:B(parseInt(e.target.value,10))},children:[10,20,50,100].map(function(e){return(0,r.jsx)("option",{value:e,children:e},e)})})]})]})]})]})]})}},72722(e,t,n){"use strict";n.d(t,{A:()=>m});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(50113),n(51629),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(21699),n(47764),n(23500),n(62953);var r=n(74848),a=n(96540);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e){var t=e.options,n=e.selectedValues,o=e.onChange,i=e.placeholder,l=void 0===i?"Selecione":i,d=e.className,f=void 0===d?"":d,m=e.style,p=void 0===m?{}:m,h=e.dropdownStyle,v=void 0===h?{}:h,b=u((0,a.useState)(!1),2),y=b[0],g=b[1],x=(0,a.useRef)(null);(0,a.useEffect)(function(){var e=function(e){x.current&&!x.current.contains(e.target)&&g(!1)};return y&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[y]);var j=function(e){n.includes(e)?o(n.filter(function(t){return t!==e})):o([].concat(c(n),[e]))};return(0,r.jsxs)("div",{ref:x,className:"dropdown ".concat(f),style:s({position:"relative",display:"inline-block",minWidth:"220px"},p),children:[(0,r.jsxs)("button",{type:"button",className:"d-flex justify-content-between align-items-center",onClick:function(){return g(!y)},style:{width:"100%",minWidth:"fit-content",padding:"10px 12px",backgroundColor:"#F8F9FA",border:"1px solid #E0E0E0",height:"20px",borderRadius:"8px",cursor:"pointer",color:"#5C5D5D",outline:"none",transition:"all 0.2s ease",whiteSpace:"nowrap"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#F0F0F0"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#F8F9FA"},children:[(0,r.jsx)("span",{style:{textAlign:"left",paddingRight:"8px",whiteSpace:"nowrap"},children:function(){if(0===n.length)return l;if(n.length===t.length)return"".concat(t.length," Opções Selecionadas");if(1===n.length){var e=t.find(function(e){return e.value===n[0]});return(null==e?void 0:e.label)||l}return"".concat(n.length," Opções Selecionadas")}()}),(0,r.jsx)("i",{className:"fas fa-chevron-down",style:{fontSize:"10px",color:"#999",flexShrink:0,transform:y?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"}})]}),y&&(0,r.jsx)("div",{style:s({position:"absolute",top:"calc(100% + 4px)",left:0,minWidth:"100%",width:"max-content",backgroundColor:"#FFFFFF",border:"1px solid #E0E0E0",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",zIndex:1e3,maxHeight:"250px",overflowY:"auto"},v),children:t.map(function(e){return(0,r.jsxs)("label",{style:{display:"flex",alignItems:"center",padding:"8px 16px",cursor:"pointer",fontSize:"14px",color:"#333",fontFamily:"Inter",fontWeight:400,lineHeight:"100%",letterSpacing:"0%",transition:"background-color 0.15s ease",whiteSpace:"nowrap"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#F8F9FA"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[(0,r.jsx)("input",{type:"checkbox",className:"tm-select-checkbox",checked:n.includes(e.value),onChange:function(){return j(e.value)}}),(0,r.jsx)("span",{style:{whiteSpace:"nowrap",fontFamily:"Inter",fontWeight:400,lineHeight:"100%",letterSpacing:"0%"},children:e.label})]},e.value)})})]})}},72810(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(62062),n(26099);var r=n(74848),a=n(82942);function o(e){var t=e.isOpen,n=e.onClose,o=e.options,i=e.onSelectOption;return t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{onClick:n,style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1040,animation:"fadeIn 0.2s ease-in-out"}}),(0,r.jsxs)("div",{style:{position:"fixed",bottom:0,left:0,right:0,backgroundColor:"#FFFFFF",borderRadius:"16px 16px 0 0",padding:"24px 20px",paddingBottom:"32px",zIndex:1050,animation:"slideUp 0.3s ease-out",boxShadow:"0 -4px 16px rgba(0, 0, 0, 0.1)"},children:[(0,r.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,r.jsx)("h5",{style:{fontFamily:"Inter",fontSize:"18px",fontWeight:600,color:"#1F2937",marginBottom:"4px"},children:"Registrar Ponto"}),(0,r.jsx)("p",{style:{fontFamily:"Inter",fontSize:"13px",color:"#9CA3AF",margin:0},children:"Selecione uma opção para registrar seu ponto"})]}),(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:o.map(function(e,t){return(0,r.jsxs)("button",{onClick:function(){i(e),n()},style:{display:"flex",alignItems:"center",gap:"16px",padding:"16px",backgroundColor:"#F9FAFB",border:"none",borderRadius:"8px",cursor:"pointer",transition:"background-color 0.2s",width:"100%"},onMouseEnter:function(e){return e.currentTarget.style.backgroundColor="#F3F4F6"},onMouseLeave:function(e){return e.currentTarget.style.backgroundColor="#F9FAFB"},children:[(0,r.jsx)("div",{style:{width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#FFFFFF",borderRadius:"8px",color:"#17A2B8"},children:(0,r.jsx)("i",{className:(0,a.JC)(e),style:{fontSize:"20px"}})}),(0,r.jsx)("div",{style:{flex:1,textAlign:"left"},children:(0,r.jsx)("div",{style:{fontFamily:"Inter",fontSize:"15px",fontWeight:500,color:"#1F2937"},children:(0,a.kC)(e)})})]},t)})}),(0,r.jsx)("button",{onClick:n,style:{width:"100%",marginTop:"16px",padding:"14px",backgroundColor:"transparent",border:"1px solid #E5E7EB",borderRadius:"8px",color:"#6B7280",fontSize:"15px",fontWeight:500,fontFamily:"Inter",cursor:"pointer"},children:"Cancelar"})]}),(0,r.jsx)("style",{children:"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "})]}):null}},73215(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>m});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(58940),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(96540),o=n(61909),i=n(88195);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e){var t=e.data,n=e.total,s=e.totalPages,l=e.page,u=void 0===l?1:l,f=e.pageSize,m=void 0===f?10:f,p=e.onPageChange,h=e.onPageSizeChange,v=e.title,b=void 0===v?"Histórico":v,y=(e.onOpenFilters,e.hasActiveFilters),g=void 0!==y&&y,x=e.searchKeyword,j=void 0===x?"":x,w=e.onSearchChange,S=e.onExportCSV,N=e.isExporting,k=void 0!==N&&N,C=e.isLoading,O=void 0!==C&&C,A=e.onApplyFilters,E=e.onClearFilters,P=d((0,a.useState)(!1),2),F=P[0],T=P[1],D=d((0,a.useState)(null),2),_=D[0],I=D[1],M=null!=n?n:t.length,R=Math.ceil(M/m),z=u<(null!=s?s:R),L=d((0,a.useState)(!1),2),q=L[0],B=L[1],G=(0,a.useRef)(null),H=(0,a.useRef)(null),W=d((0,a.useState)({recordType:"",validatedBy:"",channel:"",mode:""}),2),U=W[0],V=W[1],Q=function(){A&&A(U),B(!1)},K=function(){V({recordType:"",validatedBy:"",channel:"",mode:""}),E&&E(),B(!1)};return(0,a.useEffect)(function(){function e(e){if(q){var t=e.target,n=G.current&&G.current.contains(t),r=H.current&&H.current.contains(t);n||r||B(!1)}}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[q]),(0,r.jsxs)("div",{className:"card app-card-surface mt-3",children:[(0,r.jsxs)("div",{className:"card-header app-controls-bar tm-controls-bar",children:[(0,r.jsxs)("div",{className:"d-none d-lg-flex align-items-center",children:[(0,r.jsx)("h3",{className:"card-title mb-0 mr-3",children:b}),(0,r.jsxs)("div",{className:"card-tools ml-auto d-flex align-items-center",children:[(0,r.jsxs)("button",{type:"button",className:"app-table-action-btn ml-2",onClick:S,disabled:k,children:[(0,r.jsx)("i",{className:"fas ".concat(k?"fa-spinner fa-spin":"fa-file"," mr-2")}),k?"Exportando...":"Exportar CSV"]}),(0,r.jsxs)("div",{className:"app-controls-search ml-2",style:{width:220},children:[(0,r.jsx)("i",{className:"fas fa-search mr-2 text-muted"}),(0,r.jsx)("input",{type:"text",className:"form-control",placeholder:"Buscar por Membro",value:j,onChange:function(e){return null==w?void 0:w(e.target.value)}})]}),(0,r.jsxs)("div",{className:"dropdown ml-2",ref:G,children:[(0,r.jsx)("button",{type:"button",className:"app-list-filter-btn ".concat(g?"has-filters":""),onClick:function(){return B(!q)},title:"Filtros",children:(0,r.jsx)("i",{className:"fas fa-filter"})}),q&&(0,r.jsxs)("div",{className:"dropdown-menu app-filter-dropdown show",style:{right:0},children:[(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Tipo de registro"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.recordType,onChange:function(e){return V(c(c({},U),{},{recordType:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"first_check_in",children:"Primeira Entrada"}),(0,r.jsx)("option",{value:"first_check_out",children:"Primeira Saída"}),(0,r.jsx)("option",{value:"second_check_in",children:"Segunda Entrada"}),(0,r.jsx)("option",{value:"second_check_out",children:"Segunda Saída"})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Validação por"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.validatedBy,onChange:function(e){return V(c(c({},U),{},{validatedBy:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"selfie",children:"Selfie"}),(0,r.jsx)("option",{value:"screenshot",children:"Screenshot"}),(0,r.jsx)("option",{value:"geolocation",children:"Geolocalização"}),(0,r.jsx)("option",{value:"manual",children:"Manual"})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Canal"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.channel,onChange:function(e){return V(c(c({},U),{},{channel:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"mobile",children:"App"}),(0,r.jsx)("option",{value:"web",children:"Navegador"}),(0,r.jsx)("option",{value:"sistema",children:"Sistema"})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Modo"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.mode,onChange:function(e){return V(c(c({},U),{},{mode:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"individual",children:"Individual"}),(0,r.jsx)("option",{value:"coletivo",children:"Coletivo"})]})]}),(0,r.jsxs)("div",{className:"d-flex justify-content-between pt-1",children:[(0,r.jsx)("button",{className:"btn btn-sm text-muted",type:"button",onClick:K,children:"Limpar"}),(0,r.jsx)("button",{className:"btn btn-sm btn-primary",type:"button",onClick:Q,children:"Aplicar"})]})]})]})]})]}),(0,r.jsxs)("div",{className:"d-lg-none",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,r.jsx)("h3",{className:"card-title mb-0",children:b}),(0,r.jsxs)("div",{className:"dropdown",ref:H,children:[(0,r.jsx)("button",{type:"button",className:"app-list-filter-btn ".concat(g?"has-filters":""),onClick:function(){return B(!q)},children:(0,r.jsx)("i",{className:"fas fa-filter"})}),q&&(0,r.jsxs)("div",{className:"dropdown-menu app-filter-dropdown show",style:{right:0},children:[(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Tipo de registro"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.recordType,onChange:function(e){return V(c(c({},U),{},{recordType:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"first_check_in",children:"Primeira Entrada"}),(0,r.jsx)("option",{value:"first_check_out",children:"Primeira Saída"}),(0,r.jsx)("option",{value:"second_check_in",children:"Segunda Entrada"}),(0,r.jsx)("option",{value:"second_check_out",children:"Segunda Saída"})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Validação por"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.validatedBy,onChange:function(e){return V(c(c({},U),{},{validatedBy:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"selfie",children:"Selfie"}),(0,r.jsx)("option",{value:"screenshot",children:"Screenshot"}),(0,r.jsx)("option",{value:"geolocation",children:"Geolocalização"}),(0,r.jsx)("option",{value:"manual",children:"Manual"})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Canal"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.channel,onChange:function(e){return V(c(c({},U),{},{channel:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"mobile",children:"App"}),(0,r.jsx)("option",{value:"web",children:"Navegador"}),(0,r.jsx)("option",{value:"sistema",children:"Sistema"})]})]}),(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Modo"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:U.mode,onChange:function(e){return V(c(c({},U),{},{mode:e.target.value}))},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"individual",children:"Individual"}),(0,r.jsx)("option",{value:"coletivo",children:"Coletivo"})]})]}),(0,r.jsxs)("div",{className:"d-flex justify-content-between pt-1",children:[(0,r.jsx)("button",{className:"btn btn-sm text-muted",type:"button",onClick:K,children:"Limpar"}),(0,r.jsx)("button",{className:"btn btn-sm btn-primary",type:"button",onClick:Q,children:"Aplicar"})]})]})]})]}),(0,r.jsxs)("div",{className:"d-flex flex-column",children:[(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsxs)("div",{className:"input-group input-group-sm",children:[(0,r.jsx)("input",{type:"text",className:"form-control",placeholder:"Buscar por Membro",value:j,onChange:function(e){return null==w?void 0:w(e.target.value)}}),(0,r.jsx)("div",{className:"input-group-append",children:(0,r.jsx)("button",{type:"button",className:"btn btn-default",children:(0,r.jsx)("i",{className:"fas fa-search"})})})]})}),(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsxs)("button",{type:"button",className:"btn btn-sm btn-default w-100",title:"Exportar CSV",onClick:S,disabled:k,children:[(0,r.jsx)("i",{className:"fas ".concat(k?"fa-spinner fa-spin":"fa-file"," mr-2")}),k?"Exportando...":"Exportar CSV"]})})]})]})]}),(0,r.jsx)("div",{className:"card-body",children:O?(0,r.jsx)("div",{className:"text-center py-4",children:(0,r.jsx)("div",{className:"spinner-border text-primary",role:"status",children:(0,r.jsx)("span",{className:"sr-only",children:"Carregando..."})})}):(0,r.jsx)(i.A,{columns:[{key:"nome",label:"Nome"},{key:"data",label:"Data",width:"18%"},{key:"tipo",label:"Tipo de Registro",width:"16%"},{key:"validacao",label:"Validação por",width:"18%"},{key:"canal",label:"Canal",width:"16%"},{key:"modo",label:"Modo",width:"12%"},{key:"acoes",label:"Ações",width:"8%",align:"right"}],data:t,renderRow:function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:"ms-table-cell",style:{textTransform:"capitalize"},children:e.nome}),(0,r.jsx)("td",{className:"ms-table-cell",style:{textTransform:"capitalize"},children:e.data}),(0,r.jsx)("td",{className:"ms-table-cell",style:{textTransform:"capitalize"},children:e.tipo}),(0,r.jsx)("td",{className:"ms-table-cell",style:{textTransform:"capitalize"},children:e.validacao}),(0,r.jsx)("td",{className:"ms-table-cell",style:{textTransform:"capitalize"},children:e.canal}),(0,r.jsx)("td",{className:"ms-table-cell",style:{textTransform:"capitalize"},children:e.modo}),(0,r.jsx)("td",{className:"app-table-cell-right",children:(0,r.jsx)("button",{type:"button",className:"app-table-action-button",onClick:function(){return function(e){var t={id:e.id,memberName:e.nome,memberId:e.memberId||0,time:e.data,recordType:e.tipo,type:e.type||"",validatedBy:e.validacao,channel:e.canal,mode:e.modo,status:e.status||"registrado",latitude:e.latitude||null,longitude:e.longitude||null,selfie:e.selfie||null,print:e.print||null,createdAt:e.createdAt||"",updatedAt:e.updatedAt||"",justificationType:e.justificationType||null,justificationId:e.justificationId||null,justification:e.justification||null};I(t),T(!0)}(e)},title:"Visualizar detalhes",children:(0,r.jsx)("i",{className:"fas fa-eye app-table-action-icon"})})})]})},emptyMessage:"Sem registros"})}),(0,r.jsxs)("div",{className:"card-footer app-table-footer",children:[(0,r.jsx)("div",{className:"app-table-footer__left",children:(0,r.jsxs)("small",{className:"text-muted",children:["Mostrando ",t.length," de ",M," Resultados"]})}),(0,r.jsx)("nav",{"aria-label":"Navegação da tabela",className:"app-table-footer__center",children:(0,r.jsxs)("ul",{className:"pagination pagination-sm mb-0 app-table-pagination",children:[(0,r.jsx)("li",{className:"page-item ".concat(u<=1?"disabled":""),children:(0,r.jsx)("button",{className:"page-link",onClick:function(){return null==p?void 0:p(Math.max(1,u-1))},"aria-label":"Anterior",disabled:u<=1,children:(0,r.jsx)("span",{"aria-hidden":"true",children:"‹"})})}),(0,r.jsx)("li",{className:"page-item active",children:(0,r.jsx)("span",{className:"page-link",children:u})}),(0,r.jsx)("li",{className:"page-item ".concat(z?"":"disabled"),children:(0,r.jsx)("button",{className:"page-link",onClick:function(){z&&(null==p||p(u+1))},"aria-label":"Próxima",disabled:!z,children:(0,r.jsx)("span",{"aria-hidden":"true",children:"›"})})})]})}),(0,r.jsxs)("div",{className:"d-flex align-items-center app-table-footer__right",children:[(0,r.jsx)("span",{className:"text-muted mr-2",children:"Resultados por página"}),(0,r.jsx)("select",{className:"custom-select custom-select-sm",style:{width:72},value:m,onChange:function(e){return null==h?void 0:h(parseInt(e.target.value,10))},children:[10,20,50,100].map(function(e){return(0,r.jsx)("option",{value:e,children:e},e)})})]})]}),(0,r.jsx)(o.default,{isOpen:F,onClose:function(){T(!1),I(null)},record:_})]})}},73236(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(74848);function a(e){var t=e.title,n=e.children,a=e.headerActions,o=e.className,i=void 0===o?"":o,s=e.bodyClassName,l=void 0===s?"":s;return(0,r.jsxs)("div",{className:"card app-card-surface ".concat(i),children:[(0,r.jsxs)("div",{className:"card-header app-controls-bar tm-controls-bar d-flex align-items-center",children:[(0,r.jsx)("h3",{className:"mb-0 mr-auto card-title",children:t}),a&&(0,r.jsx)("div",{children:a})]}),(0,r.jsx)("div",{className:"card-body ".concat(l),children:n})]})}},73638(e,t,n){"use strict";n.d(t,{A:()=>d,d:()=>f});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(58940),n(27495),n(38781),n(47764),n(23500),n(62953),n(76031);var r=n(74848),a=n(96540);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.show,n=e.onClose,o=e.children,i=e.position,l=void 0===i?"bottom":i,u=e.width,d=void 0===u?"auto":u,f=e.triggerRef,m=e.centered,p=void 0!==m&&m,h=(0,a.useRef)(null),v=c((0,a.useState)({}),2),b=v[0],y=v[1];(0,a.useEffect)(function(){if(t){var e=function(e){var t=e.target;!h.current||h.current.contains(t)||null!=f&&f.current&&f.current.contains(t)||n()};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[t,n,f]);var g=(0,a.useCallback)(function(){if(t&&null!=f&&f.current&&h.current){var e=f.current.getBoundingClientRect(),n=h.current.offsetWidth||parseInt(d)||220,r=p?0:-150,a={position:"fixed",zIndex:900};switch(l){case"left":a.top="".concat(e.top,"px"),a.right="".concat(window.innerWidth-e.left+8,"px");break;case"right":a.top="".concat(e.top,"px"),a.left="".concat(e.right+8,"px");break;case"bottom":if(a.top="".concat(e.bottom+8,"px"),p){var o=e.left+e.width/2;a.left="".concat(o-n/2,"px")}else a.left="".concat(e.left+r,"px");a.transform="none",a.right="auto";break;case"top":if(a.bottom="".concat(window.innerHeight-e.top+8,"px"),p){var i=e.left+e.width/2;a.left="".concat(i-n/2,"px")}else a.left="".concat(e.left+r,"px");a.transform="none",a.right="auto"}y(a)}},[t,f,p,l,d]);return(0,a.useEffect)(function(){if(t)return window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),function(){window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[t,g]),(0,a.useEffect)(function(){if(t&&null!=f&&f.current&&h.current)g(),setTimeout(g,0);else if(t&&(null==f||!f.current)){y({left:{position:"absolute",top:"0",right:"100%",marginRight:"8px",transform:"none"},right:{position:"absolute",top:"0",left:"100%",marginLeft:"8px",transform:"none"},bottom:{position:"absolute",top:"100%",left:"0",transform:"none",marginTop:"8px"},top:{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"}}[l])}},[t,l,f,g]),t?(0,r.jsx)("div",{ref:h,className:"dropdown-menu show",style:s(s({},b),{},{width:d}),children:o}):null}function f(e){var t=e.children;return(0,r.jsx)("div",{style:{position:"relative",display:"inline-block"},children:t})}},75842(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(20826),i=n(73638),s=n(92268),l={card:{backgroundColor:"#FFF",borderRadius:"8px",padding:"20px",marginTop:"20px",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},title:{color:"#17A2B8",fontSize:"16px",fontWeight:600,marginBottom:"15px"},counter:{fontSize:"12px",fontWeight:400,color:"rgba(0, 0, 0, 0.25)",padding:"12px 15px",backgroundColor:"#EAEBEE",borderRadius:"5px",textAlign:"center",minWidth:"170px"},iconButton:{background:"transparent",border:"none",cursor:"pointer",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem"},iconImage:{width:"20px",height:"20px"},select:{fontSize:"14px",padding:"8px 12px",border:"1px solid #EAEEF3",borderRadius:"5px",width:"100%",color:"#5C5D5D"},popover:{position:"absolute !important",top:"0 !important",right:"100% !important",marginRight:"8px !important",backgroundColor:"#FFF",border:"1px solid #EAEEF3",borderRadius:"5px",boxShadow:"0 4px 12px rgba(0,0,0,0.25)",zIndex:"9999 !important",minWidth:"200px",maxHeight:"300px",overflowY:"auto"},popoverItem:{padding:"10px 15px",cursor:"pointer",fontSize:"13px",color:"#5C5D5D",borderBottom:"1px solid #EAEEF3"}};function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){e.selectedProject,e.selectedActivity,e.onSelectActivity,e.onAddNewActivity,e.atividadesDisponiveis;var t=e.counterMode,n=e.onModeChange,u=e.onStartCounter,d=e.onStopCounter,f=e.onAddManualTime,m=e.isCounterRunning,p=e.counterTime,h=c((0,a.useState)(!1),2),v=h[0],b=h[1],y=(0,a.useRef)(null);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{children:"\n\t\t\t\n\t\t\t"}),(0,r.jsx)("div",{style:l.counter,className:"counter-display-responsive",children:"automatico"===t?m?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{fontSize:"14px",fontWeight:600,color:"#17A2B8"},children:p}),(0,r.jsx)("div",{style:{fontSize:"10px",color:"#6C757D"},children:"Contando..."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{fontSize:"14px",fontWeight:600,color:"#6C757D"},children:p}),(0,r.jsx)("div",{style:{fontSize:"10px",color:"#6C757D"},children:"Pronto para iniciar"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{fontSize:"14px",fontWeight:600,color:"#6C757D"},children:"Modo Manual"}),(0,r.jsx)("div",{style:{fontSize:"10px",color:"#6C757D"}})]})}),"automatico"===t?m?(0,r.jsx)(o.A,{label:"Parar Contador",icon:"/images/icons/stop.svg",variant:"solid",onClick:d,className:"btn-larger"}):(0,r.jsx)(o.A,{label:"Iniciar contador",icon:"/images/icons/Group(6).png",variant:"solid",onClick:u}):(0,r.jsx)(o.A,{label:"Adicionar Tempo",icon:"fas fa-plus",variant:"solid",onClick:f,className:"btn-larger"}),(0,r.jsxs)(i.d,{children:[(0,r.jsx)("button",{ref:y,style:l.iconButton,onClick:function(){return b(!v)},title:"Modo do Contador",className:"btn btn-link text-muted p-0",children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),(0,r.jsx)(s.A,{show:v,onClose:function(){return b(!1)},position:"bottom",triggerRef:y,options:[{label:"Automático",value:"automatico",icon:"/images/icons/automatico.svg",selected:"automatico"===t},{label:"Manual",value:"manual",icon:"/images/icons/play.svg",selected:"manual"===t}],onSelect:function(e){return n(e)}})]})]})}},75930(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>V});n(52675),n(89463),n(2259),n(45700),n(28706),n(88431),n(2008),n(50113),n(51629),n(23418),n(74423),n(64346),n(23792),n(48598),n(62062),n(72712),n(34782),n(15086),n(26910),n(59089),n(1688),n(60739),n(89572),n(23288),n(94170),n(62010),n(36033),n(2892),n(40150),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(10287),n(26099),n(3362),n(27495),n(38781),n(31415),n(21699),n(47764),n(71761),n(68156),n(25440),n(42762),n(23500),n(62953),n(3296),n(27208),n(48408);var r=n(74848),a=n(96540),o=n(53482),i=n(97665),s=n(33930),l=n(57097),c=n(50860),u=n(1806),d=n(12921),f=n(52354);function m(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return p(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(p(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,p(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,p(d,"constructor",c),p(c,"constructor",l),l.displayName="GeneratorFunction",p(c,a,"GeneratorFunction"),p(d),p(d,a,"Generator"),p(d,r,function(){return this}),p(d,"toString",function(){return"[object Generator]"}),(m=function(){return{w:o,m:f}})()}function p(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}p=function(e,t,n,r){function o(t,n){p(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},p(e,t,n,r)}function h(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){h(o,r,a,i,s,"next",e)}function s(e){h(o,r,a,i,s,"throw",e)}i(void 0)})}}function b(){return(b=v(m().m(function e(t){var n,r;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.post("/time-management/presence-lists",t);case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}))).apply(this,arguments)}function y(){return(y=v(m().m(function e(t,n){var r,a;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.post("/time-management/presence-lists/".concat(t,"/recreate"),n);case 1:return r=e.v,a=r.data,e.a(2,a)}},e)}))).apply(this,arguments)}function g(e){return x.apply(this,arguments)}function x(){return(x=v(m().m(function e(t){return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.delete("/time-management/presence-lists/".concat(t));case 1:return e.a(2)}},e)}))).apply(this,arguments)}function j(e,t){return w.apply(this,arguments)}function w(){return(w=v(m().m(function e(t,n){return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.delete("/time-management/presence-lists/".concat(t,"/participants/").concat(n));case 1:return e.a(2)}},e)}))).apply(this,arguments)}function S(e){return N.apply(this,arguments)}function N(){return(N=v(m().m(function e(t){var n,r;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.get("/v2/file-management/files/".concat(t));case 1:return n=e.v,r=n.data,e.a(2,r.data)}},e)}))).apply(this,arguments)}function k(){return C.apply(this,arguments)}function C(){return(C=v(m().m(function e(){var t,n;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.get("/time-management/presence-lists");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function O(e){return A.apply(this,arguments)}function A(){return(A=v(m().m(function e(t){var n,r;return m().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,f.F.get("/time-management/presence-lists/".concat(t));case 1:return n=e.v,r=n.data,e.a(2,r.data)}},e)}))).apply(this,arguments)}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function P(e){return function(e){if(Array.isArray(e))return q(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||L(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function D(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=E(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==E(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return I(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(I(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,I(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,I(d,"constructor",c),I(c,"constructor",l),l.displayName="GeneratorFunction",I(c,a,"GeneratorFunction"),I(d),I(d,a,"Generator"),I(d,r,function(){return this}),I(d,"toString",function(){return"[object Generator]"}),(_=function(){return{w:o,m:f}})()}function I(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}I=function(e,t,n,r){function o(t,n){I(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},I(e,t,n,r)}function M(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function R(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){M(o,r,a,i,s,"next",e)}function s(e){M(o,r,a,i,s,"throw",e)}i(void 0)})}}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||L(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t){if(e){if("string"==typeof e)return q(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?q(e,t):void 0}}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var B=[{value:"",label:"Status"},{value:"draft",label:"Rascunho"},{value:"in_progress",label:"Em andamento"},{value:"finished",label:"Finalizado"}],G=[{value:"",label:"Status"},{value:"Presente",label:"Presente"},{value:"Pendente",label:"Pendente"},{value:"Ausente",label:"Ausente"}],H=[{value:"treinamento",label:"Treinamento"},{value:"palestra",label:"Palestra"},{value:"workshop",label:"Workshop"},{value:"reuniao",label:"Reunião"},{value:"outros",label:"Outros"}],W=[{value:"",label:"Origem"}].concat(H),U=[{value:"qr_code",label:"QR Code",icon:"fas fa-qrcode mr-2 text-primary"},{value:"photo",label:"Foto",icon:"fas fa-mobile-alt mr-2 text-primary"},{value:"signature",label:"Assinatura",icon:"fas fa-signature mr-2 text-primary"}];function V(){var e,t,n,o=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).onHeaderContextChange,l=z((0,a.useState)({startDate:"",endDate:""}),2),u=l[0],d=l[1],f=z((0,a.useState)(""),2),m=f[0],p=f[1],h=z((0,a.useState)(""),2),v=h[0],b=h[1],y=z((0,a.useState)(""),2),x=y[0],w=y[1],N=z((0,a.useState)(10),2),C=N[0],A=N[1],E=z((0,a.useState)("list"),2),P=E[0],F=E[1],D=z((0,a.useState)(!1),2),I=D[0],M=D[1],L=z((0,a.useState)(null),2),q=L[0],G=L[1],H=z((0,a.useState)(null),2),U=H[0],V=H[1],$=z((0,a.useState)(null),2),J=$[0],Y=$[1],Z=z((0,a.useState)(null),2),X=Z[0],ee=Z[1],te=z((0,a.useState)(null),2),ne=te[0],re=te[1],ae=z((0,a.useState)(new Set),2),le=ae[0],ue=ae[1],de=(0,i.jE)(),pe=(0,s.I)({queryKey:["time-management","presence-lists"],queryFn:k}),he=pe.data,ge=pe.isFetching,xe=pe.isError,je=pe.refetch,we=(0,s.I)({queryKey:["time-management","presence-list-details",null==X?void 0:X.id],queryFn:function(){return O(X.id)},enabled:null!==X}),Ne=ge&&!he,ke=null!==(e=null==he?void 0:he.rows)&&void 0!==e?e:[],Oe=null!==(t=null==he?void 0:he.summary)&&void 0!==t?t:{active_lists:0,closed_lists:0,pending_validations:0,validated:0,attendance_average:0,presences:0,absences:0},Ae=[{title:"Listas Ativas",value:String(Oe.active_lists),progress:Ce(Oe.active_lists,Oe.active_lists+Oe.closed_lists),footer:"Fechadas: ".concat(Oe.closed_lists)},{title:"Pendências de validação",value:String(Oe.pending_validations),progress:Ce(Oe.validated,Oe.validated+Oe.pending_validations),footer:"Validadas: ".concat(Oe.validated)},{title:"Média de presença",value:"".concat(Oe.attendance_average,"%"),progress:Oe.attendance_average,footer:"Presenças: ".concat(Oe.presences," Faltas: ").concat(Oe.absences)}];(0,a.useEffect)(function(){var e=window,t=e.TM_PUSHER_KEY||"",n=e.TM_PUSHER_CLUSTER||"mt1",r=Number(e.TM_USER_ID)||0;if(t&&r&&void 0!==e.Pusher){var a=new e.Pusher(t,{cluster:n,forceTLS:!0}),o="time-management-user-".concat(r),i=a.subscribe(o);return i.bind("presence-list-generating",function(e){var t=Number(null==e?void 0:e.presenceId);t>0&&(ue(function(e){return new Set(e).add(t)}),je())}),i.bind("presence-list-ready",function(t){var n=Number(null==t?void 0:t.presenceId);if(n>0){var r,a;ue(function(e){var t=new Set(e);return t.delete(n),t}),je();var o=null!=t&&t.title?' "'.concat(t.title,'"'):"";null===(r=e.toastr)||void 0===r||null===(a=r.success)||void 0===a||a.call(r,"Lista de presença".concat(o," processada com sucesso."))}}),i.bind("presence-list-failed",function(t){var n,r,a=Number(null==t?void 0:t.presenceId);a>0&&ue(function(e){var t=new Set(e);return t.delete(a),t});var o=null!=t&&t.error?" ".concat(t.error):"";null===(n=e.toastr)||void 0===n||null===(r=n.error)||void 0===r||r.call(n,"Falha ao processar lista de presença.".concat(o))}),function(){i.unbind_all(),a.unsubscribe(o)}}},[]),(0,a.useEffect)(function(){return function(){return null==o?void 0:o({title:"GESTÃO DE TEMPO",hideTabs:!1})}},[o]),(0,a.useEffect)(function(){var e;o&&o(X?{title:(null===(e=we.data)||void 0===e?void 0:e.list.title)||X.title||"Lista de presença",onBack:function(){return ee(null)},hideTabs:!0}:{title:"GESTÃO DE TEMPO",hideTabs:!1})},[null===(n=we.data)||void 0===n?void 0:n.list.title,o,X]);var Ee=(0,a.useMemo)(function(){var e=Se(x);return ke.filter(function(t){var n=!e||Se("".concat(t.title," ").concat(t.method," ").concat(t.status," ").concat(t.origin)).includes(e),r=function(e,t){return!t||("draft"===t?"Rascunho"===e:"finished"===t?"Finalizada"===e:"in_progress"!==t||("Em andamento"===e||"Aguardando"===e||"Erro"===e))}(t.status,m),a=function(e,t,n){if(!n.startDate&&!n.endDate)return!0;var r=e?new Date(e).getTime():Number.NaN,a=t?new Date(t).getTime():r;if(Number.isNaN(r)&&Number.isNaN(a))return!1;var o=n.startDate?new Date("".concat(n.startDate,"T00:00:00")).getTime():Number.NEGATIVE_INFINITY,i=n.endDate?new Date("".concat(n.endDate,"T23:59:59")).getTime():Number.POSITIVE_INFINITY,s=Number.isNaN(r)?a:r,l=Number.isNaN(a)?s:a;return s<=i&&l>=o}(t.validationStartsAt,t.validationEndsAt,u),o=!v||t.originKey===v;return n&&r&&a&&o})},[ke,u,v,x,m]),Pe=function(){var e=R(_().m(function e(t){return _().w(function(e){for(;;)switch(e.n){case 0:if(window.confirm('Tem certeza que deseja excluir a lista "'.concat(t.title,'"?'))){e.n=1;break}return e.a(2);case 1:return e.n=2,g(t.id);case 2:(null==X?void 0:X.id)===t.id&&ee(null),de.invalidateQueries({queryKey:["time-management","presence-lists"]}),de.invalidateQueries({queryKey:["time-management","presence-list-details",t.id]});case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Fe=function(){var e=R(_().m(function e(t){var n,r,a,o,i,s;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,O(t.id);case 1:n=e.v,re(n),M(!0),e.n=3;break;case 2:e.p=2,s=e.v,i=(null==s||null===(r=s.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||"Não foi possível carregar a lista para edição.",null===(a=window.toastr)||void 0===a||null===(o=a.error)||void 0===o||o.call(a,i);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),Te=function(){var e=R(_().m(function e(t){return _().w(function(e){for(;;)switch(e.n){case 0:if(X){e.n=1;break}return e.a(2);case 1:if(window.confirm("Remover ".concat(t.name," desta lista de presença?"))){e.n=2;break}return e.a(2);case 2:return e.n=3,j(X.id,t.id);case 3:de.invalidateQueries({queryKey:["time-management","presence-lists"]}),de.invalidateQueries({queryKey:["time-management","presence-list-details",X.id]});case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),De=function(){var e=R(_().m(function e(t){var n,r,a;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.photoFileId){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,S(t.photoFileId);case 2:if(r=e.v,a=(null===(n=r.local_urls)||void 0===n?void 0:n.view)||r.preview_url||r.content_url){e.n=3;break}return window.alert("Não foi possível carregar a foto enviada."),e.a(2);case 3:Y(a),V(t),e.n=5;break;case 4:e.p=4,e.v,window.alert("Não foi possível carregar a foto enviada.");case 5:return e.a(2)}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}();return(0,r.jsxs)(c.A,{className:"tm-attendance-page",children:[!X&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"row no-gutters mb-md-4 app-controls-bar-row tm-attendance-controls-row",children:(0,r.jsxs)("div",{className:"col-12 d-flex flex-column flex-md-row justify-content-between align-items-md-center app-controls-bar filters-section pl-3 pr-2 py-2 tm-attendance-toolbar",children:[(0,r.jsx)("div",{className:"tm-attendance-header-actions mb-2 mb-md-0",children:(0,r.jsx)(Q,{icon:"fas fa-plus",onClick:function(){return M(!0)},children:"Criar Lista"})}),(0,r.jsxs)("div",{className:"tm-attendance-filters d-flex flex-column flex-md-row align-items-md-center justify-content-md-end order-2 w-100 w-md-auto","aria-label":"Filtros de presença",children:[(0,r.jsx)(ve,{value:u,onChange:d}),(0,r.jsx)(be,{options:B,value:m,onChange:p}),(0,r.jsx)(be,{options:W,value:v,onChange:b}),(0,r.jsx)(ye,{value:x,onChange:w}),(0,r.jsx)("button",{className:"tm-attendance-icon-button ".concat("cards"===P?"is-active":""),type:"button","aria-label":"cards"===P?"Ver em lista":"Ver em cards","aria-pressed":"cards"===P,onClick:function(){return F(function(e){return"cards"===e?"list":"cards"})},children:(0,r.jsx)("i",{className:"far fa-calendar-alt"})})]})]})}),(0,r.jsx)("div",{className:"tm-attendance-summary-grid",children:Ae.map(function(e){return(0,r.jsx)(oe,T({},e),e.title)})})]}),X?(0,r.jsx)(ce,{row:X,details:we.data,isLoading:we.isFetching&&!we.data,isError:we.isError,onRetry:function(){return we.refetch()},onShowPhoto:De,onRemoveParticipant:Te,itemsPerPage:C,onItemsPerPageChange:A}):xe?(0,r.jsxs)("div",{className:"tm-attendance-empty-card",children:["Não foi possível carregar as listas de presença.",(0,r.jsx)("button",{type:"button",className:"btn btn-link p-0 ml-2",onClick:function(){return je()},children:"Tentar novamente"})]}):Ne?(0,r.jsx)("div",{className:"tm-attendance-empty-card",children:"Carregando listas de presença..."}):"cards"===P?(0,r.jsx)(se,{rows:Ee,onView:ee,onEdit:Fe,onDelete:Pe,onShowQr:function(e){return G(e)},generatingIds:le}):(0,r.jsx)(ie,{rows:Ee,totalRows:ke.length,itemsPerPage:C,onItemsPerPageChange:A,onView:ee,onEdit:Fe,onDelete:Pe,onShowQr:function(e){return G(e)},generatingIds:le}),(0,r.jsx)(K,{show:I,onClose:function(){M(!1),re(null)},onCreated:function(e){G(e),e.id>0&&(ue(function(t){return new Set(t).add(e.id)}),je())},editDetails:ne}),(0,r.jsx)(fe,{row:q,onClose:function(){return G(null)}}),(0,r.jsx)(me,{participant:U,photoUrl:J,onClose:function(){V(null),Y(null)}})]})}function Q(e){var t=e.children,n=e.icon,a=e.onClick;return(0,r.jsxs)("button",{type:"button",className:"tm-attendance-create-button",onClick:a,children:[n&&(0,r.jsx)("i",{className:n,"aria-hidden":"true"}),t]})}function K(e){var t=e.show,n=e.onClose,s=e.onCreated,c=e.editDetails,d=(0,i.jE)(),m=!!c,p=z((0,a.useState)(""),2),h=p[0],v=p[1],g=z((0,a.useState)("treinamento"),2),x=g[0],j=g[1],w=z((0,a.useState)(""),2),S=w[0],N=w[1],k=z((0,a.useState)(""),2),C=k[0],A=k[1],E=z((0,a.useState)(""),2),F=E[0],T=E[1],D=z((0,a.useState)(""),2),I=D[0],M=D[1],L=z((0,a.useState)(""),2),q=L[0],B=L[1],G=z((0,a.useState)("qr_code"),2),W=G[0],V=G[1],Q=z((0,a.useState)([]),2),K=Q[0],J=Q[1],oe=z((0,a.useState)([]),2),ie=oe[0],se=oe[1],le=z((0,a.useState)([]),2),ce=le[0],ue=le[1],de=z((0,a.useState)([]),2),fe=de[0],me=de[1],pe=z((0,a.useState)(!1),2),he=pe[0],ve=pe[1],be=z((0,a.useState)(!1),2),ye=be[0],ge=be[1],xe=z((0,a.useState)(!1),2),je=xe[0],we=xe[1],Se=z((0,a.useState)(null),2),Ne=Se[0],ke=Se[1],Ce=z((0,a.useState)([]),2),Ae=Ce[0],Ee=Ce[1],Pe=z((0,a.useState)([]),2),Fe=Pe[0],Te=Pe[1],De=z((0,a.useState)([]),2),_e=De[0],Ie=De[1],Me=z((0,a.useState)(!1),2),Re=Me[0],ze=Me[1];(0,a.useEffect)(function(){var e,n,r,a,o,i,s,l;if(t){var u=null!==(e=null==c?void 0:c.participants.map(Z))&&void 0!==e?e:[],d=null!==(n=null==c?void 0:c.list.responsibles.map(X))&&void 0!==n?n:[];v(null!==(r=null==c?void 0:c.list.title)&&void 0!==r?r:""),j(null!==(a=null==c?void 0:c.list.eventOrigin)&&void 0!==a?a:"treinamento"),N(null!==(o=null==c?void 0:c.list.workload)&&void 0!==o?o:""),A(null!==(i=null==c?void 0:c.list.location)&&void 0!==i?i:""),T(null!==(s=null==c?void 0:c.list.programContent)&&void 0!==s?s:""),M(c?Oe(c.list.validationStartsAt):""),B(c?Oe(c.list.validationEndsAt):""),V(null!==(l=null==c?void 0:c.list.validationModel)&&void 0!==l?l:"qr_code"),J(u),se(d),ue(u),me(d),we(!1)}},[t,c]),(0,a.useEffect)(function(){t&&c&&(Ge("",ue,ve),Ge("",me,ge))},[t,c]);var Le,qe=(0,l.n)({mutationFn:function(e){return c?function(e,t){return y.apply(this,arguments)}(c.list.id,e):function(e){return b.apply(this,arguments)}(e)},onSuccess:(Le=R(_().m(function e(t){var r,a,o,i,l;return _().w(function(e){for(;;)switch(e.n){case 0:if(a=null,!((o=Number((null==t||null===(r=t.data)||void 0===r?void 0:r.id)||0))>0)||"qr_code"!==W&&"photo"!==W&&"signature"!==W){e.n=2;break}return e.n=1,O(o);case 1:l=e.v,a={id:l.list.id,title:l.list.title,method:l.list.method,globalToken:l.list.globalToken,signatureEditUrl:null!==(i=l.list.signatureEditUrl)&&void 0!==i?i:null};case 2:v(""),j("treinamento"),N(""),A(""),T(""),M(""),B(""),V("qr_code"),J([]),se([]),ue([]),me([]),we(!1),d.invalidateQueries({queryKey:["time-management","presence-lists"]}),n(),a&&s(a);case 3:return e.a(2)}},e)})),function(e){return Le.apply(this,arguments)})}),Be=!h.trim()||!I||!q||0===K.length||qe.isPending,Ge=function(){var e=R(_().m(function e(){var t,n,r,a,o,i=arguments;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:"",n=i.length>1?i[1]:void 0,(r=i.length>2?i[2]:void 0)(!0),e.p=1,e.n=2,f.F.get("/v2/company/members",{params:{term:t,limit:100},headers:{Accept:"application/json"}});case 2:a=e.v,o=a.data,n(ne(o).map(Y));case 3:return e.p=3,r(!1),e.f(3);case 4:return e.a(2)}},e,null,[[1,,3,4]])}));return function(){return e.apply(this,arguments)}}(),He=function(){var e=R(_().m(function e(){var t,n,r,a,o,i,s,l,c,u,d;return _().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!(Fe.length>0)){e.n=1;break}return e.a(2);case 1:return ze(!0),e.p=2,e.n=3,Promise.all([f.F.get("/v2/company/members",{params:{term:"",limit:1e3},headers:{Accept:"application/json"}}),f.F.get("/v2/company/teams",{params:{term:""},headers:{Accept:"application/json"}}).catch(function(){return{data:{data:[]}}})]);case 3:t=e.v,n=z(t,2),r=n[0],a=n[1],o=ne(r.data).map(Y),i=ne(a.data).map(function(e){return{value:String(e.id),label:e.name||e.text||"#".concat(e.id)}}),Te(o),ue(function(e){return te(e,o)}),me(function(e){return te(e,o)}),Ie(i),e.n=5;break;case 4:e.p=4,d=e.v,u=(null==d||null===(s=d.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.message)||"Não foi possível carregar os membros.",null===(l=window.toastr)||void 0===l||null===(c=l.error)||void 0===c||c.call(l,u);case 5:return e.p=5,ze(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(){return e.apply(this,arguments)}}(),We=function(e){Ee("participants"===e?K:ie),ke(e),He()},Ue=function(){ke(null),Ee([])},Ve=function(e,t){(function(e){return e instanceof Element&&!!e.closest(".tm-presence-select__multi-value__remove, .tm-presence-select__clear-indicator")})(e.target)||(e.preventDefault(),We(t))},Qe=function(e,t){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),We(t))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{show:t,onClose:n,title:m?"Editar Lista de Presença":"Nova Lista de Presença",size:"xl",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{type:"button",className:"btn btn-link text-muted text-decoration-none mr-auto",onClick:function(){var e,t,n=function(e){var t,n=window,r=String(n.TM_ATTENDANCE_LIST_PREVIEW_URL||"").trim();if(!r)return"";var a=e.selectedResponsibles.map(function(e,t){return{id:e.value||t+1,name:e.label||e.email||"Responsável ".concat(t+1),email:e.email||""}}),o=(null===(t=a[0])||void 0===t?void 0:t.name)||String(n.TM_ATTENDANCE_LIST_PREVIEW_RESPONSIBLE||"Responsavel MetaHuman"),i=String(n.TM_ATTENDANCE_LIST_PREVIEW_COMPANY||"MetaHuman"),s=e.selectedParticipants.map(function(e,t){return{user_id:e.value||t+1,name:e.label||"Participante ".concat(t+1),email:e.email||"",company:"",role:"",area:"",status:"pending"}}),l=new URL(r,window.location.origin);l.searchParams.set("title",e.title.trim()||"Lista de Presenca"),l.searchParams.set("description",e.title.trim()||"Lista de Presenca"),l.searchParams.set("event_type",function(e){var t=H.find(function(t){return t.value===e});return(null==t?void 0:t.label)||"Treinamento"}(e.eventOrigin)),e.validationStartsAt&&l.searchParams.set("date",ee(e.validationStartsAt));e.validationEndsAt&&l.searchParams.set("end_date",ee(e.validationEndsAt));l.searchParams.set("workload",e.workload.trim()||"15 minutos"),l.searchParams.set("location",e.location.trim()||"-"),e.programContent.trim()&&l.searchParams.set("program_content",e.programContent.trim());l.searchParams.set("participants",String(s.length||10)),s.length&&l.searchParams.set("participants_data",JSON.stringify(s));l.searchParams.set("company",i),l.searchParams.set("responsible",o),a.length&&l.searchParams.set("responsibles_data",JSON.stringify(a));return l.searchParams.set("exported_by",String(n.TM_ATTENDANCE_LIST_PREVIEW_RESPONSIBLE||o)),l.searchParams.set("unit",e.title.trim()||"Lista de Presenca"),l.toString()}({title:h,eventOrigin:x,workload:S,location:C,programContent:F,validationStartsAt:I,validationEndsAt:q,selectedParticipants:K,selectedResponsibles:ie});n?window.open(n,"_blank","noopener,noreferrer"):null===(e=window.toastr)||void 0===e||null===(t=e.error)||void 0===t||t.call(e,"Não foi possível abrir o preview da lista de presença.")},children:[(0,r.jsx)("i",{className:"far fa-eye mr-1"}),"Ver template"]}),(0,r.jsx)(u.M,{onCancel:n,onConfirm:function(){var e;Be||qe.mutate({title:h.trim(),event_origin:x,validation_model:W,workload:S.trim(),location:C.trim(),program_content:F.trim(),validation_starts_at:I,validation_ends_at:q,participant_user_ids:K.map(function(e){return e.value}),responsible_user_ids:ie.map(function(e){return e.value}),product:(null==c?void 0:c.list.productKey)||"manual",product_reference_id:null!==(e=null==c?void 0:c.list.productReferenceId)&&void 0!==e?e:null,send_chat_message:je})},cancelText:"Cancelar",confirmText:qe.isPending?m?"Salvando...":"Criando...":m?"Salvar alterações":"Criar lista",confirmDisabled:Be})]}),children:(0,r.jsxs)("form",{className:"tm-attendance-create-form",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-7",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceTitle",children:"Título da lista *"}),(0,r.jsx)("input",{id:"presenceTitle",type:"text",className:"form-control",value:h,onChange:function(e){return v(e.target.value)},placeholder:"Ex.: Lista de presença para treinamento"})]})}),(0,r.jsx)("div",{className:"col-md-5",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceEventOrigin",children:"Origem do evento *"}),(0,r.jsx)("select",{id:"presenceEventOrigin",className:"form-control",value:x,onChange:function(e){return j(e.target.value)},children:H.map(function(e){return(0,r.jsx)("option",{value:e.value,children:e.label},e.value)})})]})})]}),(0,r.jsxs)("details",{className:"tm-attendance-optional-accordion mb-3",children:[(0,r.jsx)("summary",{className:"tm-attendance-optional-summary",children:"Campos opcionais da lista de assinatura"}),(0,r.jsxs)("div",{className:"tm-attendance-optional-body mt-3",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceWorkload",children:"Carga horária"}),(0,r.jsx)("input",{id:"presenceWorkload",type:"text",className:"form-control",value:S,maxLength:100,onChange:function(e){return N(e.target.value)},placeholder:"Ex.: 15 minutos"})]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceLocation",children:"Local"}),(0,r.jsx)("input",{id:"presenceLocation",type:"text",className:"form-control",value:C,maxLength:80,onChange:function(e){return A(e.target.value)},placeholder:"Ex.: Sala 01"})]})})]}),(0,r.jsxs)("div",{className:"form-group mb-0",children:[(0,r.jsx)("label",{htmlFor:"presenceProgramContent",children:"Conteúdo programático"}),(0,r.jsx)("textarea",{id:"presenceProgramContent",className:"form-control",value:F,maxLength:1e3,rows:4,onChange:function(e){return T(e.target.value)},placeholder:"Descreva brevemente os tópicos abordados."}),(0,r.jsxs)("small",{className:"form-text text-muted",children:[F.length,"/1000 caracteres"]})]})]})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceParticipants",children:"Participantes *"}),(0,r.jsx)("div",{role:"button",tabIndex:0,onMouseDown:function(e){return Ve(e,"participants")},onKeyDown:function(e){return Qe(e,"participants")},children:(0,r.jsx)(o.Ay,{inputId:"presenceParticipants",isMulti:!0,isSearchable:!1,openMenuOnClick:!1,openMenuOnFocus:!1,menuIsOpen:!1,isLoading:he,options:ce,value:K,onChange:function(e){return J(P(e))},placeholder:"Selecione os participantes",noOptionsMessage:function(){return"Nenhum participante encontrado"},classNamePrefix:"tm-presence-select",styles:ae,menuPortalTarget:"undefined"!=typeof document?document.body:void 0,menuPosition:"fixed"})})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceResponsibles",children:"Responsáveis"}),(0,r.jsx)("div",{role:"button",tabIndex:0,onMouseDown:function(e){return Ve(e,"responsibles")},onKeyDown:function(e){return Qe(e,"responsibles")},children:(0,r.jsx)(o.Ay,{inputId:"presenceResponsibles",isMulti:!0,isSearchable:!1,openMenuOnClick:!1,openMenuOnFocus:!1,menuIsOpen:!1,isLoading:ye,options:fe,value:ie,onChange:function(e){return se(P(e))},placeholder:"Selecione os responsáveis",noOptionsMessage:function(){return"Nenhum responsável encontrado"},classNamePrefix:"tm-presence-select",styles:ae,menuPortalTarget:"undefined"!=typeof document?document.body:void 0,menuPosition:"fixed"})})]}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceValidationStartsAt",children:"Validação a partir de *"}),(0,r.jsx)("input",{id:"presenceValidationStartsAt",type:"datetime-local",className:"form-control",value:I,onChange:function(e){return M(e.target.value)}})]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"presenceValidationEndsAt",children:"Validação até *"}),(0,r.jsx)("input",{id:"presenceValidationEndsAt",type:"datetime-local",className:"form-control",value:q,onChange:function(e){return B(e.target.value)}})]})})]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{children:"Modelo de validação *"}),(0,r.jsx)("div",{className:"row",children:U.map(function(e){var t=W===e.value;return(0,r.jsx)("div",{className:"col-12 col-md-4 mb-2",children:(0,r.jsxs)("button",{type:"button",onClick:function(){return V(e.value)},className:"btn btn-block text-left d-flex align-items-center ".concat(t?"border-primary text-primary bg-primary-soft":"border"),children:[(0,r.jsx)("i",{className:e.icon}),e.label]})},e.value)})}),(0,r.jsx)("small",{className:"form-text text-muted",children:"QR Code e Foto geram um QR Code global por lista que o manager imprime e cola no evento. O participante precisa fazer login para confirmar presença."})]}),(0,r.jsxs)("div",{className:"custom-control custom-checkbox",children:[(0,r.jsx)("input",{type:"checkbox",className:"custom-control-input",id:"presenceSendChatMessage",checked:je,onChange:function(e){return we(e.target.checked)}}),(0,r.jsx)("label",{className:"custom-control-label",htmlFor:"presenceSendChatMessage",children:"Enviar mensagem automaticamente no chat para os participantes"})]}),qe.isError&&(0,r.jsx)("div",{className:"alert alert-danger mt-3 mb-0",children:re(qe.error,m)})]})}),(0,r.jsx)($,{show:null!==Ne,title:"responsibles"===Ne?"Selecionar Responsáveis":"Selecionar Participantes",members:Fe,teams:_e,selected:Ae,isLoading:Re,onChange:Ee,onClose:Ue,onConfirm:function(){"participants"===Ne&&(J(Ae),ue(function(e){return te(e,Ae)})),"responsibles"===Ne&&(se(Ae),me(function(e){return te(e,Ae)})),Ue()}})]})}function $(e){var t=e.show,n=e.title,o=e.members,i=e.teams,s=e.selected,l=e.isLoading,c=e.onChange,d=e.onClose,f=e.onConfirm,m=z((0,a.useState)(""),2),p=m[0],h=m[1],v=z((0,a.useState)(""),2),b=v[0],y=v[1],g=(0,a.useMemo)(function(){return new Map(s.map(function(e){return[String(e.value),e]}))},[s]),x=(0,a.useMemo)(function(){var e=Se("".concat(p));return o.filter(function(t){var n,r=!e||Se("".concat(t.label," ").concat(t.email)).includes(e),a=!b||(null!==(n=t.teams)&&void 0!==n?n:[]).some(function(e){return e.id===b});return r&&a})},[o,p,b]),j=x.length>0&&x.every(function(e){return g.has(String(e.value))});(0,a.useEffect)(function(){t||(h(""),y(""))},[t]);var w=function(e){var t=String(e.value);g.has(t)?c(s.filter(function(e){return String(e.value)!==t})):c([].concat(P(s),[e]))};return(0,r.jsxs)(u.A,{show:t,onClose:d,title:n,size:"lg",className:"tm-member-picker-modal",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:"mr-auto small text-muted",children:[s.length," selecionado(s)"]}),(0,r.jsx)("button",{type:"button",className:"btn mhs-btn-cancel",onClick:d,children:"Cancelar"}),(0,r.jsx)("button",{type:"button",className:"btn mhs-btn-primary",onClick:f,children:"Selecionar"})]}),children:[(0,r.jsxs)("div",{className:"tm-member-picker-filters",children:[(0,r.jsx)("input",{type:"search",className:"form-control",value:p,onChange:function(e){return h(e.target.value)},placeholder:"Buscar por Nome"}),(0,r.jsxs)("select",{className:"form-control",value:b,onChange:function(e){return y(e.target.value)},children:[(0,r.jsx)("option",{value:"",children:"Filtrar por Equipe"}),i.map(function(e){return(0,r.jsx)("option",{value:e.value,children:e.label},e.value)})]})]}),(0,r.jsx)("div",{className:"tm-member-picker-table-wrap",children:(0,r.jsxs)("table",{className:"table mb-0 tm-member-picker-table",children:[(0,r.jsx)("thead",{className:"thead-light",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{style:{width:48},children:(0,r.jsxs)("label",{className:"tm-member-picker-check",children:[(0,r.jsx)("input",{type:"checkbox",checked:j,disabled:0===x.length,onChange:function(){if(j){var e=new Set(x.map(function(e){return String(e.value)}));c(s.filter(function(t){return!e.has(String(t.value))}))}else c(te(s,x))}}),(0,r.jsx)("span",{})]})}),(0,r.jsx)("th",{children:"Membro"}),(0,r.jsx)("th",{className:"text-black-50 font-weight-bold",children:"Equipe"})]})}),(0,r.jsxs)("tbody",{children:[l&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:3,className:"text-muted p-4",children:"Carregando membros..."})}),!l&&0===x.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:3,className:"text-muted p-4",children:"Nenhum resultado."})}),!l&&x.map(function(e){var t,n=g.has(String(e.value));return(0,r.jsxs)("tr",{className:n?"selected":"",onClick:function(){return w(e)},children:[(0,r.jsx)("td",{children:(0,r.jsxs)("label",{className:"tm-member-picker-check",onClick:function(e){return e.stopPropagation()},children:[(0,r.jsx)("input",{type:"checkbox",checked:n,onChange:function(){return w(e)}}),(0,r.jsx)("span",{})]})}),(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)(J,{member:e}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{children:e.label}),(0,r.jsx)("div",{className:"tm-member-picker-email",children:e.email})]})]})}),(0,r.jsx)("td",{className:"tm-member-picker-teams",children:(null!==(t=e.teams)&&void 0!==t?t:[]).map(function(e){return(0,r.jsx)("span",{className:"tm-member-picker-team",children:e.name},e.id)})})]},e.value)})]})]})})]})}function J(e){var t=e.member,n=(t.label||t.email||"?").charAt(0).toUpperCase();return t.avatar?(0,r.jsx)("img",{className:"tm-member-picker-avatar",src:t.avatar,alt:""}):(0,r.jsx)("span",{className:"tm-member-picker-avatar",children:n})}function Y(e){var t=e.id||e.user_id,n=e.text||e.name||"".concat(e.firstName||""," ").concat(e.lastName||"").trim()||e.email||"#".concat(t);return{value:Number(t),label:n,email:e.email||"",avatar:e.avatar||null,teams:ne(e.teams).map(function(e){return{id:String(e.id),name:e.name||e.text||"#".concat(e.id)}})}}function Z(e){return{value:e.userId,label:e.name||e.email||"#".concat(e.userId),email:e.email||""}}function X(e){return{value:e.userId,label:e.name||e.email||"#".concat(e.userId),email:e.email||""}}function ee(e){return e||""}function te(e,t){var n=new Map(e.map(function(e){return[String(e.value),e]}));return t.forEach(function(e){return n.set(String(e.value),e)}),Array.from(n.values())}function ne(e){return Array.isArray(null==e?void 0:e.results)?e.results:Array.isArray(null==e?void 0:e.data)?e.data:Array.isArray(e)?e:[]}function re(e,t){var n,r=null==e||null===(n=e.response)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.message;return r||(t?"Não foi possível editar a lista de presença.":"Não foi possível criar a lista de presença.")}var ae={control:function(e,t){return T(T({},e),{},{borderColor:t.isFocused?"#17A2B8":"#ECEDED",boxShadow:t.isFocused?"0 0 0 0.2rem rgba(23, 162, 184, 0.15)":"none","&:hover":{borderColor:"#17A2B8"}})},multiValue:function(e){return T(T({},e),{},{backgroundColor:"rgba(23, 162, 184, 0.12)"})},multiValueLabel:function(e){return T(T({},e),{},{color:"#0F6674"})},option:function(e,t){return T(T({},e),{},{backgroundColor:t.isSelected?"#17A2B8":t.isFocused?"rgba(23, 162, 184, 0.08)":"#FFFFFF",color:t.isSelected?"#FFFFFF":"#1E1E1E"})},menuPortal:function(e){return T(T({},e),{},{zIndex:10080})},menu:function(e){return T(T({},e),{},{zIndex:10080})}};function oe(e){var t=e.title,n=e.value,a=e.progress,o=e.footer;return(0,r.jsxs)("div",{className:"tm-attendance-card",children:[(0,r.jsx)("span",{className:"tm-attendance-card-title",children:t}),(0,r.jsx)("strong",{className:"tm-attendance-card-value",children:n}),(0,r.jsx)("div",{className:"tm-attendance-progress","aria-hidden":"true",children:(0,r.jsx)("span",{style:{width:"".concat(a,"%")}})}),(0,r.jsx)("span",{className:"tm-attendance-card-footer",children:o})]})}function ie(e){var t=e.rows,n=e.totalRows,o=e.itemsPerPage,i=e.onItemsPerPageChange,s=e.onView,l=e.onEdit,c=e.onDelete,u=e.onShowQr,d=e.generatingIds,f=void 0===d?new Set:d,m=z((0,a.useState)(null),2),p=m[0],h=m[1];return(0,r.jsxs)("div",{className:"tm-attendance-table-card",children:[(0,r.jsx)("div",{className:"table-responsive app-table-responsive",children:(0,r.jsxs)("table",{className:"table mb-0 tm-attendance-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Título da lista"}),(0,r.jsx)("th",{children:"Método"}),(0,r.jsx)("th",{children:"Produto"}),(0,r.jsx)("th",{children:"Colaboradores"}),(0,r.jsx)("th",{children:"Criada em"}),(0,r.jsx)("th",{children:"Início"}),(0,r.jsx)("th",{children:"Fim"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{className:"text-center",children:"Ações"})]})}),(0,r.jsxs)("tbody",{children:[t.map(function(e){return(0,r.jsxs)("tr",{children:[(0,r.jsxs)("td",{children:[e.title,f.has(e.id)&&(0,r.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:"#5a6a85",fontWeight:500},children:[(0,r.jsx)("i",{className:"fas fa-circle-notch fa-spin",style:{marginRight:3,color:"#3498db"}}),"Processando..."]})]}),(0,r.jsx)("td",{children:e.method}),(0,r.jsx)("td",{children:e.product}),(0,r.jsx)("td",{children:e.collaborators}),(0,r.jsx)("td",{children:e.createdAt}),(0,r.jsx)("td",{children:e.validationStartsAtLabel}),(0,r.jsx)("td",{children:e.validationEndsAtLabel}),(0,r.jsx)("td",{children:(0,r.jsx)(ge,{status:e.status})}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"tm-attendance-row-actions",children:e.hasMoreActions&&(0,r.jsxs)("div",{className:"tm-attendance-actions-menu",children:[(0,r.jsx)("button",{type:"button",className:"tm-attendance-action-button","aria-label":"Mais ações",onClick:function(){return h(function(t){return t===e.id?null:e.id})},children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),p===e.id&&(0,r.jsxs)("div",{className:"tm-attendance-actions-dropdown",children:[(0,r.jsxs)("button",{type:"button",onClick:function(){h(null),s(e)},children:[(0,r.jsx)("i",{className:"far fa-eye"}),"Visualizar"]}),(0,r.jsxs)("button",{type:"button",onClick:function(){h(null),l(e)},children:[(0,r.jsx)("i",{className:"far fa-edit"}),"Editar"]}),("QR Code"===e.method||"Foto"===e.method||"Lista de Assinatura"===e.method)&&(0,r.jsxs)("button",{type:"button",onClick:function(){h(null),u(e)},children:[(0,r.jsx)("i",{className:"fas fa-qrcode"}),"Ver QR Code"]}),(0,r.jsxs)("button",{type:"button",className:"is-danger",onClick:function(){h(null),c(e)},children:[(0,r.jsx)("i",{className:"far fa-trash-alt"}),"Excluir"]})]})]})})})]},e.id)}),0===t.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:9,className:"text-center text-muted py-4",children:"Nenhuma lista encontrada para os filtros selecionados."})})]})]})}),(0,r.jsxs)("div",{className:"tm-attendance-table-footer",children:[(0,r.jsxs)("span",{children:["Mostrando ",t.length," de ",n," listas"]}),(0,r.jsxs)("div",{className:"tm-attendance-pagination","aria-label":"Paginação",children:[(0,r.jsx)("button",{type:"button","aria-label":"Página anterior",children:(0,r.jsx)("i",{className:"fas fa-chevron-left"})}),(0,r.jsx)("span",{children:"1"}),(0,r.jsx)("button",{type:"button","aria-label":"Próxima página",children:(0,r.jsx)("i",{className:"fas fa-chevron-right"})})]}),(0,r.jsxs)("label",{children:["Resultados por página",(0,r.jsx)("select",{value:o,onChange:function(e){return i(Number(e.target.value))},children:[10,20,30,50].map(function(e){return(0,r.jsx)("option",{value:e,children:e},e)})})]})]})]})}function se(e){var t=e.rows,n=e.onView,a=e.onEdit,o=e.onDelete,i=e.onShowQr,s=e.generatingIds,l=void 0===s?new Set:s;return 0===t.length?(0,r.jsx)("div",{className:"tm-attendance-empty-card",children:"Nenhuma lista encontrada para os filtros selecionados."}):(0,r.jsx)("div",{className:"tm-attendance-list-card-grid",children:t.slice(0,3).map(function(e){return(0,r.jsx)(le,{row:e,onView:n,onEdit:a,onDelete:o,onShowQr:i,isGenerating:l.has(e.id)},e.id)})})}function le(e){var t=e.row,n=e.onView,o=e.onEdit,i=e.onDelete,s=e.onShowQr,l=e.isGenerating,c=void 0!==l&&l,u=z((0,a.useState)(!1),2),d=u[0],f=u[1];return(0,r.jsxs)("article",{className:"tm-attendance-list-card",children:[(0,r.jsxs)("div",{className:"tm-attendance-list-card-menu tm-attendance-actions-menu",children:[(0,r.jsx)("button",{type:"button",className:"tm-attendance-action-button","aria-label":"Mais ações",onClick:function(){return f(function(e){return!e})},children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),d&&(0,r.jsxs)("div",{className:"tm-attendance-actions-dropdown",children:[(0,r.jsxs)("button",{type:"button",onClick:function(){f(!1),n(t)},children:[(0,r.jsx)("i",{className:"far fa-eye"}),"Visualizar"]}),(0,r.jsxs)("button",{type:"button",onClick:function(){f(!1),o(t)},children:[(0,r.jsx)("i",{className:"far fa-edit"}),"Editar"]}),("QR Code"===t.method||"Foto"===t.method||"Lista de Assinatura"===t.method)&&(0,r.jsxs)("button",{type:"button",onClick:function(){f(!1),s(t)},children:[(0,r.jsx)("i",{className:"fas fa-qrcode"}),"Ver QR Code"]}),(0,r.jsxs)("button",{type:"button",className:"is-danger",onClick:function(){f(!1),i(t)},children:[(0,r.jsx)("i",{className:"far fa-trash-alt"}),"Excluir"]})]})]}),(0,r.jsxs)("header",{children:[(0,r.jsxs)("h3",{children:[t.title,c&&(0,r.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:"#5a6a85",fontWeight:500},children:[(0,r.jsx)("i",{className:"fas fa-circle-notch fa-spin",style:{marginRight:3,color:"#3498db"}}),"Processando..."]})]}),(0,r.jsx)("span",{children:t.origin})]}),(0,r.jsx)("p",{className:"tm-attendance-list-card-description",children:t.description}),(0,r.jsxs)("div",{className:"tm-attendance-list-card-meta",children:[(0,r.jsx)("span",{children:"Produto"}),(0,r.jsx)("strong",{children:t.product})]}),(0,r.jsxs)("div",{className:"tm-attendance-list-card-meta",children:[(0,r.jsx)("span",{children:"Responsável"}),(0,r.jsx)("strong",{children:t.responsible})]}),(0,r.jsxs)("div",{className:"tm-attendance-list-card-meta",children:[(0,r.jsx)("span",{children:"Participantes"}),(0,r.jsx)("strong",{children:t.collaborators})]}),(0,r.jsx)("footer",{children:(0,r.jsxs)("div",{className:"tm-attendance-list-card-status",children:[(0,r.jsx)("span",{children:t.status}),(0,r.jsx)("strong",{className:"tm-attendance-list-card-dot tm-attendance-list-card-dot-".concat(Ne(t.status))}),(0,r.jsx)("time",{children:Ae(t.createdAt)})]})})]})}function ce(e){e.row;var t,n,o=e.details,i=e.isLoading,s=e.isError,l=e.onRetry,c=e.onShowPhoto,u=e.onRemoveParticipant,d=e.itemsPerPage,f=e.onItemsPerPageChange,m=z((0,a.useState)(""),2),p=m[0],h=m[1],v=z((0,a.useState)(""),2),b=v[0],y=v[1],g=null!==(t=null==o?void 0:o.participants)&&void 0!==t?t:[],x=null!==(n=null==o?void 0:o.list.validationEndsAt)&&void 0!==n?n:"",j=(0,a.useMemo)(function(){return function(e,t){return e.reduce(function(e,n){var r=je(n,t);return"Presente"===r&&(e.present+=1),"Pendente"===r&&(e.pending+=1),"Ausente"===r&&(e.absent+=1),e.total+=1,e},{present:0,pending:0,absent:0,total:0})}(g,x)},[g,x]),w=(0,a.useMemo)(function(){var e=Se(b);return g.filter(function(t){var n=je(t,x),r=!p||n===p,a=!e||Se("".concat(t.name," ").concat(t.email," ").concat(t.role)).includes(e);return r&&a})},[b,p,g,x]);return i?(0,r.jsx)("div",{className:"tm-attendance-empty-card",children:"Carregando participantes..."}):s||!o?(0,r.jsxs)("div",{className:"tm-attendance-empty-card",children:["Não foi possível carregar os participantes.",(0,r.jsx)("button",{type:"button",className:"btn btn-link p-0 ml-2",onClick:l,children:"Tentar novamente"})]}):(0,r.jsx)("div",{className:"tm-attendance-detail",children:(0,r.jsxs)("div",{className:"tm-attendance-detail-layout row",children:[(0,r.jsxs)("div",{className:"tm-attendance-detail-main col-12",children:[(0,r.jsx)("div",{className:"tm-attendance-toolbar tm-attendance-detail-toolbar",children:(0,r.jsxs)("div",{className:"tm-attendance-filters","aria-label":"Filtros de participantes",children:[(0,r.jsx)(be,{options:G,value:p,onChange:h}),(0,r.jsx)(ye,{value:b,onChange:y,placeholder:"Buscar participante..."})]})}),(0,r.jsx)(ue,{participants:w,totalRows:g.length,validationEndsAt:x,isPhoto:"photo"===o.list.validationModel,onShowPhoto:c,onRemoveParticipant:u,itemsPerPage:d,onItemsPerPageChange:f})]}),(0,r.jsx)("div",{className:"tm-attendance-summary-col col-12",children:(0,r.jsx)(pe,{summary:j,updatedAt:we(g)})})]})})}function ue(e){var t=e.participants,n=e.totalRows,o=e.validationEndsAt,i=e.isPhoto,s=e.onShowPhoto,l=e.onRemoveParticipant,c=e.itemsPerPage,u=e.onItemsPerPageChange,d=z((0,a.useState)(null),2),f=d[0],m=d[1];return(0,r.jsxs)("div",{className:"tm-attendance-table-card",children:[(0,r.jsx)("div",{className:"table-responsive app-table-responsive",children:(0,r.jsxs)("table",{className:"table mb-0 tm-attendance-table",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"Participante"}),(0,r.jsx)("th",{children:"Cargo"}),(0,r.jsx)("th",{children:"Evidência"}),(0,r.jsx)("th",{children:"Status"}),(0,r.jsx)("th",{children:"Horário"}),(0,r.jsx)("th",{className:"text-center",children:"Ações"})]})}),(0,r.jsxs)("tbody",{children:[t.map(function(e){var t,n,a=je(e,o);return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"tm-attendance-participant-cell",children:[(0,r.jsx)(de,{participant:e}),(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{children:e.name}),(0,r.jsx)("span",{children:e.email})]})]})}),(0,r.jsx)("td",{children:e.role}),(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"tm-attendance-evidence-cell",children:[(0,r.jsx)("span",{children:e.evidence}),e.evidenceAt&&(0,r.jsx)("small",{children:e.evidenceAt})]})}),(0,r.jsx)("td",{children:(0,r.jsx)(xe,{status:a})}),(0,r.jsx)("td",{children:(null===(t=e.evidenceAt)||void 0===t?void 0:t.slice(11))||(null===(n=e.updatedAt)||void 0===n?void 0:n.slice(11))||"--"}),(0,r.jsx)("td",{children:(0,r.jsx)("div",{className:"tm-attendance-row-actions",children:(0,r.jsxs)("div",{className:"tm-attendance-actions-menu",children:[(0,r.jsx)("button",{type:"button",className:"tm-attendance-action-button","aria-label":"Mais ações",onClick:function(){return m(function(t){return t===e.id?null:e.id})},children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),f===e.id&&(0,r.jsxs)("div",{className:"tm-attendance-actions-dropdown",children:[i&&e.photoFileId&&(0,r.jsxs)("button",{type:"button",onClick:function(){m(null),s(e)},children:[(0,r.jsx)("i",{className:"far fa-image"}),"Ver foto"]}),e.signatureEvidenceUrl&&(0,r.jsxs)("a",{href:e.signatureEvidenceUrl,target:"_blank",rel:"noreferrer",onClick:function(){return m(null)},children:[(0,r.jsx)("i",{className:"fas fa-signature"}),"Ver evidência"]}),(0,r.jsxs)("button",{type:"button",className:"is-danger",onClick:function(){m(null),l(e)},children:[(0,r.jsx)("i",{className:"far fa-trash-alt"}),"Remover"]})]})]})})})]},e.id)}),0===t.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:6,className:"text-center text-muted py-4",children:"Nenhum participante encontrado para os filtros selecionados."})})]})]})}),(0,r.jsxs)("div",{className:"tm-attendance-table-footer",children:[(0,r.jsxs)("span",{children:["Mostrando ",t.length," de ",n," participantes"]}),(0,r.jsxs)("div",{className:"tm-attendance-pagination","aria-label":"Paginação",children:[(0,r.jsx)("button",{type:"button","aria-label":"Página anterior",children:(0,r.jsx)("i",{className:"fas fa-chevron-left"})}),(0,r.jsx)("span",{children:"1"}),(0,r.jsx)("button",{type:"button","aria-label":"Próxima página",children:(0,r.jsx)("i",{className:"fas fa-chevron-right"})})]}),(0,r.jsxs)("label",{children:["Resultados por página",(0,r.jsx)("select",{value:c,onChange:function(e){return u(Number(e.target.value))},children:[10,20,30,50].map(function(e){return(0,r.jsx)("option",{value:e,children:e},e)})})]})]})]})}function de(e){var t=e.participant,n=t.name.split(" ").filter(Boolean).slice(0,2).map(function(e){return e[0]}).join("").toUpperCase();return t.avatar?(0,r.jsx)("img",{className:"tm-attendance-participant-avatar",src:t.avatar,alt:""}):(0,r.jsx)("span",{className:"tm-attendance-participant-avatar",children:n||"?"})}function fe(e){var t=e.row,n=e.onClose,o=(0,a.useRef)(null),i=z((0,a.useState)(!0),2),s=i[0],l=i[1];if((0,a.useEffect)(function(){t&&l(!0)},[null==t?void 0:t.id]),!t)return null;var c="Foto"===t.method,d="Lista de Assinatura"===t.method,f="/time-management/presence/".concat(t.globalToken,c?"/photo":d?"/signature":"/confirm"),m="/time-management/presence-lists/".concat(t.id,"/qr");return(0,r.jsx)(u.A,{show:!0,onClose:n,title:"QR Code Global — ".concat(t.title),size:"lg",className:"tm-attendance-qr-modal",footer:(0,r.jsx)(u.M,{onCancel:n,onConfirm:n,cancelText:"Fechar",confirmText:"Concluir"}),children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("p",{className:"text-muted mb-2",children:c?"Imprima este QR Code e cole no local do evento. O participante escaneia, faz login e envia a foto para confirmar presença.":d?"Imprima este QR Code e cole no local do evento. O participante escaneia, faz login e assina a própria linha no MetaHuman.":"Imprima este QR Code e cole no local do evento. O participante escaneia, faz login e confirma presença automaticamente."}),(0,r.jsxs)("div",{className:"tm-attendance-qr-frame-wrapper",children:[s&&(0,r.jsxs)("div",{className:"tm-attendance-qr-loading",role:"status","aria-live":"polite",children:[(0,r.jsx)("i",{className:"fas fa-circle-notch fa-spin","aria-hidden":"true"}),(0,r.jsx)("span",{children:"Renderizando QR Code..."})]}),(0,r.jsx)("iframe",{ref:o,title:"QR Code global de ".concat(t.title),src:m,className:"tm-attendance-qr-frame ".concat(s?"is-loading":""),onLoad:function(){return l(!1)}})]}),(0,r.jsxs)("div",{className:"mt-2 tm-attendance-qr-actions",children:[(0,r.jsxs)("a",{href:f,target:"_blank",rel:"noreferrer",className:"btn btn-outline-primary btn-sm mr-2",children:[(0,r.jsx)("i",{className:"fas fa-external-link-alt mr-1"}),d?"Abrir link de assinatura":"Abrir link de presença"]}),d&&t.signatureEditUrl&&(0,r.jsxs)("a",{href:t.signatureEditUrl,target:"_blank",rel:"noreferrer",className:"btn btn-outline-primary btn-sm mr-2",children:[(0,r.jsx)("i",{className:"fas fa-edit mr-1"}),"Visualizar Assinaturas"]}),(0,r.jsxs)("button",{type:"button",className:"btn btn-outline-secondary btn-sm",onClick:function(){var e,t=null===(e=o.current)||void 0===e?void 0:e.contentWindow;if(t)return t.focus(),void t.print();window.open(m,"_blank","noopener,noreferrer")},children:[(0,r.jsx)("i",{className:"fas fa-print mr-1"}),"Imprimir QR Code"]})]})]})})}function me(e){var t=e.participant,n=e.photoUrl,a=e.onClose;return(0,r.jsx)(u.A,{show:null!==t,onClose:a,title:t?"Foto — ".concat(t.name):"Foto",size:"lg",footer:(0,r.jsx)(u.M,{onCancel:a,onConfirm:a,cancelText:"Fechar",confirmText:"Concluir"}),children:t&&n?(0,r.jsxs)("div",{className:"tm-attendance-photo-preview",children:[(0,r.jsx)("iframe",{title:"Foto de ".concat(t.name),src:n,className:"tm-attendance-qr-frame"}),(0,r.jsx)("a",{href:n,target:"_blank",rel:"noreferrer",className:"btn btn-link mt-2 p-0",children:"Abrir foto em nova aba"})]}):(0,r.jsx)("div",{className:"tm-attendance-empty-card",children:"Foto indisponível para este participante."})})}function pe(e){var t=e.summary,n=e.updatedAt,a=Ce(t.present,t.total),o=Ce(t.pending,t.total),i=Ce(t.absent,t.total);return(0,r.jsxs)("aside",{className:"tm-attendance-summary-panel",children:[(0,r.jsx)("h3",{children:"Resumo da lista"}),(0,r.jsx)("span",{children:"Participação geral"}),(0,r.jsxs)("div",{className:"tm-attendance-donut",style:{"--present":"".concat(a,"%"),"--pending":"".concat(a+o,"%")},children:[(0,r.jsxs)("strong",{children:[a,"%"]}),(0,r.jsx)("small",{children:"Presentes"})]}),(0,r.jsxs)("div",{className:"tm-attendance-summary-legend",children:[(0,r.jsx)(he,{label:"Presentes",value:t.present,percent:a,tone:"present"}),(0,r.jsx)(he,{label:"Pendentes",value:t.pending,percent:o,tone:"pending"}),t.absent>0&&(0,r.jsx)(he,{label:"Ausentes",value:t.absent,percent:i,tone:"absent"})]}),(0,r.jsxs)("div",{className:"tm-attendance-summary-updated",children:[(0,r.jsx)("i",{className:"far fa-clock"}),"Última atualização: ",n||"--"]})]})}function he(e){var t=e.label,n=e.value,a=e.percent,o=e.tone;return(0,r.jsxs)("div",{className:"tm-attendance-summary-legend-row",children:[(0,r.jsx)("span",{className:"tm-attendance-summary-dot tm-attendance-summary-dot-".concat(o)}),(0,r.jsx)("span",{children:t}),(0,r.jsxs)("strong",{children:[n," (",a,"%)"]})]})}function ve(e){var t=e.value,n=e.onChange,o=z((0,a.useState)(!1),2),i=o[0],s=o[1],l=(0,a.useRef)(null),c=t.startDate&&t.endDate,u=c?"".concat(ke(t.startDate)," - ").concat(ke(t.endDate)):"Período";return(0,a.useEffect)(function(){if(i){var e=function(e){l.current&&!l.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}}},[i]),(0,r.jsxs)("div",{className:"tm-attendance-compact-date",ref:l,children:[(0,r.jsxs)("button",{type:"button",className:"tm-attendance-compact-select tm-attendance-compact-date-button ".concat(c?"is-active":""),"aria-expanded":i,onClick:function(){return s(function(e){return!e})},children:[(0,r.jsx)("span",{children:u}),(0,r.jsx)("i",{className:"fas fa-chevron-down","aria-hidden":"true"})]}),i&&(0,r.jsxs)("div",{className:"tm-attendance-compact-date-dropdown",children:[(0,r.jsxs)("div",{className:"tm-attendance-compact-date-header",children:[(0,r.jsx)("strong",{children:"Selecionar período"}),(0,r.jsx)("button",{type:"button",onClick:function(){return s(!1)},"aria-label":"Fechar período",children:(0,r.jsx)("i",{className:"fas fa-times","aria-hidden":"true"})})]}),(0,r.jsx)(d.A,{initialStartDate:t.startDate,initialEndDate:t.endDate,onChange:n,defaultToLastMonth:!1}),(0,r.jsxs)("div",{className:"tm-attendance-compact-date-footer",children:[(0,r.jsx)("button",{type:"button",onClick:function(){return n({startDate:"",endDate:""})},children:"Limpar período"}),(0,r.jsx)("button",{type:"button",onClick:function(){return s(!1)},children:"Aplicar"})]})]})]})}function be(e){var t,n=e.options,a=e.value,o=e.onChange,i=null!==(t=n.find(function(e){return e.value===a}))&&void 0!==t?t:n[0];return(0,r.jsxs)("label",{className:"tm-attendance-compact-select",children:[(0,r.jsx)("span",{children:i.label}),(0,r.jsx)("select",{value:a,onChange:function(e){return o(e.target.value)},"aria-label":n[0].label,children:n.map(function(e){return(0,r.jsx)("option",{value:e.value,children:e.label},e.value||"all")})}),(0,r.jsx)("i",{className:"fas fa-chevron-down","aria-hidden":"true"})]})}function ye(e){var t=e.value,n=e.onChange,o=e.placeholder,i=void 0===o?"Buscar":o,s=z((0,a.useState)(!1),2),l=s[0],c=s[1];return(0,r.jsxs)("div",{className:"tm-attendance-search ".concat(l||t?"is-expanded":""),children:[(0,r.jsx)("input",{type:"search",value:t,onChange:function(e){return n(e.target.value)},onFocus:function(){return c(!0)},onBlur:function(){return!t&&c(!1)},placeholder:i,"aria-label":"Buscar listas de presença"}),(0,r.jsx)("button",{type:"button",onClick:function(){return c(function(e){return!e})},"aria-label":"Buscar",children:(0,r.jsx)("i",{className:"fas fa-search"})})]})}function ge(e){var t=e.status;return(0,r.jsx)("span",{className:"tm-attendance-status tm-attendance-status-".concat(Ne(t)),children:t})}function xe(e){var t=e.status;return(0,r.jsx)("span",{className:"tm-attendance-status tm-attendance-status-".concat(Ne(t)),children:t})}function je(e,t){return"signed"===e.rawStatus?"Presente":t&&new Date(t).getTime()<Date.now()?"Ausente":"Pendente"}function we(e){var t,n=e.map(function(e){return e.updatedAt}).filter(Boolean).sort();return null!==(t=n[n.length-1])&&void 0!==t?t:""}function Se(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Ne(e){return Se(e).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function ke(e){var t=new Date("".concat(e,"T00:00:00"));return Number.isNaN(t.getTime())?e:t.toLocaleDateString("pt-BR",{day:"2-digit",month:"short"}).replace(".","")}function Ce(e,t){return t<=0?0:Math.min(100,Math.max(0,Math.round(e/t*100)))}function Oe(e){if(!e)return"";var t=new Date(e);if(Number.isNaN(t.getTime()))return"";var n=t.getTimezoneOffset();return new Date(t.getTime()-60*n*1e3).toISOString().slice(0,16)}function Ae(e){var t,n=e.match(/(\d{1,2})\s+([a-zç]+)\s+(\d{4})/i);if(!n)return e;var r=z(n,4),a=r[1],o=r[2],i=r[3];return"".concat(a.padStart(2,"0"),"/").concat(null!==(t={jan:"01",fev:"02",mar:"03",abr:"04",mai:"05",jun:"06",jul:"07",ago:"08",set:"09",out:"10",nov:"11",dez:"12"}[o.slice(0,3).toLowerCase()])&&void 0!==t?t:"01","/").concat(i)}},76336(e,t,n){"use strict";function r(){var e=window.PRODUCT_PERMISSIONS||{canView:!1,canEdit:!1,canCreate:!1,canDelete:!1};return{canView:!0===e.canView,canEdit:!0===e.canEdit,canCreate:!0===e.canCreate,canDelete:!0===e.canDelete}}function a(){return!0===window.ACCESS_DENIED}n.d(t,{L:()=>r,v:()=>a})},77332(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>o});n(52675),n(89463),n(28706),n(51629),n(48598),n(62062),n(94490),n(26099),n(23500);var r=n(74848),a=n(1806);function o(e){var t,n,o,i,s=e.isOpen,l=e.onClose,c=e.record;if(!s||!c)return null;var u={totalJornada:c.horas||"00:00",atraso:c.delay||null,hoursDifference:c.hoursDifference||"00:00",isOvertime:c.isOvertime||!1,isMissingHours:c.isMissingHours||!1,missingClockIns:c.missingClockIns||[],expectedHours:c.expectedHours||"00:00"},d=function(){var e=[],t=c.justification;if(e.push("Total de jornada registrada: ".concat(u.totalJornada)),u.isOvertime?e.push("Este membro possui ".concat(u.hoursDifference," de horas extras registradas")):u.isMissingHours?e.push("Devendo ".concat(u.hoursDifference," neste dia")):e.push("Este membro não possui horas extras registradas"),u.missingClockIns.length>0)if(4===u.missingClockIns.length)if(!t||"reason"!==t.type&&"license"!==t.type)e.push("Nenhum ponto registrado e sem justificativa");else{var n=function(e){switch(e){case"license":return"Licença";case"reason":return"Abono";default:return e}}(t.type);e.push("Nenhum ponto registrado com justificativa de: ".concat(n))}else u.missingClockIns.forEach(function(t){e.push("Faltando a marcação obrigatória da ".concat(t))});if(u.atraso&&e.push("Atraso na primeira entrada de ".concat(u.atraso)),t&&"edit"===t.type){var r=t.editReasonLabel||t.editReason,a=t.updatedAt||"data desconhecida";e.push("Registro ajustado manualmente em ".concat(a," por motivos de: ").concat(r))}if(t&&"reason"===t.type){var o;o="other"===t.payOffAbsence&&t.otherText?t.otherText:t.payOffAbsenceLabel||function(e){switch(e){case"medical_certificate":return"Atestado médico";case"child_monitoring":return"Acompanhamento de filho";case"spouse_monitoring":return"Acompanhamento de cônjuge";case"union_activity":return"Atividade sindical";case"weather_delay":return"Atraso por chuva";case"transport_delay":return"Atraso por transporte";case"compensated_time_off":return"Compensação de horas";case"employee_marriage":return"Casamento";case"court_appearance":return"Audiência judicial";case"electoral_service":return"Serviço eleitoral";case"military_service":return"Serviço militar";case"blood_donation":return"Doação de sangue";case"other":return"Outro";default:return e}}(t.payOffAbsence||"");var i=t.timeReason||"todo o dia";e.push("Foram abonadas ".concat(i," neste dia por motivos de: ").concat(o))}if(t&&"license"===t.type){var s;s="other"===t.payOffLicense&&t.description?t.description:t.payOffLicenseLabel||function(e){switch(e){case"maternity_leave":return"Licença maternidade";case"sick_leave":return"Licença médica";case"marriage_leave":return"Casamento";case"other":return"Outro";default:return e}}(t.payOffLicense||"");var l=t.durationFormatted||"0h";t.partialLicense?e.push("Foi aplicada a licença parcial ".concat(s," com duração de ").concat(l)):e.push("Foi aplicada a licença ".concat(s," com duração de ").concat(l))}return e}();return(0,r.jsx)(a.A,{show:s,onClose:l,title:"Visualizando Registro",size:"md",className:"w-75",footer:(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:l,children:"Fechar"}),children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"row mb-3",children:[(0,r.jsxs)("div",{className:"col-md-6",children:[(0,r.jsx)("h6",{children:"Primeira Entrada"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-8",children:(0,r.jsx)("input",{type:"date",className:"form-control",value:c.data?c.data.split("/").reverse().join("-"):""})}),(0,r.jsx)("div",{className:"col-4",children:(0,r.jsx)("input",{type:"text",className:"form-control",value:(null===(t=c.registros)||void 0===t?void 0:t[0])||"Não registrado ainda",readOnly:!0})})]})]}),(0,r.jsxs)("div",{className:"col-md-6",children:[(0,r.jsx)("h6",{children:"Primeira Saída"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-8",children:(0,r.jsx)("input",{type:"date",className:"form-control",value:c.data?c.data.split("/").reverse().join("-"):"",style:{fontFamily:"Inter",fontSize:"14px"}})}),(0,r.jsx)("div",{className:"col-4",children:(0,r.jsx)("input",{type:"text",className:"form-control",value:(null===(n=c.registros)||void 0===n?void 0:n[1])||"Não registrado ainda",readOnly:!0})})]})]})]}),(0,r.jsxs)("div",{className:"row mb-3",children:[(0,r.jsxs)("div",{className:"col-md-6",children:[(0,r.jsx)("h6",{children:"Segunda Entrada"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-8",children:(0,r.jsx)("input",{type:"date",className:"form-control",value:c.data?c.data.split("/").reverse().join("-"):"",style:{fontFamily:"Inter",fontSize:"14px"}})}),(0,r.jsx)("div",{className:"col-4",children:(0,r.jsx)("input",{type:"text",className:"form-control",value:(null===(o=c.registros)||void 0===o?void 0:o[2])||"Não registrado ainda",readOnly:!0})})]})]}),(0,r.jsxs)("div",{className:"col-md-6",children:[(0,r.jsx)("h6",{children:"Segunda Saída"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-8",children:(0,r.jsx)("input",{type:"date",className:"form-control",value:c.data?c.data.split("/").reverse().join("-"):""})}),(0,r.jsx)("div",{className:"col-4",children:(0,r.jsx)("input",{type:"text",className:"form-control",value:(null===(i=c.registros)||void 0===i?void 0:i[3])||"Não registrado ainda",readOnly:!0})})]})]})]}),(0,r.jsxs)("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid #dee2e6"},children:[(0,r.jsx)("h6",{children:"Informações Adicionais"}),(0,r.jsx)("ul",{children:d.map(function(e,t){return(0,r.jsxs)("li",{children:["• ",e]},t)})})]}),c.justification&&"reason"===c.justification.type&&c.justification.description&&(0,r.jsxs)("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid #dee2e6"},children:[(0,r.jsx)("h6",{children:"Observações"}),(0,r.jsx)("textarea",{className:"form-control",value:c.justification.description,readOnly:!0,rows:3})]})]})})}},77770(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>d});n(52675),n(89463),n(2259),n(51629),n(23418),n(64346),n(23792),n(34782),n(23288),n(94170),n(62010),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(27495),n(38781),n(47764),n(23500),n(62953),n(76031);var r=n(74848),a=n(96540),o=n(1806);function i(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var i=r&&r.prototype instanceof c?r:c,u=Object.create(i.prototype);return s(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(s(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,s(m,"constructor",d),s(d,"constructor",u),u.displayName="GeneratorFunction",s(d,a,"GeneratorFunction"),s(m),s(m,a,"Generator"),s(m,r,function(){return this}),s(m,"toString",function(){return"[object Generator]"}),(i=function(){return{w:o,m:p}})()}function s(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}s=function(e,t,n,r){function o(t,n){s(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},s(e,t,n,r)}function l(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.isOpen,n=e.onCapture,s=e.onClose,u=c((0,a.useState)(null),2),d=u[0],f=u[1],m=c((0,a.useState)(null),2),p=m[0],h=m[1],v=c((0,a.useState)(null),2),b=v[0],y=v[1],g=c((0,a.useState)(!1),2),x=g[0],j=g[1],w=(0,a.useRef)(null),S=(0,a.useRef)(null);(0,a.useEffect)(function(){return!t||p||d||(console.log("SelfieModal: Iniciando câmera..."),N()),function(){t||k()}},[t,p,d]);var N=function(){var e,t=(e=i().m(function e(){var t,n,r;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,console.log("SelfieModal: Solicitando acesso à câmera..."),j(!0),y(null),navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){e.n=1;break}throw new Error("Seu navegador não suporta acesso à câmera");case 1:return e.n=2,navigator.mediaDevices.getUserMedia({video:{facingMode:"user",width:{ideal:1280},height:{ideal:720}},audio:!1});case 2:return t=e.v,console.log("SelfieModal: Câmera acessada com sucesso!",t),f(t),e.n=3,new Promise(function(e){return setTimeout(e,100)});case 3:w.current?(console.log("SelfieModal: Conectando stream ao vídeo..."),w.current.srcObject=t,w.current.onloadedmetadata=function(){var e;console.log("SelfieModal: Metadata carregada, iniciando play..."),null===(e=w.current)||void 0===e||e.play().then(function(){console.log("SelfieModal: Vídeo tocando!"),j(!1)}).catch(function(e){console.error("SelfieModal: Erro ao iniciar play:",e),j(!1)})}):(console.warn("SelfieModal: videoRef.current é null!"),j(!1)),e.n=5;break;case 4:e.p=4,r=e.v,console.error("SelfieModal: Erro ao acessar câmera:",r),n="Não foi possível acessar a câmera. Verifique se concedeu as permissões necessárias.","NotAllowedError"===r.name||"PermissionDeniedError"===r.name?n="Permissão de acesso à câmera negada. Por favor, permita o acesso à câmera nas configurações do navegador e tente novamente.":"NotFoundError"===r.name?n="Nenhuma câmera foi encontrada no seu dispositivo.":"NotReadableError"===r.name?n="A câmera está em uso por outro aplicativo. Feche outros aplicativos e tente novamente.":"OverconstrainedError"===r.name?n="A câmera do seu dispositivo não atende aos requisitos necessários.":r.message&&(n=r.message),y(n),j(!1);case 5:return e.a(2)}},e,null,[[0,4]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){l(o,r,a,i,s,"next",e)}function s(e){l(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}(),k=function(){d&&(d.getTracks().forEach(function(e){return e.stop()}),f(null))},C=function(){k(),h(null),y(null),s()};return t?(0,r.jsx)(o.A,{show:t,onClose:C,title:"Capturar Selfie",size:"md",footer:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:function(){h(null),N()},children:"Tirar Novamente"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:function(){p&&fetch(p).then(function(e){return e.blob()}).then(function(e){n(e),h(null)}).catch(function(e){console.error("Erro ao processar imagem:",e),y("Erro ao processar imagem. Tente novamente.")})},children:"Confirmar"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:C,children:"Cancelar"}),b&&(0,r.jsx)("button",{type:"button",className:"btn btn-warning",onClick:N,children:"Tentar Novamente"}),(0,r.jsx)("button",{type:"button",className:"btn btn-primary",onClick:function(){if(w.current&&S.current){var e=w.current,t=S.current,n=t.getContext("2d");if(n){t.width=e.videoWidth,t.height=e.videoHeight,n.drawImage(e,0,0,t.width,t.height);var r=t.toDataURL("image/jpeg",.8);h(r),k()}}},disabled:x||!!b||!d,children:"Capturar"})]}),children:(0,r.jsxs)("div",{style:{padding:"24px"},children:[b&&(0,r.jsxs)("div",{className:"alert d-flex align-items-center",style:{backgroundColor:"#E6F7F9",borderColor:"#17A2B8",color:"#0C5460",gap:"12px"},children:[(0,r.jsx)("i",{className:"fas fa-exclamation-circle",style:{color:"#17A2B8",fontSize:"24px"}}),(0,r.jsx)("div",{style:{flex:1},children:b})]}),x&&(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("div",{className:"spinner-border text-primary mb-3"}),(0,r.jsx)("p",{className:"text-muted",children:"Iniciando câmera..."}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-link",onClick:N,children:"Clique aqui se a câmera não iniciar"})]}),(0,r.jsx)("div",{className:"text-center",style:{display:b||x?"none":"block"},children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:p,alt:"Selfie capturada",className:"w-100 rounded",style:{maxHeight:"400px",objectFit:"cover"}}),(0,r.jsx)("p",{className:"text-success mt-2",children:"Foto capturada com sucesso!"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("video",{ref:w,autoPlay:!0,playsInline:!0,muted:!0,className:"w-100 rounded",style:{maxHeight:"400px",objectFit:"cover",backgroundColor:"#000"}}),(0,r.jsx)("p",{className:"text-muted mt-2",children:"Posicione seu rosto no centro da tela"})]})}),(0,r.jsx)("canvas",{ref:S,style:{display:"none"}})]})}):null}},79724(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>y});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(21699),n(47764),n(23500),n(62953),n(76031);var r=n(74848),a=n(97665),o=n(57097),i=n(49785),s=n(70038),l=n(96540),c=n(1806);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=[{n:0,l:"D"},{n:1,l:"S"},{n:2,l:"T"},{n:3,l:"Q"},{n:4,l:"Q"},{n:5,l:"S"},{n:6,l:"S"}],b=["time-management","work-shifts"];function y(e){var t=e.show,n=e.onClose,u=e.editData,d=(0,a.jE)(),m=!!u,h=(0,i.mN)({mode:"onChange",defaultValues:{name:"",description:"",daysOfWeek:[],firstCheckIn:"",firstCheckOut:"",secondCheckIn:"",secondCheckOut:""}}),y=h.register,g=h.handleSubmit,x=h.watch,j=h.setValue,w=h.reset,S=h.trigger,N=h.formState.errors;(0,l.useEffect)(function(){u&&(j("name",u.name,{shouldValidate:!0}),j("description",u.description||"",{shouldValidate:!1}),j("daysOfWeek",u.daysOfWeek||[],{shouldValidate:!1}),j("firstCheckIn",u.firstCheckIn||"",{shouldValidate:!0}),j("firstCheckOut",u.firstCheckOut||"",{shouldValidate:!0}),j("secondCheckIn",u.secondCheckIn||"",{shouldValidate:!0}),j("secondCheckOut",u.secondCheckOut||"",{shouldValidate:!0}),setTimeout(function(){S(["firstCheckIn","firstCheckOut","secondCheckIn","secondCheckOut"])},0))},[u,j,S]),(0,l.useEffect)(function(){t||w()},[t,w]);var k=x("daysOfWeek"),C=x("name"),O=x("firstCheckIn"),A=x("firstCheckOut"),E=x("secondCheckIn"),P=x("secondCheckOut"),F=(0,o.n)({mutationFn:function(e){var t={name:e.name,description:e.description||void 0,daysOfWeek:e.daysOfWeek,firstCheckIn:e.firstCheckIn||null,firstCheckOut:e.firstCheckOut||null,secondCheckIn:e.secondCheckIn||null,secondCheckOut:e.secondCheckOut||null};return m&&null!=u&&u.id?(0,s.zS)(u.id,t):(0,s.z1)(t)},onSuccess:function(){d.invalidateQueries({queryKey:b}),w(),n()}});return(0,r.jsx)(c.A,{show:t,onClose:n,title:m?"Editando Turno":"Criando Turno",size:"md",footer:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:n,children:"Cancelar"}),(0,r.jsx)("button",{type:"submit",form:"workShiftForm",className:"btn text-white px-4",style:{backgroundColor:"#17a2b8"},disabled:F.isPending||!C||0===((null==k?void 0:k.length)||0),children:F.isPending?(0,r.jsx)("i",{className:"fas fa-spinner fa-spin"}):m?"Salvar":"Criar Turno"})]}),children:(0,r.jsxs)("form",{id:"workShiftForm",onSubmit:g(function(e){F.mutate(e)}),children:[(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Nome do Turno"}),(0,r.jsx)("input",f({type:"text",className:"form-control",placeholder:"Digite o nome do turno"},y("name",{required:!0})))]}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Descrição"}),(0,r.jsx)("textarea",f({className:"form-control",rows:3,placeholder:"Detalhe mais informações sobre essa atividade"},y("description")))]}),(0,r.jsx)("hr",{className:"my-4"}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Dias da Semana"}),(0,r.jsx)("div",{className:"d-flex justify-content-between",children:v.map(function(e){return(0,r.jsx)("button",{type:"button",className:"btn ".concat(k.includes(e.n)?"text-white":"btn-outline-secondary"),style:f({flex:1,height:"60px",fontSize:"1.1rem",fontWeight:"normal",margin:"0 0.25rem"},k.includes(e.n)?{backgroundColor:"rgb(23, 162, 184)"}:{}),onClick:function(){return t=e.n,void j("daysOfWeek",(n=k||[]).includes(t)?n.filter(function(e){return e!==t}):[].concat(p(n),[t]));var t,n},children:e.l},e.n)})}),(0,r.jsx)("small",{className:"text-muted d-block mt-2",children:"Necessário escolher pelo menos um dia da semana.*"})]}),(0,r.jsx)("hr",{className:"my-4"}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Primeira Entrada"}),(0,r.jsx)("input",f({type:"time",className:"form-control ".concat(N.firstCheckIn?"is-invalid":"")},y("firstCheckIn",{validate:{notEqualToFirstOut:function(e){return!e||!A||(e!==A||"Não pode ser igual à Primeira Saída")}}}))),N.firstCheckIn&&(0,r.jsx)("small",{className:"text-danger d-block mt-1",children:N.firstCheckIn.message})]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Primeira Saída"}),(0,r.jsx)("input",f({type:"time",className:"form-control ".concat(N.firstCheckOut?"is-invalid":"")},y("firstCheckOut",{validate:{notEqualToFirstIn:function(e){return!e||!O||(e!==O||"Não pode ser igual à Primeira Entrada")},notEqualToSecondIn:function(e){return!e||!E||(e!==E||"Não pode ser igual à Segunda Entrada")}}}))),N.firstCheckOut&&(0,r.jsx)("small",{className:"text-danger d-block mt-1",children:N.firstCheckOut.message})]})})]}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Segunda Entrada"}),(0,r.jsx)("input",f({type:"time",className:"form-control ".concat(N.secondCheckIn?"is-invalid":"")},y("secondCheckIn",{validate:{notEqualToFirstOut:function(e){return!e||!A||(e!==A||"Não pode ser igual à Primeira Saída")},notEqualToSecondOut:function(e){return!e||!P||(e!==P||"Não pode ser igual à Segunda Saída")}}}))),N.secondCheckIn&&(0,r.jsx)("small",{className:"text-danger d-block mt-1",children:N.secondCheckIn.message})]})}),(0,r.jsx)("div",{className:"col-md-6",children:(0,r.jsxs)("div",{className:"form-group mb-0",children:[(0,r.jsx)("label",{className:"font-weight-normal text-dark",children:"Saída"}),(0,r.jsx)("input",f({type:"time",className:"form-control ".concat(N.secondCheckOut?"is-invalid":"")},y("secondCheckOut",{validate:{notEqualToSecondIn:function(e){return!e||!E||(e!==E||"Não pode ser igual à Segunda Entrada")}}}))),N.secondCheckOut&&(0,r.jsx)("small",{className:"text-danger d-block mt-1",children:N.secondCheckOut.message})]})})]})]})})}},80217(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>f});n(52675),n(89463),n(2259),n(28706),n(33771),n(23418),n(64346),n(23792),n(62062),n(72712),n(34782),n(23288),n(62010),n(2892),n(9868),n(26099),n(27495),n(38781),n(47764),n(62953),n(76031);var r=n(74848),a=n(28482),o=n(72050),i=n(9655),s=n(75548),l=n(96540);function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var d=Math.PI/180;function f(e){e.viewMode,e.onViewModeChange;var t=e.projects,n=void 0===t?[]:t,u=n.length>0?n.map(function(e){return{name:e.name,value:e.hours,color:e.color}}):[{name:"Sem dados",value:0,color:"#E0E0E0"}],f=u.reduce(function(e,t){return e+t.value},0),m=c((0,l.useState)(!0),2),p=m[0],h=m[1];(0,l.useEffect)(function(){var e,t=function(){h(!1),clearTimeout(e),e=setTimeout(function(){h(!0)},100)};return window.addEventListener("resize",t),function(){window.removeEventListener("resize",t),clearTimeout(e)}},[]);return p?(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[(0,r.jsxs)("div",{style:{width:"60%",height:"280px",position:"relative"},children:[(0,r.jsx)(a.u,{width:"100%",height:"100%",children:(0,r.jsx)(s.r,{children:(0,r.jsx)(i.Fq,{data:u,dataKey:"value",cx:"40%",cy:"50%",innerRadius:60,outerRadius:80,label:function(e){var t=e.cx,n=e.cy,a=e.midAngle,o=e.outerRadius,i=e.fill,s=e.payload,l=(e.percent,Math.sin(-d*a)),c=Math.cos(-d*a),u=Math.abs(1/c)+10,f=t+o*c,m=n+o*l,p=t+(o+u)*c,h=n+(o+u)*l,v=p+20*Number(c.toFixed(1)),b=h,y=c>=0?"start":"end";return(0,r.jsxs)("g",{children:[(0,r.jsx)("path",{d:"M".concat(f,",").concat(m,"L").concat(p,",").concat(h,"L").concat(v,",").concat(b),stroke:i,strokeWidth:"1",fill:"none"}),(0,r.jsx)("text",{x:v+5*(c>=0?1:-1),y:b-6,textAnchor:y,style:{fontSize:"12px",fontWeight:400,fill:"rgba(0, 0, 0, 0.70)",fontFamily:"Inter"},children:s.name}),(0,r.jsx)("text",{x:v+5*(c>=0?1:-1),y:b+6,textAnchor:y,style:{fontSize:"12px",fontWeight:600,fill:i,fontFamily:"Inter"},children:"".concat(s.value,"h")})]})},labelLine:!1,children:u.map(function(e,t){return(0,r.jsx)(o.f,{fill:e.color},"cell-".concat(t))})})})}),(0,r.jsx)("div",{style:{position:"absolute",top:"50%",left:"40%",transform:"translate(-50%, -50%)",textAlign:"center",pointerEvents:"none"},children:(0,r.jsxs)("div",{style:{fontSize:"24px",fontWeight:600,color:"#5C5D5D",fontFamily:"Inter"},children:[f,"h"]})})]}),(0,r.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"12px",paddingRight:"15px",alignItems:"flex-end",justifyContent:"center"},children:u.map(function(e,t){return(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:e.color,borderRadius:"2px",marginRight:"8px",flexShrink:0}}),(0,r.jsx)("span",{style:{fontSize:"12px",color:"#5C5D5D",fontWeight:500,fontFamily:"Inter"},children:e.name})]},t)})})]}):(0,r.jsx)("div",{style:{height:"280px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)("span",{style:{color:"#999",fontSize:"12px"},children:"Atualizando..."})})}},80596(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>l});n(52675),n(89463),n(2259),n(28706),n(2008),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(2892),n(26099),n(27495),n(38781),n(47764),n(90744),n(62953);var r=n(74848),a=n(96540),o=n(76336);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){var t=e.data,n=e.title,i=void 0===n?"Registro de pontos":n,s=e.isLoading,l=void 0!==s&&s,u=e.pagination,d=e.onPageChange,f=e.onItemsPerPageChange,m=(e.onFilterClick,e.onExportClick),p=e.isExporting,h=void 0!==p&&p,v=e.onEditRecord,b=e.onAbonarRecord,y=e.onLicencaRecord,g=e.onViewRecord,x=e.selectedStatus,j=e.onStatusChange,w=(0,o.L)(),S=w.canEdit,N=w.canCreate;return(0,r.jsxs)("div",{className:"card app-card-surface mt-2",children:[(0,r.jsxs)("div",{className:"card-header app-controls-bar tm-controls-bar",children:[(0,r.jsxs)("div",{className:"d-none d-lg-flex align-items-center",children:[(0,r.jsx)("h3",{className:"card-title mb-0",children:i}),(0,r.jsxs)("div",{className:"ml-auto d-flex align-items-center",children:[(0,r.jsx)("button",{className:"app-table-action-btn mr-2",onClick:m,disabled:h||l,type:"button",children:h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("i",{className:"fas fa-spinner fa-spin mr-1"}),"Exportando..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("i",{className:"fas fa-file-export mr-1"}),"Exportar Tabela"]})}),(0,r.jsx)(c,{selectedStatus:x,onStatusChange:j})]})]}),(0,r.jsxs)("div",{className:"d-lg-none",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,r.jsx)("h3",{className:"card-title mb-0",children:i}),(0,r.jsx)(c,{selectedStatus:x,onStatusChange:j})]}),(0,r.jsx)("div",{className:"d-flex flex-column",children:(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsxs)("button",{className:"btn btn-sm btn-default w-100",onClick:m,disabled:h||l,type:"button",title:"Exportar Tabela",children:[(0,r.jsx)("i",{className:"fas ".concat(h?"fa-spinner fa-spin":"fa-file-export"," mr-2")}),h?"Exportando...":"Exportar Tabela"]})})})]})]}),(0,r.jsxs)("div",{className:"card-body",children:[l&&(0,r.jsxs)("div",{className:"text-center py-4",children:[(0,r.jsx)("div",{className:"spinner-border text-primary",role:"status",children:(0,r.jsx)("span",{className:"sr-only",children:"Carregando..."})}),(0,r.jsx)("p",{className:"text-muted mt-2",children:"Carregando registros..."})]}),!l&&(0,r.jsx)("div",{className:"table-responsive app-table-responsive",children:(0,r.jsxs)("table",{className:"table mb-0 app-table",children:[(0,r.jsx)("thead",{className:"thead-light",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{style:{width:"10%"},children:"Data"}),(0,r.jsx)("th",{style:{width:"20%"},className:"text-center",children:"Nome do Membro"}),(0,r.jsx)("th",{style:{width:"22%"},className:"text-center",children:"Registros (Entrada e Saída)"}),(0,r.jsx)("th",{style:{width:"20%"},className:"text-center",children:"Registros Previstos"}),(0,r.jsx)("th",{style:{width:"10%"},className:"text-center",children:"Horas Trabalhadas"}),(0,r.jsx)("th",{style:{width:"10%"},className:"text-center",children:"Status"}),(0,r.jsx)("th",{style:{width:"8%",textAlign:"right"},children:"Ações"})]})}),(0,r.jsxs)("tbody",{children:[t.map(function(e,t){var n,o,i=e.memberName||"—",s=i.split(/\s+/).filter(Boolean),l="—"!==i?((null===(n=s[0])||void 0===n?void 0:n[0])||"?").toUpperCase():"?",c=["#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#98D8C8","#F7DC6F","#BB8FCE","#85C1E2"],u=c[i.charCodeAt(0)%c.length];return(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{className:"text-muted",children:e.data}),(0,r.jsx)("td",{className:"text-center",children:(0,r.jsx)("div",{className:"rounded-circle d-inline-flex align-items-center justify-content-center text-white",style:{width:36,height:36,backgroundColor:u,fontWeight:700,cursor:"help"},title:i,children:l})}),(0,r.jsx)("td",{className:"text-center",children:(0,r.jsx)("div",{className:"d-flex flex-wrap align-items-center justify-content-center",children:e.registros.map(function(e,t){return(0,r.jsxs)(a.Fragment,{children:[t>0&&(0,r.jsx)("span",{className:"text-muted mx-2",children:"|"}),(0,r.jsx)("span",{className:0===t?"text-primary font-weight-bold":"",children:e})]},t)})})}),(0,r.jsx)("td",{className:"text-muted text-center",children:e.previstos}),(0,r.jsx)("td",{className:"text-center ".concat("success"===e.horasColor?"tm-hours-success":"danger"===e.horasColor?"tm-hours-danger":"tm-hours-secondary"),children:e.horas}),(0,r.jsx)("td",{className:"text-center ".concat("success"===e.statusColor?"tm-status-success":"danger"===e.statusColor?"tm-status-danger":"info"===e.statusColor?"tm-status-info":"tm-status-secondary"),children:e.status}),(0,r.jsx)("td",{className:"text-right",children:(0,r.jsx)("div",{className:"d-inline-flex align-items-center",children:(o=[],S&&o.push({key:"edit",label:"Editar Registro",onClick:function(){return null==v?void 0:v(e)}}),N&&(o.push({key:"abonar",label:"Abonar",onClick:function(){return null==b?void 0:b(e)}}),o.push({key:"licenca",label:"Incluir Licença",onClick:function(){return null==y?void 0:y(e)}})),o.push({key:"view",label:"Visualizar Registro",onClick:function(){return null==g?void 0:g(e)}}),1===o.length&&"view"===o[0].key?(0,r.jsx)("button",{className:"btn btn-default btn-sm",title:o[0].label,type:"button",onClick:o[0].onClick,children:(0,r.jsx)("i",{className:"far fa-eye"})}):(0,r.jsxs)("div",{className:"btn-group",children:[(0,r.jsx)("button",{className:"ms-table-occurrences-action-button","data-toggle":"dropdown","aria-expanded":"false",title:"Mais ações",type:"button",children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v ms-table-occurrences-action-icon"})}),(0,r.jsx)("div",{className:"dropdown-menu dropdown-menu-right",role:"menu",children:o.map(function(e,t){return(0,r.jsx)("button",{className:"dropdown-item",onClick:function(t){t.preventDefault(),e.onClick()},children:e.label},"".concat(e.key,"-").concat(t))})})]}))})})]},e.id)}),0===t.length&&(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:7,className:"text-center text-muted py-4",children:"Nenhum registro encontrado para o período selecionado"})})]})]})})]}),!l&&u&&(0,r.jsxs)("div",{className:"card-footer app-table-footer",children:[(0,r.jsx)("div",{className:"app-table-footer__left",children:(0,r.jsxs)("small",{className:"text-muted",children:["Mostrando ",t.length," de ",u.total," registros ",u.total_pages>0&&" (Página ".concat(u.current_page," de ").concat(u.total_pages,")")]})}),(0,r.jsx)("nav",{"aria-label":"Navegação da tabela",className:"app-table-footer__center",children:(0,r.jsxs)("ul",{className:"pagination pagination-sm mb-0 app-table-pagination",children:[(0,r.jsx)("li",{className:"page-item ".concat(1===u.current_page?"disabled":""),children:(0,r.jsx)("button",{className:"page-link",onClick:function(){u&&u.current_page>1&&d&&d(u.current_page-1)},disabled:u.current_page<=1,"aria-label":"Anterior",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"‹"})})}),(0,r.jsx)("li",{className:"page-item active",children:(0,r.jsx)("span",{className:"page-link",children:u.current_page})}),(0,r.jsx)("li",{className:"page-item ".concat(u.current_page>=u.total_pages?"disabled":""),children:(0,r.jsx)("button",{className:"page-link",onClick:function(){u&&u.current_page<u.total_pages&&d&&d(u.current_page+1)},disabled:u.current_page>=u.total_pages,"aria-label":"Próxima",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"›"})})})]})}),(0,r.jsxs)("div",{className:"d-flex align-items-center app-table-footer__right",children:[(0,r.jsx)("span",{className:"text-muted mr-2",children:"Resultados por página"}),(0,r.jsx)("select",{className:"custom-select custom-select-sm",style:{width:72},value:u.per_page,onChange:function(e){f&&f(Number(e.target.value))},children:[10,20,30,50,100].map(function(e){return(0,r.jsx)("option",{value:e,children:e},e)})})]})]})]})}function c(e){var t=e.selectedStatus,n=e.onStatusChange,o=i((0,a.useState)(!1),2),s=o[0],l=o[1],c=(0,a.useRef)(null);(0,a.useEffect)(function(){function e(e){if(s){var t=e.target;c.current&&!c.current.contains(t)&&l(!1)}}return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[s]);var u=t&&""!==t;return(0,r.jsxs)("div",{className:"dropdown",ref:c,children:[(0,r.jsx)("button",{className:"app-list-filter-btn ".concat(u?"has-filters":""),type:"button",onClick:function(){return l(!s)},title:u?"Filtros ativos":"Filtros",children:(0,r.jsx)("i",{className:"fas fa-filter"})}),s&&(0,r.jsxs)("div",{className:"dropdown-menu app-filter-dropdown show",style:{right:0},children:[(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("label",{className:"small text-muted mb-1",children:"Status"}),(0,r.jsxs)("select",{className:"custom-select custom-select-sm",value:t||"",onChange:function(e){return null==n?void 0:n(e.target.value)},children:[(0,r.jsx)("option",{value:"",children:"Todos"}),(0,r.jsx)("option",{value:"incomplete",children:"Incompleto"}),(0,r.jsx)("option",{value:"missing_hours",children:"Devendo Horas"}),(0,r.jsx)("option",{value:"on_time",children:"Em Dia"}),(0,r.jsx)("option",{value:"overtime",children:"Horas Extras"})]})]}),(0,r.jsxs)("div",{className:"d-flex justify-content-between pt-1",children:[(0,r.jsx)("button",{className:"btn btn-sm text-muted",type:"button",onClick:function(){n&&n(""),l(!1)},children:"Limpar"}),(0,r.jsx)("button",{className:"btn btn-sm btn-primary",type:"button",onClick:function(){l(!1)},children:"Aplicar"})]})]})]})}},81149(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>g});n(52675),n(89463),n(2259),n(23418),n(74423),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(3362),n(27495),n(38781),n(47764),n(25440),n(62953),n(3296),n(27208),n(48408);var r=n(74848),a=n(96540),o=n(97665),i=n(15072),s=n(94034);function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var u=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,57909))}),d=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,23696))}),f=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,14785))}),m=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,75930))}),p=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,43432))}),h=(0,a.lazy)(function(){return Promise.resolve().then(n.bind(n,41081))}),v=new i.E({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}}),b=["overview","ponto","timesheet","attendance","settings","permissoes"];function y(e){var t=new URLSearchParams(location.hash.replace(/^#/,"")).get("tab");return t&&b.includes(t)?t:e}function g(e){var t=e.active,n=void 0===t?"overview":t,i=(0,a.useMemo)(function(){return y(n)},[n]),c=l((0,a.useState)(i),2),g=c[0],x=c[1],j=l((0,a.useState)({title:"GESTÃO DE TEMPO"}),2),w=j[0],S=j[1];(0,a.useEffect)(function(){x(y(n))},[n]),(0,a.useEffect)(function(){b.includes(g)||x(y(n))},[n,g]),(0,a.useEffect)(function(){var e,t;e=g,(t=new URL(location.href)).hash="tab=".concat(e),history.replaceState(null,"",t.toString())},[g]),(0,a.useEffect)(function(){"attendance"!==g&&S({title:"GESTÃO DE TEMPO",hideTabs:!1})},[g]),(0,a.useEffect)(function(){var e=function(){return x(y(n))};return window.addEventListener("hashchange",e),function(){return window.removeEventListener("hashchange",e)}},[n]),(0,a.useEffect)(function(){return document.body.classList.add("tm-page-active"),function(){document.body.classList.remove("tm-page-active")}},[]);var N=function(){switch(g){case"overview":default:return(0,r.jsx)(u,{});case"ponto":return(0,r.jsx)(d,{});case"timesheet":return(0,r.jsx)(f,{});case"attendance":return(0,r.jsx)(m,{onHeaderContextChange:S});case"settings":return(0,r.jsx)(p,{});case"permissoes":return(0,r.jsx)(h,{})}}();return(0,r.jsx)(o.Ht,{client:v,children:(0,r.jsxs)("section",{className:"zero-padding",style:{position:"relative"},children:[(0,r.jsx)(s.A,{items:[{key:"overview",label:"Visão Geral"},{key:"ponto",label:"Controle de Ponto"},{key:"timesheet",label:"Timesheet"},{key:"attendance",label:"Presenças"},{key:"settings",label:"Configurações"},{key:"permissoes",label:"Permissões"}],title:w.title,onBack:"attendance"===g?w.onBack:void 0,activeKey:g,onChange:x,hideTabs:w.hideTabs}),(0,r.jsx)("div",{style:{position:"relative",zIndex:1},children:(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)("div",{className:"p-3",children:"Carregando…"}),children:N})})]})})}},81623(e,t,n){"use strict";n.d(t,{Ay:()=>d,VU:()=>c,Z4:()=>l,jZ:()=>u});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(69404);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}var l={getActivities:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/activities/".concat(e));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},getProjects:function(){return s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.u.get("/api/timesheet-v2/projects");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))()},getProjectTasks:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/projects/".concat(e,"/tasks"));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},getActivityTemplates:function(){return s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.u.get("/api/timesheet-v2/activity-templates");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))()},createActivity:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.post("/api/timesheet-v2/activities",e);case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},updateActivity:function(e,t){return s(a().m(function n(){var o,i;return a().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,r.u.put("/api/timesheet-v2/activities/".concat(e),t);case 1:return o=n.v,i=o.data,n.a(2,i.data)}},n)}))()},deleteActivity:function(e){return s(a().m(function t(){return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.delete("/api/timesheet-v2/activities/".concat(e));case 1:return t.a(2)}},t)}))()},finalizeDay:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.post("/api/timesheet-v2/days/".concat(e,"/finalize"));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},getScheduledActivities:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/scheduled-activities/".concat(e));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},getPlannedActivities:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/planned-activities/".concat(e));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},getHoursWorkedKPI:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/kpi/hours-worked/".concat(e));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()},getHoursByProject:function(e,t,n){return s(a().m(function o(){var i,s;return a().w(function(a){for(;;)switch(a.n){case 0:return a.n=1,r.u.get("/api/timesheet-v2/kpi/hours-by-project",{params:{start_date:e,end_date:t,member_id:n}});case 1:return i=a.v,s=i.data,a.a(2,s.data)}},o)}))()},getEnergyPeaks:function(e,t,n){return s(a().m(function o(){var i,s;return a().w(function(a){for(;;)switch(a.n){case 0:return a.n=1,r.u.get("/api/timesheet-v2/kpi/energy-peaks",{params:{start_date:e,end_date:t,member_id:n}});case 1:return i=a.v,s=i.data,a.a(2,s.data)}},o)}))()},getWeeklyHours:function(e,t,n){return s(a().m(function o(){var i,s;return a().w(function(a){for(;;)switch(a.n){case 0:return a.n=1,r.u.get("/api/timesheet-v2/kpi/weekly-hours",{params:{start_date:e,end_date:t,member_id:n}});case 1:return i=a.v,s=i.data,a.a(2,s.data)}},o)}))()},getWorkload:function(e){return s(a().m(function t(){var n;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/workload/".concat(e));case 1:return n=t.v,t.a(2,n.data.workload_hours)}},t)}))()},updateWorkload:function(e,t){return s(a().m(function n(){return a().w(function(n){for(;;)switch(n.n){case 0:return n.n=1,r.u.put("/api/timesheet-v2/workload",{date:e,workload_hours:t});case 1:return n.a(2)}},n)}))()},getHoursControl:function(e,t,n){return s(a().m(function o(){var i,s;return a().w(function(a){for(;;)switch(a.n){case 0:return a.n=1,r.u.get("/api/timesheet-v2/hours-control/",{params:{start_date:e,end_date:t,member_id:n}});case 1:return i=a.v,s=i.data,a.a(2,s.data)}},o)}))()},getMonthInfo:function(e,t,n){return s(a().m(function o(){var i,s;return a().w(function(a){for(;;)switch(a.n){case 0:return a.n=1,r.u.get("/api/timesheet-v2/month-info",{params:{start_date:e,end_date:t,member_id:n}});case 1:return i=a.v,s=i.data,a.a(2,s.data)}},o)}))()},getMonthKPIs:function(e,t,n){return s(a().m(function o(){var i,s;return a().w(function(a){for(;;)switch(a.n){case 0:return a.n=1,r.u.get("/api/timesheet-v2/kpi/month",{params:{start_date:e,end_date:t,member_id:n}});case 1:return i=a.v,s=i.data,a.a(2,s.data)}},o)}))()},getDayKPIs:function(e){return s(a().m(function t(){var n,o;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,r.u.get("/api/timesheet-v2/kpi/day/".concat(e));case 1:return n=t.v,o=n.data,t.a(2,o.data)}},t)}))()}},c=function(){var e=s(a().m(function e(t,n){return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.u.put("/api/timesheet-v2/days/".concat(t,"/satisfaction"),{work_satisfaction:n});case 1:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),u=function(){var e=s(a().m(function e(t){var n,o,i,s,l,c,u;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.u.get("/api/timesheet-v2/days/".concat(t,"/satisfaction"));case 1:return c=e.v,u=c.data,e.a(2,{timesheetDayId:(null===(n=u.data)||void 0===n?void 0:n.id)||null,hasSatisfaction:null!==(null===(o=u.data)||void 0===o?void 0:o.work_satisfaction),isFinalized:2===(null===(i=u.data)||void 0===i?void 0:i.work_period),workSatisfaction:null!==(s=null===(l=u.data)||void 0===l?void 0:l.work_satisfaction)&&void 0!==s?s:null})}},e)}));return function(t){return e.apply(this,arguments)}}();const d=l},82942(e,t,n){"use strict";n.d(t,{AD:()=>a,JC:()=>o,Q8:()=>r,kC:()=>i});n(2008),n(62062),n(26099);function r(e,t){if(!e)return[];var n=e.mode,r=e.validate_points_others,a=t||window.innerWidth<=768;if("none"===n)return[];if("qrcode"===n)return a?["qrcode"]:[];if("flexible"===n){var o=["selfie","geolocation","screenshot"];return a&&o.push("qrcode"),o}return"manual"===n?r.map(function(e){return e.type}).filter(function(e){return!("qrcode"===e&&!a)}):[]}function a(e,t){if(!e)return!1;var n=t||window.innerWidth<=768;return"qrcode"===e.mode&&!n}function o(e){return{selfie:"fas fa-camera",geolocation:"fas fa-map-marker-alt",screenshot:"fas fa-image",qrcode:"fas fa-qrcode",teste:"fas fa-flask"}[e]||"fas fa-check"}function i(e){return{selfie:"Selfie",geolocation:"Localização",screenshot:"Screenshot",qrcode:"QR Code",teste:"Bater Ponto Teste"}[e]||e}},84136(e,t,n){"use strict";n.d(t,{L:()=>r,j:()=>a});var r={ponto_duplicado:"Ponto Duplicado",atraso:"Atraso",ponto_dia_folga:"Ponto em Dia de Folga",ausencia_sem_justificativa:"Ausência sem Justificativa",ausencia_com_justificativa:"Ausência com Justificativa",saida_antecipada:"Saída Antecipada",ponto_adiantado:"Ponto Adiantado"};function a(e){return{leve:"leve",moderado:"atencao",atencao:"atencao",resolvido:"resolvido",pendente:"pendente"}[e]||"leve"}},85231(e,t,n){"use strict";n.d(t,{GB:()=>p,Nb:()=>y,Tp:()=>l,X3:()=>f,bP:()=>v,xP:()=>u});n(52675),n(89463),n(23288),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362),n(38781);var r=n(52354);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(e){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/professional/clock-in/shift",{params:{date:t}});case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}function u(e){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/professional/clock-in/occurrences",{params:{date:t}});case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}function f(e){return m.apply(this,arguments)}function m(){return(m=s(a().m(function e(t){var n,o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return(n=new FormData).append("device",t.device),n.append("mode",t.mode),t.selfie&&n.append("selfie",t.selfie,"selfie.jpg"),t.location&&(n.append("latitude",t.location.lat.toString()),n.append("longitude",t.location.lng.toString())),t.screenshot&&n.append("screenshot",t.screenshot),t.qrcode&&n.append("qrcode",t.qrcode),t.testTime&&n.append("testTime",t.testTime),e.n=1,r.F.post("/time-management/professional/clock-in",n,{headers:{"Content-Type":"multipart/form-data"}});case 1:return o=e.v,i=o.data,e.a(2,i.data)}},e)}))).apply(this,arguments)}function p(e,t){return h.apply(this,arguments)}function h(){return(h=s(a().m(function e(t,n){var o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return console.log("[addJustification] Enviando requisição..."),console.log("[addJustification] URL:","/time-management/professional/clock-in/occurrences/".concat(t,"/justification")),console.log("[addJustification] Payload:",{justification:n}),e.n=1,r.F.post("/time-management/professional/clock-in/occurrences/".concat(t,"/justification"),{justification:n},{headers:{"Content-Type":"application/json",Accept:"application/json"}});case 1:return o=e.v,i=o.data,console.log("[addJustification] Status da resposta OK"),console.log("[addJustification] response.data:",i),e.a(2,i)}},e)}))).apply(this,arguments)}function v(e,t){return b.apply(this,arguments)}function b(){return(b=s(a().m(function e(t,n){var o,i;return a().w(function(e){for(;;)switch(e.n){case 0:return console.log("[editOccurrenceTime] Enviando requisição..."),console.log("[editOccurrenceTime] URL:","/time-management/professional/clock-in/occurrences/".concat(t,"/edit-time")),console.log("[editOccurrenceTime] Payload:",{time:n}),e.n=1,r.F.patch("/time-management/professional/clock-in/occurrences/".concat(t,"/edit-time"),{time:n},{headers:{"Content-Type":"application/json",Accept:"application/json"}});case 1:return o=e.v,i=o.data,console.log("[editOccurrenceTime] Status da resposta OK"),console.log("[editOccurrenceTime] response.data:",i),e.a(2,i)}},e)}))).apply(this,arguments)}function y(e){return g.apply(this,arguments)}function g(){return(g=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.delete("/time-management/test/clear-point",{params:{date:t},headers:{"Content-Type":"application/json",Accept:"application/json"}});case 1:return n=e.v,o=n.data,e.a(2,o)}},e)}))).apply(this,arguments)}},86628(e,t,n){var r={"./TesteController.tsx":90412};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=86628},88195(e,t,n){"use strict";n.d(t,{A:()=>a});n(62062),n(26099);var r=n(74848);function a(e){var t=e.columns,n=e.data,a=e.renderRow,o=e.emptyMessage,i=void 0===o?"Nenhuma atividade registrada":o,s=e.className,l=void 0===s?"":s;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"table-responsive app-table-responsive ".concat(l),children:(0,r.jsxs)("table",{className:"table mb-0 table-hover app-table",children:[(0,r.jsx)("thead",{className:"thead-light",children:(0,r.jsx)("tr",{children:t.map(function(e){return(0,r.jsx)("th",{className:"center"===e.align?"text-center":"right"===e.align?"text-right":"",style:{width:e.width},children:e.label},e.key)})})}),(0,r.jsx)("tbody",{children:0===n.length?(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:t.length,className:"text-center text-muted py-4",children:i})}):n.map(function(e,t){return(0,r.jsx)("tr",{className:t%2==1?"bg-light":"",children:a(e,t)},t)})})]})})})}},88821(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>c});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540),o=n(73638);function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var l={container:{padding:"16px",minWidth:"320px",maxWidth:"400px"},header:{fontSize:"14px",fontWeight:600,color:"#5C5D5D",marginBottom:"12px",paddingBottom:"8px",borderBottom:"1px solid #E0E0E0"},textarea:{width:"100%",padding:"10px",border:"1px solid #D1D5DB",borderRadius:"5px",fontSize:"13px",color:"#5C5D5D",minHeight:"100px",resize:"vertical",marginBottom:"12px",boxSizing:"border-box"},buttonGroup:{display:"flex",justifyContent:"flex-end",gap:"8px"},cancelButton:{padding:"8px 16px",border:"1px solid #D1D5DB",borderRadius:"5px",backgroundColor:"#FFF",fontSize:"13px",fontWeight:600,color:"#5C5D5D",cursor:"pointer"},saveButton:{padding:"8px 16px",border:"none",borderRadius:"5px",backgroundColor:"#186073",fontSize:"13px",fontWeight:600,color:"#FFF",cursor:"pointer"}};function c(e){var t=e.show,n=e.onClose,s=e.onSave,c=e.initialComment,u=e.activityName,d=e.triggerRef,f=i((0,a.useState)(c),2),m=f[0],p=f[1];(0,a.useEffect)(function(){p(c)},[c,t]);return(0,r.jsx)(o.A,{show:t,onClose:n,position:"bottom",triggerRef:d,children:(0,r.jsxs)("div",{style:l.container,children:[(0,r.jsxs)("div",{style:l.header,children:["Comentário: ",u]}),(0,r.jsx)("textarea",{style:l.textarea,value:m,onChange:function(e){return p(e.target.value)},placeholder:"Adicione observações sobre a atividade...",autoFocus:!0}),(0,r.jsxs)("div",{style:l.buttonGroup,children:[(0,r.jsx)("button",{type:"button",style:l.cancelButton,onClick:n,children:"Cancelar"}),(0,r.jsx)("button",{type:"button",style:l.saveButton,onClick:function(){s(m)},children:"Salvar"})]})]})})}},90162(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>j});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(64346),n(23792),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(47764),n(23500),n(62953);var r,a=n(74848),o=n(49785),i=n(96540),s=n(34559);n(62062),n(5506);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=l(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==l(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.FORGETFULNESS="esquecimento",e.DUPLICATE_RECORD="registro_duplicado",e.REQUESTED_ADJUSTMENT="ajuste_solicitado"}(r||(r={}));var f=d(d(d({},r.FORGETFULNESS,"Esquecimento"),r.DUPLICATE_RECORD,"Registro duplicado"),r.REQUESTED_ADJUSTMENT,"Ajuste solicitado");var m=n(1806),p=n(47339);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){y(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=h(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==h(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e){var t=e.isOpen,n=e.onClose,r=e.record,l=e.onSave,u=e.isSaving,d=(0,o.mN)({mode:"onChange",defaultValues:{motivo:"",primeiraEntradaData:"",primeiraEntradaHora:"",primeiraSaidaData:"",primeiraSaidaHora:"",segundaEntradaData:"",segundaEntradaHora:"",saidaData:"",saidaHora:""}}),h=d.register,v=d.handleSubmit,y=d.control,x=d.reset,j=d.formState,w=j.errors,S=j.isValid;(0,i.useEffect)(function(){if(r){var e,t,n,a,o=g((r.data||"").split("/"),3),i=o[0],s=o[1],l=o[2],c=l&&s&&i?"".concat(l,"-").concat(s,"-").concat(i):"";x({motivo:"",primeiraEntradaData:c,primeiraEntradaHora:(null===(e=r.registros)||void 0===e?void 0:e[0])||"",primeiraSaidaData:c,primeiraSaidaHora:(null===(t=r.registros)||void 0===t?void 0:t[1])||"",segundaEntradaData:c,segundaEntradaHora:(null===(n=r.registros)||void 0===n?void 0:n[2])||"",saidaData:c,saidaHora:(null===(a=r.registros)||void 0===a?void 0:a[3])||""})}},[r,x]);var N=function(e,t){if(!e||!t)return null;var n=new Date("".concat(e,"T").concat(t));return isNaN(n.getTime())?null:n.getTime()},k=function(){x(),n()};if(!t)return null;var C=Object.entries(f).map(function(e){var t=c(e,2);return{value:t[0],label:t[1]}});return(0,a.jsx)(m.A,{show:t,onClose:k,title:"Editando Registro",size:"md",className:"w-75",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:k,disabled:u,children:"Cancelar"}),(0,a.jsx)("button",{type:"submit",form:"editRecordForm",className:"btn btn-primary",disabled:u||!S,style:{backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("i",{className:"fas fa-spinner fa-spin mr-1"}),"Salvando..."]}):"Salvar Edição"})]}),children:(0,a.jsx)("form",{id:"editRecordForm",onSubmit:v(function(e){if(e.motivo){for(var t=[{name:"Primeira Entrada",value:N(e.primeiraEntradaData,e.primeiraEntradaHora)},{name:"Primeira Saída",value:N(e.primeiraSaidaData,e.primeiraSaidaHora)},{name:"Segunda Entrada",value:N(e.segundaEntradaData,e.segundaEntradaHora)},{name:"Segunda Saída",value:N(e.saidaData,e.saidaHora)}].filter(function(e){return null!==e.value}),n=1;n<t.length;n++){var r=t[n-1],a=t[n];if(a.value<=r.value)return void p.A.warning('O horário de "'.concat(a.name,'" deve ser posterior a "').concat(r.name,'".'),"Horário inválido")}l(e)}else p.A.warning("Por favor, selecione o motivo.","Campo obrigatório")}),children:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,a.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Selecione o Motivo"}),(0,a.jsx)("p",{children:"Informe o motivo pelo qual este ponto precisa ser ajustado."}),(0,a.jsx)(o.xI,{name:"motivo",control:y,rules:{required:"Motivo é obrigatório"},render:function(e){var t=e.field;return(0,a.jsx)(s.A,{options:C,value:t.value,placeholder:"Motivo*",size:"md",onChange:t.onChange})}}),w.motivo&&(0,a.jsx)("small",{className:"text-danger d-block mt-1",children:w.motivo.message})]}),(0,a.jsxs)("div",{className:"row mb-3",children:[(0,a.jsxs)("div",{className:"col-md-6",children:[(0,a.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Primeira Entrada"}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{className:"col-8",children:(0,a.jsx)("div",{className:"input-group",children:(0,a.jsx)("input",b(b({},h("primeiraEntradaData")),{},{type:"date",className:"form-control"}))})}),(0,a.jsx)("div",{className:"col-4",children:(0,a.jsx)("input",b(b({},h("primeiraEntradaHora")),{},{type:"time",className:"form-control",placeholder:"--:--"}))})]})]}),(0,a.jsxs)("div",{className:"col-md-6",children:[(0,a.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Primeira Saída"}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{className:"col-8",children:(0,a.jsx)("div",{className:"input-group",children:(0,a.jsx)("input",b(b({},h("primeiraSaidaData")),{},{type:"date",className:"form-control"}))})}),(0,a.jsx)("div",{className:"col-4",children:(0,a.jsx)("input",b(b({},h("primeiraSaidaHora")),{},{type:"time",className:"form-control",placeholder:"12:00"}))})]})]})]}),(0,a.jsxs)("div",{className:"row mb-3",children:[(0,a.jsxs)("div",{className:"col-md-6",children:[(0,a.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Segunda Entrada"}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{className:"col-8",children:(0,a.jsx)("div",{className:"input-group",children:(0,a.jsx)("input",b(b({},h("segundaEntradaData")),{},{type:"date",className:"form-control"}))})}),(0,a.jsx)("div",{className:"col-4",children:(0,a.jsx)("input",b(b({},h("segundaEntradaHora")),{},{type:"time",className:"form-control",placeholder:"13:01"}))})]})]}),(0,a.jsxs)("div",{className:"col-md-6",children:[(0,a.jsx)("h6",{style:{color:"#5C5D5D",marginBottom:"8px"},children:"Segunda Saída"}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("div",{className:"col-8",children:(0,a.jsx)("div",{className:"input-group",children:(0,a.jsx)("input",b(b({},h("saidaData")),{},{type:"date",className:"form-control"}))})}),(0,a.jsx)("div",{className:"col-4",children:(0,a.jsx)("input",b(b({},h("saidaHora")),{},{type:"time",className:"form-control",placeholder:"18:00"}))})]})]})]})]})})})}},90412(){},92268(e,t,n){"use strict";n.d(t,{A:()=>o});n(62062),n(26099),n(11392);var r=n(74848),a=n(73638);function o(e){var t=e.show,n=e.onClose,o=e.options,i=e.onSelect,s=e.position,l=void 0===s?"left":s,c=e.triggerRef;return(0,r.jsx)(a.A,{show:t,onClose:n,position:l,width:"200px",triggerRef:c,children:o.map(function(e){return(0,r.jsxs)("button",{type:"button",className:"dropdown-item d-flex align-items-center",onClick:function(){return t=e.value,i(t),void n();var t},style:{backgroundColor:e.selected?"#F3F3F3":"transparent",color:e.selected?"#5C5D5D":"inherit"},children:[e.icon&&(e.icon.startsWith("/")||e.icon.startsWith("http")?(0,r.jsx)("img",{src:e.icon,alt:"",className:"mr-2",style:{width:"16px",height:"16px"}}):(0,r.jsx)("i",{className:"".concat(e.icon," mr-2")})),e.label]},e.value)})})}},92454(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>s});n(52675),n(89463),n(2259),n(23418),n(64346),n(23792),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(96540);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t=e.isOpen,n=e.onConfirm,i=e.onClose,s=o((0,a.useState)(""),2),l=s[0],c=s[1],u=o((0,a.useState)(null),2),d=u[0],f=u[1];(0,a.useEffect)(function(){t&&(c(""),f(null))},[t]);return t?(0,r.jsx)("div",{className:"modal show d-block",style:{backgroundColor:"rgba(0,0,0,0.5)"},onClick:i,children:(0,r.jsx)("div",{className:"modal-dialog modal-dialog-centered",onClick:function(e){return e.stopPropagation()},children:(0,r.jsxs)("div",{className:"modal-content",children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsxs)("h5",{className:"modal-title",children:[(0,r.jsx)("i",{className:"fas fa-flask mr-2"}),"Bater Ponto Teste"]}),(0,r.jsx)("button",{type:"button",className:"close",onClick:i,"aria-label":"Fechar",children:(0,r.jsx)("span",{"aria-hidden":"true",children:"×"})})]}),(0,r.jsxs)("form",{onSubmit:function(e){(e.preventDefault(),l)?/^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(l)?n(l):f("Horário inválido. Use o formato HH:mm (ex: 18:00)"):f("Por favor, informe o horário")},children:[(0,r.jsxs)("div",{className:"modal-body",children:[(0,r.jsx)("p",{className:"text-muted mb-3",children:"Informe o horário que deseja registrar para o ponto de teste:"}),(0,r.jsxs)("div",{className:"form-group",children:[(0,r.jsx)("label",{htmlFor:"test-time",children:"Horário (HH:mm)"}),(0,r.jsx)("input",{type:"time",id:"test-time",className:"form-control ".concat(d?"is-invalid":""),value:l,onChange:function(e){var t=e.target.value;c(t),f(null)},onFocus:function(){f(null)},required:!0}),d&&(0,r.jsx)("div",{className:"invalid-feedback",children:d})]})]}),(0,r.jsxs)("div",{className:"modal-footer",children:[(0,r.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:i,children:"Cancelar"}),(0,r.jsxs)("button",{type:"submit",className:"btn btn-primary",style:{backgroundColor:"#17A2B8",borderColor:"#17A2B8"},children:[(0,r.jsx)("i",{className:"fas fa-check mr-2"}),"Registrar Ponto"]})]})]})]})})}):null}},92801(e,t,n){"use strict";n.d(t,{A:()=>x});n(52675),n(89463),n(2259),n(28706),n(23418),n(74423),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(21699),n(47764),n(68156),n(62953);var r=n(74848),a=n(96540),o=n(33930),i=n(10280),s=n(30588),l=n(73236),c=n(71458),u=n(93628),d=n(42328),f=n(72722),m=n(1125),p=n(81623),h=n(9504),v=n(50860);function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var g=function(e){var t=e.value,n=e.label,a={container:{background:"#FFF",borderRadius:"3px",border:"1px solid rgba(217, 217, 217, 0.40)",padding:"20px",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",textAlign:"left"},title:{fontSize:"20px",fontWeight:700,color:"#5C5D5D",margin:"0 0 8px 0",lineHeight:"normal"},subtitle:{fontSize:"12px",color:"rgba(92, 93, 93, 0.50)",margin:0,fontWeight:500,lineHeight:"normal"}};return(0,r.jsxs)("div",{style:a.container,children:[(0,r.jsx)("h3",{style:a.title,children:t}),(0,r.jsx)("p",{style:a.subtitle,children:n})]})};function x(e){var t=e.title,n=e.subtitle,y=e.showBackButton,x=void 0!==y&&y,j=e.onBack,w=e.showExportButton,S=void 0!==w&&w,N=(e.onExport,e.userInfo),k=e.memberId,C=b((0,a.useState)(function(){var e=new Date,t=new Date;t.setDate(t.getDate()-30);var n=function(e){var t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r)};return{startDate:n(t),endDate:n(e)}}()),2),O=C[0],A=C[1],E=b((0,a.useState)(["task"]),2),P=E[0],F=E[1],T=b((0,a.useState)(["timesheet"]),2),D=T[0],_=T[1],I=(0,a.useRef)(null),M=b((0,a.useState)(!1),2),R=M[0],z=M[1],L=function(e){A(e)},q=(0,o.I)({queryKey:["month-kpis",O.startDate,O.endDate,k],queryFn:function(){return p.Z4.getMonthKPIs(O.startDate,O.endDate,k)},staleTime:6e4}),B=q.data,G=q.isLoading,H=B?{totalRegistered:B.total_registered_formatted,dailyAverage:B.daily_average_formatted,extraHours:B.extra_hours_formatted,missingHours:B.missing_hours_formatted}:{totalRegistered:"00:00h",dailyAverage:"00:00h",extraHours:"0h",missingHours:"00:00h"},W=(0,o.I)({queryKey:["month-info",O.startDate,O.endDate,k],queryFn:function(){return p.Z4.getMonthInfo(O.startDate,O.endDate,k)},staleTime:6e4}),U=W.data,V=W.isLoading,Q=U?{diasRegistrados:{value:"".concat(U.dias_registrados," de ").concat(U.total_dias_mes),label:"Dias Registrados no Mês"},diasTrabalhados:{value:"".concat(U.dias_trabalhados),label:"Trabalhados"},atividadesRegistradas:{value:"".concat(U.atividades_registradas),label:"Quantidade de Atividades Registradas"}}:{diasRegistrados:{value:"0 de 0",label:"Dias Registrados no Mês"},diasTrabalhados:{value:"0",label:"Trabalhados"},atividadesRegistradas:{value:"0",label:"Quantidade de Atividades Registradas"}},K=(0,o.I)({queryKey:["hours-control",O.startDate,O.endDate,k],queryFn:function(){return p.Z4.getHoursControl(O.startDate,O.endDate,k)},staleTime:6e4}),$=K.data,J=K.isLoading,Y=$?[{type:"Horas Regulares",value:$.regular_hours},{type:"Horas Extras",value:$.extra_hours},{type:"Horas Noturnas",value:$.night_hours}]:[],Z=$?Math.max(20,4*Math.ceil(($.workload_hours+$.extra_hours)/4)):20,X=function(e){return{"Horas Regulares":"#186073","Horas Extras":"#17A1B7","Horas Noturnas":"#02D6C7"}[e]||"#186073"},ee=(0,o.I)({queryKey:["hours-by-project",O.startDate,O.endDate,k],queryFn:function(){return p.Z4.getHoursByProject(O.startDate,O.endDate,k)},staleTime:6e4}),te=ee.data,ne=ee.isLoading,re=(0,o.I)({queryKey:["energy-peaks",O.startDate,O.endDate,k],queryFn:function(){return p.Z4.getEnergyPeaks(O.startDate,O.endDate,k)},enabled:D.includes("timesheet"),staleTime:6e4}),ae=re.data,oe=re.isLoading,ie=(0,o.I)({queryKey:["weekly-hours",O.startDate,O.endDate,k],queryFn:function(){return p.Z4.getWeeklyHours(O.startDate,O.endDate,k)},enabled:P.includes("task"),staleTime:6e4}),se=ie.data,le=ie.isLoading;return(0,r.jsx)("div",{ref:I,children:(0,r.jsxs)(v.A,{children:[(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-4",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[x&&(0,r.jsx)("button",{onClick:j,className:"btn btn-link p-0 mr-3",style:{color:"#5C5D5D",fontSize:"20px",textDecoration:"none"},title:"Voltar",children:(0,r.jsx)("i",{className:"fas fa-arrow-left"})}),(0,r.jsxs)("div",{className:"d-flex align-items-center",children:[N&&(0,r.jsx)("div",{className:"rounded-circle d-flex align-items-center justify-content-center text-white mr-3",style:{width:48,height:48,fontSize:"20px",fontWeight:700,background:N.avatarBg},children:N.initials}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"title_main mb-1",style:{color:"#5C5D5D",fontSize:"20px",fontWeight:600,margin:0},children:t}),n&&(0,r.jsx)("p",{className:"subtitle_main",style:{color:"#5C5D5D",fontSize:"12px",fontWeight:400,margin:0},children:n})]})]})]}),(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{gap:"12px"},children:[S&&(0,r.jsxs)("button",{onClick:function(){(0,h.vl)({dashboardRef:I,dateRange:O,setIsExporting:z})},disabled:R,className:"btn",style:{backgroundColor:"#186073",color:"#fff",border:"none",borderRadius:"8px",padding:"10px 20px",fontSize:"14px",fontWeight:500,display:"flex",alignItems:"center",gap:"8px",cursor:R?"not-allowed":"pointer",opacity:R?.7:1,transition:"all 0.2s ease"},onMouseEnter:function(e){R||(e.currentTarget.style.backgroundColor="#134A5A")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#186073"},children:[(0,r.jsx)("i",{className:"fas fa-download"}),R?"Exportando...":"Exportar em PDF"]}),(0,r.jsx)(s.A,{initialStartDate:O.startDate,initialEndDate:O.endDate,onChange:L,maxDays:365})]})]}),(0,r.jsxs)("div",{className:"row mb-4",children:[(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:H.totalRegistered,label:"Total de Horas Registradas",variant:"teal-dark",isLoading:G,className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:H.dailyAverage,label:"Média Diária",variant:"cyan",isLoading:G,className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:H.extraHours,label:"Total de Horas Extras",variant:"turquoise",isLoading:G,className:"h-100"})}),(0,r.jsx)("div",{className:"col-12 col-sm-6 col-lg-3 mb-2",children:(0,r.jsx)(i.A,{value:H.missingHours,label:"Total de Horas Faltantes",variant:"salmon",isLoading:G,className:"h-100"})})]}),(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-between mb-3",children:(0,r.jsx)(s.A,{initialStartDate:O.startDate,initialEndDate:O.endDate,onChange:L,maxDays:365})}),(0,r.jsx)(l.A,{title:"Horas Trabalhadas na Semana",className:"mb-3",headerActions:(0,r.jsx)(f.A,{options:[{value:"task",label:"Referência Por Task"},{value:"attendance",label:"Referência Por Registro de Ponto"}],selectedValues:P,onChange:F,placeholder:"Selecione os filtros"}),children:le?(0,r.jsx)(m.A,{message:"Carregando dados..."}):(0,r.jsx)(c.A,{selectedFilters:P,weeklyData:se||[]})}),(0,r.jsx)(l.A,{title:"Horas Trabalhadas Por Projetos",className:"mb-3",children:ne?(0,r.jsx)(m.A,{message:"Carregando projetos..."}):te&&te.length>0?(0,r.jsx)(u.A,{projects:te}):(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("i",{className:"fas fa-inbox mr-2",style:{fontSize:"48px",color:"#D6DBED"}}),(0,r.jsx)("p",{className:"text-muted mt-3",children:"Nenhum projeto com horas registradas neste período"})]})}),V?(0,r.jsx)("div",{className:"row mb-3",children:(0,r.jsx)("div",{className:"col-12",children:(0,r.jsx)(m.A,{message:"Carregando informações do mês..."})})}):(0,r.jsxs)("div",{className:"row mb-3",children:[(0,r.jsx)("div",{className:"col-12 col-md-4 mb-3",children:(0,r.jsx)(g,{value:Q.diasRegistrados.value,label:Q.diasRegistrados.label})}),(0,r.jsx)("div",{className:"col-12 col-md-4 mb-3",children:(0,r.jsx)(g,{value:Q.diasTrabalhados.value,label:Q.diasTrabalhados.label})}),(0,r.jsx)("div",{className:"col-12 col-md-4 mb-3",children:(0,r.jsx)(g,{value:Q.atividadesRegistradas.value,label:Q.atividadesRegistradas.label})})]}),(0,r.jsx)(l.A,{title:"Picos de Energia - Horas Registradas",className:"mb-3",headerActions:(0,r.jsx)(f.A,{options:[{value:"timesheet",label:"Por Timesheet"},{value:"attendance",label:"Por Registro de Ponto"}],selectedValues:D,onChange:_,placeholder:"Selecione os filtros"}),children:oe?(0,r.jsx)(m.A,{message:"Carregando dados de energia..."}):(0,r.jsx)(d.A,{selectedFilters:D,timesheetData:D.includes("timesheet")&&ae||[],attendanceData:[]})}),(0,r.jsx)(l.A,{title:"Controle de Horas Trabalhadas",className:"mb-3",children:J?(0,r.jsx)(m.A,{message:"Carregando controle de horas..."}):Y.length>0?(0,r.jsxs)("div",{style:{width:"100%"},children:[(0,r.jsx)("div",{style:{display:"flex",justifyContent:"space-between",paddingLeft:"20px",paddingRight:"30px",marginBottom:"10px"},children:Array.from({length:6},function(e,t){return Math.round(Z/5*t)}).map(function(e){return(0,r.jsx)("span",{style:{color:"#5C5D5D",fontSize:"12px",fontWeight:400},children:e},e)})}),(0,r.jsx)("div",{style:{paddingLeft:"20px",paddingRight:"30px"},children:Y.map(function(e,t){return(0,r.jsx)("div",{style:{marginBottom:"12px"},children:(0,r.jsx)("div",{style:{width:"100%",height:"40px",background:"#F5F5F5",borderRadius:"4px",position:"relative",overflow:"hidden"},children:(0,r.jsx)("div",{style:{width:"".concat(e.value/Z*100,"%"),height:"100%",background:X(e.type),borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"flex-end",paddingRight:"10px",transition:"width 0.3s ease"},children:(0,r.jsxs)("span",{style:{color:"#FFF",fontSize:"12px",fontWeight:600},children:[e.value,"h"]})})})},t)})}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center",gap:"20px",marginTop:"20px"},children:Y.map(function(e){return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:X(e.type),borderRadius:"2px"}}),(0,r.jsx)("span",{style:{color:"#5C5D5D",fontSize:"12px",fontWeight:400},children:e.type})]},e.type)})})]}):(0,r.jsxs)("div",{className:"text-center py-5",children:[(0,r.jsx)("i",{className:"fas fa-clock mr-2",style:{fontSize:"48px",color:"#D6DBED"}}),(0,r.jsx)("p",{className:"text-muted mt-3",children:"Nenhuma hora registrada neste período"})]})})]})})}},93628(e,t,n){"use strict";n.d(t,{A:()=>y});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(83851),n(81278),n(79432),n(26099),n(27495),n(38781),n(47764),n(23500),n(62953);var r=n(74848),a=n(28482),o=n(72050),i=n(5614),s=n(69107),l=n(46668),c=n(77984),u=n(23495),d=n(88224);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=f(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==f(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t=e.projects,n=t.length>0?Math.max.apply(Math,v(t.map(function(e){return e.hours}))):0,f=n>0?Math.ceil(1.2*n):10,m=function(e){if(e<=0)return[0];if(e<=5)return[0,Math.ceil(e)];if(e<=10)return[0,Math.ceil(e/2),Math.ceil(e)];if(e<=20){var t=Math.ceil(e/4);return[0,t,2*t,3*t,Math.ceil(e)]}for(var n=5*Math.ceil(e/4/5),r=[0],a=n;a<=e;a+=n)r.push(a);return r}(f),h=t.map(function(e){return p(p({},e),{},{background:f-e.hours})});return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{children:(0,r.jsx)(a.u,{width:"100%",height:220,children:(0,r.jsxs)(d.E,{data:h,layout:"vertical",margin:{top:10,right:60,left:10,bottom:10},barSize:28,children:[(0,r.jsx)(s.d,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E0E0E0"}),(0,r.jsx)(c.W,{type:"number",domain:[0,f],ticks:m,axisLine:!1,tickLine:!1,tick:{fill:"#5C5D5D",fontSize:12}}),(0,r.jsx)(u.h,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,tick:!1,width:0}),(0,r.jsxs)(l.yP,{dataKey:"hours",stackId:"project",radius:[0,0,0,0],children:[h.map(function(e,t){return(0,r.jsx)(o.f,{fill:e.color},"cell-".concat(t))}),(0,r.jsx)(i.Ze,{dataKey:"hours",position:"right",formatter:function(e){return"".concat(e,"h")},style:{fill:"#5C5D5D",fontSize:12,fontWeight:600}})]}),(0,r.jsx)(l.yP,{dataKey:"background",stackId:"project",fill:"rgba(214, 219, 237, 0.40)",radius:[0,4,4,0]})]})})}),(0,r.jsx)("div",{className:"d-flex align-items-center justify-content-center flex-wrap gap-3 mt-3",children:t.map(function(e,t){return(0,r.jsxs)("div",{className:"d-flex align-items-center",style:{paddingRight:"12px"},children:[(0,r.jsx)("div",{style:{width:"12px",height:"12px",background:e.color,borderRadius:"2px",marginRight:"8px"}}),(0,r.jsx)("span",{style:{fontSize:"12px",color:"#5C5D5D"},children:e.name})]},t)})})]})}},93794(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>N});n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(23418),n(64346),n(23792),n(62062),n(34782),n(89572),n(23288),n(94170),n(62010),n(2892),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(10287),n(26099),n(3362),n(27495),n(38781),n(31415),n(47764),n(23500),n(62953);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(19619),l=n(55801),c=n(96540),u=n(76336);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){v(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return y(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,y(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,y(d,"constructor",c),y(c,"constructor",l),l.displayName="GeneratorFunction",y(c,a,"GeneratorFunction"),y(d),y(d,a,"Generator"),y(d,r,function(){return this}),y(d,"toString",function(){return"[object Generator]"}),(b=function(){return{w:o,m:f}})()}function y(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}y=function(e,t,n,r){function o(t,n){y(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},y(e,t,n,r)}function g(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){g(o,r,a,i,s,"next",e)}function s(e){g(o,r,a,i,s,"throw",e)}i(void 0)})}}var j=[{label:"Selfie",type:"selfie",description:{enabled:"Exige selfie.",disabled:"Não é exigida"}},{label:"Geolocalização",type:"geolocation",description:{enabled:"Cerca exigida.",disabled:"Cerca não exigida."}},{label:"Print da Tela",type:"screenshot",description:{enabled:"Exige Print",disabled:"Print não é exigida"}},{label:"Escanear QR Code",type:"qrcode",description:{enabled:"Escâner exigido",disabled:"Não é exigida"}}],w=[{id:"sem",title:"Sem validação",note:"Para equipes autônomas e confiáveis, com controle de ponto simplificado.",defaults:{}},{id:"flex",title:"Flexível",note:"Ideal para monitorar equipes externas. Permite várias soluções de validação",defaults:{selfie:!0,geolocation:!0,screenshot:!0,qrcode:!0}},{id:"qr",title:"Por QR Code",note:"Permite validação presencial ou digital por escaneamento de QR Code.",defaults:{qrcode:!0}},{id:"manual",title:"Faça você mesmo",note:"Personalize as verificações conforme a necessidade da sua equipe.",defaults:{}}],S=["time-management","validation"];function N(){var e,t,n,d=(0,u.L)().canEdit,m=(0,o.jE)(),p=(0,a.I)({queryKey:S,queryFn:l.G8,staleTime:6e4,refetchOnWindowFocus:!1}),v=p.data,y=p.isFetching,g=p.isLoading,N=v?s.c[v.mode]:null,k=(0,c.useMemo)(function(){var e;return new Set(null!==(e=null==v?void 0:v.others)&&void 0!==e?e:[])},[v]),C=y||g,O=(0,i.n)({mutationFn:function(e){return(0,l.iY)(s.w[e])},onMutate:(e=x(b().m(function e(t){var n,r;return b().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,m.cancelQueries({queryKey:S});case 1:return(n=m.getQueryData(S))&&(r={mode:s.w[t],others:"manual"===t?n.others:[]},m.setQueryData(S,r)),e.a(2,{prev:n})}},e)})),function(t){return e.apply(this,arguments)}),onError:function(e,t,n){null!=n&&n.prev&&m.setQueryData(S,n.prev)},onSuccess:function(e){m.setQueryData(S,e)}}),A=(0,i.n)({mutationFn:function(e){return(0,l.Tt)(e)},onMutate:(t=x(b().m(function e(t){var n,r;return b().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,m.cancelQueries({queryKey:S});case 1:return(n=m.getQueryData(S))&&(r=h(h({},n),{},{others:Array.from(new Set([].concat(f(n.others),[t])))}),m.setQueryData(S,r)),e.a(2,{prev:n})}},e)})),function(e){return t.apply(this,arguments)}),onError:function(e,t,n){null!=n&&n.prev&&m.setQueryData(S,n.prev)}}),E=(0,i.n)({mutationFn:function(e){return(0,l.kc)(e)},onMutate:(n=x(b().m(function e(t){var n,r;return b().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,m.cancelQueries({queryKey:S});case 1:return(n=m.getQueryData(S))&&(r=h(h({},n),{},{others:n.others.filter(function(e){return e!==t})}),m.setQueryData(S,r)),e.a(2,{prev:n})}},e)})),function(e){return n.apply(this,arguments)}),onError:function(e,t,n){null!=n&&n.prev&&m.setQueryData(S,n.prev)}}),P=O.isPending||A.isPending||E.isPending;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"row",children:w.map(function(e){var t=N===e.id;return(0,r.jsx)("div",{className:"col-12 col-lg-3 mb-3",children:(0,r.jsx)("div",{className:"card h-100 tm-card-mobile-auto ".concat(t?"border-primary bg-primary-soft":"border"),children:(0,r.jsxs)("div",{className:"card-body",children:[(0,r.jsxs)("div",{className:"d-flex align-items-center mb-2",children:[(0,r.jsxs)("div",{className:"custom-control custom-checkbox",children:[(0,r.jsx)("input",{id:"chk-".concat(e.id),type:"checkbox",className:"custom-control-input",checked:!!t,disabled:P||C,onChange:function(){return t=e.id,void(d&&N!==t&&O.mutate(t));var t}}),(0,r.jsx)("label",{className:"custom-control-label",htmlFor:"chk-".concat(e.id)})]}),(0,r.jsx)("label",{htmlFor:"chk-".concat(e.id),className:"mb-0 ml-2 ".concat(t?"text-primary":""),style:{cursor:"pointer"},children:e.title}),(P||C)&&(0,r.jsx)("i",{className:"fas fa-spinner fa-spin ml-auto text-muted"})]}),(0,r.jsx)("small",{className:"text-muted d-block mb-2",children:e.note}),(0,r.jsx)("ul",{className:"list-unstyled mb-0",children:j.map(function(n){var a=!!e.defaults[n.type],o="manual"===e.id?k.has(n.type):a,i="manual"===e.id,s=P||C;return(0,r.jsxs)("li",{className:"d-flex align-items-start mb-3",children:[i?(0,r.jsxs)("div",{className:"custom-control custom-checkbox mr-2",children:[(0,r.jsx)("input",{id:"op-".concat(e.id,"-").concat(n.type),type:"checkbox",className:"custom-control-input",checked:o,disabled:s,onChange:function(){return e=n.type,void(d&&"manual"===N&&(k.has(e)?E.mutate(e):A.mutate(e)));var e}}),(0,r.jsx)("label",{className:"custom-control-label",htmlFor:"op-".concat(e.id,"-").concat(n.type)})]}):(0,r.jsx)("i",{className:"fas ".concat(o?"fa-check ".concat(t?"text-primary":"text-success"):"fa-times text-muted"," mr-2 mt-1"),style:{fontSize:"1.2rem",minWidth:"20px"}}),(0,r.jsxs)("div",{style:{minHeight:"2.5rem"},children:[(0,r.jsx)("div",{className:"".concat(i||o?"":"text-muted"),children:n.label}),i?(0,r.jsx)("small",{className:"text-muted",style:{visibility:"hidden"},children:" "}):(0,r.jsx)("small",{className:"text-muted",children:o?n.description.enabled:n.description.disabled})]})]},n.type)})})]})})},e.id)})})})}},94034(e,t,n){"use strict";n.d(t,{A:()=>o});n(51629),n(62062),n(26099);var r=n(74848),a=n(96540);function o(e){var t=e.items,n=e.activeKey,o=e.title,i=e.onChange,s=e.onBack,l=e.backLabel,c=void 0===l?"Voltar":l,u=e.hideTabs,d=void 0!==u&&u,f=(0,a.useRef)(null);return(0,a.useEffect)(function(){var e=f.current;if(e){for(var t=e.parentElement,n=[];t;){var r=window.getComputedStyle(t),a=r.overflow,o=r.overflowY;"hidden"!==a&&"auto"!==a&&"scroll"!==a&&"hidden"!==o&&"auto"!==o&&"scroll"!==o||(t.style.setProperty("overflow","visible","important"),t.style.setProperty("overflow-y","visible","important"),n.push(t)),t=t.parentElement}var i=e.nextElementSibling;return i&&(i.style.setProperty("position","relative","important"),i.style.setProperty("z-index","1","important")),function(){n.forEach(function(e){e.style.removeProperty("overflow"),e.style.removeProperty("overflow-y")}),i&&(i.style.removeProperty("position"),i.style.removeProperty("z-index"))}}},[]),(0,r.jsxs)("header",{ref:f,className:"modern-header tm-modern-header ".concat(d?"no-tabs":""),children:[(0,r.jsxs)("div",{className:"header-top",children:[s&&(0,r.jsx)("button",{type:"button",className:"btn d-flex align-items-center justify-content-center",style:{borderRadius:5,padding:"5px 10px",height:40,width:40},onClick:s,"aria-label":c,title:c,children:(0,r.jsx)("i",{className:"fas fa-chevron-left","aria-hidden":"true"})}),(0,r.jsx)("h1",{className:"header-title",children:o})]}),!d&&(0,r.jsx)("div",{className:"app-tabs-bar",children:(0,r.jsx)("div",{className:"app-tabs",role:"tablist",children:(0,r.jsx)("div",{className:"d-flex flex-nowrap nav mhs-tabs-nav app-tabs-inner-row",children:t.map(function(e){var t=e.key===n;return e.href?(0,r.jsx)("a",{className:"app-tab-link ".concat(t?"active":""),href:e.href,role:"tab","aria-selected":t,children:e.label},e.key):(0,r.jsx)("button",{type:"button",className:"app-tab-link ".concat(t?"active":""),role:"tab","aria-selected":t,onClick:function(){return null==i?void 0:i(e.key)},children:e.label},e.key)})})})})]})}},95226(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>v});n(52675),n(89463),n(2259),n(28706),n(23418),n(64346),n(23792),n(62062),n(34782),n(23288),n(62010),n(26099),n(27495),n(38781),n(47764),n(62953);var r=n(74848),a=n(33930),o=n(97665),i=n(57097),s=n(70038),l=n(96540),c=n(79724),u=n(14011),d=n(76336),f=n(47339);function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var h=["time-management","work-shifts"];function v(){var e=(0,d.L)(),t=e.canCreate,n=e.canEdit,p=e.canDelete,v=m((0,l.useState)(!1),2),b=v[0],y=v[1],g=m((0,l.useState)(null),2),x=g[0],j=g[1],w=m((0,l.useState)(!1),2),S=w[0],N=w[1],k=m((0,l.useState)(null),2),C=k[0],O=k[1],A=(0,o.jE)(),E=(0,l.useRef)(null),P=(0,l.useRef)(null),F=(0,l.useRef)(null),T=m((0,l.useState)(0),2),D=T[0],_=T[1],I=(0,a.I)({queryKey:h,queryFn:s.hY}),M=I.data,R=void 0===M?[]:M,z=I.isFetching,L=(0,i.n)({mutationFn:s.b1,onSuccess:function(){A.invalidateQueries({queryKey:h})}}),q=(0,i.n)({mutationFn:function(e){var t=e.workShiftId,n=e.memberIds;return(0,s.nx)(t,n)},onSuccess:function(){A.invalidateQueries({queryKey:h}),A.invalidateQueries({queryKey:["time-management","members"]}),A.invalidateQueries({queryKey:["time-management","members-with-shifts"]}),f.A.success("Membros atribuídos com sucesso!","Sucesso"),B()},onError:function(){f.A.error("Erro ao atribuir membros. Por favor, tente novamente.","Erro")}}),B=function(){N(!1),O(null)},G=(0,l.useMemo)(function(){return 0===R.length},[R]);return(0,l.useEffect)(function(){var e=function(){if(P.current&&F.current){var e=P.current.getBoundingClientRect(),t=F.current.getBoundingClientRect(),n=t.left-e.left+t.width/2;_(n)}};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[R]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("style",{children:"\n .workshift-list-container { overflow: visible !important; overflow-x: visible !important; overflow-y: visible !important; }\n .workshift-list-container .card { overflow: visible !important; }\n .workshift-list-container .card-body { overflow: visible !important; }\n .workshift-list-container .row { overflow: visible !important; }\n .workshift-list { max-height: 360px; overflow-y: auto; padding-right: 6px; }\n .workshift-header-time { min-width: 200px; text-align: right; }\n @media (max-width: 768px) {\n .workshift-card-content {\n flex-direction: column !important;\n align-items: flex-start !important;\n }\n .workshift-icon {\n margin-bottom: 10px;\n }\n .workshift-time {\n margin: 10px 0 !important;\n width: 100%;\n }\n .workshift-actions {\n position: absolute;\n top: 10px;\n right: 10px;\n }\n .workshift-header-time {\n display: none !important;\n }\n }\n "}),(0,r.jsx)("div",{ref:E,className:"position-relative",children:!G&&(0,r.jsx)("div",{style:{position:"absolute",top:-28,left:D,transform:"translateX(-50%)"},className:"text-muted d-none d-md-block",children:"Horário"})}),!G&&(0,r.jsx)("div",{className:"mb-3 workshift-list-container workshift-list",ref:P,style:{overflow:"visible"},children:R.map(function(e,t){return(0,r.jsx)("div",{className:"card mb-3",style:{border:"1px solid #e0e0e0",borderRadius:"8px",position:"relative",overflow:"visible"},children:(0,r.jsx)("div",{className:"card-body py-3",style:{overflow:"visible"},children:(0,r.jsxs)("div",{className:"row no-gutters align-items-center workshift-card-content",style:{overflow:"visible"},children:[(0,r.jsx)("div",{className:"col-auto pr-2 d-flex align-items-center justify-content-center workshift-icon",children:(0,r.jsx)("div",{style:{width:40,height:40},className:"d-flex align-items-center justify-content-center bg-primary-soft rounded",children:(0,r.jsx)("i",{className:"far fa-clock text-primary",style:{fontSize:"1.2rem"}})})}),(0,r.jsx)("div",{className:"col-12 col-md-3 px-2 d-flex",style:{minWidth:0},children:(0,r.jsx)("div",{className:"d-flex align-items-center w-100 my-auto",style:{minWidth:0},children:(0,r.jsx)("span",{className:"font-weight-bold text-truncate",style:{minWidth:0},children:e.name})})}),(0,r.jsx)("div",{className:"col px-2 d-flex",style:{minWidth:0},children:(0,r.jsx)("div",{className:"w-100 my-auto text-muted text-truncate text-center",style:{minWidth:0},children:e.description})}),(0,r.jsx)("div",{ref:0===t?F:void 0,className:"col-auto text-center text-muted workshift-time px-2 my-auto",style:{whiteSpace:"nowrap",fontSize:"0.9rem",width:"240px"},children:(a=e.firstCheckIn,o=e.firstCheckOut,i=e.secondCheckIn,s=e.secondCheckOut,l=function(e){return e?e.slice(0,5):"--:--"},"".concat(l(a)," às ").concat(l(o))+(i||s?" • ".concat(l(i)," às ").concat(l(s)):""))}),(0,r.jsxs)("div",{className:"col-auto pl-2 dropdown workshift-actions ml-auto",style:{flexShrink:0,position:"static"},children:[(0,r.jsx)("button",{className:"btn btn-link text-muted p-0","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",style:{fontSize:"1.2rem"},children:(0,r.jsx)("i",{className:"fas fa-ellipsis-v"})}),(0,r.jsxs)("div",{className:"dropdown-menu dropdown-menu-right",style:{zIndex:2e3},children:[n&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(){return function(e){j(e),y(!0)}(e)},disabled:L.isPending,children:[(0,r.jsx)("i",{className:"far fa-edit mr-2"}),"Editar"]}),n&&(0,r.jsxs)("button",{className:"dropdown-item",onClick:function(){return function(e){O(e),N(!0)}(e)},disabled:L.isPending,children:[(0,r.jsx)("i",{className:"fas fa-users mr-2"}),"Membros"]}),p&&(0,r.jsxs)("button",{className:"dropdown-item text-danger",onClick:function(){return function(e){window.confirm('Tem certeza que deseja excluir o turno "'.concat(e.name,'"?'))&&L.mutate(e.id)}(e)},disabled:L.isPending,children:[(0,r.jsx)("i",{className:"far fa-trash-alt mr-2"}),L.isPending?"Excluindo...":"Excluir"]})]})]})]})})},e.id);var a,o,i,s,l})}),t&&(0,r.jsxs)("div",{className:"text-muted d-flex align-items-center",role:"button",onClick:function(){return y(!0)},style:{cursor:"pointer",fontSize:"0.95rem"},children:[(0,r.jsx)("i",{className:"fas fa-plus mr-2"})," Adicionar Turno",z&&(0,r.jsx)("i",{className:"fas fa-spinner fa-spin ml-2"})]}),b&&(0,r.jsx)(c.default,{show:b,onClose:function(){y(!1),j(null)},editData:x}),(0,r.jsx)(u.default,{isOpen:S,onClose:B,workShift:C,onSave:function(e){null!=C&&C.id&&q.mutate({workShiftId:C.id,memberIds:e})},isSaving:q.isPending})]})}},96339(e,t,n){"use strict";n.d(t,{E:()=>u,Z:()=>l});n(52675),n(89463),n(94170),n(59904),n(84185),n(40875),n(10287),n(26099),n(3362);var r=n(52354);function a(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,a,i){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,a){var o,i,s,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,i=0,s=e,f.n=n,l}};function m(n,r){for(i=n,s=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(s=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(i=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,i=0))}if(a||n>1)return l;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),i=u,s=p;(t=i<2?e:s)||!d;){o||(i?i<3?(i>1&&(f.n=-1),m(i,s)):f.n=s:f.v=s);try{if(c=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(s=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){o=e,i=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,a,i),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][r]?t(t([][r]())):(o(t={},r,function(){return this}),t),m=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,i,"GeneratorFunction")),e.prototype=Object.create(m),e}return u.prototype=d,o(m,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,i,"GeneratorFunction"),o(m),o(m,i,"Generator"),o(m,r,function(){return this}),o(m,"toString",function(){return"[object Generator]"}),(a=function(){return{w:s,m:p}})()}function o(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}o=function(e,t,n,r){function i(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},o(e,t,n,r)}function i(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function s(e){i(o,r,a,s,l,"next",e)}function l(e){i(o,r,a,s,l,"throw",e)}s(void 0)})}}function l(){return c.apply(this,arguments)}function c(){return(c=s(a().m(function e(){var t,n;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.get("/time-management/policy");case 1:return t=e.v,n=t.data,e.a(2,n.data)}},e)}))).apply(this,arguments)}function u(e){return d.apply(this,arguments)}function d(){return(d=s(a().m(function e(t){var n,o;return a().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.F.put("/time-management/policy",t);case 1:return n=e.v,o=n.data,e.a(2,o.data)}},e)}))).apply(this,arguments)}},96930(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>N});n(52675),n(89463),n(2259),n(45700),n(2008),n(51629),n(23792),n(89572),n(94170),n(2892),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(10287),n(26099),n(3362),n(47764),n(42762),n(23500),n(62953);var r,a=n(74848),o=n(49785),i=n(97665),s=n(57097),l=n(34559);n(23418),n(64346),n(62062),n(34782),n(23288),n(62010),n(5506),n(27495),n(38781);function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.MARRIAGE_LEAVE="marriage_leave",e.MATERNITY_LEAVE="maternity_leave",e.SICK_LEAVE="sick_leave",e.OTHER="other"}(r||(r={}));var m=f(f(f(f({},r.MARRIAGE_LEAVE,"Casamento"),r.MATERNITY_LEAVE,"Licença maternidade"),r.SICK_LEAVE,"Licença médica"),r.OTHER,"Outro");var p=n(50418),h=n(96540),v=n(1806);function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return w(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],d=!1,f={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,i}};function m(n,r){for(s=n,l=r,t=0;!d&&c&&!a&&t<u.length;t++){var a,o=u[t],m=f.p,p=o[2];n>3?(a=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=m&&((a=n<2&&m<o[1])?(s=0,f.v=r,f.n=o[1]):m<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(a||n>1)return i;throw d=!0,r}return function(a,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&m(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),m(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(w(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,w(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,w(d,"constructor",c),w(c,"constructor",l),l.displayName="GeneratorFunction",w(c,a,"GeneratorFunction"),w(d),w(d,a,"Generator"),w(d,r,function(){return this}),w(d,"toString",function(){return"[object Generator]"}),(j=function(){return{w:o,m:f}})()}function w(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}w=function(e,t,n,r){function o(t,n){w(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},w(e,t,n,r)}function S(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function N(e){var t,n,c=e.isOpen,d=e.onClose,f=e.record,b=(e.onSave,e.isSaving,(0,i.jE)()),y=(0,o.mN)({mode:"onChange",defaultValues:{isParcial:!1,motivo:"",descricao:"",periodoInicio:"",periodoFim:""}}),x=y.register,w=y.handleSubmit,N=y.control,k=y.watch,C=y.reset,O=y.formState.errors,A=k("isParcial"),E=k("motivo"),P=(0,h.useMemo)(function(){return Object.entries(m).map(function(e){var t=u(e,2);return{value:t[0],label:t[1]}})},[]),F=(0,s.n)({mutationFn:(t=j().m(function e(t){var n;return j().w(function(e){for(;;)switch(e.n){case 0:if(null!=f&&f.id){e.n=1;break}throw new Error("ID do registro (hitTheSpotId) não encontrado");case 1:return n={hitTheSpotId:f.id,payOffLicense:t.motivo,partialLicense:t.isParcial,startPeriod:t.isParcial?t.periodoInicio:void 0,endPeriod:t.isParcial?t.periodoFim:void 0,description:t.motivo===r.OTHER?t.descricao:void 0},e.a(2,(0,p.Qb)(n))}},e)}),n=function(){var e=this,n=arguments;return new Promise(function(r,a){var o=t.apply(e,n);function i(e){S(o,r,a,i,s,"next",e)}function s(e){S(o,r,a,i,s,"throw",e)}i(void 0)})},function(e){return n.apply(this,arguments)}),onSuccess:function(e){b.invalidateQueries({queryKey:["time-management","hit-spot-time-history"]}),alert(e.message||"Licença aplicada com sucesso!"),_()},onError:function(e){var t,n=(null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.error)||"Erro ao aplicar licença";alert(n)}}),T=F.mutate,D=F.isPending,_=function(){C(),d()};return c?(0,a.jsx)(v.A,{show:c,onClose:_,title:"Licença",size:"md",footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"btn mh-btn-cancel",onClick:_,disabled:D,children:"Cancelar"}),(0,a.jsx)("button",{type:"submit",form:"licencaForm",className:"btn btn-primary",disabled:D,children:D?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("i",{className:"fas fa-spinner fa-spin mr-1"}),"Salvando..."]}):"Aplicar Licença"})]}),children:(0,a.jsxs)("form",{id:"licencaForm",onSubmit:w(function(e){e.motivo?e.motivo!==r.OTHER||e.descricao.trim()?!e.isParcial||e.periodoInicio&&e.periodoFim?T(e):alert("Por favor, preencha o período de início e finalização."):alert("Por favor, descreva o motivo."):alert("Por favor, selecione o motivo.")}),children:[(0,a.jsxs)("div",{className:"d-flex align-items-center justify-content-between mb-4",children:[(0,a.jsx)("label",{htmlFor:"toggleParcial",style:{fontWeight:"normal"},children:"A licença é parcial?"}),(0,a.jsxs)("div",{className:"custom-control custom-switch",style:{marginRight:0},children:[(0,a.jsx)("input",g(g({},x("isParcial")),{},{type:"checkbox",className:"custom-control-input",id:"toggleParcial"})),(0,a.jsx)("label",{className:"custom-control-label",htmlFor:"toggleParcial",style:{cursor:"pointer"}})]})]}),A&&(0,a.jsxs)("div",{className:"row mb-4",children:[(0,a.jsxs)("div",{className:"col-6",children:[(0,a.jsx)("h6",{children:"Período de Início"}),(0,a.jsxs)("div",{className:"input-group",children:[(0,a.jsx)("input",g(g({},x("periodoInicio",{required:!!A&&"Data de início obrigatória"})),{},{type:"date",className:"form-control",placeholder:"Data"})),(0,a.jsx)("div",{className:"input-group-append",children:(0,a.jsx)("span",{className:"input-group-text",children:(0,a.jsx)("i",{className:"far fa-calendar-alt"})})})]}),O.periodoInicio&&(0,a.jsx)("small",{className:"text-danger d-block mt-1",children:O.periodoInicio.message})]}),(0,a.jsxs)("div",{className:"col-6",children:[(0,a.jsx)("h6",{children:"Período de Finalização"}),(0,a.jsxs)("div",{className:"input-group",children:[(0,a.jsx)("input",g(g({},x("periodoFim",{required:!!A&&"Data de fim obrigatória"})),{},{type:"date",className:"form-control",placeholder:"Data"})),(0,a.jsx)("div",{className:"input-group-append",children:(0,a.jsx)("span",{className:"input-group-text",children:(0,a.jsx)("i",{className:"far fa-calendar-alt"})})})]}),O.periodoFim&&(0,a.jsx)("small",{className:"text-danger d-block mt-1",children:O.periodoFim.message})]})]}),(0,a.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,a.jsx)("h6",{children:"Motivo"}),(0,a.jsx)("p",{children:"Informe o motivo da licença"}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("div",{className:E===r.OTHER?"col-4":"col-12",children:[(0,a.jsx)(o.xI,{name:"motivo",control:N,rules:{required:"Motivo é obrigatório"},render:function(e){var t=e.field;return(0,a.jsx)(l.A,{options:P,value:t.value,placeholder:"Motivo*",size:"md",onChange:function(e){t.onChange(e),e!==r.OTHER&&C(function(e){return g(g({},e),{},{descricao:""})})}})}}),O.motivo&&(0,a.jsx)("small",{className:"text-danger d-block mt-1",children:O.motivo.message})]}),E===r.OTHER&&(0,a.jsxs)("div",{className:"col-8",children:[(0,a.jsx)("input",g(g({},x("descricao",{required:E===r.OTHER&&"Descrição é obrigatória"})),{},{type:"text",className:"form-control",placeholder:"Descreva o motivo*"})),O.descricao&&(0,a.jsx)("small",{className:"text-danger d-block mt-1",children:O.descricao.message})]})]})]})]})}):null}},97677(e,t,n){var r={"./PermissionGuard.tsx":19066,"./Professional/index.tsx":49791,"./Professional/tabs/focusmode/index.tsx":52558,"./Professional/tabs/focusmode/partials/FocusBackgroundPicker.tsx":69794,"./Professional/tabs/focusmode/partials/FocusFullscreen.tsx":26723,"./Professional/tabs/focusmode/partials/FocusMethodInfo.tsx":97839,"./Professional/tabs/focusmode/partials/FocusTimerCard.tsx":18851,"./Professional/tabs/point/index.tsx":18098,"./Professional/tabs/point/modals/ConfirmationPopover.tsx":2799,"./Professional/tabs/point/modals/EditPointModal.tsx":18752,"./Professional/tabs/point/modals/GeolocationModal.tsx":5380,"./Professional/tabs/point/modals/JustificationModal.tsx":67784,"./Professional/tabs/point/modals/QRCodeModal.tsx":39576,"./Professional/tabs/point/modals/ScreenshotModal.tsx":2698,"./Professional/tabs/point/modals/SelfieModal.tsx":77770,"./Professional/tabs/point/modals/TestModal.tsx":92454,"./Professional/tabs/point/partials/ClockCard.tsx":68925,"./Professional/tabs/point/partials/MobileClockCard.tsx":69511,"./Professional/tabs/point/partials/MobileOccurrencesTable.tsx":25149,"./Professional/tabs/point/partials/MobileOptionsModal.tsx":72810,"./Professional/tabs/point/partials/MobileTimeline.tsx":46550,"./Professional/tabs/point/partials/NoShiftAssigned.tsx":15186,"./Professional/tabs/point/partials/OccurrencesTable.tsx":31475,"./Professional/tabs/point/partials/PointCardContainer.tsx":8596,"./Professional/tabs/point/partials/ShiftTable.tsx":13359,"./Professional/tabs/timesheet/index.tsx":65342,"./Professional/tabs/timesheet/partials/CommentPopover.tsx":88821,"./Professional/tabs/timesheet/partials/CounterSection.tsx":75842,"./Professional/tabs/timesheet/partials/DeleteActivityModal.tsx":39618,"./Professional/tabs/timesheet/partials/ManualTimeModal.tsx":14463,"./Professional/tabs/timesheet/partials/PlannedActivitiesCard.tsx":48592,"./Professional/tabs/timesheet/partials/ProjectActivityCard.tsx":49293,"./Professional/tabs/timesheet/partials/ProjectSelector.tsx":59261,"./Professional/tabs/timesheet/partials/ScheduledActivitiesCard.tsx":36279,"./Professional/tabs/timesheet/partials/WorkSatisfactionModal.tsx":17649,"./Professional/tabs/timesheet/partials/shared-activity-utils.ts":33384,"./Tenant/index.tsx":81149,"./Tenant/tabs/attendance/index.tsx":75930,"./Tenant/tabs/overview/index.tsx":57909,"./Tenant/tabs/overview/partials/HistoryTable.tsx":73215,"./Tenant/tabs/overview/partials/OccurrenceTable.tsx":72210,"./Tenant/tabs/overview/partials/modals/HistoryDetailsModal.tsx":61909,"./Tenant/tabs/overview/partials/modals/HistoryFilterModal.tsx":195,"./Tenant/tabs/overview/partials/modals/JustificationModal.tsx":50455,"./Tenant/tabs/overview/partials/modals/OccurrenceFilterModal.tsx":22956,"./Tenant/tabs/permissions/index.tsx":41081,"./Tenant/tabs/pointControl/index.tsx":23696,"./Tenant/tabs/pointControl/partials/PointControlTable.tsx":80596,"./Tenant/tabs/pointControl/partials/modals/AbonarModal.tsx":64466,"./Tenant/tabs/pointControl/partials/modals/EditRecordModal.tsx":90162,"./Tenant/tabs/pointControl/partials/modals/FilterModal.tsx":34773,"./Tenant/tabs/pointControl/partials/modals/LicencaModal.tsx":96930,"./Tenant/tabs/pointControl/partials/modals/ViewRecordModal.tsx":77332,"./Tenant/tabs/settings/index.tsx":43432,"./Tenant/tabs/settings/partials/ChannelsCardRow.tsx":19782,"./Tenant/tabs/settings/partials/LocationSection.tsx":17147,"./Tenant/tabs/settings/partials/NotificationCards.tsx":7440,"./Tenant/tabs/settings/partials/PolicyCards.tsx":52798,"./Tenant/tabs/settings/partials/QRCodeLinkSection.tsx":47034,"./Tenant/tabs/settings/partials/SettingsSection.tsx":46265,"./Tenant/tabs/settings/partials/TimesheetLimitCards.tsx":26071,"./Tenant/tabs/settings/partials/ValidationModes.tsx":93794,"./Tenant/tabs/settings/partials/WorkShiftsSection .tsx":95226,"./Tenant/tabs/settings/partials/modals/AssignMembersModal.tsx":14011,"./Tenant/tabs/settings/partials/modals/LocationModal.tsx":30786,"./Tenant/tabs/settings/partials/modals/QRCodeLinkModal.tsx":42415,"./Tenant/tabs/settings/partials/modals/WorkShiftModal.tsx":79724,"./Tenant/tabs/timesheet/index.tsx":14785,"./Tenant/tabs/timesheet/partials/ProjectBudgetScatter.tsx":4818,"./Tenant/tabs/timesheet/partials/ProjectDistributionPie.tsx":80217,"./Tenant/tabs/timesheet/partials/TeamHoursBar.tsx":49299,"./Tenant/tabs/timesheet/partials/TeamSummaryTable.tsx":65207};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=97677},97839(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(74848);function a(e){var t=e.method,n=function(){switch(t){case"pomodoro":return{title:"Pomodoro",text:"Ciclos de 25 minutos de foco seguidos por 5 minutos de pausa."};case"regra_52_17":return{title:"Regra 52/17",text:"Trabalhe por 52 minutos e faça 17 de pausa, com imersão mais longa."};case"personalizado":return{title:"Personalizado",text:"Defina livremente seus tempos de foco e descanso para seu ritmo."};default:return null}}();return n?(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"p-3",style:{background:"#FFED99",borderRadius:8,color:"#222"},children:[(0,r.jsxs)("strong",{className:"d-block mb-1",children:[n.title,":"]}),(0,r.jsx)("span",{children:n.text})]})}):null}}},e=>{e.O(0,[169,768],()=>{return t=54958,e(e.s=t);var t});e.O()}]);
File: public/finances/common.js
Match lines: 2
10137| const label = (rawLabel || rawType).normalize('NFD').replace(/[\u0300-\u036f]/g, '');
10856| const label = (rawLabel || rawType).normalize('NFD').replace(/[\u0300-\u036f]/g, '');
File: public/jquery-file-upload/server/gae-python/main.py
Match lines: 5
160| def normalize(self, str):
164| content_type = self.normalize(content_type)
165| file_name = self.normalize(file_name)
185| content_type = self.normalize(content_type)
186| file_name = self.normalize(file_name)
File: public/js/Highcharts-8.2.0/code/highcharts-more.js
Match lines: 2
102|h)*B+e,f)}});F.length&&0<y&&!this.logarithmic&&(f-=b,B*=(b+Math.max(0,c)-Math.min(f,b))/b,[["min","userMin",c],["max","userMax",f]].forEach(function(c){"undefined"===typeof l(a.options[c[0]],a[c[1]])&&(a[c[0]]+=c[2]/B)}))};""});C(d,"Series/Networkgraph/DraggableNodes.js",[d["Core/Chart/Chart.js"],d["Core/Globals.js"],d["Core/Utilities.js"]],function(d,a,g){var h=g.addEvent;a.dragNodesMixin={onMouseDown:function(a,h){h=this.chart.pointer.normalize(h);a.fixedPosition={chartX:h.chartX,chartY:h.chartY,
103|plotX:a.plotX,plotY:a.plotY};a.inDragMode=!0},onMouseMove:function(a,h){if(a.fixedPosition&&a.inDragMode){var b=this.chart;h=b.pointer.normalize(h);var g=a.fixedPosition.chartX-h.chartX,d=a.fixedPosition.chartY-h.chartY;h=b.graphLayoutsLookup;if(5<Math.abs(g)||5<Math.abs(d))g=a.fixedPosition.plotX-g,d=a.fixedPosition.plotY-d,b.isInsidePlot(g,d)&&(a.plotX=g,a.plotY=d,a.hasDragged=!0,this.redrawHalo(a),h.forEach(function(a){a.restartSimulation()}))}},onMouseUp:function(a,h){a.fixedPosition&&a.hasDragged&&
File: public/js/Highcharts-8.2.0/code/highcharts.js
Match lines: 9
229|h=p(h);this.followPointer&&a?("undefined"===typeof a.chartX&&(a=g.normalize(a)),h=[a.chartX-f,a.chartY-l]):h[0].tooltipPos?h=h[0].tooltipPos:(h.forEach(function(g){B=g.series.yAxis;M=g.series.xAxis;m+=g.plotX+(!d&&M?M.left-f:0);t+=(g.plotLow?(g.plotLow+g.plotHigh)/2:g.plotY)+(!d&&B?B.top-l:0)}),m/=h.length,t/=h.length,h=[d?k.plotWidth-t:m,this.shared&&!d&&1<h.length&&a?a.chartY-l:d?k.plotHeight-m:t]);return h.map(Math.round)};m.prototype.getDateFormat=function(h,a,k,g){var d=this.chart.time,l=d.dateFormat("%m-%d %H:%M:%S.%L",
261|m(d.changedTouches,a.changedTouches)[0]:a;g||(g=this.getChartPosition());d=k.pageX-g.left;g=k.pageY-g.top;if(k=this.chart.containerScaling)d/=k.scaleX,g/=k.scaleY;return q(a,{chartX:Math.round(d),chartY:Math.round(g)})};l.prototype.onContainerClick=function(a){var g=this.chart,d=g.hoverPoint;a=this.normalize(a);var k=g.plotLeft,h=g.plotTop;g.cancelClick||(d&&this.inClass(a.target,"highcharts-tracker")?(E(d.series,"click",q(a,{point:d})),g.hoverPoint&&d.firePointEvent("click",a)):(q(a,this.getCoordinates(a)),
262|g.isInsidePlot(a.chartX-k,a.chartY-h)&&E(g,"click",a)))};l.prototype.onContainerMouseDown=function(k){var g=1===((k.buttons||k.button)&1);k=this.normalize(k);if(a.isFirefox&&0!==k.button)this.onContainerMouseMove(k);if("undefined"===typeof k.button||g)this.zoomOption(k),g&&k.preventDefault&&k.preventDefault(),this.dragStart(k)};l.prototype.onContainerMouseLeave=function(k){var g=G[m(a.hoverChartIndex,-1)],d=this.chart.tooltip;k=this.normalize(k);g&&(k.relatedTarget||k.toElement)&&(g.pointer.reset(),
263|g.pointer.chartPosition=void 0);d&&!d.isHidden&&this.reset()};l.prototype.onContainerMouseEnter=function(a){delete this.chartPosition};l.prototype.onContainerMouseMove=function(a){var g=this.chart;a=this.normalize(a);this.setHoverChartIndex();a.preventDefault||(a.returnValue=!1);"mousedown"===g.mouseIsDown&&this.drag(a);g.openMenu||!this.inClass(a.target,"highcharts-tracker")&&!g.isInsidePlot(a.chartX-g.plotLeft,a.chartY-g.plotTop)||this.runPointActions(a)};l.prototype.onDocumentTouchEnd=function(k){G[a.hoverChartIndex]&&
264|G[a.hoverChartIndex].pointer.drop(k)};l.prototype.onContainerTouchMove=function(a){this.touch(a)};l.prototype.onContainerTouchStart=function(a){this.zoomOption(a);this.touch(a,!0)};l.prototype.onDocumentMouseMove=function(a){var g=this.chart,d=this.chartPosition;a=this.normalize(a,d);var h=g.tooltip;!d||h&&h.isStickyOnContact()||g.isInsidePlot(a.chartX-g.plotLeft,a.chartY-g.plotTop)||this.inClass(a.target,"highcharts-tracker")||this.reset()};l.prototype.onDocumentMouseUp=function(h){var g=G[m(a.hoverChartIndex,
265|-1)];g&&g.pointer.drop(h)};l.prototype.pinch=function(a){var g=this,d=g.chart,h=g.pinchDown,k=a.touches||[],l=k.length,f=g.lastValidTouch,p=g.hasZoom,t=g.selectionMarker,u={},F=1===l&&(g.inClass(a.target,"highcharts-tracker")&&d.runTrackerClick||g.runChartClick),e={};1<l&&(g.initiated=!0);p&&g.initiated&&!F&&a.preventDefault();[].map.call(k,function(c){return g.normalize(c)});"touchstart"===a.type?([].forEach.call(k,function(c,b){h[b]={chartX:c.chartX,chartY:c.chartY}}),f.x=[h[0].chartX,h[1]&&h[1].chartX],
266|f.y=[h[0].chartY,h[1]&&h[1].chartY],d.axes.forEach(function(c){if(c.zoomEnabled){var b=d.bounds[c.horiz?"h":"v"],e=c.minPixelPadding,g=c.toPixels(Math.min(m(c.options.min,c.dataMin),c.dataMin)),a=c.toPixels(Math.max(m(c.options.max,c.dataMax),c.dataMax)),h=Math.max(g,a);b.min=Math.min(c.pos,Math.min(g,a)-e);b.max=Math.max(c.pos+c.len,h+e)}}),g.res=!0):g.followTouchMove&&1===l?this.runPointActions(g.normalize(a)):h.length&&(t||(g.selectionMarker=t=q({destroy:C,touch:!0},d.plotBox)),g.pinchTranslate(h,
275|function(){var h=this.chart,g=a.charts[m(a.hoverChartIndex,-1)];if(g&&g!==h)g.pointer.onContainerMouseLeave({relatedTarget:!0});g&&g.mouseIsDown||(a.hoverChartIndex=h.index)};l.prototype.touch=function(a,g){var d=this.chart,h;this.setHoverChartIndex();if(1===a.touches.length)if(a=this.normalize(a),(h=d.isInsidePlot(a.chartX-d.plotLeft,a.chartY-d.plotTop))&&!d.openMenu){g&&this.runPointActions(a);if("touchmove"===a.type){g=this.pinchDown;var k=g[0]?4<=Math.sqrt(Math.pow(g[0].chartX-a.chartX,2)+Math.pow(g[0].chartY-
524|d.options.selected=a;g.options.data[g.data.indexOf(d)]=d.options;d.setState(a&&"select");f||k.getSelectedPoints().forEach(function(a){var f=a.series;a.selected&&a!==d&&(a.selected=a.options.selected=!1,f.options.data[f.data.indexOf(a)]=a.options,a.setState(k.hoverPoints&&f.options.inactiveOtherPoints?"inactive":""),a.firePointEvent("unselect"))})});delete this.selectedStaging},onMouseOver:function(a){var d=this.series.chart,f=d.pointer;a=a?f.normalize(a):f.getChartCoordinatesFromPoint(this,d.inverted);
File: public/js/ai_training/index.js
Match lines: 8
5424| .normalize('NFD').replace(/[\u0300-\u036f]/g, '').trim();
7540| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
8446| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
8451| const qWords = new Set(normalize(question));
8459| const titleW = normalize(s.heading);
8460| const bodyW = normalize(s.body);
8464| const pontoW = pontoMatch ? normalize(pontoMatch[1]) : [];
9172| .normalize('NFD').replace(/[\u0300-\u036f]/g, '').trim();
File: public/js/chat_ia/chat_form.js
Match lines: 1
7618| const norm = (s) => (s || "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
File: public/js/chat_ia/chat_ia_modal.js
Match lines: 1
7302| const norm = (s) => (s || "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
File: public/js/chat_ia/chat_markers.js
Match lines: 1
951| .normalize('NFD')
File: public/js/ckeditor/ckeditor.js
Match lines: 1
418|m),m.mergeSiblings(),CKEDITOR.env.ie||m.$.normalize()):(m=new CKEDITOR.dom.element("span"),t.extractContents().appendTo(m),t.insertNode(m),p.call(this,m),m.remove(!0));t=null}}c.moveToBookmark(v);c.shrink(CKEDITOR.SHRINK_TEXT);c.shrink(CKEDITOR.NODE_ELEMENT,!0)}}function c(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(m.getParent()),f=null,g=null,e=0;e<a.elements.length;e++){var k=a.elements[e];if(k==a.block||k==a.blockLimit)break;l.checkElementRemovable(k,
File: public/js/ckfinder/ckfinder.js
Match lines: 1
5|var CKFinder=function(){function __internalInit(e){return e=e||{},e[S("=ZZ-.\x0f&76' -")]=S('"wLLU\x07AZ\nJ\fIKB_\x11DVFF_XV\x19U]\x1c~uy)/&&6eu'),e[S("\x12{qyzx")]=S('=vZ,--c" *+\'>j(>,-$5#ss\x030v6*<z)9<23\x19A\x11\x02\0E\x12\x0f\t\x1dJ\x12\x03\x18N\x0e\x02\x14R\x07\x06\f\x1f\x19\x1fY\x0e\x14\\\x1e\f\x1ecj"lqw&fxyfbolzf\x7f\x7f2>4bs7hln;prjl\0ND\x03AC@HZ]\n_C\rM]UPFV\x14\\B\x19\x18')+S("\x11E|ayr7avo;ptuz\0UM\x03C@R\x07I\tLYIH\x0el{w[]PPD\x17TPY^RN[\0`\x07'&(e 5-,j?#m=:2<;'t,9\"*y.)=3-3\x01\x15\v\f\nDF\x0f\x1c\x1d\x1aQCB\n\0\x13\x02\\\x10\x1f\x06\x19\x02\n\x1a\x1fU\x1f\x12\x13Pcjdjjacu;&)*#j{ftt=wqcIcjxthp|jvOOQ"),e[S('C-6\x02"%&')]=!0,e}function internalCKFinderInit(e,t,n){var i=t.getElementsByTagName(S("\x0egupv"))[0],r=t.createElement(S('?3"0*41'));r[S(r.innerText?"<TPQ%3\x16&<1":";USPZ2\t\x16\x0e\b")]=n+S("\x14;U\\^pt\x7fyo0@SDVVT\r\x06PAGND[\x01\x0eK_RG^Q[B\x17\x11\x02ypzTP[%3l00$43`")+JSON.stringify(e)+S("\x15?,"),i.appendChild(r)}function configOrDefault(e,t){return e?e:t}function createUrlParams(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return"?"+t.join("&")}function extendObject(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function getCookie(e){e=e.toLowerCase();for(var t=window.document.cookie.split(";"),n=0;n<t.length;n++){var i=t[n].split("="),r=decodeURIComponent(i[0].trim().toLowerCase()),o=i.length>1?i[1]:"";if(r===e)return decodeURIComponent(o)}return null}function setCookie(e,t){window.document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+S(",\x16^NDY\x0f\x1c")}function updateIOSConfig(e,t){e._iosWidgetHeight=parseInt(getComputedStyle(t).height),e._iosWidgetWidth=parseInt(getComputedStyle(t).width)}function checkOnInit(e,t){var n=t.navigator.userAgent;if((n.indexOf(S("B\x0e\x17\f\x03g"))>0||n.indexOf(S("8mHRXXPKo"))>0||n.indexOf(S("1wWSP\x19"))>0)&&t.addEventListener(S('A!(",(#-;\x18.-)7'),function(e){setTimeout(function(){var t=e.detail.ckfinder,n=getCookie(S("%ELkZXMxBEJ^"));n||(n=t.request(S("%ETZO\x10LIYz@[T\\")),setCookie(S(" BI`WW@sGBOE"),n)),t.request(S("/Y_FVF[W[\x02ZIIZ\x07MZ4\x11#1!+2\x10!'.$;\x19!$5?"),{token:n})},1e3)}),e&&!e._omitCheckOnInit&&"function"==typeof e.onInit){var i=e.onInit;delete e.onInit,t.addEventListener(S("\x10ryu}{rrjK\x7fzxd"),function(t){e._initCalled||(e._initCalled=!0,i(t.detail.ckfinder))})}}function S(e){for(var t="",n=e.charCodeAt(0),i=1;i<e.length;++i)t+=String.fromCharCode(e.charCodeAt(i)^i+n&127);return t}function isIE9(){var e,t,n=-1;return navigator.appName==S('7uPYISNQY4a\v-0 4)-=j\x0e4=" "4 ')&&(e=navigator.userAgent,t=new RegExp(S("\x18TIRY=6D\x10\f\x1b~_\x14\nZs\x07\x1a\x06\x15pU\x1f\x1cL\x1b")),null!==t.exec(e)&&(n=parseFloat(RegExp.$1))),9===n}var connectors={php:S("\x19ytnx1|OOLFGQIU\x07YB[\x03NAA^TQG[G\x18GPI"),net:S("\x1d1|KGKM@@T\bKFDEINZ@B")},connector=S("?0)2"),basePath=function(){if(parent&&parent.CKFinder&&parent.CKFinder.basePath)return parent.CKFinder.basePath;var e,t,n,i=document.getElementsByTagName(S("(ZIYE]Z"));for(e=0;e<i.length&&(t=i[e],n=void 0!==t.getAttribute.length?t.src:t.getAttribute(S("$VTD")),!n||n.split("/").slice(-1)[0].indexOf(S(".L[W[]PPD\x19RJ"))===-1);e++);return n.split("/").slice(0,-1).join("/")+"/"}(),Modal={open:function(e){function t(e,t,n){t.forEach(function(t){e.addEventListener(t,n)})}function n(e,t,n){t.forEach(function(t){e.removeEventListener(t,n)})}function i(e){return 0===e.type.indexOf(S("2G[@U_"))?{x:e.touches[0].pageX,y:e.touches[0].pageY}:{x:document.all?window.event.clientX:e.pageX,y:document.all?window.event.clientX:e.pageY}}function r(e){var t=i(e);p=t.x,v=t.y;var n=v-E;y.style.left=p-x+S("\x1eoX"),y.style.top=(n<0?0:n)+S("\x15fo")}function o(e){var t,n,r=i(e);f?(t=l-(I-r.x),n=u-(R-r.y),t>200&&(M.style.width=t+S("+\\U")),n>200&&(M.style.height=n+S("?09"))):h&&(t=l+(I-r.x),n=u-(R-r.y),t>200&&(M.style.width=t+S("\x0f`i"),y.style.left=x-(I-r.x)+S("\x15fo")),n>200&&(M.style.height=n+S("\x17ha")))}function s(){T.parentNode===M&&M.removeChild(T),f=!1,h=!1,n(document,[S("$HIR[LGDZH"),S("\x1ekOTAKIJPB")],o),n(document,[S("\rc`ebwfd"),S("\x1bhrk|HDLG")],s)}function a(e){e.preventDefault();var n=i(e);I=n.x,R=n.y,l=M.clientWidth,u=M.clientHeight,M.appendChild(T),t(document,[S("?-.70!()1-"),S("\x0fd~gp|xya}")],o),t(document,[S("A/,16#28"),S("-Z@ERZVZQ")],s)}if(e=e||{},!Modal.div){Modal.heightAdded=48,Modal.widthAdded=2;var l,u,c=Math.min(configOrDefault(e.width,1e3),window.innerWidth-Modal.widthAdded),d=Math.min(configOrDefault(e.height,700),window.innerHeight-Modal.heightAdded),f=!1,h=!1,g=!1,p=0,v=0,m=e.width,w=e.height;e.width=e.height=S("@prsa");var y=Modal.div=document.createElement(S(".KYG"));y.id=S("\x1fCJD\x0eIJBFD"),y.style.position=S("?&(:& "),y.style.top=(document.documentElement.clientHeight-Modal.heightAdded)/2-d/2+S(" QZ"),y.style.left=(document.documentElement.clientWidth-Modal.widthAdded)/2-c/2+S("'XQ"),y.style.background=S("Ee!./"),y.style.border=S("\x17)ib;orrvD\x01\x01BED"),y.style.boxShadow=S("\x16$ha:(le>*PY\x02QCGG\x0f\x18\x05\x1a\x07\x1c\x01\x1e\x01\x02\x18"),y.style.borderTopLeftRadius=y.style.borderTopRightRadius=S("Aw3<"),y.style.zIndex=8999,y.innerHTML=S('=\x02[)7b* xd$#/g&#)/#}97200$ux*."08c}\x03\x14\x10\x10\v\x17\\G\x05\x06\x1c\x0eWM\f\0\x02\x15\x17\x01Y\x01\x19\x07U\x15\x1f\x1d\bP\f\x1edhwp>0v\x7f3)hd~ik}=e}c9g\x7fppm7i}ywjS\x1b\x17S\\\x1e\x06EIJAL^B[AT\v\x12FFY\x1eSYM[\x01UP_X%n15#n>*$r(*?(x{|\x01\x16j`7\x01 ?=7\r%>l3\x16\x03\bS\r(5S\x1f \x03*C=\t\0H\x12A)\x1a<>\x1f\f\x1b=N\x06--5oeJQsJo?~m9o?A`lj]\x7f*mOo/aT^ZkQ-Q\x12{[jCA\x14KCMmL\x15dDjG|qf]|q_TXm_SYz\x0f)\f\x16\x023\x0f\x15\x0e/-\'\' )~\x05&4\x16c=\x18\x15\x16/\x10\x1e\x1e;\x10\r\x16\x07\x02*)\b\x06T1\x11\r\x07=.\x0e]-\x1c(A!\',.%\b\x1b\0K\x15\x1f\x13Fu[QJ/FoFoYMs|ocYxrywmLAEhCM.,TYsKqqiJFKaCer}Fw\x1cLDk\0eAon}P]}mWtW}."/\x05/$\x11\x11=-\f\x1d9,\x16\x1d*\x01\x01\x19e6d\x01!\fi\x194\x04l\t0\x03\x0e5\x1e?5.\x0f\f..U$\x04.\x1c8\x1b1A8"G\x1149.\x1546\x18yQQJsOUNol^B5DdJg\\QF}Eqx\x7fPYZ{MVQ\x10C\x11bCG\x14}EJ\x18}\x1c}}fG{azSV\x05eNZy\nV_\fG6"(s-\ft\x1e{\x13 /!\x037\x0672a\x01"6\x15f.:\x1d\x1d6<\x06\rU11*\x1c,\x0f_C*\x03*\v$-.H\x12A!\x02\x1655\x0e#\x17!\x06\'&.9HhFsHERa@BE<o=NdH *gw%^!PsUtGYYKxurMlni\x18K\x19jXO\x1dmXh\0_\x04Pb\x07QtirJmYP\'\b\x0642\'\x01+=\x13\x1d\r5\x1f}\x058\v\x15?878\x06s\x1a3\x1a;\r\x16\x15\f8Q2\x03\0"W\x01$)"\v\b:_\x19<1:\x13\x11D\x1b\x13\x1d=\x1cE4\x14:iHEkhdQcgmN;e@]FwK\x7f\x7fgwR\'q}BQoV]QNBOeOi~qBs\x18HXw\x1cyEkjy\\QqaSrir[qD\v\v\x11\x01z>!+$c`q)#?**"|0< !9:bh*#|.13\t\x05B@\x07\\\x05^\vPQ\x03\t\x04\t\x07\x04KAF\x04\rVV\x11\x14\n\x14\x0e\t\x1f\x11t: =')+S("0\rS\x13GAO[]\x04\x18]PR_Kza0*#-2|h9+/($ (jqe#,ugg(!zk||72\x10\x0e\x10\x17\x05\v\x12\\H\x04\v\x19\v\x04\0UPARR\x1d\x18\x06\x18\n\r\x1b\x15\bF^\x19oov.bdkndp0+M\x7fgn|=2`u{e:k|hrz=?vMQMQPDHS\x13\tLDBY\x03XUXU[@\x0fTXT]\x01\x1bZRPKm2+9!\x7ffux92km$#??#&2:!mw404>q5;6\x07\t\x16YDWV\x17\x10IK\x02\x01\x1d\x01\x1d\x04\x10\x1c\x07OU\x02\x12\0\rW\x1f\x19\x1e\x11\rauklj?&iggo+-dc\x7f\x7fcfrza-7{vvtn'><\x18\x19\x1a\x03\x05LKWG[^JBY\x15\r\x10XV\x0e\x16V]Q\x15TU_]Q\x13\\,.1&fe.5-/wioop\x98l~3m")+S("'\x14\x06NBZ\x13")+S("\x16+|pl;uy#=CJD\x0eIJBFD\x04HDHT\f\x0fCEK_Q\b\x14GWJSOURP\x05`3'/%1/1-r=\"(9&up")+c+S("\x0e\x7fh*2{q|q\x7fl#:")+d+S("\r~w2/.<p|`)")+S('0\rVZB\x15_S\x05\x1bYPZ\x10SP$ .n"*)3-;hk?97#5lp;1<1?,czjl-&\x7fA\b\x0f\x13\v\x17\x12\x06\x06\x1dQK\x0e\f\r\x04\x17\x03\x1d\x06\x1a\x11LW[\x1fI\x1dO\x1bM]>')+S('6\vKI[U\x1cTZ\x02b")%i()#)%g9)>\'55|:2:1:2u*-y|.*&\f\x04_A\x07\x10\x14\x14\x07\x1bPK\x1f\x1aC\x1d\x15\x02\x1b\t\x11NV\0\x11\x1d\x0e\x13F]I\x0fx:"kalao|3*<|u5/txacxto-8{vt\x7fv%?FMMBP\x1f\x06KMO^\x10\fOA]TT@\x1eXPPC\x02\x19\tKD\x1dMP,(&cg!"#si($>)+=}3=\' :;mxj*#|.13\t\x05B@\0\x01\x02\\JWVD\x1f\x1d\x0f\x01N')+S(";\0NN^.a+'yg%,.d'$(,\"b\"4!:.0{?97>79p-:BA\x11\x17\x1d\t\x03ZJ\n\x1f\x19\x1f\x02\x1cUP\x02\x17^\x06\x10\x05\x1e\x02\x1cA[\v\x14\x1a\vh;\"4t}='`lcldy4/'aj(4q\x7fdhu{b&=|sOBI\x18\x04CJHI]\x10\v^DIGD\n\x12Q[GRRJ\x14HR[UJ\x05`r2;d6)+!-jh()*tp3=!00$z:6./30d\x7fS\x11\x1aC\x17\n\n\x0e\fII\x0f\b\tUMNM]\0\x04\x14\x18I")+S("\n7#igy."),document.body.appendChild(y),CKFinder.widget(S("\x16ts\x7f7vsy\x7fs\rCMG]"),e),Modal.footer=document.getElementById(S("(JAM\x01@AKQ]\x1fU[ZBRJ")),window.addEventListener(S("1]A]PXCYMSTR^V^.&'"),function(){Modal.maximized||setTimeout(function(){c=Math.min(configOrDefault(m,1e3),document.documentElement.clientWidth-Modal.widthAdded),d=Math.min(configOrDefault(w,700),document.documentElement.clientHeight-Modal.heightAdded);var e=document.getElementById(S("\x15u|~4wtx|r2BNFZ"));e.style.width=c+S("\f}v"),e.style.height=d+S("\x15fo"),y.style.top=(document.documentElement.clientHeight-Modal.heightAdded)/2-d/2+S("+\\U"),y.style.left=(document.documentElement.clientWidth-Modal.widthAdded)/2-c/2+S("C4=")},100)});var C=document.getElementById(S("E%,.d'$(,\"b3== 1"));t(C,[S("/S][P_"),S("\x12g{`u\x7f}w~")],function(e){e.stopPropagation(),e.preventDefault(),Modal.close()});var b=Modal.header=document.getElementById(S("4V]Q\x15TU_]Q\x13W% &&6")),x=y.offsetLeft,E=y.offsetTop;t(b,[S(";QRKL%%-4*"),S("9NTI^VL4 07")],function(e){e.preventDefault(),g=!0;var n=i(e);p=n.x,v=n.y,x=p-y.offsetLeft,E=v-y.offsetTop,M.appendChild(T),t(document,[S("8TUNOXSP6$"),S("\rz`erz~{cs")],r)}),t(b,[S("\x13yzcd}lj"),S("\x0fd~gp|pxs")],function(){g=!1,T.parentNode===M&&M.removeChild(T),n(document,[S(".B_DAVYZ@R"),S("\x11f|av~zwo\x7f")],r)});var _=document.getElementById(S("\x17{r|6qrz~L\fPFWL\\B\x05AKEHAK\x02CT")),F=document.getElementById(S("\fnei=|}wuy;e}jsay0v~NENF\tVQ")),M=Modal.body=document.getElementById(S('"@OC\vJGMKG\x01OAKI')),T=document.createElement(S("2W]C"));T.style.position=S("\x1az~nqsUUG"),T.style.top=T.style.right=T.style.bottom=T.style.left=0,T.style.zIndex=1e5,t(_,[S("\x0f}~g`qqy`v"),S("6CWLYSOI_M4")],function(e){f=!0,a(e)}),t(F,[S(" LMVW@BH_G"),S("/D^GP\\FBVJM")],function(e){x=y.offsetLeft,h=!0,a(e)});var I,R}},close:function(){Modal.div&&(document.body.removeChild(Modal.div),Modal.div=null,Modal.maximized&&(document.documentElement.style.overflow=Modal.preDocumentOverflow,document.documentElement.style.width=Modal.preDocumentWidth,document.documentElement.style.height=Modal.preDocumentHeight))},maximize:function(e){e?(Modal.preDocumentOverflow=document.documentElement.style.overflow,Modal.preDocumentWidth=document.documentElement.style.width,Modal.preDocumentHeight=document.documentElement.style.height,document.documentElement.style.overflow=S("\x16\x7fq}~~r"),document.documentElement.style.width=0,document.documentElement.style.height=0,Modal.preLeft=Modal.div.style.left,Modal.preTop=Modal.div.style.top,Modal.preWidth=Modal.body.style.width,Modal.preHeight=Modal.body.style.height,Modal.preBorder=Modal.div.style.border,Modal.div.style.left=Modal.div.style.top=Modal.div.style.right=Modal.div.style.bottom=0,Modal.body.style.width=S("\x1f\x11\x11\x12\x06"),Modal.body.style.height=S('\x10 "#1'),Modal.div.style.border="",Modal.header.style.display=S("*ECCK"),Modal.footer.style.display=S(" OMMA"),Modal.maximized=!0):(document.documentElement.style.overflow=Modal.preDocumentOverflow,document.documentElement.style.width=Modal.preDocumentWidth,document.documentElement.style.height=Modal.preDocumentHeight,Modal.div.style.right=Modal.div.style.bottom="",Modal.div.style.left=Modal.preLeft,Modal.div.style.top=Modal.preTop,Modal.div.style.border=Modal.preBorder,Modal.body.style.width=Modal.preWidth,Modal.body.style.height=Modal.preHeight,Modal.header.style.display=S("B!(*%,"),Modal.footer.style.display=S("(KFDOF"),Modal.maximized=!1)}},_r=/(window|S("A0&5j4"))/,ckfPopupWindow;return{basePath:basePath,connector:connector,_connectors:connectors,modal:function(e){return e===S(",NB@CT")?Modal.close():e===S("9LROT\\S%")?!!Modal.div:e===S("+ALVF]XHV")?Modal.maximize(!0):e===S("\x1fMHLJIL\\B")?Modal.maximize(!1):void Modal.open(e)},config:function(e){CKFinder._config=e},widget:function(e,t){function n(e){return e+(/^[0-9]+$/.test(e)?S("@1:"):"")}if(t=t||{},!e)throw S("3zZ\x16\x15Q]\x18\x1bSMJV//b'!#/)--j\"\"m\r\x04\x168<71'x 1==>(uw\x7f\x03\0\x0e\x0fJ");var i=S("1P\\FQSE\x02WUUY\x06");i+=S("7OP^OT\x07")+n(configOrDefault(t.width,S("4\x04\x06\x07\x1d")))+";",i+=S('E."!."?v')+n(configOrDefault(t.height,S(">\vpq")))+";";var r=document.createElement(S("!KEVDKB"));r.src="",r.setAttribute(S("*XXTBJ"),i),r.setAttribute(S("#W@GJDLYX"),S("5ERYTV^ON")),r.setAttribute(S("4FUEWUVRRZ"),S("#EPRH")),r.setAttribute(S("&SIKCEHHV"),configOrDefault(t.tabindex,0)),r.attachEvent?r.attachEvent(S("\x17wwvt}y"),function(){internalCKFinderInit(t,r.contentDocument,S("4EWE]WN"))}):r.onload=function(){/iPad|iPhone|iPod/.test(navigator.platform)&&(updateIOSConfig(t,r),r.contentWindow.addEventListener(S("0RYU][RRJk_ZXD"),function(e){e.detail.ckfinder.on(S("\x1ejI\x1bPFWL\\B"),function(e){updateIOSConfig(e.finder.config,r)},null,null,1)})),internalCKFinderInit(t,r.contentDocument,S("6GYK_UH"))};var o=document.getElementById(e);if(!o)throw S("\x1aXW[wqDDP\rSLB@M]\x02\x02\x16\rM@E]V\x13ZZB\x17^PT_\x1cXRZ-$,7d2/3 i#/lo")+e+S("\x1549");o.innerHTML="",o.appendChild(r),checkOnInit(t,r.contentWindow)},popup:function(e){function t(){ckfPopupWindow&&(r=ckfPopupWindow.document,r.open(),r.write(S("Ezf\f\x06\t\x1f\x15\x1d\vo8%??j")+S("4\t^CUU\x04")+S("\x18%r~}y ")+S(':\x07QXJ^`"*"66#3uk??*`vmn')+S('<\x01SZ4 b-%(#zj?#.;=!=$sr0;;"26-gy+4:+\b\\\x06\x06\x12\f\x05\x02E\x1e\x03\x0f\x18\x05B\x06\x1e\x18\x06\x1a\x15\x19[\x04\x1b\x18\x16\x1eALR\nsdp.wfgkikfn1ca-.')+S('5\nCQMV^\x02~uy)/&&6eugei\f" (n\r">% 1\'jx,0.79c')+S("7\x04\x16R^]Y\0")+S("/\fS]WM\v")+S("\x1c!m|RHRW\x04VTD\x15\v")+window.CKFinder.basePath+S("+OFHF^UWA\x1a_E\x15\x18ZRZNN[K}c77\"h~evue8/?'?$o")+S("\x15*d{kskh#")+S("8NSUXRI\x11)2\x01\b\x02,(#-;\x1a$<8>r$#'6o")+S('7OPT_SJ\x10P.--" x 2&*>"##ffp*')+S('!\x02\x03\x04\x05eln@DOI_\0\\DP@G\x1c\x15A^V]UL\x12RNZ.$0m\x07\x0e\0.&-/9b\x12> $"\x1c$!?86*zrg')+"}"+S("\x19&4o~lvPU\x1c")+S("<\x01\x11]/%;}")+S("\x16+7qnvp#")),r.close(),ckfPopupWindow.focus())}e=e||{},window.CKFinder._popupOptions=e;var n=isIE9()?window.CKFinder.basePath+S("\x11qxr|xs}k4shpr"):S("*JNB[[\nS^RZ^"),i=S("\x1fLNABPLII\x15GE\x07AH@ZRP@\x0eZZ\x1aCWVVY]O\x03Q/m&&4 (#-'>v5(=c=8<:9<,6:5?f22r2\x0f\x05\x03\x0fY\x1c\x03\x14D\b\x06\x1c\r\x14\x1d=\x11\x18\x01\x16\x10H\x0f\x12\vU\b\x1e\x0f\x14\x04\x1ebmg>}`u+{jxd`alnbb/jqf");i+=S("\x12?c|rcp$")+configOrDefault(e.width,1e3),i+=S("\x149~rq~ro!")+configOrDefault(e.height,700),i+=S("\x10=f|d(#'"),i+=S("8\x15V^ZI\x03\x0epq"),"undefined"==typeof ckfPopupWindow||ckfPopupWindow.closed||ckfPopupWindow.close();var r;try{var o=S("\x1d]TfqMSQU")+Date.now();ckfPopupWindow=window.open(n,o,i,!0)}catch(e){return}return/iPad|iPhone|iPod/.test(navigator.platform)?setTimeout(t,100):t(),ckfPopupWindow},start:function(e){if(!e){var t=window.opener,n={};e={};var i=window.location.search.substring(1);if(i)for(var r=i.split("&"),o=0;o<r.length;++o){var s=r[o].split("=");n[s[0]]=s[1]||null}if(n.popup&&(window.isCKFinderPopup=!0),t&&n.configId&&t.CKFinder&&t.CKFinder._popupOptions){var a=decodeURIComponent(n.configId);e=t.CKFinder._popupOptions[a]||{},e._omitCheckOnInit=!0}}CKFinder._setup(window,document),checkOnInit(e,window),CKFinder.start(e)},setupCKEditor:function(e,t,n){function i(e){if(/^(http(s)?:)?\/\/.+/i.test(e))return e;0!==e.indexOf("/")&&(e="/"+e);var t=window.parent?window.parent.location:window.location,n=t.protocol+S("'\x07\x06")+t.host;return n+e}if(!e){for(var r in CKEDITOR.instances)CKFinder.setupCKEditor(CKEDITOR.instances[r]);return void CKEDITOR.on(S("'AGY_MCMJsCWR@PR"),function(e){CKFinder.setupCKEditor(e.editor)})}e.config.filebrowserBrowseUrl=window.CKFinder.basePath+S("/SZTZZQSE\x16QNVP"),n=extendObject({command:S('=oJ)")\x164))&,'),type:S("\fKgcub")},n),t=extendObject(window.CKFinder._config||{},t);var o=window.CKFinder._connectors[window.CKFinder.connector];"/"!==o.charAt(0)&&(o=window.CKFinder.basePath+o),o=i(o),Object.keys(t).length&&(window.CKFinder._popupOptions||(window.CKFinder._popupOptions={}),t._omitCheckOnInit=!0,window.CKFinder._popupOptions[e.name]=t,e.config.filebrowserBrowseUrl+=S('7\x07IUKIM\x03\x0ef"--",!\x0e,t')+encodeURIComponent(e.name),t.connectorPath&&(o=i(t.connectorPath))),e.config.filebrowserUploadUrl=o+createUrlParams(n)},_setup:function(window,document){window.CKFinder=window.CKFinder||{},window.CKFinder.connector=connector,window.CKFinder._connectors=connectors,window.CKFinder.basePath=function(){if(window.parent&&window.parent.CKFinder&&window.parent.CKFinder.basePath)return window.parent.CKFinder.basePath;for(var e,t,n=document.getElementsByTagName(S("E5$: :?")),i=0;i<n.length&&(e=n[i],t=void 0!==e.getAttribute.length?e.src:e.getAttribute(S("?33!")),!t||t.split("/").slice(-1)[0].indexOf(S("\x1c~uyIOFFV\vLT"))===-1);i++);return t.split("/").slice(0,-1).join("/")+"/"}();var CKFinder;!function(){if(!CKFinder||!CKFinder.requirejs){CKFinder?require=CKFinder:CKFinder={};var requirejs,require,define;!function(global){function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var n;for(n=0;n<e.length&&(!e[n]||!t(e[n],n,e));n+=1);}}function eachReverse(e,t){if(e){var n;for(n=e.length-1;n>-1&&(!e[n]||!t(e[n],n,e));n-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,i){return t&&eachProp(t,function(t,r){!n&&hasProp(e,r)||(!i||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[r]=t:(e[r]||(e[r]={}),mixin(e[r],t,n,i)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName(S("\f~m}yaf"))}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,i){var r=new Error(t+S("%,O\\]Z\x11\x03\x02\\JAD[AQ_E\x19WK]\x14XR]Lo$01+75i =''o")+e);return r.requireType=e,r.requireModules=i,n&&(r.originalError=n),r}function newContext(e){function t(e){var t,n;for(t=0;t<e.length;t++)if(n=e[t],"."===n)e.splice(t,1),t-=1;else if(".."===n){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}function n(e,n,i){var r,o,s,a,l,u,c,d,f,S,h,g,p=n&&n.split("/"),v=E.map,m=v&&v["*"];if(e&&(e=e.split("/"),c=e.length-1,E.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&p&&(g=p.slice(0,p.length-1),e=g.concat(e)),t(e),e=e.join("/")),i&&v&&(p||m)){s=e.split("/");e:for(a=s.length;a>0;a-=1){if(u=s.slice(0,a).join("/"),p)for(l=p.length;l>0;l-=1)if(o=getOwn(v,p.slice(0,l).join("/")),o&&(o=getOwn(o,u))){d=o,f=a;break e}!S&&m&&getOwn(m,u)&&(S=getOwn(m,u),h=a)}!d&&S&&(d=S,f=h),d&&(s.splice(0,f,d),e=s.join("/"))}return r=getOwn(E.pkgs,e),r?r:e}function i(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute(S("\x13ptbv5k\x7fjitlzMNFVH@"))===e&&t.getAttribute(S("+HLZN\x1dCWBA\\DR[VTOYEJ"))===C.contextName)return t.parentNode.removeChild(t),!0})}function r(e){var t=getOwn(E.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),C.require.undef(e),C.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function s(e,t,i,r){var s,a,l,u,c=null,d=t?t.name:null,f=e,h=!0,g="";return e||(h=!1,e="_@r"+(A+=1)),u=o(e),c=u[0],e=u[1],c&&(c=n(c,d,r),a=getOwn(I,c)),e&&(c?g=a&&a.normalize?a.normalize(e,function(e){return n(e,d,r)}):e.indexOf("!")===-1?n(e,d,r):e:(g=n(e,d,r),u=o(g),c=u[0],g=u[1],i=!0,s=C.nameToUrl(g))),l=!c||a||i?"":S("\x0fOd|}{g{vtp`~x")+(O+=1),{prefix:c,name:g,parentMap:t,unnormalized:!!l,url:s,originalName:f,isDefine:h,id:(c?c+"!"+g:g)+l}}function a(e){var t=e.id,n=getOwn(_,t);return n||(n=_[t]=new C.Module(e)),n}function l(e,t,n){var i=e.id,r=getOwn(_,i);!hasProp(I,i)||r&&!r.defineEmitComplete?(r=a(e),r.error&&t===S("\x1cxlmOS")?n(r.error):r.on(t,n)):"defined"===t&&n(I[i])}function u(e,t){var n=e.requireModules,i=!1;t?t(e):(each(n,function(t){var n=getOwn(_,t);n&&(n.error=e,n.events.error&&(i=!0,n.emit(S("0T@A[G"),e)))}),i||req.onError(e))}function c(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(C.defQueueMap[t]=!0),T.push(e)}),globalDefQueue=[])}function d(e){delete _[e],delete F[e]}function f(e,t,n){var i=e.map.id;e.error?e.emit(S("5SEJVH"),e.error):(t[i]=!0,each(e.depMaps,function(i,r){var o=i.id,s=getOwn(_,o);!s||e.depMatched[r]||n[o]||(getOwn(t,o)?(e.defineDep(r,I[o]),e.check()):f(s,t,n))}),n[i]=!0)}function h(){var e,t,n=1e3*E.waitSeconds,o=n&&C.startTime+n<(new Date).getTime(),s=[],a=[],l=!1,c=!0;if(!w){if(w=!0,eachProp(F,function(e){var n=e.map,u=n.id;if(e.enabled&&(n.isDefine||a.push(e),!e.error))if(!e.inited&&o)r(u)?(t=!0,l=!0):(s.push(u),i(u));else if(!e.inited&&e.fetched&&n.isDefine&&(l=!0,!n.prefix))return c=!1}),o&&s.length)return e=makeError(S("\x18msvyrkk"),S('B\x0f+$"g< \'.#8:o6> s9:2"4<)a|')+s,null,s),e.contextName=C.contextName,u(e);c&&each(a,function(e){f(e,{},{})}),o&&!t||!l||!isBrowser&&!isWebWorker||x||(x=setTimeout(function(){x=0,h()},50)),w=!1}}function g(e){hasProp(I,e[0])||a(s(e[0],null,!0)).init(e[1],e[2])}function p(e,t,n,i){e.detachEvent&&!isOpera?i&&e.detachEvent(i,t):e.removeEventListener(n,t,!1)}function v(e){var t=e.currentTarget||e.srcElement;return p(t,C.onScriptLoad,S("\x0f|~sw"),S("\x17wwh~}yglT@VFGMGIOL")),p(t,C.onScriptError,S("8\\HISO")),{node:t,id:t&&t.getAttribute(S("1VR@T\x1bE]HORNXSP$4.&"))}}function m(){var e;for(c();T.length;){if(e=T.shift(),null===e[0])return u(makeError(S("0\\[@YTBTP"),S(" lKPIDRD@LN\vMCAAI\\]FG\x15RR^PT^\x14\x14\x1eR/%7/!\x7ff")+e[e.length-1]));g(e)}C.defQueueMap={}}var w,y,C,b,x,E={waitSeconds:7,baseUrl:S("@om"),paths:{},bundles:{},pkgs:{},shim:{},config:{}},_={},F={},M={},T=[],I={},R={},P={},A=1,O=1;return b={require:function(e){return e.require?e.require:e.require=C.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?I[e.map.id]=e.exports:e.exports=I[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(E.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},y=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(E.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},y.prototype={init:function(e,t,n,i){i=i||{},this.inited||(this.factory=t,n?this.on(S("\x14pdewk"),n):this.events.error&&(n=bind(this,function(e){this.emit(S("A'16*4"),e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=i.ignore,i.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,C.startTime=(new Date).getTime();var e=this.map;return this.shim?void C.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;R[e]||(R[e]=!0,C.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,n=this.map.id,i=this.depExports,r=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit(S("9_INRL"),this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){try{r=C.execCb(n,o,i,r)}catch(t){e=t}if(this.map.isDefine&&void 0===r&&(t=this.module,t?r=t.exports:this.usingExports&&(r=this.exports)),e){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=S(this.map.isDefine?"\vhhhf~t":'E4"9<#9)'),u(this.error=e);"undefined"!=typeof console&&console.error?console.error(e):req.onError(e)}}else r=o;if(this.exports=r,this.map.isDefine&&!this.ignore&&(I[n]=r,req.onResourceLoad)){var s=[];each(this.depMaps,function(e){s.push(e.normalizedMap||e)}),req.onResourceLoad(C,this.map,s)}d(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(C.defQueueMap,n)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,i=s(e.prefix);this.depMaps.push(i),l(i,"defined",bind(this,function(i){var r,o,c,f=getOwn(P,this.map.id),h=this.map.name,g=this.map.parentMap?this.map.parentMap.name:null,p=C.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(i.normalize&&(h=i.normalize(h,function(e){return n(e,g,!0)})||""),o=s(e.prefix+"!"+h,this.map.parentMap),l(o,"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),c=getOwn(_,o.id),void(c&&(this.depMaps.push(o),this.events.error&&c.on(S("$@TUG["),bind(this,function(e){this.emit(S("0T@A[G"),e)})),c.enable()))):f?(this.map.url=C.nameToUrl(f),void this.load()):(r=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),r.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(_,function(e){0===e.map.id.indexOf(t+S("\x11Mfz{yeuxvrfxz"))&&d(e.map.id)}),u(e)}),r.fromText=bind(this,function(n,i){var o=e.name,l=s(o),c=useInteractive;i&&(n=i),c&&(useInteractive=!1),a(l),hasProp(E.config,t)&&(E.config[o]=E.config[t]);try{req.exec(n)}catch(e){return u(makeError(S(",K\\@]EWK@P@VT"),S("\x14sdxuM\x7fch={iAM\x02EKW\x06")+t+S("\f-hny}ww.5")+e,e,[t]))}c&&(useInteractive=!0),this.depMaps.push(l),C.completeLoad(o),p([o],r)}),void i.load(e.name,p,r,E))})),C.enable(i,this),this.pluginMaps[i.id]=i},enable:function(){F[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,i,r;if("string"==typeof e){if(e=s(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,r=getOwn(b,e.id))return void(this.depExports[t]=r(this));this.depCount+=1,l(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?l(e,S(".JBC]A"),bind(this,this.errback)):this.events.error&&l(e,S("4PDEWK"),bind(this,function(e){this.emit(S("7]KHTN"),e)}))}n=e.id,i=_[n],hasProp(b,n)||!i||i.enabled||C.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(_,e.id);t&&!t.enabled&&C.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),e===S("!GQVJT")&&delete this.events[e]}},C={config:E,contextName:e,registry:_,defined:I,urlFetched:R,defQueue:T,defQueueMap:{},Module:y,makeModuleMap:s,nextTick:req.nextTick,onError:u,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var t=E.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){n[t]?(E[t]||(E[t]={}),mixin(E[t],e,!0,!0)):E[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(P[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,n){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=C.makeShimExports(e)),t[n]=e}),E.shim=t),e.packages&&each(e.packages,function(e){var t,n;e="string"==typeof e?{name:e}:e,n=e.name,t=e.location,t&&(E.paths[n]=e.location),E.pkgs[n]=e.name+"/"+(e.main||S("\x13yt\x7fy")).replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(_,function(e,t){e.inited||e.map.unnormalized||(e.map=s(t,null,!0))}),(e.deps||e.callback)&&C.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,r){function o(n,i,l){var c,d,f;return r.enableBuildCallback&&i&&isFunction(i)&&(i.__requireJsBuild=!0),"string"==typeof n?isFunction(i)?u(makeError(S("\x12aqdc~j|{i{n"),S("9sUJ\\RV$a0&50/5-i)* !")),l):t&&hasProp(b,n)?b[n](_[t.id]):req.get?req.get(C,n,t,o):(d=s(n,t,!1,!0),c=d.id,hasProp(I,c)?I[c]:u(makeError(S("\x15xxluuzxxz"),S("8tU_IQ[\x1f. /&dg")+c+S("\x1547pxi;rrj?BDGM\x04IIFLLN\vUHZ\x0fV^@\x13WZXC]AN\x01\x1c")+e+(t?"":S("6\x19\x18lI^\x1cO[N5(0&l\x1e\x1bn"))))):(m(),C.nextTick(function(){m(),f=a(s(null,t)),f.skipMap=r.skipMap,f.init(n,i,l,{enabled:!0}),h()}),o)}return r=r||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var i,r=e.lastIndexOf("."),o=e.split("/")[0],s="."===o||".."===o;return r!==-1&&(!s||r>1)&&(i=e.substring(r,e.length),e=e.substring(0,r)),C.nameToUrl(n(e,t&&t.id,!0),i,!0)},defined:function(e){return hasProp(I,s(e,t,!1,!0).id)},specified:function(e){return e=s(e,t,!1,!0).id,hasProp(I,e)||hasProp(_,e)}}),t||(o.undef=function(e){c();var n=s(e,t,!0),r=getOwn(_,e);r.undefed=!0,i(e),delete I[e],delete R[n.url],delete M[e],eachReverse(T,function(t,n){t[0]===e&&T.splice(n,1)}),delete C.defQueueMap[e],r&&(r.events.defined&&(M[e]=r.events),d(e))}),o},enable:function(e){var t=getOwn(_,e.id);t&&a(e).enable()},completeLoad:function(e){var t,n,i,o=getOwn(E.shim,e)||{},s=o.exports;for(c();T.length;){if(n=T.shift(),null===n[0]){if(n[0]=e,t)break;t=!0}else n[0]===e&&(t=!0);g(n)}if(C.defQueueMap={},i=getOwn(_,e),!t&&!hasProp(I,e)&&i&&!i.inited){if(!(!E.enforceDefine||s&&getGlobal(s)))return r(e)?void 0:u(makeError(S("&IGMOMECK"),S("\x11\\|4qsqqw\x7f;\x7f|rs\0GMQ\x04")+e,null,[e]));g([e,o.deps||[],o.exportsFn])}h()},nameToUrl:function(e,t,n){var i,r,o,s,a,l,u,c=getOwn(E.pkgs,e);if(c&&(e=c),u=getOwn(P,e))return C.nameToUrl(u,t,n);if(req.jsExtRegExp.test(e))a=e+(t||"");else{for(i=E.paths,r=e.split("/"),o=r.length;o>0;o-=1)if(s=r.slice(0,o).join("/"),l=getOwn(i,s)){isArray(l)&&(l=l[0]),r.splice(0,o,l);break}a=r.join("/"),a+=t||(/^data\:|\?/.test(a)||n?"":".js"),a=("/"===a.charAt(0)||a.match(/^[\w\+\.\-]+:/)?"":E.baseUrl)+a}return E.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+E.urlArgs):a},load:function(e,t){req.load(C,e,t)},execCb:function(e,t,n,i){return t.apply(i,n)},onScriptLoad:function(e){if(e.type===S("9VT]Y")||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=v(e);C.completeLoad(t.id)}},onScriptError:function(e){var t=v(e);if(!r(t.id)){var n=[];return eachProp(_,function(e,i){0!==i.indexOf("_@r")&&each(e.depMaps,function(e){return e.id===t.id&&n.push(i),!0})}),u(makeError(S("\x1elCSKSP@TUG["),S("+\x7fN\\F@E\x12VFGYE\x18_UI\x1c\x1f")+t.id+(n.length?S("\x1f\x02\r\x02MA@BBL\tHR\x16\r")+n.join(S("\x12?4")):'"'),e,[t.id]))}}},C.require=C.makeRequire(),C}function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState===S("\x0ef~ewauvb~n|")?interactiveScript:(eachReverse(scripts(),function(e){if(e.readyState===S("-GADT@RWA_A]"))return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version=S(":\t\x12\f\x10\rr"),commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&navigator.platform===S("\f]BNIBFR@\\YY8*")?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&opera.toString()===S("'sFHAINZ\x0f\x7fAWAUh"),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,n,i){var r,o,s=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=n,n=i):e=[]),o&&o.context&&(s=o.context),r=getOwn(contexts,s),r||(r=contexts[s]=req.s.newContext(s)),o&&r.configure(o),r.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){
File: public/js/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Acl/Acl.php
Match lines: 2
134| $folderPath = Path::normalize($folderPath);
160| $folderPath = Path::normalize($folderPath);
File: public/js/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Filesystem/Folder/WorkingFolder.php
Match lines: 2
104| $this->clientCurrentFolder = Path::normalize(trim((string) $request->get('currentFolder')));
432| $newClientPath = Path::normalize(dirname($this->getClientCurrentFolder()) . '/' . $newName);
File: public/js/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Filesystem/Path.php
Match lines: 1
43| public static function normalize($path)
File: public/js/ckfinder/core/connector/php/vendor/guzzlehttp/psr7/src/UriNormalizer.php
Match lines: 2
119| public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS)
177| return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations);
File: public/js/ckfinder/core/connector/php/vendor/league/flysystem-azure/src/AzureAdapter.php
Match lines: 2
286| protected function normalize($path, $timestamp, $content = null)
373| return $this->normalize($path, $result->getLastModified()->format('U'), $contents);
File: public/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
Match lines: 1
134| $data = $this->normalize($data);
File: public/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
Match lines: 5
76| return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : '');
110| return $this->toJson($this->normalize($records), true);
141| protected function normalize($data)
152| $normalized[$key] = $this->normalize($value);
197| $data['trace'][] = $this->normalize($frame);
File: public/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php
Match lines: 4
43| return $this->normalize($record);
58| protected function normalize($data)
82| $normalized[$key] = $this->normalize($value);
153| $data['trace'][] = $this->toJson($this->normalize($frame), true);
File: public/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php
Match lines: 1
40| $normalized = $this->normalize($value);
File: public/js/ckfinder/core/connector/php/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php
Match lines: 3
57| $record = $this->normalize($record);
105| protected function normalize($data)
111| return parent::normalize($data);
File: public/js/ckfinder/libs/jquery.mobile.js
Match lines: 1
3|!function(a,b,c){"function"==typeof define&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)}(this,document,function(a,b,c){!function(a){a.mobile={}}(a),function(a,b){function d(b,c){var d,f,g,h=b.nodeName.toLowerCase();return"area"===h?(d=b.parentNode,f=d.name,b.href&&f&&"map"===d.nodeName.toLowerCase()?(g=a("img[usemap=#"+f+"]")[0],!!g&&e(g)):!1):(/input|select|textarea|button|object/.test(h)?!b.disabled:"a"===h?b.href||c:c)&&e(b)}function e(b){return a.expr.filters.visible(b)&&!a(b).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}var f=0,g=/^ui-id-\d+$/;a.ui=a.ui||{},a.extend(a.ui,{version:"c0ab71056b936627e8a7821f03c044aec6280a40",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({focus:function(b){return function(c,d){return"number"==typeof c?this.each(function(){var b=this;setTimeout(function(){a(b).focus(),d&&d.call(b)},c)}):b.apply(this,arguments)}}(a.fn.focus),scrollParent:function(){var b;return b=a.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.css(this,"position"))&&/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.css(this,"overflow")+a.css(this,"overflow-y")+a.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(this[0].ownerDocument||c):b},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++f)})},removeUniqueId:function(){return this.each(function(){g.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return d(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var c=a.attr(b,"tabindex"),e=isNaN(c);return(e||c>=0)&&d(b,!e)}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function e(b,c,d,e){return a.each(f,function(){c-=parseFloat(a.css(b,"padding"+this))||0,d&&(c-=parseFloat(a.css(b,"border"+this+"Width"))||0),e&&(c-=parseFloat(a.css(b,"margin"+this))||0)}),c}var f="Width"===d?["Left","Right"]:["Top","Bottom"],g=d.toLowerCase(),h={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?h["inner"+d].call(this):this.each(function(){a(this).css(g,e(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return"number"!=typeof b?h["outer"+d].call(this,b):this.each(function(){a(this).css(g,e(this,b,!0,c)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}),a("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,a.camelCase(c)):b.call(this)}}(a.fn.removeData)),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.support.selectstart="onselectstart"in c.createElement("div"),a.fn.extend({disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(d){if(d!==b)return this.css("zIndex",d);if(this.length)for(var e,f,g=a(this[0]);g.length&&g[0]!==c;){if(e=g.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(f=parseInt(g.css("zIndex"),10),!isNaN(f)&&0!==f))return f;g=g.parent()}return 0}}),a.ui.plugin={add:function(b,c,d){var e,f=a.ui[b].prototype;for(e in d)f.plugins[e]=f.plugins[e]||[],f.plugins[e].push([c,d[e]])},call:function(a,b,c,d){var e,f=a.plugins[b];if(f&&(d||a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType))for(e=0;e<f.length;e++)a.options[f[e][0]]&&f[e][1].apply(a.element,c)}}}(a),function(a,b){var d=function(b,c){var d=b.parent(),e=[],f=function(){var b=a(this),c=a.mobile.toolbar&&b.data("mobile-toolbar")?b.toolbar("option"):{position:b.attr("data-"+a.mobile.ns+"position"),updatePagePadding:b.attr("data-"+a.mobile.ns+"update-page-padding")!==!1};return!("fixed"===c.position&&c.updatePagePadding===!0)},g=d.children(":jqmData(role='header')").filter(f),h=b.children(":jqmData(role='header')"),i=d.children(":jqmData(role='footer')").filter(f),j=b.children(":jqmData(role='footer')");return 0===h.length&&g.length>0&&(e=e.concat(g.toArray())),0===j.length&&i.length>0&&(e=e.concat(i.toArray())),a.each(e,function(b,d){c-=a(d).outerHeight()}),Math.max(0,c)};a.extend(a.mobile,{window:a(b),document:a(c),keyCode:a.ui.keyCode,behaviors:{},silentScroll:function(c){"number"!==a.type(c)&&(c=a.mobile.defaultHomeScroll),a.event.special.scrollstart.enabled=!1,setTimeout(function(){b.scrollTo(0,c),a.mobile.document.trigger("silentscroll",{x:0,y:c})},20),setTimeout(function(){a.event.special.scrollstart.enabled=!0},150)},getClosestBaseUrl:function(b){var c=a(b).closest(".ui-page").jqmData("url"),d=a.mobile.path.documentBase.hrefNoHash;return a.mobile.dynamicBaseEnabled&&c&&a.mobile.path.isPath(c)||(c=d),a.mobile.path.makeUrlAbsolute(c,d)},removeActiveLinkClass:function(b){!a.mobile.activeClickedLink||a.mobile.activeClickedLink.closest("."+a.mobile.activePageClass).length&&!b||a.mobile.activeClickedLink.removeClass(a.mobile.activeBtnClass),a.mobile.activeClickedLink=null},getInheritedTheme:function(a,b){for(var c,d,e=a[0],f="",g=/ui-(bar|body|overlay)-([a-z])\b/;e&&(c=e.className||"",!(c&&(d=g.exec(c))&&(f=d[2])));)e=e.parentNode;return f||b||"a"},enhanceable:function(a){return this.haveParents(a,"enhance")},hijackable:function(a){return this.haveParents(a,"ajax")},haveParents:function(b,c){if(!a.mobile.ignoreContentEnabled)return b;var d,e,f,g,h,i=b.length,j=a();for(g=0;i>g;g++){for(e=b.eq(g),f=!1,d=b[g];d;){if(h=d.getAttribute?d.getAttribute("data-"+a.mobile.ns+c):"","false"===h){f=!0;break}d=d.parentNode}f||(j=j.add(e))}return j},getScreenHeight:function(){return b.innerHeight||a.mobile.window.height()},resetActivePageHeight:function(b){var c=a("."+a.mobile.activePageClass),e=c.height(),f=c.outerHeight(!0);b=d(c,"number"==typeof b?b:a.mobile.getScreenHeight()),c.css("min-height",""),c.height()<b&&c.css("min-height",b-(f-e))},loading:function(){var b=this.loading._widget||a(a.mobile.loader.prototype.defaultHtml).loader(),c=b.loader.apply(b,arguments);return this.loading._widget=b,c}}),a.addDependents=function(b,c){var d=a(b),e=d.jqmData("dependents")||a();d.jqmData("dependents",a(e).add(c))},a.fn.extend({removeWithDependents:function(){a.removeWithDependents(this)},enhanceWithin:function(){var b,c={},d=a.mobile.page.prototype.keepNativeSelector(),e=this;a.mobile.nojs&&a.mobile.nojs(this),a.mobile.links&&a.mobile.links(this),a.mobile.degradeInputsWithin&&a.mobile.degradeInputsWithin(this),a.fn.buttonMarkup&&this.find(a.fn.buttonMarkup.initSelector).not(d).jqmEnhanceable().buttonMarkup(),a.fn.fieldcontain&&this.find(":jqmData(role='fieldcontain')").not(d).jqmEnhanceable().fieldcontain(),a.each(a.mobile.widgets,function(b,f){if(f.initSelector){var g=a.mobile.enhanceable(e.find(f.initSelector));g.length>0&&(g=g.not(d)),g.length>0&&(c[f.prototype.widgetName]=g)}});for(b in c)c[b][b]();return this},addDependents:function(b){a.addDependents(this,b)},getEncodedText:function(){return a("<a>").text(this.text()).html()},jqmEnhanceable:function(){return a.mobile.enhanceable(this)},jqmHijackable:function(){return a.mobile.hijackable(this)}}),a.removeWithDependents=function(b){var c=a(b);(c.jqmData("dependents")||a()).remove(),c.remove()},a.addDependents=function(b,c){var d=a(b),e=d.jqmData("dependents")||a();d.jqmData("dependents",a(e).add(c))},a.find.matches=function(b,c){return a.find(b,null,null,c)},a.find.matchesSelector=function(b,c){return a.find(c,null,null,[b]).length>0}}(a,this),function(a){a.extend(a.mobile,{version:"1.4.5",subPageUrlKey:"ui-page",hideUrlBar:!0,keepNative:":jqmData(role='none'), :jqmData(role='nojs')",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,minScrollBack:0,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"a",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,buttonMarkup:{hoverDelay:200},dynamicBaseEnabled:!0,pageContainer:a(),allowCrossDomainPages:!1,dialogHashKey:"&ui-state=dialog"})}(a,this),function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c,d=0;null!=(c=b[d]);d++)try{a(c).triggerHandler("remove")}catch(f){}e(b)},a.widget=function(b,c,d){var e,f,g,h,i={},j=b.split(".")[0];return b=b.split(".")[1],e=j+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e.toLowerCase()]=function(b){return!!a.data(b,e)},a[j]=a[j]||{},f=a[j][b],g=a[j][b]=function(a,b){return this._createWidget?void(arguments.length&&this._createWidget(a,b)):new g(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,d){return a.isFunction(d)?void(i[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},e=function(a){return c.prototype[b].apply(this,a)};return function(){var b,c=this._super,f=this._superApply;return this._super=a,this._superApply=e,b=d.apply(this,arguments),this._super=c,this._superApply=f,b}}()):void(i[b]=d)}),g.prototype=a.widget.extend(h,{widgetEventPrefix:f?h.widgetEventPrefix||b:b},i,{constructor:g,namespace:j,widgetName:b,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g),g},a.widget.extend=function(c){for(var e,f,g=d.call(arguments,1),h=0,i=g.length;i>h;h++)for(e in g[h])f=g[h][e],g[h].hasOwnProperty(e)&&f!==b&&(c[e]=a.isPlainObject(f)?a.isPlainObject(c[e])?a.widget.extend({},c[e],f):a.widget.extend({},f):f);return c},a.widget.bridge=function(c,e){var f=e.prototype.widgetFullName||c;a.fn[c]=function(g){var h="string"==typeof g,i=d.call(arguments,1),j=this;return g=!h&&i.length?a.widget.extend.apply(null,[g].concat(i)):g,this.each(h?function(){var d,e=a.data(this,f);return"instance"===g?(j=e,!1):e?a.isFunction(e[g])&&"_"!==g.charAt(0)?(d=e[g].apply(e,i),d!==e&&d!==b?(j=d&&d.jquery?j.pushStack(d.get()):d,!1):void 0):a.error("no such method '"+g+"' for "+c+" widget instance"):a.error("cannot call methods on "+c+" prior to initialization; attempted to call method '"+g+"'")}:function(){var b=a.data(this,f);b?b.option(g||{})._init():a.data(this,f,new e(g,this))}),j}},a.Widget=function(){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(b,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=a.widget.extend({},this.options,this._getCreateOptions(),b),this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(c,d){var e,f,g,h=c;if(0===arguments.length)return a.widget.extend({},this.options);if("string"==typeof c)if(h={},e=c.split("."),c=e.shift(),e.length){for(f=h[c]=a.widget.extend({},this.options[c]),g=0;g<e.length-1;g++)f[e[g]]=f[e[g]]||{},f=f[e[g]];if(c=e.pop(),d===b)return f[c]===b?null:f[c];f[c]=d}else{if(d===b)return this.options[c]===b?null:this.options[c];h[c]=d}return this._setOptions(h),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(b,c,d){var e,f=this;"boolean"!=typeof b&&(d=c,c=b,b=!1),d?(c=e=a(c),this.bindings=this.bindings.add(c)):(d=c,c=this.element,e=this.widget()),a.each(d,function(d,g){function h(){return b||f.options.disabled!==!0&&!a(this).hasClass("ui-state-disabled")?("string"==typeof g?f[g]:g).apply(f,arguments):void 0}"string"!=typeof g&&(h.guid=g.guid=g.guid||h.guid||a.guid++);var i=d.match(/^(\w+)\s*(.*)$/),j=i[1]+f.eventNamespace,k=i[2];k?e.delegate(k,j,h):c.bind(j,h)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,a.unbind(b).undelegate(b)},_delay:function(a,b){function c(){return("string"==typeof a?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];if(d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){"string"==typeof e&&(e={effect:e});var g,h=e?e===!0||"number"==typeof e?c:e.effect||c:b;e=e||{},"number"==typeof e&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&a.effects.effect[h]?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}})}(a),function(a,b,c){var d={},e=a.find,f=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,g=/:jqmData\(([^)]*)\)/g;a.extend(a.mobile,{ns:"",getAttribute:function(b,c){var d;b=b.jquery?b[0]:b,b&&b.getAttribute&&(d=b.getAttribute("data-"+a.mobile.ns+c));try{d="true"===d?!0:"false"===d?!1:"null"===d?null:+d+""===d?+d:f.test(d)?JSON.parse(d):d}catch(e){}return d},nsNormalizeDict:d,nsNormalize:function(b){return d[b]||(d[b]=a.camelCase(a.mobile.ns+b))},closestPageData:function(a){return a.closest(":jqmData(role='page'), :jqmData(role='dialog')").data("mobile-page")}}),a.fn.jqmData=function(b,d){var e;return"undefined"!=typeof b&&(b&&(b=a.mobile.nsNormalize(b)),e=arguments.length<2||d===c?this.data(b):this.data(b,d)),e},a.jqmData=function(b,c,d){var e;return"undefined"!=typeof c&&(e=a.data(b,c?a.mobile.nsNormalize(c):c,d)),e},a.fn.jqmRemoveData=function(b){return this.removeData(a.mobile.nsNormalize(b))},a.jqmRemoveData=function(b,c){return a.removeData(b,a.mobile.nsNormalize(c))},a.find=function(b,c,d,f){return b.indexOf(":jqmData")>-1&&(b=b.replace(g,"[data-"+(a.mobile.ns||"")+"$1]")),e.call(this,b,c,d,f)},a.extend(a.find,e)}(a,this),function(a){var b=/[A-Z]/g,c=function(a){return"-"+a.toLowerCase()};a.extend(a.Widget.prototype,{_getCreateOptions:function(){var d,e,f=this.element[0],g={};if(!a.mobile.getAttribute(f,"defaults"))for(d in this.options)e=a.mobile.getAttribute(f,d.replace(b,c)),null!=e&&(g[d]=e);return g}}),a.mobile.widget=a.Widget}(a),function(a){var b="ui-loader",c=a("html");a.widget("mobile.loader",{options:{theme:"a",textVisible:!1,html:"",text:"loading"},defaultHtml:"<div class='"+b+"'><span class='ui-icon-loading'></span><h1></h1></div>",fakeFixLoader:function(){var b=a("."+a.mobile.activeBtnClass).first();this.element.css({top:a.support.scrollTop&&this.window.scrollTop()+this.window.height()/2||b.length&&b.offset().top||100})},checkLoaderPosition:function(){var b=this.element.offset(),c=this.window.scrollTop(),d=a.mobile.getScreenHeight();(b.top<c||b.top-c>d)&&(this.element.addClass("ui-loader-fakefix"),this.fakeFixLoader(),this.window.unbind("scroll",this.checkLoaderPosition).bind("scroll",a.proxy(this.fakeFixLoader,this)))},resetHtml:function(){this.element.html(a(this.defaultHtml).html())},show:function(d,e,f){var g,h,i;this.resetHtml(),"object"===a.type(d)?(i=a.extend({},this.options,d),d=i.theme):(i=this.options,d=d||i.theme),h=e||(i.text===!1?"":i.text),c.addClass("ui-loading"),g=i.textVisible,this.element.attr("class",b+" ui-corner-all ui-body-"+d+" ui-loader-"+(g||e||d.text?"verbose":"default")+(i.textonly||f?" ui-loader-textonly":"")),i.html?this.element.html(i.html):this.element.find("h1").text(h),this.element.appendTo(a(a.mobile.pagecontainer?":mobile-pagecontainer":"body")),this.checkLoaderPosition(),this.window.bind("scroll",a.proxy(this.checkLoaderPosition,this))},hide:function(){c.removeClass("ui-loading"),this.options.text&&this.element.removeClass("ui-loader-fakefix"),this.window.unbind("scroll",this.fakeFixLoader),this.window.unbind("scroll",this.checkLoaderPosition)}})}(a,this),function(a,b,d){"$:nomunge";function e(a){return a=a||location.href,"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var f,g="hashchange",h=c,i=a.event.special,j=h.documentMode,k="on"+g in b&&(j===d||j>7);a.fn[g]=function(a){return a?this.bind(g,a):this.trigger(g)},a.fn[g].delay=50,i[g]=a.extend(i[g],{setup:function(){return k?!1:void a(f.start)},teardown:function(){return k?!1:void a(f.stop)}}),f=function(){function c(){var d=e(),h=n(j);d!==j?(m(j=d,h),a(b).trigger(g)):h!==j&&(location.href=location.href.replace(/#.*/,"")+h),f=setTimeout(c,a.fn[g].delay)}var f,i={},j=e(),l=function(a){return a},m=l,n=l;return i.start=function(){f||c()},i.stop=function(){f&&clearTimeout(f),f=d},b.attachEvent&&!b.addEventListener&&!k&&function(){var b,d;i.start=function(){b||(d=a.fn[g].src,d=d&&d+e(),b=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){d||m(e()),c()}).attr("src",d||"javascript:0").insertAfter("body")[0].contentWindow,h.onpropertychange=function(){try{"title"===event.propertyName&&(b.document.title=h.title)}catch(a){}})},i.stop=l,n=function(){return e(b.location.href)},m=function(c,d){var e=b.document,f=a.fn[g].domain;c!==d&&(e.title=h.title,e.open(),f&&e.write('<script>document.domain="'+f+'"</script>'),e.close(),b.location.hash=c)}}(),i}()}(a,this),function(a){b.matchMedia=b.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(c),a.mobile.media=function(a){return b.matchMedia(a).matches}}(a),function(a){var b={touch:"ontouchend"in c};a.mobile.support=a.mobile.support||{},a.extend(a.support,b),a.extend(a.mobile.support,b)}(a),function(a){a.extend(a.support,{orientation:"orientation"in b&&"onorientationchange"in b})}(a),function(a,d){function e(a){var b,c=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(c+" ")+c).split(" ");for(b in e)if(n[e[b]]!==d)return!0}function f(){var c=b,d=!(!c.document.createElementNS||!c.document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||c.opera&&-1===navigator.userAgent.indexOf("Chrome")),e=function(b){b&&d||a("html").addClass("ui-nosvg")},f=new c.Image;f.onerror=function(){e(!1)},f.onload=function(){e(1===f.width&&1===f.height)},f.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="}function g(){var e,f,g,h="transform-3d",i=a.mobile.media("(-"+o.join("-"+h+"),(-")+"-"+h+"),("+h+")");if(i)return!!i;e=c.createElement("div"),f={MozTransform:"-moz-transform",transform:"transform"},m.append(e);for(g in f)e.style[g]!==d&&(e.style[g]="translate3d( 100px, 1px, 1px )",i=b.getComputedStyle(e).getPropertyValue(f[g]));return!!i&&"none"!==i}function h(){var b,c,d=location.protocol+"//"+location.host+location.pathname+"ui-dir/",e=a("head base"),f=null,g="";return e.length?g=e.attr("href"):e=f=a("<base>",{href:d}).appendTo("head"),b=a("<a href='testurl' />").prependTo(m),c=b[0].href,e[0].href=g||location.pathname,f&&f.remove(),0===c.indexOf(d)}function i(){var a,d=c.createElement("x"),e=c.documentElement,f=b.getComputedStyle;return"pointerEvents"in d.style?(d.style.pointerEvents="auto",d.style.pointerEvents="x",e.appendChild(d),a=f&&"auto"===f(d,"").pointerEvents,e.removeChild(d),!!a):!1}function j(){var a=c.createElement("div");return"undefined"!=typeof a.getBoundingClientRect}function k(){var a=b,c=navigator.userAgent,d=navigator.platform,e=c.match(/AppleWebKit\/([0-9]+)/),f=!!e&&e[1],g=c.match(/Fennec\/([0-9]+)/),h=!!g&&g[1],i=c.match(/Opera Mobi\/([0-9]+)/),j=!!i&&i[1];return(d.indexOf("iPhone")>-1||d.indexOf("iPad")>-1||d.indexOf("iPod")>-1)&&f&&534>f||a.operamini&&"[object OperaMini]"==={}.toString.call(a.operamini)||i&&7458>j||c.indexOf("Android")>-1&&f&&533>f||h&&6>h||"palmGetResource"in b&&f&&534>f||c.indexOf("MeeGo")>-1&&c.indexOf("NokiaBrowser/8.5.0")>-1?!1:!0}var l,m=a("<body>").prependTo("html"),n=m[0].style,o=["Webkit","Moz","O"],p="palmGetResource"in b,q=b.operamini&&"[object OperaMini]"==={}.toString.call(b.operamini),r=b.blackberry&&!e("-webkit-transform");a.extend(a.mobile,{browser:{}}),a.mobile.browser.oldIE=function(){var a=3,b=c.createElement("div"),d=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(d[0]);return a>4?a:!a}(),a.extend(a.support,{pushState:"pushState"in history&&"replaceState"in history&&!(b.navigator.userAgent.indexOf("Firefox")>=0&&b.top!==b)&&-1===b.navigator.userAgent.search(/CriOS/),mediaquery:a.mobile.media("only all"),cssPseudoElement:!!e("content"),touchOverflow:!!e("overflowScrolling"),cssTransform3d:g(),boxShadow:!!e("boxShadow")&&!r,fixedPosition:k(),scrollTop:("pageXOffset"in b||"scrollTop"in c.documentElement||"scrollTop"in m[0])&&!p&&!q,dynamicBaseTag:h(),cssPointerEvents:i(),boundingRect:j(),inlineSVG:f}),m.remove(),l=function(){var a=b.navigator.userAgent;return a.indexOf("Nokia")>-1&&(a.indexOf("Symbian/3")>-1||a.indexOf("Series60/5")>-1)&&a.indexOf("AppleWebKit")>-1&&a.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/)}(),a.mobile.gradeA=function(){return(a.support.mediaquery&&a.support.cssPseudoElement||a.mobile.browser.oldIE&&a.mobile.browser.oldIE>=8)&&(a.support.boundingRect||null!==a.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/))},a.mobile.ajaxBlacklist=b.blackberry&&!b.WebKitPoint||q||l,l&&a(function(){a("head link[rel='stylesheet']").attr("rel","alternate stylesheet").attr("rel","stylesheet")}),a.support.boxShadow||a("html").addClass("ui-noboxshadow")}(a),function(a,b){var c,d=a.mobile.window,e=function(){};a.event.special.beforenavigate={setup:function(){d.on("navigate",e)},teardown:function(){d.off("navigate",e)}},a.event.special.navigate=c={bound:!1,pushStateEnabled:!0,originalEventName:b,isPushStateEnabled:function(){return a.support.pushState&&a.mobile.pushStateEnabled===!0&&this.isHashChangeEnabled()},isHashChangeEnabled:function(){return a.mobile.hashListeningEnabled===!0},popstate:function(b){var c=new a.Event("navigate"),e=new a.Event("beforenavigate"),f=b.originalEvent.state||{};e.originalEvent=b,d.trigger(e),e.isDefaultPrevented()||(b.historyState&&a.extend(f,b.historyState),c.originalEvent=b,setTimeout(function(){d.trigger(c,{state:f})},0))},hashchange:function(b){var c=new a.Event("navigate"),e=new a.Event("beforenavigate");e.originalEvent=b,d.trigger(e),e.isDefaultPrevented()||(c.originalEvent=b,d.trigger(c,{state:b.hashchangeState||{}}))},setup:function(){c.bound||(c.bound=!0,c.isPushStateEnabled()?(c.originalEventName="popstate",d.bind("popstate.navigate",c.popstate)):c.isHashChangeEnabled()&&(c.originalEventName="hashchange",d.bind("hashchange.navigate",c.hashchange)))}}}(a),function(a,c){var d,e,f="&ui-state=dialog";a.mobile.path=d={uiStateKey:"&ui-state",urlParseRE:/^\s*(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,getLocation:function(a){var b=this.parseUrl(a||location.href),c=a?b:location,d=b.hash;return d="#"===d?"":d,c.protocol+b.doubleSlash+c.host+(""!==c.protocol&&"/"!==c.pathname.substring(0,1)?"/":"")+c.pathname+c.search+d},getDocumentUrl:function(b){return b?a.extend({},d.documentUrl):d.documentUrl.href},parseLocation:function(){return this.parseUrl(this.getLocation())},parseUrl:function(b){if("object"===a.type(b))return b;var c=d.urlParseRE.exec(b||"")||[];return{href:c[0]||"",hrefNoHash:c[1]||"",hrefNoSearch:c[2]||"",domain:c[3]||"",protocol:c[4]||"",doubleSlash:c[5]||"",authority:c[6]||"",username:c[8]||"",password:c[9]||"",host:c[10]||"",hostname:c[11]||"",port:c[12]||"",pathname:c[13]||"",directory:c[14]||"",filename:c[15]||"",search:c[16]||"",hash:c[17]||""}},makePathAbsolute:function(a,b){var c,d,e,f;if(a&&"/"===a.charAt(0))return a;for(a=a||"",b=b?b.replace(/^\/|(\/[^\/]*|[^\/]+)$/g,""):"",c=b?b.split("/"):[],d=a.split("/"),e=0;e<d.length;e++)switch(f=d[e]){case".":break;case"..":c.length&&c.pop();break;default:c.push(f)}return"/"+c.join("/")},isSameDomain:function(a,b){return d.parseUrl(a).domain.toLowerCase()===d.parseUrl(b).domain.toLowerCase()},isRelativeUrl:function(a){return""===d.parseUrl(a).protocol},isAbsoluteUrl:function(a){return""!==d.parseUrl(a).protocol},makeUrlAbsolute:function(a,b){if(!d.isRelativeUrl(a))return a;b===c&&(b=this.documentBase);var e=d.parseUrl(a),f=d.parseUrl(b),g=e.protocol||f.protocol,h=e.protocol?e.doubleSlash:e.doubleSlash||f.doubleSlash,i=e.authority||f.authority,j=""!==e.pathname,k=d.makePathAbsolute(e.pathname||f.filename,f.pathname),l=e.search||!j&&f.search||"",m=e.hash;return g+h+i+k+l+m},addSearchParams:function(b,c){var e=d.parseUrl(b),f="object"==typeof c?a.param(c):c,g=e.search||"?";return e.hrefNoSearch+g+("?"!==g.charAt(g.length-1)?"&":"")+f+(e.hash||"")},convertUrlToDataUrl:function(a){var c=a,e=d.parseUrl(a);return d.isEmbeddedPage(e)?c=e.hash.split(f)[0].replace(/^#/,"").replace(/\?.*$/,""):d.isSameDomain(e,this.documentBase)&&(c=e.hrefNoHash.replace(this.documentBase.domain,"").split(f)[0]),b.decodeURIComponent(c)},get:function(a){return a===c&&(a=d.parseLocation().hash),d.stripHash(a).replace(/[^\/]*\.[^\/*]+$/,"")},set:function(a){location.hash=a},isPath:function(a){return/\//.test(a)},clean:function(a){return a.replace(this.documentBase.domain,"")},stripHash:function(a){return a.replace(/^#/,"")},stripQueryParams:function(a){return a.replace(/\?.*$/,"")},cleanHash:function(a){return d.stripHash(a.replace(/\?.*$/,"").replace(f,""))},isHashValid:function(a){return/^#[^#]+$/.test(a)},isExternal:function(a){var b=d.parseUrl(a);return!(!b.protocol||b.domain.toLowerCase()===this.documentUrl.domain.toLowerCase())},hasProtocol:function(a){return/^(:?\w+:)/.test(a)},isEmbeddedPage:function(a){var b=d.parseUrl(a);return""!==b.protocol?!this.isPath(b.hash)&&b.hash&&(b.hrefNoHash===this.documentUrl.hrefNoHash||this.documentBaseDiffers&&b.hrefNoHash===this.documentBase.hrefNoHash):/^#/.test(b.href)},squash:function(a,b){var c,e,f,g,h,i=this.isPath(a),j=this.parseUrl(a),k=j.hash,l="";return b||(i?b=d.getLocation():(h=d.getDocumentUrl(!0),b=d.isPath(h.hash)?d.squash(h.href):h.href)),e=i?d.stripHash(a):a,e=d.isPath(j.hash)?d.stripHash(j.hash):e,g=e.indexOf(this.uiStateKey),g>-1&&(l=e.slice(g),e=e.slice(0,g)),c=d.makeUrlAbsolute(e,b),f=this.parseUrl(c).search,i?((d.isPath(k)||0===k.replace("#","").indexOf(this.uiStateKey))&&(k=""),l&&-1===k.indexOf(this.uiStateKey)&&(k+=l),-1===k.indexOf("#")&&""!==k&&(k="#"+k),c=d.parseUrl(c),c=c.protocol+c.doubleSlash+c.host+c.pathname+f+k):c+=c.indexOf("#")>-1?l:"#"+l,c},isPreservableHash:function(a){return 0===a.replace("#","").indexOf(this.uiStateKey)},hashToSelector:function(a){var b="#"===a.substring(0,1);return b&&(a=a.substring(1)),(b?"#":"")+a.replace(/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,"\\$1")},getFilePath:function(a){return a&&a.split(f)[0]},isFirstPageUrl:function(b){var e=d.parseUrl(d.makeUrlAbsolute(b,this.documentBase)),f=e.hrefNoHash===this.documentUrl.hrefNoHash||this.documentBaseDiffers&&e.hrefNoHash===this.documentBase.hrefNoHash,g=a.mobile.firstPage,h=g&&g[0]?g[0].id:c;return f&&(!e.hash||"#"===e.hash||h&&e.hash.replace(/^#/,"")===h)},isPermittedCrossDomainRequest:function(b,c){return a.mobile.allowCrossDomainPages&&("file:"===b.protocol||"content:"===b.protocol)&&-1!==c.search(/^https?:/)}},d.documentUrl=d.parseLocation(),e=a("head").find("base"),d.documentBase=e.length?d.parseUrl(d.makeUrlAbsolute(e.attr("href"),d.documentUrl.href)):d.documentUrl,d.documentBaseDiffers=d.documentUrl.hrefNoHash!==d.documentBase.hrefNoHash,d.getDocumentBase=function(b){return b?a.extend({},d.documentBase):d.documentBase.href},a.extend(a.mobile,{getDocumentUrl:d.getDocumentUrl,getDocumentBase:d.getDocumentBase})}(a),function(a,b){a.mobile.History=function(a,b){this.stack=a||[],this.activeIndex=b||0},a.extend(a.mobile.History.prototype,{getActive:function(){return this.stack[this.activeIndex]},getLast:function(){return this.stack[this.previousIndex]},getNext:function(){return this.stack[this.activeIndex+1]},getPrev:function(){return this.stack[this.activeIndex-1]},add:function(a,b){b=b||{},this.getNext()&&this.clearForward(),b.hash&&-1===b.hash.indexOf("#")&&(b.hash="#"+b.hash),b.url=a,this.stack.push(b),this.activeIndex=this.stack.length-1},clearForward:function(){this.stack=this.stack.slice(0,this.activeIndex+1)},find:function(a,b,c){b=b||this.stack;var d,e,f,g=b.length;for(e=0;g>e;e++)if(d=b[e],(decodeURIComponent(a)===decodeURIComponent(d.url)||decodeURIComponent(a)===decodeURIComponent(d.hash))&&(f=e,c))return f;return f},closest:function(a){var c,d=this.activeIndex;return c=this.find(a,this.stack.slice(0,d)),c===b&&(c=this.find(a,this.stack.slice(d),!0),c=c===b?c:c+d),c},direct:function(c){var d=this.closest(c.url),e=this.activeIndex;d!==b&&(this.activeIndex=d,this.previousIndex=e),e>d?(c.present||c.back||a.noop)(this.getActive(),"back"):d>e?(c.present||c.forward||a.noop)(this.getActive(),"forward"):d===b&&c.missing&&c.missing(this.getActive())}})}(a),function(a){var d=a.mobile.path,e=location.href;a.mobile.Navigator=function(b){this.history=b,this.ignoreInitialHashChange=!0,a.mobile.window.bind({"popstate.history":a.proxy(this.popstate,this),"hashchange.history":a.proxy(this.hashchange,this)})},a.extend(a.mobile.Navigator.prototype,{squash:function(e,f){var g,h,i=d.isPath(e)?d.stripHash(e):e;return h=d.squash(e),g=a.extend({hash:i,url:h},f),b.history.replaceState(g,g.title||c.title,h),g},hash:function(a,b){var c,e,f,g;return c=d.parseUrl(a),e=d.parseLocation(),e.pathname+e.search===c.pathname+c.search?f=c.hash?c.hash:c.pathname+c.search:d.isPath(a)?(g=d.parseUrl(b),f=g.pathname+g.search+(d.isPreservableHash(g.hash)?g.hash.replace("#",""):"")):f=a,f},go:function(e,f,g){var h,i,j,k,l=a.event.special.navigate.isPushStateEnabled();
File: public/js/decision_system/risk_intelligence_signals.js
Match lines: 1
1502| .normalize('NFD')
File: public/js/decoderWorker.min.js
Match lines: 1
2|if(ba){d.print||(d.print=function(a){process.stdout.write(a+"\n")});d.printErr||(d.printErr=function(a){process.stderr.write(a+"\n")});var da=require("fs"),ea=require("path");d.read=function(a,b){a=ea.normalize(a);var c=da.readFileSync(a);c||a==ea.resolve(a)||(a=path.join(__dirname,"..","src",a),c=da.readFileSync(a));c&&!b&&(c=c.toString());return c};d.readBinary=function(a){a=d.read(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};d.load=function(a){fa(read(a))};d.thisProgram||(d.thisProgram=
File: public/js/encoderWorker.min.js
Match lines: 1
2|if(ca){d.print||(d.print=function(a){process.stdout.write(a+"\n")});d.printErr||(d.printErr=function(a){process.stderr.write(a+"\n")});var ea=require("fs"),fa=require("path");d.read=function(a,b){a=fa.normalize(a);var c=ea.readFileSync(a);c||a==fa.resolve(a)||(a=path.join(__dirname,"..","src",a),c=ea.readFileSync(a));c&&!b&&(c=c.toString());return c};d.readBinary=function(a){a=d.read(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};d.load=function(a){ga(read(a))};d.thisProgram||(d.thisProgram=
File: public/js/flot/jquery.colorhelpers.min.js
Match lines: 1
1|(function(b){b.color={};b.color.make=function(f,e,c,d){var h={};h.r=f||0;h.g=e||0;h.b=c||0;h.a=d!=null?d:1;h.add=function(k,j){for(var g=0;g<k.length;++g){h[k.charAt(g)]+=j}return h.normalize()};h.scale=function(k,j){for(var g=0;g<k.length;++g){h[k.charAt(g)]*=j}return h.normalize()};h.toString=function(){if(h.a>=1){return"rgb("+[h.r,h.g,h.b].join(",")+")"}else{return"rgba("+[h.r,h.g,h.b,h.a].join(",")+")"}};h.normalize=function(){function g(j,k,i){return k<j?j:(k>i?i:k)}h.r=g(0,parseInt(h.r),255);h.g=g(0,parseInt(h.g),255);h.b=g(0,parseInt(h.b),255);h.a=g(0,h.a,1);return h};h.clone=function(){return b.color.make(h.r,h.b,h.g,h.a)};return h.normalize()};b.color.extract=function(e,d){var f;do{f=e.css(d).toLowerCase();if(f!=""&&f!="transparent"){break}e=e.parent()}while(!b.nodeName(e.get(0),"body"));if(f=="rgba(0, 0, 0, 0)"){f="transparent"}return b.color.parse(f)};b.color.parse=function(f){var e,c=b.color.make;if(e=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)){return c(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10))}if(e=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(f)){return c(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10),parseFloat(e[4]))}if(e=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)){return c(parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55)}if(e=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(f)){return c(parseFloat(e[1])*2.55,parseFloat(e[2])*2.55,parseFloat(e[3])*2.55,parseFloat(e[4]))}if(e=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)){return c(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16))}if(e=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)){return c(parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16))}var d=b.trim(f).toLowerCase();if(d=="transparent"){return c(255,255,255,0)}else{e=a[d]||[0,0,0];return c(e[0],e[1],e[2])}};var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
File: public/js/flot/jquery.flot.min.js
Match lines: 1
6|(function(b){b.color={};b.color.make=function(d,e,g,f){var c={};c.r=d||0;c.g=e||0;c.b=g||0;c.a=f!=null?f:1;c.add=function(h,j){for(var k=0;k<h.length;++k){c[h.charAt(k)]+=j}return c.normalize()};c.scale=function(h,j){for(var k=0;k<h.length;++k){c[h.charAt(k)]*=j}return c.normalize()};c.toString=function(){if(c.a>=1){return"rgb("+[c.r,c.g,c.b].join(",")+")"}else{return"rgba("+[c.r,c.g,c.b,c.a].join(",")+")"}};c.normalize=function(){function h(k,j,l){return j<k?k:(j>l?l:j)}c.r=h(0,parseInt(c.r),255);c.g=h(0,parseInt(c.g),255);c.b=h(0,parseInt(c.b),255);c.a=h(0,c.a,1);return c};c.clone=function(){return b.color.make(c.r,c.b,c.g,c.a)};return c.normalize()};b.color.extract=function(d,e){var c;do{c=d.css(e).toLowerCase();if(c!=""&&c!="transparent"){break}d=d.parent()}while(!b.nodeName(d.get(0),"body"));if(c=="rgba(0, 0, 0, 0)"){c="transparent"}return b.color.parse(c)};b.color.parse=function(c){var d,f=b.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)){return f(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10))}if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)){return f(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]))}if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)){return f(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55)}if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)){return f(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55,parseFloat(d[4]))}if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)){return f(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16))}if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)){return f(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16))}var e=b.trim(c).toLowerCase();if(e=="transparent"){return f(255,255,255,0)}else{d=a[e]||[0,0,0];return f(d[0],d[1],d[2])}};var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(c){function b(av,ai,J,af){var Q=[],O={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{show:null,position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:0.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},hooks:{}},az=null,ad=null,y=null,H=null,A=null,p=[],aw=[],q={left:0,right:0,top:0,bottom:0},G=0,I=0,h=0,w=0,ak={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},aq=this;aq.setData=aj;aq.setupGrid=t;aq.draw=W;aq.getPlaceholder=function(){return av};aq.getCanvas=function(){return az};aq.getPlotOffset=function(){return q};aq.width=function(){return h};aq.height=function(){return w};aq.offset=function(){var aB=y.offset();aB.left+=q.left;aB.top+=q.top;return aB};aq.getData=function(){return Q};aq.getAxes=function(){var aC={},aB;c.each(p.concat(aw),function(aD,aE){if(aE){aC[aE.direction+(aE.n!=1?aE.n:"")+"axis"]=aE}});return aC};aq.getXAxes=function(){return p};aq.getYAxes=function(){return aw};aq.c2p=C;aq.p2c=ar;aq.getOptions=function(){return O};aq.highlight=x;aq.unhighlight=T;aq.triggerRedrawOverlay=f;aq.pointOffset=function(aB){return{left:parseInt(p[aA(aB,"x")-1].p2c(+aB.x)+q.left),top:parseInt(aw[aA(aB,"y")-1].p2c(+aB.y)+q.top)}};aq.shutdown=ag;aq.resize=function(){B();g(az);g(ad)};aq.hooks=ak;F(aq);Z(J);X();aj(ai);t();W();ah();function an(aD,aB){aB=[aq].concat(aB);for(var aC=0;aC<aD.length;++aC){aD[aC].apply(this,aB)}}function F(){for(var aB=0;aB<af.length;++aB){var aC=af[aB];aC.init(aq);if(aC.options){c.extend(true,O,aC.options)}}}function Z(aC){var aB;c.extend(true,O,aC);if(O.xaxis.color==null){O.xaxis.color=O.grid.color}if(O.yaxis.color==null){O.yaxis.color=O.grid.color}if(O.xaxis.tickColor==null){O.xaxis.tickColor=O.grid.tickColor}if(O.yaxis.tickColor==null){O.yaxis.tickColor=O.grid.tickColor}if(O.grid.borderColor==null){O.grid.borderColor=O.grid.color}if(O.grid.tickColor==null){O.grid.tickColor=c.color.parse(O.grid.color).scale("a",0.22).toString()}for(aB=0;aB<Math.max(1,O.xaxes.length);++aB){O.xaxes[aB]=c.extend(true,{},O.xaxis,O.xaxes[aB])}for(aB=0;aB<Math.max(1,O.yaxes.length);++aB){O.yaxes[aB]=c.extend(true,{},O.yaxis,O.yaxes[aB])}if(O.xaxis.noTicks&&O.xaxis.ticks==null){O.xaxis.ticks=O.xaxis.noTicks}if(O.yaxis.noTicks&&O.yaxis.ticks==null){O.yaxis.ticks=O.yaxis.noTicks}if(O.x2axis){O.xaxes[1]=c.extend(true,{},O.xaxis,O.x2axis);O.xaxes[1].position="top"}if(O.y2axis){O.yaxes[1]=c.extend(true,{},O.yaxis,O.y2axis);O.yaxes[1].position="right"}if(O.grid.coloredAreas){O.grid.markings=O.grid.coloredAreas}if(O.grid.coloredAreasColor){O.grid.markingsColor=O.grid.coloredAreasColor}if(O.lines){c.extend(true,O.series.lines,O.lines)}if(O.points){c.extend(true,O.series.points,O.points)}if(O.bars){c.extend(true,O.series.bars,O.bars)}if(O.shadowSize!=null){O.series.shadowSize=O.shadowSize}for(aB=0;aB<O.xaxes.length;++aB){V(p,aB+1).options=O.xaxes[aB]}for(aB=0;aB<O.yaxes.length;++aB){V(aw,aB+1).options=O.yaxes[aB]}for(var aD in ak){if(O.hooks[aD]&&O.hooks[aD].length){ak[aD]=ak[aD].concat(O.hooks[aD])}}an(ak.processOptions,[O])}function aj(aB){Q=Y(aB);ax();z()}function Y(aE){var aC=[];for(var aB=0;aB<aE.length;++aB){var aD=c.extend(true,{},O.series);if(aE[aB].data!=null){aD.data=aE[aB].data;delete aE[aB].data;c.extend(true,aD,aE[aB]);aE[aB].data=aD.data}else{aD.data=aE[aB]}aC.push(aD)}return aC}function aA(aC,aD){var aB=aC[aD+"axis"];if(typeof aB=="object"){aB=aB.n}if(typeof aB!="number"){aB=1}return aB}function m(){return c.grep(p.concat(aw),function(aB){return aB})}function C(aE){var aC={},aB,aD;for(aB=0;aB<p.length;++aB){aD=p[aB];if(aD&&aD.used){aC["x"+aD.n]=aD.c2p(aE.left)}}for(aB=0;aB<aw.length;++aB){aD=aw[aB];if(aD&&aD.used){aC["y"+aD.n]=aD.c2p(aE.top)}}if(aC.x1!==undefined){aC.x=aC.x1}if(aC.y1!==undefined){aC.y=aC.y1}return aC}function ar(aF){var aD={},aC,aE,aB;for(aC=0;aC<p.length;++aC){aE=p[aC];if(aE&&aE.used){aB="x"+aE.n;if(aF[aB]==null&&aE.n==1){aB="x"}if(aF[aB]!=null){aD.left=aE.p2c(aF[aB]);break}}}for(aC=0;aC<aw.length;++aC){aE=aw[aC];if(aE&&aE.used){aB="y"+aE.n;if(aF[aB]==null&&aE.n==1){aB="y"}if(aF[aB]!=null){aD.top=aE.p2c(aF[aB]);break}}}return aD}function V(aC,aB){if(!aC[aB-1]){aC[aB-1]={n:aB,direction:aC==p?"x":"y",options:c.extend(true,{},aC==p?O.xaxis:O.yaxis)}}return aC[aB-1]}function ax(){var aG;var aM=Q.length,aB=[],aE=[];for(aG=0;aG<Q.length;++aG){var aJ=Q[aG].color;if(aJ!=null){--aM;if(typeof aJ=="number"){aE.push(aJ)}else{aB.push(c.color.parse(Q[aG].color))}}}for(aG=0;aG<aE.length;++aG){aM=Math.max(aM,aE[aG]+1)}var aC=[],aF=0;aG=0;while(aC.length<aM){var aI;if(O.colors.length==aG){aI=c.color.make(100,100,100)}else{aI=c.color.parse(O.colors[aG])}var aD=aF%2==1?-1:1;aI.scale("rgb",1+aD*Math.ceil(aF/2)*0.2);aC.push(aI);++aG;if(aG>=O.colors.length){aG=0;++aF}}var aH=0,aN;for(aG=0;aG<Q.length;++aG){aN=Q[aG];if(aN.color==null){aN.color=aC[aH].toString();++aH}else{if(typeof aN.color=="number"){aN.color=aC[aN.color].toString()}}if(aN.lines.show==null){var aL,aK=true;for(aL in aN){if(aN[aL]&&aN[aL].show){aK=false;break}}if(aK){aN.lines.show=true}}aN.xaxis=V(p,aA(aN,"x"));aN.yaxis=V(aw,aA(aN,"y"))}}function z(){var aO=Number.POSITIVE_INFINITY,aI=Number.NEGATIVE_INFINITY,aB=Number.MAX_VALUE,aU,aS,aR,aN,aD,aJ,aT,aP,aH,aG,aC,a0,aX,aL;function aF(a3,a2,a1){if(a2<a3.datamin&&a2!=-aB){a3.datamin=a2}if(a1>a3.datamax&&a1!=aB){a3.datamax=a1}}c.each(m(),function(a1,a2){a2.datamin=aO;a2.datamax=aI;a2.used=false});for(aU=0;aU<Q.length;++aU){aJ=Q[aU];aJ.datapoints={points:[]};an(ak.processRawData,[aJ,aJ.data,aJ.datapoints])}for(aU=0;aU<Q.length;++aU){aJ=Q[aU];var aZ=aJ.data,aW=aJ.datapoints.format;if(!aW){aW=[];aW.push({x:true,number:true,required:true});aW.push({y:true,number:true,required:true});if(aJ.bars.show||(aJ.lines.show&&aJ.lines.fill)){aW.push({y:true,number:true,required:false,defaultValue:0});if(aJ.bars.horizontal){delete aW[aW.length-1].y;aW[aW.length-1].x=true}}aJ.datapoints.format=aW}if(aJ.datapoints.pointsize!=null){continue}aJ.datapoints.pointsize=aW.length;aP=aJ.datapoints.pointsize;aT=aJ.datapoints.points;insertSteps=aJ.lines.show&&aJ.lines.steps;aJ.xaxis.used=aJ.yaxis.used=true;for(aS=aR=0;aS<aZ.length;++aS,aR+=aP){aL=aZ[aS];var aE=aL==null;if(!aE){for(aN=0;aN<aP;++aN){a0=aL[aN];aX=aW[aN];if(aX){if(aX.number&&a0!=null){a0=+a0;if(isNaN(a0)){a0=null}else{if(a0==Infinity){a0=aB}else{if(a0==-Infinity){a0=-aB}}}}if(a0==null){if(aX.required){aE=true}if(aX.defaultValue!=null){a0=aX.defaultValue}}}aT[aR+aN]=a0}}if(aE){for(aN=0;aN<aP;++aN){a0=aT[aR+aN];if(a0!=null){aX=aW[aN];if(aX.x){aF(aJ.xaxis,a0,a0)}if(aX.y){aF(aJ.yaxis,a0,a0)}}aT[aR+aN]=null}}else{if(insertSteps&&aR>0&&aT[aR-aP]!=null&&aT[aR-aP]!=aT[aR]&&aT[aR-aP+1]!=aT[aR+1]){for(aN=0;aN<aP;++aN){aT[aR+aP+aN]=aT[aR+aN]}aT[aR+1]=aT[aR-aP+1];aR+=aP}}}}for(aU=0;aU<Q.length;++aU){aJ=Q[aU];an(ak.processDatapoints,[aJ,aJ.datapoints])}for(aU=0;aU<Q.length;++aU){aJ=Q[aU];aT=aJ.datapoints.points,aP=aJ.datapoints.pointsize;var aK=aO,aQ=aO,aM=aI,aV=aI;for(aS=0;aS<aT.length;aS+=aP){if(aT[aS]==null){continue}for(aN=0;aN<aP;++aN){a0=aT[aS+aN];aX=aW[aN];if(!aX||a0==aB||a0==-aB){continue}if(aX.x){if(a0<aK){aK=a0}if(a0>aM){aM=a0}}if(aX.y){if(a0<aQ){aQ=a0}if(a0>aV){aV=a0}}}}if(aJ.bars.show){var aY=aJ.bars.align=="left"?0:-aJ.bars.barWidth/2;if(aJ.bars.horizontal){aQ+=aY;aV+=aY+aJ.bars.barWidth}else{aK+=aY;aM+=aY+aJ.bars.barWidth}}aF(aJ.xaxis,aK,aM);aF(aJ.yaxis,aQ,aV)}c.each(m(),function(a1,a2){if(a2.datamin==aO){a2.datamin=null}if(a2.datamax==aI){a2.datamax=null}})}function j(aB,aC){var aD=document.createElement("canvas");aD.className=aC;aD.width=G;aD.height=I;if(!aB){c(aD).css({position:"absolute",left:0,top:0})}c(aD).appendTo(av);if(!aD.getContext){aD=window.G_vmlCanvasManager.initElement(aD)}aD.getContext("2d").save();return aD}function B(){G=av.width();I=av.height();if(G<=0||I<=0){throw"Invalid dimensions for plot, width = "+G+", height = "+I}}function g(aC){if(aC.width!=G){aC.width=G}if(aC.height!=I){aC.height=I}var aB=aC.getContext("2d");aB.restore();aB.save()}function X(){var aC,aB=av.children("canvas.base"),aD=av.children("canvas.overlay");if(aB.length==0||aD==0){av.html("");av.css({padding:0});if(av.css("position")=="static"){av.css("position","relative")}B();az=j(true,"base");ad=j(false,"overlay");aC=false}else{az=aB.get(0);ad=aD.get(0);aC=true}H=az.getContext("2d");A=ad.getContext("2d");y=c([ad,az]);if(aC){av.data("plot").shutdown();aq.resize();A.clearRect(0,0,G,I);y.unbind();av.children().not([az,ad]).remove()}av.data("plot",aq)}function ah(){if(O.grid.hoverable){y.mousemove(aa);y.mouseleave(l)}if(O.grid.clickable){y.click(R)}an(ak.bindEvents,[y])}function ag(){if(M){clearTimeout(M)}y.unbind("mousemove",aa);y.unbind("mouseleave",l);y.unbind("click",R);an(ak.shutdown,[y])}function r(aG){function aC(aH){return aH}var aF,aB,aD=aG.options.transform||aC,aE=aG.options.inverseTransform;if(aG.direction=="x"){aF=aG.scale=h/Math.abs(aD(aG.max)-aD(aG.min));aB=Math.min(aD(aG.max),aD(aG.min))}else{aF=aG.scale=w/Math.abs(aD(aG.max)-aD(aG.min));aF=-aF;aB=Math.max(aD(aG.max),aD(aG.min))}if(aD==aC){aG.p2c=function(aH){return(aH-aB)*aF}}else{aG.p2c=function(aH){return(aD(aH)-aB)*aF}}if(!aE){aG.c2p=function(aH){return aB+aH/aF}}else{aG.c2p=function(aH){return aE(aB+aH/aF)}}}function L(aD){var aB=aD.options,aF,aJ=aD.ticks||[],aI=[],aE,aK=aB.labelWidth,aG=aB.labelHeight,aC;function aH(aM,aL){return c('<div style="position:absolute;top:-10000px;'+aL+'font-size:smaller"><div class="'+aD.direction+"Axis "+aD.direction+aD.n+'Axis">'+aM.join("")+"</div></div>").appendTo(av)}if(aD.direction=="x"){if(aK==null){aK=Math.floor(G/(aJ.length>0?aJ.length:1))}if(aG==null){aI=[];for(aF=0;aF<aJ.length;++aF){aE=aJ[aF].label;if(aE){aI.push('<div class="tickLabel" style="float:left;width:'+aK+'px">'+aE+"</div>")}}if(aI.length>0){aI.push('<div style="clear:left"></div>');aC=aH(aI,"width:10000px;");aG=aC.height();aC.remove()}}}else{if(aK==null||aG==null){for(aF=0;aF<aJ.length;++aF){aE=aJ[aF].label;if(aE){aI.push('<div class="tickLabel">'+aE+"</div>")}}if(aI.length>0){aC=aH(aI,"");if(aK==null){aK=aC.children().width()}if(aG==null){aG=aC.find("div.tickLabel").height()}aC.remove()}}}if(aK==null){aK=0}if(aG==null){aG=0}aD.labelWidth=aK;aD.labelHeight=aG}function au(aD){var aC=aD.labelWidth,aL=aD.labelHeight,aH=aD.options.position,aF=aD.options.tickLength,aG=O.grid.axisMargin,aJ=O.grid.labelMargin,aK=aD.direction=="x"?p:aw,aE;var aB=c.grep(aK,function(aN){return aN&&aN.options.position==aH&&aN.reserveSpace});if(c.inArray(aD,aB)==aB.length-1){aG=0}if(aF==null){aF="full"}var aI=c.grep(aK,function(aN){return aN&&aN.reserveSpace});var aM=c.inArray(aD,aI)==0;if(!aM&&aF=="full"){aF=5}if(!isNaN(+aF)){aJ+=+aF}if(aD.direction=="x"){aL+=aJ;if(aH=="bottom"){q.bottom+=aL+aG;aD.box={top:I-q.bottom,height:aL}}else{aD.box={top:q.top+aG,height:aL};q.top+=aL+aG}}else{aC+=aJ;if(aH=="left"){aD.box={left:q.left+aG,width:aC};q.left+=aC+aG}else{q.right+=aC+aG;aD.box={left:G-q.right,width:aC}}}aD.position=aH;aD.tickLength=aF;aD.box.padding=aJ;aD.innermost=aM}function U(aB){if(aB.direction=="x"){aB.box.left=q.left;aB.box.width=h}else{aB.box.top=q.top;aB.box.height=w}}function t(){var aC,aE=m();c.each(aE,function(aF,aG){aG.show=aG.options.show;if(aG.show==null){aG.show=aG.used}aG.reserveSpace=aG.show||aG.options.reserveSpace;n(aG)});allocatedAxes=c.grep(aE,function(aF){return aF.reserveSpace});q.left=q.right=q.top=q.bottom=0;if(O.grid.show){c.each(allocatedAxes,function(aF,aG){S(aG);P(aG);ap(aG,aG.ticks);L(aG)});for(aC=allocatedAxes.length-1;aC>=0;--aC){au(allocatedAxes[aC])}var aD=O.grid.minBorderMargin;if(aD==null){aD=0;for(aC=0;aC<Q.length;++aC){aD=Math.max(aD,Q[aC].points.radius+Q[aC].points.lineWidth/2)}}for(var aB in q){q[aB]+=O.grid.borderWidth;q[aB]=Math.max(aD,q[aB])}}h=G-q.left-q.right;w=I-q.bottom-q.top;c.each(aE,function(aF,aG){r(aG)});if(O.grid.show){c.each(allocatedAxes,function(aF,aG){U(aG)});k()}o()}function n(aE){var aF=aE.options,aD=+(aF.min!=null?aF.min:aE.datamin),aB=+(aF.max!=null?aF.max:aE.datamax),aH=aB-aD;if(aH==0){var aC=aB==0?1:0.01;if(aF.min==null){aD-=aC}if(aF.max==null||aF.min!=null){aB+=aC}}else{var aG=aF.autoscaleMargin;if(aG!=null){if(aF.min==null){aD-=aH*aG;if(aD<0&&aE.datamin!=null&&aE.datamin>=0){aD=0}}if(aF.max==null){aB+=aH*aG;if(aB>0&&aE.datamax!=null&&aE.datamax<=0){aB=0}}}}aE.min=aD;aE.max=aB}function S(aG){var aM=aG.options;var aH;if(typeof aM.ticks=="number"&&aM.ticks>0){aH=aM.ticks}else{aH=0.3*Math.sqrt(aG.direction=="x"?G:I)}var aT=(aG.max-aG.min)/aH,aO,aB,aN,aR,aS,aQ,aI;if(aM.mode=="time"){var aJ={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var aK=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var aC=0;if(aM.minTickSize!=null){if(typeof aM.tickSize=="number"){aC=aM.tickSize}else{aC=aM.minTickSize[0]*aJ[aM.minTickSize[1]]}}for(var aS=0;aS<aK.length-1;++aS){if(aT<(aK[aS][0]*aJ[aK[aS][1]]+aK[aS+1][0]*aJ[aK[aS+1][1]])/2&&aK[aS][0]*aJ[aK[aS][1]]>=aC){break}}aO=aK[aS][0];aN=aK[aS][1];if(aN=="year"){aQ=Math.pow(10,Math.floor(Math.log(aT/aJ.year)/Math.LN10));aI=(aT/aJ.year)/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ}aG.tickSize=aM.tickSize||[aO,aN];aB=function(aX){var a2=[],a0=aX.tickSize[0],a3=aX.tickSize[1],a1=new Date(aX.min);var aW=a0*aJ[a3];if(a3=="second"){a1.setUTCSeconds(a(a1.getUTCSeconds(),a0))}if(a3=="minute"){a1.setUTCMinutes(a(a1.getUTCMinutes(),a0))}if(a3=="hour"){a1.setUTCHours(a(a1.getUTCHours(),a0))}if(a3=="month"){a1.setUTCMonth(a(a1.getUTCMonth(),a0))}if(a3=="year"){a1.setUTCFullYear(a(a1.getUTCFullYear(),a0))}a1.setUTCMilliseconds(0);if(aW>=aJ.minute){a1.setUTCSeconds(0)}if(aW>=aJ.hour){a1.setUTCMinutes(0)}if(aW>=aJ.day){a1.setUTCHours(0)}if(aW>=aJ.day*4){a1.setUTCDate(1)}if(aW>=aJ.year){a1.setUTCMonth(0)}var a5=0,a4=Number.NaN,aY;do{aY=a4;a4=a1.getTime();a2.push(a4);if(a3=="month"){if(a0<1){a1.setUTCDate(1);var aV=a1.getTime();a1.setUTCMonth(a1.getUTCMonth()+1);var aZ=a1.getTime();a1.setTime(a4+a5*aJ.hour+(aZ-aV)*a0);a5=a1.getUTCHours();a1.setUTCHours(0)}else{a1.setUTCMonth(a1.getUTCMonth()+a0)}}else{if(a3=="year"){a1.setUTCFullYear(a1.getUTCFullYear()+a0)}else{a1.setTime(a4+aW)}}}while(a4<aX.max&&a4!=aY);return a2};aR=function(aV,aY){var a0=new Date(aV);if(aM.timeformat!=null){return c.plot.formatDate(a0,aM.timeformat,aM.monthNames)}var aW=aY.tickSize[0]*aJ[aY.tickSize[1]];var aX=aY.max-aY.min;var aZ=(aM.twelveHourClock)?" %p":"";if(aW<aJ.minute){fmt="%h:%M:%S"+aZ}else{if(aW<aJ.day){if(aX<2*aJ.day){fmt="%h:%M"+aZ}else{fmt="%b %d %h:%M"+aZ}}else{if(aW<aJ.month){fmt="%b %d"}else{if(aW<aJ.year){if(aX<aJ.year){fmt="%b"}else{fmt="%b %y"}}else{fmt="%y"}}}}return c.plot.formatDate(a0,fmt,aM.monthNames)}}else{var aU=aM.tickDecimals;var aP=-Math.floor(Math.log(aT)/Math.LN10);if(aU!=null&&aP>aU){aP=aU}aQ=Math.pow(10,-aP);aI=aT/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2;if(aI>2.25&&(aU==null||aP+1<=aU)){aO=2.5;++aP}}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ;if(aM.minTickSize!=null&&aO<aM.minTickSize){aO=aM.minTickSize}aG.tickDecimals=Math.max(0,aU!=null?aU:aP);aG.tickSize=aM.tickSize||aO;aB=function(aX){var aZ=[];var a0=a(aX.min,aX.tickSize),aW=0,aV=Number.NaN,aY;do{aY=aV;aV=a0+aW*aX.tickSize;aZ.push(aV);++aW}while(aV<aX.max&&aV!=aY);return aZ};aR=function(aV,aW){return aV.toFixed(aW.tickDecimals)}}if(aM.alignTicksWithAxis!=null){var aF=(aG.direction=="x"?p:aw)[aM.alignTicksWithAxis-1];if(aF&&aF.used&&aF!=aG){var aL=aB(aG);if(aL.length>0){if(aM.min==null){aG.min=Math.min(aG.min,aL[0])}if(aM.max==null&&aL.length>1){aG.max=Math.max(aG.max,aL[aL.length-1])}}aB=function(aX){var aY=[],aV,aW;for(aW=0;aW<aF.ticks.length;++aW){aV=(aF.ticks[aW].v-aF.min)/(aF.max-aF.min);aV=aX.min+aV*(aX.max-aX.min);aY.push(aV)}return aY};if(aG.mode!="time"&&aM.tickDecimals==null){var aE=Math.max(0,-Math.floor(Math.log(aT)/Math.LN10)+1),aD=aB(aG);if(!(aD.length>1&&/\..*0$/.test((aD[1]-aD[0]).toFixed(aE)))){aG.tickDecimals=aE}}}}aG.tickGenerator=aB;if(c.isFunction(aM.tickFormatter)){aG.tickFormatter=function(aV,aW){return""+aM.tickFormatter(aV,aW)}}else{aG.tickFormatter=aR}}function P(aF){var aH=aF.options.ticks,aG=[];if(aH==null||(typeof aH=="number"&&aH>0)){aG=aF.tickGenerator(aF)}else{if(aH){if(c.isFunction(aH)){aG=aH({min:aF.min,max:aF.max})}else{aG=aH}}}var aE,aB;aF.ticks=[];for(aE=0;aE<aG.length;++aE){var aC=null;var aD=aG[aE];if(typeof aD=="object"){aB=+aD[0];if(aD.length>1){aC=aD[1]}}else{aB=+aD}if(aC==null){aC=aF.tickFormatter(aB,aF)}if(!isNaN(aB)){aF.ticks.push({v:aB,label:aC})}}}function ap(aB,aC){if(aB.options.autoscaleMargin&&aC.length>0){if(aB.options.min==null){aB.min=Math.min(aB.min,aC[0].v)}if(aB.options.max==null&&aC.length>1){aB.max=Math.max(aB.max,aC[aC.length-1].v)}}}function W(){H.clearRect(0,0,G,I);var aC=O.grid;if(aC.show&&aC.backgroundColor){N()}if(aC.show&&!aC.aboveData){ac()}for(var aB=0;aB<Q.length;++aB){an(ak.drawSeries,[H,Q[aB]]);d(Q[aB])}an(ak.draw,[H]);if(aC.show&&aC.aboveData){ac()}}function D(aB,aI){var aE,aH,aG,aD,aF=m();for(i=0;i<aF.length;++i){aE=aF[i];if(aE.direction==aI){aD=aI+aE.n+"axis";if(!aB[aD]&&aE.n==1){aD=aI+"axis"}if(aB[aD]){aH=aB[aD].from;aG=aB[aD].to;break}}}if(!aB[aD]){aE=aI=="x"?p[0]:aw[0];aH=aB[aI+"1"];aG=aB[aI+"2"]}if(aH!=null&&aG!=null&&aH>aG){var aC=aH;aH=aG;aG=aC}return{from:aH,to:aG,axis:aE}}function N(){H.save();H.translate(q.left,q.top);H.fillStyle=am(O.grid.backgroundColor,w,0,"rgba(255, 255, 255, 0)");H.fillRect(0,0,h,w);H.restore()}function ac(){var aF;H.save();H.translate(q.left,q.top);var aH=O.grid.markings;if(aH){if(c.isFunction(aH)){var aK=aq.getAxes();aK.xmin=aK.xaxis.min;aK.xmax=aK.xaxis.max;aK.ymin=aK.yaxis.min;aK.ymax=aK.yaxis.max;aH=aH(aK)}for(aF=0;aF<aH.length;++aF){var aD=aH[aF],aC=D(aD,"x"),aI=D(aD,"y");if(aC.from==null){aC.from=aC.axis.min}if(aC.to==null){aC.to=aC.axis.max}if(aI.from==null){aI.from=aI.axis.min}if(aI.to==null){aI.to=aI.axis.max}if(aC.to<aC.axis.min||aC.from>aC.axis.max||aI.to<aI.axis.min||aI.from>aI.axis.max){continue}aC.from=Math.max(aC.from,aC.axis.min);aC.to=Math.min(aC.to,aC.axis.max);aI.from=Math.max(aI.from,aI.axis.min);aI.to=Math.min(aI.to,aI.axis.max);if(aC.from==aC.to&&aI.from==aI.to){continue}aC.from=aC.axis.p2c(aC.from);aC.to=aC.axis.p2c(aC.to);aI.from=aI.axis.p2c(aI.from);aI.to=aI.axis.p2c(aI.to);if(aC.from==aC.to||aI.from==aI.to){H.beginPath();H.strokeStyle=aD.color||O.grid.markingsColor;H.lineWidth=aD.lineWidth||O.grid.markingsLineWidth;H.moveTo(aC.from,aI.from);H.lineTo(aC.to,aI.to);H.stroke()}else{H.fillStyle=aD.color||O.grid.markingsColor;H.fillRect(aC.from,aI.to,aC.to-aC.from,aI.from-aI.to)}}}var aK=m(),aM=O.grid.borderWidth;for(var aE=0;aE<aK.length;++aE){var aB=aK[aE],aG=aB.box,aQ=aB.tickLength,aN,aL,aP,aJ;if(!aB.show||aB.ticks.length==0){continue}H.strokeStyle=aB.options.tickColor||c.color.parse(aB.options.color).scale("a",0.22).toString();H.lineWidth=1;if(aB.direction=="x"){aN=0;if(aQ=="full"){aL=(aB.position=="top"?0:w)}else{aL=aG.top-q.top+(aB.position=="top"?aG.height:0)}}else{aL=0;if(aQ=="full"){aN=(aB.position=="left"?0:h)}else{aN=aG.left-q.left+(aB.position=="left"?aG.width:0)}}if(!aB.innermost){H.beginPath();aP=aJ=0;if(aB.direction=="x"){aP=h}else{aJ=w}if(H.lineWidth==1){aN=Math.floor(aN)+0.5;aL=Math.floor(aL)+0.5}H.moveTo(aN,aL);H.lineTo(aN+aP,aL+aJ);H.stroke()}H.beginPath();for(aF=0;aF<aB.ticks.length;++aF){var aO=aB.ticks[aF].v;aP=aJ=0;if(aO<aB.min||aO>aB.max||(aQ=="full"&&aM>0&&(aO==aB.min||aO==aB.max))){continue}if(aB.direction=="x"){aN=aB.p2c(aO);aJ=aQ=="full"?-w:aQ;if(aB.position=="top"){aJ=-aJ}}else{aL=aB.p2c(aO);aP=aQ=="full"?-h:aQ;if(aB.position=="left"){aP=-aP}}if(H.lineWidth==1){if(aB.direction=="x"){aN=Math.floor(aN)+0.5}else{aL=Math.floor(aL)+0.5}}H.moveTo(aN,aL);H.lineTo(aN+aP,aL+aJ)}H.stroke()}if(aM){H.lineWidth=aM;H.strokeStyle=O.grid.borderColor;H.strokeRect(-aM/2,-aM/2,h+aM,w+aM)}H.restore()}function k(){av.find(".tickLabels").remove();var aG=['<div class="tickLabels" style="font-size:smaller">'];var aJ=m();for(var aD=0;aD<aJ.length;++aD){var aC=aJ[aD],aF=aC.box;if(!aC.show){continue}aG.push('<div class="'+aC.direction+"Axis "+aC.direction+aC.n+'Axis" style="color:'+aC.options.color+'">');for(var aE=0;aE<aC.ticks.length;++aE){var aH=aC.ticks[aE];if(!aH.label||aH.v<aC.min||aH.v>aC.max){continue}var aK={},aI;if(aC.direction=="x"){aI="center";aK.left=Math.round(q.left+aC.p2c(aH.v)-aC.labelWidth/2);if(aC.position=="bottom"){aK.top=aF.top+aF.padding}else{aK.bottom=I-(aF.top+aF.height-aF.padding)}}else{aK.top=Math.round(q.top+aC.p2c(aH.v)-aC.labelHeight/2);if(aC.position=="left"){aK.right=G-(aF.left+aF.width-aF.padding);aI="right"}else{aK.left=aF.left+aF.padding;aI="left"}}aK.width=aC.labelWidth;var aB=["position:absolute","text-align:"+aI];for(var aL in aK){aB.push(aL+":"+aK[aL]+"px")}aG.push('<div class="tickLabel" style="'+aB.join(";")+'">'+aH.label+"</div>")}aG.push("</div>")}aG.push("</div>");av.append(aG.join(""))}function d(aB){if(aB.lines.show){at(aB)}if(aB.bars.show){e(aB)}if(aB.points.show){ao(aB)}}function at(aE){function aD(aP,aQ,aI,aU,aT){var aV=aP.points,aJ=aP.pointsize,aN=null,aM=null;H.beginPath();for(var aO=aJ;aO<aV.length;aO+=aJ){var aL=aV[aO-aJ],aS=aV[aO-aJ+1],aK=aV[aO],aR=aV[aO+1];if(aL==null||aK==null){continue}if(aS<=aR&&aS<aT.min){if(aR<aT.min){continue}aL=(aT.min-aS)/(aR-aS)*(aK-aL)+aL;aS=aT.min}else{if(aR<=aS&&aR<aT.min){if(aS<aT.min){continue}aK=(aT.min-aS)/(aR-aS)*(aK-aL)+aL;aR=aT.min}}if(aS>=aR&&aS>aT.max){if(aR>aT.max){continue}aL=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aS=aT.max}else{if(aR>=aS&&aR>aT.max){if(aS>aT.max){continue}aK=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aR=aT.max}}if(aL<=aK&&aL<aU.min){if(aK<aU.min){continue}aS=(aU.min-aL)/(aK-aL)*(aR-aS)+aS;aL=aU.min}else{if(aK<=aL&&aK<aU.min){if(aL<aU.min){continue}aR=(aU.min-aL)/(aK-aL)*(aR-aS)+aS;aK=aU.min}}if(aL>=aK&&aL>aU.max){if(aK>aU.max){continue}aS=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aL=aU.max}else{if(aK>=aL&&aK>aU.max){if(aL>aU.max){continue}aR=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aK=aU.max}}if(aL!=aN||aS!=aM){H.moveTo(aU.p2c(aL)+aQ,aT.p2c(aS)+aI)}aN=aK;aM=aR;H.lineTo(aU.p2c(aK)+aQ,aT.p2c(aR)+aI)}H.stroke()}function aF(aI,aQ,aP){var aW=aI.points,aV=aI.pointsize,aN=Math.min(Math.max(0,aP.min),aP.max),aX=0,aU,aT=false,aM=1,aL=0,aR=0;while(true){if(aV>0&&aX>aW.length+aV){break}aX+=aV;var aZ=aW[aX-aV],aK=aW[aX-aV+aM],aY=aW[aX],aJ=aW[aX+aM];if(aT){if(aV>0&&aZ!=null&&aY==null){aR=aX;aV=-aV;aM=2;continue}if(aV<0&&aX==aL+aV){H.fill();aT=false;aV=-aV;aM=1;aX=aL=aR+aV;continue}}if(aZ==null||aY==null){continue}if(aZ<=aY&&aZ<aQ.min){if(aY<aQ.min){continue}aK=(aQ.min-aZ)/(aY-aZ)*(aJ-aK)+aK;aZ=aQ.min}else{if(aY<=aZ&&aY<aQ.min){if(aZ<aQ.min){continue}aJ=(aQ.min-aZ)/(aY-aZ)*(aJ-aK)+aK;aY=aQ.min}}if(aZ>=aY&&aZ>aQ.max){if(aY>aQ.max){continue}aK=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aZ=aQ.max}else{if(aY>=aZ&&aY>aQ.max){if(aZ>aQ.max){continue}aJ=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aY=aQ.max}}if(!aT){H.beginPath();H.moveTo(aQ.p2c(aZ),aP.p2c(aN));aT=true}if(aK>=aP.max&&aJ>=aP.max){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.max));H.lineTo(aQ.p2c(aY),aP.p2c(aP.max));continue}else{if(aK<=aP.min&&aJ<=aP.min){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.min));H.lineTo(aQ.p2c(aY),aP.p2c(aP.min));continue}}var aO=aZ,aS=aY;if(aK<=aJ&&aK<aP.min&&aJ>=aP.min){aZ=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.min}else{if(aJ<=aK&&aJ<aP.min&&aK>=aP.min){aY=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.min}}if(aK>=aJ&&aK>aP.max&&aJ<=aP.max){aZ=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.max}else{if(aJ>=aK&&aJ>aP.max&&aK<=aP.max){aY=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.max}}if(aZ!=aO){H.lineTo(aQ.p2c(aO),aP.p2c(aK))}H.lineTo(aQ.p2c(aZ),aP.p2c(aK));H.lineTo(aQ.p2c(aY),aP.p2c(aJ));if(aY!=aS){H.lineTo(aQ.p2c(aY),aP.p2c(aJ));H.lineTo(aQ.p2c(aS),aP.p2c(aJ))}}}H.save();H.translate(q.left,q.top);H.lineJoin="round";var aG=aE.lines.lineWidth,aB=aE.shadowSize;if(aG>0&&aB>0){H.lineWidth=aB;H.strokeStyle="rgba(0,0,0,0.1)";var aH=Math.PI/18;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/2),Math.cos(aH)*(aG/2+aB/2),aE.xaxis,aE.yaxis);H.lineWidth=aB/2;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/4),Math.cos(aH)*(aG/2+aB/4),aE.xaxis,aE.yaxis)}H.lineWidth=aG;H.strokeStyle=aE.color;var aC=ae(aE.lines,aE.color,0,w);if(aC){H.fillStyle=aC;aF(aE.datapoints,aE.xaxis,aE.yaxis)}if(aG>0){aD(aE.datapoints,0,0,aE.xaxis,aE.yaxis)}H.restore()}function ao(aE){function aH(aN,aM,aU,aK,aS,aT,aQ,aJ){var aR=aN.points,aI=aN.pointsize;for(var aL=0;aL<aR.length;aL+=aI){var aP=aR[aL],aO=aR[aL+1];if(aP==null||aP<aT.min||aP>aT.max||aO<aQ.min||aO>aQ.max){continue}H.beginPath();aP=aT.p2c(aP);aO=aQ.p2c(aO)+aK;if(aJ=="circle"){H.arc(aP,aO,aM,0,aS?Math.PI:Math.PI*2,false)}else{aJ(H,aP,aO,aM,aS)}H.closePath();if(aU){H.fillStyle=aU;H.fill()}H.stroke()}}H.save();H.translate(q.left,q.top);var aG=aE.points.lineWidth,aC=aE.shadowSize,aB=aE.points.radius,aF=aE.points.symbol;if(aG>0&&aC>0){var aD=aC/2;H.lineWidth=aD;H.strokeStyle="rgba(0,0,0,0.1)";aH(aE.datapoints,aB,null,aD+aD/2,true,aE.xaxis,aE.yaxis,aF);H.strokeStyle="rgba(0,0,0,0.2)";aH(aE.datapoints,aB,null,aD/2,true,aE.xaxis,aE.yaxis,aF)}H.lineWidth=aG;H.strokeStyle=aE.color;aH(aE.datapoints,aB,ae(aE.points,aE.color),0,false,aE.xaxis,aE.yaxis,aF);H.restore()}function E(aN,aM,aV,aI,aQ,aF,aD,aL,aK,aU,aR,aC){var aE,aT,aJ,aP,aG,aB,aO,aH,aS;if(aR){aH=aB=aO=true;aG=false;aE=aV;aT=aN;aP=aM+aI;aJ=aM+aQ;if(aT<aE){aS=aT;aT=aE;aE=aS;aG=true;aB=false}}else{aG=aB=aO=true;aH=false;aE=aN+aI;aT=aN+aQ;aJ=aV;aP=aM;if(aP<aJ){aS=aP;aP=aJ;aJ=aS;aH=true;aO=false}}if(aT<aL.min||aE>aL.max||aP<aK.min||aJ>aK.max){return}if(aE<aL.min){aE=aL.min;aG=false}if(aT>aL.max){aT=aL.max;aB=false}if(aJ<aK.min){aJ=aK.min;aH=false}if(aP>aK.max){aP=aK.max;aO=false}aE=aL.p2c(aE);aJ=aK.p2c(aJ);aT=aL.p2c(aT);aP=aK.p2c(aP);if(aD){aU.beginPath();aU.moveTo(aE,aJ);aU.lineTo(aE,aP);aU.lineTo(aT,aP);aU.lineTo(aT,aJ);aU.fillStyle=aD(aJ,aP);aU.fill()}if(aC>0&&(aG||aB||aO||aH)){aU.beginPath();aU.moveTo(aE,aJ+aF);if(aG){aU.lineTo(aE,aP+aF)}else{aU.moveTo(aE,aP+aF)}if(aO){aU.lineTo(aT,aP+aF)}else{aU.moveTo(aT,aP+aF)}if(aB){aU.lineTo(aT,aJ+aF)}else{aU.moveTo(aT,aJ+aF)}if(aH){aU.lineTo(aE,aJ+aF)}else{aU.moveTo(aE,aJ+aF)}aU.stroke()}}function e(aD){function aC(aJ,aI,aL,aG,aK,aN,aM){var aO=aJ.points,aF=aJ.pointsize;for(var aH=0;aH<aO.length;aH+=aF){if(aO[aH]==null){continue}E(aO[aH],aO[aH+1],aO[aH+2],aI,aL,aG,aK,aN,aM,H,aD.bars.horizontal,aD.bars.lineWidth)}}H.save();H.translate(q.left,q.top);H.lineWidth=aD.bars.lineWidth;H.strokeStyle=aD.color;var aB=aD.bars.align=="left"?0:-aD.bars.barWidth/2;var aE=aD.bars.fill?function(aF,aG){return ae(aD.bars,aD.color,aF,aG)}:null;aC(aD.datapoints,aB,aB+aD.bars.barWidth,0,aE,aD.xaxis,aD.yaxis);H.restore()}function ae(aD,aB,aC,aF){var aE=aD.fill;if(!aE){return null}if(aD.fillColor){return am(aD.fillColor,aC,aF,aB)}var aG=c.color.parse(aB);aG.a=typeof aE=="number"?aE:0.4;aG.normalize();return aG.toString()}function o(){av.find(".legend").remove();if(!O.legend.show){return}var aH=[],aF=false,aN=O.legend.labelFormatter,aM,aJ;for(var aE=0;aE<Q.length;++aE){aM=Q[aE];aJ=aM.label;if(!aJ){continue}if(aE%O.legend.noColumns==0){if(aF){aH.push("</tr>")}aH.push("<tr>");aF=true}if(aN){aJ=aN(aJ,aM)}aH.push('<td class="legendColorBox"><div style="border:1px solid '+O.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+aM.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+aJ+"</td>")}if(aF){aH.push("</tr>")}if(aH.length==0){return}var aL='<table style="font-size:smaller;color:'+O.grid.color+'">'+aH.join("")+"</table>";if(O.legend.container!=null){c(O.legend.container).html(aL)}else{var aI="",aC=O.legend.position,aD=O.legend.margin;if(aD[0]==null){aD=[aD,aD]}if(aC.charAt(0)=="n"){aI+="top:"+(aD[1]+q.top)+"px;"}else{if(aC.charAt(0)=="s"){aI+="bottom:"+(aD[1]+q.bottom)+"px;"}}if(aC.charAt(1)=="e"){aI+="right:"+(aD[0]+q.right)+"px;"}else{if(aC.charAt(1)=="w"){aI+="left:"+(aD[0]+q.left)+"px;"}}var aK=c('<div class="legend">'+aL.replace('style="','style="position:absolute;'+aI+";")+"</div>").appendTo(av);if(O.legend.backgroundOpacity!=0){var aG=O.legend.backgroundColor;if(aG==null){aG=O.grid.backgroundColor;if(aG&&typeof aG=="string"){aG=c.color.parse(aG)}else{aG=c.color.extract(aK,"background-color")}aG.a=1;aG=aG.toString()}var aB=aK.children();c('<div style="position:absolute;width:'+aB.width()+"px;height:"+aB.height()+"px;"+aI+"background-color:"+aG+';"> </div>').prependTo(aK).css("opacity",O.legend.backgroundOpacity)}}}var ab=[],M=null;function K(aI,aG,aD){var aO=O.grid.mouseActiveRadius,a0=aO*aO+1,aY=null,aR=false,aW,aU;for(aW=Q.length-1;aW>=0;--aW){if(!aD(Q[aW])){continue}var aP=Q[aW],aH=aP.xaxis,aF=aP.yaxis,aV=aP.datapoints.points,aT=aP.datapoints.pointsize,aQ=aH.c2p(aI),aN=aF.c2p(aG),aC=aO/aH.scale,aB=aO/aF.scale;if(aH.options.inverseTransform){aC=Number.MAX_VALUE}if(aF.options.inverseTransform){aB=Number.MAX_VALUE}if(aP.lines.show||aP.points.show){for(aU=0;aU<aV.length;aU+=aT){var aK=aV[aU],aJ=aV[aU+1];if(aK==null){continue}if(aK-aQ>aC||aK-aQ<-aC||aJ-aN>aB||aJ-aN<-aB){continue}var aM=Math.abs(aH.p2c(aK)-aI),aL=Math.abs(aF.p2c(aJ)-aG),aS=aM*aM+aL*aL;if(aS<a0){a0=aS;aY=[aW,aU/aT]}}}if(aP.bars.show&&!aY){var aE=aP.bars.align=="left"?0:-aP.bars.barWidth/2,aX=aE+aP.bars.barWidth;for(aU=0;aU<aV.length;aU+=aT){var aK=aV[aU],aJ=aV[aU+1],aZ=aV[aU+2];if(aK==null){continue}if(Q[aW].bars.horizontal?(aQ<=Math.max(aZ,aK)&&aQ>=Math.min(aZ,aK)&&aN>=aJ+aE&&aN<=aJ+aX):(aQ>=aK+aE&&aQ<=aK+aX&&aN>=Math.min(aZ,aJ)&&aN<=Math.max(aZ,aJ))){aY=[aW,aU/aT]}}}}if(aY){aW=aY[0];aU=aY[1];aT=Q[aW].datapoints.pointsize;return{datapoint:Q[aW].datapoints.points.slice(aU*aT,(aU+1)*aT),dataIndex:aU,series:Q[aW],seriesIndex:aW}}return null}function aa(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return aC.hoverable!=false})}}function l(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return false})}}function R(aB){u("plotclick",aB,function(aC){return aC.clickable!=false})}function u(aC,aB,aD){var aE=y.offset(),aH=aB.pageX-aE.left-q.left,aF=aB.pageY-aE.top-q.top,aJ=C({left:aH,top:aF});aJ.pageX=aB.pageX;aJ.pageY=aB.pageY;var aK=K(aH,aF,aD);if(aK){aK.pageX=parseInt(aK.series.xaxis.p2c(aK.datapoint[0])+aE.left+q.left);aK.pageY=parseInt(aK.series.yaxis.p2c(aK.datapoint[1])+aE.top+q.top)}if(O.grid.autoHighlight){for(var aG=0;aG<ab.length;++aG){var aI=ab[aG];if(aI.auto==aC&&!(aK&&aI.series==aK.series&&aI.point[0]==aK.datapoint[0]&&aI.point[1]==aK.datapoint[1])){T(aI.series,aI.point)}}if(aK){x(aK.series,aK.datapoint,aC)}}av.trigger(aC,[aJ,aK])}function f(){if(!M){M=setTimeout(s,30)}}function s(){M=null;A.save();A.clearRect(0,0,G,I);A.translate(q.left,q.top);var aC,aB;for(aC=0;aC<ab.length;++aC){aB=ab[aC];if(aB.series.bars.show){v(aB.series,aB.point)}else{ay(aB.series,aB.point)}}A.restore();an(ak.drawOverlay,[A])}function x(aD,aB,aF){if(typeof aD=="number"){aD=Q[aD]}if(typeof aB=="number"){var aE=aD.datapoints.pointsize;aB=aD.datapoints.points.slice(aE*aB,aE*(aB+1))}var aC=al(aD,aB);if(aC==-1){ab.push({series:aD,point:aB,auto:aF});f()}else{if(!aF){ab[aC].auto=false}}}function T(aD,aB){if(aD==null&&aB==null){ab=[];f()}if(typeof aD=="number"){aD=Q[aD]}if(typeof aB=="number"){aB=aD.data[aB]}var aC=al(aD,aB);if(aC!=-1){ab.splice(aC,1);f()}}function al(aD,aE){for(var aB=0;aB<ab.length;++aB){var aC=ab[aB];if(aC.series==aD&&aC.point[0]==aE[0]&&aC.point[1]==aE[1]){return aB}}return -1}function ay(aE,aD){var aC=aD[0],aI=aD[1],aH=aE.xaxis,aG=aE.yaxis;if(aC<aH.min||aC>aH.max||aI<aG.min||aI>aG.max){return}var aF=aE.points.radius+aE.points.lineWidth/2;A.lineWidth=aF;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aB=1.5*aF,aC=aH.p2c(aC),aI=aG.p2c(aI);A.beginPath();if(aE.points.symbol=="circle"){A.arc(aC,aI,aB,0,2*Math.PI,false)}else{aE.points.symbol(A,aC,aI,aB,false)}A.closePath();A.stroke()}function v(aE,aB){A.lineWidth=aE.bars.lineWidth;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aD=c.color.parse(aE.color).scale("a",0.5).toString();var aC=aE.bars.align=="left"?0:-aE.bars.barWidth/2;E(aB[0],aB[1],aB[2]||0,aC,aC+aE.bars.barWidth,0,function(){return aD},aE.xaxis,aE.yaxis,A,aE.bars.horizontal,aE.bars.lineWidth)}function am(aJ,aB,aH,aC){if(typeof aJ=="string"){return aJ}else{var aI=H.createLinearGradient(0,aH,0,aB);for(var aE=0,aD=aJ.colors.length;aE<aD;++aE){var aF=aJ.colors[aE];if(typeof aF!="string"){var aG=c.color.parse(aC);if(aF.brightness!=null){aG=aG.scale("rgb",aF.brightness)}if(aF.opacity!=null){aG.a*=aF.opacity}aF=aG.toString()}aI.addColorStop(aE/(aD-1),aF)}return aI}}}c.plot=function(g,e,d){var f=new b(c(g),e,d,c.plot.plugins);return f};c.plot.version="0.7";c.plot.plugins=[];c.plot.formatDate=function(l,f,h){var o=function(d){d=""+d;return d.length==1?"0"+d:d};var e=[];var p=false,j=false;var n=l.getUTCHours();var k=n<12;if(h==null){h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}if(f.search(/%p|%P/)!=-1){if(n>12){n=n-12}else{if(n==0){n=12}}}for(var g=0;g<f.length;++g){var m=f.charAt(g);if(p){switch(m){case"h":m=""+n;break;case"H":m=o(n);break;case"M":m=o(l.getUTCMinutes());break;case"S":m=o(l.getUTCSeconds());break;case"d":m=""+l.getUTCDate();break;case"m":m=""+(l.getUTCMonth()+1);break;case"y":m=""+l.getUTCFullYear();break;case"b":m=""+h[l.getUTCMonth()];break;case"p":m=(k)?("am"):("pm");break;case"P":m=(k)?("AM"):("PM");break;case"0":m="";j=true;break}if(m&&j){m=o(m);j=false}e.push(m);if(!j){p=false}}else{if(m=="%"){p=true}else{e.push(m)}}}return e.join("")};function a(e,d){return d*Math.floor(e/d)}})(jQuery);
File: public/js/goal-model-templates.js
Match lines: 1
13| .normalize('NFD')
File: public/js/goals-common-form.js
Match lines: 1
238| .normalize('NFD')
File: public/js/goals-company-offcanvas.js
Match lines: 1
79| .normalize('NFD')
File: public/js/highcharts/highcharts.js
Match lines: 6
143|null},hideCrosshairs:function(){n(this.crosshairs,function(a){a&&a.hide()})},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,i,a=ja(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===w&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(n(a,function(a){i=a.series.yAxis;g+=a.plotX;h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:
154|g=f.length,h=b.lastValidTouch,i=b.zoomHor||b.pinchHor,j=b.zoomVert||b.pinchVert,k=i||j,l=b.selectionMarker,m={},p=g===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),q={};(k||e)&&!p&&a.preventDefault();Na(f,function(a){return b.normalize(a)});if(a.type==="touchstart")n(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],n(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],
155|d=a.minPixelPadding,e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=I(e,f),e=s(e,f);b.min=I(a.pos,g-d);b.max=s(a.pos+a.len,e+d)}});else if(d.length){if(!l)b.selectionMarker=l=r({destroy:pa},c.plotBox);i&&b.pinchTranslateDirection(!0,d,f,m,l,q,h);j&&b.pinchTranslateDirection(!1,d,f,m,l,q,h);b.hasPinched=k;b.scaleGroups(m,q);!k&&e&&g===1&&this.runPointActions(b.normalize(a))}},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=
159|this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){this.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){this.reset();this.chartPosition=null},onContainerMouseMove:function(a){var b=this.chart,a=this.normalize(a);a.returnValue=
161|onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,f=b.inverted,g,h,i,a=this.normalize(a);a.cancelBubble=!0;if(!b.cancelClick)c&&this.inClass(a.target,"highcharts-tracker")?(g=this.chartPosition,h=c.plotX,i=c.plotY,r(c,{pageX:g.left+d+(f?b.plotWidth-i:h),pageY:g.top+e+(f?b.plotHeight-h:i)}),z(c.series,"click",r(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(r(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&z(b,"click",a))},onContainerTouchStart:function(a){var b=
162|this.chart;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){this.drop(a)},setDOMEvents:function(){var a=this,b=a.chart.container,c;this._events=c=[[b,"onmousedown","onContainerMouseDown"],[b,"onmousemove","onContainerMouseMove"],[b,"onclick",
File: public/js/highcharts/highcharts.src.js
Match lines: 8
8731| mouseEvent = chart.pointer.normalize(mouseEvent);
9376| return self.normalize(e);
9430| this.runPointActions(self.normalize(e));
9595| e = this.normalize(e);
9620| e = this.normalize(e, chartPosition);
9643| e = this.normalize(e);
9697| e = this.normalize(e);
9745| e = this.normalize(e);
File: public/js/highcharts/modules/canvas-tools.src.js
Match lines: 2
2625| function normalize(mask) {
2668| mask = normalize(mask);
File: public/js/highcharts/modules/map.js
Match lines: 2
11|(e.len-c)/2});t(y.prototype,"render",function(a){var b=this,c=b.options.mapNavigation;a.call(b);b.renderMapNavigation();c.zoomOnDoubleClick&&g.addEvent(b.container,"dblclick",function(a){b.pointer.onContainerDblClick(a)});c.zoomOnMouseWheel&&g.addEvent(b.container,document.onmousewheel===void 0?"DOMMouseScroll":"mousewheel",function(a){b.pointer.onContainerMouseWheel(a)})});v(z.prototype,{onContainerDblClick:function(a){var b=this.chart,a=this.normalize(a);b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-
12|b.plotTop)&&b.mapZoom(0.5,b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY))},onContainerMouseWheel:function(a){var b=this.chart,c,a=this.normalize(a);c=a.detail||-(a.wheelDelta/120);b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&b.mapZoom(c>0?2:0.5,b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY))}});t(z.prototype,"init",function(a,b,c){a.call(this,b,c);if(c.mapNavigation.enableTouchZoom)this.pinchX=this.pinchHor=this.pinchY=this.pinchVert=!0});v(y.prototype,{renderMapNavigation:function(){var a=
File: public/js/highcharts/modules/map.src.js
Match lines: 2
219| e = this.normalize(e);
237| e = this.normalize(e);
File: public/js/highcharts/vendor/highcharts-more.js
Match lines: 1
7| */function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/highcharts-more",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(e,i,s,o){e.hasOwnProperty(i)||(e[i]=o.apply(null,s),"function"==typeof CustomEvent&&t.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:e[i]}})))}i(e,"Extensions/Pane/PaneComposition.js",[e["Core/Utilities.js"]],function(t){let{addEvent:e,correctFloat:i,defined:s,pick:o}=t;function a(t){let e;let i=this;return t&&i.pane.forEach(s=>{r(t.chartX-i.plotLeft,t.chartY-i.plotTop,s.center)&&(e=s)}),e}function r(t,e,o,a,r){let n=!0,l=o[0],h=o[1],p=Math.sqrt(Math.pow(t-l,2)+Math.pow(e-h,2));if(s(a)&&s(r)){let s=Math.atan2(i(e-h,8),i(t-l,8));r!==a&&(n=a>r?s>=a&&s<=Math.PI||s<=r&&s>=-Math.PI:s>=a&&s<=i(r,8))}return p<=Math.ceil(o[2]/2)&&n}function n(t){this.polar&&(t.options.inverted&&([t.x,t.y]=[t.y,t.x]),t.isInsidePlot=this.pane.some(e=>r(t.x,t.y,e.center,e.axis&&e.axis.normalizedStartAngleRad,e.axis&&e.axis.normalizedEndAngleRad)))}function l(t){let e=this.chart;t.hoverPoint&&t.hoverPoint.plotX&&t.hoverPoint.plotY&&e.hoverPane&&!r(t.hoverPoint.plotX,t.hoverPoint.plotY,e.hoverPane.center)&&(t.hoverPoint=void 0)}function h(t){let e=this.chart;e.polar?(e.hoverPane=e.getHoverPane(t),t.filter=function(i){return i.visible&&!(!t.shared&&i.directTouch)&&o(i.options.enableMouseTracking,!0)&&(!e.hoverPane||i.xAxis.pane===e.hoverPane)}):e.hoverPane=void 0}return{compose:function(t,i){let s=t.prototype;s.getHoverPane||(s.collectionsWithUpdate.push("pane"),s.getHoverPane=a,e(t,"afterIsInsidePlot",n),e(i,"afterGetHoverData",l),e(i,"beforeGetHoverData",h))}}}),i(e,"Extensions/Pane/PaneDefaults.js",[],function(){return{pane:{center:["50%","50%"],size:"85%",innerSize:"0%",startAngle:0},background:{shape:"circle",borderRadius:0,borderWidth:1,borderColor:"#cccccc",backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#ffffff"],[1,"#e6e6e6"]]},from:-Number.MAX_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}}}),i(e,"Extensions/Pane/Pane.js",[e["Series/CenteredUtilities.js"],e["Extensions/Pane/PaneComposition.js"],e["Extensions/Pane/PaneDefaults.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{extend:o,merge:a,splat:r}=s;class n{constructor(t,e){this.coll="pane",this.init(t,e)}init(t,e){this.chart=e,this.background=[],e.pane.push(this),this.setOptions(t)}setOptions(t){this.options=t=a(i.pane,this.chart.angular?{background:{}}:void 0,t)}render(){let t=this.options,e=this.chart.renderer;this.group||(this.group=e.g("pane-group").attr({zIndex:t.zIndex||0}).add()),this.updateCenter();let s=this.options.background;if(s){let t=Math.max((s=r(s)).length,this.background.length||0);for(let e=0;e<t;e++)s[e]&&this.axis?this.renderBackground(a(i.background,s[e]),e):this.background[e]&&(this.background[e]=this.background[e].destroy(),this.background.splice(e,1))}}renderBackground(t,e){let i={class:"highcharts-pane "+(t.className||"")},s="animate";this.chart.styledMode||o(i,{fill:t.backgroundColor,stroke:t.borderColor,"stroke-width":t.borderWidth}),this.background[e]||(this.background[e]=this.chart.renderer.path().add(this.group),s="attr"),this.background[e][s]({d:this.axis.getPlotBandPath(t.from,t.to,t)}).attr(i)}updateCenter(e){this.center=(e||this.axis||{}).center=t.getCenter.call(this)}update(t,e){a(!0,this.options,t),this.setOptions(this.options),this.render(),this.chart.axes.forEach(function(t){t.pane===this&&(t.pane=null,t.update({},e))},this)}}return n.compose=e.compose,n}),i(e,"Series/AreaRange/AreaRangePoint.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){let{area:{prototype:{pointClass:i,pointClass:{prototype:s}}}}=t.seriesTypes,{defined:o,isNumber:a}=e;return class extends i{setState(){let t=this.state,e=this.series,i=e.chart.polar;o(this.plotHigh)||(this.plotHigh=e.yAxis.toPixels(this.high,!0)),o(this.plotLow)||(this.plotLow=this.plotY=e.yAxis.toPixels(this.low,!0)),e.lowerStateMarkerGraphic=e.stateMarkerGraphic,e.stateMarkerGraphic=e.upperStateMarkerGraphic,this.graphic=this.graphics&&this.graphics[1],this.plotY=this.plotHigh,i&&a(this.plotHighX)&&(this.plotX=this.plotHighX),s.setState.apply(this,arguments),this.state=t,this.plotY=this.plotLow,this.graphic=this.graphics&&this.graphics[0],i&&a(this.plotLowX)&&(this.plotX=this.plotLowX),e.upperStateMarkerGraphic=e.stateMarkerGraphic,e.stateMarkerGraphic=e.lowerStateMarkerGraphic,e.lowerStateMarkerGraphic=void 0;let r=e.modifyMarkerSettings();s.setState.apply(this,arguments),e.restoreMarkerSettings(r)}haloPath(){let t=this.series.chart.polar,e=[];return this.plotY=this.plotLow,t&&a(this.plotLowX)&&(this.plotX=this.plotLowX),this.isInside&&(e=s.haloPath.apply(this,arguments)),this.plotY=this.plotHigh,t&&a(this.plotHighX)&&(this.plotX=this.plotHighX),this.isTopInside&&(e=e.concat(s.haloPath.apply(this,arguments))),e}isValid(){return a(this.low)&&a(this.high)}}}),i(e,"Series/AreaRange/AreaRangeSeries.js",[e["Series/AreaRange/AreaRangePoint.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{noop:o}=e,{area:a,area:{prototype:r},column:{prototype:n}}=i.seriesTypes,{addEvent:l,defined:h,extend:p,isArray:d,isNumber:c,pick:u,merge:g}=s;class f extends a{toYData(t){return[t.low,t.high]}highToXY(t){let e=this.chart,i=this.xAxis.postTranslate(t.rectPlotX||0,this.yAxis.len-(t.plotHigh||0));t.plotHighX=i.x-e.plotLeft,t.plotHigh=i.y-e.plotTop,t.plotLowX=t.plotX}getGraphPath(t){let e=[],i=[],s=r.getGraphPath,o=this.options,a=this.chart.polar,n=a&&!1!==o.connectEnds,l=o.connectNulls,h,p,d,c=o.step;for(h=(t=t||this.points).length;h--;){p=t[h];let s=a?{plotX:p.rectPlotX,plotY:p.yBottom,doCurve:!1}:{plotX:p.plotX,plotY:p.plotY,doCurve:!1};p.isNull||n||l||t[h+1]&&!t[h+1].isNull||i.push(s),d={polarPlotY:p.polarPlotY,rectPlotX:p.rectPlotX,yBottom:p.yBottom,plotX:u(p.plotHighX,p.plotX),plotY:p.plotHigh,isNull:p.isNull},i.push(d),e.push(d),p.isNull||n||l||t[h-1]&&!t[h-1].isNull||i.push(s)}let g=s.call(this,t);c&&(!0===c&&(c="left"),o.step=({left:"right",center:"center",right:"left"})[c]);let f=s.call(this,e),b=s.call(this,i);o.step=c;let m=[].concat(g,f);return!this.chart.polar&&b[0]&&"M"===b[0][0]&&(b[0]=["L",b[0][1],b[0][2]]),this.graphPath=m,this.areaPath=g.concat(b),m.isArea=!0,m.xMap=g.xMap,this.areaPath.xMap=g.xMap,m}drawDataLabels(){let t,e,i,s,o;let a=this.points,n=a.length,l=[],h=this.options.dataLabels,c=this.chart.inverted;if(h){if(d(h)?(s=h[0]||{enabled:!1},o=h[1]||{enabled:!1}):((s=p({},h)).x=h.xHigh,s.y=h.yHigh,(o=p({},h)).x=h.xLow,o.y=h.yLow),s.enabled||this.hasDataLabels?.()){for(t=n;t--;)if(e=a[t]){let{plotHigh:o=0,plotLow:a=0}=e;i=s.inside?o<a:o>a,e.y=e.high,e._plotY=e.plotY,e.plotY=o,l[t]=e.dataLabel,e.dataLabel=e.dataLabelUpper,e.below=i,c?s.align||(s.align=i?"right":"left"):s.verticalAlign||(s.verticalAlign=i?"top":"bottom")}for(this.options.dataLabels=s,r.drawDataLabels&&r.drawDataLabels.apply(this,arguments),t=n;t--;)(e=a[t])&&(e.dataLabelUpper=e.dataLabel,e.dataLabel=l[t],delete e.dataLabels,e.y=e.low,e.plotY=e._plotY)}if(o.enabled||this.hasDataLabels?.()){for(t=n;t--;)if(e=a[t]){let{plotHigh:t=0,plotLow:s=0}=e;i=o.inside?t<s:t>s,e.below=!i,c?o.align||(o.align=i?"left":"right"):o.verticalAlign||(o.verticalAlign=i?"bottom":"top")}this.options.dataLabels=o,r.drawDataLabels&&r.drawDataLabels.apply(this,arguments)}if(s.enabled)for(t=n;t--;)(e=a[t])&&(e.dataLabels=[e.dataLabelUpper,e.dataLabel].filter(function(t){return!!t}));this.options.dataLabels=h}}alignDataLabel(){n.alignDataLabel.apply(this,arguments)}modifyMarkerSettings(){let t={marker:this.options.marker,symbol:this.symbol};if(this.options.lowMarker){let{options:{marker:t,lowMarker:e}}=this;this.options.marker=g(t,e),e.symbol&&(this.symbol=e.symbol)}return t}restoreMarkerSettings(t){this.options.marker=t.marker,this.symbol=t.symbol}drawPoints(){let t,e;let i=this.points.length,s=this.modifyMarkerSettings();for(r.drawPoints.apply(this,arguments),this.restoreMarkerSettings(s),t=0;t<i;)(e=this.points[t]).graphics=e.graphics||[],e.origProps={plotY:e.plotY,plotX:e.plotX,isInside:e.isInside,negative:e.negative,zone:e.zone,y:e.y},(e.graphic||e.graphics[0])&&(e.graphics[0]=e.graphic),e.graphic=e.graphics[1],e.plotY=e.plotHigh,h(e.plotHighX)&&(e.plotX=e.plotHighX),e.y=u(e.high,e.origProps.y),e.negative=e.y<(this.options.threshold||0),this.zones.length&&(e.zone=e.getZone()),this.chart.polar||(e.isInside=e.isTopInside=void 0!==e.plotY&&e.plotY>=0&&e.plotY<=this.yAxis.len&&e.plotX>=0&&e.plotX<=this.xAxis.len),t++;for(r.drawPoints.apply(this,arguments),t=0;t<i;)(e=this.points[t]).graphics=e.graphics||[],(e.graphic||e.graphics[1])&&(e.graphics[1]=e.graphic),e.graphic=e.graphics[0],e.origProps&&(p(e,e.origProps),delete e.origProps),t++}hasMarkerChanged(t,e){let i=t.lowMarker,s=e.lowMarker||{};return i&&(!1===i.enabled||s.symbol!==i.symbol||s.height!==i.height||s.width!==i.width)||super.hasMarkerChanged(t,e)}}return f.defaultOptions=g(a.defaultOptions,{lineWidth:1,threshold:null,tooltip:{pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},trackByArea:!0,dataLabels:{align:void 0,verticalAlign:void 0,xLow:0,xHigh:0,yLow:0,yHigh:0}}),l(f,"afterTranslate",function(){"low,high"===this.pointArrayMap.join(",")&&this.points.forEach(t=>{let e=t.high,i=t.plotY;t.isNull?t.plotY=void 0:(t.plotLow=i,t.plotHigh=c(e)?this.yAxis.translate(this.dataModify?this.dataModify.modifyValue(e):e,!1,!0,void 0,!0):void 0,this.dataModify&&(t.yBottom=t.plotHigh))})},{order:0}),l(f,"afterTranslate",function(){this.points.forEach(t=>{if(this.chart.polar)this.highToXY(t),t.plotLow=t.plotY,t.tooltipPos=[((t.plotHighX||0)+(t.plotLowX||0))/2,((t.plotHigh||0)+(t.plotLow||0))/2];else{let e=t.pos(!1,t.plotLow),i=t.pos(!1,t.plotHigh);e&&i&&(e[0]=(e[0]+i[0])/2,e[1]=(e[1]+i[1])/2),t.tooltipPos=e}})},{order:3}),p(f.prototype,{deferTranslatePolar:!0,pointArrayMap:["low","high"],pointClass:t,pointValKey:"low",setStackedPoints:o}),i.registerSeriesType("arearange",f),f}),i(e,"Series/AreaSplineRange/AreaSplineRangeSeries.js",[e["Series/AreaRange/AreaRangeSeries.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{spline:{prototype:s}}=e.seriesTypes,{merge:o,extend:a}=i;class r extends t{}return r.defaultOptions=o(t.defaultOptions),a(r.prototype,{getPointSpline:s.getPointSpline}),e.registerSeriesType("areasplinerange",r),r}),i(e,"Series/BoxPlot/BoxPlotSeriesDefaults.js",[],function(){return{threshold:null,tooltip:{pointFormat:'<span style="color:{point.color}">●</span> <b>{series.name}</b><br/>Maximum: {point.high}<br/>Upper quartile: {point.q3}<br/>Median: {point.median}<br/>Lower quartile: {point.q1}<br/>Minimum: {point.low}<br/>'},whiskerLength:"50%",fillColor:"#ffffff",lineWidth:1,medianWidth:2,whiskerWidth:2}}),i(e,"Series/BoxPlot/BoxPlotSeries.js",[e["Series/BoxPlot/BoxPlotSeriesDefaults.js"],e["Series/Column/ColumnSeries.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,o){let{noop:a}=i,{crisp:r,extend:n,merge:l,pick:h}=o;class p extends e{pointAttribs(){return{}}translate(){let t=this.yAxis,e=this.pointArrayMap;super.translate.apply(this),this.points.forEach(function(i){e.forEach(function(e){null!==i[e]&&(i[e+"Plot"]=t.translate(i[e],0,1,0,1))}),i.plotHigh=i.highPlot})}drawPoints(){let t,e,i,s,o,a,n,l,p,d,c,u,g;let f=this.points,b=this.options,m=this.chart,y=m.renderer,x=!1!==this.doQuartiles,P=this.options.whiskerLength;for(let S of f){let f=(l=S.graphic)?"animate":"attr",M=S.shapeArgs,L={},C={},k={},v={},A=S.color||this.color;if(void 0!==S.plotY){let w;p=M.width,c=(d=M.x)+p,u=p/2,t=x?S.q1Plot:S.lowPlot,e=x?S.q3Plot:S.lowPlot,i=S.highPlot,s=S.lowPlot,l||(S.graphic=l=y.g("point").add(this.group),S.stem=y.path().addClass("highcharts-boxplot-stem").add(l),P&&(S.whiskers=y.path().addClass("highcharts-boxplot-whisker").add(l)),x&&(S.box=y.path(n).addClass("highcharts-boxplot-box").add(l)),S.medianShape=y.path(a).addClass("highcharts-boxplot-median").add(l)),m.styledMode||(C.stroke=S.stemColor||b.stemColor||A,C["stroke-width"]=h(S.stemWidth,b.stemWidth,b.lineWidth),C.dashstyle=S.stemDashStyle||b.stemDashStyle||b.dashStyle,S.stem.attr(C),P&&(k.stroke=S.whiskerColor||b.whiskerColor||A,k["stroke-width"]=h(S.whiskerWidth,b.whiskerWidth,b.lineWidth),k.dashstyle=S.whiskerDashStyle||b.whiskerDashStyle||b.dashStyle,S.whiskers.attr(k)),x&&(L.fill=S.fillColor||b.fillColor||A,L.stroke=b.lineColor||A,L["stroke-width"]=b.lineWidth||0,L.dashstyle=S.boxDashStyle||b.boxDashStyle||b.dashStyle,S.box.attr(L)),v.stroke=S.medianColor||b.medianColor||A,v["stroke-width"]=h(S.medianWidth,b.medianWidth,b.lineWidth),v.dashstyle=S.medianDashStyle||b.medianDashStyle||b.dashStyle,S.medianShape.attr(v));let T=r((S.plotX||0)+(this.pointXOffset||0)+(this.barW||0)/2,S.stem.strokeWidth());if(w=[["M",T,e],["L",T,i],["M",T,t],["L",T,s]],S.stem[f]({d:w}),x){let i=S.box.strokeWidth();t=r(t,i),e=r(e,i),w=[["M",d=r(d,i),e],["L",d,t],["L",c=r(c,i),t],["L",c,e],["L",d,e],["Z"]],S.box[f]({d:w})}if(P){let t=S.whiskers.strokeWidth();i=r(S.highPlot,t),s=r(S.lowPlot,t),w=[["M",r(T-(g="string"==typeof P&&/%$/.test(P)?u*parseFloat(P)/100:Number(P)/2)),i],["L",r(T+g),i],["M",r(T-g),s],["L",r(T+g),s]],S.whiskers[f]({d:w})}w=[["M",d,o=r(S.medianPlot,S.medianShape.strokeWidth())],["L",c,o]],S.medianShape[f]({d:w})}}}toYData(t){return[t.low,t.q1,t.median,t.q3,t.high]}}return p.defaultOptions=l(e.defaultOptions,t),n(p.prototype,{pointArrayMap:["low","q1","median","q3","high"],pointValKey:"high",drawDataLabels:a,setStackedPoints:a}),s.registerSeriesType("boxplot",p),p}),i(e,"Series/Bubble/BubbleLegendDefaults.js",[],function(){return{borderColor:void 0,borderWidth:2,className:void 0,color:void 0,connectorClassName:void 0,connectorColor:void 0,connectorDistance:60,connectorWidth:1,enabled:!1,labels:{className:void 0,allowOverlap:!1,format:"",formatter:void 0,align:"right",style:{fontSize:"0.9em",color:"#000000"},x:0,y:0},maxSize:60,minSize:10,legendIndex:0,ranges:{value:void 0,borderColor:void 0,color:void 0,connectorColor:void 0},sizeBy:"area",sizeByAbsoluteValue:!1,zIndex:1,zThreshold:0}}),i(e,"Series/Bubble/BubbleLegendItem.js",[e["Core/Color/Color.js"],e["Core/Templating.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{parse:o}=t,{noop:a}=i,{arrayMax:r,arrayMin:n,isNumber:l,merge:h,pick:p,stableSort:d}=s;return class{constructor(t,e){this.setState=a,this.init(t,e)}init(t,e){this.options=t,this.visible=!0,this.chart=e.chart,this.legend=e}addToLegend(t){t.splice(this.options.legendIndex,0,this)}drawLegendSymbol(t){let e;let i=p(t.options.itemDistance,20),s=this.legendItem||{},o=this.options,a=o.ranges,r=o.connectorDistance;if(!a||!a.length||!l(a[0].value)){t.options.bubbleLegend.autoRanges=!0;return}d(a,function(t,e){return e.value-t.value}),this.ranges=a,this.setOptions(),this.render();let n=this.getMaxLabelSize(),h=this.ranges[0].radius,c=2*h;e=(e=r-h+n.width)>0?e:0,this.maxLabel=n,this.movementX="left"===o.labels.align?e:0,s.labelWidth=c+e+i,s.labelHeight=c+n.height/2}setOptions(){let t=this.ranges,e=this.options,i=this.chart.series[e.seriesIndex],s=this.legend.baseline,a={zIndex:e.zIndex,"stroke-width":e.borderWidth},r={zIndex:e.zIndex,"stroke-width":e.connectorWidth},n={align:this.legend.options.rtl||"left"===e.labels.align?"right":"left",zIndex:e.zIndex},l=i.options.marker.fillOpacity,d=this.chart.styledMode;t.forEach(function(c,u){d||(a.stroke=p(c.borderColor,e.borderColor,i.color),a.fill=p(c.color,e.color,1!==l?o(i.color).setOpacity(l).get("rgba"):i.color),r.stroke=p(c.connectorColor,e.connectorColor,i.color)),t[u].radius=this.getRangeRadius(c.value),t[u]=h(t[u],{center:t[0].radius-t[u].radius+s}),d||h(!0,t[u],{bubbleAttribs:h(a),connectorAttribs:h(r),labelAttribs:n})},this)}getRangeRadius(t){let e=this.options,i=this.options.seriesIndex,s=this.chart.series[i],o=e.ranges[0].value,a=e.ranges[e.ranges.length-1].value,r=e.minSize,n=e.maxSize;return s.getRadius.call(this,a,o,r,n,t)}render(){let t=this.legendItem||{},e=this.chart.renderer,i=this.options.zThreshold;for(let s of(this.symbols||(this.symbols={connectors:[],bubbleItems:[],labels:[]}),t.symbol=e.g("bubble-legend"),t.label=e.g("bubble-legend-item").css(this.legend.itemStyle||{}),t.symbol.translateX=0,t.symbol.translateY=0,t.symbol.add(t.label),t.label.add(t.group),this.ranges))s.value>=i&&this.renderRange(s);this.hideOverlappingLabels()}renderRange(t){let e=this.ranges[0],i=this.legend,s=this.options,o=s.labels,a=this.chart,r=a.series[s.seriesIndex],n=a.renderer,l=this.symbols,h=l.labels,p=t.center,d=Math.abs(t.radius),c=s.connectorDistance||0,u=o.align,g=i.options.rtl,f=s.borderWidth,b=s.connectorWidth,m=e.radius||0,y=p-d-f/2+b/2,x=(y%1?1:.5)-(b%2?0:.5),P=n.styledMode,S=g||"left"===u?-c:c;"center"===u&&(S=0,s.connectorDistance=0,t.labelAttribs.align="center"),l.bubbleItems.push(n.circle(m,p+x,d).attr(P?{}:t.bubbleAttribs).addClass((P?"highcharts-color-"+r.colorIndex+" ":"")+"highcharts-bubble-legend-symbol "+(s.className||"")).add(this.legendItem.symbol)),l.connectors.push(n.path(n.crispLine([["M",m,y],["L",m+S,y]],s.connectorWidth)).attr(P?{}:t.connectorAttribs).addClass((P?"highcharts-color-"+this.options.seriesIndex+" ":"")+"highcharts-bubble-legend-connectors "+(s.connectorClassName||"")).add(this.legendItem.symbol));let M=n.text(this.formatLabel(t)).attr(P?{}:t.labelAttribs).css(P?{}:o.style).addClass("highcharts-bubble-legend-labels "+(s.labels.className||"")).add(this.legendItem.symbol),L={x:m+S+s.labels.x,y:y+s.labels.y+.4*M.getBBox().height};M.attr(L),h.push(M),M.placed=!0,M.alignAttr=L}getMaxLabelSize(){let t,e;return this.symbols.labels.forEach(function(i){e=i.getBBox(!0),t=t?e.width>t.width?e:t:e}),t||{}}formatLabel(t){let i=this.options,s=i.labels.formatter,o=i.labels.format,{numberFormatter:a}=this.chart;return o?e.format(o,t):s?s.call(t):a(t.value,1)}hideOverlappingLabels(){let t=this.chart,e=this.options.labels.allowOverlap,i=this.symbols;!e&&i&&(t.hideOverlappingLabels(i.labels),i.labels.forEach(function(t,e){t.newOpacity?t.newOpacity!==t.oldOpacity&&i.connectors[e].show():i.connectors[e].hide()}))}getRanges(){let t=this.legend.bubbleLegend,e=t.chart.series,i=t.options.ranges,s,o,a=Number.MAX_VALUE,d=-Number.MAX_VALUE;return e.forEach(function(t){t.isBubble&&!t.ignoreSeries&&(o=t.zData.filter(l)).length&&(a=p(t.options.zMin,Math.min(a,Math.max(n(o),!1===t.options.displayNegative?t.options.zThreshold:-Number.MAX_VALUE))),d=p(t.options.zMax,Math.max(d,r(o))))}),s=a===d?[{value:d}]:[{value:a},{value:(a+d)/2},{value:d,autoRanges:!0}],i.length&&i[0].radius&&s.reverse(),s.forEach(function(t,e){i&&i[e]&&(s[e]=h(i[e],t))}),s}predictBubbleSizes(){let t=this.chart,e=t.legend.options,i=e.floating,s="horizontal"===e.layout,o=s?t.legend.lastLineHeight:0,a=t.plotSizeX,r=t.plotSizeY,n=t.series[this.options.seriesIndex],l=n.getPxExtremes(),h=Math.ceil(l.minPxSize),p=Math.ceil(l.maxPxSize),d=Math.min(r,a),c,u=n.options.maxSize;return i||!/%$/.test(u)?c=p:(c=(d+o)*(u=parseFloat(u))/100/(u/100+1),(s&&r-c>=a||!s&&a-c>=r)&&(c=p)),[h,Math.ceil(c)]}updateRanges(t,e){let i=this.legend.options.bubbleLegend;i.minSize=t,i.maxSize=e,i.ranges=this.getRanges()}correctSizes(){let t=this.legend,e=this.chart.series[this.options.seriesIndex].getPxExtremes();Math.abs(Math.ceil(e.maxPxSize)-this.options.maxSize)>1&&(this.updateRanges(this.options.minSize,e.maxPxSize),t.render())}}}),i(e,"Series/Bubble/BubbleLegendComposition.js",[e["Series/Bubble/BubbleLegendDefaults.js"],e["Series/Bubble/BubbleLegendItem.js"],e["Core/Defaults.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i,s,o){let{setOptions:a}=i,{composed:r}=s,{addEvent:n,objectEach:l,pushUnique:h,wrap:p}=o;function d(t,e,i){let s,o,a;let r=this.legend,n=c(this)>=0;r&&r.options.enabled&&r.bubbleLegend&&r.options.bubbleLegend.autoRanges&&n?(s=r.bubbleLegend.options,o=r.bubbleLegend.predictBubbleSizes(),r.bubbleLegend.updateRanges(o[0],o[1]),s.placed||(r.group.placed=!1,r.allItems.forEach(t=>{(a=t.legendItem||{}).group&&(a.group.translateY=void 0)})),r.render(),s.placed||(this.getMargins(),this.axes.forEach(function(t){t.visible&&t.render(),s.placed||(t.setScale(),t.updateNames(),l(t.ticks,function(t){t.isNew=!0,t.isNewLabel=!0}))}),this.getMargins()),s.placed=!0,t.call(this,e,i),r.bubbleLegend.correctSizes(),b(r,u(r))):(t.call(this,e,i),r&&r.options.enabled&&r.bubbleLegend&&(r.render(),b(r,u(r))))}function c(t){let e=t.series,i=0;for(;i<e.length;){if(e[i]&&e[i].isBubble&&e[i].visible&&e[i].zData.length)return i;i++}return -1}function u(t){let e=t.allItems,i=[],s=e.length,o,a,r,n=0,l=0;for(n=0;n<s;n++)if(a=e[n].legendItem||{},r=(e[n+1]||{}).legendItem||{},a.labelHeight&&(e[n].itemHeight=a.labelHeight),e[n]===e[s-1]||a.y!==r.y){for(i.push({height:0}),o=i[i.length-1];l<=n;l++)e[l].itemHeight>o.height&&(o.height=e[l].itemHeight);o.step=n}return i}function g(t){let i=this.bubbleLegend,s=this.options,o=s.bubbleLegend,a=c(this.chart);i&&i.ranges&&i.ranges.length&&(o.ranges.length&&(o.autoRanges=!!o.ranges[0].autoRanges),this.destroyItem(i)),a>=0&&s.enabled&&o.enabled&&(o.seriesIndex=a,this.bubbleLegend=new e(o,this),this.bubbleLegend.addToLegend(t.allItems))}function f(t){let e;if(t.defaultPrevented)return!1;let i=t.legendItem,s=this.chart,o=i.visible;this&&this.bubbleLegend&&(i.visible=!o,i.ignoreSeries=o,e=c(s)>=0,this.bubbleLegend.visible!==e&&(this.update({bubbleLegend:{enabled:e}}),this.bubbleLegend.visible=e),i.visible=o)}function b(t,e){let i=t.allItems,s=t.options.rtl,o,a,r,n,l=0;i.forEach((t,i)=>{(n=t.legendItem||{}).group&&(o=n.group.translateX||0,a=n.y||0,((r=t.movementX)||s&&t.ranges)&&(r=s?o-t.options.maxSize/2:o+r,n.group.attr({translateX:r})),i>e[l].step&&l++,n.group.attr({translateY:Math.round(a+e[l].height/2)}),n.y=a+e[l].height/2)})}return{compose:function(e,i){h(r,"Series.BubbleLegend")&&(a({legend:{bubbleLegend:t}}),p(e.prototype,"drawChartBox",d),n(i,"afterGetAllItems",g),n(i,"itemClick",f))}}}),i(e,"Series/Bubble/BubblePoint.js",[e["Core/Series/Point.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{seriesTypes:{scatter:{prototype:{pointClass:s}}}}=e,{extend:o}=i;class a extends s{haloPath(e){let i=(e&&this.marker&&this.marker.radius||0)+e;if(this.series.chart.inverted){let t=this.pos()||[0,0],{xAxis:e,yAxis:s,chart:o}=this.series;return o.renderer.symbols.circle(e.len-t[1]-i,s.len-t[0]-i,2*i,2*i)}return t.prototype.haloPath.call(this,i)}}return o(a.prototype,{ttBelow:!1}),a}),i(e,"Series/Bubble/BubbleSeries.js",[e["Series/Bubble/BubbleLegendComposition.js"],e["Series/Bubble/BubblePoint.js"],e["Core/Color/Color.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,o,a){let{parse:r}=i,{composed:n,noop:l}=s,{series:h,seriesTypes:{column:{prototype:p},scatter:d}}=o,{addEvent:c,arrayMax:u,arrayMin:g,clamp:f,extend:b,isNumber:m,merge:y,pick:x,pushUnique:P}=a;function S(){let t=this.len,{coll:e,isXAxis:i,min:s}=this,o=i?"xData":"yData",a=(this.max||0)-(s||0),r=0,n=t,l=t/a,h;("xAxis"===e||"yAxis"===e)&&(this.series.forEach(t=>{if(t.bubblePadding&&t.reserveSpace()){this.allowZoomOutside=!0,h=!0;let e=t[o];if(i&&((t.onPoint||t).getRadii(0,0,t),t.onPoint&&(t.radii=t.onPoint.radii)),a>0){let i=e.length;for(;i--;)if(m(e[i])&&this.dataMin<=e[i]&&e[i]<=this.max){let o=t.radii&&t.radii[i]||0;r=Math.min((e[i]-s)*l-o,r),n=Math.max((e[i]-s)*l+o,n)}}}}),h&&a>0&&!this.logarithmic&&(n-=t,l*=(t+Math.max(0,r)-Math.min(n,t))/t,[["min","userMin",r],["max","userMax",n]].forEach(t=>{void 0===x(this.options[t[0]],this[t[1]])&&(this[t[0]]+=t[2]/l)})))}class M extends d{static compose(e,i,s){t.compose(i,s),P(n,"Series.Bubble")&&c(e,"foundExtremes",S)}animate(t){!t&&this.points.length<this.options.animationLimit&&this.points.forEach(function(t){let{graphic:e,plotX:i=0,plotY:s=0}=t;e&&e.width&&(this.hasRendered||e.attr({x:i,y:s,width:1,height:1}),e.animate(this.markerAttribs(t),this.options.animation))},this)}getRadii(){let t=this.zData,e=this.yData,i=[],s,o,a,r=this.chart.bubbleZExtremes,{minPxSize:n,maxPxSize:l}=this.getPxExtremes();if(!r){let t,e=Number.MAX_VALUE,i=-Number.MAX_VALUE;this.chart.series.forEach(s=>{if(s.bubblePadding&&s.reserveSpace()){let o=(s.onPoint||s).getZExtremes();o&&(e=Math.min(x(e,o.zMin),o.zMin),i=Math.max(x(i,o.zMax),o.zMax),t=!0)}}),t?(r={zMin:e,zMax:i},this.chart.bubbleZExtremes=r):r={zMin:0,zMax:0}}for(o=0,s=t.length;o<s;o++)a=t[o],i.push(this.getRadius(r.zMin,r.zMax,n,l,a,e&&e[o]));this.radii=i}getRadius(t,e,i,s,o,a){let r=this.options,n="width"!==r.sizeBy,l=r.zThreshold,h=e-t,p=.5;if(null===a||null===o)return null;if(m(o)){if(r.sizeByAbsoluteValue&&(o=Math.abs(o-l),e=h=Math.max(e-l,Math.abs(t-l)),t=0),o<t)return i/2-1;h>0&&(p=(o-t)/h)}return n&&p>=0&&(p=Math.sqrt(p)),Math.ceil(i+p*(s-i))/2}hasData(){return!!this.processedXData.length}markerAttribs(t,e){let i=super.markerAttribs(t,e),{height:s=0,width:o=0}=i;return this.chart.inverted?b(i,{x:(t.plotX||0)-o/2,y:(t.plotY||0)-s/2}):i}pointAttribs(t,e){let i=this.options.marker.fillOpacity,s=h.prototype.pointAttribs.call(this,t,e);return 1!==i&&(s.fill=r(s.fill).setOpacity(i).get("rgba")),s}translate(){super.translate.call(this),this.getRadii(),this.translateBubble()}translateBubble(){let{data:t,options:e,radii:i}=this,{minPxSize:s}=this.getPxExtremes(),o=t.length;for(;o--;){let a=t[o],r=i?i[o]:0;"z"===this.zoneAxis&&(a.negative=(a.z||0)<(e.zThreshold||0)),m(r)&&r>=s/2?(a.marker=b(a.marker,{radius:r,width:2*r,height:2*r}),a.dlBox={x:a.plotX-r,y:a.plotY-r,width:2*r,height:2*r}):(a.shapeArgs=a.plotY=a.dlBox=void 0,a.isInside=!1)}}getPxExtremes(){let t=Math.min(this.chart.plotWidth,this.chart.plotHeight),e=e=>{let i;return"string"==typeof e&&(i=/%$/.test(e),e=parseInt(e,10)),i?t*e/100:e},i=e(x(this.options.minSize,8)),s=Math.max(e(x(this.options.maxSize,"20%")),i);return{minPxSize:i,maxPxSize:s}}getZExtremes(){let t=this.options,e=(this.zData||[]).filter(m);if(e.length){let i=x(t.zMin,f(g(e),!1===t.displayNegative?t.zThreshold||0:-Number.MAX_VALUE,Number.MAX_VALUE)),s=x(t.zMax,u(e));if(m(i)&&m(s))return{zMin:i,zMax:s}}}}return M.defaultOptions=y(d.defaultOptions,{dataLabels:{formatter:function(){let{numberFormatter:t}=this.series.chart,{z:e}=this.point;return m(e)?t(e,-1):""},inside:!0,verticalAlign:"middle"},animationLimit:250,marker:{lineColor:null,lineWidth:1,fillOpacity:.5,radius:null,states:{hover:{radiusPlus:0}},symbol:"circle"},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0,zoneAxis:"z"}),b(M.prototype,{alignDataLabel:p.alignDataLabel,applyZones:l,bubblePadding:!0,isBubble:!0,pointArrayMap:["y","z"],pointClass:e,parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],specialGroup:"group",zoneAxis:"z"}),c(M,"updatedData",t=>{delete t.target.chart.bubbleZExtremes}),c(M,"remove",t=>{delete t.target.chart.bubbleZExtremes}),o.registerSeriesType("bubble",M),M}),i(e,"Series/ColumnRange/ColumnRangePoint.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){let{seriesTypes:{column:{prototype:{pointClass:{prototype:i}}},arearange:{prototype:{pointClass:s}}}}=t,{extend:o,isNumber:a}=e;class r extends s{isValid(){return a(this.low)}}return o(r.prototype,{setState:i.setState}),r}),i(e,"Series/ColumnRange/ColumnRangeSeries.js",[e["Series/ColumnRange/ColumnRangePoint.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{noop:o}=e,{seriesTypes:{arearange:a,column:r,column:{prototype:n}}}=i,{addEvent:l,clamp:h,extend:p,isNumber:d,merge:c,pick:u}=s;class g extends a{setOptions(){return c(!0,arguments[0],{stacking:void 0}),a.prototype.setOptions.apply(this,arguments)}translate(){return n.translate.apply(this)}pointAttribs(){return n.pointAttribs.apply(this,arguments)}translate3dPoints(){return n.translate3dPoints.apply(this,arguments)}translate3dShapes(){return n.translate3dShapes.apply(this,arguments)}afterColumnTranslate(){let t,e,i,s;let o=this.yAxis,a=this.xAxis,r=a.startAngleRad,n=this.chart,l=this.xAxis.isRadial,p=Math.max(n.chartWidth,n.chartHeight)+999;this.points.forEach(g=>{let f=g.shapeArgs||{},b=this.options.minPointLength,m=g.plotY,y=o.translate(g.high,0,1,0,1);if(d(y)&&d(m)){if(g.plotHigh=h(y,-p,p),g.plotLow=h(m,-p,p),s=g.plotHigh,Math.abs(t=u(g.rectPlotY,g.plotY)-g.plotHigh)<b?(e=b-t,t+=e,s-=e/2):t<0&&(t*=-1,s-=t),l&&this.polar)i=g.barX+r,g.shapeType="arc",g.shapeArgs=this.polar.arc(s+t,s,i,i+g.pointWidth);else{f.height=t,f.y=s;let{x:e=0,width:i=0}=f;g.shapeArgs=c(g.shapeArgs,this.crispCol(e,s,i,t)),g.tooltipPos=n.inverted?[o.len+o.pos-n.plotLeft-s-t/2,a.len+a.pos-n.plotTop-e-i/2,t]:[a.left-n.plotLeft+e+i/2,o.pos-n.plotTop+s+t/2,t]}}})}}return g.defaultOptions=c(r.defaultOptions,a.defaultOptions,{borderRadius:{where:"all"},pointRange:null,legendSymbol:"rectangle",marker:null,states:{hover:{halo:!1}}}),l(g,"afterColumnTranslate",function(){g.prototype.afterColumnTranslate.apply(this)},{order:5}),p(g.prototype,{directTouch:!0,pointClass:t,trackerGroups:["group","dataLabelsGroup"],adjustForMissingColumns:n.adjustForMissingColumns,animate:n.animate,crispCol:n.crispCol,drawGraph:o,drawPoints:n.drawPoints,getSymbol:o,drawTracker:n.drawTracker,getColumnMetrics:n.getColumnMetrics}),i.registerSeriesType("columnrange",g),g}),i(e,"Series/ColumnPyramid/ColumnPyramidSeriesDefaults.js",[],function(){return{}}),i(e,"Series/ColumnPyramid/ColumnPyramidSeries.js",[e["Series/ColumnPyramid/ColumnPyramidSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{column:s}=e.seriesTypes,{clamp:o,merge:a,pick:r}=i;class n extends s{translate(){let t=this.chart,e=this.options,i=this.dense=this.closestPointRange*this.xAxis.transA<2,s=this.borderWidth=r(e.borderWidth,i?0:1),a=this.yAxis,n=e.threshold,l=r(e.minPointLength,5),h=this.getColumnMetrics(),p=h.width,d=this.pointXOffset=h.offset,c=this.translatedThreshold=a.getThreshold(n),u=this.barW=Math.max(p,1+2*s);for(let i of(t.inverted&&(c-=.5),e.pointPadding&&(u=Math.ceil(u)),super.translate(),this.points)){let s=r(i.yBottom,c),g=999+Math.abs(s),f=o(i.plotY,-g,a.len+g),b=u/2,m=Math.min(f,s),y=Math.max(f,s)-m,x=i.plotX+d,P,S,M,L,C,k,v,A,w,T,N;e.centerInCategory&&(x=this.adjustForMissingColumns(x,p,i,h)),i.barX=x,i.pointWidth=p,i.tooltipPos=t.inverted?[a.len+a.pos-t.plotLeft-f,this.xAxis.len-x-b,y]:[x+b,f+a.pos-t.plotTop,y],P=n+(i.total||i.y),"percent"===e.stacking&&(P=n+(i.y<0)?-100:100);let X=a.toPixels(P,!0);M=(S=t.plotHeight-X-(t.plotHeight-c))?b*(m-X)/S:0,L=S?b*(m+y-X)/S:0,k=x-M+b,v=x+M+b,A=x+L+b,w=x-L+b,T=m-l,N=m+y,i.y<0&&(T=m,N=m+y+l),t.inverted&&(C=a.width-m,S=X-(a.width-c),M=b*(X-C)/S,L=b*(X-(C-y))/S,v=(k=x+b+M)-2*M,A=x-L+b,w=x+L+b,T=m,N=m+y-l,i.y<0&&(N=m+y+l)),i.shapeType="path",i.shapeArgs={x:k,y:T,width:v-k,height:y,d:[["M",k,T],["L",v,T],["L",A,N],["L",w,N],["Z"]]}}}}return n.defaultOptions=a(s.defaultOptions,t),e.registerSeriesType("columnpyramid",n),n}),i(e,"Series/ErrorBar/ErrorBarSeriesDefaults.js",[],function(){return{color:"#000000",grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},whiskerWidth:null}}),i(e,"Series/ErrorBar/ErrorBarSeries.js",[e["Series/BoxPlot/BoxPlotSeries.js"],e["Series/Column/ColumnSeries.js"],e["Series/ErrorBar/ErrorBarSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,o){let{arearange:a}=s.seriesTypes,{addEvent:r,merge:n,extend:l}=o;class h extends t{getColumnMetrics(){return this.linkedParent&&this.linkedParent.columnMetrics||e.prototype.getColumnMetrics.call(this)}drawDataLabels(){let t=this.pointValKey;if(a)for(let e of(a.prototype.drawDataLabels.call(this),this.points))e.y=e[t]}toYData(t){return[t.low,t.high]}}return h.defaultOptions=n(t.defaultOptions,i),r(h,"afterTranslate",function(){for(let t of this.points)t.plotLow=t.plotY},{order:0}),l(h.prototype,{pointArrayMap:["low","high"],pointValKey:"high",doQuartiles:!1}),s.registerSeriesType("errorbar",h),h}),i(e,"Series/Gauge/GaugePoint.js",[e["Core/Series/SeriesRegistry.js"]],function(t){let{series:{prototype:{pointClass:e}}}=t;return class extends e{setState(t){this.state=t}}}),i(e,"Series/Gauge/GaugeSeries.js",[e["Series/Gauge/GaugePoint.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{noop:o}=e,{series:a,seriesTypes:{column:r}}=i,{clamp:n,isNumber:l,extend:h,merge:p,pick:d,pInt:c,defined:u}=s;class g extends a{translate(){let t=this.yAxis,e=this.options,i=t.center;this.generatePoints(),this.points.forEach(s=>{let o=p(e.dial,s.dial),a=c(o.radius)*i[2]/200,r=c(o.baseLength)*a/100,h=c(o.rearLength)*a/100,d=o.baseWidth,g=o.topWidth,f=e.overshoot,b=t.startAngleRad+t.translate(s.y,void 0,void 0,void 0,!0);(l(f)||!1===e.wrap)&&(f=l(f)?f/180*Math.PI:0,b=n(b,t.startAngleRad-f,t.endAngleRad+f)),b=180*b/Math.PI,s.shapeType="path";let m=o.path||[["M",-h,-d/2],["L",r,-d/2],["L",a,-g/2],["L",a,g/2],["L",r,d/2],["L",-h,d/2],["Z"]];s.shapeArgs={d:m,translateX:i[0],translateY:i[1],rotation:b},s.plotX=i[0],s.plotY=i[1],u(s.y)&&t.max-t.min&&(s.percentage=(s.y-t.min)/(t.max-t.min)*100)})}drawPoints(){let t=this,e=t.chart,i=t.yAxis.center,s=t.pivot,o=t.options,a=o.pivot,r=e.renderer;t.points.forEach(i=>{let s=i.graphic,a=i.shapeArgs,n=a.d,l=p(o.dial,i.dial);s?(s.animate(a),a.d=n):i.graphic=r[i.shapeType](a).addClass("highcharts-dial").add(t.group),e.styledMode||i.graphic[s?"animate":"attr"]({stroke:l.borderColor,"stroke-width":l.borderWidth,fill:l.backgroundColor})}),s?s.animate({translateX:i[0],translateY:i[1]}):a&&(t.pivot=r.circle(0,0,a.radius).attr({zIndex:2}).addClass("highcharts-pivot").translate(i[0],i[1]).add(t.group),e.styledMode||t.pivot.attr({fill:a.backgroundColor,stroke:a.borderColor,"stroke-width":a.borderWidth}))}animate(t){let e=this;t||e.points.forEach(t=>{let i=t.graphic;i&&(i.attr({rotation:180*e.yAxis.startAngleRad/Math.PI}),i.animate({rotation:t.shapeArgs.rotation},e.options.animation))})}render(){this.group=this.plotGroup("group","series",this.visible?"inherit":"hidden",this.options.zIndex,this.chart.seriesGroup),a.prototype.render.call(this),this.group.clip(this.chart.clipRect)}setData(t,e){a.prototype.setData.call(this,t,!1),this.processData(),this.generatePoints(),d(e,!0)&&this.chart.redraw()}hasData(){return!!this.points.length}}return g.defaultOptions=p(a.defaultOptions,{dataLabels:{borderColor:"#cccccc",borderRadius:3,borderWidth:1,crop:!1,defer:!1,enabled:!0,verticalAlign:"top",y:15,zIndex:2},dial:{backgroundColor:"#000000",baseLength:"70%",baseWidth:3,borderColor:"#cccccc",borderWidth:0,radius:"80%",rearLength:"10%",topWidth:1},pivot:{radius:5,borderWidth:0,borderColor:"#cccccc",backgroundColor:"#000000"},tooltip:{headerFormat:""},showInLegend:!1}),h(g.prototype,{angular:!0,directTouch:!0,drawGraph:o,drawTracker:r.prototype.drawTracker,fixedBox:!0,forceDL:!0,noSharedTooltip:!0,pointClass:t,trackerGroups:["group","dataLabelsGroup"]}),i.registerSeriesType("gauge",g),g}),i(e,"Series/DragNodesComposition.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{composed:i}=t,{addEvent:s,pushUnique:o}=e;function a(){let t,e,i;let o=this;o.container&&(t=s(o.container,"mousedown",t=>{let a=o.hoverPoint;a&&a.series&&a.series.hasDraggableNodes&&a.series.options.draggable&&(a.series.onMouseDown(a,t),e=s(o.container,"mousemove",t=>a&&a.series&&a.series.onMouseMove(a,t)),i=s(o.container.ownerDocument,"mouseup",t=>(e(),i(),a&&a.series&&a.series.onMouseUp(a,t))))})),s(o,"destroy",function(){t()})}return{compose:function(t){o(i,"DragNodes")&&s(t,"load",a)},onMouseDown:function(t,e){let i=this.chart.pointer?.normalize(e)||e;t.fixedPosition={chartX:i.chartX,chartY:i.chartY,plotX:t.plotX,plotY:t.plotY},t.inDragMode=!0},onMouseMove:function(t,e){if(t.fixedPosition&&t.inDragMode){let i,s;let o=this.chart,a=o.pointer?.normalize(e)||e,r=t.fixedPosition.chartX-a.chartX,n=t.fixedPosition.chartY-a.chartY,l=o.graphLayoutsLookup;(Math.abs(r)>5||Math.abs(n)>5)&&(i=t.fixedPosition.plotX-r,s=t.fixedPosition.plotY-n,o.isInsidePlot(i,s)&&(t.plotX=i,t.plotY=s,t.hasDragged=!0,this.redrawHalo(t),l.forEach(t=>{t.restartSimulation()})))}},onMouseUp:function(t){t.fixedPosition&&(t.hasDragged&&(this.layout.enableSimulation?this.layout.start():this.chart.redraw()),t.inDragMode=t.hasDragged=!1,this.options.fixedDraggable||delete t.fixedPosition)},redrawHalo:function(t){t&&this.halo&&this.halo.attr({d:t.haloPath(this.options.states.hover.halo.size)})}}}),i(e,"Series/GraphLayoutComposition.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){let{setAnimation:s}=t,{composed:o}=e,{addEvent:a,pushUnique:r}=i;function n(){this.graphLayoutsLookup&&(this.graphLayoutsLookup.forEach(t=>{t.updateSimulation()}),this.redraw())}function l(){this.graphLayoutsLookup&&(this.graphLayoutsLookup.forEach(t=>{t.updateSimulation(!1)}),this.redraw())}function h(){this.graphLayoutsLookup&&this.graphLayoutsLookup.forEach(t=>{t.stop()})}function p(){let t,e=!1,i=i=>{i.maxIterations--&&isFinite(i.temperature)&&!i.isStable()&&!i.enableSimulation&&(i.beforeStep&&i.beforeStep(),i.step(),t=!1,e=!0)};if(this.graphLayoutsLookup){for(s(!1,this),this.graphLayoutsLookup.forEach(t=>t.start());!t;)t=!0,this.graphLayoutsLookup.forEach(i);e&&this.series.forEach(t=>{t&&t.layout&&t.render()})}}return{compose:function(t){r(o,"GraphLayout")&&(a(t,"afterPrint",n),a(t,"beforePrint",l),a(t,"predraw",h),a(t,"render",p))},integrations:{},layouts:{}}}),i(e,"Series/PackedBubble/PackedBubblePoint.js",[e["Core/Chart/Chart.js"],e["Core/Series/Point.js"],e["Core/Series/SeriesRegistry.js"]],function(t,e,i){let{seriesTypes:{bubble:{prototype:{pointClass:s}}}}=i;return class extends s{destroy(){return this.series?.layout&&this.series.layout.removeElementFromCollection(this,this.series.layout.nodes),e.prototype.destroy.apply(this,arguments)}firePointEvent(){let t=this.series.options;if(this.isParentNode&&t.parentNode){let i=t.allowPointSelect;t.allowPointSelect=t.parentNode.allowPointSelect,e.prototype.firePointEvent.apply(this,arguments),t.allowPointSelect=i}else e.prototype.firePointEvent.apply(this,arguments)}select(){let i=this.series.chart;this.isParentNode?(i.getSelectedPoints=i.getSelectedParentNodes,e.prototype.select.apply(this,arguments),i.getSelectedPoints=t.prototype.getSelectedPoints):e.prototype.select.apply(this,arguments)}}}),i(e,"Series/PackedBubble/PackedBubbleSeriesDefaults.js",[e["Core/Utilities.js"]],function(t){let{isNumber:e}=t;return{minSize:"10%",maxSize:"50%",sizeBy:"area",zoneAxis:"y",crisp:!1,tooltip:{pointFormat:"Value: {point.value}"},draggable:!0,useSimulation:!0,parentNode:{allowPointSelect:!1},dataLabels:{formatter:function(){let{numberFormatter:t}=this.series.chart,{value:i}=this.point;return e(i)?t(i,-1):""},parentNodeFormatter:function(){return this.name},parentNodeTextPath:{enabled:!0},padding:0,style:{transition:"opacity 2000ms"}},layoutAlgorithm:{initialPositions:"circle",initialPositionRadius:20,bubblePadding:5,parentNodeLimit:!1,seriesInteraction:!0,dragBetweenSeries:!1,parentNodeOptions:{maxIterations:400,gravitationalConstant:.03,maxSpeed:50,initialPositionRadius:100,seriesInteraction:!0,marker:{fillColor:null,fillOpacity:1,lineWidth:null,lineColor:null,symbol:"circle"}},enableSimulation:!0,type:"packedbubble",integration:"packedbubble",maxIterations:1e3,splitSeries:!1,maxSpeed:5,gravitationalConstant:.01,friction:-.981}}}),i(e,"Series/Networkgraph/VerletIntegration.js",[],function(){return{attractive:function(t,e,i){let s=t.getMass(),o=-i.x*e*this.diffTemperature,a=-i.y*e*this.diffTemperature;t.fromNode.fixedPosition||(t.fromNode.plotX-=o*s.fromNode/t.fromNode.degree,t.fromNode.plotY-=a*s.fromNode/t.fromNode.degree),t.toNode.fixedPosition||(t.toNode.plotX+=o*s.toNode/t.toNode.degree,t.toNode.plotY+=a*s.toNode/t.toNode.degree)},attractiveForceFunction:function(t,e){return(e-t)/t},barycenter:function(){let t=this.options.gravitationalConstant||0,e=(this.barycenter.xFactor-(this.box.left+this.box.width)/2)*t,i=(this.barycenter.yFactor-(this.box.top+this.box.height)/2)*t;this.nodes.forEach(function(t){t.fixedPosition||(t.plotX-=e/t.mass/t.degree,t.plotY-=i/t.mass/t.degree)})},getK:function(t){return Math.pow(t.box.width*t.box.height/t.nodes.length,.5)},integrate:function(t,e){let i=-t.options.friction,s=t.options.maxSpeed,o=e.prevX,a=e.prevY,r=(e.plotX+e.dispX-o)*i,n=(e.plotY+e.dispY-a)*i,l=Math.abs,h=l(r)/(r||1),p=l(n)/(n||1),d=h*Math.min(s,Math.abs(r)),c=p*Math.min(s,Math.abs(n));e.prevX=e.plotX+e.dispX,e.prevY=e.plotY+e.dispY,e.plotX+=d,e.plotY+=c,e.temperature=t.vectorLength({x:d,y:c})},repulsive:function(t,e,i){let s=e*this.diffTemperature/t.mass/t.degree;t.fixedPosition||(t.plotX+=i.x*s,t.plotY+=i.y*s)},repulsiveForceFunction:function(t,e){return(e-t)/t*(e>t?1:0)}}}),i(e,"Series/PackedBubble/PackedBubbleIntegration.js",[e["Core/Globals.js"],e["Series/Networkgraph/VerletIntegration.js"]],function(t,e){let{noop:i}=t;return{barycenter:function(){let t,e;let i=this.options.gravitationalConstant,s=this.box,o=this.nodes;for(let a of o)this.options.splitSeries&&!a.isParentNode?(t=a.series.parentNode.plotX,e=a.series.parentNode.plotY):(t=s.width/2,e=s.height/2),a.fixedPosition||(a.plotX-=(a.plotX-t)*i/(a.mass*Math.sqrt(o.length)),a.plotY-=(a.plotY-e)*i/(a.mass*Math.sqrt(o.length)))},getK:i,integrate:e.integrate,repulsive:function(t,e,i,s){let o=e*this.diffTemperature/t.mass/t.degree,a=i.x*o,r=i.y*o;t.fixedPosition||(t.plotX+=a,t.plotY+=r),s.fixedPosition||(s.plotX-=a,s.plotY-=r)},repulsiveForceFunction:function(t,e,i,s){return Math.min(t,(i.marker.radius+s.marker.radius)/2)}}}),i(e,"Series/Networkgraph/EulerIntegration.js",[],function(){return{attractive:function(t,e,i,s){let o=t.getMass(),a=i.x/s*e,r=i.y/s*e;t.fromNode.fixedPosition||(t.fromNode.dispX-=a*o.fromNode/t.fromNode.degree,t.fromNode.dispY-=r*o.fromNode/t.fromNode.degree),t.toNode.fixedPosition||(t.toNode.dispX+=a*o.toNode/t.toNode.degree,t.toNode.dispY+=r*o.toNode/t.toNode.degree)},attractiveForceFunction:function(t,e){return t*t/e},barycenter:function(){let t=this.options.gravitationalConstant,e=this.barycenter.xFactor,i=this.barycenter.yFactor;this.nodes.forEach(function(s){if(!s.fixedPosition){let o=s.getDegree(),a=o*(1+o/2);s.dispX+=(e-s.plotX)*t*a/s.degree,s.dispY+=(i-s.plotY)*t*a/s.degree}})},getK:function(t){return Math.pow(t.box.width*t.box.height/t.nodes.length,.3)},integrate:function(t,e){e.dispX+=e.dispX*t.options.friction,e.dispY+=e.dispY*t.options.friction;let i=e.temperature=t.vectorLength({x:e.dispX,y:e.dispY});0!==i&&(e.plotX+=e.dispX/i*Math.min(Math.abs(e.dispX),t.temperature),e.plotY+=e.dispY/i*Math.min(Math.abs(e.dispY),t.temperature))},repulsive:function(t,e,i,s){t.dispX+=i.x/s*e/t.degree,t.dispY+=i.y/s*e/t.degree},repulsiveForceFunction:function(t,e){return e*e/t}}}),i(e,"Series/Networkgraph/QuadTreeNode.js",[],function(){class t{constructor(t){this.body=!1,this.isEmpty=!1,this.isInternal=!1,this.nodes=[],this.box=t,this.boxSize=Math.min(t.width,t.height)}divideBox(){let e=this.box.width/2,i=this.box.height/2;this.nodes[0]=new t({left:this.box.left,top:this.box.top,width:e,height:i}),this.nodes[1]=new t({left:this.box.left+e,top:this.box.top,width:e,height:i}),this.nodes[2]=new t({left:this.box.left+e,top:this.box.top+i,width:e,height:i}),this.nodes[3]=new t({left:this.box.left,top:this.box.top+i,width:e,height:i})}getBoxPosition(t){let e=t.plotX<this.box.left+this.box.width/2,i=t.plotY<this.box.top+this.box.height/2;return e?i?0:3:i?1:2}insert(e,i){let s;this.isInternal?this.nodes[this.getBoxPosition(e)].insert(e,i-1):(this.isEmpty=!1,this.body?i?(this.isInternal=!0,this.divideBox(),!0!==this.body&&(this.nodes[this.getBoxPosition(this.body)].insert(this.body,i-1),this.body=!0),this.nodes[this.getBoxPosition(e)].insert(e,i-1)):((s=new t({top:e.plotX||NaN,left:e.plotY||NaN,width:.1,height:.1})).body=e,s.isInternal=!1,this.nodes.push(s)):(this.isInternal=!1,this.body=e))}updateMassAndCenter(){let t=0,e=0,i=0;if(this.isInternal){for(let s of this.nodes)s.isEmpty||(t+=s.mass,e+=s.plotX*s.mass,i+=s.plotY*s.mass);e/=t,i/=t}else this.body&&(t=this.body.mass,e=this.body.plotX,i=this.body.plotY);this.mass=t,this.plotX=e,this.plotY=i}}return t}),i(e,"Series/Networkgraph/QuadTree.js",[e["Series/Networkgraph/QuadTreeNode.js"]],function(t){return class{constructor(e,i,s,o){this.box={left:e,top:i,width:s,height:o},this.maxDepth=25,this.root=new t(this.box),this.root.isInternal=!0,this.root.isRoot=!0,this.root.divideBox()}calculateMassAndCenter(){this.visitNodeRecursive(null,null,function(t){t.updateMassAndCenter()})}insertNodes(t){for(let e of t)this.root.insert(e,this.maxDepth)}visitNodeRecursive(t,e,i){let s;if(t||(t=this.root),t===this.root&&e&&(s=e(t)),!1!==s){for(let o of t.nodes){if(o.isInternal){if(e&&(s=e(o)),!1===s)continue;this.visitNodeRecursive(o,e,i)}else o.body&&e&&e(o.body);i&&i(o)}t===this.root&&i&&i(t)}}}}),i(e,"Series/Networkgraph/ReingoldFruchtermanLayout.js",[e["Series/Networkgraph/EulerIntegration.js"],e["Core/Globals.js"],e["Series/GraphLayoutComposition.js"],e["Series/Networkgraph/QuadTree.js"],e["Core/Utilities.js"],e["Series/Networkgraph/VerletIntegration.js"]],function(t,e,i,s,o,a){let{win:r}=e,{clamp:n,defined:l,isFunction:h,fireEvent:p,pick:d}=o;class c{constructor(){this.box={},this.currentStep=0,this.initialRendering=!0,this.links=[],this.nodes=[],this.series=[],this.simulation=!1}static compose(e){i.compose(e),i.integrations.euler=t,i.integrations.verlet=a,i.layouts["reingold-fruchterman"]=c}init(t){this.options=t,this.nodes=[],this.links=[],this.series=[],this.box={x:0,y:0,width:0,height:0},this.setInitialRendering(!0),this.integration=i.integrations[t.integration],this.enableSimulation=t.enableSimulation,this.attractiveForce=d(t.attractiveForce,this.integration.attractiveForceFunction),this.repulsiveForce=d(t.repulsiveForce,this.integration.repulsiveForceFunction),this.approximation=t.approximation}updateSimulation(t){this.enableSimulation=d(t,this.options.enableSimulation)}start(){let t=this.series,e=this.options;this.currentStep=0,this.forces=t[0]&&t[0].forces||[],this.chart=t[0]&&t[0].chart,this.initialRendering&&(this.initPositions(),t.forEach(function(t){t.finishedAnimating=!0,t.render()})),this.setK(),this.resetSimulation(e),this.enableSimulation&&this.step()}step(){let t=this.series;for(let t of(this.currentStep++,"barnes-hut"===this.approximation&&(this.createQuadTree(),this.quadTree.calculateMassAndCenter()),this.forces||[]))this[t+"Forces"](this.temperature);if(this.applyLimits(),this.temperature=this.coolDown(this.startTemperature,this.diffTemperature,this.currentStep),this.prevSystemTemperature=this.systemTemperature,this.systemTemperature=this.getSystemTemperature(),this.enableSimulation){for(let e of t)e.chart&&e.render();this.maxIterations--&&isFinite(this.temperature)&&!this.isStable()?(this.simulation&&r.cancelAnimationFrame(this.simulation),this.simulation=r.requestAnimationFrame(()=>this.step())):(this.simulation=!1,this.series.forEach(t=>{p(t,"afterSimulation")}))}}stop(){this.simulation&&r.cancelAnimationFrame(this.simulation)}setArea(t,e,i,s){this.box={left:t,top:e,width:i,height:s}}setK(){this.k=this.options.linkLength||this.integration.getK(this)}addElementsToCollection(t,e){for(let i of t)-1===e.indexOf(i)&&e.push(i)}removeElementFromCollection(t,e){let i=e.indexOf(t);-1!==i&&e.splice(i,1)}clear(){this.nodes.length=0,this.links.length=0,this.series.length=0,this.resetSimulation()}resetSimulation(){this.forcedStop=!1,this.systemTemperature=0,this.setMaxIterations(),this.setTemperature(),this.setDiffTemperature()}restartSimulation(){this.simulation?this.resetSimulation():(this.setInitialRendering(!1),this.enableSimulation?this.start():this.setMaxIterations(1),this.chart&&this.chart.redraw(),this.setInitialRendering(!0))}setMaxIterations(t){this.maxIterations=d(t,this.options.maxIterations)}setTemperature(){this.temperature=this.startTemperature=Math.sqrt(this.nodes.length)}setDiffTemperature(){this.diffTemperature=this.startTemperature/(this.options.maxIterations+1)}setInitialRendering(t){this.initialRendering=t}createQuadTree(){this.quadTree=new s(this.box.left,this.box.top,this.box.width,this.box.height),this.quadTree.insertNodes(this.nodes)}initPositions(){let t=this.options.initialPositions;if(h(t))for(let e of(t.call(this),this.nodes))l(e.prevX)||(e.prevX=e.plotX),l(e.prevY)||(e.prevY=e.plotY),e.dispX=0,e.dispY=0;else"circle"===t?this.setCircularPositions():this.setRandomPositions()}setCircularPositions(){let t;let e=this.box,i=this.nodes,s=2*Math.PI/(i.length+1),o=i.filter(function(t){return 0===t.linksTo.length}),a={},r=this.options.initialPositionRadius,n=t=>{for(let e of t.linksFrom||[])a[e.toNode.id]||(a[e.toNode.id]=!0,l.push(e.toNode),n(e.toNode))},l=[];for(let t of o)l.push(t),n(t);if(l.length)for(let t of i)-1===l.indexOf(t)&&l.push(t);else l=i;for(let i=0,o=l.length;i<o;++i)(t=l[i]).plotX=t.prevX=d(t.plotX,e.width/2+r*Math.cos(i*s)),t.plotY=t.prevY=d(t.plotY,e.height/2+r*Math.sin(i*s)),t.dispX=0,t.dispY=0}setRandomPositions(){let t;let e=this.box,i=this.nodes,s=i.length+1,o=t=>{let e=t*t/Math.PI;return e-Math.floor(e)};for(let a=0,r=i.length;a<r;++a)(t=i[a]).plotX=t.prevX=d(t.plotX,e.width*o(a)),t.plotY=t.prevY=d(t.plotY,e.height*o(s+a)),t.dispX=0,t.dispY=0}force(t,...e){this.integration[t].apply(this,e)}barycenterForces(){this.getBarycenter(),this.force("barycenter")}getBarycenter(){let t=0,e=0,i=0;for(let s of this.nodes)e+=s.plotX*s.mass,i+=s.plotY*s.mass,t+=s.mass;return this.barycenter={x:e,y:i,xFactor:e/t,yFactor:i/t},this.barycenter}barnesHutApproximation(t,e){let i,s;let o=this.getDistXY(t,e),a=this.vectorLength(o);return t!==e&&0!==a&&(e.isInternal?e.boxSize/a<this.options.theta&&0!==a?(s=this.repulsiveForce(a,this.k),this.force("repulsive",t,s*e.mass,o,a),i=!1):i=!0:(s=this.repulsiveForce(a,this.k),this.force("repulsive",t,s*e.mass,o,a))),i}repulsiveForces(){if("barnes-hut"===this.approximation)for(let t of this.nodes)this.quadTree.visitNodeRecursive(null,e=>this.barnesHutApproximation(t,e));else{let t,e,i;for(let s of this.nodes)for(let o of this.nodes)s===o||s.fixedPosition||(i=this.getDistXY(s,o),0!==(e=this.vectorLength(i))&&(t=this.repulsiveForce(e,this.k),this.force("repulsive",s,t*o.mass,i,e)))}}attractiveForces(){let t,e,i;for(let s of this.links)s.fromNode&&s.toNode&&(t=this.getDistXY(s.fromNode,s.toNode),0!==(e=this.vectorLength(t))&&(i=this.attractiveForce(e,this.k),this.force("attractive",s,i,t,e)))}applyLimits(){for(let t of this.nodes)t.fixedPosition||(this.integration.integrate(this,t),this.applyLimitBox(t,this.box),t.dispX=0,t.dispY=0)}applyLimitBox(t,e){let i=t.radius;t.plotX=n(t.plotX,e.left+i,e.width-i),t.plotY=n(t.plotY,e.top+i,e.height-i)}coolDown(t,e,i){return t-e*i}isStable(){return 1e-5>Math.abs(this.systemTemperature-this.prevSystemTemperature)||this.temperature<=0}getSystemTemperature(){let t=0;for(let e of this.nodes)t+=e.temperature;return t}vectorLength(t){return Math.sqrt(t.x*t.x+t.y*t.y)}getDistR(t,e){let i=this.getDistXY(t,e);return this.vectorLength(i)}getDistXY(t,e){let i=t.plotX-e.plotX,s=t.plotY-e.plotY;return{x:i,y:s,absX:Math.abs(i),absY:Math.abs(s)}}}return c}),i(e,"Series/PackedBubble/PackedBubbleLayout.js",[e["Series/GraphLayoutComposition.js"],e["Series/PackedBubble/PackedBubbleIntegration.js"],e["Series/Networkgraph/ReingoldFruchtermanLayout.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{addEvent:o,pick:a}=s;function r(){let t=this.series,e=[];return t.forEach(t=>{t.parentNode&&t.parentNode.selected&&e.push(t.parentNode)}),e}function n(){this.allDataPoints&&delete this.allDataPoints}class l extends i{constructor(){super(...arguments),this.index=NaN,this.nodes=[],this.series=[]}static compose(s){i.compose(s),t.integrations.packedbubble=e,t.layouts.packedbubble=l;let a=s.prototype;a.getSelectedParentNodes||(o(s,"beforeRedraw",n),a.getSelectedParentNodes=r)}beforeStep(){this.options.marker&&this.series.forEach(t=>{t&&t.calculateParentRadius()})}isStable(){let t=Math.abs(this.prevSystemTemperature-this.systemTemperature);return 1>Math.abs(10*this.systemTemperature/Math.sqrt(this.nodes.length))&&t<1e-5||this.temperature<=0}setCircularPositions(){let t=this.box,e=this.nodes,i=2*Math.PI/(e.length+1),s=this.options.initialPositionRadius,o,r,n=0;for(let l of e)this.options.splitSeries&&!l.isParentNode?(o=l.series.parentNode.plotX,r=l.series.parentNode.plotY):(o=t.width/2,r=t.height/2),l.plotX=l.prevX=a(l.plotX,o+s*Math.cos(l.index||n*i)),l.plotY=l.prevY=a(l.plotY,r+s*Math.sin(l.index||n*i)),l.dispX=0,l.dispY=0,n++}repulsiveForces(){let t,e,i;let s=this,o=s.options.bubblePadding,a=s.nodes;a.forEach(r=>{r.degree=r.mass,r.neighbours=0,a.forEach(a=>{t=0,r!==a&&!r.fixedPosition&&(s.options.seriesInteraction||r.series===a.series)&&(i=s.getDistXY(r,a),(e=s.vectorLength(i)-(r.marker.radius+a.marker.radius+o))<0&&(r.degree+=.01,r.neighbours++,t=s.repulsiveForce(-e/Math.sqrt(r.neighbours),s.k,r,a)),s.force("repulsive",r,t*a.mass,i,a,e))})})}applyLimitBox(t,e){let i,s;this.options.splitSeries&&!t.isParentNode&&this.options.parentNodeLimit&&(i=this.getDistXY(t,t.series.parentNode),(s=t.series.parentNodeRadius-t.marker.radius-this.vectorLength(i))<0&&s>-2*t.marker.radius&&(t.plotX-=.01*i.x,t.plotY-=.01*i.y)),super.applyLimitBox(t,e)}}return t.layouts.packedbubble=l,l}),i(e,"Series/SimulationSeriesUtilities.js",[e["Core/Utilities.js"],e["Core/Animation/AnimationUtilities.js"]],function(t,e){let{merge:i,syncTimeout:s}=t,{animObject:o}=e;return{initDataLabels:function(){let t=this.options.dataLabels;if(!this.dataLabelsGroup){let e=this.initDataLabelsGroup();return!this.chart.styledMode&&t?.style&&e.css(t.style),e.attr({opacity:0}),this.visible&&e.show(),e}return this.dataLabelsGroup.attr(i({opacity:1},this.getPlotBox("data-labels"))),this.dataLabelsGroup},initDataLabelsDefer:function(){let t=this.options.dataLabels;t?.defer&&this.options.layoutAlgorithm?.enableSimulation?s(()=>{this.deferDataLabels=!1},t?o(t.animation).defer:0):this.deferDataLabels=!1}}}),i(e,"Extensions/TextPath.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{deg2rad:i}=t,{addEvent:s,merge:o,uniqueKey:a,defined:r,extend:n}=e;function l(t,e){e=o(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);let i=this.renderer.url,l=this.text||this,h=l.textPath,{attributes:p,enabled:d}=e;if(t=t||h&&h.path,h&&h.undo(),t&&d){let e=s(l,"afterModifyTree",e=>{if(t&&d){let s=t.attr("id");s||t.attr("id",s=a());let o={x:0,y:0};r(p.dx)&&(o.dx=p.dx,delete p.dx),r(p.dy)&&(o.dy=p.dy,delete p.dy),l.attr(o),this.attr({transform:""}),this.box&&(this.box=this.box.destroy());let h=e.nodes.slice(0);e.nodes.length=0,e.nodes[0]={tagName:"textPath",attributes:n(p,{"text-anchor":p.textAnchor,href:`${i}#${s}`}),children:h}}});l.textPath={path:t,undo:e}}else l.attr({dx:0,dy:0}),delete l.textPath;return this.added&&(l.textCache="",this.renderer.buildText(l)),this}function h(t){let e=t.bBox,s=this.element?.querySelector("textPath");if(s){let t=[],{b:o,h:a}=this.renderer.fontMetrics(this.element),r=a-o,n=RegExp('(<tspan>|<tspan(?!\\sclass="highcharts-br")[^>]*>|<\\/tspan>)',"g"),l=s.innerHTML.replace(n,"").split(/<tspan class="highcharts-br"[^>]*>/),h=l.length,p=(t,e)=>{let{x:a,y:n}=e,l=(s.getRotationOfChar(t)-90)*i,h=Math.cos(l),p=Math.sin(l);return[[a-r*h,n-r*p],[a+o*h,n+o*p]]};for(let e=0,i=0;i<h;i++){let o=l[i].length;for(let a=0;a<o;a+=5)try{let o=e+a+i,[r,n]=p(o,s.getStartPositionOfChar(o));0===a?(t.push(n),t.push(r)):(0===i&&t.unshift(n),i===h-1&&t.push(r))}catch(t){break}e+=o-1;try{let o=e+i,a=s.getEndPositionOfChar(o),[r,n]=p(o,a);t.unshift(n),t.unshift(r)}catch(t){break}}t.length&&t.push(t[0].slice()),e.polygon=t}return e}function p(t){let e=t.labelOptions,i=t.point,s=e[i.formatPrefix+"TextPath"]||e.textPath;s&&!e.useHTML&&(this.setTextPath(i.getDataLabelPath?.(this)||i.graphic,s),i.dataLabelPath&&!s.enabled&&(i.dataLabelPath=i.dataLabelPath.destroy()))}return{compose:function(t){s(t,"afterGetBBox",h),s(t,"beforeAddingDataLabel",p);let e=t.prototype;e.setTextPath||(e.setTextPath=l)}}}),i(e,"Series/PackedBubble/PackedBubbleSeries.js",[e["Core/Color/Color.js"],e["Series/DragNodesComposition.js"],e["Series/GraphLayoutComposition.js"],e["Core/Globals.js"],e["Series/PackedBubble/PackedBubblePoint.js"],e["Series/PackedBubble/PackedBubbleSeriesDefaults.js"],e["Series/PackedBubble/PackedBubbleLayout.js"],e["Core/Series/SeriesRegistry.js"],e["Series/SimulationSeriesUtilities.js"],e["Core/Utilities.js"],e["Core/Renderer/SVG/SVGElement.js"],e["Extensions/TextPath.js"]],function(t,e,i,s,o,a,r,n,l,h,p,d){let{parse:c}=t,{noop:u}=s,{series:{prototype:g},seriesTypes:{bubble:f}}=n,{initDataLabels:b,initDataLabelsDefer:m}=l,{addEvent:y,clamp:x,defined:P,extend:S,fireEvent:M,isArray:L,isNumber:C,merge:k,pick:v}=h;d.compose(p);class A extends f{constructor(){super(...arguments),this.parentNodeMass=0,this.deferDataLabels=!0}static compose(t,i,s){f.compose(t,i,s),e.compose(i),r.compose(i)}accumulateAllPoints(){let t;let e=this.chart,i=[];for(let s of e.series)if(s.is("packedbubble")&&s.reserveSpace()){t=s.yData||[];for(let e=0;e<t.length;e++)i.push([null,null,t[e],s.index,e,{id:e,marker:{radius:0}}])}return i}addLayout(){let t=this.options.layoutAlgorithm=this.options.layoutAlgorithm||{},e=t.type||"packedbubble",s=this.chart.options.chart,o=this.chart.graphLayoutsStorage,a=this.chart.graphLayoutsLookup,r;o||(this.chart.graphLayoutsStorage=o={},this.chart.graphLayoutsLookup=a=[]),(r=o[e])||(t.enableSimulation=P(s.forExport)?!s.forExport:t.enableSimulation,o[e]=r=new i.layouts[e],r.init(t),a.splice(r.index,0,r)),this.layout=r,this.points.forEach(t=>{t.mass=2,t.degree=1,t.collisionNmb=1}),r.setArea(0,0,this.chart.plotWidth,this.chart.plotHeight),r.addElementsToCollection([this],r.series),r.addElementsToCollection(this.points,r.nodes)}addSeriesLayout(){let t=this.options.layoutAlgorithm=this.options.layoutAlgorithm||{},e=t.type||"packedbubble",s=this.chart.graphLayoutsStorage,o=this.chart.graphLayoutsLookup,a=k(t,t.parentNodeOptions,{enableSimulation:this.layout.options.enableSimulation}),r=s[e+"-series"];r||(s[e+"-series"]=r=new i.layouts[e],r.init(a),o.splice(r.index,0,r)),this.parentNodeLayout=r,this.createParentNodes()}calculateParentRadius(){let t=this.seriesBox();this.parentNodeRadius=x(Math.sqrt(2*this.parentNodeMass/Math.PI)+20,20,t?Math.max(Math.sqrt(Math.pow(t.width,2)+Math.pow(t.height,2))/2+20,20):Math.sqrt(2*this.parentNodeMass/Math.PI)+20),this.parentNode&&(this.parentNode.marker.radius=this.parentNode.radius=this.parentNodeRadius)}calculateZExtremes(){let t=this.chart.series,e=this.options.zMin,i=this.options.zMax,s=1/0,o=-1/0;return e&&i?[e,i]:(t.forEach(t=>{t.yData.forEach(t=>{P(t)&&(t>o&&(o=t),t<s&&(s=t))})}),[e=v(e,s),i=v(i,o)])}checkOverlap(t,e){let i=t[0]-e[0],s=t[1]-e[1];return Math.sqrt(i*i+s*s)-Math.abs(t[2]+e[2])<-.001}createParentNodes(){let t=this.pointClass,e=this.chart,i=this.parentNodeLayout,s=this.layout.options,o,a=this.parentNode,r={radius:this.parentNodeRadius,lineColor:this.color,fillColor:c(this.color).brighten(.4).get()};s.parentNodeOptions&&(r=k(s.parentNodeOptions.marker||{},r)),this.parentNodeMass=0,this.points.forEach(t=>{this.parentNodeMass+=Math.PI*Math.pow(t.marker.radius,2)}),this.calculateParentRadius(),i.nodes.forEach(t=>{t.seriesIndex===this.index&&(o=!0)}),i.setArea(0,0,e.plotWidth,e.plotHeight),o||(a||(a=new t(this,{mass:this.parentNodeRadius/2,marker:r,dataLabels:{inside:!1},states:{normal:{marker:r},hover:{marker:r}},dataLabelOnNull:!0,degree:this.parentNodeRadius,isParentNode:!0,seriesIndex:this.index})),this.parentNode&&(a.plotX=this.parentNode.plotX,a.plotY=this.parentNode.plotY),this.parentNode=a,i.addElementsToCollection([this],i.series),i.addElementsToCollection([a],i.nodes))}deferLayout(){let t=this.options.layoutAlgorithm;this.visible&&(this.addLayout(),t.splitSeries&&this.addSeriesLayout())}destroy(){this.chart.graphLayoutsLookup&&this.chart.graphLayoutsLookup.forEach(t=>{t.removeElementFromCollection(this,t.series)},this),this.parentNode&&this.parentNodeLayout&&(this.parentNodeLayout.removeElementFromCollection(this.parentNode,this.parentNodeLayout.nodes),this.parentNode.dataLabel&&(this.parentNode.dataLabel=this.parentNode.dataLabel.destroy())),g.destroy.apply(this,arguments)}drawDataLabels(){!this.deferDataLabels&&(g.drawDataLabels.call(this,this.points),this.parentNode&&(this.parentNode.formatPrefix="parentNode",g.drawDataLabels.call(this,[this.parentNode])))}drawGraph(){if(!this.layout||!this.layout.options.splitSeries)return;let t=this.chart,e=this.layout.options.parentNodeOptions.marker,i={fill:e.fillColor||c(this.color).brighten(.4).get(),opacity:e.fillOpacity,stroke:e.lineColor||this.color,"stroke-width":v(e.lineWidth,this.options.lineWidth)},s={};this.parentNodesGroup=this.plotGroup("parentNodesGroup","parentNode",this.visible?"inherit":"hidden",.1,t.seriesGroup),this.group?.attr({zIndex:2}),this.calculateParentRadius(),this.parentNode&&P(this.parentNode.plotX)&&P(this.parentNode.plotY)&&P(this.parentNodeRadius)&&(s=k({x:this.parentNode.plotX-this.parentNodeRadius,y:this.parentNode.plotY-this.parentNodeRadius,width:2*this.parentNodeRadius,height:2*this.parentNodeRadius},i),this.parentNode.graphic||(this.graph=this.parentNode.graphic=t.renderer.symbol(i.symbol).add(this.parentNodesGroup)),this.parentNode.graphic.attr(s))}drawTracker(){let t;let e=this.parentNode;super.drawTracker(),e&&(t=L(e.dataLabels)?e.dataLabels:e.dataLabel?[e.dataLabel]:[],e.graphic&&(e.graphic.element.point=e),t.forEach(t=>{(t.div||t.element).point=e}))}getPointRadius(){let t,e,i,s;let o=this.chart,a=o.plotWidth,r=o.plotHeight,n=this.options,l=n.useSimulation,h=Math.min(a,r),p={},d=[],c=o.allDataPoints||[],u=c.length;["minSize","maxSize"].forEach(t=>{let e=parseInt(n[t],10),i=/%$/.test(n[t]);p[t]=i?h*e/100:e*Math.sqrt(u)}),o.minRadius=t=p.minSize/Math.sqrt(u),o.maxRadius=e=p.maxSize/Math.sqrt(u);let g=l?this.calculateZExtremes():[t,e];c.forEach((o,a)=>{i=l?x(o[2],g[0],g[1]):o[2],0===(s=this.getRadius(g[0],g[1],t,e,i))&&(s=null),c[a][2]=s,d.push(s)}),this.radii=d}init(){return g.init.apply(this,arguments),m.call(this),this.eventsToUnbind.push(y(this,"updatedData",function(){this.chart.series.forEach(t=>{t.type===this.type&&(t.isDirty=!0)},this)})),this}onMouseUp(t){if(t.fixedPosition&&!t.removed){let i;let s=this.layout,o=this.parentNodeLayout;o&&s.options.dragBetweenSeries&&o.nodes.forEach(e=>{t&&t.marker&&e!==t.series.parentNode&&(i=s.getDistXY(t,e),s.vectorLength(i)-e.marker.radius-t.marker.radius<0&&(e.series.addPoint(k(t.options,{plotX:t.plotX,plotY:t.plotY}),!1),s.removeElementFromCollection(t,s.nodes),t.remove()))}),e.onMouseUp.apply(this,arguments)}}placeBubbles(t){let e=this.checkOverlap,i=this.positionBubble,s=[],o=1,a=0,r=0,n,l=[],h,p=t.sort((t,e)=>e[2]-t[2]);if(p.length){if(s.push([[0,0,p[0][2],p[0][3],p[0][4]]]),p.length>1)for(s.push([[0,0-p[1][2]-p[0][2],p[1][2],p[1][3],p[1][4]]]),h=2;h<p.length;h++)p[h][2]=p[h][2]||1,e(n=i(s[o][a],s[o-1][r],p[h]),s[o][0])?(s.push([]),r=0,s[o+1].push(i(s[o][a],s[o][0],p[h])),o++,a=0):o>1&&s[o-1][r+1]&&e(n,s[o-1][r+1])?(r++,s[o].push(i(s[o][a],s[o-1][r],p[h])),a++):(a++,s[o].push(n));this.chart.stages=s,this.chart.rawPositions=[].concat.apply([],s),this.resizeRadius(),l=this.chart.rawPositions}return l}pointAttribs(t,e){let i=this.options,s=t&&t.isParentNode,o=i.marker;s&&i.layoutAlgorithm&&i.layoutAlgorithm.parentNodeOptions&&(o=i.layoutAlgorithm.parentNodeOptions.marker);let a=o.fillOpacity,r=g.pointAttribs.call(this,t,e);return 1!==a&&(r["fill-opacity"]=a),r}positionBubble(t,e,i){let s=Math.asin,o=Math.acos,a=Math.pow,r=Math.abs,n=(0,Math.sqrt)(a(t[0]-e[0],2)+a(t[1]-e[1],2)),l=o((a(n,2)+a(i[2]+e[2],2)-a(i[2]+t[2],2))/(2*(i[2]+e[2])*n)),h=s(r(t[0]-e[0])/n),p=(t[1]-e[1]<0?0:Math.PI)+l+h*((t[0]-e[0])*(t[1]-e[1])<0?1:-1),d=Math.cos(p),c=Math.sin(p);return[e[0]+(e[2]+i[2])*c,e[1]-(e[2]+i[2])*d,i[2],i[3],i[4]]}render(){let t=[];g.render.apply(this,arguments),!this.options.dataLabels.allowOverlap&&(this.data.forEach(e=>{L(e.dataLabels)&&e.dataLabels.forEach(e=>{t.push(e)})}),this.options.useSimulation&&this.chart.hideOverlappingLabels(t))}resizeRadius(){let t,e,i,s,o;let a=this.chart,r=a.rawPositions,n=Math.min,l=Math.max,h=a.plotLeft,p=a.plotTop,d=a.plotHeight,c=a.plotWidth;for(let a of(t=i=Number.POSITIVE_INFINITY,e=s=Number.NEGATIVE_INFINITY,r))o=a[2],t=n(t,a[0]-o),e=l(e,a[0]+o),i=n(i,a[1]-o),s=l(s,a[1]+o);let u=[e-t,s-i],g=[(c-h)/u[0],(d-p)/u[1]],f=n.apply([],g);if(Math.abs(f-1)>1e-10){for(let t of r)t[2]*=f;this.placeBubbles(r)}else a.diffY=d/2+p-i-(s-i)/2,a.diffX=c/2+h-t-(e-t)/2}seriesBox(){let t;let e=this.chart,i=this.data,s=Math.max,o=Math.min,a=[e.plotLeft,e.plotLeft+e.plotWidth,e.plotTop,e.plotTop+e.plotHeight];return i.forEach(e=>{P(e.plotX)&&P(e.plotY)&&e.marker.radius&&(t=e.marker.radius,a[0]=o(a[0],e.plotX-t),a[1]=s(a[1],e.plotX+t),a[2]=o(a[2],e.plotY-t),a[3]=s(a[3],e.plotY+t))}),C(a.width/a.height)?a:null}setVisible(){let t=this;g.setVisible.apply(t,arguments),t.parentNodeLayout&&t.graph?t.visible?(t.graph.show(),t.parentNode.dataLabel&&t.parentNode.dataLabel.show()):(t.graph.hide(),t.parentNodeLayout.removeElementFromCollection(t.parentNode,t.parentNodeLayout.nodes),t.parentNode.dataLabel&&t.parentNode.dataLabel.hide()):t.layout&&(t.visible?t.layout.addElementsToCollection(t.points,t.layout.nodes):t.points.forEach(e=>{t.layout.removeElementFromCollection(e,t.layout.nodes)}))}translate(){let t,e,i;let s=this.chart,o=this.data,a=this.index,r=this.options.useSimulation;for(let n of(this.processedXData=this.xData,this.generatePoints(),P(s.allDataPoints)||(s.allDataPoints=this.accumulateAllPoints(),this.getPointRadius()),r?i=s.allDataPoints:(i=this.placeBubbles(s.allDataPoints),this.options.draggable=!1),i))n[3]===a&&(t=o[n[4]],e=v(n[2],void 0),r||(t.plotX=n[0]-s.plotLeft+s.diffX,t.plotY=n[1]-s.plotTop+s.diffY),C(e)&&(t.marker=S(t.marker,{radius:e,width:2*e,height:2*e}),t.radius=e));r&&this.deferLayout(),M(this,"afterTranslate")}}return A.defaultOptions=k(f.defaultOptions,a),S(A.prototype,{pointClass:o,axisTypes:[],directTouch:!0,forces:["barycenter","repulsive"],hasDraggableNodes:!0,invertible:!1,isCartesian:!1,noSharedTooltip:!0,pointArrayMap:["value"],pointValKey:"value",requireSorting:!1,trackerGroups:["group","dataLabelsGroup","parentNodesGroup"],initDataLabels:b,alignDataLabel:g.alignDataLabel,indexateNodes:u,onMouseDown:e.onMouseDown,onMouseMove:e.onMouseMove,redrawHalo:e.redrawHalo,searchPoint:u}),n.registerSeriesType("packedbubble",A),A}),i(e,"Series/Polygon/PolygonSeriesDefaults.js",[],function(){return{marker:{enabled:!1,states:{hover:{enabled:!1}}},stickyTracking:!1,tooltip:{followPointer:!0,pointFormat:""},trackByArea:!0,legendSymbol:"rectangle"}}),i(e,"Series/Polygon/PolygonSeries.js",[e["Core/Globals.js"],e["Series/Polygon/PolygonSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{noop:o}=t,{area:a,line:r,scatter:n}=i.seriesTypes,{extend:l,merge:h}=s;class p extends n{getGraphPath(){let t=r.prototype.getGraphPath.call(this),e=t.length+1;for(;e--;)(e===t.length||"M"===t[e][0])&&e>0&&t.splice(e,0,["Z"]);return this.areaPath=t,t}drawGraph(){this.options.fillColor=this.color,a.prototype.drawGraph.call(this)}}return p.defaultOptions=h(n.defaultOptions,e),l(p.prototype,{type:"polygon",drawTracker:r.prototype.drawTracker,setStackedPoints:o}),i.registerSeriesType("polygon",p),p}),i(e,"Core/Axis/RadialAxisDefaults.js",[],function(){return{circular:{gridLineWidth:1,labels:{align:void 0,x:0,y:void 0,style:{textOverflow:"none"}},maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},radial:{gridLineInterpolation:"circle",gridLineWidth:1,labels:{align:"right",padding:5,x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},radialGauge:{endOnTick:!1,gridLineWidth:0,labels:{align:"center",distance:-25,x:0,y:void 0},lineWidth:1,minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickPosition:"inside",tickWidth:2,title:{rotation:0,text:""},zIndex:2}}}),i(e,"Core/Axis/RadialAxis.js",[e["Core/Axis/RadialAxisDefaults.js"],e["Core/Defaults.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i,s){var o;let{defaultOptions:a}=e,{composed:r,noop:n}=i,{addEvent:l,correctFloat:h,defined:p,extend:d,fireEvent:c,isObject:u,merge:g,pick:f,pushUnique:b,relativeLength:m,wrap:y}=s;return function(e){function s(){this.autoConnect=this.isCircular&&void 0===f(this.userMax,this.options.max)&&h(this.endAngleRad-this.startAngleRad)===h(2*Math.PI),!this.isCircular&&this.chart.inverted&&this.max++,this.autoConnect&&(this.max+=this.categories&&1||this.pointRange||this.closestPointRange||0)}function o(){return()=>{if(this.isRadial&&this.tickPositions&&this.options.labels&&!0!==this.options.labels.allowOverlap)return this.tickPositions.map(t=>this.ticks[t]&&this.ticks[t].label).filter(t=>!!t)}}function x(){return n}function P(t,e,i){let s=this.pane.center,o=t.value,a,r,n;return this.isCircular?(p(o)?t.point&&(t.point.shapeArgs||{}).start&&(o=this.chart.inverted?this.translate(t.point.rectPlotY,!0):t.point.x):(r=t.chartX||0,n=t.chartY||0,o=this.translate(Math.atan2(n-i,r-e)-this.startAngleRad,!0)),r=(a=this.getPosition(o)).x,n=a.y):(p(o)||(r=t.chartX,n=t.chartY),p(r)&&p(n)&&(i=s[1]+this.chart.plotTop,o=this.translate(Math.min(Math.sqrt(Math.pow(r-e,2)+Math.pow(n-i,2)),s[2]/2)-s[3]/2,!0))),[o,r||0,n||0]}function S(t,e,i){let s=this.pane.center,o=this.chart,a=this.left||0,r=this.top||0,n,l=f(e,s[2]/2-this.offset),h;return void 0===i&&(i=this.horiz?0:this.center&&-this.center[3]/2),i&&(l+=i),this.isCircular||void 0!==e?((h=this.chart.renderer.symbols.arc(a+s[0],r+s[1],l,l,{start:this.startAngleRad,end:this.endAngleRad,open:!0,innerR:0})).xBounds=[a+s[0]],h.yBounds=[r+s[1]-l]):(n=this.postTranslate(this.angleRad,l),h=[["M",this.center[0]+o.plotLeft,this.center[1]+o.plotTop],["L",n.x,n.y]]),h}function M(){this.constructor.prototype.getOffset.call(this),this.chart.axisOffset[this.side]=0}function L(t,e,i){let s=this.chart,o=t=>{if("string"==typeof t){let e=parseInt(t,10);return d.test(t)&&(e=e*n/100),e}return t},a=this.center,r=this.startAngleRad,n=a[2]/2,l=Math.min(this.offset,0),h=this.left||0,p=this.top||0,d=/%$/,c=this.isCircular,u,g,b,m,y,x,P=f(o(i.outerRadius),n),S=o(i.innerRadius),M=f(o(i.thickness),10);if("polygon"===this.options.gridLineInterpolation)x=this.getPlotLinePath({value:t}).concat(this.getPlotLinePath({value:e,reverse:!0}));else{t=Math.max(t,this.min),e=Math.min(e,this.max);let o=this.translate(t),n=this.translate(e);c||(P=o||0,S=n||0),"circle"!==i.shape&&c?(u=r+(o||0),g=r+(n||0)):(u=-Math.PI/2,g=1.5*Math.PI,y=!0),P-=l,M-=l,x=s.renderer.symbols.arc(h+a[0],p+a[1],P,P,{start:Math.min(u,g),end:Math.max(u,g),innerR:f(S,P-M),open:y,borderRadius:i.borderRadius}),c&&(b=(g+u)/2,m=h+a[0]+a[2]/2*Math.cos(b),x.xBounds=b>-Math.PI/2&&b<Math.PI/2?[m,s.plotWidth]:[0,m],x.yBounds=[p+a[1]+a[2]/2*Math.sin(b)],x.yBounds[0]+=b>-Math.PI&&b<0||b>Math.PI?-10:10)}return x}function C(t){let e=this.pane.center,i=this.chart,s=i.inverted,o=t.reverse,a=this.pane.options.background?this.pane.options.background[0]||this.pane.options.background:{},r=a.innerRadius||"0%",n=a.outerRadius||"100%",l=e[0]+i.plotLeft,h=e[1]+i.plotTop,p=this.height,d=t.isCrosshair,c=e[3]/2,u=t.value,g,f,b,y,x,P,S,M,L,C=this.getPosition(u),k=C.x,v=C.y;if(d&&(u=(M=this.getCrosshairPosition(t,l,h))[0],k=M[1],v=M[2]),this.isCircular)f=Math.sqrt(Math.pow(k-l,2)+Math.pow(v-h,2)),b="string"==typeof r?m(r,1):r/f,y="string"==typeof n?m(n,1):n/f,e&&c&&(b<(g=c/f)&&(b=g),y<g&&(y=g)),L=[["M",l+b*(k-l),h-b*(h-v)],["L",k-(1-y)*(k-l),v+(1-y)*(h-v)]];else if((u=this.translate(u))&&(u<0||u>p)&&(u=0),"circle"===this.options.gridLineInterpolation)L=this.getLinePath(0,u,c);else if(L=[],i[s?"yAxis":"xAxis"].forEach(t=>{t.pane===this.pane&&(x=t)}),x){S=x.tickPositions,x.autoConnect&&(S=S.concat([S[0]])),o&&(S=S.slice().reverse()),u&&(u+=c);for(let t=0;t<S.length;t++)P=x.getPosition(S[t],u),L.push(t?["L",P.x,P.y]:["M",P.x,P.y])}return L}function k(t,e){let i=this.translate(t);return this.postTranslate(this.isCircular?i:this.angleRad,f(this.isCircular?e:i<0?0:i,this.center[2]/2)-this.offset)}function v(){let t=this.center,e=this.chart,i=this.options.title;return{x:e.plotLeft+t[0]+(i.x||0),y:e.plotTop+t[1]-({high:.5,middle:.25,low:0})[i.align]*t[2]+(i.y||0)}}function A(t){t.beforeSetTickPositions=s,t.createLabelCollector=o,t.getCrosshairPosition=P,t.getLinePath=S,t.getOffset=M,t.getPlotBandPath=L,t.getPlotLinePath=C,t.getPosition=k,t.getTitlePosition=v,t.postTranslate=D,t.setAxisSize=B,t.setAxisTranslation=z,t.setOptions=O}function w(){let t=this.chart,e=this.options,i=t.angular&&this.isXAxis,s=this.pane,o=s&&s.options;if(!i&&s&&(t.angular||t.polar)){let t=2*Math.PI,i=(f(o.startAngle,0)-90)*Math.PI/180,s=(f(o.endAngle,f(o.startAngle,0)+360)-90)*Math.PI/180;this.angleRad=(e.angle||0)*Math.PI/180,this.startAngleRad=i,this.endAngleRad=s,this.offset=e.offset||0;let a=(i%t+t)%t,r=(s%t+t)%t;a>Math.PI&&(a-=t),r>Math.PI&&(r-=t),this.normalizedStartAngleRad=a,this.normalizedEndAngleRad=r}}function T(t){this.isRadial&&(t.align=void 0,t.preventDefault())}function N(){if(this.chart&&this.chart.labelCollectors){let t=this.labelCollector?this.chart.labelCollectors.indexOf(this.labelCollector):-1;t>=0&&this.chart.labelCollectors.splice(t,1)}}function X(t){let e;let i=this.chart,s=i.angular,o=i.polar,a=this.isXAxis,r=this.coll,l=t.userOptions.pane||0,h=this.pane=i.pane&&i.pane[l];if("colorAxis"===r){this.isRadial=!1;return}s?(s&&a?(this.isHidden=!0,this.createLabelCollector=x,this.getOffset=n,this.redraw=E,this.render=E,this.setScale=n,this.setCategories=n,this.setTitle=n):A(this),e=!a):o&&(A(this),e=this.horiz),s||o?(this.isRadial=!0,this.labelCollector||(this.labelCollector=this.createLabelCollector()),this.labelCollector&&i.labelCollectors.push(this.labelCollector)):this.isRadial=!1,h&&e&&(h.axis=this),this.isCircular=e}function R(){this.isRadial&&this.beforeSetTickPositions()}function Y(t){let e=this.label;if(!e)return;let i=this.axis,s=e.getBBox(),o=i.options.labels,a=(i.translate(this.pos)+i.startAngleRad+Math.PI/2)/Math.PI*180%360,r=Math.round(a),n=p(o.y)?0:-(.3*s.height),l=o.y,h,d=20,c=o.align,u="end",g=r<0?r+360:r,b=g,y=0,x=0;i.isRadial&&(h=i.getPosition(this.pos,i.center[2]/2+m(f(o.distance,-25),i.center[2]/2,-i.center[2]/2)),"auto"===o.rotation?e.attr({rotation:a}):p(l)||(l=i.chart.renderer.fontMetrics(e).b-s.height/2),p(c)||(i.isCircular?(s.width>i.len*i.tickInterval/(i.max-i.min)&&(d=0),c=a>d&&a<180-d?"left":a>180+d&&a<360-d?"right":"center"):c="center",e.attr({align:c})),"auto"===c&&2===i.tickPositions.length&&i.isCircular&&(g>90&&g<180?g=180-g:g>270&&g<=360&&(g=540-g),b>180&&b<=360&&(b=360-b),(i.pane.options.startAngle===r||i.pane.options.startAngle===r+360||i.pane.options.startAngle===r-360)&&(u="start"),c=r>=-90&&r<=90||r>=-360&&r<=-270||r>=270&&r<=360?"start"===u?"right":"left":"start"===u?"left":"right",b>70&&b<110&&(c="center"),g<15||g>=180&&g<195?y=.3*s.height:g>=15&&g<=35?y="start"===u?0:.75*s.height:g>=195&&g<=215?y="start"===u?.75*s.height:0:g>35&&g<=90?y="start"===u?-(.25*s.height):s.height:g>215&&g<=270&&(y="start"===u?s.height:-(.25*s.height)),b<15?x="start"===u?-(.15*s.height):.15*s.height:b>165&&b<=180&&(x="start"===u?.15*s.height:-(.15*s.height)),e.attr({align:c}),e.translate(x,y+n)),t.pos.x=h.x+(o.x||0),t.pos.y=h.y+(l||0))}function j(t){this.axis.getPosition&&d(t.pos,this.axis.getPosition(this.pos))}function I({options:t}){t.xAxis&&g(!0,e.radialDefaultOptions.circular,t.xAxis),t.yAxis&&g(!0,e.radialDefaultOptions.radialGauge,t.yAxis)}function D(t,e){let i=this.chart,s=this.center;return t=this.startAngleRad+t,{x:i.plotLeft+s[0]+Math.cos(t)*e,y:i.plotTop+s[1]+Math.sin(t)*e}}function E(){this.isDirty=!1}function B(){let t,e;this.constructor.prototype.setAxisSize.call(this),this.isRadial&&(this.pane.updateCenter(this),t=this.center=this.pane.center.slice(),this.isCircular?this.sector=this.endAngleRad-this.startAngleRad:(e=this.postTranslate(this.angleRad,t[3]/2),t[0]=e.x-this.chart.plotLeft,t[1]=e.y-this.chart.plotTop),this.len=this.width=this.height=(t[2]-t[3])*f(this.sector,1)/2)}function z(){this.constructor.prototype.setAxisTranslation.call(this),this.center&&(this.isCircular?this.transA=(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.transA=(this.center[2]-this.center[3])/2/(this.max-this.min||1),this.isXAxis?this.minPixelPadding=this.transA*this.minPointOffset:this.minPixelPadding=0)}function O(t){let{coll:i}=this,{angular:s,inverted:o,polar:r}=this.chart,n={};s?this.isXAxis||(n=g(a.yAxis,e.radialDefaultOptions.radialGauge)):r&&(n=this.horiz?g(a.xAxis,e.radialDefaultOptions.circular):g("xAxis"===i?a.xAxis:a.yAxis,e.radialDefaultOptions.radial)),o&&"yAxis"===i&&(n.stackLabels=u(a.yAxis,!0)?a.yAxis.stackLabels:{},n.reversedStacks=!0);let l=this.options=g(n,t);l.plotBands||(l.plotBands=[]),c(this,"afterSetOptions")}function W(t,e,i,s,o,a,r){let n;let l=this.axis;return l.isRadial?["M",e,i,"L",(n=l.getPosition(this.pos,l.center[2]/2+s)).x,n.y]:t.call(this,e,i,s,o,a,r)}e.radialDefaultOptions=g(t),e.compose=function(t,e){return b(r,"Axis.Radial")&&(l(t,"afterInit",w),l(t,"autoLabelAlign",T),l(t,"destroy",N),l(t,"init",X),l(t,"initialAxisTranslation",R),l(e,"afterGetLabelPosition",Y),l(e,"afterGetPosition",j),l(i,"setOptions",I),y(e.prototype,"getMarkPath",W)),t}}(o||(o={})),o}),i(e,"Series/PolarComposition.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Globals.js"],e["Core/Series/Series.js"],e["Extensions/Pane/Pane.js"],e["Core/Axis/RadialAxis.js"],e["Core/Utilities.js"]],function(t,e,i,s,o,a){let{animObject:r}=t,{composed:n}=e,{addEvent:l,defined:h,find:p,isNumber:d,merge:c,pick:u,pushUnique:g,relativeLength:f,splat:b,uniqueKey:m,wrap:y}=a;function x(){(this.pane||[]).forEach(t=>{t.render()})}function P(t){let e=t.args[0].xAxis,i=t.args[0].yAxis,s=t.args[0].chart;e&&i&&("polygon"===i.gridLineInterpolation?(e.startOnTick=!0,e.endOnTick=!0):"polygon"===e.gridLineInterpolation&&s.inverted&&(i.startOnTick=!0,i.endOnTick=!0))}function S(){this.pane||(this.pane=[]),this.options.pane=b(this.options.pane),this.options.pane.forEach(t=>{new s(t,this)},this)}function M(t){let e=t.args.marker,i=this.chart.xAxis[0],s=this.chart.yAxis[0],o=this.chart.inverted,a=o?s:i,r=o?i:s;if(this.chart.polar){t.preventDefault();let i=(e.attr?e.attr("start"):e.start)-a.startAngleRad,s=e.attr?e.attr("r"):e.r,o=(e.attr?e.attr("end"):e.end)-a.startAngleRad,n=e.attr?e.attr("innerR"):e.innerR;t.result.x=i+a.pos,t.result.width=o-i,t.result.y=r.len+r.pos-s,t.result.height=s-n}}function L(t){let e=this.chart;if(e.polar&&e.hoverPane&&e.hoverPane.axis){t.preventDefault();let i=e.hoverPane.center,s=e.mouseDownX||0,o=e.mouseDownY||0,a=t.args.chartY,r=t.args.chartX,n=2*Math.PI,l=e.hoverPane.axis.startAngleRad,h=e.hoverPane.axis.endAngleRad,p=e.inverted?e.xAxis[0]:e.yAxis[0],d={},c="arc";if(d.x=i[0]+e.plotLeft,d.y=i[1]+e.plotTop,this.zoomHor){let t=l>0?h-l:Math.abs(l)+Math.abs(h),u=Math.atan2(o-e.plotTop-i[1],s-e.plotLeft-i[0])-l,g=Math.atan2(a-e.plotTop-i[1],r-e.plotLeft-i[0])-l;d.r=i[2]/2,d.innerR=i[3]/2,u<=0&&(u+=n),g<=0&&(g+=n),g<u&&(g=[u,u=g][0]),t<n&&l+g>h+(n-t)/2&&(g=u,u=l<=0?l:0);let f=d.start=Math.max(u+l,l),b=d.end=Math.min(g+l,h);if("polygon"===p.options.gridLineInterpolation){let t=e.hoverPane.axis,s=f-t.startAngleRad+t.pos,o=p.getPlotLinePath({value:p.max}),a=t.toValue(s),r=t.toValue(s+(b-f));if(a<t.getExtremes().min){let{min:e,max:i}=t.getExtremes();a=i-(e-a)}if(r<t.getExtremes().min){let{min:e,max:i}=t.getExtremes();r=i-(e-r)}r<a&&(r=[a,a=r][0]),(o=A(o,a,r,t)).push(["L",i[0]+e.plotLeft,e.plotTop+i[1]]),d.d=o,c="path"}}if(this.zoomVert){let t=e.inverted?e.xAxis[0]:e.yAxis[0],n=Math.sqrt(Math.pow(s-e.plotLeft-i[0],2)+Math.pow(o-e.plotTop-i[1],2)),p=Math.sqrt(Math.pow(r-e.plotLeft-i[0],2)+Math.pow(a-e.plotTop-i[1],2));if(p<n&&(n=[p,p=n][0]),p>i[2]/2&&(p=i[2]/2),n<i[3]/2&&(n=i[3]/2),this.zoomHor||(d.start=l,d.end=h),d.r=p,d.innerR=n,"polygon"===t.options.gridLineInterpolation){let e=t.toValue(t.len+t.pos-n),i=t.toValue(t.len+t.pos-p),s=t.getPlotLinePath({value:i}).concat(t.getPlotLinePath({value:e,reverse:!0}));d.d=s,c="path"}}if(this.zoomHor&&this.zoomVert&&"polygon"===p.options.gridLineInterpolation){let t=e.hoverPane.axis,i=d.start||0,s=d.end||0,o=i-t.startAngleRad+t.pos,a=t.toValue(o),r=t.toValue(o+(s-i));if(d.d instanceof Array){let t=d.d.slice(0,d.d.length/2),i=d.d.slice(d.d.length/2,d.d.length);i=[...i].reverse();let s=e.hoverPane.axis;t=A(t,a,r,s),(i=A(i,a,r,s))&&(i[0][0]="L"),i=[...i].reverse(),d.d=t.concat(i),c="path"}}t.attrs=d,t.shapeType=c}}function C(){let t=this.chart;t.polar&&(this.polar=new E(this),t.inverted&&(this.isRadialSeries=!0,this.is("column")&&(this.isRadialBar=!0)))}function k(){if(this.chart.polar&&this.xAxis){let{xAxis:t,yAxis:i}=this,s=this.chart;this.kdByAngle=s.tooltip&&s.tooltip.shared,this.kdByAngle||s.inverted?this.searchPoint=v:this.options.findNearestPointBy="xy";let o=this.points,a=o.length;for(;a--;)this.is("column")||this.is("columnrange")||this.polar.toXY(o[a]),s.hasParallelCoordinates||this.yAxis.reversed||(u(o[a].y,Number.MIN_VALUE)<i.min||o[a].x<t.min||o[a].x>t.max?(o[a].isNull=!0,o[a].plotY=NaN):o[a].isNull=o[a].isValid&&!o[a].isValid());this.hasClipCircleSetter||(this.hasClipCircleSetter=!!this.eventsToUnbind.push(l(this,"afterRender",function(){let t;s.polar&&!1!==this.options.clip&&(t=this.yAxis.pane.center,this.clipCircle?this.clipCircle.animate({x:t[0],y:t[1],r:t[2]/2,innerR:t[3]/2}):this.clipCircle=function(t,e,i,s,o){let a=m(),r=t.createElement("clipPath").attr({id:a}).add(t.defs),n=o?t.arc(e,i,s,o,0,2*Math.PI).add(r):t.circle(e,i,s).add(r);return n.id=a,n.clipPath=r,n}(s.renderer,t[0],t[1],t[2]/2,t[3]/2),this.group.clip(this.clipCircle),this.setClip=e.noop)})))}}function v(t){let e=this.chart,i=this.xAxis,s=this.yAxis,o=i.pane&&i.pane.center,a=t.chartX-(o&&o[0]||0)-e.plotLeft,r=t.chartY-(o&&o[1]||0)-e.plotTop,n=e.inverted?{clientX:t.chartX-s.pos,plotY:t.chartY-i.pos}:{clientX:180+-180/Math.PI*Math.atan2(a,r)};return this.searchKDTree(n)}function A(t,e,i,s){let o=s.tickInterval,a=s.tickPositions,r=p(a,t=>t>=i),n=p([...a].reverse(),t=>t<=e);return h(r)||(r=a[a.length-1]),h(n)||(n=a[0],r+=o,t[0][0]="L",t.unshift(t[t.length-3])),(t=t.slice(a.indexOf(n),a.indexOf(r)+1))[0][0]="M",t}function w(t,e){return p(this.pane||[],t=>t.options.id===e)||t.call(this,e)}function T(t,e,s,o,a,r){let n,l,h;let p=this.chart,d=u(o.inside,!!this.options.stacking);if(p.polar){if(n=e.rectPlotX/Math.PI*180,p.inverted)this.forceDL=p.isInsidePlot(e.plotX,e.plotY),d&&e.shapeArgs?(l=e.shapeArgs,a=c(a,{x:(h=this.yAxis.postTranslate(((l.start||0)+(l.end||0))/2-this.xAxis.startAngleRad,e.barX+e.pointWidth/2)).x-p.plotLeft,y:h.y-p.plotTop})):e.tooltipPos&&(a=c(a,{x:e.tooltipPos[0],y:e.tooltipPos[1]})),o.align=u(o.align,"center"),o.verticalAlign=u(o.verticalAlign,"middle");else{var g;let t,e;null===(g=o).align&&(t=n>20&&n<160?"left":n>200&&n<340?"right":"center",g.align=t),null===g.verticalAlign&&(e=n<45||n>315?"bottom":n>135&&n<225?"top":"middle",g.verticalAlign=e),o=g}i.prototype.alignDataLabel.call(this,e,s,o,a,r),this.isRadialBar&&e.shapeArgs&&e.shapeArgs.start===e.shapeArgs.end?s.hide():s.show()}else t.call(this,e,s,o,a,r)}function N(){let t=this.options,e=t.stacking,i=this.chart,s=this.xAxis,o=this.yAxis,r=o.reversed,n=o.center,l=s.startAngleRad,p=s.endAngleRad-l,c=t.threshold,u=0,g,b,m,y,x,P=0,S=0,M,L,C,k,v,A,w,T;if(s.isRadial)for(m=(g=this.points).length,y=o.translate(o.min),x=o.translate(o.max),c=t.threshold||0,i.inverted&&d(c)&&h(u=o.translate(c))&&(u<0?u=0:u>p&&(u=p),this.translatedThreshold=u+l);m--;){if(A=(b=g[m]).barX,L=b.x,C=b.y,b.shapeType="arc",i.inverted){b.plotY=o.translate(C),e&&o.stacking?(v=o.stacking.stacks[(C<0?"-":"")+this.stackKey],this.visible&&v&&v[L]&&!b.isNull&&(k=v[L].points[this.getStackIndicator(void 0,L,this.index).key],P=o.translate(k[0]),S=o.translate(k[1]),h(P)&&(P=a.clamp(P,0,p)))):(P=u,S=b.plotY),P>S&&(S=[P,P=S][0]),r?S>y?S=y:P<x?P=x:(P>y||S<x)&&(P=S=p):P<y?P=y:S>x?S=x:(S<y||P>x)&&(P=S=0),o.min>o.max&&(P=S=r?p:0),P+=l,S+=l,n&&(b.barX=A+=n[3]/2),w=Math.max(A,0),T=Math.max(A+b.pointWidth,0);let i=t.borderRadius,s=f(("object"==typeof i?i.radius:i)||0,T-w);b.shapeArgs={x:n[0],y:n[1],r:T,innerR:w,start:P,end:S,borderRadius:s},b.opacity=P===S?0:void 0,b.plotY=(h(this.translatedThreshold)&&(P<this.translatedThreshold?P:S))-l}else P=A+l,b.shapeArgs=this.polar.arc(b.yBottom,b.plotY,P,P+b.pointWidth),b.shapeArgs.borderRadius=0;this.polar.toXY(b),i.inverted?(M=o.postTranslate(b.rectPlotY,A+b.pointWidth/2),b.tooltipPos=[M.x-i.plotLeft,M.y-i.plotTop]):b.tooltipPos=[b.plotX,b.plotY],n&&(b.ttBelow=b.plotY>n[1])}}function X(t,e){let i,s;let o=this;if(this.chart.polar){e=e||this.points;for(let t=0;t<e.length;t++)if(!e[t].isNull){i=t;break}!1!==this.options.connectEnds&&void 0!==i&&(this.connectEnds=!0,e.splice(e.length,0,e[i]),s=!0),e.forEach(t=>{void 0===t.polarPlotY&&o.polar.toXY(t)})}let a=t.apply(this,[].slice.call(arguments,1));return s&&e.pop(),a}function R(t,e){let i=this.chart,s={xAxis:[],yAxis:[]};return i.polar?i.axes.forEach(t=>{if("colorAxis"===t.coll)return;let o=t.isXAxis,a=t.center,r=e.chartX-a[0]-i.plotLeft,n=e.chartY-a[1]-i.plotTop;s[o?"xAxis":"yAxis"].push({axis:t,value:t.translate(o?Math.PI-Math.atan2(r,n):Math.sqrt(Math.pow(r,2)+Math.pow(n,2)),!0)})}):s=t.call(this,e),s}function Y(t,e){this.chart.polar||t.call(this,e)}function j(t,i){let s=this,o=this.chart,a=this.group,n=this.markerGroup,l=this.xAxis&&this.xAxis.center,h=o.plotLeft,p=o.plotTop,d=this.options.animation,c,g,f,b,m,y;o.polar?s.isRadialBar?i||(s.startAngleRad=u(s.translatedThreshold,s.xAxis.startAngleRad),e.seriesTypes.pie.prototype.animate.call(s,i)):(d=r(d),s.is("column")?i||(g=l[3]/2,s.points.forEach(t=>{f=t.graphic,m=(b=t.shapeArgs)&&b.r,y=b&&b.innerR,f&&b&&(f.attr({r:g,innerR:g}),f.animate({r:m,innerR:y},s.options.animation))})):i?(c={translateX:l[0]+h,translateY:l[1]+p,scaleX:.001,scaleY:.001},a.attr(c),n&&n.attr(c)):(c={translateX:h,translateY:p,scaleX:1,scaleY:1},a.animate(c,d),n&&n.animate(c,d))):t.call(this,i)}function I(t,e,i,s){let o,a;if(this.chart.polar){if(s){let t=(a=function t(e,i,s,o){let a,r,n,l,h,p;let d=o?1:0,c=(a=i>=0&&i<=e.length-1?i:i<0?e.length-1+i:0)-1<0?e.length-(1+d):a-1,u=a+1>e.length-1?d:a+1,g=e[c],f=e[u],b=g.plotX,m=g.plotY,y=f.plotX,x=f.plotY,P=e[a].plotX,S=e[a].plotY;r=(1.5*P+b)/2.5,n=(1.5*S+m)/2.5,l=(1.5*P+y)/2.5,h=(1.5*S+x)/2.5;let M=Math.sqrt(Math.pow(r-P,2)+Math.pow(n-S,2)),L=Math.sqrt(Math.pow(l-P,2)+Math.pow(h-S,2)),C=Math.atan2(n-S,r-P);p=Math.PI/2+(C+Math.atan2(h-S,l-P))/2,Math.abs(C-p)>Math.PI/2&&(p-=Math.PI),r=P+Math.cos(p)*M,n=S+Math.sin(p)*M;let k={rightContX:l=P+Math.cos(Math.PI+p)*L,rightContY:h=S+Math.sin(Math.PI+p)*L,leftContX:r,leftContY:n,plotX:P,plotY:S};return s&&(k.prevPointCont=t(e,c,!1,o)),k}(e,s,!0,this.connectEnds)).prevPointCont&&a.prevPointCont.rightContX,i=a.prevPointCont&&a.prevPointCont.rightContY;o=["C",d(t)?t:a.plotX,d(i)?i:a.plotY,d(a.leftContX)?a.leftContX:a.plotX,d(a.leftContY)?a.leftContY:a.plotY,a.plotX,a.plotY]}else o=["M",i.plotX,i.plotY]}else o=t.call(this,e,i,s);return o}function D(t,e,i=this.plotY){if(!this.destroyed){let{plotX:s,series:o}=this,{chart:a}=o;return a.polar&&d(s)&&d(i)?[s+(e?a.plotLeft:0),i+(e?a.plotTop:0)]:t.call(this,e,i)}}class E{static compose(t,e,i,a,r,h,p,d,c,u){if(s.compose(e,i),o.compose(t,r),g(n,"Polar")){let t=e.prototype,s=h.prototype,o=i.prototype,r=a.prototype;if(l(e,"afterDrawChartBox",x),l(e,"getAxes",S),l(e,"init",P),y(t,"get",w),y(o,"getCoordinates",R),y(o,"pinch",Y),l(i,"getSelectionMarkerAttrs",L),l(i,"getSelectionBox",M),l(a,"afterInit",C),l(a,"afterTranslate",k,{order:2}),l(a,"afterColumnTranslate",N,{order:4}),y(r,"animate",j),y(s,"pos",D),d){let t=d.prototype;y(t,"alignDataLabel",T),y(t,"animate",j)}if(c&&y(c.prototype,"getGraphPath",X),u){let t=u.prototype;y(t,"getPointSpline",I),p&&(p.prototype.getPointSpline=t.getPointSpline)}}}constructor(t){this.series=t}arc(t,e,i,s){let o=this.series,a=o.xAxis.center,r=o.yAxis.len,n=a[3]/2,l=r-e+n,h=r-u(t,r)+n;return o.yAxis.reversed&&(l<0&&(l=n),h<0&&(h=n)),{x:a[0],y:a[1],r:l,innerR:h,start:i,end:s}}toXY(t){let e=this.series,i=e.chart,s=e.xAxis,o=e.yAxis,a=t.plotX,r=i.inverted,n=t.y,l=t.plotY,h=r?a:o.len-l,p;if(r&&e&&!e.isRadialBar&&(t.plotY=l=d(n)?o.translate(n):0),t.rectPlotX=a,t.rectPlotY=l,o.center&&(h+=o.center[3]/2),d(l)){let e=r?o.postTranslate(l,h):s.postTranslate(a,h);t.plotX=t.polarPlotX=e.x-i.plotLeft,t.plotY=t.polarPlotY=e.y-i.plotTop}e.kdByAngle?((p=(a/Math.PI*180+s.pane.options.startAngle)%360)<0&&(p+=360),t.clientX=p):t.clientX=t.plotX}}return E}),i(e,"Core/Axis/WaterfallAxis.js",[e["Core/Globals.js"],e["Core/Axis/Stacking/StackItem.js"],e["Core/Utilities.js"]],function(t,e,i){var s;let{composed:o}=t,{addEvent:a,objectEach:r,pushUnique:n}=i;return function(t){function i(){let t=this.waterfall.stacks;t&&(t.changed=!1,delete t.alreadyChanged)}function s(){let t=this.options.stackLabels;t&&t.enabled&&this.waterfall.stacks&&this.waterfall.renderStackTotals()}function l(){this.waterfall||(this.waterfall=new p(this))}function h(){let t=this.axes;for(let e of this.series)if(e.options.stacking){for(let e of t)e.isXAxis||(e.waterfall.stacks.changed=!0);break}}t.compose=function(t,e){n(o,"Axis.Waterfall")&&(a(t,"init",l),a(t,"afterBuildStacks",i),a(t,"afterRender",s),a(e,"beforeRedraw",h))};class p{constructor(t){this.axis=t,this.stacks={changed:!1}}renderStackTotals(){let t=this.axis,i=t.waterfall.stacks,s=t.stacking&&t.stacking.stackTotalGroup,o=new e(t,t.options.stackLabels||{},!1,0,void 0);this.dummyStackItem=o,s&&r(i,t=>{r(t,(t,i)=>{o.total=t.stackTotal,o.x=+i,t.label&&(o.label=t.label),e.prototype.render.call(o,s),t.label=o.label,delete o.label})}),o.total=null}}t.Composition=p}(s||(s={})),s}),i(e,"Series/Waterfall/WaterfallPoint.js",[e["Series/Column/ColumnSeries.js"],e["Core/Series/Point.js"],e["Core/Utilities.js"]],function(t,e,i){let{isNumber:s}=i;class o extends t.prototype.pointClass{getClassName(){let t=e.prototype.getClassName.call(this);return this.isSum?t+=" highcharts-sum":this.isIntermediateSum&&(t+=" highcharts-intermediate-sum"),t}isValid(){return s(this.y)||this.isSum||!!this.isIntermediateSum}}return o}),i(e,"Series/Waterfall/WaterfallSeriesDefaults.js",[],function(){return{dataLabels:{inside:!0},lineWidth:1,lineColor:"#333333",dashStyle:"Dot",borderColor:"#333333",states:{hover:{lineWidthPlus:0}}}}),i(e,"Series/Waterfall/WaterfallSeries.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"],e["Core/Axis/WaterfallAxis.js"],e["Series/Waterfall/WaterfallPoint.js"],e["Series/Waterfall/WaterfallSeriesDefaults.js"]],function(t,e,i,s,o){let{column:a,line:r}=t.seriesTypes,{addEvent:n,arrayMax:l,arrayMin:h,correctFloat:p,crisp:d,extend:c,isNumber:u,merge:g,objectEach:f,pick:b}=e;function m(t,e){return Object.hasOwnProperty.call(t,e)}class y extends a{generatePoints(){a.prototype.generatePoints.apply(this);for(let t=0,e=this.points.length;t<e;t++){let e=this.points[t],i=this.processedYData[t];u(i)&&(e.isIntermediateSum||e.isSum)&&(e.y=p(i))}}processData(t){let e,i,s,o,a,r;let n=this.options,l=this.yData,h=n.data,d=l.length,c=n.threshold||0;s=i=o=a=0;for(let t=0;t<d;t++)r=l[t],e=h&&h[t]?h[t]:{},"sum"===r||e.isSum?l[t]=p(s):"intermediateSum"===r||e.isIntermediateSum?(l[t]=p(i),i=0):(s+=r,i+=r),o=Math.min(s,o),a=Math.max(s,a);super.processData.call(this,t),n.stacking||(this.dataMin=o+c,this.dataMax=a)}toYData(t){return t.isSum?"sum":t.isIntermediateSum?"intermediateSum":t.y}updateParallelArrays(t,e){super.updateParallelArrays.call(this,t,e),("sum"===this.yData[0]||"intermediateSum"===this.yData[0])&&(this.yData[0]=null)}pointAttribs(t,e){let i=this.options.upColor;i&&!t.options.color&&u(t.y)&&(t.color=t.y>0?i:void 0);let s=a.prototype.pointAttribs.call(this,t,e);return delete s.dashstyle,s}getGraphPath(){return[["M",0,0]]}getCrispPath(){let t=this.data.filter(t=>u(t.y)),e=this.yAxis,i=t.length,s=this.graph?.strokeWidth()||0,o=this.xAxis.reversed,a=this.yAxis.reversed,r=this.options.stacking,n=[];for(let l=1;l<i;l++){if(!(this.options.connectNulls||u(this.data[t[l].index-1].y)))continue;let i=t[l].box,h=t[l-1],p=h.y||0,c=t[l-1].box;if(!i||!c)continue;let g=e.waterfall.stacks[this.stackKey],f=p>0?-c.height:0;if(g&&c&&i){let t;let p=g[l-1];if(r){let i=p.connectorThreshold;t=d(e.translate(i,!1,!0,!1,!0)+(a?f:0),s)}else t=d(c.y+(h.minPointLengthOffset||0),s);n.push(["M",(c.x||0)+(o?0:c.width||0),t],["L",(i.x||0)+(o&&i.width||0),t])}if(c&&n.length&&(!r&&p<0&&!a||p>0&&a)){let t=n[n.length-2];t&&"number"==typeof t[2]&&(t[2]+=c.height||0);let e=n[n.length-1];e&&"number"==typeof e[2]&&(e[2]+=c.height||0)}}return n}drawGraph(){r.prototype.drawGraph.call(this),this.graph&&this.graph.attr({d:this.getCrispPath()})}setStackedPoints(t){let e=this.options,i=t.waterfall?.stacks,s=e.threshold||0,o=this.stackKey,a=this.xData,r=a.length,n=s,l=n,h,p=0,d=0,c=0,u,g,f,b,m,y,x,P,S=(t,e,i,s)=>{if(h){if(u)for(;i<u;i++)h.stackState[i]+=s;else h.stackState[0]=t,u=h.stackState.length;h.stackState.push(h.stackState[u-1]+e)}};if(t.stacking&&i&&this.reserveSpace()){P=i.changed,(x=i.alreadyChanged)&&0>x.indexOf(o)&&(P=!0),i[o]||(i[o]={});let t=i[o];if(t)for(let i=0;i<r;i++)(!t[y=a[i]]||P)&&(t[y]={negTotal:0,posTotal:0,stackTotal:0,threshold:0,stateIndex:0,stackState:[],label:P&&t[y]?t[y].label:void 0}),h=t[y],(m=this.yData[i])>=0?h.posTotal+=m:h.negTotal+=m,b=e.data[i],g=h.absolutePos=h.posTotal,f=h.absoluteNeg=h.negTotal,h.stackTotal=g+f,u=h.stackState.length,b&&b.isIntermediateSum?(S(c,d,0,c),c=d,d=s,n^=l,l^=n,n^=l):b&&b.isSum?(S(s,p,u,0),n=s):(S(n,m,0,p),b&&(p+=m,d+=m)),h.stateIndex++,h.threshold=n,n+=h.stackTotal;i.changed=!1,i.alreadyChanged||(i.alreadyChanged=[]),i.alreadyChanged.push(o)}}getExtremes(){let t,e,i;let s=this.options.stacking;return s?(t=this.yAxis.waterfall.stacks,e=this.stackedYNeg=[],i=this.stackedYPos=[],"overlap"===s?f(t[this.stackKey],function(t){e.push(h(t.stackState)),i.push(l(t.stackState))}):f(t[this.stackKey],function(t){e.push(t.negTotal+t.threshold),i.push(t.posTotal+t.threshold)}),{dataMin:h(e),dataMax:l(i)}):{dataMin:this.dataMin,dataMax:this.dataMax}}}return y.defaultOptions=g(a.defaultOptions,o),y.compose=i.compose,c(y.prototype,{pointValKey:"y",showLine:!0,pointClass:s}),n(y,"afterColumnTranslate",function(){let{options:t,points:e,yAxis:i}=this,s=b(t.minPointLength,5),o=s/2,a=t.threshold||0,r=t.stacking,n=i.waterfall.stacks[this.stackKey],l=a,h=a,p,f,y,x;for(let t=0;t<e.length;t++){let b=e[t],P=this.processedYData[t],S=c({x:0,y:0,width:0,height:0},b.shapeArgs||{});b.box=S;let M=[0,P],L=b.y||0;if(r){if(n){let e=n[t];"overlap"===r?(f=e.stackState[e.stateIndex--],p=L>=0?f:f-L,m(e,"absolutePos")&&delete e.absolutePos,m(e,"absoluteNeg")&&delete e.absoluteNeg):(L>=0?(f=e.threshold+e.posTotal,e.posTotal-=L,p=f):(f=e.threshold+e.negTotal,e.negTotal-=L,p=f-L),!e.posTotal&&u(e.absolutePos)&&m(e,"absolutePos")&&(e.posTotal=e.absolutePos,delete e.absolutePos),!e.negTotal&&u(e.absoluteNeg)&&m(e,"absoluteNeg")&&(e.negTotal=e.absoluteNeg,delete e.absoluteNeg)),b.isSum||(e.connectorThreshold=e.threshold+e.stackTotal),i.reversed?(y=L>=0?p-L:p+L,x=p):(y=p,x=p-L),b.below=y<=a,S.y=i.translate(y,!1,!0,!1,!0),S.height=Math.abs(S.y-i.translate(x,!1,!0,!1,!0));let s=i.waterfall.dummyStackItem;s&&(s.x=t,s.label=n[t].label,s.setOffset(this.pointXOffset||0,this.barW||0,this.stackedYNeg[t],this.stackedYPos[t],void 0,this.xAxis))}}else p=Math.max(h,h+L)+M[0],S.y=i.translate(p,!1,!0,!1,!0),b.isSum?(S.y=i.translate(M[1],!1,!0,!1,!0),S.height=Math.min(i.translate(M[0],!1,!0,!1,!0),i.len)-S.y,b.below=M[1]<=a):b.isIntermediateSum?(L>=0?(y=M[1]+l,x=l):(y=l,x=M[1]+l),i.reversed&&(y^=x,x^=y,y^=x),S.y=i.translate(y,!1,!0,!1,!0),S.height=Math.abs(S.y-Math.min(i.translate(x,!1,!0,!1,!0),i.len)),l+=M[1],b.below=y<=a):(S.height=P>0?i.translate(h,!1,!0,!1,!0)-S.y:i.translate(h,!1,!0,!1,!0)-i.translate(h-P,!1,!0,!1,!0),h+=P,b.below=h<a),S.height<0&&(S.y+=S.height,S.height*=-1);b.plotY=S.y,b.yBottom=S.y+S.height,S.height<=s&&!b.isNull?(S.height=s,S.y-=o,b.yBottom=S.y+S.height,b.plotY=S.y,L<0?b.minPointLengthOffset=-o:b.minPointLengthOffset=o):(b.isNull&&(S.width=0),b.minPointLengthOffset=0);let C=b.plotY+(b.negative?S.height:0);b.below&&(b.plotY+=S.height),b.tooltipPos&&(this.chart.inverted?b.tooltipPos[0]=i.len-C:b.tooltipPos[1]=C),b.isInside=this.isPointInside(b);let k=d(b.yBottom,this.borderWidth);S.y=d(S.y,this.borderWidth),S.height=k-S.y,g(!0,b.shapeArgs,S)}},{order:2}),t.registerSeriesType("waterfall",y),y}),i(e,"masters/highcharts-more.src.js",[e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Extensions/Pane/Pane.js"],e["Series/Bubble/BubbleSeries.js"],e["Series/PackedBubble/PackedBubbleSeries.js"],e["Series/PolarComposition.js"],e["Core/Axis/RadialAxis.js"],e["Series/Waterfall/WaterfallSeries.js"]],function(t,e,i,s,o,a,r,n){return t.RadialAxis=r,s.compose(t.Axis,t.Chart,t.Legend),o.compose(t.Axis,t.Chart,t.Legend),i.compose(t.Chart,t.Pointer),a.compose(t.Axis,t.Chart,t.Pointer,t.Series,t.Tick,t.Point,e.seriesTypes.areasplinerange,e.seriesTypes.column,e.seriesTypes.line,e.seriesTypes.spline),n.compose(t.Axis,t.Chart),t})});
File: public/js/highcharts/vendor/highcharts.js
Match lines: 1
8| - ${i}: ${e}`,h&&(l+=encodeURI(i)+"="+encodeURI(e))}),l+=t}M(t,"displayError",{chart:s,code:e,message:l,params:n},function(){if(i)throw Error(l);r.console&&-1===o.messages.indexOf(l)&&console.warn(l)}),o.messages.push(l)}function n(t,e){return parseInt(t,e||10)}function a(t){return"string"==typeof t}function h(t){let e=Object.prototype.toString.call(t);return"[object Array]"===e||"[object Array Iterator]"===e}function l(t,e){return!!t&&"object"==typeof t&&(!e||!h(t))}function d(t){return l(t)&&"number"==typeof t.nodeType}function c(t){let e=t&&t.constructor;return!!(l(t,!0)&&!d(t)&&e&&e.name&&"Object"!==e.name)}function p(t){return"number"==typeof t&&!isNaN(t)&&t<1/0&&t>-1/0}function u(t){return null!=t}function g(t,e,i){let s;let r=a(e)&&!u(i),o=(e,i)=>{u(e)?t.setAttribute(i,e):r?(s=t.getAttribute(i))||"class"!==i||(s=t.getAttribute(i+"Name")):t.removeAttribute(i)};return a(e)?o(i,e):C(e,o),s}function f(t){return h(t)?t:[t]}function m(t,e){let i;for(i in t||(t={}),e)t[i]=e[i];return t}function x(){let t=arguments,e=t.length;for(let i=0;i<e;i++){let e=t[i];if(null!=e)return e}}function y(t,e){m(t.style,e)}function b(t){return Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function v(t,e){return t>1e14?t:parseFloat(t.toPrecision(e||14))}(o||(o={})).messages=[],Math.easeInOutSine=function(t){return -.5*(Math.cos(Math.PI*t)-1)};let S=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){let i;let s=t.length;for(i=0;i<s;i++)if(e(t[i],i))return t[i]};function C(t,e,i){for(let s in t)Object.hasOwnProperty.call(t,s)&&e.call(i||t[s],t[s],s,t)}function k(t,e,i){function s(e,i){let s=t.removeEventListener;s&&s.call(t,e,i,!1)}function r(i){let r,o;t.nodeName&&(e?(r={})[e]=!0:r=i,C(r,function(t,e){if(i[e])for(o=i[e].length;o--;)s(e,i[e][o].fn)}))}let o="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(o,"hcEvents")){let t=o.hcEvents;if(e){let o=t[e]||[];i?(t[e]=o.filter(function(t){return i!==t.fn}),s(e,i)):(r(t),t[e]=[])}else r(t),delete o.hcEvents}}function M(e,i,r,o){if(r=r||{},s.createEvent&&(e.dispatchEvent||e.fireEvent&&e!==t)){let t=s.createEvent("Events");t.initEvent(i,!0,!0),r=m(t,r),e.dispatchEvent?e.dispatchEvent(r):e.fireEvent(i,r)}else if(e.hcEvents){r.target||m(r,{preventDefault:function(){r.defaultPrevented=!0},target:e,type:i});let t=[],s=e,o=!1;for(;s.hcEvents;)Object.hasOwnProperty.call(s,"hcEvents")&&s.hcEvents[i]&&(t.length&&(o=!0),t.unshift.apply(t,s.hcEvents[i])),s=Object.getPrototypeOf(s);o&&t.sort((t,e)=>t.order-e.order),t.forEach(t=>{!1===t.fn.call(e,r)&&r.preventDefault()})}o&&!r.defaultPrevented&&o.call(e,r)}C({map:"map",each:"forEach",grep:"filter",reduce:"reduce",some:"some"},function(e,i){t[i]=function(t){return o(32,!1,void 0,{[`Highcharts.${i}`]:`use Array.${e}`}),Array.prototype[e].apply(t,[].slice.call(arguments,1))}});let w=function(){let t=Math.random().toString(36).substring(2,9)+"-",i=0;return function(){return"highcharts-"+(e?"":t)+i++}}();return r.jQuery&&(r.jQuery.fn.highcharts=function(){let e=[].slice.call(arguments);if(this[0])return e[0]?(new t[a(e[0])?e.shift():"Chart"](this[0],e[0],e[1]),this):i[g(this[0],"data-highcharts-chart")]}),{addEvent:function(e,i,s,r={}){let o="function"==typeof e&&e.prototype||e;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let n=o.hcEvents;t.Point&&e instanceof t.Point&&e.series&&e.series.chart&&(e.series.chart.runTrackerClick=!0);let a=e.addEventListener;a&&a.call(e,i,s,!!t.supportsPassiveEvents&&{passive:void 0===r.passive?-1!==i.indexOf("touch"):r.passive,capture:!1}),n[i]||(n[i]=[]);let h={fn:s,order:"number"==typeof r.order?r.order:1/0};return n[i].push(h),n[i].sort((t,e)=>t.order-e.order),function(){k(e,i,s)}},arrayMax:function(t){let e=t.length,i=t[0];for(;e--;)t[e]>i&&(i=t[e]);return i},arrayMin:function(t){let e=t.length,i=t[0];for(;e--;)t[e]<i&&(i=t[e]);return i},attr:g,clamp:function(t,e,i){return t>e?t<i?t:i:e},clearTimeout:function(t){u(t)&&clearTimeout(t)},correctFloat:v,createElement:function(t,e,i,r,o){let n=s.createElement(t);return e&&m(n,e),o&&y(n,{padding:"0",border:"none",margin:"0"}),i&&y(n,i),r&&r.appendChild(n),n},crisp:(t,e=0,i)=>{let s=e%2/2,r=i?-1:1;return(Math.round(t*r-s)+s)*r},css:y,defined:u,destroyObjectProperties:function(t,e,i){C(t,function(s,r){s!==e&&s?.destroy&&s.destroy(),(s?.destroy||!i)&&delete t[r]})},diffObjects:function(t,e,i,s){let r={};return function t(e,r,o,n){let a=i?r:e;C(e,function(i,d){if(!n&&s&&s.indexOf(d)>-1&&r[d]){i=f(i),o[d]=[];for(let e=0;e<Math.max(i.length,r[d].length);e++)r[d][e]&&(void 0===i[e]?o[d][e]=r[d][e]:(o[d][e]={},t(i[e],r[d][e],o[d][e],n+1)))}else l(i,!0)&&!i.nodeType?(o[d]=h(i)?[]:{},t(i,r[d]||{},o[d],n+1),0!==Object.keys(o[d]).length||"colorAxis"===d&&0===n||delete o[d]):(e[d]!==r[d]||d in e&&!(d in r))&&"__proto__"!==d&&"constructor"!==d&&(o[d]=a[d])})}(t,e,r,0),r},discardElement:function(t){t&&t.parentElement&&t.parentElement.removeChild(t)},erase:function(t,e){let i=t.length;for(;i--;)if(t[i]===e){t.splice(i,1);break}},error:o,extend:m,extendClass:function(t,e){let i=function(){};return i.prototype=new t,m(i.prototype,e),i},find:S,fireEvent:M,getClosestDistance:function(t,e){let i,s,r,o;let n=!e;return t.forEach(t=>{if(t.length>1)for(o=s=t.length-1;o>0;o--)(r=t[o]-t[o-1])<0&&!n?(e?.(),e=void 0):r&&(void 0===i||r<i)&&(i=r)}),i},getMagnitude:b,getNestedProperty:function(t,e){let i=t.split(".");for(;i.length&&u(e);){let t=i.shift();if(void 0===t||"__proto__"===t)return;if("this"===t){let t;return l(e)&&(t=e["@this"]),t??e}let s=e[t];if(!u(s)||"function"==typeof s||"number"==typeof s.nodeType||s===r)return;e=s}return e},getStyle:function t(e,i,s){let o;if("width"===i){let i=Math.min(e.offsetWidth,e.scrollWidth),s=e.getBoundingClientRect&&e.getBoundingClientRect().width;return s<i&&s>=i-1&&(i=Math.floor(s)),Math.max(0,i-(t(e,"padding-left",!0)||0)-(t(e,"padding-right",!0)||0))}if("height"===i)return Math.max(0,Math.min(e.offsetHeight,e.scrollHeight)-(t(e,"padding-top",!0)||0)-(t(e,"padding-bottom",!0)||0));let a=r.getComputedStyle(e,void 0);return a&&(o=a.getPropertyValue(i),x(s,"opacity"!==i)&&(o=n(o))),o},inArray:function(t,e,i){return o(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),e.indexOf(t,i)},insertItem:function(t,e){let i;let s=t.options.index,r=e.length;for(i=t.options.isInternal?r:0;i<r+1;i++)if(!e[i]||p(s)&&s<x(e[i].options.index,e[i]._i)||e[i].options.isInternal){e.splice(i,0,t);break}return i},isArray:h,isClass:c,isDOMElement:d,isFunction:function(t){return"function"==typeof t},isNumber:p,isObject:l,isString:a,keys:function(t){return o(32,!1,void 0,{"Highcharts.keys":"use Object.keys"}),Object.keys(t)},merge:function(){let t,e=arguments,i={},s=function(t,e){return"object"!=typeof t&&(t={}),C(e,function(i,r){"__proto__"!==r&&"constructor"!==r&&(!l(i,!0)||c(i)||d(i)?t[r]=e[r]:t[r]=s(t[r]||{},i))}),t};!0===e[0]&&(i=e[1],e=Array.prototype.slice.call(e,2));let r=e.length;for(t=0;t<r;t++)i=s(i,e[t]);return i},normalizeTickInterval:function(t,e,i,s,r){let o,n=t;i=x(i,b(t));let a=t/i;for(!e&&(e=r?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===s&&(1===i?e=e.filter(function(t){return t%1==0}):i<=.1&&(e=[1/i]))),o=0;o<e.length&&(n=e[o],(!r||!(n*i>=t))&&(r||!(a<=(e[o]+(e[o+1]||e[o]))/2)));o++);return v(n*i,-Math.round(Math.log(.001)/Math.LN10))},objectEach:C,offset:function(t){let e=s.documentElement,i=t.parentElement||t.parentNode?t.getBoundingClientRect():{top:0,left:0,width:0,height:0};return{top:i.top+(r.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(r.pageXOffset||e.scrollLeft)-(e.clientLeft||0),width:i.width,height:i.height}},pad:function(t,e,i){return Array((e||2)+1-String(t).replace("-","").length).join(i||"0")+t},pick:x,pInt:n,pushUnique:function(t,e){return 0>t.indexOf(e)&&!!t.push(e)},relativeLength:function(t,e,i){return/%$/.test(t)?e*parseFloat(t)/100+(i||0):parseFloat(t)},removeEvent:k,replaceNested:function(t,...e){let i,s;do for(s of(i=t,e))t=t.replace(s[0],s[1]);while(t!==i);return t},splat:f,stableSort:function(t,e){let i,s;let r=t.length;for(s=0;s<r;s++)t[s].safeI=s;for(t.sort(function(t,s){return 0===(i=e(t,s))?t.safeI-s.safeI:i}),s=0;s<r;s++)delete t[s].safeI},syncTimeout:function(t,e,i){return e>0?setTimeout(t,e,i):(t.call(0,i),-1)},timeUnits:{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},uniqueKey:w,useSerialIds:function(t){return e=x(t,e)},wrap:function(t,e,i){let s=t[e];t[e]=function(){let t=arguments,e=this;return i.apply(this,[function(){return s.apply(e,arguments.length?arguments:t)}].concat([].slice.call(arguments)))}}}}),i(e,"Core/Chart/ChartDefaults.js",[],function(){return{alignThresholds:!1,panning:{enabled:!1,type:"x"},styledMode:!1,borderRadius:0,colorCount:10,allowMutatingData:!0,ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{},position:{}},reflow:!0,type:"line",zooming:{singleTouch:!1,resetButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}}},width:null,height:null,borderColor:"#334eff",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"}}),i(e,"Core/Color/Palettes.js",[],function(){return{colors:["#2caffe","#544fc5","#00e272","#fe6a35","#6b8abc","#d568fb","#2ee0ca","#fa4b42","#feb56a","#91e8e1"]}}),i(e,"Core/Time.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{win:i}=t,{defined:s,error:r,extend:o,isNumber:n,isObject:a,merge:h,objectEach:l,pad:d,pick:c,splat:p,timeUnits:u}=e,g=t.isSafari&&i.Intl&&i.Intl.DateTimeFormat.prototype.formatRange,f=t.isSafari&&i.Intl&&!i.Intl.DateTimeFormat.prototype.formatRange;class m{constructor(t){this.options={},this.useUTC=!1,this.variableTimezone=!1,this.Date=i.Date,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.update(t)}get(t,e){if(this.variableTimezone||this.timezoneOffset){let i=e.getTime(),s=i-this.getTimezoneOffset(e);e.setTime(s);let r=e["getUTC"+t]();return e.setTime(i),r}return this.useUTC?e["getUTC"+t]():e["get"+t]()}set(t,e,i){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===t||"Seconds"===t||"Minutes"===t&&this.getTimezoneOffset(e)%36e5==0)return e["setUTC"+t](i);let s=this.getTimezoneOffset(e),r=e.getTime()-s;e.setTime(r),e["setUTC"+t](i);let o=this.getTimezoneOffset(e);return r=e.getTime()+o,e.setTime(r)}return this.useUTC||g&&"FullYear"===t?e["setUTC"+t](i):e["set"+t](i)}update(t={}){let e=c(t.useUTC,!0);this.options=t=h(!0,this.options,t),this.Date=t.Date||i.Date||Date,this.useUTC=e,this.timezoneOffset=e&&t.timezoneOffset||void 0,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.variableTimezone=e&&!!(t.getTimezoneOffset||t.timezone)}makeTime(t,e,i,s,r,o){let n,a,h;return this.useUTC?(n=this.Date.UTC.apply(0,arguments),a=this.getTimezoneOffset(n),n+=a,a!==(h=this.getTimezoneOffset(n))?n+=h-a:a-36e5!==this.getTimezoneOffset(n-36e5)||f||(n-=36e5)):n=new this.Date(t,e,c(i,1),c(s,0),c(r,0),c(o,0)).getTime(),n}timezoneOffsetFunction(){let t=this,e=this.options,i=e.getTimezoneOffset;return this.useUTC?e.timezone?t=>{try{let i=`shortOffset,${e.timezone||""}`,[s,r,o,a,h=0]=(m.formatCache[i]=m.formatCache[i]||Intl.DateTimeFormat("en",{timeZone:e.timezone,timeZoneName:"shortOffset"})).format(t).split(/(GMT|:)/).map(Number),l=-(36e5*(o+h/60));if(n(l))return l}catch(t){r(34)}return 0}:this.useUTC&&i?t=>6e4*i(t.valueOf()):()=>6e4*(t.timezoneOffset||0):t=>6e4*new Date(t.toString()).getTimezoneOffset()}dateFormat(e,i,r){if(!s(i)||isNaN(i))return t.defaultOptions.lang&&t.defaultOptions.lang.invalidDate||"";e=c(e,"%Y-%m-%d %H:%M:%S");let n=this,a=new this.Date(i),h=this.get("Hours",a),p=this.get("Day",a),u=this.get("Date",a),g=this.get("Month",a),f=this.get("FullYear",a),m=t.defaultOptions.lang,x=m&&m.weekdays,y=m&&m.shortWeekdays;return l(o({a:y?y[p]:x[p].substr(0,3),A:x[p],d:d(u),e:d(u,2," "),w:p,b:m.shortMonths[g],B:m.months[g],m:d(g+1),o:g+1,y:f.toString().substr(2,2),Y:f,H:d(h),k:h,I:d(h%12||12),l:h%12||12,M:d(this.get("Minutes",a)),p:h<12?"AM":"PM",P:h<12?"am":"pm",S:d(this.get("Seconds",a)),L:d(Math.floor(i%1e3),3)},t.dateFormats),function(t,s){for(;-1!==e.indexOf("%"+s);)e=e.replace("%"+s,"function"==typeof t?t.call(n,i):t)}),r?e.substr(0,1).toUpperCase()+e.substr(1):e}resolveDTLFormat(t){return a(t,!0)?t:{main:(t=p(t))[0],from:t[1],to:t[2]}}getTimeTicks(t,e,i,r){let n,a,h,l;let d=this,p=d.Date,g=[],f={},m=new p(e),x=t.unitRange,y=t.count||1;if(r=c(r,1),s(e)){d.set("Milliseconds",m,x>=u.second?0:y*Math.floor(d.get("Milliseconds",m)/y)),x>=u.second&&d.set("Seconds",m,x>=u.minute?0:y*Math.floor(d.get("Seconds",m)/y)),x>=u.minute&&d.set("Minutes",m,x>=u.hour?0:y*Math.floor(d.get("Minutes",m)/y)),x>=u.hour&&d.set("Hours",m,x>=u.day?0:y*Math.floor(d.get("Hours",m)/y)),x>=u.day&&d.set("Date",m,x>=u.month?1:Math.max(1,y*Math.floor(d.get("Date",m)/y))),x>=u.month&&(d.set("Month",m,x>=u.year?0:y*Math.floor(d.get("Month",m)/y)),a=d.get("FullYear",m)),x>=u.year&&(a-=a%y,d.set("FullYear",m,a)),x===u.week&&(l=d.get("Day",m),d.set("Date",m,d.get("Date",m)-l+r+(l<r?-7:0))),a=d.get("FullYear",m);let t=d.get("Month",m),o=d.get("Date",m),c=d.get("Hours",m);e=m.getTime(),(d.variableTimezone||!d.useUTC)&&s(i)&&(h=i-e>4*u.month||d.getTimezoneOffset(e)!==d.getTimezoneOffset(i));let p=m.getTime();for(n=1;p<i;)g.push(p),x===u.year?p=d.makeTime(a+n*y,0):x===u.month?p=d.makeTime(a,t+n*y):h&&(x===u.day||x===u.week)?p=d.makeTime(a,t,o+n*y*(x===u.day?1:7)):h&&x===u.hour&&y>1?p=d.makeTime(a,t,o,c+n*y):p+=x*y,n++;g.push(p),x<=u.hour&&g.length<1e4&&g.forEach(function(t){t%18e5==0&&"000000000"===d.dateFormat("%H%M%S%L",t)&&(f[t]="day")})}return g.info=o(t,{higherRanks:f,totalRange:x*y}),g}getDateFormat(t,e,i,s){let r=this.dateFormat("%m-%d %H:%M:%S.%L",e),o="01-01 00:00:00.000",n={millisecond:15,second:12,minute:9,hour:6,day:3},a="millisecond",h=a;for(a in u){if(t===u.week&&+this.dateFormat("%w",e)===i&&r.substr(6)===o.substr(6)){a="week";break}if(u[a]>t){a=h;break}if(n[a]&&r.substr(n[a])!==o.substr(n[a]))break;"week"!==a&&(h=a)}return this.resolveDTLFormat(s[a]).main}}return m.formatCache={},m}),i(e,"Core/Defaults.js",[e["Core/Chart/ChartDefaults.js"],e["Core/Globals.js"],e["Core/Color/Palettes.js"],e["Core/Time.js"],e["Core/Utilities.js"]],function(t,e,i,s,r){let{isTouchDevice:o}=e,{fireEvent:n,merge:a}=r,h={colors:i.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",numericSymbols:["k","M","G","T","P","E"],resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{buttonTheme:{fill:"#f7f7f7",padding:8,r:2,stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontSize:"0.8em",fontWeight:"normal"},states:{hover:{fill:"#e6e6e6"},select:{fill:"#e6e9ff",style:{color:"#000000",fontWeight:"bold"}},disabled:{style:{color:"#cccccc"}}}}},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:t,title:{style:{color:"#333333",fontWeight:"bold"},text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{style:{color:"#666666",fontSize:"0.8em"},text:"",align:"center",widthAdjust:-44},caption:{margin:15,style:{color:"#666666",fontSize:"0.8em"},text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",events:{},layout:"horizontal",itemMarginBottom:2,itemMarginTop:2,labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{style:{fontSize:"0.8em"},activeColor:"#0022ff",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"0.8em",textDecoration:"none",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#666666",textDecoration:"line-through"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontSize:"0.8em",fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:{duration:300,easing:t=>Math.sqrt(1-Math.pow(t-1,2))},borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %e %b, %H:%M:%S.%L",second:"%A, %e %b, %H:%M:%S",minute:"%A, %e %b, %H:%M",hour:"%A, %e %b, %H:%M",day:"%A, %e %b %Y",week:"Week from %A, %e %b %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,shape:"callout",shared:!1,snap:o?25:10,headerFormat:'<span style="font-size: 0.8em">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:"#ffffff",borderWidth:void 0,shadow:!0,stickOnContact:!1,style:{color:"#333333",cursor:"default",fontSize:"0.8em"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"0.6em"},text:"Highcharts.com"}};h.chart.styledMode=!1;let l=new s(h.time);return{defaultOptions:h,defaultTime:l,getOptions:function(){return h},setOptions:function(t){return n(e,"setOptions",{options:t}),a(!0,h,t),(t.time||t.global)&&(e.time?e.time.update(a(h.global,h.time,t.global,t.time)):e.time=l),h}}}),i(e,"Core/Color/Color.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{isNumber:i,merge:s,pInt:r}=e;class o{static parse(t){return t?new o(t):o.None}constructor(e){let i,s,r,n;this.rgba=[NaN,NaN,NaN,NaN],this.input=e;let a=t.Color;if(a&&a!==o)return new a(e);if("object"==typeof e&&void 0!==e.stops)this.stops=e.stops.map(t=>new o(t[1]));else if("string"==typeof e){if(this.input=e=o.names[e.toLowerCase()]||e,"#"===e.charAt(0)){let t=e.length,i=parseInt(e.substr(1),16);7===t?s=[(16711680&i)>>16,(65280&i)>>8,255&i,1]:4===t&&(s=[(3840&i)>>4|(3840&i)>>8,(240&i)>>4|240&i,(15&i)<<4|15&i,1])}if(!s)for(r=o.parsers.length;r--&&!s;)(i=(n=o.parsers[r]).regex.exec(e))&&(s=n.parse(i))}s&&(this.rgba=s)}get(t){let e=this.input,r=this.rgba;if("object"==typeof e&&void 0!==this.stops){let i=s(e);return i.stops=[].slice.call(i.stops),this.stops.forEach((e,s)=>{i.stops[s]=[i.stops[s][0],e.get(t)]}),i}return r&&i(r[0])?"rgb"!==t&&(t||1!==r[3])?"a"===t?`${r[3]}`:"rgba("+r.join(",")+")":"rgb("+r[0]+","+r[1]+","+r[2]+")":e}brighten(t){let e=this.rgba;if(this.stops)this.stops.forEach(function(e){e.brighten(t)});else if(i(t)&&0!==t)for(let i=0;i<3;i++)e[i]+=r(255*t),e[i]<0&&(e[i]=0),e[i]>255&&(e[i]=255);return this}setOpacity(t){return this.rgba[3]=t,this}tweenTo(t,e){let s=this.rgba,r=t.rgba;if(!i(s[0])||!i(r[0]))return t.input||"none";let o=1!==r[3]||1!==s[3];return(o?"rgba(":"rgb(")+Math.round(r[0]+(s[0]-r[0])*(1-e))+","+Math.round(r[1]+(s[1]-r[1])*(1-e))+","+Math.round(r[2]+(s[2]-r[2])*(1-e))+(o?","+(r[3]+(s[3]-r[3])*(1-e)):"")+")"}}return o.names={white:"#ffffff",black:"#000000"},o.parsers=[{regex:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?(?:\.\d+)?)\s*\)/,parse:function(t){return[r(t[1]),r(t[2]),r(t[3]),parseFloat(t[4],10)]}},{regex:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/,parse:function(t){return[r(t[1]),r(t[2]),r(t[3]),1]}}],o.None=new o(""),o}),i(e,"Core/Animation/Fx.js",[e["Core/Color/Color.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){let{parse:s}=t,{win:r}=e,{isNumber:o,objectEach:n}=i;class a{constructor(t,e,i){this.pos=NaN,this.options=e,this.elem=t,this.prop=i}dSetter(){let t=this.paths,e=t&&t[0],i=t&&t[1],s=this.now||0,r=[];if(1!==s&&e&&i){if(e.length===i.length&&s<1)for(let t=0;t<i.length;t++){let n=e[t],a=i[t],h=[];for(let t=0;t<a.length;t++){let e=n[t],i=a[t];o(e)&&o(i)&&!("A"===a[0]&&(4===t||5===t))?h[t]=e+s*(i-e):h[t]=i}r.push(h)}else r=i}else r=this.toD||[];this.elem.attr("d",r,void 0,!0)}update(){let t=this.elem,e=this.prop,i=this.now,s=this.options.step;this[e+"Setter"]?this[e+"Setter"]():t.attr?t.element&&t.attr(e,i,null,!0):t.style[e]=i+this.unit,s&&s.call(t,i,this)}run(t,e,i){let s=this,o=s.options,n=function(t){return!n.stopped&&s.step(t)},h=r.requestAnimationFrame||function(t){setTimeout(t,13)},l=function(){for(let t=0;t<a.timers.length;t++)a.timers[t]()||a.timers.splice(t--,1);a.timers.length&&h(l)};t!==e||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=t,this.end=e,this.unit=i,this.now=this.start,this.pos=0,n.elem=this.elem,n.prop=this.prop,n()&&1===a.timers.push(n)&&h(l)):(delete o.curAnim[this.prop],o.complete&&0===Object.keys(o.curAnim).length&&o.complete.call(this.elem))}step(t){let e,i;let s=+new Date,r=this.options,o=this.elem,a=r.complete,h=r.duration,l=r.curAnim;return o.attr&&!o.element?e=!1:t||s>=h+this.startTime?(this.now=this.end,this.pos=1,this.update(),l[this.prop]=!0,i=!0,n(l,function(t){!0!==t&&(i=!1)}),i&&a&&a.call(o),e=!1):(this.pos=r.easing((s-this.startTime)/h),this.now=this.start+(this.end-this.start)*this.pos,this.update(),e=!0),e}initPath(t,e,i){let s=t.startX,r=t.endX,n=i.slice(),a=t.isArea,h=a?2:1,l=e&&i.length>e.length&&i.hasStackedCliffs,d,c,p,u,g=e&&e.slice();if(!g||l)return[n,n];function f(t,e){for(;t.length<c;){let i=t[0],s=e[c-t.length];if(s&&"M"===i[0]&&("C"===s[0]?t[0]=["C",i[1],i[2],i[1],i[2],i[1],i[2]]:t[0]=["L",i[1],i[2]]),t.unshift(i),a){let e=t.pop();t.push(t[t.length-1],e)}}}function m(t){for(;t.length<c;){let e=t[Math.floor(t.length/h)-1].slice();if("C"===e[0]&&(e[1]=e[5],e[2]=e[6]),a){let i=t[Math.floor(t.length/h)].slice();t.splice(t.length/2,0,e,i)}else t.push(e)}}if(s&&r&&r.length){for(p=0;p<s.length;p++){if(s[p]===r[0]){d=p;break}if(s[0]===r[r.length-s.length+p]){d=p,u=!0;break}if(s[s.length-1]===r[r.length-s.length+p]){d=s.length-p;break}}void 0===d&&(g=[])}return g.length&&o(d)&&(c=n.length+d*h,u?(f(g,n),m(n)):(f(n,g),m(g))),[g,n]}fillSetter(){a.prototype.strokeSetter.apply(this,arguments)}strokeSetter(){this.elem.attr(this.prop,s(this.start).tweenTo(s(this.end),this.pos),void 0,!0)}}return a.timers=[],a}),i(e,"Core/Animation/AnimationUtilities.js",[e["Core/Animation/Fx.js"],e["Core/Utilities.js"]],function(t,e){let{defined:i,getStyle:s,isArray:r,isNumber:o,isObject:n,merge:a,objectEach:h,pick:l}=e;function d(t){return n(t)?a({duration:500,defer:0},t):{duration:t?500:0,defer:0}}function c(e,i){let s=t.timers.length;for(;s--;)t.timers[s].elem!==e||i&&i!==t.timers[s].prop||(t.timers[s].stopped=!0)}return{animate:function(e,i,l){let d,p="",u,g,f;n(l)||(f=arguments,l={duration:f[2],easing:f[3],complete:f[4]}),o(l.duration)||(l.duration=400),l.easing="function"==typeof l.easing?l.easing:Math[l.easing]||Math.easeInOutSine,l.curAnim=a(i),h(i,function(o,n){c(e,n),g=new t(e,l,n),u=void 0,"d"===n&&r(i.d)?(g.paths=g.initPath(e,e.pathArray,i.d),g.toD=i.d,d=0,u=1):e.attr?d=e.attr(n):(d=parseFloat(s(e,n))||0,"opacity"!==n&&(p="px")),u||(u=o),"string"==typeof u&&u.match("px")&&(u=u.replace(/px/g,"")),g.run(d,u,p)})},animObject:d,getDeferredAnimation:function(t,e,s){let r=d(e),o=s?[s]:t.series,a=0,h=0;return o.forEach(t=>{let s=d(t.options.animation);a=n(e)&&i(e.defer)?r.defer:Math.max(a,s.duration+s.defer),h=Math.min(r.duration,s.duration)}),t.renderer.forExport&&(a=0),{defer:Math.max(0,a-h),duration:Math.min(a,h)}},setAnimation:function(t,e){e.renderer.globalAnimation=l(t,e.options.chart.animation,!0)},stop:c}}),i(e,"Core/Renderer/HTML/AST.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{SVG_NS:i,win:s}=t,{attr:r,createElement:o,css:n,error:a,isFunction:h,isString:l,objectEach:d,splat:c}=e,{trustedTypes:p}=s,u=p&&h(p.createPolicy)&&p.createPolicy("highcharts",{createHTML:t=>t}),g=u?u.createHTML(""):"",f=function(){try{return!!new DOMParser().parseFromString(g,"text/html")}catch(t){return!1}}();class m{static filterUserAttributes(t){return d(t,(e,i)=>{let s=!0;-1===m.allowedAttributes.indexOf(i)&&(s=!1),-1!==["background","dynsrc","href","lowsrc","src"].indexOf(i)&&(s=l(e)&&m.allowedReferences.some(t=>0===e.indexOf(t))),s||(a(33,!1,void 0,{"Invalid attribute in config":`${i}`}),delete t[i]),l(e)&&t[i]&&(t[i]=e.replace(/</g,"<"))}),t}static parseStyle(t){return t.split(";").reduce((t,e)=>{let i=e.split(":").map(t=>t.trim()),s=i.shift();return s&&i.length&&(t[s.replace(/-([a-z])/g,t=>t[1].toUpperCase())]=i.join(":")),t},{})}static setElementHTML(t,e){t.innerHTML=m.emptyHTML,e&&new m(e).addToDOM(t)}constructor(t){this.nodes="string"==typeof t?this.parseMarkup(t):t}addToDOM(e){return function e(s,o){let h;return c(s).forEach(function(s){let l;let c=s.tagName,p=s.textContent?t.doc.createTextNode(s.textContent):void 0,u=m.bypassHTMLFiltering;if(c){if("#text"===c)l=p;else if(-1!==m.allowedTags.indexOf(c)||u){let a="svg"===c?i:o.namespaceURI||i,h=t.doc.createElementNS(a,c),g=s.attributes||{};d(s,function(t,e){"tagName"!==e&&"attributes"!==e&&"children"!==e&&"style"!==e&&"textContent"!==e&&(g[e]=t)}),r(h,u?g:m.filterUserAttributes(g)),s.style&&n(h,s.style),p&&h.appendChild(p),e(s.children||[],h),l=h}else a(33,!1,void 0,{"Invalid tagName in config":c})}l&&o.appendChild(l),h=l}),h}(this.nodes,e)}parseMarkup(t){let e;let i=[];if(t=t.trim().replace(/ style=(["'])/g," data-style=$1"),f)e=new DOMParser().parseFromString(u?u.createHTML(t):t,"text/html");else{let i=o("div");i.innerHTML=t,e={body:i}}let s=(t,e)=>{let i=t.nodeName.toLowerCase(),r={tagName:i};"#text"===i&&(r.textContent=t.textContent||"");let o=t.attributes;if(o){let t={};[].forEach.call(o,e=>{"data-style"===e.name?r.style=m.parseStyle(e.value):t[e.name]=e.value}),r.attributes=t}if(t.childNodes.length){let e=[];[].forEach.call(t.childNodes,t=>{s(t,e)}),e.length&&(r.children=e)}e.push(r)};return[].forEach.call(e.body.childNodes,t=>s(t,i)),i}}return m.allowedAttributes=["alt","aria-controls","aria-describedby","aria-expanded","aria-haspopup","aria-hidden","aria-label","aria-labelledby","aria-live","aria-pressed","aria-readonly","aria-roledescription","aria-selected","class","clip-path","color","colspan","cx","cy","d","dx","dy","disabled","fill","filterUnits","flood-color","flood-opacity","height","href","id","in","in2","markerHeight","markerWidth","offset","opacity","operator","orient","padding","paddingLeft","paddingRight","patternUnits","r","radius","refX","refY","role","scope","slope","src","startOffset","stdDeviation","stroke","stroke-linecap","stroke-width","style","tableValues","result","rowspan","summary","target","tabindex","text-align","text-anchor","textAnchor","textLength","title","type","valign","width","x","x1","x2","xlink:href","y","y1","y2","zIndex"],m.allowedReferences=["https://","http://","mailto:","/","../","./","#"],m.allowedTags=["a","abbr","b","br","button","caption","circle","clipPath","code","dd","defs","div","dl","dt","em","feComponentTransfer","feComposite","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMorphology","feOffset","feMerge","feMergeNode","filter","h1","h2","h3","h4","h5","h6","hr","i","img","li","linearGradient","marker","ol","p","path","pattern","pre","rect","small","span","stop","strong","style","sub","sup","svg","table","text","textPath","thead","title","tbody","tspan","td","th","tr","u","ul","#text"],m.emptyHTML=g,m.bypassHTMLFiltering=!1,m}),i(e,"Core/Templating.js",[e["Core/Defaults.js"],e["Core/Utilities.js"]],function(t,e){let{defaultOptions:i,defaultTime:s}=t,{extend:r,getNestedProperty:o,isArray:n,isNumber:a,isObject:h,pick:l,pInt:d}=e,c={add:(t,e)=>t+e,divide:(t,e)=>0!==e?t/e:"",eq:(t,e)=>t==e,each:function(t){let e=arguments[arguments.length-1];return!!n(t)&&t.map((i,s)=>p(e.body,r(h(i)?i:{"@this":i},{"@index":s,"@first":0===s,"@last":s===t.length-1}))).join("")},ge:(t,e)=>t>=e,gt:(t,e)=>t>e,if:t=>!!t,le:(t,e)=>t<=e,lt:(t,e)=>t<e,multiply:(t,e)=>t*e,ne:(t,e)=>t!=e,subtract:(t,e)=>t-e,unless:t=>!t};function p(t="",e,r){let n=/\{([\w\:\.\,;\-\/<>%@"'’= #\(\)]+)\}/g,a=/\(([\w\:\.\,;\-\/<>%@"'= ]+)\)/g,h=[],d=/f$/,g=/\.(\d)/,f=i.lang,m=r&&r.time||s,x=r&&r.numberFormatter||u,y=(t="")=>{let i;return"true"===t||"false"!==t&&((i=Number(t)).toString()===t?i:o(t,e))},b,v,S=0,C;for(;null!==(b=n.exec(t));){let i=a.exec(b[1]);i&&(b=i,C=!0),v&&v.isBlock||(v={ctx:e,expression:b[1],find:b[0],isBlock:"#"===b[1].charAt(0),start:b.index,startInner:b.index+b[0].length,length:b[0].length});let s=b[1].split(" ")[0].replace("#","");c[s]&&(v.isBlock&&s===v.fn&&S++,v.fn||(v.fn=s));let r="else"===b[1];if(v.isBlock&&v.fn&&(b[1]===`/${v.fn}`||r)){if(S)!r&&S--;else{let e=v.startInner,i=t.substr(e,b.index-e);void 0===v.body?(v.body=i,v.startInner=b.index+b[0].length):v.elseBody=i,v.find+=i+b[0],r||(h.push(v),v=void 0)}}else v.isBlock||h.push(v);if(i&&!v?.isBlock)break}return h.forEach(i=>{let s,o;let{body:n,elseBody:a,expression:h,fn:u}=i;if(u){let t=[i],l=h.split(" ");for(o=c[u].length;o--;)t.unshift(y(l[o+1]));s=c[u].apply(e,t),i.isBlock&&"boolean"==typeof s&&(s=p(s?n:a,e,r))}else{let t=h.split(":");if(s=y(t.shift()||""),t.length&&"number"==typeof s){let e=t.join(":");if(d.test(e)){let t=parseInt((e.match(g)||["","-1"])[1],10);null!==s&&(s=x(s,t,f.decimalPoint,e.indexOf(",")>-1?f.thousandsSep:""))}else s=m.dateFormat(e,s)}}t=t.replace(i.find,l(s,""))}),C?p(t,e,r):t}function u(t,e,s,r){let o,n;t=+t||0,e=+e;let h=i.lang,c=(t.toString().split(".")[1]||"").split("e")[0].length,p=t.toString().split("e"),u=e;-1===e?e=Math.min(c,20):a(e)?e&&p[1]&&p[1]<0&&((n=e+ +p[1])>=0?(p[0]=(+p[0]).toExponential(n).split("e")[0],e=n):(p[0]=p[0].split(".")[0]||0,t=e<20?(p[0]*Math.pow(10,p[1])).toFixed(e):0,p[1]=0)):e=2;let g=(Math.abs(p[1]?p[0]:t)+Math.pow(10,-Math.max(e,c)-1)).toFixed(e),f=String(d(g)),m=f.length>3?f.length%3:0;return s=l(s,h.decimalPoint),r=l(r,h.thousandsSep),o=(t<0?"-":"")+(m?f.substr(0,m)+r:""),0>+p[1]&&!u?o="0":o+=f.substr(m).replace(/(\d{3})(?=\d)/g,"$1"+r),e?o+=s+g.slice(-e):0==+o&&(o="0"),p[1]&&0!=+o&&(o+="e"+p[1]),o}return{dateFormat:function(t,e,i){return s.dateFormat(t,e,i)},format:p,helpers:c,numberFormat:u}}),i(e,"Core/Renderer/RendererRegistry.js",[e["Core/Globals.js"]],function(t){var e,i;let s;return(i=e||(e={})).rendererTypes={},i.getRendererType=function(t=s){return i.rendererTypes[t]||i.rendererTypes[s]},i.registerRendererType=function(e,r,o){i.rendererTypes[e]=r,(!s||o)&&(s=e,t.Renderer=r)},e}),i(e,"Core/Renderer/RendererUtilities.js",[e["Core/Utilities.js"]],function(t){var e;let{clamp:i,pick:s,pushUnique:r,stableSort:o}=t;return(e||(e={})).distribute=function t(e,n,a){let h=e,l=h.reducedLen||n,d=(t,e)=>t.target-e.target,c=[],p=e.length,u=[],g=c.push,f,m,x,y=!0,b,v,S=0,C;for(f=p;f--;)S+=e[f].size;if(S>l){for(o(e,(t,e)=>(e.rank||0)-(t.rank||0)),x=(C=e[0].rank===e[e.length-1].rank)?p/2:-1,m=C?x:p-1;x&&S>l;)b=e[f=Math.floor(m)],r(u,f)&&(S-=b.size),m+=x,C&&m>=e.length&&(x/=2,m=x);u.sort((t,e)=>e-t).forEach(t=>g.apply(c,e.splice(t,1)))}for(o(e,d),e=e.map(t=>({size:t.size,targets:[t.target],align:s(t.align,.5)}));y;){for(f=e.length;f--;)b=e[f],v=(Math.min.apply(0,b.targets)+Math.max.apply(0,b.targets))/2,b.pos=i(v-b.size*b.align,0,n-b.size);for(f=e.length,y=!1;f--;)f>0&&e[f-1].pos+e[f-1].size>e[f].pos&&(e[f-1].size+=e[f].size,e[f-1].targets=e[f-1].targets.concat(e[f].targets),e[f-1].align=.5,e[f-1].pos+e[f-1].size>n&&(e[f-1].pos=n-e[f-1].size),e.splice(f,1),y=!0)}return g.apply(h,c),f=0,e.some(e=>{let i=0;return(e.targets||[]).some(()=>(h[f].pos=e.pos+i,void 0!==a&&Math.abs(h[f].pos-h[f].target)>a)?(h.slice(0,f+1).forEach(t=>delete t.pos),h.reducedLen=(h.reducedLen||n)-.1*n,h.reducedLen>.1*n&&t(h,n,a),!0):(i+=h[f].size,f++,!1))}),o(h,d),h},e}),i(e,"Core/Renderer/SVG/SVGElement.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Color/Color.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{animate:r,animObject:o,stop:n}=t,{deg2rad:a,doc:h,svg:l,SVG_NS:d,win:c}=i,{addEvent:p,attr:u,createElement:g,crisp:f,css:m,defined:x,erase:y,extend:b,fireEvent:v,isArray:S,isFunction:C,isObject:k,isString:M,merge:w,objectEach:T,pick:A,pInt:P,pushUnique:L,replaceNested:O,syncTimeout:D,uniqueKey:E}=s;class I{_defaultGetter(t){let e=A(this[t+"Value"],this[t],this.element?this.element.getAttribute(t):null,0);return/^-?[\d\.]+$/.test(e)&&(e=parseFloat(e)),e}_defaultSetter(t,e,i){i.setAttribute(e,t)}add(t){let e;let i=this.renderer,s=this.element;return t&&(this.parentGroup=t),void 0!==this.textStr&&"text"===this.element.nodeName&&i.buildText(this),this.added=!0,(!t||t.handleZ||this.zIndex)&&(e=this.zIndexSetter()),e||(t?t.element:i.box).appendChild(s),this.onAdd&&this.onAdd(),this}addClass(t,e){let i=e?"":this.attr("class")||"";return(t=(t||"").split(/ /g).reduce(function(t,e){return -1===i.indexOf(e)&&t.push(e),t},i?[i]:[]).join(" "))!==i&&this.attr("class",t),this}afterSetters(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)}align(t,e,i,s=!0){let r,o,n,a;let h={},l=this.renderer,d=l.alignedObjects,c=!!t;t?(this.alignOptions=t,this.alignByTranslate=e,this.alignTo=i):(t=this.alignOptions||{},e=this.alignByTranslate,i=this.alignTo);let p=!i||M(i)?i||"renderer":void 0;p&&(c&&L(d,this),i=void 0);let u=A(i,l[p],l),g=t.align,f=t.verticalAlign;return r=(u.x||0)+(t.x||0),o=(u.y||0)+(t.y||0),"right"===g?n=1:"center"===g&&(n=2),n&&(r+=((u.width||0)-(t.width||0))/n),h[e?"translateX":"x"]=Math.round(r),"bottom"===f?a=1:"middle"===f&&(a=2),a&&(o+=((u.height||0)-(t.height||0))/a),h[e?"translateY":"y"]=Math.round(o),s&&(this[this.placed?"animate":"attr"](h),this.placed=!0),this.alignAttr=h,this}alignSetter(t){let e={left:"start",center:"middle",right:"end"};e[t]&&(this.alignValue=t,this.element.setAttribute("text-anchor",e[t]))}animate(t,e,i){let s=o(A(e,this.renderer.globalAnimation,!0)),n=s.defer;return h.hidden&&(s.duration=0),0!==s.duration?(i&&(s.complete=i),D(()=>{this.element&&r(this,t,s)},n)):(this.attr(t,void 0,i||s.complete),T(t,function(t,e){s.step&&s.step.call(this,t,{prop:e,pos:1,elem:this})},this)),this}applyTextOutline(t){let e=this.element;-1!==t.indexOf("contrast")&&(t=t.replace(/contrast/g,this.renderer.getContrast(e.style.fill)));let s=t.split(" "),r=s[s.length-1],o=s[0];if(o&&"none"!==o&&i.svg){this.fakeTS=!0,o=o.replace(/(^[\d\.]+)(.*?)$/g,function(t,e,i){return 2*Number(e)+i}),this.removeTextOutline();let t=h.createElementNS(d,"tspan");u(t,{class:"highcharts-text-outline",fill:r,stroke:r,"stroke-width":o,"stroke-linejoin":"round"});let i=e.querySelector("textPath")||e;[].forEach.call(i.childNodes,e=>{let i=e.cloneNode(!0);i.removeAttribute&&["fill","stroke","stroke-width","stroke"].forEach(t=>i.removeAttribute(t)),t.appendChild(i)});let s=0;[].forEach.call(i.querySelectorAll("text tspan"),t=>{s+=Number(t.getAttribute("dy"))});let n=h.createElementNS(d,"tspan");n.textContent="",u(n,{x:Number(e.getAttribute("x")),dy:-s}),t.appendChild(n),i.insertBefore(t,i.firstChild)}}attr(t,e,i,s){let{element:r}=this,o=I.symbolCustomAttribs,a,h,l=this,d;return"string"==typeof t&&void 0!==e&&(a=t,(t={})[a]=e),"string"==typeof t?l=(this[t+"Getter"]||this._defaultGetter).call(this,t,r):(T(t,function(e,i){d=!1,s||n(this,i),this.symbolName&&-1!==o.indexOf(i)&&(h||(this.symbolAttr(t),h=!0),d=!0),this.rotation&&("x"===i||"y"===i)&&(this.doTransform=!0),d||(this[i+"Setter"]||this._defaultSetter).call(this,e,i,r)},this),this.afterSetters()),i&&i.call(this),l}clip(t){if(t&&!t.clipPath){let e=E()+"-",i=this.renderer.createElement("clipPath").attr({id:e}).add(this.renderer.defs);b(t,{clipPath:i,id:e,count:0}),t.add(i)}return this.attr("clip-path",t?`url(${this.renderer.url}#${t.id})`:"none")}crisp(t,e){e=Math.round(e||t.strokeWidth||0);let i=t.x||this.x||0,s=t.y||this.y||0,r=(t.width||this.width||0)+i,o=(t.height||this.height||0)+s,n=f(i,e),a=f(s,e);return b(t,{x:n,y:a,width:f(r,e)-n,height:f(o,e)-a}),x(t.strokeWidth)&&(t.strokeWidth=e),t}complexColor(t,i,s){let r=this.renderer,o,n,a,h,l,d,c,p,u,g,f=[],m;v(this.renderer,"complexColor",{args:arguments},function(){if(t.radialGradient?n="radialGradient":t.linearGradient&&(n="linearGradient"),n){if(a=t[n],l=r.gradients,d=t.stops,u=s.radialReference,S(a)&&(t[n]=a={x1:a[0],y1:a[1],x2:a[2],y2:a[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===n&&u&&!x(a.gradientUnits)&&(h=a,a=w(a,r.getRadialAttr(u,h),{gradientUnits:"userSpaceOnUse"})),T(a,function(t,e){"id"!==e&&f.push(e,t)}),T(d,function(t){f.push(t)}),l[f=f.join(",")])g=l[f].attr("id");else{a.id=g=E();let t=l[f]=r.createElement(n).attr(a).add(r.defs);t.radAttr=h,t.stops=[],d.forEach(function(i){0===i[1].indexOf("rgba")?(c=(o=e.parse(i[1])).get("rgb"),p=o.get("a")):(c=i[1],p=1);let s=r.createElement("stop").attr({offset:i[0],"stop-color":c,"stop-opacity":p}).add(t);t.stops.push(s)})}m="url("+r.url+"#"+g+")",s.setAttribute(i,m),s.gradient=f,t.toString=function(){return m}}})}css(t){let e=this.styles,i={},s=this.element,r,o=!e;if(e&&T(t,function(t,s){e&&e[s]!==t&&(i[s]=t,o=!0)}),o){e&&(t=b(e,i)),null===t.width||"auto"===t.width?delete this.textWidth:"text"===s.nodeName.toLowerCase()&&t.width&&(r=this.textWidth=P(t.width)),b(this.styles,t),r&&!l&&this.renderer.forExport&&delete t.width;let o=w(t);s.namespaceURI===this.SVG_NS&&(["textOutline","textOverflow","width"].forEach(t=>o&&delete o[t]),o.color&&(o.fill=o.color)),m(s,o)}return this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),t.textOutline&&this.applyTextOutline(t.textOutline)),this}dashstyleSetter(t){let e,i=this["stroke-width"];if("inherit"===i&&(i=1),t=t&&t.toLowerCase()){let s=t.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=s.length;e--;)s[e]=""+P(s[e])*A(i,NaN);t=s.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",t)}}destroy(){let t=this,e=t.element||{},i=t.renderer,s=e.ownerSVGElement,r="SPAN"===e.nodeName&&t.parentGroup||void 0,o,a;if(e.onclick=e.onmouseout=e.onmouseover=e.onmousemove=e.point=null,n(t),t.clipPath&&s){let e=t.clipPath;[].forEach.call(s.querySelectorAll("[clip-path],[CLIP-PATH]"),function(t){t.getAttribute("clip-path").indexOf(e.element.id)>-1&&t.removeAttribute("clip-path")}),t.clipPath=e.destroy()}if(t.connector=t.connector?.destroy(),t.stops){for(a=0;a<t.stops.length;a++)t.stops[a].destroy();t.stops.length=0,t.stops=void 0}for(t.safeRemoveChild(e);r&&r.div&&0===r.div.childNodes.length;)o=r.parentGroup,t.safeRemoveChild(r.div),delete r.div,r=o;t.alignOptions&&y(i.alignedObjects,t),T(t,function(e,i){t[i]&&t[i].parentGroup===t&&t[i].destroy&&t[i].destroy(),delete t[i]})}dSetter(t,e,i){S(t)&&("string"==typeof t[0]&&(t=this.renderer.pathToSegments(t)),this.pathArray=t,t=t.reduce((t,e,i)=>e&&e.join?(i?t+" ":"")+e.join(" "):(e||"").toString(),"")),/(NaN| {2}|^$)/.test(t)&&(t="M 0 0"),this[e]!==t&&(i.setAttribute(e,t),this[e]=t)}fillSetter(t,e,i){"string"==typeof t?i.setAttribute(e,t):t&&this.complexColor(t,e,i)}hrefSetter(t,e,i){i.setAttributeNS("http://www.w3.org/1999/xlink",e,t)}getBBox(t,e){let i,s,r,o;let{alignValue:n,element:a,renderer:h,styles:l,textStr:d}=this,{cache:c,cacheKeys:p}=h,u=a.namespaceURI===this.SVG_NS,g=A(e,this.rotation,0),f=h.styledMode?a&&I.prototype.getStyle.call(a,"font-size"):l.fontSize;if(x(d)&&(-1===(o=d.toString()).indexOf("<")&&(o=o.replace(/\d/g,"0")),o+=["",h.rootFontSize,f,g,this.textWidth,n,l.textOverflow,l.fontWeight].join(",")),o&&!t&&(i=c[o]),!i||i.polygon){if(u||h.forExport){try{r=this.fakeTS&&function(t){let e=a.querySelector(".highcharts-text-outline");e&&m(e,{display:t})},C(r)&&r("none"),i=a.getBBox?b({},a.getBBox()):{width:a.offsetWidth,height:a.offsetHeight,x:0,y:0},C(r)&&r("")}catch(t){}(!i||i.width<0)&&(i={x:0,y:0,width:0,height:0})}else i=this.htmlGetBBox();s=i.height,u&&(i.height=s=({"11px,17":14,"13px,20":16})[`${f||""},${Math.round(s)}`]||s),g&&(i=this.getRotatedBox(i,g));let t={bBox:i};v(this,"afterGetBBox",t),i=t.bBox}if(o&&(""===d||i.height>0)){for(;p.length>250;)delete c[p.shift()];c[o]||p.push(o),c[o]=i}return i}getRotatedBox(t,e){let{x:i,y:s,width:r,height:o}=t,{alignValue:n,translateY:h,rotationOriginX:l=0,rotationOriginY:d=0}=this,c={right:1,center:.5}[n||0]||0,p=Number(this.element.getAttribute("y")||0)-(h?0:s),u=e*a,g=(e-90)*a,f=Math.cos(u),m=Math.sin(u),x=r*f,y=r*m,b=Math.cos(g),v=Math.sin(g),[[S,C],[k,M]]=[l,d].map(t=>[t-t*f,t*m]),w=i+c*(r-x)+S+M+p*b,T=w+x,A=T-o*b,P=A-x,L=s+p-c*y-C+k+p*v,O=L+y,D=O-o*v,E=D-y,I=Math.min(w,T,A,P),j=Math.min(L,O,D,E),B=Math.max(w,T,A,P)-I,R=Math.max(L,O,D,E)-j;return{x:I,y:j,width:B,height:R,polygon:[[w,L],[T,O],[A,D],[P,E]]}}getStyle(t){return c.getComputedStyle(this.element||this,"").getPropertyValue(t)}hasClass(t){return -1!==(""+this.attr("class")).split(" ").indexOf(t)}hide(){return this.attr({visibility:"hidden"})}htmlGetBBox(){return{height:0,width:0,x:0,y:0}}constructor(t,e){this.onEvents={},this.opacity=1,this.SVG_NS=d,this.element="span"===e||"body"===e?g(e):h.createElementNS(this.SVG_NS,e),this.renderer=t,this.styles={},v(this,"afterInit")}on(t,e){let{onEvents:i}=this;return i[t]&&i[t](),i[t]=p(this.element,t,e),this}opacitySetter(t,e,i){let s=Number(Number(t).toFixed(3));this.opacity=s,i.setAttribute(e,s)}reAlign(){this.alignOptions?.width&&"left"!==this.alignOptions.align&&(this.alignOptions.width=this.getBBox().width,this.placed=!1,this.align())}removeClass(t){return this.attr("class",(""+this.attr("class")).replace(M(t)?RegExp(`(^| )${t}( |$)`):t," ").replace(/ +/g," ").trim())}removeTextOutline(){let t=this.element.querySelector("tspan.highcharts-text-outline");t&&this.safeRemoveChild(t)}safeRemoveChild(t){let e=t.parentNode;e&&e.removeChild(t)}setRadialReference(t){let e=this.element.gradient&&this.renderer.gradients[this.element.gradient];return this.element.radialReference=t,e&&e.radAttr&&e.animate(this.renderer.getRadialAttr(t,e.radAttr)),this}shadow(t){let{renderer:e}=this,i=w(this.parentGroup?.rotation===90?{offsetX:-1,offsetY:-1}:{},k(t)?t:{}),s=e.shadowDefinition(i);return this.attr({filter:t?`url(${e.url}#${s})`:"none"})}show(t=!0){return this.attr({visibility:t?"inherit":"visible"})}"stroke-widthSetter"(t,e,i){this[e]=t,i.setAttribute(e,t)}strokeWidth(){if(!this.renderer.styledMode)return this["stroke-width"]||0;let t=this.getStyle("stroke-width"),e=0,i;return/px$/.test(t)?e=P(t):""!==t&&(u(i=h.createElementNS(d,"rect"),{width:t,"stroke-width":0}),this.element.parentNode.appendChild(i),e=i.getBBox().width,i.parentNode.removeChild(i)),e}symbolAttr(t){let e=this;I.symbolCustomAttribs.forEach(function(i){e[i]=A(t[i],e[i])}),e.attr({d:e.renderer.symbols[e.symbolName](e.x,e.y,e.width,e.height,e)})}textSetter(t){t!==this.textStr&&(delete this.textPxLength,this.textStr=t,this.added&&this.renderer.buildText(this),this.reAlign())}titleSetter(t){let e=this.element,i=e.getElementsByTagName("title")[0]||h.createElementNS(this.SVG_NS,"title");e.insertBefore?e.insertBefore(i,e.firstChild):e.appendChild(i),i.textContent=O(A(t,""),[/<[^>]*>/g,""]).replace(/</g,"<").replace(/>/g,">")}toFront(){let t=this.element;return t.parentNode.appendChild(t),this}translate(t,e){return this.attr({translateX:t,translateY:e})}updateTransform(t="transform"){let{element:e,matrix:i,rotation:s=0,rotationOriginX:r,rotationOriginY:o,scaleX:n,scaleY:a,translateX:h=0,translateY:l=0}=this,d=["translate("+h+","+l+")"];x(i)&&d.push("matrix("+i.join(",")+")"),s&&(d.push("rotate("+s+" "+A(r,e.getAttribute("x"),0)+" "+A(o,e.getAttribute("y")||0)+")"),this.text?.element.tagName==="SPAN"&&this.text.attr({rotation:s,rotationOriginX:(r||0)-this.padding,rotationOriginY:(o||0)-this.padding})),(x(n)||x(a))&&d.push("scale("+A(n,1)+" "+A(a,1)+")"),d.length&&!(this.text||this).textPath&&e.setAttribute(t,d.join(" "))}visibilitySetter(t,e,i){"inherit"===t?i.removeAttribute(e):this[e]!==t&&i.setAttribute(e,t),this[e]=t}xGetter(t){return"circle"===this.element.nodeName&&("x"===t?t="cx":"y"===t&&(t="cy")),this._defaultGetter(t)}zIndexSetter(t,e){let i=this.renderer,s=this.parentGroup,r=(s||i).element||i.box,o=this.element,n=r===i.box,a,h,l,d=!1,c,p=this.added,u;if(x(t)?(o.setAttribute("data-z-index",t),t=+t,this[e]===t&&(p=!1)):x(this[e])&&o.removeAttribute("data-z-index"),this[e]=t,p){for((t=this.zIndex)&&s&&(s.handleZ=!0),u=(a=r.childNodes).length-1;u>=0&&!d;u--)c=!x(l=(h=a[u]).getAttribute("data-z-index")),h!==o&&(t<0&&c&&!n&&!u?(r.insertBefore(o,a[u]),d=!0):(P(l)<=t||c&&(!x(t)||t>=0))&&(r.insertBefore(o,a[u+1]),d=!0));d||(r.insertBefore(o,a[n?3:0]),d=!0)}return d}}return I.symbolCustomAttribs=["anchorX","anchorY","clockwise","end","height","innerR","r","start","width","x","y"],I.prototype.strokeSetter=I.prototype.fillSetter,I.prototype.yGetter=I.prototype.xGetter,I.prototype.matrixSetter=I.prototype.rotationOriginXSetter=I.prototype.rotationOriginYSetter=I.prototype.rotationSetter=I.prototype.scaleXSetter=I.prototype.scaleYSetter=I.prototype.translateXSetter=I.prototype.translateYSetter=I.prototype.verticalAlignSetter=function(t,e){this[e]=t,this.doTransform=!0},I}),i(e,"Core/Renderer/SVG/SVGLabel.js",[e["Core/Renderer/SVG/SVGElement.js"],e["Core/Utilities.js"]],function(t,e){let{defined:i,extend:s,isNumber:r,merge:o,pick:n,removeEvent:a}=e;class h extends t{constructor(t,e,i,s,r,o,n,a,l,d){let c;super(t,"g"),this.paddingLeftSetter=this.paddingSetter,this.paddingRightSetter=this.paddingSetter,this.doUpdate=!1,this.textStr=e,this.x=i,this.y=s,this.anchorX=o,this.anchorY=n,this.baseline=l,this.className=d,this.addClass("button"===d?"highcharts-no-tooltip":"highcharts-label"),d&&this.addClass("highcharts-"+d),this.text=t.text(void 0,0,0,a).attr({zIndex:1}),"string"==typeof r&&((c=/^url\((.*?)\)$/.test(r))||this.renderer.symbols[r])&&(this.symbolKey=r),this.bBox=h.emptyBBox,this.padding=3,this.baselineOffset=0,this.needsBox=t.styledMode||c,this.deferredAttr={},this.alignFactor=0}alignSetter(t){let e={left:0,center:.5,right:1}[t];e!==this.alignFactor&&(this.alignFactor=e,this.bBox&&r(this.xSetting)&&this.attr({x:this.xSetting}))}anchorXSetter(t,e){this.anchorX=t,this.boxAttr(e,Math.round(t)-this.getCrispAdjust()-this.xSetting)}anchorYSetter(t,e){this.anchorY=t,this.boxAttr(e,t-this.ySetting)}boxAttr(t,e){this.box?this.box.attr(t,e):this.deferredAttr[t]=e}css(e){if(e){let t={};e=o(e),h.textProps.forEach(i=>{void 0!==e[i]&&(t[i]=e[i],delete e[i])}),this.text.css(t),"fontSize"in t||"fontWeight"in t?this.updateTextPadding():("width"in t||"textOverflow"in t)&&this.updateBoxSize()}return t.prototype.css.call(this,e)}destroy(){a(this.element,"mouseenter"),a(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),t.prototype.destroy.call(this)}fillSetter(t,e){t&&(this.needsBox=!0),this.fill=t,this.boxAttr(e,t)}getBBox(t,e){this.textStr&&0===this.bBox.width&&0===this.bBox.height&&this.updateBoxSize();let{padding:i,height:s=0,translateX:r=0,translateY:o=0,width:a=0}=this,h=n(this.paddingLeft,i),l=e??(this.rotation||0),d={width:a,height:s,x:r+this.bBox.x-h,y:o+this.bBox.y-i+this.baselineOffset};return l&&(d=this.getRotatedBox(d,l)),d}getCrispAdjust(){return(this.renderer.styledMode&&this.box?this.box.strokeWidth():this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2}heightSetter(t){this.heightSetting=t,this.doUpdate=!0}afterSetters(){super.afterSetters(),this.doUpdate&&(this.updateBoxSize(),this.doUpdate=!1)}onAdd(){this.text.add(this),this.attr({text:n(this.textStr,""),x:this.x||0,y:this.y||0}),this.box&&i(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})}paddingSetter(t,e){r(t)?t!==this[e]&&(this[e]=t,this.updateTextPadding()):this[e]=void 0}rSetter(t,e){this.boxAttr(e,t)}strokeSetter(t,e){this.stroke=t,this.boxAttr(e,t)}"stroke-widthSetter"(t,e){t&&(this.needsBox=!0),this["stroke-width"]=t,this.boxAttr(e,t)}"text-alignSetter"(t){this.textAlign=t}textSetter(t){void 0!==t&&this.text.attr({text:t}),this.updateTextPadding(),this.reAlign()}updateBoxSize(){let t;let e=this.text,o={},n=this.padding,a=this.bBox=(!r(this.widthSetting)||!r(this.heightSetting)||this.textAlign)&&i(e.textStr)?e.getBBox(void 0,0):h.emptyBBox;this.width=this.getPaddedWidth(),this.height=(this.heightSetting||a.height||0)+2*n;let l=this.renderer.fontMetrics(e);if(this.baselineOffset=n+Math.min((this.text.firstLineMetrics||l).b,a.height||1/0),this.heightSetting&&(this.baselineOffset+=(this.heightSetting-l.h)/2),this.needsBox&&!e.textPath){if(!this.box){let t=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect();t.addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),t.add(this)}t=this.getCrispAdjust(),o.x=t,o.y=(this.baseline?-this.baselineOffset:0)+t,o.width=Math.round(this.width),o.height=Math.round(this.height),this.box.attr(s(o,this.deferredAttr)),this.deferredAttr={}}}updateTextPadding(){let t=this.text;if(!t.textPath){this.updateBoxSize();let e=this.baseline?0:this.baselineOffset,s=n(this.paddingLeft,this.padding);i(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(s+=({center:.5,right:1})[this.textAlign]*(this.widthSetting-this.bBox.width)),(s!==t.x||e!==t.y)&&(t.attr("x",s),t.hasBoxWidthChanged&&(this.bBox=t.getBBox(!0)),void 0!==e&&t.attr("y",e)),t.x=s,t.y=e}}widthSetter(t){this.widthSetting=r(t)?t:void 0,this.doUpdate=!0}getPaddedWidth(){let t=this.padding,e=n(this.paddingLeft,t),i=n(this.paddingRight,t);return(this.widthSetting||this.bBox.width||0)+e+i}xSetter(t){this.x=t,this.alignFactor&&(t-=this.alignFactor*this.getPaddedWidth(),this["forceAnimate:x"]=!0),this.xSetting=Math.round(t),this.attr("translateX",this.xSetting)}ySetter(t){this.ySetting=this.y=Math.round(t),this.attr("translateY",this.ySetting)}}return h.emptyBBox={width:0,height:0,x:0,y:0},h.textProps=["color","direction","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textAlign","textDecoration","textOutline","textOverflow","whiteSpace","width"],h}),i(e,"Core/Renderer/SVG/Symbols.js",[e["Core/Utilities.js"]],function(t){let{defined:e,isNumber:i,pick:s}=t;function r(t,i,r,o,n){let a=[];if(n){let h=n.start||0,l=s(n.r,r),d=s(n.r,o||r),c=2e-4/(n.borderRadius?1:Math.max(l,1)),p=Math.abs((n.end||0)-h-2*Math.PI)<c,u=(n.end||0)-(p?c:0),g=n.innerR,f=s(n.open,p),m=Math.cos(h),x=Math.sin(h),y=Math.cos(u),b=Math.sin(u),v=s(n.longArc,u-h-Math.PI<c?0:1),S=["A",l,d,0,v,s(n.clockwise,1),t+l*y,i+d*b];S.params={start:h,end:u,cx:t,cy:i},a.push(["M",t+l*m,i+d*x],S),e(g)&&((S=["A",g,g,0,v,e(n.clockwise)?1-n.clockwise:0,t+g*m,i+g*x]).params={start:u,end:h,cx:t,cy:i},a.push(f?["M",t+g*y,i+g*b]:["L",t+g*y,i+g*b],S)),f||a.push(["Z"])}return a}function o(t,e,i,s,r){return r&&r.r?n(t,e,i,s,r):[["M",t,e],["L",t+i,e],["L",t+i,e+s],["L",t,e+s],["Z"]]}function n(t,e,i,s,r){let o=r?.r||0;return[["M",t+o,e],["L",t+i-o,e],["A",o,o,0,0,1,t+i,e+o],["L",t+i,e+s-o],["A",o,o,0,0,1,t+i-o,e+s],["L",t+o,e+s],["A",o,o,0,0,1,t,e+s-o],["L",t,e+o],["A",o,o,0,0,1,t+o,e],["Z"]]}return{arc:r,callout:function(t,e,s,r,o){let a=Math.min(o&&o.r||0,s,r),h=a+6,l=o&&o.anchorX,d=o&&o.anchorY||0,c=n(t,e,s,r,{r:a});if(!i(l)||l<s&&l>0&&d<r&&d>0)return c;if(t+l>s-h){if(d>e+h&&d<e+r-h)c.splice(3,1,["L",t+s,d-6],["L",t+s+6,d],["L",t+s,d+6],["L",t+s,e+r-a]);else if(l<s){let i=d<e+h,o=i?e:e+r;c.splice(i?2:5,0,["L",l,d],["L",t+s-a,o])}else c.splice(3,1,["L",t+s,r/2],["L",l,d],["L",t+s,r/2],["L",t+s,e+r-a])}else if(t+l<h){if(d>e+h&&d<e+r-h)c.splice(7,1,["L",t,d+6],["L",t-6,d],["L",t,d-6],["L",t,e+a]);else if(l>0){let i=d<e+h,s=i?e:e+r;c.splice(i?1:6,0,["L",l,d],["L",t+a,s])}else c.splice(7,1,["L",t,r/2],["L",l,d],["L",t,r/2],["L",t,e+a])}else d>r&&l<s-h?c.splice(5,1,["L",l+6,e+r],["L",l,e+r+6],["L",l-6,e+r],["L",t+a,e+r]):d<0&&l>h&&c.splice(1,1,["L",l-6,e],["L",l,e-6],["L",l+6,e],["L",s-a,e]);return c},circle:function(t,e,i,s){return r(t+i/2,e+s/2,i/2,s/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},diamond:function(t,e,i,s){return[["M",t+i/2,e],["L",t+i,e+s/2],["L",t+i/2,e+s],["L",t,e+s/2],["Z"]]},rect:o,roundedRect:n,square:o,triangle:function(t,e,i,s){return[["M",t+i/2,e],["L",t+i,e+s],["L",t,e+s],["Z"]]},"triangle-down":function(t,e,i,s){return[["M",t,e],["L",t+i,e],["L",t+i/2,e+s],["Z"]]}}}),i(e,"Core/Renderer/SVG/TextBuilder.js",[e["Core/Renderer/HTML/AST.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){let{doc:s,SVG_NS:r,win:o}=e,{attr:n,extend:a,fireEvent:h,isString:l,objectEach:d,pick:c}=i;return class{constructor(t){let e=t.styles;this.renderer=t.renderer,this.svgElement=t,this.width=t.textWidth,this.textLineHeight=e&&e.lineHeight,this.textOutline=e&&e.textOutline,this.ellipsis=!!(e&&"ellipsis"===e.textOverflow),this.noWrap=!!(e&&"nowrap"===e.whiteSpace)}buildSVG(){let e=this.svgElement,i=e.element,r=e.renderer,o=c(e.textStr,"").toString(),n=-1!==o.indexOf("<"),a=i.childNodes,h=!e.added&&r.box,d=[o,this.ellipsis,this.noWrap,this.textLineHeight,this.textOutline,e.getStyle("font-size"),this.width].join(",");if(d!==e.textCache){e.textCache=d,delete e.actualWidth;for(let t=a.length;t--;)i.removeChild(a[t]);if(n||this.ellipsis||this.width||e.textPath||-1!==o.indexOf(" ")&&(!this.noWrap||/<br.*?>/g.test(o))){if(""!==o){h&&h.appendChild(i);let s=new t(o);this.modifyTree(s.nodes),s.addToDOM(i),this.modifyDOM(),this.ellipsis&&-1!==(i.textContent||"").indexOf("…")&&e.attr("title",this.unescapeEntities(e.textStr||"",["<",">"])),h&&h.removeChild(i)}}else i.appendChild(s.createTextNode(this.unescapeEntities(o)));l(this.textOutline)&&e.applyTextOutline&&e.applyTextOutline(this.textOutline)}}modifyDOM(){let t;let e=this.svgElement,i=n(e.element,"x");for(e.firstLineMetrics=void 0;t=e.element.firstChild;)if(/^[\s\u200B]*$/.test(t.textContent||" "))e.element.removeChild(t);else break;[].forEach.call(e.element.querySelectorAll("tspan.highcharts-br"),(t,s)=>{t.nextSibling&&t.previousSibling&&(0===s&&1===t.previousSibling.nodeType&&(e.firstLineMetrics=e.renderer.fontMetrics(t.previousSibling)),n(t,{dy:this.getLineHeight(t.nextSibling),x:i}))});let a=this.width||0;if(!a)return;let h=(t,o)=>{let h=t.textContent||"",l=h.replace(/([^\^])-/g,"$1- ").split(" "),d=!this.noWrap&&(l.length>1||e.element.childNodes.length>1),c=this.getLineHeight(o),p=0,u=e.actualWidth;if(this.ellipsis)h&&this.truncate(t,h,void 0,0,Math.max(0,a-.8*c),(t,e)=>t.substring(0,e)+"…");else if(d){let h=[],d=[];for(;o.firstChild&&o.firstChild!==t;)d.push(o.firstChild),o.removeChild(o.firstChild);for(;l.length;)l.length&&!this.noWrap&&p>0&&(h.push(t.textContent||""),t.textContent=l.join(" ").replace(/- /g,"-")),this.truncate(t,void 0,l,0===p&&u||0,a,(t,e)=>l.slice(0,e).join(" ").replace(/- /g,"-")),u=e.actualWidth,p++;d.forEach(e=>{o.insertBefore(e,t)}),h.forEach(e=>{o.insertBefore(s.createTextNode(e),t);let a=s.createElementNS(r,"tspan");a.textContent="",n(a,{dy:c,x:i}),o.insertBefore(a,t)})}},l=t=>{[].slice.call(t.childNodes).forEach(i=>{i.nodeType===o.Node.TEXT_NODE?h(i,t):(-1!==i.className.baseVal.indexOf("highcharts-br")&&(e.actualWidth=0),l(i))})};l(e.element)}getLineHeight(t){let e=t.nodeType===o.Node.TEXT_NODE?t.parentElement:t;return this.textLineHeight?parseInt(this.textLineHeight.toString(),10):this.renderer.fontMetrics(e||this.svgElement.element).h}modifyTree(t){let e=(i,s)=>{let{attributes:r={},children:o,style:n={},tagName:h}=i,l=this.renderer.styledMode;if("b"===h||"strong"===h?l?r.class="highcharts-strong":n.fontWeight="bold":("i"===h||"em"===h)&&(l?r.class="highcharts-emphasized":n.fontStyle="italic"),n&&n.color&&(n.fill=n.color),"br"===h){r.class="highcharts-br",i.textContent="";let e=t[s+1];e&&e.textContent&&(e.textContent=e.textContent.replace(/^ +/gm,""))}else"a"===h&&o&&o.some(t=>"#text"===t.tagName)&&(i.children=[{children:o,tagName:"tspan"}]);"#text"!==h&&"a"!==h&&(i.tagName="tspan"),a(i,{attributes:r,style:n}),o&&o.filter(t=>"#text"!==t.tagName).forEach(e)};t.forEach(e),h(this.svgElement,"afterModifyTree",{nodes:t})}truncate(t,e,i,s,r,o){let n,a;let h=this.svgElement,{rotation:l}=h,d=[],c=i?1:0,p=(e||i||"").length,u=p,g=function(e,r){let o=r||e,n=t.parentNode;if(n&&void 0===d[o]&&n.getSubStringLength)try{d[o]=s+n.getSubStringLength(0,i?o+1:o)}catch(t){}return d[o]};if(h.rotation=0,s+(a=g(t.textContent.length))>r){for(;c<=p;)u=Math.ceil((c+p)/2),i&&(n=o(i,u)),a=g(u,n&&n.length-1),c===p?c=p+1:a>r?p=u-1:c=u;0===p?t.textContent="":e&&p===e.length-1||(t.textContent=n||o(e||i,u))}i&&i.splice(0,u),h.actualWidth=a,h.rotation=l}unescapeEntities(t,e){return d(this.renderer.escapes,function(i,s){e&&-1!==e.indexOf(i)||(t=t.toString().replace(RegExp(i,"g"),s))}),t}}}),i(e,"Core/Renderer/SVG/SVGRenderer.js",[e["Core/Renderer/HTML/AST.js"],e["Core/Defaults.js"],e["Core/Color/Color.js"],e["Core/Globals.js"],e["Core/Renderer/RendererRegistry.js"],e["Core/Renderer/SVG/SVGElement.js"],e["Core/Renderer/SVG/SVGLabel.js"],e["Core/Renderer/SVG/Symbols.js"],e["Core/Renderer/SVG/TextBuilder.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o,n,a,h,l){let d;let{defaultOptions:c}=e,{charts:p,deg2rad:u,doc:g,isFirefox:f,isMS:m,isWebKit:x,noop:y,SVG_NS:b,symbolSizes:v,win:S}=s,{addEvent:C,attr:k,createElement:M,crisp:w,css:T,defined:A,destroyObjectProperties:P,extend:L,isArray:O,isNumber:D,isObject:E,isString:I,merge:j,pick:B,pInt:R,replaceNested:z,uniqueKey:N}=l;class W{constructor(t,e,i,s,r,o,n){let a,h;let l=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"}),d=l.element;n||l.css(this.getStyle(s||{})),t.appendChild(d),k(t,"dir","ltr"),-1===t.innerHTML.indexOf("xmlns")&&k(d,"xmlns",this.SVG_NS),this.box=d,this.boxWrapper=l,this.alignedObjects=[],this.url=this.getReferenceURL(),this.createElement("desc").add().element.appendChild(g.createTextNode("Created with Highcharts 11.4.8")),this.defs=this.createElement("defs").add(),this.allowHTML=o,this.forExport=r,this.styledMode=n,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.rootFontSize=l.getStyle("font-size"),this.setSize(e,i,!1),f&&t.getBoundingClientRect&&((a=function(){T(t,{left:0,top:0}),h=t.getBoundingClientRect(),T(t,{left:Math.ceil(h.left)-h.left+"px",top:Math.ceil(h.top)-h.top+"px"})})(),this.unSubPixelFix=C(S,"resize",a))}definition(e){return new t([e]).addToDOM(this.defs.element)}getReferenceURL(){if((f||x)&&g.getElementsByTagName("base").length){if(!A(d)){let e=N(),i=new t([{tagName:"svg",attributes:{width:8,height:8},children:[{tagName:"defs",children:[{tagName:"clipPath",attributes:{id:e},children:[{tagName:"rect",attributes:{width:4,height:4}}]}]},{tagName:"rect",attributes:{id:"hitme",width:8,height:8,"clip-path":`url(#${e})`,fill:"rgba(0,0,0,0.001)"}}]}]).addToDOM(g.body);T(i,{position:"fixed",top:0,left:0,zIndex:9e5});let s=g.elementFromPoint(6,6);d="hitme"===(s&&s.id),g.body.removeChild(i)}if(d)return z(S.location.href.split("#")[0],[/<[^>]*>/g,""],[/([\('\)])/g,"\\$1"],[/ /g,"%20"])}return""}getStyle(t){return this.style=L({fontFamily:"Helvetica, Arial, sans-serif",fontSize:"1rem"},t),this.style}setStyle(t){this.boxWrapper.css(this.getStyle(t))}isHidden(){return!this.boxWrapper.getBBox().width}destroy(){let t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),P(this.gradients||{}),this.gradients=null,this.defs=t.destroy(),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null,null}createElement(t){return new this.Element(this,t)}getRadialAttr(t,e){return{cx:t[0]-t[2]/2+(e.cx||0)*t[2],cy:t[1]-t[2]/2+(e.cy||0)*t[2],r:(e.r||0)*t[2]}}shadowDefinition(t){let e=[`highcharts-drop-shadow-${this.chartIndex}`,...Object.keys(t).map(e=>`${e}-${t[e]}`)].join("-").toLowerCase().replace(/[^a-z\d\-]/g,""),i=j({color:"#000000",offsetX:1,offsetY:1,opacity:.15,width:5},t);return this.defs.element.querySelector(`#${e}`)||this.definition({tagName:"filter",attributes:{id:e,filterUnits:i.filterUnits},children:this.getShadowFilterContent(i)}),e}getShadowFilterContent(t){return[{tagName:"feDropShadow",attributes:{dx:t.offsetX,dy:t.offsetY,"flood-color":t.color,"flood-opacity":Math.min(5*t.opacity,1),stdDeviation:t.width/2}}]}buildText(t){new h(t).buildSVG()}getContrast(t){let e=i.parse(t).rgba.map(t=>{let e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}),s=.2126*e[0]+.7152*e[1]+.0722*e[2];return 1.05/(s+.05)>(s+.05)/.05?"#FFFFFF":"#000000"}button(e,i,s,r,o={},n,a,h,l,d){let p=this.label(e,i,s,l,void 0,void 0,d,void 0,"button"),u=this.styledMode,g=arguments,f=0;o=j(c.global.buttonTheme,o),u&&(delete o.fill,delete o.stroke,delete o["stroke-width"]);let x=o.states||{},y=o.style||{};delete o.states,delete o.style;let b=[t.filterUserAttributes(o)],v=[y];return u||["hover","select","disabled"].forEach((e,i)=>{b.push(j(b[0],t.filterUserAttributes(g[i+5]||x[e]||{}))),v.push(b[i+1].style),delete b[i+1].style}),C(p.element,m?"mouseover":"mouseenter",function(){3!==f&&p.setState(1)}),C(p.element,m?"mouseout":"mouseleave",function(){3!==f&&p.setState(f)}),p.setState=(t=0)=>{if(1!==t&&(p.state=f=t),p.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][t]),!u){p.attr(b[t]);let e=v[t];E(e)&&p.css(e)}},p.attr(b[0]),!u&&(p.css(L({cursor:"default"},y)),d&&p.text.css({pointerEvents:"none"})),p.on("touchstart",t=>t.stopPropagation()).on("click",function(t){3!==f&&r.call(p,t)})}crispLine(t,e){let[i,s]=t;return A(i[1])&&i[1]===s[1]&&(i[1]=s[1]=w(i[1],e)),A(i[2])&&i[2]===s[2]&&(i[2]=s[2]=w(i[2],e)),t}path(t){let e=this.styledMode?{}:{fill:"none"};return O(t)?e.d=t:E(t)&&L(e,t),this.createElement("path").attr(e)}circle(t,e,i){let s=E(t)?t:void 0===t?{}:{x:t,y:e,r:i},r=this.createElement("circle");return r.xSetter=r.ySetter=function(t,e,i){i.setAttribute("c"+e,t)},r.attr(s)}arc(t,e,i,s,r,o){let n;E(t)?(e=(n=t).y,i=n.r,s=n.innerR,r=n.start,o=n.end,t=n.x):n={innerR:s,start:r,end:o};let a=this.symbol("arc",t,e,i,i,n);return a.r=i,a}rect(t,e,i,s,r,o){let n=E(t)?t:void 0===t?{}:{x:t,y:e,r,width:Math.max(i||0,0),height:Math.max(s||0,0)},a=this.createElement("rect");return this.styledMode||(void 0!==o&&(n["stroke-width"]=o,L(n,a.crisp(n))),n.fill="none"),a.rSetter=function(t,e,i){a.r=t,k(i,{rx:t,ry:t})},a.rGetter=function(){return a.r||0},a.attr(n)}roundedRect(t){return this.symbol("roundedRect").attr(t)}setSize(t,e,i){this.width=t,this.height=e,this.boxWrapper.animate({width:t,height:e},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:B(i,!0)?void 0:0}),this.alignElements()}g(t){let e=this.createElement("g");return t?e.attr({class:"highcharts-"+t}):e}image(t,e,i,s,r,o){let n={preserveAspectRatio:"none"};D(e)&&(n.x=e),D(i)&&(n.y=i),D(s)&&(n.width=s),D(r)&&(n.height=r);let a=this.createElement("image").attr(n),h=function(e){a.attr({href:t}),o.call(a,e)};if(o){a.attr({href:"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="});let e=new S.Image;C(e,"load",h),e.src=t,e.complete&&h({})}else a.attr({href:t});return a}symbol(t,e,i,s,r,o){let n,a,h,l;let d=this,c=/^url\((.*?)\)$/,u=c.test(t),f=!u&&(this.symbols[t]?t:"circle"),m=f&&this.symbols[f];if(m)"number"==typeof e&&(a=m.call(this.symbols,e||0,i||0,s||0,r||0,o)),n=this.path(a),d.styledMode||n.attr("fill","none"),L(n,{symbolName:f||void 0,x:e,y:i,width:s,height:r}),o&&L(n,o);else if(u){h=t.match(c)[1];let s=n=this.image(h);s.imgwidth=B(o&&o.width,v[h]&&v[h].width),s.imgheight=B(o&&o.height,v[h]&&v[h].height),l=t=>t.attr({width:t.width,height:t.height}),["width","height"].forEach(t=>{s[`${t}Setter`]=function(t,e){this[e]=t;let{alignByTranslate:i,element:s,width:r,height:n,imgwidth:a,imgheight:h}=this,l="width"===e?a:h,d=1;o&&"within"===o.backgroundSize&&r&&n&&a&&h?(d=Math.min(r/a,n/h),k(s,{width:Math.round(a*d),height:Math.round(h*d)})):s&&l&&s.setAttribute(e,l),!i&&a&&h&&this.translate(((r||0)-a*d)/2,((n||0)-h*d)/2)}}),A(e)&&s.attr({x:e,y:i}),s.isImg=!0,s.symbolUrl=t,A(s.imgwidth)&&A(s.imgheight)?l(s):(s.attr({width:0,height:0}),M("img",{onload:function(){let t=p[d.chartIndex];0===this.width&&(T(this,{position:"absolute",top:"-999em"}),g.body.appendChild(this)),v[h]={width:this.width,height:this.height},s.imgwidth=this.width,s.imgheight=this.height,s.element&&l(s),this.parentNode&&this.parentNode.removeChild(this),d.imgCount--,d.imgCount||!t||t.hasLoaded||t.onload()},src:h}),this.imgCount++)}return n}clipRect(t,e,i,s){return this.rect(t,e,i,s,0)}text(t,e,i,s){let r={};if(s&&(this.allowHTML||!this.forExport))return this.html(t,e,i);r.x=Math.round(e||0),i&&(r.y=Math.round(i)),A(t)&&(r.text=t);let o=this.createElement("text").attr(r);return s&&(!this.forExport||this.allowHTML)||(o.xSetter=function(t,e,i){let s=i.getElementsByTagName("tspan"),r=i.getAttribute(e);for(let i=0,o;i<s.length;i++)(o=s[i]).getAttribute(e)===r&&o.setAttribute(e,t);i.setAttribute(e,t)}),o}fontMetrics(t){let e=R(o.prototype.getStyle.call(t,"font-size")||0),i=e<24?e+3:Math.round(1.2*e),s=Math.round(.8*i);return{h:i,b:s,f:e}}rotCorr(t,e,i){let s=t;return e&&i&&(s=Math.max(s*Math.cos(e*u),4)),{x:-t/3*Math.sin(e*u),y:s}}pathToSegments(t){let e=[],i=[],s={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2};for(let r=0;r<t.length;r++)I(i[0])&&D(t[r])&&i.length===s[i[0].toUpperCase()]&&t.splice(r,0,i[0].replace("M","L").replace("m","l")),"string"==typeof t[r]&&(i.length&&e.push(i.slice(0)),i.length=0),i.push(t[r]);return e.push(i.slice(0)),e}label(t,e,i,s,r,o,a,h,l){return new n(this,t,e,i,s,r,o,a,h,l)}alignElements(){this.alignedObjects.forEach(t=>t.align())}}return L(W.prototype,{Element:o,SVG_NS:b,escapes:{"&":"&","<":"<",">":">","'":"'",'"':"""},symbols:a,draw:y}),r.registerRendererType("svg",W,!0),W}),i(e,"Core/Renderer/HTML/HTMLElement.js",[e["Core/Renderer/HTML/AST.js"],e["Core/Globals.js"],e["Core/Renderer/SVG/SVGElement.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{composed:r}=e,{attr:o,css:n,createElement:a,defined:h,extend:l,pInt:d,pushUnique:c}=s;function p(t,e,s){let r=this.div?.style||s.style;i.prototype[`${e}Setter`].call(this,t,e,s),r&&(r[e]=t)}let u=(t,e)=>{if(!t.div){let s=o(t.element,"class"),r=t.css,n=a("div",s?{className:s}:void 0,{position:"absolute",left:`${t.translateX||0}px`,top:`${t.translateY||0}px`,...t.styles,display:t.display,opacity:t.opacity,visibility:t.visibility},t.parentGroup?.div||e);t.classSetter=(t,e,i)=>{i.setAttribute("class",t),n.className=t},t.translateXSetter=t.translateYSetter=(e,i)=>{t[i]=e,n.style["translateX"===i?"left":"top"]=`${e}px`,t.doTransform=!0},t.opacitySetter=t.visibilitySetter=p,t.css=e=>(r.call(t,e),e.cursor&&(n.style.cursor=e.cursor),e.pointerEvents&&(n.style.pointerEvents=e.pointerEvents),t),t.on=function(){return i.prototype.on.apply({element:n,onEvents:t.onEvents},arguments),t},t.div=n}return t.div};class g extends i{static compose(t){c(r,this.compose)&&(t.prototype.html=function(t,e,i){return new g(this,"span").attr({text:t,x:Math.round(e),y:Math.round(i)})})}constructor(t,e){super(t,e),this.css({position:"absolute",...t.styledMode?{}:{fontFamily:t.style.fontFamily,fontSize:t.style.fontSize}}),this.element.style.whiteSpace="nowrap"}getSpanCorrection(t,e,i){this.xCorr=-t*i,this.yCorr=-e}css(t){let e;let{element:i}=this,s="SPAN"===i.tagName&&t&&"width"in t,r=s&&t.width;return s&&(delete t.width,this.textWidth=d(r)||void 0,e=!0),t?.textOverflow==="ellipsis"&&(t.whiteSpace="nowrap",t.overflow="hidden"),l(this.styles,t),n(i,t),e&&this.updateTransform(),this}htmlGetBBox(){let{element:t}=this;return{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}updateTransform(){if(!this.added){this.alignOnAdd=!0;return}let{element:t,renderer:e,rotation:i,rotationOriginX:s,rotationOriginY:r,styles:o,textAlign:a="left",textWidth:l,translateX:d=0,translateY:c=0,x:p=0,y:u=0}=this,g={left:0,center:.5,right:1}[a],f=o.whiteSpace;if(n(t,{marginLeft:`${d}px`,marginTop:`${c}px`}),"SPAN"===t.tagName){let o=[i,a,t.innerHTML,l,this.textAlign].join(","),d=-(this.parentGroup?.padding*1)||0,c,m=!1;if(l!==this.oldTextWidth){let e=this.textPxLength?this.textPxLength:(n(t,{width:"",whiteSpace:f||"nowrap"}),t.offsetWidth),s=l||0;(s>this.oldTextWidth||e>s)&&(/[ \-]/.test(t.textContent||t.innerText)||"ellipsis"===t.style.textOverflow)&&(n(t,{width:e>s||i?l+"px":"auto",display:"block",whiteSpace:f||"normal"}),this.oldTextWidth=l,m=!0)}this.hasBoxWidthChanged=m,o!==this.cTT&&(c=e.fontMetrics(t).b,h(i)&&(i!==(this.oldRotation||0)||a!==this.oldAlign)&&this.setSpanRotation(i,d,d),this.getSpanCorrection(!h(i)&&this.textPxLength||t.offsetWidth,c,g));let{xCorr:x=0,yCorr:y=0}=this,b=(s??p)-x-p-d,v=(r??u)-y-u-d;n(t,{left:`${p+x}px`,top:`${u+y}px`,transformOrigin:`${b}px ${v}px`}),this.cTT=o,this.oldRotation=i,this.oldAlign=a}}setSpanRotation(t,e,i){n(this.element,{transform:`rotate(${t}deg)`,transformOrigin:`${e}% ${i}px`})}add(t){let e;let i=this.renderer.box.parentNode,s=[];if(this.parentGroup=t,t&&!(e=t.div)){let r=t;for(;r;)s.push(r),r=r.parentGroup;for(let t of s.reverse())e=u(t,i)}return(e||i).appendChild(this.element),this.added=!0,this.alignOnAdd&&this.updateTransform(),this}textSetter(e){e!==this.textStr&&(delete this.bBox,delete this.oldTextWidth,t.setElementHTML(this.element,e??""),this.textStr=e,this.doTransform=!0)}alignSetter(t){this.alignValue=this.textAlign=t,this.doTransform=!0}xSetter(t,e){this[e]=t,this.doTransform=!0}}let f=g.prototype;return f.visibilitySetter=f.opacitySetter=p,f.ySetter=f.rotationSetter=f.rotationOriginXSetter=f.rotationOriginYSetter=f.xSetter,g}),i(e,"Core/Axis/AxisDefaults.js",[],function(){var t,e;return(e=t||(t={})).xAxis={alignTicks:!0,allowDecimals:void 0,panningEnabled:!0,zIndex:2,zoomEnabled:!0,dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e %b"},week:{main:"%e %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,gridLineDashStyle:"Solid",gridZIndex:1,labels:{autoRotationLimit:80,distance:15,enabled:!0,indentation:10,overflow:"justify",reserveSpace:void 0,rotation:void 0,staggerLines:0,step:0,useHTML:!1,zIndex:7,style:{color:"#333333",cursor:"default",fontSize:"0.8em"}},maxPadding:.01,minorGridLineDashStyle:"Solid",minorTickLength:2,minorTickPosition:"outside",minorTicksPerMajor:5,minPadding:.01,offset:void 0,reversed:void 0,reversedStacks:!1,showEmpty:!0,showFirstLabel:!0,showLastLabel:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",useHTML:!1,x:0,y:0,style:{color:"#666666",fontSize:"0.8em"}},visible:!0,minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#333333",lineWidth:1,gridLineColor:"#e6e6e6",gridLineWidth:void 0,tickColor:"#333333"},e.yAxis={reversedStacks:!0,endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:void 0},startOnTick:!0,title:{text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){let{numberFormatter:t}=this.axis.chart;return t(this.total||0,-1)},style:{color:"#000000",fontSize:"0.7em",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},t}),i(e,"Core/Foundation.js",[e["Core/Utilities.js"]],function(t){var e;let{addEvent:i,isFunction:s,objectEach:r,removeEvent:o}=t;return(e||(e={})).registerEventOptions=function(t,e){t.eventOptions=t.eventOptions||{},r(e.events,function(e,r){t.eventOptions[r]!==e&&(t.eventOptions[r]&&(o(t,r,t.eventOptions[r]),delete t.eventOptions[r]),s(e)&&(t.eventOptions[r]=e,i(t,r,e,{order:0})))})},e}),i(e,"Core/Axis/Tick.js",[e["Core/Templating.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){let{deg2rad:s}=e,{clamp:r,correctFloat:o,defined:n,destroyObjectProperties:a,extend:h,fireEvent:l,isNumber:d,merge:c,objectEach:p,pick:u}=i;return class{constructor(t,e,i,s,r){this.isNew=!0,this.isNewLabel=!0,this.axis=t,this.pos=e,this.type=i||"",this.parameters=r||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,l(this,"init"),i||s||this.addLabel()}addLabel(){let e=this,i=e.axis,s=i.options,r=i.chart,a=i.categories,c=i.logarithmic,p=i.names,g=e.pos,f=u(e.options&&e.options.labels,s.labels),m=i.tickPositions,x=g===m[0],y=g===m[m.length-1],b=(!f.step||1===f.step)&&1===i.tickInterval,v=m.info,S=e.label,C,k,M,w=this.parameters.category||(a?u(a[g],p[g],g):g);c&&d(w)&&(w=o(c.lin2log(w))),i.dateTime&&(v?C=(k=r.time.resolveDTLFormat(s.dateTimeLabelFormats[!s.grid&&v.higherRanks[g]||v.unitName])).main:d(w)&&(C=i.dateTime.getXDateFormat(w,s.dateTimeLabelFormats||{}))),e.isFirst=x,e.isLast=y;let T={axis:i,chart:r,dateTimeLabelFormat:C,isFirst:x,isLast:y,pos:g,tick:e,tickPositionInfo:v,value:w};l(this,"labelFormat",T);let A=e=>f.formatter?f.formatter.call(e,e):f.format?(e.text=i.defaultLabelFormatter.call(e),t.format(f.format,e,r)):i.defaultLabelFormatter.call(e),P=A.call(T,T),L=k&&k.list;L?e.shortenLabel=function(){for(M=0;M<L.length;M++)if(h(T,{dateTimeLabelFormat:L[M]}),S.attr({text:A.call(T,T)}),S.getBBox().width<i.getSlotWidth(e)-2*(f.padding||0))return;S.attr({text:""})}:e.shortenLabel=void 0,b&&i._addedPlotLB&&e.moveLabel(P,f),n(S)||e.movedLabel?S&&S.textStr!==P&&!b&&(!S.textWidth||f.style.width||S.styles.width||S.css({width:null}),S.attr({text:P}),S.textPxLength=S.getBBox().width):(e.label=S=e.createLabel(P,f),e.rotation=0)}createLabel(t,e,i){let s=this.axis,r=s.chart,o=n(t)&&e.enabled?r.renderer.text(t,i?.x,i?.y,e.useHTML).add(s.labelGroup):void 0;return o&&(r.styledMode||o.css(c(e.style)),o.textPxLength=o.getBBox().width),o}destroy(){a(this,this.axis)}getPosition(t,e,i,s){let n=this.axis,a=n.chart,h=s&&a.oldChartHeight||a.chartHeight,d={x:t?o(n.translate(e+i,void 0,void 0,s)+n.transB):n.left+n.offset+(n.opposite?(s&&a.oldChartWidth||a.chartWidth)-n.right-n.left:0),y:t?h-n.bottom+n.offset-(n.opposite?n.height:0):o(h-n.translate(e+i,void 0,void 0,s)-n.transB)};return d.y=r(d.y,-1e9,1e9),l(this,"afterGetPosition",{pos:d}),d}getLabelPosition(t,e,i,r,o,a,h,d){let c,p;let g=this.axis,f=g.transA,m=g.isLinked&&g.linkedParent?g.linkedParent.reversed:g.reversed,x=g.staggerLines,y=g.tickRotCorr||{x:0,y:0},b=r||g.reserveSpaceDefault?0:-g.labelOffset*("center"===g.labelAlign?.5:1),v=o.distance,S={};return c=0===g.side?i.rotation?-v:-i.getBBox().height:2===g.side?y.y+v:Math.cos(i.rotation*s)*(y.y-i.getBBox(!1,0).height/2),n(o.y)&&(c=0===g.side&&g.horiz?o.y+c:o.y),t=t+u(o.x,[0,1,0,-1][g.side]*v)+b+y.x-(a&&r?a*f*(m?-1:1):0),e=e+c-(a&&!r?a*f*(m?1:-1):0),x&&(p=h/(d||1)%x,g.opposite&&(p=x-p-1),e+=p*(g.labelOffset/x)),S.x=t,S.y=Math.round(e),l(this,"afterGetLabelPosition",{pos:S,tickmarkOffset:a,index:h}),S}getLabelSize(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0}getMarkPath(t,e,i,s,r=!1,o){return o.crispLine([["M",t,e],["L",t+(r?0:-i),e+(r?i:0)]],s)}handleOverflow(t){let e=this.axis,i=e.options.labels,r=t.x,o=e.chart.chartWidth,n=e.chart.spacing,a=u(e.labelLeft,Math.min(e.pos,n[3])),h=u(e.labelRight,Math.max(e.isRadial?0:e.pos+e.len,o-n[1])),l=this.label,d=this.rotation,c={left:0,center:.5,right:1}[e.labelAlign||l.attr("align")],p=l.getBBox().width,g=e.getSlotWidth(this),f={},m=g,x=1,y,b,v;d||"justify"!==i.overflow?d<0&&r-c*p<a?v=Math.round(r/Math.cos(d*s)-a):d>0&&r+c*p>h&&(v=Math.round((o-r)/Math.cos(d*s))):(y=r-c*p,b=r+(1-c)*p,y<a?m=t.x+m*(1-c)-a:b>h&&(m=h-t.x+m*c,x=-1),(m=Math.min(g,m))<g&&"center"===e.labelAlign&&(t.x+=x*(g-m-c*(g-Math.min(p,m)))),(p>m||e.autoRotation&&(l.styles||{}).width)&&(v=m)),v&&(this.shortenLabel?this.shortenLabel():(f.width=Math.floor(v)+"px",(i.style||{}).textOverflow||(f.textOverflow="ellipsis"),l.css(f)))}moveLabel(t,e){let i=this,s=i.label,r=i.axis,o=!1,n;s&&s.textStr===t?(i.movedLabel=s,o=!0,delete i.label):p(r.ticks,function(e){o||e.isNew||e===i||!e.label||e.label.textStr!==t||(i.movedLabel=e.label,o=!0,e.labelPos=i.movedLabel.xy,delete e.label)}),!o&&(i.labelPos||s)&&(n=i.labelPos||s.xy,i.movedLabel=i.createLabel(t,e,n),i.movedLabel&&i.movedLabel.attr({opacity:0}))}render(t,e,i){let s=this.axis,r=s.horiz,n=this.pos,a=u(this.tickmarkOffset,s.tickmarkOffset),h=this.getPosition(r,n,a,e),d=h.x,c=h.y,p=s.pos,g=p+s.len,f=r?d:c;!s.chart.polar&&this.isNew&&(o(f)<p||f>g)&&(i=0);let m=u(i,this.label&&this.label.newOpacity,1);i=u(i,1),this.isActive=!0,this.renderGridLine(e,i),this.renderMark(h,i),this.renderLabel(h,e,m,t),this.isNew=!1,l(this,"afterRender")}renderGridLine(t,e){let i=this.axis,s=i.options,r={},o=this.pos,n=this.type,a=u(this.tickmarkOffset,i.tickmarkOffset),h=i.chart.renderer,l=this.gridLine,d,c=s.gridLineWidth,p=s.gridLineColor,g=s.gridLineDashStyle;"minor"===this.type&&(c=s.minorGridLineWidth,p=s.minorGridLineColor,g=s.minorGridLineDashStyle),l||(i.chart.styledMode||(r.stroke=p,r["stroke-width"]=c||0,r.dashstyle=g),n||(r.zIndex=1),t&&(e=0),this.gridLine=l=h.path().attr(r).addClass("highcharts-"+(n?n+"-":"")+"grid-line").add(i.gridGroup)),l&&(d=i.getPlotLinePath({value:o+a,lineWidth:l.strokeWidth(),force:"pass",old:t,acrossPanes:!1}))&&l[t||this.isNew?"attr":"animate"]({d:d,opacity:e})}renderMark(t,e){let i=this.axis,s=i.options,r=i.chart.renderer,o=this.type,n=i.tickSize(o?o+"Tick":"tick"),a=t.x,h=t.y,l=u(s["minor"!==o?"tickWidth":"minorTickWidth"],!o&&i.isXAxis?1:0),d=s["minor"!==o?"tickColor":"minorTickColor"],c=this.mark,p=!c;n&&(i.opposite&&(n[0]=-n[0]),c||(this.mark=c=r.path().addClass("highcharts-"+(o?o+"-":"")+"tick").add(i.axisGroup),i.chart.styledMode||c.attr({stroke:d,"stroke-width":l})),c[p?"attr":"animate"]({d:this.getMarkPath(a,h,n[0],c.strokeWidth(),i.horiz,r),opacity:e}))}renderLabel(t,e,i,s){let r=this.axis,o=r.horiz,n=r.options,a=this.label,h=n.labels,l=h.step,c=u(this.tickmarkOffset,r.tickmarkOffset),p=t.x,g=t.y,f=!0;a&&d(p)&&(a.xy=t=this.getLabelPosition(p,g,a,o,h,c,s,l),(!this.isFirst||this.isLast||n.showFirstLabel)&&(!this.isLast||this.isFirst||n.showLastLabel)?!o||h.step||h.rotation||e||0===i||this.handleOverflow(t):f=!1,l&&s%l&&(f=!1),f&&d(t.y)?(t.opacity=i,a[this.isNewLabel?"attr":"animate"](t).show(!0),this.isNewLabel=!1):(a.hide(),this.isNewLabel=!0))}replaceMovedLabel(){let t=this.label,e=this.axis;t&&!this.isNew&&(t.animate({opacity:0},void 0,t.destroy),delete this.label),e.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel}}}),i(e,"Core/Axis/Axis.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Axis/AxisDefaults.js"],e["Core/Color/Color.js"],e["Core/Defaults.js"],e["Core/Foundation.js"],e["Core/Globals.js"],e["Core/Axis/Tick.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o,n,a){let{animObject:h}=t,{xAxis:l,yAxis:d}=e,{defaultOptions:c}=s,{registerEventOptions:p}=r,{deg2rad:u}=o,{arrayMax:g,arrayMin:f,clamp:m,correctFloat:x,defined:y,destroyObjectProperties:b,erase:v,error:S,extend:C,fireEvent:k,getClosestDistance:M,insertItem:w,isArray:T,isNumber:A,isString:P,merge:L,normalizeTickInterval:O,objectEach:D,pick:E,relativeLength:I,removeEvent:j,splat:B,syncTimeout:R}=a,z=(t,e)=>O(e,void 0,void 0,E(t.options.allowDecimals,e<.5||void 0!==t.tickAmount),!!t.tickAmount);C(c,{xAxis:l,yAxis:L(l,d)});class N{constructor(t,e,i){this.init(t,e,i)}init(t,e,i=this.coll){let s="xAxis"===i,r=this.isZAxis||(t.inverted?!s:s);this.chart=t,this.horiz=r,this.isXAxis=s,this.coll=i,k(this,"init",{userOptions:e}),this.opposite=E(e.opposite,this.opposite),this.side=E(e.side,this.side,r?this.opposite?0:2:this.opposite?1:3),this.setOptions(e);let o=this.options,n=o.labels;this.type??(this.type=o.type||"linear"),this.uniqueNames??(this.uniqueNames=o.uniqueNames??!0),k(this,"afterSetType"),this.userOptions=e,this.minPixelPadding=0,this.reversed=E(o.reversed,this.reversed),this.visible=o.visible,this.zoomEnabled=o.zoomEnabled,this.hasNames="category"===this.type||!0===o.categories,this.categories=T(o.categories)&&o.categories||(this.hasNames?[]:void 0),this.names||(this.names=[],this.names.keys={}),this.plotLinesAndBandsGroups={},this.positiveValuesOnly=!!this.logarithmic,this.isLinked=y(o.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len??(this.len=0),this.minRange=this.userMinRange=o.minRange||o.maxZoom,this.range=o.range,this.offset=o.offset||0,this.max=void 0,this.min=void 0;let a=E(o.crosshair,B(t.options.tooltip.crosshairs)[s?0:1]);this.crosshair=!0===a?{}:a,-1===t.axes.indexOf(this)&&(s?t.axes.splice(t.xAxis.length,0,this):t.axes.push(this),w(this,t[this.coll])),t.orderItems(this.coll),this.series=this.series||[],t.inverted&&!this.isZAxis&&s&&!y(this.reversed)&&(this.reversed=!0),this.labelRotation=A(n.rotation)?n.rotation:void 0,p(this,o),k(this,"afterInit")}setOptions(t){let e=this.horiz?{labels:{autoRotation:[-45],padding:4},margin:15}:{labels:{padding:1},title:{rotation:90*this.side}};this.options=L(e,c[this.coll],t),k(this,"afterSetOptions",{userOptions:t})}defaultLabelFormatter(){let t=this.axis,{numberFormatter:e}=this.chart,i=A(this.value)?this.value:NaN,s=t.chart.time,r=t.categories,o=this.dateTimeLabelFormat,n=c.lang,a=n.numericSymbols,h=n.numericSymbolMagnitude||1e3,l=t.logarithmic?Math.abs(i):t.tickInterval,d=a&&a.length,p,u;if(r)u=`${this.value}`;else if(o)u=s.dateFormat(o,i);else if(d&&a&&l>=1e3)for(;d--&&void 0===u;)l>=(p=Math.pow(h,d+1))&&10*i%p==0&&null!==a[d]&&0!==i&&(u=e(i/p,-1)+a[d]);return void 0===u&&(u=Math.abs(i)>=1e4?e(i,-1):e(i,-1,void 0,"")),u}getSeriesExtremes(){let t;let e=this;k(this,"getSeriesExtremes",null,function(){e.hasVisibleSeries=!1,e.dataMin=e.dataMax=e.threshold=void 0,e.softThreshold=!e.isXAxis,e.series.forEach(i=>{if(i.reserveSpace()){let s=i.options,r,o=s.threshold,n,a;if(e.hasVisibleSeries=!0,e.positiveValuesOnly&&0>=(o||0)&&(o=void 0),e.isXAxis)(r=i.xData)&&r.length&&(r=e.logarithmic?r.filter(t=>t>0):r,n=(t=i.getXExtremes(r)).min,a=t.max,A(n)||n instanceof Date||(r=r.filter(A),n=(t=i.getXExtremes(r)).min,a=t.max),r.length&&(e.dataMin=Math.min(E(e.dataMin,n),n),e.dataMax=Math.max(E(e.dataMax,a),a)));else{let t=i.applyExtremes();A(t.dataMin)&&(n=t.dataMin,e.dataMin=Math.min(E(e.dataMin,n),n)),A(t.dataMax)&&(a=t.dataMax,e.dataMax=Math.max(E(e.dataMax,a),a)),y(o)&&(e.threshold=o),(!s.softThreshold||e.positiveValuesOnly)&&(e.softThreshold=!1)}}})}),k(this,"afterGetSeriesExtremes")}translate(t,e,i,s,r,o){let n=this.linkedParent||this,a=s&&n.old?n.old.min:n.min;if(!A(a))return NaN;let h=n.minPixelPadding,l=(n.isOrdinal||n.brokenAxis?.hasBreaks||n.logarithmic&&r)&&n.lin2val,d=1,c=0,p=s&&n.old?n.old.transA:n.transA,u=0;return p||(p=n.transA),i&&(d*=-1,c=n.len),n.reversed&&(d*=-1,c-=d*(n.sector||n.len)),e?(u=(t=t*d+c-h)/p+a,l&&(u=n.lin2val(u))):(l&&(t=n.val2lin(t)),u=d*(t-a)*p+c+d*h+(A(o)?p*o:0),n.isRadial||(u=x(u))),u}toPixels(t,e){return this.translate(t,!1,!this.horiz,void 0,!0)+(e?0:this.pos)}toValue(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,void 0,!0)}getPlotLinePath(t){let e=this,i=e.chart,s=e.left,r=e.top,o=t.old,n=t.value,a=t.lineWidth,h=o&&i.oldChartHeight||i.chartHeight,l=o&&i.oldChartWidth||i.chartWidth,d=e.transB,c=t.translatedValue,p=t.force,u,g,f,x,y;function b(t,e,i){return"pass"!==p&&(t<e||t>i)&&(p?t=m(t,e,i):y=!0),t}let v={value:n,lineWidth:a,old:o,force:p,acrossPanes:t.acrossPanes,translatedValue:c};return k(this,"getPlotLinePath",v,function(t){u=f=(c=m(c=E(c,e.translate(n,void 0,void 0,o)),-1e9,1e9))+d,g=x=h-c-d,A(c)?e.horiz?(g=r,x=h-e.bottom+(e.options.isInternal?0:i.scrollablePixelsY||0),u=f=b(u,s,s+e.width)):(u=s,f=l-e.right+(i.scrollablePixelsX||0),g=x=b(g,r,r+e.height)):(y=!0,p=!1),t.path=y&&!p?void 0:i.renderer.crispLine([["M",u,g],["L",f,x]],a||1)}),v.path}getLinearTickPositions(t,e,i){let s,r,o;let n=x(Math.floor(e/t)*t),a=x(Math.ceil(i/t)*t),h=[];if(x(n+t)===n&&(o=20),this.single)return[e];for(s=n;s<=a&&(h.push(s),(s=x(s+t,o))!==r);)r=s;return h}getMinorTickInterval(){let{minorTicks:t,minorTickInterval:e}=this.options;return!0===t?E(e,"auto"):!1!==t?e:void 0}getMinorTickPositions(){let t=this.options,e=this.tickPositions,i=this.minorTickInterval,s=this.pointRangePadding||0,r=(this.min||0)-s,o=(this.max||0)+s,n=o-r,a=[],h;if(n&&n/i<this.len/3){let s=this.logarithmic;if(s)this.paddedTicks.forEach(function(t,e,r){e&&a.push.apply(a,s.getLogTickPositions(i,r[e-1],r[e],!0))});else if(this.dateTime&&"auto"===this.getMinorTickInterval())a=a.concat(this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(i),r,o,t.startOfWeek));else for(h=r+(e[0]-r)%i;h<=o&&h!==a[0];h+=i)a.push(h)}return 0!==a.length&&this.trimTicks(a),a}adjustForMinRange(){let t=this.options,e=this.logarithmic,{max:i,min:s,minRange:r}=this,o,n,a,h;this.isXAxis&&void 0===r&&!e&&(r=y(t.min)||y(t.max)||y(t.floor)||y(t.ceiling)?null:Math.min(5*(M(this.series.map(t=>(t.xIncrement?t.xData?.slice(0,2):t.xData)||[]))||0),this.dataMax-this.dataMin)),A(i)&&A(s)&&A(r)&&i-s<r&&(n=this.dataMax-this.dataMin>=r,o=(r-i+s)/2,a=[s-o,E(t.min,s-o)],n&&(a[2]=e?e.log2lin(this.dataMin):this.dataMin),h=[(s=g(a))+r,E(t.max,s+r)],n&&(h[2]=e?e.log2lin(this.dataMax):this.dataMax),(i=f(h))-s<r&&(a[0]=i-r,a[1]=E(t.min,i-r),s=g(a))),this.minRange=r,this.min=s,this.max=i}getClosest(){let t,e;if(this.categories)e=1;else{let i=[];this.series.forEach(function(t){let s=t.closestPointRange;t.xData?.length===1?i.push(t.xData[0]):!t.noSharedTooltip&&y(s)&&t.reserveSpace()&&(e=y(e)?Math.min(e,s):s)}),i.length&&(i.sort((t,e)=>t-e),t=M([i]))}return t&&e?Math.min(t,e):t||e}nameToX(t){let e=T(this.options.categories),i=e?this.categories:this.names,s=t.options.x,r;return t.series.requireSorting=!1,y(s)||(s=this.uniqueNames&&i?e?i.indexOf(t.name):E(i.keys[t.name],-1):t.series.autoIncrement()),-1===s?!e&&i&&(r=i.length):r=s,void 0!==r?(this.names[r]=t.name,this.names.keys[t.name]=r):t.x&&(r=t.x),r}updateNames(){let t=this,e=this.names;e.length>0&&(Object.keys(e.keys).forEach(function(t){delete e.keys[t]}),e.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach(e=>{e.xIncrement=null,(!e.points||e.isDirtyData)&&(t.max=Math.max(t.max,e.xData.length-1),e.processData(),e.generatePoints()),e.data.forEach(function(i,s){let r;i?.options&&void 0!==i.name&&void 0!==(r=t.nameToX(i))&&r!==i.x&&(i.x=r,e.xData[s]=r)})}))}setAxisTranslation(){let t=this,e=t.max-t.min,i=t.linkedParent,s=!!t.categories,r=t.isXAxis,o=t.axisPointRange||0,n,a=0,h=0,l,d=t.transA;(r||s||o)&&(n=t.getClosest(),i?(a=i.minPointOffset,h=i.pointRangePadding):t.series.forEach(function(e){let i=s?1:r?E(e.options.pointRange,n,0):t.axisPointRange||0,l=e.options.pointPlacement;if(o=Math.max(o,i),!t.single||s){let t=e.is("xrange")?!r:r;a=Math.max(a,t&&P(l)?0:i/2),h=Math.max(h,t&&"on"===l?0:i)}}),l=t.ordinal&&t.ordinal.slope&&n?t.ordinal.slope/n:1,t.minPointOffset=a*=l,t.pointRangePadding=h*=l,t.pointRange=Math.min(o,t.single&&s?1:e),r&&n&&(t.closestPointRange=n)),t.translationSlope=t.transA=d=t.staticScale||t.len/(e+h||1),t.transB=t.horiz?t.left:t.bottom,t.minPixelPadding=d*a,k(this,"afterSetAxisTranslation")}minFromRange(){let{max:t,min:e}=this;return A(t)&&A(e)&&t-e||void 0}setTickInterval(t){let{categories:e,chart:i,dataMax:s,dataMin:r,dateTime:o,isXAxis:n,logarithmic:a,options:h,softThreshold:l}=this,d=A(this.threshold)?this.threshold:void 0,c=this.minRange||0,{ceiling:p,floor:u,linkedTo:g,softMax:f,softMin:m}=h,b=A(g)&&i[this.coll]?.[g],v=h.tickPixelInterval,C=h.maxPadding,M=h.minPadding,w=0,T,P=A(h.tickInterval)&&h.tickInterval>=0?h.tickInterval:void 0,L,O,D,I;if(o||e||b||this.getTickAmount(),D=E(this.userMin,h.min),I=E(this.userMax,h.max),b?(this.linkedParent=b,T=b.getExtremes(),this.min=E(T.min,T.dataMin),this.max=E(T.max,T.dataMax),this.type!==b.type&&S(11,!0,i)):(l&&y(d)&&A(s)&&A(r)&&(r>=d?(L=d,M=0):s<=d&&(O=d,C=0)),this.min=E(D,L,r),this.max=E(I,O,s)),A(this.max)&&A(this.min)&&(a&&(this.positiveValuesOnly&&!t&&0>=Math.min(this.min,E(r,this.min))&&S(10,!0,i),this.min=x(a.log2lin(this.min),16),this.max=x(a.log2lin(this.max),16)),this.range&&A(r)&&(this.userMin=this.min=D=Math.max(r,this.minFromRange()||0),this.userMax=I=this.max,this.range=void 0)),k(this,"foundExtremes"),this.adjustForMinRange(),A(this.min)&&A(this.max)){if(!A(this.userMin)&&A(m)&&m<this.min&&(this.min=D=m),!A(this.userMax)&&A(f)&&f>this.max&&(this.max=I=f),e||this.axisPointRange||this.stacking?.usePercentage||b||!(w=this.max-this.min)||(!y(D)&&M&&(this.min-=w*M),y(I)||!C||(this.max+=w*C)),!A(this.userMin)&&A(u)&&(this.min=Math.max(this.min,u)),!A(this.userMax)&&A(p)&&(this.max=Math.min(this.max,p)),l&&A(r)&&A(s)){let t=d||0;!y(D)&&this.min<t&&r>=t?this.min=h.minRange?Math.min(t,this.max-c):t:!y(I)&&this.max>t&&s<=t&&(this.max=h.minRange?Math.max(t,this.min+c):t)}!i.polar&&this.min>this.max&&(y(h.min)?this.max=this.min:y(h.max)&&(this.min=this.max)),w=this.max-this.min}if(this.min!==this.max&&A(this.min)&&A(this.max)?b&&!P&&v===b.options.tickPixelInterval?this.tickInterval=P=b.tickInterval:this.tickInterval=E(P,this.tickAmount?w/Math.max(this.tickAmount-1,1):void 0,e?1:w*v/Math.max(this.len,v)):this.tickInterval=1,n&&!t){let t=this.min!==this.old?.min||this.max!==this.old?.max;this.series.forEach(function(e){e.forceCrop=e.forceCropping?.(),e.processData(t)}),k(this,"postProcessData",{hasExtremesChanged:t})}this.setAxisTranslation(),k(this,"initialAxisTranslation"),this.pointRange&&!P&&(this.tickInterval=Math.max(this.pointRange,this.tickInterval));let j=E(h.minTickInterval,o&&!this.series.some(t=>t.noSharedTooltip)?this.closestPointRange:0);!P&&this.tickInterval<j&&(this.tickInterval=j),o||a||P||(this.tickInterval=z(this,this.tickInterval)),this.tickAmount||(this.tickInterval=this.unsquish()),this.setTickPositions()}setTickPositions(){let t=this.options,e=t.tickPositions,i=t.tickPositioner,s=this.getMinorTickInterval(),r=!this.isPanning,o=r&&t.startOnTick,n=r&&t.endOnTick,a=[],h;if(this.tickmarkOffset=this.categories&&"between"===t.tickmarkPlacement&&1===this.tickInterval?.5:0,this.single=this.min===this.max&&y(this.min)&&!this.tickAmount&&(this.min%1==0||!1!==t.allowDecimals),e)a=e.slice();else if(A(this.min)&&A(this.max)){if(!this.ordinal?.positions&&(this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))a=[this.min,this.max],S(19,!1,this.chart);else if(this.dateTime)a=this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,t.units),this.min,this.max,t.startOfWeek,this.ordinal?.positions,this.closestPointRange,!0);else if(this.logarithmic)a=this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max);else{let t=this.tickInterval,e=t;for(;e<=2*t;)if(a=this.getLinearTickPositions(this.tickInterval,this.min,this.max),this.tickAmount&&a.length>this.tickAmount)this.tickInterval=z(this,e*=1.1);else break}a.length>this.len&&(a=[a[0],a[a.length-1]])[0]===a[1]&&(a.length=1),i&&(this.tickPositions=a,(h=i.apply(this,[this.min,this.max]))&&(a=h))}this.tickPositions=a,this.minorTickInterval="auto"===s&&this.tickInterval?this.tickInterval/t.minorTicksPerMajor:s,this.paddedTicks=a.slice(0),this.trimTicks(a,o,n),!this.isLinked&&A(this.min)&&A(this.max)&&(this.single&&a.length<2&&!this.categories&&!this.series.some(t=>t.is("heatmap")&&"between"===t.options.pointPlacement)&&(this.min-=.5,this.max+=.5),e||h||this.adjustTickAmount()),k(this,"afterSetTickPositions")}trimTicks(t,e,i){let s=t[0],r=t[t.length-1],o=!this.isOrdinal&&this.minPointOffset||0;if(k(this,"trimTicks"),!this.isLinked){if(e&&s!==-1/0)this.min=s;else for(;this.min-o>t[0];)t.shift();if(i)this.max=r;else for(;this.max+o<t[t.length-1];)t.pop();0===t.length&&y(s)&&!this.options.tickPositions&&t.push((r+s)/2)}}alignToOthers(){let t;let e=this,i=e.chart,s=[this],r=e.options,o=i.options.chart,n="yAxis"===this.coll&&o.alignThresholds,a=[];if(e.thresholdAlignment=void 0,(!1!==o.alignTicks&&r.alignTicks||n)&&!1!==r.startOnTick&&!1!==r.endOnTick&&!e.logarithmic){let r=t=>{let{horiz:e,options:i}=t;return[e?i.left:i.top,i.width,i.height,i.pane].join(",")},o=r(this);i[this.coll].forEach(function(i){let{series:n}=i;n.length&&n.some(t=>t.visible)&&i!==e&&r(i)===o&&(t=!0,s.push(i))})}if(t&&n){s.forEach(t=>{let i=t.getThresholdAlignment(e);A(i)&&a.push(i)});let t=a.length>1?a.reduce((t,e)=>t+=e,0)/a.length:void 0;s.forEach(e=>{e.thresholdAlignment=t})}return t}getThresholdAlignment(t){if((!A(this.dataMin)||this!==t&&this.series.some(t=>t.isDirty||t.isDirtyData))&&this.getSeriesExtremes(),A(this.threshold)){let t=m((this.threshold-(this.dataMin||0))/((this.dataMax||0)-(this.dataMin||0)),0,1);return this.options.reversed&&(t=1-t),t}}getTickAmount(){let t=this.options,e=t.tickPixelInterval,i=t.tickAmount;y(t.tickInterval)||i||!(this.len<e)||this.isRadial||this.logarithmic||!t.startOnTick||!t.endOnTick||(i=2),!i&&this.alignToOthers()&&(i=Math.ceil(this.len/e)+1),i<4&&(this.finalTickAmt=i,i=5),this.tickAmount=i}adjustTickAmount(){let t=this,{finalTickAmt:e,max:i,min:s,options:r,tickPositions:o,tickAmount:n,thresholdAlignment:a}=t,h=o?.length,l=E(t.threshold,t.softThreshold?0:null),d,c,p=t.tickInterval,u,g=()=>o.push(x(o[o.length-1]+p)),f=()=>o.unshift(x(o[0]-p));if(A(a)&&(u=a<.5?Math.ceil(a*(n-1)):Math.floor(a*(n-1)),r.reversed&&(u=n-1-u)),t.hasData()&&A(s)&&A(i)){let a=()=>{t.transA*=(h-1)/(n-1),t.min=r.startOnTick?o[0]:Math.min(s,o[0]),t.max=r.endOnTick?o[o.length-1]:Math.max(i,o[o.length-1])};if(A(u)&&A(t.threshold)){for(;o[u]!==l||o.length!==n||o[0]>s||o[o.length-1]<i;){for(o.length=0,o.push(t.threshold);o.length<n;)void 0===o[u]||o[u]>t.threshold?f():g();if(p>8*t.tickInterval)break;p*=2}a()}else if(h<n){for(;o.length<n;)o.length%2||s===l?g():f();a()}if(y(e)){for(c=d=o.length;c--;)(3===e&&c%2==1||e<=2&&c>0&&c<d-1)&&o.splice(c,1);t.finalTickAmt=void 0}}}setScale(){let{coll:t,stacking:e}=this,i=!1,s=!1;this.series.forEach(t=>{i=i||t.isDirtyData||t.isDirty,s=s||t.xAxis&&t.xAxis.isDirty||!1}),this.setAxisSize();let r=this.len!==(this.old&&this.old.len);r||i||s||this.isLinked||this.forceRedraw||this.userMin!==(this.old&&this.old.userMin)||this.userMax!==(this.old&&this.old.userMax)||this.alignToOthers()?(e&&"yAxis"===t&&e.buildStacks(),this.forceRedraw=!1,this.userMinRange||(this.minRange=void 0),this.getSeriesExtremes(),this.setTickInterval(),e&&"xAxis"===t&&e.buildStacks(),this.isDirty||(this.isDirty=r||this.min!==this.old?.min||this.max!==this.old?.max)):e&&e.cleanStacks(),i&&delete this.allExtremes,k(this,"afterSetScale")}setExtremes(t,e,i=!0,s,r){this.series.forEach(t=>{delete t.kdTree}),k(this,"setExtremes",r=C(r,{min:t,max:e}),t=>{this.userMin=t.min,this.userMax=t.max,this.eventArgs=t,i&&this.chart.redraw(s)})}setAxisSize(){let t=this.chart,e=this.options,i=e.offsets||[0,0,0,0],s=this.horiz,r=this.width=Math.round(I(E(e.width,t.plotWidth-i[3]+i[1]),t.plotWidth)),o=this.height=Math.round(I(E(e.height,t.plotHeight-i[0]+i[2]),t.plotHeight)),n=this.top=Math.round(I(E(e.top,t.plotTop+i[0]),t.plotHeight,t.plotTop)),a=this.left=Math.round(I(E(e.left,t.plotLeft+i[3]),t.plotWidth,t.plotLeft));this.bottom=t.chartHeight-o-n,this.right=t.chartWidth-r-a,this.len=Math.max(s?r:o,0),this.pos=s?a:n}getExtremes(){let t=this.logarithmic;return{min:t?x(t.lin2log(this.min)):this.min,max:t?x(t.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}}getThreshold(t){let e=this.logarithmic,i=e?e.lin2log(this.min):this.min,s=e?e.lin2log(this.max):this.max;return null===t||t===-1/0?t=i:t===1/0?t=s:i>t?t=i:s<t&&(t=s),this.translate(t,0,1,0,1)}autoLabelAlign(t){let e=(E(t,0)-90*this.side+720)%360,i={align:"center"};return k(this,"autoLabelAlign",i,function(t){e>15&&e<165?t.align="right":e>195&&e<345&&(t.align="left")}),i.align}tickSize(t){let e=this.options,i=E(e["tick"===t?"tickWidth":"minorTickWidth"],"tick"===t&&this.isXAxis&&!this.categories?1:0),s=e["tick"===t?"tickLength":"minorTickLength"],r;i&&s&&("inside"===e[t+"Position"]&&(s=-s),r=[s,i]);let o={tickSize:r};return k(this,"afterTickSize",o),o.tickSize}labelMetrics(){let t=this.chart.renderer,e=this.ticks,i=e[Object.keys(e)[0]]||{};return this.chart.renderer.fontMetrics(i.label||i.movedLabel||t.box)}unsquish(){let t=this.options.labels,e=t.padding||0,i=this.horiz,s=this.tickInterval,r=this.len/(((this.categories?1:0)+this.max-this.min)/s),o=t.rotation,n=x(.8*this.labelMetrics().h),a=Math.max(this.max-this.min,0),h=function(t){let i=(t+2*e)/(r||1);return(i=i>1?Math.ceil(i):1)*s>a&&t!==1/0&&r!==1/0&&a&&(i=Math.ceil(a/s)),x(i*s)},l=s,d,c=Number.MAX_VALUE,p;if(i){if(!t.staggerLines&&(A(o)?p=[o]:r<t.autoRotationLimit&&(p=t.autoRotation)),p){let t,e;for(let i of p)(i===o||i&&i>=-90&&i<=90)&&(e=(t=h(Math.abs(n/Math.sin(u*i))))+Math.abs(i/360))<c&&(c=e,d=i,l=t)}}else l=h(.75*n);return this.autoRotation=p,this.labelRotation=E(d,A(o)?o:0),t.step?s:l}getSlotWidth(t){let e=this.chart,i=this.horiz,s=this.options.labels,r=Math.max(this.tickPositions.length-(this.categories?0:1),1),o=e.margin[3];if(t&&A(t.slotWidth))return t.slotWidth;if(i&&s.step<2)return s.rotation?0:(this.staggerLines||1)*this.len/r;if(!i){let t=s.style.width;if(void 0!==t)return parseInt(String(t),10);if(o)return o-e.spacing[3]}return .33*e.chartWidth}renderUnsquish(){let t=this.chart,e=t.renderer,i=this.tickPositions,s=this.ticks,r=this.options.labels,o=r.style,n=this.horiz,a=this.getSlotWidth(),h=Math.max(1,Math.round(a-(n?2*(r.padding||0):r.distance||0))),l={},d=this.labelMetrics(),c=o.textOverflow,p,u,g=0,f,m;if(P(r.rotation)||(l.rotation=r.rotation||0),i.forEach(function(t){let e=s[t];e.movedLabel&&e.replaceMovedLabel(),e&&e.label&&e.label.textPxLength>g&&(g=e.label.textPxLength)}),this.maxLabelLength=g,this.autoRotation)g>h&&g>d.h?l.rotation=this.labelRotation:this.labelRotation=0;else if(a&&(p=h,!c))for(u="clip",m=i.length;!n&&m--;)(f=s[i[m]].label)&&("ellipsis"===f.styles.textOverflow?f.css({textOverflow:"clip"}):f.textPxLength>a&&f.css({width:a+"px"}),f.getBBox().height>this.len/i.length-(d.h-d.f)&&(f.specificTextOverflow="ellipsis"));l.rotation&&(p=g>.5*t.chartHeight?.33*t.chartHeight:g,c||(u="ellipsis")),this.labelAlign=r.align||this.autoLabelAlign(this.labelRotation),this.labelAlign&&(l.align=this.labelAlign),i.forEach(function(t){let e=s[t],i=e&&e.label,r=o.width,n={};i&&(i.attr(l),e.shortenLabel?e.shortenLabel():p&&!r&&"nowrap"!==o.whiteSpace&&(p<i.textPxLength||"SPAN"===i.element.tagName)?(n.width=p+"px",c||(n.textOverflow=i.specificTextOverflow||u),i.css(n)):!i.styles.width||n.width||r||i.css({width:null}),delete i.specificTextOverflow,e.rotation=l.rotation)},this),this.tickRotCorr=e.rotCorr(d.b,this.labelRotation||0,0!==this.side)}hasData(){return this.series.some(function(t){return t.hasData()})||this.options.showEmpty&&y(this.min)&&y(this.max)}addTitle(t){let e;let i=this.chart.renderer,s=this.horiz,r=this.opposite,o=this.options.title,n=this.chart.styledMode;this.axisTitle||((e=o.textAlign)||(e=(s?{low:"left",middle:"center",high:"right"}:{low:r?"right":"left",middle:"center",high:r?"left":"right"})[o.align]),this.axisTitle=i.text(o.text||"",0,0,o.useHTML).attr({zIndex:7,rotation:o.rotation||0,align:e}).addClass("highcharts-axis-title"),n||this.axisTitle.css(L(o.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=!0),n||o.style.width||this.isRadial||this.axisTitle.css({width:this.len+"px"}),this.axisTitle[t?"show":"hide"](t)}generateTick(t){let e=this.ticks;e[t]?e[t].addLabel():e[t]=new n(this,t)}createGroups(){let{axisParent:t,chart:e,coll:i,options:s}=this,r=e.renderer,o=(e,o,n)=>r.g(e).attr({zIndex:n}).addClass(`highcharts-${i.toLowerCase()}${o} `+(this.isRadial?`highcharts-radial-axis${o} `:"")+(s.className||"")).add(t);this.axisGroup||(this.gridGroup=o("grid","-grid",s.gridZIndex),this.axisGroup=o("axis","",s.zIndex),this.labelGroup=o("axis-labels","-labels",s.labels.zIndex))}getOffset(){let t=this,{chart:e,horiz:i,options:s,side:r,ticks:o,tickPositions:n,coll:a}=t,h=e.inverted&&!t.isZAxis?[1,0,3,2][r]:r,l=t.hasData(),d=s.title,c=s.labels,p=A(s.crossing),u=e.axisOffset,g=e.clipOffset,f=[-1,1,1,-1][r],m,x=0,b,v=0,S=0,C,M;if(t.showAxis=m=l||s.showEmpty,t.staggerLines=t.horiz&&c.staggerLines||void 0,t.createGroups(),l||t.isLinked?(n.forEach(function(e){t.generateTick(e)}),t.renderUnsquish(),t.reserveSpaceDefault=0===r||2===r||({1:"left",3:"right"})[r]===t.labelAlign,E(c.reserveSpace,!p&&null,"center"===t.labelAlign||null,t.reserveSpaceDefault)&&n.forEach(function(t){S=Math.max(o[t].getLabelSize(),S)}),t.staggerLines&&(S*=t.staggerLines),t.labelOffset=S*(t.opposite?-1:1)):D(o,function(t,e){t.destroy(),delete o[e]}),d?.text&&!1!==d.enabled&&(t.addTitle(m),m&&!p&&!1!==d.reserveSpace&&(t.titleOffset=x=t.axisTitle.getBBox()[i?"height":"width"],v=y(b=d.offset)?0:E(d.margin,i?5:10))),t.renderLine(),t.offset=f*E(s.offset,u[r]?u[r]+(s.margin||0):0),t.tickRotCorr=t.tickRotCorr||{x:0,y:0},M=0===r?-t.labelMetrics().h:2===r?t.tickRotCorr.y:0,C=Math.abs(S)+v,S&&(C-=M,C+=f*(i?E(c.y,t.tickRotCorr.y+f*c.distance):E(c.x,f*c.distance))),t.axisTitleMargin=E(b,C),t.getMaxLabelDimensions&&(t.maxLabelDimensions=t.getMaxLabelDimensions(o,n)),"colorAxis"!==a&&g){let e=this.tickSize("tick");u[r]=Math.max(u[r],(t.axisTitleMargin||0)+x+f*t.offset,C,n&&n.length&&e?e[0]+f*t.offset:0);let i=!t.axisLine||s.offset?0:t.axisLine.strokeWidth()/2;g[h]=Math.max(g[h],i)}k(this,"afterGetOffset")}getLinePath(t){let e=this.chart,i=this.opposite,s=this.offset,r=this.horiz,o=this.left+(i?this.width:0)+s,n=e.chartHeight-this.bottom-(i?this.height:0)+s;return i&&(t*=-1),e.renderer.crispLine([["M",r?this.left:o,r?n:this.top],["L",r?e.chartWidth-this.right:o,r?n:e.chartHeight-this.bottom]],t)}renderLine(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))}getTitlePosition(t){let e=this.horiz,i=this.left,s=this.top,r=this.len,o=this.options.title,n=e?i:s,a=this.opposite,h=this.offset,l=o.x,d=o.y,c=this.chart.renderer.fontMetrics(t),p=t?Math.max(t.getBBox(!1,0).height-c.h-1,0):0,u={low:n+(e?0:r),middle:n+r/2,high:n+(e?r:0)}[o.align],g=(e?s+this.height:i)+(e?1:-1)*(a?-1:1)*(this.axisTitleMargin||0)+[-p,p,c.f,-p][this.side],f={x:e?u+l:g+(a?this.width:0)+h+l,y:e?g+d-(a?this.height:0)+h:u+d};return k(this,"afterGetTitlePosition",{titlePosition:f}),f}renderMinorTick(t,e){let i=this.minorTicks;i[t]||(i[t]=new n(this,t,"minor")),e&&i[t].isNew&&i[t].render(null,!0),i[t].render(null,!1,1)}renderTick(t,e,i){let s=this.isLinked,r=this.ticks;(!s||t>=this.min&&t<=this.max||this.grid&&this.grid.isColumn)&&(r[t]||(r[t]=new n(this,t)),i&&r[t].isNew&&r[t].render(e,!0,-1),r[t].render(e))}render(){let t,e;let i=this,s=i.chart,r=i.logarithmic,a=s.renderer,l=i.options,d=i.isLinked,c=i.tickPositions,p=i.axisTitle,u=i.ticks,g=i.minorTicks,f=i.alternateBands,m=l.stackLabels,x=l.alternateGridColor,y=l.crossing,b=i.tickmarkOffset,v=i.axisLine,S=i.showAxis,C=h(a.globalAnimation);if(i.labelEdge.length=0,i.overlap=!1,[u,g,f].forEach(function(t){D(t,function(t){t.isActive=!1})}),A(y)){let t=this.isXAxis?s.yAxis[0]:s.xAxis[0],e=[1,-1,-1,1][this.side];if(t){let s=t.toPixels(y,!0);i.horiz&&(s=t.len-s),i.offset=e*s}}if(i.hasData()||d){let a=i.chart.hasRendered&&i.old&&A(i.old.min);i.minorTickInterval&&!i.categories&&i.getMinorTickPositions().forEach(function(t){i.renderMinorTick(t,a)}),c.length&&(c.forEach(function(t,e){i.renderTick(t,e,a)}),b&&(0===i.min||i.single)&&(u[-1]||(u[-1]=new n(i,-1,null,!0)),u[-1].render(-1))),x&&c.forEach(function(n,a){e=void 0!==c[a+1]?c[a+1]+b:i.max-b,a%2==0&&n<i.max&&e<=i.max+(s.polar?-b:b)&&(f[n]||(f[n]=new o.PlotLineOrBand(i,{})),t=n+b,f[n].options={from:r?r.lin2log(t):t,to:r?r.lin2log(e):e,color:x,className:"highcharts-alternate-grid"},f[n].render(),f[n].isActive=!0)}),i._addedPlotLB||(i._addedPlotLB=!0,(l.plotLines||[]).concat(l.plotBands||[]).forEach(function(t){i.addPlotBandOrLine(t)}))}[u,g,f].forEach(function(t){let e=[],i=C.duration;D(t,function(t,i){t.isActive||(t.render(i,!1,0),t.isActive=!1,e.push(i))}),R(function(){let i=e.length;for(;i--;)t[e[i]]&&!t[e[i]].isActive&&(t[e[i]].destroy(),delete t[e[i]])},t!==f&&s.hasRendered&&i?i:0)}),v&&(v[v.isPlaced?"animate":"attr"]({d:this.getLinePath(v.strokeWidth())}),v.isPlaced=!0,v[S?"show":"hide"](S)),p&&S&&(p[p.isNew?"attr":"animate"](i.getTitlePosition(p)),p.isNew=!1),m&&m.enabled&&i.stacking&&i.stacking.renderStackTotals(),i.old={len:i.len,max:i.max,min:i.min,transA:i.transA,userMax:i.userMax,userMin:i.userMin},i.isDirty=!1,k(this,"afterRender")}redraw(){this.visible&&(this.render(),this.plotLinesAndBands.forEach(function(t){t.render()})),this.series.forEach(function(t){t.isDirty=!0})}getKeepProps(){return this.keepProps||N.keepProps}destroy(t){let e=this,i=e.plotLinesAndBands,s=this.eventOptions;if(k(this,"destroy",{keepEvents:t}),t||j(e),[e.ticks,e.minorTicks,e.alternateBands].forEach(function(t){b(t)}),i){let t=i.length;for(;t--;)i[t].destroy()}for(let t in["axisLine","axisTitle","axisGroup","gridGroup","labelGroup","cross","scrollbar"].forEach(function(t){e[t]&&(e[t]=e[t].destroy())}),e.plotLinesAndBandsGroups)e.plotLinesAndBandsGroups[t]=e.plotLinesAndBandsGroups[t].destroy();D(e,function(t,i){-1===e.getKeepProps().indexOf(i)&&delete e[i]}),this.eventOptions=s}drawCrosshair(t,e){let s=this.crosshair,r=E(s&&s.snap,!0),o=this.chart,n,a,h,l=this.cross,d;if(k(this,"drawCrosshair",{e:t,point:e}),t||(t=this.cross&&this.cross.e),s&&!1!==(y(e)||!r)){if(r?y(e)&&(a=E("colorAxis"!==this.coll?e.crosshairPos:null,this.isXAxis?e.plotX:this.len-e.plotY)):a=t&&(this.horiz?t.chartX-this.pos:this.len-t.chartY+this.pos),y(a)&&(d={value:e&&(this.isXAxis?e.x:E(e.stackY,e.y)),translatedValue:a},o.polar&&C(d,{isCrosshair:!0,chartX:t&&t.chartX,chartY:t&&t.chartY,point:e}),n=this.getPlotLinePath(d)||null),!y(n)){this.hideCrosshair();return}h=this.categories&&!this.isRadial,l||(this.cross=l=o.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(h?"category ":"thin ")+(s.className||"")).attr({zIndex:E(s.zIndex,2)}).add(),!o.styledMode&&(l.attr({stroke:s.color||(h?i.parse("#ccd3ff").setOpacity(.25).get():"#cccccc"),"stroke-width":E(s.width,1)}).css({"pointer-events":"none"}),s.dashStyle&&l.attr({dashstyle:s.dashStyle}))),l.show().attr({d:n}),h&&!s.width&&l.attr({"stroke-width":this.transA}),this.cross.e=t}else this.hideCrosshair();k(this,"afterDrawCrosshair",{e:t,point:e})}hideCrosshair(){this.cross&&this.cross.hide(),k(this,"afterHideCrosshair")}update(t,e){let i=this.chart;t=L(this.userOptions,t),this.destroy(!0),this.init(i,t),i.isDirtyBox=!0,E(e,!0)&&i.redraw()}remove(t){let e=this.chart,i=this.coll,s=this.series,r=s.length;for(;r--;)s[r]&&s[r].remove(!1);v(e.axes,this),v(e[i]||[],this),e.orderItems(i),this.destroy(),e.isDirtyBox=!0,E(t,!0)&&e.redraw()}setTitle(t,e){this.update({title:t},e)}setCategories(t,e){this.update({categories:t},e)}}return N.keepProps=["coll","extKey","hcEvents","len","names","series","userMax","userMin"],N}),i(e,"Core/Axis/DateTimeAxis.js",[e["Core/Utilities.js"]],function(t){var e;let{addEvent:i,getMagnitude:s,normalizeTickInterval:r,timeUnits:o}=t;return function(t){function e(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)}function n(){if("datetime"!==this.type){this.dateTime=void 0;return}this.dateTime||(this.dateTime=new a(this))}t.compose=function(t){return t.keepProps.includes("dateTime")||(t.keepProps.push("dateTime"),t.prototype.getTimeTicks=e,i(t,"afterSetType",n)),t};class a{constructor(t){this.axis=t}normalizeTimeTickInterval(t,e){let i=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],n=i[i.length-1],a=o[n[0]],h=n[1],l;for(l=0;l<i.length&&(a=o[(n=i[l])[0]],h=n[1],!i[l+1]||!(t<=(a*h[h.length-1]+o[i[l+1][0]])/2));l++);a===o.year&&t<5*a&&(h=[1,2,5]);let d=r(t/a,h,"year"===n[0]?Math.max(s(t/a),1):1);return{unitRange:a,count:d,unitName:n[0]}}getXDateFormat(t,e){let{axis:i}=this,s=i.chart.time;return i.closestPointRange?s.getDateFormat(i.closestPointRange,t,i.options.startOfWeek,e)||s.resolveDTLFormat(e.year).main:s.resolveDTLFormat(e.day).main}}t.Additions=a}(e||(e={})),e}),i(e,"Core/Axis/LogarithmicAxis.js",[e["Core/Utilities.js"]],function(t){var e;let{addEvent:i,normalizeTickInterval:s,pick:r}=t;return function(t){function e(){"logarithmic"!==this.type?this.logarithmic=void 0:this.logarithmic??(this.logarithmic=new n(this))}function o(){let t=this.logarithmic;t&&(this.lin2val=function(e){return t.lin2log(e)},this.val2lin=function(e){return t.log2lin(e)})}t.compose=function(t){return t.keepProps.includes("logarithmic")||(t.keepProps.push("logarithmic"),i(t,"afterSetType",e),i(t,"afterInit",o)),t};class n{constructor(t){this.axis=t}getLogTickPositions(t,e,i,o){let n=this.axis,a=n.len,h=n.options,l=[];if(o||(this.minorAutoInterval=void 0),t>=.5)t=Math.round(t),l=n.getLinearTickPositions(t,e,i);else if(t>=.08){let s,r,n,a,h,d,c;let p=Math.floor(e);for(s=t>.3?[1,2,4]:t>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9],r=p;r<i+1&&!c;r++)for(n=0,a=s.length;n<a&&!c;n++)(h=this.log2lin(this.lin2log(r)*s[n]))>e&&(!o||d<=i)&&void 0!==d&&l.push(d),d>i&&(c=!0),d=h}else{let d=this.lin2log(e),c=this.lin2log(i),p=o?n.getMinorTickInterval():h.tickInterval,u=h.tickPixelInterval/(o?5:1),g=o?a/n.tickPositions.length:a;t=s(t=r("auto"===p?null:p,this.minorAutoInterval,(c-d)*u/(g||1))),l=n.getLinearTickPositions(t,d,c).map(this.log2lin),o||(this.minorAutoInterval=t/5)}return o||(n.tickInterval=t),l}lin2log(t){return Math.pow(10,t)}log2lin(t){return Math.log(t)/Math.LN10}}t.Additions=n}(e||(e={})),e}),i(e,"Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js",[e["Core/Utilities.js"]],function(t){var e;let{erase:i,extend:s,isNumber:r}=t;return function(t){let e;function o(t){return this.addPlotBandOrLine(t,"plotBands")}function n(t,i){let s=this.userOptions,r=new e(this,t);if(this.visible&&(r=r.render()),r){if(this._addedPlotLB||(this._addedPlotLB=!0,(s.plotLines||[]).concat(s.plotBands||[]).forEach(t=>{this.addPlotBandOrLine(t)})),i){let e=s[i]||[];e.push(t),s[i]=e}this.plotLinesAndBands.push(r)}return r}function a(t){return this.addPlotBandOrLine(t,"plotLines")}function h(t,e,i){i=i||this.options;let s=this.getPlotLinePath({value:e,force:!0,acrossPanes:i.acrossPanes}),o=[],n=this.horiz,a=!r(this.min)||!r(this.max)||t<this.min&&e<this.min||t>this.max&&e>this.max,h=this.getPlotLinePath({value:t,force:!0,acrossPanes:i.acrossPanes}),l,d=1,c;if(h&&s)for(a&&(c=h.toString()===s.toString(),d=0),l=0;l<h.length;l+=2){let t=h[l],e=h[l+1],i=s[l],r=s[l+1];("M"===t[0]||"L"===t[0])&&("M"===e[0]||"L"===e[0])&&("M"===i[0]||"L"===i[0])&&("M"===r[0]||"L"===r[0])&&(n&&i[1]===t[1]?(i[1]+=d,r[1]+=d):n||i[2]!==t[2]||(i[2]+=d,r[2]+=d),o.push(["M",t[1],t[2]],["L",e[1],e[2]],["L",r[1],r[2]],["L",i[1],i[2]],["Z"])),o.isFlat=c}return o}function l(t){this.removePlotBandOrLine(t)}function d(t){let e=this.plotLinesAndBands,s=this.options,r=this.userOptions;if(e){let o=e.length;for(;o--;)e[o].id===t&&e[o].destroy();[s.plotLines||[],r.plotLines||[],s.plotBands||[],r.plotBands||[]].forEach(function(e){for(o=e.length;o--;)(e[o]||{}).id===t&&i(e,e[o])})}}function c(t){this.removePlotBandOrLine(t)}t.compose=function(t,i){let r=i.prototype;return r.addPlotBand||(e=t,s(r,{addPlotBand:o,addPlotLine:a,addPlotBandOrLine:n,getPlotBandPath:h,removePlotBand:l,removePlotLine:c,removePlotBandOrLine:d})),i}}(e||(e={})),e}),i(e,"Core/Axis/PlotLineOrBand/PlotLineOrBand.js",[e["Core/Axis/PlotLineOrBand/PlotLineOrBandAxis.js"],e["Core/Utilities.js"]],function(t,e){let{addEvent:i,arrayMax:s,arrayMin:r,defined:o,destroyObjectProperties:n,erase:a,fireEvent:h,merge:l,objectEach:d,pick:c}=e;class p{static compose(e,s){return i(e,"afterInit",function(){this.labelCollectors.push(()=>{let t=[];for(let e of this.axes)for(let{label:i,options:s}of e.plotLinesAndBands)i&&!s?.label?.allowOverlap&&t.push(i);return t})}),t.compose(p,s)}constructor(t,e){this.axis=t,this.options=e,this.id=e.id}render(){h(this,"render");let{axis:t,options:e}=this,{horiz:i,logarithmic:s}=t,{color:r,events:n,zIndex:a=0}=e,p={},u=t.chart.renderer,g=e.to,f=e.from,m=e.value,x=e.borderWidth,y=e.label,{label:b,svgElem:v}=this,S=[],C,k=o(f)&&o(g),M=o(m),w=!v,T={class:"highcharts-plot-"+(k?"band ":"line ")+(e.className||"")},A=k?"bands":"lines";if(!t.chart.styledMode&&(M?(T.stroke=r||"#999999",T["stroke-width"]=c(e.width,1),e.dashStyle&&(T.dashstyle=e.dashStyle)):k&&(T.fill=r||"#e6e9ff",x&&(T.stroke=e.borderColor,T["stroke-width"]=x))),p.zIndex=a,A+="-"+a,(C=t.plotLinesAndBandsGroups[A])||(t.plotLinesAndBandsGroups[A]=C=u.g("plot-"+A).attr(p).add()),v||(this.svgElem=v=u.path().attr(T).add(C)),o(m))S=t.getPlotLinePath({value:s?.log2lin(m)??m,lineWidth:v.strokeWidth(),acrossPanes:e.acrossPanes});else{if(!(o(f)&&o(g)))return;S=t.getPlotBandPath(s?.log2lin(f)??f,s?.log2lin(g)??g,e)}return!this.eventsAdded&&n&&(d(n,(t,e)=>{v?.on(e,t=>{n[e].apply(this,[t])})}),this.eventsAdded=!0),(w||!v.d)&&S?.length?v.attr({d:S}):v&&(S?(v.show(),v.animate({d:S})):v.d&&(v.hide(),b&&(this.label=b=b.destroy()))),y&&(o(y.text)||o(y.formatter))&&S?.length&&t.width>0&&t.height>0&&!S.isFlat?(y=l({align:i&&k?"center":void 0,x:i?!k&&4:10,verticalAlign:!i&&k?"middle":void 0,y:i?k?16:10:k?6:-4,rotation:i&&!k?90:0,...k?{inside:!0}:{}},y),this.renderLabel(y,S,k,a)):b&&b.hide(),this}renderLabel(t,e,i,n){let a=this.axis,h=a.chart.renderer,d=t.inside,c=this.label;c||(this.label=c=h.text(this.getLabelText(t),0,0,t.useHTML).attr({align:t.textAlign||t.align,rotation:t.rotation,class:"highcharts-plot-"+(i?"band":"line")+"-label "+(t.className||""),zIndex:n}),a.chart.styledMode||c.css(l({fontSize:"0.8em",textOverflow:i&&!d?"":"ellipsis"},t.style)),c.add());let p=e.xBounds||[e[0][1],e[1][1],i?e[2][1]:e[0][1]],u=e.yBounds||[e[0][2],e[1][2],i?e[2][2]:e[0][2]],g=r(p),f=r(u),m=s(p)-g;c.align(t,!1,{x:g,y:f,width:m,height:s(u)-f}),(!c.alignValue||"left"===c.alignValue||o(d))&&c.css({width:(t.style?.width||(i&&d?m:90===c.rotation?a.height-(c.alignAttr.y-a.top):(t.clip?a.width:a.chart.chartWidth)-(c.alignAttr.x-a.left)))+"px"}),c.show(!0)}getLabelText(t){return o(t.formatter)?t.formatter.call(this):t.text}destroy(){a(this.axis.plotLinesAndBands,this),delete this.axis,n(this)}}return p}),i(e,"Core/Tooltip.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Templating.js"],e["Core/Globals.js"],e["Core/Renderer/RendererUtilities.js"],e["Core/Renderer/RendererRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o){var n;let{animObject:a}=t,{format:h}=e,{composed:l,doc:d,isSafari:c}=i,{distribute:p}=s,{addEvent:u,clamp:g,css:f,discardElement:m,extend:x,fireEvent:y,isArray:b,isNumber:v,isString:S,merge:C,pick:k,pushUnique:M,splat:w,syncTimeout:T}=o;class A{constructor(t,e,i){this.allowShared=!0,this.crosshairs=[],this.distance=0,this.isHidden=!0,this.isSticky=!1,this.options={},this.outside=!1,this.chart=t,this.init(t,e),this.pointer=i}bodyFormatter(t){return t.map(function(t){let e=t.series.tooltipOptions;return(e[(t.point.formatPrefix||"point")+"Formatter"]||t.point.tooltipFormatter).call(t.point,e[(t.point.formatPrefix||"point")+"Format"]||"")})}cleanSplit(t){this.chart.series.forEach(function(e){let i=e&&e.tt;i&&(!i.isActive||t?e.tt=i.destroy():i.isActive=!1)})}defaultFormatter(t){let e;let i=this.points||w(this);return(e=(e=[t.tooltipFooterHeaderFormatter(i[0])]).concat(t.bodyFormatter(i))).push(t.tooltipFooterHeaderFormatter(i[0],!0)),e}destroy(){this.label&&(this.label=this.label.destroy()),this.split&&(this.cleanSplit(!0),this.tt&&(this.tt=this.tt.destroy())),this.renderer&&(this.renderer=this.renderer.destroy(),m(this.container)),o.clearTimeout(this.hideTimer)}getAnchor(t,e){let i;let{chart:s,pointer:r}=this,o=s.inverted,n=s.plotTop,a=s.plotLeft;if((t=w(t))[0].series&&t[0].series.yAxis&&!t[0].series.yAxis.options.reversedStacks&&(t=t.slice().reverse()),this.followPointer&&e)void 0===e.chartX&&(e=r.normalize(e)),i=[e.chartX-a,e.chartY-n];else if(t[0].tooltipPos)i=t[0].tooltipPos;else{let s=0,r=0;t.forEach(function(t){let e=t.pos(!0);e&&(s+=e[0],r+=e[1])}),s/=t.length,r/=t.length,this.shared&&t.length>1&&e&&(o?s=e.chartX:r=e.chartY),i=[s-a,r-n]}return i.map(Math.round)}getClassName(t,e,i){let s=this.options,r=t.series,o=r.options;return[s.className,"highcharts-label",i&&"highcharts-tooltip-header",e?"highcharts-tooltip-box":"highcharts-tooltip",!i&&"highcharts-color-"+k(t.colorIndex,r.colorIndex),o&&o.className].filter(S).join(" ")}getLabel({anchorX:t,anchorY:e}={anchorX:0,anchorY:0}){let s=this,o=this.chart.styledMode,n=this.options,a=this.split&&this.allowShared,h=this.container,l=this.chart.renderer;if(this.label){let t=!this.label.hasClass("highcharts-label");(!a&&t||a&&!t)&&this.destroy()}if(!this.label){if(this.outside){let t=this.chart.options.chart.style,e=r.getRendererType();this.container=h=i.doc.createElement("div"),h.className="highcharts-tooltip-container",f(h,{position:"absolute",top:"1px",pointerEvents:"none",zIndex:Math.max(this.options.style.zIndex||0,(t&&t.zIndex||0)+3)}),this.renderer=l=new e(h,0,0,t,void 0,void 0,l.styledMode)}if(a?this.label=l.g("tooltip"):(this.label=l.label("",t,e,n.shape,void 0,void 0,n.useHTML,void 0,"tooltip").attr({padding:n.padding,r:n.borderRadius}),o||this.label.attr({fill:n.backgroundColor,"stroke-width":n.borderWidth||0}).css(n.style).css({pointerEvents:n.style.pointerEvents||(this.shouldStickOnContact()?"auto":"none")})),s.outside){let t=this.label;[t.xSetter,t.ySetter].forEach((e,i)=>{t[i?"ySetter":"xSetter"]=r=>{e.call(t,s.distance),t[i?"y":"x"]=r,h&&(h.style[i?"top":"left"]=`${r}px`)}})}this.label.attr({zIndex:8}).shadow(n.shadow).add()}return h&&!h.parentElement&&i.doc.body.appendChild(h),this.label}getPlayingField(){let{body:t,documentElement:e}=d,{chart:i,distance:s,outside:r}=this;return{width:r?Math.max(t.scrollWidth,e.scrollWidth,t.offsetWidth,e.offsetWidth,e.clientWidth)-2*s:i.chartWidth,height:r?Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,e.clientHeight):i.chartHeight}}getPosition(t,e,i){let{distance:s,chart:r,outside:o,pointer:n}=this,{inverted:a,plotLeft:h,plotTop:l,polar:d}=r,{plotX:c=0,plotY:p=0}=i,u={},g=a&&i.h||0,{height:f,width:m}=this.getPlayingField(),x=n.getChartPosition(),y=t=>t*x.scaleX,b=t=>t*x.scaleY,v=i=>{let n="x"===i;return[i,n?m:f,n?t:e].concat(o?[n?y(t):b(e),n?x.left-s+y(c+h):x.top-s+b(p+l),0,n?m:f]:[n?t:e,n?c+h:p+l,n?h:l,n?h+r.plotWidth:l+r.plotHeight])},S=v("y"),C=v("x"),M,w=!!i.negative;!d&&r.hoverSeries?.yAxis?.reversed&&(w=!w);let T=!this.followPointer&&k(i.ttBelow,!d&&!a===w),A=function(t,e,i,r,n,a,h){let l=o?"y"===t?b(s):y(s):s,d=(i-r)/2,c=r<n-s,p=n+s+r<e,f=n-l-i+d,m=n+l-d;if(T&&p)u[t]=m;else if(!T&&c)u[t]=f;else if(c)u[t]=Math.min(h-r,f-g<0?f:f-g);else{if(!p)return!1;u[t]=Math.max(a,m+g+i>e?m:m+g)}},P=function(t,e,i,r,o){if(o<s||o>e-s)return!1;o<i/2?u[t]=1:o>e-r/2?u[t]=e-r-2:u[t]=o-i/2},L=function(t){[S,C]=[C,S],M=t},O=()=>{!1!==A.apply(0,S)?!1!==P.apply(0,C)||M||(L(!0),O()):M?u.x=u.y=0:(L(!0),O())};return(a&&!d||this.len>1)&&L(),O(),u}hide(t){let e=this;o.clearTimeout(this.hideTimer),t=k(t,this.options.hideDelay),this.isHidden||(this.hideTimer=T(function(){let i=e.getLabel();e.getLabel().animate({opacity:0},{duration:t?150:t,complete:()=>{i.hide(),e.container&&e.container.remove()}}),e.isHidden=!0},t))}init(t,e){this.chart=t,this.options=e,this.crosshairs=[],this.isHidden=!0,this.split=e.split&&!t.inverted&&!t.polar,this.shared=e.shared||this.split,this.outside=k(e.outside,!!(t.scrollablePixelsX||t.scrollablePixelsY))}shouldStickOnContact(t){return!!(!this.followPointer&&this.options.stickOnContact&&(!t||this.pointer.inClass(t.target,"highcharts-tooltip")))}move(t,e,i,s){let r=this,o=a(!r.isHidden&&r.options.animation),n=r.followPointer||(r.len||0)>1,h={x:t,y:e};n||(h.anchorX=i,h.anchorY=s),o.step=()=>r.drawTracker(),r.getLabel().animate(h,o)}refresh(t,e){let{chart:i,options:s,pointer:r,shared:n}=this,a=w(t),l=a[0],d=[],c=s.format,p=s.formatter||this.defaultFormatter,u=i.styledMode,f={},m=this.allowShared;if(!s.enabled||!l.series)return;o.clearTimeout(this.hideTimer),this.allowShared=!(!b(t)&&t.series&&t.series.noSharedTooltip),m=m&&!this.allowShared,this.followPointer=!this.split&&l.series.tooltipOptions.followPointer;let x=this.getAnchor(t,e),v=x[0],C=x[1];n&&this.allowShared?(r.applyInactiveState(a),a.forEach(function(t){t.setState("hover"),d.push(t.getLabelConfig())}),(f=l.getLabelConfig()).points=d):f=l.getLabelConfig(),this.len=d.length;let M=S(c)?h(c,f,i):p.call(f,this),T=l.series;if(this.distance=k(T.tooltipOptions.distance,16),!1===M)this.hide();else{if(this.split&&this.allowShared)this.renderSplit(M,a);else{let t=v,o=C;if(e&&r.isDirectTouch&&(t=e.chartX-i.plotLeft,o=e.chartY-i.plotTop),i.polar||!1===T.options.clip||a.some(e=>r.isDirectTouch||e.series.shouldShowTooltip(t,o))){let t=this.getLabel(m&&this.tt||{});(!s.style.width||u)&&t.css({width:(this.outside?this.getPlayingField():i.spacingBox).width+"px"}),t.attr({class:this.getClassName(l),text:M&&M.join?M.join(""):M}),this.outside&&t.attr({x:g(t.x||0,0,this.getPlayingField().width-(t.width||0))}),u||t.attr({stroke:s.borderColor||l.color||T.color||"#666666"}),this.updatePosition({plotX:v,plotY:C,negative:l.negative,ttBelow:l.ttBelow,h:x[2]||0})}else{this.hide();return}}this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1}y(this,"refresh")}renderSplit(t,e){let i=this,{chart:s,chart:{chartWidth:r,chartHeight:o,plotHeight:n,plotLeft:a,plotTop:h,scrollablePixelsY:l=0,scrollablePixelsX:u,styledMode:f},distance:m,options:y,options:{positioner:b},pointer:v}=i,{scrollLeft:C=0,scrollTop:M=0}=s.scrollablePlotArea?.scrollingContainer||{},w=i.outside&&"number"!=typeof u?d.documentElement.getBoundingClientRect():{left:C,right:C+r,top:M,bottom:M+o},T=i.getLabel(),A=this.renderer||s.renderer,P=!!(s.xAxis[0]&&s.xAxis[0].opposite),{left:L,top:O}=v.getChartPosition(),D=h+M,E=0,I=n-l;function j(t,e,s,r,o=!0){let n,a;return s?(n=P?0:I,a=g(t-r/2,w.left,w.right-r-(i.outside?L:0))):(n=e-D,a=g(a=o?t-r-m:t+m,o?a:w.left,w.right)),{x:a,y:n}}S(t)&&(t=[!1,t]);let B=t.slice(0,e.length+1).reduce(function(t,s,r){if(!1!==s&&""!==s){let o=e[r-1]||{isHeader:!0,plotX:e[0].plotX,plotY:n,series:{}},l=o.isHeader,d=l?i:o.series,c=d.tt=function(t,e,s){let r=t,{isHeader:o,series:n}=e;if(!r){let t={padding:y.padding,r:y.borderRadius};f||(t.fill=y.backgroundColor,t["stroke-width"]=y.borderWidth??1),r=A.label("",0,0,y[o?"headerShape":"shape"],void 0,void 0,y.useHTML).addClass(i.getClassName(e,!0,o)).attr(t).add(T)}return r.isActive=!0,r.attr({text:s}),f||r.css(y.style).attr({stroke:y.borderColor||e.color||n.color||"#333333"}),r}(d.tt,o,s.toString()),p=c.getBBox(),u=p.width+c.strokeWidth();l&&(E=p.height,I+=E,P&&(D-=E));let{anchorX:x,anchorY:v}=function(t){let e,i;let{isHeader:s,plotX:r=0,plotY:o=0,series:l}=t;if(s)e=Math.max(a+r,a),i=h+n/2;else{let{xAxis:t,yAxis:s}=l;e=t.pos+g(r,-m,t.len+m),l.shouldShowTooltip(0,s.pos-h+o,{ignoreX:!0})&&(i=s.pos+o)}return{anchorX:e=g(e,w.left-m,w.right+m),anchorY:i}}(o);if("number"==typeof v){let e=p.height+1,s=b?b.call(i,u,e,o):j(x,v,l,u);t.push({align:b?0:void 0,anchorX:x,anchorY:v,boxWidth:u,point:o,rank:k(s.rank,l?1:0),size:e,target:s.y,tt:c,x:s.x})}else c.isActive=!1}return t},[]);!b&&B.some(t=>{let{outside:e}=i,s=(e?L:0)+t.anchorX;return s<w.left&&s+t.boxWidth<w.right||s<L-w.left+t.boxWidth&&w.right-s>s})&&(B=B.map(t=>{let{x:e,y:i}=j(t.anchorX,t.anchorY,t.point.isHeader,t.boxWidth,!1);return x(t,{target:i,x:e})})),i.cleanSplit(),p(B,I);let R={left:L,right:L};B.forEach(function(t){let{x:e,boxWidth:s,isHeader:r}=t;!r&&(i.outside&&L+e<R.left&&(R.left=L+e),!r&&i.outside&&R.left+s>R.right&&(R.right=L+e))}),B.forEach(function(t){let{x:e,anchorX:s,anchorY:r,pos:o,point:{isHeader:n}}=t,a={visibility:void 0===o?"hidden":"inherit",x:e,y:(o||0)+D,anchorX:s,anchorY:r};if(i.outside&&e<s){let t=L-R.left;t>0&&(n||(a.x=e+t,a.anchorX=s+t),n&&(a.x=(R.right-R.left)/2,a.anchorX=s+t))}t.tt.attr(a)});let{container:z,outside:N,renderer:W}=i;if(N&&z&&W){let{width:t,height:e,x:i,y:s}=T.getBBox();W.setSize(t+i,e+s,!1),z.style.left=R.left+"px",z.style.top=O+"px"}c&&T.attr({opacity:1===T.opacity?.999:1})}drawTracker(){if(!this.shouldStickOnContact()){this.tracker&&(this.tracker=this.tracker.destroy());return}let t=this.chart,e=this.label,i=this.shared?t.hoverPoints:t.hoverPoint;if(!e||!i)return;let s={x:0,y:0,width:0,height:0},r=this.getAnchor(i),o=e.getBBox();r[0]+=t.plotLeft-(e.translateX||0),r[1]+=t.plotTop-(e.translateY||0),s.x=Math.min(0,r[0]),s.y=Math.min(0,r[1]),s.width=r[0]<0?Math.max(Math.abs(r[0]),o.width-r[0]):Math.max(Math.abs(r[0]),o.width),s.height=r[1]<0?Math.max(Math.abs(r[1]),o.height-Math.abs(r[1])):Math.max(Math.abs(r[1]),o.height),this.tracker?this.tracker.attr(s):(this.tracker=e.renderer.rect(s).addClass("highcharts-tracker").add(e),t.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}styledModeFormat(t){return t.replace('style="font-size: 0.8em"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex} {series.options.className} {point.options.className}"')}tooltipFooterHeaderFormatter(t,e){let i=t.series,s=i.tooltipOptions,r=i.xAxis,o=r&&r.dateTime,n={isFooter:e,labelConfig:t},a=s.xDateFormat,l=s[e?"footerFormat":"headerFormat"];return y(this,"headerFormatter",n,function(e){o&&!a&&v(t.key)&&(a=o.getXDateFormat(t.key,s.dateTimeLabelFormats)),o&&a&&(t.point&&t.point.tooltipDateKeys||["key"]).forEach(function(t){l=l.replace("{point."+t+"}","{point."+t+":"+a+"}")}),i.chart.styledMode&&(l=this.styledModeFormat(l)),e.text=h(l,{point:t,series:i},this.chart)}),n.text}update(t){this.destroy(),this.init(this.chart,C(!0,this.options,t))}updatePosition(t){let{chart:e,container:i,distance:s,options:r,pointer:o,renderer:n}=this,{height:a=0,width:h=0}=this.getLabel(),{left:l,top:d,scaleX:c,scaleY:p}=o.getChartPosition(),u=(r.positioner||this.getPosition).call(this,h,a,t),g=(t.plotX||0)+e.plotLeft,m=(t.plotY||0)+e.plotTop,x;n&&i&&(r.positioner&&(u.x+=l-s,u.y+=d-s),x=(r.borderWidth||0)+2*s+2,n.setSize(h+x,a+x,!1),(1!==c||1!==p)&&(f(i,{transform:`scale(${c}, ${p})`}),g*=c,m*=p),g+=l-u.x,m+=d-u.y),this.move(Math.round(u.x),Math.round(u.y||0),g,m)}}return(n=A||(A={})).compose=function(t){M(l,"Core.Tooltip")&&u(t,"afterInit",function(){let t=this.chart;t.options.tooltip&&(t.tooltip=new n(t,t.options.tooltip,this))})},A}),i(e,"Core/Series/Point.js",[e["Core/Renderer/HTML/AST.js"],e["Core/Animation/AnimationUtilities.js"],e["Core/Defaults.js"],e["Core/Templating.js"],e["Core/Utilities.js"]],function(t,e,i,s,r){let{animObject:o}=e,{defaultOptions:n}=i,{format:a}=s,{addEvent:h,crisp:l,erase:d,extend:c,fireEvent:p,getNestedProperty:u,isArray:g,isFunction:f,isNumber:m,isObject:x,merge:y,pick:b,syncTimeout:v,removeEvent:S,uniqueKey:C}=r;class k{animateBeforeDestroy(){let t=this,e={x:t.startXPos,opacity:0},i=t.getGraphicalProps();i.singular.forEach(function(i){t[i]=t[i].animate("dataLabel"===i?{x:t[i].startXPos,y:t[i].startYPos,opacity:0}:e)}),i.plural.forEach(function(e){t[e].forEach(function(e){e.element&&e.animate(c({x:t.startXPos},e.startYPos?{x:e.startXPos,y:e.startYPos}:{}))})})}applyOptions(t,e){let i=this.series,s=i.options.pointValKey||i.pointValKey;return c(this,t=k.prototype.optionsToObject.call(this,t)),this.options=this.options?c(this.options,t):t,t.group&&delete this.group,t.dataLabels&&delete this.dataLabels,s&&(this.y=k.prototype.getNestedProperty.call(this,s)),this.selected&&(this.state="select"),"name"in this&&void 0===e&&i.xAxis&&i.xAxis.hasNames&&(this.x=i.xAxis.nameToX(this)),void 0===this.x&&i?this.x=e??i.autoIncrement():m(t.x)&&i.options.relativeXValue&&(this.x=i.autoIncrement(t.x)),this.isNull=this.isValid&&!this.isValid(),this.formatPrefix=this.isNull?"null":"point",this}destroy(){if(!this.destroyed){let t=this,e=t.series,i=e.chart,s=e.options.dataSorting,r=i.hoverPoints,n=o(t.series.chart.renderer.globalAnimation),a=()=>{for(let e in(t.graphic||t.graphics||t.dataLabel||t.dataLabels)&&(S(t),t.destroyElements()),t)delete t[e]};t.legendItem&&i.legend.destroyItem(t),r&&(t.setState(),d(r,t),r.length||(i.hoverPoints=null)),t===i.hoverPoint&&t.onMouseOut(),s&&s.enabled?(this.animateBeforeDestroy(),v(a,n.duration)):a(),i.pointCount--}this.destroyed=!0}destroyElements(t){let e=this,i=e.getGraphicalProps(t);i.singular.forEach(function(t){e[t]=e[t].destroy()}),i.plural.forEach(function(t){e[t].forEach(function(t){t&&t.element&&t.destroy()}),delete e[t]})}firePointEvent(t,e,i){let s=this,r=this.series.options;s.manageEvent(t),"click"===t&&r.allowPointSelect&&(i=function(t){!s.destroyed&&s.select&&s.select(null,t.ctrlKey||t.metaKey||t.shiftKey)}),p(s,t,e,i)}getClassName(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")}getGraphicalProps(t){let e,i;let s=this,r=[],o={singular:[],plural:[]};for((t=t||{graphic:1,dataLabel:1}).graphic&&r.push("graphic","connector"),t.dataLabel&&r.push("dataLabel","dataLabelPath","dataLabelUpper"),i=r.length;i--;)s[e=r[i]]&&o.singular.push(e);return["graphic","dataLabel"].forEach(function(e){let i=e+"s";t[e]&&s[i]&&o.plural.push(i)}),o}getLabelConfig(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}}getNestedProperty(t){return t?0===t.indexOf("custom.")?u(t,this.options):this[t]:void 0}getZone(){let t=this.series,e=t.zones,i=t.zoneAxis||"y",s,r=0;for(s=e[0];this[i]>=s.value;)s=e[++r];return this.nonZonedColor||(this.nonZonedColor=this.color),s&&s.color&&!this.options.color?this.color=s.color:this.color=this.nonZonedColor,s}hasNewShapeType(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType}constructor(t,e,i){this.formatPrefix="point",this.visible=!0,this.series=t,this.applyOptions(e,i),this.id??(this.id=C()),this.resolveColor(),t.chart.pointCount++,p(this,"afterInit")}isValid(){return(m(this.x)||this.x instanceof Date)&&m(this.y)}optionsToObject(t){let e=this.series,i=e.options.keys,s=i||e.pointArrayMap||["y"],r=s.length,o={},n,a=0,h=0;if(m(t)||null===t)o[s[0]]=t;else if(g(t))for(!i&&t.length>r&&("string"==(n=typeof t[0])?o.name=t[0]:"number"===n&&(o.x=t[0]),a++);h<r;)i&&void 0===t[a]||(s[h].indexOf(".")>0?k.prototype.setNestedProperty(o,t[a],s[h]):o[s[h]]=t[a]),a++,h++;else"object"==typeof t&&(o=t,t.dataLabels&&(e.hasDataLabels=()=>!0),t.marker&&(e._hasPointMarkers=!0));return o}pos(t,e=this.plotY){if(!this.destroyed){let{plotX:i,series:s}=this,{chart:r,xAxis:o,yAxis:n}=s,a=0,h=0;if(m(i)&&m(e))return t&&(a=o?o.pos:r.plotLeft,h=n?n.pos:r.plotTop),r.inverted&&o&&n?[n.len-e+h,o.len-i+a]:[i+a,e+h]}}resolveColor(){let t=this.series,e=t.chart.options.chart,i=t.chart.styledMode,s,r,o=e.colorCount,n;delete this.nonZonedColor,t.options.colorByPoint?(i||(s=(r=t.options.colors||t.chart.options.colors)[t.colorCounter],o=r.length),n=t.colorCounter,t.colorCounter++,t.colorCounter===o&&(t.colorCounter=0)):(i||(s=t.color),n=t.colorIndex),this.colorIndex=b(this.options.colorIndex,n),this.color=b(this.options.color,s)}setNestedProperty(t,e,i){return i.split(".").reduce(function(t,i,s,r){let o=r.length-1===s;return t[i]=o?e:x(t[i],!0)?t[i]:{},t[i]},t),t}shouldDraw(){return!this.isNull}tooltipFormatter(t){let e=this.series,i=e.tooltipOptions,s=b(i.valueDecimals,""),r=i.valuePrefix||"",o=i.valueSuffix||"";return e.chart.styledMode&&(t=e.chart.tooltip.styledModeFormat(t)),(e.pointArrayMap||["y"]).forEach(function(e){e="{point."+e,(r||o)&&(t=t.replace(RegExp(e+"}","g"),r+e+"}"+o)),t=t.replace(RegExp(e+"}","g"),e+":,."+s+"f}")}),a(t,{point:this,series:this.series},e.chart)}update(t,e,i,s){let r;let o=this,n=o.series,a=o.graphic,h=n.chart,l=n.options;function d(){o.applyOptions(t);let s=a&&o.hasMockGraphic,d=null===o.y?!s:s;a&&d&&(o.graphic=a.destroy(),delete o.hasMockGraphic),x(t,!0)&&(a&&a.element&&t&&t.marker&&void 0!==t.marker.symbol&&(o.graphic=a.destroy()),t?.dataLabels&&o.dataLabel&&(o.dataLabel=o.dataLabel.destroy())),r=o.index,n.updateParallelArrays(o,r),l.data[r]=x(l.data[r],!0)||x(t,!0)?o.options:b(t,l.data[r]),n.isDirty=n.isDirtyData=!0,!n.fixedBox&&n.hasCartesianSeries&&(h.isDirtyBox=!0),"point"===l.legendType&&(h.isDirtyLegend=!0),e&&h.redraw(i)}e=b(e,!0),!1===s?d():o.firePointEvent("update",{options:t},d)}remove(t,e){this.series.removePoint(this.series.data.indexOf(this),t,e)}select(t,e){let i=this,s=i.series,r=s.chart;t=b(t,!i.selected),this.selectedStaging=t,i.firePointEvent(t?"select":"unselect",{accumulate:e},function(){i.selected=i.options.selected=t,s.options.data[s.data.indexOf(i)]=i.options,i.setState(t&&"select"),e||r.getSelectedPoints().forEach(function(t){let e=t.series;t.selected&&t!==i&&(t.selected=t.options.selected=!1,e.options.data[e.data.indexOf(t)]=t.options,t.setState(r.hoverPoints&&e.options.inactiveOtherPoints?"inactive":""),t.firePointEvent("unselect"))})}),delete this.selectedStaging}onMouseOver(t){let{inverted:e,pointer:i}=this.series.chart;i&&(t=t?i.normalize(t):i.getChartCoordinatesFromPoint(this,e),i.runPointActions(t,this))}onMouseOut(){let t=this.series.chart;this.firePointEvent("mouseOut"),this.series.options.inactiveOtherPoints||(t.hoverPoints||[]).forEach(function(t){t.setState()}),t.hoverPoints=t.hoverPoint=null}manageEvent(t){let e=y(this.series.options.point,this.options),i=e.events?.[t];f(i)&&(!this.hcEvents?.[t]||this.hcEvents?.[t]?.map(t=>t.fn).indexOf(i)===-1)?(this.importedUserEvent?.(),this.importedUserEvent=h(this,t,i)):this.importedUserEvent&&!i&&this.hcEvents?.[t]&&(S(this,t),delete this.hcEvents[t],Object.keys(this.hcEvents)||delete this.importedUserEvent)}setState(e,i){let s=this.series,r=this.state,o=s.options.states[e||"normal"]||{},a=n.plotOptions[s.type].marker&&s.options.marker,h=a&&!1===a.enabled,l=a&&a.states&&a.states[e||"normal"]||{},d=!1===l.enabled,u=this.marker||{},g=s.chart,f=a&&s.markerAttribs,x=s.halo,y,v,S,C=s.stateMarkerGraphic,k;if((e=e||"")===this.state&&!i||this.selected&&"select"!==e||!1===o.enabled||e&&(d||h&&!1===l.enabled)||e&&u.states&&u.states[e]&&!1===u.states[e].enabled)return;if(this.state=e,f&&(y=s.markerAttribs(this,e)),this.graphic&&!this.hasMockGraphic){if(r&&this.graphic.removeClass("highcharts-point-"+r),e&&this.graphic.addClass("highcharts-point-"+e),!g.styledMode){v=s.pointAttribs(this,e),S=b(g.options.chart.animation,o.animation);let t=v.opacity;s.options.inactiveOtherPoints&&m(t)&&(this.dataLabels||[]).forEach(function(e){e&&!e.hasClass("highcharts-data-label-hidden")&&(e.animate({opacity:t},S),e.connector&&e.connector.animate({opacity:t},S))}),this.graphic.animate(v,S)}y&&this.graphic.animate(y,b(g.options.chart.animation,l.animation,a.animation)),C&&C.hide()}else e&&l&&(k=u.symbol||s.symbol,C&&C.currentSymbol!==k&&(C=C.destroy()),y&&(C?C[i?"animate":"attr"]({x:y.x,y:y.y}):k&&(s.stateMarkerGraphic=C=g.renderer.symbol(k,y.x,y.y,y.width,y.height).add(s.markerGroup),C.currentSymbol=k)),!g.styledMode&&C&&"inactive"!==this.state&&C.attr(s.pointAttribs(this,e))),C&&(C[e&&this.isInside?"show":"hide"](),C.element.point=this,C.addClass(this.getClassName(),!0));let M=o.halo,w=this.graphic||C,T=w&&w.visibility||"inherit";M&&M.size&&w&&"hidden"!==T&&!this.isCluster?(x||(s.halo=x=g.renderer.path().add(w.parentGroup)),x.show()[i?"animate":"attr"]({d:this.haloPath(M.size)}),x.attr({class:"highcharts-halo highcharts-color-"+b(this.colorIndex,s.colorIndex)+(this.className?" "+this.className:""),visibility:T,zIndex:-1}),x.point=this,g.styledMode||x.attr(c({fill:this.color||s.color,"fill-opacity":M.opacity},t.filterUserAttributes(M.attributes||{})))):x?.point?.haloPath&&!x.point.destroyed&&x.animate({d:x.point.haloPath(0)},null,x.hide),p(this,"afterSetState",{state:e})}haloPath(t){let e=this.pos();return e?this.series.chart.renderer.symbols.circle(l(e[0],1)-t,e[1]-t,2*t,2*t):[]}}return k}),i(e,"Core/Pointer.js",[e["Core/Color/Color.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){var s;let{parse:r}=t,{charts:o,composed:n,isTouchDevice:a}=e,{addEvent:h,attr:l,css:d,extend:c,find:p,fireEvent:u,isNumber:g,isObject:f,objectEach:m,offset:x,pick:y,pushUnique:b,splat:v}=i;class S{applyInactiveState(t){let e=[],i;(t||[]).forEach(function(t){i=t.series,e.push(i),i.linkedParent&&e.push(i.linkedParent),i.linkedSeries&&(e=e.concat(i.linkedSeries)),i.navigatorSeries&&e.push(i.navigatorSeries)}),this.chart.series.forEach(function(t){-1===e.indexOf(t)?t.setState("inactive",!0):t.options.inactiveOtherPoints&&t.setAllPointsToState("inactive")})}destroy(){let t=this;this.eventsToUnbind.forEach(t=>t()),this.eventsToUnbind=[],!e.chartCount&&(S.unbindDocumentMouseUp&&S.unbindDocumentMouseUp.forEach(t=>t()),S.unbindDocumentTouchEnd&&(S.unbindDocumentTouchEnd=S.unbindDocumentTouchEnd())),clearInterval(t.tooltipTimeout),m(t,function(e,i){t[i]=void 0})}getSelectionMarkerAttrs(t,e){let i={args:{chartX:t,chartY:e},attrs:{},shapeType:"rect"};return u(this,"getSelectionMarkerAttrs",i,i=>{let s;let{chart:r,zoomHor:o,zoomVert:n}=this,{mouseDownX:a=0,mouseDownY:h=0}=r,l=i.attrs;l.x=r.plotLeft,l.y=r.plotTop,l.width=o?1:r.plotWidth,l.height=n?1:r.plotHeight,o&&(s=t-a,l.width=Math.max(1,Math.abs(s)),l.x=(s>0?0:s)+a),n&&(s=e-h,l.height=Math.max(1,Math.abs(s)),l.y=(s>0?0:s)+h)}),i}drag(t){let{chart:e}=this,{mouseDownX:i=0,mouseDownY:s=0}=e,{panning:o,panKey:n,selectionMarkerFill:a}=e.options.chart,h=e.plotLeft,l=e.plotTop,d=e.plotWidth,c=e.plotHeight,p=f(o)?o.enabled:o,u=n&&t[`${n}Key`],g=t.chartX,m=t.chartY,x,y=this.selectionMarker;if((!y||!y.touch)&&(g<h?g=h:g>h+d&&(g=h+d),m<l?m=l:m>l+c&&(m=l+c),this.hasDragged=Math.sqrt(Math.pow(i-g,2)+Math.pow(s-m,2)),this.hasDragged>10)){x=e.isInsidePlot(i-h,s-l,{visiblePlotOnly:!0});let{shapeType:n,attrs:d}=this.getSelectionMarkerAttrs(g,m);(e.hasCartesianSeries||e.mapView)&&this.hasZoom&&x&&!u&&!y&&(this.selectionMarker=y=e.renderer[n](),y.attr({class:"highcharts-selection-marker",zIndex:7}).add(),e.styledMode||y.attr({fill:a||r("#334eff").setOpacity(.25).get()})),y&&y.attr(d),x&&!y&&p&&e.pan(t,o)}}dragStart(t){let e=this.chart;e.mouseIsDown=t.type,e.cancelClick=!1,e.mouseDownX=t.chartX,e.mouseDownY=t.chartY}getSelectionBox(t){let e={args:{marker:t},result:t.getBBox()};return u(this,"getSelectionBox",e),e.result}drop(t){let e;let{chart:i,selectionMarker:s}=this;for(let t of i.axes)t.isPanning&&(t.isPanning=!1,(t.options.startOnTick||t.options.endOnTick||t.series.some(t=>t.boosted))&&(t.forceRedraw=!0,t.setExtremes(t.userMin,t.userMax,!1),e=!0));if(e&&i.redraw(),s&&t){if(this.hasDragged){let e=this.getSelectionBox(s);i.transform({axes:i.axes.filter(t=>t.zoomEnabled&&("xAxis"===t.coll&&this.zoomX||"yAxis"===t.coll&&this.zoomY)),selection:{originalEvent:t,xAxis:[],yAxis:[],...e},from:e})}g(i.index)&&(this.selectionMarker=s.destroy())}i&&g(i.index)&&(d(i.container,{cursor:i._cursor}),i.cancelClick=this.hasDragged>10,i.mouseIsDown=!1,this.hasDragged=0,this.pinchDown=[])}findNearestKDPoint(t,e,i){let s;return t.forEach(function(t){let r=!(t.noSharedTooltip&&e)&&0>t.options.findNearestPointBy.indexOf("y"),o=t.searchPoint(i,r);f(o,!0)&&o.series&&(!f(s,!0)||function(t,i){let s=t.distX-i.distX,r=t.dist-i.dist,o=i.series.group?.zIndex-t.series.group?.zIndex;return 0!==s&&e?s:0!==r?r:0!==o?o:t.series.index>i.series.index?-1:1}(s,o)>0)&&(s=o)}),s}getChartCoordinatesFromPoint(t,e){let{xAxis:i,yAxis:s}=t.series,r=t.shapeArgs;if(i&&s){let o=t.clientX??t.plotX??0,n=t.plotY||0;return t.isNode&&r&&g(r.x)&&g(r.y)&&(o=r.x,n=r.y),e?{chartX:s.len+s.pos-n,chartY:i.len+i.pos-o}:{chartX:o+i.pos,chartY:n+s.pos}}if(r&&r.x&&r.y)return{chartX:r.x,chartY:r.y}}getChartPosition(){if(this.chartPosition)return this.chartPosition;let{container:t}=this.chart,e=x(t);this.chartPosition={left:e.left,top:e.top,scaleX:1,scaleY:1};let{offsetHeight:i,offsetWidth:s}=t;return s>2&&i>2&&(this.chartPosition.scaleX=e.width/s,this.chartPosition.scaleY=e.height/i),this.chartPosition}getCoordinates(t){let e={xAxis:[],yAxis:[]};for(let i of this.chart.axes)e[i.isXAxis?"xAxis":"yAxis"].push({axis:i,value:i.toValue(t[i.horiz?"chartX":"chartY"])});return e}getHoverData(t,e,i,s,r,o){let n=[],a=function(t){return t.visible&&!(!r&&t.directTouch)&&y(t.options.enableMouseTracking,!0)},h=e,l,d={chartX:o?o.chartX:void 0,chartY:o?o.chartY:void 0,shared:r};u(this,"beforeGetHoverData",d),l=h&&!h.stickyTracking?[h]:i.filter(t=>t.stickyTracking&&(d.filter||a)(t));let c=s&&t||!o?t:this.findNearestKDPoint(l,r,o);return h=c&&c.series,c&&(r&&!h.noSharedTooltip?(l=i.filter(function(t){return d.filter?d.filter(t):a(t)&&!t.noSharedTooltip})).forEach(function(t){let e=p(t.points,function(t){return t.x===c.x&&!t.isNull});f(e)&&(t.boosted&&t.boost&&(e=t.boost.getPoint(e)),n.push(e))}):n.push(c)),u(this,"afterGetHoverData",d={hoverPoint:c}),{hoverPoint:d.hoverPoint,hoverSeries:h,hoverPoints:n}}getPointFromEvent(t){let e=t.target,i;for(;e&&!i;)i=e.point,e=e.parentNode;return i}onTrackerMouseOut(t){let e=this.chart,i=t.relatedTarget,s=e.hoverSeries;this.isDirectTouch=!1,!s||!i||s.stickyTracking||this.inClass(i,"highcharts-tooltip")||this.inClass(i,"highcharts-series-"+s.index)&&this.inClass(i,"highcharts-tracker")||s.onMouseOut()}inClass(t,e){let i=t,s;for(;i;){if(s=l(i,"class")){if(-1!==s.indexOf(e))return!0;if(-1!==s.indexOf("highcharts-container"))return!1}i=i.parentElement}}constructor(t,e){this.hasDragged=0,this.pointerCaptureEventsToUnbind=[],this.eventsToUnbind=[],this.options=e,this.chart=t,this.runChartClick=!!e.chart.events?.click,this.pinchDown=[],this.setDOMEvents(),u(this,"afterInit")}normalize(t,e){let i=t.touches,s=i?i.length?i.item(0):y(i.changedTouches,t.changedTouches)[0]:t;e||(e=this.getChartPosition());let r=s.pageX-e.left,o=s.pageY-e.top;return c(t,{chartX:Math.round(r/=e.scaleX),chartY:Math.round(o/=e.scaleY)})}onContainerClick(t){let e=this.chart,i=e.hoverPoint,s=this.normalize(t),r=e.plotLeft,o=e.plotTop;!e.cancelClick&&(i&&this.inClass(s.target,"highcharts-tracker")?(u(i.series,"click",c(s,{point:i})),e.hoverPoint&&i.firePointEvent("click",s)):(c(s,this.getCoordinates(s)),e.isInsidePlot(s.chartX-r,s.chartY-o,{visiblePlotOnly:!0})&&u(e,"click",s)))}onContainerMouseDown(t){let i=(1&(t.buttons||t.button))==1;t=this.normalize(t),e.isFirefox&&0!==t.button&&this.onContainerMouseMove(t),(void 0===t.button||i)&&(this.zoomOption(t),i&&t.preventDefault?.(),this.dragStart(t))}onContainerMouseLeave(t){let{pointer:e}=o[y(S.hoverChartIndex,-1)]||{};t=this.normalize(t),this.onContainerMouseMove(t),e&&!this.inClass(t.relatedTarget,"highcharts-tooltip")&&(e.reset(),e.chartPosition=void 0)}onContainerMouseEnter(){delete this.chartPosition}onContainerMouseMove(t){let e=this.chart,i=e.tooltip,s=this.normalize(t);this.setHoverChartIndex(t),("mousedown"===e.mouseIsDown||this.touchSelect(s))&&this.drag(s),!e.openMenu&&(this.inClass(s.target,"highcharts-tracker")||e.isInsidePlot(s.chartX-e.plotLeft,s.chartY-e.plotTop,{visiblePlotOnly:!0}))&&!(i&&i.shouldStickOnContact(s))&&(this.inClass(s.target,"highcharts-no-tooltip")?this.reset(!1,0):this.runPointActions(s))}onDocumentTouchEnd(t){this.onDocumentMouseUp(t)}onContainerTouchMove(t){this.touchSelect(t)?this.onContainerMouseMove(t):this.touch(t)}onContainerTouchStart(t){this.touchSelect(t)?this.onContainerMouseDown(t):(this.zoomOption(t),this.touch(t,!0))}onDocumentMouseMove(t){let e=this.chart,i=e.tooltip,s=this.chartPosition,r=this.normalize(t,s);!s||e.isInsidePlot(r.chartX-e.plotLeft,r.chartY-e.plotTop,{visiblePlotOnly:!0})||i&&i.shouldStickOnContact(r)||r.target!==e.container.ownerDocument&&this.inClass(r.target,"highcharts-tracker")||this.reset()}onDocumentMouseUp(t){o[y(S.hoverChartIndex,-1)]?.pointer?.drop(t)}pinch(t){let e=this,{chart:i,hasZoom:s,lastTouches:r}=e,o=[].map.call(t.touches||[],t=>e.normalize(t)),n=o.length,a=1===n&&(e.inClass(t.target,"highcharts-tracker")&&i.runTrackerClick||e.runChartClick),h=i.tooltip,l=1===n&&y(h?.options.followTouchMove,!0);n>1?e.initiated=!0:l&&(e.initiated=!1),s&&e.initiated&&!a&&!1!==t.cancelable&&t.preventDefault(),"touchstart"===t.type?(e.pinchDown=o,e.res=!0,i.mouseDownX=t.chartX):l?this.runPointActions(e.normalize(t)):r&&(u(i,"touchpan",{originalEvent:t,touches:o},()=>{let e=t=>{let e=t[0],i=t[1]||e;return{x:e.chartX,y:e.chartY,width:i.chartX-e.chartX,height:i.chartY-e.chartY}};i.transform({axes:i.axes.filter(t=>t.zoomEnabled&&(this.zoomHor&&t.horiz||this.zoomVert&&!t.horiz)),to:e(o),from:e(r),trigger:t.type})}),e.res&&(e.res=!1,this.reset(!1,0))),e.lastTouches=o}reset(t,e){let i=this.chart,s=i.hoverSeries,r=i.hoverPoint,o=i.hoverPoints,n=i.tooltip,a=n&&n.shared?o:r;t&&a&&v(a).forEach(function(e){e.series.isCartesian&&void 0===e.plotX&&(t=!1)}),t?n&&a&&v(a).length&&(n.refresh(a),n.shared&&o?o.forEach(function(t){t.setState(t.state,!0),t.series.isCartesian&&(t.series.xAxis.crosshair&&t.series.xAxis.drawCrosshair(null,t),t.series.yAxis.crosshair&&t.series.yAxis.drawCrosshair(null,t))}):r&&(r.setState(r.state,!0),i.axes.forEach(function(t){t.crosshair&&r.series[t.coll]===t&&t.drawCrosshair(null,r)}))):(r&&r.onMouseOut(),o&&o.forEach(function(t){t.setState()}),s&&s.onMouseOut(),n&&n.hide(e),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),i.axes.forEach(function(t){t.hideCrosshair()}),i.hoverPoints=i.hoverPoint=void 0)}runPointActions(t,e,i){let s=this.chart,r=s.series,n=s.tooltip&&s.tooltip.options.enabled?s.tooltip:void 0,a=!!n&&n.shared,l=e||s.hoverPoint,d=l&&l.series||s.hoverSeries,c=(!t||"touchmove"!==t.type)&&(!!e||d&&d.directTouch&&this.isDirectTouch),u=this.getHoverData(l,d,r,c,a,t);l=u.hoverPoint,d=u.hoverSeries;let g=u.hoverPoints,f=d&&d.tooltipOptions.followPointer&&!d.tooltipOptions.split,m=a&&d&&!d.noSharedTooltip;if(l&&(i||l!==s.hoverPoint||n&&n.isHidden)){if((s.hoverPoints||[]).forEach(function(t){-1===g.indexOf(t)&&t.setState()}),s.hoverSeries!==d&&d.onMouseOver(),this.applyInactiveState(g),(g||[]).forEach(function(t){t.setState("hover")}),s.hoverPoint&&s.hoverPoint.firePointEvent("mouseOut"),!l.series)return;s.hoverPoints=g,s.hoverPoint=l,l.firePointEvent("mouseOver",void 0,()=>{n&&l&&n.refresh(m?g:l,t)})}else if(f&&n&&!n.isHidden){let e=n.getAnchor([{}],t);s.isInsidePlot(e[0],e[1],{visiblePlotOnly:!0})&&n.updatePosition({plotX:e[0],plotY:e[1]})}this.unDocMouseMove||(this.unDocMouseMove=h(s.container.ownerDocument,"mousemove",t=>o[S.hoverChartIndex??-1]?.pointer?.onDocumentMouseMove(t)),this.eventsToUnbind.push(this.unDocMouseMove)),s.axes.forEach(function(e){let i;let r=y((e.crosshair||{}).snap,!0);!r||(i=s.hoverPoint)&&i.series[e.coll]===e||(i=p(g,t=>t.series&&t.series[e.coll]===e)),i||!r?e.drawCrosshair(t,i):e.hideCrosshair()})}setDOMEvents(){let t=this.chart.container,e=t.ownerDocument;t.onmousedown=this.onContainerMouseDown.bind(this),t.onmousemove=this.onContainerMouseMove.bind(this),t.onclick=this.onContainerClick.bind(this),this.eventsToUnbind.push(h(t,"mouseenter",this.onContainerMouseEnter.bind(this)),h(t,"mouseleave",this.onContainerMouseLeave.bind(this))),S.unbindDocumentMouseUp||(S.unbindDocumentMouseUp=[]),S.unbindDocumentMouseUp.push(h(e,"mouseup",this.onDocumentMouseUp.bind(this)));let i=this.chart.renderTo.parentElement;for(;i&&"BODY"!==i.tagName;)this.eventsToUnbind.push(h(i,"scroll",()=>{delete this.chartPosition})),i=i.parentElement;this.eventsToUnbind.push(h(t,"touchstart",this.onContainerTouchStart.bind(this),{passive:!1}),h(t,"touchmove",this.onContainerTouchMove.bind(this),{passive:!1})),S.unbindDocumentTouchEnd||(S.unbindDocumentTouchEnd=h(e,"touchend",this.onDocumentTouchEnd.bind(this),{passive:!1})),this.setPointerCapture(),h(this.chart,"redraw",this.setPointerCapture.bind(this))}setPointerCapture(){if(!a)return;let t=this.pointerCaptureEventsToUnbind,e=this.chart,i=e.container,s=y(e.options.tooltip?.followTouchMove,!0)&&e.series.some(t=>t.options.findNearestPointBy.indexOf("y")>-1);!this.hasPointerCapture&&s?(t.push(h(i,"pointerdown",t=>{t.target?.hasPointerCapture(t.pointerId)&&t.target?.releasePointerCapture(t.pointerId)}),h(i,"pointermove",t=>{e.pointer?.getPointFromEvent(t)?.onMouseOver(t)})),e.styledMode||d(i,{"touch-action":"none"}),i.className+=" highcharts-no-touch-action",this.hasPointerCapture=!0):this.hasPointerCapture&&!s&&(t.forEach(t=>t()),t.length=0,e.styledMode||d(i,{"touch-action":y(e.options.chart.style?.["touch-action"],"manipulation")}),i.className=i.className.replace(" highcharts-no-touch-action",""),this.hasPointerCapture=!1)}setHoverChartIndex(t){let i=this.chart,s=e.charts[y(S.hoverChartIndex,-1)];if(s&&s!==i){let e={relatedTarget:i.container};t&&!t?.relatedTarget&&(t={...e,...t}),s.pointer?.onContainerMouseLeave(t||e)}s&&s.mouseIsDown||(S.hoverChartIndex=i.index)}touch(t,e){let i;let{chart:s,pinchDown:r=[]}=this;this.setHoverChartIndex(),1===(t=this.normalize(t)).touches.length?s.isInsidePlot(t.chartX-s.plotLeft,t.chartY-s.plotTop,{visiblePlotOnly:!0})&&!s.openMenu?(e&&this.runPointActions(t),"touchmove"===t.type&&(i=!!r[0]&&Math.pow(r[0].chartX-t.chartX,2)+Math.pow(r[0].chartY-t.chartY,2)>=16),y(i,!0)&&this.pinch(t)):e&&this.reset():2===t.touches.length&&this.pinch(t)}touchSelect(t){return!!(this.chart.zooming.singleTouch&&t.touches&&1===t.touches.length)}zoomOption(t){let e=this.chart,i=e.inverted,s=e.zooming.type||"",r,o;/touch/.test(t.type)&&(s=y(e.zooming.pinchType,s)),this.zoomX=r=/x/.test(s),this.zoomY=o=/y/.test(s),this.zoomHor=r&&!i||o&&i,this.zoomVert=o&&!i||r&&i,this.hasZoom=r||o}}return(s=S||(S={})).compose=function(t){b(n,"Core.Pointer")&&h(t,"beforeRender",function(){this.pointer=new s(this,this.options)})},S}),i(e,"Core/Legend/LegendSymbol.js",[e["Core/Utilities.js"]],function(t){var e;let{extend:i,merge:s,pick:r}=t;return function(t){function e(t,e,o){let n=this.legendItem=this.legendItem||{},{chart:a,options:h}=this,{baseline:l=0,symbolWidth:d,symbolHeight:c}=t,p=this.symbol||"circle",u=c/2,g=a.renderer,f=n.group,m=l-Math.round((t.fontMetrics?.b||c)*(o?.4:.3)),x={},y,b=h.marker,v=0;if(a.styledMode||(x["stroke-width"]=Math.min(h.lineWidth||0,24),h.dashStyle?x.dashstyle=h.dashStyle:"square"===h.linecap||(x["stroke-linecap"]="round")),n.line=g.path().addClass("highcharts-graph").attr(x).add(f),o&&(n.area=g.path().addClass("highcharts-area").add(f)),x["stroke-linecap"]&&(v=Math.min(n.line.strokeWidth(),d)/2),d){let t=[["M",v,m],["L",d-v,m]];n.line.attr({d:t}),n.area?.attr({d:[...t,["L",d-v,l],["L",v,l]]})}if(b&&!1!==b.enabled&&d){let t=Math.min(r(b.radius,u),u);0===p.indexOf("url")&&(b=s(b,{width:c,height:c}),t=0),n.symbol=y=g.symbol(p,d/2-t,m-t,2*t,2*t,i({context:"legend"},b)).addClass("highcharts-point").add(f),y.isMarker=!0}}t.areaMarker=function(t,i){e.call(this,t,i,!0)},t.lineMarker=e,t.rectangle=function(t,e){let i=e.legendItem||{},s=t.options,o=t.symbolHeight,n=s.squareSymbol,a=n?o:t.symbolWidth;i.symbol=this.chart.renderer.rect(n?(t.symbolWidth-o)/2:0,t.baseline-o+1,a,o,r(t.options.symbolRadius,o/2)).addClass("highcharts-point").attr({zIndex:3}).add(i.group)}}(e||(e={})),e}),i(e,"Core/Series/SeriesDefaults.js",[],function(){return{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},enableMouseTracking:!0,events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:150},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",borderWidth:0,defer:!0,formatter:function(){let{numberFormatter:t}=this.series.chart;return"number"!=typeof this.y?"":t(this.y,-1)},padding:5,style:{fontSize:"0.7em",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:150},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:150},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"}}),i(e,"Core/Series/SeriesRegistry.js",[e["Core/Globals.js"],e["Core/Defaults.js"],e["Core/Series/Point.js"],e["Core/Utilities.js"]],function(t,e,i,s){var r;let{defaultOptions:o}=e,{extend:n,extendClass:a,merge:h}=s;return function(e){function s(t,s){let r=o.plotOptions||{},n=s.defaultOptions,a=s.prototype;return a.type=t,a.pointClass||(a.pointClass=i),!e.seriesTypes[t]&&(n&&(r[t]=n),e.seriesTypes[t]=s,!0)}e.seriesTypes=t.seriesTypes,e.registerSeriesType=s,e.seriesType=function(t,r,l,d,c){let p=o.plotOptions||{};if(r=r||"",p[t]=h(p[r],l),delete e.seriesTypes[t],s(t,a(e.seriesTypes[r]||function(){},d)),e.seriesTypes[t].prototype.type=t,c){class s extends i{}n(s.prototype,c),e.seriesTypes[t].prototype.pointClass=s}return e.seriesTypes[t]}}(r||(r={})),r}),i(e,"Core/Series/Series.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Defaults.js"],e["Core/Foundation.js"],e["Core/Globals.js"],e["Core/Legend/LegendSymbol.js"],e["Core/Series/Point.js"],e["Core/Series/SeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Renderer/SVG/SVGElement.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o,n,a,h,l){let{animObject:d,setAnimation:c}=t,{defaultOptions:p}=e,{registerEventOptions:u}=i,{svg:g,win:f}=s,{seriesTypes:m}=a,{arrayMax:x,arrayMin:y,clamp:b,correctFloat:v,crisp:S,defined:C,destroyObjectProperties:k,diffObjects:M,erase:w,error:T,extend:A,find:P,fireEvent:L,getClosestDistance:O,getNestedProperty:D,insertItem:E,isArray:I,isNumber:j,isString:B,merge:R,objectEach:z,pick:N,removeEvent:W,splat:G,syncTimeout:H}=l;class X{constructor(){this.zoneAxis="y"}init(t,e){let i;L(this,"init",{options:e});let s=this,r=t.series;this.eventsToUnbind=[],s.chart=t,s.options=s.setOptions(e);let o=s.options,n=!1!==o.visible;s.linkedSeries=[],s.bindAxes(),A(s,{name:o.name,state:"",visible:n,selected:!0===o.selected}),u(this,o);let a=o.events;(a&&a.click||o.point&&o.point.events&&o.point.events.click||o.allowPointSelect)&&(t.runTrackerClick=!0),s.getColor(),s.getSymbol(),s.parallelArrays.forEach(function(t){s[t+"Data"]||(s[t+"Data"]=[])}),s.isCartesian&&(t.hasCartesianSeries=!0),r.length&&(i=r[r.length-1]),s._i=N(i&&i._i,-1)+1,s.opacity=s.options.opacity,t.orderItems("series",E(this,r)),o.dataSorting&&o.dataSorting.enabled?s.setDataSortingOptions():s.points||s.data||s.setData(o.data,!1),L(this,"afterInit")}is(t){return m[t]&&this instanceof m[t]}bindAxes(){let t;let e=this,i=e.options,s=e.chart;L(this,"bindAxes",null,function(){(e.axisTypes||[]).forEach(function(r){(s[r]||[]).forEach(function(s){t=s.options,(N(i[r],0)===s.index||void 0!==i[r]&&i[r]===t.id)&&(E(e,s.series),e[r]=s,s.isDirty=!0)}),e[r]||e.optionalAxis===r||T(18,!0,s)})}),L(this,"afterBindAxes")}updateParallelArrays(t,e,i){let s=t.series,r=j(e)?function(i){let r="y"===i&&s.toYData?s.toYData(t):t[i];s[i+"Data"][e]=r}:function(t){Array.prototype[e].apply(s[t+"Data"],i)};s.parallelArrays.forEach(r)}hasData(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin||this.visible&&this.yData&&this.yData.length>0}hasMarkerChanged(t,e){let i=t.marker,s=e.marker||{};return i&&(s.enabled&&!i.enabled||s.symbol!==i.symbol||s.height!==i.height||s.width!==i.width)}autoIncrement(t){let e=this.options,i=e.pointIntervalUnit,s=e.relativeXValue,r=this.chart.time,o=this.xIncrement,n,a;return(o=N(o,e.pointStart,0),this.pointInterval=a=N(this.pointInterval,e.pointInterval,1),s&&j(t)&&(a*=t),i&&(n=new r.Date(o),"day"===i?r.set("Date",n,r.get("Date",n)+a):"month"===i?r.set("Month",n,r.get("Month",n)+a):"year"===i&&r.set("FullYear",n,r.get("FullYear",n)+a),a=n.getTime()-o),s&&j(t))?o+a:(this.xIncrement=o+a,o)}setDataSortingOptions(){let t=this.options;A(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1}),C(t.pointRange)||(t.pointRange=1)}setOptions(t){let e;let i=this.chart,s=i.options.plotOptions,r=i.userOptions||{},o=R(t),n=i.styledMode,a={plotOptions:s,userOptions:o};L(this,"setOptions",a);let h=a.plotOptions[this.type],l=r.plotOptions||{},d=l.series||{},c=p.plotOptions[this.type]||{},u=l[this.type]||{};this.userOptions=a.userOptions;let g=R(h,s.series,u,o);this.tooltipOptions=R(p.tooltip,p.plotOptions.series?.tooltip,c?.tooltip,i.userOptions.tooltip,l.series?.tooltip,u.tooltip,o.tooltip),this.stickyTracking=N(o.stickyTracking,u.stickyTracking,d.stickyTracking,!!this.tooltipOptions.shared&&!this.noSharedTooltip||g.stickyTracking),null===h.marker&&delete g.marker,this.zoneAxis=g.zoneAxis||"y";let f=this.zones=(g.zones||[]).map(t=>({...t}));return(g.negativeColor||g.negativeFillColor)&&!g.zones&&(e={value:g[this.zoneAxis+"Threshold"]||g.threshold||0,className:"highcharts-negative"},n||(e.color=g.negativeColor,e.fillColor=g.negativeFillColor),f.push(e)),f.length&&C(f[f.length-1].value)&&f.push(n?{}:{color:this.color,fillColor:this.fillColor}),L(this,"afterSetOptions",{options:g}),g}getName(){return N(this.options.name,"Series "+(this.index+1))}getCyclic(t,e,i){let s,r;let o=this.chart,n=`${t}Index`,a=`${t}Counter`,h=i?.length||o.options.chart.colorCount;!e&&(C(r=N("color"===t?this.options.colorIndex:void 0,this[n]))?s=r:(o.series.length||(o[a]=0),s=o[a]%h,o[a]+=1),i&&(e=i[s])),void 0!==s&&(this[n]=s),this[t]=e}getColor(){this.chart.styledMode?this.getCyclic("color"):this.options.colorByPoint?this.color="#cccccc":this.getCyclic("color",this.options.color||p.plotOptions[this.type].color,this.chart.options.colors)}getPointsCollection(){return(this.hasGroupedData?this.points:this.data)||[]}getSymbol(){let t=this.options.marker;this.getCyclic("symbol",t.symbol,this.chart.options.symbols)}findPointIndex(t,e){let i,s,r;let n=t.id,a=t.x,h=this.points,l=this.options.dataSorting;if(n){let t=this.chart.get(n);t instanceof o&&(i=t)}else if(this.linkedParent||this.enabledDataSorting||this.options.relativeXValue){let e=e=>!e.touched&&e.index===t.index;if(l&&l.matchByName?e=e=>!e.touched&&e.name===t.name:this.options.relativeXValue&&(e=e=>!e.touched&&e.options.x===t.x),!(i=P(h,e)))return}return i&&void 0!==(r=i&&i.index)&&(s=!0),void 0===r&&j(a)&&(r=this.xData.indexOf(a,e)),-1!==r&&void 0!==r&&this.cropped&&(r=r>=this.cropStart?r-this.cropStart:r),!s&&j(r)&&h[r]&&h[r].touched&&(r=void 0),r}updateData(t,e){let i=this.options,s=i.dataSorting,r=this.points,o=[],n=this.requireSorting,a=t.length===r.length,h,l,d,c,p=!0;if(this.xIncrement=null,t.forEach(function(t,e){let l;let d=C(t)&&this.pointClass.prototype.optionsToObject.call({series:this},t)||{},p=d.x;d.id||j(p)?(-1===(l=this.findPointIndex(d,c))||void 0===l?o.push(t):r[l]&&t!==i.data[l]?(r[l].update(t,!1,null,!1),r[l].touched=!0,n&&(c=l+1)):r[l]&&(r[l].touched=!0),(!a||e!==l||s&&s.enabled||this.hasDerivedData)&&(h=!0)):o.push(t)},this),h)for(l=r.length;l--;)(d=r[l])&&!d.touched&&d.remove&&d.remove(!1,e);else!a||s&&s.enabled?p=!1:(t.forEach(function(t,e){t===r[e].y||r[e].destroyed||r[e].update(t,!1,null,!1)}),o.length=0);return r.forEach(function(t){t&&(t.touched=!1)}),!!p&&(o.forEach(function(t){this.addPoint(t,!1,null,null,!1)},this),null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=x(this.xData),this.autoIncrement()),!0)}setData(t,e=!0,i,s){let r=this,o=r.points,n=o&&o.length||0,a=r.options,h=r.chart,l=a.dataSorting,d=r.xAxis,c=a.turboThreshold,p=this.xData,u=this.yData,g=r.pointArrayMap,f=g&&g.length,m=a.keys,x,y,b,v=0,S=1,C;h.options.chart.allowMutatingData||(a.data&&delete r.options.data,r.userOptions.data&&delete r.userOptions.data,C=R(!0,t));let k=(t=C||t||[]).length;if(l&&l.enabled&&(t=this.sortData(t)),h.options.chart.allowMutatingData&&!1!==s&&k&&n&&!r.cropped&&!r.hasGroupedData&&r.visible&&!r.boosted&&(b=this.updateData(t,i)),!b){r.xIncrement=null,r.colorCounter=0,this.parallelArrays.forEach(function(t){r[t+"Data"].length=0});let e=c&&k>c;if(e){let i=r.getFirstValidPoint(t),s=r.getFirstValidPoint(t,k-1,-1),o=t=>!!(I(t)&&(m||j(t[0])));if(j(i)&&j(s))for(x=0;x<k;x++)p[x]=this.autoIncrement(),u[x]=t[x];else if(o(i)&&o(s)){if(f){if(i.length===f)for(x=0;x<k;x++)p[x]=this.autoIncrement(),u[x]=t[x];else for(x=0;x<k;x++)y=t[x],p[x]=y[0],u[x]=y.slice(1,f+1)}else if(m&&(v=m.indexOf("x"),S=m.indexOf("y"),v=v>=0?v:0,S=S>=0?S:1),1===i.length&&(S=0),v===S)for(x=0;x<k;x++)p[x]=this.autoIncrement(),u[x]=t[x][S];else for(x=0;x<k;x++)y=t[x],p[x]=y[v],u[x]=y[S]}else e=!1}if(!e)for(x=0;x<k;x++)y={series:r},r.pointClass.prototype.applyOptions.apply(y,[t[x]]),r.updateParallelArrays(y,x);for(u&&B(u[0])&&T(14,!0,h),r.data=[],r.options.data=r.userOptions.data=t,x=n;x--;)o[x]?.destroy();d&&(d.minRange=d.userMinRange),r.isDirty=h.isDirtyBox=!0,r.isDirtyData=!!o,i=!1}"point"===a.legendType&&(this.processData(),this.generatePoints()),e&&h.redraw(i)}sortData(t){let e=this,i=e.options.dataSorting.sortKey||"y",s=function(t,e){return C(e)&&t.pointClass.prototype.optionsToObject.call({series:t},e)||{}};return t.forEach(function(i,r){t[r]=s(e,i),t[r].index=r},this),t.concat().sort((t,e)=>{let s=D(i,t),r=D(i,e);return r<s?-1:r>s?1:0}).forEach(function(t,e){t.x=e},this),e.linkedSeries&&e.linkedSeries.forEach(function(e){let i=e.options,r=i.data;i.dataSorting&&i.dataSorting.enabled||!r||(r.forEach(function(i,o){r[o]=s(e,i),t[o]&&(r[o].x=t[o].x,r[o].index=o)}),e.setData(r,!1))}),t}getProcessedData(t){let e=this,i=e.xAxis,s=e.options.cropThreshold,r=i?.logarithmic,o=e.isCartesian,n,a,h=0,l,d,c,p=e.xData,u=e.yData,g=!1,f=p.length;i&&(d=(l=i.getExtremes()).min,c=l.max,g=!!(i.categories&&!i.names.length)),o&&e.sorted&&!t&&(!s||f>s||e.forceCrop)&&(p[f-1]<d||p[0]>c?(p=[],u=[]):e.yData&&(p[0]<d||p[f-1]>c)&&(p=(n=this.cropData(e.xData,e.yData,d,c)).xData,u=n.yData,h=n.start,a=!0));let m=O([r?p.map(r.log2lin):p],()=>e.requireSorting&&!g&&T(15,!1,e.chart));return{xData:p,yData:u,cropped:a,cropStart:h,closestPointRange:m}}processData(t){let e=this.xAxis;if(this.isCartesian&&!this.isDirty&&!e.isDirty&&!this.yAxis.isDirty&&!t)return!1;let i=this.getProcessedData();this.cropped=i.cropped,this.cropStart=i.cropStart,this.processedXData=i.xData,this.processedYData=i.yData,this.closestPointRange=this.basePointRange=i.closestPointRange,L(this,"afterProcessData")}cropData(t,e,i,s){let r=t.length,o,n,a=0,h=r;for(o=0;o<r;o++)if(t[o]>=i){a=Math.max(0,o-1);break}for(n=o;n<r;n++)if(t[n]>s){h=n+1;break}return{xData:t.slice(a,h),yData:e.slice(a,h),start:a,end:h}}generatePoints(){let t=this.options,e=this.processedData||t.data,i=this.processedXData,s=this.processedYData,r=this.pointClass,o=i.length,n=this.cropStart||0,a=this.hasGroupedData,h=t.keys,l=[],d=t.dataGrouping&&t.dataGrouping.groupAll?n:0,c,p,u,g,f=this.data;if(!f&&!a){let t=[];t.length=e.length,f=this.data=t}for(h&&a&&(this.options.keys=!1),g=0;g<o;g++)p=n+g,a?((u=new r(this,[i[g]].concat(G(s[g])))).dataGroup=this.groupMap[d+g],u.dataGroup.options&&(u.options=u.dataGroup.options,A(u,u.dataGroup.options),delete u.dataLabels)):(u=f[p])||void 0===e[p]||(f[p]=u=new r(this,e[p],i[g])),u&&(u.index=a?d+g:p,l[g]=u);if(this.options.keys=h,f&&(o!==(c=f.length)||a))for(g=0;g<c;g++)g!==n||a||(g+=o),f[g]&&(f[g].destroyElements(),f[g].plotX=void 0);this.data=f,this.points=l,L(this,"afterGeneratePoints")}getXExtremes(t){return{min:y(t),max:x(t)}}getExtremes(t,e){let i=this.xAxis,s=this.yAxis,r=[],o=this.requireSorting&&!this.is("column")?1:0,n=!!s&&s.positiveValuesOnly,a=e||this.getExtremesFromAll||this.options.getExtremesFromAll,{processedXData:h,processedYData:l}=this,d,c,p,u,g,f,m,b=0,v=0,S=0;if(this.cropped&&a){let t=this.getProcessedData(!0);h=t.xData,l=t.yData}let C=(t=t||this.stackedYData||l||[]).length,k=h||this.xData;for(i&&(b=(d=i.getExtremes()).min,v=d.max),f=0;f<C;f++)if(u=k[f],c=(j(g=t[f])||I(g))&&((j(g)?g>0:g.length)||!n),p=e||this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||!i||(k[f+o]||u)>=b&&(k[f-o]||u)<=v,c&&p){if(m=g.length)for(;m--;)j(g[m])&&(r[S++]=g[m]);else r[S++]=g}let M={activeYData:r,dataMin:y(r),dataMax:x(r)};return L(this,"afterGetExtremes",{dataExtremes:M}),M}applyExtremes(){let t=this.getExtremes();return this.dataMin=t.dataMin,this.dataMax=t.dataMax,t}getFirstValidPoint(t,e=0,i=1){let s=t.length,r=e;for(;r>=0&&r<s;){if(C(t[r]))return t[r];r+=i}}translate(){this.processedXData||this.processData(),this.generatePoints();let t=this.options,e=t.stacking,i=this.xAxis,s=i.categories,r=this.enabledDataSorting,o=this.yAxis,n=this.points,a=n.length,h=this.pointPlacementToXValue(),l=!!h,d=t.threshold,c=t.startFromThreshold?d:0,p,u,g,f,m=Number.MAX_VALUE;function x(t){return b(t,-1e9,1e9)}for(p=0;p<a;p++){let t;let a=n[p],y=a.x,b,S,k=a.y,M=a.low,w=e&&o.stacking?.stacks[(this.negStacks&&k<(c?0:d)?"-":"")+this.stackKey];u=i.translate(y,!1,!1,!1,!0,h),a.plotX=j(u)?v(x(u)):void 0,e&&this.visible&&w&&w[y]&&(f=this.getStackIndicator(f,y,this.index),!a.isNull&&f.key&&(S=(b=w[y]).points[f.key]),b&&I(S)&&(M=S[0],k=S[1],M===c&&f.key===w[y].base&&(M=N(j(d)?d:o.min)),o.positiveValuesOnly&&C(M)&&M<=0&&(M=void 0),a.total=a.stackTotal=N(b.total),a.percentage=C(a.y)&&b.total?a.y/b.total*100:void 0,a.stackY=k,this.irregularWidths||b.setOffset(this.pointXOffset||0,this.barW||0,void 0,void 0,void 0,this.xAxis))),a.yBottom=C(M)?x(o.translate(M,!1,!0,!1,!0)):void 0,this.dataModify&&(k=this.dataModify.modifyValue(k,p)),j(k)&&void 0!==a.plotX&&(t=j(t=o.translate(k,!1,!0,!1,!0))?x(t):void 0),a.plotY=t,a.isInside=this.isPointInside(a),a.clientX=l?v(i.translate(y,!1,!1,!1,!0,h)):u,a.negative=(a.y||0)<(d||0),a.category=N(s&&s[a.x],a.x),a.isNull||!1===a.visible||(void 0!==g&&(m=Math.min(m,Math.abs(u-g))),g=u),a.zone=this.zones.length?a.getZone():void 0,!a.graphic&&this.group&&r&&(a.isNew=!0)}this.closestPointRangePx=m,L(this,"afterTranslate")}getValidPoints(t,e,i){let s=this.chart;return(t||this.points||[]).filter(function(t){let{plotX:r,plotY:o}=t;return!!((i||!t.isNull&&j(o))&&(!e||s.isInsidePlot(r,o,{inverted:s.inverted})))&&!1!==t.visible})}getClipBox(){let{chart:t,xAxis:e,yAxis:i}=this,{x:s,y:r,width:o,height:n}=R(t.clipBox);return e&&e.len!==t.plotSizeX&&(o=e.len),i&&i.len!==t.plotSizeY&&(n=i.len),t.inverted&&!this.invertible&&([o,n]=[n,o]),{x:s,y:r,width:o,height:n}}getSharedClipKey(){return this.sharedClipKey=(this.options.xAxis||0)+","+(this.options.yAxis||0),this.sharedClipKey}setClip(){let{chart:t,group:e,markerGroup:i}=this,s=t.sharedClips,r=t.renderer,o=this.getClipBox(),n=this.getSharedClipKey(),a=s[n];a?a.animate(o):s[n]=a=r.clipRect(o),e&&e.clip(!1===this.options.clip?void 0:a),i&&i.clip()}animate(t){let{chart:e,group:i,markerGroup:s}=this,r=e.inverted,o=d(this.options.animation),n=[this.getSharedClipKey(),o.duration,o.easing,o.defer].join(","),a=e.sharedClips[n],h=e.sharedClips[n+"m"];if(t&&i){let t=this.getClipBox();if(a)a.attr("height",t.height);else{t.width=0,r&&(t.x=e.plotHeight),a=e.renderer.clipRect(t),e.sharedClips[n]=a;let i={x:-99,y:-99,width:r?e.plotWidth+199:99,height:r?99:e.plotHeight+199};h=e.renderer.clipRect(i),e.sharedClips[n+"m"]=h}i.clip(a),s?.clip(h)}else if(a&&!a.hasClass("highcharts-animating")){let t=this.getClipBox(),i=o.step;(s?.element.childNodes.length||e.series.length>1)&&(o.step=function(t,e){i&&i.apply(e,arguments),"width"===e.prop&&h?.element&&h.attr(r?"height":"width",t+99)}),a.addClass("highcharts-animating").animate(t,o)}}afterAnimate(){this.setClip(),z(this.chart.sharedClips,(t,e,i)=>{t&&!this.chart.container.querySelector(`[clip-path="url(#${t.id})"]`)&&(t.destroy(),delete i[e])}),this.finishedAnimating=!0,L(this,"afterAnimate")}drawPoints(t=this.points){let e,i,s,r,o,n,a;let h=this.chart,l=h.styledMode,{colorAxis:d,options:c}=this,p=c.marker,u=this[this.specialGroup||"markerGroup"],g=this.xAxis,f=N(p.enabled,!g||!!g.isRadial||null,this.closestPointRangePx>=p.enabledThreshold*p.radius);if(!1!==p.enabled||this._hasPointMarkers)for(e=0;e<t.length;e++)if(r=(s=(i=t[e]).graphic)?"animate":"attr",o=i.marker||{},n=!!i.marker,(f&&void 0===o.enabled||o.enabled)&&!i.isNull&&!1!==i.visible){let t=N(o.symbol,this.symbol,"rect");a=this.markerAttribs(i,i.selected&&"select"),this.enabledDataSorting&&(i.startXPos=g.reversed?-(a.width||0):g.width);let e=!1!==i.isInside;if(!s&&e&&((a.width||0)>0||i.hasImage)&&(i.graphic=s=h.renderer.symbol(t,a.x,a.y,a.width,a.height,n?o:p).add(u),this.enabledDataSorting&&h.hasRendered&&(s.attr({x:i.startXPos}),r="animate")),s&&"animate"===r&&s[e?"show":"hide"](e).animate(a),s){let t=this.pointAttribs(i,l||!i.selected?void 0:"select");l?d&&s.css({fill:t.fill}):s[r](t)}s&&s.addClass(i.getClassName(),!0)}else s&&(i.graphic=s.destroy())}markerAttribs(t,e){let i=this.options,s=i.marker,r=t.marker||{},o=r.symbol||s.symbol,n={},a,h,l=N(r.radius,s&&s.radius);e&&(a=s.states[e],l=N((h=r.states&&r.states[e])&&h.radius,a&&a.radius,l&&l+(a&&a.radiusPlus||0))),t.hasImage=o&&0===o.indexOf("url"),t.hasImage&&(l=0);let d=t.pos();return j(l)&&d&&(i.crisp&&(d[0]=S(d[0],t.hasImage?0:"rect"===o?s?.lineWidth||0:1)),n.x=d[0]-l,n.y=d[1]-l),l&&(n.width=n.height=2*l),n}pointAttribs(t,e){let i=this.options.marker,s=t&&t.options,r=s&&s.marker||{},o=s&&s.color,n=t&&t.color,a=t&&t.zone&&t.zone.color,h,l,d=this.color,c,p,u=N(r.lineWidth,i.lineWidth),g=1;return d=o||a||n||d,c=r.fillColor||i.fillColor||d,p=r.lineColor||i.lineColor||d,e=e||"normal",h=i.states[e]||{},u=N((l=r.states&&r.states[e]||{}).lineWidth,h.lineWidth,u+N(l.lineWidthPlus,h.lineWidthPlus,0)),c=l.fillColor||h.fillColor||c,{stroke:p=l.lineColor||h.lineColor||p,"stroke-width":u,fill:c,opacity:g=N(l.opacity,h.opacity,g)}}destroy(t){let e,i,s;let r=this,o=r.chart,n=/AppleWebKit\/533/.test(f.navigator.userAgent),a=r.data||[];for(L(r,"destroy",{keepEventsForUpdate:t}),this.removeEvents(t),(r.axisTypes||[]).forEach(function(t){(s=r[t])&&s.series&&(w(s.series,r),s.isDirty=s.forceRedraw=!0)}),r.legendItem&&r.chart.legend.destroyItem(r),e=a.length;e--;)(i=a[e])&&i.destroy&&i.destroy();for(let t of r.zones)k(t,void 0,!0);l.clearTimeout(r.animationTimeout),z(r,function(t,e){t instanceof h&&!t.survive&&t[n&&"group"===e?"hide":"destroy"]()}),o.hoverSeries===r&&(o.hoverSeries=void 0),w(o.series,r),o.orderItems("series"),z(r,function(e,i){t&&"hcEvents"===i||delete r[i]})}applyZones(){let{area:t,chart:e,graph:i,zones:s,points:r,xAxis:o,yAxis:n,zoneAxis:a}=this,{inverted:h,renderer:l}=e,d=this[`${a}Axis`],{isXAxis:c,len:p=0}=d||{},u=(i?.strokeWidth()||0)/2+1,g=(t,e=0,i=0)=>{h&&(i=p-i);let{translated:s=0,lineClip:r}=t,o=i-s;r?.push(["L",e,Math.abs(o)<u?i-u*(o<=0?-1:1):s])};if(s.length&&(i||t)&&d&&j(d.min)){let e=d.getExtremes().max,u=t=>{t.forEach((e,i)=>{("M"===e[0]||"L"===e[0])&&(t[i]=[e[0],c?p-e[1]:e[1],c?e[2]:p-e[2]])})};if(s.forEach(t=>{t.lineClip=[],t.translated=b(d.toPixels(N(t.value,e),!0)||0,0,p)}),i&&!this.showLine&&i.hide(),t&&t.hide(),"y"===a&&r.length<o.len)for(let t of r){let{plotX:e,plotY:i,zone:r}=t,o=r&&s[s.indexOf(r)-1];r&&g(r,e,i),o&&g(o,e,i)}let f=[],m=d.toPixels(d.getExtremes().min,!0);s.forEach(e=>{let s=e.lineClip||[],r=Math.round(e.translated||0);o.reversed&&s.reverse();let{clip:a,simpleClip:d}=e,p=0,g=0,x=o.len,y=n.len;c?(p=r,x=m):(g=r,y=m);let b=[["M",p,g],["L",x,g],["L",x,y],["L",p,y],["Z"]],v=[b[0],...s,b[1],b[2],...f,b[3],b[4]];f=s.reverse(),m=r,h&&(u(v),t&&u(b)),a?(a.animate({d:v}),d?.animate({d:b})):(a=e.clip=l.path(v),t&&(d=e.simpleClip=l.path(b))),i&&e.graph?.clip(a),t&&e.area?.clip(d)})}else this.visible&&(i&&i.show(),t&&t.show())}plotGroup(t,e,i,s,r){let o=this[t],n=!o,a={visibility:i,zIndex:s||.1};return C(this.opacity)&&!this.chart.styledMode&&"inactive"!==this.state&&(a.opacity=this.opacity),o||(this[t]=o=this.chart.renderer.g().add(r)),o.addClass("highcharts-"+e+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(C(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(o.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),o.attr(a)[n?"attr":"animate"](this.getPlotBox(e)),o}getPlotBox(t){let e=this.xAxis,i=this.yAxis,s=this.chart,r=s.inverted&&!s.polar&&e&&this.invertible&&"series"===t;return s.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:s.plotLeft,translateY:i?i.top:s.plotTop,rotation:r?90:0,rotationOriginX:r?(e.len-i.len)/2:0,rotationOriginY:r?(e.len+i.len)/2:0,scaleX:r?-1:1,scaleY:1}}removeEvents(t){let{eventsToUnbind:e}=this;t||W(this),e.length&&(e.forEach(t=>{t()}),e.length=0)}render(){let t=this,{chart:e,options:i,hasRendered:s}=t,r=d(i.animation),o=t.visible?"inherit":"hidden",n=i.zIndex,a=e.seriesGroup,h=t.finishedAnimating?0:r.duration;L(this,"render"),t.plotGroup("group","series",o,n,a),t.markerGroup=t.plotGroup("markerGroup","markers",o,n,a),!1!==i.clip&&t.setClip(),h&&t.animate?.(!0),t.drawGraph&&(t.drawGraph(),t.applyZones()),t.visible&&t.drawPoints(),t.drawDataLabels?.(),t.redrawPoints?.(),i.enableMouseTracking&&t.drawTracker?.(),h&&t.animate?.(),s||(h&&r.defer&&(h+=r.defer),t.animationTimeout=H(()=>{t.afterAnimate()},h||0)),t.isDirty=!1,t.hasRendered=!0,L(t,"afterRender")}redraw(){let t=this.isDirty||this.isDirtyData;this.translate(),this.render(),t&&delete this.kdTree}reserveSpace(){return this.visible||!this.chart.options.chart.ignoreHiddenSeries}searchPoint(t,e){let{xAxis:i,yAxis:s}=this,r=this.chart.inverted;return this.searchKDTree({clientX:r?i.len-t.chartY+i.pos:t.chartX-i.pos,plotY:r?s.len-t.chartX+s.pos:t.chartY-s.pos},e,t)}buildKDTree(t){this.buildingKdTree=!0;let e=this,i=e.options.findNearestPointBy.indexOf("y")>-1?2:1;delete e.kdTree,H(function(){e.kdTree=function t(i,s,r){let o,n;let a=i?.length;if(a)return o=e.kdAxisArray[s%r],i.sort((t,e)=>(t[o]||0)-(e[o]||0)),{point:i[n=Math.floor(a/2)],left:t(i.slice(0,n),s+1,r),right:t(i.slice(n+1),s+1,r)}}(e.getValidPoints(void 0,!e.directTouch),i,i),e.buildingKdTree=!1},e.options.kdNow||t?.type==="touchstart"?0:1)}searchKDTree(t,e,i){let s=this,[r,o]=this.kdAxisArray,n=e?"distX":"dist",a=(s.options.findNearestPointBy||"").indexOf("y")>-1?2:1,h=!!s.isBubble;if(this.kdTree||this.buildingKdTree||this.buildKDTree(i),this.kdTree)return function t(e,i,a,l){let d=i.point,c=s.kdAxisArray[a%l],p,u,g=d;!function(t,e){let i=t[r],s=e[r],n=C(i)&&C(s)?i-s:null,a=t[o],l=e[o],d=C(a)&&C(l)?a-l:0,c=h&&e.marker?.radius||0;e.dist=Math.sqrt((n&&n*n||0)+d*d)-c,e.distX=C(n)?Math.abs(n)-c:Number.MAX_VALUE}(e,d);let f=(e[c]||0)-(d[c]||0)+(h&&d.marker?.radius||0),m=f<0?"left":"right",x=f<0?"right":"left";return i[m]&&(g=(p=t(e,i[m],a+1,l))[n]<g[n]?p:d),i[x]&&Math.sqrt(f*f)<g[n]&&(g=(u=t(e,i[x],a+1,l))[n]<g[n]?u:g),g}(t,this.kdTree,a,a)}pointPlacementToXValue(){let{options:t,xAxis:e}=this,i=t.pointPlacement;return"between"===i&&(i=e.reversed?-.5:.5),j(i)?i*(t.pointRange||e.pointRange):0}isPointInside(t){let{chart:e,xAxis:i,yAxis:s}=this,{plotX:r=-1,plotY:o=-1}=t;return o>=0&&o<=(s?s.len:e.plotHeight)&&r>=0&&r<=(i?i.len:e.plotWidth)}drawTracker(){let t=this,e=t.options,i=e.trackByArea,s=[].concat((i?t.areaPath:t.graphPath)||[]),r=t.chart,o=r.pointer,n=r.renderer,a=r.options.tooltip?.snap||0,h=()=>{e.enableMouseTracking&&r.hoverSeries!==t&&t.onMouseOver()},l="rgba(192,192,192,"+(g?1e-4:.002)+")",d=t.tracker;d?d.attr({d:s}):t.graph&&(t.tracker=d=n.path(s).attr({visibility:t.visible?"inherit":"hidden",zIndex:2}).addClass(i?"highcharts-tracker-area":"highcharts-tracker-line").add(t.group),r.styledMode||d.attr({"stroke-linecap":"round","stroke-linejoin":"round",stroke:l,fill:i?l:"none","stroke-width":t.graph.strokeWidth()+(i?0:2*a)}),[t.tracker,t.markerGroup,t.dataLabelsGroup].forEach(t=>{t&&(t.addClass("highcharts-tracker").on("mouseover",h).on("mouseout",t=>{o?.onTrackerMouseOut(t)}),e.cursor&&!r.styledMode&&t.css({cursor:e.cursor}),t.on("touchstart",h))})),L(this,"afterDrawTracker")}addPoint(t,e,i,s,r){let o,n;let a=this.options,h=this.data,l=this.chart,d=this.xAxis,c=d&&d.hasNames&&d.names,p=a.data,u=this.xData;e=N(e,!0);let g={series:this};this.pointClass.prototype.applyOptions.apply(g,[t]);let f=g.x;if(n=u.length,this.requireSorting&&f<u[n-1])for(o=!0;n&&u[n-1]>f;)n--;this.updateParallelArrays(g,"splice",[n,0,0]),this.updateParallelArrays(g,n),c&&g.name&&(c[f]=g.name),p.splice(n,0,t),(o||this.processedData)&&(this.data.splice(n,0,null),this.processData()),"point"===a.legendType&&this.generatePoints(),i&&(h[0]&&h[0].remove?h[0].remove(!1):(h.shift(),this.updateParallelArrays(g,"shift"),p.shift())),!1!==r&&L(this,"addPoint",{point:g}),this.isDirty=!0,this.isDirtyData=!0,e&&l.redraw(s)}removePoint(t,e,i){let s=this,r=s.data,o=r[t],n=s.points,a=s.chart,h=function(){n&&n.length===r.length&&n.splice(t,1),r.splice(t,1),s.options.data.splice(t,1),s.updateParallelArrays(o||{series:s},"splice",[t,1]),o&&o.destroy(),s.isDirty=!0,s.isDirtyData=!0,e&&a.redraw()};c(i,a),e=N(e,!0),o?o.firePointEvent("remove",null,h):h()}remove(t,e,i,s){let r=this,o=r.chart;function n(){r.destroy(s),o.isDirtyLegend=o.isDirtyBox=!0,o.linkSeries(s),N(t,!0)&&o.redraw(e)}!1!==i?L(r,"remove",null,n):n()}update(t,e){L(this,"update",{options:t=M(t,this.userOptions)});let i=this,s=i.chart,r=i.userOptions,o=i.initialType||i.type,n=s.options.plotOptions,a=m[o].prototype,h=i.finishedAnimating&&{animation:!1},l={},d,c,p=["colorIndex","eventOptions","navigatorSeries","symbolIndex","baseSeries"],u=t.type||r.type||s.options.chart.type,g=!(this.hasDerivedData||u&&u!==this.type||void 0!==t.pointStart||void 0!==t.pointInterval||void 0!==t.relativeXValue||t.joinBy||t.mapData||["dataGrouping","pointStart","pointInterval","pointIntervalUnit","keys"].some(t=>i.hasOptionChanged(t)));u=u||o,g&&(p.push("data","isDirtyData","isDirtyCanvas","points","processedData","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","hasDataLabels","nodes","layout","level","mapMap","mapData","minY","maxY","minX","maxX","transformGroups"),!1!==t.visible&&p.push("area","graph"),i.parallelArrays.forEach(function(t){p.push(t+"Data")}),t.data&&(t.dataSorting&&A(i.options.dataSorting,t.dataSorting),this.setData(t.data,!1))),t=R(r,{index:void 0===r.index?i.index:r.index,pointStart:n?.series?.pointStart??r.pointStart??i.xData?.[0]},!g&&{data:i.options.data},t,h),g&&t.data&&(t.data=i.options.data),(p=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(p)).forEach(function(t){p[t]=i[t],delete i[t]});let f=!1;if(m[u]){if(f=u!==i.type,i.remove(!1,!1,!1,!0),f){if(s.propFromSeries(),Object.setPrototypeOf)Object.setPrototypeOf(i,m[u].prototype);else{let t=Object.hasOwnProperty.call(i,"hcEvents")&&i.hcEvents;for(c in a)i[c]=void 0;A(i,m[u].prototype),t?i.hcEvents=t:delete i.hcEvents}}}else T(17,!0,s,{missingModuleFor:u});if(p.forEach(function(t){i[t]=p[t]}),i.init(s,t),g&&this.points)for(let t of(!1===(d=i.options).visible?(l.graphic=1,l.dataLabel=1):(this.hasMarkerChanged(d,r)&&(l.graphic=1),i.hasDataLabels?.()||(l.dataLabel=1)),this.points))t&&t.series&&(t.resolveColor(),Object.keys(l).length&&t.destroyElements(l),!1===d.showInLegend&&t.legendItem&&s.legend.destroyItem(t));i.initialType=o,s.linkSeries(),s.setSortedData(),f&&i.linkedSeries.length&&(i.isDirtyData=!0),L(this,"afterUpdate"),N(e,!0)&&s.redraw(!!g&&void 0)}setName(t){this.name=this.options.name=this.userOptions.name=t,this.chart.isDirtyLegend=!0}hasOptionChanged(t){let e=this.chart,i=this.options[t],s=e.options.plotOptions,r=this.userOptions[t],o=N(s?.[this.type]?.[t],s?.series?.[t]);return r&&!C(o)?i!==r:i!==N(o,i)}onMouseOver(){let t=this.chart,e=t.hoverSeries,i=t.pointer;i?.setHoverChartIndex(),e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&L(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this}onMouseOut(){let t=this.options,e=this.chart,i=e.tooltip,s=e.hoverPoint;e.hoverSeries=null,s&&s.onMouseOut(),this&&t.events.mouseOut&&L(this,"mouseOut"),i&&!this.stickyTracking&&(!i.shared||this.noSharedTooltip)&&i.hide(),e.series.forEach(function(t){t.setState("",!0)})}setState(t,e){let i=this,s=i.options,r=i.graph,o=s.inactiveOtherPoints,n=s.states,a=N(n[t||"normal"]&&n[t||"normal"].animation,i.chart.options.chart.animation),h=s.lineWidth,l=s.opacity;if(t=t||"",i.state!==t&&([i.group,i.markerGroup,i.dataLabelsGroup].forEach(function(e){e&&(i.state&&e.removeClass("highcharts-series-"+i.state),t&&e.addClass("highcharts-series-"+t))}),i.state=t,!i.chart.styledMode)){if(n[t]&&!1===n[t].enabled)return;if(t&&(h=n[t].lineWidth||h+(n[t].lineWidthPlus||0),l=N(n[t].opacity,l)),r&&!r.dashstyle&&j(h))for(let t of[r,...this.zones.map(t=>t.graph)])t?.animate({"stroke-width":h},a);o||[i.group,i.markerGroup,i.dataLabelsGroup,i.labelBySeries].forEach(function(t){t&&t.animate({opacity:l},a)})}e&&o&&i.points&&i.setAllPointsToState(t||void 0)}setAllPointsToState(t){this.points.forEach(function(e){e.setState&&e.setState(t)})}setVisible(t,e){let i=this,s=i.chart,r=s.options.chart.ignoreHiddenSeries,o=i.visible;i.visible=t=i.options.visible=i.userOptions.visible=void 0===t?!o:t;let n=t?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(t=>{i[t]?.[n]()}),(s.hoverSeries===i||s.hoverPoint?.series===i)&&i.onMouseOut(),i.legendItem&&s.legend.colorizeItem(i,t),i.isDirty=!0,i.options.stacking&&s.series.forEach(t=>{t.options.stacking&&t.visible&&(t.isDirty=!0)}),i.linkedSeries.forEach(e=>{e.setVisible(t,!1)}),r&&(s.isDirtyBox=!0),L(i,n),!1!==e&&s.redraw()}show(){this.setVisible(!0)}hide(){this.setVisible(!1)}select(t){this.selected=t=this.options.selected=void 0===t?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),L(this,t?"select":"unselect")}shouldShowTooltip(t,e,i={}){return i.series=this,i.visiblePlotOnly=!0,this.chart.isInsidePlot(t,e,i)}drawLegendSymbol(t,e){r[this.options.legendSymbol||"rectangle"]?.call(this,t,e)}}return X.defaultOptions=n,X.types=a.seriesTypes,X.registerType=a.registerSeriesType,A(X.prototype,{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,directTouch:!1,invertible:!0,isCartesian:!0,kdAxisArray:["clientX","plotY"],parallelArrays:["x","y"],pointClass:o,requireSorting:!0,sorted:!0}),a.series=X,X}),i(e,"Core/Legend/Legend.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Foundation.js"],e["Core/Globals.js"],e["Core/Series/Series.js"],e["Core/Series/Point.js"],e["Core/Renderer/RendererUtilities.js"],e["Core/Templating.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o,n,a){var h;let{animObject:l,setAnimation:d}=t,{registerEventOptions:c}=e,{composed:p,marginNames:u}=i,{distribute:g}=o,{format:f}=n,{addEvent:m,createElement:x,css:y,defined:b,discardElement:v,find:S,fireEvent:C,isNumber:k,merge:M,pick:w,pushUnique:T,relativeLength:A,stableSort:P,syncTimeout:L}=a;class O{constructor(t,e){this.allItems=[],this.initialItemY=0,this.itemHeight=0,this.itemMarginBottom=0,this.itemMarginTop=0,this.itemX=0,this.itemY=0,this.lastItemY=0,this.lastLineHeight=0,this.legendHeight=0,this.legendWidth=0,this.maxItemWidth=0,this.maxLegendWidth=0,this.offsetWidth=0,this.padding=0,this.pages=[],this.symbolHeight=0,this.symbolWidth=0,this.titleHeight=0,this.totalItemWidth=0,this.widthOption=0,this.chart=t,this.setOptions(e),e.enabled&&(this.render(),c(this,e),m(this.chart,"endResize",function(){this.legend.positionCheckboxes()})),m(this.chart,"render",()=>{this.options.enabled&&this.proximate&&(this.proximatePositions(),this.positionItems())})}setOptions(t){let e=w(t.padding,8);this.options=t,this.chart.styledMode||(this.itemStyle=t.itemStyle,this.itemHiddenStyle=M(this.itemStyle,t.itemHiddenStyle)),this.itemMarginTop=t.itemMarginTop,this.itemMarginBottom=t.itemMarginBottom,this.padding=e,this.initialItemY=e-5,this.symbolWidth=w(t.symbolWidth,16),this.pages=[],this.proximate="proximate"===t.layout&&!this.chart.inverted,this.baseline=void 0}update(t,e){let i=this.chart;this.setOptions(M(!0,this.options,t)),"events"in this.options&&c(this,this.options),this.destroy(),i.isDirtyLegend=i.isDirtyBox=!0,w(e,!0)&&i.redraw(),C(this,"afterUpdate",{redraw:e})}colorizeItem(t,e){let{area:i,group:s,label:r,line:o,symbol:n}=t.legendItem||{};if(s?.[e?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){let{itemHiddenStyle:s={}}=this,a=s.color,{fillColor:h,fillOpacity:l,lineColor:d,marker:c}=t.options,p=t=>(!e&&(t.fill&&(t.fill=a),t.stroke&&(t.stroke=a)),t);r?.css(M(e?this.itemStyle:s)),o?.attr(p({stroke:d||t.color})),n&&n.attr(p(c&&n.isMarker?t.pointAttribs():{fill:t.color})),i?.attr(p({fill:h||t.color,"fill-opacity":h?1:l??.75}))}C(this,"afterColorizeItem",{item:t,visible:e})}positionItems(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()}positionItem(t){let{group:e,x:i=0,y:s=0}=t.legendItem||{},r=this.options,o=r.symbolPadding,n=!r.rtl,a=t.checkbox;if(e&&e.element){let r={translateX:n?i:this.legendWidth-i-2*o-4,translateY:s};e[b(e.translateY)?"animate":"attr"](r,void 0,()=>{C(this,"afterPositionItem",{item:t})})}a&&(a.x=i,a.y=s)}destroyItem(t){let e=t.checkbox,i=t.legendItem||{};for(let t of["group","label","line","symbol"])i[t]&&(i[t]=i[t].destroy());e&&v(e),t.legendItem=void 0}destroy(){for(let t of this.getAllItems())this.destroyItem(t);for(let t of["clipRect","up","down","pager","nav","box","title","group"])this[t]&&(this[t]=this[t].destroy());this.display=null}positionCheckboxes(){let t;let e=this.group&&this.group.alignAttr,i=this.clipHeight||this.legendHeight,s=this.titleHeight;e&&(t=e.translateY,this.allItems.forEach(function(r){let o;let n=r.checkbox;n&&(o=t+s+n.y+(this.scrollOffset||0)+3,y(n,{left:e.translateX+r.checkboxOffset+n.x-20+"px",top:o+"px",display:this.proximate||o>t-6&&o<t+i-6?"":"none"}))},this))}renderTitle(){let t=this.options,e=this.padding,i=t.title,s,r=0;i.text&&(this.title||(this.title=this.chart.renderer.label(i.text,e-3,e-4,void 0,void 0,void 0,t.useHTML,void 0,"legend-title").attr({zIndex:1}),this.chart.styledMode||this.title.css(i.style),this.title.add(this.group)),i.width||this.title.css({width:this.maxLegendWidth+"px"}),r=(s=this.title.getBBox()).height,this.offsetWidth=s.width,this.contentGroup.attr({translateY:r})),this.titleHeight=r}setText(t){let e=this.options;t.legendItem.label.attr({text:e.labelFormat?f(e.labelFormat,t,this.chart):e.labelFormatter.call(t)})}renderItem(t){let e=t.legendItem=t.legendItem||{},i=this.chart,s=i.renderer,r=this.options,o="horizontal"===r.layout,n=this.symbolWidth,a=r.symbolPadding||0,h=this.itemStyle,l=this.itemHiddenStyle,d=o?w(r.itemDistance,20):0,c=!r.rtl,p=!t.series,u=!p&&t.series.drawLegendSymbol?t.series:t,g=u.options,f=!!this.createCheckboxForItem&&g&&g.showCheckbox,m=r.useHTML,x=t.options.className,y=e.label,b=n+a+d+(f?20:0);!y&&(e.group=s.g("legend-item").addClass("highcharts-"+u.type+"-series highcharts-color-"+t.colorIndex+(x?" "+x:"")+(p?" highcharts-series-"+t.index:"")).attr({zIndex:1}).add(this.scrollGroup),e.label=y=s.text("",c?n+a:-a,this.baseline||0,m),i.styledMode||y.css(M(t.visible?h:l)),y.attr({align:c?"left":"right",zIndex:2}).add(e.group),!this.baseline&&(this.fontMetrics=s.fontMetrics(y),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,y.attr("y",this.baseline),this.symbolHeight=w(r.symbolHeight,this.fontMetrics.f),r.squareSymbol&&(this.symbolWidth=w(r.symbolWidth,Math.max(this.symbolHeight,16)),b=this.symbolWidth+a+d+(f?20:0),c&&y.attr("x",this.symbolWidth+a))),u.drawLegendSymbol(this,t),this.setItemEvents&&this.setItemEvents(t,y,m)),f&&!t.checkbox&&this.createCheckboxForItem&&this.createCheckboxForItem(t),this.colorizeItem(t,t.visible),(i.styledMode||!h.width)&&y.css({width:(r.itemWidth||this.widthOption||i.spacingBox.width)-b+"px"}),this.setText(t);let v=y.getBBox(),S=this.fontMetrics&&this.fontMetrics.h||0;t.itemWidth=t.checkboxOffset=r.itemWidth||e.labelWidth||v.width+b,this.maxItemWidth=Math.max(this.maxItemWidth,t.itemWidth),this.totalItemWidth+=t.itemWidth,this.itemHeight=t.itemHeight=Math.round(e.labelHeight||(v.height>1.5*S?v.height:S))}layoutItem(t){let e=this.options,i=this.padding,s="horizontal"===e.layout,r=t.itemHeight,o=this.itemMarginBottom,n=this.itemMarginTop,a=s?w(e.itemDistance,20):0,h=this.maxLegendWidth,l=e.alignColumns&&this.totalItemWidth>h?this.maxItemWidth:t.itemWidth,d=t.legendItem||{};s&&this.itemX-i+l>h&&(this.itemX=i,this.lastLineHeight&&(this.itemY+=n+this.lastLineHeight+o),this.lastLineHeight=0),this.lastItemY=n+this.itemY+o,this.lastLineHeight=Math.max(r,this.lastLineHeight),d.x=this.itemX,d.y=this.itemY,s?this.itemX+=l:(this.itemY+=n+r+o,this.lastLineHeight=r),this.offsetWidth=this.widthOption||Math.max((s?this.itemX-i-(t.checkbox?0:a):l)+i,this.offsetWidth)}getAllItems(){let t=[];return this.chart.series.forEach(function(e){let i=e&&e.options;e&&w(i.showInLegend,!b(i.linkedTo)&&void 0,!0)&&(t=t.concat((e.legendItem||{}).labels||("point"===i.legendType?e.data:e)))}),C(this,"afterGetAllItems",{allItems:t}),t}getAlignment(){let t=this.options;return this.proximate?t.align.charAt(0)+"tv":t.floating?"":t.align.charAt(0)+t.verticalAlign.charAt(0)+t.layout.charAt(0)}adjustMargins(t,e){let i=this.chart,s=this.options,r=this.getAlignment();r&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(o,n){o.test(r)&&!b(t[n])&&(i[u[n]]=Math.max(i[u[n]],i.legend[(n+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][n]*s[n%2?"x":"y"]+w(s.margin,12)+e[n]+(i.titleOffset[n]||0)))})}proximatePositions(){let t;let e=this.chart,i=[],s="left"===this.options.align;for(let r of(this.allItems.forEach(function(t){let r,o,n=s,a,h;t.yAxis&&(t.xAxis.options.reversed&&(n=!n),t.points&&(r=S(n?t.points:t.points.slice(0).reverse(),function(t){return k(t.plotY)})),o=this.itemMarginTop+t.legendItem.label.getBBox().height+this.itemMarginBottom,h=t.yAxis.top-e.plotTop,a=t.visible?(r?r.plotY:t.yAxis.height)+(h-.3*o):h+t.yAxis.height,i.push({target:a,size:o,item:t}))},this),g(i,e.plotHeight)))t=r.item.legendItem||{},k(r.pos)&&(t.y=e.plotTop-e.spacing[0]+r.pos)}render(){let t=this.chart,e=t.renderer,i=this.options,s=this.padding,r=this.getAllItems(),o,n,a,h=this.group,l,d=this.box;this.itemX=s,this.itemY=this.initialItemY,this.offsetWidth=0,this.lastItemY=0,this.widthOption=A(i.width,t.spacingBox.width-s),l=t.spacingBox.width-2*s-i.x,["rm","lm"].indexOf(this.getAlignment().substring(0,2))>-1&&(l/=2),this.maxLegendWidth=this.widthOption||l,h||(this.group=h=e.g("legend").addClass(i.className||"").attr({zIndex:7}).add(),this.contentGroup=e.g().attr({zIndex:1}).add(h),this.scrollGroup=e.g().add(this.contentGroup)),this.renderTitle(),P(r,(t,e)=>(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0)),i.reversed&&r.reverse(),this.allItems=r,this.display=o=!!r.length,this.lastLineHeight=0,this.maxItemWidth=0,this.totalItemWidth=0,this.itemHeight=0,r.forEach(this.renderItem,this),r.forEach(this.layoutItem,this),n=(this.widthOption||this.offsetWidth)+s,a=this.lastItemY+this.lastLineHeight+this.titleHeight,a=this.handleOverflow(a)+s,d||(this.box=d=e.rect().addClass("highcharts-legend-box").attr({r:i.borderRadius}).add(h)),t.styledMode||d.attr({stroke:i.borderColor,"stroke-width":i.borderWidth||0,fill:i.backgroundColor||"none"}).shadow(i.shadow),n>0&&a>0&&d[d.placed?"animate":"attr"](d.crisp.call({},{x:0,y:0,width:n,height:a},d.strokeWidth())),h[o?"show":"hide"](),t.styledMode&&"none"===h.getStyle("display")&&(n=a=0),this.legendWidth=n,this.legendHeight=a,o&&this.align(),this.proximate||this.positionItems(),C(this,"afterRender")}align(t=this.chart.spacingBox){let e=this.chart,i=this.options,s=t.y;/(lth|ct|rth)/.test(this.getAlignment())&&e.titleOffset[0]>0?s+=e.titleOffset[0]:/(lbh|cb|rbh)/.test(this.getAlignment())&&e.titleOffset[2]>0&&(s-=e.titleOffset[2]),s!==t.y&&(t=M(t,{y:s})),e.hasRendered||(this.group.placed=!1),this.group.align(M(i,{width:this.legendWidth,height:this.legendHeight,verticalAlign:this.proximate?"top":i.verticalAlign}),!0,t)}handleOverflow(t){let e=this,i=this.chart,s=i.renderer,r=this.options,o=r.y,n="top"===r.verticalAlign,a=this.padding,h=r.maxHeight,l=r.navigation,d=w(l.animation,!0),c=l.arrowSize||12,p=this.pages,u=this.allItems,g=function(t){"number"==typeof t?S.attr({height:t}):S&&(e.clipRect=S.destroy(),e.contentGroup.clip()),e.contentGroup.div&&(e.contentGroup.div.style.clip=t?"rect("+a+"px,9999px,"+(a+t)+"px,0)":"auto")},f=function(t){return e[t]=s.circle(0,0,1.3*c).translate(c/2,c/2).add(v),i.styledMode||e[t].attr("fill","rgba(0,0,0,0.0001)"),e[t]},m,x,y,b=i.spacingBox.height+(n?-o:o)-a,v=this.nav,S=this.clipRect;return"horizontal"!==r.layout||"middle"===r.verticalAlign||r.floating||(b/=2),h&&(b=Math.min(b,h)),p.length=0,t&&b>0&&t>b&&!1!==l.enabled?(this.clipHeight=m=Math.max(b-20-this.titleHeight-a,0),this.currentPage=w(this.currentPage,1),this.fullHeight=t,u.forEach((t,e)=>{let i=(y=t.legendItem||{}).y||0,s=Math.round(y.label.getBBox().height),r=p.length;(!r||i-p[r-1]>m&&(x||i)!==p[r-1])&&(p.push(x||i),r++),y.pageIx=r-1,x&&((u[e-1].legendItem||{}).pageIx=r-1),e===u.length-1&&i+s-p[r-1]>m&&i>p[r-1]&&(p.push(i),y.pageIx=r),i!==x&&(x=i)}),S||(S=e.clipRect=s.clipRect(0,a-2,9999,0),e.contentGroup.clip(S)),g(m),v||(this.nav=v=s.g().attr({zIndex:1}).add(this.group),this.up=s.symbol("triangle",0,0,c,c).add(v),f("upTracker").on("click",function(){e.scroll(-1,d)}),this.pager=s.text("",15,10).addClass("highcharts-legend-navigation"),!i.styledMode&&l.style&&this.pager.css(l.style),this.pager.add(v),this.down=s.symbol("triangle-down",0,0,c,c).add(v),f("downTracker").on("click",function(){e.scroll(1,d)})),e.scroll(0),t=b):v&&(g(),this.nav=v.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),t}scroll(t,e){let i=this.chart,s=this.pages,r=s.length,o=this.clipHeight,n=this.options.navigation,a=this.pager,h=this.padding,c=this.currentPage+t;c>r&&(c=r),c>0&&(void 0!==e&&d(e,i),this.nav.attr({translateX:h,translateY:o+this.padding+7+this.titleHeight,visibility:"inherit"}),[this.up,this.upTracker].forEach(function(t){t.attr({class:1===c?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})}),a.attr({text:c+"/"+r}),[this.down,this.downTracker].forEach(function(t){t.attr({x:18+this.pager.getBBox().width,class:c===r?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})},this),i.styledMode||(this.up.attr({fill:1===c?n.inactiveColor:n.activeColor}),this.upTracker.css({cursor:1===c?"default":"pointer"}),this.down.attr({fill:c===r?n.inactiveColor:n.activeColor}),this.downTracker.css({cursor:c===r?"default":"pointer"})),this.scrollOffset=-s[c-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=c,this.positionCheckboxes(),L(()=>{C(this,"afterScroll",{currentPage:c})},l(w(e,i.renderer.globalAnimation,!0)).duration))}setItemEvents(t,e,i){let o=this,n=t.legendItem||{},a=o.chart.renderer.boxWrapper,h=t instanceof r,l=t instanceof s,d="highcharts-legend-"+(h?"point":"series")+"-active",c=o.chart.styledMode,p=i?[e,n.symbol]:[n.group],u=e=>{o.allItems.forEach(i=>{t!==i&&[i].concat(i.linkedSeries||[]).forEach(t=>{t.setState(e,!h)})})};for(let i of p)i&&i.on("mouseover",function(){t.visible&&u("inactive"),t.setState("hover"),t.visible&&a.addClass(d),c||e.css(o.options.itemHoverStyle)}).on("mouseout",function(){o.chart.styledMode||e.css(M(t.visible?o.itemStyle:o.itemHiddenStyle)),u(""),a.removeClass(d),t.setState()}).on("click",function(e){let i=function(){t.setVisible&&t.setVisible(),u(t.visible?"inactive":"")};a.removeClass(d),C(o,"itemClick",{browserEvent:e,legendItem:t},i),h?t.firePointEvent("legendItemClick",{browserEvent:e}):l&&C(t,"legendItemClick",{browserEvent:e})})}createCheckboxForItem(t){t.checkbox=x("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:t.selected,defaultChecked:t.selected},this.options.itemCheckboxStyle,this.chart.container),m(t.checkbox,"click",function(e){let i=e.target;C(t.series||t,"checkboxClick",{checked:i.checked,item:t},function(){t.select()})})}}return(h=O||(O={})).compose=function(t){T(p,"Core.Legend")&&m(t,"beforeMargins",function(){this.legend=new h(this,this.options.legend)})},O}),i(e,"Core/Chart/Chart.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Axis/Axis.js"],e["Core/Defaults.js"],e["Core/Templating.js"],e["Core/Foundation.js"],e["Core/Globals.js"],e["Core/Renderer/RendererRegistry.js"],e["Core/Series/Series.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Renderer/SVG/SVGRenderer.js"],e["Core/Time.js"],e["Core/Utilities.js"],e["Core/Renderer/HTML/AST.js"],e["Core/Axis/Tick.js"]],function(t,e,i,s,r,o,n,a,h,l,d,c,p,u){let{animate:g,animObject:f,setAnimation:m}=t,{defaultOptions:x,defaultTime:y}=i,{numberFormat:b}=s,{registerEventOptions:v}=r,{charts:S,doc:C,marginNames:k,svg:M,win:w}=o,{seriesTypes:T}=h,{addEvent:A,attr:P,createElement:L,css:O,defined:D,diffObjects:E,discardElement:I,erase:j,error:B,extend:R,find:z,fireEvent:N,getStyle:W,isArray:G,isNumber:H,isObject:X,isString:F,merge:Y,objectEach:U,pick:V,pInt:$,relativeLength:Z,removeEvent:_,splat:q,syncTimeout:K,uniqueKey:J}=c;class Q{static chart(t,e,i){return new Q(t,e,i)}constructor(t,e,i){this.sharedClips={};let s=[...arguments];(F(t)||t.nodeName)&&(this.renderTo=s.shift()),this.init(s[0],s[1])}setZoomOptions(){let t=this.options.chart,e=t.zooming;this.zooming={...e,type:V(t.zoomType,e.type),key:V(t.zoomKey,e.key),pinchType:V(t.pinchType,e.pinchType),singleTouch:V(t.zoomBySingleTouch,e.singleTouch,!1),resetButton:Y(e.resetButton,t.resetZoomButton)}}init(t,e){N(this,"init",{args:arguments},function(){let i=Y(x,t),s=i.chart;this.userOptions=R({},t),this.margin=[],this.spacing=[],this.labelCollectors=[],this.callback=e,this.isResizing=0,this.options=i,this.axes=[],this.series=[],this.time=t.time&&Object.keys(t.time).length?new d(t.time):o.time,this.numberFormatter=s.numberFormatter||b,this.styledMode=s.styledMode,this.hasCartesianSeries=s.showAxes,this.index=S.length,S.push(this),o.chartCount++,v(this,s),this.xAxis=[],this.yAxis=[],this.pointCount=this.colorCounter=this.symbolCounter=0,this.setZoomOptions(),N(this,"afterInit"),this.firstRender()})}initSeries(t){let e=this.options.chart,i=t.type||e.type,s=T[i];s||B(17,!0,this,{missingModuleFor:i});let r=new s;return"function"==typeof r.init&&r.init(this,t),r}setSortedData(){this.getSeriesOrderByLinks().forEach(function(t){t.points||t.data||!t.enabledDataSorting||t.setData(t.options.data,!1)})}getSeriesOrderByLinks(){return this.series.concat().sort(function(t,e){return t.linkedSeries.length||e.linkedSeries.length?e.linkedSeries.length-t.linkedSeries.length:0})}orderItems(t,e=0){let i=this[t],s=this.options[t]=q(this.options[t]).slice(),r=this.userOptions[t]=this.userOptions[t]?q(this.userOptions[t]).slice():[];if(this.hasRendered&&(s.splice(e),r.splice(e)),i)for(let t=e,o=i.length;t<o;++t){let e=i[t];e&&(e.index=t,e instanceof a&&(e.name=e.getName()),e.options.isInternal||(s[t]=e.options,r[t]=e.userOptions))}}isInsidePlot(t,e,i={}){let{inverted:s,plotBox:r,plotLeft:o,plotTop:n,scrollablePlotBox:a}=this,{scrollLeft:h=0,scrollTop:l=0}=i.visiblePlotOnly&&this.scrollablePlotArea?.scrollingContainer||{},d=i.series,c=i.visiblePlotOnly&&a||r,p=i.inverted?e:t,u=i.inverted?t:e,g={x:p,y:u,isInsidePlot:!0,options:i};if(!i.ignoreX){let t=d&&(s&&!this.polar?d.yAxis:d.xAxis)||{pos:o,len:1/0},e=i.paneCoordinates?t.pos+p:o+p;e>=Math.max(h+o,t.pos)&&e<=Math.min(h+o+c.width,t.pos+t.len)||(g.isInsidePlot=!1)}if(!i.ignoreY&&g.isInsidePlot){let t=!s&&i.axis&&!i.axis.isXAxis&&i.axis||d&&(s?d.xAxis:d.yAxis)||{pos:n,len:1/0},e=i.paneCoordinates?t.pos+u:n+u;e>=Math.max(l+n,t.pos)&&e<=Math.min(l+n+c.height,t.pos+t.len)||(g.isInsidePlot=!1)}return N(this,"afterIsInsidePlot",g),g.isInsidePlot}redraw(t){N(this,"beforeRedraw");let e=this.hasCartesianSeries?this.axes:this.colorAxis||[],i=this.series,s=this.pointer,r=this.legend,o=this.userOptions.legend,n=this.renderer,a=n.isHidden(),h=[],l,d,c,p=this.isDirtyBox,u=this.isDirtyLegend,g;for(n.rootFontSize=n.boxWrapper.getStyle("font-size"),this.setResponsive&&this.setResponsive(!1),m(!!this.hasRendered&&t,this),a&&this.temporaryDisplay(),this.layOutTitles(!1),c=i.length;c--;)if(((g=i[c]).options.stacking||g.options.centerInCategory)&&(d=!0,g.isDirty)){l=!0;break}if(l)for(c=i.length;c--;)(g=i[c]).options.stacking&&(g.isDirty=!0);i.forEach(function(t){t.isDirty&&("point"===t.options.legendType?("function"==typeof t.updateTotals&&t.updateTotals(),u=!0):o&&(o.labelFormatter||o.labelFormat)&&(u=!0)),t.isDirtyData&&N(t,"updatedData")}),u&&r&&r.options.enabled&&(r.render(),this.isDirtyLegend=!1),d&&this.getStacks(),e.forEach(function(t){t.updateNames(),t.setScale()}),this.getMargins(),e.forEach(function(t){t.isDirty&&(p=!0)}),e.forEach(function(t){let e=t.min+","+t.max;t.extKey!==e&&(t.extKey=e,h.push(function(){N(t,"afterSetExtremes",R(t.eventArgs,t.getExtremes())),delete t.eventArgs})),(p||d)&&t.redraw()}),p&&this.drawChartBox(),N(this,"predraw"),i.forEach(function(t){(p||t.isDirty)&&t.visible&&t.redraw(),t.isDirtyData=!1}),s&&s.reset(!0),n.draw(),N(this,"redraw"),N(this,"render"),a&&this.temporaryDisplay(!0),h.forEach(function(t){t.call()})}get(t){let e=this.series;function i(e){return e.id===t||e.options&&e.options.id===t}let s=z(this.axes,i)||z(this.series,i);for(let t=0;!s&&t<e.length;t++)s=z(e[t].points||[],i);return s}getAxes(){let t=this.userOptions;for(let i of(N(this,"getAxes"),["xAxis","yAxis"]))for(let s of t[i]=q(t[i]||{}))new e(this,s,i);N(this,"afterGetAxes")}getSelectedPoints(){return this.series.reduce((t,e)=>(e.getPointsCollection().forEach(e=>{V(e.selectedStaging,e.selected)&&t.push(e)}),t),[])}getSelectedSeries(){return this.series.filter(function(t){return t.selected})}setTitle(t,e,i){this.applyDescription("title",t),this.applyDescription("subtitle",e),this.applyDescription("caption",void 0),this.layOutTitles(i)}applyDescription(t,e){let i=this,s=this.options[t]=Y(this.options[t],e),r=this[t];r&&e&&(this[t]=r=r.destroy()),s&&!r&&((r=this.renderer.text(s.text,0,0,s.useHTML).attr({align:s.align,class:"highcharts-"+t,zIndex:s.zIndex||4}).add()).update=function(e,s){i.applyDescription(t,e),i.layOutTitles(s)},this.styledMode||r.css(R("title"===t?{fontSize:this.options.isStock?"1em":"1.2em"}:{},s.style)),this[t]=r)}layOutTitles(t=!0){let e=[0,0,0],i=this.renderer,s=this.spacingBox;["title","subtitle","caption"].forEach(function(t){let r=this[t],o=this.options[t],n=o.verticalAlign||"top",a="title"===t?"top"===n?-3:0:"top"===n?e[0]+2:0;if(r){r.css({width:(o.width||s.width+(o.widthAdjust||0))+"px"});let t=i.fontMetrics(r).b,h=Math.round(r.getBBox(o.useHTML).height);r.align(R({y:"bottom"===n?t:a+t,height:h},o),!1,"spacingBox"),o.floating||("top"===n?e[0]=Math.ceil(e[0]+h):"bottom"===n&&(e[2]=Math.ceil(e[2]+h)))}},this),e[0]&&"top"===(this.options.title.verticalAlign||"top")&&(e[0]+=this.options.title.margin),e[2]&&"bottom"===this.options.caption.verticalAlign&&(e[2]+=this.options.caption.margin);let r=!this.titleOffset||this.titleOffset.join(",")!==e.join(",");this.titleOffset=e,N(this,"afterLayOutTitles"),!this.isDirtyBox&&r&&(this.isDirtyBox=this.isDirtyLegend=r,this.hasRendered&&t&&this.isDirtyBox&&this.redraw())}getContainerBox(){let t=[].map.call(this.renderTo.children,t=>{if(t!==this.container){let e=t.style.display;return t.style.display="none",[t,e]}}),e={width:W(this.renderTo,"width",!0)||0,height:W(this.renderTo,"height",!0)||0};return t.filter(Boolean).forEach(([t,e])=>{t.style.display=e}),e}getChartSize(){let t=this.options.chart,e=t.width,i=t.height,s=this.getContainerBox(),r=s.height>1&&!(!this.renderTo.parentElement?.style.height&&"100%"===this.renderTo.style.height);this.chartWidth=Math.max(0,e||s.width||600),this.chartHeight=Math.max(0,Z(i,this.chartWidth)||(r?s.height:400)),this.containerBox=s}temporaryDisplay(t){let e=this.renderTo,i;if(t)for(;e&&e.style;)e.hcOrigStyle&&(O(e,e.hcOrigStyle),delete e.hcOrigStyle),e.hcOrigDetached&&(C.body.removeChild(e),e.hcOrigDetached=!1),e=e.parentNode;else for(;e&&e.style&&(C.body.contains(e)||e.parentNode||(e.hcOrigDetached=!0,C.body.appendChild(e)),("none"===W(e,"display",!1)||e.hcOricDetached)&&(e.hcOrigStyle={display:e.style.display,height:e.style.height,overflow:e.style.overflow},i={display:"block",overflow:"hidden"},e!==this.renderTo&&(i.height=0),O(e,i),e.offsetWidth||e.style.setProperty("display","block","important")),(e=e.parentNode)!==C.body););}setClassName(t){this.container.className="highcharts-container "+(t||"")}getContainer(){let t=this.options,e=t.chart,i="data-highcharts-chart",s=J(),r,o=this.renderTo;o||(this.renderTo=o=e.renderTo),F(o)&&(this.renderTo=o=C.getElementById(o)),o||B(13,!0,this);let a=$(P(o,i));H(a)&&S[a]&&S[a].hasRendered&&S[a].destroy(),P(o,i,this.index),o.innerHTML=p.emptyHTML,e.skipClone||o.offsetWidth||this.temporaryDisplay(),this.getChartSize();let h=this.chartHeight,d=this.chartWidth;O(o,{overflow:"hidden"}),this.styledMode||(r=R({position:"relative",overflow:"hidden",width:d+"px",height:h+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)",userSelect:"none","touch-action":"manipulation",outline:"none",padding:"0px"},e.style||{}));let c=L("div",{id:s},r,o);this.container=c,this.getChartSize(),d===this.chartWidth||(d=this.chartWidth,this.styledMode||O(c,{width:V(e.style?.width,d+"px")})),this.containerBox=this.getContainerBox(),this._cursor=c.style.cursor;let u=e.renderer||!M?n.getRendererType(e.renderer):l;if(this.renderer=new u(c,d,h,void 0,e.forExport,t.exporting&&t.exporting.allowHTML,this.styledMode),m(void 0,this),this.setClassName(e.className),this.styledMode)for(let e in t.defs)this.renderer.definition(t.defs[e]);else this.renderer.setStyle(e.style);this.renderer.chartIndex=this.index,N(this,"afterGetContainer")}getMargins(t){let{spacing:e,margin:i,titleOffset:s}=this;this.resetMargins(),s[0]&&!D(i[0])&&(this.plotTop=Math.max(this.plotTop,s[0]+e[0])),s[2]&&!D(i[2])&&(this.marginBottom=Math.max(this.marginBottom,s[2]+e[2])),this.legend&&this.legend.display&&this.legend.adjustMargins(i,e),N(this,"getMargins"),t||this.getAxisMargins()}getAxisMargins(){let t=this,e=t.axisOffset=[0,0,0,0],i=t.colorAxis,s=t.margin,r=function(t){t.forEach(function(t){t.visible&&t.getOffset()})};t.hasCartesianSeries?r(t.axes):i&&i.length&&r(i),k.forEach(function(i,r){D(s[r])||(t[i]+=e[r])}),t.setChartSize()}getOptions(){return E(this.userOptions,x)}reflow(t){let e=this,i=e.containerBox,s=e.getContainerBox();delete e.pointer?.chartPosition,!e.isPrinting&&!e.isResizing&&i&&s.width&&((s.width!==i.width||s.height!==i.height)&&(c.clearTimeout(e.reflowTimeout),e.reflowTimeout=K(function(){e.container&&e.setSize(void 0,void 0,!1)},t?100:0)),e.containerBox=s)}setReflow(){let t=this,e=e=>{t.options?.chart.reflow&&t.hasLoaded&&t.reflow(e)};if("function"==typeof ResizeObserver)new ResizeObserver(e).observe(t.renderTo);else{let t=A(w,"resize",e);A(this,"destroy",t)}}setSize(t,e,i){let s=this,r=s.renderer;s.isResizing+=1,m(i,s);let o=r.globalAnimation;s.oldChartHeight=s.chartHeight,s.oldChartWidth=s.chartWidth,void 0!==t&&(s.options.chart.width=t),void 0!==e&&(s.options.chart.height=e),s.getChartSize();let{chartWidth:n,chartHeight:a,scrollablePixelsX:h=0,scrollablePixelsY:l=0}=s;(s.isDirtyBox||n!==s.oldChartWidth||a!==s.oldChartHeight)&&(s.styledMode||(o?g:O)(s.container,{width:`${n+h}px`,height:`${a+l}px`},o),s.setChartSize(!0),r.setSize(n,a,o),s.axes.forEach(function(t){t.isDirty=!0,t.setScale()}),s.isDirtyLegend=!0,s.isDirtyBox=!0,s.layOutTitles(),s.getMargins(),s.redraw(o),s.oldChartHeight=void 0,N(s,"resize"),setTimeout(()=>{s&&N(s,"endResize")},f(o).duration)),s.isResizing-=1}setChartSize(t){let e,i,s,r;let{chartHeight:o,chartWidth:n,inverted:a,spacing:h,renderer:l}=this,d=this.clipOffset,c=Math[a?"floor":"round"];this.plotLeft=e=Math.round(this.plotLeft),this.plotTop=i=Math.round(this.plotTop),this.plotWidth=s=Math.max(0,Math.round(n-e-this.marginRight)),this.plotHeight=r=Math.max(0,Math.round(o-i-this.marginBottom)),this.plotSizeX=a?r:s,this.plotSizeY=a?s:r,this.spacingBox=l.spacingBox={x:h[3],y:h[0],width:n-h[3]-h[1],height:o-h[0]-h[2]},this.plotBox=l.plotBox={x:e,y:i,width:s,height:r},d&&(this.clipBox={x:c(d[3]),y:c(d[0]),width:c(this.plotSizeX-d[1]-d[3]),height:c(this.plotSizeY-d[0]-d[2])}),t||(this.axes.forEach(function(t){t.setAxisSize(),t.setAxisTranslation()}),l.alignElements()),N(this,"afterSetChartSize",{skipAxes:t})}resetMargins(){N(this,"resetMargins");let t=this,e=t.options.chart,i=e.plotBorderWidth||0,s=i/2;["margin","spacing"].forEach(function(i){let s=e[i],r=X(s)?s:[s,s,s,s];["Top","Right","Bottom","Left"].forEach(function(s,o){t[i][o]=V(e[i+s],r[o])})}),k.forEach(function(e,i){t[e]=V(t.margin[i],t.spacing[i])}),t.axisOffset=[0,0,0,0],t.clipOffset=[s,s,s,s],t.plotBorderWidth=i}drawChartBox(){let t=this.options.chart,e=this.renderer,i=this.chartWidth,s=this.chartHeight,r=this.styledMode,o=this.plotBGImage,n=t.backgroundColor,a=t.plotBackgroundColor,h=t.plotBackgroundImage,l=this.plotLeft,d=this.plotTop,c=this.plotWidth,p=this.plotHeight,u=this.plotBox,g=this.clipRect,f=this.clipBox,m=this.chartBackground,x=this.plotBackground,y=this.plotBorder,b,v,S,C="animate";m||(this.chartBackground=m=e.rect().addClass("highcharts-background").add(),C="attr"),r?b=v=m.strokeWidth():(v=(b=t.borderWidth||0)+(t.shadow?8:0),S={fill:n||"none"},(b||m["stroke-width"])&&(S.stroke=t.borderColor,S["stroke-width"]=b),m.attr(S).shadow(t.shadow)),m[C]({x:v/2,y:v/2,width:i-v-b%2,height:s-v-b%2,r:t.borderRadius}),C="animate",x||(C="attr",this.plotBackground=x=e.rect().addClass("highcharts-plot-background").add()),x[C](u),!r&&(x.attr({fill:a||"none"}).shadow(t.plotShadow),h&&(o?(h!==o.attr("href")&&o.attr("href",h),o.animate(u)):this.plotBGImage=e.image(h,l,d,c,p).add())),g?g.animate({width:f.width,height:f.height}):this.clipRect=e.clipRect(f),C="animate",y||(C="attr",this.plotBorder=y=e.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add()),r||y.attr({stroke:t.plotBorderColor,"stroke-width":t.plotBorderWidth||0,fill:"none"}),y[C](y.crisp({x:l,y:d,width:c,height:p},-y.strokeWidth())),this.isDirtyBox=!1,N(this,"afterDrawChartBox")}propFromSeries(){let t,e,i;let s=this,r=s.options.chart,o=s.options.series;["inverted","angular","polar"].forEach(function(n){for(e=T[r.type],i=r[n]||e&&e.prototype[n],t=o&&o.length;!i&&t--;)(e=T[o[t].type])&&e.prototype[n]&&(i=!0);s[n]=i})}linkSeries(t){let e=this,i=e.series;i.forEach(function(t){t.linkedSeries.length=0}),i.forEach(function(t){let{linkedTo:i}=t.options;if(F(i)){let s;(s=":previous"===i?e.series[t.index-1]:e.get(i))&&s.linkedParent!==t&&(s.linkedSeries.push(t),t.linkedParent=s,s.enabledDataSorting&&t.setDataSortingOptions(),t.visible=V(t.options.visible,s.options.visible,t.visible))}}),N(this,"afterLinkSeries",{isUpdating:t})}renderSeries(){this.series.forEach(function(t){t.translate(),t.render()})}render(){let t=this.axes,e=this.colorAxis,i=this.renderer,s=this.options.chart.axisLayoutRuns||2,r=t=>{t.forEach(t=>{t.visible&&t.render()})},o=0,n=!0,a,h=0;for(let e of(this.setTitle(),N(this,"beforeMargins"),this.getStacks?.(),this.getMargins(!0),this.setChartSize(),t)){let{options:t}=e,{labels:i}=t;if(this.hasCartesianSeries&&e.horiz&&e.visible&&i.enabled&&e.series.length&&"colorAxis"!==e.coll&&!this.polar){o=t.tickLength,e.createGroups();let s=new u(e,0,"",!0),r=s.createLabel("x",i);if(s.destroy(),r&&V(i.reserveSpace,!H(t.crossing))&&(o=r.getBBox().height+i.distance+Math.max(t.offset||0,0)),o){r?.destroy();break}}}for(this.plotHeight=Math.max(this.plotHeight-o,0);(n||a||s>1)&&h<s;){let e=this.plotWidth,i=this.plotHeight;for(let e of t)0===h?e.setScale():(e.horiz&&n||!e.horiz&&a)&&e.setTickInterval(!0);0===h?this.getAxisMargins():this.getMargins(),n=e/this.plotWidth>(h?1:1.1),a=i/this.plotHeight>(h?1:1.05),h++}this.drawChartBox(),this.hasCartesianSeries?r(t):e&&e.length&&r(e),this.seriesGroup||(this.seriesGroup=i.g("series-group").attr({zIndex:3}).shadow(this.options.chart.seriesGroupShadow).add()),this.renderSeries(),this.addCredits(),this.setResponsive&&this.setResponsive(),this.hasRendered=!0}addCredits(t){let e=this,i=Y(!0,this.options.credits,t);i.enabled&&!this.credits&&(this.credits=this.renderer.text(i.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){i.href&&(w.location.href=i.href)}).attr({align:i.position.align,zIndex:8}),e.styledMode||this.credits.css(i.style),this.credits.add().align(i.position),this.credits.update=function(t){e.credits=e.credits.destroy(),e.addCredits(t)})}destroy(){let t;let e=this,i=e.axes,s=e.series,r=e.container,n=r&&r.parentNode;for(N(e,"destroy"),e.renderer.forExport?j(S,e):S[e.index]=void 0,o.chartCount--,e.renderTo.removeAttribute("data-highcharts-chart"),_(e),t=i.length;t--;)i[t]=i[t].destroy();for(this.scroller&&this.scroller.destroy&&this.scroller.destroy(),t=s.length;t--;)s[t]=s[t].destroy();["title","subtitle","chartBackground","plotBackground","plotBGImage","plotBorder","seriesGroup","clipRect","credits","pointer","rangeSelector","legend","resetZoomButton","tooltip","renderer"].forEach(function(t){let i=e[t];i&&i.destroy&&(e[t]=i.destroy())}),r&&(r.innerHTML=p.emptyHTML,_(r),n&&I(r)),U(e,function(t,i){delete e[i]})}firstRender(){let t=this,e=t.options;t.getContainer(),t.resetMargins(),t.setChartSize(),t.propFromSeries(),t.getAxes();let i=G(e.series)?e.series:[];e.series=[],i.forEach(function(e){t.initSeries(e)}),t.linkSeries(),t.setSortedData(),N(t,"beforeRender"),t.render(),t.pointer?.getChartPosition(),t.renderer.imgCount||t.hasLoaded||t.onload(),t.temporaryDisplay(!0)}onload(){this.callbacks.concat([this.callback]).forEach(function(t){t&&void 0!==this.index&&t.apply(this,[this])},this),N(this,"load"),N(this,"render"),D(this.index)&&this.setReflow(),this.warnIfA11yModuleNotLoaded(),this.hasLoaded=!0}warnIfA11yModuleNotLoaded(){let{options:t,title:e}=this;!t||this.accessibility||(this.renderer.boxWrapper.attr({role:"img","aria-label":(e&&e.element.textContent||"").replace(/</g,"<")}),t.accessibility&&!1===t.accessibility.enabled||B('Highcharts warning: Consider including the "accessibility.js" module to make your chart more usable for people with disabilities. Set the "accessibility.enabled" option to false to remove this warning. See https://www.highcharts.com/docs/accessibility/accessibility-module.',!1,this))}addSeries(t,e,i){let s;let r=this;return t&&(e=V(e,!0),N(r,"addSeries",{options:t},function(){s=r.initSeries(t),r.isDirtyLegend=!0,r.linkSeries(),s.enabledDataSorting&&s.setData(t.data,!1),N(r,"afterAddSeries",{series:s}),e&&r.redraw(i)})),s}addAxis(t,e,i,s){return this.createAxis(e?"xAxis":"yAxis",{axis:t,redraw:i,animation:s})}addColorAxis(t,e,i){return this.createAxis("colorAxis",{axis:t,redraw:e,animation:i})}createAxis(t,i){let s=new e(this,i.axis,t);return V(i.redraw,!0)&&this.redraw(i.animation),s}showLoading(t){let e=this,i=e.options,s=i.loading,r=function(){o&&O(o,{left:e.plotLeft+"px",top:e.plotTop+"px",width:e.plotWidth+"px",height:e.plotHeight+"px"})},o=e.loadingDiv,n=e.loadingSpan;o||(e.loadingDiv=o=L("div",{className:"highcharts-loading highcharts-loading-hidden"},null,e.container)),n||(e.loadingSpan=n=L("span",{className:"highcharts-loading-inner"},null,o),A(e,"redraw",r)),o.className="highcharts-loading",p.setElementHTML(n,V(t,i.lang.loading,"")),e.styledMode||(O(o,R(s.style,{zIndex:10})),O(n,s.labelStyle),e.loadingShown||(O(o,{opacity:0,display:""}),g(o,{opacity:s.style.opacity||.5},{duration:s.showDuration||0}))),e.loadingShown=!0,r()}hideLoading(){let t=this.options,e=this.loadingDiv;e&&(e.className="highcharts-loading highcharts-loading-hidden",this.styledMode||g(e,{opacity:0},{duration:t.loading.hideDuration||100,complete:function(){O(e,{display:"none"})}})),this.loadingShown=!1}update(t,e,i,s){let r,o,n;let a=this,h={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"},l=t.isResponsiveOptions,c=[];N(a,"update",{options:t}),l||a.setResponsive(!1,!0),t=E(t,a.options),a.userOptions=Y(a.userOptions,t);let p=t.chart;p&&(Y(!0,a.options.chart,p),this.setZoomOptions(),"className"in p&&a.setClassName(p.className),("inverted"in p||"polar"in p||"type"in p)&&(a.propFromSeries(),r=!0),"alignTicks"in p&&(r=!0),"events"in p&&v(this,p),U(p,function(t,e){-1!==a.propsRequireUpdateSeries.indexOf("chart."+e)&&(o=!0),-1!==a.propsRequireDirtyBox.indexOf(e)&&(a.isDirtyBox=!0),-1===a.propsRequireReflow.indexOf(e)||(a.isDirtyBox=!0,l||(n=!0))}),!a.styledMode&&p.style&&a.renderer.setStyle(a.options.chart.style||{})),!a.styledMode&&t.colors&&(this.options.colors=t.colors),t.time&&(this.time===y&&(this.time=new d(t.time)),Y(!0,a.options.time,t.time)),U(t,function(e,i){a[i]&&"function"==typeof a[i].update?a[i].update(e,!1):"function"==typeof a[h[i]]?a[h[i]](e):"colors"!==i&&-1===a.collectionsWithUpdate.indexOf(i)&&Y(!0,a.options[i],t[i]),"chart"!==i&&-1!==a.propsRequireUpdateSeries.indexOf(i)&&(o=!0)}),this.collectionsWithUpdate.forEach(function(e){t[e]&&(q(t[e]).forEach(function(t,s){let r;let o=D(t.id);o&&(r=a.get(t.id)),!r&&a[e]&&(r=a[e][V(t.index,s)])&&(o&&D(r.options.id)||r.options.isInternal)&&(r=void 0),r&&r.coll===e&&(r.update(t,!1),i&&(r.touched=!0)),!r&&i&&a.collectionsWithInit[e]&&(a.collectionsWithInit[e][0].apply(a,[t].concat(a.collectionsWithInit[e][1]||[]).concat([!1])).touched=!0)}),i&&a[e].forEach(function(t){t.touched||t.options.isInternal?delete t.touched:c.push(t)}))}),c.forEach(function(t){t.chart&&t.remove&&t.remove(!1)}),r&&a.axes.forEach(function(t){t.update({},!1)}),o&&a.getSeriesOrderByLinks().forEach(function(t){t.chart&&t.update({},!1)},this);let u=p&&p.width,g=p&&(F(p.height)?Z(p.height,u||a.chartWidth):p.height);n||H(u)&&u!==a.chartWidth||H(g)&&g!==a.chartHeight?a.setSize(u,g,s):V(e,!0)&&a.redraw(s),N(a,"afterUpdate",{options:t,redraw:e,animation:s})}setSubtitle(t,e){this.applyDescription("subtitle",t),this.layOutTitles(e)}setCaption(t,e){this.applyDescription("caption",t),this.layOutTitles(e)}showResetZoom(){let t=this,e=x.lang,i=t.zooming.resetButton,s=i.theme,r="chart"===i.relativeTo||"spacingBox"===i.relativeTo?null:"plotBox";function o(){t.zoomOut()}N(this,"beforeShowResetZoom",null,function(){t.resetZoomButton=t.renderer.button(e.resetZoom,null,null,o,s).attr({align:i.position.align,title:e.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(i.position,!1,r)}),N(this,"afterShowResetZoom")}zoomOut(){N(this,"selection",{resetSelection:!0},()=>this.transform({reset:!0,trigger:"zoom"}))}pan(t,e){let i=this,s="object"==typeof e?e:{enabled:e,type:"x"},r=s.type,o=r&&i[({x:"xAxis",xy:"axes",y:"yAxis"})[r]].filter(t=>t.options.panningEnabled&&!t.options.isInternal),n=i.options.chart;n?.panning&&(n.panning=s),N(this,"pan",{originalEvent:t},()=>{i.transform({axes:o,event:t,to:{x:t.chartX-(i.mouseDownX||0),y:t.chartY-(i.mouseDownY||0)},trigger:"pan"}),O(i.container,{cursor:"move"})})}transform(t){let{axes:e=this.axes,event:i,from:s={},reset:r,selection:o,to:n={},trigger:a}=t,{inverted:h}=this,l=!1,d,c;for(let t of(this.hoverPoints?.forEach(t=>t.setState()),e)){let{horiz:e,len:p,minPointOffset:u=0,options:g,reversed:f}=t,m=e?"width":"height",x=e?"x":"y",y=V(n[m],t.len),b=V(s[m],t.len),v=10>Math.abs(y)?1:y/b,S=(s[x]||0)+b/2-t.pos,C=S-((n[x]??t.pos)+y/2-t.pos)/v,k=f&&!h||!f&&h?-1:1;if(!r&&(S<0||S>t.len))continue;let M=t.toValue(C,!0)+(o||t.isOrdinal?0:u*k),w=t.toValue(C+p/v,!0)-(o||t.isOrdinal?0:u*k||0),T=t.allExtremes;if(M>w&&([M,w]=[w,M]),1===v&&!r&&"yAxis"===t.coll&&!T){for(let e of t.series){let t=e.getExtremes(e.getProcessedData(!0).yData,!0);T??(T={dataMin:Number.MAX_VALUE,dataMax:-Number.MAX_VALUE}),H(t.dataMin)&&H(t.dataMax)&&(T.dataMin=Math.min(t.dataMin,T.dataMin),T.dataMax=Math.max(t.dataMax,T.dataMax))}t.allExtremes=T}let{dataMin:A,dataMax:P,min:L,max:O}=R(t.getExtremes(),T||{}),E=A??g.min,I=P??g.max,j=w-M,B=t.categories?0:Math.min(j,I-E),z=E-B*(D(g.min)?0:g.minPadding),N=I+B*(D(g.max)?0:g.maxPadding),W=t.allowZoomOutside||1===v||"zoom"!==a&&v>1,G=Math.min(g.min??z,z,W?L:z),X=Math.max(g.max??N,N,W?O:N);(!t.isOrdinal||t.options.overscroll||1!==v||r)&&(M<G&&(M=G,v>=1&&(w=M+j)),w>X&&(w=X,v>=1&&(M=w-j)),(r||t.series.length&&(M!==L||w!==O)&&M>=G&&w<=X)&&(o?o[t.coll].push({axis:t,min:M,max:w}):(t.isPanning="zoom"!==a,t.isPanning&&(c=!0),t.setExtremes(r?void 0:M,r?void 0:w,!1,!1,{move:C,trigger:a,scale:v}),!r&&(M>G||w<X)&&"mousewheel"!==a&&(d=!0)),l=!0),i&&(this[e?"mouseDownX":"mouseDownY"]=i[e?"chartX":"chartY"]))}return l&&(o?N(this,"selection",o,()=>{delete t.selection,t.trigger="zoom",this.transform(t)}):(!d||c||this.resetZoomButton?!d&&this.resetZoomButton&&(this.resetZoomButton=this.resetZoomButton.destroy()):this.showResetZoom(),this.redraw("zoom"===a&&(this.options.chart.animation??this.pointCount<100)))),l}}return R(Q.prototype,{callbacks:[],collectionsWithInit:{xAxis:[Q.prototype.addAxis,[!0]],yAxis:[Q.prototype.addAxis,[!1]],series:[Q.prototype.addSeries]},collectionsWithUpdate:["xAxis","yAxis","series"],propsRequireDirtyBox:["backgroundColor","borderColor","borderWidth","borderRadius","plotBackgroundColor","plotBackgroundImage","plotBorderColor","plotBorderWidth","plotShadow","shadow"],propsRequireReflow:["margin","marginTop","marginRight","marginBottom","marginLeft","spacing","spacingTop","spacingRight","spacingBottom","spacingLeft"],propsRequireUpdateSeries:["chart.inverted","chart.polar","chart.ignoreHiddenSeries","chart.type","colors","plotOptions","time","tooltip"]}),Q}),i(e,"Extensions/ScrollablePlotArea.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Globals.js"],e["Core/Renderer/RendererRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){let{stop:r}=t,{composed:o}=e,{addEvent:n,createElement:a,css:h,defined:l,merge:d,pushUnique:c}=s;function p(){let t=this.scrollablePlotArea;(this.scrollablePixelsX||this.scrollablePixelsY)&&!t&&(this.scrollablePlotArea=t=new g(this)),t?.applyFixed()}function u(){this.chart.scrollablePlotArea&&(this.chart.scrollablePlotArea.isDirty=!0)}class g{static compose(t,e,i){c(o,this.compose)&&(n(t,"afterInit",u),n(e,"afterSetChartSize",t=>this.afterSetSize(t.target,t)),n(e,"render",p),n(i,"show",u))}static afterSetSize(t,e){let i,s,r;let{minWidth:o,minHeight:n}=t.options.chart.scrollablePlotArea||{},{clipBox:a,plotBox:h,inverted:c,renderer:p}=t;if(!p.forExport&&(o?(t.scrollablePixelsX=i=Math.max(0,o-t.chartWidth),i&&(t.scrollablePlotBox=d(t.plotBox),h.width=t.plotWidth+=i,a[c?"height":"width"]+=i,r=!0)):n&&(t.scrollablePixelsY=s=Math.max(0,n-t.chartHeight),l(s)&&(t.scrollablePlotBox=d(t.plotBox),h.height=t.plotHeight+=s,a[c?"width":"height"]+=s,r=!1)),l(r)&&!e.skipAxes))for(let e of t.axes)e.horiz===r&&(e.setAxisSize(),e.setAxisTranslation())}constructor(t){let e;let s=t.options.chart,r=i.getRendererType(),o=s.scrollablePlotArea||{},l=this.moveFixedElements.bind(this),d={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};t.scrollablePixelsX&&(d.overflowX="auto"),t.scrollablePixelsY&&(d.overflowY="auto"),this.chart=t;let c=this.parentDiv=a("div",{className:"highcharts-scrolling-parent"},{position:"relative"},t.renderTo),p=this.scrollingContainer=a("div",{className:"highcharts-scrolling"},d,c),u=this.innerContainer=a("div",{className:"highcharts-inner-container"},void 0,p),g=this.fixedDiv=a("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:(s.style?.zIndex||0)+2,top:0},void 0,!0),f=this.fixedRenderer=new r(g,t.chartWidth,t.chartHeight,s.style);this.mask=f.path().attr({fill:s.backgroundColor||"#fff","fill-opacity":o.opacity??.85,zIndex:-1}).addClass("highcharts-scrollable-mask").add(),p.parentNode.insertBefore(g,p),h(t.renderTo,{overflow:"visible"}),n(t,"afterShowResetZoom",l),n(t,"afterApplyDrilldown",l),n(t,"afterLayOutTitles",l),n(p,"scroll",()=>{let{pointer:i,hoverPoint:s}=t;i&&(delete i.chartPosition,s&&(e=s),i.runPointActions(void 0,e,!0))}),u.appendChild(t.container)}applyFixed(){let{chart:t,fixedRenderer:e,isDirty:i,scrollingContainer:s}=this,{axisOffset:o,chartWidth:n,chartHeight:a,container:d,plotHeight:c,plotLeft:p,plotTop:u,plotWidth:g,scrollablePixelsX:f=0,scrollablePixelsY:m=0}=t,{scrollPositionX:x=0,scrollPositionY:y=0}=t.options.chart.scrollablePlotArea||{},b=n+f,v=a+m;e.setSize(n,a),(i??!0)&&(this.isDirty=!1,this.moveFixedElements()),r(t.container),h(d,{width:`${b}px`,height:`${v}px`}),t.renderer.boxWrapper.attr({width:b,height:v,viewBox:[0,0,b,v].join(" ")}),t.chartBackground?.attr({width:b,height:v}),h(s,{width:`${n}px`,height:`${a}px`}),l(i)||(s.scrollLeft=f*x,s.scrollTop=m*y);let S=u-o[0]-1,C=p-o[3]-1,k=u+c+o[2]+1,M=p+g+o[1]+1,w=p+g-f,T=u+c-m,A=[["M",0,0]];f?A=[["M",0,S],["L",p-1,S],["L",p-1,k],["L",0,k],["Z"],["M",w,S],["L",n,S],["L",n,k],["L",w,k],["Z"]]:m&&(A=[["M",C,0],["L",C,u-1],["L",M,u-1],["L",M,0],["Z"],["M",C,T],["L",C,a],["L",M,a],["L",M,T],["Z"]]),"adjustHeight"!==t.redrawTrigger&&this.mask.attr({d:A})}moveFixedElements(){let t;let{container:e,inverted:i,scrollablePixelsX:s,scrollablePixelsY:r}=this.chart,o=this.fixedRenderer,n=g.fixedSelectors;for(let a of(s&&!i?t=".highcharts-yaxis":s&&i?t=".highcharts-xaxis":r&&!i?t=".highcharts-xaxis":r&&i&&(t=".highcharts-yaxis"),t&&n.push(`${t}:not(.highcharts-radial-axis)`,`${t}-labels:not(.highcharts-radial-axis-labels)`),n))[].forEach.call(e.querySelectorAll(a),t=>{(t.namespaceURI===o.SVG_NS?o.box:o.box.parentNode).appendChild(t),t.style.pointerEvents="auto"})}}return g.fixedSelectors=[".highcharts-breadcrumbs-group",".highcharts-contextbutton",".highcharts-caption",".highcharts-credits",".highcharts-drillup-button",".highcharts-legend",".highcharts-legend-checkbox",".highcharts-navigator-series",".highcharts-navigator-xaxis",".highcharts-navigator-yaxis",".highcharts-navigator",".highcharts-range-selector-group",".highcharts-reset-zoom",".highcharts-scrollbar",".highcharts-subtitle",".highcharts-title"],g}),i(e,"Core/Axis/Stacking/StackItem.js",[e["Core/Templating.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{format:s}=t,{series:r}=e,{destroyObjectProperties:o,fireEvent:n,isNumber:a,pick:h}=i;return class{constructor(t,e,i,s,r){let o=t.chart.inverted,n=t.reversed;this.axis=t;let a=this.isNegative=!!i!=!!n;this.options=e=e||{},this.x=s,this.total=null,this.cumulative=null,this.points={},this.hasValidPoints=!1,this.stack=r,this.leftCliff=0,this.rightCliff=0,this.alignOptions={align:e.align||(o?a?"left":"right":"center"),verticalAlign:e.verticalAlign||(o?"middle":a?"bottom":"top"),y:e.y,x:e.x},this.textAlign=e.textAlign||(o?a?"right":"left":"center")}destroy(){o(this,this.axis)}render(t){let e=this.axis.chart,i=this.options,r=i.format,o=r?s(r,this,e):i.formatter.call(this);if(this.label)this.label.attr({text:o,visibility:"hidden"});else{this.label=e.renderer.label(o,null,void 0,i.shape,void 0,void 0,i.useHTML,!1,"stack-labels");let s={r:i.borderRadius||0,text:o,padding:h(i.padding,5),visibility:"hidden"};e.styledMode||(s.fill=i.backgroundColor,s.stroke=i.borderColor,s["stroke-width"]=i.borderWidth,this.label.css(i.style||{})),this.label.attr(s),this.label.added||this.label.add(t)}this.label.labelrank=e.plotSizeY,n(this,"afterRender")}setOffset(t,e,i,s,o,l){let{alignOptions:d,axis:c,label:p,options:u,textAlign:g}=this,f=c.chart,m=this.getStackBox({xOffset:t,width:e,boxBottom:i,boxTop:s,defaultX:o,xAxis:l}),{verticalAlign:x}=d;if(p&&m){let t=p.getBBox(void 0,0),e=p.padding,i="justify"===h(u.overflow,"justify"),s;d.x=u.x||0,d.y=u.y||0;let{x:o,y:n}=this.adjustStackPosition({labelBox:t,verticalAlign:x,textAlign:g});m.x-=o,m.y-=n,p.align(d,!1,m),(s=f.isInsidePlot(p.alignAttr.x+d.x+o,p.alignAttr.y+d.y+n))||(i=!1),i&&r.prototype.justifyDataLabel.call(c,p,d,p.alignAttr,t,m),p.attr({x:p.alignAttr.x,y:p.alignAttr.y,rotation:u.rotation,rotationOriginX:t.width*({left:0,center:.5,right:1})[u.textAlign||"center"],rotationOriginY:t.height/2}),h(!i&&u.crop,!0)&&(s=a(p.x)&&a(p.y)&&f.isInsidePlot(p.x-e+(p.width||0),p.y)&&f.isInsidePlot(p.x+e,p.y)),p[s?"show":"hide"]()}n(this,"afterSetOffset",{xOffset:t,width:e})}adjustStackPosition({labelBox:t,verticalAlign:e,textAlign:i}){let s={bottom:0,middle:1,top:2,right:1,center:0,left:-1},r=s[e],o=s[i];return{x:t.width/2+t.width/2*o,y:t.height/2*r}}getStackBox(t){let e=this.axis,i=e.chart,{boxTop:s,defaultX:r,xOffset:o,width:n,boxBottom:l}=t,d=e.stacking.usePercentage?100:h(s,this.total,0),c=e.toPixels(d),p=t.xAxis||i.xAxis[0],u=h(r,p.translate(this.x))+o,g=Math.abs(c-e.toPixels(l||a(e.min)&&e.logarithmic&&e.logarithmic.lin2log(e.min)||0)),f=i.inverted,m=this.isNegative;return f?{x:(m?c:c-g)-i.plotLeft,y:p.height-u-n+p.top-i.plotTop,width:g,height:n}:{x:u+p.transB-i.plotLeft,y:(m?c-g:c)-i.plotTop,width:n,height:g}}}}),i(e,"Core/Axis/Stacking/StackingAxis.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Axis/Axis.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Axis/Stacking/StackItem.js"],e["Core/Utilities.js"]],function(t,e,i,s,r){var o;let{getDeferredAnimation:n}=t,{series:{prototype:a}}=i,{addEvent:h,correctFloat:l,defined:d,destroyObjectProperties:c,fireEvent:p,isArray:u,isNumber:g,objectEach:f,pick:m}=r;function x(){let t=this.inverted;this.axes.forEach(t=>{t.stacking&&t.stacking.stacks&&t.hasVisibleSeries&&(t.stacking.oldStacks=t.stacking.stacks)}),this.series.forEach(e=>{let i=e.xAxis&&e.xAxis.options||{};e.options.stacking&&e.reserveSpace()&&(e.stackKey=[e.type,m(e.options.stack,""),t?i.top:i.left,t?i.height:i.width].join(","))})}function y(){let t=this.stacking;if(t){let e=t.stacks;f(e,(t,i)=>{c(t),delete e[i]}),t.stackTotalGroup?.destroy()}}function b(){this.stacking||(this.stacking=new w(this))}function v(t,e,i,s){return!d(t)||t.x!==e||s&&t.stackKey!==s?t={x:e,index:0,key:s,stackKey:s}:t.index++,t.key=[i,e,t.index].join(","),t}function S(){let t;let e=this,i=e.yAxis,s=e.stackKey||"",r=i.stacking.stacks,o=e.processedXData,n=e.options.stacking,a=e[n+"Stacker"];a&&[s,"-"+s].forEach(i=>{let s=o.length,n,h,l;for(;s--;)n=o[s],t=e.getStackIndicator(t,n,e.index,i),h=r[i]?.[n],(l=h?.points[t.key||""])&&a.call(e,l,h,s)})}function C(t,e,i){let s=e.total?100/e.total:0;t[0]=l(t[0]*s),t[1]=l(t[1]*s),this.stackedYData[i]=t[1]}function k(t){(this.is("column")||this.is("columnrange"))&&(this.options.centerInCategory&&!this.options.stacking&&this.chart.series.length>1?a.setStackedPoints.call(this,t,"group"):t.stacking.resetStacks())}function M(t,e){let i,r,o,n,a,h,c,p,g;let f=e||this.options.stacking;if(!f||!this.reserveSpace()||(({group:"xAxis"})[f]||"yAxis")!==t.coll)return;let x=this.processedXData,y=this.processedYData,b=[],v=y.length,S=this.options,C=S.threshold||0,k=S.startFromThreshold?C:0,M=S.stack,w=e?`${this.type},${f}`:this.stackKey||"",T="-"+w,A=this.negStacks,P=t.stacking,L=P.stacks,O=P.oldStacks;for(P.stacksTouched+=1,c=0;c<v;c++){p=x[c],g=y[c],h=(i=this.getStackIndicator(i,p,this.index)).key||"",L[a=(r=A&&g<(k?0:C))?T:w]||(L[a]={}),L[a][p]||(O[a]?.[p]?(L[a][p]=O[a][p],L[a][p].total=null):L[a][p]=new s(t,t.options.stackLabels,!!r,p,M)),o=L[a][p],null!==g?(o.points[h]=o.points[this.index]=[m(o.cumulative,k)],d(o.cumulative)||(o.base=h),o.touched=P.stacksTouched,i.index>0&&!1===this.singleStacks&&(o.points[h][0]=o.points[this.index+","+p+",0"][0])):(delete o.points[h],delete o.points[this.index]);let e=o.total||0;"percent"===f?(n=r?w:T,e=A&&L[n]?.[p]?(n=L[n][p]).total=Math.max(n.total||0,e)+Math.abs(g)||0:l(e+(Math.abs(g)||0))):"group"===f?(u(g)&&(g=g[0]),null!==g&&e++):e=l(e+(g||0)),"group"===f?o.cumulative=(e||1)-1:o.cumulative=l(m(o.cumulative,k)+(g||0)),o.total=e,null!==g&&(o.points[h].push(o.cumulative),b[c]=o.cumulative,o.hasValidPoints=!0)}"percent"===f&&(P.usePercentage=!0),"group"!==f&&(this.stackedYData=b),P.oldStacks={}}class w{constructor(t){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=t}buildStacks(){let t,e;let i=this.axis,s=i.series,r="xAxis"===i.coll,o=i.options.reversedStacks,n=s.length;for(this.resetStacks(),this.usePercentage=!1,e=n;e--;)t=s[o?e:n-e-1],r&&t.setGroupedPoints(i),t.setStackedPoints(i);if(!r)for(e=0;e<n;e++)s[e].modifyStacks();p(i,"afterBuildStacks")}cleanStacks(){this.oldStacks&&(this.stacks=this.oldStacks,f(this.stacks,t=>{f(t,t=>{t.cumulative=t.total})}))}resetStacks(){f(this.stacks,t=>{f(t,(e,i)=>{g(e.touched)&&e.touched<this.stacksTouched?(e.destroy(),delete t[i]):(e.total=null,e.cumulative=null)})})}renderStackTotals(){let t=this.axis,e=t.chart,i=e.renderer,s=this.stacks,r=n(e,t.options.stackLabels?.animation||!1),o=this.stackTotalGroup=this.stackTotalGroup||i.g("stack-labels").attr({zIndex:6,opacity:0}).add();o.translate(e.plotLeft,e.plotTop),f(s,t=>{f(t,t=>{t.render(o)})}),o.animate({opacity:1},r)}}return(o||(o={})).compose=function(t,e,i){let s=e.prototype,r=i.prototype;s.getStacks||(h(t,"init",b),h(t,"destroy",y),s.getStacks=x,r.getStackIndicator=v,r.modifyStacks=S,r.percentStacker=C,r.setGroupedPoints=k,r.setStackedPoints=M)},o}),i(e,"Series/Line/LineSeries.js",[e["Core/Series/Series.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{defined:s,merge:r,isObject:o}=i;class n extends t{drawGraph(){let t=this.options,e=(this.gappedPath||this.getGraphPath).call(this),i=this.chart.styledMode;[this,...this.zones].forEach((s,n)=>{let a,h=s.graph,l=h?"animate":"attr",d=s.dashStyle||t.dashStyle;h?(h.endX=this.preventGraphAnimation?null:e.xMap,h.animate({d:e})):e.length&&(s.graph=h=this.chart.renderer.path(e).addClass("highcharts-graph"+(n?` highcharts-zone-graph-${n-1} `:" ")+(n&&s.className||"")).attr({zIndex:1}).add(this.group)),h&&!i&&(a={stroke:!n&&t.lineColor||s.color||this.color||"#cccccc","stroke-width":t.lineWidth||0,fill:this.fillGraph&&this.color||"none"},d?a.dashstyle=d:"square"!==t.linecap&&(a["stroke-linecap"]=a["stroke-linejoin"]="round"),h[l](a).shadow(n<2&&t.shadow&&r({filterUnits:"userSpaceOnUse"},o(t.shadow)?t.shadow:{}))),h&&(h.startX=e.xMap,h.isArea=e.isArea)})}getGraphPath(t,e,i){let r=this,o=r.options,n=[],a=[],h,l=o.step,d=(t=t||r.points).reversed;return d&&t.reverse(),(l=({right:1,center:2})[l]||l&&3)&&d&&(l=4-l),(t=this.getValidPoints(t,!1,!(o.connectNulls&&!e&&!i))).forEach(function(d,c){let p;let u=d.plotX,g=d.plotY,f=t[c-1],m=d.isNull||"number"!=typeof g;(d.leftCliff||f&&f.rightCliff)&&!i&&(h=!0),m&&!s(e)&&c>0?h=!o.connectNulls:m&&!e?h=!0:(0===c||h?p=[["M",d.plotX,d.plotY]]:r.getPointSpline?p=[r.getPointSpline(t,d,c)]:l?(p=1===l?[["L",f.plotX,g]]:2===l?[["L",(f.plotX+u)/2,f.plotY],["L",(f.plotX+u)/2,g]]:[["L",u,f.plotY]]).push(["L",u,g]):p=[["L",u,g]],a.push(d.x),l&&(a.push(d.x),2===l&&a.push(d.x)),n.push.apply(n,p),h=!1)}),n.xMap=a,r.graphPath=n,n}}return n.defaultOptions=r(t.defaultOptions,{legendSymbol:"lineMarker"}),e.registerSeriesType("line",n),n}),i(e,"Series/Area/AreaSeriesDefaults.js",[],function(){return{threshold:0,legendSymbol:"areaMarker"}}),i(e,"Series/Area/AreaSeries.js",[e["Series/Area/AreaSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{seriesTypes:{line:s}}=e,{extend:r,merge:o,objectEach:n,pick:a}=i;class h extends s{drawGraph(){this.areaPath=[],super.drawGraph.apply(this);let{areaPath:t,options:e}=this;[this,...this.zones].forEach((i,s)=>{let r={},o=i.fillColor||e.fillColor,n=i.area,a=n?"animate":"attr";n?(n.endX=this.preventGraphAnimation?null:t.xMap,n.animate({d:t})):(r.zIndex=0,(n=i.area=this.chart.renderer.path(t).addClass("highcharts-area"+(s?` highcharts-zone-area-${s-1} `:" ")+(s&&i.className||"")).add(this.group)).isArea=!0),this.chart.styledMode||(r.fill=o||i.color||this.color,r["fill-opacity"]=o?1:e.fillOpacity??.75,n.css({pointerEvents:this.stickyTracking?"none":"auto"})),n[a](r),n.startX=t.xMap,n.shiftUnit=e.step?2:1})}getGraphPath(t){let e,i,r;let o=s.prototype.getGraphPath,n=this.options,h=n.stacking,l=this.yAxis,d=[],c=[],p=this.index,u=l.stacking.stacks[this.stackKey],g=n.threshold,f=Math.round(l.getThreshold(n.threshold)),m=a(n.connectNulls,"percent"===h),x=function(i,s,r){let o=t[i],n=h&&u[o.x].points[p],a=o[r+"Null"]||0,m=o[r+"Cliff"]||0,x,y,b=!0;m||a?(x=(a?n[0]:n[1])+m,y=n[0]+m,b=!!a):!h&&t[s]&&t[s].isNull&&(x=y=g),void 0!==x&&(c.push({plotX:e,plotY:null===x?f:l.getThreshold(x),isNull:b,isCliff:!0}),d.push({plotX:e,plotY:null===y?f:l.getThreshold(y),doCurve:!1}))};t=t||this.points,h&&(t=this.getStackPoints(t));for(let s=0,o=t.length;s<o;++s)h||(t[s].leftCliff=t[s].rightCliff=t[s].leftNull=t[s].rightNull=void 0),i=t[s].isNull,e=a(t[s].rectPlotX,t[s].plotX),r=h?a(t[s].yBottom,f):f,i&&!m||(m||x(s,s-1,"left"),i&&!h&&m||(c.push(t[s]),d.push({x:s,plotX:e,plotY:r})),m||x(s,s+1,"right"));let y=o.call(this,c,!0,!0);d.reversed=!0;let b=o.call(this,d,!0,!0),v=b[0];v&&"M"===v[0]&&(b[0]=["L",v[1],v[2]]);let S=y.concat(b);S.length&&S.push(["Z"]);let C=o.call(this,c,!1,m);return this.chart.series.length>1&&h&&c.some(t=>t.isCliff)&&(S.hasStackedCliffs=C.hasStackedCliffs=!0),S.xMap=y.xMap,this.areaPath=S,C}getStackPoints(t){let e=this,i=[],s=[],r=this.xAxis,o=this.yAxis,h=o.stacking.stacks[this.stackKey],l={},d=o.series,c=d.length,p=o.options.reversedStacks?1:-1,u=d.indexOf(e);if(t=t||this.points,this.options.stacking){for(let e=0;e<t.length;e++)t[e].leftNull=t[e].rightNull=void 0,l[t[e].x]=t[e];n(h,function(t,e){null!==t.total&&s.push(e)}),s.sort(function(t,e){return t-e});let g=d.map(t=>t.visible);s.forEach(function(t,n){let f=0,m,x;if(l[t]&&!l[t].isNull)i.push(l[t]),[-1,1].forEach(function(i){let r=1===i?"rightNull":"leftNull",o=h[s[n+i]],a=0;if(o){let i=u;for(;i>=0&&i<c;){let s=d[i].index;!(m=o.points[s])&&(s===e.index?l[t][r]=!0:g[i]&&(x=h[t].points[s])&&(a-=x[1]-x[0])),i+=p}}l[t][1===i?"rightCliff":"leftCliff"]=a});else{let e=u;for(;e>=0&&e<c;){let i=d[e].index;if(m=h[t].points[i]){f=m[1];break}e+=p}f=a(f,0),f=o.translate(f,0,1,0,1),i.push({isNull:!0,plotX:r.translate(t,0,0,0,1),x:t,plotY:f,yBottom:f})}})}return i}}return h.defaultOptions=o(s.defaultOptions,t),r(h.prototype,{singleStacks:!1}),e.registerSeriesType("area",h),h}),i(e,"Series/Spline/SplineSeries.js",[e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e){let{line:i}=t.seriesTypes,{merge:s,pick:r}=e;class o extends i{getPointSpline(t,e,i){let s,o,n,a;let h=e.plotX||0,l=e.plotY||0,d=t[i-1],c=t[i+1];function p(t){return t&&!t.isNull&&!1!==t.doCurve&&!e.isCliff}if(p(d)&&p(c)){let t=d.plotX||0,i=d.plotY||0,r=c.plotX||0,p=c.plotY||0,u=0;s=(1.5*h+t)/2.5,o=(1.5*l+i)/2.5,n=(1.5*h+r)/2.5,a=(1.5*l+p)/2.5,n!==s&&(u=(a-o)*(n-h)/(n-s)+l-a),o+=u,a+=u,o>i&&o>l?(o=Math.max(i,l),a=2*l-o):o<i&&o<l&&(o=Math.min(i,l),a=2*l-o),a>p&&a>l?(a=Math.max(p,l),o=2*l-a):a<p&&a<l&&(a=Math.min(p,l),o=2*l-a),e.rightContX=n,e.rightContY=a,e.controlPoints={low:[s,o],high:[n,a]}}let u=["C",r(d.rightContX,d.plotX,0),r(d.rightContY,d.plotY,0),r(s,h,0),r(o,l,0),h,l];return d.rightContX=d.rightContY=void 0,u}}return o.defaultOptions=s(i.defaultOptions),t.registerSeriesType("spline",o),o}),i(e,"Series/AreaSpline/AreaSplineSeries.js",[e["Series/Spline/SplineSeries.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{area:s,area:{prototype:r}}=e.seriesTypes,{extend:o,merge:n}=i;class a extends t{}return a.defaultOptions=n(t.defaultOptions,s.defaultOptions),o(a.prototype,{getGraphPath:r.getGraphPath,getStackPoints:r.getStackPoints,drawGraph:r.drawGraph}),e.registerSeriesType("areaspline",a),a}),i(e,"Series/Column/ColumnSeriesDefaults.js",[],function(){return{borderRadius:3,centerInCategory:!1,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:"#cccccc",borderColor:"#000000"}},dataLabels:{align:void 0,verticalAlign:void 0,y:void 0},startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"}}),i(e,"Series/Column/ColumnSeries.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Color/Color.js"],e["Series/Column/ColumnSeriesDefaults.js"],e["Core/Globals.js"],e["Core/Series/Series.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o,n){let{animObject:a}=t,{parse:h}=e,{noop:l}=s,{clamp:d,crisp:c,defined:p,extend:u,fireEvent:g,isArray:f,isNumber:m,merge:x,pick:y,objectEach:b}=n;class v extends r{animate(t){let e,i;let s=this,r=this.yAxis,o=r.pos,n=r.reversed,h=s.options,{clipOffset:l,inverted:c}=this.chart,p={},g=c?"translateX":"translateY";t&&l?(p.scaleY=.001,i=d(r.toPixels(h.threshold),o,o+r.len),c?(i+=n?-Math.floor(l[0]):Math.ceil(l[2]),p.translateX=i-r.len):(i+=n?Math.ceil(l[0]):-Math.floor(l[2]),p.translateY=i),s.clipBox&&s.setClip(),s.group.attr(p)):(e=Number(s.group.attr(g)),s.group.animate({scaleY:1},u(a(s.options.animation),{step:function(t,i){s.group&&(p[g]=e+i.pos*(o-e),s.group.attr(p))}})))}init(t,e){super.init.apply(this,arguments);let i=this;(t=i.chart).hasRendered&&t.series.forEach(function(t){t.type===i.type&&(t.isDirty=!0)})}getColumnMetrics(){let t=this,e=t.options,i=t.xAxis,s=t.yAxis,r=i.options.reversedStacks,o=i.reversed&&!r||!i.reversed&&r,n={},a,h=0;!1===e.grouping?h=1:t.chart.series.forEach(function(e){let i;let r=e.yAxis,o=e.options;e.type===t.type&&e.reserveSpace()&&s.len===r.len&&s.pos===r.pos&&(o.stacking&&"group"!==o.stacking?(void 0===n[a=e.stackKey]&&(n[a]=h++),i=n[a]):!1!==o.grouping&&(i=h++),e.columnIndex=i)});let l=Math.min(Math.abs(i.transA)*(!i.brokenAxis?.hasBreaks&&i.ordinal?.slope||e.pointRange||i.closestPointRange||i.tickInterval||1),i.len),d=l*e.groupPadding,c=(l-2*d)/(h||1),p=Math.min(e.maxPointWidth||i.len,y(e.pointWidth,c*(1-2*e.pointPadding))),u=(t.columnIndex||0)+(o?1:0);return t.columnMetrics={width:p,offset:(c-p)/2+(d+u*c-l/2)*(o?-1:1),paddedWidth:c,columnCount:h},t.columnMetrics}crispCol(t,e,i,s){let r=this.borderWidth,o=this.chart.inverted;return s=c(e+s,r,o)-(e=c(e,r,o)),this.options.crisp&&(i=c(t+i,r)-(t=c(t,r))),{x:t,y:e,width:i,height:s}}adjustForMissingColumns(t,e,i,s){if(!i.isNull&&s.columnCount>1){let r=this.xAxis.series.filter(t=>t.visible).map(t=>t.index),o=0,n=0;b(this.xAxis.stacking?.stacks,t=>{if("number"==typeof i.x){let e=t[i.x.toString()];if(e&&f(e.points[this.index])){let t=Object.keys(e.points).filter(t=>!t.match(",")&&e.points[t]&&e.points[t].length>1).map(parseFloat).filter(t=>-1!==r.indexOf(t)).sort((t,e)=>e-t);o=t.indexOf(this.index),n=t.length}}}),o=this.xAxis.reversed?n-1-o:o;let a=(n-1)*s.paddedWidth+e;t=(i.plotX||0)+a/2-e-o*s.paddedWidth}return t}translate(){let t=this,e=t.chart,i=t.options,s=t.dense=t.closestPointRange*t.xAxis.transA<2,o=t.borderWidth=y(i.borderWidth,s?0:1),n=t.xAxis,a=t.yAxis,h=i.threshold,l=y(i.minPointLength,5),c=t.getColumnMetrics(),u=c.width,f=t.pointXOffset=c.offset,x=t.dataMin,b=t.dataMax,v=t.translatedThreshold=a.getThreshold(h),S=t.barW=Math.max(u,1+2*o);i.pointPadding&&(S=Math.ceil(S)),r.prototype.translate.apply(t),t.points.forEach(function(s){let r=y(s.yBottom,v),o=999+Math.abs(r),g=s.plotX||0,C=d(s.plotY,-o,a.len+o),k,M=Math.min(C,r),w=Math.max(C,r)-M,T=u,A=g+f,P=S;l&&Math.abs(w)<l&&(w=l,k=!a.reversed&&!s.negative||a.reversed&&s.negative,m(h)&&m(b)&&s.y===h&&b<=h&&(a.min||0)<h&&(x!==b||(a.max||0)<=h)&&(k=!k,s.negative=!s.negative),M=Math.abs(M-v)>l?r-l:v-(k?l:0)),p(s.options.pointWidth)&&(A-=Math.round(((T=P=Math.ceil(s.options.pointWidth))-u)/2)),i.centerInCategory&&!i.stacking&&(A=t.adjustForMissingColumns(A,T,s,c)),s.barX=A,s.pointWidth=T,s.tooltipPos=e.inverted?[d(a.len+a.pos-e.plotLeft-C,a.pos-e.plotLeft,a.len+a.pos-e.plotLeft),n.len+n.pos-e.plotTop-A-P/2,w]:[n.left-e.plotLeft+A+P/2,d(C+a.pos-e.plotTop,a.pos-e.plotTop,a.len+a.pos-e.plotTop),w],s.shapeType=t.pointClass.prototype.shapeType||"roundedRect",s.shapeArgs=t.crispCol(A,s.isNull?v:M,P,s.isNull?0:w)}),g(this,"afterColumnTranslate")}drawGraph(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")}pointAttribs(t,e){let i=this.options,s=this.pointAttrToOptions||{},r=s.stroke||"borderColor",o=s["stroke-width"]||"borderWidth",n,a,l,d=t&&t.color||this.color,c=t&&t[r]||i[r]||d,p=t&&t.options.dashStyle||i.dashStyle,u=t&&t[o]||i[o]||this[o]||0,g=y(t&&t.opacity,i.opacity,1);t&&this.zones.length&&(a=t.getZone(),d=t.options.color||a&&(a.color||t.nonZonedColor)||this.color,a&&(c=a.borderColor||c,p=a.dashStyle||p,u=a.borderWidth||u)),e&&t&&(l=(n=x(i.states[e],t.options.states&&t.options.states[e]||{})).brightness,d=n.color||void 0!==l&&h(d).brighten(n.brightness).get()||d,c=n[r]||c,u=n[o]||u,p=n.dashStyle||p,g=y(n.opacity,g));let f={fill:d,stroke:c,"stroke-width":u,opacity:g};return p&&(f.dashstyle=p),f}drawPoints(t=this.points){let e;let i=this,s=this.chart,r=i.options,o=s.renderer,n=r.animationLimit||250;t.forEach(function(t){let a=t.plotY,h=t.graphic,l=!!h,d=h&&s.pointCount<n?"animate":"attr";m(a)&&null!==t.y?(e=t.shapeArgs,h&&t.hasNewShapeType()&&(h=h.destroy()),i.enabledDataSorting&&(t.startXPos=i.xAxis.reversed?-(e&&e.width||0):i.xAxis.width),!h&&(t.graphic=h=o[t.shapeType](e).add(t.group||i.group),h&&i.enabledDataSorting&&s.hasRendered&&s.pointCount<n&&(h.attr({x:t.startXPos}),l=!0,d="animate")),h&&l&&h[d](x(e)),s.styledMode||h[d](i.pointAttribs(t,t.selected&&"select")).shadow(!1!==t.allowShadow&&r.shadow),h&&(h.addClass(t.getClassName(),!0),h.attr({visibility:t.visible?"inherit":"hidden"}))):h&&(t.graphic=h.destroy())})}drawTracker(t=this.points){let e;let i=this,s=i.chart,r=s.pointer,o=function(t){let e=r?.getPointFromEvent(t);r&&e&&i.options.enableMouseTracking&&(r.isDirectTouch=!0,e.onMouseOver(t))};t.forEach(function(t){e=f(t.dataLabels)?t.dataLabels:t.dataLabel?[t.dataLabel]:[],t.graphic&&(t.graphic.element.point=t),e.forEach(function(e){(e.div||e.element).point=t})}),i._hasTracking||(i.trackerGroups.forEach(function(t){i[t]&&(i[t].addClass("highcharts-tracker").on("mouseover",o).on("mouseout",function(t){r?.onTrackerMouseOut(t)}).on("touchstart",o),!s.styledMode&&i.options.cursor&&i[t].css({cursor:i.options.cursor}))}),i._hasTracking=!0),g(this,"afterDrawTracker")}remove(){let t=this,e=t.chart;e.hasRendered&&e.series.forEach(function(e){e.type===t.type&&(e.isDirty=!0)}),r.prototype.remove.apply(t,arguments)}}return v.defaultOptions=x(r.defaultOptions,i),u(v.prototype,{directTouch:!0,getSymbol:l,negStacks:!0,trackerGroups:["group","dataLabelsGroup"]}),o.registerSeriesType("column",v),v}),i(e,"Core/Series/DataLabel.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Templating.js"],e["Core/Utilities.js"]],function(t,e,i){var s;let{getDeferredAnimation:r}=t,{format:o}=e,{defined:n,extend:a,fireEvent:h,isArray:l,isString:d,merge:c,objectEach:p,pick:u,pInt:g,splat:f}=i;return function(t){function e(){return v(this).some(t=>t?.enabled)}function i(t,e,i,s,r){let{chart:o,enabledDataSorting:h}=this,l=this.isCartesian&&o.inverted,d=t.plotX,p=t.plotY,g=i.rotation||0,f=n(d)&&n(p)&&o.isInsidePlot(d,Math.round(p),{inverted:l,paneCoordinates:!0,series:this}),m=0===g&&"justify"===u(i.overflow,h?"none":"justify"),x=this.visible&&!1!==t.visible&&n(d)&&(t.series.forceDL||h&&!m||f||u(i.inside,!!this.options.stacking)&&s&&o.isInsidePlot(d,l?s.x+1:s.y+s.height-1,{inverted:l,paneCoordinates:!0,series:this})),y=t.pos();if(x&&y){var b;let n=e.getBBox(),d=e.getBBox(void 0,0),p={right:1,center:.5}[i.align||0]||0,v={bottom:1,middle:.5}[i.verticalAlign||0]||0;if(s=a({x:y[0],y:Math.round(y[1]),width:0,height:0},s||{}),"plotEdges"===i.alignTo&&this.isCartesian&&(s[l?"x":"y"]=0,s[l?"width":"height"]=this.yAxis?.len||0),a(i,{width:n.width,height:n.height}),b=s,h&&this.xAxis&&!m&&this.setDataLabelStartPos(t,e,r,f,b),e.align(c(i,{width:d.width,height:d.height}),!1,s,!1),e.alignAttr.x+=p*(d.width-n.width),e.alignAttr.y+=v*(d.height-n.height),e[e.placed?"animate":"attr"]({x:e.alignAttr.x+(n.width-d.width)/2,y:e.alignAttr.y+(n.height-d.height)/2,rotationOriginX:(e.width||0)/2,rotationOriginY:(e.height||0)/2}),m&&s.height>=0)this.justifyDataLabel(e,i,e.alignAttr,n,s,r);else if(u(i.crop,!0)){let{x:t,y:i}=e.alignAttr;x=o.isInsidePlot(t,i,{paneCoordinates:!0,series:this})&&o.isInsidePlot(t+n.width-1,i+n.height-1,{paneCoordinates:!0,series:this})}i.shape&&!g&&e[r?"attr":"animate"]({anchorX:y[0],anchorY:y[1]})}r&&h&&(e.placed=!1),x||h&&!m?(e.show(),e.placed=!0):(e.hide(),e.placed=!1)}function s(){return this.plotGroup("dataLabelsGroup","data-labels",this.hasRendered?"inherit":"hidden",this.options.dataLabels.zIndex||6)}function m(t){let e=this.hasRendered||0,i=this.initDataLabelsGroup().attr({opacity:+e});return!e&&i&&(this.visible&&i.show(),this.options.animation?i.animate({opacity:1},t):i.attr({opacity:1})),i}function x(t){let e;t=t||this.points;let i=this,s=i.chart,a=i.options,l=s.renderer,{backgroundColor:c,plotBackgroundColor:m}=s.options.chart,x=l.getContrast(d(m)&&m||d(c)&&c||"#000000"),y=v(i),{animation:S,defer:C}=y[0],k=C?r(s,S,i):{defer:0,duration:0};h(this,"drawDataLabels"),i.hasDataLabels?.()&&(e=this.initDataLabels(k),t.forEach(t=>{let r=t.dataLabels||[];f(b(y,t.dlOptions||t.options?.dataLabels)).forEach((c,f)=>{let m=c.enabled&&(t.visible||t.dataLabelOnHidden)&&(!t.isNull||t.dataLabelOnNull)&&function(t,e){let i=e.filter;if(i){let e=i.operator,s=t[i.property],r=i.value;return">"===e&&s>r||"<"===e&&s<r||">="===e&&s>=r||"<="===e&&s<=r||"=="===e&&s==r||"==="===e&&s===r||"!="===e&&s!=r||"!=="===e&&s!==r}return!0}(t,c),{backgroundColor:y,borderColor:b,distance:v,style:S={}}=c,C,k,M,w,T={},A=r[f],P=!A,L;m&&(k=u(c[t.formatPrefix+"Format"],c.format),C=t.getLabelConfig(),M=n(k)?o(k,C,s):(c[t.formatPrefix+"Formatter"]||c.formatter).call(C,c),w=c.rotation,!s.styledMode&&(S.color=u(c.color,S.color,d(i.color)?i.color:void 0,"#000000"),"contrast"===S.color?("none"!==y&&(L=y),t.contrastColor=l.getContrast("auto"!==L&&L||t.color||i.color),S.color=L||!n(v)&&c.inside||0>g(v||0)||a.stacking?t.contrastColor:x):delete t.contrastColor,a.cursor&&(S.cursor=a.cursor)),T={r:c.borderRadius||0,rotation:w,padding:c.padding,zIndex:1},s.styledMode||(T.fill="auto"===y?t.color:y,T.stroke="auto"===b?t.color:b,T["stroke-width"]=c.borderWidth),p(T,(t,e)=>{void 0===t&&delete T[e]})),!A||m&&n(M)&&!!A.div==!!c.useHTML&&(A.rotation&&c.rotation||A.rotation===c.rotation)||(A=void 0,P=!0),m&&n(M)&&(A?T.text=M:(A=l.label(M,0,0,c.shape,void 0,void 0,c.useHTML,void 0,"data-label")).addClass(" highcharts-data-label-color-"+t.colorIndex+" "+(c.className||"")+(c.useHTML?" highcharts-tracker":"")),A&&(A.options=c,A.attr(T),s.styledMode?S.width&&A.css({width:S.width,textOverflow:S.textOverflow}):A.css(S).shadow(c.shadow),h(A,"beforeAddingDataLabel",{labelOptions:c,point:t}),A.added||A.add(e),i.alignDataLabel(t,A,c,void 0,P),A.isActive=!0,r[f]&&r[f]!==A&&r[f].destroy(),r[f]=A))});let c=r.length;for(;c--;)r[c]&&r[c].isActive?r[c].isActive=!1:(r[c]?.destroy(),r.splice(c,1));t.dataLabel=r[0],t.dataLabels=r})),h(this,"afterDrawDataLabels")}function y(t,e,i,s,r,o){let n=this.chart,a=e.align,h=e.verticalAlign,l=t.box?0:t.padding||0,d=n.inverted?this.yAxis:this.xAxis,c=d?d.left-n.plotLeft:0,p=n.inverted?this.xAxis:this.yAxis,u=p?p.top-n.plotTop:0,{x:g=0,y:f=0}=e,m,x;return(m=(i.x||0)+l+c)<0&&("right"===a&&g>=0?(e.align="left",e.inside=!0):g-=m,x=!0),(m=(i.x||0)+s.width-l+c)>n.plotWidth&&("left"===a&&g<=0?(e.align="right",e.inside=!0):g+=n.plotWidth-m,x=!0),(m=i.y+l+u)<0&&("bottom"===h&&f>=0?(e.verticalAlign="top",e.inside=!0):f-=m,x=!0),(m=(i.y||0)+s.height-l+u)>n.plotHeight&&("top"===h&&f<=0?(e.verticalAlign="bottom",e.inside=!0):f+=n.plotHeight-m,x=!0),x&&(e.x=g,e.y=f,t.placed=!o,t.align(e,void 0,r)),x}function b(t,e){let i=[],s;if(l(t)&&!l(e))i=t.map(function(t){return c(t,e)});else if(l(e)&&!l(t))i=e.map(function(e){return c(t,e)});else if(l(t)||l(e)){if(l(t)&&l(e))for(s=Math.max(t.length,e.length);s--;)i[s]=c(t[s],e[s])}else i=c(t,e);return i}function v(t){let e=t.chart.options.plotOptions;return f(b(b(e?.series?.dataLabels,e?.[t.type]?.dataLabels),t.options.dataLabels))}function S(t,e,i,s,r){let o=this.chart,n=o.inverted,a=this.xAxis,h=a.reversed,l=((n?e.height:e.width)||0)/2,d=t.pointWidth,c=d?d/2:0;e.startXPos=n?r.x:h?-l-c:a.width-l+c,e.startYPos=n?h?this.yAxis.height-l+c:-l-c:r.y,s?"hidden"===e.visibility&&(e.show(),e.attr({opacity:0}).animate({opacity:1})):e.attr({opacity:1}).animate({opacity:0},void 0,e.hide),o.hasRendered&&(i&&e.attr({x:e.startXPos,y:e.startYPos}),e.placed=!0)}t.compose=function(t){let r=t.prototype;r.initDataLabels||(r.initDataLabels=m,r.initDataLabelsGroup=s,r.alignDataLabel=i,r.drawDataLabels=x,r.justifyDataLabel=y,r.setDataLabelStartPos=S,r.hasDataLabels=e)}}(s||(s={})),s}),i(e,"Series/Column/ColumnDataLabel.js",[e["Core/Series/DataLabel.js"],e["Core/Globals.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s){var r;let{composed:o}=e,{series:n}=i,{merge:a,pick:h,pushUnique:l}=s;return function(e){function i(t,e,i,s,r){let o=this.chart.inverted,l=t.series,d=(l.xAxis?l.xAxis.len:this.chart.plotSizeX)||0,c=(l.yAxis?l.yAxis.len:this.chart.plotSizeY)||0,p=t.dlBox||t.shapeArgs,u=h(t.below,t.plotY>h(this.translatedThreshold,c)),g=h(i.inside,!!this.options.stacking);if(p){if(s=a(p),!("allow"===i.overflow&&!1===i.crop)){s.y<0&&(s.height+=s.y,s.y=0);let t=s.y+s.height-c;t>0&&t<s.height-1&&(s.height-=t)}o&&(s={x:c-s.y-s.height,y:d-s.x-s.width,width:s.height,height:s.width}),g||(o?(s.x+=u?0:s.width,s.width=0):(s.y+=u?s.height:0,s.height=0))}i.align=h(i.align,!o||g?"center":u?"right":"left"),i.verticalAlign=h(i.verticalAlign,o||g?"middle":u?"top":"bottom"),n.prototype.alignDataLabel.call(this,t,e,i,s,r),i.inside&&t.contrastColor&&e.css({color:t.contrastColor})}e.compose=function(e){t.compose(n),l(o,"ColumnDataLabel")&&(e.prototype.alignDataLabel=i)}}(r||(r={})),r}),i(e,"Series/Bar/BarSeries.js",[e["Series/Column/ColumnSeries.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{extend:s,merge:r}=i;class o extends t{}return o.defaultOptions=r(t.defaultOptions,{}),s(o.prototype,{inverted:!0}),e.registerSeriesType("bar",o),o}),i(e,"Series/Scatter/ScatterSeriesDefaults.js",[],function(){return{lineWidth:0,findNearestPointBy:"xy",jitter:{x:0,y:0},marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">●</span> <span style="font-size: 0.8em"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}}}),i(e,"Series/Scatter/ScatterSeries.js",[e["Series/Scatter/ScatterSeriesDefaults.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i){let{column:s,line:r}=e.seriesTypes,{addEvent:o,extend:n,merge:a}=i;class h extends r{applyJitter(){let t=this,e=this.options.jitter,i=this.points.length;e&&this.points.forEach(function(s,r){["x","y"].forEach(function(o,n){if(e[o]&&!s.isNull){let a=`plot${o.toUpperCase()}`,h=t[`${o}Axis`],l=e[o]*h.transA;if(h&&!h.logarithmic){let t=Math.max(0,(s[a]||0)-l),e=Math.min(h.len,(s[a]||0)+l);s[a]=t+(e-t)*function(t){let e=1e4*Math.sin(t);return e-Math.floor(e)}(r+n*i),"x"===o&&(s.clientX=s.plotX)}}})})}drawGraph(){this.options.lineWidth?super.drawGraph():this.graph&&(this.graph=this.graph.destroy())}}return h.defaultOptions=a(r.defaultOptions,t),n(h.prototype,{drawTracker:s.prototype.drawTracker,sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"]}),o(h,"afterTranslate",function(){this.applyJitter()}),e.registerSeriesType("scatter",h),h}),i(e,"Series/CenteredUtilities.js",[e["Core/Globals.js"],e["Core/Series/Series.js"],e["Core/Utilities.js"]],function(t,e,i){var s,r;let{deg2rad:o}=t,{fireEvent:n,isNumber:a,pick:h,relativeLength:l}=i;return(r=s||(s={})).getCenter=function(){let t=this.options,i=this.chart,s=2*(t.slicedOffset||0),r=i.plotWidth-2*s,o=i.plotHeight-2*s,d=t.center,c=Math.min(r,o),p=t.thickness,u,g=t.size,f=t.innerSize||0,m,x;"string"==typeof g&&(g=parseFloat(g)),"string"==typeof f&&(f=parseFloat(f));let y=[h(d[0],"50%"),h(d[1],"50%"),h(g&&g<0?void 0:t.size,"100%"),h(f&&f<0?void 0:t.innerSize||0,"0%")];for(!i.angular||this instanceof e||(y[3]=0),m=0;m<4;++m)x=y[m],u=m<2||2===m&&/%$/.test(x),y[m]=l(x,[r,o,c,y[2]][m])+(u?s:0);return y[3]>y[2]&&(y[3]=y[2]),a(p)&&2*p<y[2]&&p>0&&(y[3]=y[2]-2*p),n(this,"afterGetCenter",{positions:y}),y},r.getStartAndEndRadians=function(t,e){let i=a(t)?t:0,s=a(e)&&e>i&&e-i<360?e:i+360;return{start:o*(i+-90),end:o*(s+-90)}},s}),i(e,"Series/Pie/PiePoint.js",[e["Core/Animation/AnimationUtilities.js"],e["Core/Series/Point.js"],e["Core/Utilities.js"]],function(t,e,i){let{setAnimation:s}=t,{addEvent:r,defined:o,extend:n,isNumber:a,pick:h,relativeLength:l}=i;class d extends e{getConnectorPath(t){let e=t.dataLabelPosition,i=t.options||{},s=i.connectorShape,r=this.connectorShapes[s]||s;return e&&r.call(this,{...e.computed,alignment:e.alignment},e.connectorPosition,i)||[]}getTranslate(){return this.sliced&&this.slicedTranslation||{translateX:0,translateY:0}}haloPath(t){let e=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.x,e.y,e.r+t,e.r+t,{innerR:e.r-1,start:e.start,end:e.end,borderRadius:e.borderRadius})}constructor(t,e,i){super(t,e,i),this.half=0,this.name??(this.name="Slice");let s=t=>{this.slice("select"===t.type)};r(this,"select",s),r(this,"unselect",s)}isValid(){return a(this.y)&&this.y>=0}setVisible(t,e=!0){t!==this.visible&&this.update({visible:t??!this.visible},e,void 0,!1)}slice(t,e,i){let r=this.series;s(i,r.chart),e=h(e,!0),this.sliced=this.options.sliced=t=o(t)?t:!this.sliced,r.options.data[r.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate())}}return n(d.prototype,{connectorShapes:{fixedOffset:function(t,e,i){let s=e.breakAt,r=e.touchingSliceAt,o=i.softConnector?["C",t.x+("left"===t.alignment?-5:5),t.y,2*s.x-r.x,2*s.y-r.y,s.x,s.y]:["L",s.x,s.y];return[["M",t.x,t.y],o,["L",r.x,r.y]]},straight:function(t,e){let i=e.touchingSliceAt;return[["M",t.x,t.y],["L",i.x,i.y]]},crookedLine:function(t,e,i){let{breakAt:s,touchingSliceAt:r}=e,{series:o}=this,[n,a,h]=o.center,d=h/2,{plotLeft:c,plotWidth:p}=o.chart,u="left"===t.alignment,{x:g,y:f}=t,m=s.x;if(i.crookDistance){let t=l(i.crookDistance,1);m=u?n+d+(p+c-n-d)*(1-t):c+(n-d)*t}else m=n+(a-f)*Math.tan((this.angle||0)-Math.PI/2);let x=[["M",g,f]];return(u?m<=g&&m>=s.x:m>=g&&m<=s.x)&&x.push(["L",m,f]),x.push(["L",s.x,s.y],["L",r.x,r.y]),x}}}),d}),i(e,"Series/Pie/PieSeriesDefaults.js",[],function(){return{borderRadius:3,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{connectorPadding:5,connectorShape:"crookedLine",crookDistance:void 0,distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}}}),i(e,"Series/Pie/PieSeries.js",[e["Series/CenteredUtilities.js"],e["Series/Column/ColumnSeries.js"],e["Core/Globals.js"],e["Series/Pie/PiePoint.js"],e["Series/Pie/PieSeriesDefaults.js"],e["Core/Series/Series.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Renderer/SVG/Symbols.js"],e["Core/Utilities.js"]],function(t,e,i,s,r,o,n,a,h){let{getStartAndEndRadians:l}=t,{noop:d}=i,{clamp:c,extend:p,fireEvent:u,merge:g,pick:f}=h;class m extends o{animate(t){let e=this,i=e.points,s=e.startAngleRad;t||i.forEach(function(t){let i=t.graphic,r=t.shapeArgs;i&&r&&(i.attr({r:f(t.startR,e.center&&e.center[3]/2),start:s,end:s}),i.animate({r:r.r,start:r.start,end:r.end},e.options.animation))})}drawEmpty(){let t,e;let i=this.startAngleRad,s=this.endAngleRad,r=this.options;0===this.total&&this.center?(t=this.center[0],e=this.center[1],this.graph||(this.graph=this.chart.renderer.arc(t,e,this.center[1]/2,0,i,s).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:a.arc(t,e,this.center[2]/2,0,{start:i,end:s,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":r.borderWidth,fill:r.fillColor||"none",stroke:r.color||"#cccccc"})):this.graph&&(this.graph=this.graph.destroy())}drawPoints(){let t=this.chart.renderer;this.points.forEach(function(e){e.graphic&&e.hasNewShapeType()&&(e.graphic=e.graphic.destroy()),e.graphic||(e.graphic=t[e.shapeType](e.shapeArgs).add(e.series.group),e.delayedRendering=!0)})}generatePoints(){super.generatePoints(),this.updateTotals()}getX(t,e,i,s){let r=this.center,o=this.radii?this.radii[i.index]||0:r[2]/2,n=s.dataLabelPosition,a=n?.distance||0,h=Math.asin(c((t-r[1])/(o+a),-1,1));return r[0]+Math.cos(h)*(o+a)*(e?-1:1)+(a>0?(e?-1:1)*(s.padding||0):0)}hasData(){return!!this.processedXData.length}redrawPoints(){let t,e,i,s;let r=this,o=r.chart;this.drawEmpty(),r.group&&!o.styledMode&&r.group.shadow(r.options.shadow),r.points.forEach(function(n){let a={};e=n.graphic,!n.isNull&&e?(s=n.shapeArgs,t=n.getTranslate(),o.styledMode||(i=r.pointAttribs(n,n.selected&&"select")),n.delayedRendering?(e.setRadialReference(r.center).attr(s).attr(t),o.styledMode||e.attr(i).attr({"stroke-linejoin":"round"}),n.delayedRendering=!1):(e.setRadialReference(r.center),o.styledMode||g(!0,a,i),g(!0,a,s,t),e.animate(a)),e.attr({visibility:n.visible?"inherit":"hidden"}),e.addClass(n.getClassName(),!0)):e&&(n.graphic=e.destroy())})}sortByAngle(t,e){t.sort(function(t,i){return void 0!==t.angle&&(i.angle-t.angle)*e})}translate(t){u(this,"translate"),this.generatePoints();let e=this.options,i=e.slicedOffset,s=l(e.startAngle,e.endAngle),r=this.startAngleRad=s.start,o=(this.endAngleRad=s.end)-r,n=this.points,a=e.ignoreHiddenPoint,h=n.length,d,c,p,g,f,m,x,y=0;for(t||(this.center=t=this.getCenter()),m=0;m<h;m++){x=n[m],d=r+y*o,x.isValid()&&(!a||x.visible)&&(y+=x.percentage/100),c=r+y*o;let e={x:t[0],y:t[1],r:t[2]/2,innerR:t[3]/2,start:Math.round(1e3*d)/1e3,end:Math.round(1e3*c)/1e3};x.shapeType="arc",x.shapeArgs=e,(p=(c+d)/2)>1.5*Math.PI?p-=2*Math.PI:p<-Math.PI/2&&(p+=2*Math.PI),x.slicedTranslation={translateX:Math.round(Math.cos(p)*i),translateY:Math.round(Math.sin(p)*i)},g=Math.cos(p)*t[2]/2,f=Math.sin(p)*t[2]/2,x.tooltipPos=[t[0]+.7*g,t[1]+.7*f],x.half=p<-Math.PI/2||p>Math.PI/2?1:0,x.angle=p}u(this,"afterTranslate")}updateTotals(){let t=this.points,e=t.length,i=this.options.ignoreHiddenPoint,s,r,o=0;for(s=0;s<e;s++)(r=t[s]).isValid()&&(!i||r.visible)&&(o+=r.y);for(s=0,this.total=o;s<e;s++)(r=t[s]).percentage=o>0&&(r.visible||!i)?r.y/o*100:0,r.total=o}}return m.defaultOptions=g(o.defaultOptions,r),p(m.prototype,{axisTypes:[],directTouch:!0,drawGraph:void 0,drawTracker:e.prototype.drawTracker,getCenter:t.getCenter,getSymbol:d,invertible:!1,isCartesian:!1,noSharedTooltip:!0,pointAttribs:e.prototype.pointAttribs,pointClass:s,requireSorting:!1,searchPoint:d,trackerGroups:["group","dataLabelsGroup"]}),n.registerSeriesType("pie",m),m}),i(e,"Series/Pie/PieDataLabel.js",[e["Core/Series/DataLabel.js"],e["Core/Globals.js"],e["Core/Renderer/RendererUtilities.js"],e["Core/Series/SeriesRegistry.js"],e["Core/Utilities.js"]],function(t,e,i,s,r){var o;let{composed:n,noop:a}=e,{distribute:h}=i,{series:l}=s,{arrayMax:d,clamp:c,defined:p,pick:u,pushUnique:g,relativeLength:f}=r;return function(e){let i={radialDistributionY:function(t,e){return(e.dataLabelPosition?.top||0)+t.distributeBox.pos},radialDistributionX:function(t,e,i,s,r){let o=r.dataLabelPosition;return t.getX(i<(o?.top||0)+2||i>(o?.bottom||0)-2?s:i,e.half,e,r)},justify:function(t,e,i,s){return s[0]+(t.half?-1:1)*(i+(e.dataLabelPosition?.distance||0))},alignToPlotEdges:function(t,e,i,s){let r=t.getBBox().width;return e?r+s:i-r-s},alignToConnectors:function(t,e,i,s){let r=0,o;return t.forEach(function(t){(o=t.dataLabel.getBBox().width)>r&&(r=o)}),e?r+s:i-r-s}};function s(t,e){let{center:i,options:s}=this,r=i[2]/2,o=t.angle||0,n=Math.cos(o),a=Math.sin(o),h=i[0]+n*r,l=i[1]+a*r,d=Math.min((s.slicedOffset||0)+(s.borderWidth||0),e/5);return{natural:{x:h+n*e,y:l+a*e},computed:{},alignment:e<0?"center":t.half?"right":"left",connectorPosition:{breakAt:{x:h+n*d,y:l+a*d},touchingSliceAt:{x:h,y:l}},distance:e}}function r(){let t=this,e=t.points,i=t.chart,s=i.plotWidth,r=i.plotHeight,o=i.plotLeft,n=Math.round(i.chartWidth/3),a=t.center,c=a[2]/2,g=a[1],m=[[],[]],x=[0,0,0,0],y=t.dataLabelPositioners,b,v,S,C=0;t.visible&&t.hasDataLabels?.()&&(e.forEach(t=>{(t.dataLabels||[]).forEach(t=>{t.shortened&&(t.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),t.shortened=!1)})}),l.prototype.drawDataLabels.apply(t),e.forEach(t=>{(t.dataLabels||[]).forEach((e,i)=>{let s=a[2]/2,r=e.options,o=f(r?.distance||0,s);0===i&&m[t.half].push(t),!p(r?.style?.width)&&e.getBBox().width>n&&(e.css({width:Math.round(.7*n)+"px"}),e.shortened=!0),e.dataLabelPosition=this.getDataLabelPosition(t,o),C=Math.max(C,o)})}),m.forEach((e,n)=>{let l=e.length,d=[],f,m,b=0,k;l&&(t.sortByAngle(e,n-.5),C>0&&(f=Math.max(0,g-c-C),m=Math.min(g+c+C,i.plotHeight),e.forEach(t=>{(t.dataLabels||[]).forEach(e=>{let s=e.dataLabelPosition;s&&s.distance>0&&(s.top=Math.max(0,g-c-s.distance),s.bottom=Math.min(g+c+s.distance,i.plotHeight),b=e.getBBox().height||21,e.lineHeight=i.renderer.fontMetrics(e.text||e).h+2*e.padding,t.distributeBox={target:(e.dataLabelPosition?.natural.y||0)-s.top+e.lineHeight/2,size:b,rank:t.y},d.push(t.distributeBox))})}),h(d,k=m+b-f,k/5)),e.forEach(i=>{(i.dataLabels||[]).forEach(h=>{let l=h.options||{},g=i.distributeBox,f=h.dataLabelPosition,m=f?.natural.y||0,b=l.connectorPadding||0,C=h.lineHeight||21,k=(C-h.getBBox().height)/2,M=0,w=m,T="inherit";if(f){if(d&&p(g)&&f.distance>0&&(void 0===g.pos?T="hidden":(S=g.size,w=y.radialDistributionY(i,h))),l.justify)M=y.justify(i,h,c,a);else switch(l.alignTo){case"connectors":M=y.alignToConnectors(e,n,s,o);break;case"plotEdges":M=y.alignToPlotEdges(h,n,s,o);break;default:M=y.radialDistributionX(t,i,w-k,m,h)}if(f.attribs={visibility:T,align:f.alignment},f.posAttribs={x:M+(l.x||0)+(({left:b,right:-b})[f.alignment]||0),y:w+(l.y||0)-C/2},f.computed.x=M,f.computed.y=w-k,u(l.crop,!0)){let t;M-(v=h.getBBox().width)<b&&1===n?(t=Math.round(v-M+b),x[3]=Math.max(t,x[3])):M+v>s-b&&0===n&&(t=Math.round(M+v-s+b),x[1]=Math.max(t,x[1])),w-S/2<0?x[0]=Math.max(Math.round(-w+S/2),x[0]):w+S/2>r&&(x[2]=Math.max(Math.round(w+S/2-r),x[2])),f.sideOverflow=t}}})}))}),(0===d(x)||this.verifyDataLabelOverflow(x))&&(this.placeDataLabels(),this.points.forEach(e=>{(e.dataLabels||[]).forEach(s=>{let{connectorColor:r,connectorWidth:o=1}=s.options||{},n=s.dataLabelPosition;if(o){let a;b=s.connector,n&&n.distance>0?(a=!b,b||(s.connector=b=i.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+e.colorIndex+(e.className?" "+e.className:"")).add(t.dataLabelsGroup)),i.styledMode||b.attr({"stroke-width":o,stroke:r||e.color||"#666666"}),b[a?"attr":"animate"]({d:e.getConnectorPath(s)}),b.attr({visibility:n.attribs?.visibility})):b&&(s.connector=b.destroy())}})})))}function o(){this.points.forEach(t=>{(t.dataLabels||[]).forEach(t=>{let e=t.dataLabelPosition;e?(e.sideOverflow&&(t.css({width:Math.max(t.getBBox().width-e.sideOverflow,0)+"px",textOverflow:(t.options?.style||{}).textOverflow||"ellipsis"}),t.shortened=!0),t.attr(e.attribs),t[t.moved?"animate":"attr"](e.posAttribs),t.moved=!0):t&&t.attr({y:-9999})}),delete t.distributeBox},this)}function m(t){let e=this.center,i=this.options,s=i.center,r=i.minSize||80,o=r,n=null!==i.size;return!n&&(null!==s[0]?o=Math.max(e[2]-Math.max(t[1],t[3]),r):(o=Math.max(e[2]-t[1]-t[3],r),e[0]+=(t[3]-t[1])/2),null!==s[1]?o=c(o,r,e[2]-Math.max(t[0],t[2])):(o=c(o,r,e[2]-t[0]-t[2]),e[1]+=(t[0]-t[2])/2),o<e[2]?(e[2]=o,e[3]=Math.min(i.thickness?Math.max(0,o-2*i.thickness):Math.max(0,f(i.innerSize||0,o)),o),this.translate(e),this.drawDataLabels&&this.drawDataLabels()):n=!0),n}e.compose=function(e){if(t.compose(l),g(n,"PieDataLabel")){let t=e.prototype;t.dataLabelPositioners=i,t.alignDataLabel=a,t.drawDataLabels=r,t.getDataLabelPosition=s,t.placeDataLabels=o,t.verifyDataLabelOverflow=m}}}(o||(o={})),o}),i(e,"Core/Geometry/GeometryUtilities.js",[],function(){var t,e;return(e=t||(t={})).getCenterOfPoints=function(t){let e=t.reduce((t,e)=>(t.x+=e.x,t.y+=e.y,t),{x:0,y:0});return{x:e.x/t.length,y:e.y/t.length}},e.getDistanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},e.getAngleBetweenPoints=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)},e.pointInPolygon=function({x:t,y:e},i){let s=i.length,r,o,n=!1;for(r=0,o=s-1;r<s;o=r++){let[s,a]=i[r],[h,l]=i[o];a>e!=l>e&&t<(h-s)*(e-a)/(l-a)+s&&(n=!n)}return n},t}),i(e,"Extensions/OverlappingDataLabels.js",[e["Core/Geometry/GeometryUtilities.js"],e["Core/Utilities.js"]],function(t,e){let{pointInPolygon:i}=t,{addEvent:s,fireEvent:r,objectEach:o,pick:n}=e;function a(t){let e=t.length,s=(t,e)=>!(e.x>=t.x+t.width||e.x+e.width<=t.x||e.y>=t.y+t.height||e.y+e.height<=t.y),o=(t,e)=>{for(let s of t)if(i({x:s[0],y:s[1]},e))return!0;return!1},n,a,l,d,c,p=!1;for(let i=0;i<e;i++)(n=t[i])&&(n.oldOpacity=n.opacity,n.newOpacity=1,n.absoluteBox=function(t){if(t&&(!t.alignAttr||t.placed)){let e=t.box?0:t.padding||0,i=t.alignAttr||{x:t.attr("x"),y:t.attr("y")},s=t.getBBox();return t.width=s.width,t.height=s.height,{x:i.x+(t.parentGroup?.translateX||0)+e,y:i.y+(t.parentGroup?.translateY||0)+e,width:(t.width||0)-2*e,height:(t.height||0)-2*e,polygon:s?.polygon}}}(n));t.sort((t,e)=>(e.labelrank||0)-(t.labelrank||0));for(let i=0;i<e;++i){d=(a=t[i])&&a.absoluteBox;let r=d?.polygon;for(let n=i+1;n<e;++n){c=(l=t[n])&&l.absoluteBox;let e=!1;if(d&&c&&a!==l&&0!==a.newOpacity&&0!==l.newOpacity&&"hidden"!==a.visibility&&"hidden"!==l.visibility){let t=c.polygon;if(r&&t&&r!==t?o(r,t)&&(e=!0):s(d,c)&&(e=!0),e){let t=a.labelrank<l.labelrank?a:l,e=t.text;t.newOpacity=0,e?.element.querySelector("textPath")&&e.hide()}}}}for(let e of t)h(e,this)&&(p=!0);p&&r(this,"afterHideAllOverlappingLabels")}function h(t,e){let i,s,o=!1;return t&&(s=t.newOpacity,t.oldOpacity!==s&&(t.hasClass("highcharts-data-label")?(t[s?"removeClass":"addClass"]("highcharts-data-label-hidden"),i=function(){e.styledMode||t.css({pointerEvents:s?"auto":"none"})},o=!0,t[t.isOld?"animate":"attr"]({opacity:s},void 0,i),r(e,"afterHideOverlappingLabel")):t.attr({opacity:s})),t.isOld=!0),o}function l(){let t=this,e=[];for(let i of t.labelCollectors||[])e=e.concat(i());for(let i of t.yAxis||[])i.stacking&&i.options.stackLabels&&!i.options.stackLabels.allowOverlap&&o(i.stacking.stacks,t=>{o(t,t=>{t.label&&e.push(t.label)})});for(let i of t.series||[])if(i.visible&&i.hasDataLabels?.()){let s=i=>{for(let s of i)s.visible&&(s.dataLabels||[]).forEach(i=>{let r=i.options||{};i.labelrank=n(r.labelrank,s.labelrank,s.shapeArgs?.height),r.allowOverlap??Number(r.distance)>0?(i.oldOpacity=i.opacity,i.newOpacity=1,h(i,t)):e.push(i)})};s(i.nodes||[]),s(i.points)}this.hideOverlappingLabels(e)}return{compose:function(t){let e=t.prototype;e.hideOverlappingLabels||(e.hideOverlappingLabels=a,s(t,"render",l))}}}),i(e,"Extensions/BorderRadius.js",[e["Core/Defaults.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e,i){let{defaultOptions:s}=t,{noop:r}=e,{addEvent:o,extend:n,isObject:a,merge:h,relativeLength:l}=i,d={radius:0,scope:"stack",where:void 0},c=r,p=r;function u(t,e,i,s,r={}){let o=c(t,e,i,s,r),{innerR:n=0,r:a=i,start:h=0,end:d=0}=r;if(r.open||!r.borderRadius)return o;let p=d-h,g=Math.sin(p/2),f=Math.max(Math.min(l(r.borderRadius||0,a-n),(a-n)/2,a*g/(1+g)),0),m=Math.min(f,p/Math.PI*2*n),x=o.length-1;for(;x--;)!function(t,e,i){let s,r,o;let n=t[e],a=t[e+1];if("Z"===a[0]&&(a=t[0]),("M"===n[0]||"L"===n[0])&&"A"===a[0]?(s=n,r=a,o=!0):"A"===n[0]&&("M"===a[0]||"L"===a[0])&&(s=a,r=n),s&&r&&r.params){let n=r[1],a=r[5],h=r.params,{start:l,end:d,cx:c,cy:p}=h,u=a?n-i:n+i,g=u?Math.asin(i/u):0,f=a?g:-g,m=Math.cos(g)*u;o?(h.start=l+f,s[1]=c+m*Math.cos(l),s[2]=p+m*Math.sin(l),t.splice(e+1,0,["A",i,i,0,0,1,c+n*Math.cos(h.start),p+n*Math.sin(h.start)])):(h.end=d-f,r[6]=c+n*Math.cos(h.end),r[7]=p+n*Math.sin(h.end),t.splice(e+1,0,["A",i,i,0,0,1,c+m*Math.cos(d),p+m*Math.sin(d)])),r[4]=Math.abs(h.end-h.start)<Math.PI?0:1}}(o,x,x>1?m:f);return o}function g(){if(this.options.borderRadius&&!(this.chart.is3d&&this.chart.is3d())){let{options:t,yAxis:e}=this,i="percent"===t.stacking,r=s.plotOptions?.[this.type]?.borderRadius,o=f(t.borderRadius,a(r)?r:{}),h=e.options.reversed;for(let s of this.points){let{shapeArgs:r}=s;if("roundedRect"===s.shapeType&&r){let{width:a=0,height:d=0,y:c=0}=r,p=c,u=d;if("stack"===o.scope&&s.stackTotal){let r=e.translate(i?100:s.stackTotal,!1,!0,!1,!0),o=e.translate(t.threshold||0,!1,!0,!1,!0),n=this.crispCol(0,Math.min(r,o),0,Math.abs(r-o));p=n.y,u=n.height}let g=(s.negative?-1:1)*(h?-1:1)==-1,f=o.where;!f&&this.is("waterfall")&&Math.abs((s.yBottom||0)-(this.translatedThreshold||0))>this.borderWidth&&(f="all"),f||(f="end");let m=Math.min(l(o.radius,a),a/2,"all"===f?d/2:1/0)||0;"end"===f&&(g&&(p-=m),u+=m),n(r,{brBoxHeight:u,brBoxY:p,r:m})}}}}function f(t,e){return a(t)||(t={radius:t||0}),h(d,e,t)}function m(){let t=f(this.options.borderRadius);for(let e of this.points){let i=e.shapeArgs;i&&(i.borderRadius=l(t.radius,(i.r||0)-(i.innerR||0)))}}function x(t,e,i,s,r={}){let o=p(t,e,i,s,r),{r:n=0,brBoxHeight:a=s,brBoxY:h=e}=r,l=e-h,d=h+a-(e+s),c=l-n>-.1?0:n,u=d-n>-.1?0:n,g=Math.max(c&&l,0),f=Math.max(u&&d,0),m=[t+c,e],y=[t+i-c,e],b=[t+i,e+c],v=[t+i,e+s-u],S=[t+i-u,e+s],C=[t+u,e+s],k=[t,e+s-u],M=[t,e+c],w=(t,e)=>Math.sqrt(Math.pow(t,2)-Math.pow(e,2));if(g){let t=w(c,c-g);m[0]-=t,y[0]+=t,b[1]=M[1]=e+c-g}if(s<c-g){let r=w(c,c-g-s);b[0]=v[0]=t+i-c+r,S[0]=Math.min(b[0],S[0]),C[0]=Math.max(v[0],C[0]),k[0]=M[0]=t+c-r,b[1]=M[1]=e+s}if(f){let t=w(u,u-f);S[0]+=t,C[0]-=t,v[1]=k[1]=e+s-u+f}if(s<u-f){let r=w(u,u-f-s);b[0]=v[0]=t+i-u+r,y[0]=Math.min(b[0],y[0]),m[0]=Math.max(v[0],m[0]),k[0]=M[0]=t+u-r,v[1]=k[1]=e}return o.length=0,o.push(["M",...m],["L",...y],["A",c,c,0,0,1,...b],["L",...v],["A",u,u,0,0,1,...S],["L",...C],["A",u,u,0,0,1,...k],["L",...M],["A",c,c,0,0,1,...m],["Z"]),o}return{compose:function(t,e,i){let s=t.types.pie;if(!e.symbolCustomAttribs.includes("borderRadius")){let r=i.prototype.symbols;o(t,"afterColumnTranslate",g,{order:9}),o(s,"afterTranslate",m),e.symbolCustomAttribs.push("borderRadius","brBoxHeight","brBoxY"),c=r.arc,p=r.roundedRect,r.arc=u,r.roundedRect=x}},optionsToObject:f}}),i(e,"Core/Responsive.js",[e["Core/Utilities.js"]],function(t){var e;let{diffObjects:i,extend:s,find:r,merge:o,pick:n,uniqueKey:a}=t;return function(t){function e(t,e){let i=t.condition;(i.callback||function(){return this.chartWidth<=n(i.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=n(i.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=n(i.minWidth,0)&&this.chartHeight>=n(i.minHeight,0)}).call(this)&&e.push(t._id)}function h(t,e){let s=this.options.responsive,n=this.currentResponsive,h=[],l;!e&&s&&s.rules&&s.rules.forEach(t=>{void 0===t._id&&(t._id=a()),this.matchResponsiveRule(t,h)},this);let d=o(...h.map(t=>r((s||{}).rules||[],e=>e._id===t)).map(t=>t&&t.chartOptions));d.isResponsiveOptions=!0,h=h.toString()||void 0;let c=n&&n.ruleIds;h===c||(n&&(this.currentResponsive=void 0,this.updatingResponsive=!0,this.update(n.undoOptions,t,!0),this.updatingResponsive=!1),h?((l=i(d,this.options,!0,this.collectionsWithUpdate)).isResponsiveOptions=!0,this.currentResponsive={ruleIds:h,mergedOptions:d,undoOptions:l},this.updatingResponsive||this.update(d,t,!0)):this.currentResponsive=void 0)}t.compose=function(t){let i=t.prototype;return i.matchResponsiveRule||s(i,{matchResponsiveRule:e,setResponsive:h}),t}}(e||(e={})),e}),i(e,"masters/highcharts.src.js",[e["Core/Globals.js"],e["Core/Utilities.js"],e["Core/Defaults.js"],e["Core/Animation/Fx.js"],e["Core/Animation/AnimationUtilities.js"],e["Core/Renderer/HTML/AST.js"],e["Core/Templating.js"],e["Core/Renderer/RendererRegistry.js"],e["Core/Renderer/RendererUtilities.js"],e["Core/Renderer/SVG/SVGElement.js"],e["Core/Renderer/SVG/SVGRenderer.js"],e["Core/Renderer/HTML/HTMLElement.js"],e["Core/Axis/Axis.js"],e["Core/Axis/DateTimeAxis.js"],e["Core/Axis/LogarithmicAxis.js"],e["Core/Axis/PlotLineOrBand/PlotLineOrBand.js"],e["Core/Axis/Tick.js"],e["Core/Tooltip.js"],e["Core/Series/Point.js"],e["Core/Pointer.js"],e["Core/Legend/Legend.js"],e["Core/Legend/LegendSymbol.js"],e["Core/Chart/Chart.js"],e["Extensions/ScrollablePlotArea.js"],e["Core/Axis/Stacking/StackingAxis.js"],e["Core/Axis/Stacking/StackItem.js"],e["Core/Series/Series.js"],e["Core/Series/SeriesRegistry.js"],e["Series/Column/ColumnDataLabel.js"],e["Series/Pie/PieDataLabel.js"],e["Core/Series/DataLabel.js"],e["Extensions/OverlappingDataLabels.js"],e["Extensions/BorderRadius.js"],e["Core/Responsive.js"],e["Core/Color/Color.js"],e["Core/Time.js"]],function(t,e,i,s,r,o,n,a,h,l,d,c,p,u,g,f,m,x,y,b,v,S,C,k,M,w,T,A,P,L,O,D,E,I,j,B){return t.AST=o,t.Axis=p,t.Chart=C,t.Color=j,t.DataLabel=O,t.Fx=s,t.HTMLElement=c,t.Legend=v,t.LegendSymbol=S,t.OverlappingDataLabels=t.OverlappingDataLabels||D,t.PlotLineOrBand=f,t.Point=y,t.Pointer=b,t.RendererRegistry=a,t.Series=T,t.SeriesRegistry=A,t.StackItem=w,t.SVGElement=l,t.SVGRenderer=d,t.Templating=n,t.Tick=m,t.Time=B,t.Tooltip=x,t.animate=r.animate,t.animObject=r.animObject,t.chart=C.chart,t.color=j.parse,t.dateFormat=n.dateFormat,t.defaultOptions=i.defaultOptions,t.distribute=h.distribute,t.format=n.format,t.getDeferredAnimation=r.getDeferredAnimation,t.getOptions=i.getOptions,t.numberFormat=n.numberFormat,t.seriesType=A.seriesType,t.setAnimation=r.setAnimation,t.setOptions=i.setOptions,t.stop=r.stop,t.time=i.defaultTime,t.timers=s.timers,E.compose(t.Series,t.SVGElement,t.SVGRenderer),P.compose(t.Series.types.column),O.compose(t.Series),u.compose(t.Axis),c.compose(t.SVGRenderer),v.compose(t.Chart),g.compose(t.Axis),D.compose(t.Chart),L.compose(t.Series.types.pie),f.compose(t.Chart,t.Axis),b.compose(t.Chart),I.compose(t.Chart),k.compose(t.Axis,t.Chart,t.Series),M.compose(t.Axis,t.Chart,t.Series),x.compose(t.Pointer),e.extend(t,e),t}),e["masters/highcharts.src.js"]._modules=e,e["masters/highcharts.src.js"]});
File: public/js/highcharts/vendor/modules/accessibility.js
Match lines: 1
10| */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/accessibility",["highcharts"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function i(t,i,s,n){t.hasOwnProperty(i)||(t[i]=n.apply(null,s),"function"==typeof CustomEvent&&e.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:t[i]}})))}i(t,"Accessibility/Utils/HTMLUtilities.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{doc:i,win:s}=e,{css:n}=t,r=s.EventTarget&&new s.EventTarget||"none";function o(e){if("function"==typeof s.MouseEvent)return new s.MouseEvent(e.type,e);if(i.createEvent){let t=i.createEvent("MouseEvent");if(t.initMouseEvent)return t.initMouseEvent(e.type,e.bubbles,e.cancelable,e.view||s,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),t}return a(e.type)}function a(e,t,n){let o=t||{x:0,y:0};if("function"==typeof s.MouseEvent)return new s.MouseEvent(e,{bubbles:!0,cancelable:!0,composed:!0,button:0,buttons:1,relatedTarget:n||r,view:s,detail:"click"===e?1:0,screenX:o.x,screenY:o.y,clientX:o.x,clientY:o.y});if(i.createEvent){let t=i.createEvent("MouseEvent");if(t.initMouseEvent)return t.initMouseEvent(e,!0,!0,s,"click"===e?1:0,o.x,o.y,o.x,o.y,!1,!1,!1,!1,0,null),t}return{type:e}}return{addClass:function(e,t){e.classList?e.classList.add(t):0>e.className.indexOf(t)&&(e.className+=" "+t)},cloneMouseEvent:o,cloneTouchEvent:function(e){let t=e=>{let t=[];for(let i=0;i<e.length;++i){let s=e.item(i);s&&t.push(s)}return t};if("function"==typeof s.TouchEvent){let i=new s.TouchEvent(e.type,{touches:t(e.touches),targetTouches:t(e.targetTouches),changedTouches:t(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed,detail:e.detail,view:e.view});return e.defaultPrevented&&i.preventDefault(),i}let i=o(e);return i.touches=e.touches,i.changedTouches=e.changedTouches,i.targetTouches=e.targetTouches,i},escapeStringForHTML:function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},getElement:function(e){return i.getElementById(e)},getFakeMouseEvent:a,getHeadingTagNameForElement:function(e){let t=e=>"h"+Math.min(6,parseInt(e.slice(1),10)+1),i=e=>/^H[1-6]$/i.test(e),s=e=>{let t=e;for(;t=t.previousSibling;){let e=t.tagName||"";if(i(e))return e}return""},n=e=>{let r=s(e);if(r)return t(r);let o=e.parentElement;if(!o)return"p";let a=o.tagName;return i(a)?t(a):n(o)};return n(e)},removeChildNodes:function(e){for(;e.lastChild;)e.removeChild(e.lastChild)},removeClass:function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(t,"g"),"")},removeElement:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},reverseChildNodes:function(e){let t=e.childNodes.length;for(;t--;)e.appendChild(e.childNodes[t])},simulatedEventTarget:r,stripHTMLTagsFromString:function(e,t=!1){return"string"==typeof e?t?e.replace(/<\/?[^>]+(>|$)/g,""):e.replace(/<\/?(?!\s)[^>]+(>|$)/g,""):e},visuallyHideElement:function(e){n(e,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(1px, 1px, 1px, 1px)",marginTop:"-3px","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)",filter:"alpha(opacity=1)",opacity:.01})}}}),i(t,"Accessibility/A11yI18n.js",[t["Core/Templating.js"],t["Core/Utilities.js"]],function(e,t){var i;let{format:s}=e,{getNestedProperty:n,pick:r}=t;return function(e){function t(e,t,i){let o=(e,t)=>{let i=e.slice(t||0),s=i.indexOf("{"),n=i.indexOf("}");if(s>-1&&n>s)return{statement:i.substring(s+1,n),begin:t+s+1,end:t+n}},a=[],l,h,c=0;do l=o(e,c),(h=e.substring(c,l&&l.begin-1)).length&&a.push({value:h,type:"constant"}),l&&a.push({value:l.statement,type:"statement"}),c=l?l.end+1:c+1;while(l);return a.forEach(e=>{"statement"===e.type&&(e.value=function(e,t){let i,s;let o=e.indexOf("#each("),a=e.indexOf("#plural("),l=e.indexOf("["),h=e.indexOf("]");if(o>-1){let r=e.slice(o).indexOf(")")+o,a=e.substring(0,o),l=e.substring(r+1),h=e.substring(o+6,r).split(","),c=Number(h[1]),d;if(s="",i=n(h[0],t)){d=(c=isNaN(c)?i.length:c)<0?i.length+c:Math.min(c,i.length);for(let e=0;e<d;++e)s+=a+i[e]+l}return s.length?s:""}if(a>-1){var c;let i=e.slice(a).indexOf(")")+a,o=e.substring(a+8,i).split(",");switch(Number(n(o[0],t))){case 0:s=r(o[4],o[1]);break;case 1:s=r(o[2],o[1]);break;case 2:s=r(o[3],o[1]);break;default:s=o[1]}return s?(c=s).trim&&c.trim()||c.replace(/^\s+|\s+$/g,""):""}if(l>-1){let s;let r=e.substring(0,l),o=Number(e.substring(l+1,h));return i=n(r,t),!isNaN(o)&&i&&(o<0?void 0===(s=i[i.length+o])&&(s=i[0]):void 0===(s=i[o])&&(s=i[i.length-1])),void 0!==s?s:""}return"{"+e+"}"}(e.value,t))}),s(a.reduce((e,t)=>e+t.value,""),t,i)}function i(e,i){let s=e.split("."),n=this.options.lang,r=0;for(;r<s.length;++r)n=n&&n[s[r]];return"string"==typeof n?t(n,i,this):""}e.compose=function(e){let t=e.prototype;t.langFormat||(t.langFormat=i)},e.i18nFormat=t}(i||(i={})),i}),i(t,"Accessibility/Utils/ChartUtilities.js",[t["Core/Globals.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Core/Utilities.js"]],function(e,t,i){let{doc:s}=e,{stripHTMLTagsFromString:n}=t,{defined:r,find:o,fireEvent:a}=i;function l(e){if(e.points&&e.points.length){let t=o(e.points,e=>!!e.graphic);return t&&t.graphic&&t.graphic.element}}function h(e){let t=l(e);return t&&t.parentNode||e.graph&&e.graph.element||e.group&&e.group.element}return{fireEventOnWrappedOrUnwrappedElement:function e(t,i){let n=i.type,r=t.hcEvents;s.createEvent&&(t.dispatchEvent||t.fireEvent)?t.dispatchEvent?t.dispatchEvent(i):t.fireEvent(n,i):r&&r[n]?a(t,n,i):t.element&&e(t.element,i)},getChartTitle:function(e){return n(e.options.title.text||e.langFormat("accessibility.defaultChartTitle",{chart:e}),e.renderer.forExport)},getAxisDescription:function(e){return e&&(e.options.accessibility?.description||e.axisTitle?.textStr||e.options.id||e.categories&&"categories"||e.dateTime&&"Time"||"values")},getAxisRangeDescription:function(e){let t=e.options||{};return t.accessibility&&void 0!==t.accessibility.rangeDescription?t.accessibility.rangeDescription:e.categories?function(e){let t=e.chart;return e.dataMax&&e.dataMin?t.langFormat("accessibility.axis.rangeCategories",{chart:t,axis:e,numCategories:e.dataMax-e.dataMin+1}):""}(e):e.dateTime&&(0===e.min||0===e.dataMin)?function(e){let t=e.chart,i={},s=e.dataMin||e.min||0,n=e.dataMax||e.max||0,r="Seconds";i.Seconds=(n-s)/1e3,i.Minutes=i.Seconds/60,i.Hours=i.Minutes/60,i.Days=i.Hours/24,["Minutes","Hours","Days"].forEach(function(e){i[e]>2&&(r=e)});let o=i[r].toFixed("Seconds"!==r&&"Minutes"!==r?1:0);return t.langFormat("accessibility.axis.timeRange"+r,{chart:t,axis:e,range:o.replace(".0","")})}(e):function(e){let t=e.chart,i=t.options,s=i&&i.accessibility&&i.accessibility.screenReaderSection.axisRangeDateFormat||"",n={min:e.dataMin||e.min||0,max:e.dataMax||e.max||0},r=function(i){return e.dateTime?t.time.dateFormat(s,n[i]):n[i].toString()};return t.langFormat("accessibility.axis.rangeFromTo",{chart:t,axis:e,rangeFrom:r("min"),rangeTo:r("max")})}(e)},getPointFromXY:function(e,t,i){let s=e.length,n;for(;s--;)if(n=o(e[s].points||[],function(e){return e.x===t&&e.y===i}))return n},getSeriesFirstPointElement:l,getSeriesFromName:function(e,t){return t?(e.series||[]).filter(function(e){return e.name===t}):e.series},getSeriesA11yElement:h,unhideChartElementFromAT:function e(t,i){i.setAttribute("aria-hidden",!1),i!==t.renderTo&&i.parentNode&&i.parentNode!==s.body&&(Array.prototype.forEach.call(i.parentNode.childNodes,function(e){e.hasAttribute("aria-hidden")||e.setAttribute("aria-hidden",!0)}),e(t,i.parentNode))},hideSeriesFromAT:function(e){let t=h(e);t&&t.setAttribute("aria-hidden",!0)},scrollAxisToPoint:function(e){let t=e.series.xAxis,i=e.series.yAxis,s=t&&t.scrollbar?t:i,n=s&&s.scrollbar;if(n&&r(n.to)&&r(n.from)){let t=n.to-n.from,i=function(e,t){if(!r(e.dataMin)||!r(e.dataMax))return 0;let i=e.toPixels(e.dataMin),s=e.toPixels(e.dataMax),n="xAxis"===e.coll?"x":"y";return(e.toPixels(t[n]||0)-i)/(s-i)}(s,e);n.updatePosition(i-t/2,i+t/2),a(n,"changed",{from:n.from,to:n.to,trigger:"scrollbar",DOMEvent:null})}}}}),i(t,"Accessibility/Utils/DOMElementProvider.js",[t["Core/Globals.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t){let{doc:i}=e,{removeElement:s}=t;return class{constructor(){this.elements=[]}createElement(){let e=i.createElement.apply(i,arguments);return this.elements.push(e),e}removeElement(e){s(e),this.elements.splice(this.elements.indexOf(e),1)}destroyCreatedElements(){this.elements.forEach(function(e){s(e)}),this.elements=[]}}}),i(t,"Accessibility/Utils/EventProvider.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{addEvent:i}=t;return class{constructor(){this.eventRemovers=[]}addEvent(){let t=i.apply(e,arguments);return this.eventRemovers.push({element:arguments[0],remover:t}),t}removeEvent(e){let t=this.eventRemovers.map(e=>e.remover).indexOf(e);this.eventRemovers[t].remover(),this.eventRemovers.splice(t,1)}removeAddedEvents(){this.eventRemovers.map(e=>e.remover).forEach(e=>e()),this.eventRemovers=[]}}}),i(t,"Accessibility/AccessibilityComponent.js",[t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/DOMElementProvider.js"],t["Accessibility/Utils/EventProvider.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t,i,s){let{fireEventOnWrappedOrUnwrappedElement:n}=e,{getFakeMouseEvent:r}=s;return class{destroy(){}getKeyboardNavigation(){return[]}init(){}onChartRender(){}onChartUpdate(){}initBase(e,s){this.chart=e,this.eventProvider=new i,this.domElementProvider=new t,this.proxyProvider=s,this.keyCodes={left:37,right:39,up:38,down:40,enter:13,space:32,esc:27,tab:9,pageUp:33,pageDown:34,end:35,home:36}}addEvent(e,t,i,s){return this.eventProvider.addEvent(e,t,i,s)}createElement(e,t){return this.domElementProvider.createElement(e,t)}fakeClickEvent(e){n(e,r("click"))}destroyBase(){this.domElementProvider.destroyCreatedElements(),this.eventProvider.removeAddedEvents()}}}),i(t,"Accessibility/KeyboardNavigationHandler.js",[t["Core/Utilities.js"]],function(e){let{find:t}=e;return class{constructor(e,t){this.chart=e,this.keyCodeMap=t.keyCodeMap||[],this.validate=t.validate,this.init=t.init,this.terminate=t.terminate,this.response={success:1,prev:2,next:3,noHandler:4,fail:5}}run(e){let i=e.which||e.keyCode,s=this.response.noHandler,n=t(this.keyCodeMap,function(e){return e[0].indexOf(i)>-1});return n?s=n[1].call(this,i,e):9===i&&(s=this.response[e.shiftKey?"prev":"next"]),s}}}),i(t,"Accessibility/Components/ContainerComponent.js",[t["Accessibility/AccessibilityComponent.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Core/Globals.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t,i,s,n){let{unhideChartElementFromAT:r,getChartTitle:o}=i,{doc:a}=s,{stripHTMLTagsFromString:l}=n;return class extends e{onChartUpdate(){this.handleSVGTitleElement(),this.setSVGContainerLabel(),this.setGraphicContainerAttrs(),this.setRenderToAttrs(),this.makeCreditsAccessible()}handleSVGTitleElement(){let e=this.chart,t="highcharts-title-"+e.index,i=l(e.langFormat("accessibility.svgContainerTitle",{chartTitle:o(e)}));if(i.length){let s=this.svgTitleElement=this.svgTitleElement||a.createElementNS("http://www.w3.org/2000/svg","title");s.textContent=i,s.id=t,e.renderTo.insertBefore(s,e.renderTo.firstChild)}}setSVGContainerLabel(){let e=this.chart,t=e.langFormat("accessibility.svgContainerLabel",{chartTitle:o(e)});e.renderer.box&&t.length&&e.renderer.box.setAttribute("aria-label",t)}setGraphicContainerAttrs(){let e=this.chart,t=e.langFormat("accessibility.graphicContainerLabel",{chartTitle:o(e)});t.length&&e.container.setAttribute("aria-label",t)}setRenderToAttrs(){let e=this.chart,t="disabled"!==e.options.accessibility.landmarkVerbosity,i=e.langFormat("accessibility.chartContainerLabel",{title:o(e),chart:e});i&&(e.renderTo.setAttribute("role",t?"region":"group"),e.renderTo.setAttribute("aria-label",i))}makeCreditsAccessible(){let e=this.chart,t=e.credits;t&&(t.textStr&&t.element.setAttribute("aria-label",e.langFormat("accessibility.credits",{creditsStr:l(t.textStr,e.renderer.forExport)})),r(e,t.element))}getKeyboardNavigation(){let e=this.chart;return new t(e,{keyCodeMap:[],validate:function(){return!0},init:function(){let t=e.accessibility;t&&t.keyboardNavigation.tabindexContainer.focus()}})}destroy(){this.chart.renderTo.setAttribute("aria-hidden",!0)}}}),i(t,"Accessibility/FocusBorder.js",[t["Core/Utilities.js"]],function(e){var t;let{addEvent:i,pick:s}=e;return function(e){let t=["x","y","transform","width","height","r","d","stroke-width"];function n(){let e=this.focusElement,t=this.options.accessibility.keyboardNavigation.focusBorder;e&&(e.removeFocusBorder(),t.enabled&&e.addFocusBorder(t.margin,{stroke:t.style.color,strokeWidth:t.style.lineWidth,r:t.style.borderRadius}))}function r(e,t){let s=this.options.accessibility.keyboardNavigation.focusBorder,n=t||e.element;n&&n.focus&&(n.hcEvents&&n.hcEvents.focusin||i(n,"focusin",function(){}),n.focus(),s.hideBrowserFocusOutline&&(n.style.outline="none")),this.focusElement&&this.focusElement.removeFocusBorder(),this.focusElement=e,this.renderFocusBorder()}function o(e,i){this.focusBorder&&this.removeFocusBorder();let n=this.getBBox(),r=s(e,3),o=this.parentGroup,a=this.scaleX||o&&o.scaleX,l=this.scaleY||o&&o.scaleY,h=(a?!l:l)?Math.abs(a||l||1):(Math.abs(a||1)+Math.abs(l||1))/2;n.x+=this.translateX?this.translateX:0,n.y+=this.translateY?this.translateY:0;let c=n.x-r,d=n.y-r,u=n.width+2*r,p=n.height+2*r,g=!!this.text;if("text"===this.element.nodeName||g){let e,t;let i=!!this.rotation,s=g?{x:i?1:0,y:0}:(e=0,t=0,"middle"===this.attr("text-anchor")?e=t=.5:this.rotation?e=.25:t=.75,{x:e,y:t}),o=+this.attr("x"),a=+this.attr("y");if(isNaN(o)||(c=o-n.width*s.x-r),isNaN(a)||(d=a-n.height*s.y-r),g&&i){let e=u;u=p,p=e,isNaN(o)||(c=o-n.height*s.x-r),isNaN(a)||(d=a-n.width*s.y-r)}}this.focusBorder=this.renderer.rect(c,d,u,p,parseInt((i&&i.r||0).toString(),10)/h).addClass("highcharts-focus-border").attr({zIndex:99}).add(o),this.renderer.styledMode||this.focusBorder.attr({stroke:i&&i.stroke,"stroke-width":(i&&i.strokeWidth||0)/h}),function(e,...i){e.focusBorderUpdateHooks||(e.focusBorderUpdateHooks={},t.forEach(t=>{let s=t+"Setter",n=e[s]||e._defaultSetter;e.focusBorderUpdateHooks[s]=n,e[s]=function(){let t=n.apply(e,arguments);return e.addFocusBorder.apply(e,i),t}}))}(this,e,i),function(e){if(e.focusBorderDestroyHook)return;let t=e.destroy;e.destroy=function(){return e.focusBorder&&e.focusBorder.destroy&&e.focusBorder.destroy(),t.apply(e,arguments)},e.focusBorderDestroyHook=t}(this)}function a(){var e;e=this,e.focusBorderUpdateHooks&&(Object.keys(e.focusBorderUpdateHooks).forEach(t=>{let i=e.focusBorderUpdateHooks[t];i===e._defaultSetter?delete e[t]:e[t]=i}),delete e.focusBorderUpdateHooks),this.focusBorderDestroyHook&&(this.destroy=this.focusBorderDestroyHook,delete this.focusBorderDestroyHook),this.focusBorder&&(this.focusBorder.destroy(),delete this.focusBorder)}e.compose=function(e,t){let i=e.prototype,s=t.prototype;i.renderFocusBorder||(i.renderFocusBorder=n,i.setFocusToElement=r),s.addFocusBorder||(s.addFocusBorder=o,s.removeFocusBorder=a)}}(t||(t={})),t}),i(t,"Accessibility/Utils/Announcer.js",[t["Core/Renderer/HTML/AST.js"],t["Accessibility/Utils/DOMElementProvider.js"],t["Core/Globals.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Core/Utilities.js"]],function(e,t,i,s,n){let{doc:r}=i,{addClass:o,visuallyHideElement:a}=s,{attr:l}=n;return class{constructor(e,i){this.chart=e,this.domElementProvider=new t,this.announceRegion=this.addAnnounceRegion(i)}destroy(){this.domElementProvider.destroyCreatedElements()}announce(t){e.setElementHTML(this.announceRegion,t),this.clearAnnouncementRegionTimer&&clearTimeout(this.clearAnnouncementRegionTimer),this.clearAnnouncementRegionTimer=setTimeout(()=>{this.announceRegion.innerHTML=e.emptyHTML,delete this.clearAnnouncementRegionTimer},3e3)}addAnnounceRegion(e){let t=this.chart.announcerContainer||this.createAnnouncerContainer(),i=this.domElementProvider.createElement("div");return l(i,{"aria-hidden":!1,"aria-live":e,"aria-atomic":!0}),this.chart.styledMode?o(i,"highcharts-visually-hidden"):a(i),t.appendChild(i),i}createAnnouncerContainer(){let e=this.chart,t=r.createElement("div");return l(t,{"aria-hidden":!1,class:"highcharts-announcer-container"}),t.style.position="relative",e.renderTo.insertBefore(t,e.renderTo.firstChild),e.announcerContainer=t,t}}}),i(t,"Accessibility/Components/AnnotationsA11y.js",[t["Accessibility/Utils/HTMLUtilities.js"]],function(e){let{escapeStringForHTML:t,stripHTMLTagsFromString:i}=e;function s(e){return(e.annotations||[]).reduce((e,t)=>(t.options&&!1!==t.options.visible&&(e=e.concat(t.labels)),e),[])}function n(e){return e.options&&e.options.accessibility&&e.options.accessibility.description||e.graphic&&e.graphic.text&&e.graphic.text.textStr||""}function r(e){let t=e.options&&e.options.accessibility&&e.options.accessibility.description;if(t)return t;let i=e.chart,s=n(e),r=e.points,o=e=>e.graphic&&e.graphic.element&&e.graphic.element.getAttribute("aria-label")||"",a=r.filter(e=>!!e.graphic).map(e=>{let t=e.accessibility&&e.accessibility.valueDescription||o(e),i=e&&e.series.name||"";return(i?i+", ":"")+"data point "+t}).filter(e=>!!e),l=a.length,h=l>1?"MultiplePoints":l?"SinglePoint":"NoPoints",c={annotationText:s,annotation:e,numPoints:l,annotationPoint:a[0],additionalAnnotationPoints:a.slice(1)};return i.langFormat("accessibility.screenReaderSection.annotations.description"+h,c)}function o(e){return s(e).map(s=>{let n=t(i(r(s),e.renderer.forExport));return n?`<li>${n}</li>`:""})}return{getAnnotationsInfoHTML:function(e){let t=e.annotations;if(!(t&&t.length))return"";let i=o(e);return`<ul style="list-style-type: none">${i.join(" ")}</ul>`},getAnnotationLabelDescription:r,getAnnotationListItems:o,getPointAnnotationTexts:function(e){let t=s(e.series.chart).filter(t=>t.points.indexOf(e)>-1);return t.length?t.map(e=>`${n(e)}`):[]}}}),i(t,"Accessibility/Components/InfoRegionsComponent.js",[t["Accessibility/A11yI18n.js"],t["Accessibility/AccessibilityComponent.js"],t["Accessibility/Utils/Announcer.js"],t["Accessibility/Components/AnnotationsA11y.js"],t["Core/Renderer/HTML/AST.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Core/Templating.js"],t["Core/Globals.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Core/Utilities.js"]],function(e,t,i,s,n,r,o,a,l,h){let{getAnnotationsInfoHTML:c}=s,{getAxisDescription:d,getAxisRangeDescription:u,getChartTitle:p,unhideChartElementFromAT:g}=r,{format:m}=o,{doc:b}=a,{addClass:y,getElement:f,getHeadingTagNameForElement:x,stripHTMLTagsFromString:v,visuallyHideElement:A}=l,{attr:C,pick:w,replaceNested:E}=h;function T(e){return E(e,[/<([\w\-.:!]+)\b[^<>]*>\s*<\/\1>/g,""])}return class extends t{constructor(){super(...arguments),this.screenReaderSections={}}init(){let e=this.chart,t=this;this.initRegionsDefinitions(),this.addEvent(e,"aftergetTableAST",function(e){t.onDataTableCreated(e)}),this.addEvent(e,"afterViewData",function(e){e.wasHidden&&(t.dataTableDiv=e.element,setTimeout(function(){t.focusDataTable()},300))}),this.addEvent(e,"afterHideData",function(){t.viewDataTableButton&&t.viewDataTableButton.setAttribute("aria-expanded","false")}),e.exporting&&this.addEvent(e,"afterPrint",function(){t.updateAllScreenReaderSections()}),this.announcer=new i(e,"assertive")}initRegionsDefinitions(){let e=this,t=this.chart.options.accessibility;this.screenReaderSections={before:{element:null,buildContent:function(i){let s=t.screenReaderSection.beforeChartFormatter;return s?s(i):e.defaultBeforeChartFormatter(i)},insertIntoDOM:function(e,t){t.renderTo.insertBefore(e,t.renderTo.firstChild)},afterInserted:function(){void 0!==e.sonifyButtonId&&e.initSonifyButton(e.sonifyButtonId),void 0!==e.dataTableButtonId&&e.initDataTableButton(e.dataTableButtonId)}},after:{element:null,buildContent:function(i){let s=t.screenReaderSection.afterChartFormatter;return s?s(i):e.defaultAfterChartFormatter()},insertIntoDOM:function(e,t){t.renderTo.insertBefore(e,t.container.nextSibling)},afterInserted:function(){e.chart.accessibility&&t.keyboardNavigation.enabled&&e.chart.accessibility.keyboardNavigation.updateExitAnchor()}}}}onChartRender(){this.linkedDescriptionElement=this.getLinkedDescriptionElement(),this.setLinkedDescriptionAttrs(),this.updateAllScreenReaderSections()}updateAllScreenReaderSections(){let e=this;Object.keys(this.screenReaderSections).forEach(function(t){e.updateScreenReaderSection(t)})}getLinkedDescriptionElement(){let e=this.chart.options.accessibility.linkedDescription;if(!e)return;if("string"!=typeof e)return e;let t=m(e,this.chart),i=b.querySelectorAll(t);if(1===i.length)return i[0]}setLinkedDescriptionAttrs(){let e=this.linkedDescriptionElement;e&&(e.setAttribute("aria-hidden","true"),y(e,"highcharts-linked-description"))}updateScreenReaderSection(e){let t=this.chart,i=this.screenReaderSections[e],s=i.buildContent(t),r=i.element=i.element||this.createElement("div"),o=r.firstChild||this.createElement("div");s?(this.setScreenReaderSectionAttribs(r,e),n.setElementHTML(o,s),r.appendChild(o),i.insertIntoDOM(r,t),t.styledMode?y(o,"highcharts-visually-hidden"):A(o),g(t,o),i.afterInserted&&i.afterInserted()):(r.parentNode&&r.parentNode.removeChild(r),i.element=null)}setScreenReaderSectionAttribs(e,t){let i=this.chart,s=i.langFormat("accessibility.screenReaderSection."+t+"RegionLabel",{chart:i,chartTitle:p(i)});C(e,{id:`highcharts-screen-reader-region-${t}-${i.index}`,"aria-label":s||void 0}),e.style.position="relative",s&&e.setAttribute("role","all"===i.options.accessibility.landmarkVerbosity?"region":"group")}defaultBeforeChartFormatter(){let t=this.chart,i=t.options.accessibility.screenReaderSection.beforeChartFormat;if(!i)return"";let s=this.getAxesDescription(),n=t.sonify&&t.options.sonification&&t.options.sonification.enabled,r="highcharts-a11y-sonify-data-btn-"+t.index,o="hc-linkto-highcharts-data-table-"+t.index,a=c(t),l=t.langFormat("accessibility.screenReaderSection.annotations.heading",{chart:t}),h={headingTagName:x(t.renderTo),chartTitle:p(t),typeDescription:this.getTypeDescriptionText(),chartSubtitle:this.getSubtitleText(),chartLongdesc:this.getLongdescText(),xAxisDescription:s.xAxis,yAxisDescription:s.yAxis,playAsSoundButton:n?this.getSonifyButtonText(r):"",viewTableButton:t.getCSV?this.getDataTableButtonText(o):"",annotationsTitle:a?l:"",annotationsList:a},d=e.i18nFormat(i,h,t);return this.dataTableButtonId=o,this.sonifyButtonId=r,T(d)}defaultAfterChartFormatter(){let t=this.chart,i=t.options.accessibility.screenReaderSection.afterChartFormat;if(!i)return"";let s={endOfChartMarker:this.getEndOfChartMarkerText()};return T(e.i18nFormat(i,s,t))}getLinkedDescription(){let e=this.linkedDescriptionElement;return v(e&&e.innerHTML||"",this.chart.renderer.forExport)}getLongdescText(){let e=this.chart.options,t=e.caption,i=t&&t.text,s=this.getLinkedDescription();return e.accessibility.description||s||i||""}getTypeDescriptionText(){let e=this.chart;return e.types?e.options.accessibility.typeDescription||function(e,t){let i=t[0],s=e.series&&e.series[0]||{},n=e.mapView&&e.mapView.geoMap&&e.mapView.geoMap.title,r={numSeries:e.series.length,numPoints:s.points&&s.points.length,chart:e,mapTitle:n};return i?"map"===i||"tiledwebmap"===i?r.mapTitle?e.langFormat("accessibility.chartTypes.mapTypeDescription",r):e.langFormat("accessibility.chartTypes.unknownMap",r):e.types.length>1?e.langFormat("accessibility.chartTypes.combinationChart",r):function(e,t,i){let s=t[0],n=e.langFormat("accessibility.seriesTypeDescriptions."+s,i),r=e.series&&e.series.length<2?"Single":"Multiple";return(e.langFormat("accessibility.chartTypes."+s+r,i)||e.langFormat("accessibility.chartTypes.default"+r,i))+(n?" "+n:"")}(e,t,r):e.langFormat("accessibility.chartTypes.emptyChart",r)}(e,e.types):""}getDataTableButtonText(e){let t=this.chart;return'<button id="'+e+'">'+t.langFormat("accessibility.table.viewAsDataTableButtonText",{chart:t,chartTitle:p(t)})+"</button>"}getSonifyButtonText(e){let t=this.chart;return t.options.sonification&&!1===t.options.sonification.enabled?"":'<button id="'+e+'">'+t.langFormat("accessibility.sonification.playAsSoundButtonText",{chart:t,chartTitle:p(t)})+"</button>"}getSubtitleText(){let e=this.chart.options.subtitle;return v(e&&e.text||"",this.chart.renderer.forExport)}getEndOfChartMarkerText(){let e=f(`highcharts-end-of-chart-marker-${this.chart.index}`);if(e)return e.outerHTML;let t=this.chart,i=t.langFormat("accessibility.screenReaderSection.endOfChartMarker",{chart:t});return'<div id="highcharts-end-of-chart-marker-'+t.index+'">'+i+"</div>"}onDataTableCreated(e){let t=this.chart;if(t.options.accessibility.enabled){this.viewDataTableButton&&this.viewDataTableButton.setAttribute("aria-expanded","true");let i=e.tree.attributes||{};i.tabindex=-1,i.summary=t.langFormat("accessibility.table.tableSummary",{chart:t}),e.tree.attributes=i}}focusDataTable(){let e=this.dataTableDiv,t=e&&e.getElementsByTagName("table")[0];t&&t.focus&&t.focus()}initSonifyButton(e){let t=this.sonifyButton=f(e),i=this.chart,s=e=>{t&&(t.setAttribute("aria-hidden","true"),t.setAttribute("aria-label","")),e.preventDefault(),e.stopPropagation();let s=i.langFormat("accessibility.sonification.playAsSoundClickAnnouncement",{chart:i});this.announcer.announce(s),setTimeout(()=>{t&&(t.removeAttribute("aria-hidden"),t.removeAttribute("aria-label")),i.sonify&&i.sonify()},1e3)};t&&i&&(t.setAttribute("tabindex",-1),t.onclick=function(e){(i.options.accessibility&&i.options.accessibility.screenReaderSection.onPlayAsSoundClick||s).call(this,e,i)})}initDataTableButton(e){let t=this.viewDataTableButton=f(e),i=this.chart,s=e.replace("hc-linkto-","");t&&(C(t,{tabindex:-1,"aria-expanded":!!f(s)}),t.onclick=i.options.accessibility.screenReaderSection.onViewDataTableClick||function(){i.viewData()})}getAxesDescription(){let e=this.chart,t=function(t,i){let s=e[t];return s.length>1||s[0]&&w(s[0].options.accessibility&&s[0].options.accessibility.enabled,i)},i=!!e.types&&0>e.types.indexOf("map")&&0>e.types.indexOf("treemap")&&0>e.types.indexOf("tilemap"),s=!!e.hasCartesianSeries,n=t("xAxis",!e.angular&&s&&i),r=t("yAxis",s&&i),o={};return n&&(o.xAxis=this.getAxisDescriptionText("xAxis")),r&&(o.yAxis=this.getAxisDescriptionText("yAxis")),o}getAxisDescriptionText(e){let t=this.chart,i=t[e];return t.langFormat("accessibility.axis."+e+"Description"+(i.length>1?"Plural":"Singular"),{chart:t,names:i.map(function(e){return d(e)}),ranges:i.map(function(e){return u(e)}),numAxes:i.length})}destroy(){this.announcer&&this.announcer.destroy()}}}),i(t,"Accessibility/Components/MenuComponent.js",[t["Core/Utilities.js"],t["Accessibility/AccessibilityComponent.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t,i,s,n){let{attr:r}=e,{getChartTitle:o,unhideChartElementFromAT:a}=s,{getFakeMouseEvent:l}=n;function h(e){return e.exportSVGElements&&e.exportSVGElements[0]}class c extends t{init(){let e=this.chart,t=this;this.addEvent(e,"exportMenuShown",function(){t.onMenuShown()}),this.addEvent(e,"exportMenuHidden",function(){t.onMenuHidden()}),this.createProxyGroup()}onMenuHidden(){let e=this.chart.exportContextMenu;e&&e.setAttribute("aria-hidden","true"),this.setExportButtonExpandedState("false")}onMenuShown(){let e=this.chart,t=e.exportContextMenu;t&&(this.addAccessibleContextMenuAttribs(),a(e,t)),this.setExportButtonExpandedState("true")}setExportButtonExpandedState(e){this.exportButtonProxy&&this.exportButtonProxy.innerElement.setAttribute("aria-expanded",e)}onChartRender(){let e=this.chart,t=e.focusElement,i=e.accessibility;this.proxyProvider.clearGroup("chartMenu"),this.proxyMenuButton(),this.exportButtonProxy&&t&&t===e.exportingGroup&&(t.focusBorder?e.setFocusToElement(t,this.exportButtonProxy.innerElement):i&&i.keyboardNavigation.tabindexContainer.focus())}proxyMenuButton(){let e=this.chart,t=this.proxyProvider,i=h(e);(function(e){let t=e.options.exporting,i=h(e);return!!(t&&!1!==t.enabled&&t.accessibility&&t.accessibility.enabled&&i&&i.element)})(e)&&i&&(this.exportButtonProxy=t.addProxyElement("chartMenu",{click:i},"button",{"aria-label":e.langFormat("accessibility.exporting.menuButtonLabel",{chart:e,chartTitle:o(e)}),"aria-expanded":!1,title:e.options.lang.contextButtonTitle||null}))}createProxyGroup(){this.chart&&this.proxyProvider&&this.proxyProvider.addGroup("chartMenu")}addAccessibleContextMenuAttribs(){let e=this.chart,t=e.exportDivElements;if(t&&t.length){t.forEach(e=>{e&&("LI"!==e.tagName||e.children&&e.children.length?e.setAttribute("aria-hidden","true"):e.setAttribute("tabindex",-1))});let i=t[0]&&t[0].parentNode;i&&r(i,{"aria-hidden":void 0,"aria-label":e.langFormat("accessibility.exporting.chartMenuLabel",{chart:e}),role:"list"})}}getKeyboardNavigation(){let e=this.keyCodes,t=this.chart,s=this;return new i(t,{keyCodeMap:[[[e.left,e.up],function(){return s.onKbdPrevious(this)}],[[e.right,e.down],function(){return s.onKbdNext(this)}],[[e.enter,e.space],function(){return s.onKbdClick(this)}]],validate:function(){return!!t.exporting&&!1!==t.options.exporting.enabled&&!1!==t.options.exporting.accessibility.enabled},init:function(){let e=s.exportButtonProxy,i=s.chart.exportingGroup;e&&i&&t.setFocusToElement(i,e.innerElement)},terminate:function(){t.hideExportMenu()}})}onKbdPrevious(e){let t=this.chart,i=t.options.accessibility,s=e.response,n=t.highlightedExportItemIx||0;for(;n--;)if(t.highlightExportItem(n))return s.success;return i.keyboardNavigation.wrapAround?(t.highlightLastExportItem(),s.success):s.prev}onKbdNext(e){let t=this.chart,i=t.options.accessibility,s=e.response;for(let e=(t.highlightedExportItemIx||0)+1;e<t.exportDivElements.length;++e)if(t.highlightExportItem(e))return s.success;return i.keyboardNavigation.wrapAround?(t.highlightExportItem(0),s.success):s.next}onKbdClick(e){let t=this.chart,i=t.exportDivElements[t.highlightedExportItemIx],s=h(t).element;return t.openMenu?this.fakeClickEvent(i):(this.fakeClickEvent(s),t.highlightExportItem(0)),e.response.success}}return function(e){function t(){let e=h(this);if(e){let t=e.element;t.onclick&&t.onclick(l("click"))}}function i(){let e=this.exportDivElements;e&&this.exportContextMenu&&this.openMenu&&(e.forEach(e=>{e&&"highcharts-menu-item"===e.className&&e.onmouseout&&e.onmouseout(l("mouseout"))}),this.highlightedExportItemIx=0,this.exportContextMenu.hideMenu(),this.container.focus())}function s(e){let t=this.exportDivElements&&this.exportDivElements[e],i=this.exportDivElements&&this.exportDivElements[this.highlightedExportItemIx];if(t&&"LI"===t.tagName&&!(t.children&&t.children.length)){let s=!!(this.renderTo.getElementsByTagName("g")[0]||{}).focus;return t.focus&&s&&t.focus(),i&&i.onmouseout&&i.onmouseout(l("mouseout")),t.onmouseover&&t.onmouseover(l("mouseover")),this.highlightedExportItemIx=e,!0}return!1}function n(){if(this.exportDivElements){let e=this.exportDivElements.length;for(;e--;)if(this.highlightExportItem(e))return!0}return!1}e.compose=function(e){let r=e.prototype;r.hideExportMenu||(r.hideExportMenu=i,r.highlightExportItem=s,r.highlightLastExportItem=n,r.showExportMenu=t)}}(c||(c={})),c}),i(t,"Accessibility/KeyboardNavigation.js",[t["Core/Globals.js"],t["Accessibility/Components/MenuComponent.js"],t["Core/Utilities.js"],t["Accessibility/Utils/EventProvider.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t,i,s,n){let{doc:r,win:o}=e,{addEvent:a,defined:l,fireEvent:h}=i,{getElement:c,simulatedEventTarget:d}=n;class u{constructor(e,t){this.currentModuleIx=NaN,this.modules=[],this.init(e,t)}init(e,t){let i=this.eventProvider=new s;this.chart=e,this.components=t,this.modules=[],this.currentModuleIx=0,this.update(),i.addEvent(this.tabindexContainer,"keydown",e=>this.onKeydown(e)),i.addEvent(this.tabindexContainer,"focus",e=>this.onFocus(e)),["mouseup","touchend"].forEach(e=>i.addEvent(r,e,e=>this.onMouseUp(e))),["mousedown","touchstart"].forEach(t=>i.addEvent(e.renderTo,t,()=>{this.isClickingChart=!0}))}update(e){let t=this.chart.options.accessibility,i=t&&t.keyboardNavigation,s=this.components;this.updateContainerTabindex(),i&&i.enabled&&e&&e.length?(this.modules=e.reduce(function(e,t){let i=s[t].getKeyboardNavigation();return e.concat(i)},[]),this.updateExitAnchor()):(this.modules=[],this.currentModuleIx=0,this.removeExitAnchor())}updateExitAnchor(){let e=c(`highcharts-end-of-chart-marker-${this.chart.index}`);this.removeExitAnchor(),e?(this.makeElementAnExitAnchor(e),this.exitAnchor=e):this.createExitAnchor()}move(e){let t=this.modules&&this.modules[this.currentModuleIx];t&&t.terminate&&t.terminate(e),this.chart.focusElement&&this.chart.focusElement.removeFocusBorder(),this.currentModuleIx+=e;let i=this.modules&&this.modules[this.currentModuleIx];if(i){if(i.validate&&!i.validate())return this.move(e);if(i.init)return i.init(e),!0}return this.currentModuleIx=0,this.exiting=!0,e>0?this.exitAnchor&&this.exitAnchor.focus():this.tabindexContainer.focus(),!1}onFocus(e){let t=this.chart,i=e.relatedTarget&&t.container.contains(e.relatedTarget),s=t.options.accessibility,n=s&&s.keyboardNavigation;if(n&&n.enabled&&!this.exiting&&!this.tabbingInBackwards&&!this.isClickingChart&&!i){let e=this.getFirstValidModuleIx();null!==e&&(this.currentModuleIx=e,this.modules[e].init(1))}this.keyboardReset=!1,this.exiting=!1}onMouseUp(e){if(delete this.isClickingChart,!this.keyboardReset&&e.relatedTarget!==d){let t=this.chart;if(!e.target||!t.container.contains(e.target)){let e=this.modules&&this.modules[this.currentModuleIx||0];e&&e.terminate&&e.terminate(),this.currentModuleIx=0}t.focusElement&&(t.focusElement.removeFocusBorder(),delete t.focusElement),this.keyboardReset=!0}}onKeydown(e){let t;let i=e||o.event,s=this.modules&&this.modules.length&&this.modules[this.currentModuleIx],n=i.target;if((!n||"INPUT"!==n.nodeName||n.classList.contains("highcharts-a11y-proxy-element"))&&(this.keyboardReset=!1,this.exiting=!1,s)){let e=s.run(i);e===s.response.success?t=!0:e===s.response.prev?t=this.move(-1):e===s.response.next&&(t=this.move(1)),t&&(i.preventDefault(),i.stopPropagation())}}updateContainerTabindex(){let e;let t=this.chart.options.accessibility,i=t&&t.keyboardNavigation,s=!(i&&!1===i.enabled),n=this.chart,r=n.container;n.renderTo.hasAttribute("tabindex")?(r.removeAttribute("tabindex"),e=n.renderTo):e=r,this.tabindexContainer=e;let o=e.getAttribute("tabindex");s&&!o?e.setAttribute("tabindex","0"):s||n.container.removeAttribute("tabindex")}createExitAnchor(){let e=this.chart,t=this.exitAnchor=r.createElement("div");e.renderTo.appendChild(t),this.makeElementAnExitAnchor(t)}makeElementAnExitAnchor(e){let t=this.tabindexContainer.getAttribute("tabindex")||0;e.setAttribute("class","highcharts-exit-anchor"),e.setAttribute("tabindex",t),e.setAttribute("aria-hidden",!1),this.addExitAnchorEventsToEl(e)}removeExitAnchor(){if(this.exitAnchor){let e=this.eventProvider.eventRemovers.find(e=>e.element===this.exitAnchor);e&&l(e.remover)&&this.eventProvider.removeEvent(e.remover),this.exitAnchor.parentNode&&this.exitAnchor.parentNode.removeChild(this.exitAnchor),delete this.exitAnchor}}addExitAnchorEventsToEl(e){let t=this.chart,i=this;this.eventProvider.addEvent(e,"focus",function(e){let s=e||o.event,n=!(s.relatedTarget&&t.container.contains(s.relatedTarget)||i.exiting);if(t.focusElement&&delete t.focusElement,n){if(i.tabbingInBackwards=!0,i.tabindexContainer.focus(),delete i.tabbingInBackwards,s.preventDefault(),i.modules&&i.modules.length){i.currentModuleIx=i.modules.length-1;let e=i.modules[i.currentModuleIx];e&&e.validate&&!e.validate()?i.move(-1):e&&e.init(-1)}}else i.exiting=!1})}getFirstValidModuleIx(){let e=this.modules.length;for(let t=0;t<e;++t){let e=this.modules[t];if(!e.validate||e.validate())return t}return null}destroy(){this.removeExitAnchor(),this.eventProvider.removeAddedEvents(),this.chart.container.removeAttribute("tabindex")}}return function(i){function s(){let e=this;h(this,"dismissPopupContent",{},function(){e.tooltip&&e.tooltip.hide(0),e.hideExportMenu()})}function n(t){27===(t.which||t.keyCode)&&e.charts&&e.charts.forEach(e=>{e&&e.dismissPopupContent&&e.dismissPopupContent()})}i.compose=function(e){t.compose(e);let i=e.prototype;return i.dismissPopupContent||(i.dismissPopupContent=s,a(r,"keydown",n)),e}}(u||(u={})),u}),i(t,"Accessibility/Components/LegendComponent.js",[t["Core/Animation/AnimationUtilities.js"],t["Core/Globals.js"],t["Core/Legend/Legend.js"],t["Core/Utilities.js"],t["Accessibility/AccessibilityComponent.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t,i,s,n,r,o,a){let{animObject:l}=e,{doc:h}=t,{addEvent:c,fireEvent:d,isNumber:u,pick:p,syncTimeout:g}=s,{getChartTitle:m}=o,{stripHTMLTagsFromString:b,addClass:y,removeClass:f}=a;function x(e){let t=e.legend&&e.legend.allItems,i=e.options.legend.accessibility||{},s=e.colorAxis&&e.colorAxis.some(e=>!e.dataClasses||!e.dataClasses.length);return!!(t&&t.length&&!s&&!1!==i.enabled)}function v(e,t){let i=t.legendItem||{};for(let s of(t.setState(e?"hover":"",!0),["group","label","symbol"])){let t=i[s],n=t&&t.element||t;n&&d(n,e?"mouseover":"mouseout")}}class A extends n{constructor(){super(...arguments),this.highlightedLegendItemIx=NaN,this.proxyGroup=null}init(){let e=this;this.recreateProxies(),this.addEvent(i,"afterScroll",function(){this.chart===e.chart&&(e.proxyProvider.updateGroupProxyElementPositions("legend"),e.updateLegendItemProxyVisibility(),e.highlightedLegendItemIx>-1&&this.chart.highlightLegendItem(e.highlightedLegendItemIx))}),this.addEvent(i,"afterPositionItem",function(t){this.chart===e.chart&&this.chart.renderer&&e.updateProxyPositionForItem(t.item)}),this.addEvent(i,"afterRender",function(){this.chart===e.chart&&this.chart.renderer&&e.recreateProxies()&&g(()=>e.proxyProvider.updateGroupProxyElementPositions("legend"),l(p(this.chart.renderer.globalAnimation,!0)).duration)})}updateLegendItemProxyVisibility(){let e;let t=this.chart,i=t.legend,s=i.allItems||[],n=i.currentPage||1,r=i.clipHeight||0;s.forEach(s=>{if(s.a11yProxyElement){let o=i.pages&&i.pages.length,a=s.a11yProxyElement.element,l=!1;if(e=s.legendItem||{},o){let t=e.pageIx||0;l=(e.y||0)+(e.label?Math.round(e.label.getBBox().height):0)-i.pages[t]>r||t!==n-1}l?t.styledMode?y(a,"highcharts-a11y-invisible"):a.style.visibility="hidden":(f(a,"highcharts-a11y-invisible"),a.style.visibility="")}})}onChartRender(){x(this.chart)||this.removeProxies()}highlightAdjacentLegendPage(e){let t=this.chart,i=t.legend,s=(i.currentPage||1)+e,n=i.pages||[];if(s>0&&s<=n.length){let e=0;for(let n of i.allItems)((n.legendItem||{}).pageIx||0)+1===s&&t.highlightLegendItem(e)&&(this.highlightedLegendItemIx=e),++e}}updateProxyPositionForItem(e){e.a11yProxyElement&&e.a11yProxyElement.refreshPosition()}recreateProxies(){let e=h.activeElement,t=this.proxyGroup,i=e&&t&&t.contains(e);return this.removeProxies(),!!x(this.chart)&&(this.addLegendProxyGroup(),this.proxyLegendItems(),this.updateLegendItemProxyVisibility(),this.updateLegendTitle(),i&&this.chart.highlightLegendItem(this.highlightedLegendItemIx),!0)}removeProxies(){this.proxyProvider.removeGroup("legend")}updateLegendTitle(){let e=this.chart,t=b((e.legend&&e.legend.options.title&&e.legend.options.title.text||"").replace(/<br ?\/?>/g," "),e.renderer.forExport),i=e.langFormat("accessibility.legend.legendLabel"+(t?"":"NoTitle"),{chart:e,legendTitle:t,chartTitle:m(e)});this.proxyProvider.updateGroupAttrs("legend",{"aria-label":i})}addLegendProxyGroup(){let e="all"===this.chart.options.accessibility.landmarkVerbosity?"region":null;this.proxyGroup=this.proxyProvider.addGroup("legend","ul",{"aria-label":"_placeholder_",role:e})}proxyLegendItems(){let e;let t=this;((this.chart.legend||{}).allItems||[]).forEach(i=>{(e=i.legendItem||{}).label&&e.label.element&&t.proxyLegendItem(i)})}proxyLegendItem(e){let t=e.legendItem||{};if(!t.label||!t.group)return;let i=this.chart.langFormat("accessibility.legend.legendItem",{chart:this.chart,itemName:b(e.name,this.chart.renderer.forExport),item:e}),s={tabindex:-1,"aria-pressed":e.visible,"aria-label":i},n=t.group.div?t.label:t.group;e.a11yProxyElement=this.proxyProvider.addProxyElement("legend",{click:t.label,visual:n.element},"button",s)}getKeyboardNavigation(){let e=this.keyCodes,t=this,i=this.chart;return new r(i,{keyCodeMap:[[[e.left,e.right,e.up,e.down],function(e){return t.onKbdArrowKey(this,e)}],[[e.enter,e.space],function(){return t.onKbdClick(this)}],[[e.pageDown,e.pageUp],function(i){let s=i===e.pageDown?1:-1;return t.highlightAdjacentLegendPage(s),this.response.success}]],validate:function(){return t.shouldHaveLegendNavigation()},init:function(){i.highlightLegendItem(0),t.highlightedLegendItemIx=0},terminate:function(){t.highlightedLegendItemIx=-1,i.legend.allItems.forEach(e=>v(!1,e))}})}onKbdArrowKey(e,t){let{keyCodes:{left:i,up:s},highlightedLegendItemIx:n,chart:r}=this,o=r.legend.allItems.length,a=r.options.accessibility.keyboardNavigation.wrapAround,l=t===i||t===s?-1:1;return r.highlightLegendItem(n+l)?this.highlightedLegendItemIx+=l:a&&o>1&&(this.highlightedLegendItemIx=l>0?0:o-1,r.highlightLegendItem(this.highlightedLegendItemIx)),e.response.success}onKbdClick(e){let t=this.chart.legend.allItems[this.highlightedLegendItemIx];return t&&t.a11yProxyElement&&t.a11yProxyElement.click(),e.response.success}shouldHaveLegendNavigation(){if(!x(this.chart))return!1;let e=this.chart,t=(e.options.legend||{}).accessibility||{};return!!(e.legend.display&&t.keyboardNavigation&&t.keyboardNavigation.enabled)}destroy(){this.removeProxies()}}return function(e){function t(e){let t=this.legend.allItems,i=this.accessibility&&this.accessibility.components.legend.highlightedLegendItemIx,s=t[e],n=s?.legendItem||{};if(s){u(i)&&t[i]&&v(!1,t[i]),function(e,t){let i=(e.allItems[t].legendItem||{}).pageIx,s=e.currentPage;void 0!==i&&i+1!==s&&e.scroll(1+i-s)}(this.legend,e);let r=n.label,o=s.a11yProxyElement&&s.a11yProxyElement.innerElement;return r&&r.element&&o&&this.setFocusToElement(r,o),v(!0,s),!0}return!1}function i(e){let t=this.chart.options.accessibility,i=e.item;t.enabled&&i&&i.a11yProxyElement&&i.a11yProxyElement.innerElement.setAttribute("aria-pressed",e.visible?"true":"false")}e.compose=function(e,s){let n=e.prototype;n.highlightLegendItem||(n.highlightLegendItem=t,c(s,"afterColorizeItem",i))}}(A||(A={})),A}),i(t,"Stock/Navigator/ChartNavigatorComposition.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){let i;let{isTouchDevice:s}=e,{addEvent:n,merge:r,pick:o}=t,a=[];function l(){this.navigator&&this.navigator.setBaseSeries(null,!1)}function h(){let e,t,i;let s=this.legend,n=this.navigator;if(n){e=s&&s.options,t=n.xAxis,i=n.yAxis;let{scrollbarHeight:r,scrollButtonSize:a}=n;this.inverted?(n.left=n.opposite?this.chartWidth-r-n.height:this.spacing[3]+r,n.top=this.plotTop+a):(n.left=o(t.left,this.plotLeft+a),n.top=n.navigatorOptions.top||this.chartHeight-n.height-r-(this.scrollbar?.options.margin||0)-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(e&&"bottom"===e.verticalAlign&&"proximate"!==e.layout&&e.enabled&&!e.floating?s.legendHeight+o(e.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0)),t&&i&&(this.inverted?t.options.left=i.options.left=n.left:t.options.top=i.options.top=n.top,t.setAxisSize(),i.setAxisSize())}}function c(e){!this.navigator&&!this.scroller&&(this.options.navigator.enabled||this.options.scrollbar.enabled)&&(this.scroller=this.navigator=new i(this),o(e.redraw,!0)&&this.redraw(e.animation))}function d(){let e=this.options;(e.navigator.enabled||e.scrollbar.enabled)&&(this.scroller=this.navigator=new i(this))}function u(){let e=this.options,t=e.navigator,i=e.rangeSelector;if((t&&t.enabled||i&&i.enabled)&&(!s&&"x"===this.zooming.type||s&&"x"===this.zooming.pinchType))return!1}function p(e){let t=e.navigator;if(t&&e.xAxis[0]){let i=e.xAxis[0].getExtremes();t.render(i.min,i.max)}}function g(e){let t=e.options.navigator||{},i=e.options.scrollbar||{};!this.navigator&&!this.scroller&&(t.enabled||i.enabled)&&(r(!0,this.options.navigator,t),r(!0,this.options.scrollbar,i),delete e.options.navigator,delete e.options.scrollbar)}return{compose:function(e,s){if(t.pushUnique(a,e)){let t=e.prototype;i=s,t.callbacks.push(p),n(e,"afterAddSeries",l),n(e,"afterSetChartSize",h),n(e,"afterUpdate",c),n(e,"beforeRender",d),n(e,"beforeShowResetZoom",u),n(e,"update",g)}}}}),i(t,"Core/Axis/NavigatorAxisComposition.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{isTouchDevice:i}=e,{addEvent:s,correctFloat:n,defined:r,isNumber:o,pick:a}=t;function l(){this.navigatorAxis||(this.navigatorAxis=new c(this))}function h(e){let t;let s=this.chart,n=s.options,o=n.navigator,a=this.navigatorAxis,l=s.zooming.pinchType,h=n.rangeSelector,c=s.zooming.type;if(this.isXAxis&&(o?.enabled||h?.enabled)){if("y"===c&&"zoom"===e.trigger)t=!1;else if(("zoom"===e.trigger&&"xy"===c||i&&"xy"===l)&&this.options.range){let t=a.previousZoom;r(e.min)?a.previousZoom=[this.min,this.max]:t&&(e.min=t[0],e.max=t[1],a.previousZoom=void 0)}}void 0!==t&&e.preventDefault()}class c{static compose(e){e.keepProps.includes("navigatorAxis")||(e.keepProps.push("navigatorAxis"),s(e,"init",l),s(e,"setExtremes",h))}constructor(e){this.axis=e}destroy(){this.axis=void 0}toFixedRange(e,t,i,s){let l=this.axis,h=(l.pointRange||0)/2,c=a(i,l.translate(e,!0,!l.horiz)),d=a(s,l.translate(t,!0,!l.horiz));return r(i)||(c=n(c+h)),r(s)||(d=n(d-h)),o(c)&&o(d)||(c=d=void 0),{min:c,max:d}}}return c}),i(t,"Stock/Navigator/NavigatorDefaults.js",[t["Core/Color/Color.js"],t["Core/Series/SeriesRegistry.js"]],function(e,t){let{parse:i}=e,{seriesTypes:s}=t;return{height:40,margin:25,maskInside:!0,handles:{width:7,borderRadius:0,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0,lineWidth:1,backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:i("#667aff").setOpacity(.3).get(),outlineColor:"#999999",outlineWidth:1,series:{type:void 0===s.areaspline?"line":"areaspline",fillOpacity:.05,lineWidth:1,compare:null,sonification:{enabled:!1},dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,firstAnchor:"firstPoint",anchor:"middle",lastAnchor:"lastPoint",units:[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2,3,4]],["week",[1,2,3]],["month",[1,3,6]],["year",null]]},dataLabels:{enabled:!1,zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",id:"navigator-x-axis",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#000000",fontSize:"0.7em",opacity:.6,textOutline:"2px contrast"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,id:"navigator-y-axis",maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},tickLength:0,tickWidth:0}}}),i(t,"Stock/Navigator/NavigatorSymbols.js",[t["Core/Renderer/SVG/Symbols.js"],t["Core/Utilities.js"]],function(e,t){let{relativeLength:i}=t;return{"navigator-handle":function(t,s,n,r,o={}){let a=o.width?o.width/2:n,l=i(o.borderRadius||0,Math.min(2*a,r));return[["M",-1.5,(r=o.height||r)/2-3.5],["L",-1.5,r/2+4.5],["M",.5,r/2-3.5],["L",.5,r/2+4.5],...e.rect(-a-1,.5,2*a+1,r,{r:l})]}}}),i(t,"Stock/Utilities/StockUtilities.js",[t["Core/Utilities.js"]],function(e){let{defined:t}=e;return{setFixedRange:function(e){let i=this.xAxis[0];t(i.dataMax)&&t(i.dataMin)&&e?this.fixedRange=Math.min(e,i.dataMax-i.dataMin):this.fixedRange=e}}}),i(t,"Stock/Navigator/NavigatorComposition.js",[t["Core/Defaults.js"],t["Core/Globals.js"],t["Core/Axis/NavigatorAxisComposition.js"],t["Stock/Navigator/NavigatorDefaults.js"],t["Stock/Navigator/NavigatorSymbols.js"],t["Core/Renderer/RendererRegistry.js"],t["Stock/Utilities/StockUtilities.js"],t["Core/Utilities.js"]],function(e,t,i,s,n,r,o,a){let{setOptions:l}=e,{composed:h}=t,{getRendererType:c}=r,{setFixedRange:d}=o,{addEvent:u,extend:p,pushUnique:g}=a;function m(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}return{compose:function(e,t,r){i.compose(t),g(h,"Navigator")&&(e.prototype.setFixedRange=d,p(c().prototype.symbols,n),u(r,"afterUpdate",m),l({navigator:s}))}}}),i(t,"Core/Axis/ScrollbarAxis.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){var i;let{composed:s}=e,{addEvent:n,defined:r,pick:o,pushUnique:a}=t;return function(e){let t;function i(e){let t=o(e.options&&e.options.min,e.min),i=o(e.options&&e.options.max,e.max);return{axisMin:t,axisMax:i,scrollMin:r(e.dataMin)?Math.min(t,e.min,e.dataMin,o(e.threshold,1/0)):t,scrollMax:r(e.dataMax)?Math.max(i,e.max,e.dataMax,o(e.threshold,-1/0)):i}}function l(){let e=this.scrollbar,t=e&&!e.options.opposite,i=this.horiz?2:t?3:1;e&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[i]+=e.size+(e.options.margin||0))}function h(){let e=this;e.options&&e.options.scrollbar&&e.options.scrollbar.enabled&&(e.options.scrollbar.vertical=!e.horiz,e.options.startOnTick=e.options.endOnTick=!1,e.scrollbar=new t(e.chart.renderer,e.options.scrollbar,e.chart),n(e.scrollbar,"changed",function(t){let s,n;let{axisMin:o,axisMax:a,scrollMin:l,scrollMax:h}=i(e),c=h-l;if(r(o)&&r(a)){if(e.horiz&&!e.reversed||!e.horiz&&e.reversed?(s=l+c*this.to,n=l+c*this.from):(s=l+c*(1-this.from),n=l+c*(1-this.to)),this.shouldUpdateExtremes(t.DOMType)){let i="mousemove"!==t.DOMType&&"touchmove"!==t.DOMType&&void 0;e.setExtremes(n,s,!0,i,t)}else this.setRange(this.from,this.to)}}))}function c(){let e,t,s;let{scrollMin:n,scrollMax:o}=i(this),a=this.scrollbar,l=this.axisTitleMargin+(this.titleOffset||0),h=this.chart.scrollbarsOffsets,c=this.options.margin||0;if(a&&h){if(this.horiz)this.opposite||(h[1]+=l),a.position(this.left,this.top+this.height+2+h[1]-(this.opposite?c:0),this.width,this.height),this.opposite||(h[1]+=c),e=1;else{let t;this.opposite&&(h[0]+=l),t=a.options.opposite?this.left+this.width+2+h[0]-(this.opposite?0:c):this.opposite?0:c,a.position(t,this.top,this.width,this.height),this.opposite&&(h[0]+=c),e=0}if(h[e]+=a.size+(a.options.margin||0),isNaN(n)||isNaN(o)||!r(this.min)||!r(this.max)||this.dataMin===this.dataMax)a.setRange(0,1);else if(this.min===this.max){let e=this.pointRange/(this.dataMax+1);t=e*this.min,s=e*(this.max+1),a.setRange(t,s)}else t=(this.min-n)/(o-n),s=(this.max-n)/(o-n),this.horiz&&!this.reversed||!this.horiz&&this.reversed?a.setRange(t,s):a.setRange(1-s,1-t)}}e.compose=function(e,i){a(s,"Axis.Scrollbar")&&(t=i,n(e,"afterGetOffset",l),n(e,"afterInit",h),n(e,"afterRender",c))}}(i||(i={})),i}),i(t,"Stock/Scrollbar/ScrollbarDefaults.js",[],function(){return{height:10,barBorderRadius:5,buttonBorderRadius:0,buttonsEnabled:!1,liveRedraw:void 0,margin:void 0,minWidth:6,opposite:!0,step:.2,zIndex:3,barBackgroundColor:"#cccccc",barBorderWidth:0,barBorderColor:"#cccccc",buttonArrowColor:"#333333",buttonBackgroundColor:"#e6e6e6",buttonBorderColor:"#cccccc",buttonBorderWidth:1,rifleColor:"none",trackBackgroundColor:"rgba(255, 255, 255, 0.001)",trackBorderColor:"#cccccc",trackBorderRadius:5,trackBorderWidth:1}}),i(t,"Stock/Scrollbar/Scrollbar.js",[t["Core/Defaults.js"],t["Core/Globals.js"],t["Core/Axis/ScrollbarAxis.js"],t["Stock/Scrollbar/ScrollbarDefaults.js"],t["Core/Utilities.js"]],function(e,t,i,s,n){let{defaultOptions:r}=e,{addEvent:o,correctFloat:a,crisp:l,defined:h,destroyObjectProperties:c,fireEvent:d,merge:u,pick:p,removeEvent:g}=n;class m{static compose(e){i.compose(e,m)}static swapXY(e,t){return t&&e.forEach(e=>{let t;let i=e.length;for(let s=0;s<i;s+=2)"number"==typeof(t=e[s+1])&&(e[s+1]=e[s+2],e[s+2]=t)}),e}constructor(e,t,i){this._events=[],this.chartX=0,this.chartY=0,this.from=0,this.scrollbarButtons=[],this.scrollbarLeft=0,this.scrollbarStrokeWidth=1,this.scrollbarTop=0,this.size=0,this.to=0,this.trackBorderWidth=1,this.x=0,this.y=0,this.init(e,t,i)}addEvents(){let e=this.options.inverted?[1,0]:[0,1],t=this.scrollbarButtons,i=this.scrollbarGroup.element,s=this.track.element,n=this.mouseDownHandler.bind(this),r=this.mouseMoveHandler.bind(this),a=this.mouseUpHandler.bind(this),l=[[t[e[0]].element,"click",this.buttonToMinClick.bind(this)],[t[e[1]].element,"click",this.buttonToMaxClick.bind(this)],[s,"click",this.trackClick.bind(this)],[i,"mousedown",n],[i.ownerDocument,"mousemove",r],[i.ownerDocument,"mouseup",a],[i,"touchstart",n],[i.ownerDocument,"touchmove",r],[i.ownerDocument,"touchend",a]];l.forEach(function(e){o.apply(null,e)}),this._events=l}buttonToMaxClick(e){let t=(this.to-this.from)*p(this.options.step,.2);this.updatePosition(this.from+t,this.to+t),d(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:e})}buttonToMinClick(e){let t=a(this.to-this.from)*p(this.options.step,.2);this.updatePosition(a(this.from-t),a(this.to-t)),d(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:e})}cursorToScrollbarPosition(e){let t=this.options,i=t.minWidth>this.calculatedWidth?t.minWidth:0;return{chartX:(e.chartX-this.x-this.xOffset)/(this.barWidth-i),chartY:(e.chartY-this.y-this.yOffset)/(this.barWidth-i)}}destroy(){let e=this,t=e.chart.scroller;e.removeEvents(),["track","scrollbarRifles","scrollbar","scrollbarGroup","group"].forEach(function(t){e[t]&&e[t].destroy&&(e[t]=e[t].destroy())}),t&&e===t.scrollbar&&(t.scrollbar=null,c(t.scrollbarButtons))}drawScrollbarButton(e){let t=this.renderer,i=this.scrollbarButtons,s=this.options,n=this.size,r=t.g().add(this.group);if(i.push(r),s.buttonsEnabled){let o=t.rect().addClass("highcharts-scrollbar-button").add(r);this.chart.styledMode||o.attr({stroke:s.buttonBorderColor,"stroke-width":s.buttonBorderWidth,fill:s.buttonBackgroundColor}),o.attr(o.crisp({x:-.5,y:-.5,width:n,height:n,r:s.buttonBorderRadius},o.strokeWidth()));let a=t.path(m.swapXY([["M",n/2+(e?-1:1),n/2-3],["L",n/2+(e?-1:1),n/2+3],["L",n/2+(e?2:-2),n/2]],s.vertical)).addClass("highcharts-scrollbar-arrow").add(i[e]);this.chart.styledMode||a.attr({fill:s.buttonArrowColor})}}init(e,t,i){this.scrollbarButtons=[],this.renderer=e,this.userOptions=t,this.options=u(s,r.scrollbar,t),this.options.margin=p(this.options.margin,10),this.chart=i,this.size=p(this.options.size,this.options.height),t.enabled&&(this.render(),this.addEvents())}mouseDownHandler(e){let t=this.chart.pointer?.normalize(e)||e,i=this.cursorToScrollbarPosition(t);this.chartX=i.chartX,this.chartY=i.chartY,this.initPositions=[this.from,this.to],this.grabbedCenter=!0}mouseMoveHandler(e){let t;let i=this.chart.pointer?.normalize(e)||e,s=this.options.vertical?"chartY":"chartX",n=this.initPositions||[];this.grabbedCenter&&(!e.touches||0!==e.touches[0][s])&&(t=this.cursorToScrollbarPosition(i)[s]-this[s],this.hasDragged=!0,this.updatePosition(n[0]+t,n[1]+t),this.hasDragged&&d(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:e.type,DOMEvent:e}))}mouseUpHandler(e){this.hasDragged&&d(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:e.type,DOMEvent:e}),this.grabbedCenter=this.hasDragged=this.chartX=this.chartY=null}position(e,t,i,s){let{buttonsEnabled:n,margin:r=0,vertical:o}=this.options,a=this.rendered?"animate":"attr",l=s,h=0;this.group.show(),this.x=e,this.y=t+this.trackBorderWidth,this.width=i,this.height=s,this.xOffset=l,this.yOffset=h,o?(this.width=this.yOffset=i=h=this.size,this.xOffset=l=0,this.yOffset=h=n?this.size:0,this.barWidth=s-(n?2*i:0),this.x=e+=r):(this.height=s=this.size,this.xOffset=l=n?this.size:0,this.barWidth=i-(n?2*s:0),this.y=this.y+r),this.group[a]({translateX:e,translateY:this.y}),this.track[a]({width:i,height:s}),this.scrollbarButtons[1][a]({translateX:o?0:i-l,translateY:o?s-h:0})}removeEvents(){this._events.forEach(function(e){g.apply(null,e)}),this._events.length=0}render(){let e=this.renderer,t=this.options,i=this.size,s=this.chart.styledMode,n=e.g("scrollbar").attr({zIndex:t.zIndex}).hide().add();this.group=n,this.track=e.rect().addClass("highcharts-scrollbar-track").attr({r:t.trackBorderRadius||0,height:i,width:i}).add(n),s||this.track.attr({fill:t.trackBackgroundColor,stroke:t.trackBorderColor,"stroke-width":t.trackBorderWidth});let r=this.trackBorderWidth=this.track.strokeWidth();this.track.attr({x:-l(0,r),y:-l(0,r)}),this.scrollbarGroup=e.g().add(n),this.scrollbar=e.rect().addClass("highcharts-scrollbar-thumb").attr({height:i-r,width:i-r,r:t.barBorderRadius||0}).add(this.scrollbarGroup),this.scrollbarRifles=e.path(m.swapXY([["M",-3,i/4],["L",-3,2*i/3],["M",0,i/4],["L",0,2*i/3],["M",3,i/4],["L",3,2*i/3]],t.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup),s||(this.scrollbar.attr({fill:t.barBackgroundColor,stroke:t.barBorderColor,"stroke-width":t.barBorderWidth}),this.scrollbarRifles.attr({stroke:t.rifleColor,"stroke-width":1})),this.scrollbarStrokeWidth=this.scrollbar.strokeWidth(),this.scrollbarGroup.translate(-l(0,this.scrollbarStrokeWidth),-l(0,this.scrollbarStrokeWidth)),this.drawScrollbarButton(0),this.drawScrollbarButton(1)}setRange(e,t){let i,s;let n=this.options,r=n.vertical,o=n.minWidth,l=this.barWidth,c=!this.rendered||this.hasDragged||this.chart.navigator&&this.chart.navigator.hasDragged?"attr":"animate";if(!h(l))return;let d=l*Math.min(t,1);i=Math.ceil(l*(e=Math.max(e,0))),this.calculatedWidth=s=a(d-i),s<o&&(i=(l-o+s)*e,s=o);let u=Math.floor(i+this.xOffset+this.yOffset),p=s/2-.5;this.from=e,this.to=t,r?(this.scrollbarGroup[c]({translateY:u}),this.scrollbar[c]({height:s}),this.scrollbarRifles[c]({translateY:p}),this.scrollbarTop=u,this.scrollbarLeft=0):(this.scrollbarGroup[c]({translateX:u}),this.scrollbar[c]({width:s}),this.scrollbarRifles[c]({translateX:p}),this.scrollbarLeft=u,this.scrollbarTop=0),s<=12?this.scrollbarRifles.hide():this.scrollbarRifles.show(),!1===n.showFull&&(e<=0&&t>=1?this.group.hide():this.group.show()),this.rendered=!0}shouldUpdateExtremes(e){return p(this.options.liveRedraw,t.svg&&!t.isTouchDevice&&!this.chart.boosted)||"mouseup"===e||"touchend"===e||!h(e)}trackClick(e){let t=this.chart.pointer?.normalize(e)||e,i=this.to-this.from,s=this.y+this.scrollbarTop,n=this.x+this.scrollbarLeft;this.options.vertical&&t.chartY>s||!this.options.vertical&&t.chartX>n?this.updatePosition(this.from+i,this.to+i):this.updatePosition(this.from-i,this.to-i),d(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:e})}update(e){this.destroy(),this.init(this.chart.renderer,u(!0,this.options,e),this.chart)}updatePosition(e,t){t>1&&(e=a(1-a(t-e)),t=1),e<0&&(t=a(t-e),e=0),this.from=e,this.to=t}}return m.defaultOptions=s,r.scrollbar=u(!0,m.defaultOptions,r.scrollbar),m}),i(t,"Stock/Navigator/Navigator.js",[t["Core/Axis/Axis.js"],t["Stock/Navigator/ChartNavigatorComposition.js"],t["Core/Defaults.js"],t["Core/Globals.js"],t["Core/Axis/NavigatorAxisComposition.js"],t["Stock/Navigator/NavigatorComposition.js"],t["Stock/Scrollbar/Scrollbar.js"],t["Core/Renderer/SVG/SVGRenderer.js"],t["Core/Utilities.js"]],function(e,t,i,s,n,r,o,a,l){let{defaultOptions:h}=i,{isTouchDevice:c}=s,{prototype:{symbols:d}}=a,{addEvent:u,clamp:p,correctFloat:g,defined:m,destroyObjectProperties:b,erase:y,extend:f,find:x,fireEvent:v,isArray:A,isNumber:C,merge:w,pick:E,removeEvent:T,splat:M}=l;function S(e,...t){let i=[].filter.call(t,C);if(i.length)return Math[e].apply(0,i)}class k{static compose(e,i,s){t.compose(e,k),r.compose(e,i,s)}constructor(e){this.isDirty=!1,this.scrollbarHeight=0,this.init(e)}drawHandle(e,t,i,s){let n=this.navigatorOptions.handles.height;this.handles[t][s](i?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+parseInt(e,10)+.5-n)}:{translateX:Math.round(this.left+parseInt(e,10)),translateY:Math.round(this.top+this.height/2-n/2-1)})}drawOutline(e,t,i,s){let n=this.navigatorOptions.maskInside,r=this.outline.strokeWidth(),o=r/2,a=r%2/2,l=this.scrollButtonSize,h=this.size,c=this.top,d=this.height,u=c-o,p=c+d,g=this.left,m,b;i?(m=c+t+a,t=c+e+a,b=[["M",g+d,c-l-a],["L",g+d,m],["L",g,m],["M",g,t],["L",g+d,t],["L",g+d,c+h+l]],n&&b.push(["M",g+d,m-o],["L",g+d,t+o])):(g-=l,e+=g+l-a,t+=g+l-a,b=[["M",g,u],["L",e,u],["L",e,p],["M",t,p],["L",t,u],["L",g+h+2*l,u]],n&&b.push(["M",e-o,u],["L",t+o,u])),this.outline[s]({d:b})}drawMasks(e,t,i,s){let n,r,o,a;let l=this.left,h=this.top,c=this.height;i?(o=[l,l,l],a=[h,h+e,h+t],r=[c,c,c],n=[e,t-e,this.size-t]):(o=[l,l+e,l+t],a=[h,h,h],r=[e,t-e,this.size-t],n=[c,c,c]),this.shades.forEach((e,t)=>{e[s]({x:o[t],y:a[t],width:r[t],height:n[t]})})}renderElements(){let e=this,t=e.navigatorOptions,i=t.maskInside,s=e.chart,n=s.inverted,r=s.renderer,o={cursor:n?"ns-resize":"ew-resize"},a=e.navigatorGroup??(e.navigatorGroup=r.g("navigator").attr({zIndex:8,visibility:"hidden"}).add());if([!i,i,!i].forEach((i,n)=>{let l=e.shades[n]??(e.shades[n]=r.rect().addClass("highcharts-navigator-mask"+(1===n?"-inside":"-outside")).add(a));s.styledMode||(l.attr({fill:i?t.maskFill:"rgba(0,0,0,0)"}),1===n&&l.css(o))}),e.outline||(e.outline=r.path().addClass("highcharts-navigator-outline").add(a)),s.styledMode||e.outline.attr({"stroke-width":t.outlineWidth,stroke:t.outlineColor}),t.handles?.enabled){let i=t.handles,{height:n,width:l}=i;[0,1].forEach(t=>{let h=i.symbols[t];if(e.handles[t]&&e.handles[t].symbolUrl===h){if(!e.handles[t].isImg&&e.handles[t].symbolName!==h){let i=d[h].call(d,-l/2-1,0,l,n);e.handles[t].attr({d:i}),e.handles[t].symbolName=h}}else e.handles[t]?.destroy(),e.handles[t]=r.symbol(h,-l/2-1,0,l,n,i),e.handles[t].attr({zIndex:7-t}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][t]).add(a),e.addMouseEvents();s.inverted&&e.handles[t].attr({rotation:90,rotationOriginX:Math.floor(-l/2),rotationOriginY:(n+l)/2}),s.styledMode||e.handles[t].attr({fill:i.backgroundColor,stroke:i.borderColor,"stroke-width":i.lineWidth,width:i.width,height:i.height,x:-l/2-1,y:0}).css(o)})}}update(e,t=!1){let i=this.chart,s=i.options.chart.inverted!==i.scrollbar?.options.vertical;if(w(!0,i.options.navigator,e),this.navigatorOptions=i.options.navigator||{},this.setOpposite(),m(e.enabled)||s)return this.destroy(),this.navigatorEnabled=e.enabled||this.navigatorEnabled,this.init(i);if(this.navigatorEnabled&&(this.isDirty=!0,!1===e.adaptToUpdatedData&&this.baseSeries.forEach(e=>{T(e,"updatedData",this.updatedDataHandler)},this),e.adaptToUpdatedData&&this.baseSeries.forEach(e=>{e.eventsToUnbind.push(u(e,"updatedData",this.updatedDataHandler))},this),(e.series||e.baseSeries)&&this.setBaseSeries(void 0,!1),e.height||e.xAxis||e.yAxis)){this.height=e.height??this.height;let t=this.getXAxisOffsets();this.xAxis.update({...e.xAxis,offsets:t,[i.inverted?"width":"height"]:this.height,[i.inverted?"height":"width"]:void 0},!1),this.yAxis.update({...e.yAxis,[i.inverted?"width":"height"]:this.height},!1)}t&&i.redraw()}render(e,t,i,s){let n=this.chart,r=this.xAxis,o=r.pointRange||0,a=r.navigatorAxis.fake?n.xAxis[0]:r,l=this.navigatorEnabled,h=this.rendered,c=n.inverted,d=n.xAxis[0].minRange,u=n.xAxis[0].options.maxRange,b=this.scrollButtonSize,y,f,x,A=this.scrollbarHeight,w,T;if(this.hasDragged&&!m(i))return;if(this.isDirty&&this.renderElements(),e=g(e-o/2),t=g(t+o/2),!C(e)||!C(t)){if(!h)return;i=0,s=E(r.width,a.width)}this.left=E(r.left,n.plotLeft+b+(c?n.plotWidth:0));let M=this.size=w=E(r.len,(c?n.plotHeight:n.plotWidth)-2*b);y=c?A:w+2*b,i=E(i,r.toPixels(e,!0)),s=E(s,r.toPixels(t,!0)),C(i)&&Math.abs(i)!==1/0||(i=0,s=y);let S=r.toValue(i,!0),k=r.toValue(s,!0),P=Math.abs(g(k-S));P<d?this.grabbedLeft?i=r.toPixels(k-d-o,!0):this.grabbedRight&&(s=r.toPixels(S+d+o,!0)):m(u)&&g(P-o)>u&&(this.grabbedLeft?i=r.toPixels(k-u-o,!0):this.grabbedRight&&(s=r.toPixels(S+u+o,!0))),this.zoomedMax=p(Math.max(i,s),0,M),this.zoomedMin=p(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(i,s),0,M),this.range=this.zoomedMax-this.zoomedMin,M=Math.round(this.zoomedMax);let D=Math.round(this.zoomedMin);l&&(this.navigatorGroup.attr({visibility:"inherit"}),T=h&&!this.hasDragged?"animate":"attr",this.drawMasks(D,M,c,T),this.drawOutline(D,M,c,T),this.navigatorOptions.handles.enabled&&(this.drawHandle(D,0,c,T),this.drawHandle(M,1,c,T))),this.scrollbar&&(c?(x=this.top-b,f=this.left-A+(l||!a.opposite?0:(a.titleOffset||0)+a.axisTitleMargin),A=w+2*b):(x=this.top+(l?this.height:-A),f=this.left-b),this.scrollbar.position(f,x,y,A),this.scrollbar.setRange(this.zoomedMin/(w||1),this.zoomedMax/(w||1))),this.rendered=!0,this.isDirty=!1,v(this,"afterRender")}addMouseEvents(){let e=this,t=e.chart,i=t.container,s=[],n,r;e.mouseMoveHandler=n=function(t){e.onMouseMove(t)},e.mouseUpHandler=r=function(t){e.onMouseUp(t)},(s=e.getPartsEvents("mousedown")).push(u(t.renderTo,"mousemove",n),u(i.ownerDocument,"mouseup",r),u(t.renderTo,"touchmove",n),u(i.ownerDocument,"touchend",r)),s.concat(e.getPartsEvents("touchstart")),e.eventsToUnbind=s,e.series&&e.series[0]&&s.push(u(e.series[0].xAxis,"foundExtremes",function(){t.navigator.modifyNavigatorAxisExtremes()}))}getPartsEvents(e){let t=this,i=[];return["shades","handles"].forEach(function(s){t[s].forEach(function(n,r){i.push(u(n.element,e,function(e){t[s+"Mousedown"](e,r)}))})}),i}shadesMousedown(e,t){e=this.chart.pointer?.normalize(e)||e;let i=this.chart,s=this.xAxis,n=this.zoomedMin,r=this.size,o=this.range,a=this.left,l=e.chartX,h,c,d,u;i.inverted&&(l=e.chartY,a=this.top),1===t?(this.grabbedCenter=l,this.fixedWidth=o,this.dragOffset=l-n):(u=l-a-o/2,0===t?u=Math.max(0,u):2===t&&u+o>=r&&(u=r-o,this.reversedExtremes?(u-=o,c=this.getUnionExtremes().dataMin):h=this.getUnionExtremes().dataMax),u!==n&&(this.fixedWidth=o,m((d=s.navigatorAxis.toFixedRange(u,u+o,c,h)).min)&&v(this,"setRange",{min:Math.min(d.min,d.max),max:Math.max(d.min,d.max),redraw:!0,eventArguments:{trigger:"navigator"}})))}handlesMousedown(e,t){e=this.chart.pointer?.normalize(e)||e;let i=this.chart,s=i.xAxis[0],n=this.reversedExtremes;0===t?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=n?s.min:s.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=n?s.max:s.min),i.setFixedRange(void 0)}onMouseMove(e){let t=this,i=t.chart,s=t.navigatorSize,n=t.range,r=t.dragOffset,o=i.inverted,a=t.left,l;(!e.touches||0!==e.touches[0].pageX)&&(l=(e=i.pointer?.normalize(e)||e).chartX,o&&(a=t.top,l=e.chartY),t.grabbedLeft?(t.hasDragged=!0,t.render(0,0,l-a,t.otherHandlePos)):t.grabbedRight?(t.hasDragged=!0,t.render(0,0,t.otherHandlePos,l-a)):t.grabbedCenter&&(t.hasDragged=!0,l<r?l=r:l>s+r-n&&(l=s+r-n),t.render(0,0,l-r,l-r+n)),t.hasDragged&&t.scrollbar&&E(t.scrollbar.options.liveRedraw,!c&&!this.chart.boosted)&&(e.DOMType=e.type,setTimeout(function(){t.onMouseUp(e)},0)))}onMouseUp(e){let t,i,s,n,r,o;let a=this.chart,l=this.xAxis,h=this.scrollbar,c=e.DOMEvent||e,d=a.inverted,u=this.rendered&&!this.hasDragged?"animate":"attr";(this.hasDragged&&(!h||!h.hasDragged)||"scrollbar"===e.trigger)&&(s=this.getUnionExtremes(),this.zoomedMin===this.otherHandlePos?n=this.fixedExtreme:this.zoomedMax===this.otherHandlePos&&(r=this.fixedExtreme),this.zoomedMax===this.size&&(r=this.reversedExtremes?s.dataMin:s.dataMax),0===this.zoomedMin&&(n=this.reversedExtremes?s.dataMax:s.dataMin),m((o=l.navigatorAxis.toFixedRange(this.zoomedMin,this.zoomedMax,n,r)).min)&&v(this,"setRange",{min:Math.min(o.min,o.max),max:Math.max(o.min,o.max),redraw:!0,animation:!this.hasDragged&&null,eventArguments:{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:c}})),"mousemove"!==e.DOMType&&"touchmove"!==e.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null),this.navigatorEnabled&&C(this.zoomedMin)&&C(this.zoomedMax)&&(i=Math.round(this.zoomedMin),t=Math.round(this.zoomedMax),this.shades&&this.drawMasks(i,t,d,u),this.outline&&this.drawOutline(i,t,d,u),this.navigatorOptions.handles.enabled&&Object.keys(this.handles).length===this.handles.length&&(this.drawHandle(i,0,d,u),this.drawHandle(t,1,d,u)))}removeEvents(){this.eventsToUnbind&&(this.eventsToUnbind.forEach(function(e){e()}),this.eventsToUnbind=void 0),this.removeBaseSeriesEvents()}removeBaseSeriesEvents(){let e=this.baseSeries||[];this.navigatorEnabled&&e[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&e.forEach(function(e){T(e,"updatedData",this.updatedDataHandler)},this),e[0].xAxis&&T(e[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))}getXAxisOffsets(){return this.chart.inverted?[this.scrollButtonSize,0,-this.scrollButtonSize,0]:[0,-this.scrollButtonSize,0,this.scrollButtonSize]}init(t){let i=t.options,s=i.navigator||{},r=s.enabled,a=i.scrollbar||{},l=a.enabled,h=r&&s.height||0,c=l&&a.height||0,d=a.buttonsEnabled&&c||0;this.handles=[],this.shades=[],this.chart=t,this.setBaseSeries(),this.height=h,this.scrollbarHeight=c,this.scrollButtonSize=d,this.scrollbarEnabled=l,this.navigatorEnabled=r,this.navigatorOptions=s,this.scrollbarOptions=a,this.setOpposite();let p=this,g=p.baseSeries,m=t.xAxis.length,b=t.yAxis.length,y=g&&g[0]&&g[0].xAxis||t.xAxis[0]||{options:{}};if(t.isDirtyBox=!0,p.navigatorEnabled){let i=this.getXAxisOffsets();p.xAxis=new e(t,w({breaks:y.options.breaks,ordinal:y.options.ordinal,overscroll:y.options.overscroll},s.xAxis,{type:"datetime",yAxis:s.yAxis?.id,index:m,isInternal:!0,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:y.options.ordinal?0:y.options.minPadding,maxPadding:y.options.ordinal?0:y.options.maxPadding,zoomEnabled:!1},t.inverted?{offsets:i,width:h}:{offsets:i,height:h}),"xAxis"),p.yAxis=new e(t,w(s.yAxis,{alignTicks:!1,offset:0,index:b,isInternal:!0,reversed:E(s.yAxis&&s.yAxis.reversed,t.yAxis[0]&&t.yAxis[0].reversed,!1),zoomEnabled:!1},t.inverted?{width:h}:{height:h}),"yAxis"),g||s.series.data?p.updateNavigatorSeries(!1):0===t.series.length&&(p.unbindRedraw=u(t,"beforeRedraw",function(){t.series.length>0&&!p.series&&(p.setBaseSeries(),p.unbindRedraw())})),p.reversedExtremes=t.inverted&&!p.xAxis.reversed||!t.inverted&&p.xAxis.reversed,p.renderElements(),p.addMouseEvents()}else p.xAxis={chart:t,navigatorAxis:{fake:!0},translate:function(e,i){let s=t.xAxis[0],n=s.getExtremes(),r=s.len-2*d,o=S("min",s.options.min,n.dataMin),a=S("max",s.options.max,n.dataMax)-o;return i?e*a/r+o:r*(e-o)/a},toPixels:function(e){return this.translate(e)},toValue:function(e){return this.translate(e,!0)}},p.xAxis.navigatorAxis.axis=p.xAxis,p.xAxis.navigatorAxis.toFixedRange=n.prototype.toFixedRange.bind(p.xAxis.navigatorAxis);if(t.options.scrollbar.enabled){let e=w(t.options.scrollbar,{vertical:t.inverted});!C(e.margin)&&p.navigatorEnabled&&(e.margin=t.inverted?-3:3),t.scrollbar=p.scrollbar=new o(t.renderer,e,t),u(p.scrollbar,"changed",function(e){let t=p.size,i=t*this.to,s=t*this.from;p.hasDragged=p.scrollbar.hasDragged,p.render(0,0,s,i),this.shouldUpdateExtremes(e.DOMType)&&setTimeout(function(){p.onMouseUp(e)})})}p.addBaseSeriesEvents(),p.addChartEvents()}setOpposite(){let e=this.navigatorOptions,t=this.navigatorEnabled,i=this.chart;this.opposite=E(e.opposite,!!(!t&&i.inverted))}getUnionExtremes(e){let t;let i=this.chart.xAxis[0],s=this.xAxis,n=s.options,r=i.options;return e&&null===i.dataMin||(t={dataMin:E(n&&n.min,S("min",r.min,i.dataMin,s.dataMin,s.min)),dataMax:E(n&&n.max,S("max",r.max,i.dataMax,s.dataMax,s.max))}),t}setBaseSeries(e,t){let i=this.chart,s=this.baseSeries=[];e=e||i.options&&i.options.navigator.baseSeries||(i.series.length?x(i.series,e=>!e.options.isInternal).index:0),(i.series||[]).forEach((t,i)=>{!t.options.isInternal&&(t.options.showInNavigator||(i===e||t.options.id===e)&&!1!==t.options.showInNavigator)&&s.push(t)}),this.xAxis&&!this.xAxis.navigatorAxis.fake&&this.updateNavigatorSeries(!0,t)}updateNavigatorSeries(e,t){let i=this,s=i.chart,n=i.baseSeries,r={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:this.navigatorOptions.xAxis?.id,yAxis:this.navigatorOptions.yAxis?.id,showInLegend:!1,stacking:void 0,isInternal:!0,states:{inactive:{opacity:1}}},o=i.series=(i.series||[]).filter(e=>{let t=e.baseSeries;return!(0>n.indexOf(t))||(t&&(T(t,"updatedData",i.updatedDataHandler),delete t.navigatorSeries),e.chart&&e.destroy(),!1)}),a,l,c=i.navigatorOptions.series,d;n&&n.length&&n.forEach(e=>{let u=e.navigatorSeries,p=f({color:e.color,visible:e.visible},A(c)?h.navigator.series:c);if(u&&!1===i.navigatorOptions.adaptToUpdatedData)return;r.name="Navigator "+n.length,d=(a=e.options||{}).navigatorOptions||{},p.dataLabels=M(p.dataLabels),(l=w(a,r,p,d)).pointRange=E(p.pointRange,d.pointRange,h.plotOptions[l.type||"line"].pointRange);let g=d.data||p.data;i.hasNavigatorData=i.hasNavigatorData||!!g,l.data=g||a.data&&a.data.slice(0),u&&u.options?u.update(l,t):(e.navigatorSeries=s.initSeries(l),s.setSortedData(),e.navigatorSeries.baseSeries=e,o.push(e.navigatorSeries))}),(c.data&&!(n&&n.length)||A(c))&&(i.hasNavigatorData=!1,(c=M(c)).forEach((e,t)=>{r.name="Navigator "+(o.length+1),(l=w(h.navigator.series,{color:s.series[t]&&!s.series[t].options.isInternal&&s.series[t].color||s.options.colors[t]||s.options.colors[0]},r,e)).data=e.data,l.data&&(i.hasNavigatorData=!0,o.push(s.initSeries(l)))})),e&&this.addBaseSeriesEvents()}addBaseSeriesEvents(){let e=this,t=e.baseSeries||[];t[0]&&t[0].xAxis&&t[0].eventsToUnbind.push(u(t[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes)),t.forEach(i=>{i.eventsToUnbind.push(u(i,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,!1)})),i.eventsToUnbind.push(u(i,"hide",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)})),!1!==this.navigatorOptions.adaptToUpdatedData&&i.xAxis&&i.eventsToUnbind.push(u(i,"updatedData",this.updatedDataHandler)),i.eventsToUnbind.push(u(i,"remove",function(){t&&y(t,i),this.navigatorSeries&&(y(e.series,this.navigatorSeries),m(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1),delete this.navigatorSeries)}))})}getBaseSeriesMin(e){return this.baseSeries.reduce(function(e,t){return Math.min(e,t.xData&&t.xData.length?t.xData[0]:e)},e)}modifyNavigatorAxisExtremes(){let e=this.xAxis;if(void 0!==e.getExtremes){let t=this.getUnionExtremes(!0);t&&(t.dataMin!==e.min||t.dataMax!==e.max)&&(e.min=t.dataMin,e.max=t.dataMax)}}modifyBaseAxisExtremes(){let e,t;let i=this.chart.navigator,s=this.getExtremes(),n=s.min,r=s.max,o=s.dataMin,a=s.dataMax,l=r-n,h=i.stickToMin,c=i.stickToMax,d=E(this.ordinal?.convertOverscroll(this.options.overscroll),0),u=i.series&&i.series[0],p=!!this.setExtremes;!(this.eventArgs&&"rangeSelectorButton"===this.eventArgs.trigger)&&(h&&(e=(t=o)+l),c&&(e=a+d,h||(t=Math.max(o,e-l,i.getBaseSeriesMin(u&&u.xData?u.xData[0]:-Number.MAX_VALUE)))),p&&(h||c)&&C(t)&&(this.min=this.userMin=t,this.max=this.userMax=e)),i.stickToMin=i.stickToMax=null}updatedDataHandler(){let e=this.chart.navigator,t=this.navigatorSeries,i=e.reversedExtremes?0===Math.round(e.zoomedMin):Math.round(e.zoomedMax)>=Math.round(e.size);e.stickToMax=E(this.chart.options.navigator&&this.chart.options.navigator.stickToMax,i),e.stickToMin=e.shouldStickToMin(this,e),t&&!e.hasNavigatorData&&(t.options.pointStart=this.xData[0],t.setData(this.options.data,!1,null,!1))}shouldStickToMin(e,t){let i=t.getBaseSeriesMin(e.xData[0]),s=e.xAxis,n=s.max,r=s.min,o=s.options.range;return!!(C(n)&&C(r))&&(o&&n-i>0?n-i<o:r<=i)}addChartEvents(){this.eventsToUnbind||(this.eventsToUnbind=[]),this.eventsToUnbind.push(u(this.chart,"redraw",function(){let e=this.navigator,t=e&&(e.baseSeries&&e.baseSeries[0]&&e.baseSeries[0].xAxis||this.xAxis[0]);t&&e.render(t.min,t.max)}),u(this.chart,"getMargins",function(){let e=this.navigator,t=e.opposite?"plotTop":"marginBottom";this.inverted&&(t=e.opposite?"marginRight":"plotLeft"),this[t]=(this[t]||0)+(e.navigatorEnabled||!this.inverted?e.height+e.scrollbarHeight:0)+e.navigatorOptions.margin}),u(k,"setRange",function(e){this.chart.xAxis[0].setExtremes(e.min,e.max,e.redraw,e.animation,e.eventArguments)}))}destroy(){this.removeEvents(),this.xAxis&&(y(this.chart.xAxis,this.xAxis),y(this.chart.axes,this.xAxis)),this.yAxis&&(y(this.chart.yAxis,this.yAxis),y(this.chart.axes,this.yAxis)),(this.series||[]).forEach(e=>{e.destroy&&e.destroy()}),["series","xAxis","yAxis","shades","outline","scrollbarTrack","scrollbarRifles","scrollbarGroup","scrollbar","navigatorGroup","rendered"].forEach(e=>{this[e]&&this[e].destroy&&this[e].destroy(),this[e]=null}),[this.handles].forEach(e=>{b(e)}),this.navigatorEnabled=!1}}return k}),i(t,"Accessibility/Components/NavigatorComponent.js",[t["Accessibility/AccessibilityComponent.js"],t["Accessibility/Utils/Announcer.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Stock/Navigator/Navigator.js"],t["Core/Animation/AnimationUtilities.js"],t["Core/Templating.js"],t["Core/Utilities.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Accessibility/Utils/ChartUtilities.js"]],function(e,t,i,s,n,r,o,a,l){let{animObject:h}=n,{format:c}=r,{clamp:d,pick:u,syncTimeout:p}=o,{getFakeMouseEvent:g}=a,{getAxisRangeDescription:m,fireEventOnWrappedOrUnwrappedElement:b}=l;return class extends e{init(){let e=this.chart,i=this;this.announcer=new t(e,"polite"),this.addEvent(s,"afterRender",function(){this.chart===i.chart&&this.chart.renderer&&p(()=>{i.proxyProvider.updateGroupProxyElementPositions("navigator"),i.updateHandleValues()},h(u(this.chart.renderer.globalAnimation,!0)).duration)})}onChartUpdate(){let e=this.chart,t=e.options,i=t.navigator;if(i.enabled&&i.accessibility?.enabled){let i=t.accessibility.landmarkVerbosity,s=t.lang.accessibility?.navigator.groupLabel;this.proxyProvider.removeGroup("navigator"),this.proxyProvider.addGroup("navigator","div",{role:"all"===i?"region":"group","aria-label":c(s,{chart:e},e)});let n=t.lang.accessibility?.navigator.handleLabel;[0,1].forEach(t=>{let i=this.getHandleByIx(t);if(i){let s=this.proxyProvider.addProxyElement("navigator",{click:i},"input",{type:"range","aria-label":c(n,{handleIx:t,chart:e},e)});this[t?"maxHandleProxy":"minHandleProxy"]=s.innerElement,s.innerElement.style.pointerEvents="none",s.innerElement.oninput=()=>this.updateNavigator()}}),this.updateHandleValues()}else this.proxyProvider.removeGroup("navigator")}getNavigatorHandleNavigation(e){let t=this,s=this.chart,n=e?this.maxHandleProxy:this.minHandleProxy,r=this.keyCodes;return new i(s,{keyCodeMap:[[[r.left,r.right,r.up,r.down],function(i){if(n){let o=i===r.left||i===r.up?-1:1;n.value=""+d(parseFloat(n.value)+o,0,100),t.updateNavigator(()=>{let i=t.getHandleByIx(e);i&&s.setFocusToElement(i,n)})}return this.response.success}]],init:()=>{s.setFocusToElement(this.getHandleByIx(e),n)},validate:()=>!!(this.getHandleByIx(e)&&n&&s.options.navigator.accessibility?.enabled)})}getKeyboardNavigation(){return[this.getNavigatorHandleNavigation(0),this.getNavigatorHandleNavigation(1)]}destroy(){this.updateNavigatorThrottleTimer&&clearTimeout(this.updateNavigatorThrottleTimer),this.proxyProvider.removeGroup("navigator"),this.announcer&&this.announcer.destroy()}updateHandleValues(){let e=this.chart.navigator;if(e&&this.minHandleProxy&&this.maxHandleProxy){let t=e.size;this.minHandleProxy.value=""+Math.round(e.zoomedMin/t*100),this.maxHandleProxy.value=""+Math.round(e.zoomedMax/t*100)}}getHandleByIx(e){let t=this.chart.navigator;return t&&t.handles&&t.handles[e]}updateNavigator(e){this.updateNavigatorThrottleTimer&&clearTimeout(this.updateNavigatorThrottleTimer),this.updateNavigatorThrottleTimer=setTimeout((e=>{let t=this.chart,{navigator:i,pointer:s}=t;if(i&&s&&this.minHandleProxy&&this.maxHandleProxy){let n=s.getChartPosition(),r=parseFloat(this.minHandleProxy.value)/100*i.size,o=parseFloat(this.maxHandleProxy.value)/100*i.size;[[0,"mousedown",i.zoomedMin],[0,"mousemove",r],[0,"mouseup",r],[1,"mousedown",i.zoomedMax],[1,"mousemove",o],[1,"mouseup",o]].forEach(([e,t,s])=>{let r=this.getHandleByIx(e)?.element;r&&b(r,g(t,{x:n.left+i.left+s,y:n.top+i.top},r))}),e&&e();let a=t.options.lang.accessibility?.navigator.changeAnnouncement,l=m(t.xAxis[0]);this.announcer.announce(c(a,{axisRangeDescription:l,chart:t},t))}}).bind(this,e),20)}}}),i(t,"Accessibility/Components/SeriesComponent/SeriesDescriber.js",[t["Accessibility/Components/AnnotationsA11y.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Core/Templating.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Core/Utilities.js"]],function(e,t,i,s,n){let{getPointAnnotationTexts:r}=e,{getAxisDescription:o,getSeriesFirstPointElement:a,getSeriesA11yElement:l,unhideChartElementFromAT:h}=t,{format:c,numberFormat:d}=i,{reverseChildNodes:u,stripHTMLTagsFromString:p}=s,{find:g,isNumber:m,isString:b,pick:y,defined:f}=n;function x(e){let t=e.chart.options.accessibility.series.pointDescriptionEnabledThreshold;return!!(!1!==t&&e.points&&e.points.length>=+t)}function v(e,t){let i=e.series,s=i.chart,n=s.options.accessibility.point||{},r=i.options.accessibility&&i.options.accessibility.point||{},o=i.tooltipOptions||{},a=s.options.lang;return m(t)?d(t,r.valueDecimals||n.valueDecimals||o.valueDecimals||-1,a.decimalPoint,a.accessibility.thousandsSep||a.thousandsSep):t}function A(e,t){let i=e[t];return e.chart.langFormat("accessibility.series."+t+"Description",{name:o(i),series:e})}function C(e){let t=e.series,i=t.chart.series.length>1||t.options.name,s=function(e){let t=e.series,i=t.chart,s=t.options.accessibility,n=s&&s.point&&s.point.valueDescriptionFormat||i.options.accessibility.point.valueDescriptionFormat,r=y(t.xAxis&&t.xAxis.options.accessibility&&t.xAxis.options.accessibility.enabled,!i.angular&&"flowmap"!==t.type),o=r?function(e){let t=function(e){let t=e.series,i=t.chart,s=t.options.accessibility&&t.options.accessibility.point||{},n=i.options.accessibility.point||{},r=t.xAxis&&t.xAxis.dateTime;if(r){let t=r.getXDateFormat(e.x||0,i.options.tooltip.dateTimeLabelFormats),o=s.dateFormatter&&s.dateFormatter(e)||n.dateFormatter&&n.dateFormatter(e)||s.dateFormat||n.dateFormat||t;return i.time.dateFormat(o,e.x||0,void 0)}}(e),i=(e.series.xAxis||{}).categories&&f(e.category)&&(""+e.category).replace("<br/>"," "),s=f(e.id)&&0>(""+e.id).indexOf("highcharts-"),n="x, "+e.x;return e.name||t||i||(s?e.id:n)}(e):"";return c(n,{point:e,index:f(e.index)?e.index+1:"",xDescription:o,value:function(e){let t=e.series,i=t.chart.options.accessibility.point||{},s=t.chart.options.accessibility&&t.chart.options.accessibility.point||{},n=t.tooltipOptions||{},r=s.valuePrefix||i.valuePrefix||n.valuePrefix||"",o=s.valueSuffix||i.valueSuffix||n.valueSuffix||"",a=void 0!==e.value?"value":"y",l=v(e,e[a]);return e.isNull?t.chart.langFormat("accessibility.series.nullPointValue",{point:e}):t.pointArrayMap?function(e,t,i){let s=t||"",n=i||"",r=function(t){let i=v(e,y(e[t],e.options[t]));return void 0!==i?t+": "+s+i+n:i};return e.series.pointArrayMap.reduce(function(e,t){let i=r(t);return i?e+(e.length?", ":"")+i:e},"")}(e,r,o):r+l+o}(e),separator:r?", ":""},i)}(e),n=e.options&&e.options.accessibility&&e.options.accessibility.description,o=i?" "+t.name+".":"",a=function(e){let t=e.series.chart,i=r(e);return i.length?t.langFormat("accessibility.series.pointAnnotationsDescription",{point:e,annotations:i}):""}(e);return e.accessibility=e.accessibility||{},e.accessibility.valueDescription=s,s+(n?" "+n:"")+o+(a?" "+a:"")}function w(e){let t=e.chart,i=t.types||[],s=function(e){let t=(e.options.accessibility||{}).description;return t&&e.chart.langFormat("accessibility.series.description",{description:t,series:e})||""}(e),n=function(i){return t[i]&&t[i].length>1&&e[i]},r=e.index+1,o=A(e,"xAxis"),a=A(e,"yAxis"),l={seriesNumber:r,series:e,chart:t},h=i.length>1?"Combination":"",d=t.langFormat("accessibility.series.summary."+e.type+h,l)||t.langFormat("accessibility.series.summary.default"+h,l),u=(n("yAxis")?" "+a+".":"")+(n("xAxis")?" "+o+".":"");return c(y(e.options.accessibility&&e.options.accessibility.descriptionFormat,t.options.accessibility.series.descriptionFormat,""),{seriesDescription:d,authorDescription:s?" "+s:"",axisDescription:u,series:e,chart:t,seriesNumber:r},void 0)}return{defaultPointDescriptionFormatter:C,defaultSeriesDescriptionFormatter:w,describeSeries:function(e){let t=e.chart,i=a(e),s=l(e),n=t.is3d&&t.is3d();s&&(s.lastChild!==i||n||u(s),function(e){let t=function(e){let t=e.options.accessibility||{};return!x(e)&&!t.exposeAsGroupOnly}(e),i=function(e){let t=e.chart.options.accessibility.keyboardNavigation.seriesNavigation;return!!(e.points&&(e.points.length<+t.pointNavigationEnabledThreshold||!1===t.pointNavigationEnabledThreshold))}(e),s=e.chart.options.accessibility.point.describeNull;(t||i)&&e.points.forEach(i=>{let n=i.graphic&&i.graphic.element||function(e){let t=e.series,i=t&&t.chart,s=t&&t.is("sunburst"),n=e.isNull,r=i&&i.options.accessibility.point.describeNull;return n&&!s&&r}(i)&&function(e){let t=e.series,i=function(e){let t=e.index;return e.series&&e.series.data&&f(t)&&g(e.series.data,function(e){return!!(e&&void 0!==e.index&&e.index>t&&e.graphic&&e.graphic.element)})||null}(e),s=i&&i.graphic,n=s?s.parentGroup:t.graph||t.group,r=i?{x:y(e.plotX,i.plotX,0),y:y(e.plotY,i.plotY,0)}:{x:y(e.plotX,0),y:y(e.plotY,0)},o=function(e,t){let i=e.series.chart.renderer.rect(t.x,t.y,1,1);return i.attr({class:"highcharts-a11y-mock-point",fill:"none",opacity:0,"fill-opacity":0,"stroke-opacity":0}),i}(e,r);if(n&&n.element)return e.graphic=o,e.hasMockGraphic=!0,o.add(n),n.element.insertBefore(o.element,s?s.element:null),o.element}(i),r=i.options&&i.options.accessibility&&!1===i.options.accessibility.enabled;if(n){if(i.isNull&&!s){n.setAttribute("aria-hidden",!0);return}n.setAttribute("tabindex","-1"),e.chart.styledMode||(n.style.outline="none"),t&&!r?function(e,t){let i=e.series,s=i.options.accessibility?.point||{},n=i.chart.options.accessibility.point||{},r=p(b(s.descriptionFormat)&&c(s.descriptionFormat,e,i.chart)||s.descriptionFormatter?.(e)||b(n.descriptionFormat)&&c(n.descriptionFormat,e,i.chart)||n.descriptionFormatter?.(e)||C(e),i.chart.renderer.forExport);t.setAttribute("role","img"),t.setAttribute("aria-label",r)}(i,n):n.setAttribute("aria-hidden",!0)}})}(e),h(t,s),function(e){let t=e.chart,i=t.options.chart,s=i.options3d&&i.options3d.enabled,n=t.series.length>1,r=t.options.accessibility.series.describeSingleSeries,o=(e.options.accessibility||{}).exposeAsGroupOnly;return!(s&&n)&&(n||r||o||x(e))}(e)?function(e,t){let i=e.options.accessibility||{},s=e.chart.options.accessibility,n=s.landmarkVerbosity;i.exposeAsGroupOnly?t.setAttribute("role","img"):"all"===n?t.setAttribute("role","region"):t.setAttribute("role","group"),t.setAttribute("tabindex","-1"),e.chart.styledMode||(t.style.outline="none"),t.setAttribute("aria-label",p(s.series.descriptionFormatter&&s.series.descriptionFormatter(e)||w(e),e.chart.renderer.forExport))}(e,s):s.removeAttribute("aria-label"))}}}),i(t,"Accessibility/Components/SeriesComponent/NewDataAnnouncer.js",[t["Core/Globals.js"],t["Core/Utilities.js"],t["Accessibility/Utils/Announcer.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/EventProvider.js"],t["Accessibility/Components/SeriesComponent/SeriesDescriber.js"]],function(e,t,i,s,n,r){let{composed:o}=e,{addEvent:a,defined:l,pushUnique:h}=t,{getChartTitle:c}=s,{defaultPointDescriptionFormatter:d,defaultSeriesDescriptionFormatter:u}=r;function p(e){return!!e.options.accessibility.announceNewData.enabled}class g{constructor(e){this.dirty={allSeries:{}},this.lastAnnouncementTime=0,this.chart=e}init(){let e=this.chart,t=e.options.accessibility.announceNewData.interruptUser?"assertive":"polite";this.lastAnnouncementTime=0,this.dirty={allSeries:{}},this.eventProvider=new n,this.announcer=new i(e,t),this.addEventListeners()}destroy(){this.eventProvider.removeAddedEvents(),this.announcer.destroy()}addEventListeners(){let e=this,t=this.chart,i=this.eventProvider;i.addEvent(t,"afterApplyDrilldown",function(){e.lastAnnouncementTime=0}),i.addEvent(t,"afterAddSeries",function(t){e.onSeriesAdded(t.series)}),i.addEvent(t,"redraw",function(){e.announceDirtyData()})}onSeriesAdded(e){p(this.chart)&&(this.dirty.hasDirty=!0,this.dirty.allSeries[e.name+e.index]=e,this.dirty.newSeries=l(this.dirty.newSeries)?void 0:e)}announceDirtyData(){let e=this.chart,t=this;if(e.options.accessibility.announceNewData&&this.dirty.hasDirty){let e=this.dirty.newPoint;e&&(e=function(e){let t=e.series.data.filter(t=>e.x===t.x&&e.y===t.y);return 1===t.length?t[0]:e}(e)),this.queueAnnouncement(Object.keys(this.dirty.allSeries).map(e=>t.dirty.allSeries[e]),this.dirty.newSeries,e),this.dirty={allSeries:{}}}}queueAnnouncement(e,t,i){let s=this.chart.options.accessibility.announceNewData;if(s.enabled){let n=+new Date,r=n-this.lastAnnouncementTime,o=Math.max(0,s.minAnnounceInterval-r),a=function(e,t){let i=(e||[]).concat(t||[]).reduce((e,t)=>(e[t.name+t.index]=t,e),{});return Object.keys(i).map(e=>i[e])}(this.queuedAnnouncement&&this.queuedAnnouncement.series,e),l=this.buildAnnouncementMessage(a,t,i);l&&(this.queuedAnnouncement&&clearTimeout(this.queuedAnnouncementTimer),this.queuedAnnouncement={time:n,message:l,series:a},this.queuedAnnouncementTimer=setTimeout(()=>{this&&this.announcer&&(this.lastAnnouncementTime=+new Date,this.announcer.announce(this.queuedAnnouncement.message),delete this.queuedAnnouncement,delete this.queuedAnnouncementTimer)},o))}}buildAnnouncementMessage(t,i,s){let n=this.chart,r=n.options.accessibility.announceNewData;if(r.announcementFormatter){let e=r.announcementFormatter(t,i,s);if(!1!==e)return e.length?e:null}let o=e.charts&&e.charts.length>1?"Multiple":"Single",a=i?"newSeriesAnnounce"+o:s?"newPointAnnounce"+o:"newDataAnnounce",l=c(n);return n.langFormat("accessibility.announceNewData."+a,{chartTitle:l,seriesDesc:i?u(i):null,pointDesc:s?d(s):null,point:s,series:i})}}return function(e){function t(e){let t=this.chart,i=t.accessibility?.components.series.newDataAnnouncer;i&&i.chart===t&&p(t)&&(i.dirty.newPoint=l(i.dirty.newPoint)?void 0:e.point)}function i(){let e=this.chart,t=e.accessibility?.components.series.newDataAnnouncer;t&&t.chart===e&&p(e)&&(t.dirty.hasDirty=!0,t.dirty.allSeries[this.name+this.index]=this)}e.compose=function(e){h(o,"A11y.NDA")&&(a(e,"addPoint",t),a(e,"updatedData",i))}}(g||(g={})),g}),i(t,"Accessibility/ProxyElement.js",[t["Core/Globals.js"],t["Core/Utilities.js"],t["Accessibility/Utils/EventProvider.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/HTMLUtilities.js"]],function(e,t,i,s,n){let{doc:r}=e,{attr:o,css:a,merge:l}=t,{fireEventOnWrappedOrUnwrappedElement:h}=s,{cloneMouseEvent:c,cloneTouchEvent:d,getFakeMouseEvent:u,removeElement:p}=n;return class{constructor(e,t,s="button",n,o){this.chart=e,this.target=t,this.eventProvider=new i;let a=this.innerElement=r.createElement(s),l=this.element=n?r.createElement(n):a;e.styledMode||this.hideElementVisually(a),n&&("li"!==n||e.styledMode||(l.style.listStyle="none"),l.appendChild(a),this.element=l),this.updateTarget(t,o)}click(){let e=this.getTargetPosition();e.x+=e.width/2,e.y+=e.height/2;let t=u("click",e);h(this.target.click,t)}updateTarget(e,t){this.target=e,this.updateCSSClassName();let i=t||{};Object.keys(i).forEach(e=>{null===i[e]&&delete i[e]});let s=this.getTargetAttr(e.click,"aria-label");o(this.innerElement,l(s?{"aria-label":s}:{},i)),this.eventProvider.removeAddedEvents(),this.addProxyEventsToElement(this.innerElement,e.click),this.refreshPosition()}refreshPosition(){let e=this.getTargetPosition();a(this.innerElement,{width:(e.width||1)+"px",height:(e.height||1)+"px",left:(Math.round(e.x)||0)+"px",top:(Math.round(e.y)||0)+"px"})}remove(){this.eventProvider.removeAddedEvents(),p(this.element)}updateCSSClassName(){let e=e=>e.indexOf("highcharts-no-tooltip")>-1,t=this.chart.legend,i=t.group&&t.group.div,s=e(i&&i.className||""),n=e(this.getTargetAttr(this.target.click,"class")||"");this.innerElement.className=s||n?"highcharts-a11y-proxy-element highcharts-no-tooltip":"highcharts-a11y-proxy-element"}addProxyEventsToElement(e,t){["click","touchstart","touchend","touchcancel","touchmove","mouseover","mouseenter","mouseleave","mouseout"].forEach(i=>{let s=0===i.indexOf("touch");this.eventProvider.addEvent(e,i,e=>{let i=s?d(e):c(e);t&&h(t,i),e.stopPropagation(),s||e.preventDefault()},{passive:!1})})}hideElementVisually(e){a(e,{borderWidth:0,backgroundColor:"transparent",cursor:"pointer",outline:"none",opacity:.001,filter:"alpha(opacity=1)",zIndex:999,overflow:"hidden",padding:0,margin:0,display:"block",position:"absolute","-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)"})}getTargetPosition(){let e=this.target.click,t=e.element?e.element:e,i=this.target.visual||t,s=this.chart.renderTo,n=this.chart.pointer;if(s&&i?.getBoundingClientRect&&n){let e=i.getBoundingClientRect(),t=n.getChartPosition();return{x:(e.left-t.left)/t.scaleX,y:(e.top-t.top)/t.scaleY,width:e.right/t.scaleX-e.left/t.scaleX,height:e.bottom/t.scaleY-e.top/t.scaleY}}return{x:0,y:0,width:1,height:1}}getTargetAttr(e,t){return e.element?e.element.getAttribute(t):e.getAttribute(t)}}}),i(t,"Accessibility/ProxyProvider.js",[t["Core/Globals.js"],t["Core/Utilities.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/DOMElementProvider.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Accessibility/ProxyElement.js"]],function(e,t,i,s,n,r){let{doc:o}=e,{attr:a,css:l}=t,{unhideChartElementFromAT:h}=i,{removeChildNodes:c}=n;return class{constructor(e){this.chart=e,this.domElementProvider=new s,this.groups={},this.groupOrder=[],this.beforeChartProxyPosContainer=this.createProxyPosContainer("before"),this.afterChartProxyPosContainer=this.createProxyPosContainer("after"),this.update()}addProxyElement(e,t,i="button",s){let n=this.groups[e];if(!n)throw Error("ProxyProvider.addProxyElement: Invalid group key "+e);let o="ul"===n.type||"ol"===n.type?"li":void 0,a=new r(this.chart,t,i,o,s);return n.proxyContainerElement.appendChild(a.element),n.proxyElements.push(a),a}addGroup(e,t="div",i){let s;let n=this.groups[e];if(n)return n.groupElement;let r=this.domElementProvider.createElement(t);return i&&i.role&&"div"!==t?(s=this.domElementProvider.createElement("div")).appendChild(r):s=r,s.className="highcharts-a11y-proxy-group highcharts-a11y-proxy-group-"+e.replace(/\W/g,"-"),this.groups[e]={proxyContainerElement:r,groupElement:s,type:t,proxyElements:[]},a(s,i||{}),"ul"===t&&r.setAttribute("role","list"),this.afterChartProxyPosContainer.appendChild(s),this.updateGroupOrder(this.groupOrder),s}updateGroupAttrs(e,t){let i=this.groups[e];if(!i)throw Error("ProxyProvider.updateGroupAttrs: Invalid group key "+e);a(i.groupElement,t)}updateGroupOrder(e){if(this.groupOrder=e.slice(),this.isDOMOrderGroupOrder())return;let t=e.indexOf("series"),i=t>-1?e.slice(0,t):e,s=t>-1?e.slice(t+1):[],n=o.activeElement;["before","after"].forEach(e=>{let t=this["before"===e?"beforeChartProxyPosContainer":"afterChartProxyPosContainer"];c(t),("before"===e?i:s).forEach(e=>{let i=this.groups[e];i&&t.appendChild(i.groupElement)})}),(this.beforeChartProxyPosContainer.contains(n)||this.afterChartProxyPosContainer.contains(n))&&n&&n.focus&&n.focus()}clearGroup(e){let t=this.groups[e];if(!t)throw Error("ProxyProvider.clearGroup: Invalid group key "+e);c(t.proxyContainerElement)}removeGroup(e){let t=this.groups[e];t&&(this.domElementProvider.removeElement(t.groupElement),t.groupElement!==t.proxyContainerElement&&this.domElementProvider.removeElement(t.proxyContainerElement),delete this.groups[e])}update(){this.updatePosContainerPositions(),this.updateGroupOrder(this.groupOrder),this.updateProxyElementPositions()}updateProxyElementPositions(){Object.keys(this.groups).forEach(this.updateGroupProxyElementPositions.bind(this))}updateGroupProxyElementPositions(e){let t=this.groups[e];t&&t.proxyElements.forEach(e=>e.refreshPosition())}destroy(){this.domElementProvider.destroyCreatedElements()}createProxyPosContainer(e){let t=this.domElementProvider.createElement("div");return t.setAttribute("aria-hidden","false"),t.className="highcharts-a11y-proxy-container"+(e?"-"+e:""),l(t,{top:"0",left:"0"}),this.chart.styledMode||(t.style.whiteSpace="nowrap",t.style.position="absolute"),t}getCurrentGroupOrderInDOM(){let e=e=>{let t=Object.keys(this.groups),i=t.length;for(;i--;){let s=t[i],n=this.groups[s];if(n&&e===n.groupElement)return s}},t=t=>{let i=[],s=t.children;for(let t=0;t<s.length;++t){let n=e(s[t]);n&&i.push(n)}return i},i=t(this.beforeChartProxyPosContainer),s=t(this.afterChartProxyPosContainer);return i.push("series"),i.concat(s)}isDOMOrderGroupOrder(){let e=this.getCurrentGroupOrderInDOM(),t=this.groupOrder.filter(e=>"series"===e||!!this.groups[e]),i=e.length;if(i!==t.length)return!1;for(;i--;)if(e[i]!==t[i])return!1;return!0}updatePosContainerPositions(){let e=this.chart;if(e.renderer.forExport)return;let t=e.renderer.box;e.container.insertBefore(this.afterChartProxyPosContainer,t.nextSibling),e.container.insertBefore(this.beforeChartProxyPosContainer,t),h(this.chart,this.afterChartProxyPosContainer),h(this.chart,this.beforeChartProxyPosContainer)}}}),i(t,"Accessibility/Components/RangeSelectorComponent.js",[t["Accessibility/AccessibilityComponent.js"],t["Accessibility/Utils/Announcer.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Core/Utilities.js"]],function(e,t,i,s,n){let{unhideChartElementFromAT:r,getAxisRangeDescription:o}=i,{addEvent:a,attr:l}=n;class h extends e{init(){let e=this.chart;this.announcer=new t(e,"polite")}onChartUpdate(){let e=this.chart,t=this,i=e.rangeSelector;i&&(this.updateSelectorVisibility(),this.setDropdownAttrs(),i.buttons&&i.buttons.length&&i.buttons.forEach(e=>{t.setRangeButtonAttrs(e)}),i.maxInput&&i.minInput&&["minInput","maxInput"].forEach(function(s,n){let o=i[s];o&&(r(e,o),t.setRangeInputAttrs(o,"accessibility.rangeSelector."+(n?"max":"min")+"InputLabel"))}))}updateSelectorVisibility(){let e=this.chart,t=e.rangeSelector,i=t&&t.dropdown,s=t&&t.buttons||[],n=e=>e.setAttribute("aria-hidden",!0);t&&t.hasVisibleDropdown&&i?(r(e,i),s.forEach(e=>n(e.element))):(i&&n(i),s.forEach(t=>r(e,t.element)))}setDropdownAttrs(){let e=this.chart,t=e.rangeSelector&&e.rangeSelector.dropdown;if(t){let i=e.langFormat("accessibility.rangeSelector.dropdownLabel",{rangeTitle:e.options.lang.rangeSelectorZoom});t.setAttribute("aria-label",i),t.setAttribute("tabindex",-1)}}setRangeButtonAttrs(e){l(e.element,{tabindex:-1,role:"button"})}setRangeInputAttrs(e,t){let i=this.chart;l(e,{tabindex:-1,"aria-label":i.langFormat(t,{chart:i})})}onButtonNavKbdArrowKey(e,t){let i=e.response,s=this.keyCodes,n=this.chart,r=n.options.accessibility.keyboardNavigation.wrapAround,o=t===s.left||t===s.up?-1:1;return n.highlightRangeSelectorButton(n.highlightedRangeSelectorItemIx+o)?i.success:r?(e.init(o),i.success):i[o>0?"next":"prev"]}onButtonNavKbdClick(e){let t=e.response,i=this.chart;return 3!==i.oldRangeSelectorItemState&&this.fakeClickEvent(i.rangeSelector.buttons[i.highlightedRangeSelectorItemIx].element),t.success}onAfterBtnClick(){let e=this.chart,t=o(e.xAxis[0]),i=e.langFormat("accessibility.rangeSelector.clickButtonAnnouncement",{chart:e,axisRangeDescription:t});i&&this.announcer.announce(i)}onInputKbdMove(e){let t=this.chart,i=t.rangeSelector,s=t.highlightedInputRangeIx=(t.highlightedInputRangeIx||0)+e;if(s>1||s<0){if(t.accessibility)return t.accessibility.keyboardNavigation.exiting=!0,t.accessibility.keyboardNavigation.tabindexContainer.focus(),t.accessibility.keyboardNavigation.move(e)}else if(i){let e=i[s?"maxDateBox":"minDateBox"],n=i[s?"maxInput":"minInput"];e&&n&&t.setFocusToElement(e,n)}return!0}onInputNavInit(e){let t=this,i=this.chart,s=e>0?0:1,n=i.rangeSelector,r=n&&n[s?"maxDateBox":"minDateBox"],o=n&&n.minInput,l=n&&n.maxInput;if(i.highlightedInputRangeIx=s,r&&o&&l){i.setFocusToElement(r,s?l:o),this.removeInputKeydownHandler&&this.removeInputKeydownHandler();let e=e=>{(e.which||e.keyCode)===this.keyCodes.tab&&t.onInputKbdMove(e.shiftKey?-1:1)&&(e.preventDefault(),e.stopPropagation())},n=a(o,"keydown",e),h=a(l,"keydown",e);this.removeInputKeydownHandler=()=>{n(),h()}}}onInputNavTerminate(){let e=this.chart.rangeSelector||{};e.maxInput&&e.hideInput("max"),e.minInput&&e.hideInput("min"),this.removeInputKeydownHandler&&(this.removeInputKeydownHandler(),delete this.removeInputKeydownHandler)}initDropdownNav(){let e=this.chart,t=e.rangeSelector,i=t&&t.dropdown;t&&i&&(e.setFocusToElement(t.buttonGroup,i),this.removeDropdownKeydownHandler&&this.removeDropdownKeydownHandler(),this.removeDropdownKeydownHandler=a(i,"keydown",t=>{let i=(t.which||t.keyCode)===this.keyCodes.tab,s=e.accessibility;i&&(t.preventDefault(),t.stopPropagation(),s&&(s.keyboardNavigation.tabindexContainer.focus(),s.keyboardNavigation.move(t.shiftKey?-1:1)))}))}getRangeSelectorButtonNavigation(){let e=this.chart,t=this.keyCodes,i=this;return new s(e,{keyCodeMap:[[[t.left,t.right,t.up,t.down],function(e){return i.onButtonNavKbdArrowKey(this,e)}],[[t.enter,t.space],function(){return i.onButtonNavKbdClick(this)}]],validate:function(){return!!(e.rangeSelector&&e.rangeSelector.buttons&&e.rangeSelector.buttons.length)},init:function(t){let s=e.rangeSelector;if(s&&s.hasVisibleDropdown)i.initDropdownNav();else if(s){let i=s.buttons.length-1;e.highlightRangeSelectorButton(t>0?0:i)}},terminate:function(){i.removeDropdownKeydownHandler&&(i.removeDropdownKeydownHandler(),delete i.removeDropdownKeydownHandler)}})}getRangeSelectorInputNavigation(){let e=this.chart,t=this;return new s(e,{keyCodeMap:[],validate:function(){return!!(e.rangeSelector&&e.rangeSelector.inputGroup&&"hidden"!==e.rangeSelector.inputGroup.element.style.visibility&&!1!==e.options.rangeSelector.inputEnabled&&e.rangeSelector.minInput&&e.rangeSelector.maxInput)},init:function(e){t.onInputNavInit(e)},terminate:function(){t.onInputNavTerminate()}})}getKeyboardNavigation(){return[this.getRangeSelectorButtonNavigation(),this.getRangeSelectorInputNavigation()]}destroy(){this.removeDropdownKeydownHandler&&this.removeDropdownKeydownHandler(),this.removeInputKeydownHandler&&this.removeInputKeydownHandler(),this.announcer&&this.announcer.destroy()}}return function(e){function t(e){let t=this.rangeSelector&&this.rangeSelector.buttons||[],i=this.highlightedRangeSelectorItemIx,s=this.rangeSelector&&this.rangeSelector.selected;return void 0!==i&&t[i]&&i!==s&&t[i].setState(this.oldRangeSelectorItemState||0),this.highlightedRangeSelectorItemIx=e,!!t[e]&&(this.setFocusToElement(t[e].box,t[e].element),e!==s&&(this.oldRangeSelectorItemState=t[e].state,t[e].setState(1)),!0)}function i(){let e=this.chart.accessibility;if(e&&e.components.rangeSelector)return e.components.rangeSelector.onAfterBtnClick()}e.compose=function(e,s){let n=e.prototype;n.highlightRangeSelectorButton||(n.highlightRangeSelectorButton=t,a(s,"afterBtnClick",i))}}(h||(h={})),h}),i(t,"Accessibility/Components/SeriesComponent/ForcedMarkers.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){var i;let{composed:s}=e,{addEvent:n,merge:r,pushUnique:o}=t;return function(e){function t(e){r(!0,e,{marker:{enabled:!0,states:{normal:{opacity:0}}}})}function i(e){return e.marker.states&&e.marker.states.normal&&e.marker.states.normal.opacity}function a(e){return!!(e._hasPointMarkers&&e.points&&e.points.length)}function l(){this.chart.styledMode&&(this.markerGroup&&this.markerGroup[this.a11yMarkersForced?"addClass":"removeClass"]("highcharts-a11y-markers-hidden"),a(this)&&this.points.forEach(e=>{e.graphic&&(e.graphic[e.hasForcedA11yMarker?"addClass":"removeClass"]("highcharts-a11y-marker-hidden"),e.graphic[!1===e.hasForcedA11yMarker?"addClass":"removeClass"]("highcharts-a11y-marker-visible"))}))}function h(e){this.resetA11yMarkerOptions=r(e.options.marker||{},this.userOptions.marker||{})}function c(){let e=this.options;(function(e){let t=e.chart.options.accessibility.enabled,i=!1!==(e.options.accessibility&&e.options.accessibility.enabled);return t&&i&&function(e){let t=e.chart.options.accessibility;return e.points.length<t.series.pointDescriptionEnabledThreshold||!1===t.series.pointDescriptionEnabledThreshold}(e)})(this)?(e.marker&&!1===e.marker.enabled&&(this.a11yMarkersForced=!0,t(this.options)),a(this)&&function(e){let s=e.points.length;for(;s--;){let n=e.points[s],o=n.options,a=n.hasForcedA11yMarker;if(delete n.hasForcedA11yMarker,o.marker){let e=a&&0===i(o);o.marker.enabled&&!e?(r(!0,o.marker,{states:{normal:{opacity:i(o)||1}}}),n.hasForcedA11yMarker=!1):!1===o.marker.enabled&&(t(o),n.hasForcedA11yMarker=!0)}}}(this)):this.a11yMarkersForced&&(delete this.a11yMarkersForced,function(e){let t=e.resetA11yMarkerOptions;if(t){let i=t.states&&t.states.normal&&t.states.normal.opacity;e.userOptions&&e.userOptions.marker&&(e.userOptions.marker.enabled=!0),e.update({marker:{enabled:t.enabled,states:{normal:{opacity:i}}}})}}(this),delete this.resetA11yMarkerOptions)}function d(){this.boosted&&this.a11yMarkersForced&&(r(!0,this.options,{marker:{enabled:!1}}),delete this.a11yMarkersForced)}e.compose=function(e){o(s,"A11y.FM")&&(n(e,"afterSetOptions",h),n(e,"render",c),n(e,"afterRender",l),n(e,"renderCanvas",d))}}(i||(i={})),i}),i(t,"Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js",[t["Core/Series/Point.js"],t["Core/Series/Series.js"],t["Core/Series/SeriesRegistry.js"],t["Core/Globals.js"],t["Core/Utilities.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Accessibility/Utils/EventProvider.js"],t["Accessibility/Utils/ChartUtilities.js"]],function(e,t,i,s,n,r,o,a){let{seriesTypes:l}=i,{doc:h}=s,{defined:c,fireEvent:d}=n,{getPointFromXY:u,getSeriesFromName:p,scrollAxisToPoint:g}=a;function m(e){let t=e.index,i=e.series.points,s=i.length;if(i[t]===e)return t;for(;s--;)if(i[s]===e)return s}function b(e){let t=e.chart.options.accessibility.keyboardNavigation.seriesNavigation,i=e.options.accessibility||{},s=i.keyboardNavigation;return s&&!1===s.enabled||!1===i.enabled||!1===e.options.enableMouseTracking||!e.visible||t.pointNavigationEnabledThreshold&&+t.pointNavigationEnabledThreshold<=e.points.length}function y(e){let t=e.series.chart.options.accessibility,i=e.options.accessibility&&!1===e.options.accessibility.enabled;return e.isNull&&t.keyboardNavigation.seriesNavigation.skipNullPoints||!1===e.visible||!1===e.isInside||i||b(e.series)}function f(e){let t=e.series||[],i=t.length;for(let e=0;e<i;++e)if(!b(t[e])){let i=function(e){let t=e.points||[],i=t.length;for(let e=0;e<i;++e)if(!y(t[e]))return t[e];return null}(t[e]);if(i)return i}return null}function x(e){let t=e.series.length,i=!1;for(;t--&&(e.highlightedPoint=e.series[t].points[e.series[t].points.length-1],!(i=e.series[t].highlightNextValidPoint())););return i}function v(e){delete e.highlightedPoint;let t=f(e);return!!t&&t.highlight()}class A{constructor(e,t){this.keyCodes=t,this.chart=e}init(){let i=this,s=this.chart,n=this.eventProvider=new o;n.addEvent(t,"destroy",function(){return i.onSeriesDestroy(this)}),n.addEvent(s,"afterApplyDrilldown",function(){!function(e){let t=f(e);t&&t.highlight(!1)}(this)}),n.addEvent(s,"drilldown",function(e){let t=e.point,s=t.series;i.lastDrilledDownPoint={x:t.x,y:t.y,seriesName:s?s.name:""}}),n.addEvent(s,"drillupall",function(){setTimeout(function(){i.onDrillupAll()},10)}),n.addEvent(e,"afterSetState",function(){let e=this.graphic&&this.graphic.element,t=h.activeElement,i=t&&t.getAttribute("class"),n=i&&i.indexOf("highcharts-a11y-proxy-element")>-1;s.highlightedPoint===this&&t!==e&&!n&&e&&e.focus&&e.focus()})}onDrillupAll(){let e;let t=this.lastDrilledDownPoint,i=this.chart,s=t&&p(i,t.seriesName);t&&s&&c(t.x)&&c(t.y)&&(e=u(s,t.x,t.y)),e=e||f(i),i.container&&i.container.focus(),e&&e.highlight&&e.highlight(!1)}getKeyboardNavigationHandler(){let e=this,t=this.keyCodes,i=this.chart,s=i.inverted;return new r(i,{keyCodeMap:[[s?[t.up,t.down]:[t.left,t.right],function(t){return e.onKbdSideways(this,t)}],[s?[t.left,t.right]:[t.up,t.down],function(t){return e.onKbdVertical(this,t)}],[[t.enter,t.space],function(e,t){let s=i.highlightedPoint;if(s){let{plotLeft:e,plotTop:i}=this.chart,{plotX:n=0,plotY:r=0}=s;t={...t,chartX:e+n,chartY:i+r,point:s,target:s.graphic?.element||t.target},d(s.series,"click",t),s.firePointEvent("click",t)}return this.response.success}],[[t.home],function(){return v(i),this.response.success}],[[t.end],function(){return x(i),this.response.success}],[[t.pageDown,t.pageUp],function(e){return i.highlightAdjacentSeries(e===t.pageDown),this.response.success}]],init:function(){return e.onHandlerInit(this)},validate:function(){return!!f(i)},terminate:function(){return e.onHandlerTerminate()}})}onKbdSideways(e,t){let i=this.keyCodes,s=t===i.right||t===i.down;return this.attemptHighlightAdjacentPoint(e,s)}onHandlerInit(e){let t=this.chart;return t.options.accessibility.keyboardNavigation.seriesNavigation.rememberPointFocus&&t.highlightedPoint?t.highlightedPoint.highlight():v(t),e.response.success}onKbdVertical(e,t){let i=this.chart,s=this.keyCodes,n=t===s.down||t===s.right,r=i.options.accessibility.keyboardNavigation.seriesNavigation;if(r.mode&&"serialize"===r.mode)return this.attemptHighlightAdjacentPoint(e,n);let o=i.highlightedPoint&&i.highlightedPoint.series.keyboardMoveVertical?"highlightAdjacentPointVertical":"highlightAdjacentSeries";return i[o](n),e.response.success}onHandlerTerminate(){let e=this.chart,t=e.options.accessibility.keyboardNavigation;e.tooltip&&e.tooltip.hide(0);let i=e.highlightedPoint&&e.highlightedPoint.series;i&&i.onMouseOut&&i.onMouseOut(),e.highlightedPoint&&e.highlightedPoint.onMouseOut&&e.highlightedPoint.onMouseOut(),t.seriesNavigation.rememberPointFocus||delete e.highlightedPoint}attemptHighlightAdjacentPoint(e,t){let i=this.chart,s=i.options.accessibility.keyboardNavigation.wrapAround;return i.highlightAdjacentPoint(t)?e.response.success:s&&(t?v(i):x(i))?e.response.success:e.response[t?"next":"prev"]}onSeriesDestroy(e){let t=this.chart;t.highlightedPoint&&t.highlightedPoint.series===e&&(delete t.highlightedPoint,t.focusElement&&t.focusElement.removeFocusBorder())}destroy(){this.eventProvider.removeAddedEvents()}}return function(e){function t(e){let t,i;let s=this.series,n=this.highlightedPoint,r=n&&m(n)||0,o=n&&n.series.points||[],a=this.series&&this.series[this.series.length-1],l=a&&a.points&&a.points[a.points.length-1];if(!s[0]||!s[0].points)return!1;if(n){if(t=s[n.series.index+(e?1:-1)],(i=o[r+(e?1:-1)])||!t||(i=t.points[e?0:t.points.length-1]),!i)return!1}else i=e?s[0].points[0]:l;return y(i)?(b(t=i.series)?this.highlightedPoint=e?t.points[t.points.length-1]:t.points[0]:this.highlightedPoint=i,this.highlightAdjacentPoint(e)):i.highlight()}function i(e){let t=this.highlightedPoint,i=1/0,s;return!!(c(t.plotX)&&c(t.plotY))&&(this.series.forEach(n=>{b(n)||n.points.forEach(r=>{if(!c(r.plotY)||!c(r.plotX)||r===t)return;let o=r.plotY-t.plotY,a=Math.abs(r.plotX-t.plotX),l=Math.abs(o)*Math.abs(o)+a*a*4;n.yAxis&&n.yAxis.reversed&&(o*=-1),!(o<=0&&e||o>=0&&!e||l<5||y(r))&&l<i&&(i=l,s=r)})}),!!s&&s.highlight())}function s(e){let t,i,s;let n=this.highlightedPoint,r=this.series&&this.series[this.series.length-1],o=r&&r.points&&r.points[r.points.length-1];return this.highlightedPoint?!!((t=this.series[n.series.index+(e?-1:1)])&&(i=function(e,t,i,s){let n=1/0,r,o,a,l=t.points.length,h=e=>!(c(e.plotX)&&c(e.plotY));if(!h(e)){for(;l--;)!h(r=t.points[l])&&(a=(e.plotX-r.plotX)*(e.plotX-r.plotX)*4+(e.plotY-r.plotY)*(e.plotY-r.plotY)*1)<n&&(n=a,o=l);return c(o)?t.points[o]:void 0}}(n,t,0)))&&(b(t)?(i.highlight(),s=this.highlightAdjacentSeries(e))?s:(n.highlight(),!1):(i.highlight(),i.series.highlightNextValidPoint())):(t=e?this.series&&this.series[0]:r,!!(i=e?t&&t.points&&t.points[0]:o)&&i.highlight())}function n(e=!0){let t=this.series.chart,i=t.tooltip?.label?.element;!this.isNull&&e?this.onMouseOver():t.tooltip&&t.tooltip.hide(0),g(this),this.graphic&&(t.setFocusToElement(this.graphic),!e&&t.focusElement&&t.focusElement.removeFocusBorder()),t.highlightedPoint=this;let s=i?.getBoundingClientRect().top;if(i&&s&&s<0){let e=window.scrollY;window.scrollTo({behavior:"smooth",top:e+s})}return this}function r(){let e=this.chart.highlightedPoint,t=(e&&e.series)===this?m(e):0,i=this.points,s=i.length;if(i&&s){for(let e=t;e<s;++e)if(!y(i[e]))return i[e].highlight();for(let e=t;e>=0;--e)if(!y(i[e]))return i[e].highlight()}return!1}e.compose=function(e,o,a){let h=e.prototype,c=o.prototype,d=a.prototype;h.highlightAdjacentPoint||(h.highlightAdjacentPoint=t,h.highlightAdjacentPointVertical=i,h.highlightAdjacentSeries=s,c.highlight=n,d.keyboardMoveVertical=!0,["column","gantt","pie"].forEach(e=>{l[e]&&(l[e].prototype.keyboardMoveVertical=!1)}),d.highlightNextValidPoint=r)}}(A||(A={})),A}),i(t,"Accessibility/Components/SeriesComponent/SeriesComponent.js",[t["Accessibility/AccessibilityComponent.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Components/SeriesComponent/ForcedMarkers.js"],t["Accessibility/Components/SeriesComponent/NewDataAnnouncer.js"],t["Accessibility/Components/SeriesComponent/SeriesDescriber.js"],t["Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js"]],function(e,t,i,s,n,r){let{hideSeriesFromAT:o}=t,{describeSeries:a}=n;return class extends e{static compose(e,t,n){s.compose(n),i.compose(n),r.compose(e,t,n)}init(){this.newDataAnnouncer=new s(this.chart),this.newDataAnnouncer.init(),this.keyboardNavigation=new r(this.chart,this.keyCodes),this.keyboardNavigation.init(),this.hideTooltipFromATWhenShown(),this.hideSeriesLabelsFromATWhenShown()}hideTooltipFromATWhenShown(){let e=this;this.chart.tooltip&&this.addEvent(this.chart.tooltip.constructor,"refresh",function(){this.chart===e.chart&&this.label&&this.label.element&&this.label.element.setAttribute("aria-hidden",!0)})}hideSeriesLabelsFromATWhenShown(){this.addEvent(this.chart,"afterDrawSeriesLabels",function(){this.series.forEach(function(e){e.labelBySeries&&e.labelBySeries.attr("aria-hidden",!0)})})}onChartRender(){this.chart.series.forEach(function(e){!1!==(e.options.accessibility&&e.options.accessibility.enabled)&&e.visible&&0!==e.getPointsCollection().length?a(e):o(e)})}getKeyboardNavigation(){return this.keyboardNavigation.getKeyboardNavigationHandler()}destroy(){this.newDataAnnouncer.destroy(),this.keyboardNavigation.destroy()}}}),i(t,"Accessibility/Components/ZoomComponent.js",[t["Accessibility/AccessibilityComponent.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Core/Utilities.js"]],function(e,t,i,s,n){let{unhideChartElementFromAT:r}=t,{getFakeMouseEvent:o}=i,{attr:a,pick:l}=n;return class extends e{constructor(){super(...arguments),this.focusedMapNavButtonIx=-1}init(){let e=this,t=this.chart;this.proxyProvider.addGroup("zoom","div"),["afterShowResetZoom","afterApplyDrilldown","drillupall"].forEach(i=>{e.addEvent(t,i,function(){e.updateProxyOverlays()})})}onChartUpdate(){let e=this.chart,t=this;e.mapNavigation&&e.mapNavigation.navButtons.forEach((i,s)=>{r(e,i.element),t.setMapNavButtonAttrs(i.element,"accessibility.zoom.mapZoom"+(s?"Out":"In"))})}setMapNavButtonAttrs(e,t){let i=this.chart;a(e,{tabindex:-1,role:"button","aria-label":i.langFormat(t,{chart:i})})}onChartRender(){this.updateProxyOverlays()}updateProxyOverlays(){let e=this.chart;if(this.proxyProvider.clearGroup("zoom"),e.resetZoomButton&&this.createZoomProxyButton(e.resetZoomButton,"resetZoomProxyButton",e.langFormat("accessibility.zoom.resetZoomButton",{chart:e})),e.drillUpButton&&e.breadcrumbs&&e.breadcrumbs.list){let t=e.breadcrumbs.list[e.breadcrumbs.list.length-1];this.createZoomProxyButton(e.drillUpButton,"drillUpProxyButton",e.langFormat("accessibility.drillUpButton",{chart:e,buttonText:e.breadcrumbs.getButtonText(t)}))}}createZoomProxyButton(e,t,i){this[t]=this.proxyProvider.addProxyElement("zoom",{click:e},"button",{"aria-label":i,tabindex:-1})}getMapZoomNavigation(){let e=this.keyCodes,t=this.chart,i=this;return new s(t,{keyCodeMap:[[[e.up,e.down,e.left,e.right],function(e){return i.onMapKbdArrow(this,e)}],[[e.tab],function(e,t){return i.onMapKbdTab(this,t)}],[[e.space,e.enter],function(){return i.onMapKbdClick(this)}]],validate:function(){return!!(t.mapView&&t.mapNavigation&&t.mapNavigation.navButtons.length)},init:function(e){return i.onMapNavInit(e)}})}onMapKbdArrow(e,t){let i=this.chart,s=this.keyCodes,n=i.container,r=t===s.up||t===s.down,a=t===s.left||t===s.up?1:-1,l=(r?i.plotHeight:i.plotWidth)/10*a,h=10*Math.random(),c={x:n.offsetLeft+i.plotLeft+i.plotWidth/2+h,y:n.offsetTop+i.plotTop+i.plotHeight/2+h},d=r?{x:c.x,y:c.y+l}:{x:c.x+l,y:c.y};return[o("mousedown",c),o("mousemove",d),o("mouseup",d)].forEach(e=>n.dispatchEvent(e)),e.response.success}onMapKbdTab(e,t){let i=this.chart,s=e.response,n=t.shiftKey,r=n&&!this.focusedMapNavButtonIx||!n&&this.focusedMapNavButtonIx;if(i.mapNavigation.navButtons[this.focusedMapNavButtonIx].setState(0),r)return i.mapView&&i.mapView.zoomBy(),s[n?"prev":"next"];this.focusedMapNavButtonIx+=n?-1:1;let o=i.mapNavigation.navButtons[this.focusedMapNavButtonIx];return i.setFocusToElement(o.box,o.element),o.setState(2),s.success}onMapKbdClick(e){let t=this.chart.mapNavigation.navButtons[this.focusedMapNavButtonIx].element;return this.fakeClickEvent(t),e.response.success}onMapNavInit(e){let t=this.chart,i=t.mapNavigation.navButtons[0],s=t.mapNavigation.navButtons[1],n=e>0?i:s;t.setFocusToElement(n.box,n.element),n.setState(2),this.focusedMapNavButtonIx=e>0?0:1}simpleButtonNavigation(e,t,i){let n=this.keyCodes,r=this,o=this.chart;return new s(o,{keyCodeMap:[[[n.tab,n.up,n.down,n.left,n.right],function(e,t){let i=e===n.tab&&t.shiftKey||e===n.left||e===n.up;return this.response[i?"prev":"next"]}],[[n.space,n.enter],function(){return l(i(this,o),this.response.success)}]],validate:function(){return o[e]&&o[e].box&&r[t].innerElement},init:function(){o.setFocusToElement(o[e].box,r[t].innerElement)}})}getKeyboardNavigation(){return[this.simpleButtonNavigation("resetZoomButton","resetZoomProxyButton",function(e,t){t.zoomOut()}),this.simpleButtonNavigation("drillUpButton","drillUpProxyButton",function(e,t){return t.drillUp(),e.response.prev}),this.getMapZoomNavigation()]}}}),i(t,"Accessibility/HighContrastMode.js",[t["Core/Globals.js"]],function(e){let{doc:t,isMS:i,win:s}=e;return{isHighContrastModeActive:function(){let e=/(Edg)/.test(s.navigator.userAgent);if(s.matchMedia&&e)return s.matchMedia("(-ms-high-contrast: active)").matches;if(i&&s.getComputedStyle){let e=t.createElement("div");e.style.backgroundImage="url(data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)",t.body.appendChild(e);let i=(e.currentStyle||s.getComputedStyle(e)).backgroundImage;return t.body.removeChild(e),"none"===i}return s.matchMedia&&s.matchMedia("(forced-colors: active)").matches},setHighContrastTheme:function(e){e.highContrastModeActive=!0;let t=e.options.accessibility.highContrastTheme;e.update(t,!1);let i=t.colors?.length>1;e.series.forEach(function(e){let s=t.plotOptions[e.type]||{},n=i&&void 0!==e.colorIndex?t.colors[e.colorIndex]:s.color||"window",r={color:s.color||"windowText",colors:i?t.colors:[s.color||"windowText"],borderColor:s.borderColor||"window",fillColor:n};e.update(r,!1),e.points&&e.points.forEach(function(e){e.options&&e.options.color&&e.update({color:s.color||"windowText",borderColor:s.borderColor||"window"},!1)})}),e.redraw()}}}),i(t,"Accessibility/HighContrastTheme.js",[],function(){return{chart:{backgroundColor:"window"},title:{style:{color:"windowText"}},subtitle:{style:{color:"windowText"}},colorAxis:{minColor:"windowText",maxColor:"windowText",stops:[],dataClasses:[]},colors:["windowText"],xAxis:{gridLineColor:"windowText",labels:{style:{color:"windowText"}},lineColor:"windowText",minorGridLineColor:"windowText",tickColor:"windowText",title:{style:{color:"windowText"}}},yAxis:{gridLineColor:"windowText",labels:{style:{color:"windowText"}},lineColor:"windowText",minorGridLineColor:"windowText",tickColor:"windowText",title:{style:{color:"windowText"}}},tooltip:{backgroundColor:"window",borderColor:"windowText",style:{color:"windowText"}},plotOptions:{series:{lineColor:"windowText",fillColor:"window",borderColor:"windowText",edgeColor:"windowText",borderWidth:1,dataLabels:{connectorColor:"windowText",color:"windowText",style:{color:"windowText",textOutline:"none"}},marker:{lineColor:"windowText",fillColor:"windowText"}},pie:{color:"window",colors:["window"],borderColor:"windowText",borderWidth:1},boxplot:{fillColor:"window"},candlestick:{lineColor:"windowText",fillColor:"window"},errorbar:{fillColor:"window"}},legend:{backgroundColor:"window",itemStyle:{color:"windowText"},itemHoverStyle:{color:"windowText"},itemHiddenStyle:{color:"#555"},title:{style:{color:"windowText"}}},credits:{style:{color:"windowText"}},drilldown:{activeAxisLabelStyle:{color:"windowText"},activeDataLabelStyle:{color:"windowText"}},navigation:{buttonOptions:{symbolStroke:"windowText",theme:{fill:"window"}}},rangeSelector:{buttonTheme:{fill:"window",stroke:"windowText",style:{color:"windowText"},states:{hover:{fill:"window",stroke:"windowText",style:{color:"windowText"}},select:{fill:"#444",stroke:"windowText",style:{color:"windowText"}}}},inputBoxBorderColor:"windowText",inputStyle:{backgroundColor:"window",color:"windowText"},labelStyle:{color:"windowText"}},navigator:{handles:{backgroundColor:"window",borderColor:"windowText"},outlineColor:"windowText",maskFill:"transparent",series:{color:"windowText",lineColor:"windowText"},xAxis:{gridLineColor:"windowText"}},scrollbar:{barBackgroundColor:"#444",barBorderColor:"windowText",buttonArrowColor:"windowText",buttonBackgroundColor:"window",buttonBorderColor:"windowText",rifleColor:"windowText",trackBackgroundColor:"window",trackBorderColor:"windowText"}}}),i(t,"Accessibility/Options/A11yDefaults.js",[],function(){return{accessibility:{enabled:!0,screenReaderSection:{beforeChartFormat:"<{headingTagName}>{chartTitle}</{headingTagName}><div>{typeDescription}</div><div>{chartSubtitle}</div><div>{chartLongdesc}</div><div>{playAsSoundButton}</div><div>{viewTableButton}</div><div>{xAxisDescription}</div><div>{yAxisDescription}</div><div>{annotationsTitle}{annotationsList}</div>",afterChartFormat:"{endOfChartMarker}",axisRangeDateFormat:"%Y-%m-%d %H:%M:%S"},series:{descriptionFormat:"{seriesDescription}{authorDescription}{axisDescription}",describeSingleSeries:!1,pointDescriptionEnabledThreshold:200},point:{valueDescriptionFormat:"{xDescription}{separator}{value}.",describeNull:!0},landmarkVerbosity:"all",linkedDescription:'*[data-highcharts-chart="{index}"] + .highcharts-description',highContrastMode:"auto",keyboardNavigation:{enabled:!0,focusBorder:{enabled:!0,hideBrowserFocusOutline:!0,style:{color:"#334eff",lineWidth:2,borderRadius:3},margin:2},order:["series","zoom","rangeSelector","navigator","legend","chartMenu"],wrapAround:!0,seriesNavigation:{skipNullPoints:!0,pointNavigationEnabledThreshold:!1,rememberPointFocus:!1}},announceNewData:{enabled:!1,minAnnounceInterval:5e3,interruptUser:!1}},legend:{accessibility:{enabled:!0,keyboardNavigation:{enabled:!0}}},exporting:{accessibility:{enabled:!0}},navigator:{accessibility:{enabled:!0}}}}),i(t,"Accessibility/Options/LangDefaults.js",[],function(){return{accessibility:{defaultChartTitle:"Chart",chartContainerLabel:"{title}. Highcharts interactive chart.",svgContainerLabel:"Interactive chart",drillUpButton:"{buttonText}",credits:"Chart credits: {creditsStr}",thousandsSep:",",svgContainerTitle:"",graphicContainerLabel:"",screenReaderSection:{beforeRegionLabel:"",afterRegionLabel:"",annotations:{heading:"Chart annotations summary",descriptionSinglePoint:"{annotationText}. Related to {annotationPoint}",descriptionMultiplePoints:"{annotationText}. Related to {annotationPoint}{#each additionalAnnotationPoints}, also related to {this}{/each}",descriptionNoPoints:"{annotationText}"},endOfChartMarker:"End of interactive chart."},sonification:{playAsSoundButtonText:"Play as sound, {chartTitle}",playAsSoundClickAnnouncement:"Play"},legend:{legendLabelNoTitle:"Toggle series visibility, {chartTitle}",legendLabel:"Chart legend: {legendTitle}",legendItem:"Show {itemName}"},zoom:{mapZoomIn:"Zoom chart",mapZoomOut:"Zoom out chart",resetZoomButton:"Reset zoom"},rangeSelector:{dropdownLabel:"{rangeTitle}",minInputLabel:"Select start date.",maxInputLabel:"Select end date.",clickButtonAnnouncement:"Viewing {axisRangeDescription}"},navigator:{handleLabel:"{#eq handleIx 0}Start, percent{else}End, percent{/eq}",groupLabel:"Axis zoom",changeAnnouncement:"{axisRangeDescription}"},table:{viewAsDataTableButtonText:"View as data table, {chartTitle}",tableSummary:"Table representation of chart."},announceNewData:{newDataAnnounce:"Updated data for chart {chartTitle}",newSeriesAnnounceSingle:"New data series: {seriesDesc}",newPointAnnounceSingle:"New data point: {pointDesc}",newSeriesAnnounceMultiple:"New data series in chart {chartTitle}: {seriesDesc}",newPointAnnounceMultiple:"New data point in chart {chartTitle}: {pointDesc}"},seriesTypeDescriptions:{boxplot:"Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile, and maximum.",arearange:"Arearange charts are line charts displaying a range between a lower and higher value for each point.",areasplinerange:"These charts are line charts displaying a range between a lower and higher value for each point.",bubble:"Bubble charts are scatter charts where each data point also has a size value.",columnrange:"Columnrange charts are column charts displaying a range between a lower and higher value for each point.",errorbar:"Errorbar series are used to display the variability of the data.",funnel:"Funnel charts are used to display reduction of data in stages.",pyramid:"Pyramid charts consist of a single pyramid with item heights corresponding to each point value.",waterfall:"A waterfall chart is a column chart where each column contributes towards a total end value."},chartTypes:{emptyChart:"Empty chart",mapTypeDescription:"Map of {mapTitle} with {numSeries} data series.",unknownMap:"Map of unspecified region with {numSeries} data series.",combinationChart:"Combination chart with {numSeries} data series.",defaultSingle:"Chart with {numPoints} data {#eq numPoints 1}point{else}points{/eq}.",defaultMultiple:"Chart with {numSeries} data series.",splineSingle:"Line chart with {numPoints} data {#eq numPoints 1}point{else}points{/eq}.",splineMultiple:"Line chart with {numSeries} lines.",lineSingle:"Line chart with {numPoints} data {#eq numPoints 1}point{else}points{/eq}.",lineMultiple:"Line chart with {numSeries} lines.",columnSingle:"Bar chart with {numPoints} {#eq numPoints 1}bar{else}bars{/eq}.",columnMultiple:"Bar chart with {numSeries} data series.",barSingle:"Bar chart with {numPoints} {#eq numPoints 1}bar{else}bars{/eq}.",barMultiple:"Bar chart with {numSeries} data series.",pieSingle:"Pie chart with {numPoints} {#eq numPoints 1}slice{else}slices{/eq}.",pieMultiple:"Pie chart with {numSeries} pies.",scatterSingle:"Scatter chart with {numPoints} {#eq numPoints 1}point{else}points{/eq}.",scatterMultiple:"Scatter chart with {numSeries} data series.",boxplotSingle:"Boxplot with {numPoints} {#eq numPoints 1}box{else}boxes{/eq}.",boxplotMultiple:"Boxplot with {numSeries} data series.",bubbleSingle:"Bubble chart with {numPoints} {#eq numPoints 1}bubbles{else}bubble{/eq}.",bubbleMultiple:"Bubble chart with {numSeries} data series."},axis:{xAxisDescriptionSingular:"The chart has 1 X axis displaying {names[0]}. {ranges[0]}",xAxisDescriptionPlural:"The chart has {numAxes} X axes displaying {#each names}{#unless @first},{/unless}{#if @last} and{/if} {this}{/each}.",yAxisDescriptionSingular:"The chart has 1 Y axis displaying {names[0]}. {ranges[0]}",yAxisDescriptionPlural:"The chart has {numAxes} Y axes displaying {#each names}{#unless @first},{/unless}{#if @last} and{/if} {this}{/each}.",timeRangeDays:"Data range: {range} days.",timeRangeHours:"Data range: {range} hours.",timeRangeMinutes:"Data range: {range} minutes.",timeRangeSeconds:"Data range: {range} seconds.",rangeFromTo:"Data ranges from {rangeFrom} to {rangeTo}.",rangeCategories:"Data range: {numCategories} categories."},exporting:{chartMenuLabel:"Chart menu",menuButtonLabel:"View chart menu, {chartTitle}"},series:{summary:{default:"{series.name}, series {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",defaultCombination:"{series.name}, series {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",line:"{series.name}, line {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",lineCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Line with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",spline:"{series.name}, line {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",splineCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Line with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",column:"{series.name}, bar series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.",columnCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Bar series with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.",bar:"{series.name}, bar series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.",barCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Bar series with {series.points.length} {#eq series.points.length 1}bar{else}bars{/eq}.",pie:"{series.name}, pie {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}slice{else}slices{/eq}.",pieCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Pie with {series.points.length} {#eq series.points.length 1}slice{else}slices{/eq}.",scatter:"{series.name}, scatter plot {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}point{else}points{/eq}.",scatterCombination:"{series.name}, series {seriesNumber} of {chart.series.length}, scatter plot with {series.points.length} {#eq series.points.length 1}point{else}points{/eq}.",boxplot:"{series.name}, boxplot {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}box{else}boxes{/eq}.",boxplotCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Boxplot with {series.points.length} {#eq series.points.length 1}box{else}boxes{/eq}.",bubble:"{series.name}, bubble series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.",bubbleCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Bubble series with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.",map:"{series.name}, map {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}area{else}areas{/eq}.",mapCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Map with {series.points.length} {#eq series.points.length 1}area{else}areas{/eq}.",mapline:"{series.name}, line {seriesNumber} of {chart.series.length} with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",maplineCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Line with {series.points.length} data {#eq series.points.length 1}point{else}points{/eq}.",mapbubble:"{series.name}, bubble series {seriesNumber} of {chart.series.length} with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}.",mapbubbleCombination:"{series.name}, series {seriesNumber} of {chart.series.length}. Bubble series with {series.points.length} {#eq series.points.length 1}bubble{else}bubbles{/eq}."},description:"{description}",xAxisDescription:"X axis, {name}",yAxisDescription:"Y axis, {name}",nullPointValue:"No value",pointAnnotationsDescription:"{#each annotations}Annotation: {this}{/each}"}}}}),i(t,"Accessibility/Options/DeprecatedOptions.js",[t["Core/Utilities.js"]],function(e){let{error:t,pick:i}=e;function s(e,t,s){let n=e,r,o=0;for(;o<t.length-1;++o)n=n[r=t[o]]=i(n[r],{});n[t[t.length-1]]=s}function n(e,i,n,r){function o(e,t){return t.reduce(function(e,t){return e[t]},e)}let a=o(e.options,i),l=o(e.options,n);Object.keys(r).forEach(function(o){let h=a[o];void 0!==h&&(s(l,r[o],h),t(32,!1,e,{[i.join(".")+"."+o]:n.join(".")+"."+r[o].join(".")}))})}return function(e){(function(e){let i=e.options.chart,s=e.options.accessibility||{};["description","typeDescription"].forEach(function(n){i[n]&&(s[n]=i[n],t(32,!1,e,{[`chart.${n}`]:`use accessibility.${n}`}))})})(e),function(e){e.axes.forEach(function(i){let s=i.options;s&&s.description&&(s.accessibility=s.accessibility||{},s.accessibility.description=s.description,t(32,!1,e,{"axis.description":"use axis.accessibility.description"}))})}(e),e.series&&function(e){let i={description:["accessibility","description"],exposeElementToA11y:["accessibility","exposeAsGroupOnly"],pointDescriptionFormatter:["accessibility","point","descriptionFormatter"],skipKeyboardNavigation:["accessibility","keyboardNavigation","enabled"],"accessibility.pointDescriptionFormatter":["accessibility","point","descriptionFormatter"]};e.series.forEach(function(n){Object.keys(i).forEach(function(r){let o=n.options[r];"accessibility.pointDescriptionFormatter"===r&&(o=n.options.accessibility&&n.options.accessibility.pointDescriptionFormatter),void 0!==o&&(s(n.options,i[r],"skipKeyboardNavigation"===r?!o:o),t(32,!1,e,{[`series.${r}`]:"series."+i[r].join(".")}))})})}(e),n(e,["accessibility"],["accessibility"],{pointDateFormat:["point","dateFormat"],pointDateFormatter:["point","dateFormatter"],pointDescriptionFormatter:["point","descriptionFormatter"],pointDescriptionThreshold:["series","pointDescriptionEnabledThreshold"],pointNavigationThreshold:["keyboardNavigation","seriesNavigation","pointNavigationEnabledThreshold"],pointValueDecimals:["point","valueDecimals"],pointValuePrefix:["point","valuePrefix"],pointValueSuffix:["point","valueSuffix"],screenReaderSectionFormatter:["screenReaderSection","beforeChartFormatter"],describeSingleSeries:["series","describeSingleSeries"],seriesDescriptionFormatter:["series","descriptionFormatter"],onTableAnchorClick:["screenReaderSection","onViewDataTableClick"],axisRangeDateFormat:["screenReaderSection","axisRangeDateFormat"]}),n(e,["accessibility","keyboardNavigation"],["accessibility","keyboardNavigation","seriesNavigation"],{skipNullPoints:["skipNullPoints"],mode:["mode"]}),n(e,["lang","accessibility"],["lang","accessibility"],{legendItem:["legend","legendItem"],legendLabel:["legend","legendLabel"],mapZoomIn:["zoom","mapZoomIn"],mapZoomOut:["zoom","mapZoomOut"],resetZoomButton:["zoom","resetZoomButton"],screenReaderRegionLabel:["screenReaderSection","beforeRegionLabel"],rangeSelectorButton:["rangeSelector","buttonText"],rangeSelectorMaxInput:["rangeSelector","maxInputLabel"],rangeSelectorMinInput:["rangeSelector","minInputLabel"],svgContainerEnd:["screenReaderSection","endOfChartMarker"],viewAsDataTable:["table","viewAsDataTableButtonText"],tableSummary:["table","tableSummary"]})}}),i(t,"Accessibility/Accessibility.js",[t["Core/Defaults.js"],t["Core/Globals.js"],t["Core/Utilities.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Accessibility/A11yI18n.js"],t["Accessibility/Components/ContainerComponent.js"],t["Accessibility/FocusBorder.js"],t["Accessibility/Components/InfoRegionsComponent.js"],t["Accessibility/KeyboardNavigation.js"],t["Accessibility/Components/LegendComponent.js"],t["Accessibility/Components/MenuComponent.js"],t["Accessibility/Components/NavigatorComponent.js"],t["Accessibility/Components/SeriesComponent/NewDataAnnouncer.js"],t["Accessibility/ProxyProvider.js"],t["Accessibility/Components/RangeSelectorComponent.js"],t["Accessibility/Components/SeriesComponent/SeriesComponent.js"],t["Accessibility/Components/ZoomComponent.js"],t["Accessibility/HighContrastMode.js"],t["Accessibility/HighContrastTheme.js"],t["Accessibility/Options/A11yDefaults.js"],t["Accessibility/Options/LangDefaults.js"],t["Accessibility/Options/DeprecatedOptions.js"]],function(e,t,i,s,n,r,o,a,l,h,c,d,u,p,g,m,b,y,f,x,v,A){let{defaultOptions:C}=e,{doc:w}=t,{addEvent:E,extend:T,fireEvent:M,merge:S}=i,{removeElement:k}=s;class P{constructor(e){this.init(e)}init(e){if(this.chart=e,!w.addEventListener){this.zombie=!0,this.components={},e.renderTo.setAttribute("aria-hidden",!0);return}A(e),this.proxyProvider=new p(this.chart),this.initComponents(),this.keyboardNavigation=new l(e,this.components)}initComponents(){let e=this.chart,t=this.proxyProvider,i=e.options.accessibility;this.components={container:new r,infoRegions:new a,legend:new h,chartMenu:new c,rangeSelector:new g,series:new m,zoom:new b,navigator:new d},i.customComponents&&T(this.components,i.customComponents);let s=this.components;this.getComponentOrder().forEach(function(i){s[i].initBase(e,t),s[i].init()})}getComponentOrder(){return this.components?this.components.series?["series"].concat(Object.keys(this.components).filter(e=>"series"!==e)):Object.keys(this.components):[]}update(){let e=this.components,t=this.chart,i=t.options.accessibility;M(t,"beforeA11yUpdate"),t.types=this.getChartTypes();let s=i.keyboardNavigation.order;this.proxyProvider.updateGroupOrder(s),this.getComponentOrder().forEach(function(i){e[i].onChartUpdate(),M(t,"afterA11yComponentUpdate",{name:i,component:e[i]})}),this.keyboardNavigation.update(s),!t.highContrastModeActive&&!1!==i.highContrastMode&&(y.isHighContrastModeActive()||!0===i.highContrastMode)&&y.setHighContrastTheme(t),M(t,"afterA11yUpdate",{accessibility:this})}destroy(){let e=this.chart||{},t=this.components;Object.keys(t).forEach(function(e){t[e].destroy(),t[e].destroyBase()}),this.proxyProvider&&this.proxyProvider.destroy(),e.announcerContainer&&k(e.announcerContainer),this.keyboardNavigation&&this.keyboardNavigation.destroy(),e.renderTo&&e.renderTo.setAttribute("aria-hidden",!0),e.focusElement&&e.focusElement.removeFocusBorder()}getChartTypes(){let e={};return this.chart.series.forEach(function(t){e[t.type]=1}),Object.keys(e)}}return function(e){function t(){this.accessibility&&this.accessibility.destroy()}function i(){this.a11yDirty&&this.renderTo&&(delete this.a11yDirty,this.updateA11yEnabled());let e=this.accessibility;e&&!e.zombie&&(e.proxyProvider.updateProxyElementPositions(),e.getComponentOrder().forEach(function(t){e.components[t].onChartRender()}))}function s(e){let t=e.options.accessibility;t&&(t.customComponents&&(this.options.accessibility.customComponents=t.customComponents,delete t.customComponents),S(!0,this.options.accessibility,t),this.accessibility&&this.accessibility.destroy&&(this.accessibility.destroy(),delete this.accessibility)),this.a11yDirty=!0}function r(){let t=this.accessibility,i=this.options.accessibility,s=this.renderer.boxWrapper.element,n=this.title;if(i&&i.enabled)t&&!t.zombie?t.update():(this.accessibility=t=new e(this),t&&!t.zombie&&t.update(),"img"===s.getAttribute("role")&&s.removeAttribute("role"));else if(t)t.destroy&&t.destroy(),delete this.accessibility;else{this.renderTo.setAttribute("role","img"),this.renderTo.setAttribute("aria-hidden",!1),this.renderTo.setAttribute("aria-label",(n&&n.element.textContent||"").replace(/</g,"<")),s.setAttribute("aria-hidden",!0);let e=document.getElementsByClassName("highcharts-description")[0];e&&(e.setAttribute("aria-hidden",!1),e.classList.remove("highcharts-linked-description"))}}function a(){this.series.chart.accessibility&&(this.series.chart.a11yDirty=!0)}e.i18nFormat=n.i18nFormat,e.compose=function(e,d,p,b,y,f){l.compose(e),u.compose(b),h.compose(e,d),c.compose(e),m.compose(e,p,b),n.compose(e),o.compose(e,y),f&&g.compose(e,f);let x=e.prototype;x.updateA11yEnabled||(x.updateA11yEnabled=r,E(e,"destroy",t),E(e,"render",i),E(e,"update",s),["addSeries","init"].forEach(t=>{E(e,t,function(){this.a11yDirty=!0})}),["afterApplyDrilldown","drillupall"].forEach(t=>{E(e,t,function(){let e=this.accessibility;e&&!e.zombie&&e.update()})}),E(p,"update",a),["update","updatedData","remove"].forEach(e=>{E(b,e,function(){this.chart.accessibility&&(this.chart.a11yDirty=!0)})}))}}(P||(P={})),S(!0,C,x,{accessibility:{highContrastTheme:f},lang:v}),P}),i(t,"masters/modules/accessibility.src.js",[t["Core/Globals.js"],t["Accessibility/Accessibility.js"],t["Accessibility/AccessibilityComponent.js"],t["Accessibility/Utils/ChartUtilities.js"],t["Accessibility/Utils/HTMLUtilities.js"],t["Accessibility/KeyboardNavigationHandler.js"],t["Accessibility/Components/SeriesComponent/SeriesDescriber.js"]],function(e,t,i,s,n,r,o){return e.i18nFormat=t.i18nFormat,e.A11yChartUtilities=s,e.A11yHTMLUtilities=n,e.AccessibilityComponent=i,e.KeyboardNavigationHandler=r,e.SeriesAccessibilityDescriber=o,t.compose(e.Chart,e.Legend,e.Point,e.Series,e.SVGElement,e.RangeSelector),e})});
File: public/js/hub-navigation.js
Match lines: 2
129| var wanted = normalize(label);
142| var text = normalize(anchor.textContent);
File: public/js/jquery-file-upload/server/gae-python/main.py
Match lines: 5
160| def normalize(self, str):
164| content_type = self.normalize(content_type)
165| file_name = self.normalize(file_name)
185| content_type = self.normalize(content_type)
186| file_name = self.normalize(file_name)
File: public/js/jquery-ui-1.9.2.min.js
Match lines: 1
6|(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(jQuery);(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery);(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery);(function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype))})(jQuery);(function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgiframe&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this.document.find(t||"body")[0]),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})})(jQuery);(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){$(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$('<span class="'+this._appendClass+'">'+n+"</span>"),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var r=this._getInst(e);if(arguments.length==2&&typeof t=="string")return t=="defaults"?$.extend({},$.datepicker._defaults):r?t=="all"?$.extend({},r.settings):this._get(r,t):null;var i=t||{};typeof t=="string"&&(i={},i[t]=n);if(r){this._curInst==r&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),o=this._getMinMaxDate(r,"min"),u=this._getMinMaxDate(r,"max");extendRemove(r.settings,i),o!==null&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,o)),u!==null&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,u)),this._attachments($(e),r),this._autoSize(r),this._setDate(r,s),this._updateAlternate(r),this._updateDatepicker(r)}},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),n=!0,r=t.dpDiv.is(".ui-datepicker-rtl");t._keyEvent=!0;if($.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),n=!1;break;case 13:var i=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);i[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,i[0]);var s=$.datepicker._get(t,"onSelect");if(s){var o=$.datepicker._formatDate(t);s.apply(t.input?t.input[0]:null,[o,t])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),n=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),n=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?1:-1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),n=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?-1:1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),n=e.ctrlKey||e.metaKey;break;default:n=!1}else e.keyCode==36&&e.ctrlKey?$.datepicker._showDatepicker(this):n=!1;n&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i});var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;var t=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var n=e.dpDiv.find("iframe.ui-datepicker-cover");!n.length||n.css({left:-t[0],top:-t[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),i=r[1],s=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),e.dpDiv[(r[0]!=1||r[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var o=e.yearshtml;setTimeout(function(){o===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),o=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&($.effects.effect[n]||$.effects[n])?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length){var w=t.substr(g);if(!/^\s+/.test(w))throw"Extra/unparsed characters found in date: "+w}a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var E=this._getDaysInMonth(a,f-1);if(l<=E)break;f++,l-=E}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":l+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&v<c?c:v;while(this._daylightSavingAdjust(new Date(d,p,1))>v)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>":i?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>":i?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=e.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(e,"closeText")+"</button>",x=r?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(n?S:"")+(this._isInRange(e,E)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+w+"</button>":"")+(n?"":S)+"</div>":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j<o[0];j++){var F="";this.maxRows=4;for(var I=0;I<o[1];I++){var q=this._daylightSavingAdjust(new Date(d,p,e.selectedDay)),R=" ui-corner-all",U="";if(f){U+='<div class="ui-datepicker-group';if(o[1]>1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var z=N?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="<th"+((W+T+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+C[X]+'">'+L[X]+"</span></th>"}U+=z+"</tr></thead><tbody>";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y<Q;Y++){U+="<tr>";var Z=N?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(G)+"</td>":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&G<c||h&&G>h;Z+='<td class="'+((W+T+6)%7>=5?" ui-datepicker-week-end":"")+(tt?" ui-datepicker-other-month":"")+(G.getTime()==q.getTime()&&p==e.selectedMonth&&e._keyEvent||H.getTime()==G.getTime()&&H.getTime()==q.getTime()?" "+this._dayOverClass:"")+(nt?" "+this._unselectableClass+" ui-state-disabled":"")+(tt&&!_?"":" "+et[1]+(G.getTime()==l.getTime()?" "+this._currentClass:"")+(G.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+((!tt||_)&&et[2]?' title="'+et[2]+'"':"")+(nt?"":' data-handler="selectDay" data-event="click" data-month="'+G.getMonth()+'" data-year="'+G.getFullYear()+'"')+">"+(tt&&!_?" ":nt?'<span class="ui-state-default">'+G.getDate()+"</span>":'<a class="ui-state-default'+(G.getTime()==t.getTime()?" ui-state-highlight":"")+(G.getTime()==l.getTime()?" ui-state-active":"")+(tt?" ui-priority-secondary":"")+'" href="#">'+G.getDate()+"</a>")+"</td>",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+"</tr>"}p++,p>11&&(p=0,d++),U+="</tbody></table>"+(f?"</div>"+(o[0]>0&&I==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',h="";if(s||!a)h+='<span class="ui-datepicker-month">'+o[t]+"</span>";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var v=0;v<12;v++)(!p||v>=r.getMonth())&&(!d||v<=i.getMonth())&&(h+='<option value="'+v+'"'+(v==t?' selected="selected"':"")+">"+u[v]+"</option>");h+="</select>"}l||(c+=h+(s||!a||!f?" ":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+='<span class="ui-datepicker-year">'+n+"</span>";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;b<=w;b++)e.yearshtml+='<option value="'+b+'"'+(b==n?' selected="selected"':"")+">"+b+"</option>";e.yearshtml+="</select>",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?" ":"")+h),c+="</div>",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return i=r&&i>r?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$})(jQuery);(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||" ",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("<button></button>",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||" "))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(jQuery);(function(e,t){e.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(jQuery);jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function d(e){var n=o(),r=n._rgba=[];return e=e.toLowerCase(),h(s,function(t,i){var s,o=i.re.exec(e),a=o&&i.parse(o),f=i.space||"rgba";if(a)return s=n[f](a),n[u[f].cache]=s[u[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&t.extend(r,c.transparent),n):c[e]}function v(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],o=t.Color=function(e,n,r,i){return new t.Color.fn.parse(e,n,r,i)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},a={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},f=o.support={},l=t("<p>")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,n){var i,s;for(s=0;s<n.length;s++)n[s]!==null&&(i=e.data(r+n[s]),i===t&&(i=""),e.css(n[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery);(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuery);(function(e,t){e.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(jQuery);(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);(function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(jQuery);(function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading…</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);
File: public/js/metahuman-standard/managers/state.js
Match lines: 2
50| var normalizedCurrent = normalize(currentUrl);
79| var full = normalize(href);
File: public/js/metahuman-standard/pages/organizational_structure_index.js
Match lines: 1
910| .normalize('NFD')
File: public/js/modern-layout.js
Match lines: 2
150| var normalizedCurrent = normalize(currentUrl);
177| var full = normalize(href);
File: public/js/modern-layoutOld.js
Match lines: 2
109| var normalizedCurrent = normalize(currentUrl);
136| var full = normalize(href);
File: public/js/offboarding/offboardingMemberController.js
Match lines: 1
387| .normalize('NFD')
File: public/js/offboarding/utils.js
Match lines: 1
339| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
File: public/js/offboarding/visualizar_atividades.js
Match lines: 4
1828| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
1971| .normalize('NFD')
2510| .normalize('NFD')
2758| .normalize('NFD')
File: public/js/onboarding/utils.js
Match lines: 1
326| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
File: public/js/people-analytics/modules/diversity-inclusion-dashboard.js
Match lines: 1
871| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
File: public/js/people-analytics/modules/saude-organizacional-dashboard.js
Match lines: 1
1151| data: normalize(src),
File: public/js/recommendations-network-ported/jquery-ui.min.js
Match lines: 1
7|}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.2"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target);return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0
File: public/js/shift-scheduling/index.js
Match lines: 1
320| .normalize('NFD')
File: python/scripts/semantic_search.py
Match lines: 3
16|def l2_normalize(mat: np.ndarray) -> np.ndarray:
74| doc_emb = l2_normalize(doc_emb)
75| q_emb = l2_normalize(q_emb)
File: python/scripts/semantic_search_files.py
Match lines: 3
27|def l2_normalize(mat: np.ndarray) -> np.ndarray:
174| chunk_emb = l2_normalize(chunk_emb)
175| q_emb = l2_normalize(q_emb)
File: src/Command/AdrianaWorkflowIndirectProductSmokeCommand.php
Match lines: 1
282| $workflowBlock = WorkflowLayerBlockNormalizer::normalize($workflowBlock, $prompt) ?? $workflowBlock;
File: src/Controller/AiCommitteeController.php
Match lines: 1
1206| $vw = SpecializedCommitteeAgentWeightsValidator::validateAndNormalize($rawW);
File: src/Controller/Api/PeopleAnalytics/DiversityInclusionController.php
Match lines: 3
614| $filters = $this->normalize($request->query->all());
616| $filters = $this->normalize($filters);
624| private function normalize(array $filters): array
File: src/Controller/BudgetsController.php
Match lines: 4
1910| $budget->setStatus(BudgetStatus::normalize($rawStatus !== '' ? $rawStatus : BudgetStatus::RASCRUNHO));
2727| $statusNorm = BudgetStatus::normalize($data['status'] ?? BudgetStatus::RASCRUNHO);
3078| $newStatus = BudgetStatus::normalize($data['status']);
3204| $prevStatus = BudgetStatus::normalize($budget->getStatus());
File: src/Controller/ChatController.php
Match lines: 3
4191| $author = $normalize($item['author'] ?? ($item['first_name'] ?? ($item['name'] ?? 'Participante')));
4193| $content = $normalize($item['content'] ?? ($item['message'] ?? ($item['text'] ?? '')));
4205| $content = $normalize($item['content'] ?? ($item['message'] ?? ($item['text'] ?? '')));
File: src/Controller/CognitiveAssessmentController.php
Match lines: 1
665| return $normalize($productType) === $normalize($assessmentType);
File: src/Controller/CommunicationCenterController.php
Match lines: 4
305| 'name' => Utf8MojibakeNormalizer::normalize((string) ($row['name'] ?? '')),
315| 'flowName' => Utf8MojibakeNormalizer::normalize((string) ($row['flowName'] ?? '')),
316| 'stageName' => Utf8MojibakeNormalizer::normalize(\is_scalar($stageRaw) ? (string) $stageRaw : ''),
352| 'name' => Utf8MojibakeNormalizer::normalize((string) ($template->getName() ?? '')),
File: src/Controller/DecisionSystemController.php
Match lines: 3
1236| return Utf8MojibakeNormalizer::normalize($value);
4254| $name = Utf8MojibakeNormalizer::normalize((string) $workflow->getName());
4255| $description = Utf8MojibakeNormalizer::normalize((string) ($workflow->getDescription() ?? ''));
File: src/Controller/IaController.php
Match lines: 1
598| $workflowBlock = \App\Service\Adriana\WorkflowLayerBlockNormalizer::normalize(
File: src/Controller/InnovationResearchController.php
Match lines: 7
6808| $blob = $normalize(
6827| $blob = $normalize(
7071| $blob = $normalize(
7097| $blob = $normalize(
7120| $blob = $normalize(
7494| $optionToneByLabel[$normalize($option->getAnswer())] = $option->getIndicatorAnchored() ? 'negative' : 'positive';
7507| $label = $normalize($marketAnswer['answer'] ?? '');
File: src/Controller/PeopleAnalyticsApiController.php
Match lines: 1
112| $filters = $filterNormalizer->normalize($filters);
File: src/Controller/ProjectsNewController.php
Match lines: 1
5683| $permissions = ProjectCollaboratorPermission::normalize($data['permissions'] ?? $data);
File: src/Controller/ReceivablesController.php
Match lines: 2
4876| $p = $normalize($parcelaRaw);
4877| $t = $normalize($totalRaw);
File: src/Controller/SsmaController.php
Match lines: 37
4471| $gerencia = Utf8MojibakeNormalizer::normalize(trim((string) ($dept->getName() ?? '')));
6880| 'name' => Utf8MojibakeNormalizer::normalize((string) ($row['name'] ?? '')),
6890| 'flowName' => Utf8MojibakeNormalizer::normalize((string) ($row['flowName'] ?? '')),
6891| 'stageName' => Utf8MojibakeNormalizer::normalize(\is_scalar($stageRaw) ? (string) $stageRaw : ''),
6945| 'name' => Utf8MojibakeNormalizer::normalize((string) ($t->getName() ?? '')),
10948| return Utf8MojibakeNormalizer::normalize(trim((string) ($area->getName() ?? '')));
10982| $teamName = Utf8MojibakeNormalizer::normalize(trim((string) ($team->getName() ?? '')));
11022| return Utf8MojibakeNormalizer::normalize($full);
11026| return Utf8MojibakeNormalizer::normalize($firstLast);
11033| return Utf8MojibakeNormalizer::normalize($email);
11037| return Utf8MojibakeNormalizer::normalize($email);
11042| return Utf8MojibakeNormalizer::normalize($email);
11046| return Utf8MojibakeNormalizer::normalize($readable);
11053| return Utf8MojibakeNormalizer::normalize(implode(' ', $words));
12272| $rootAreaName = Utf8MojibakeNormalizer::normalize(trim((string) ($dept->getName() ?? '')));
13436| $name = Utf8MojibakeNormalizer::normalize(trim((string) ($row['observador_nome'] ?? '')));
14206| $key = ActionOrigemEnum::normalize($relatedEventType) ?? '';
14226| $origemKey = ActionOrigemEnum::normalize($relatedEventType);
17101| $panelSection = SsmaOccurrencePanelSectionAnalytics::normalize(
17200| $panelView = SsmaPreventionPanelViewAnalytics::normalize(
20368| 'name' => Utf8MojibakeNormalizer::normalize((string) ($member['name'] ?? '')),
20369| 'email' => Utf8MojibakeNormalizer::normalize((string) ($member['email'] ?? '')),
20372| 'position' => Utf8MojibakeNormalizer::normalize((string) ($member['position'] ?? '')),
20374| 'team_name' => Utf8MojibakeNormalizer::normalize($teamName),
20617| $insp = $normalize((string) ($refs['inspecao'] ?? $defaults['inspecao']));
20618| $ab = $normalize((string) ($refs['abordagem'] ?? $defaults['abordagem']));
24925| $teamIdToName[(string) $ct->getId()] = Utf8MojibakeNormalizer::normalize((string) ($ct->getName() ?? ''));
24962| 'cargo' => Utf8MojibakeNormalizer::normalize((string) ($roleMember ? $roleMember->getName() : ($m->getRole() ?? ''))),
24963| 'team_name' => Utf8MojibakeNormalizer::normalize((string) ($team->getName() ?? '')),
24984| 'cargo' => Utf8MojibakeNormalizer::normalize((string) ($roleMember ? $roleMember->getName() : ($m->getRole() ?? ''))),
24992| 'grupo' => ['id' => $team->getId(), 'name' => Utf8MojibakeNormalizer::normalize((string) ($team->getName() ?? ''))],
25072| $teamIdToName[(string) $ct->getId()] = Utf8MojibakeNormalizer::normalize((string) ($ct->getName() ?? ''));
25104| 'cargo' => Utf8MojibakeNormalizer::normalize((string) ($roleMember ? $roleMember->getName() : ($m->getRole() ?? ''))),
25126| 'cargo' => Utf8MojibakeNormalizer::normalize((string) ($roleMember ? $roleMember->getName() : ($m->getRole() ?? ''))),
25136| 'name' => Utf8MojibakeNormalizer::normalize((string) ($tag->getName() ?? '')),
25285| 'name' => Utf8MojibakeNormalizer::normalize((string) ($r['name'] ?? '')),
25364| $row[$k] = Utf8MojibakeNormalizer::normalize($v);
File: src/Domain/Ontology/OntologySeverity.php
Match lines: 4
23| public static function normalize(?string $severity): string
32| return self::RANK[self::normalize($severity)] ?? 1;
37| return self::normalize($severity) === self::MEDIUM;
42| $normalized = self::normalize($severity);
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/AbstractAnchorCandidateExtractor.php
Match lines: 10
69| protected function normalize(string $text): string
88| return trim($this->normalize($text));
220| $normalized = $this->normalize($line);
255| if (in_array($this->normalize($clean), ['de', 'da', 'do', 'dos', 'das', 'e'], true)) {
277| $normalized = $this->normalize($line);
291| $normalized = $this->normalize($line);
322| if ($clean === '' || in_array($this->normalize($clean), ['de', 'da', 'do', 'dos', 'das', '&'], true)) {
340| $normalized = $this->normalize($line);
459| $normalized = $this->normalize($trimmed);
501| } elseif ($this->normalize($line) === $this->normalize($label) && isset($lines[$index + 1])) {
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/ContractAnchorCandidateExtractor.php
Match lines: 2
45| $normalizedLabel = $this->normalize($label);
48| $normalizedLine = $this->normalize($line);
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/LifecycleAnchorCandidateExtractor.php
Match lines: 2
95| && $this->normalize($line) !== $this->normalize($label)
143| $matchedSignals = ['pattern:labeled_lifecycle_party', 'stage:' . $stage, 'label:' . $this->normalize($label)];
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/PayslipAnchorCandidateExtractor.php
Match lines: 2
53| && $this->normalize($line) !== $this->normalize($label)
100| $matchedSignals = ['pattern:labeled_payslip_party', 'label:' . $this->normalize($label)];
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/PolicyAnchorCandidateExtractor.php
Match lines: 2
49| && $this->normalize($line) !== $this->normalize($label)
93| $matchedSignals = ['pattern:labeled_policy_party', 'label:' . $this->normalize($label)];
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/ReceiptAnchorCandidateExtractor.php
Match lines: 1
49| $normalizedLabel = $this->normalize($label);
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/ResumeAnchorCandidateExtractor.php
Match lines: 7
53| if ($this->isGenericSectionHeading($this->normalize($line))) {
80| $previousLine = $this->normalize($window[$index - 1]);
199| || $this->containsAny($this->normalize($line), ['linkedin', 'github', 'telefone', 'celular', 'contato']);
238| $normalized = $this->normalize($line);
328| ['pattern:labeled_section_line', 'label:' . $this->normalize($label)],
368| $normalizedRight = $this->normalize($right);
416| return $this->containsAny($this->normalize($line), self::ORGANIZATION_MARKERS);
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/TimesheetAnchorCandidateExtractor.php
Match lines: 2
49| && $this->normalize($line) !== $this->normalize($label)
95| $matchedSignals = ['pattern:labeled_timesheet_summary_party', 'label:' . $this->normalize($label)];
File: src/Domains/FileManagement/v2/Service/Indexing/AnchorCandidate/TimesheetMirrorAnchorCandidateExtractor.php
Match lines: 2
50| && $this->normalize($line) !== $this->normalize($label)
95| $matchedSignals = ['pattern:labeled_timesheet_party', 'label:' . $this->normalize($label)];
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AbonoRequestDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AbstractDocumentTypeRule.php
Match lines: 1
7| protected function normalize(?string $text): string
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AddressProofDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AdmissionDocumentDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AdmissionFormDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ApplicationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AssessmentBundleDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AssessmentReportDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AssessmentSimulatorDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/AssetReturnReceiptDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/BankProofDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CampaignMessageDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CampaignTemplateDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CandidateOfferDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CandidateProfileDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CareerTrackDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ChannelPreferenceDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CommunityListDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ConfidentialityTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ConsentRecordDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ContractDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/CoverLetterDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/DocumentDeliveryReceiptDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/EmployeeHandbookDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/EmployeeRegistryFormDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/EmploymentContractDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ExitInterviewDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ExitMedicalExamDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/FunctionalHistoryDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/GamifiedAssessmentDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/HiringDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/HomologationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/IntegrationTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/InterviewEvaluationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/InterviewScriptDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/JobDescriptionDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/JobPostingDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/LevelDefinitionDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/MarketJobTitleDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/MemberRegistrationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/MonitoredAssessmentDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/NoticePeriodDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OffboardingChecklistDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OfferLetterDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OnboardingChecklistDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OnboardingPlanDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OnboardingScheduleDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OnboardingSignatureDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OperationalKeywordDocumentTypeRule.php
Match lines: 5
49| $text = $this->normalize($input->text);
50| $filename = $this->normalize($input->filename);
51| $folder = $this->normalize($input->folderName);
52| $source = $this->normalize($input->sourceModule);
124| $normalized = $this->normalize(str_replace('_', ' ', $term));
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/OrgChartExportDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PayslipDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PermissionTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PermissionsPolicyDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PersonalDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PjContractDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PolicyDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/PortfolioDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ProfessionalAreaDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ProfessionalProfileDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ProfessionalRecommendationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ProposalAcceptanceDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/QualifiedTalentProfileDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ReceiptDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/RescissionDocumentPackageRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ResignationLetterDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ResponsibilityTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ResumeDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/RoleDescriptionDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/RoleDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/ScreeningOpinionDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/SettlementTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/SeveranceTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/SignedInternalPolicyDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TalentCampaignDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TalentProfileDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TeamRegistrationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TerminationNoticeDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TerminationTermDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TestResultDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TimeAdjustmentJustificationDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TimeBankReportDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TimePunchDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TimesheetDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TimesheetMirrorDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TrmAnalyticsReportDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TrmTaskDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/TrmWorkflowTemplateDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/VacancyBriefingDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/VacancyRequestDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/WelcomeLetterDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/Classification/Rules/WorkScheduleDocumentTypeRule.php
Match lines: 4
18| $text = $this->normalize($input->text);
19| $filename = $this->normalize($input->filename);
20| $folder = $this->normalize($input->folderName);
21| $source = $this->normalize($input->sourceModule);
File: src/Domains/FileManagement/v2/Service/Indexing/InternalUserSearchAnchorProjectorService.php
Match lines: 2
68| $normalizedName = $this->normalize($displayName);
167| private function normalize(string $text): string
File: src/Domains/FileManagement/v2/Service/Search/FileManagementAdvancedSearchService.php
Match lines: 2
197| if (in_array($this->normalize($part), $normalizedTokens, true)) {
205| private function normalize(string $text): string
File: src/Domains/FileManagement/v2/Service/Search/SearchService.php
Match lines: 11
71| $normalizedQuery = $this->normalize($query);
211| return $this->extractTokens($this->normalize($query));
514| $matchedName = $this->normalize((string) ($row['normalized_name'] ?? $row['display_name'] ?? ''));
537| $name = $this->normalize((string) ($row['name'] ?? ''));
538| $documentType = $this->normalize(str_replace('_', ' ', (string) ($row['document_type'] ?? '')));
539| $folderName = $this->normalize((string) ($row['folder_name'] ?? ''));
540| $ext = $this->normalize((string) ($row['ext'] ?? ''));
541| $type = $this->normalize((string) ($row['type'] ?? ''));
594| $text = $this->normalize(trim(implode(' ', array_filter($parts))));
633| $normalizedValue = $this->normalize($value);
737| private function normalize(string $text): string
File: src/Entity/Budget.php
Match lines: 1
182| if (BudgetStatus::normalize($this->status) !== BudgetStatus::APROVADO) {
File: src/Entity/ProjectCollaboratorPermission.php
Match lines: 2
122| public static function normalize(?array $raw): array
142| $flags = self::normalize($raw);
File: src/Enum/Ssma/ActionOrigemEnum.php
Match lines: 4
46| $normalized = self::normalize($value);
59| public static function normalize(?string $value): ?string
97| return self::normalize($value) !== null;
102| $normalized = self::normalize($value);
File: src/Finance/BudgetStatus.php
Match lines: 5
69| public static function normalize(?string $raw): string
94| $s = self::normalize($status);
125| $from = self::normalize($from);
126| $to = self::normalize($to);
165| $s = self::normalize($currentStatus);
File: src/Repository/AccountReceivableRepository.php
Match lines: 1
215| $normalized = NossoNumeroNormalizer::normalize($nossoNumeroFromCnab);
File: src/Repository/GovernanceCaseHistoryRepository.php
Match lines: 15
214| return Utf8MojibakeNormalizer::normalize($name);
234| return Utf8MojibakeNormalizer::normalize($author);
262| return Utf8MojibakeNormalizer::normalize($fromProfileFull);
271| return Utf8MojibakeNormalizer::normalize($fromMemberFull);
276| return Utf8MojibakeNormalizer::normalize($composed);
281| return Utf8MojibakeNormalizer::normalize($fromProfileFirst);
287| return Utf8MojibakeNormalizer::normalize($companyName);
308| return Utf8MojibakeNormalizer::normalize($fromProfileFull);
313| return Utf8MojibakeNormalizer::normalize($composed);
318| return Utf8MojibakeNormalizer::normalize($fromProfileFirst);
324| return Utf8MojibakeNormalizer::normalize($companyName);
351| return Utf8MojibakeNormalizer::normalize($firstName);
359| return Utf8MojibakeNormalizer::normalize($fullName);
374| return Utf8MojibakeNormalizer::normalize($firstName);
442| return Utf8MojibakeNormalizer::normalize($name);
File: src/Security/LoginIdentifierResolver.php
Match lines: 3
27| public function normalize(string $loginIdentifier): string
58| $normalized = $this->normalize($loginIdentifier);
70| return $this->normalize($loginIdentifier);
File: src/Service/Adriana/AdrianaContextProviderService.php
Match lines: 3
1493| $normalized = $this->normalize($message);
1615| $normalized = $this->normalize($message);
1680| private function normalize(string $text): string
File: src/Service/Adriana/DraftMapper.php
Match lines: 1
67| return $this->draftNormalizer->normalize($draft);
File: src/Service/Adriana/Instance/Product/OffboardingInstanceHandler.php
Match lines: 4
166| $needle = $this->normalize($value);
172| if ((string) ($activity['typeId'] ?? '') === $needle || $this->normalize((string) ($activity['label'] ?? '')) === $needle || $key === $needle) {
176| if ($this->normalize((string) $alias) === $needle) {
435| private function normalize(string $text): string
File: src/Service/Adriana/Instance/Product/OnboardingInstanceHandler.php
Match lines: 4
188| $needle = $this->normalize($value);
194| if ((string) ($activity['typeId'] ?? '') === $needle || $this->normalize((string) ($activity['label'] ?? '')) === $needle || $key === $needle) {
198| if ($this->normalize((string) $alias) === $needle) {
518| private function normalize(string $text): string
File: src/Service/Adriana/Instance/Product/SelectionProcessInstanceHandler.php
Match lines: 4
126| $needle = $this->normalize($value);
136| if ($this->normalize((string) $alias) === $needle) {
900| $model = is_scalar($stage['modelo'] ?? null) ? $this->normalize((string) $stage['modelo']) : '';
1052| private function normalize(string $value): string
File: src/Service/Adriana/WorkflowActivitySuggestionService.php
Match lines: 5
182| $normalizedSegment = $this->normalize($segment);
210| $key = $productSlug . ':' . $this->normalize($name);
340| $name = $this->normalize((string) (((array) ($flatOption['activity'] ?? []))['name'] ?? ''));
352| $name = $this->normalize((string) (((array) ($flatOption['activity'] ?? []))['name'] ?? ''));
808| private function normalize(string $text): string
File: src/Service/Adriana/WorkflowApprovedPayrollFlowTemplateEnricher.php
Match lines: 2
128| $text = $this->normalize($this->collectSearchText($draft, $rawPayload));
183| private function normalize(string $text): string
File: src/Service/Adriana/WorkflowApprovedProcessoSeletivoEnricher.php
Match lines: 3
132| $normalized = $this->normalize($stepName);
176| $normalized = $this->normalize($stepName);
229| private function normalize(string $text): string
File: src/Service/Adriana/WorkflowConversationOrchestratorService.php
Match lines: 57
752| $normalized = $this->normalize($message);
927| $normalized = $this->normalize($message);
986| $normalized = $this->normalize($message);
1024| $normalizedName = $this->normalize($name);
1631| $normalized = $this->normalize($message);
1722| $haystack = $this->normalize(implode(' ', array_filter([
1746| $normalized = $this->normalize($message);
1843| $normalized = $this->normalize($message);
2080| $normalized = $this->normalize($message);
2209| $normalized = $this->normalize($message);
2252| $normalized = $this->normalize($message);
2341| $normalized = $this->normalize($message);
2443| $normalized = $this->normalize($message);
2489| $normalized = $this->normalize($message);
2508| $normalized = $this->normalize($message);
2838| $normalized = $this->normalize($message);
2862| $term = $this->normalize((string) $term);
2954| $normalized = $this->normalize($message);
3009| $candidate = $this->normalize((string) $workflow['name']);
3211| $normalized = $this->normalize($message);
3235| $term = $this->normalize((string) $term);
3271| $normalized = $this->normalize($name);
3925| return match ($this->normalize($value)) {
4058| if ($this->isKeepSuggestedFlowNameAnswer($this->normalize($name))) {
4110| $normalized = $this->normalize($message);
4347| $normalized = $this->normalize($value);
4365| $normalized = $this->normalize($message);
4833| $soft = $this->softNormalize($message);
4859| * stricter normalize() drops punctuation, which is unsuitable here.
4861| private function softNormalize(string $text): string
5026| return $this->normalize($templateType) === 'variavel' ? 'variavel' : 'fixo';
5377| $normalized = $this->normalize($message);
5609| $normalized = $this->normalize($message);
5797| $normalized = $this->normalize($rawValue);
5922| $normalized = $this->normalize($rawValue);
5932| $normalized = $this->normalize($rawValue);
5949| return $this->resolveOnboardingBooleanAnswer($this->normalize($rawValue)) ?? false;
5956| if ($field === 'footerText' && in_array($this->normalize($rawValue), ['sem rodape', 'sem rodapé', 'pular', 'nao', 'não'], true)) {
6041| $normalized = $this->normalize($message);
6110| $normalized = $this->normalize($rawValue);
6126| $normalized = $this->normalize($rawValue);
6297| $normalized = $this->normalize($rawValue);
6303| $optionLabel = $this->normalize((string) ($option['label'] ?? $option['name'] ?? ''));
6325| $normalized = $this->normalize($message);
6423| if (!$this->isExplicitNewInstanceModeAnswer($this->normalize($message))) {
6503| $normalized = $this->normalize($message);
6538| // $normalized is produced by normalize(), which strips accents, so the
6589| $normalizedValue = $this->normalize($rawValue);
6596| $label = $this->normalize((string) ($option['label'] ?? ''));
6660| $normalized = $this->normalize($trimmed);
6691| $normalized = $this->normalize($trimmed);
7012| $normalized = $this->normalize($rawValue);
7089| $normalized = $this->normalize($rawValue);
7214| $normalized = $this->normalize($rawValue);
7371| $normalized = $this->normalize($rawValue);
8104| $normalizedChoice = $this->normalize($choice);
8371| private function normalize(string $text): string
File: src/Service/Adriana/WorkflowDomainLayerStateCodec.php
Match lines: 1
172| $draft = (new WorkflowDraftNormalizer())->normalize($draft);
File: src/Service/Adriana/WorkflowDraftHashService.php
Match lines: 1
22| $draft = $this->draftNormalizer->normalize(
File: src/Service/Adriana/WorkflowDraftNavigationInference.php
Match lines: 3
81| $text = self::normalize(self::collectSearchText($productKey, $draft, $rawPayload));
198| if ($needle !== '' && str_contains($haystack, self::normalize($needle))) {
206| private static function normalize(string $value): string
File: src/Service/Adriana/WorkflowDraftNormalizer.php
Match lines: 2
26| public function normalize(mixed $raw): array
48| $slotValue = $this->stepsNormalizer->normalize(
File: src/Service/Adriana/WorkflowDraftStepsNormalizer.php
Match lines: 1
21| public function normalize(array $steps, ?string $productKey = null): array
File: src/Service/Adriana/WorkflowIntentHeuristicService.php
Match lines: 3
22| $normalized = $this->normalize($message);
137| $normalized = $this->normalize($message);
305| private function normalize(string $text): string
File: src/Service/Adriana/WorkflowLayerBlockNormalizer.php
Match lines: 2
32| public static function normalize(?array $workflow, string $userMessage = ''): ?array
50| $workflow['draft'] = (new WorkflowDraftNormalizer())->normalize($workflow['draft']);
File: src/Service/Adriana/WorkflowLayerBridgeService.php
Match lines: 1
169| $workflowBlock = WorkflowLayerBlockNormalizer::normalize(
File: src/Service/Adriana/WorkflowLayerChatPayloadEnricher.php
Match lines: 1
39| $workflowBlock = WorkflowLayerBlockNormalizer::normalize(
File: src/Service/Adriana/WorkflowLayerDiffSummaryBuilder.php
Match lines: 2
20| $currentDraft = (new WorkflowDraftNormalizer())->normalize($currentPatch['workflow_draft'] ?? null);
21| $previousDraft = (new WorkflowDraftNormalizer())->normalize(
File: src/Service/Adriana/WorkflowLayerPatchCodec.php
Match lines: 4
69| $draft = (new WorkflowDraftNormalizer())->normalize($layerPatch['workflow_draft'] ?? null);
81| $draft = (new WorkflowDraftNormalizer())->normalize($layerPatch['workflow_draft'] ?? null);
107| $draft = (new WorkflowDraftNormalizer())->normalize($layerPatch['workflow_draft'] ?? null);
153| $draft = (new WorkflowDraftNormalizer())->normalize($workflowBlock['draft'] ?? null);
File: src/Service/Adriana/WorkflowNarrativeDraftHydrator.php
Match lines: 3
76| return (new WorkflowDraftNormalizer($this->stepsNormalizer))->normalize($draft);
142| return $this->stepsNormalizer->normalize($payrollSteps, 'folha-de-pagamento');
151| return $this->stepsNormalizer->normalize($genericSteps, $productKey);
File: src/Service/Adriana/WorkflowStageDescriptionResolver.php
Match lines: 4
73| $normalized = $this->normalize($text);
76| if ($normalized === $this->normalize($token)) {
91| $normalized = $this->normalize($stepName);
110| private function normalize(string $text): string
File: src/Service/AutomationExecutionService.php
Match lines: 2
12229| return $normalize($conditions[0]['type'] ?? $automation->getTriggerType() ?? 'on_enter');
12232| return $normalize($automation->getTriggerType() ?? 'on_enter');
File: src/Service/Cnab/Bradesco/BradescoCnab240CobrancaParser.php
Match lines: 1
125| $nossoNumero = NossoNumeroNormalizer::normalize($nossoNumeroRaw);
File: src/Service/Cnab/NossoNumeroNormalizer.php
Match lines: 2
19| public static function normalize(?string $value, bool $trimLeadingZeros = true): string
39| return self::normalize($fromCnab) === self::normalize($fromDb);
File: src/Service/CompanyCodeGenerator.php
Match lines: 2
20| public function normalize(?string $value, ?Company $company = null): string
39| $baseCode = $this->normalize($value, $company);
File: src/Service/Effectiveness/RiskIntelligence/RiskFingerprintNormalizer.php
Match lines: 2
26| $fingerprint = $this->normalize($row, $referenceDate);
36| public function normalize(array $row, \DateTimeImmutable $referenceDate): ?RiskFingerprint
File: src/Service/ExternalImport/CanonicalPayloadHasher.php
Match lines: 4
16| $normalized = $this->normalize($payload);
38| private function normalize(mixed $value): mixed
45| return array_map(fn (mixed $item): mixed => $this->normalize($item), $value);
50| $value[$key] = $this->normalize($item);
File: src/Service/Governance/GovernanceCasesAutomationPersistenceHelper.php
Match lines: 1
108| $catalogLabel = Utf8MojibakeNormalizer::normalize(trim((string) ($module['label'] ?? $moduleCode)));
File: src/Service/Governance/GovernanceCasesAutomationProvisioner.php
Match lines: 4
128| 'name' => Utf8MojibakeNormalizer::normalize((string) ($row['name'] ?? '')),
138| 'flowName' => Utf8MojibakeNormalizer::normalize((string) ($row['flowName'] ?? '')),
139| 'stageName' => Utf8MojibakeNormalizer::normalize(\is_scalar($stageRaw) ? (string) $stageRaw : ''),
177| 'name' => Utf8MojibakeNormalizer::normalize((string) ($template->getName() ?? '')),
File: src/Service/Governance/Grc/GovernanceIntelligentControlModuleResolver.php
Match lines: 1
101| 'label' => Utf8MojibakeNormalizer::normalize((string) $catalogModule['label']),
File: src/Service/Interview/V2/Category/DeterministicCategoryClassifier.php
Match lines: 5
45| $normalized = $this->normalize((string) $value);
49| $normalizedCode = $this->normalize($code);
50| $normalizedLabel = $this->normalize($label);
88| $normalized = $this->normalize($candidate);
204| private function normalize(string $value): string
File: src/Service/MetaHuman/GovernanceCasesHubService.php
Match lines: 3
7396| 'motivo' => Utf8MojibakeNormalizer::normalize($parsedReason['motivo']),
7470| return $fallback !== '' ? Utf8MojibakeNormalizer::normalize($fallback) : '—';
7478| return Utf8MojibakeNormalizer::normalize($name);
File: src/Service/NewPackageProductsService.php
Match lines: 1
352| return $normalize($left) !== $normalize($right);
File: src/Service/Ontology/Alert/OntologyAlertReviewPersistenceService.php
Match lines: 1
285| 'severity' => OntologySeverity::normalize((string) ($event['severity'] ?? '')),
File: src/Service/Ontology/Attendance/AttendanceEventEngineService.php
Match lines: 1
239| 'severity' => OntologySeverity::normalize($severity),
File: src/Service/Ontology/Compensation/CompensationEventEngineService.php
Match lines: 1
129| 'severity' => OntologySeverity::normalize($severity),
File: src/Service/Ontology/Cross/CrossCompositeRuleEngineService.php
Match lines: 3
52| 'severity' => OntologySeverity::normalize($this->resolveCompositeSeverity($matched, $definition)),
78| $minSeverity = OntologySeverity::normalize((string) ($definition['min_upstream_severity'] ?? OntologySeverity::LOW));
244| $severity = OntologySeverity::normalize((string) ($event['severity'] ?? ''));
File: src/Service/Ontology/Engagement/EngagementEventEngineService.php
Match lines: 1
228| 'severity' => OntologySeverity::normalize($severity),
File: src/Service/Ontology/OntologySignalBridgeService.php
Match lines: 2
1197| $severity = OntologySeverity::normalize((string) ($alert['severity'] ?? ''));
2130| return strtolower(OntologySeverity::normalize($severity));
File: src/Service/Ontology/Performance/PerformanceEventEngineService.php
Match lines: 1
135| 'severity' => OntologySeverity::normalize($severity),
File: src/Service/Ontology/Ssma/SsmaEventEngineService.php
Match lines: 1
125| 'severity' => OntologySeverity::normalize($severity),
File: src/Service/Ontology/Ssma/SsmaStateClassifierService.php
Match lines: 1
38| if (OntologySeverity::normalize((string) ($event['severity'] ?? '')) === OntologySeverity::CRITICAL) {
File: src/Service/Ontology/Team/OntologyTeamAggregationService.php
Match lines: 1
203| $severity = OntologySeverity::normalize((string) ($alert['severity'] ?? ''));
File: src/Service/Ontology/Team/OntologyTeamSignalBuilderService.php
Match lines: 2
56| $worstSeverity = OntologySeverity::normalize((string) ($aggregate['worst_severity'] ?? OntologySeverity::MEDIUM));
231| return match (OntologySeverity::normalize($severity)) {
File: src/Service/PeopleAnalytics/BurnoutRiskService.php
Match lines: 9
1163| ? $this->normalize(max(0.0, -$engagementDelta), 0.0, 20.0)
1189| ? $this->normalize(max(0.0, -$performanceDelta), 0.0, 20.0)
1244| $licenseScore = $this->normalize((float) $absenceCurrent['dias_licenca'], 0.0, 6.0);
1245| $operationalScore = $this->normalize((float) $absenceCurrent['dias_ausencia_operacional'], 0.0, 4.0);
1488| $peakPercentScore = $this->normalize((float) $workload['max_daily_worked_percent'], 100.0, 1000.0);
1489| $periodOvertimeScore = $this->normalize((float) $workload['overtime_hours_30d'], 0.0, 40.0);
1490| $peakHoursScore = $this->normalize((float) $workload['max_daily_worked_hours'], 8.0, 24.0);
1491| $peakOvertimeScore = $this->normalize((float) $workload['max_daily_overtime_hours'], 0.0, 16.0);
1693| private function normalize(float $value, float $min, float $max): float
File: src/Service/PeopleAnalytics/Chart/ChartFilterNormalizer.php
Match lines: 1
17| public function normalize(array $filters): array
File: src/Service/PeopleAnalytics/Chart/ChartResolver.php
Match lines: 1
71| $normalizedFilters = $this->filterNormalizer->normalize($filters);
File: src/Service/PeopleAnalytics/Import/ChartDataImportService.php
Match lines: 2
289| $parsedData = $this->excelParser->normalize($parsedData);
324| $parsedData = $this->excelParser->normalize($parsedData);
File: src/Service/PeopleAnalytics/Import/ExcelParserService.php
Match lines: 1
319| public function normalize(array $rawData): array
File: src/Service/PositionLevel/PositionLevelService.php
Match lines: 3
41| 'position' => $this->normalize($position),
64| 'position' => $this->normalize($position),
94| private function normalize(PositionLevel $position): array
File: src/Service/PromptFactory.php
Match lines: 4
128| private function normalize(string $s): string
132| $s = \Normalizer::normalize($s, \Normalizer::FORM_D);
163| $textNorm = $this->normalize($cvText);
166| $kwNorm = $this->normalize($kw);
File: src/Service/Ssma/ActionPlan/SsmaActionPlanPanelService.php
Match lines: 1
1345| $normalized = ActionOrigemEnum::normalize($origem);
File: src/Service/Ssma/Investigation/Coordinator/FindingNormalizer.php
Match lines: 1
16| public function normalize(array $findings): array
File: src/Service/Ssma/Investigation/Coordinator/InvestigationCoordinator.php
Match lines: 1
80| $findings = $this->deduplicator->deduplicate($this->normalizer->normalize($findings));
File: src/Service/Ssma/SsmaActionPlanExecutiveReportBuilder.php
Match lines: 1
1087| $normalized = ActionOrigemEnum::normalize($origem);
File: src/Service/Ssma/SsmaCauseTreeAnalysisApproval.php
Match lines: 1
41| public static function normalize(mixed $raw): array
File: src/Service/Ssma/SsmaCauseTreeCommittee.php
Match lines: 2
91| return self::normalize($leaderId, $memberIds);
99| public static function normalize(?int $leaderId, mixed $memberIds): array
File: src/Service/Ssma/SsmaCauseTreeService.php
Match lines: 7
780| $approved = SsmaCauseTreeAnalysisApproval::normalize(
994| $approval = SsmaCauseTreeAnalysisApproval::normalize(
1050| $approval = SsmaCauseTreeAnalysisApproval::normalize(
1577| $approval = SsmaCauseTreeAnalysisApproval::normalize(
1688| return SsmaCauseTreeCommittee::normalize($filteredLeader, $filteredMembers);
1707| return SsmaCauseTreeCommittee::normalize($leaderId, $memberIds);
1725| return SsmaCauseTreeAnalysisApproval::normalize(
File: src/Service/Ssma/SsmaInformativeQuestionGuard.php
Match lines: 2
19| $normalized = self::normalize($message);
51| private static function normalize(string $value): string
File: src/Service/Ssma/SsmaInspectionTypeConfigService.php
Match lines: 3
51| return $this->normalize($types);
61| $normalized = $this->normalize($types);
78| private function normalize(array $types): array
File: src/Service/Ssma/SsmaOccurrenceDashboardAggregator.php
Match lines: 1
995| $panelSection = SsmaOccurrencePanelSectionAnalytics::normalize($panelSection);
File: src/Service/Ssma/SsmaOccurrencePanelSectionAnalytics.php
Match lines: 2
18| public static function normalize(string $value): string
37| $section = self::normalize($section);
File: src/Service/Ssma/SsmaOccurrenceSemanticAnalysisService.php
Match lines: 1
77| $panelSection = SsmaOccurrencePanelSectionAnalytics::normalize($panelSection);
File: src/Service/Ssma/SsmaPreventionPanelViewAnalytics.php
Match lines: 3
15| public static function normalize(string $value): string
33| $view = self::normalize($view);
58| $view = self::normalize($view);
File: src/Service/Trm/EventIngestion/Consumers/AssessmentEventConsumer.php
Match lines: 2
30| $eventDto = $this->normalize($payload, $companyId);
37| public function normalize(array $payload, int $companyId): ExternalEventDTO
File: src/Service/Trm/EventIngestion/Consumers/AtsEventConsumer.php
Match lines: 2
34| $eventDto = $this->normalize($payload, $companyId);
41| public function normalize(array $payload, int $companyId): ExternalEventDTO
File: src/Service/Trm/EventIngestion/Consumers/BpmEventConsumer.php
Match lines: 2
33| $eventDto = $this->normalize($payload, $companyId);
40| public function normalize(array $payload, int $companyId): ExternalEventDTO
File: src/Service/Trm/EventIngestion/Consumers/ChannelEventConsumer.php
Match lines: 2
34| $eventDto = $this->normalize($payload, $companyId, $channel);
41| public function normalize(array $payload, int $companyId, string $channel): ExternalEventDTO
File: src/Service/Trm/EventIngestion/Consumers/SignatureEventConsumer.php
Match lines: 2
31| $eventDto = $this->normalize($payload, $companyId);
38| public function normalize(array $payload, int $companyId): ExternalEventDTO
File: src/Service/ai_committee/SpecializedCommitteeAgentWeightsValidator.php
Match lines: 1
17| public static function validateAndNormalize(?array $raw): array
File: src/Service/ai_committee/SpecializedCommitteeAnalysisRunner.php
Match lines: 1
2407| $s = SpecializedCommitteeUtf8DisplayV1::normalize($s);
File: src/Service/ai_committee/SpecializedCommitteeSessionDashboardDataResolver.php
Match lines: 2
4334| $v = mb_strtolower(trim(str_replace('-', '_', SpecializedCommitteeUtf8DisplayV1::normalize($raw))), 'UTF-8');
4359| $t = trim(SpecializedCommitteeUtf8DisplayV1::normalize($text));
File: src/Service/ai_committee/SpecializedCommitteeSessionWorkAccidentDashAligner.php
Match lines: 1
197| $t = trim(SpecializedCommitteeUtf8DisplayV1::normalize($raw));
File: src/Service/ai_committee/SpecializedCommitteeUtf8DisplayV1.php
Match lines: 3
49| public static function normalize(string $text): string
82| $data[$key] = self::normalize($value);
99| $s = self::normalize($s);
File: src/Util/Utf8MojibakeNormalizer.php
Match lines: 3
19| return self::normalize($value);
25| $normalizedKey = \is_string($key) ? self::normalize($key) : $key;
35| public static function normalize(string $value): string
File: src/libs/nfephp-org/sped-common/src/Strings.php
Match lines: 3
89| $input = self::normalize($input);
100| $input = self::normalize($input);
131| public static function normalize($input)
File: templates/LiveInterviewSchedule/management/index.html.twig
Match lines: 2
589| var search = normalize(searchInput ? searchInput.value : '');
594| var cardSearchContent = normalize(card.getAttribute('data-search-content') || '');
File: templates/candidate/components_perfil/modal_mergeCv.html.twig
Match lines: 3
238| const idiomaKey = idiomaNome.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
239| const nivelKey = nivelNome.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
354| str?.normalize("NFD").replace(/\p{Diacritic}/gu, "") || "";
File: templates/candidate/components_perfil/modal_warning_cvIa.html.twig
Match lines: 6
607| str?.trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "") || "";
642| str?.trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "") || "";
717| str?.trim().toLowerCase().normalize("NFD").replace(/\p{Diacritic}/gu, "") || "";
966| const nome = nomeRaw.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\(.*\)/g, "").trim();
967| const nivel = nivelRaw.normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
1042| .normalize('NFD')
File: templates/company/my_plan_company.html.twig
Match lines: 1
302| .normalize('NFD')
File: templates/contractor/tabs/_tab_empresas.html.twig
Match lines: 1
1138| .normalize('NFD')
File: templates/contractor/tabs/_tab_requisitos_documentais.html.twig
Match lines: 1
693| .normalize('NFD')
File: templates/cultural_hub/feed/feed_index.html.twig
Match lines: 1
3232| .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
File: templates/cultural_hub/newsletter/newsletter_tabs/custom_list.html.twig
Match lines: 5
1324| function normalize(s){
1325| return String(s||'').toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g,'');
1333| var term = normalize(input.value).trim();
1335| var bag = normalize(tr.getAttribute('data-name') || '');
1336| var email = normalize(tr.getAttribute('data-email') || '');
File: templates/decision_system/automations/new_automation.html.twig
Match lines: 1
1434| .normalize('NFD')
File: templates/dei_assessment/dei_company_tabs/dashboard_dimentional_map.html.twig
Match lines: 1
766| return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
File: templates/governance/authorization/tabs/_tab_authorizations_config.html.twig
Match lines: 1
1442| .normalize('NFD')
File: templates/governance/cases/automations/new_automation.html.twig
Match lines: 1
1516| .normalize('NFD')
File: templates/governance/cases/index.html.twig
Match lines: 1
2602| .normalize('NFD')
File: templates/new-goals/goal_team/goal_team.html.twig
Match lines: 1
1421| return (str || '').toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
File: templates/new-goals/goal_team/modals_goal_collective/modal_create_meta_colective.html.twig
Match lines: 1
1080| .normalize('NFD')
File: templates/new-goals/pdi/pdi_collaborators.html.twig
Match lines: 1
498| .normalize('NFD')
File: templates/onboarding/index_user.html.twig
Match lines: 1
332| const stSlugUser = stUser.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/\s+/g, '-');
File: templates/onboarding/onboarding_view/tabs/_tab_overview.html.twig
Match lines: 1
954| const stSlugEl = st.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(/\s+/g, '-');
File: templates/organograma/company_layout.html.twig
Match lines: 1
11554| .normalize('NFD')
File: templates/payables/payroll/form_embedded.html.twig
Match lines: 1
2535| .normalize("NFD") // Remove acentos
File: templates/payables/payroll/form_fragment.html.twig
Match lines: 1
2510| .normalize("NFD") // Remove acentos
File: templates/process/new_selective_process.html.twig
Match lines: 1
4293| ? scheduleTypeObj.name.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "")
File: templates/process_department/components/_professional_area_form_modal.html.twig
Match lines: 1
280| .normalize('NFD')
File: templates/process_department/index.html.twig
Match lines: 1
707| .normalize('NFD')
File: templates/projects2.0/components/modal_create_project.html.twig
Match lines: 1
933| .normalize('NFD').replace(/[\u0300-\u036f]/g, '');
File: templates/refunds/dashboard.html.twig
Match lines: 1
1546| return String(str || '').normalize('NFD').replace(/[\u0300-\u036f]/g, '');
File: templates/ssma/partials/_shared_module_assets.html.twig
Match lines: 1
641| .normalize('NFD')
File: templates/ssma/refusal/tabs/_tab_list.html.twig
Match lines: 2
430| .normalize('NFD')
447| .normalize('NFD')
File: templates/sst_exam/components/_tab_scheduling.html.twig
Match lines: 1
747| return String(value || '').toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').trim();
File: templates/sst_exam/components/historico.html.twig
Match lines: 1
594| return String(value || '').toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '').trim();
File: templates/suppliers/index.html.twig
Match lines: 1
1234| .normalize('NFD')
File: templates/templates/a360/criar_pesquisa.html.twig
Match lines: 2
631| var normalizedStoredCat = storedCategory.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
635| var normalizedOption = optionValue.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
File: templates/templates/payroll_form.html.twig
Match lines: 1
2531| .normalize("NFD") // Remove acentos
File: templates/time-management/components/Professional/tabs/timesheet/partials/shared-activity-utils.ts
Match lines: 1
18| .normalize("NFD")
File: templates/time-management/components/Tenant/tabs/attendance/index.tsx
Match lines: 9
192| const normalizedSearch = normalize(search);
194| const matchesSearch = !normalizedSearch || normalize(`${row.title} ${row.method} ${row.status} ${row.origin}`).includes(normalizedSearch);
880| const normalizedSearch = normalize(`${search}`);
882| const matchesSearch = !normalizedSearch || normalize(`${member.label} ${member.email}`).includes(normalizedSearch);
1519| const normalizedSearch = normalize(participantSearch);
1523| const matchesSearch = !normalizedSearch || normalize(`${participant.name} ${participant.email} ${participant.role}`).includes(normalizedSearch);
2037|function normalize(value: string) {
2040| .normalize("NFD")
2045| return normalize(value).replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
File: templates/time-management/ui/multi-select/index.tsx
Match lines: 2
36| .normalize('NFD')
41| .normalize('NFD')
File: tests/Service/Adriana/WorkflowAiPipelineTest.php
Match lines: 1
2651| // The accent-stripping normalize() must still resolve "use o padrão".
File: tests/Service/ai_committee/SpecializedCommitteeAgentWeightsValidatorTest.php
Match lines: 4
18| $r = SpecializedCommitteeAgentWeightsValidator::validateAndNormalize(null);
34| $r = SpecializedCommitteeAgentWeightsValidator::validateAndNormalize([
49| $r = SpecializedCommitteeAgentWeightsValidator::validateAndNormalize($raw);
60| $r = SpecializedCommitteeAgentWeightsValidator::validateAndNormalize($raw);
File: tests/Service/ai_committee/SpecializedCommitteeUtf8DisplayV1Test.php
Match lines: 1
31| $fixed = SpecializedCommitteeUtf8DisplayV1::normalize($broken);
File: tests/Ssma/assert_member_searchable_field.js
Match lines: 1
11| .normalize('NFD')
File: tests/Unit/Product/AuraLoginCpf/PendingInvitationLoginAuthenticatorTest.php
Match lines: 1
168| $resolver->normalize('cpf52998224725@sem-email.local');
File: tests/Unit/Product/Effectiveness/Leadership/LeadershipUpperFilterHtmlContractTest.php
Match lines: 7
124| self::assertSame($period, $this->invokeControllerNormalize($period));
129| self::assertSame('30d', $this->invokeControllerNormalize('quarterly-invalid'));
130| self::assertSame('30d', $this->invokeControllerNormalize(''));
131| self::assertSame('90d', $this->invokeControllerNormalize('quarter'));
132| self::assertSame('180d', $this->invokeControllerNormalize('semester'));
133| self::assertSame('365d', $this->invokeControllerNormalize('year'));
256| private function invokeControllerNormalize(string $period): string
File: tests/Unit/Product/Projects/ProjectCollaboratorPermissionTest.php
Match lines: 2
31| $normalized = ProjectCollaboratorPermission::normalize([
49| $normalized = ProjectCollaboratorPermission::normalize([
File: tests/Unit/Product/Ssma/ActionOrigemEnumTest.php
Match lines: 7
13| self::assertSame(ActionOrigemEnum::INSPECAO, ActionOrigemEnum::normalize('inspecao'));
14| self::assertSame(ActionOrigemEnum::INSPECAO, ActionOrigemEnum::normalize('inspection'));
15| self::assertSame(ActionOrigemEnum::ABORDAGEM, ActionOrigemEnum::normalize('abordagem'));
16| self::assertSame(ActionOrigemEnum::ABORDAGEM, ActionOrigemEnum::normalize('approach'));
17| self::assertSame(ActionOrigemEnum::OCORRENCIA, ActionOrigemEnum::normalize('ocorrencia'));
18| self::assertNull(ActionOrigemEnum::normalize(''));
19| self::assertNull(ActionOrigemEnum::normalize('desconhecido'));
File: tests/Unit/Product/Ssma/SsmaCauseTreeAnalysisApprovalTest.php
Match lines: 1
13| self::assertSame(SsmaCauseTreeAnalysisApproval::STATUS_CREATED, SsmaCauseTreeAnalysisApproval::normalize(null)['status']);
File: tests/Unit/Product/Ssma/SsmaCauseTreeCommitteeTest.php
Match lines: 2
13| $committee = SsmaCauseTreeCommittee::normalize(7, [7, 8, 9, 0, '8']);
22| $committee = SsmaCauseTreeCommittee::normalize(4, []);
File: tests/Unit/Product/TextToBpmn/WorkflowBlockSchemaContractTest.php
Match lines: 6
20| $normalized = WorkflowLayerBlockNormalizer::normalize($block);
31| $normalized = WorkflowLayerBlockNormalizer::normalize($block);
44| $normalized = WorkflowLayerBlockNormalizer::normalize($block);
56| $normalized = WorkflowLayerBlockNormalizer::normalize(
70| $normalized = WorkflowLayerBlockNormalizer::normalize(
89| $normalized = WorkflowLayerBlockNormalizer::normalize($block);
File: tests/Unit/Product/TextToBpmn/WorkflowDraftStepsNormalizerTest.php
Match lines: 2
21| $steps = $this->normalizer->normalize([
42| $steps = $this->normalizer->normalize([
File: tests/Unit/Product/TextToBpmn/WorkflowIndirectProductResolutionCasesTest.php
Match lines: 1
193| $normalized = WorkflowLayerBlockNormalizer::normalize($this->layerBlock($wrongProduct, true), $prompt);
File: tests/Unit/Product/TextToBpmn/WorkflowLayerBlockNormalizerTest.php
Match lines: 6
15| $block = WorkflowLayerBlockNormalizer::normalize(array_merge(
31| $block = WorkflowLayerBlockNormalizer::normalize([
46| $block = WorkflowLayerBlockNormalizer::normalize(array_merge(
64| $block = WorkflowLayerBlockNormalizer::normalize([
87| self::assertNull(WorkflowLayerBlockNormalizer::normalize([
95| $block = WorkflowLayerBlockNormalizer::normalize([
code_search
Show Details
Arguments
{"search_text": "resolveRelatedEventType"}
Result
File: src/Controller/SsmaController.php Match lines: 2 9628| $relatedEventType = $action->resolveRelatedEventType(); 14738| $relatedEventType = $row->resolveRelatedEventType(); File: src/Entity/SsmaAction.php Match lines: 1 240| public function resolveRelatedEventType(): string
code_search
Show Details
Arguments
{"search_text": "ActionOrigemEnum::label"}
Result
File: src/Controller/SsmaController.php Match lines: 7 14112| ActionOrigemEnum::label(ActionOrigemEnum::INSPECAO), 14113| ActionOrigemEnum::label(ActionOrigemEnum::ABORDAGEM), 14114| ActionOrigemEnum::label(ActionOrigemEnum::OCORRENCIA), 14115| ActionOrigemEnum::label(ActionOrigemEnum::OUTRO), 14116| ActionOrigemEnum::label(ActionOrigemEnum::EVENTO), 14210| 'occurrence_type_label' => ActionOrigemEnum::label($relatedEventType), 14230| 'occurrence_type_label' => ActionOrigemEnum::label($origemKey), File: src/Service/Home/HomeSsmaActivityCardService.php Match lines: 4 178| $title = ActionOrigemEnum::label(ActionOrigemEnum::ABORDAGEM) . ' — ' . (string) ($row->getLocal() ?? 'SSMA'); 188| 'format' => ActionOrigemEnum::label(ActionOrigemEnum::ABORDAGEM), 244| 'format' => ActionOrigemEnum::label(ActionOrigemEnum::INSPECAO), 364| return ActionOrigemEnum::label($action->getOrigem(), ''); File: src/Service/SafetyEnvironmentService.php Match lines: 6 457| $label = ActionOrigemEnum::label($origem); 528| $title = ActionOrigemEnum::label(ActionOrigemEnum::ABORDAGEM) . ' — ' . $row->getLocal(); 542| 'origin' => ActionOrigemEnum::label(ActionOrigemEnum::ABORDAGEM), 597| $title = ActionOrigemEnum::label(ActionOrigemEnum::INSPECAO) . ' — ' . ($row->getType() ?? 'SSMA'); 607| 'occurrenceType' => ActionOrigemEnum::label(ActionOrigemEnum::INSPECAO), 610| 'origin' => ActionOrigemEnum::label(ActionOrigemEnum::INSPECAO), File: src/Service/Ssma/Effectiveness/SecurityActionEffectivenessPresenter.php Match lines: 4 1660| $prefix = ActionOrigemEnum::label(ActionOrigemEnum::INSPECAO); 1666| ActionOrigemEnum::ABORDAGEM => ActionOrigemEnum::label(ActionOrigemEnum::ABORDAGEM), 1667| ActionOrigemEnum::EVENTO => ActionOrigemEnum::label(ActionOrigemEnum::EVENTO), 1668| ActionOrigemEnum::OUTRO => ActionOrigemEnum::label(ActionOrigemEnum::OUTRO), File: src/Service/Ssma/SsmaActionPlanExecutiveReportBuilder.php Match lines: 1 1089| return ActionOrigemEnum::label($normalized);
memory_compression_task
Request #1
6260ms
Error
Error Detail
POST "https://api.deepseek.com/chat/completions": 400 Bad Request {"message":"This model's maximum context length is 1048576 tokens. However, you requested 2664193 tokens (2664193 in the messages, 0 in the completion). Please reduce the length of the messages or completion.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}
Review Comments (4 findings)
src/Controller/SsmaController.php 4 comments
No comments match this filter.