From 56315ec97649b94558e84513192498dfef91d3e0 Mon Sep 17 00:00:00 2001 From: LeeKyungBeom Date: Wed, 16 Sep 2026 15:42:32 +0900 Subject: [PATCH 1/2] feat: add nginx Helm catalog, display ingress endpoints, and support async deployments --- .../scripts/test-deployment-submission.mjs | 39 +++++ .../scripts/test-ingress-preparation.mjs | 2 +- applicationFE/src/api/softwareCatalog.ts | 35 +++- applicationFE/src/common/request.ts | 4 +- .../src/utils/deploymentSubmission.ts | 68 ++++++++ .../components/applicationDetailModal.vue | 4 + .../applicationInstallationForm.vue | 37 ++++- doc/deployment-submission-timeout-20260916.md | 45 +++++ doc/helm-ingress-mapping.md | 34 ++++ doc/nginx-external-rollout-20260916.md | 72 ++++++++ doc/nginx-k8s-catalog.md | 69 ++++++++ doc/nginx-multi-csp-cleanup-20260916.md | 46 ++++++ doc/nginx-multi-csp-verification-20260916.md | 43 +++++ .../DeploymentSubmissionController.java | 57 +++++++ .../dto/IntegratedApplicationInfoDTO.java | 2 + .../service/DeploymentSubmissionService.java | 150 +++++++++++++++++ .../service/impl/ApplicationServiceImpl.java | 13 +- .../kubernetes/service/HelmIngressValues.java | 25 ++- .../service/IngressAddressService.java | 140 ++++++++++++++++ .../kr/co/mcmp/util/DatabaseInitializer.java | 44 +++++ .../assets/ApplicationRepository-BBRiVMU8.js | 1 + .../assets/ApplicationStatus-BKVG0wix.js | 57 +++++++ .../assets/ApplicationStatus-DB1vt_4c.css | 1 + .../static/assets/IconPlus-CDLv8nZC.js | 6 + .../assets/InstallSoftwareIframe-DWV8wQFf.css | 1 + .../assets/InstallSoftwareIframe-Dl_2Qi7t.js | 1 + .../static/assets/OssList-L1_lVc8d.js | 17 ++ .../assets/RepositoryDetail-DCPVJP7B.js | 15 ++ .../static/assets/RepositoryList-e6fBx0-3.js | 17 ++ .../assets/SoftwareCatalog-KiPa5CHK.css | 1 + .../static/assets/SoftwareCatalog-qoXeieRx.js | 21 +++ .../SoftwareCatalogListTest-C5HTJg28.css | 1 + .../SoftwareCatalogListTest-v-qS7pn0.js | 11 ++ ...ue_vue_type_style_index_0_lang-DdZDJSEi.js | 22 +++ .../static/assets/YamlGenerate-CY7vMkIK.js | 1 + .../assets/applicationDetailModal-B5NPsj3q.js | 11 ++ .../applicationDetailModal-BFNmmqoF.css | 1 + .../applicationInstallationForm-CeRjQOiG.js | 1 + .../applicationInstallationForm-xd8qJ2_F.css | 1 + .../assets/createVueComponent-DOVlSFKE.js | 11 ++ .../resources/static/assets/index-D89BCYsX.js | 42 +++++ .../static/assets/lodash-QU4yi6a5.js | 27 +++ .../static/assets/repository-CPO7R4t0.js | 1 + .../static/assets/request-CuP4O-bn.js | 1 + .../static/assets/softwareCatalog-CAQVjm80.js | 1 + src/main/resources/static/index.html | 2 +- .../DeploymentSubmissionControllerTest.java | 26 +++ .../DeploymentSubmissionServiceTest.java | 123 ++++++++++++++ .../service/CloudPiratesNginxHelmTest.java | 76 +++++++++ .../service/IngressAddressServiceTest.java | 156 ++++++++++++++++++ .../kr/co/mcmp/util/NginxHelmCatalogTest.java | 86 ++++++++++ 51 files changed, 1648 insertions(+), 20 deletions(-) create mode 100644 applicationFE/scripts/test-deployment-submission.mjs create mode 100644 applicationFE/src/utils/deploymentSubmission.ts create mode 100644 doc/deployment-submission-timeout-20260916.md create mode 100644 doc/nginx-external-rollout-20260916.md create mode 100644 doc/nginx-k8s-catalog.md create mode 100644 doc/nginx-multi-csp-cleanup-20260916.md create mode 100644 doc/nginx-multi-csp-verification-20260916.md create mode 100644 src/main/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionController.java create mode 100644 src/main/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionService.java create mode 100644 src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java create mode 100644 src/main/resources/static/assets/ApplicationRepository-BBRiVMU8.js create mode 100644 src/main/resources/static/assets/ApplicationStatus-BKVG0wix.js create mode 100644 src/main/resources/static/assets/ApplicationStatus-DB1vt_4c.css create mode 100644 src/main/resources/static/assets/IconPlus-CDLv8nZC.js create mode 100644 src/main/resources/static/assets/InstallSoftwareIframe-DWV8wQFf.css create mode 100644 src/main/resources/static/assets/InstallSoftwareIframe-Dl_2Qi7t.js create mode 100644 src/main/resources/static/assets/OssList-L1_lVc8d.js create mode 100644 src/main/resources/static/assets/RepositoryDetail-DCPVJP7B.js create mode 100644 src/main/resources/static/assets/RepositoryList-e6fBx0-3.js create mode 100644 src/main/resources/static/assets/SoftwareCatalog-KiPa5CHK.css create mode 100644 src/main/resources/static/assets/SoftwareCatalog-qoXeieRx.js create mode 100644 src/main/resources/static/assets/SoftwareCatalogListTest-C5HTJg28.css create mode 100644 src/main/resources/static/assets/SoftwareCatalogListTest-v-qS7pn0.js create mode 100644 src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js create mode 100644 src/main/resources/static/assets/YamlGenerate-CY7vMkIK.js create mode 100644 src/main/resources/static/assets/applicationDetailModal-B5NPsj3q.js create mode 100644 src/main/resources/static/assets/applicationDetailModal-BFNmmqoF.css create mode 100644 src/main/resources/static/assets/applicationInstallationForm-CeRjQOiG.js create mode 100644 src/main/resources/static/assets/applicationInstallationForm-xd8qJ2_F.css create mode 100644 src/main/resources/static/assets/createVueComponent-DOVlSFKE.js create mode 100644 src/main/resources/static/assets/index-D89BCYsX.js create mode 100644 src/main/resources/static/assets/lodash-QU4yi6a5.js create mode 100644 src/main/resources/static/assets/repository-CPO7R4t0.js create mode 100644 src/main/resources/static/assets/request-CuP4O-bn.js create mode 100644 src/main/resources/static/assets/softwareCatalog-CAQVjm80.js create mode 100644 src/test/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionControllerTest.java create mode 100644 src/test/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionServiceTest.java create mode 100644 src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/CloudPiratesNginxHelmTest.java create mode 100644 src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressServiceTest.java create mode 100644 src/test/java/kr/co/mcmp/util/NginxHelmCatalogTest.java diff --git a/applicationFE/scripts/test-deployment-submission.mjs b/applicationFE/scripts/test-deployment-submission.mjs new file mode 100644 index 0000000..f0d710b --- /dev/null +++ b/applicationFE/scripts/test-deployment-submission.mjs @@ -0,0 +1,39 @@ +import assert from 'node:assert/strict' +import { readFile } from 'node:fs/promises' +import ts from 'typescript' +const source=await readFile(new URL('../src/utils/deploymentSubmission.ts',import.meta.url),'utf8') +const js=ts.transpileModule(source,{compilerOptions:{target:ts.ScriptTarget.ES2022,module:ts.ModuleKind.ES2022}}).outputText +const {submitAndTrackDeployment,DeploymentStatusUnknown,deploymentOperationId}=await import('data:text/javascript;base64,'+Buffer.from(js).toString('base64')) +const state=(s)=>({id:'op1',namespace:'ns1',state:s,message:s,deploymentId:22}) +const sleep=async()=>{} +let submits=0,polls=0 +const result=await submitAndTrackDeployment('op1','ns1',async()=>{submits++;throw {response:{status:504}}},async()=>{polls++;return state(polls===1?'RUNNING':'SUCCEEDED')},()=>true,sleep) +assert.equal(result.data.id,22);assert.equal(submits,1);assert.equal(polls,2) +for(const s of ['FAILED','PARTIAL_SUCCESS']) await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>state(s),async()=>assert.fail(),()=>true,sleep),new RegExp(s)) +await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>state('INTERRUPTED'),async()=>assert.fail(),()=>true,sleep),DeploymentStatusUnknown) +await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>state('QUEUED'),async()=>{throw Error('network')},()=>true,sleep),DeploymentStatusUnknown) +await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>state('QUEUED'),async()=>assert.fail(),()=>false,sleep),DeploymentStatusUnknown) +await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>({...state('SUCCEEDED'),id:'other'}),async()=>assert.fail(),()=>true,sleep),DeploymentStatusUnknown) +console.log('PASS: gateway504 single submit recovery, success/failure/partial propagation, interrupted/network/cancel/mismatched operation handling') + +assert.match(deploymentOperationId({getRandomValues: array => array.fill(7)}), /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/) +console.log('PASS: HTTP-compatible operation ID uses getRandomValues only') + +try { + await submitAndTrackDeployment('op1','ns1',async()=>state('INTERRUPTED'),async()=>assert.fail(),()=>true,sleep) + assert.fail('expected interrupted tracking') +} catch(error) { assert.deepEqual(error.interruptedOperation,{id:'op1',namespace:'ns1'}) } +let closed=false +await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>state('ABANDONED'),async()=>assert.fail(),()=>true,sleep,10,()=>{closed=true}),/ABANDONED/) +assert.equal(closed,true) +console.log('PASS: interrupted operation can be explicitly closed without reporting success') + +for(const prior of ['SUCCEEDED','FAILED','PARTIAL_SUCCESS','ABANDONED']) { + let cleared=false,starts=0 + await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>{starts++;throw {response:{status:409}}},async()=>state(prior),()=>true,sleep,10,()=>{cleared=true}),/previous operation finished/i) + assert.equal(cleared,true);assert.equal(starts,1) +} +let cleared=false +await assert.rejects(submitAndTrackDeployment('op1','ns1',async()=>{throw {response:{status:409}}},async()=>state('RUNNING'),()=>true,sleep,10,()=>{cleared=true}),DeploymentStatusUnknown) +assert.equal(cleared,false) +console.log('PASS: changed-payload409 clears only terminal receipts and never automatically resubmits') diff --git a/applicationFE/scripts/test-ingress-preparation.mjs b/applicationFE/scripts/test-ingress-preparation.mjs index cdb2520..d0cc8c4 100644 --- a/applicationFE/scripts/test-ingress-preparation.mjs +++ b/applicationFE/scripts/test-ingress-preparation.mjs @@ -58,7 +58,7 @@ return { runInstall, cancel: () => { preparationEpoch++ }, invalidate: () => { s function harness(options = {}) { const calls = [] const values = Object.fromEntries(Object.entries({ - deploying: false, deploymentCompleted: false, modalTitle: 'Application Installation', selectInfra: options.infra || 'K8S', specCheckFlag: false, + jupyterInstallationUnsupported: false, deploying: false, deploymentCompleted: false, modalTitle: 'Application Installation', selectInfra: options.infra || 'K8S', specCheckFlag: false, specChecking: false, projectScopeError: '', servicePortCidr: '203.0.113.4/32', ingressData: { ingressEnabled: options.ingress !== false, ingressHost: 'app.company.com', ingressPath: '/', ingressTlsEnabled: Boolean(options.tls) }, isJupyterObjectStorageCatalog: Boolean(options.jupyter), projectContextKey: 'workspace/project-a', diff --git a/applicationFE/src/api/softwareCatalog.ts b/applicationFE/src/api/softwareCatalog.ts index 783a8bf..095963a 100644 --- a/applicationFE/src/api/softwareCatalog.ts +++ b/applicationFE/src/api/softwareCatalog.ts @@ -2,6 +2,8 @@ import request, { getProjectContextHeaders } from "../common/request"; import axios from "axios"; import { getApiBaseUrl } from "@/common/url"; +import { submitAndTrackDeployment, deploymentOperationId } from "@/utils/deploymentSubmission"; + const apiBaseUrl = getApiBaseUrl(import.meta.env.VITE_API_URL).replace(/\/$/, '') const standardPolicyAnalysisDays = [90, 30, 7] @@ -31,6 +33,31 @@ export const searchArtifacthubhub = (keyword: string) => { return request.get(`/search/artifacthub/${keyword}`) } +// Retain only operation IDs in session storage, never deployment settings or credentials. +async function trackInstallation(type: 'VM' | 'K8S', params: any, isCurrent?: () => boolean) { + const headers = getProjectContextHeaders() + const key = 'am-deployment:' + JSON.stringify([headers['X-MCMP-Workspace-ID'], headers['X-MCMP-Project-ID'], + params.namespace, type, params.catalogId, type === 'VM' ? params.mciId : params.clusterName, + type === 'VM' ? params.vmNodeGroupId || [...(params.vmIds || [])].sort() : null]) + let id = sessionStorage.getItem(key) + if (!id) { id = deploymentOperationId(); sessionStorage.setItem(key, id) } + const operationId = id + return submitAndTrackDeployment(operationId, params.namespace, + async () => (await request.post(`/applications/deployment-submissions/${type}`, params, + { headers: { 'Idempotency-Key': operationId }, timeout: 30000 })).data, + async () => (await request.get(`/applications/deployment-submissions/${operationId}`, + { params: { namespace: params.namespace }, timeout: 30000 })).data, + isCurrent, undefined, undefined, () => sessionStorage.removeItem(key)) +} + +export async function closeInterruptedDeployment(id: string, namespace: string) { + const response = await request.post(`/applications/deployment-submissions/${id}/close-interrupted`, null, { params: { namespace } }) + for (const key of Object.keys(sessionStorage)) { + if (key.startsWith('am-deployment:') && sessionStorage.getItem(key) === id) sessionStorage.removeItem(key) + } + return response +} + // Application 설치 (VM) export const runVmInstall = (params: { namespace: string, @@ -47,8 +74,8 @@ export const runVmInstall = (params: { vmDeploymentMode: string, resourceType: string, additionalConfig?: Record, -}) => { - return request.post(`/applications/vm/deploy`, params) +}, isCurrent?: () => boolean) => { + return trackInstallation('VM', params, isCurrent) } // Application Action (VM -> INSTALL, UNINSTALL, RUN, RESTART, STOP) @@ -77,8 +104,8 @@ export const runK8SInstall = (params: { ingressTlsEnabled?: boolean, ingressTlsSecret?: string, additionalConfig?: Record -}) => { - return request.post(`/applications/k8s/deploy`, params) +}, isCurrent?: () => boolean) => { + return trackInstallation('K8S', params, isCurrent) } export const objectStorageSmokeCheck = (params: { diff --git a/applicationFE/src/common/request.ts b/applicationFE/src/common/request.ts index 869ff96..e1309cd 100644 --- a/applicationFE/src/common/request.ts +++ b/applicationFE/src/common/request.ts @@ -84,7 +84,7 @@ service.interceptors.response.use( if (res.code === 200) { return res; } else { - toast.error(res.detail) + if (!response.config?.url?.startsWith('/applications/deployment-submissions/')) toast.error(res.detail) return Promise.reject(new Error(res.message || "Error")); } }, @@ -95,7 +95,7 @@ service.interceptors.response.use( status: res?.status, message: error?.message }) - if (res?.status === 404) { + if (res?.status === 404 && !error?.config?.url?.startsWith('/applications/deployment-submissions/')) { toast.error('API Call Fail :: Code 404') } if (axios.isCancel(error)) { diff --git a/applicationFE/src/utils/deploymentSubmission.ts b/applicationFE/src/utils/deploymentSubmission.ts new file mode 100644 index 0000000..a21a364 --- /dev/null +++ b/applicationFE/src/utils/deploymentSubmission.ts @@ -0,0 +1,68 @@ +/** getRandomValues remains available on HTTP origins where subtle/randomUUID are unavailable. */ +export function deploymentOperationId(random: Pick = globalThis.crypto): string { + const bytes = random.getRandomValues(new Uint8Array(16)) + bytes[6] = (bytes[6] & 0x0f) | 0x40 + bytes[8] = (bytes[8] & 0x3f) | 0x80 + const hex = Array.from(bytes).map(b => b.toString(16).padStart(2, '0')).join('') + return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}` +} + +export interface DeploymentSubmissionStatus { + id: string + namespace: string + state: 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'PARTIAL_SUCCESS' | 'FAILED' | 'INTERRUPTED' | 'ABANDONED' + message: string + deploymentId?: number +} + +export class DeploymentStatusUnknown extends Error { + readonly deploymentStatusUnknown = true + constructor(message: string, readonly interruptedOperation?: { id: string, namespace: string }) { super(message) } +} + +/** A transport failure is not an installation failure. Never automatically submit a second operation. */ +export async function submitAndTrackDeployment( + id: string, + namespace: string, + submit: () => Promise, + getStatus: () => Promise, + isCurrent: () => boolean = () => true, + sleep: () => Promise = () => new Promise(resolve => setTimeout(resolve, 2000)), + maxPolls = 3600, + terminal: () => void = () => {} +): Promise<{ data: { id?: number, status: string } }> { + let status: DeploymentSubmissionStatus | undefined + try { status = await submit() } catch (error: any) { + const http = error?.response?.status + if (http === 409) { + let previous: DeploymentSubmissionStatus | undefined + try { previous = await getStatus() } catch { throw error } + if (previous.id !== id || previous.namespace !== namespace) throw new DeploymentStatusUnknown('Existing operation did not match this target. Check Apps Status.') + if (['SUCCEEDED', 'FAILED', 'PARTIAL_SUCCESS', 'ABANDONED'].includes(previous.state)) { + terminal() + throw new Error('The previous operation finished. Review Apps Status, then click Deploy again if you intend to use the changed settings. No new installation was started.') + } + if (previous.state === 'INTERRUPTED') throw new DeploymentStatusUnknown(previous.message, { id, namespace }) + throw new DeploymentStatusUnknown('An installation with the previous settings is still active. Check Apps Status before changing settings; no new installation was started.') + } + if (http && http >= 400 && http < 500 && http !== 408 && http !== 429) throw error + // Submission might have committed despite a gateway timeout: recover by its original ID. + } + let failures = 0 + for (let attempt = 0; attempt < maxPolls; attempt++) { + if (!isCurrent()) throw new DeploymentStatusUnknown('Tracking stopped because the form or project changed. Installation may continue; check Apps Status.') + if (status) { + if (status.id !== id || status.namespace !== namespace) throw new DeploymentStatusUnknown('Deployment response did not match this operation. Check Apps Status before retrying.') + if (status.state === 'SUCCEEDED') { terminal(); return { data: { id: status.deploymentId, status: 'SUCCESS' } } } + if (status.state === 'FAILED' || status.state === 'PARTIAL_SUCCESS' || status.state === 'ABANDONED') { terminal(); throw new Error(status.message || 'Installation failed. Open Apps Status for details.') } + if (status.state === 'INTERRUPTED') throw new DeploymentStatusUnknown(status.message, { id, namespace }) + if (!['QUEUED', 'RUNNING'].includes(status.state)) throw new DeploymentStatusUnknown('Unknown deployment state. Check Apps Status before retrying.') + } + await sleep() + if (!isCurrent()) throw new DeploymentStatusUnknown('Tracking stopped. Closing the dialog does not cancel the installation; check Apps Status.') + try { status = await getStatus(); failures = 0 } catch { + if (++failures >= 5) throw new DeploymentStatusUnknown('Could not retrieve installation status. The operation may still be running. Check Apps Status or retry tracking; do not start a second installation.') + } + } + throw new DeploymentStatusUnknown('Installation is taking longer than expected. Check Apps Status; no replacement installation was submitted.') +} diff --git a/applicationFE/src/views/softwareCatalog/components/applicationDetailModal.vue b/applicationFE/src/views/softwareCatalog/components/applicationDetailModal.vue index 974a4c3..f29bae3 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationDetailModal.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationDetailModal.vue @@ -437,6 +437,8 @@ Enabled Host + Access Port + Public IP (Worker / IBM Load Balancer) Path Class TLS Enabled @@ -451,6 +453,8 @@ {{ applicationDetail.ingressHost || 'N/A' }} + {{ applicationDetail.ingressAccessPorts?.join(', ') || '-' }} + {{ applicationDetail.ingressPublicIps?.join(', ') || '-' }} {{ applicationDetail.ingressPath || 'N/A' }} {{ applicationDetail.ingressClass || 'N/A' }} diff --git a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue index 444636a..15e44a2 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue @@ -29,6 +29,11 @@ Deployment completed.

Check the application's running status in Apps Status.

+
+ AM restarted while tracking this installation. Check Apps Status before starting another installation. + +
Deployment targets are scoped to @@ -922,7 +927,7 @@ import { type SoftwareCatalog } from '@/views/type/type' import { useUserStore } from '@/stores/user' import { isVmClusteringCatalog } from '@/utils/vmClustering' import { resolveInstallVmTarget } from '@/integration/installTarget' -import { startIngressPreparation, getIngressPreparation } from '@/api/softwareCatalog' +import { startIngressPreparation, getIngressPreparation, closeInterruptedDeployment } from '@/api/softwareCatalog' import { waitForIngressPreparation } from '@/utils/ingressPreparation' interface Props { @@ -1059,6 +1064,19 @@ const objectStorageChecking = ref(false as boolean) const registeredObjectStorageList = ref([] as any[]) const registeredObjectStorageLoading = ref(false as boolean) const registeredObjectStorageLoadError = ref(false as boolean) +const interruptedDeployment = ref<{ id: string, namespace: string } | null>(null) +const closingInterruptedTracking = ref(false) +const closeInterruptedTracking = async () => { + const operation = interruptedDeployment.value + if (!operation || !confirm('Check Apps Status and confirm that no installation is still running before closing this interrupted tracking record. This does not cancel or uninstall an application. Continue?')) return + closingInterruptedTracking.value = true + try { + await closeInterruptedDeployment(operation.id, operation.namespace) + interruptedDeployment.value = null + toast.warning('Interrupted tracking closed. The application itself was not changed.') + } catch { toast.error('Could not close interrupted tracking. Reload its status before retrying.') } + finally { closingInterruptedTracking.value = false } +} const deploying = ref(false) const deploymentCompleted = ref(false) let preparationEpoch = 0 @@ -1299,6 +1317,7 @@ onMounted(async () => { const setInit = async () => { preparationEpoch++ deploymentCompleted.value = false + interruptedDeployment.value = null storageRequestSequence++ const loadSequence = ++resourceLoadSequence clearTargetResources() @@ -1924,7 +1943,7 @@ const runInstall = async () => { resourceType: selectedResourceType.value, additionalConfig: buildVmAdditionalConfig(), } - res = await runVmInstall(params) + res = await runVmInstall(params, isCurrentDeployment) } else { res = await runAction(params) } @@ -1962,7 +1981,7 @@ const runInstall = async () => { isCurrentDeployment) } res = modalTitle.value == 'Application Installation' - ? await runK8SInstall(params) + ? await runK8SInstall(params, isCurrentDeployment) : await runAction(params) } @@ -1982,10 +2001,14 @@ const runInstall = async () => { } catch (error) { if (!isCurrentDeployment()) return const message = error instanceof Error ? error.message : 'The deployment request failed.' - toast.error(message) - emitDeploymentEvent('DEPLOY_FAILED', { - message - }) + if ((error as any)?.deploymentStatusUnknown) { + if ((error as any).interruptedOperation) interruptedDeployment.value = (error as any).interruptedOperation + toast.warning(message) + emitDeploymentEvent('DEPLOY_STATUS_UNKNOWN', { message }) + } else { + toast.error(message) + emitDeploymentEvent('DEPLOY_FAILED', { message }) + } } finally { deploying.value = false } diff --git a/doc/deployment-submission-timeout-20260916.md b/doc/deployment-submission-timeout-20260916.md new file mode 100644 index 0000000..eb3d0fe --- /dev/null +++ b/doc/deployment-submission-timeout-20260916.md @@ -0,0 +1,45 @@ +# Deployment tracking and gateway timeout correction + +## Observed cause (2026-09-16) + +The AM HTTPS location in `mc-iam-manager-nginx` overrides the global 600-second timeout with `proxy_read_timeout 60s`. Both existing `/applications/vm/deploy` and `/applications/k8s/deploy` wait synchronously for remote installation. The browser's Axios timeout is 300 seconds, so the gateway can return 504 first while AM continues working. + +Read-only evidence for the user's VM Jupyter deployment 22 (UTC): + +- Started: `05:50:59.362730`. +- Gateway: `05:51:59`, `POST /applications/vm/deploy`, HTTP 504, `upstream timed out ... while reading response header`. +- Persisted completion: `05:52:58.656698`, `SUCCESS`, about 119 seconds after start. + +The deployment and its VM were not modified during diagnosis. Sanitized server evidence is `/home/ubuntu/am-deployment-504-20260916/diagnosis.json`. Kubernetes installations can encounter the same timeout because their original controller follows the same synchronous pattern. + +## Changed installation flow + +The SW Catalog form now submits VM and Kubernetes installs to `POST /applications/deployment-submissions/{VM|K8S}` with a client-generated UUID `Idempotency-Key`. A short response returns a durable receipt. The form polls `GET /applications/deployment-submissions/{id}?namespace=...` until the persisted result is terminal; a successful receipt alone is not installation success. `FAILED` and `PARTIAL_SUCCESS` do not produce a success toast. + +The original synchronous APIs remain compatible. External clients that continue calling them can still hit the gateway timeout; this change does not increase gateway timeouts or silently retry their deployments. + +The receipt table `application_deployment_submission` stores scope, owner subject, request hash, target identity, state and history linkage. It stores no raw deployment body, bearer token or credentials. Namespace authorization uses the existing IAM project validation; both querying and closing a receipt additionally require its workspace, project and authenticated user subject. The asynchronous worker copies the security context transiently and clears it when finished. + +Four workers and a queue of 16 bound execution. A database-unique active target/catalog key prevents overlapping async installs; VM locking conservatively covers the catalog across its MCI, including overlapping node groups. The same operation ID and payload return the same receipt even after a lost response. Different settings under the same ID are rejected. A gateway/network error causes lookup of that ID, never automatic submission of a replacement installation. The browser retains only nonsecret target identifiers and an operation ID in session storage. UUID generation uses `getRandomValues`, so existing HTTP-origin installations do not depend on secure-context-only `crypto.subtle` or `randomUUID`. + +If settings change after the previous receipt is terminal, a 409 is followed by a status lookup, the stale browser receipt is cleared, and the user is instructed to review Apps Status and click Deploy again. There is no automatic second POST. Polling failure or dialog/project changes stop tracking, not the underlying work; the UI reports uncertainty rather than falsely declaring installation failure. Error toasts from intermediate receipt HTTP 404s are suppressed only for this tracked endpoint family, and final outcome handling stays with the tracker. + +## Restart and interrupted tracking + +This implementation follows the existing single-AM-instance deployment model. At startup, never-started `QUEUED` receipts become `FAILED` and release their guards. Previously `RUNNING` receipts become `INTERRUPTED`; work is not replayed. + +An interrupted receipt can reconcile only when exactly one subsequent matching persisted installation history is terminal, and only for Kubernetes or an explicitly single-VM request without a node group. A deleted history releases the guard without claiming installation success. Multiple histories, multi-VM/node-group jobs, missing histories or still-running histories remain interrupted rather than inferring success. + +For those cases the form offers **Close interrupted tracking** after instructing the user to inspect Apps Status and confirm no installation remains active. The owner/project-scoped `POST /applications/deployment-submissions/{id}/close-interrupted?namespace=...` accepts only `INTERRUPTED`, changes tracking to `ABANDONED`, and releases its guard. It does not cancel, uninstall, restart, delete, or resubmit the actual application, nor rewrite its deployment history. Closing ordinary running tracking through this endpoint is rejected. The user must separately decide whether a new installation is appropriate. + +The existing synchronous endpoints do not participate in the new receipt lock. Do not run legacy and tracked installation requests concurrently for the same target. Interrupted history correlation is deliberately conservative and cannot substitute for inspecting provider/application state after an interrupted multi-target deployment. + +## Validation + +- Nine H2-backed service tests passed: immediate receipt with a blocked remote worker, idempotency, conflicting submissions, failed/partial results, restart state, owner/project separation, no secret persistence, single-history recovery, multi-VM non-reconciliation and explicit tracking closure. +- Two controller tests passed for the VM and K8S routes with namespace authorization. +- Frontend tracker tests passed for 504 response recovery with one submission, terminal outcomes, cancellation/network uncertainty, mismatched receipts, HTTP-compatible UUID generation, interrupted closure and changed-payload 409 handling. +- Existing ingress-preparation/form regression suite passed 38 cases. Its fixture gained the existing Jupyter unsupported-provider guard. +- Frontend type checking and production build passed. These tests did not create new cloud resources. + +Runtime rollout and live verification are recorded separately; this document does not claim that a new VM or Kubernetes installation has been exercised after deployment. diff --git a/doc/helm-ingress-mapping.md b/doc/helm-ingress-mapping.md index fc8be0e..daf25e0 100644 --- a/doc/helm-ingress-mapping.md +++ b/doc/helm-ingress-mapping.md @@ -25,6 +25,19 @@ Supported chart identities and render-tested versions: `ingress.extraTls[]`. `ingress.tls=false` and `selfSigned=false` avoid chart-derived Secret names / certificate generation; `extraTls` references the selected Secret. +- CloudPirates, `https://cloudpirates-io.github.io/helm-charts`, chart `nginx` 0.16.8 + (application 1.31.5): `CLOUDPIRATES_NGINX` uses the same Ingress shape as the generic + fallback: `ingress.className`, `ingress.hosts[].host`, `ingress.hosts[].paths[]`, + and `ingress.tls[]`. Its separate service mapping writes AM's effective service port + to the `service.ports` array (`port`, `targetPort: http`, `protocol: TCP`, `name: http`). + This is an array, unlike Bitnami's `service.ports.http` map. + AM also sets the named container port `http` and nginx `serverConfig` listener to + 8080. The Service retains the selected external-to-container service port and + `targetPort: http`. This avoids binding privileged port 80 on clusters that enforce + the upstream nonroot UID 101; `runAsNonRoot: true` and + `allowPrivilegeEscalation: false` remain unchanged. The container listener is not + the public ingress access port. + Repository alias changes and trailing URL slashes are accepted. A chart from a different repository, including a mirror or a different vendor with the same chart name, uses the generic fallback unless a matching adapter is registered. Unknown @@ -184,6 +197,27 @@ inherit the Helm release namespace; this is distinct from proving live AM namesp selection. The suite runs `helm template --kube-version 1.30.0`, not server-side admission, Pod scheduling or an HTTP request through a live controller. +The external CloudPirates chart has a separate opt-in render test. Set `AM_HELM_BIN` +to the Helm executable and run: + +```sh +AM_HELM_BIN="$(command -v helm)" bash gradlew cleanTest test \ + --tests kr.co.mcmp.softwarecatalog.kubernetes.service.CloudPiratesNginxHelmTest \ + --tests kr.co.mcmp.util.NginxHelmCatalogTest +``` + +`cleanTest` ensures that a previous run skipped without `AM_HELM_BIN` does not leave +an up-to-date test result. The test pulls chart 0.16.8 from the external HTTP repository +into its own temporary directory, then renders that exact tgz by absolute path. +It does not use the repository's older `nginx/` fixture. Four combinations passed on +2026-09-16: TLS disabled/enabled crossed with classes `nginx` and +`public-iks-k8s-nginx`. Each checks service port 8088 targeting the named container port `http`, container port +8080 and `listen 8080` in the rendered ConfigMap, nonroot UID 101 with privilege +escalation disabled, CIDR ingress policy, HPA, +upstream nginx image, absence of PVCs, and the selected TLS Secret when enabled. +The three H2 catalog tests also passed. This is chart and migration validation, +not a claim that the external chart has been deployed to a live cluster. + Unit tests additionally cover request/catalog precedence, generic fallback for unknown/missing repositories and unknown chart names, invalid inputs, YAML string preservation, independent requests, rejection of invalid input before cluster side diff --git a/doc/nginx-external-rollout-20260916.md b/doc/nginx-external-rollout-20260916.md new file mode 100644 index 0000000..a05298d --- /dev/null +++ b/doc/nginx-external-rollout-20260916.md @@ -0,0 +1,72 @@ +# External nginx Helm rollout — 2026-09-16 + +## Change + +The user requested uninstalling only nginx on the AWS archiving Kubernetes cluster, replacing the AM-bundled chart with an external chart like the other Helm catalog applications, recreating the earlier IBM test cluster, and deploying the replacement nginx to both. + +Catalog 12 (`Nginx for Kubernetes`) now uses `cloudpirates/nginx` version `0.16.8` from `https://cloudpirates-io.github.io/helm-charts`. The upstream chart package SHA256 is `6ce283ebae619a9c0255446418703488f4848720902ec0f1026d5e7c86982b86`. It deploys the Docker Official Image `docker.io/nginx:1.31.5-alpine@sha256:72ba65eb42c10344912a84ff42408db7d34f2feb642204570ab8fc5ffd29f1d3`. + +CloudPirates is the chart publisher, not the nginx project's official chart. It was selected because its public chart uses the public official nginx image and an HTTP Helm repository compatible with AM's existing Helm installation path. Bitnami's nginx image availability has moved to its Secure Images subscription policy. No legacy Bitnami image fallback was introduced. + +AM's source no longer contains the newly introduced `charts/nginx` and static chart archive/index. The earlier unrelated root `nginx/` fixture was preserved. Startup registers the external chart or migrates only the exact former built-in mapping; customized mappings remain untouched. The ingress adapter maps AM's service port to the external chart's `service.ports` array. Existing ingress policy, public-address lookup and IBM automation were preserved. + +Runtime: `mc-application-manager:external-nginx-20260916-r7`. The r4 patch migrated the external chart, r5 added ingress access-port details, r6 added asynchronous installation submission/tracking and rebuilt UI, and r7 made nginx listen on unprivileged container port 8080. Entries outside each patch were verified identical; prior images remain available for rollback. Compose override: `/home/ubuntu/nginx-external-20260916/override-r7.yaml`. + +The live IBM test exposed a portability issue in the upstream defaults: UID 101 could not bind container port 80 (`Permission denied`). The AM adapter now sets both `containerPorts[].containerPort=8080` and `serverConfig` with `listen 8080;` for CloudPirates nginx on every provider. The Service stays on the selected port (80 in this deployment), targeting named port `http`; probes use the same name. UID 101, `runAsNonRoot=true`, and `allowPrivilegeEscalation=false` are preserved. External ports remain AWS 30880 and IBM 80. + +## Verification + +- H2 catalog registration / migration / custom-mapping preservation: 3 passed. +- External-chart render with TLS on/off and AWS/IBM ingress classes, service port 8088, HPA and CIDR: 4 passed, none skipped. +- Existing ingress mapping/policy regression tests: 55 passed. +- `git diff --check` passed. No commit or push. +- Render tests pull the external chart into an isolated temporary directory before rendering: `helm template nginx --repo ...` can otherwise select the existing local `nginx/` fixture. + +## AWS archiving deployment — complete + +- Cluster: `k8s-mariadb-data-init-aws-archiving-01`. +- Previous nginx deployment 9 / status 5 was uninstalled through AM. VM nginx (status 3) and Jupyter (status 4) remained RUNNING. +- Initial external deployment 21 was replaced through AM after the IBM portability finding. Final deployment: **24**, release `nginx-20260916062028-8b9cdf84`, revision 1, chart `nginx-0.16.8`, app `1.31.5`. +- Pod ready: 1/1, deployment readyReplicas 1; live image digest, container/listener 8080 and non-root security settings verified. +- Service: ClusterIP 80. Ingress host `nginx.example.com`, class `nginx`, source restriction `210.219.181.78/32`. +- Actual ingress worker/public endpoint: `3.36.93.224:30880`; HTTP 200 from the allowed client using `curl --resolve`. +- AM integrated detail API reports RUNNING, host `nginx.example.com`, `ingressPublicIps=["3.36.93.224"]`, `ingressAccessPorts=[30880]`. +- Metrics-server is Running; no capacity workaround was needed in this rollout. Existing Jupyter PVCs were preserved. + +## Ingress access port — complete + +The application detail table now shows **Host → Access Port → Public IP**. The backend reads the actual ingress controller Service: NodePort for worker IPs, public LB listener port for IBM, selecting HTTP/HTTPS according to the application TLS setting. Missing values display `-`. The application Service Port remains separate. + +- Ingress address/port unit tests: 10 passed. +- Frontend TypeScript check and production build passed. +- Live deployment 11 (Jupyter) and final deployment 24 (nginx) both return `ingressAccessPorts=[30880]`, `ingressPublicIps=["3.36.93.224"]`, and their original domain names. +- Live browser visual verification was blocked by the gateway self-signed certificate; no certificate bypass was performed. API responses and the production bundle were verified. + +## IBM deployment — complete + +- Workflow 103 (`k8s-mariadb-backup-import-data-init`), build 14 **SUCCESS**. +- Cluster: `k8s-mariadb-data-init-ibm-01`; native ID `dal2n5co0aht41nitr20`. +- Region/zone: `jp-osa` / `jp-osa-1`, worker `bx2-2x8`, Kubernetes `1.33.13`. +- Initial deployment 23 exposed the port-80 permission issue and was uninstalled through AM. Final deployment **25**, release `nginx-20260916062053-1aa0a4fd`, uses the shared 8080 fix. +- Pod 1/1 Running. Ingress `nginx.example.com`, class `public-iks-k8s-nginx`, source restriction `210.219.181.78/32`. +- Managed LB public addresses: **163.68.88.219** and **163.68.88.220**, external HTTP **80**. Both returned HTTP 200 from the allowed client using `curl --resolve`. +- Detail API reports both public addresses and `ingressAccessPorts=[80]`. +- Both LB addresses reject the disallowed AM-server source with HTTP 403, including a spoofed `X-Forwarded-For: 210.219.181.78` header. + +## 504 correction and live asynchronous installation + +See [deployment-submission-timeout-20260916.md](deployment-submission-timeout-20260916.md) for the gateway evidence, design, restart behavior and test details. The user's VM Jupyter deployment 22 succeeded after approximately 119 seconds, while the gateway had returned 504 after 60 seconds. VM and K8s SW Catalog installation now use durable asynchronous receipts with separate status polling and idempotency. + +- Backend submission/service/controller tests: 11 passed, including a blocked remote worker returning its receipt immediately; repeated in the runtime-compatible build. +- Frontend tracking tests, existing 38 ingress-preparation regression cases, type check and production build passed. +- Live VM/K8s input-validation requests return HTTP 400 promptly; an unknown receipt returns 404. These checks created no deployment. +- Final AWS nginx installation used the new API: receipt in **0.059 seconds**, operation `6005918e-1c39-43cf-92c0-739e7a51b301`, final `SUCCEEDED`, history 24. +- Final IBM installation used the new API: receipt in **0.015 seconds**, operation `484df400-6df8-4736-bea5-e391f9849dcf`, final `SUCCEEDED`, history 25. +- Resending each exact request with its original operation ID returned the same receipt, with one submission row per operation. +- Production-served index `index-D89BCYsX.js`, asynchronous API bundle and Access Port modal bundle were fetched and checked. +- Preserved applications verified RUNNING: VM nginx history 7/status 3, K8s Jupyter history 11/status 4, and the user's VM Jupyter history 22/status 15. No new VM installation was run solely for this verification. +- Changes applied to `D:/mcmp/mc-application-manager`; no Git commit or push. + +## Evidence + +Restricted server directory: `/home/ubuntu/nginx-external-20260916/`. Includes prior catalog settings, old nginx uninstall result, chart package/rendered manifests, runtime build/deploy logs, AWS request/result/detail, and live chart verification. Credentials and kubeconfigs are not included in this report. diff --git a/doc/nginx-k8s-catalog.md b/doc/nginx-k8s-catalog.md new file mode 100644 index 0000000..586a644 --- /dev/null +++ b/doc/nginx-k8s-catalog.md @@ -0,0 +1,69 @@ +# Kubernetes nginx catalog and deployment + +Source and chart rendering verified on 2026-09-16 (KST). See [external chart rollout](nginx-external-rollout-20260916.md) for current AWS/IBM deployment results. The historical section below describes the earlier built-in-chart deployment. + +## Catalog and source + +`Nginx for Kubernetes` is a general-purpose selectable SW Catalog entry, separate from the existing VM `Nginx` entry. `DatabaseInitializer.ensureNginxHelmCatalog()` registers the catalog and its external Helm mapping idempotently. + +- Repository: `https://cloudpirates-io.github.io/helm-charts` (HTTP Helm repository; alias `cloudpirates`). +- Chart: `nginx` version `0.16.8`; upstream application version `1.31.5`. +- Upstream image: `docker.io/nginx:1.31.5-alpine`, pinned by the chart's image digest. +- Package identity: `cloudpirates-nginx`; a new installation fetches the external chart through Helm. +- The AM source no longer includes `charts/nginx/` or the static `/charts/index.yaml` and `nginx-0.1.0.tgz`. Newly built AM JARs do not bundle these nginx chart assets. +- The catalog's default requests remain 100m CPU / 64Mi memory; limits remain 500m CPU / 256Mi memory. AM supplies its ingress, resource, replicas and HPA settings to the external chart. The verified default rendering creates no PVC. + +Startup migrates only the exact old mapping for `Nginx for Kubernetes`: package ID `mcmp-builtin-nginx`, chart `nginx` version `0.1.0`, repository `http://localhost:18084/charts`, and repository name `mcmp-builtin`. Other chart mappings, customized repository/version selections, and other catalogs are preserved. This metadata migration does not upgrade an existing Helm release. + +`CloudPiratesNginxHelmTest` downloads the pinned chart into an isolated temporary directory and renders the package by absolute path. This prevents the unrelated existing `nginx/` fixture from shadowing the external chart. Four cases passed: TLS on/off with `nginx` and `public-iks-k8s-nginx`, including service port 8088, CIDR restriction, and HPA rendering. Three H2 tests passed for registration, idempotent legacy migration, and custom mapping preservation. These tests do not establish live rollout or HTTP reachability; see [Helm ingress mapping](helm-ingress-mapping.md) for reproduction. + +The detail API exposes `ingressPublicIps`. The appStatus detail modal displays these addresses under Ingress. For non-IBM clusters the resolver reads ExternalIP addresses of nodes running the AM ingress controller. IBM uses public managed ingress LoadBalancer addresses. Missing public addresses display `-`; lookup failures do not break the detail dialog. + +## Historical built-in-chart installation (2026-09-16) + +| Field | Value | +| --- | --- | +| Cluster | k8s-mariadb-data-init-aws-archiving-01 | +| Namespace | default | +| Catalog | 12 — Nginx for Kubernetes | +| Deployment history / application status IDs | 9 / 5 | +| Helm release | nginx-20260916003401-489dc4b9 | +| Host | nginx.example.com | +| Public worker IP | 3.36.93.224 | +| External HTTP port | 30880 | +| Allowed source | 210.219.181.78/32 | +| Application service | ClusterIP, internal port 80 | +| State | Helm deployed; application RUNNING; pod 1/1 Running | + +Run from the currently allowed source IP (210.219.181.78): + +```sh +curl --fail --resolve nginx.example.com:30880:3.36.93.224 \ + http://nginx.example.com:30880/ +``` + +This returned HTTP 200 and the nginx welcome page. Port 80 is internal service traffic, not an additional public opening. The worker security group has the restricted TCP 30880 rule, and the Ingress has `nginx.ingress.kubernetes.io/whitelist-source-range: 210.219.181.78/32`. The ingress controller uses `externalTrafficPolicy: Local`. Its pre-existing HTTPS NodePort 30418 remains allocated but is not externally opened. Before the source-CIDR correction, probes from AM confirmed 30880 reachable and 80, 443, 30418 unreachable. Current allowed-source access is verified from 210.219.181.78; AM is no longer an allowed client. + +Catalog, release and deployment records remain in AM's database after an AM restart, which was verified. Retain the AM database when archiving/restoring the environment; this change does not implement a separate cluster restoration mechanism. + +## Historical runtime and validation + +- Deployed AM image: `mc-application-manager:nginx-catalog-ingress-ip-20260916-r3`. +- Server artifacts and before/after DB backups: `/home/ubuntu/am-nginx-20260916/`. +- Compose override: `/home/ubuntu/am-nginx-20260916/override-r3.yaml`; base compose: `/home/ubuntu/mcmp/2026/0910/mc-admin-cli/conf/docker/docker-compose.yaml`. +- Only AM was recreated; other container IDs were unchanged. Existing MariaDB and ingress pods remain running. +- D-drive source retains its original HEAD `6a682de`; no commit or push was performed. Its frontend assets were rebuilt from that checkout to retain its newer Jupyter changes. The server patch was built against the server-compatible source and preserves unrelated runtime entries. +- D-drive backend suite: 622 tests, 0 failures, 0 errors, 1 skipped. New address-resolution and Helm-rendering tests passed. Frontend typecheck/build and Helm lint passed. +- AWS address display was verified through the actual detail API. IBM LB and Alibaba/NHN public-address-absent cases were subsequently verified on live clusters; see [multi-CSP verification](nginx-multi-csp-verification-20260916.md). +- Browser visual verification was blocked by the server's untrusted certificate; no certificate bypass was used. + +The existing t3.small worker permits 11 pods. The AM installation newly added metrics-server and exhausted that capacity. Only that newly added metrics-server Helm release was removed after backing up its status/values; nginx then became Running. HPA is disabled for this deployment. AM CPU/memory metrics may remain unavailable until capacity is expanded and metrics-server is installed. Existing application pods were preserved. + +## Historical domain correction and VM distinction + +The operator confirmed `nginx.example.com` as the intended host. Helm revision 2 and deployment history 9 now both use that host. The detail API reports `nginx.example.com` and worker IP `3.36.93.224`; HTTP through port 30880 returned 200 after the correction. Original release values and deployment history were saved under `values-before-domain-correction.json` and `history-before-domain-correction.json` in the server artifact directory. + +`54.180.127.114` belongs to the separate existing VM Nginx deployment (history 7, MCI `vm-mariadb-data-init-aws-archiving-01`, VM `g1-1`, service port 80). The local Windows hosts file maps `nginx.example.com` to that VM IP. It was not modified. Thus that mapping does not access the new Kubernetes deployment. K8s access uses `3.36.93.224:30880`, with the same source CIDR restriction as before. The browser's reported access to VM port 80 was not reproduced from the AM server; that does not alter the verified VM/K8s resource distinction. +## Historical source CIDR correction + +At the operator's request, Helm revision 3 changes the current allowed source to `210.219.181.78/32`. The AWS TCP 30880 rule, live Ingress whitelist annotation, Helm release values and AM exposure record for deployment 9 were updated and verified. The previous `210.217.178.130/32` rule was removed. Historical checks above from the AM server describe the pre-change configuration; that server is no longer allowed by this rule. Host `nginx.example.com`, worker `3.36.93.224`, external port 30880 and the Running pod are unchanged. Before-change values and rules are saved as `cidr-before-*` in the server artifact directory. diff --git a/doc/nginx-multi-csp-cleanup-20260916.md b/doc/nginx-multi-csp-cleanup-20260916.md new file mode 100644 index 0000000..694e7e3 --- /dev/null +++ b/doc/nginx-multi-csp-cleanup-20260916.md @@ -0,0 +1,46 @@ +# Kubernetes nginx test cleanup — 2026-09-16 + +Scope: uninstall nginx and remove the seven non-AWS Kubernetes test clusters and their owned infrastructure. Preserve AWS archiving VM/K8s and pre-existing reused resources. No Git commit or push. + +## Verified removal + +| CSP | Cluster / resources | +| --- | --- | +| Azure | AKS cluster, generated node resource group, test VNet/subnets/security group removed; native cluster, node RG and VNet return 404. | +| GCP | GKE cluster/workers removed; test VPC, both subnets and five test firewall rules absent in native API. | +| Alibaba | ACK cluster, two workers/disks, endpoint LB/EIP absent; prior shared VPC retained. | +| Tencent | TKE cluster, two workers/disks, nodepool, ASG, launch configuration and orphan endpoint LB removed; prior VPC retained. | +| NHN | NKS cluster/workers absent; no matching cluster ports, security groups, load balancers or volumes found. | +| NCP | NKS cluster, worker, public-IP allocation and cluster ACG absent; test LB subnets 323974/323975 removed. | +| IBM | Cluster/workers, managed LB, owned VPC/subnet/PGW, six endpoint gateways, six security groups and test PGW Floating IP all absent. Older resources verified unchanged by exact ID. | + +## Application Manager and AWS + +All seven nginx UNINSTALL actions and AM cleanup calls succeeded. Old non-AWS failed/uninstalled deployment records were also cleaned. Audit/log rows were preserved; nullable references blocking cleanup were detached only for targeted status rows, with reference mappings backed up. A monitor cycle recreated IBM/NCP status rows after cleanup; these were removed through the cleanup API once uninstall completion was verified. + +Final AM application-status list contains only AWS IDs 3, 4 and 5, all RUNNING (archiving VM nginx, K8s Jupyter and K8s nginx). Tumblebug Kubernetes list contains only `k8s-mariadb-data-init-aws-archiving-01`, Active. Final external HTTP checks: AWS VM 54.180.127.114:80 = 200; AWS K8s 3.36.93.224:30880 = 200. SW Catalog entries and deployed AM runtime were retained. + +## Existing resources intentionally retained + +- NCP reused VPC 148385 and original GENERAL subnets 323783/323784. +- NHN September 14 VPC/subnets and pre-existing Floating IP 180.210.82.26 (allocation bbb36eac-3b74-4f7e-98a5-730e5c7f0959), now detached. The address allocation remains reserved. +- Alibaba/Tencent prior shared VPCs and existing shared security groups; no target VPC ENIs remain. Tencent test-created SG sg-nab2s4d1 was deleted after the user explicitly approved treating it the same as other CSPs. Native associations were zero before deletion; platform and native absence were verified. Prior SGs sg-7cvsbyyf and sg-bnq06prt remain. +- Other unrelated/older infrastructure, shared credentials and SSH keys. + +## Alibaba exception + +Before deletion, prior September 15 NAT `ngw-mj7x2i4lkixtdmff0lj1m` and EIP `eip-mj790in8dhgumfs911q45` existed in the reused VPC. Both were absent in exact-ID queries after the normal platform cluster DELETE. No separate native deletion was sent for either resource. Provider/driver cascade is suspected, but causality was not established. The VPC remains. This exception is not represented as an intentionally preserved resource. + +## Evidence + +Server: `/home/ubuntu/nginx-csp-cleanup-20260916/` (restricted directory), including before identities, uninstall/cleanup results, audit-reference mappings and provider final checks. Supplementary Alibaba/Tencent snapshots are under `/home/ubuntu/nginx-csp-test-20260916/`. Reports contain no cloud credentials or kubeconfigs. + +## Follow-up: Workflow cleanup and Tumblebug metadata verification + +The initial report's NCP platform-absence conclusion was incomplete: HTTP 404 can also wrap a provider lookup failure while a Tumblebug record remains. Exact-ID reinspection found the NCP record still referencing native cluster 3f62d0e5-686e-4968-8321-8820045cd8c9. The other six clusters returned the explicit `not exist` message. All seven separate infra IDs returned `does not exist`. + +At the user's request, Workflow 107 (`k8s-mariadb-data-init-cleanup`) was run for namespace `default`, cluster `k8s-mariadb-data-init-ncp-01`, with the workflow's force cleanup option. Build #4 was marked FAILED because Tumblebug returned HTTP 200 with `is not deleted`, although its force path removed the stale metadata. A subsequent exact-ID query returned the explicit `not exist` message. The same workflow was rerun as build #5 and completed SUCCESS, including its cleanup stage. + +Final exact-ID checks: Azure, GCP, Alibaba, Tencent, IBM, NCP and NHN K8s records all return `not exist`; all seven separate infra IDs return `does not exist`. No cleanup workflow was needed for the other six because their records were already absent. AWS archiving resources and the intentionally retained existing/shared networks were excluded from these runs. + +Evidence: `/home/ubuntu/nginx-csp-cleanup-20260916/workflow107-ncp-dispatch.json`, `workflow107-ncp-result.json`, `workflow107-ncp-stage4.json` (restricted raw log), `workflow107-ncp-retry-dispatch.json`, `workflow107-ncp-retry-result.json`, and the final per-ID query snapshot `workflow-precheck.json`. diff --git a/doc/nginx-multi-csp-verification-20260916.md b/doc/nginx-multi-csp-verification-20260916.md new file mode 100644 index 0000000..c820daf --- /dev/null +++ b/doc/nginx-multi-csp-verification-20260916.md @@ -0,0 +1,43 @@ +> Historical deployment results. The non-AWS test deployments were subsequently uninstalled and their clusters removed at the user's request. See [cleanup record](nginx-multi-csp-cleanup-20260916.md) for the final state. + +# Multi-CSP Kubernetes nginx verification — 2026-09-16 + +All seven CSP workflows and AM SW Catalog nginx installations completed. Final AM monitoring confirms every deployment is RUNNING with 1/1 pods (2026-09-16 02:32 UTC / 11:32 KST). The pre-existing AWS archiving nginx also remains RUNNING. The existing Workflow `k8s-mariadb-backup-import-data-init` (103) used `INFRA_ID` and `K8S_CLUSTER_ID` = `k8s-mariadb-data-init-{csp}-01`. Each cluster has Application Manager SW Catalog 12 (`Nginx for Kubernetes`) installed. + +Common settings: namespace `default`, host `nginx.example.com`, allowed source `210.219.181.78/32`, application replicas 1, HPA disabled. Non-IBM HTTP uses worker NodePort **30880**; IBM uses its managed public LB on **80**. The application Service is ClusterIP port 80. The local Windows hosts file was not changed; external tests used `curl --resolve`. + +| CSP | Region / requested worker | Kubernetes version used | Successful Workflow build | nginx deployment | Verified public address | +| --- | --- | --- | --- | --- | --- | +| Azure | koreasouth / Standard_D2s_v3 | 1.35.6 | 5 | 13, HTTP 200 | 20.214.19.2 | +| GCP | asia-northeast3 / e2-medium | 1.35.6-gke.1250000 | 6 | 14, HTTP 200 | 34.50.29.86 | +| Alibaba | ap-northeast-2 / ecs.c9i.xlarge | 1.34.10-aliyun.1 | 12 | 15, backend HTTP 200 | None (`-`) | +| Tencent | ap-seoul / BF1.MEDIUM2 | 1.34.1 | 8 | 17, HTTP 200 | 43.155.141.168 | +| IBM | jp-osa / bx2-2x8 | 1.33.13_1580 | 9 | 19, HTTP 200 | 163.68.86.201, 163.68.83.115 | +| NCP | kr / c2-g3 requested; actual c2-g2-s50 | 1.34.3-nks.1 | 13 | 20, HTTP 200 | 211.233.199.71 | +| NHN | kr1 / m2.c1m2 | v1.35.5 | 11 | 18, backend HTTP 200 | None (`-`) | + +Alibaba and NHN workers have no public IP. Backend requests returned HTTP 200; ingress requests from a non-allowed internal source returned 403. Their AM ingress public-address lists are empty and the detail UI displays `-`. Public addresses in this report refer to ingress workers, except IBM, where they refer to the managed public LB. + +## Findings and scoped recovery + +- **Azure:** available 1.35-series patch was 1.35.6. AM initially looked up the AKS-generated NSG in the wrong resource group. The actual VMSS NIC attachment was verified, and inbound TCP 30880 from the specified /32 was added directly to the correct NSG. Deployment 13 succeeded with automatic firewall opening disabled and the Ingress CIDR restriction retained. This is an operator-managed NSG rule; AM's security-group ledger does not automatically remove it on uninstall. The rule ID and before-state are retained in server evidence. +- **GCP:** initial provisioning chose COS_CONTAINERD. The new nodepool was updated to the requested UBUNTU_CONTAINERD family and completed successfully; the managed image is Ubuntu 24.04.4 LTS. The workflow's MariaDB uses ephemeral storage, so its known initialization schema/sample seed were restored after node replacement. Validation queried the row count (1), not table contents. +- **Alibaba:** missing `ack-node-problem-detector` prevented nodegroup creation. The add-on was installed, the requested `ng1` was created, and recovery Workflow 12 passed all six stages. Two workers became Ready within the configured min1/max3 autoscaling range. +- **Tencent:** an empty `sys.description` tag and the wrong nodepool availability-zone subnet prevented worker creation. Both were corrected. Requested Ubuntu 22.04 workers became Ready; Workflow 8 and AM deployment 17 succeeded. +- **IBM:** runtime r2 lacked HTTP ingress preparation present in the local source. Runtime r3 adds the required functionality using 23 relevant classes; 243 scoped regression tests passed. All 13 underlying Java source files already match `D:/mcmp/mc-application-manager` by SHA256. Managed preparation reached READY, adding HTTP 80 while preserving existing 443. Both LB addresses returned HTTP 200 from the allowed client. Requests from the non-allowed AM server, including a spoofed X-Forwarded-For header, returned 403. Both ALB replicas and two workers became Ready. +- **NCP network:** Workflow 10 failed at the three-VPC account limit. The user approved reuse of VPC 148385 (`tbqg8ghs3egav4q9p8ph`, 10.156.0.0/16), which had no attached compute/NICs. Its subnets 323783/323784 were registered; a subnet-registration metadata mismatch was corrected with backups. No existing VPC was deleted and no quota was increased. Workflow 13 completed successfully in approximately 24 minutes. +- **NCP specification limitation:** the driver defaults to XEN and matches legacy products by CPU/RAM, causing the requested c2-g3 to provision as c2-g2-s50 / Ubuntu 20.04.3. A KVM replacement would require a new cluster and minimum 100GB root disk. After explanation, the user prioritized nginx functional verification with the already-created cluster. No replacement KVM cluster was created and no existing cluster was deleted. **c2-g3 provisioning has not been verified or fixed in the infrastructure driver.** +- **NHN:** the requested general Ubuntu Server 22.04.5 LTS (2026.03.10) image `0f07c795-2a46-44fc-a61b-fa0d96763ce2` became the corresponding Container image `107cc02d-02d8-44fd-84d6-6c316045b817`, with the same OS release/image date. Actual worker Ubuntu 22.04.5 LTS / Kubernetes v1.35.5 was verified; Workflow 11 passed all stages. + +## Runtime, source, and evidence + +AM runs `mc-application-manager:nginx-catalog-ingress-ip-20260916-r3`. Compose recreation must include `/home/ubuntu/am-nginx-20260916/override-r3.yaml` with base `/home/ubuntu/mcmp/2026/0910/mc-admin-cli/conf/docker/docker-compose.yaml`. The r2 image, `override-r2.yaml`, and `am-r2.jar` remain for rollback. Other r2 JAR entries were preserved; existing deployments remained Running after the AM restart. + +The D-drive project contains the catalog, Helm chart, domain/public-IP detail changes, compiled frontend assets, tests, and verification documents. The original checkout HEAD is preserved; **no Git commit or push was performed**. The prior full backend run passed 622 tests (0 failures/errors, 1 skipped), frontend typecheck/build and Helm lint passed, and the additional runtime IBM patch passed 243 scoped tests. `git diff --check` passed. + +Status-refresh limitation: with all clusters monitored, the cached AM status can lag actual Pod readiness by several minutes. NCP initially displayed INSTALL despite a Running Pod and HTTP 200; the regular monitor subsequently updated it to RUNNING without manual status edits. + +Server evidence: `/home/ubuntu/nginx-csp-test-20260916/`, including per-CSP details and `final-am-verification.json`. Runtime backups: `/home/ubuntu/am-nginx-20260916/`. Credentials are not included in this report. + +API references: [GKE nodePools.update](https://docs.cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters.nodePools/update), [Alibaba InstallClusterAddons](https://www.alibabacloud.com/help/tc/ack/ack-managed-and-ack-dedicated/developer-reference/api-install-a-component-in-an-ack-cluster), [NCP createCluster](https://api.ncloud-docs.com/docs/nks-createcluster). + diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionController.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionController.java new file mode 100644 index 0000000..aa0cd1b --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionController.java @@ -0,0 +1,57 @@ +package kr.co.mcmp.softwarecatalog.application.controller; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Base64; +import kr.co.mcmp.response.ResponseWrapper; +import kr.co.mcmp.security.project.ProjectScopeAuthorizationService; +import kr.co.mcmp.softwarecatalog.application.constants.DeploymentType; +import kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequestDTO; +import kr.co.mcmp.softwarecatalog.application.service.DeploymentSubmissionService; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.server.ResponseStatusException; + +@RestController +@RequestMapping("/applications/deployment-submissions") +@RequiredArgsConstructor +public class DeploymentSubmissionController { + private final ProjectScopeAuthorizationService authorization; + private final DeploymentSubmissionService jobs; + private final ObjectMapper mapper; + + @PostMapping("/{type}") + public ResponseWrapper submit(@PathVariable DeploymentType type, + @RequestHeader("Idempotency-Key") String id, @RequestBody DeploymentRequestDTO request, HttpServletRequest http) { + if(type!=DeploymentType.VM && type!=DeploymentType.K8S) throw new ResponseStatusException(HttpStatus.BAD_REQUEST,"Only VM and K8S deployments are supported."); + var scope=scope(http,request.getNamespace()); + request.setDeploymentType(type); + return new ResponseWrapper<>(jobs.submit(scope,id,request)); + } + @GetMapping("/{id}") + public ResponseWrapper get(@PathVariable String id,@RequestParam String namespace,HttpServletRequest http) { + return new ResponseWrapper<>(jobs.get(scope(http,namespace),id)); + } + @PostMapping("/{id}/close-interrupted") + public ResponseWrapper closeInterrupted(@PathVariable String id, + @RequestParam String namespace,HttpServletRequest http) { + return new ResponseWrapper<>(jobs.closeInterrupted(scope(http,namespace),id)); + } + @ExceptionHandler(ResponseStatusException.class) + public org.springframework.http.ResponseEntity> statusError(ResponseStatusException ex) { + return org.springframework.http.ResponseEntity.status(ex.getStatusCode()) + .body(new ResponseWrapper<>(ex.getStatusCode().value(), "Deployment request rejected", ex.getReason())); + } + private DeploymentSubmissionService.Scope scope(HttpServletRequest http,String namespace) { + String ns=authorization.authorizeNamespace(http,namespace); + if(!authorization.isEnabled()) return new DeploymentSubmissionService.Scope("local","local",ns,"local"); + try { + // authorizeNamespace above validates the bearer against IAM. Only its non-secret subject is retained. + String bearer=http.getHeader("Authorization").substring(7).trim(); + String owner=mapper.readTree(Base64.getUrlDecoder().decode(bearer.split("\\.")[1])).path("sub").asText(); + if(owner.isBlank()) throw new IllegalArgumentException(); + return new DeploymentSubmissionService.Scope(http.getHeader("X-MCMP-Workspace-ID"),http.getHeader("X-MCMP-Project-ID"),ns,owner); + } catch(Exception ex) { throw new ResponseStatusException(HttpStatus.UNAUTHORIZED,"An authenticated user subject is required."); } + } +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java index ea85f5d..023cf64 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/dto/IntegratedApplicationInfoDTO.java @@ -70,6 +70,8 @@ public class IntegratedApplicationInfoDTO { // Ingress 정보 private Boolean ingressEnabled; private String ingressHost; + private List ingressPublicIps; + private List ingressAccessPorts; private String ingressPath; private String ingressClass; private Boolean ingressTlsEnabled; diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionService.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionService.java new file mode 100644 index 0000000..b53498f --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionService.java @@ -0,0 +1,150 @@ +package kr.co.mcmp.softwarecatalog.application.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.*; +import java.util.concurrent.*; +import org.springframework.dao.DuplicateKeyException; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Service; +import org.springframework.web.server.ResponseStatusException; +import org.springframework.http.HttpStatus; +import kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequestDTO; + +/** Durable receipt/status only: deployment credentials and request bodies are never persisted here. */ +@Service +public class DeploymentSubmissionService { + public record Scope(String workspace, String project, String namespace, String owner) {} + public record Status(String id, String namespace, String state, String message, Long deploymentId) {} + private final JdbcTemplate jdbc; + private final ApplicationOrchestrationService deployments; + private final ObjectMapper mapper; + private final ExecutorService executor; + + @org.springframework.beans.factory.annotation.Autowired + public DeploymentSubmissionService(JdbcTemplate jdbc, ApplicationOrchestrationService deployments, ObjectMapper mapper) { + this(jdbc, deployments, mapper, new ThreadPoolExecutor(4, 4, 0, TimeUnit.SECONDS, + new ArrayBlockingQueue<>(16), new ThreadPoolExecutor.AbortPolicy())); + } + DeploymentSubmissionService(JdbcTemplate jdbc, ApplicationOrchestrationService deployments, ObjectMapper mapper, ExecutorService executor) { + this.jdbc=jdbc; this.deployments=deployments; this.mapper=mapper; this.executor=executor; + } + @PostConstruct + void initialize() { + jdbc.execute(""" + CREATE TABLE IF NOT EXISTS application_deployment_submission ( + id VARCHAR(36) PRIMARY KEY, workspace_id VARCHAR(255) NOT NULL, + project_id VARCHAR(255) NOT NULL, namespace VARCHAR(255) NOT NULL, + owner_id VARCHAR(255) NOT NULL, request_hash VARCHAR(64) NOT NULL, + active_key VARCHAR(64) UNIQUE, target_type VARCHAR(16) NOT NULL, target_id VARCHAR(255) NOT NULL, + catalog_id BIGINT NOT NULL, automatic_reconciliation BOOLEAN NOT NULL, history_watermark BIGINT NOT NULL, state VARCHAR(32) NOT NULL, + message VARCHAR(512) NOT NULL, deployment_id BIGINT, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP) + """); + jdbc.update("UPDATE application_deployment_submission SET state='FAILED', active_key=NULL, message=?, updated_at=CURRENT_TIMESTAMP WHERE state='QUEUED'", + "AM restarted before this installation started. No deployment was submitted; retry if needed."); + // Never replay an installation after restart: remote work might already have completed. + jdbc.update("UPDATE application_deployment_submission SET state='INTERRUPTED', message=?, updated_at=CURRENT_TIMESTAMP WHERE state='RUNNING'", + "AM restarted while tracking this deployment. Check Apps Status before retrying; no automatic resubmission was made."); + } + public Status submit(Scope scope, String id, DeploymentRequestDTO input) { + try { UUID.fromString(id); } catch (Exception ex) { throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "A UUID Idempotency-Key is required."); } + if (input.getCatalogId()==null || input.getDeploymentType()==null || !scope.namespace().equals(input.getNamespace())) + throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Deployment catalog, type and namespace are required."); + String target=input.getDeploymentType().name().equals("VM") ? input.getMciId() : input.getClusterName(); + if (target==null || target.isBlank()) throw new ResponseStatusException(HttpStatus.BAD_REQUEST,"Deployment target is required."); + DeploymentRequestDTO request=mapper.convertValue(input,DeploymentRequestDTO.class); + String hash=hash(request); + var prior=jdbc.queryForList("SELECT request_hash FROM application_deployment_submission WHERE id=?",id); + if (!prior.isEmpty()) { + Status existing=get(scope,id); + if (!hash.equals(prior.get(0).get("request_hash"))) throw new ResponseStatusException(HttpStatus.CONFLICT,"This operation ID was used with different deployment settings."); + return existing; + } + // Conservatively serialize the same catalog on an entire VM MCI (including overlapping node groups). + String active=hash(List.of(scope.namespace(),input.getDeploymentType().name(),target,input.getCatalogId())); + try { + jdbc.update("INSERT INTO application_deployment_submission(id,workspace_id,project_id,namespace,owner_id,request_hash,active_key,target_type,target_id,catalog_id,automatic_reconciliation,history_watermark,state,message) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,'QUEUED',?)", + id,scope.workspace(),scope.project(),scope.namespace(),scope.owner(),hash,active,input.getDeploymentType().name(),target,input.getCatalogId(),input.getDeploymentType().name().equals("K8S") || ((input.getVmNodeGroupId()==null || input.getVmNodeGroupId().isBlank()) && input.getVmIds()!=null && input.getVmIds().size()==1), + jdbc.queryForObject("SELECT COALESCE(MAX(id),0) FROM deployment_history",Long.class),"Deployment accepted; waiting for a worker."); + } catch (DuplicateKeyException ex) { + var same=jdbc.queryForList("SELECT id FROM application_deployment_submission WHERE id=?",id); + if (!same.isEmpty()) return submit(scope,id,input); + throw new ResponseStatusException(HttpStatus.CONFLICT,"An installation of this catalog on this target is already active or requires reconciliation. Check Apps Status before retrying."); + } + var context=SecurityContextHolder.createEmptyContext(); + context.setAuthentication(SecurityContextHolder.getContext().getAuthentication()); + try { + executor.execute(() -> { + SecurityContextHolder.setContext(context); + try { run(id,request); } finally { SecurityContextHolder.clearContext(); } + }); + } catch (RejectedExecutionException ex) { + finish(id,"FAILED","Deployment queue is full; no installation was started.",null); + } + return get(scope,id); + } + public Status get(Scope scope,String id) { + var found=jdbc.query("SELECT id,namespace,state,message,deployment_id FROM application_deployment_submission WHERE id=? AND workspace_id=? AND project_id=? AND namespace=? AND owner_id=?", + (rs,n)->new Status(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),(Long)rs.getObject(5)), + id,scope.workspace(),scope.project(),scope.namespace(),scope.owner()); + if(found.isEmpty()) throw new ResponseStatusException(HttpStatus.NOT_FOUND,"Deployment operation was not found in this user/project scope."); + Status status=found.get(0); + if ("INTERRUPTED".equals(status.state())) { + // A single matching persisted history can reconcile a lost response. Ambiguous/multi-VM + // histories are deliberately not guessed; an operator must inspect those deployments. + var rows=jdbc.queryForList(""" + SELECT h.id,h.status FROM deployment_history h JOIN application_deployment_submission j + ON h.namespace=j.namespace AND h.catalog_id=j.catalog_id AND h.deployment_type=j.target_type + AND ((j.target_type='VM' AND h.mci_id=j.target_id) OR (j.target_type='K8S' AND h.cluster_name=j.target_id)) + WHERE j.id=? AND j.automatic_reconciliation=true AND h.id>j.history_watermark AND h.action_type='INSTALL' + """,id); + if(rows.size()==1) { + String recorded=String.valueOf(rows.get(0).get("status")); + if(Set.of("SUCCESS","FAILED","PARTIAL_SUCCESS","DELETED").contains(recorded)) { + Long historyId=((Number)rows.get(0).get("id")).longValue(); + String reconciled="SUCCESS".equals(recorded)?"SUCCEEDED":("DELETED".equals(recorded)?"FAILED":recorded); + finish(id,reconciled,"Tracking recovered from persisted deployment history. Check Apps Status for the current application state.",historyId); + return new Status(id,scope.namespace(),reconciled,"Tracking recovered from deployment history.",historyId); + } + } + } + return status; + } + /** Explicit owner action closes tracking only; never changes or retries the real deployment. */ + public Status closeInterrupted(Scope scope,String id) { + Status status=get(scope,id); + if(!"INTERRUPTED".equals(status.state())) throw new ResponseStatusException(HttpStatus.CONFLICT,"Only interrupted tracking can be closed."); + int changed=jdbc.update("UPDATE application_deployment_submission SET state='ABANDONED',active_key=NULL,message=?,updated_at=CURRENT_TIMESTAMP WHERE id=? AND state='INTERRUPTED'", + "Interrupted tracking was closed by its owner. This does not cancel or change the actual application.",id); + if(changed!=1) throw new ResponseStatusException(HttpStatus.CONFLICT,"Tracking state changed; reload its status."); + return get(scope,id); + } + private void run(String id,DeploymentRequestDTO request) { + if(jdbc.update("UPDATE application_deployment_submission SET state='RUNNING',message='Installation is running. Closing the dialog does not cancel it.',updated_at=CURRENT_TIMESTAMP WHERE id=? AND state='QUEUED'",id)!=1) return; + try { + var result=deployments.deployApplication(request.toDeploymentRequest()); + String state=result==null ? "FAILED" : result.getStatus(); + Long deploymentId=result==null ? null : result.getId(); + if("SUCCESS".equals(state)) finish(id,"SUCCEEDED","Installation completed.",deploymentId); + else if("PARTIAL_SUCCESS".equals(state)) finish(id,"PARTIAL_SUCCESS","Only some targets completed. Open Apps Status for individual results.",deploymentId); + else finish(id,"FAILED","Installation did not complete successfully. Open Apps Status for deployment logs.",deploymentId); + } catch(Exception ex) { + // Provider/Helm errors can contain credentials; details remain in existing deployment logging. + finish(id,"FAILED","Installation failed. Open Apps Status for deployment logs.",null); + } + } + private void finish(String id,String state,String message,Long deploymentId) { + jdbc.update("UPDATE application_deployment_submission SET state=?,message=?,deployment_id=?,active_key=NULL,updated_at=CURRENT_TIMESTAMP WHERE id=?",state,message,deploymentId,id); + } + private String hash(Object value) { + try { return HexFormat.of().formatHex(MessageDigest.getInstance("SHA-256").digest(mapper.writeValueAsString(value).getBytes(StandardCharsets.UTF_8))); } + catch(Exception ex) { throw new IllegalArgumentException("Deployment settings could not be encoded."); } + } + @PreDestroy void shutdown() { executor.shutdown(); } +} diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java index 2be1b25..99bc446 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/application/service/impl/ApplicationServiceImpl.java @@ -32,6 +32,7 @@ import kr.co.mcmp.softwarecatalog.application.service.ApplicationService; import kr.co.mcmp.softwarecatalog.application.service.NexusIntegrationService; import kr.co.mcmp.softwarecatalog.application.service.UnifiedLogService; +import kr.co.mcmp.softwarecatalog.kubernetes.service.IngressAddressService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -62,6 +63,7 @@ public class ApplicationServiceImpl implements ApplicationService { private final CatalogRepository catalogRepository; private final UnifiedLogService unifiedLogService; + private final IngressAddressService ingressAddressService; // ===== 넥서스 연동 관련 메서드 (애플리케이션 배포/운영용) ===== @@ -566,6 +568,10 @@ public Map getIntegratedApplicationInfoByDeploymentId(Long deplo // 간소화된 DTO로 변환 IntegratedApplicationInfoDTO dto = convertToIntegratedDTOWithUnifiedLogs(deploymentHistory, applicationStatuses, logs, operations, errorLogs, podLogs); + var ingressEndpoint = ingressAddressService.getEndpoint(deploymentHistory, dto.getIngressEnabled(), + dto.getIngressClass(), dto.getIngressTlsEnabled()); + dto.setIngressPublicIps(ingressEndpoint.publicIps()); + dto.setIngressAccessPorts(ingressEndpoint.accessPorts()); Map result = new HashMap<>(); result.put("integratedInfo", dto); @@ -737,7 +743,12 @@ public IntegratedApplicationInfoDTO getIntegratedApplicationInfoByDeploymentIdAs List podLogs = unifiedLogService.getLogsByDeploymentIdAndModule(deploymentId, "KUBERNETES"); // DTO로 변환 - return convertToIntegratedDTOWithUnifiedLogs(deploymentHistory, applicationStatuses, logs, operations, errorLogs, podLogs); + IntegratedApplicationInfoDTO dto = convertToIntegratedDTOWithUnifiedLogs(deploymentHistory, applicationStatuses, logs, operations, errorLogs, podLogs); + var ingressEndpoint = ingressAddressService.getEndpoint(deploymentHistory, dto.getIngressEnabled(), + dto.getIngressClass(), dto.getIngressTlsEnabled()); + dto.setIngressPublicIps(ingressEndpoint.publicIps()); + dto.setIngressAccessPorts(ingressEndpoint.accessPorts()); + return dto; } private List findApplicationStatusesForDeployment(DeploymentHistory deploymentHistory) { diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmIngressValues.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmIngressValues.java index 1b15bfe..1ec4aea 100644 --- a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmIngressValues.java +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/HelmIngressValues.java @@ -32,7 +32,7 @@ static Map from(HelmChart chart, DeploymentConfigDTO config) { if (config.isTlsEnabled() && config.getIngressTlsSecret() == null) { throw new IllegalStateException("Resolve the TLS Secret using the actual Helm release name before building values"); } - ingress.put(profile == Profile.GENERIC ? "className" : "ingressClassName", config.getIngressClass()); + ingress.put((profile == Profile.GENERIC || profile == Profile.CLOUDPIRATES_NGINX) ? "className" : "ingressClassName", config.getIngressClass()); List> tls = config.isTlsEnabled() ? List.of(Map.of("secretName", config.getIngressTlsSecret(), "hosts", List.of(host))) : List.of(); @@ -44,7 +44,7 @@ static Map from(HelmChart chart, DeploymentConfigDTO config) { ingress.put("pathType", "Prefix"); ingress.put("tls", tls); } - case RCLONE, GENERIC -> { + case RCLONE, CLOUDPIRATES_NGINX, GENERIC -> { ingress.put("hosts", List.of(Map.of("host", host, "paths", List.of( Map.of("path", config.getIngressPath(), "pathType", "Prefix"))))); ingress.put("tls", tls); @@ -63,10 +63,26 @@ static Map from(HelmChart chart, DeploymentConfigDTO config) { Map result = new LinkedHashMap<>(); switch (profile) { - case GRAFANA, BITNAMI_NGINX, GENERIC -> result.put("ingress", ingress); + case GRAFANA, BITNAMI_NGINX, CLOUDPIRATES_NGINX, GENERIC -> result.put("ingress", ingress); case PROMETHEUS -> result.put("server", Map.of("ingress", ingress)); case RCLONE -> result.put("ingress", Map.of("main", ingress)); } + if (profile == Profile.CLOUDPIRATES_NGINX) { + // Non-root nginx must not rely on a provider allowing privileged container ports. + result.put("containerPorts", List.of(Map.of("name", "http", "containerPort", 8080, "protocol", "TCP"))); + result.put("serverConfig", """ + server { + listen 8080; + server_name _; + root /usr/share/nginx/html; + index index.html index.htm; + location / { try_files $uri $uri/ =404; } + } + """); + // This chart uses a port array; the generic service.port value is ignored upstream. + result.put("service", Map.of("ports", List.of(Map.of( + "name", "http", "port", config.getServicePort(), "targetPort", "http", "protocol", "TCP")))); + } return result; } @@ -98,7 +114,7 @@ static void validate(HelmChart chart, DeploymentConfigDTO config) { } requirePlainYamlString(host, "Host"); } - if (profile == Profile.GRAFANA || profile == Profile.PROMETHEUS || profile == Profile.GENERIC) { + if (profile == Profile.GRAFANA || profile == Profile.PROMETHEUS || profile == Profile.CLOUDPIRATES_NGINX || profile == Profile.GENERIC) { requirePlainYamlString(config.getIngressClass(), "Class"); } } @@ -127,6 +143,7 @@ private enum Profile { PROMETHEUS("prometheus", "https://prometheus-community.github.io/helm-charts"), RCLONE("rclone", "https://jacobcolvin.com/helm-charts"), BITNAMI_NGINX("nginx", "https://charts.bitnami.com/bitnami"), + CLOUDPIRATES_NGINX("nginx", "https://cloudpirates-io.github.io/helm-charts"), // Fallback only: a repository/chart with a different schema still needs an adapter. GENERIC(null, null); diff --git a/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java new file mode 100644 index 0000000..d2d18e2 --- /dev/null +++ b/src/main/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressService.java @@ -0,0 +1,140 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import java.util.List; +import java.util.TreeSet; +import java.net.InetAddress; + +import io.fabric8.kubernetes.client.KubernetesClient; +import kr.co.mcmp.softwarecatalog.application.constants.DeploymentType; +import kr.co.mcmp.softwarecatalog.application.model.DeploymentHistory; +import kr.co.mcmp.softwarecatalog.kubernetes.config.KubernetesClientFactory; +import kr.co.mcmp.ape.cbtumblebug.api.CbtumblebugRestApi; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** Resolves the public addresses of the ingress controller installed by AM. */ +@Service +@RequiredArgsConstructor +@Slf4j +public class IngressAddressService { + private final KubernetesClientFactory clientFactory; + private final CbtumblebugRestApi tumblebug; + + public record Endpoint(List publicIps, List accessPorts) {} + + public List getPublicIps(DeploymentHistory history, Boolean enabled, String ingressClass) { + return getEndpoint(history, enabled, ingressClass, false).publicIps(); + } + + public Endpoint getEndpoint(DeploymentHistory history, Boolean enabled, String ingressClass, Boolean tlsEnabled) { + if (history.getDeploymentType() != DeploymentType.K8S || !Boolean.TRUE.equals(enabled)) { + return new Endpoint(List.of(), List.of()); + } + try (KubernetesClient client = clientFactory.getClient(history.getNamespace(), history.getClusterName())) { + String provider = history.getCloudProvider(); + if ((provider == null || provider.isBlank()) && !IbmIngressSupport.managed(ingressClass)) { + var cluster = tumblebug.getK8sClusterByName(history.getNamespace(), history.getClusterName()); + if (cluster != null && cluster.getConnectionConfig() != null) provider = cluster.getConnectionConfig().getProviderName(); + } + List ips = resolve(client, history.getNamespace(), provider, ingressClass); + List ports = List.of(); + try { + ports = resolvePorts(client, history.getNamespace(), provider, ingressClass, Boolean.TRUE.equals(tlsEnabled)); + } catch (Exception e) { + log.warn("Cannot resolve ingress ports for deployment {}: {}", history.getId(), e.getClass().getSimpleName()); + } + return new Endpoint(ips, ports); + } catch (Exception e) { + // A missing cluster or denied Kubernetes permission must not break the detail dialog. + log.warn("Cannot resolve ingress endpoint for deployment {}: {}", history.getId(), e.getClass().getSimpleName()); + return new Endpoint(List.of(), List.of()); + } + } + + List resolvePorts(KubernetesClient client, String namespace, String provider, String ingressClass, boolean tls) { + boolean ibm = IbmIngressSupport.isIbm(provider) || IbmIngressSupport.managed(ingressClass); + if (ibm && IbmIngressSupport.PRIVATE_CLASS.equals(ingressClass)) return List.of(); + var services = ibm ? IbmIngressSupport.managedServices(client, "public-") + : client.services().inNamespace("default") + .withLabel("app.kubernetes.io/instance", "nginx-ingress-" + namespace) + .withLabel("app.kubernetes.io/component", "controller").list().getItems(); + var ports = new TreeSet(); + for (var service : services) { + if (service.getMetadata() == null || service.getMetadata().getDeletionTimestamp() != null + || service.getSpec() == null || service.getSpec().getPorts() == null) continue; + for (var port : service.getSpec().getPorts()) { + if (port.getProtocol() != null && !"TCP".equals(port.getProtocol())) continue; + if (!(tls ? "https" : "http").equals(port.getName()) + && !Integer.valueOf(tls ? 443 : 80).equals(port.getPort())) continue; + // A worker address uses NodePort; IBM's public LB uses its service listener port. + Integer accessPort = ibm ? port.getPort() : port.getNodePort(); + if (accessPort != null && accessPort > 0 && accessPort <= 65535) ports.add(accessPort); + } + } + return List.copyOf(ports); + } + + List resolve(KubernetesClient client, String namespace, String provider, String ingressClass) { + String release = "nginx-ingress-" + namespace; + var addresses = new TreeSet(); + if (IbmIngressSupport.isIbm(provider) || IbmIngressSupport.managed(ingressClass)) { + // Private IBM ingress has no public entry point. + if (IbmIngressSupport.PRIVATE_CLASS.equals(ingressClass)) return List.of(); + for (var service : IbmIngressSupport.managedServices(client, "public-")) { + if (service.getStatus() != null && service.getStatus().getLoadBalancer() != null + && service.getStatus().getLoadBalancer().getIngress() != null) { + for (var entry : service.getStatus().getLoadBalancer().getIngress()) { + addPublicAddresses(addresses, entry.getIp()); + if (entry.getIp() == null || entry.getIp().isBlank()) addPublicAddresses(addresses, entry.getHostname()); + } + } + } + } else { + var pods = client.pods().inNamespace("default") + .withLabel("app.kubernetes.io/instance", release) + .withLabel("app.kubernetes.io/component", "controller").list().getItems(); + var nodeNames = new TreeSet(); + for (var pod : pods) { + if (pod.getMetadata().getDeletionTimestamp() == null && pod.getSpec() != null + && pod.getStatus() != null && "Running".equals(pod.getStatus().getPhase())) { + add(nodeNames, pod.getSpec().getNodeName()); + } + } + for (String name : nodeNames) { + var node = client.nodes().withName(name).get(); + if (node != null && node.getStatus() != null && node.getStatus().getAddresses() != null) { + node.getStatus().getAddresses().stream() + .filter(address -> "ExternalIP".equals(address.getType())) + .forEach(address -> addPublicAddresses(addresses, address.getAddress())); + } + } + } + return List.copyOf(addresses); + } + + private static void add(java.util.Set values, String value) { + if (value != null && !value.isBlank()) values.add(value.trim()); + } + + void addPublicAddresses(java.util.Set values, String endpoint) { + if (endpoint == null || endpoint.isBlank()) return; + try { + for (var address : lookup(endpoint.trim())) { + byte[] bytes = address.getAddress(); + boolean privateV6 = bytes.length == 16 && (bytes[0] & 0xfe) == 0xfc; + boolean sharedV4 = bytes.length == 4 && (bytes[0] & 255) == 100 && (bytes[1] & 255) >= 64 && (bytes[1] & 255) <= 127; + if (!address.isAnyLocalAddress() && !address.isLoopbackAddress() && !address.isLinkLocalAddress() + && !address.isSiteLocalAddress() && !address.isMulticastAddress() && !privateV6 && !sharedV4) { + values.add(address.getHostAddress()); + } + } + } catch (java.net.UnknownHostException e) { + log.debug("Ingress endpoint DNS resolution failed"); + } + } + + InetAddress[] lookup(String endpoint) throws java.net.UnknownHostException { + return InetAddress.getAllByName(endpoint); + } +} diff --git a/src/main/java/kr/co/mcmp/util/DatabaseInitializer.java b/src/main/java/kr/co/mcmp/util/DatabaseInitializer.java index 20bdc9a..2a378f1 100644 --- a/src/main/java/kr/co/mcmp/util/DatabaseInitializer.java +++ b/src/main/java/kr/co/mcmp/util/DatabaseInitializer.java @@ -36,9 +36,53 @@ public void run(String... args) throws Exception { System.out.println("데이터베이스가 이미 초기화되어 있습니다. 건너뜁니다."); } ensureBuiltInJupyterCatalog(); + ensureNginxHelmCatalog(); ensureBuiltInCatalogCapabilities(); } + private void ensureNginxHelmCatalog() { + jdbcTemplate.update(""" + INSERT INTO SOFTWARE_CATALOG ( + TITLE, DESCRIPTION, SUMMARY, CATEGORY, LOGO_URL_LARGE, LOGO_URL_SMALL, + MIN_CPU, RECOMMENDED_CPU, MIN_MEMORY, RECOMMENDED_MEMORY, MIN_DISK, + RECOMMENDED_DISK, CPU_THRESHOLD, MEMORY_THRESHOLD, MIN_REPLICAS, + MAX_REPLICAS, HPA_ENABLED, DEFAULT_PORT, INGRESS_ENABLED, CREATED_AT, UPDATED_AT) + SELECT 'Nginx for Kubernetes', 'General-purpose Nginx web server deployed with Helm on Kubernetes.', + 'Nginx web server', 'Web Server', '/catalog-icons/nginx.svg', '/catalog-icons/nginx.svg', + 0.1, 0.5, 0.0625, 0.25, 1, 1, 80.0, 80.0, 1, 1, false, 80, true, + CURRENT_TIMESTAMP, CURRENT_TIMESTAMP + WHERE NOT EXISTS (SELECT 1 FROM SOFTWARE_CATALOG WHERE LOWER(TITLE) = 'nginx for kubernetes') + """); + for (Long catalogId : jdbcTemplate.queryForList( + "SELECT ID FROM SOFTWARE_CATALOG WHERE LOWER(TITLE) = 'nginx for kubernetes'", Long.class)) { + jdbcTemplate.update(""" + INSERT INTO HELM_CHART (CATALOG_ID, CHART_NAME, CHART_VERSION, CHART_REPOSITORY_URL, + REPOSITORY_NAME, REPOSITORY_DISPLAY_NAME, REPOSITORY_OFFICIAL, PACKAGE_ID, + NORMALIZED_NAME, APP_VERSION, DESCRIPTION, CATEGORY, IMAGE_REPOSITORY, TAG, HAS_VALUES_SCHEMA) + SELECT ?, 'nginx', '0.16.8', 'https://cloudpirates-io.github.io/helm-charts', 'cloudpirates', + 'CloudPirates', false, 'cloudpirates-nginx', 'nginx', '1.31.5', + 'Nginx web server from the CloudPirates Helm repository.', 'Web Server', 'nginx', '0.16.8', true + WHERE NOT EXISTS (SELECT 1 FROM HELM_CHART WHERE CATALOG_ID = ?) + """, catalogId, catalogId); + // Migrate only the exact AM-provided legacy mapping, never a customized chart. + jdbcTemplate.update(""" + UPDATE HELM_CHART + SET CHART_VERSION = '0.16.8', + CHART_REPOSITORY_URL = 'https://cloudpirates-io.github.io/helm-charts', + REPOSITORY_NAME = 'cloudpirates', REPOSITORY_DISPLAY_NAME = 'CloudPirates', + REPOSITORY_OFFICIAL = false, PACKAGE_ID = 'cloudpirates-nginx', + NORMALIZED_NAME = 'nginx', APP_VERSION = '1.31.5', + DESCRIPTION = 'Nginx web server from the CloudPirates Helm repository.', + IMAGE_REPOSITORY = 'nginx', TAG = '0.16.8', HAS_VALUES_SCHEMA = true + WHERE CATALOG_ID = ? AND PACKAGE_ID = 'mcmp-builtin-nginx' + AND CHART_NAME = 'nginx' AND CHART_VERSION = '0.1.0' + AND CHART_REPOSITORY_URL = 'http://localhost:18084/charts' + AND REPOSITORY_NAME = 'mcmp-builtin' + """, catalogId); + ensureCatalogReference(catalogId, "nginx", "TAG"); + } + } + private void ensureBuiltInJupyterCatalog() { try { jdbcTemplate.update(""" diff --git a/src/main/resources/static/assets/ApplicationRepository-BBRiVMU8.js b/src/main/resources/static/assets/ApplicationRepository-BBRiVMU8.js new file mode 100644 index 0000000..fbc9eb0 --- /dev/null +++ b/src/main/resources/static/assets/ApplicationRepository-BBRiVMU8.js @@ -0,0 +1 @@ +import{I as _}from"./IconPlus-CDLv8nZC.js";import{d as u,E as m,r as v,g as y,c as i,a as e,b as n,u as r,e as f,m as g,G as h,o,s as b,H as w,R}from"./index-D89BCYsX.js";import"./createVueComponent-DOVlSFKE.js";const x={class:"page"},k={class:"page-wrapper"},C={key:0,class:"page-header d-print-none"},V={class:"container-xxl"},N={class:"row g-2 align-items-center"},B={class:"col-auto ms-auto"},E={class:"btn-list"},I={class:"page-body"},L={class:"container-xxl"},z={class:"row"},A={class:"col-lg-12"},P=u({__name:"ApplicationRepository",setup(D){const c=m(),a=v(null),l=y(()=>c.name==="repositoryList"),d=()=>{var t,s;(s=(t=a.value)==null?void 0:t.startCreate)==null||s.call(t)};return(t,s)=>(o(),i("div",x,[e("div",k,[l.value?(o(),i("div",C,[e("div",V,[e("div",N,[s[1]||(s[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Repository")],-1)),e("div",B,[e("div",E,[e("button",{type:"button",class:"btn btn-outline-primary page-header-action-btn","data-bs-toggle":"modal","data-bs-target":"#repositoryForm",onClick:d},[n(r(_),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),s[0]||(s[0]=f(" New Repository "))])])])])])])):g("",!0),e("div",I,[e("div",L,[e("div",z,[e("div",A,[n(r(R),null,{default:h(({Component:p})=>[(o(),b(w(p),{ref_key:"repositoryViewRef",ref:a},null,512))]),_:1})])])])])])]))}});export{P as default}; diff --git a/src/main/resources/static/assets/ApplicationStatus-BKVG0wix.js b/src/main/resources/static/assets/ApplicationStatus-BKVG0wix.js new file mode 100644 index 0000000..a94e381 --- /dev/null +++ b/src/main/resources/static/assets/ApplicationStatus-BKVG0wix.js @@ -0,0 +1,57 @@ +import{d as B,f as F,g as U,r,c as $,a as t,e as j,t as x,m as et,j as N,v as z,F as q,k as G,l as V,o as A,w as at,p as ot,n as st,i as nt,x as it,h as lt,b as L,q as dt,u as rt}from"./index-D89BCYsX.js";import{i as ct,g as ut,b as pt,A as mt,a as vt}from"./applicationDetailModal-B5NPsj3q.js";import{_ as bt}from"./Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js";import{n as ft,r as gt,o as yt,p as _t}from"./softwareCatalog-CAQVjm80.js";import{_ as St}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./createVueComponent-DOVlSFKE.js";import"./request-CuP4O-bn.js";const wt={class:"modal",id:"action-confirm",tabindex:"-1"},ht={class:"modal-dialog modal-lg",role:"document"},It={class:"modal-content"},Rt={class:"modal-header"},$t={class:"modal-title"},At={key:0},Ct={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},kt={class:"mb-3"},xt=["value"],Nt={class:"mb-3"},Lt={class:"modal-footer d-flex justify-content-between"},Tt=B({__name:"applicationActionConfirm",props:{title:{},applicationStatusId:{},type:{},applicationName:{}},emits:["getApplicationsStatusList"],setup(k,{expose:C,emit:I}){const _=F(),m=k,s=I,v=U(()=>m.title),b=U(()=>m.applicationStatusId),f=U(()=>m.type),g=r(""),S=r(""),n=()=>{g.value="",S.value=""},a=r([]),l=async w=>{const{data:d}=await ft(w);a.value=d},R=async()=>{var d,c;const w={operation:v.value,applicationStatusId:b.value,reason:g.value,detailReason:S.value};try{const{data:p}=await gt(w),y=p;y&&y.success!==!1&&!y.error?_.success(`${v.value} Action SUCCESS`):_.error((y==null?void 0:y.error)||`${v.value} Action FAIL`)}catch(p){_.error(((c=(d=p==null?void 0:p.response)==null?void 0:d.data)==null?void 0:c.message)||(p==null?void 0:p.message)||`${v.value} Action FAIL`)}finally{s("getApplicationsStatusList")}};return C({setInit:n,_getReasonList:l}),(w,d)=>(A(),$("div",wt,[t("div",ht,[t("div",It,[t("div",Rt,[t("h5",$t,[j(x(w.applicationName)+" "+x(v.value)+" ",1),f.value?(A(),$("span",At,"("+x(f.value)+")",1)):et("",!0)]),t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:n})]),t("div",Ct,[t("div",kt,[d[3]||(d[3]=t("label",{class:"form-label"},"Reason",-1)),N(t("select",{class:"form-select","onUpdate:modelValue":d[0]||(d[0]=c=>g.value=c)},[d[2]||(d[2]=t("option",{value:""},"Select Reason",-1)),(A(!0),$(q,null,G(a.value,c=>(A(),$("option",{value:c.label,key:c.label},x(c.label),9,xt))),128))],512),[[z,g.value]])]),t("div",Nt,[d[4]||(d[4]=t("label",{class:"form-label"},"Detail Reason",-1)),d[5]||(d[5]=t("p",{class:"text-muted"}," Please enter a detail reason ",-1)),N(t("textarea",{class:"form-control",rows:"10",placeholder:"Detail Reason","onUpdate:modelValue":d[1]||(d[1]=c=>S.value=c)},null,512),[[V,S.value]])])]),t("div",Lt,[t("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:n}," Cancel "),t("div",null,[t("button",{class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:R},x(v.value),1)])])])])]))}}),Dt={class:"modal modal-blur fade",id:"rating-modal",tabindex:"-1",role:"dialog","aria-hidden":"true"},Mt={class:"modal-dialog modal-dialog-centered",role:"document"},Ut={class:"modal-content"},Et={class:"modal-body"},Vt={class:"mb-3"},Bt={class:"rating-stars"},Ft=["onClick"],qt={class:"mb-3"},Pt={class:"mb-3"},Ot={class:"mb-3"},Wt={class:"mb-3"},jt={class:"modal-footer"},zt=["disabled"],Gt=B({__name:"applicationRatingModal",props:{catalogId:{},applicationName:{}},emits:["ratingSubmitted"],setup(k,{emit:C}){const I=k,_=C,m=F(),s=r({rating:0,category:"",detailedComments:"",name:"",email:""}),v=n=>{s.value.rating=n},b=U(()=>s.value.rating>0&&s.value.category&&s.value.detailedComments&&s.value.name&&s.value.email),f=()=>{s.value={rating:0,category:"",detailedComments:"",name:"",email:""}},g=()=>{const n=document.getElementById("rating-modal");if(n)try{if(window.bootstrap&&window.bootstrap.Modal){const a=window.bootstrap.Modal.getInstance(n);a?a.hide():new window.bootstrap.Modal(n).hide()}else n.style.display="none",n.classList.remove("show"),n.setAttribute("aria-hidden","true"),n.removeAttribute("aria-modal"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(l=>l.remove()),document.body.style.overflow="",document.body.style.paddingRight=""}catch(a){console.error("Error closing modal:",a),n.style.display="none",n.classList.remove("show"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(R=>R.remove())}},S=async()=>{if(!b.value){m.error("Please fill in all fields");return}try{const n={catalogId:I.catalogId,rating:s.value.rating,category:s.value.category,detailedComments:s.value.detailedComments,name:s.value.name,email:s.value.email,metadata:JSON.stringify({version:"1.0.0",environment:"production",applicationName:I.applicationName})};await yt(n)&&(m.success("Rating submitted successfully"),f(),_("ratingSubmitted"),g())}catch(n){console.error("Rating submission error:",n),m.error("Failed to submit rating")}};return(n,a)=>(A(),$("div",Dt,[t("div",Mt,[t("div",Ut,[a[11]||(a[11]=t("div",{class:"modal-header"},[t("h5",{class:"modal-title"},"Application Rating"),t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"})],-1)),t("div",Et,[t("form",{onSubmit:at(S,["prevent"])},[t("div",Vt,[a[4]||(a[4]=t("label",{class:"form-label"},"Overall Rating",-1)),t("div",Bt,[(A(),$(q,null,G(5,l=>t("span",{key:l,class:st(["star",{active:l<=s.value.rating}]),onClick:R=>v(l)}," ★ ",10,Ft)),64))])]),t("div",qt,[a[6]||(a[6]=t("label",{class:"form-label"},"Category",-1)),N(t("select",{"onUpdate:modelValue":a[0]||(a[0]=l=>s.value.category=l),class:"form-select",required:""},a[5]||(a[5]=[ot('',6)]),512),[[z,s.value.category]])]),t("div",Pt,[a[7]||(a[7]=t("label",{class:"form-label"},"Detailed Comments",-1)),N(t("textarea",{"onUpdate:modelValue":a[1]||(a[1]=l=>s.value.detailedComments=l),class:"form-control",rows:"4",placeholder:"Enter detailed comments",required:""},null,512),[[V,s.value.detailedComments]])]),t("div",Ot,[a[8]||(a[8]=t("label",{class:"form-label"},"Name",-1)),N(t("input",{"onUpdate:modelValue":a[2]||(a[2]=l=>s.value.name=l),type:"text",class:"form-control",placeholder:"Enter your name",required:""},null,512),[[V,s.value.name]])]),t("div",Wt,[a[9]||(a[9]=t("label",{class:"form-label"},"Email",-1)),N(t("input",{"onUpdate:modelValue":a[3]||(a[3]=l=>s.value.email=l),type:"email",class:"form-control",placeholder:"Enter your email",required:""},null,512),[[V,s.value.email]])])],32)]),t("div",jt,[a[10]||(a[10]=t("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal"},"Cancel",-1)),t("button",{type:"button",class:"btn btn-primary",onClick:S,disabled:!b.value},"Submit",8,zt)])])])]))}}),Kt=St(Gt,[["__scopeId","data-v-6565f21d"]]),Ht={class:"card w-100"},W="application-status-detail-modal",Jt=B({__name:"applicationStatusList",props:{nsId:{default:""}},emits:["refresh-time-updated"],setup(k,{expose:C,emit:I}){const _=F(),m=k,s=I,v=window.self!==window.top;let b=!1,f=0;const g=r([]),S=r([]),n=r(""),a=r(""),l=r(0),R=r(""),w=r(""),d=r(0);r(!1);const c=r(0),p=r(),y=r();nt(async()=>{b=!0,H(),await T()}),it(()=>{f+=1}),lt(()=>m.nsId,async(e,o)=>{var i;e!==o&&(f+=1,g.value=[],l.value=0,c.value=0,R.value="",w.value="",d.value=0,(i=p.value)==null||i.resetData(),b&&await T())});const T=async()=>{const e=++f,o=String(m.nsId||"").trim();try{if(K(),v&&!o){g.value=[];return}const{data:i}=await _t(o||void 0);if(e!==f||o!==String(m.nsId||"").trim())return;i?g.value=i:g.value=[]}catch{if(e!==f)return;_.error("Unable to retrieve data")}},K=()=>{const e=new Date,o={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};n.value=e.toLocaleDateString("ko-KR",o),s("refresh-time-updated",n.value)},H=()=>{S.value=[{title:"Infra",width:230,minWidth:180,formatter:J,cellClick:function(e,o){E(o)}},{title:"Application",field:"applicationName",width:180,minWidth:150,cellClick:function(e,o){E(o)},formatter:function(e){return`
${e.getValue()}
`}},{title:"Status",width:210,minWidth:190,formatter:X,cellClick:function(e,o){E(o)}},{title:"CheckedAt",field:"checkedAt",width:210,minWidth:190,cellClick:function(e,o){E(o)},formatter:function(e){return`
${e.getValue()}
`}},{title:"Action",width:320,minWidth:300,headerSort:!1,formatter:Y,cellClick:async function(e,o){const i=e.target,u=i==null?void 0:i.getAttribute("id"),M=o.getRow().getData().status;if(P(M))return;const O=o.getRow().getData().id,Z=o.getRow().getData().deploymentType,tt=o.getRow().getData().applicationName,h={operation:"",applicationStatusId:O,deploymentType:Z,applicationName:tt};u==="start-btn"?(h.operation="START",await D(h)):u==="restart-btn"?(h.operation="RESTART",await D(h)):u==="stop-btn"?(h.operation="STOP",await D(h)):u==="uninstall-btn"?(h.operation="UNINSTALL",await D(h)):u==="rating-btn"&&(h.operation="RATING",d.value=o.getRow().getData().catalogId||1,await D(h))}}]},D=async e=>{a.value=e.operation,l.value=e.applicationStatusId,R.value=e.deploymentType,w.value=e.applicationName,y.value&&(y.value.setInit(),y.value._getReasonList(e.operation))},E=e=>{const o=e.getRow().getData(),i=o.deploymentHistoryId||o.deploymentId;if(!i)return;c.value=i;const u=document.getElementById(W);if(u)try{window.bootstrap&&window.bootstrap.Modal?(new window.bootstrap.Modal(u).show(),setTimeout(()=>{p.value&&p.value.refreshData(c.value)},100)):(u.style.display="block",u.classList.add("show"),document.body.classList.add("modal-open"),p.value&&p.value.refreshData(c.value))}catch(M){console.error("Error opening detail modal:",M)}},J=e=>{const o=e.getRow().getData(),i=o.deploymentType,u=Q(o);return` +
+

+ ${i} (${u}) +

+
+ `},Q=e=>e.deploymentType==="VM"?[e.namespace,e.mciId,e.vmId].filter(Boolean).join(" / ")||"-":e.deploymentType==="K8S"?[e.namespace,e.clusterName].filter(Boolean).join(" / ")||"-":e.vmId||e.clusterName||"-",P=e=>ct(e),X=e=>{const o=e.getRow().getData().status,i=ut(o);return` +
+ + ${i} + +
`},Y=e=>{const o=e.getRow().getData().status,i=P(o)?"disabled":"",u=String(o||"").trim().toUpperCase();return` +
+ ${u==="STOP"||u==="STOPPED"?` + + `:` + + + `} + + +
`};return C({refresh:T}),(e,o)=>(A(),$(q,null,[t("div",Ht,[L(bt,{columns:S.value,"table-data":g.value},null,8,["columns","table-data"])]),L(Tt,{ref_key:"applicationActionConfirmModalRef",ref:y,title:a.value,applicationStatusId:l.value,type:R.value,applicationName:w.value,onGetApplicationsStatusList:T},null,8,["title","applicationStatusId","type","applicationName"]),L(Kt,{catalogId:d.value,applicationName:w.value,onRatingSubmitted:T},null,8,["catalogId","applicationName"]),L(mt,{ref_key:"applicationDetailModalRef",ref:p,"modal-id":W,deploymentId:c.value},null,8,["deploymentId"])],64))}}),Qt={class:"page"},Xt={class:"page-wrapper"},Yt={class:"page-header d-print-none"},Zt={class:"container-xxl"},te={class:"row g-2 align-items-center"},ee={class:"col-auto ms-auto"},ae={class:"btn-list"},oe={class:"me-2 d-none d-md-inline"},se={class:"page-body"},ne={class:"container-xxl"},ie={class:"row"},le={class:"col-lg-12"},be=B({__name:"ApplicationStatus",setup(k){const C=dt(),I=U(()=>C.getNsId()||""),_=r(""),m=r(null),s=()=>{var v;(v=m.value)==null||v.refresh()};return(v,b)=>(A(),$("div",Qt,[t("div",Xt,[t("div",Yt,[t("div",Zt,[t("div",te,[b[2]||(b[2]=t("div",{class:"col d-flex"},[t("h2",{class:"page-title"},"App Status")],-1)),t("div",ee,[t("div",ae,[t("span",oe,x(_.value),1),t("button",{type:"button",class:"btn btn-outline-primary page-header-action-btn",onClick:s},[L(rt(vt),{class:"icon icon-tabler",size:20,"stroke-width":"1"}),b[1]||(b[1]=j(" Refresh "))])])])])])]),t("div",se,[t("div",ne,[t("div",ie,[t("div",le,[L(Jt,{ref_key:"applicationStatusListRef",ref:m,"ns-id":I.value,onRefreshTimeUpdated:b[0]||(b[0]=f=>_.value=f)},null,8,["ns-id"])])])])])])]))}});export{be as default}; diff --git a/src/main/resources/static/assets/ApplicationStatus-DB1vt_4c.css b/src/main/resources/static/assets/ApplicationStatus-DB1vt_4c.css new file mode 100644 index 0000000..96d35b0 --- /dev/null +++ b/src/main/resources/static/assets/ApplicationStatus-DB1vt_4c.css @@ -0,0 +1 @@ +.rating-stars[data-v-6565f21d]{display:flex;gap:5px;margin-bottom:10px}.star[data-v-6565f21d]{font-size:24px;color:#ddd;cursor:pointer;transition:color .2s}.star[data-v-6565f21d]:hover,.star.active[data-v-6565f21d]{color:#ffc107}.star:hover~.star[data-v-6565f21d]{color:#ddd} diff --git a/src/main/resources/static/assets/IconPlus-CDLv8nZC.js b/src/main/resources/static/assets/IconPlus-CDLv8nZC.js new file mode 100644 index 0000000..7b54eba --- /dev/null +++ b/src/main/resources/static/assets/IconPlus-CDLv8nZC.js @@ -0,0 +1,6 @@ +import{c as e}from"./createVueComponent-DOVlSFKE.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var s=e("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);export{s as I}; diff --git a/src/main/resources/static/assets/InstallSoftwareIframe-DWV8wQFf.css b/src/main/resources/static/assets/InstallSoftwareIframe-DWV8wQFf.css new file mode 100644 index 0000000..9545a76 --- /dev/null +++ b/src/main/resources/static/assets/InstallSoftwareIframe-DWV8wQFf.css @@ -0,0 +1 @@ +.install-page[data-v-5183bd18]{min-height:100vh;padding:24px;background:#f6f8fb}.install-page-header[data-v-5183bd18],.target-summary[data-v-5183bd18]{width:100%;max-width:960px;margin:0 auto 16px}.target-summary[data-v-5183bd18]{display:flex;flex-wrap:wrap;gap:24px;padding:14px 18px;border:1px solid #dce2e9;border-radius:8px;background:#fff}.target-summary>div[data-v-5183bd18]{display:flex;flex-direction:column;gap:2px}.target-label[data-v-5183bd18]{color:#667085;font-size:.75rem;text-transform:uppercase}.alert[data-v-5183bd18]{width:100%;max-width:960px;margin:0 auto 16px}@media (max-width: 640px){.install-page[data-v-5183bd18]{padding:12px}} diff --git a/src/main/resources/static/assets/InstallSoftwareIframe-Dl_2Qi7t.js b/src/main/resources/static/assets/InstallSoftwareIframe-Dl_2Qi7t.js new file mode 100644 index 0000000..5ff3582 --- /dev/null +++ b/src/main/resources/static/assets/InstallSoftwareIframe-Dl_2Qi7t.js @@ -0,0 +1 @@ +import{d as k,q as E,g as m,h as w,i as M,c as i,a,u as o,t as p,F as N,s as A,o as n}from"./index-D89BCYsX.js";import{p as R,A as b}from"./applicationInstallationForm-CeRjQOiG.js";import{_ as C}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./bootstrap.esm-Ceob_0pG.js";import"./lodash-QU4yi6a5.js";import"./request-CuP4O-bn.js";import"./softwareCatalog-CAQVjm80.js";const S={class:"install-page"},x={key:0,class:"alert alert-danger",role:"alert"},L={class:"target-summary","aria-label":"Fixed deployment target"},V={key:0},h={class:"target-label"},G={key:1},F={key:0,class:"alert alert-info",role:"status"},B="MCMP_AM_INSTALL_EVENT",D=k({__name:"InstallSoftwareIframe",setup(O){const l=E(),t=R(window.location.search),g=e=>{const r=String(e??"").trim();return["undefined","null"].includes(r.toLowerCase())?"":r},u=m(()=>g(l.getNsId())),c=m(()=>{var e,r,s,I;return!!(g(l.accessToken)&&g(((e=l.workspaceInfo)==null?void 0:e.id)??((r=l.workspaceInfo)==null?void 0:r.Id))&&g(((s=l.projectInfo)==null?void 0:s.id)??((I=l.projectInfo)==null?void 0:I.Id))&&u.value)}),f=m(()=>!t.ok||t.target.targetType!=="VM"?"":[t.target.mciId,t.target.nodeGroupId,t.target.vmId].filter(Boolean).join(" / ")),v=m(()=>!t.ok||t.target.targetType!=="VM"?"":t.target.vmId?t.target.nodeGroupId?"Infra / NodeGroup / VM":"Infra / VM":"Infra / NodeGroup"),y=()=>{if(!t.ok)return;const e=t.target;return e.targetType==="VM"?{targetType:e.targetType,mciId:e.mciId,...e.nodeGroupId?{nodeGroupId:e.nodeGroupId}:{},...e.vmId?{vmId:e.vmId}:{}}:{targetType:e.targetType,clusterId:e.clusterId}},d=(e,r={})=>{window.parent!==window&&window.parent.postMessage({type:B,version:1,requestId:t.ok?t.target.requestId:"",status:e,target:y(),...r},"*")},_=()=>{d("FORM_READY")},T=e=>{const r=g(e.status);if(!r)return;const s={};e.deploymentId&&(s.deploymentId=e.deploymentId),e.message&&(s.message=e.message),d(r,s)};return w(c,(e,r)=>{e&&!r&&d("CONTEXT_READY")},{immediate:!0}),M(()=>{d("IFRAME_READY"),t.ok||d("CONFIGURATION_ERROR",{message:t.error})}),(e,r)=>(n(),i("main",S,[r[4]||(r[4]=a("header",{class:"install-page-header"},[a("div",null,[a("p",{class:"text-uppercase text-muted small mb-1"},"MC Application Manager"),a("h1",{class:"h2 mb-1"},"Install Software"),a("p",{class:"text-muted mb-0"},"The target is fixed by the calling Workload screen.")])],-1)),o(t).ok?(n(),i(N,{key:1},[a("section",L,[a("div",null,[r[2]||(r[2]=a("span",{class:"target-label"},"Target type",-1)),a("strong",null,p(o(t).target.targetType),1)]),o(t).target.targetType==="VM"?(n(),i("div",V,[a("span",h,p(v.value),1),a("strong",null,p(f.value),1)])):(n(),i("div",G,[r[3]||(r[3]=a("span",{class:"target-label"},"Cluster",-1)),a("strong",null,p(o(t).target.clusterId),1)]))]),c.value?(n(),A(b,{key:1,"form-id":"install-sw-iframe-form",title:"Application Installation","ns-id":u.value,embedded:!0,"target-type":o(t).target.targetType,"target-mci-id":o(t).target.mciId,"target-vm-id":o(t).target.vmId,"target-node-group-id":o(t).target.nodeGroupId,"target-cluster-id":o(t).target.clusterId,onReady:_,onDeploymentEvent:T,onCancel:r[0]||(r[0]=s=>d("CANCELLED"))},null,8,["ns-id","target-type","target-mci-id","target-vm-id","target-node-group-id","target-cluster-id"])):(n(),i("div",F," Waiting for Workspace and Project context from MC-WEB-CONSOLE… "))],64)):(n(),i("div",x,[r[1]||(r[1]=a("strong",null,"Invalid installation request.",-1)),a("div",null,p(o(t).error),1)]))]))}}),X=C(D,[["__scopeId","data-v-5183bd18"]]);export{X as default}; diff --git a/src/main/resources/static/assets/OssList-L1_lVc8d.js b/src/main/resources/static/assets/OssList-L1_lVc8d.js new file mode 100644 index 0000000..6634eb8 --- /dev/null +++ b/src/main/resources/static/assets/OssList-L1_lVc8d.js @@ -0,0 +1,17 @@ +import{d as T,o as u,c as m,a as s,t as k,w as P,b as O,u as $,e as L,r as p,f as D,g as G,h as F,i as B,j as h,v as H,F as W,k as J,l as x}from"./index-D89BCYsX.js";import{I as E}from"./IconPlus-CDLv8nZC.js";import{_ as K}from"./Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js";import{s as f}from"./request-CuP4O-bn.js";import{M as Q}from"./bootstrap.esm-Ceob_0pG.js";import"./createVueComponent-DOVlSFKE.js";const X={class:"page-header page-wrapper"},Y={class:"row align-items-center"},Z={class:"card-header d-flex",style:{"justify-content":"space-between"}},ss={class:"card-title"},es={class:"btn-list"},ts=["data-bs-target"],os=T({__name:"TableHeader",props:{headerTitle:{},newBtnTitle:{},popupFlag:{type:Boolean},popupTarget:{}},emits:["click-new-btn"],setup(l,{emit:w}){const i=l,c=w,o=()=>{c("click-new-btn")};return(n,g)=>(u(),m("div",X,[s("div",Y,[s("div",Z,[s("h3",ss,[s("strong",null,k(i.headerTitle),1)]),s("div",es,[i.popupFlag?(u(),m("a",{key:1,class:"btn btn-outline-primary d-none d-sm-inline-block","data-bs-toggle":"modal","data-bs-target":i.popupTarget,onClick:P(o,["prevent","stop"])},[O($(E),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),L(" "+k(i.newBtnTitle),1)],8,ts)):(u(),m("a",{key:0,class:"btn btn-outline-primary d-none d-sm-inline-block",onClick:P(o,["prevent","stop"])},[O($(E),{class:"icon icon-tabler icon-tabler-plus",size:20,"stroke-width":"1"}),L(" "+k(i.newBtnTitle),1)]))])])])]))}}),as=()=>f.get("/ossType/list"),ls=()=>f.get("/ossType/filter/list"),ns=()=>f.get("/oss/list");function rs(l){return f.get(`/oss/duplicate?ossName=${l.ossName}&ossUrl=${l.ossUrl}&ossUsername=${l.ossUsername}`)}function is(l){return f.post("/oss/connection-check",l)}function ds(l){return f.get("/oss/"+l)}function cs(l){return f.post("/oss",l)}function us(l){return f.patch(`/oss/${l.ossIdx}`,l)}function ms(l){return f.delete(`/oss/${l}`)}const ps={class:"modal-dialog modal-xl",role:"document"},vs={class:"modal-content"},bs={class:"modal-body text-left py-4"},fs={class:"mb-5"},gs={class:"mb-3"},ys={class:"grid gap-0 column-gap-3"},ws=["value"],Ss={class:"row mb-3"},_s={class:"grid gap-0 column-gap-3"},ks={class:"mb-3"},hs={class:"mb-3"},Os={class:"row"},Cs={class:"col"},xs={class:"col"},Ts={class:"col mt-4 row"},Us={key:1,class:"btn btn-success col",style:{"margin-right":"3px"}},Is={key:3,class:"btn btn-success col"},Ds={class:"modal-footer"},Ns=T({__name:"ossForm",props:{mode:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:w}){const i=p(),c=p(),o=D(),n=l,g=w,d=G(()=>n.ossIdx);F(d,async()=>{await y()}),F(()=>n.mode,async()=>{await b(n.mode)}),B(async()=>{i.value&&(c.value=new Q(i.value)),await b("init"),await y()});const t=p({}),y=async()=>{if(n.mode==="new")t.value.ossTypeIdx=0,t.value.ossName="",t.value.ossDesc="",t.value.ossUrl="",t.value.ossUsername="",t.value.ossPassword="",v.value=!1,_.value=!1;else{const{data:a}=await ds(n.ossIdx);t.value=a,t.value.ossPassword=j(t.value.ossPassword),v.value=!0,_.value=!0}},C=p([]),b=async a=>{try{if(a==="new"||a==="init"){const{data:e}=await ls();C.value=e}else{const{data:e}=await as();C.value=e}}catch(e){console.log(e)}},S=()=>{t.value.ossPassword="",_.value=!1},v=p(!1),U=async()=>{const a={ossName:t.value.ossName,ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername},{data:e}=await rs(a);e?o.error("The name is already in use."):(o.success("The name is available."),v.value=!0)},_=p(!1),R=async()=>{const a={ossUrl:t.value.ossUrl,ossUsername:t.value.ossUsername,ossPassword:N(t.value.ossPassword),ossTypeIdx:t.value.ossTypeIdx},{data:e}=await is(a);e?(o.success("The OSS is available."),_.value=!0):o.error("The OSS is unavailable.")},V=()=>{v.value=!1},I=()=>{_.value=!1},A=async()=>{if(!t.value.ossTypeIdx||t.value.ossTypeIdx===0){o.error("Please select OSS Type.");return}if(!t.value.ossName){o.error("Please enter OSS Name.");return}if(!t.value.ossDesc){o.error("Please enter OSS Description.");return}if(!t.value.ossUrl){o.error("Please enter URL.");return}if(!t.value.ossUsername){o.error("Please enter OSS ID.");return}if(!t.value.ossPassword){o.error("Please enter OSS Password.");return}if(!v.value){o.error("Please perform duplicate check.");return}if(!_.value){o.error("Please perform connection check.");return}t.value.ossPassword=N(t.value.ossPassword);let a=!1;n.mode==="new"?a=await q():a=await M(),a&&(g("get-oss-list"),y(),console.log(c.value),c.value&&(c.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const e=document.querySelector(".modal-backdrop");e==null||e.remove()},150)))},q=async()=>{try{const{data:a}=await cs(t.value);return a?(o.success("Regist SUCCESS."),!0):(o.error("Regist FAIL."),!1)}catch{return o.error("Regist FAIL."),!1}},M=async()=>{try{const{data:a}=await us(t.value);return a?(o.success("Update SUCCESS."),!0):(o.error("Update FAIL."),!1)}catch{return o.error("Update FAIL."),!1}},N=a=>btoa(a),j=a=>atob(a);return(a,e)=>(u(),m("div",{class:"modal fade",id:"ossForm",tabindex:"-1",ref_key:"modalElement",ref:i},[s("div",ps,[s("div",vs,[e[15]||(e[15]=s("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),s("div",bs,[s("h3",fs,k(n.mode==="new"?"New":"Edit")+" OSS ",1),s("div",null,[s("div",gs,[e[9]||(e[9]=s("label",{class:"form-label required"},"OSS Type",-1)),s("div",ys,[h(s("select",{"onUpdate:modelValue":e[0]||(e[0]=r=>t.value.ossTypeIdx=r),class:"form-select p-2 g-col-12"},[e[8]||(e[8]=s("option",{value:0},"Select OSS Type",-1)),(u(!0),m(W,null,J(C.value,(r,z)=>(u(),m("option",{value:r.ossTypeIdx,key:z},k(r.ossTypeName),9,ws))),128))],512),[[H,t.value.ossTypeIdx]])])]),s("div",Ss,[e[10]||(e[10]=s("label",{class:"form-label required"},"OSS Name",-1)),s("div",_s,[h(s("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Name","onUpdate:modelValue":e[1]||(e[1]=r=>t.value.ossName=r),onChange:V},null,544),[[x,t.value.ossName]])])]),s("div",ks,[e[11]||(e[11]=s("label",{class:"form-label required"},"OSS Description",-1)),h(s("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Description","onUpdate:modelValue":e[2]||(e[2]=r=>t.value.ossDesc=r)},null,512),[[x,t.value.ossDesc]])]),s("div",hs,[e[12]||(e[12]=s("label",{class:"form-label required"},"URL",-1)),h(s("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the Server URL","onUpdate:modelValue":e[3]||(e[3]=r=>t.value.ossUrl=r),onFocus:I},null,544),[[x,t.value.ossUrl]])]),s("div",Os,[s("div",Cs,[e[13]||(e[13]=s("label",{class:"form-label required"},"OSS ID",-1)),h(s("input",{type:"text",class:"form-control p-2 g-col-7",placeholder:"Enter the OSS ID","onUpdate:modelValue":e[4]||(e[4]=r=>t.value.ossUsername=r),onFocus:I},null,544),[[x,t.value.ossUsername]])]),s("div",xs,[e[14]||(e[14]=s("label",{class:"form-label required"},"OSS PW",-1)),h(s("input",{type:"password",class:"form-control p-2 g-col-11",placeholder:"Enter the OSS Password","onUpdate:modelValue":e[5]||(e[5]=r=>t.value.ossPassword=r),onClick:S,onFocus:I},null,544),[[x,t.value.ossPassword]])]),s("div",Ts,[v.value?(u(),m("button",Us,"Duplicate Check")):(u(),m("button",{key:0,class:"btn btn-primary col",onClick:U,style:{"margin-right":"3px"}},"Duplicate Check")),_.value?(u(),m("button",Is,"Connection Check")):(u(),m("button",{key:2,class:"btn btn-primary col",onClick:R},"Connection Check"))])])])]),s("div",Ds,[s("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:e[6]||(e[6]=r=>y())}," Cancel "),s("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:e[7]||(e[7]=r=>A())},k(n.mode==="new"?"Regist":"Edit"),513)])])])],512))}}),Ps={class:"modal fade",id:"deleteOss",tabindex:"-1"},$s={class:"modal-dialog modal-lg",role:"document"},Ls={class:"modal-content"},Fs={class:"modal-body text-left py-4"},Es={class:"modal-footer"},Bs=T({__name:"deleteOss",props:{ossName:{},ossIdx:{}},emits:["get-oss-list"],setup(l,{emit:w}){const i=D(),c=l,o=w,n=async()=>{const{data:g}=await ms(c.ossIdx);g?i.success("Deleted successfully."):i.error("Failed to delete."),o("get-oss-list")};return(g,d)=>(u(),m("div",Ps,[s("div",$s,[s("div",Ls,[d[3]||(d[3]=s("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),d[4]||(d[4]=s("div",{class:"modal-status bg-danger"},null,-1)),s("div",Fs,[d[1]||(d[1]=s("h3",{class:"mb-5"}," Delete OSS ",-1)),s("h4",null,"Are you sure you want to delete "+k(c.ossName)+"?",1)]),s("div",Es,[d[2]||(d[2]=s("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),s("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:d[0]||(d[0]=t=>n())}," Delete ")])])])]))}}),Rs={class:"card card-flush w-100"},Vs={ref:"table-responsive"},Hs=T({__name:"OssList",setup(l){const w=D(),i=p([]),c=p([]);B(async()=>{d(),await o()});const o=async()=>{try{const{data:b}=await ns();i.value=b}catch(b){console.log(b),w.error("데이터를 가져올 수 없습니다.")}},n=p(0),g=p(""),d=()=>{c.value=[{title:"OSS Name",field:"ossName",width:400},{title:"OSS Desc",field:"ossDesc",width:500},{title:"URL",field:"ossUrl",width:600},{title:"Action",width:400,formatter:t,cellClick:function(b,S){const v=b.target,U=v==null?void 0:v.getAttribute("id");n.value=S.getRow().getData().ossIdx,U==="edit-btn"?y.value="edit":g.value=S.getRow().getData().ossName}}]},t=()=>` +
+ + +
`,y=p("new"),C=()=>{n.value=0,y.value="new"};return(b,S)=>(u(),m("div",Rs,[O(os,{"header-title":"OSS","new-btn-title":"New OSS","popup-flag":!0,"popup-target":"#ossForm",onClickNewBtn:C}),O(K,{columns:c.value,"table-data":i.value},null,8,["columns","table-data"]),s("div",Vs,S[0]||(S[0]=[s("div",{class:"table table-vcenter table-bordered table-nowrap card-table"},null,-1)]),512),O(Ns,{mode:y.value,"oss-idx":n.value,onGetOssList:o},null,8,["mode","oss-idx"]),O(Bs,{"oss-name":g.value,"oss-idx":n.value,onGetOssList:o},null,8,["oss-name","oss-idx"])]))}});export{Hs as default}; diff --git a/src/main/resources/static/assets/RepositoryDetail-DCPVJP7B.js b/src/main/resources/static/assets/RepositoryDetail-DCPVJP7B.js new file mode 100644 index 0000000..f4364f0 --- /dev/null +++ b/src/main/resources/static/assets/RepositoryDetail-DCPVJP7B.js @@ -0,0 +1,15 @@ +import{d as C,f as D,c as $,a as t,t as B,o as N,i as x,r as u,j as y,l as w,E as I,J as L,h as A,b as _}from"./index-D89BCYsX.js";import{b as S,c as z,g as E,e as P}from"./repository-CPO7R4t0.js";import{_ as q}from"./lodash-QU4yi6a5.js";import{_ as T}from"./Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js";import"./request-CuP4O-bn.js";const G={class:"modal fade",id:"deleteComponent",tabindex:"-1"},M={class:"modal-dialog modal-lg",role:"document"},j={class:"modal-content"},J={class:"modal-body text-left py-4"},K={class:"modal-footer"},H=C({__name:"deleteComponent",props:{componentName:{},componentId:{}},emits:["get-detail"],setup(b,{emit:f}){const d=D(),r=b,i=f,m=async()=>{const{data:l}=await S("nexus",r.componentId);l?d.success("Deleted successfully."):d.error("Failed to delete."),i("get-detail")};return(l,a)=>(N(),$("div",G,[t("div",M,[t("div",j,[a[3]||(a[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),a[4]||(a[4]=t("div",{class:"modal-status bg-danger"},null,-1)),t("div",J,[a[1]||(a[1]=t("h3",{class:"mb-5"}," Delete Component ",-1)),t("h4",null,"Are you sure you want to delete "+B(r.componentName)+"?",1)]),t("div",K,[a[2]||(a[2]=t("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),t("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:a[0]||(a[0]=v=>m())}," Delete ")])])])]))}}),O={class:"modal fade",id:"uploadComponent",tabindex:"-1"},Q={class:"modal-dialog modal-lg",role:"document"},W={class:"modal-content"},X={class:"modal-body text-left py-4"},Y={class:"mb-3"},Z=["value"],tt={class:"mb-3"},et=["disabled"],ot={class:"mb-3"},st={class:"grid gap-0 column-gap-3"},lt={class:"modal-footer"},at=C({__name:"uploadComponent",props:{repositoryName:{},format:{}},emits:["get-detail"],setup(b,{emit:f}){const d=D(),r=b,i=f;x(()=>{p()});const m=u("/"),l=u([]),a=c=>{l.value=c.target.files[0]},v=async()=>{if(r.format=="raw"&&q.isEmpty(m.value)){d.error("Please enter the path.");return}if(l.value.length==0){d.error("No file selected.");return}const c=new FormData;c.append("assets",l.value),c.append("directory",m.value);const{data:s}=await z("nexus",r.repositoryName,c);s?d.success("Uploaded successfully."):d.error("Failed to upload."),i("get-detail")},p=()=>{m.value="/",l.value=[]};return(c,s)=>(N(),$("div",O,[t("div",Q,[t("div",W,[s[7]||(s[7]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),t("div",X,[s[5]||(s[5]=t("h3",{class:"mb-5"}," File Upload ",-1)),t("div",null,[t("div",Y,[s[2]||(s[2]=t("label",{class:"form-label"},"Name",-1)),t("input",{type:"text",class:"form-control p-2 g-col-11",value:r.repositoryName,readonly:""},null,8,Z)]),t("div",tt,[s[3]||(s[3]=t("label",{class:"form-label"},"Path",-1)),y(t("input",{type:"text",class:"form-control p-2 g-col-11","onUpdate:modelValue":s[0]||(s[0]=g=>m.value=g),disabled:r.format!="raw"},null,8,et),[[w,m.value]])]),t("div",ot,[s[4]||(s[4]=t("label",{class:"form-label required"},"File",-1)),t("div",st,[t("input",{type:"file",class:"form-control p-2 g-col-11",onChange:a},null,32)])])])]),t("div",lt,[s[6]||(s[6]=t("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),t("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:s[1]||(s[1]=g=>v())}," Upload ")])])])]))}}),nt={class:"card w-100",ref:"workflowForm"},it={class:"card-body"},dt={class:"card-title"},rt={class:"mb-3"},mt={class:"grid gap-0 column-gap-3"},ct={class:"mb-3"},ut={class:"grid gap-0 column-gap-3"},pt={class:"mb-3"},bt={class:"grid gap-0 column-gap-3"},ft={class:"mb-3"},vt={class:"grid gap-0 column-gap-3"},gt={class:"mb-3"},$t=C({__name:"RepositoryDetail",props:{embedded:{type:Boolean},repositoryName:{}},emits:["back-to-list"],setup(b,{emit:f}){D();const d=I(),r=L(),i=b,m=f,l=u({}),a=u([]),v=u([]);x(async()=>{h(),i.embedded||await p()});const p=async n=>{const e=d.params.repositoryName,o=n??(i.embedded?i.repositoryName:e);if(!o)return;const{data:k}=await E("nexus",o);l.value=k,await c()};A(()=>i.repositoryName,async n=>{i.embedded&&n&&await p(n)},{immediate:!0});const c=async()=>{const{data:n}=await P("nexus",l.value.name);a.value=n},s=u(""),g=u(""),h=()=>{v.value=[{title:"Name",field:"name",width:"15%"},{title:"URL(Path)",field:"assets",width:"50%",formatter:function(n){const e=n.getValue();return e&&e.length>0?e[0].downloadUrl:"N/A"}},{title:"Size",field:"assets",width:"15%",formatter:function(n){const e=n.getValue();return e&&e.length>0?`${(e[0].fileSize/1024).toFixed(2)} KB`:"N/A"}},{title:"Action",width:"20%",formatter:U,cellClick:function(n,e){const o=n.target;if((o==null?void 0:o.getAttribute("id"))==="download-btn"){console.log("download");let V=e.getRow().getData();F(V)}else s.value=e.getRow().getData().id,g.value=e.getRow().getData().name}}]},U=()=>` +
+ + +
`,F=n=>{const e=n.assets[0].downloadUrl,o=document.createElement("a");o.href=e,o.download="",document.body.appendChild(o),o.click(),document.body.removeChild(o)},R=()=>{i.embedded?m("back-to-list"):r.push({name:"repositoryList"})};return(n,e)=>(N(),$("div",nt,[e[9]||(e[9]=t("div",{class:"card-header"},[t("div",{class:"card-title"},[t("h1",null,"Repository Detail")])],-1)),t("div",it,[t("div",dt,[t("div",rt,[e[4]||(e[4]=t("label",{class:"form-label"},"Name",-1)),t("div",mt,[y(t("input",{type:"text",ref:"repositoryName",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[0]||(e[0]=o=>l.value.name=o),disabled:""},null,512),[[w,l.value.name]])])]),t("div",ct,[e[5]||(e[5]=t("label",{class:"form-label"},"Format",-1)),t("div",ut,[y(t("input",{type:"text",ref:"repositoryFormat",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[1]||(e[1]=o=>l.value.format=o),disabled:""},null,512),[[w,l.value.format]])])]),t("div",pt,[e[6]||(e[6]=t("label",{class:"form-label required"},"URL(Path)",-1)),t("div",bt,[y(t("input",{type:"text",ref:"repositoryFormat",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[2]||(e[2]=o=>l.value.url=o),disabled:""},null,512),[[w,l.value.url]])])]),t("div",ft,[e[7]||(e[7]=t("label",{class:"form-label required"},"Type(hosted)",-1)),t("div",vt,[y(t("input",{type:"text",ref:"repositoryFormat",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[3]||(e[3]=o=>l.value.type=o),disabled:""},null,512),[[w,l.value.type]])])]),t("div",gt,[_(T,{columns:v.value,"table-data":a.value},null,8,["columns","table-data"])]),t("div",{class:"row align-items-center"},[e[8]||(e[8]=t("div",{id:"gap",class:"col"},null,-1)),t("div",{class:"col-auto ms-auto"},[t("div",{class:"btn-list"},[t("button",{class:"btn btn-outline-primary",onClick:R}," Back to List ")])])])]),_(H,{"component-name":g.value,"component-id":s.value,onGetDetail:p},null,8,["component-name","component-id"]),_(at,{"repository-name":l.value.name,format:l.value.format,onGetDetail:p},null,8,["repository-name","format"])])],512))}});export{$t as default}; diff --git a/src/main/resources/static/assets/RepositoryList-e6fBx0-3.js b/src/main/resources/static/assets/RepositoryList-e6fBx0-3.js new file mode 100644 index 0000000..ad97777 --- /dev/null +++ b/src/main/resources/static/assets/RepositoryList-e6fBx0-3.js @@ -0,0 +1,17 @@ +import{_ as $}from"./Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js";import{g as P,r as V,u as B,d as L,a as M}from"./repository-CPO7R4t0.js";import{d as C,f as D,r as p,g as q,h as A,i as N,c as x,a as t,t as _,j as c,l as E,z as y,o as F,b as R,I as T}from"./index-D89BCYsX.js";import{M as I}from"./bootstrap.esm-Ceob_0pG.js";import"./request-CuP4O-bn.js";const S={class:"modal-dialog modal-lg",role:"document"},G={class:"modal-content"},O={class:"modal-header"},j={class:"modal-title"},z={class:"modal-body py-4"},H={class:"row mb-3"},J=["disabled"],K={class:"mb-3"},Q={class:"form-check form-check-inline"},W=["disabled"],X={class:"form-check form-check-inline"},Y=["disabled"],Z={class:"mb-3"},ee={class:"form-check form-check-inline"},te={class:"form-check form-check-inline"},oe={class:"form-check form-check-inline"},le={class:"mb-3"},se={class:"form-check form-check-inline"},ae={class:"form-check form-check-inline"},ne={class:"modal-footer"},ie=C({__name:"repositoryForm",props:{mode:{},repositoryName:{}},emits:["get-repository-list"],setup(v,{emit:b}){const s=D(),m=p(),f=p(),r=v,u=b,a=q(()=>r.repositoryName);A(a,async()=>{await d()}),N(async()=>{m.value&&(f.value=new I(m.value)),await d()});const o=p({}),n=p(""),d=async()=>{if(r.mode==="new")o.value.name="",o.value.format="helm",o.value.type="hosted",o.value.url="",o.value.online=!0,n.value="allow";else{const{data:i}=await P("nexus",r.repositoryName);o.value=i,n.value=i.storage.writePolicy}},w=async()=>{if(!o.value.name||o.value.name.trim()===""){s.error("Please enter repository name.");return}if(!o.value.format){s.error("Please select format.");return}if(!n.value){s.error("Please select allow policy.");return}if(o.value.online===void 0||o.value.online===null){s.error("Please select online/offline status.");return}if(o.value.storage={blobStoreName:"default",strictContentTypeValidation:!0,writePolicy:n.value},o.value.format!="docker")o.value.docker={};else{const e={v1Enabled:!1,forceBasicAuth:!0};o.value.docker=e}let i=!1;r.mode==="new"?i=await g():i=await k(),i&&(u("get-repository-list"),d(),f.value&&(f.value.hide(),setTimeout(()=>{document.body.classList.remove("modal-open");const e=document.querySelector(".modal-backdrop");e==null||e.remove()},150)))},g=async()=>{try{const{data:i}=await V("nexus",o.value);return i?(s.success("Repository created successfully."),!0):(s.error("Failed to create repository."),!1)}catch{return s.error("Failed to create repository."),!1}},k=async()=>{try{const{data:i}=await B("nexus",o.value);return i?(s.success("Repository updated successfully."),!0):(s.error("Failed to update repository."),!1)}catch{return s.error("Failed to update repository."),!1}};return(i,e)=>(F(),x("div",{class:"modal fade",id:"repositoryForm",tabindex:"-1",ref_key:"modalElement",ref:m},[t("div",S,[t("div",G,[t("div",O,[t("h3",j,"Repository "+_(r.mode==="new"?"Create":"Update"),1),e[10]||(e[10]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",z,[t("div",null,[t("div",H,[e[11]||(e[11]=t("label",{class:"form-label required"},"Name",-1)),c(t("input",{type:"text",class:"form-control p-2 g-col-11","onUpdate:modelValue":e[0]||(e[0]=l=>o.value.name=l),disabled:r.mode!="new",placeholder:"Enter repository name"},null,8,J),[[E,o.value.name]])]),t("div",K,[e[14]||(e[14]=t("label",{class:"form-label required"},"Format",-1)),t("div",null,[t("label",Q,[c(t("input",{class:"form-check-input",type:"radio",name:"format",value:"helm","onUpdate:modelValue":e[1]||(e[1]=l=>o.value.format=l),disabled:r.mode!="new"},null,8,W),[[y,o.value.format]]),e[12]||(e[12]=t("span",{class:"form-check-label"},"helm",-1))]),t("label",X,[c(t("input",{class:"form-check-input",type:"radio",name:"format",value:"docker","onUpdate:modelValue":e[2]||(e[2]=l=>o.value.format=l),disabled:r.mode!="new"},null,8,Y),[[y,o.value.format]]),e[13]||(e[13]=t("span",{class:"form-check-label"},"docker",-1))])])]),t("div",Z,[e[18]||(e[18]=t("label",{class:"form-label required"},"Allow",-1)),t("div",null,[t("label",ee,[c(t("input",{class:"form-check-input",type:"radio",name:"allow",value:"allow","onUpdate:modelValue":e[3]||(e[3]=l=>n.value=l)},null,512),[[y,n.value]]),e[15]||(e[15]=t("span",{class:"form-check-label"},"allow",-1))]),t("label",te,[c(t("input",{class:"form-check-input",type:"radio",name:"allow",value:"allow_once","onUpdate:modelValue":e[4]||(e[4]=l=>n.value=l)},null,512),[[y,n.value]]),e[16]||(e[16]=t("span",{class:"form-check-label"},"allow_once",-1))]),t("label",oe,[c(t("input",{class:"form-check-input",type:"radio",name:"allow",value:"deny","onUpdate:modelValue":e[5]||(e[5]=l=>n.value=l)},null,512),[[y,n.value]]),e[17]||(e[17]=t("span",{class:"form-check-label"},"deny",-1))])])]),t("div",le,[e[21]||(e[21]=t("label",{class:"form-label required"},"On/Offline",-1)),t("div",null,[t("label",se,[c(t("input",{class:"form-check-input",type:"radio",name:"online",value:"true","onUpdate:modelValue":e[6]||(e[6]=l=>o.value.online=l)},null,512),[[y,o.value.online]]),e[19]||(e[19]=t("span",{class:"form-check-label"},"true",-1))]),t("label",ae,[c(t("input",{class:"form-check-input",type:"radio",name:"online",value:"false","onUpdate:modelValue":e[7]||(e[7]=l=>o.value.online=l)},null,512),[[y,o.value.online]]),e[20]||(e[20]=t("span",{class:"form-check-label"},"false",-1))])])])])]),t("div",ne,[t("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:e[8]||(e[8]=l=>d())}," Cancel "),t("button",{type:"button",ref:"submitBtn",class:"btn btn-primary ms-auto",onClick:e[9]||(e[9]=l=>w())},_(r.mode==="new"?"Create":"Update"),513)])])])],512))}}),re={class:"modal fade",id:"deleteRepository",tabindex:"-1"},de={class:"modal-dialog modal-lg",role:"document"},ue={class:"modal-content"},me={class:"modal-body text-left py-4"},ce={class:"modal-footer"},pe=C({__name:"deleteRepository",props:{repositoryName:{}},emits:["get-repository-list"],setup(v,{emit:b}){const s=D(),m=v,f=b,r=async()=>{const{data:u}=await L("nexus",m.repositoryName);u?s.success("Deleted successfully."):s.error("Failed to delete."),f("get-repository-list")};return(u,a)=>(F(),x("div",re,[t("div",de,[t("div",ue,[a[3]||(a[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),a[4]||(a[4]=t("div",{class:"modal-status bg-danger"},null,-1)),t("div",me,[a[1]||(a[1]=t("h3",{class:"mb-5"}," Delete Repository ",-1)),t("h4",null,"Are you sure you want to delete "+_(m.repositoryName)+"?",1)]),t("div",ce,[a[2]||(a[2]=t("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1)),t("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:a[0]||(a[0]=o=>r())}," Delete ")])])])]))}}),fe={class:"card w-100"},ge=C({__name:"RepositoryList",props:{embedded:{type:Boolean}},emits:["open-detail"],setup(v,{expose:b,emit:s}){const m=D(),f=v,r=s,u=e=>{if(d.value=e,f.embedded){r("open-detail",e);return}T.push({name:"repositoryDetail",params:{repositoryName:e}})},a=p([]),o=p([]);N(async()=>{w(),await n()});const n=async()=>{try{const{data:e}=await M("nexus");a.value=e}catch(e){console.log(e),m.error("Unable to fetch data.")}},d=p(""),w=()=>{o.value=[{title:"Name",field:"name",width:"15%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"Format",field:"format",width:"10%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"URL",field:"url",width:"40%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"Type(hosted)",field:"type",width:"15%",cellClick:function(e,l){e.stopPropagation(),u(l.getRow().getData().name)}},{title:"Action",width:"20%",formatter:g,cellClick:function(e,l){const h=e.target,U=h==null?void 0:h.getAttribute("id");d.value=l.getRow().getData().name,U==="edit-btn"?k.value="edit":d.value=l.getRow().getData().name}}]},g=()=>` +
+ + +
`,k=p("new");return b({startCreate:()=>{d.value="",k.value="new"}}),(e,l)=>(F(),x("div",fe,[R($,{columns:o.value,"table-data":a.value},null,8,["columns","table-data"]),R(ie,{mode:k.value,"repository-name":d.value,onGetRepositoryList:n},null,8,["mode","repository-name"]),R(pe,{"repository-name":d.value,onGetRepositoryList:n},null,8,["repository-name"])]))}});export{ge as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalog-KiPa5CHK.css b/src/main/resources/static/assets/SoftwareCatalog-KiPa5CHK.css new file mode 100644 index 0000000..fbded27 --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalog-KiPa5CHK.css @@ -0,0 +1 @@ +@import"https://rsms.me/inter/inter.css";.nav-link[data-v-b5a9b02f]{cursor:default}.source-option[data-v-b5a9b02f]{display:flex;align-items:flex-start;gap:.75rem;min-height:92px;padding:1rem;border:1px solid var(--tblr-border-color);border-radius:var(--tblr-border-radius);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.source-option.selected[data-v-b5a9b02f]{border-color:var(--tblr-primary);box-shadow:0 0 0 1px var(--tblr-primary)}.source-option small[data-v-b5a9b02f]{display:block;margin-top:.25rem;color:var(--tblr-secondary-color)}.registry-results[data-v-b5a9b02f]{max-height:280px;overflow-y:auto}.registry-logo[data-v-b5a9b02f]{flex:0 0 auto;object-fit:contain;background:#fff}.registry-description[data-v-b5a9b02f],.registry-results .list-group-item.active .registry-description[data-v-b5a9b02f]{color:var(--tblr-secondary-color)!important}.mouse-hover{opacity:0;transition:opacity .15s ease-in-out}.list-group-item:hover .mouse-hover{opacity:1}.catalog-icon,.catalog-icon-fallback{width:40px;height:40px;object-fit:contain}.catalog-icon-fallback{color:#667085;background-color:#f1f5f9;border:1px solid #dbe3ea}:root{--tblr-font-sans-serif: "Inter Var", -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif}body{font-feature-settings:"cv03","cv04","cv11"}.btn-grid-list{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;grid-row-gap:10px} diff --git a/src/main/resources/static/assets/SoftwareCatalog-qoXeieRx.js b/src/main/resources/static/assets/SoftwareCatalog-qoXeieRx.js new file mode 100644 index 0000000..a34aba0 --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalog-qoXeieRx.js @@ -0,0 +1,21 @@ +import{A as ta}from"./applicationInstallationForm-CeRjQOiG.js";import{d as Ie,f as Ue,r as v,i as Le,x as Be,g as q,h as he,o as d,c as u,a as e,t as g,n as oe,j as b,y as ke,z as Ce,m as L,F as E,k as G,v as re,e as ve,w as we,l as M,p as oa,A as sa,B as $e,b as z,u as te,C as na,q as ia}from"./index-D89BCYsX.js";import{c as Se}from"./createVueComponent-DOVlSFKE.js";import{g as Ke,I as ra,a as da,b as ua,A as ca}from"./applicationDetailModal-B5NPsj3q.js";import{g as De,s as va,a as ma,b as pa,c as ga,d as fa,u as ba,e as ya,f as _a,h as ha,i as ka,j as Ca,k as Fe,l as wa,m as Ia}from"./softwareCatalog-CAQVjm80.js";import{_ as Sa}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as Aa}from"./lodash-QU4yi6a5.js";import{M as Ta}from"./bootstrap.esm-Ceob_0pG.js";import"./request-CuP4O-bn.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Ma=Se("outline","cloud-download","IconCloudDownload",[["path",{d:"M19 18a3.5 3.5 0 0 0 0 -7h-1a5 4.5 0 0 0 -11 -2a4.6 4.4 0 0 0 -2.1 8.4",key:"svg-0"}],["path",{d:"M12 13l0 9",key:"svg-1"}],["path",{d:"M9 19l3 3l3 -3",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Ea=Se("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Na=Se("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Ra=Se("filled","star-filled","IconStarFilled",[["path",{d:"M8.243 7.34l-6.38 .925l-.113 .023a1 1 0 0 0 -.44 1.684l4.622 4.499l-1.09 6.355l-.013 .11a1 1 0 0 0 1.464 .944l5.706 -3l5.693 3l.1 .046a1 1 0 0 0 1.352 -1.1l-1.091 -6.355l4.624 -4.5l.078 -.085a1 1 0 0 0 -.633 -1.62l-6.38 -.926l-2.852 -5.78a1 1 0 0 0 -1.794 0l-2.853 5.78z",key:"svg-0"}]]);const Da={class:"modal-dialog modal-lg",role:"document"},$a={class:"modal-content"},Ua={class:"modal-header"},La={class:"modal-title"},xa=["disabled"],Pa={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},Va={class:"nav nav-tabs mb-3"},Ga={class:"nav-item"},Oa={class:"nav-item"},Ha={class:"nav-item"},Ba={class:"nav-item"},Ka={key:0,class:"mb-4"},Fa={class:"row g-3"},za={class:"col-md-6"},ja=["disabled"],qa={class:"col-md-6"},Ya=["disabled"],Wa={class:"mb-3"},Ja={class:"d-flex align-items-center"},Za={class:"form-check me-3"},Qa=["disabled"],Xa={class:"form-check"},el=["disabled"],al={class:"mb-3"},ll=["disabled"],tl=["value"],ol={class:"row g-3"},sl={class:"col-md-6"},nl=["disabled"],il=["value"],rl={class:"col-md-6"},dl=["disabled"],ul=["value"],cl={class:"alert alert-info py-2 mb-3",role:"status"},vl={class:"form-label required",for:"registrySearchInput"},ml={class:"input-group"},pl=["placeholder","disabled"],gl=["disabled"],fl={key:0,class:"text-danger small mt-2"},bl={key:0,class:"text-center text-muted py-4"},yl={key:1,class:"text-muted py-3"},_l={key:2,class:"registry-results list-group mb-3"},hl=["disabled","onClick"],kl={class:"d-flex align-items-start gap-3"},Cl=["src"],wl={class:"flex-fill text-start"},Il={class:"fw-semibold"},Sl={class:"small registry-description"},Al={key:3,class:"row g-3"},Tl={class:"col-md-6"},Ml=["disabled"],El={value:""},Nl=["value"],Rl={class:"col-md-6"},Dl=["disabled"],$l=["value"],Ul={class:"mb-3"},Ll={class:"mb-3"},xl={class:"mb-3"},Pl={class:"mb-3"},Vl={class:"col-5"},Gl=["onUpdate:modelValue"],Ol={class:"col-6"},Hl=["onUpdate:modelValue"],Bl={class:"col-1 d-flex gap-2"},Kl=["onClick","disabled"],Fl={class:"row"},zl={class:"col-md-6"},jl={class:"row"},ql={class:"col-6"},Yl={class:"input-group"},Wl={class:"col-6"},Jl={class:"input-group"},Zl={class:"row mt-3"},Ql={class:"col-md-6"},Xl={class:"row"},et={class:"col-6"},at={class:"input-group"},lt={class:"col-6"},tt={class:"input-group"},ot={class:"row mt-3"},st={class:"col-md-6"},nt={class:"row"},it={class:"col-6"},rt={class:"input-group"},dt={class:"col-6"},ut={class:"input-group"},ct={key:0,class:"card mt-3"},vt={class:"card-body"},mt={class:"d-flex align-items-center mb-2"},pt={class:"form-check form-switch"},gt={class:"row"},ft={class:"col-md-3"},bt=["disabled"],yt={class:"col-md-3"},_t=["disabled"],ht={class:"col-md-3"},kt=["disabled"],Ct={class:"col-md-3"},wt=["disabled"],It={key:0},St={class:"card"},At={class:"card-body"},Tt={class:"mb-3"},Mt={key:1},Et={class:"card"},Nt={class:"card-body"},Rt={class:"mb-3"},Dt={class:"col-4"},$t=["onUpdate:modelValue"],Ut={class:"col-3"},Lt=["onUpdate:modelValue"],xt={class:"col-4"},Pt=["onUpdate:modelValue"],Vt={class:"col-1 d-flex align-items-end gap-2"},Gt=["onClick","disabled"],Ot={class:"modal-footer"},Ht=["disabled"],Bt={class:"ms-auto d-flex gap-2"},Kt=["disabled"],Ft=["disabled"],zt=["disabled"],jt=Ie({__name:"softwareCatalogWizard",props:{show:{type:Boolean},mode:{}},emits:["created","updated"],setup(me,{expose:se,emit:le}){const m=me,K=le,R=Ue(),f=v(1),I=v(!1),A=v(!1),S=v(0),y=v({}),Y=["AI_MACHINE_LEARNING","DATABASE","INTEGRATION_AND_DELIVERY","MONITORING_AND_LOGGING","NETWORKING","SECURITY","STORAGE","STREAMING_AND_MESSAGING"],x={1:"AI_MACHINE_LEARNING",2:"DATABASE",3:"INTEGRATION_AND_DELIVERY",4:"MONITORING_AND_LOGGING",5:"NETWORKING",6:"SECURITY",7:"STORAGE",8:"STREAMING_AND_MESSAGING"},W={"AI / MACHINE LEARNING":"AI_MACHINE_LEARNING","AI MACHINE LEARNING":"AI_MACHINE_LEARNING",DATABASE:"DATABASE","INTEGRATION AND DELIVERY":"INTEGRATION_AND_DELIVERY","MONITORING AND LOGGING":"MONITORING_AND_LOGGING","MONITORING & LOGGING":"MONITORING_AND_LOGGING",NETWORKING:"NETWORKING",SECURITY:"SECURITY",STORAGE:"STORAGE","STREAMING AND MESSAGING":"STREAMING_AND_MESSAGING"},T=v("existing"),J=v(""),P=v([]),$=v(!1),j=v(!1),V=v(""),D=v(null),O=v([]),H=v(!1),Z=v(Y.map(l=>({key:l,value:l}))),_=v(!1),i=v(!1),p=v(""),C=v(null),de=v(!1);Le(()=>{C.value&&(C.value.addEventListener("show.bs.modal",F),C.value.addEventListener("hide.bs.modal",ne)),be()}),Be(()=>{C.value&&(C.value.removeEventListener("show.bs.modal",F),C.value.removeEventListener("hide.bs.modal",ne))});const F=()=>{A.value=!0,m.mode==="new"&&Ee()},ne=()=>{A.value=!1,de.value=!1},t=v({id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null}),B=v([{refId:0,refValue:"",refDesc:"",refType:"URL"}]),N=v([{targetPort:80,hostPort:8080,protocol:"TCP"}]),Q=q(()=>m.mode==="update"||T.value==="existing"),ie=q(()=>t.value.target==="VM"?"Docker Hub":"Artifact Hub"),Ae=q(()=>t.value.target==="VM"?"Search official container images":"Search official Helm charts"),ge=q(()=>m.mode==="update"?_.value?"Updating...":"Update":i.value?"Importing...":_.value?"Creating...":T.value==="public"?"Import & Create":"Create"),ue=q(()=>f.value===1?t.value.target&&t.value.category&&t.value.packageName&&t.value.version:f.value===2?t.value.name.trim().length>0&&t.value.summary.trim().length>0&&t.value.description.trim().length>0:f.value===3?t.value.minCpu>0&&t.value.minMemory>0&&t.value.minDisk>0&&t.value.recommendedCpu>0&&t.value.recommendedMemory>0&&t.value.recommendedDisk>0:f.value===3&&t.value.hpaEnabled?t.value.minReplicas>0&&t.value.maxReplicas>0&&t.value.cpuThreshold>0&&t.value.memoryThreshold>0:(console.log(N.value),f.value===3&&t.value.target==="VM"?t.value.defaultPort>0:f.value===4&&t.value.target==="K8S"?(console.log(N.value.length),N.value.length>0?N.value.every(l=>l.targetPort>0&&l.hostPort>0&&l.protocol):!1):f.value===4&&t.value.ingressEnabled?t.value.ingressUrl.trim().length>0:!0)),Te=()=>{ue.value&&f.value<4&&(f.value+=1)},Me=()=>{f.value>1&&(f.value-=1)},s=(l=!0)=>{l&&(J.value=""),P.value=[],j.value=!1,V.value="",D.value=null,O.value=[],$.value=!1,H.value=!1,i.value=!1,p.value=""},n=l=>{if(l==null)return"";if(typeof l=="object")return n(l.value||l.key||l.name||l.displayName||l.display_name||l.category);const a=String(l).trim();if(!a)return"";if(x[a])return x[a];const o=a.replace(/[_-]+/g," ").replace(/\s+/g," ").trim().toUpperCase();return W[o]?W[o]:a.replace(/&/g,"AND").replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/_+/g,"_").toUpperCase()},r=(l=[])=>{const a=new Map;[...Y,...Z.value,...l].forEach(o=>{const k=n((o==null?void 0:o.value)||(o==null?void 0:o.key)||o);k&&a.set(k,{key:k,value:k})}),Z.value=Array.from(a.values()).sort((o,k)=>o.value.localeCompare(k.value))},h=async()=>{r();const a=(await Promise.allSettled([De({target:"DOCKER",availableOnly:!1}),De({target:"HELM",availableOnly:!1})])).flatMap(o=>o.status==="fulfilled"?o.value.data||[]:[]);r(a)},c=(l,a=0)=>{var o;return String((l==null?void 0:l.id)||(l==null?void 0:l.packageId)||`${((o=l==null?void 0:l.repository)==null?void 0:o.name)||"registry"}-${(l==null?void 0:l.name)||a}`)},U=l=>!!D.value&&c(D.value)===c(l),X=l=>{var a,o;return((a=l==null?void 0:l.logo_url)==null?void 0:a.small)||((o=l==null?void 0:l.logo_url)==null?void 0:o.large)||""},xe=l=>(l==null?void 0:l.short_description)||(l==null?void 0:l.description)||"",ze=(l,a)=>{const o=String(l||"");return o.length>a?`${o.substring(0,a)}...`:o},je=async()=>{const l=J.value.trim();if(V.value="",j.value=!1,P.value=[],D.value=null,O.value=[],t.value.packageName="",t.value.version="",!l){V.value="Enter a search keyword.";return}J.value=l,$.value=!0;try{const{data:a}=t.value.target==="VM"?await va(l):await ma(l),o=t.value.target==="VM"?a==null?void 0:a.results:a==null?void 0:a.packages;P.value=(Array.isArray(o)?o:[]).filter(Boolean).slice(0,8),j.value=!0}catch(a){console.log(a),V.value=`Unable to search ${ie.value}.`}finally{$.value=!1}},qe=async l=>{var w,pe,ee,He;D.value=l,t.value.packageName=(l==null?void 0:l.name)||"",t.value.version="",t.value.sourceType=t.value.target==="VM"?"DOCKERHUB":"ARTIFACTHUB",O.value=[],V.value="",p.value="";const a=xe(l);t.value.name=(l==null?void 0:l.name)||t.value.name,t.value.summary=a||(l==null?void 0:l.name)||"",t.value.description=a||(l==null?void 0:l.name)||"",t.value.logoUrlLarge=((w=l==null?void 0:l.logo_url)==null?void 0:w.large)||"",t.value.logoUrlSmall=((pe=l==null?void 0:l.logo_url)==null?void 0:pe.small)||"";const o=n((l==null?void 0:l.category)||((ee=l==null?void 0:l.categories)==null?void 0:ee[0]));r(o?[o]:[]),t.value.category=o;const k=c(l);H.value=!0;try{const{data:_e}=t.value.target==="VM"?await pa({path:(l==null?void 0:l.id)||""}):await ga({kind:"helm",repository:((He=l==null?void 0:l.repository)==null?void 0:He.name)||"",packageName:(l==null?void 0:l.name)||""});if(c(D.value)!==k)return;const Re=(Array.isArray(_e)?_e:[]).map(ae=>t.value.target==="VM"?ae==null?void 0:ae.name:ae==null?void 0:ae.version).filter(Boolean);Re.length===0&&(l!=null&&l.version)&&Re.push(l.version),O.value=Array.from(new Set(Re)).map(ae=>({key:ae,value:ae})),O.value.length===1&&(t.value.version=O.value[0].value)}catch(_e){if(console.log(_e),c(D.value)!==k)return;l!=null&&l.version?(O.value=[{key:l.version,value:l.version}],t.value.version=l.version):V.value="Unable to retrieve package versions."}finally{c(D.value)===k&&(H.value=!1)}},Ee=()=>{f.value=1,T.value="existing",_.value=!1,s(),Z.value=Y.map(l=>({key:l,value:l})),t.value={id:null,target:"VM",sourceType:"DOCKERHUB",category:"",packageName:"",version:"",packageInfo:null,helmChart:null,name:"",summary:"",description:"",logoUrlLarge:"",logoUrlSmall:"",catalogRefs:[],minCpu:0,recommendedCpu:0,minMemory:0,recommendedMemory:0,minDisk:0,recommendedDisk:0,hpaEnabled:!1,minReplicas:1,maxReplicas:10,cpuThreshold:80,memoryThreshold:80,ports:[],ingressEnabled:!1,ingressUrl:"",defaultPort:80,registeredById:null,createdAt:null,updatedAt:null},B.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],N.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}]},Ye=()=>{B.value.push({refId:0,refValue:"",refDesc:"",refType:"URL"})},We=l=>{B.value.length>1&&B.value.splice(l,1)},Je=()=>{N.value.push({targetPort:80,hostPort:8080,protocol:"TCP"})},Ze=l=>{N.value.length>1&&N.value.splice(l,1)},Pe=()=>{if(C.value){A.value=!1;const l=C.value.querySelector('[data-bs-dismiss="modal"]');if(l)l.click();else try{const a=window.bootstrap;if(a!=null&&a.Modal)(a.Modal.getInstance(C.value)||new a.Modal(C.value)).hide();else{C.value.classList.remove("show"),C.value.style.display="none",document.body.classList.remove("modal-open");const o=document.querySelector(".modal-backdrop");o==null||o.remove()}}catch(a){console.warn("Modal close failed:",a)}}},Qe=()=>[t.value.target,c(D.value),t.value.version].join("|"),Xe=async()=>{var a,o;if(T.value!=="public")return;if(!D.value)throw new Error("Select a package to import.");const l=Qe();if(p.value!==l){i.value=!0;try{const k=JSON.parse(JSON.stringify(D.value));let w;if(t.value.target==="VM"){const pe=t.value.category,ee={...k,tag:t.value.version,sourceType:"DockerHub",createdAt:k.created_at,updatedAt:k.updated_at,shortDescription:k.short_description,starCount:k.star_count,ratePlans:k.rate_plans,categories:[{name:pe,slug:pe.toLowerCase().replace(/_/g,"-")}]};delete ee.created_at,delete ee.updated_at,delete ee.short_description,delete ee.star_count,delete ee.rate_plans,w=await ka(ee)}else w=await Ca({...k,packageId:k.packageId,tag:t.value.version,version:t.value.version,category:t.value.category,sourceType:"ArtifactHub"});if(((a=w==null?void 0:w.data)==null?void 0:a.success)!==!0)throw new Error(((o=w==null?void 0:w.data)==null?void 0:o.message)||`${ie.value} import failed.`);p.value=l}finally{i.value=!1}}},ea=async()=>{if(!_.value){_.value=!0;try{await Xe(),t.value.catalogRefs=B.value.filter(l=>l.refValue.trim()),t.value.target==="K8S"&&(t.value.ports=N.value.filter(l=>l.targetPort&&l.hostPort)),t.value.target==="VM"?t.value.sourceType="DOCKERHUB":t.value.target==="K8S"&&(t.value.sourceType="ARTIFACTHUB"),await fa(t.value),R.success("Registration Success"),Pe(),K("created")}catch(l){console.log(l),R.error((l==null?void 0:l.message)||"Registration Failed")}finally{_.value=!1}}},aa=async()=>{if(!_.value){_.value=!0;try{t.value.catalogRefs=B.value.filter(l=>l.refValue.trim()),t.value.target==="K8S"&&(t.value.ports=N.value.filter(l=>l.targetPort&&l.hostPort)),t.value.target==="VM"?t.value.sourceType="DOCKERHUB":t.value.target==="K8S"&&(t.value.sourceType="ARTIFACTHUB"),await ba(t.value),R.success("Update Success"),Pe(),K("updated")}catch{R.error("Update Failed")}finally{_.value=!1}}},Ve=async()=>{try{if(!S.value)return;y.value&&y.value.category&&(I.value=!0,t.value.target=y.value.packageInfo!==null?"VM":"K8S",t.value.category=y.value.category,y.value.packageInfo!==null?(t.value.packageName=y.value.packageInfo.packageName,t.value.version=y.value.packageInfo.packageVersion):y.value.helmChart!==null&&(t.value.packageName=y.value.helmChart.chartName,t.value.version=y.value.helmChart.chartVersion),I.value=!1),await la()}catch{R.error("Failed to load catalog data"),I.value=!1}},la=async()=>{try{if(!S.value)return;const{data:l}=await ya(S.value);I.value=!0,t.value={...t.value,...l,target:l.packageInfo!==null?"VM":"K8S"},l.packageInfo!==null&&(t.value.packageName=l.packageInfo.packageName,t.value.version=l.packageInfo.packageVersion),l.helmChart!==null&&(t.value.packageName=l.helmChart.chartName,t.value.version=l.helmChart.chartVersion),l.catalogRefs&&l.catalogRefs.length>0?B.value=l.catalogRefs.map(a=>({refId:a.id||0,refValue:a.refValue||"",refDesc:a.refDesc||"",refType:a.refType||"URL"})):B.value=[{refId:0,refValue:"",refDesc:"",refType:"URL"}],l.ports&&l.ports.length>0?N.value=l.ports.map(a=>({targetPort:a.targetPort||80,hostPort:a.hostPort||8080,protocol:a.protocol||"TCP"})):N.value=[{targetPort:80,hostPort:8080,protocol:"TCP"}],await be(),t.value.category&&(await Ge(),t.value.packageName&&await Oe()),I.value=!1}catch{R.error("Failed to load catalog data"),I.value=!1}},fe=l=>{!_.value&&ue.value&&(f.value=l)};he(T,async()=>{m.mode!=="new"||I.value||(t.value.category="",t.value.packageName="",t.value.version="",t.value.name="",t.value.summary="",t.value.description="",t.value.logoUrlLarge="",t.value.logoUrlSmall="",s(),T.value==="existing"?await be():(t.value.sourceType=t.value.target==="VM"?"DOCKERHUB":"ARTIFACTHUB",await h()))}),he(()=>t.value.target,async(l,a)=>{!l||I.value||l===a||(m.mode==="new"&&(t.value.category="",t.value.packageName="",t.value.version=""),Q.value?await be():(t.value.sourceType=l==="VM"?"DOCKERHUB":"ARTIFACTHUB",s(),await h()))});const Ne=v([]),be=async()=>{if(m.mode==="new"&&Q.value&&(Ne.value=[],ye.value=[],ce.value=[],t.value.category="",t.value.packageName="",t.value.version=""),t.value.target){const l={target:t.value.target==="VM"?"DOCKER":"HELM",availableOnly:m.mode==="new"},{data:a}=await De(l);Ne.value=a}};he(()=>t.value.category,l=>{l&&Q.value&&!I.value&&(m.mode==="new"&&(t.value.packageName="",t.value.version=""),Ge())});const ye=v([]),Ge=async()=>{m.mode==="new"&&Q.value&&(ye.value=[],ce.value=[],t.value.packageName="",t.value.version="");const l={target:t.value.target==="VM"?"DOCKER":"HELM",category:t.value.category||"",availableOnly:m.mode==="new"},{data:a}=await _a(l);ye.value=a};he(()=>t.value.packageName,l=>{l&&Q.value&&!I.value&&(m.mode==="new"&&(t.value.version=""),Oe())});const ce=v([]),Oe=async()=>{m.mode==="new"&&Q.value&&(ce.value=[],t.value.version="");const l={target:t.value.target==="VM"?"DOCKER":"HELM",packageName:t.value.packageName||"",availableOnly:m.mode==="new"},{data:a}=await ha(l);m.mode==="new"?a.forEach(o=>{o.isUsed||ce.value.push(o)}):ce.value=a};return se({loadCatalogDataWithCategoryInit:Ve,initForCreate:()=>{Ee(),f.value=1},initForUpdate:(l,a)=>{S.value=l,y.value=a,f.value=1,Ve()}}),(l,a)=>(d(),u("div",{class:"modal fade",id:"modal-wizard",tabindex:"-1",ref_key:"wizardModal",ref:C},[e("div",Da,[e("div",$a,[e("div",Ua,[e("h5",La,g(m.mode==="update"?"Application Update":"Application Registration"),1),e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",disabled:_.value},null,8,xa)]),e("div",Pa,[e("ul",Va,[e("li",Ga,[e("a",{class:oe(["nav-link",{active:f.value===1}]),href:"javascript:void(0);",onClick:a[0]||(a[0]=o=>fe(1))},"1. "+g(m.mode==="update"?"Package":"Source & Package"),3)]),e("li",Oa,[e("a",{class:oe(["nav-link",{active:f.value===2}]),href:"javascript:void(0);",onClick:a[1]||(a[1]=o=>fe(2))},"2. General",2)]),e("li",Ha,[e("a",{class:oe(["nav-link",{active:f.value===3}]),href:"javascript:void(0);",onClick:a[2]||(a[2]=o=>fe(3))},"3. Resource Requirements",2)]),e("li",Ba,[e("a",{class:oe(["nav-link",{active:f.value===4}]),href:"javascript:void(0);",onClick:a[3]||(a[3]=o=>fe(4))},"4. Network",2)])]),b(e("div",null,[m.mode!=="update"?(d(),u("div",Ka,[a[32]||(a[32]=e("label",{class:"form-label required"},"Registration Source",-1)),e("div",Fa,[e("div",za,[e("label",{class:oe(["source-option",{selected:T.value==="existing"}]),for:"sourceExisting"},[b(e("input",{id:"sourceExisting","onUpdate:modelValue":a[4]||(a[4]=o=>T.value=o),class:"form-check-input",type:"radio",name:"registrationSource",value:"existing",disabled:_.value},null,8,ja),[[Ce,T.value]]),a[30]||(a[30]=e("span",null,[e("strong",null,"Existing Package"),e("small",null,"Register a package already available in MCMP.")],-1))],2)]),e("div",qa,[e("label",{class:oe(["source-option",{selected:T.value==="public"}]),for:"sourcePublic"},[b(e("input",{id:"sourcePublic","onUpdate:modelValue":a[5]||(a[5]=o=>T.value=o),class:"form-check-input",type:"radio",name:"registrationSource",value:"public",disabled:_.value},null,8,Ya),[[Ce,T.value]]),a[31]||(a[31]=e("span",null,[e("strong",null,"Public Registry"),e("small",null,"Search, import, and register in one flow.")],-1))],2)])])])):L("",!0),e("div",Wa,[a[35]||(a[35]=e("label",{class:"form-label required"},"Target",-1)),e("div",Ja,[e("div",Za,[b(e("input",{class:"form-check-input",type:"radio",name:"target",value:"VM","onUpdate:modelValue":a[6]||(a[6]=o=>t.value.target=o),id:"targetVM",disabled:m.mode==="update"||_.value},null,8,Qa),[[Ce,t.value.target]]),a[33]||(a[33]=e("label",{class:"form-check-label",for:"targetVM"},"VM",-1))]),e("div",Xa,[b(e("input",{class:"form-check-input",type:"radio",name:"target",value:"K8S","onUpdate:modelValue":a[7]||(a[7]=o=>t.value.target=o),id:"targetK8S",disabled:m.mode==="update"||_.value},null,8,el),[[Ce,t.value.target]]),a[34]||(a[34]=e("label",{class:"form-check-label",for:"targetK8S"},"K8S",-1))])])]),Q.value?(d(),u(E,{key:1},[e("div",al,[a[37]||(a[37]=e("label",{class:"form-label required"},"Category",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[8]||(a[8]=o=>t.value.category=o),disabled:m.mode==="update"},[a[36]||(a[36]=e("option",{value:""},"Select Category",-1)),(d(!0),u(E,null,G(Ne.value,o=>(d(),u("option",{value:o.value,key:o.key},g(o.value),9,tl))),128))],8,ll),[[re,t.value.category]])]),e("div",ol,[e("div",sl,[a[39]||(a[39]=e("label",{class:"form-label required"},"Package",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[9]||(a[9]=o=>t.value.packageName=o),disabled:m.mode==="update"},[a[38]||(a[38]=e("option",{value:""},"Select Package",-1)),(d(!0),u(E,null,G(ye.value,o=>(d(),u("option",{value:o.value,key:o.key},g(o.value),9,il))),128))],8,nl),[[re,t.value.packageName]])]),e("div",rl,[a[41]||(a[41]=e("label",{class:"form-label required"},"Version",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[10]||(a[10]=o=>t.value.version=o),disabled:m.mode==="update"},[a[40]||(a[40]=e("option",{value:""},"Select Version",-1)),(d(!0),u(E,null,G(ce.value,o=>(d(),u("option",{value:o.value,key:o.key},g(o.value),9,ul))),128))],8,dl),[[re,t.value.version]])])])],64)):(d(),u(E,{key:2},[e("div",cl,[e("strong",null,g(ie.value),1),a[42]||(a[42]=ve(" will be searched for the selected target. The package is imported only when you complete registration. "))]),e("form",{class:"mb-3",onSubmit:we(je,["prevent"])},[e("label",vl,"Search "+g(ie.value),1),e("div",ml,[b(e("input",{id:"registrySearchInput","onUpdate:modelValue":a[11]||(a[11]=o=>J.value=o),type:"search",class:"form-control",placeholder:Ae.value,disabled:$.value||_.value},null,8,pl),[[M,J.value]]),e("button",{class:"btn btn-outline-primary",type:"submit",disabled:$.value||_.value},g($.value?"Searching...":"Search"),9,gl)]),V.value?(d(),u("div",fl,g(V.value),1)):L("",!0)],32),$.value?(d(),u("div",bl,"Searching "+g(ie.value)+"...",1)):j.value&&P.value.length===0?(d(),u("div",yl," No matching packages found. ")):P.value.length>0?(d(),u("div",_l,[(d(!0),u(E,null,G(P.value,(o,k)=>(d(),u("button",{key:c(o,k),type:"button",class:oe(["list-group-item list-group-item-action",{active:U(o)}]),disabled:H.value||_.value,onClick:w=>qe(o)},[e("div",kl,[X(o)?(d(),u("img",{key:0,src:X(o),class:"rounded registry-logo",alt:"",width:"40",height:"40"},null,8,Cl)):L("",!0),e("div",wl,[e("div",Il,g((o==null?void 0:o.name)||(o==null?void 0:o.packageId)||"Unnamed package"),1),e("div",Sl,g(ze(xe(o),120)),1)])])],10,hl))),128))])):L("",!0),D.value?(d(),u("div",Al,[e("div",Tl,[a[43]||(a[43]=e("label",{class:"form-label required"},"Version",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[12]||(a[12]=o=>t.value.version=o),disabled:H.value||_.value},[e("option",El,g(H.value?"Loading versions...":"Select Version"),1),(d(!0),u(E,null,G(O.value,o=>(d(),u("option",{value:o.value,key:o.key},g(o.value),9,Nl))),128))],8,Ml),[[re,t.value.version]])]),e("div",Rl,[a[45]||(a[45]=e("label",{class:"form-label required"},"Category",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":a[13]||(a[13]=o=>t.value.category=o),disabled:_.value},[a[44]||(a[44]=e("option",{value:""},"Select Category",-1)),(d(!0),u(E,null,G(Z.value,o=>(d(),u("option",{value:o.value,key:o.key},g(o.value),9,$l))),128))],8,Dl),[[re,t.value.category]])])])):L("",!0)],64))],512),[[ke,f.value===1]]),b(e("div",null,[e("div",Ul,[a[46]||(a[46]=e("label",{class:"form-label required"},"Application Name",-1)),b(e("input",{type:"text",class:"form-control","onUpdate:modelValue":a[14]||(a[14]=o=>t.value.name=o),placeholder:"Application name"},null,512),[[M,t.value.name]])]),e("div",Ll,[a[47]||(a[47]=e("label",{class:"form-label required"},"Summary",-1)),b(e("input",{type:"text",class:"form-control","onUpdate:modelValue":a[15]||(a[15]=o=>t.value.summary=o),placeholder:"Application summary"},null,512),[[M,t.value.summary]])]),e("div",xl,[a[48]||(a[48]=e("label",{class:"form-label required"},"Description",-1)),b(e("textarea",{class:"form-control",rows:"4","onUpdate:modelValue":a[16]||(a[16]=o=>t.value.description=o),placeholder:"Application description"},null,512),[[M,t.value.description]])]),e("div",Pl,[a[50]||(a[50]=e("label",{class:"form-label"},"Reference",-1)),(d(!0),u(E,null,G(B.value,(o,k)=>(d(),u("div",{class:"row g-2 mb-2",key:k},[e("div",Vl,[b(e("select",{class:"form-select","onUpdate:modelValue":w=>o.refType=w},a[49]||(a[49]=[oa('',6)]),8,Gl),[[re,o.refType]])]),e("div",Ol,[b(e("input",{type:"text",class:"form-control","onUpdate:modelValue":w=>o.refValue=w,placeholder:"Ref Value"},null,8,Hl),[[M,o.refValue]])]),e("div",Bl,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:w=>We(k),disabled:B.value.length<=1},"-",8,Kl)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:Ye,style:{color:"gray"}},"+ Add Reference")])],512),[[ke,f.value===2]]),b(e("div",null,[e("div",Fl,[e("div",zl,[a[55]||(a[55]=e("label",{class:"form-label"},"CPU",-1)),e("div",jl,[e("div",ql,[a[52]||(a[52]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",Yl,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[17]||(a[17]=o=>t.value.minCpu=o),placeholder:"1"},null,512),[[M,t.value.minCpu,void 0,{number:!0}]]),a[51]||(a[51]=e("span",{class:"input-group-text"},"Cores",-1))])]),e("div",Wl,[a[54]||(a[54]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",Jl,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[18]||(a[18]=o=>t.value.recommendedCpu=o),placeholder:"2"},null,512),[[M,t.value.recommendedCpu,void 0,{number:!0}]]),a[53]||(a[53]=e("span",{class:"input-group-text"},"Cores",-1))])])])])]),e("div",Zl,[e("div",Ql,[a[60]||(a[60]=e("label",{class:"form-label"},"Memory",-1)),e("div",Xl,[e("div",et,[a[57]||(a[57]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",at,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[19]||(a[19]=o=>t.value.minMemory=o),placeholder:"4"},null,512),[[M,t.value.minMemory,void 0,{number:!0}]]),a[56]||(a[56]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",lt,[a[59]||(a[59]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",tt,[b(e("input",{type:"number",min:"0",step:"0.1",class:"form-control","onUpdate:modelValue":a[20]||(a[20]=o=>t.value.recommendedMemory=o),placeholder:"8"},null,512),[[M,t.value.recommendedMemory,void 0,{number:!0}]]),a[58]||(a[58]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),e("div",ot,[e("div",st,[a[65]||(a[65]=e("label",{class:"form-label"},"Storage",-1)),e("div",nt,[e("div",it,[a[62]||(a[62]=e("label",{class:"form-label text-muted small"},"Minimum",-1)),e("div",rt,[b(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":a[21]||(a[21]=o=>t.value.minDisk=o),placeholder:"10"},null,512),[[M,t.value.minDisk,void 0,{number:!0}]]),a[61]||(a[61]=e("span",{class:"input-group-text"},"GB",-1))])]),e("div",dt,[a[64]||(a[64]=e("label",{class:"form-label text-muted small"},"Recommended",-1)),e("div",ut,[b(e("input",{type:"number",min:"0",class:"form-control","onUpdate:modelValue":a[22]||(a[22]=o=>t.value.recommendedDisk=o),placeholder:"20"},null,512),[[M,t.value.recommendedDisk,void 0,{number:!0}]]),a[63]||(a[63]=e("span",{class:"input-group-text"},"GB",-1))])])])])]),t.value.target==="K8S"?(d(),u("div",ct,[e("div",vt,[e("div",mt,[a[66]||(a[66]=e("label",{class:"form-check-label me-2"},"K8S HPA",-1)),e("div",pt,[b(e("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":a[23]||(a[23]=o=>t.value.hpaEnabled=o)},null,512),[[sa,t.value.hpaEnabled]])])]),e("div",gt,[e("div",ft,[a[67]||(a[67]=e("label",{class:"form-label"},"minReplicas",-1)),b(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":a[24]||(a[24]=o=>t.value.minReplicas=o),disabled:!t.value.hpaEnabled,placeholder:"1"},null,8,bt),[[M,t.value.minReplicas,void 0,{number:!0}]])]),e("div",yt,[a[68]||(a[68]=e("label",{class:"form-label"},"maxReplicas",-1)),b(e("input",{type:"number",min:"1",class:"form-control","onUpdate:modelValue":a[25]||(a[25]=o=>t.value.maxReplicas=o),disabled:!t.value.hpaEnabled,placeholder:"10"},null,8,_t),[[M,t.value.maxReplicas,void 0,{number:!0}]])]),e("div",ht,[a[69]||(a[69]=e("label",{class:"form-label"},"CPU (%)",-1)),b(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":a[26]||(a[26]=o=>t.value.cpuThreshold=o),disabled:!t.value.hpaEnabled,placeholder:"80"},null,8,kt),[[M,t.value.cpuThreshold,void 0,{number:!0}]])]),e("div",Ct,[a[70]||(a[70]=e("label",{class:"form-label"},"Memory (%)",-1)),b(e("input",{type:"number",min:"1",max:"100",class:"form-control","onUpdate:modelValue":a[27]||(a[27]=o=>t.value.memoryThreshold=o),disabled:!t.value.hpaEnabled,placeholder:"80"},null,8,wt),[[M,t.value.memoryThreshold,void 0,{number:!0}]])])])])])):L("",!0)],512),[[ke,f.value===3]]),b(e("div",null,[t.value.target==="VM"?(d(),u("div",It,[e("div",St,[a[72]||(a[72]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",At,[e("div",Tt,[a[71]||(a[71]=e("label",{class:"form-label"},"Port",-1)),b(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":a[28]||(a[28]=o=>t.value.defaultPort=o),placeholder:"80"},null,512),[[M,t.value.defaultPort,void 0,{number:!0}]])])])])])):L("",!0),t.value.target==="K8S"?(d(),u("div",Mt,[e("div",Et,[a[78]||(a[78]=e("div",{class:"card-header"},[e("h6",{class:"card-title"},"Port Mapping")],-1)),e("div",Nt,[e("div",Rt,[a[77]||(a[77]=e("label",{class:"form-label"},"Port",-1)),(d(!0),u(E,null,G(N.value,(o,k)=>(d(),u("div",{class:"row g-2 mb-2",key:k},[e("div",Dt,[a[73]||(a[73]=e("label",{class:"form-label small"},"Target Port",-1)),b(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":w=>o.targetPort=w,placeholder:"80"},null,8,$t),[[M,o.targetPort,void 0,{number:!0}]])]),e("div",Ut,[a[75]||(a[75]=e("label",{class:"form-label small"},"Protocol",-1)),b(e("select",{class:"form-select","onUpdate:modelValue":w=>o.protocol=w},a[74]||(a[74]=[e("option",{value:"TCP"},"TCP",-1),e("option",{value:"UDP"},"UDP",-1),e("option",{value:"SCTP"},"SCTP",-1)]),8,Lt),[[re,o.protocol]])]),e("div",xt,[a[76]||(a[76]=e("label",{class:"form-label small"},"Host Port",-1)),b(e("input",{type:"number",min:"1",max:"65535",class:"form-control","onUpdate:modelValue":w=>o.hostPort=w,placeholder:"8080"},null,8,Pt),[[M,o.hostPort,void 0,{number:!0}]])]),e("div",Vt,[e("button",{type:"button",class:"btn btn-outline-danger btn-sm w-100 cursor-pointer",onClick:w=>Ze(k),disabled:N.value.length<=1},"-",8,Gt)])]))),128)),e("div",{class:"form-text cursor-pointer",onClick:Je,style:{color:"gray"}},"+ Add Port Mapping")])])])])):L("",!0)],512),[[ke,f.value===4]])]),e("div",Ot,[e("button",{type:"button",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",disabled:_.value,onClick:Ee}," Cancel ",8,Ht),e("div",Bt,[e("button",{class:"btn btn-outline-secondary",disabled:f.value===1||_.value,onClick:Me},"Prev",8,Kt),f.value<4?(d(),u("button",{key:0,class:"btn btn-primary",disabled:!ue.value||_.value,onClick:Te},"Next",8,Ft)):(d(),u("button",{key:1,class:"btn btn-primary",disabled:!ue.value||_.value,onClick:a[29]||(a[29]=o=>m.mode==="update"?aa():ea())},g(ge.value),9,zt))])])])])],512))}}),qt=Sa(jt,[["__scopeId","data-v-b5a9b02f"]]),Yt={class:"modal-dialog",role:"document"},Wt={class:"modal-content"},Jt={class:"modal-body"},Zt={key:0,class:"text-muted"},Qt={key:1,class:"alert alert-warning mb-0"},Xt={key:2,class:"alert alert-warning mb-0"},eo={class:"mb-0 mt-2 ps-3"},ao={key:0,class:"mt-1"},lo={key:3,class:"text-muted"},to={class:"modal-footer"},oo=["disabled"],so=["disabled"],no={key:0,class:"spinner-border spinner-border-sm me-2",role:"status"},io=Ie({__name:"DeleteConfirmModal",props:{targetCatalog:{}},emits:["deleted","close"],setup(me,{expose:se,emit:le}){const m=me,K=le,R=Ue(),f=v(!1),I=v(!1),A=v(!1),S=v([]),y=v(null),Y=new Set(["UNINSTALLED","DELETED","DELETE_COMPLETED"]),x=q(()=>S.value.length>0),W=q(()=>S.value.slice(0,3)),T=q(()=>Math.max(S.value.length-W.value.length,0)),J=q(()=>f.value||I.value||A.value||x.value),P=async()=>{if(await $e(),V(),y.value)try{const i=window.bootstrap;if(i&&i.Modal)new i.Modal(y.value).show();else{y.value.classList.add("show"),y.value.style.display="block",document.body.classList.add("modal-open");const p=document.createElement("div");p.className="modal-backdrop fade show",p.id="delete-modal-backdrop",document.body.appendChild(p)}}catch(i){console.warn("Failed to show modal with Bootstrap, using fallback:",i),y.value.classList.add("show"),y.value.style.display="block",document.body.classList.add("modal-open")}},$=()=>{if(y.value)try{const i=window.bootstrap;if(i&&i.Modal){const p=i.Modal.getInstance(y.value);p?p.hide():j()}else j()}catch(i){console.warn("Failed to hide modal with Bootstrap, using fallback:",i),j()}},j=()=>{if(y.value){y.value.classList.remove("show"),y.value.style.display="none",document.body.classList.remove("modal-open");const i=document.getElementById("delete-modal-backdrop");i&&i.remove(),K("close")}},V=async()=>{var i;if(S.value=[],A.value=!1,!!((i=m.targetCatalog)!=null&&i.id)){I.value=!0;try{const{data:p}=await Fe(m.targetCatalog.id),C=Array.isArray(p==null?void 0:p.applicationStatuses)?p.applicationStatuses:[];S.value=C.filter(D).map(O)}catch(p){console.log(p),A.value=!0}finally{I.value=!1}}},D=i=>{const p=H((i==null?void 0:i.status)||(i==null?void 0:i.podStatus));return!Y.has(p)},O=(i,p)=>{const C=[i==null?void 0:i.namespace,i==null?void 0:i.mciId,(i==null?void 0:i.vmId)||(i==null?void 0:i.clusterName)].filter(Boolean).join(" / "),de=(i==null?void 0:i.deploymentType)||"Deployment",F=Ke((i==null?void 0:i.status)||(i==null?void 0:i.podStatus));return{key:(i==null?void 0:i.id)||`${de}-${C}-${p}`,label:`${de}${C?` - ${C}`:""} (${F})`}},H=i=>String(i||"").trim().toUpperCase(),Z=async()=>{var i;if((i=m.targetCatalog)!=null&&i.id){if(J.value){x.value&&R.warning("This catalog has deployed applications. Please delete them first.");return}f.value=!0;try{await wa(m.targetCatalog.id),R.success(`${m.targetCatalog.name} catalog has been successfully deleted.`),$(),K("deleted",m.targetCatalog.id)}catch(p){console.error("Delete failed:",p),R.error("Failed to delete catalog.")}finally{f.value=!1}}},_=()=>{K("close")};return Le(()=>{y.value&&y.value.addEventListener("hidden.bs.modal",_)}),Be(()=>{y.value&&y.value.removeEventListener("hidden.bs.modal",_)}),se({show:P,hide:$}),(i,p)=>(d(),u("div",{class:"modal fade",id:"deleteConfirmModal",tabindex:"-1",ref_key:"deleteModal",ref:y,onClick:we($,["self"])},[e("div",Yt,[e("div",Wt,[e("div",{class:"modal-header"},[p[0]||(p[0]=e("h5",{class:"modal-title"},"Confirm Catalog Deletion",-1)),e("button",{type:"button",class:"btn-close",onClick:$,"aria-label":"Close"})]),e("div",Jt,[e("p",null,[p[1]||(p[1]=ve("Are you sure you want to delete ")),e("strong",null,g(i.targetCatalog.name),1),ve(" ("+g(i.targetCatalog.category)+") catalog?",1)]),I.value?(d(),u("div",Zt,p[2]||(p[2]=[e("span",{class:"spinner-border spinner-border-sm me-2",role:"status"},null,-1),ve(" Checking deployed applications... ")]))):A.value?(d(),u("div",Qt," Unable to verify deployed applications. Try again before deleting this catalog. ")):x.value?(d(),u("div",Xt,[p[3]||(p[3]=e("div",{class:"fw-semibold"},"This catalog has deployed applications.",-1)),p[4]||(p[4]=e("div",null,"Please delete the deployed applications first.",-1)),e("ul",eo,[(d(!0),u(E,null,G(W.value,C=>(d(),u("li",{key:C.key},g(C.label),1))),128))]),T.value>0?(d(),u("div",ao," and "+g(T.value)+" more... ",1)):L("",!0)])):(d(),u("p",lo,"This action cannot be undone."))]),e("div",to,[A.value?(d(),u("button",{key:0,type:"button",class:"btn btn-outline-secondary",disabled:I.value,onClick:V}," Retry ",8,oo)):L("",!0),e("button",{type:"button",class:"btn btn-secondary",onClick:$},"Cancel"),e("button",{type:"button",class:"btn btn-danger",onClick:Z,disabled:J.value},[f.value?(d(),u("span",no)):L("",!0),ve(" "+g(f.value?"Deleting...":"Delete"),1)],8,so)])])])],512))}}),ro={ref:"sofwareCatalog"},uo={class:"row"},co={class:"col-lg-12"},vo={class:"card"},mo={class:"list-group card-list-group",id:"sc-list-group"},po={class:"row g-2 align-items-center"},go={class:"col-auto me-3"},fo=["src","onError"],bo={key:1,class:"rounded catalog-icon-fallback d-flex align-items-center justify-content-center"},yo=["onClick"],_o={class:"text-muted"},ho=["onClick"],ko={class:"text-muted",style:{width:"auto","text-align":"right"}},Co={style:{color:"#e5b942"}},wo={style:{color:"#e5b942"}},Io={class:"text-muted",style:{width:"80px","text-align":"right"}},So={style:{color:"gray"}},Ao={class:"col-3 text-muted"},To={class:"d-flex justify-content-end"},Mo={class:"mouse-hover"},Eo=["onClick"],No={class:"text-muted"},Ro=["id"],Do={class:"accordion-body pt-0"},$o=["innerHTML"],Uo=["id"],Lo=["onClick"],xo=["id"],Po=["id"],Vo={class:"btn btn-sm",style:{"margin-right":"5px"}},Go={class:"btn btn-sm",style:{"margin-right":"5px"}},Oo={class:"btn btn-sm",style:{"margin-right":"5px"}},Ho={class:"mt-4"},Bo={class:"d-flex justify-content-between align-items-center mb-2"},Ko=["disabled","onClick"],Fo={key:0,class:"text-center text-muted py-3"},zo={key:1,class:"table-responsive"},jo={class:"table table-sm table-vcenter"},qo={key:0},Yo={class:"text-end"},Wo=["disabled","onClick"],Jo=Ie({__name:"softwareCatalogList",setup(me,{expose:se}){const le=Ue(),m=v([]),K=v(null),R=v(null),f=v({}),I=v("new"),A=v({}),S=v(""),y=v({}),Y=v(null),x=v(null),W=v(0),T=v(null);Le(async()=>{P()}),se({startRegistration:()=>{I.value="new",R.value=null,f.value={},K.value=0,A.value={},S.value="",setTimeout(()=>{x.value&&typeof x.value.initForCreate=="function"&&x.value.initForCreate()},100)}});const P=async()=>{try{await Ia("").then(({data:s})=>{Aa.forEach(s,function(n){n.refData=$(n.catalogRefs),n.isShow=!1,n.deploymentStatuses=[],n.deploymentStatusLoaded=!1,n.deploymentStatusLoading=!1,n.resolvedLogoUrl=ue(n),n.logoLoadFailed=!1}),m.value=s})}catch(s){console.log(s),le.error("Unable to retrieve data.")}},$=s=>s.reduce((n,r)=>(n[r.refType]||(n[r.refType]=[]),n[r.refType].push(r),n),{}),j=s=>{const n=m.value.find(r=>r.id===s);R.value=s,f.value=n||{},I.value="update",setTimeout(()=>{x.value&&typeof x.value.initForUpdate=="function"&&x.value.initForUpdate(s,n)},100)},V=s=>{y.value=s,Y.value&&Y.value.show()},D=async()=>{await P()},O=()=>{y.value={}},H=async s=>{const n=m.value[s];n.isShow=!n.isShow,n.isShow&&!n.deploymentStatusLoaded&&await Z(n)},Z=async s=>{if(s!=null&&s.id){s.deploymentStatusLoading=!0;try{const{data:n}=await Fe(s.id);s.deploymentStatuses=_(n),s.deploymentStatusLoaded=!0}catch(n){console.log(n),s.deploymentStatuses=[],le.error("Unable to retrieve deployment status.")}finally{s.deploymentStatusLoading=!1}}},_=s=>{const n=Array.isArray(s==null?void 0:s.deploymentHistories)?s.deploymentHistories:[];return(Array.isArray(s==null?void 0:s.applicationStatuses)?s.applicationStatuses:[]).map((h,c)=>{const U=i(h,n);return p(U,h,`status-${h.id||c}`)})},i=(s,n)=>{if(!s)return null;const r=n.find(h=>s.deploymentHistoryId&&String(s.deploymentHistoryId)===String(h.id));return r||n.find(h=>ne(s.deploymentType,h.deploymentType)&&ne(s.namespace,h.namespace)&&(ne(s.vmId,h.vmId)||ne(s.clusterName,h.clusterName)))},p=(s,n,r)=>({rowKey:r,deploymentId:(n==null?void 0:n.deploymentHistoryId)||(s==null?void 0:s.id)||null,deploymentType:F((n==null?void 0:n.deploymentType)||(s==null?void 0:s.deploymentType)),target:F(C(s,n)),csp:F(s==null?void 0:s.cloudProvider),status:F((n==null?void 0:n.status)||(n==null?void 0:n.podStatus)),ipOrEndpoint:F(de(s,n)),lastCheckedOrDeployedAt:F(t(n==null?void 0:n.checkedAt))}),C=(s,n)=>{const r=(n==null?void 0:n.deploymentType)||(s==null?void 0:s.deploymentType),h=(n==null?void 0:n.namespace)||(s==null?void 0:s.namespace),c=(n==null?void 0:n.mciId)||(s==null?void 0:s.mciId),U=(n==null?void 0:n.vmId)||(s==null?void 0:s.vmId),X=(n==null?void 0:n.clusterName)||(s==null?void 0:s.clusterName);return r==="VM"?[h,c,U].filter(Boolean).join(" / "):r==="K8S"?[h,X].filter(Boolean).join(" / "):[h,c,U,X].filter(Boolean).join(" / ")},de=(s,n)=>{var X;const r=(n==null?void 0:n.publicIp)||(s==null?void 0:s.publicIp),h=(n==null?void 0:n.servicePort)||(s==null?void 0:s.servicePort),c=s==null?void 0:s.ingressHost,U=s==null?void 0:s.ingressPath;return s!=null&&s.ingressEnabled&&["public-iks-k8s-nginx","private-iks-k8s-nginx"].includes(s==null?void 0:s.ingressClass)&&c?`${s!=null&&s.ingressTlsEnabled?"https":"http"}://${c}${U||"/"}`:(X=s==null?void 0:s.releaseName)!=null&&X.startsWith("mcmp-jupyter-")&&c?`http://${c}:30880/`:r&&h?`${r}:${h}`:r||(c&&U?`${c}${U}`:c||"")},F=s=>s==null||s===""?"-":s,ne=(s,n)=>!s||!n?!1:String(s)===String(n),t=s=>{if(!s)return"";const n=new Date(s);return Number.isNaN(n.getTime())?s:n.toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},B=s=>{if(!s)return;W.value=s;const n=document.getElementById("application-detail-modal");if(n)try{window.bootstrap&&window.bootstrap.Modal?new window.bootstrap.Modal(n).show():(n.style.display="block",n.classList.add("show"),document.body.classList.add("modal-open")),setTimeout(()=>{T.value&&T.value.refreshData(W.value)},100)}catch(r){console.error("Error opening detail modal:",r)}},N=(s,n)=>Object.prototype.hasOwnProperty.call(s,n),Q=s=>{window.open(s)},ie={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},Ae=s=>String(s||"").trim().toLowerCase(),ge=s=>ie[Ae(s==null?void 0:s.name)]||"",ue=s=>ge(s)||(s==null?void 0:s.logoUrlLarge)||(s==null?void 0:s.logoUrlSmall)||"",Te=s=>{const n=ge(s);if(n&&s.resolvedLogoUrl!==n){s.resolvedLogoUrl=n,s.logoLoadFailed=!1;return}s.logoLoadFailed=!0},Me=s=>s.replace(/\\n|\n/g,"
");return(s,n)=>(d(),u(E,null,[e("div",ro,[e("div",uo,[e("div",co,[e("div",vo,[e("div",mo,[(d(!0),u(E,null,G(m.value,(r,h)=>(d(),u("div",{class:"list-group-item pe-1",key:h},[e("div",po,[e("div",go,[r.resolvedLogoUrl&&!r.logoLoadFailed?(d(),u("img",{key:0,src:r.resolvedLogoUrl,class:"rounded catalog-icon",alt:"Catalog Icon",width:"40",height:"40",onError:c=>Te(r)},null,40,fo)):(d(),u("div",bo,[z(te(ra),{class:"icon",size:"22","stroke-width":"1.75"})]))]),e("div",{class:"col-5",onClick:c=>H(h)},[ve(g(r.name)+" ",1),e("div",_o,g(r.summary),1)],8,yo),e("div",{class:"col-3 d-flex justify-content-end",onClick:c=>H(h)},[e("span",ko,[z(te(Ra),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"#e5b942"}),e("span",Co,g(r.averageRating||0),1),e("span",wo," ("+g(r.ratingCount||0)+") ",1)]),e("span",Io,[z(te(Ma),{class:"icon me-1",width:"12",height:"12","stroke-width":"1",color:"gray"}),e("span",So,g(r.downloadCount||0),1)])],8,ho),e("div",Ao,[e("div",To,[e("div",Mo,[z(te(Ea),{class:"me-2 cursor-pointer",size:"15","stroke-width":"2","data-bs-toggle":"modal","data-bs-target":"#modal-wizard",onClick:c=>j(r.id)},null,8,["onClick"]),z(te(Na),{class:"cursor-pointer",size:"15","stroke-width":"2",onClick:c=>V(r)},null,8,["onClick"])])]),e("div",{class:"d-flex justify-content-end",onClick:c=>H(h)},[e("span",No,g(r.category.length>25?r.category.substring(0,25)+"...":r.category),1)],8,Eo)]),e("div",{id:"accordion_"+r.id,class:"accordion-collapse collapse",style:na([r.isShow?{display:"block"}:{display:"none"}])},[e("div",Do,[e("div",{class:"mt-3 mb-5",innerHTML:Me(r.description)},null,8,$o),e("div",null,[n[3]||(n[3]=e("strong",null,"Ref Information",-1)),e("ul",{id:`${h}-entity-ul`},[N(r.refData,"HOMEPAGE")?(d(!0),u(E,{key:0},G(r.refData.HOMEPAGE,(c,U)=>(d(),u("li",{key:U},[e("a",{class:"btn",onClick:X=>Q(c.refValue)},g(c.refValue),9,Lo)]))),128)):L("",!0)],8,Uo),n[4]||(n[4]=e("strong",null,"TAGS",-1)),e("ul",{id:`${h}-tag-ul`},[N(r.refData,"TAG")?(d(!0),u(E,{key:0},G(r.refData.TAG,(c,U)=>(d(),u("span",{key:U},"#"+g(c.refValue)+"  ",1))),128)):L("",!0)],8,xo),n[5]||(n[5]=e("strong",null,"Recommended Spec",-1)),e("ul",{id:`${h}-tag-ul`},[r.recommendedCpu&&r.recommendedMemory&&r.recommendedDisk?(d(),u(E,{key:0},[e("button",Vo," CPU : "+g(r.recommendedCpu)+" Core ",1),e("button",Go," MEMORY : "+g(r.recommendedMemory)+" GB ",1),e("button",Oo," DISK : "+g(r.recommendedDisk)+" GB ",1)],64)):L("",!0)],8,Po),e("div",Ho,[e("div",Bo,[n[0]||(n[0]=e("strong",null,"Deployment Status",-1)),e("button",{type:"button",class:"btn btn-sm btn-icon btn-ghost-secondary",title:"Refresh deployment status","aria-label":"Refresh deployment status",disabled:r.deploymentStatusLoading,onClick:we(c=>Z(r),["stop"])},[z(te(da),{class:"icon",size:"18","stroke-width":"1.75"})],8,Ko)]),r.deploymentStatusLoading?(d(),u("div",Fo," Loading deployment status... ")):(d(),u("div",zo,[e("table",jo,[n[2]||(n[2]=e("thead",null,[e("tr",null,[e("th",null,"Type"),e("th",null,"Target"),e("th",null,"CSP"),e("th",null,"Status"),e("th",null,"IP/Endpoint"),e("th",null,"Last Checked"),e("th",{class:"text-end"},"Detail")])],-1)),e("tbody",null,[r.deploymentStatuses.length===0?(d(),u("tr",qo,n[1]||(n[1]=[e("td",{colspan:"7",class:"text-center text-muted"}," No deployment status available ",-1)]))):L("",!0),(d(!0),u(E,null,G(r.deploymentStatuses,c=>(d(),u("tr",{key:c.rowKey},[e("td",null,g(c.deploymentType),1),e("td",null,g(c.target),1),e("td",null,g(c.csp),1),e("td",null,[e("span",{class:oe(te(ua)(c.status))},g(te(Ke)(c.status)),3)]),e("td",null,g(c.ipOrEndpoint),1),e("td",null,g(c.lastCheckedOrDeployedAt),1),e("td",Yo,[e("button",{type:"button",class:"btn btn-outline-primary",disabled:!c.deploymentId,onClick:we(U=>B(c.deploymentId),["stop"])}," Detail ",8,Wo)])]))),128))])])]))])])])],12,Ro)])]))),128))])])])])],512),z(io,{ref_key:"deleteConfirmModal",ref:Y,"target-catalog":y.value,onDeleted:D,onClose:O},null,8,["target-catalog"]),z(qt,{ref_key:"wizardModal",ref:x,mode:I.value,onCreated:P,onUpdated:P},null,8,["mode"]),z(ca,{ref_key:"applicationDetailModalRef",ref:T,"deployment-id":W.value},null,8,["deployment-id"])],64))}}),Zo={class:"page",ref:"sofwareCatalog"},Qo={class:"page-wrapper"},Xo={class:"page-header d-print-none"},es={class:"container-xxl"},as={class:"row g-2 align-items-center"},ls={class:"col-auto ms-auto"},ts={class:"btn-list"},os={class:"page-body"},ss={class:"container-xxl"},ns={class:"row"},is={class:"col-lg-12"},_s=Ie({__name:"SoftwareCatalog",setup(me){const se=ia(),le=q(()=>se.getNsId()||""),m=v(""),K=v(null),R=A=>{const S=document.getElementById(A);S&&Ta.getOrCreateInstance(S).show()},f=async A=>{m.value=A,await $e(),R("install-form")},I=async()=>{var A;(A=K.value)==null||A.startRegistration(),await $e(),R("modal-wizard")};return(A,S)=>(d(),u(E,null,[e("div",Zo,[e("div",Qo,[e("div",Xo,[e("div",es,[e("div",as,[S[1]||(S[1]=e("div",{class:"col d-flex"},[e("h2",{class:"page-title"},"Software Catalog")],-1)),e("div",ls,[e("div",ts,[e("button",{type:"button",class:"btn btn-outline-primary page-header-action-btn",onClick:I}," Register "),e("button",{type:"button",class:"btn btn-primary page-header-action-btn",onClick:S[0]||(S[0]=y=>f("Application Installation"))}," Deploy ")])])])])]),e("div",os,[e("div",ss,[e("div",ns,[e("div",is,[z(Jo,{ref_key:"softwareCatalogListRef",ref:K},null,512)])])])])])],512),z(ta,{"ns-id":le.value,title:m.value},null,8,["ns-id","title"])],64))}});export{_s as default}; diff --git a/src/main/resources/static/assets/SoftwareCatalogListTest-C5HTJg28.css b/src/main/resources/static/assets/SoftwareCatalogListTest-C5HTJg28.css new file mode 100644 index 0000000..9f70dd0 --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalogListTest-C5HTJg28.css @@ -0,0 +1 @@ +@import"https://rsms.me/inter/inter.css";.me-30[data-v-964f7356]{margin-right:30px}.input-form[data-v-92315a7d]{width:100%!important;display:flex;gap:10px;margin-bottom:10px}.w-50-per[data-v-92315a7d]{width:50%!important}.w-80-per[data-v-92315a7d]{width:80%!important}.w-90-per[data-v-92315a7d]{width:90%!important}:root{--tblr-font-sans-serif: "Inter Var", -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif}body{font-feature-settings:"cv03","cv04","cv11"}.btn-grid-list{display:grid;grid-template-columns:repeat(2,1fr);grid-column-gap:10px;grid-row-gap:10px} diff --git a/src/main/resources/static/assets/SoftwareCatalogListTest-v-qS7pn0.js b/src/main/resources/static/assets/SoftwareCatalogListTest-v-qS7pn0.js new file mode 100644 index 0000000..d6bf361 --- /dev/null +++ b/src/main/resources/static/assets/SoftwareCatalogListTest-v-qS7pn0.js @@ -0,0 +1,11 @@ +import{I as B}from"./IconPlus-CDLv8nZC.js";import{c as L}from"./createVueComponent-DOVlSFKE.js";import{d as D,g as I,o as l,c as n,a as t,t as _,r as c,h as M,i as N,D as j,b as w,u as T,F as x,k as S,m as $,f as A,e as E}from"./index-D89BCYsX.js";import{e as P,x as O,m as U}from"./softwareCatalog-CAQVjm80.js";import{_ as G}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as V}from"./lodash-QU4yi6a5.js";import{A as H}from"./applicationInstallationForm-CeRjQOiG.js";import"./request-CuP4O-bn.js";import"./bootstrap.esm-Ceob_0pG.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var z=L("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var F=L("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);const K={class:"card mb-3"},J={class:"grid"},Y={class:"g-col-5"},q=["src"],Q={class:"col-auto text-muted",style:{"align-items":"center"}},W={class:"col g-col-7"},X={class:"text-muted mt-3",style:{height:"50px"}},Z=D({__name:"softwareCatalogCard",props:{catalogInfo:{},idx:{}},emits:["set-software-catalog-refrence"],setup(C,{emit:y}){const d=C,g=y,e=I(()=>d.catalogInfo),o=I(()=>d.idx),b=async r=>{g("set-software-catalog-refrence",r)};return(r,p)=>(l(),n("div",K,[t("div",{class:"card-body cursor-pointer",onClick:p[0]||(p[0]=m=>b(o.value))},[t("div",J,[t("div",Y,[t("img",{src:e.value.catalogIcon,class:"rounded mb-3",alt:"Catalog Icon",width:"50",height:"50",style:{"margin-left":"5px"}},null,8,q),t("div",Q,_(e.value.catalogCategory),1)]),t("div",W,[t("div",null,[t("b",null,_(e.value.catalogTitle),1),t("div",X,_(e.value.catalogSummary),1)])])])])]))}}),tt={class:"modal",id:"software-card-detail",tabindex:"-1"},st={class:"modal-dialog modal-lg",role:"document"},at={class:"modal-content"},ot={class:"modal-header"},et={class:"modal-title"},lt={class:"modal-body",style:{"max-height":"calc(100vh - 200px)","overflow-y":"auto"}},nt={class:"datagrid"},dt={class:"datagrid-item"},it={class:"d-flex justify-content-space-between"},ct={class:"col-lg-11 d-flex justify-content-start mb-5"},rt={class:"me-30",style:{"margin-right":"30px"}},ut=["src"],vt={class:"col-auto text-muted",style:{"align-items":"center"}},_t={class:"mt-3"},mt={class:"text-muted"},gt={class:"col-lg-1 lh-1"},pt={class:"dropdown"},ht={href:"#",class:"link-secondary","data-bs-toggle":"dropdown"},ft={class:"dropdown-menu dropdown-menu-end"},bt={class:"pt-0"},yt=["innerHTML"],wt={class:"datagrid"},Ct={class:"datagrid-item mb-5"},kt={class:"datagrid-content"},xt=["onClick"],$t={class:"datagrid-item"},It={class:"datagrid-content"},St={key:0},Dt={class:"d-inline"},Tt={class:"datagrid"},Lt={class:"datagrid-item mb-5"},Mt={class:"datagrid-content"},Nt={class:"btn btn-sm",style:{"margin-right":"5px"}},jt={class:"btn btn-sm",style:{"margin-right":"5px"}},At={class:"btn btn-sm",style:{"margin-right":"5px"}},Et={class:"footer"},Rt={class:"col-auto me-auto fs-3"},Bt={class:"d-flex justify-content-center"},Pt=D({__name:"softwareCatalogCardDetail",props:{catalogIdx:{}},emits:["set-software-catalog-refrence","on-click-deploy"],setup(C,{emit:y}){const d=C,g=y,e=I(()=>d.catalogIdx),o=c({});M(()=>e.value,async()=>{await b(e.value)}),N(async()=>{await b(e.value)});const b=async i=>{await P(Number(i)).then(({data:s})=>{s.catalogIcon=j(s.catalogIcon),o.value=s})},r=c("new"),p=i=>{r.value="update"},m=i=>i===void 0?"":i.replace(/\\n|\n/g,"
"),u=(i,s)=>i===void 0?null:Object.prototype.hasOwnProperty.call(i,s),h=i=>{window.open(i)},k=i=>{g("on-click-deploy",i)};return(i,s)=>{var a,f;return l(),n("div",tt,[t("div",st,[t("div",at,[t("div",ot,[t("h5",et,_(o.value.catalogTitle),1),s[3]||(s[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",lt,[t("div",nt,[t("div",dt,[t("div",it,[t("div",ct,[t("div",rt,[t("img",{src:o.value.catalogIcon,class:"rounded mb-3",alt:"Catalog Icon",width:"50",height:"50",style:{"margin-left":"5px"}},null,8,ut),t("div",vt,_(o.value.catalogCategory),1)]),t("div",_t,[t("b",null,_(o.value.catalogTitle),1),t("div",mt,_(o.value.catalogSummary),1)])]),t("div",gt,[t("div",pt,[t("a",ht,[w(T(z),{class:"icon icon-tabler",color:"black",size:20,"stroke-width":"2"})]),t("div",ft,[t("a",{class:"dropdown-item",onClick:s[0]||(s[0]=v=>p(o.value.catalogIdx||0)),"data-bs-toggle":"modal","data-bs-target":"#modal-form"},"Update")])])])])])]),t("div",bt,[t("div",{class:"mb-5",style:{"white-space":"pre-wrap"},innerHTML:m(o.value.catalogDescription||"")},null,8,yt),t("div",wt,[t("div",Ct,[s[4]||(s[4]=t("div",{class:"datagrid-title"},"Ref Information",-1)),t("div",kt,[u(o.value.refData,"HOMEPAGE")?(l(!0),n(x,{key:0},S((a=o.value.refData)==null?void 0:a.HOMEPAGE,v=>(l(),n("div",{key:v},[t("a",{onClick:R=>h(v),class:"btn"},_(v),9,xt)]))),128)):$("",!0)])]),t("div",$t,[s[5]||(s[5]=t("div",{class:"datagrid-title"},"TAGS",-1)),t("div",It,[u(o.value.refData,"TAG")?(l(),n("div",St,[(l(!0),n(x,null,S((f=o.value.refData)==null?void 0:f.TAG,v=>(l(),n("div",{class:"d-inline",key:v},[t("div",Dt,[t("span",null,"#"+_(v)+"  ",1)])]))),128))])):$("",!0)])])]),t("div",Tt,[t("div",Lt,[s[6]||(s[6]=t("div",{class:"datagrid-title"},"Recommended Spec",-1)),t("div",Mt,[o.value.recommendedCpu&&o.value.recommendedMemory&&o.value.recommendedDisk?(l(),n(x,{key:0},[t("button",Nt," CPU : "+_(o.value.recommendedCpu),1),t("button",jt," MEMORY : "+_(o.value.recommendedMemory),1),t("button",At," DISK : "+_(o.value.recommendedDisk),1)],64)):$("",!0)])])])])]),t("div",Et,[t("div",Rt,[t("div",Bt,[t("button",{class:"btn btn-primary me-md-2 mb-2","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:s[1]||(s[1]=v=>k("Application Installation"))},"INSTALL"),t("button",{class:"btn btn-danger me-md-2 mb-2","data-bs-toggle":"modal","data-bs-target":"#install-form",onClick:s[2]||(s[2]=v=>k("Application Uninstallation"))},"UNINSTALL")])])])])])])}}}),Ot=G(Pt,[["__scopeId","data-v-964f7356"]]),Ut={class:"modal fade",id:"softwareCatalogLog",tabindex:"-1"},Gt={class:"modal-dialog modal-xl",role:"document"},Vt={class:"modal-content"},Ht={class:"modal-body text-left py-4"},zt={class:"mb-5"},Ft={key:0,class:"spinner-border",role:"status"},Kt={key:0},Jt={class:"card mb-3"},Yt=["onClick"],qt={class:"card-title"},Qt={key:0,class:"card-body"},Wt=["value"],Xt=D({__name:"softwareCatalogLog",props:{jobName:{}},setup(C){A();const y=C,d=c(!1),g=I(()=>y.jobName);M(g,async()=>{d.value=!1,await o()});const e=c([]),o=async()=>{e.value=[];const m=await O(g.value);e.value=m.data.data,d.value=!0},b=()=>{e.value=[],r.value=1},r=c(1),p=m=>{r.value===m?r.value=0:r.value=m};return(m,u)=>(l(),n("div",Ut,[t("div",Gt,[t("div",Vt,[u[3]||(u[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1)),t("div",Ht,[t("h3",zt,[u[1]||(u[1]=E(" Build Log ")),d.value?$("",!0):(l(),n("div",Ft,u[0]||(u[0]=[t("span",{class:"visually-hidden"},"Loading...",-1)])))]),t("div",null,[e.value.length<=0?(l(),n("div",Kt,u[2]||(u[2]=[t("p",{class:"text-secondary"},"No Data",-1)]))):(l(!0),n(x,{key:1},S(e.value,h=>(l(),n("div",{key:h.buildIdx},[t("div",Jt,[t("div",{class:"card-header",onClick:k=>p(h.buildIdx),style:{cursor:"pointer"}},[t("h3",qt,_(h.buildIdx),1)],8,Yt),r.value===h.buildIdx?(l(),n("div",Qt,[t("textarea",{value:h.buildLog,disabled:"",style:{width:"100%"},rows:"20"},null,8,Wt)])):$("",!0)])]))),128))])]),t("div",{class:"modal-footer"},[t("a",{class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:b}," Cancel ")])])])]))}}),Zt={class:"page",ref:"sofwareCatalog"},ts={class:"page-wrapper"},ss={class:"page-header d-print-none"},as={class:"container-xl"},os={class:"row g-2 align-items-center"},es={class:"col-auto ms-auto d-print-none"},ls={class:"d-flex"},ns={class:"me-3 d-none d-md-block"},ds={class:"input-icon"},is={class:"input-icon-addon"},cs={class:"col-auto ms-auto"},rs={class:"btn-list"},us={class:"page-body"},vs={class:"container-xl"},_s={class:"row"},ms={class:"col-auto"},gs={class:"card bg-color-white"},ps={class:"card-body"},hs={class:"row row-deck"},fs={class:"w-100"},Ds=D({__name:"SoftwareCatalogListTest",setup(C){const y=A(),d=c([]),g=c("");c([]),c([]);const e=c(0),o=c(""),b=c("new"),r=c("");c("ns01");const p=c("");N(async()=>{g.value="",window.addEventListener("message",async function(s){const a=s.data;a.projectInfo&&(r.value=a.projectInfo.ns_id)}),await m()});const m=async()=>{try{const s=await U(g.value);V.forEach(s.data,function(a){a.catalogIcon=j(a.catalogIcon),a.refData=u(a.catalogRefData),a.isShow=!1}),d.value=s.data}catch(s){console.log(s),y.error("데이터를 가져올 수 없습니다.")}},u=s=>s.reduce((a,f)=>(a[f.referenceType]||(a[f.referenceType]=[]),a[f.referenceType].push(f),a),{}),h=async s=>{e.value=s,d.value.forEach(a=>{a.isShow=!1}),d.value[s].isShow=!d.value[s].isShow},k=()=>{b.value="new",e.value=0},i=s=>{p.value=s};return(s,a)=>(l(),n("div",Zt,[t("div",ts,[t("div",ss,[t("div",as,[t("div",os,[a[2]||(a[2]=t("div",{class:"col d-flex"},[t("h2",{class:"page-title"},"Software catalog")],-1)),t("div",es,[t("div",ls,[t("div",ns,[t("div",ds,[a[0]||(a[0]=t("input",{type:"text",class:"form-control",placeholder:"Search…"},null,-1)),t("span",is,[w(T(F),{class:"icon icon-tabler icon-tabler-search",size:24})])])])])]),t("div",cs,[t("div",rs,[t("a",{class:"btn btn-primary d-none d-sm-inline-block",onClick:k,"data-bs-toggle":"modal","data-bs-target":"#modal-form"},[w(T(B),{class:"icon icon-tabler icon-tabler-plus",color:"white",size:20,"stroke-width":"2"}),a[1]||(a[1]=E(" New "))])])])])])]),t("div",us,[t("div",vs,[t("div",_s,[t("div",ms,[t("div",gs,[t("div",ps,[t("div",hs,[(l(!0),n(x,null,S(d.value,(f,v)=>(l(),n("div",{class:"col-md-4",key:v,style:{width:"33%",display:"flex","justify-content":"space-between"}},[t("div",fs,[w(Z,{"catalog-info":f,idx:v,"data-bs-toggle":"modal","data-bs-target":"#software-card-detail",onSetSoftwareCatalogRefrence:R=>h(v)},null,8,["catalog-info","idx","onSetSoftwareCatalogRefrence"])])]))),128))])])])])])])])]),w(Xt,{"job-name":o.value},null,8,["job-name"]),w(H,{"ns-id":r.value,title:p.value,"catalog-list":d.value},null,8,["ns-id","title","catalog-list"]),w(Ot,{"catalog-idx":e.value+1,onOnClickDeploy:i},null,8,["catalog-idx"])],512))}});export{Ds as default}; diff --git a/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js new file mode 100644 index 0000000..d558333 --- /dev/null +++ b/src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js @@ -0,0 +1,22 @@ +var vt=Object.defineProperty;var wt=(l,e,t)=>e in l?vt(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t;var b=(l,e,t)=>wt(l,typeof e!="symbol"?e+"":e,t);import{d as Ct,r as Ge,h as je,i as Et,B as yt,x as Rt,c as xt,o as Tt}from"./index-D89BCYsX.js";class M{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return typeof t<"u"&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t,i){return this.table.deprecationAdvisor.check(e,t,i)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class x{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(e,t,i){var s=e?t.split(e):[t],n=s.length,r;for(let o=0;od.subject===o),a>-1?t[r]=i[a].copy:(h=Object.assign(Array.isArray(o)?[]:{},o),i.unshift({subject:o,copy:h}),t[r]=this.deepClone(o,h,i)))}return t}}let kt=class Ke extends M{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.blurEventsBound=!1,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed.bind(this),this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return typeof e=="string"?(e=document.querySelector(e),e||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")):e===!0&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t?!0:t.parentNode?this._checkContainerIsParent(e,t.parentNode):!1}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,s=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let n=x.elOffset(this.container);i-=n.left,s-=n.top}return{x:i,y:s}}elementPositionCoords(e,t="right"){var i=x.elOffset(e),s,n,r;switch(this.container!==document.body&&(s=x.elOffset(this.container),i.left-=s.left,i.top-=s.top),t){case"right":n=i.left+e.offsetWidth,r=i.top-1;break;case"bottom":n=i.left,r=i.top+e.offsetHeight;break;case"left":n=i.left,r=i.top-1;break;case"top":n=i.left,r=i.top;break;case"center":n=i.left+e.offsetWidth/2,r=i.top+e.offsetHeight/2;break}return{x:n,y:r,offset:i}}show(e,t){var i,s,n,r,o;return this.destroyed||this.table.destroyed?this:(e instanceof HTMLElement?(n=e,o=this.elementPositionCoords(e,t),r=o.offset,i=o.x,s=o.y):typeof e=="number"?(r={top:0,left:0},i=e,s=t):(o=this.containerEventCoords(e),i=o.x,s=o.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),typeof this.renderedCallback=="function"&&this.renderedCallback(),this._fitToScreen(i,s,n,r,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",a=>{a.stopPropagation()}),this)}_fitToScreen(e,t,i,s,n){var r=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;(e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",i?this.element.style.right=this.container.offsetWidth-s.left+"px":this.element.style.right=this.container.offsetWidth-e+"px",this.reversedX=!0);let o=Math.max(this.container.offsetHeight,r?this.container.scrollHeight:0);if(t+this.element.offsetHeight>o)if(i)switch(n){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.height=o+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout(()=>{this.visible&&(this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent),this.blurEventsBound=!0)},100),this.blurCallback=e),this}_escapeCheck(e){e.keyCode==27&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&this.blurEventsBound&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent),this.blurEventsBound=!1),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new Ke(this.table,e,this),this.childPopup}};class w extends M{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){typeof this.table[e]>"u"?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t=this.table.rowManager.displayRows.length-1,i;if(this._handler&&(i=this.table.rowManager.displayPipeline.findIndex(s=>s.handler===this._handler),i>-1&&(t=i)),e&&(t=t+e),this._handler)return t>-1?this.table.rowManager.getDisplayRows(t):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new kt(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}var Mt={rownum:function(l,e,t,i,s,n){return n.getPosition()}};const K=class K extends w{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupAccessor(e.definition[n]),r&&(t=!0,i[n]={accessor:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":K.accessors[e]?t=K.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),s=e.getComponent(),n=x.deepClone(e.data||{});return this.table.columnManager.traverse(function(r){var o,a,h,d;r.modules.accessor&&(a=r.modules.accessor[i]||r.modules.accessor.accessor||!1,a&&(o=r.getFieldValue(n),o!="undefined"&&(d=r.getComponent(),h=typeof a.params=="function"?a.params(o,n,t,d,s):a.params,r.setFieldValue(n,a.accessor(o,n,t,h,d,s)))))}),n}};b(K,"moduleName","accessor"),b(K,"accessors",Mt);let ce=K;var Lt={method:"GET"};function fe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(fe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(fe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}function St(l){var e=fe(l),t=[];return e.forEach(function(i){t.push(encodeURIComponent(i.key)+"="+encodeURIComponent(i.value))}),t.join("&")}function qe(l,e,t){return l&&t&&Object.keys(t).length&&(!e.method||e.method.toLowerCase()=="get")&&(e.method="get",l+=(l.includes("?")?"&":"?")+St(t)),l}function Dt(l,e,t){var i;return new Promise((s,n)=>{if(l=this.urlGenerator.call(this.table,l,e,t),e.method.toUpperCase()!="GET")if(i=typeof this.table.options.ajaxContentType=="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType],i){for(var r in i.headers)e.headers||(e.headers={}),typeof e.headers[r]>"u"&&(e.headers[r]=i.headers[r]);e.body=i.body.call(this,l,e,t)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);l?(typeof e.headers>"u"&&(e.headers={}),typeof e.headers.Accept>"u"&&(e.headers.Accept="application/json"),typeof e.headers["X-Requested-With"]>"u"&&(e.headers["X-Requested-With"]="XMLHttpRequest"),typeof e.mode>"u"&&(e.mode="cors"),e.mode=="cors"?(typeof e.headers.Origin>"u"&&(e.headers.Origin=window.location.origin),typeof e.credentials>"u"&&(e.credentials="same-origin")):typeof e.credentials>"u"&&(e.credentials="include"),fetch(l,e).then(o=>{o.ok?o.json().then(a=>{s(a)}).catch(a=>{n(a),console.warn("Ajax Load Error - Invalid JSON returned",a)}):(console.error("Ajax Load Error - Connection Error: "+o.status,o.statusText),n(o))}).catch(o=>{console.error("Ajax Load Error - Connection Error: ",o),n(o)})):(console.warn("Ajax Load Error - No URL Set"),s([]))})}function pe(l,e){var t=[];if(e=e||"",Array.isArray(l))l.forEach((s,n)=>{t=t.concat(pe(s,e?e+"["+n+"]":n))});else if(typeof l=="object")for(var i in l)t=t.concat(pe(l[i],e?e+"["+i+"]":i));else t.push({key:e,value:l});return t}var zt={json:{headers:{"Content-Type":"application/json"},body:function(l,e,t){return JSON.stringify(t)}},form:{headers:{},body:function(l,e,t){var i=pe(t),s=new FormData;return i.forEach(function(n){s.append(n.key,n.value)}),s}}};const F=class F extends w{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",function(){}),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=F.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||F.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||F.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var n=this.table.options.ajaxParams;return n&&(typeof n=="function"&&(n=n.call(this.table)),s=Object.assign(Object.assign({},n),s)),s}requestDataCheck(e,t,i,s){return!!(!e&&this.url||typeof e=="string")}requestData(e,t,i,s,n){var r;return!n&&this.requestDataCheck(e)?(e&&this.setUrl(e),r=this.generateConfig(i),this.sendRequest(this.url,t,r)):n}setDefaultConfig(e={}){this.config=Object.assign({},F.defaultConfig),typeof e=="string"?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return typeof e=="string"?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return this.table.options.ajaxRequesting.call(this.table,e,t)!==!1?this.loaderPromise(e,i,t).then(s=>(this.table.options.ajaxResponse&&(s=this.table.options.ajaxResponse.call(this.table,e,t,s)),s)):Promise.reject()}};b(F,"moduleName","ajax"),b(F,"defaultConfig",Lt),b(F,"defaultURLGenerator",qe),b(F,"defaultLoaderPromise",Dt),b(F,"contentTypeFormatters",zt);let me=F;var Ht={replace:function(l){return this.table.setData(l)},update:function(l){return this.table.updateOrAddData(l)},insert:function(l){return this.table.addData(l)}},Ft={table:function(l){var e=[],t=!0,i=this.table.columnManager.columns,s=[],n=[];return l=l.split(` +`),l.forEach(function(r){e.push(r.split(" "))}),e.length&&!(e.length===1&&e[0].length<2)?(e[0].forEach(function(r){var o=i.find(function(a){return r&&a.definition.title&&r.trim()&&a.definition.title.trim()===r.trim()});o?s.push(o):t=!1}),t||(t=!0,s=[],e[0].forEach(function(r){var o=i.find(function(a){return r&&a.field&&r.trim()&&a.field.trim()===r.trim()});o?s.push(o):t=!1}),t||(s=this.table.columnManager.columnsByIndex)),t&&e.shift(),e.forEach(function(r){var o={};r.forEach(function(a,h){s[h]&&(o[s[h].field]=a)}),n.push(o)}),n):!1}},Pt={copyToClipboard:["ctrl + 67","meta + 67"]},Ot={copyToClipboard:function(l){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}},At={keybindings:{bindings:Pt,actions:Ot}};const _=class _ extends w{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,(this.mode===!0||this.mode==="copy")&&this.table.element.addEventListener("copy",e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),i=this.table.modules.export.generateHTMLTable(s),t=i?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())}),(this.mode===!0||this.mode==="paste")&&this.table.element.addEventListener("paste",e=>{this.paste(e)}),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach(i=>{var s=[];i.columns.forEach(n=>{var r="";if(n)if(i.type==="group"&&(n.value=n.component.getKey()),n.value===null)r="";else switch(typeof n.value){case"object":r=JSON.stringify(n.value);break;case"undefined":r="";break;default:r=n.value}s.push(r)}),t.push(s.join(" "))}),t.join(` +`)}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,(this.mode===!0||this.mode==="copy")&&(this.rowRange=e||this.table.options.clipboardCopyRowRange,typeof window.getSelection<"u"&&typeof document.createRange<"u"?(e=document.createRange(),e.selectNodeContents(this.table.element),i=window.getSelection(),i.toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):typeof document.selection<"u"&&typeof document.body.createTextRange<"u"&&(s=document.body.createTextRange(),s.moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=_.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e;break}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=_.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e;break}}paste(e){var t,i,s;this.checkPasteOrigin(e)&&(t=this.getPasteData(e),i=this.pasteParser.call(this,t),i?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach(i=>{t.push(this.table.modules.mutator.transformRow(i,"clipboard"))}):t=e,t}checkPasteOrigin(e){var t=!0,i=this.confirm("clipboard-paste",[e]);return(i||!["DIV","SPAN"].includes(e.target.tagName))&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}};b(_,"moduleName","clipboard"),b(_,"moduleExtensions",At),b(_,"pasteActions",Ht),b(_,"pasteParsers",Ft);let ge=_;class _t{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}_getSelf(){return this._row}}class Ye{constructor(e){return this._cell=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(e){return this._cell.row.getData(e)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){typeof t>"u"&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class ne extends M{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell"),this.column.isRowHeader&&this.element.classList.add("tabulator-row-header")}_configureCell(){var e=this.element,t=this.column.getField(),i={top:"flex-start",bottom:"flex-end",middle:"center"},s={left:"flex-start",right:"flex-end",center:"center"};if(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems=i[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent=s[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass){var n=this.column.definition.cssClass.split(" ");n.forEach(r=>{e.classList.add(r)})}this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(e=this.chain("cell-format",this,null,()=>this.element.innerHTML=this.value),typeof e){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",e!=null&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){var s=this.setValueProcessData(e,t,i);s&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new Ye(this)),this.component}}class $e{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._column.table.componentFunctionBinder.handle("column",t._column,i)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach(function(t){e.push(t.getComponent())}),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach(function(e){e.show()}):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach(function(e){e.hide()}):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach(function(t){e.push(t.getComponent())}),e}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(e,t){return this._column.table.columnManager.scrollToColumn(this._column,e,t)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return e?e.getComponent():!1}getPrevColumn(){var e=this._column.prevColumn();return e?e.getComponent():!1}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return e===!0?t=this._column.reinitializeWidth(!0):t=this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var Qe={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,headerWordWrap:!1,editableTitle:void 0};const W=class W extends M{constructor(e,t,i){super(t.table),this.definition=e,this.parent=t,this.type="column",this.columns=[],this.cells=[],this.isGroup=!1,this.isRowHeader=i,this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach((s,n)=>{var r=new W(s,this);this.attachColumn(r)}),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.isRowHeader&&e.classList.add("tabulator-row-header"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end";break}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)typeof this.definition[t]>"u"&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(W.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach(e=>{W.defaultOptionList.indexOf(e)===-1&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)})}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach(function(e){e.reRegisterPosition()}):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),e.headerVertical==="flip"&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;if(this.dispatch("column-layout",this),typeof e.visible<"u"&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass){var t=e.cssClass.split(" ");t.forEach(i=>{this.element.classList.add(i)})}e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.headerWordWrap&&t.classList.add("tabulator-col-title-wrap"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",s=>{s.stopPropagation(),i.focus()}),i.addEventListener("mousedown",s=>{s.stopPropagation()}),i.addEventListener("change",()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())}),t.appendChild(i),e.field?this.langBind("columns|"+e.field,s=>{i.value=s||e.title||" "}):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,s=>{this._formatColumnHeaderTitle(t,s||e.title||" ")}):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,()=>t);switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){if(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass){var e=this.definition.cssClass.split(" ");e.forEach(t=>{this.element.classList.add(t)})}this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t=e,i=this.fieldStructure,s=i.length,n;for(let r=0;r{t.push(i),t=t.concat(i.getColumns(!0))}):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach(function(i){t.push(i.getDefinition(!0))}),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach(function(t){t.visible&&(e=!0)}),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.show()}),!this.isGroup&&this.width===null&&this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach(function(i){i.hide()}),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}),this.contentElement.style.maxWidth=e-1+"px",this.table.initialized&&(this.element.style.width=e+"px"),this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach(function(t){t.setWidth()}),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this),this.subscribedExternal("columnWidth")&&this.dispatchExternal("columnWidth",this.getComponent())}checkCellHeights(){var e=[];this.cells.forEach(function(t){t.row.heightInitialized&&(t.row.getElement().offsetParent!==null?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)}),e.forEach(function(t){t.calcHeight()}),e.forEach(function(t){t.setCellHeight()})}getWidth(){var e=0;return this.isGroup?this.columns.forEach(function(t){t.visible&&(e+=t.getWidth())}):e=this.width,e}getLeftOffset(){var e=this.element.offsetLeft;return this.parent.isGroup&&(e+=this.parent.getLeftOffset()),e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach(function(t){t.setMinWidth()})}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach(function(s){s.delete()}),this.dispatch("column-delete",this);var i=this.cells.length;for(let s=0;s-1?this._nextVisibleColumn(e+1):!1}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1?this._prevVisibleColumn(e-1):!1}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,typeof this.definition.width<"u"&&!e&&this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach(s=>{s.clearWidth()}));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach(s=>{var n=s.getWidth();n>t&&(t=n)}),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then(i=>(t.field==this.field&&(this.field=!1),this.delete().then(()=>i.getComponent()))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new $e(this)),this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof W?this.parent.getComponent():!1}};b(W,"defaultOptionList",Qe);let U=W;class oe{constructor(e){return this._row=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._row.table.componentFunctionBinder.handle("row",t._row,i)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach(function(t){e.push(t.getComponent())}),e}getCell(e){var t=this._row.getCell(e);return t?t.getComponent():!1}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(e,t){return this._row.table.rowManager.scrollToRow(this._row,e,t)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e&&e.getComponent()}getPrevRow(){var e=this._row.prevRow();return e&&e.getComponent()}}class S extends M{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e,t){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this,t),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this,t)}rendered(){this.cells.forEach(e=>{e.cellRendered()})}reinitializeHeight(){this.heightInitialized=!1,this.element&&this.element.offsetParent!==null&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&this.element.offsetParent!==null&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t=0,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(i=this.calcMinHeight(),t=this.calcMaxHeight(),e?this.height=Math.max(t,i):this.height=this.manualHeight?this.height:Math.max(t,i)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var e=0;return this.cells.forEach(function(t){var i=t.getHeight();i>e&&(e=i)}),e}setCellHeight(){this.cells.forEach(function(e){e.setHeight()}),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach(function(e){e.clearHeight()})}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight,this.subscribedExternal("rowHeight")&&this.dispatchExternal("rowHeight",this.getComponent()))}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var t=this.element&&x.elVisible(this.element),i={},s;return new Promise((n,r)=>{typeof e=="string"&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(i=Object.assign(i,this.data),i=Object.assign(i,e)),s=this.chain("row-data-changing",[this,i,e],null,e);for(let o in s)this.data[o]=s[o];this.dispatch("row-data-save-after",this);for(let o in e)this.table.columnManager.getColumnsByFieldRoot(o).forEach(h=>{let d=this.getCell(h.getField());if(d){let u=h.getFieldValue(s);d.getValue()!==u&&(d.setValueProcessData(u),t&&d.cellRendered())}});t?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,t,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n()})}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){var t=!1;return e=this.table.columnManager.findColumn(e),!this.initialized&&this.cells.length===0&&this.generateCells(),t=this.cells.find(function(i){return i.column===e}),t}getCellIndex(e){return this.cells.findIndex(function(t){return t===e})}findCell(e){return this.cells.find(t=>t.element===e)}getCells(){return!this.initialized&&this.cells.length===0&&this.generateCells(),this.cells}nextRow(){var e=this.table.rowManager.nextDisplayRow(this,!0);return e||!1}prevRow(){var e=this.table.rowManager.prevDisplayRow(this,!0);return e||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{t(this.position)}))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new oe(this)),this.component}}var Bt={avg:function(l,e,t){var i=0,s=typeof t.precision<"u"?t.precision:2;return l.length&&(i=l.reduce(function(n,r){return Number(n)+Number(r)}),i=i/l.length,i=s!==!1?i.toFixed(s):i),parseFloat(i).toString()},max:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n>i||i===null)&&(i=n)}),i!==null?s!==!1?i.toFixed(s):i:""},min:function(l,e,t){var i=null,s=typeof t.precision<"u"?t.precision:!1;return l.forEach(function(n){n=Number(n),(n(l||s===0)&&l.indexOf(s)===n);return i.length}};const B=class B extends w{constructor(e){super(e),this.topCalcs=[],this.botCalcs=[],this.genColumn=!1,this.topElement=this.createElement(),this.botElement=this.createElement(),this.topRow=!1,this.botRow=!1,this.topInitialized=!1,this.botInitialized=!1,this.blocked=!1,this.recalcAfterBlock=!1,this.registerTableOption("columnCalcs",!0),this.registerColumnOption("topCalc"),this.registerColumnOption("topCalcParams"),this.registerColumnOption("topCalcFormatter"),this.registerColumnOption("topCalcFormatterParams"),this.registerColumnOption("bottomCalc"),this.registerColumnOption("bottomCalcParams"),this.registerColumnOption("bottomCalcFormatter"),this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-calcs-holder"),e}initialize(){this.genColumn=new U({field:"value"},this),this.subscribe("cell-value-changed",this.cellValueChanged.bind(this)),this.subscribe("column-init",this.initializeColumnCheck.bind(this)),this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("column-moved",this.recalcActiveRows.bind(this)),this.subscribe("column-add",this.recalcActiveRows.bind(this)),this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this)),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("rows-visible",this.visibleRows.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this)),this.subscribe("redraw-blocked",this.blockRedraw.bind(this)),this.subscribe("redraw-restored",this.restoreRedraw.bind(this)),this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this)),this.subscribe("column-resized",this.resizeHolderWidth.bind(this)),this.subscribe("column-show",this.resizeHolderWidth.bind(this)),this.subscribe("column-hide",this.resizeHolderWidth.bind(this)),this.registerTableFunction("getCalcResults",this.getResults.bind(this)),this.registerTableFunction("recalc",this.userRecalc.bind(this)),this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(e){this.recalc(this.table.rowManager.activeRows),e&&this.redraw()}blockRedraw(){this.blocked=!0,this.recalcAfterBlock=!1}restoreRedraw(){this.blocked=!1,this.recalcAfterBlock&&(this.recalcAfterBlock=!1,this.recalcActiveRowsRefresh())}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){return this.blocked&&(this.recalcAfterBlock=!0),this.blocked}visibleRows(e,t){return this.topRow&&t.unshift(this.topRow),this.botRow&&t.push(this.botRow),t}rowsUpdated(e){this.table.options.groupBy?this.recalcRowGroup(e):this.recalcActiveRows()}recalcActiveRowsRefresh(){this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree?this.recalcAll():this.recalcActiveRows()}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(e){(e.column.definition.topCalc||e.column.definition.bottomCalc)&&(this.table.options.groupBy?((this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both")&&this.recalcActiveRows(),this.table.options.columnCalcs!="table"&&this.recalcRowGroup(e.row)):this.recalcActiveRows())}initializeColumnCheck(e){(e.definition.topCalc||e.definition.bottomCalc)&&this.initializeColumn(e)}initializeColumn(e){var t=e.definition,i={topCalcParams:t.topCalcParams||{},botCalcParams:t.bottomCalcParams||{}};if(t.topCalc){switch(typeof t.topCalc){case"string":B.calculations[t.topCalc]?i.topCalc=B.calculations[t.topCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.topCalc);break;case"function":i.topCalc=t.topCalc;break}i.topCalc&&(e.modules.columnCalcs=i,this.topCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeTopRow())}if(t.bottomCalc){switch(typeof t.bottomCalc){case"string":B.calculations[t.bottomCalc]?i.botCalc=B.calculations[t.bottomCalc]:console.warn("Column Calc Error - No such calculation found, ignoring: ",t.bottomCalc);break;case"function":i.botCalc=t.bottomCalc;break}i.botCalc&&(e.modules.columnCalcs=i,this.botCalcs.push(e),this.table.options.columnCalcs!="group"&&this.initializeBottomRow())}}registerColumnField(){}removeCalcs(){var e=!1;this.topInitialized&&(this.topInitialized=!1,this.topElement.parentNode.removeChild(this.topElement),e=!0),this.botInitialized&&(this.botInitialized=!1,this.footerRemove(this.botElement),e=!0),e&&this.table.rowManager.adjustTableSize()}reinitializeCalcs(){this.topCalcs.length&&this.initializeTopRow(),this.botCalcs.length&&this.initializeBottomRow()}initializeTopRow(){var e=document.createDocumentFragment();this.topInitialized||(e.appendChild(document.createElement("br")),e.appendChild(this.topElement),this.table.columnManager.getContentsElement().insertBefore(e,this.table.columnManager.headersElement.nextSibling),this.topInitialized=!0)}initializeBottomRow(){this.botInitialized||(this.footerPrepend(this.botElement),this.botInitialized=!0)}scrollHorizontal(e){this.botInitialized&&this.botRow&&(this.botElement.scrollLeft=e)}recalc(e){var t,i;if(!this.blockCheck()&&(this.topInitialized||this.botInitialized)){if(t=this.rowsToData(e),this.topInitialized){for(this.topRow&&this.topRow.deleteCells(),i=this.generateRow("top",t),this.topRow=i;this.topElement.firstChild;)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(i.getElement()),i.initialize(!0)}if(this.botInitialized){for(this.botRow&&this.botRow.deleteCells(),i=this.generateRow("bottom",t),this.botRow=i;this.botElement.firstChild;)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(i.getElement()),i.initialize(!0)}this.table.rowManager.adjustTableSize(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()}}recalcRowGroup(e){this.recalcGroup(this.table.modules.groupRows.getRowGroup(e))}recalcAll(){if((this.topCalcs.length||this.botCalcs.length)&&(this.table.options.columnCalcs!=="group"&&this.recalcActiveRows(),this.table.options.groupBy&&this.table.options.columnCalcs!=="table")){var e=this.table.modules.groupRows.getChildGroups();e.forEach(t=>{this.recalcGroup(t)})}}recalcGroup(e){var t,i;this.blockCheck()||e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[],i=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;return e.forEach(n=>{var r;t.push(n.getData()),i&&((r=n.modules.dataTree)!=null&&r.open)&&this.rowsToData(s.getFilteredTreeChildren(n)).forEach(o=>{t.push(n)})}),t}generateRow(e,t){var i=this.generateRowData(e,t),s;return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),s=new S(i,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),s.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),s.component=!1,s.getComponent=()=>(s.component||(s.component=new _t(s)),s.component),s.generateCells=()=>{var n=[];this.table.columnManager.columnsByIndex.forEach(r=>{this.genColumn.setField(r.getField()),this.genColumn.hozAlign=r.hozAlign,r.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(r.definition[e+"CalcFormatter"]),params:r.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=r.definition.cssClass;var o=new ne(this.genColumn,s);o.getElement(),o.column=r,o.setWidth(),r.cells.push(o),n.push(o),r.visible||o.hide()}),s.cells=n},s}generateRowData(e,t){var i={},s=e=="top"?this.topCalcs:this.botCalcs,n=e=="top"?"topCalc":"botCalc",r,o;return s.forEach(function(a){var h=[];a.modules.columnCalcs&&a.modules.columnCalcs[n]&&(t.forEach(function(d){h.push(a.getFieldValue(d))}),o=n+"Params",r=typeof a.modules.columnCalcs[o]=="function"?a.modules.columnCalcs[o](h,t):a.modules.columnCalcs[o],a.setFieldValue(i,a.modules.columnCalcs[n](h,t,r)))}),i}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={},t;return this.table.options.groupBy&&this.table.modExists("groupRows")?(t=this.table.modules.groupRows.getGroups(!0),t.forEach(i=>{e[i.getKey()]=this.getGroupResults(i)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={},n={};return i.forEach(r=>{s[r.getKey()]=this.getGroupResults(r)}),n={top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s},n}adjustForScrollbar(e){this.botRow&&(this.table.rtl?this.botElement.style.paddingLeft=e+"px":this.botElement.style.paddingRight=e+"px")}};b(B,"moduleName","columnCalcs"),b(B,"calculations",Bt);let be=B;class Ze extends w{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement?t.dataTreeBranchElement===!0?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):typeof t.dataTreeBranchElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement:(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch-empty")),t.dataTreeCollapseElement?typeof t.dataTreeCollapseElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?typeof t.dataTreeExpandElement=="string"?(e=document.createElement("div"),e.innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(i,s){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(i,s){return t.dataTreeStartExpanded[s]};break}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){var t;e&&(t=this.table.rowManager.getRows(),t.forEach(i=>{this.reinitializeRowChildren(i)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(e?e.field:!1)}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach(t=>{e=e.concat(this.getTreeChildren(t,!1,!0))}),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){var t=e.column.getField();t===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&typeof t=="object"&&t!==null;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:s?e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0):!1,controlEl:e.modules.dataTree&&s?e.modules.dataTree.controlEl:!1,branchEl:e.modules.dataTree&&s?e.modules.dataTree.branchEl:!1,parent:e.modules.dataTree?e.modules.dataTree.parent:!1,children:s}}reinitializeRowChildren(e){var t=this.getTreeChildren(e,!1,!0);t.forEach(function(i){i.reinitialize(!0)})}layoutRow(e){var t=this.elementField?e.getCell(this.elementField):e.getCells()[0],i=t.getElement(),s=e.modules.dataTree;s.branchEl&&(s.branchEl.parentNode&&s.branchEl.parentNode.removeChild(s.branchEl),s.branchEl=!1),s.controlEl&&(s.controlEl.parentNode&&s.controlEl.parentNode.removeChild(s.controlEl),s.controlEl=!1),this.generateControlElement(e,i),e.getElement().classList.add("tabulator-tree-level-"+s.index),s.index&&(this.branchEl?(s.branchEl=this.branchEl.cloneNode(!0),i.insertBefore(s.branchEl,i.firstChild),this.table.rtl?s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px":s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"):this.table.rtl?i.style.paddingRight=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-right"))+s.index*this.indent+"px":i.style.paddingLeft=parseInt(window.getComputedStyle(i,null).getPropertyValue("padding-left"))+s.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),i.children!==!1&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.collapseRow(e)})):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",n=>{n.stopPropagation(),this.expandRow(e)})),i.controlEl.addEventListener("mousedown",n=>{n.stopPropagation()}),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach((i,s)=>{var n,r;t.push(i),i instanceof S&&(i.create(),n=i.modules.dataTree,!n.index&&n.children!==!1&&(r=this.getChildren(i,!1,!0),r.forEach(o=>{o.create(),t.push(o)})))}),t}getChildren(e,t,i){var s=e.modules.dataTree,n=[],r=[];return s.children!==!1&&(s.open||t)&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?n=this.table.modules.filter.filter(s.children):n=s.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(n,i),n.forEach(o=>{r.push(o);var a=this.getChildren(o,!1,!0);a.forEach(h=>{r.push(h)})})),r}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach(s=>{var n=new S(s||{},this.table.rowManager);n.create(),n.modules.dataTree.index=e.modules.dataTree.index+1,n.modules.dataTree.parent=e,n.modules.dataTree.children&&(n.modules.dataTree.open=this.startOpen(n.getComponent(),n.modules.dataTree.index)),t.push(n)}),t}expandRow(e,t){var i=e.modules.dataTree;i.children!==!1&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;t.children!==!1&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return e.modules.dataTree.parent?e.modules.dataTree.parent.getComponent():!1}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[],s;return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),this.table.modExists("filter")&&this.table.options.dataTreeFilter?s=this.table.modules.filter.filter(t.children):s=t.children,s.forEach(n=>{n instanceof S&&i.push(n)})),i}rowDelete(e){var t=e.modules.dataTree.parent,i;t&&(i=this.findChildIndex(e,t),i!==!1&&t.data[this.field].splice(i,1),t.data[this.field].length||delete t.data[this.field],this.initializeRow(t),this.layoutRow(t)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var n=!1;typeof t=="string"&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),typeof s<"u"&&(n=this.findChildIndex(s,e),n!==!1&&e.data[this.field].splice(i?n:n+1,0,t)),n===!1&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return typeof e=="object"?e instanceof S?i=e.data:e instanceof oe?i=e._getSelf().data:typeof HTMLElement<"u"&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find(s=>s instanceof S?s.element===e:!1),i&&(i=i.data)):e===null&&(i=!1):typeof e>"u"?i=!1:i=t.data[this.field].find(s=>s.data[this.table.options.index]==e),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),i==-1&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,n=[];return s&&s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach(r=>{r instanceof S&&(n.push(t?r.getComponent():r),i&&this.getTreeChildren(r,t,i).forEach(o=>{n.push(o)}))})),n}getChildField(){return this.field}redrawNeeded(e){return(this.field?typeof e[this.field]<"u":!1)||(this.elementField?typeof e[this.elementField]<"u":!1)}}b(Ze,"moduleName","dataTree");function Vt(l,e={},t){var i=e.delimiter?e.delimiter:",",s=[],n=[];l.forEach(r=>{var o=[];switch(r.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":r.columns.forEach((a,h)=>{a&&a.depth===1&&(n[h]=typeof a.value>"u"||a.value===null?"":'"'+String(a.value).split('"').join('""')+'"')});break;case"row":r.columns.forEach(a=>{if(a){switch(typeof a.value){case"object":a.value=a.value!==null?JSON.stringify(a.value):"";break;case"undefined":a.value="";break}o.push('"'+String(a.value).split('"').join('""')+'"')}}),s.push(o.join(i));break}}),n.length&&s.unshift(n.join(i)),s=s.join(` +`),e.bom&&(s="\uFEFF"+s),t(s,"text/csv")}function It(l,e,t){var i=[];l.forEach(s=>{var n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(n);break}}),i=JSON.stringify(i,null," "),t(i,"application/json")}function Nt(l,e={},t){var i=[],s=[],n={},r=e.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},o=e.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},a=e.jsPDF||{},h=e.title?e.title:"";a.orientation||(a.orientation=e.orientation||"landscape"),a.unit||(a.unit="pt"),l.forEach(c=>{switch(c.type){case"header":i.push(d(c));break;case"group":s.push(d(c,r));break;case"calc":s.push(d(c,o));break;case"row":s.push(d(c));break}});function d(c,f){var g=[];return c.columns.forEach(p=>{var v;if(p){switch(typeof p.value){case"object":p.value=p.value!==null?JSON.stringify(p.value):"";break;case"undefined":p.value="";break}v={content:p.value,colSpan:p.width,rowSpan:p.height},f&&(v.styles=f),g.push(v)}}),g}var u=new jspdf.jsPDF(a);e.autoTable&&(typeof e.autoTable=="function"?n=e.autoTable(u)||{}:n=e.autoTable),h&&(n.didDrawPage=function(c){u.text(h,40,30)}),n.head=i,n.body=s,u.autoTable(n),e.documentProcessing&&e.documentProcessing(u),t(u.output("arraybuffer"),"application/pdf")}function Wt(l,e,t){var i=this,s=e.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new M(this),o="compress"in e?e.compress:!0,a=e.writeOptions||{bookType:"xlsx",bookSST:!0,compression:o},h;a.type="binary",n.SheetNames=[],n.Sheets={};function d(){var f=[],g=[],p={},v={s:{c:0,r:0},e:{c:l[0]?l[0].columns.reduce((m,C)=>m+(C&&C.width?C.width:1),0):0,r:l.length}};return l.forEach((m,C)=>{var T=[];m.columns.forEach(function(y,k){y?(T.push(!(y.value instanceof Date)&&typeof y.value=="object"?JSON.stringify(y.value):y.value),(y.width>1||y.height>-1)&&(y.height>1||y.width>1)&&g.push({s:{r:C,c:k},e:{r:C+y.height-1,c:k+y.width-1}})):T.push("")}),f.push(T)}),XLSX.utils.sheet_add_aoa(p,f),p["!ref"]=XLSX.utils.encode_range(v),g.length&&(p["!merges"]=g),p}if(e.sheetOnly){t(d());return}if(e.sheets)for(var u in e.sheets)e.sheets[u]===!0?(n.SheetNames.push(u),n.Sheets[u]=d()):(n.SheetNames.push(u),r.commsSend(e.sheets[u],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:i.active,intercept:function(f){n.Sheets[u]=f}}));else n.SheetNames.push(s),n.Sheets[s]=d();e.documentProcessing&&(n=e.documentProcessing(n));function c(f){for(var g=new ArrayBuffer(f.length),p=new Uint8Array(g),v=0;v!=f.length;++v)p[v]=f.charCodeAt(v)&255;return g}h=XLSX.write(n,a),t(c(h),"application/octet-stream")}function Gt(l,e,t){this.modExists("export",!0)&&t(this.modules.export.generateHTMLTable(l),"text/html")}function jt(l,e,t){const i=[];l.forEach(s=>{const n={};switch(s.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":s.columns.forEach(r=>{r&&(n[r.component.getTitleDownload()||r.component.getField()]=r.value)}),i.push(JSON.stringify(n));break}}),t(i.join(` +`),"application/x-ndjson")}var Ut={csv:Vt,json:It,jsonLines:jt,pdf:Nt,xlsx:Wt,html:Gt};const q=class q extends w{constructor(e){super(e),this.registerTableOption("downloadEncoder",function(t,i){return new Blob([t],{type:i})}),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,n){var r=!1;function o(h,d){n?n===!0?this.triggerDownload(h,d,e,t,!0):n(h):this.triggerDownload(h,d,e,t)}if(typeof e=="function"?r=e:q.downloaders[e]?r=q.downloaders[e]:console.warn("Download Error - No such download type found: ",e),r){var a=this.generateExportList(s);r.call(this.table,a,i||{},o.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach(s=>{var n;s.type==="group"&&(n=s.columns[0],i&&i[s.indent]&&(n.value=i[s.indent](n.value,s.component._group.getRowCount(),s.component._group.getData(),s.component)))}),t}triggerDownload(e,t,i,s,n){var r=document.createElement("a"),o=this.table.options.downloadEncoder(e,t);o&&(n?window.open(window.URL.createObjectURL(o)):(s=s||"Tabulator."+(typeof i=="function"?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(o,s):(r.setAttribute("href",window.URL.createObjectURL(o)),r.setAttribute("download",s),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept);break}}};b(q,"moduleName","download"),b(q,"downloaders",Ut);let ve=q;function ae(l,e){var t=e.mask,i=typeof e.maskLetterChar<"u"?e.maskLetterChar:"A",s=typeof e.maskNumberChar<"u"?e.maskNumberChar:"9",n=typeof e.maskWildcardChar<"u"?e.maskWildcardChar:"*";function r(o){var a=t[o];typeof a<"u"&&a!==n&&a!==i&&a!==s&&(l.value=l.value+""+a,r(o+1))}l.addEventListener("keydown",o=>{var a=l.value.length,h=o.key;if(o.keyCode>46&&!o.ctrlKey&&!o.metaKey){if(a>=t.length)return o.preventDefault(),o.stopPropagation(),!1;switch(t[a]){case i:if(h.toUpperCase()==h.toLowerCase())return o.preventDefault(),o.stopPropagation(),!1;break;case s:if(isNaN(h))return o.preventDefault(),o.stopPropagation(),!1;break;case n:break;default:if(h!==t[a])return o.preventDefault(),o.stopPropagation(),!1}}}),l.addEventListener("keyup",o=>{o.keyCode>46&&e.maskAutoFill&&r(l.value.length)}),l.placeholder||(l.placeholder=t),e.maskAutoFill&&r(l.value.length)}function Xt(l,e,t,i,s){var n=l.getValue(),r=document.createElement("input");if(r.setAttribute("type",s.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let a in s.elementAttributes)a.charAt(0)=="+"?(a=a.slice(1),r.setAttribute(a,r.getAttribute(a)+s.elementAttributes["+"+a])):r.setAttribute(a,s.elementAttributes[a]);r.value=typeof n<"u"?n:"",e(function(){l.getType()==="cell"&&(r.focus({preventScroll:!0}),r.style.height="100%",s.selectContents&&r.select())});function o(a){(n===null||typeof n>"u")&&r.value!==""||r.value!==n?t(r.value)&&(n=r.value):i()}return r.addEventListener("change",o),r.addEventListener("blur",o),r.addEventListener("keydown",function(a){switch(a.keyCode){case 13:o();break;case 27:i();break;case 35:case 36:a.stopPropagation();break}}),s.mask&&ae(r,s),r}function Jt(l,e,t,i,s){var n=l.getValue(),r=s.verticalNavigation||"hybrid",o=String(n!==null&&typeof n<"u"?n:""),a=document.createElement("textarea"),h=0;if(a.style.display="block",a.style.padding="2px",a.style.height="100%",a.style.width="100%",a.style.boxSizing="border-box",a.style.whiteSpace="pre-wrap",a.style.resize="none",s.elementAttributes&&typeof s.elementAttributes=="object")for(let u in s.elementAttributes)u.charAt(0)=="+"?(u=u.slice(1),a.setAttribute(u,a.getAttribute(u)+s.elementAttributes["+"+u])):a.setAttribute(u,s.elementAttributes[u]);a.value=o,e(function(){l.getType()==="cell"&&(a.focus({preventScroll:!0}),a.style.height="100%",a.scrollHeight,a.style.height=a.scrollHeight+"px",l.getRow().normalizeHeight(),s.selectContents&&a.select())});function d(u){(n===null||typeof n>"u")&&a.value!==""||a.value!==n?(t(a.value)&&(n=a.value),setTimeout(function(){l.getRow().normalizeHeight()},300)):i()}return a.addEventListener("change",d),a.addEventListener("blur",d),a.addEventListener("keyup",function(){a.style.height="";var u=a.scrollHeight;a.style.height=u+"px",u!=h&&(h=u,l.getRow().normalizeHeight())}),a.addEventListener("keydown",function(u){switch(u.keyCode){case 13:u.shiftKey&&s.shiftEnterSubmit&&d();break;case 27:i();break;case 38:(r=="editor"||r=="hybrid"&&a.selectionStart)&&(u.stopImmediatePropagation(),u.stopPropagation());break;case 40:(r=="editor"||r=="hybrid"&&a.selectionStart!==a.value.length)&&(u.stopImmediatePropagation(),u.stopPropagation());break;case 35:case 36:u.stopPropagation();break}}),s.mask&&ae(a,s),a}function Kt(l,e,t,i,s){var n=l.getValue(),r=s.verticalNavigation||"editor",o=document.createElement("input");if(o.setAttribute("type","number"),typeof s.max<"u"&&o.setAttribute("max",s.max),typeof s.min<"u"&&o.setAttribute("min",s.min),typeof s.step<"u"&&o.setAttribute("step",s.step),o.style.padding="4px",o.style.width="100%",o.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let d in s.elementAttributes)d.charAt(0)=="+"?(d=d.slice(1),o.setAttribute(d,o.getAttribute(d)+s.elementAttributes["+"+d])):o.setAttribute(d,s.elementAttributes[d]);o.value=n;var a=function(d){h()};e(function(){l.getType()==="cell"&&(o.removeEventListener("blur",a),o.focus({preventScroll:!0}),o.style.height="100%",o.addEventListener("blur",a),s.selectContents&&o.select())});function h(){var d=o.value;!isNaN(d)&&d!==""&&(d=Number(d)),d!==n?t(d)&&(n=d):i()}return o.addEventListener("keydown",function(d){switch(d.keyCode){case 13:h();break;case 27:i();break;case 38:case 40:r=="editor"&&(d.stopImmediatePropagation(),d.stopPropagation());break;case 35:case 36:d.stopPropagation();break}}),s.mask&&ae(o,s),o}function qt(l,e,t,i,s){var n=l.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),typeof s.max<"u"&&r.setAttribute("max",s.max),typeof s.min<"u"&&r.setAttribute("min",s.min),typeof s.step<"u"&&r.setAttribute("step",s.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let a in s.elementAttributes)a.charAt(0)=="+"?(a=a.slice(1),r.setAttribute(a,r.getAttribute(a)+s.elementAttributes["+"+a])):r.setAttribute(a,s.elementAttributes[a]);r.value=n,e(function(){l.getType()==="cell"&&(r.focus({preventScroll:!0}),r.style.height="100%")});function o(){var a=r.value;!isNaN(a)&&a!==""&&(a=Number(a)),a!=n?t(a)&&(n=a):i()}return r.addEventListener("blur",function(a){o()}),r.addEventListener("keydown",function(a){switch(a.keyCode){case 13:o();break;case 27:i();break}}),r}function Yt(l,e,t,i,s){var n=s.format,r=s.verticalNavigation||"editor",o=n?window.DateTime||luxon.DateTime:null,a=l.getValue(),h=document.createElement("input");function d(c){var f;return o.isDateTime(c)?f=c:n==="iso"?f=o.fromISO(String(c)):f=o.fromFormat(String(c),n),f.toFormat("yyyy-MM-dd")}if(h.type="date",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",s.max&&h.setAttribute("max",n?d(s.max):s.max),s.min&&h.setAttribute("min",n?d(s.min):s.min),s.elementAttributes&&typeof s.elementAttributes=="object")for(let c in s.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),h.setAttribute(c,h.getAttribute(c)+s.elementAttributes["+"+c])):h.setAttribute(c,s.elementAttributes[c]);a=typeof a<"u"?a:"",n&&(o?a=d(a):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),h.value=a,e(function(){l.getType()==="cell"&&(h.focus({preventScroll:!0}),h.style.height="100%",s.selectContents&&h.select())});function u(){var c=h.value,f;if((a===null||typeof a>"u")&&c!==""||c!==a){if(c&&n)switch(f=o.fromFormat(String(c),"yyyy-MM-dd"),n){case!0:c=f;break;case"iso":c=f.toISO();break;default:c=f.toFormat(n)}t(c)&&(a=h.value)}else i()}return h.addEventListener("blur",function(c){(c.relatedTarget||c.rangeParent||c.explicitOriginalTarget!==h)&&u()}),h.addEventListener("keydown",function(c){switch(c.keyCode){case 13:u();break;case 27:i();break;case 35:case 36:c.stopPropagation();break;case 38:case 40:r=="editor"&&(c.stopImmediatePropagation(),c.stopPropagation());break}}),h}function $t(l,e,t,i,s){var n=s.format,r=s.verticalNavigation||"editor",o=n?window.DateTime||luxon.DateTime:null,a,h=l.getValue(),d=document.createElement("input");if(d.type="time",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let c in s.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+s.elementAttributes["+"+c])):d.setAttribute(c,s.elementAttributes[c]);h=typeof h<"u"?h:"",n&&(o?(o.isDateTime(h)?a=h:n==="iso"?a=o.fromISO(String(h)):a=o.fromFormat(String(h),n),h=a.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,e(function(){l.getType()=="cell"&&(d.focus({preventScroll:!0}),d.style.height="100%",s.selectContents&&d.select())});function u(){var c=d.value,f;if((h===null||typeof h>"u")&&c!==""||c!==h){if(c&&n)switch(f=o.fromFormat(String(c),"hh:mm"),n){case!0:c=f;break;case"iso":c=f.toISO();break;default:c=f.toFormat(n)}t(c)&&(h=d.value)}else i()}return d.addEventListener("blur",function(c){(c.relatedTarget||c.rangeParent||c.explicitOriginalTarget!==d)&&u()}),d.addEventListener("keydown",function(c){switch(c.keyCode){case 13:u();break;case 27:i();break;case 35:case 36:c.stopPropagation();break;case 38:case 40:r=="editor"&&(c.stopImmediatePropagation(),c.stopPropagation());break}}),d}function Qt(l,e,t,i,s){var n=s.format,r=s.verticalNavigation||"editor",o=n?window.DateTime||luxon.DateTime:null,a,h=l.getValue(),d=document.createElement("input");if(d.type="datetime-local",d.style.padding="4px",d.style.width="100%",d.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let c in s.elementAttributes)c.charAt(0)=="+"?(c=c.slice(1),d.setAttribute(c,d.getAttribute(c)+s.elementAttributes["+"+c])):d.setAttribute(c,s.elementAttributes[c]);h=typeof h<"u"?h:"",n&&(o?(o.isDateTime(h)?a=h:n==="iso"?a=o.fromISO(String(h)):a=o.fromFormat(String(h),n),h=a.toFormat("yyyy-MM-dd")+"T"+a.toFormat("HH:mm")):console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")),d.value=h,e(function(){l.getType()==="cell"&&(d.focus({preventScroll:!0}),d.style.height="100%",s.selectContents&&d.select())});function u(){var c=d.value,f;if((h===null||typeof h>"u")&&c!==""||c!==h){if(c&&n)switch(f=o.fromISO(String(c)),n){case!0:c=f;break;case"iso":c=f.toISO();break;default:c=f.toFormat(n)}t(c)&&(h=d.value)}else i()}return d.addEventListener("blur",function(c){(c.relatedTarget||c.rangeParent||c.explicitOriginalTarget!==d)&&u()}),d.addEventListener("keydown",function(c){switch(c.keyCode){case 13:u();break;case 27:i();break;case 35:case 36:c.stopPropagation();break;case 38:case 40:r=="editor"&&(c.stopImmediatePropagation(),c.stopPropagation());break}}),d}let Zt=class{constructor(e,t,i,s,n,r){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(r),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=t.getType()==="header",this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.filterTerm="",this.blurable=!0,this.actions={success:s,cancel:n},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var e=this.cell.getValue();typeof e>"u"&&typeof this.params.defaultValue<"u"&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(i){i.stopPropagation()}this.isFilter||(this.input.style.height="100%",this.input.focus({preventScroll:!0})),e.addEventListener("click",t),setTimeout(()=>{e.removeEventListener("click",t)},1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(this.params.maxWidth===!0?this.listEl.style.maxWidth=e.offsetWidth+"px":typeof this.params.maxWidth=="number"?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&typeof e=="object")for(let i in e)i.charAt(0)=="+"?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&ae(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t=["values","valuesURL","valuesLookup"],i;return e=Object.assign({},e),e.verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=typeof e.placeholderLoading>"u"?"Searching ...":e.placeholderLoading,e.placeholderEmpty=typeof e.placeholderEmpty>"u"?"No Results Found":e.placeholderEmpty,e.filterDelay=typeof e.filterDelay>"u"?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",i=Object.keys(e).filter(s=>t.includes(s)).length,i?i>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&!(typeof e.valuesLookup=="function"||e.valuesURL)&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.rebuildOptionsList()},this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:this._keyTab(e);break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout(()=>{this.popup&&this.popup.restoreHide()},10)}_preventBlur(){this.blurable=!1,setTimeout(()=>{this.blurable=!0},10)}_keyTab(e){this.params.autocomplete&&this.lastAction==="typing"?this._resolveValue(!0):this.focusedItem&&this._chooseItem(this.focusedItem,!0)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find(s=>typeof s.label<"u"&&s.label.toLowerCase().startsWith(this.filterTerm));i&&this._focusItem(i),this.filterTimeout=setTimeout(()=>{this.filterTerm=""},800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch(e=>{Number.isInteger(e)||console.error("List generation error",e)})}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):typeof this.params.valuesLookup=="function"?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then(s=>this.listIteration===i?this._parseList(s):Promise.reject(i))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");typeof e=="function"&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){var i=this.params.filterRemote?{term:t}:{};return e=qe(e,{},i),fetch(e).then(s=>s.ok?s.json().catch(n=>(console.warn("List Ajax Load Error - Invalid JSON returned",n),Promise.reject(n))):(console.error("List Ajax Load Error - Connection Error: "+s.status,s.statusText),Promise.reject(s))).catch(s=>(console.error("List Ajax Load Error - Connection Error: ",s),Promise.reject(s)))}_uniqueColumnValues(e){var t={},i=this.table.getData(this.params.valuesLookup),s;return e?s=this.table.columnManager.getColumnByField(e):s=this.cell.getColumn()._getSelf(),s?i.forEach(n=>{var r=s.getFieldValue(n);r!==null&&typeof r<"u"&&r!==""&&(t[r]=!0)}):(console.warn("unable to find matching column to create select lookup list:",e),t=[]),Object.keys(t)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map(([i,s])=>({label:s,value:i}))),e.forEach(i=>{typeof i!="object"&&(i={label:i,value:i}),this._parseListItem(i,t,0)}),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach(s=>{this._parseListItem(s,i.options,t)}),i}_sortOptions(e){var t;return this.params.sort&&(t=typeof this.params.sort=="function"?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort((i,s)=>e(i.label,s.label,i.value,s.value,i.original,s.original)),t.forEach(i=>{i.group&&this._sortGroup(e,i.options)})}_defaultSortFunction(e,t){var i,s,n,r,o=0,a,h=/(\d+)|(\D+)/g,d=/\d/,u=0;if(this.params.sort==="desc"&&([e,t]=[t,e]),!e&&e!==0)u=!t&&t!==0?0:-1;else if(!t&&t!==0)u=1;else{if(isFinite(e)&&isFinite(t))return e-t;if(i=String(e).toLowerCase(),s=String(t).toLowerCase(),i===s)return 0;if(!(d.test(i)&&d.test(s)))return i>s?1:-1;for(i=i.match(h),s=s.match(h),a=i.length>s.length?s.length:i.length;or?1:-1;return i.length>s.length}return u}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach(i=>{this._filterItem(e,t,i)})):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach(n=>{this._filterItem(e,t,n)&&(s=!0)}),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),t!==null&&typeof t<"u"&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach(t=>{this._buildItem(t)}),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t=e.element,i;if(!this.filtered||e.visible){if(!t){if(t=document.createElement("div"),t.tabIndex=0,i=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,t):e.label,i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i,e.group?t.classList.add("tabulator-edit-list-group"):t.classList.add("tabulator-edit-list-item"),t.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&typeof e.elementAttributes=="object")for(let s in e.elementAttributes)s.charAt(0)=="+"?(s=s.slice(1),t.setAttribute(s,this.input.getAttribute(s)+e.elementAttributes["+"+s])):t.setAttribute(s,e.elementAttributes[s]);e.group?t.addEventListener("click",this._groupClick.bind(this,e)):t.addEventListener("click",this._itemClick.bind(this,e)),t.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=t}this._styleItem(e),this.listEl.appendChild(t),e.group?e.options.forEach(s=>{this._buildItem(s)}):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&this.input.value===""&&!this.params.listOnEmpty){this.popup&&this.popup.hide(!0);return}this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout(()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))},10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach(e=>{e.selected=!1,this._styleItem(e)}),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?(i=this.currentItems.indexOf(e),i>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map(s=>s.label).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map(s=>s.value);else if(e&&this.params.autocomplete&&this.typing)if(this.params.freetext||this.params.allowEmpty&&this.input.value==="")t=this.input.value;else{this.actions.cancel();return}else this.currentItems[0]?t=this.currentItems[0].value:(i=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues,i===null||typeof i>"u"||i===""?t=i:t=this.params.emptyValue);t===""&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}};function ei(l,e,t,i,s){var n=new Zt(this,l,e,t,i,s);return n.input}function ti(l,e,t,i,s){var n=this,r=l.getElement(),o=l.getValue(),a=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],u=document.createElement("div"),c=document.createElementNS("http://www.w3.org/2000/svg","svg");function f(m){d.forEach(function(C,T){T'):(n.table.browser=="ie"?C.setAttribute("class","tabulator-star-inactive"):C.classList.replace("tabulator-star-active","tabulator-star-inactive"),C.innerHTML='')})}function g(m){var C=document.createElement("span"),T=c.cloneNode(!0);d.push(T),C.addEventListener("mouseenter",function(y){y.stopPropagation(),y.stopImmediatePropagation(),f(m)}),C.addEventListener("mousemove",function(y){y.stopPropagation(),y.stopImmediatePropagation()}),C.addEventListener("click",function(y){y.stopPropagation(),y.stopImmediatePropagation(),t(m),r.blur()}),C.appendChild(T),u.appendChild(C)}function p(m){o=m,f(m)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",u.style.verticalAlign="middle",u.style.display="inline-block",u.style.padding="4px",c.setAttribute("width",h),c.setAttribute("height",h),c.setAttribute("viewBox","0 0 512 512"),c.setAttribute("xml:space","preserve"),c.style.padding="0 1px",s.elementAttributes&&typeof s.elementAttributes=="object")for(let m in s.elementAttributes)m.charAt(0)=="+"?(m=m.slice(1),u.setAttribute(m,u.getAttribute(m)+s.elementAttributes["+"+m])):u.setAttribute(m,s.elementAttributes[m]);for(var v=1;v<=a;v++)g(v);return o=Math.min(parseInt(o),a),f(o),u.addEventListener("mousemove",function(m){f(0)}),u.addEventListener("click",function(m){t(0)}),r.addEventListener("blur",function(m){i()}),r.addEventListener("keydown",function(m){switch(m.keyCode){case 39:p(o+1);break;case 37:p(o-1);break;case 13:t(o);break;case 27:i();break}}),u}function ii(l,e,t,i,s){var n=l.getElement(),r=typeof s.max>"u"?n.getElementsByTagName("div")[0]&&n.getElementsByTagName("div")[0].getAttribute("max")||100:s.max,o=typeof s.min>"u"?n.getElementsByTagName("div")[0]&&n.getElementsByTagName("div")[0].getAttribute("min")||0:s.min,a=(r-o)/100,h=l.getValue()||0,d=document.createElement("div"),u=document.createElement("div"),c,f;function g(){var p=window.getComputedStyle(n,null),v=a*Math.round(u.offsetWidth/((n.clientWidth-parseInt(p.getPropertyValue("padding-left"))-parseInt(p.getPropertyValue("padding-right")))/100))+o;t(v),n.setAttribute("aria-valuenow",v),n.setAttribute("aria-label",h)}if(d.style.position="absolute",d.style.right="0",d.style.top="0",d.style.bottom="0",d.style.width="5px",d.classList.add("tabulator-progress-handle"),u.style.display="inline-block",u.style.position="relative",u.style.height="100%",u.style.backgroundColor="#488CE9",u.style.maxWidth="100%",u.style.minWidth="0%",s.elementAttributes&&typeof s.elementAttributes=="object")for(let p in s.elementAttributes)p.charAt(0)=="+"?(p=p.slice(1),u.setAttribute(p,u.getAttribute(p)+s.elementAttributes["+"+p])):u.setAttribute(p,s.elementAttributes[p]);return n.style.padding="4px 4px",h=Math.min(parseFloat(h),r),h=Math.max(parseFloat(h),o),h=Math.round((h-o)/a),u.style.width=h+"%",n.setAttribute("aria-valuemin",o),n.setAttribute("aria-valuemax",r),u.appendChild(d),d.addEventListener("mousedown",function(p){c=p.screenX,f=u.offsetWidth}),d.addEventListener("mouseover",function(){d.style.cursor="ew-resize"}),n.addEventListener("mousemove",function(p){c&&(u.style.width=f+p.screenX-c+"px")}),n.addEventListener("mouseup",function(p){c&&(p.stopPropagation(),p.stopImmediatePropagation(),c=!1,f=!1,g())}),n.addEventListener("keydown",function(p){switch(p.keyCode){case 39:p.preventDefault(),u.style.width=u.clientWidth+n.clientWidth/100+"px";break;case 37:p.preventDefault(),u.style.width=u.clientWidth-n.clientWidth/100+"px";break;case 9:case 13:g();break;case 27:i();break}}),n.addEventListener("blur",function(){i()}),u}function si(l,e,t,i,s){var n=l.getValue(),r=document.createElement("input"),o=s.tristate,a=typeof s.indeterminateValue>"u"?null:s.indeterminateValue,h=!1,d=Object.keys(s).includes("trueValue"),u=Object.keys(s).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",s.elementAttributes&&typeof s.elementAttributes=="object")for(let f in s.elementAttributes)f.charAt(0)=="+"?(f=f.slice(1),r.setAttribute(f,r.getAttribute(f)+s.elementAttributes["+"+f])):r.setAttribute(f,s.elementAttributes[f]);r.value=n,o&&(typeof n>"u"||n===a||n==="")&&(h=!0,r.indeterminate=!0),this.table.browser!="firefox"&&this.table.browser!="safari"&&e(function(){l.getType()==="cell"&&r.focus({preventScroll:!0})}),r.checked=d?n===s.trueValue:n===!0||n==="true"||n==="True"||n===1;function c(f){var g=r.checked;return d&&g?g=s.trueValue:u&&!g&&(g=s.falseValue),o?f?h?a:g:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,a):(h=!1,g):g}return r.addEventListener("change",function(f){t(c())}),r.addEventListener("blur",function(f){t(c(!0))}),r.addEventListener("keydown",function(f){f.keyCode==13&&t(c()),f.keyCode==27&&i()}),r}var ni={input:Xt,textarea:Jt,number:Kt,range:qt,date:Yt,time:$t,datetime:Qt,list:ei,star:ti,progress:ii,tickCross:si};const Z=class Z extends w{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.convertEmptyValues=!1,this.editors=Z.editors,this.registerTableOption("editTriggerEvent","focus"),this.registerTableOption("editorEmptyValue"),this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this)),this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("editorEmptyValue"),this.registerColumnOption("editorEmptyValueFunc"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("row-layout",this.rowEditableCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("clipboard-paste",this.pasteBlocker.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0)),Object.keys(this.table.options).includes("editorEmptyValue")&&(this.convertEmptyValues=!0)}pasteBlocker(e){if(this.currentCell)return!0}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),this.invalidEdit||(i===!0?i=this.table.addRow({}):typeof i=="function"?i=this.table.addRow(i(t.row.getComponent())):i=this.table.addRow(Object.assign({},i)),i.then(()=>{setTimeout(()=>{t.getComponent().navigateNext()})}))))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach(t=>{this.table.modules.edit.clearEdited(t._getSelf())})}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft(),i)return!0;if(s=this.table.rowManager.prevDisplayRow(e.row,!0),s&&(i=this.findPrevEditableCell(s,s.cells.length),i))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight(),i)return!0;if(s=this.table.rowManager.nextDisplayRow(e.row,!0),s&&(i=this.findNextEditableCell(s,-1),i))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i),s)?(s.getComponent().edit(),!0):!1}navigateRight(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i),s)?(s.getComponent().edit(),!0):!1}navigateUp(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0),s)?(s.cells[i].getComponent().edit(),!0):!1}navigateDown(e=this.currentCell,t){var i,s;return e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0),s)?(s.cells[i].getComponent().edit(),!0):!1}findNextEditableCell(e,t){var i=!1;if(t0)for(var s=t-1;s>=0;s--){let n=e.cells[s];if(n.column.modules.edit&&x.elVisible(n.getElement())&&this.allowEdit(n)){i=n;break}}return i}initializeColumnCheck(e){typeof e.definition.editor<"u"&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}rowEditableCheck(e){e.getCells().forEach(t=>{t.column.modules.edit&&typeof t.column.modules.edit.check=="function"&&this.updateCellClass(t)})}initializeColumn(e){var t=Object.keys(e.definition).includes("editorEmptyValue"),i={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{},convertEmptyValues:t,editorEmptyValue:e.definition.editorEmptyValue,editorEmptyValueFunc:e.definition.editorEmptyValueFunc};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?i.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":i.editor=e.definition.editor;break;case"boolean":e.definition.editor===!0&&(typeof e.definition.formatter!="function"?this.editors[e.definition.formatter]?i.editor=this.editors[e.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter));break}i.editor&&(e.modules.edit=i)}getCurrentCell(){return this.currentCell?this.currentCell.getComponent():!1}clearEditor(e){var t=this.currentCell,i;if(this.invalidEdit=!1,t){for(this.currentCell=!1,i=t.getElement(),this.dispatch("edit-editor-clear",t,e),i.classList.remove("tabulator-editing");i.firstChild;)i.removeChild(i.firstChild);t.row.getElement().classList.remove("tabulator-editing"),t.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),(e.column.definition.editor=="textarea"||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("mousedown",function(s){s.button===2?s.preventDefault():t.mouseClick=!0}),this.options("editTriggerEvent")==="dblclick"&&i.addEventListener("dblclick",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))}),(this.options("editTriggerEvent")==="focus"||this.options("editTriggerEvent")==="click")&&i.addEventListener("click",function(s){i.classList.contains("tabulator-editing")||(i.focus({preventScroll:!0}),t.edit(e,s,!1))}),this.options("editTriggerEvent")==="focus"&&i.addEventListener("focus",function(s){t.recursionBlock||t.edit(e,s,!1)})}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&this.table.browser==="ie"||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if(this.table.rowManager.getRenderMode()=="virtual"){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var n=this.table.rowManager.element.scrollLeft,r=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,o=e.getElement();this.table.modExists("frozenColumns")&&(n+=parseInt(this.table.modules.frozenColumns.leftMargin||0),r-=parseInt(this.table.modules.frozenColumns.rightMargin||0)),this.table.options.renderHorizontal==="virtual"&&(n-=parseInt(this.table.columnManager.renderer.vDomPadLeft),r-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),o.offsetLeftr&&(this.table.rowManager.element.scrollLeft+=o.offsetLeft+o.offsetWidth-r)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":e.row.initialized&&(t=e.column.modules.edit.check(e.getComponent()));break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check;break}return t}edit(e,t,i){var s=this,n=!0,r=function(){},o=e.getElement(),a=!1,h,d,u;if(this.currentCell){!this.invalidEdit&&this.currentCell!==e&&this.cancelEdit();return}function c(m){if(s.currentCell===e&&!a){var C=s.chain("edit-success",[e,m],!0,!0);return C===!0||s.table.options.validationMode==="highlight"?(a=!0,s.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,s.editedCells.indexOf(e)==-1&&s.editedCells.push(e),m=s.transformEmptyValues(m,e),e.setValue(m,!0),C===!0):(a=!0,s.invalidEdit=!0,s.focusCellNoEvent(e,!0),r(),setTimeout(()=>{a=!1},10),!1)}}function f(){s.currentCell===e&&!a&&s.cancelEdit()}function g(m){r=m}if(e.column.modules.edit.blocked)return this.mouseClick=!1,this.blur(o),!1;if(t&&t.stopPropagation(),n=this.allowEdit(e),n||i){if(s.cancelEdit(),s.currentCell=e,this.focusScrollAdjust(e),d=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,d)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,d),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",d),u=typeof e.column.modules.edit.params=="function"?e.column.modules.edit.params(d):e.column.modules.edit.params,h=e.column.modules.edit.editor.call(s,d,g,c,f,u),this.currentCell&&h!==!1)if(h instanceof Node){for(o.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");o.firstChild;)o.removeChild(o.firstChild);o.appendChild(h),r();for(var p=o.children,v=0;v"u"}transformEmptyValues(e,t){var i=t.column.modules.edit,s=i.convertEmptyValues||this.convertEmptyValues,n;return s&&(n=i.editorEmptyValueFunc||this.options("editorEmptyValueFunc"),n&&n(e)&&(e=i.convertEmptyValues?i.editorEmptyValue:this.options("editorEmptyValue"))),e}blur(e){this.confirm("edit-blur",[e])||e.blur()}getEditedCells(){var e=[];return this.editedCells.forEach(t=>{e.push(t.getComponent())}),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),t=this.editedCells.indexOf(e),t>-1&&this.editedCells.splice(t,1)}};b(Z,"moduleName","edit"),b(Z,"editors",ni);let we=Z;class Ue{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class de{constructor(e,t,i,s,n){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=n}}var ri={},oi={visible:function(){return this.rowManager.getVisibleRows(!1,!0)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){return this.options.pagination?this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2):this.rowManager.getDisplayRows()}};const V=class V extends w{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.colVisPropAttach="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){var n,r,o,a;return this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s,this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1),a=V.columnLookups[i],a&&(o=a.call(this.table),o=o.filter(h=>this.columnVisCheck(h))),n=this.config.columnHeaders!==!1?this.headersToExportRows(this.generateColumnGroupHeaders(o)):[],o&&(o=o.map(h=>h.getComponent())),r=this.bodyToExportRows(this.rowLookup(i),o),n.concat(r)}generateTable(e,t,i,s){var n=this.generateExportList(e,t,i,s);return this.generateTableElement(n)}rowLookup(e){var t=[],i;return typeof e=="function"?e.call(this.table).forEach(s=>{s=this.table.rowManager.findRow(s),s&&t.push(s)}):(i=V.rowLookups[e]||V.rowLookups.active,t=i.call(this.table)),Object.assign([],t)}generateColumnGroupHeaders(e){var t=[];return e||(e=this.config.columnGroups!==!1?this.table.columnManager.columns:this.table.columnManager.columnsByIndex),e.forEach(i=>{var s=this.processColumnGroup(i);s&&t.push(s)}),t}processColumnGroup(e){var t=e.columns,i=0,s=e.definition["title"+this.colVisPropAttach]||e.definition.title,n={title:s,column:e,depth:1};if(t.length){if(n.subGroups=[],n.width=0,t.forEach(r=>{var o=this.processColumnGroup(r);o&&(n.width+=o.width,n.subGroups.push(o),o.depth>i&&(i=o.depth))}),n.depth+=i,!n.width)return!1}else if(this.columnVisCheck(e))n.width=1;else return!1;return n}columnVisCheck(e){var t=e.definition[this.colVisProp];return this.config.rowHeaders===!1&&e.isRowHeader?!1:(typeof t=="function"&&(t=t.call(this.table,e.getComponent())),t===!1||t===!0?t:e.visible&&e.field)}headersToExportRows(e){var t=[],i=0,s=[];function n(r,o){var a=i-o;if(typeof t[o]>"u"&&(t[o]=[]),r.height=r.subGroups?1:a-r.depth+1,t[o].push(r),r.height>1)for(let h=1;h"u"&&(t[o+h]=[]),t[o+h].push(!1);if(r.width>1)for(let h=1;hi&&(i=r.depth)}),e.forEach(function(r){n(r,0)}),t.forEach(r=>{var o=[];r.forEach(a=>{if(a){let h=typeof a.title>"u"?"":a.title;o.push(new de(h,a.column.getComponent(),a.width,a.height,a.depth))}else o.push(null)}),s.push(new Ue("header",o))}),s}bodyToExportRows(e,t=[]){var i=[];return t.length===0&&this.table.columnManager.columnsByIndex.forEach(s=>{this.columnVisCheck(s)&&t.push(s.getComponent())}),this.config.columnCalcs!==!1&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),e=e.filter(s=>{switch(s.type){case"group":return this.config.rowGroups!==!1;case"calc":return this.config.columnCalcs!==!1;case"row":return!(this.table.options.dataTree&&this.config.dataTree===!1&&s.modules.dataTree.parent)}return!0}),e.forEach((s,n)=>{var r=s.getData(this.colVisProp),o=[],a=0;switch(s.type){case"group":a=s.level,o.push(new de(s.key,s.getComponent(),t.length,1));break;case"calc":case"row":t.forEach(h=>{o.push(new de(h._column.getFieldValue(r),h,1,1))}),this.table.options.dataTree&&this.config.dataTree!==!1&&(a=s.modules.dataTree.index);break}i.push(new Ue(s.type,o,s.getComponent(),a))}),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),n=this.lookupTableStyles(),r=this.table.options["rowFormatter"+this.colVisPropAttach],o={};return o.rowFormatter=r!==null?r:this.table.options.rowFormatter,this.table.options.dataTree&&this.config.dataTree!==!1&&this.table.modExists("columnCalcs")&&(o.treeElementField=this.table.modules.dataTree.elementField),o.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach],o.groupHeader&&!Array.isArray(o.groupHeader)&&(o.groupHeader=[o.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((a,h)=>{let d;switch(a.type){case"header":i.appendChild(this.generateHeaderElement(a,o,n));break;case"group":s.appendChild(this.generateGroupElement(a,o,n));break;case"calc":s.appendChild(this.generateCalcElement(a,o,n));break;case"row":d=this.generateRowElement(a,o,n),this.mapElementStyles(h%2&&n.evenRow?n.evenRow:n.oddRow,d,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(d);break}}),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.styleRowHeader=e.firstRow.getElementsByClassName("tabulator-row-header")[0],e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach(n=>{if(n){var r=document.createElement("th"),o=n.component._column.definition.cssClass?n.component._column.definition.cssClass.split(" "):[];r.colSpan=n.width,r.rowSpan=n.height,r.innerHTML=n.value,this.cloneTableStyle&&(r.style.boxSizing="border-box"),o.forEach(function(a){r.classList.add(a)}),this.mapElementStyles(n.component.getElement(),r,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(n.component._column.contentElement,r,["padding-top","padding-left","padding-right","padding-bottom"]),n.component._column.visible?this.mapElementStyles(n.component.getElement(),r,["width"]):n.component._column.definition.width&&(r.style.width=n.component._column.definition.width+"px"),n.component._column.parent&&n.component._column.parent.isGroup?this.mapElementStyles(n.component._column.parent.groupElement,r,["border-top"]):this.mapElementStyles(n.component.getElement(),r,["border-top"]),n.component._column.isGroup?this.mapElementStyles(n.component.getElement(),r,["border-bottom"]):this.mapElementStyles(this.table.columnManager.getElement(),r,["border-bottom"]),s.appendChild(r)}}),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),n=document.createElement("td"),r=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?r.value=t.groupHeader[e.indent](r.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):t.groupHeader!==!1&&(r.value=e.component._group.generator(r.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),n.colSpan=r.width,n.innerHTML=r.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),r.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,n,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(n),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");if(s.classList.add("tabulator-print-table-row"),e.columns.forEach((n,r)=>{if(n){var o=document.createElement("td"),a=n.component._column,h=this.table,d=h.columnManager.findColumnIndex(a),u=n.value,c,f,g={modules:{},getValue:function(){return u},getField:function(){return a.definition.field},getElement:function(){return o},getType:function(){return"cell"},getColumn:function(){return a.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getTable:function(){return h},getComponent:function(){return g},column:a},p=a.definition.cssClass?a.definition.cssClass.split(" "):[];if(p.forEach(function(v){o.classList.add(v)}),this.table.modExists("format")&&this.config.formatCells!==!1)u=this.table.modules.format.formatExportValue(g,this.colVisProp);else switch(typeof u){case"object":u=u!==null?JSON.stringify(u):"";break;case"undefined":u="";break}u instanceof Node?o.appendChild(u):o.innerHTML=u,f=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"],a.isRowHeader?(c=i.styleRowHeader,f.push("background-color")):c=i.styleCells&&i.styleCells[d]?i.styleCells[d]:i.firstCell,c&&(this.mapElementStyles(c,o,f),a.definition.align&&(o.style.textAlign=a.definition.align)),this.table.options.dataTree&&this.config.dataTree!==!1&&(t.treeElementField&&t.treeElementField==a.field||!t.treeElementField&&r==0)&&(e.component._row.modules.dataTree.controlEl&&o.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),o.firstChild),e.component._row.modules.dataTree.branchEl&&o.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),o.firstChild)),s.appendChild(o),g.modules.format&&g.modules.format.renderedCallback&&g.modules.format.renderedCallback()}}),t.rowFormatter&&e.type==="row"&&this.config.formatCells!==!1){let n=Object.assign(e.component);n.getElement=function(){return s},t.rowFormatter(e.component)}return s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var n=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(n)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var n=window.getComputedStyle(e);i.forEach(function(r){t.style[s[r]]||(t.style[s[r]]=n.getPropertyValue(r))})}}}};b(V,"moduleName","export"),b(V,"columnLookups",ri),b(V,"rowLookups",oi);let Ce=V;var ai={"=":function(l,e,t,i){return e==l},"<":function(l,e,t,i){return e":function(l,e,t,i){return e>l},">=":function(l,e,t,i){return e>=l},"!=":function(l,e,t,i){return e!=l},regex:function(l,e,t,i){return typeof l=="string"&&(l=new RegExp(l)),l.test(e)},like:function(l,e,t,i){return l===null||typeof l>"u"?e===l:typeof e<"u"&&e!==null?String(e).toLowerCase().indexOf(l.toLowerCase())>-1:!1},keywords:function(l,e,t,i){var s=l.toLowerCase().split(typeof i.separator>"u"?" ":i.separator),n=String(e===null||typeof e>"u"?"":e).toLowerCase(),r=[];return s.forEach(o=>{n.includes(o)&&r.push(!0)}),i.matchAll?r.length===s.length:!!r.length},starts:function(l,e,t,i){return l===null||typeof l>"u"?e===l:typeof e<"u"&&e!==null?String(e).toLowerCase().startsWith(l.toLowerCase()):!1},ends:function(l,e,t,i){return l===null||typeof l>"u"?e===l:typeof e<"u"&&e!==null?String(e).toLowerCase().endsWith(l.toLowerCase()):!1},in:function(l,e,t,i){return Array.isArray(l)?l.length?l.indexOf(e)>-1:!0:(console.warn("Filter Error - filter value is not an array:",l),!1)}};const O=class O extends w{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerTableOption("placeholderHeaderFilter",!1),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.subscribe("placeholder",this.generatePlaceholder.bind(this)),this.table.options.filterMode==="remote"&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach(e=>{var t=this.table.columnManager.findColumn(e.field);if(t)this.setHeaderFilterValue(t,e.value);else return console.warn("Column Filter Error - No matching column found:",e.field),!1}),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}generatePlaceholder(e){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length)return this.table.options.placeholderHeaderFilter}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(t)this.setHeaderFilterFocus(t);else return console.warn("Column Filter Focus Error - No matching column found:",e),!1}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(i)this.setHeaderFilterValue(i,t);else return console.warn("Column Filter Error - No matching column found:",e),!1}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){var t=e.definition;t.headerFilter&&this.initializeColumn(e)}initializeColumn(e,t){var i=this,s=e.getField();function n(r){var o=e.modules.filter.tagType=="input"&&e.modules.filter.attrType=="text"||e.modules.filter.tagType=="textarea"?"partial":"match",a="",h="",d;if(typeof e.modules.filter.prevSuccess>"u"||e.modules.filter.prevSuccess!==r){if(e.modules.filter.prevSuccess=r,e.modules.filter.emptyFunc(r))delete i.headerFilters[s];else{switch(e.modules.filter.value=r,typeof e.definition.headerFilterFunc){case"string":O.filters[e.definition.headerFilterFunc]?(a=e.definition.headerFilterFunc,d=function(u){var c=e.definition.headerFilterFuncParams||{},f=e.getFieldValue(u);return c=typeof c=="function"?c(r,f,u):c,O.filters[e.definition.headerFilterFunc](r,f,u,c)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":d=function(u){var c=e.definition.headerFilterFuncParams||{},f=e.getFieldValue(u);return c=typeof c=="function"?c(r,f,u):c,e.definition.headerFilterFunc(r,f,u,c)},a=d;break}if(!d)switch(o){case"partial":d=function(u){var c=e.getFieldValue(u);return typeof c<"u"&&c!==null?String(c).toLowerCase().indexOf(String(r).toLowerCase())>-1:!1},a="like";break;default:d=function(u){return e.getFieldValue(u)==r},a="="}i.headerFilters[s]={value:r,func:d,type:a}}e.modules.filter.value=r,h=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==h&&(i.prevHeaderFilterChangeCheck=h,i.trackChanges(),i.refreshFilter())}return!0}e.modules.filter={success:n,attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s=this,n=e.modules.filter.success,r=e.getField(),o,a,h,d,u,c,f,g;e.modules.filter.value=t;function p(){}function v(m){g=m}if(e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),r){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(m){return!m&&m!==0},o=document.createElement("div"),o.classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":s.table.modules.edit.editors[e.definition.headerFilter]?(a=s.table.modules.edit.editors[e.definition.headerFilter],(e.definition.headerFilter==="tick"||e.definition.headerFilter==="tickCross")&&!e.definition.headerFilterEmptyCheck&&(e.modules.filter.emptyFunc=function(m){return m!==!0&&m!==!1})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":a=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?a=e.modules.edit.editor:e.definition.formatter&&s.table.modules.edit.editors[e.definition.formatter]?(a=s.table.modules.edit.editors[e.definition.formatter],(e.definition.formatter==="tick"||e.definition.formatter==="tickCross")&&!e.definition.headerFilterEmptyCheck&&(e.modules.filter.emptyFunc=function(m){return m!==!0&&m!==!1})):a=s.table.modules.edit.editors.input;break}if(a){if(d={getValue:function(){return typeof t<"u"?t:""},getField:function(){return e.definition.field},getElement:function(){return o},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}},f=e.definition.headerFilterParams||{},f=typeof f=="function"?f.call(s.table,d):f,h=a.call(this.table.modules.edit,d,v,n,p,f),!h){console.warn("Filter Error - Cannot add filter to "+r+" column, editor returned a value of false");return}if(!(h instanceof Node)){console.warn("Filter Error - Cannot add filter to "+r+" column, editor should return an instance of Node, the editor returned:",h);return}s.langBind("headerFilters|columns|"+e.definition.field,function(m){h.setAttribute("placeholder",typeof m<"u"&&m?m:e.definition.headerFilterPlaceholder||s.langText("headerFilters|default"))}),h.addEventListener("click",function(m){m.stopPropagation(),h.focus()}),h.addEventListener("focus",m=>{var C=this.table.columnManager.contentsElement.scrollLeft,T=this.table.rowManager.element.scrollLeft;C!==T&&(this.table.rowManager.scrollHorizontal(C),this.table.columnManager.scrollHorizontal(C))}),u=!1,c=function(m){u&&clearTimeout(u),u=setTimeout(function(){n(h.value)},s.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=h,e.modules.filter.attrType=h.hasAttribute("type")?h.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=h.tagName.toLowerCase(),e.definition.headerFilterLiveFilter!==!1&&(e.definition.headerFilter==="autocomplete"||e.definition.headerFilter==="tickCross"||(e.definition.editor==="autocomplete"||e.definition.editor==="tickCross")&&e.definition.headerFilter===!0||(h.addEventListener("keyup",c),h.addEventListener("search",c),e.modules.filter.attrType=="number"&&h.addEventListener("change",function(m){n(h.value)}),e.modules.filter.attrType=="text"&&this.table.browser!=="ie"&&h.setAttribute("type","search")),(e.modules.filter.tagType=="input"||e.modules.filter.tagType=="select"||e.modules.filter.tagType=="textarea")&&h.addEventListener("mousedown",function(m){m.stopPropagation()})),o.appendChild(h),e.contentElement.appendChild(o),i||s.headerFilterColumns.push(e),g&&g()}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")})}showHeaderFilterElements(){this.headerFilterColumns.forEach(function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")})}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&(this.table.options.filterMode==="remote"?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var n=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach(r=>{r=this.findFilter(r),r&&(this.filterList.push(r),n=!0)}),n&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return typeof e.field=="function"?i=function(s){return e.field(s,e.type||{})}:O.filters[e.type]?(t=this.table.columnManager.getColumnByField(e.field),t?i=function(s){return O.filters[e.type](e.value,t.getFieldValue(s),s,e.params||{})}:i=function(s){return O.filters[e.type](e.value,s[e.field],s,e.params||{})}):console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,e.func?e:!1}findSubFilters(e){var t=[];return e.forEach(i=>{i=this.findFilter(i),i&&t.push(i)}),t.length?t:!1}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach(function(s){typeof s.type=="function"&&(s.type="function")}),i=i.concat(this.filtersToArray(this.filterList,t)),i}filtersToArray(e,t){var i=[];return e.forEach(s=>{var n;Array.isArray(s)?i.push(this.filtersToArray(s,t)):(n={field:s.field,type:s.type,value:s.value},t&&typeof n.type=="function"&&(n.type="function"),i.push(n))}),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach(s=>{var n=-1;typeof s.field=="object"?n=this.filterList.findIndex(r=>s===r):n=this.filterList.findIndex(r=>s.field===r.field&&s.type===r.type&&s.value===r.value),n>-1?this.filterList.splice(n,1):console.warn("Filter Error - No matching filter type found, ignoring: ",s.type)}),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach(e=>{typeof e.modules.filter.value<"u"&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)}),this.trackChanges()}search(e,t,i,s){var n=[],r=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach(o=>{o=this.findFilter(o),o&&r.push(o)}),this.table.rowManager.rows.forEach(o=>{var a=!0;r.forEach(h=>{this.filterRecurse(h,o.getData())||(a=!1)}),a&&n.push(e==="data"?o.getData("data"):o.getComponent())}),n}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),this.table.options.filterMode!=="remote"&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach(n=>{this.filterRow(n)&&i.push(n)}):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach(n=>{s.push(n.getComponent())}),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();this.filterList.forEach(r=>{this.filterRecurse(r,s)||(i=!1)});for(var n in this.headerFilters)this.headerFilters[n].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach(s=>{this.filterRecurse(s,t)&&(i=!0)}):i=e.func(t),i}};b(O,"moduleName","filter"),b(O,"filters",ai);let Ee=O;function li(l,e,t){return this.emptyToSpace(this.sanitizeHTML(l.getValue()))}function hi(l,e,t){return l.getValue()}function di(l,e,t){return l.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(l.getValue()))}function ui(l,e,t){var i=parseFloat(l.getValue()),s="",n,r,o,a,h,d=e.decimal||".",u=e.thousand||",",c=e.negativeSign||"-",f=e.symbol||"",g=!!e.symbolAfter,p=typeof e.precision<"u"?e.precision:2;if(isNaN(i))return this.emptyToSpace(this.sanitizeHTML(l.getValue()));if(i<0&&(i=Math.abs(i),s=c),n=p!==!1?i.toFixed(p):i,n=String(n).split("."),r=n[0],o=n.length>1?d+n[1]:"",e.thousand!==!1)for(a=/(\d+)(\d{3})/;a.test(r);)r=r.replace(a,"$1"+u+"$2");return h=r+o,s===!0?(h="("+h+")",g?h+f:f+h):g?s+h+f:s+f+h}function ci(l,e,t){var i=l.getValue(),s=e.urlPrefix||"",n=e.download,r=i,o=document.createElement("a"),a;function h(d,u){var c=d.shift(),f=u[c];return d.length&&typeof f=="object"?h(d,f):f}if(e.labelField&&(a=l.getData(),r=h(e.labelField.split(this.table.options.nestedFieldSeparator),a)),e.label)switch(typeof e.label){case"string":r=e.label;break;case"function":r=e.label(l);break}if(r){if(e.urlField&&(a=l.getData(),i=x.retrieveNestedData(this.table.options.nestedFieldSeparator,e.urlField,a)),e.url)switch(typeof e.url){case"string":i=e.url;break;case"function":i=e.url(l);break}return o.setAttribute("href",s+i),e.target&&o.setAttribute("target",e.target),e.download&&(typeof n=="function"?n=n(l):n=n===!0?"":n,o.setAttribute("download",n)),o.innerHTML=this.emptyToSpace(this.sanitizeHTML(r)),o}else return" "}function fi(l,e,t){var i=document.createElement("img"),s=l.getValue();switch(e.urlPrefix&&(s=e.urlPrefix+l.getValue()),e.urlSuffix&&(s=s+e.urlSuffix),i.setAttribute("src",s),typeof e.height){case"number":i.style.height=e.height+"px";break;case"string":i.style.height=e.height;break}switch(typeof e.width){case"number":i.style.width=e.width+"px";break;case"string":i.style.width=e.width;break}return i.addEventListener("load",function(){l.getRow().normalizeHeight()}),i}function pi(l,e,t){var i=l.getValue(),s=l.getElement(),n=e.allowEmpty,r=e.allowTruthy,o=Object.keys(e).includes("trueValue"),a=typeof e.tickElement<"u"?e.tickElement:'',h=typeof e.crossElement<"u"?e.crossElement:'';return o&&i===e.trueValue||!o&&(r&&i||i===!0||i==="true"||i==="True"||i===1||i==="1")?(s.setAttribute("aria-checked",!0),a||""):n&&(i==="null"||i===""||i===null||typeof i>"u")?(s.setAttribute("aria-checked","mixed"),""):(s.setAttribute("aria-checked",!1),h||"")}function mi(l,e,t){var i=window.DateTime||luxon.DateTime,s=e.inputFormat||"yyyy-MM-dd HH:mm:ss",n=e.outputFormat||"dd/MM/yyyy HH:mm:ss",r=typeof e.invalidPlaceholder<"u"?e.invalidPlaceholder:"",o=l.getValue();if(typeof i<"u"){var a;return i.isDateTime(o)?a=o:s==="iso"?a=i.fromISO(String(o)):a=i.fromFormat(String(o),s),a.isValid?(e.timezone&&(a=a.setZone(e.timezone)),a.toFormat(n)):r===!0||!o?o:typeof r=="function"?r(o):r}else console.error("Format Error - 'datetime' formatter is dependant on luxon.js")}function gi(l,e,t){var i=window.DateTime||luxon.DateTime,s=e.inputFormat||"yyyy-MM-dd HH:mm:ss",n=typeof e.invalidPlaceholder<"u"?e.invalidPlaceholder:"",r=typeof e.suffix<"u"?e.suffix:!1,o=typeof e.unit<"u"?e.unit:"days",a=typeof e.humanize<"u"?e.humanize:!1,h=typeof e.date<"u"?e.date:i.now(),d=l.getValue();if(typeof i<"u"){var u;return i.isDateTime(d)?u=d:s==="iso"?u=i.fromISO(String(d)):u=i.fromFormat(String(d),s),u.isValid?a?u.diff(h,o).toHuman()+(r?" "+r:""):parseInt(u.diff(h,o)[o])+(r?" "+r:""):n===!0?d:typeof n=="function"?n(d):n}else console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")}function bi(l,e,t){var i=l.getValue();return typeof e[i]>"u"?(console.warn("Missing display value for "+i),i):e[i]}function vi(l,e,t){var i=l.getValue(),s=l.getElement(),n=e&&e.stars?e.stars:5,r=document.createElement("span"),o=document.createElementNS("http://www.w3.org/2000/svg","svg"),a='',h='';r.style.verticalAlign="middle",o.setAttribute("width","14"),o.setAttribute("height","14"),o.setAttribute("viewBox","0 0 512 512"),o.setAttribute("xml:space","preserve"),o.style.padding="0 1px",i=i&&!isNaN(i)?parseInt(i):0,i=Math.max(0,Math.min(i,n));for(var d=1;d<=n;d++){var u=o.cloneNode(!0);u.innerHTML=d<=i?a:h,r.appendChild(u)}return s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.setAttribute("aria-label",i),r}function wi(l,e,t){var i=this.sanitizeHTML(l.getValue())||0,s=document.createElement("span"),n=e&&e.max?e.max:100,r=e&&e.min?e.min:0,o=e&&typeof e.color<"u"?e.color:["red","orange","green"],a="#666666",h,d;if(!(isNaN(i)||typeof l.getValue()>"u")){switch(s.classList.add("tabulator-traffic-light"),d=parseFloat(i)<=n?parseFloat(i):n,d=parseFloat(d)>=r?parseFloat(d):r,h=(n-r)/100,d=Math.round((d-r)/h),typeof o){case"string":a=o;break;case"function":a=o(i);break;case"object":if(Array.isArray(o)){var u=100/o.length,c=Math.floor(d/u);c=Math.min(c,o.length-1),c=Math.max(c,0),a=o[c];break}}return s.style.backgroundColor=a,s}}function Ci(l,e={},t){var i=this.sanitizeHTML(l.getValue())||0,s=l.getElement(),n=e.max?e.max:100,r=e.min?e.min:0,o=e.legendAlign?e.legendAlign:"center",a,h,d,u,c;switch(h=parseFloat(i)<=n?parseFloat(i):n,h=parseFloat(h)>=r?parseFloat(h):r,a=(n-r)/100,h=Math.round((h-r)/a),typeof e.color){case"string":d=e.color;break;case"function":d=e.color(i);break;case"object":if(Array.isArray(e.color)){let v=100/e.color.length,m=Math.floor(h/v);m=Math.min(m,e.color.length-1),m=Math.max(m,0),d=e.color[m];break}default:d="#2DC214"}switch(typeof e.legend){case"string":u=e.legend;break;case"function":u=e.legend(i);break;case"boolean":u=i;break;default:u=!1}switch(typeof e.legendColor){case"string":c=e.legendColor;break;case"function":c=e.legendColor(i);break;case"object":if(Array.isArray(e.legendColor)){let v=100/e.legendColor.length,m=Math.floor(h/v);m=Math.min(m,e.legendColor.length-1),m=Math.max(m,0),c=e.legendColor[m]}break;default:c="#000"}s.style.minWidth="30px",s.style.position="relative",s.setAttribute("aria-label",h);var f=document.createElement("div");f.style.display="inline-block",f.style.width=h+"%",f.style.backgroundColor=d,f.style.height="100%",f.setAttribute("data-max",n),f.setAttribute("data-min",r);var g=document.createElement("div");if(g.style.position="relative",g.style.width="100%",g.style.height="100%",u){var p=document.createElement("div");p.style.position="absolute",p.style.top=0,p.style.left=0,p.style.textAlign=o,p.style.width="100%",p.style.color=c,p.innerHTML=u}return t(function(){if(!(l instanceof Ye)){var v=document.createElement("div");v.style.position="absolute",v.style.top="4px",v.style.bottom="4px",v.style.left="4px",v.style.right="4px",s.appendChild(v),s=v}s.appendChild(g),g.appendChild(f),u&&g.appendChild(p)}),""}function Ei(l,e,t){return l.getElement().style.backgroundColor=this.sanitizeHTML(l.getValue()),""}function yi(l,e,t){return''}function Ri(l,e,t){return''}function xi(l,e,t){var i=l.getValue(),s=e.size||15,n=s+"px",r,o,a=e.hasOwnProperty("onValue")?e.onValue:!0,h=e.hasOwnProperty("offValue")?e.offValue:!1,d=e.onTruthy?i:i===a;return r=document.createElement("div"),r.classList.add("tabulator-toggle"),d?(r.classList.add("tabulator-toggle-on"),r.style.flexDirection="row-reverse",e.onColor&&(r.style.background=e.onColor)):e.offColor&&(r.style.background=e.offColor),r.style.width=2.5*s+"px",r.style.borderRadius=n,e.clickable&&r.addEventListener("click",u=>{l.setValue(d?h:a)}),o=document.createElement("div"),o.classList.add("tabulator-toggle-switch"),o.style.height=n,o.style.width=n,o.style.borderRadius=n,r.appendChild(o),r}function Ti(l,e,t){var i=document.createElement("span"),s=l.getRow(),n=l.getTable();return s.watchPosition(r=>{e.relativeToPage&&(r+=n.modules.page.getPageSize()*(n.modules.page.getPage()-1)),i.innerText=r}),i}function ki(l,e,t){return l.getElement().classList.add("tabulator-row-handle"),"
"}var Mi={plaintext:li,html:hi,textarea:di,money:ui,link:ci,image:fi,tickCross:pi,datetime:mi,datetimediff:gi,lookup:bi,star:vi,traffic:wi,progress:Ci,color:Ei,buttonTick:yi,buttonCross:Ri,toggle:xi,rownum:Ti,handle:ki};const H=class H extends w{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),typeof e.definition.formatterPrint<"u"&&(e.modules.format.print=this.lookupFormatter(e,"Print")),typeof e.definition.formatterClipboard<"u"&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),typeof e.definition.formatterHtmlOutput<"u"&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":H.formatters[s]?i.formatter=H.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=H.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=H.formatters.plaintext;break}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,n,r,o;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),r=a=>{e.titleFormatterRendered=a},o={getValue:function(){return t},getElement:function(){return i},getType:function(){return"header"},getColumn:function(){return e.getComponent()},getTable:()=>this.table},n=e.definition.titleFormatterParams||{},n=typeof n=="function"?n():n,s.call(this,o,n,r)):t}formatValue(e){var t=e.getComponent(),i=typeof e.column.modules.format.params=="function"?e.column.modules.format.params(t):e.column.modules.format.params;function s(n){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=n,e.modules.format.rendered=!1}return e.column.modules.format.formatter.call(this,t,i,s)}formatExportValue(e,t){var i=e.column.modules.format[t],s;if(i){let n=function(r){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=r,e.modules.format.rendered=!1};return s=typeof i.params=="function"?i.params(e.getComponent()):i.params,i.formatter.call(this,e.getComponent(),s,n)}else return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,function(i){return t[i]})}else return e}emptyToSpace(e){return e===null||typeof e>"u"||e===""?" ":e}getFormatter(e){switch(typeof e){case"string":H.formatters[e]?e=H.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=H.formatters.plaintext);break;case"function":break;default:e=H.formatters.plaintext;break}return e}};b(H,"moduleName","format"),b(H,"formatters",Mi);let ye=H;class et extends w{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.active=!1}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-deleted",this.reinitializeColumns.bind(this)),this.subscribe("column-hide",this.reinitializeColumns.bind(this)),this.subscribe("column-show",this.reinitializeColumns.bind(this)),this.subscribe("columns-loaded",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this)),this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach(e=>{this.initializeColumn(e)}),this.layout()}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,this.initializationMode=="left"?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach(t=>{t.calcs.top&&this.layoutRow(t.calcs.top),t.calcs.bottom&&this.layoutRow(t.calcs.bottom),t.groupList&&t.groupList.length&&this.layoutGroupCalcs(t.groupList)})}layoutColumnPosition(e){var t=[],i=0,s=0;this.leftColumns.forEach((n,r)=>{if(n.modules.frozen.marginValue=i,n.modules.frozen.margin=n.modules.frozen.marginValue+"px",n.visible&&(i+=n.getWidth()),r==this.leftColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup){var o=this.getColGroupParentElement(n);t.includes(o)||(this.layoutElement(o,n),t.push(o)),o.classList.toggle("tabulator-frozen-left",n.modules.frozen.edge&&n.modules.frozen.position==="left"),o.classList.toggle("tabulator-frozen-right",n.modules.frozen.edge&&n.modules.frozen.position==="right")}else this.layoutElement(n.getElement(),n);e&&n.cells.forEach(a=>{this.layoutElement(a.getElement(!0),n)})}),this.rightColumns.forEach((n,r)=>{n.modules.frozen.marginValue=s,n.modules.frozen.margin=n.modules.frozen.marginValue+"px",n.visible&&(s+=n.getWidth()),r==this.rightColumns.length-1?n.modules.frozen.edge=!0:n.modules.frozen.edge=!1,n.parent.isGroup?this.layoutElement(this.getColGroupParentElement(n),n):this.layoutElement(n.getElement(),n),e&&n.cells.forEach(o=>{this.layoutElement(o.getElement(!0),n)})})}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0),t=this.table.rowManager.getRows().filter(i=>!e.includes(i));t.forEach(i=>{i.deinitialize()}),e.forEach(i=>{i.type==="row"&&this.layoutRow(i)})}layoutRow(e){this.table.options.layout==="fitDataFill"&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach(t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}),this.rightColumns.forEach(t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})}layoutElement(e,t){var i;t.modules.frozen&&e&&(e.style.position="sticky",this.table.rtl?i=t.modules.frozen.position==="left"?"right":"left":i=t.modules.frozen.position,e.style[i]=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),e.classList.toggle("tabulator-frozen-left",t.modules.frozen.edge&&t.modules.frozen.position==="left"),e.classList.toggle("tabulator-frozen-right",t.modules.frozen.edge&&t.modules.frozen.position==="right"))}adjustForScrollbar(e){this.rightColumns.length&&(this.table.columnManager.getContentsElement().style.width="calc(100% - "+e+"px)")}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(e,t){var i=0;for(let s=0;s{this.initializeRow(e)})}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;i==="number"?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):i==="function"?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){var t=this.rows.indexOf(e);return t>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach(i=>{t.push(i)}),t}getRows(e){var t=e.slice(0);return this.rows.forEach(function(i){var s=t.indexOf(i);s>-1&&t.splice(s,1)}),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach((t,i)=>{this.table.rowManager.styleRow(t,i)})}}b(tt,"moduleName","frozenRows");class Li{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._group.groupManager.table.componentFunctionBinder.handle("group",t._group,i)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return this._group.parent?this._group.parent.getComponent():!1}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(e,t){return this._group.groupManager.table.rowManager.scrollToRow(this._group,e,t)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class J{constructor(e,t,i,s,n,r,o){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=n,this.hasSubGroups=i{t.modules&&delete t.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),this.groupManager.table.options.movableRows!==!1&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach(t=>{this._createGroup(t,e)})}addBindings(){var e;this.groupManager.table.options.groupToggleElement&&(e=this.groupManager.table.options.groupToggleElement=="arrow"?this.arrowElement:this.element,e.addEventListener("click",t=>{this.groupManager.table.options.groupToggleElement==="arrow"&&(t.stopPropagation(),t.stopImmediatePropagation()),setTimeout(()=>{this.toggleVisibility()})}))}_createGroup(e,t){var i=t+"_"+e,s=new J(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],this.old?this.old.groups[i]:!1);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var n=this.rows.indexOf(t);n>-1?i?this.rows.splice(n+1,0,e):this.rows.splice(n,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach(function(t){t.scrollHeader(e)}))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),!this.groupManager.table.options.groupValues&&!this.rows.length?(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0)):(i.parentNode&&i.parentNode.removeChild(i),this.groupManager.blockRedraw||(this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)))}removeGroup(e){var t=e.level+"_"+e.key,i;this.groups[t]&&(delete this.groups[t],i=this.groupList.indexOf(e),i>-1&&this.groupList.splice(i,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(){var e=[];return e.push(this),this._visSet(),this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.visible?this.groupList.length?this.groupList.forEach(function(t){e=e.concat(t.getHeadersAndRows())}):(this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),e=e.concat(this.rows),this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))):!this.groupList.length&&this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&(this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),e.push(this.calcs.top)),this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),e.push(this.calcs.bottom))),e}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach(s=>{i.push(s.getData(t||"data"))}),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach(t=>{e+=t.getRowCount()}):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,this.groupManager.table.rowManager.getRenderMode()=="basic"&&!this.groupManager.table.options.pagination?(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach(e=>{var t=e.getHeadersAndRows();t.forEach(i=>{i.detachElement()})}):this.rows.forEach(e=>{var t=e.getElement();t.parentNode.removeChild(t)}),this.groupManager.updateGroupRows(!0)):this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,this.groupManager.table.rowManager.getRenderMode()=="basic"&&!this.groupManager.table.options.pagination){this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach(t=>{var i=t.getHeadersAndRows();i.forEach(s=>{var n=s.getElement();e.parentNode.insertBefore(n,e.nextSibling),s.initialize(),e=n})}):this.rows.forEach(t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}),this.groupManager.updateGroupRows(!0)}else this.groupManager.updateGroupRows(!0);this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];typeof this.visible=="function"&&(this.rows.forEach(function(t){e.push(t.getData())}),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach(function(i){var s=i.getRowGroup(e);s&&(t=s)}):this.rows.find(function(i){return i===e})&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach(function(i){t.push(e?i.getComponent():i)}),t}getRows(e,t){var i=[];return t&&this.groupList.length?this.groupList.forEach(s=>{i=i.concat(s.getRows(e,t))}):this.rows.forEach(function(s){i.push(e?s.getComponent():s)}),i}generateGroupHeaderContents(){var e=[],t=this.getRows(!1,!0);for(t.forEach(function(i){e.push(i.getData())}),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);typeof this.elementContents=="string"?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(n,r)=>{this.headerGenerator[0]=(o,a,h)=>(typeof o>"u"?"":o)+"("+a+" "+(a===1?n:r.groups.items)+")"}),this.groupIDLookups=[],e)this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="table"&&this.table.options.columnCalcs!="both"&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="group"){var s=this.table.columnManager.getRealColumns();s.forEach(n=>{n.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),n.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()})}Array.isArray(e)||(e=[e]),e.forEach((n,r)=>{var o,a;typeof n=="function"?o=n:(a=this.table.columnManager.getColumnByField(n),a?o=function(h){return a.getFieldValue(h)}:o=function(h){return h[n]}),this.groupIDLookups.push({field:typeof n=="function"?!1:n,func:o,values:this.allowedValues?this.allowedValues[r]:!1})}),t&&(Array.isArray(t)||(t=[t]),t.forEach(n=>{}),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(this.table.options.groupBy)t=t.filter(i=>i.type!=="group"),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px";else return t}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&s.indexOf(t)==-1?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),!e&&this.table.modExists("columnCalcs")&&this.table.options.columnCalcs===!0&&this.table.modules.columnCalcs.reinitializeCalcs(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return e.modules.group?e.modules.group.getComponent():!1}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof J&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof J?t:t.modules.group,n=e instanceof J?e:e.modules.group;s===n?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(n&&n.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach(function(i){t.push(e?i.getComponent():i)}),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach(i=>{i.groupList.length?t=t.concat(this.getChildGroups(i)):t.push(i)}),t}wipe(){this.table.options.groupBy&&(this.groupList.forEach(function(e){e.wipe()}),this.groupList=[],this.groups={})}pullGroupListData(e){var t=[];return e.forEach(i=>{var s={};s.level=0,s.rowCount=0,s.headerContent="";var n=[];i.hasSubGroups?(n=this.pullGroupListData(i.groupList),s.level=i.level,s.rowCount=n.length-i.groupList.length,s.headerContent=i.generator(i.key,s.rowCount,i.rows,i),t.push(s),t=t.concat(n)):(s.level=i.level,s.headerContent=i.generator(i.key,i.rows.length,i.rows,i),s.rowCount=i.getRows().length,t.push(s),i.getRows().forEach(r=>{t.push(r.getData("data"))}))}),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach(i=>{var s=i.getRowGroup(e);s&&(t=s)}),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach(i=>{this.createGroup(i,0,t)}),e.forEach(i=>{this.assignRowToExistingGroup(i,t)})):e.forEach(i=>{this.assignRowToGroup(i,t)}),Object.values(t).forEach(i=>{i.wipe(!0)})}createGroup(e,t,i){var s=t+"_"+e,n;i=i||[],n=new J(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[s]),this.groups[s]=n,this.groupList.push(n)}assignRowToExistingGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s="0_"+i;this.groups[s]&&this.groups[s].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if(e.type==="row"){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e),n;n=i.length==s.length&&i.every((r,o)=>r===s[o]),n||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach(s=>{t.push(s.func(i))}),t}updateGroupRows(e){var t=[];return this.blockRedraw||(this.groupList.forEach(i=>{t=t.concat(i.getHeadersAndRows())}),e&&this.refreshData(!0)),t}scrollHeaders(e){this.table.options.groupBy&&(this.table.options.renderHorizontal==="virtual"&&(e-=this.table.columnManager.renderer.vDomPadLeft),e=e+"px",this.groupList.forEach(t=>{t.scrollHeader(e)}))}removeGroup(e){var t=e.level+"_"+e.key,i;this.groups[t]&&(delete this.groups[t],i=this.groupList.indexOf(e),i>-1&&this.groupList.splice(i,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),i.type!=="group"&&(t=!1)}),t?e.style.minWidth=this.table.columnManager.getWidth()+"px":e.style.minWidth=""}}b(it,"moduleName","groupRows");var Si={cellEdit:function(l){l.component.setValueProcessData(l.data.oldValue),l.component.cellRendered()},rowAdd:function(l){l.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowDelete:function(l){var e=this.table.rowManager.addRowActual(l.data.data,l.data.pos,l.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(l.component,e),this.table.rowManager.checkPlaceholder()},rowMove:function(l){var e=l.data.posFrom-l.data.posTo>0;this.table.rowManager.moveRowActual(l.component,this.table.rowManager.getRowFromPosition(l.data.posFrom),e),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},Di={cellEdit:function(l){l.component.setValueProcessData(l.data.newValue),l.component.cellRendered()},rowAdd:function(l){var e=this.table.rowManager.addRowActual(l.data.data,l.data.pos,l.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(l.component,e),this.table.rowManager.checkPlaceholder()},rowDelete:function(l){l.component.deleteActual(),this.table.rowManager.checkPlaceholder()},rowMove:function(l){this.table.rowManager.moveRowActual(l.component,this.table.rowManager.getRowFromPosition(l.data.posTo),l.data.after),this.table.rowManager.regenerateRowPositions(),this.table.rowManager.reRenderInPosition()}},zi={undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]},Hi={undo:function(l){var e=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell,e||(l.preventDefault(),this.table.modules.history.undo()))},redo:function(l){var e=!1;this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(e=this.table.modules.edit.currentCell,e||(l.preventDefault(),this.table.modules.history.redo()))}},Fi={keybindings:{bindings:zi,actions:Hi}};const I=class I extends w{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(i=e.getComponent().getGroup()._getSelf().rows,t=i.indexOf(e),t&&(t=i[t-1])):(t=e.table.rowManager.getRowIndex(e),t&&(t=e.table.rowManager.rows[t-1])),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex(function(i){return i.component===e});t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return I.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}else return console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return I.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}else return console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled"),!1}_rebindRow(e,t){this.history.forEach(function(i){if(i.component instanceof S)i.component===e&&(i.component=t);else if(i.component instanceof ne&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}})}};b(I,"moduleName","history"),b(I,"moduleExtensions",Fi),b(I,"undoers",Si),b(I,"redoers",Di);let Re=I;class st extends w{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&this.table.originalElement.tagName==="TABLE"&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],n=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var r=0;r{r[d.toLowerCase()]=d});for(var o in s){var a=s[o],h;a&&typeof a=="object"&&a.name&&a.name.indexOf("tabulator-")===0&&(h=a.name.replace("tabulator-",""),typeof r[h]<"u"&&(t[r[h]]=this._attribValue(a.value)))}}_attribValue(e){return e==="true"?!0:e==="false"?!1:e}_findCol(e){var t=this.table.options.columns.find(i=>i.title===e);return t||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",r||"Unable to import data"),Promise.reject(r)))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),typeof e=="string"?t=ee.importers[e]:t=e,t||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t,i){var s=this.lookupImporter(e);if(s)return this.pickFile(t,i).then(this.importData.bind(this,s)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch(n=>(this.dispatch("import-error",n),this.dispatchExternal("importError",n),console.error("Import Error:",n||"Unable to import file"),Promise.reject(n)))}pickFile(e,t){return new Promise((i,s)=>{var n=document.createElement("input");n.type="file",n.accept=e,n.addEventListener("change",r=>{var o=n.files[0],a=new FileReader;switch(this.dispatch("import-importing",n.files),this.dispatchExternal("importImporting",n.files),t||this.table.options.importReader){case"buffer":a.readAsArrayBuffer(o);break;case"binary":a.readAsBinaryString(o);break;case"url":a.readAsDataURL(o);break;case"text":default:a.readAsText(o)}a.onload=h=>{i(a.result)},a.onerror=h=>{console.warn("File Load Error - Unable to read file"),s()}}),this.dispatch("import-choose"),this.dispatchExternal("importChoose"),n.click()})}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){var t=[];return Array.isArray(e)&&e.length&&Array.isArray(e[0])?(this.table.options.autoColumns?t=this.structureArrayToObject(e):t=this.structureArrayToColumns(e),t):e}structureArrayToObject(e){var t=e.shift(),i=e.map(s=>{var n={};return t.forEach((r,o)=>{n[r]=s[o]}),n});return i}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach(s=>{var n={};s.forEach((r,o)=>{var a=i[o];a&&(n[a.getField()]=r)}),t.push(n)}),t}setData(e){return this.dispatch("import-imported",e),this.dispatchExternal("importImported",e),this.table.setData(e)}};b(ee,"moduleName","import"),b(ee,"importers",Bi);let xe=ee;class nt extends w{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerMouseDown"),this.registerColumnOption("headerMouseUp"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellMouseDown"),this.registerColumnOption("cellMouseUp"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this)),this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this)),this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){var e=Object.values(this.touchWatchers);e.forEach(t=>{for(let i in t)t[i]=null})}cellContentsSelectionFixer(e,t){var i;if(!(this.table.modExists("edit")&&this.table.modules.edit.currentCell===t)){e.preventDefault();try{document.selection?(i=document.body.createTextRange(),i.moveToElementText(t.getElement()),i.select()):window.getSelection&&(i=document.createRange(),i.selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch{}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?this.subscribers[e]&&!this.columnSubscribers[e]&&!this.subscribedExternal(e)&&(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let s in this.eventMap)this.eventMap[s]===i&&this.subscribers[s]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var n=this.touchWatchers[e];switch(e==="column"&&(e="header"),t){case"start":n.tap=!0,clearTimeout(n.tapHold),n.tapHold=setTimeout(()=>{clearTimeout(n.tapHold),n.tapHold=null,n.tap=null,clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)},1e3);break;case"end":n.tap&&(n.tap=null,this.dispatchEvent(e+"Tap",i,s)),n.tapDbl?(clearTimeout(n.tapDbl),n.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):n.tapDbl=setTimeout(()=>{clearTimeout(n.tapDbl),n.tapDbl=null},300),clearTimeout(n.tapHold),n.tapHold=null;break}}dispatchEvent(e,t,i){var s=i.getComponent(),n;this.columnSubscribers[e]&&(i instanceof ne?n=i.column.definition[e]:i instanceof U&&(n=i.definition[e]),n&&n(t,s)),this.dispatchExternal(e,t,s)}}b(nt,"moduleName","interaction");var Vi={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35},Ii={keyBlock:function(l){l.stopPropagation(),l.preventDefault()},scrollPageUp:function(l){var e=this.table.rowManager,t=e.scrollTop-e.element.clientHeight;l.preventDefault(),e.displayRowsCount&&(t>=0?e.element.scrollTop=t:e.scrollToRow(e.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(l){var e=this.table.rowManager,t=e.scrollTop+e.element.clientHeight,i=e.element.scrollHeight;l.preventDefault(),e.displayRowsCount&&(t<=i?e.element.scrollTop=t:e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(l){var e=this.table.rowManager;l.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(l){var e=this.table.rowManager;l.preventDefault(),e.displayRowsCount&&e.scrollToRow(e.getDisplayRows()[e.displayRowsCount-1]),this.table.element.focus()},navPrev:function(l){this.dispatch("keybinding-nav-prev",l)},navNext:function(l){this.dispatch("keybinding-nav-next",l)},navLeft:function(l){this.dispatch("keybinding-nav-left",l)},navRight:function(l){this.dispatch("keybinding-nav-right",l)},navUp:function(l){this.dispatch("keybinding-nav-up",l)},navDown:function(l){this.dispatch("keybinding-nav-down",l)}};const N=class N extends w{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],e!==!1&&(Object.assign(t,N.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)N.actions[t]?e[t]&&(typeof e[t]!="object"&&(e[t]=[e[t]]),e[t].forEach(i=>{var s=Array.isArray(i)?i:[i];s.forEach(n=>{this.mapBinding(t,n)})})):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:N.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1},s=t.toString().toLowerCase().split(" ").join("").split("+");s.forEach(n=>{switch(n){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:n=isNaN(n)?n.toUpperCase().charCodeAt(0):parseInt(n),i.keys.push(n),this.watchKeys[n]||(this.watchKeys[n]=[]),this.watchKeys[n].push(i)}})}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach(function(n){e.checkBinding(t,n)}))},this.keydownBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];if(s){var n=e.pressedKeys.indexOf(i);n>-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta?(t.keys.forEach(s=>{var n=this.pressedKeys.indexOf(s);n==-1&&(i=!1)}),i&&t.action.call(this,e),!0):!1}};b(N,"moduleName","keybindings"),b(N,"bindings",Vi),b(N,"actions",Ii);let Te=N;class rt extends w{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("rowDblClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerTableOption("groupDblClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerDblClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu"),this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu)),this.table.options.rowDblClickMenu&&this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu)),this.table.options.groupDblClickMenu&&this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu&&(this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu)),t.dblClickMenu&&!this.columnSubscribers.dblClickMenu&&(this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu"),this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu))}initializeColumnHeaderMenu(e){var t=e.definition.headerMenuIcon,i;i=document.createElement("span"),i.classList.add("tabulator-header-popup-button"),t?(typeof t=="function"&&(t=t(e.getComponent())),t instanceof HTMLElement?i.appendChild(t):i.innerHTML=t):i.innerHTML="⋮",i.addEventListener("click",s=>{s.stopPropagation(),s.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,s,e)}),e.titleElement.insertBefore(i,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e=typeof e=="function"?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,n){var r=!(e instanceof MouseEvent),o=document.createElement("div"),a;if(o.classList.add("tabulator-menu"),r||e.preventDefault(),!(!i||!i.length)){if(s)a=n.child(o);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout(()=>{this.nestedMenuBlock=!1},100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=a=this.popup(o)}i.forEach(h=>{var d=document.createElement("div"),u=h.label,c=h.disabled;h.separator?d.classList.add("tabulator-menu-separator"):(d.classList.add("tabulator-menu-item"),typeof u=="function"&&(u=u.call(this.table,t.getComponent())),u instanceof Node?d.appendChild(u):d.innerHTML=u,typeof c=="function"&&(c=c.call(this.table,t.getComponent())),c?(d.classList.add("tabulator-menu-item-disabled"),d.addEventListener("click",f=>{f.stopPropagation()})):h.menu&&h.menu.length?d.addEventListener("click",f=>{f.stopPropagation(),this.loadMenu(f,t,h.menu,d,a)}):h.action&&d.addEventListener("click",f=>{h.action(f,t.getComponent())}),h.menu&&h.menu.length&&d.classList.add("tabulator-menu-item-submenu")),o.appendChild(d)}),o.addEventListener("click",h=>{this.rootPopup&&this.rootPopup.hide()}),a.show(s||e),a===this.rootPopup&&(this.rootPopup.hideOnBlur(()=>{this.rootPopup=null,this.currentComponent&&(this.dispatch("menu-closed",i,a),this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)}),this.currentComponent=t,this.dispatch("menu-opened",i,a),this.dispatchExternal("menuOpened",t.getComponent()))}}}b(rt,"moduleName","menu");class ot extends w{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&(this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("alert-show",this.abortMove.bind(this)))}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(e){var t=this,i={},s;!e.modules.frozen&&!e.isGroup&&!e.isRowHeader&&(s=e.getElement(),i.mousemove=(function(n){e.parent===t.moving.parent&&((t.touchMove?n.touches[0].pageX:n.pageX)-x.elOffset(s).left+t.table.columnManager.contentsElement.scrollLeft>e.getWidth()/2?(t.toCol!==e||!t.toColAfter)&&(s.parentNode.insertBefore(t.placeholderElement,s.nextSibling),t.moveColumn(e,!0)):(t.toCol!==e||t.toColAfter)&&(s.parentNode.insertBefore(t.placeholderElement,s),t.moveColumn(e,!1)))}).bind(t),s.addEventListener("mousedown",function(n){t.touchMove=!1,n.which===1&&(t.checkTimeout=setTimeout(function(){t.startMove(n,e)},t.checkPeriod))}),s.addEventListener("mouseup",function(n){n.which===1&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),t.bindTouchEvents(e)),e.modules.moveColumn=i}bindTouchEvents(e){var t=e.getElement(),i=!1,s,n,r,o,a,h;t.addEventListener("touchstart",d=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,s=e.nextColumn(),r=s?s.getWidth()/2:0,n=e.prevColumn(),o=n?n.getWidth()/2:0,a=0,h=0,i=!1,this.startMove(d,e)},this.checkPeriod)},{passive:!0}),t.addEventListener("touchmove",d=>{var u,c;this.moving&&(this.moveHover(d),i||(i=d.touches[0].pageX),u=d.touches[0].pageX-i,u>0?s&&u-a>r&&(c=s,c!==e&&(i=d.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveColumn(c,!0))):n&&-u-h>o&&(c=n,c!==e&&(i=d.touches[0].pageX,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveColumn(c,!1))),c&&(s=c.nextColumn(),a=r,r=s?s.getWidth()/2:0,n=c.prevColumn(),h=o,o=n?n.getWidth()/2:0))},{passive:!0}),t.addEventListener("touchend",d=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(d)})}startMove(e,t){var i=t.getElement(),s=this.table.columnManager.getContentsElement(),n=this.table.columnManager.getHeadersElement();this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection&&this.table.modules.selectRange.mousedown&&this.table.modules.selectRange.selecting==="column"||(this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-x.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),s.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=s.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e),this.dispatch("column-moving",e,this.moving))}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)})}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach(function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)})}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach(function(s,n){var r=s.getElement(!0);r.parentNode&&i[n]&&r.parentNode.insertBefore(i[n].getElement(),r.nextSibling)}):e.getCells().forEach(function(s,n){var r=s.getElement(!0);r.parentNode&&i[n]&&r.parentNode.insertBefore(i[n].getElement(),r)})}endMove(e){(e.which===1||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var t=this.table.columnManager.getContentsElement(),i=t.scrollLeft,s=(this.touchMove?e.touches[0].pageX:e.pageX)-x.elOffset(t).left+i,n;this.hoverElement.style.left=s-this.startX+"px",s-i{n=Math.max(0,i-5),this.table.rowManager.getElement().scrollLeft=n,this.autoScrollTimeout=!1},1))),i+t.clientWidth-s{n=Math.min(t.clientWidth,i+5),this.table.rowManager.getElement().scrollLeft=n,this.autoScrollTimeout=!1},1)))}}b(ot,"moduleName","moveColumn");var Ni={delete:function(l,e,t){l.delete()}},Wi={insert:function(l,e,t){return this.table.addRow(l.getData(),void 0,e),!0},add:function(l,e,t){return this.table.addRow(l.getData()),!0},update:function(l,e,t){return e?(e.update(l.getData()),!0):!1},replace:function(l,e,t){return e?(this.table.addRow(l.getData(),void 0,e),e.delete(),!0):!1}};const G=class G extends w{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var t=this,i={};i.mouseup=(function(s){t.tableRowDrop(s,e)}).bind(t),i.mousemove=(function(s){var n;s.pageY-x.elOffset(e.element).top+t.table.rowManager.element.scrollTop>e.getHeight()/2?(t.toRow!==e||!t.toRowAfter)&&(n=e.getElement(),n.parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(n=e.getElement(),n.previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1)))}).bind(t),e.modules.moveRow=i}initializeRow(e){var t=this,i={},s;i.mouseup=(function(n){t.tableRowDrop(n,e)}).bind(t),i.mousemove=(function(n){var r=e.getElement();n.pageY-x.elOffset(r).top+t.table.rowManager.element.scrollTop>e.getHeight()/2?(t.toRow!==e||!t.toRowAfter)&&(r.parentNode.insertBefore(t.placeholderElement,r.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(r.parentNode.insertBefore(t.placeholderElement,r),t.moveRow(e,!1))}).bind(t),this.hasHandle||(s=e.getElement(),s.addEventListener("mousedown",function(n){n.which===1&&(t.checkTimeout=setTimeout(function(){t.startMove(n,e)},t.checkPeriod))}),s.addEventListener("mouseup",function(n){n.which===1&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=i}initializeColumn(e){e.definition.rowHandle&&this.table.options.movableRows!==!1&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&this.table.options.movableRows!==!1){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",function(s){s.which===1&&(t.checkTimeout=setTimeout(function(){t.startMove(s,e.row)},t.checkPeriod))}),i.addEventListener("mouseup",function(s){s.which===1&&t.checkTimeout&&clearTimeout(t.checkTimeout)}),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i=!1,s,n,r,o,a,h;t.addEventListener("touchstart",d=>{this.checkTimeout=setTimeout(()=>{this.touchMove=!0,s=e.nextRow(),r=s?s.getHeight()/2:0,n=e.prevRow(),o=n?n.getHeight()/2:0,a=0,h=0,i=!1,this.startMove(d,e)},this.checkPeriod)},{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",d=>{var u,c;this.moving&&(d.preventDefault(),this.moveHover(d),i||(i=d.touches[0].pageY),u=d.touches[0].pageY-i,u>0?s&&u-a>r&&(c=s,c!==e&&(i=d.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement().nextSibling),this.moveRow(c,!0))):n&&-u-h>o&&(c=n,c!==e&&(i=d.touches[0].pageY,c.getElement().parentNode.insertBefore(this.placeholderElement,c.getElement()),this.moveRow(c,!1))),c&&(s=c.nextRow(),a=r,r=s?s.getHeight()/2:0,n=c.prevRow(),h=o,o=n?n.getHeight()/2:0))}),t.addEventListener("touchend",d=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(d),this.touchMove=!1)})}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach(e=>{(e.type==="row"||e.type==="group")&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)})}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach(e=>{(e.type==="row"||e.type==="group")&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)})}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i=this.touchMove?e.touches[0].pageX:e.pageX,s=this.touchMove?e.touches[0].pageY:e.pageY,n,r;n=t.getElement(),this.connection?(r=n.getBoundingClientRect(),this.startX=r.left-i+window.pageXOffset,this.startY=r.top-s+window.pageYOffset):this.startY=s-n.getBoundingClientRect().top}endMove(e){(!e||e.which===1||this.touchMove)&&(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,i?i.getComponent():!1)}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach(i=>{typeof i=="string"?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(i))):this.connectionElements.push(i)}),this.connectionElements.forEach(i=>{var s=n=>{this.elementRowDrop(n,i,this.moving)};i.addEventListener("mouseup",s),i.tabulatorElementDropEvent=s,i.classList.add("tabulator-movingrow-receiving")}))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach(t=>{t.classList.remove("tabulator-movingrow-receiving"),t.removeEventListener("mouseup",t.tabulatorElementDropEvent),delete t.tabulatorElementDropEvent})}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(i=>{i.type==="row"&&i.modules.moveRow&&i.modules.moveRow.mouseup&&i.getElement().addEventListener("mouseup",i.modules.moveRow.mouseup)}),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach(t=>{t.type==="row"&&t.modules.moveRow&&t.modules.moveRow.mouseup&&t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=G.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender;break}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=G.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver;break}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}};b(G,"moduleName","moveRow"),b(G,"senders",Ni),b(G,"receivers",Wi);let ke=G;var Gi={};const Y=class Y extends w{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach(s=>{var n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1)),r;e.definition[n]&&(r=this.lookupMutator(e.definition[n]),r&&(t=!0,i[n]={mutator:r,params:e.definition[n+"Params"]||{}}))}),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":Y.mutators[e]?t=Y.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e;break}return t}transformRow(e,t,i){var s="mutator"+(t.charAt(0).toUpperCase()+t.slice(1)),n;return this.enabled&&this.table.columnManager.traverse(r=>{var o,a,h;r.modules.mutate&&(o=r.modules.mutate[s]||r.modules.mutate.mutator||!1,o&&(n=r.getFieldValue(typeof i<"u"?i:e),(t=="data"&&!i||typeof n<"u")&&(h=r.getComponent(),a=typeof o.params=="function"?o.params(n,e,t,h):o.params,r.setFieldValue(e,o.mutator(n,e,t,a,h)))))}),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach(i=>{var s=e.row.getCell(i);s&&s.setValue(s.getValue(),!0,!0)}))}enable(){this.enabled=!0}disable(){this.enabled=!1}};b(Y,"moduleName","mutator"),b(Y,"mutators",Gi);let Me=Y;function ji(l,e,t,i,s){var n=document.createElement("span"),r=document.createElement("span"),o=document.createElement("span"),a=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",u=>{r.innerHTML=u}),this.table.modules.localize.langBind("pagination|counter|of",u=>{a.innerHTML=u}),this.table.modules.localize.langBind("pagination|counter|rows",u=>{d.innerHTML=u}),i?(o.innerHTML=" "+e+"-"+Math.min(e+l-1,i)+" ",h.innerHTML=" "+i+" ",n.appendChild(r),n.appendChild(o),n.appendChild(a),n.appendChild(h),n.appendChild(d)):(o.innerHTML=" 0 ",n.appendChild(r),n.appendChild(o),n.appendChild(d)),n}function Ui(l,e,t,i,s){var n=document.createElement("span"),r=document.createElement("span"),o=document.createElement("span"),a=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",u=>{r.innerHTML=u}),o.innerHTML=" "+t+" ",this.table.modules.localize.langBind("pagination|counter|of",u=>{a.innerHTML=u}),h.innerHTML=" "+s+" ",this.table.modules.localize.langBind("pagination|counter|pages",u=>{d.innerHTML=u}),n.appendChild(r),n.appendChild(o),n.appendChild(a),n.appendChild(h),n.appendChild(d),n}var Xi={rows:ji,pages:Ui};const te=class te extends w{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),this.table.options.paginationAddRow=="page"&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),this.table.options.paginationMode==="remote"&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),this.table.options.progressiveLoad==="scroll"&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i=this.table.rowManager,s=i.getDisplayRows(),n;return t?s.length?n=s[0]:i.activeRows.length&&(n=i.activeRows[i.activeRows.length-1],t=!1):s.length&&(n=s[s.length-1],t=!(s.length{}))}restOnRenderBefore(e,t){return t||this.mode==="local"&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),e=document.createElement("button"),e.classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,this.pageSizes.indexOf(this.size)==-1&&e.unshift(this.size);else if(this.pageSizes.indexOf(this.size)==-1){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach(t=>{var i=document.createElement("option");i.value=t,t===!0?this.langBind("pagination|all",function(s){i.innerHTML=s}):i.innerHTML=t,this.pageSizeSelect.appendChild(i)}),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&(typeof e=="function"?t=e:t=te.pageCounters[e],t?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",s=>{this.firstBut.innerHTML=s}),this.langBind("pagination|first_title",s=>{this.firstBut.setAttribute("aria-label",s),this.firstBut.setAttribute("title",s)}),this.langBind("pagination|prev",s=>{this.prevBut.innerHTML=s}),this.langBind("pagination|prev_title",s=>{this.prevBut.setAttribute("aria-label",s),this.prevBut.setAttribute("title",s)}),this.langBind("pagination|next",s=>{this.nextBut.innerHTML=s}),this.langBind("pagination|next_title",s=>{this.nextBut.setAttribute("aria-label",s),this.nextBut.setAttribute("title",s)}),this.langBind("pagination|last",s=>{this.lastBut.innerHTML=s}),this.langBind("pagination|last_title",s=>{this.lastBut.setAttribute("aria-label",s),this.lastBut.setAttribute("title",s)}),this.firstBut.addEventListener("click",()=>{this.setPage(1)}),this.prevBut.addEventListener("click",()=>{this.previousPage()}),this.nextBut.addEventListener("click",()=>{this.nextPage()}),this.lastBut.addEventListener("click",()=>{this.setPage(this.max)}),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",s=>{this.pageSizeSelect.setAttribute("aria-label",s),this.pageSizeSelect.setAttribute("title",s),t.innerHTML=s}),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",s=>{this.setPageSize(this.pageSizeSelect.value=="true"?!0:this.pageSizeSelect.value),this.setPage(1)})),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):typeof this.table.options.paginationCounterElement=="string"&&(i=document.querySelector(this.table.options.paginationCounterElement),i?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){e?this.max=this.size===!0?1:Math.ceil(e/this.size):this.max=1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||(this.mode=="local"||e)&&(this.page=1,this.trackChanges())}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return e=parseInt(e),e>0&&e<=this.max||this.mode!=="local"?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1),i=t.indexOf(e);if(i>-1){var s=this.size===!0?1:Math.ceil((i+1)/this.size);return this.setPage(s)}else return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){e!==!0&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch(this.mode==="remote"&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),s=this.pageCounter.call(this,t,i,this.page,e,this.max),typeof s){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",s!=null&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&n<=this.max&&this.pagesElement.appendChild(this._generatePageButton(n));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)}),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",i=>{this.setPage(e)}),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.pagea.type==="row");if(this.mode=="local"){i=[],this.setMaxRows(e.length),this.size===!0?(s=0,n=e.length):(s=this.size*(this.page-1),n=s+parseInt(this.size)),this._setPageButtons();for(let a=s;a{this.dataChanging=!1});case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(typeof e.last_page>"u"&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data)if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=typeof e.last_row<"u"?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":this.page==1?this.table.rowManager.setData(e.data,!1,this.page==1):this.table.rowManager.addRows(e.data),this.page{this.nextPage()},this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=this.page===1?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,this.page!==1,this.page==1),t=this.table.options.progressiveLoadScrollMargin||this.table.rowManager.element.clientHeight*2,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()});break}return!1}else this.dispatchExternal("pageLoaded",this.getPage());else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}};b(te,"moduleName","page"),b(te,"pageCounters",Xi);let Le=te;var Ji={local:function(l,e){var t=localStorage.getItem(l+"-"+e);return t?JSON.parse(t):!1},cookie:function(l,e){var t=document.cookie,i=l+"-"+e,s=t.indexOf(i+"="),n,r;return s>-1&&(t=t.slice(s),n=t.indexOf(";"),n>-1&&(t=t.slice(0,n)),r=t.replace(i+"=","")),r?JSON.parse(r):!1}},Ki={local:function(l,e,t){localStorage.setItem(l+"-"+e,JSON.stringify(t))},cookie:function(l,e,t){var i=new Date;i.setDate(i.getDate()+1e4),document.cookie=l+"-"+e+"="+JSON.stringify(t)+"; expires="+i.toUTCString()}};const D=class D extends w{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}initialize(){if(this.table.options.persistence){var e=this.table.options.persistenceMode,t=this.table.options.persistenceID,i;this.mode=e!==!0?e:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?typeof this.table.options.persistenceReaderFunc=="function"?this.readFunc=this.table.options.persistenceReaderFunc:D.readers[this.table.options.persistenceReaderFunc]?this.readFunc=D.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):D.readers[this.mode]?this.readFunc=D.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?typeof this.table.options.persistenceWriterFunc=="function"?this.writeFunc=this.table.options.persistenceWriterFunc:D.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=D.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):D.writers[this.mode]?this.writeFunc=D.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(t||this.table.element.getAttribute("id")||""),this.config={sort:this.table.options.persistence===!0||this.table.options.persistence.sort,filter:this.table.options.persistence===!0||this.table.options.persistence.filter,headerFilter:this.table.options.persistence===!0||this.table.options.persistence.headerFilter,group:this.table.options.persistence===!0||this.table.options.persistence.group,page:this.table.options.persistence===!0||this.table.options.persistence.page,columns:this.table.options.persistence===!0?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(i=this.retrieveData("page"),i&&(typeof i.paginationSize<"u"&&(this.config.page===!0||this.config.page.size)&&(this.table.options.paginationSize=i.paginationSize),typeof i.paginationInitialPage<"u"&&(this.config.page===!0||this.config.page.page)&&(this.table.options.paginationInitialPage=i.paginationInitialPage))),this.config.group&&(i=this.retrieveData("group"),i&&(typeof i.groupBy<"u"&&(this.config.group===!0||this.config.group.groupBy)&&(this.table.options.groupBy=i.groupBy),typeof i.groupStartOpen<"u"&&(this.config.group===!0||this.config.group.groupStartOpen)&&(this.table.options.groupStartOpen=i.groupStartOpen),typeof i.groupHeader<"u"&&(this.config.group===!0||this.config.group.groupHeader)&&(this.table.options.groupHeader=i.groupHeader))),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("column-width",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t,i;this.config.sort&&(e=this.load("sort"),e&&(this.table.options.initialSort=e)),this.config.filter&&(t=this.load("filter"),t&&(this.table.options.initialFilter=t)),this.config.headerFilter&&(i=this.load("headerFilter"),i&&(this.table.options.initialHeaderFilter=i))}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e,!0)),!0}initializeColumn(e){var t,i;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),i=this.config.columns===!0?Object.keys(t):this.config.columns,i.forEach(s=>{var n=Object.getOwnPropertyDescriptor(t,s),r=t[s];n&&Object.defineProperty(t,s,{set:o=>{r=o,this.defWatcherBlock||this.save("columns"),n.set&&n.set(o)},get:()=>(n.get&&n.get(),r)})}),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return this.readFunc?this.readFunc(this.id,e):!1}mergeDefinition(e,t,i){var s=[];return t=t||[],t.forEach((n,r)=>{var o=this._findColumn(e,n),a;o&&(i?a=Object.keys(n):this.config.columns===!0||this.config.columns==null?(a=Object.keys(o),a.push("width")):a=this.config.columns,a.forEach(h=>{h!=="columns"&&typeof n[h]<"u"&&(o[h]=n[h])}),o.columns&&(o.columns=this.mergeDefinition(o.columns,n.columns)),s.push(o))}),e.forEach((n,r)=>{var o=this._findColumn(t,n);o||(s.length>r?s.splice(r,0,n):s.push(n))}),s}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find(function(s){switch(i){case"group":return s.title===t.title&&s.columns.length===t.columns.length;case"field":return s.field===t.field;case"object":return s===t}})}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"headerFilter":t=this.table.modules.filter.getHeaderFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig();break}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach(function(t){t.column=t.field,delete t.field}),e}getGroupConfig(){var e={};return this.config.group&&((this.config.group===!0||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(this.config.group===!0||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(this.config.group===!0||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((this.config.page===!0||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(this.config.page===!0||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach(s=>{var n={},r=s.getDefinition(),o;s.isGroup?(n.title=r.title,n.columns=this.parseColumns(s.getColumns())):(n.field=s.getField(),this.config.columns===!0||this.config.columns==null?(o=Object.keys(r),o.push("width"),o.push("visible")):o=this.config.columns,o.forEach(a=>{switch(a){case"width":n.width=s.getWidth();break;case"visible":n.visible=s.visible;break;default:typeof r[a]!="function"&&i.indexOf(a)===-1&&(n[a]=r[a])}})),t.push(n)}),t}};b(D,"moduleName","persistence"),b(D,"moduleInitOrder",-10),b(D,"readers",Ji),b(D,"writers",Ki);let Se=D;class at extends w{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("rowDblClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerTableOption("groupDblClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerDblClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup"),this.registerColumnOption("dblClickPopup"),this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this)),this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(e,t,i){this.loadPopupEvent(t,null,e,i)}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup)),this.table.options.rowDblClickPopup&&this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup)),this.table.options.groupDblClickPopup&&this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup&&(this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup"),this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup)),t.dblClickPopup&&!this.columnSubscribers.dblClickPopup&&(this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup"),this.subscribe("cell-click",this.columnSubscribers.dblClickPopup))}initializeColumnHeaderPopup(e){var t=e.definition.headerPopupIcon,i;i=document.createElement("span"),i.classList.add("tabulator-header-popup-button"),t?(typeof t=="function"&&(t=t(e.getComponent())),t instanceof HTMLElement?i.appendChild(t):i.innerHTML=t):i.innerHTML="⋮",i.addEventListener("click",s=>{s.stopPropagation(),s.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,s,e)}),e.titleElement.insertBefore(i,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i,s){var n;function r(o){n=o}i._group?i=i._group:i._row&&(i=i._row),e=typeof e=="function"?e.call(this.table,t,i.getComponent(),r):e,this.loadPopup(t,i,e,n,s)}loadPopup(e,t,i,s,n){var r=!(e instanceof MouseEvent),o,a;i instanceof HTMLElement?o=i:(o=document.createElement("div"),o.innerHTML=i),o.classList.add("tabulator-popup"),o.addEventListener("click",h=>{h.stopPropagation()}),r||e.preventDefault(),a=this.popup(o),typeof s=="function"&&a.renderCallback(s),e?a.show(e):a.show(t.getElement(),n||"center"),a.hideOnBlur(()=>{this.dispatchExternal("popupClosed",t.getComponent())}),this.dispatchExternal("popupOpened",t.getComponent())}}b(at,"moduleName","popup");class lt extends w{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.beforeprintEventHandler=null,this.afterprintEventHandler=null,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(this.beforeprintEventHandler=this.replaceTable.bind(this),this.afterprintEventHandler=this.cleanup.bind(this),window.addEventListener("beforeprint",this.beforeprintEventHandler),window.addEventListener("afterprint",this.afterprintEventHandler),this.subscribe("table-destroy",this.destroy.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){this.table.options.printAsHtml&&(window.removeEventListener("beforeprint",this.beforeprintEventHandler),window.removeEventListener("afterprint",this.afterprintEventHandler))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s=window.scrollX,n=window.scrollY,r=document.createElement("div"),o=document.createElement("div"),a=this.table.modules.export.generateTable(typeof i<"u"?i:this.table.options.printConfig,typeof t<"u"?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print"),h,d;this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),h=typeof this.table.options.printHeader=="function"?this.table.options.printHeader.call(this.table):this.table.options.printHeader,typeof h=="string"?r.innerHTML=h:r.appendChild(h),this.element.appendChild(r)),this.element.appendChild(a),this.table.options.printFooter&&(o.classList.add("tabulator-print-footer"),d=typeof this.table.options.printFooter=="function"?this.table.options.printFooter.call(this.table):this.table.options.printFooter,typeof d=="string"?o.innerHTML=d:o.appendChild(d),this.element.appendChild(o)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,a),window.print(),this.cleanup(),window.scrollTo(s,n),this.manualBlock=!1}}b(lt,"moduleName","print");class ht extends w{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t=this,i;this.currentVersion++,i=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments),n;return!t.blocked&&i===t.currentVersion&&(t.block("data-push"),s.forEach(r=>{t.table.rowManager.addRowActual(r,!1)}),n=t.origFuncs.push.apply(e,arguments),t.unblock("data-push")),n}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments),n;return!t.blocked&&i===t.currentVersion&&(t.block("data-unshift"),s.forEach(r=>{t.table.rowManager.addRowActual(r,!0)}),n=t.origFuncs.unshift.apply(e,arguments),t.unblock("data-unshift")),n}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,n;return!t.blocked&&i===t.currentVersion&&(t.block("data-shift"),t.data.length&&(s=t.table.rowManager.getRowFromDataObject(t.data[0]),s&&s.deleteActual()),n=t.origFuncs.shift.call(e),t.unblock("data-shift")),n}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,n;return!t.blocked&&i===t.currentVersion&&(t.block("data-pop"),t.data.length&&(s=t.table.rowManager.getRowFromDataObject(t.data[t.data.length-1]),s&&s.deleteActual()),n=t.origFuncs.pop.call(e),t.unblock("data-pop")),n}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s=Array.from(arguments),n=s[0]<0?e.length+s[0]:s[0],r=s[1],o=s[2]?s.slice(2):!1,a,h;if(!t.blocked&&i===t.currentVersion){if(t.block("data-splice"),o&&(a=e[n]?t.table.rowManager.getRowFromDataObject(e[n]):!1,a?o.forEach(u=>{t.table.rowManager.addRowActual(u,!0,a,!0)}):(o=o.slice().reverse(),o.forEach(u=>{t.table.rowManager.addRowActual(u,!0,!1,!0)}))),r!==0){var d=e.slice(n,typeof s[1]>"u"?s[1]:n+r);d.forEach((u,c)=>{var f=t.table.rowManager.getRowFromDataObject(u);f&&f.deleteActual(c!==d.length-1)})}(o||r!==0)&&t.table.rowManager.reRenderInPosition(),h=t.origFuncs.splice.apply(e,arguments),t.unblock("data-splice")}return h}})}unwatchData(){if(this.data!==!1)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField],s={};i&&(s.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-push");var n=s.push.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-push")}return n}}),s.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-unshift");var n=s.unshift.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-unshift")}return n}}),s.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-shift");var n=s.shift.call(i);this.rebuildTree(e),t.unblock("tree-shift")}return n}}),s.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-pop");var n=s.pop.call(i);this.rebuildTree(e),t.unblock("tree-pop")}return n}}),s.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-splice");var n=s.splice.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-splice")}return n}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,n=Object.getOwnPropertyDescriptor(t,i),r=t[i],o=this.currentVersion;Object.defineProperty(t,i,{set:a=>{if(r=a,!s.blocked&&o===s.currentVersion){s.block("key");var h={};h[i]=a,e.updateData(h),s.unblock("key")}n.set&&n.set(a)},get:()=>(n.get&&n.get(),r)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}}b(ht,"moduleName","reactiveData");class dt extends w{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1),this.registerTableOption("resizableColumnGuide",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){e.row.type==="row"&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.reinitializeColumn(t)}):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.reinitializeColumn(t)}))}frozenColumnOffset(e){var t=!1;return e.modules.frozen&&(t=e.modules.frozen.marginValue,e.modules.frozen.position==="left"?t+=e.getWidth()-3:t&&(t-=3)),t!==!1?t+"px":!1}reinitializeColumn(e){var t=this.frozenColumnOffset(e);e.cells.forEach(i=>{i.modules.resize&&i.modules.resize.handleEl&&(t&&(i.modules.resize.handleEl.style[e.modules.frozen.position]=t,i.modules.resize.handleEl.style["z-index"]=11),i.element.after(i.modules.resize.handleEl))}),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style[e.modules.frozen.position]=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var n=this,r=!1,o=i.definition.resizable,a={},h=i.getLastColumn();if(e==="header"&&(r=i.definition.formatter=="textarea"||i.definition.variableHeight,a={variableHeight:r}),(o===!0||o==e)&&this._checkResizability(h)){var d=document.createElement("span");d.className="tabulator-col-resize-handle",d.addEventListener("click",function(c){c.stopPropagation()});var u=function(c){n.startColumn=i,n.initialNextColumn=n.nextColumn=h.nextColumn(),n._mouseDown(c,h,d)};d.addEventListener("mousedown",u),d.addEventListener("touchstart",u,{passive:!0}),d.addEventListener("dblclick",c=>{var f=h.getWidth();c.stopPropagation(),h.reinitializeWidth(!0),f!==h.getWidth()&&(n.dispatch("column-resized",h),n.dispatchExternal("columnResized",h.getComponent()))}),i.modules.frozen&&(d.style.position="sticky",d.style[i.modules.frozen.position]=this.frozenColumnOffset(i)),a.handleEl=d,s.parentNode&&i.visible&&s.after(d)}t.modules.resize=a}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach(t=>{this.deInitializeComponent(t)})}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl,t&&t.parentElement&&t.parentElement.removeChild(t))}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}resize(e,t){var i=typeof e.clientX>"u"?e.touches[0].clientX:e.clientX,s=i-this.startX,n=i-this.latestX,r,o;if(this.latestX=i,this.table.rtl&&(s=-s,n=-n),r=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(this.startWidth+s),o=t.width==t.minWidth||t.width==t.maxWidth,n<0&&(this.nextColumn=this.initialNextColumn),this.table.options.resizableColumnFit&&this.nextColumn&&!(r&&o)){let a=this.nextColumn.getWidth();n>0&&a<=this.nextColumn.minWidth&&(this.nextColumn=this.nextColumn.nextColumn()),this.nextColumn&&this.nextColumn.setWidth(this.nextColumn.getWidth()-n)}this.table.columnManager.rerenderColumns(!0),!this.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}calcGuidePosition(e,t,i){var s=typeof e.clientX>"u"?e.touches[0].clientX:e.clientX,n=i.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,r=this.table.element.getBoundingClientRect().x,o=t.element.getBoundingClientRect().left-r,a=s-this.startX,h=Math.max(n+a,o+t.minWidth);return t.maxWidth&&(h=Math.min(h,o+t.maxWidth)),h}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this,n;this.dispatchExternal("columnResizing",t.getComponent()),s.table.options.resizableColumnGuide&&(n=document.createElement("span"),n.classList.add("tabulator-col-resize-guide"),s.table.element.appendChild(n),setTimeout(()=>{n.style.left=s.calcGuidePosition(e,t,i)+"px"})),s.table.element.classList.add("tabulator-block-select");function r(a){s.table.options.resizableColumnGuide?n.style.left=s.calcGuidePosition(a,t,i)+"px":s.resize(a,t)}function o(a){s.table.options.resizableColumnGuide&&(s.resize(a,t),n.remove()),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",r),i.removeEventListener("touchmove",r),i.removeEventListener("touchend",o),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.table.columnManager.verticalAlignHeaders(),s.dispatch("column-resized",t),s.dispatchExternal("columnResized",t.getComponent()))}e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=typeof e.clientX>"u"?e.touches[0].clientX:e.clientX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",r),document.body.addEventListener("mouseup",o),i.addEventListener("touchmove",r,{passive:!0}),i.addEventListener("touchend",o)}}b(dt,"moduleName","resizeColumns");class ut extends w{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1),this.registerTableOption("resizableRowGuide",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var n=document.createElement("div");n.className="tabulator-row-resize-handle prev",s.addEventListener("click",function(a){a.stopPropagation()});var r=function(a){t.startRow=e,t._mouseDown(a,e,s)};s.addEventListener("mousedown",r),s.addEventListener("touchstart",r,{passive:!0}),n.addEventListener("click",function(a){a.stopPropagation()});var o=function(a){var h=t.table.rowManager.prevDisplayRow(e);h&&(t.startRow=h,t._mouseDown(a,h,n))};n.addEventListener("mousedown",o),n.addEventListener("touchstart",o,{passive:!0}),i.appendChild(s),i.appendChild(n)}resize(e,t){t.setHeight(this.startHeight+((typeof e.screenY>"u"?e.touches[0].screenY:e.screenY)-this.startY))}calcGuidePosition(e,t,i){var s=typeof e.screenY>"u"?e.touches[0].screenY:e.screenY,n=i.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,r=this.table.element.getBoundingClientRect().y,o=t.element.getBoundingClientRect().top-r,a=s-this.startY;return Math.max(n+a,o)}_mouseDown(e,t,i){var s=this,n;s.dispatchExternal("rowResizing",t.getComponent()),s.table.options.resizableRowGuide&&(n=document.createElement("span"),n.classList.add("tabulator-row-resize-guide"),s.table.element.appendChild(n),setTimeout(()=>{n.style.top=s.calcGuidePosition(e,t,i)+"px"})),s.table.element.classList.add("tabulator-block-select");function r(a){s.table.options.resizableRowGuide?n.style.top=s.calcGuidePosition(a,t,i)+"px":s.resize(a,t)}function o(a){s.table.options.resizableRowGuide&&(s.resize(a,t),n.remove()),document.body.removeEventListener("mouseup",r),document.body.removeEventListener("mousemove",r),i.removeEventListener("touchmove",r),i.removeEventListener("touchend",o),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}e.stopPropagation(),s.startY=typeof e.screenY>"u"?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",r),document.body.addEventListener("mouseup",o),i.addEventListener("touchmove",r,{passive:!0}),i.addEventListener("touchend",o)}}b(ut,"moduleName","resizeRows");class ct extends w{constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e=this.table,t;this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),typeof IntersectionObserver<"u"&&typeof ResizeObserver<"u"&&e.rowManager.getRenderMode()==="virtual"?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver(i=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var s=Math.floor(i[0].contentRect.height),n=Math.floor(i[0].contentRect.width);(this.tableHeight!=s||this.tableWidth!=n)&&(this.tableHeight=s,this.tableWidth=n,e.element.parentNode&&(this.containerHeight=e.element.parentNode.clientHeight,this.containerWidth=e.element.parentNode.clientWidth),this.redrawTable())}}),this.resizeObserver.observe(e.element),t=window.getComputedStyle(e.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver(i=>{if(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell)){var s=Math.floor(i[0].contentRect.height),n=Math.floor(i[0].contentRect.width);(this.containerHeight!=s||this.containerWidth!=n)&&(this.containerHeight=s,this.containerWidth=n,this.tableHeight=e.element.clientHeight,this.tableWidth=e.element.clientWidth),this.redrawTable()}}),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!e.browserMobile||e.browserMobile&&(!e.modules.edit||e.modules.edit&&!e.modules.edit.currentCell))&&(e.columnManager.rerenderColumns(!0),e.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver(e=>{this.visible=e[0].isIntersecting,this.initialized?this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1):(this.initialized=!0,this.initialRedraw=!this.visible)}),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}b(ct,"moduleName","resizeTable");function qi(l,e,t){var i=document.createElement("div"),s=l.getRow()._row.modules.responsiveLayout;i.classList.add("tabulator-responsive-collapse-toggle"),i.innerHTML=` + + + + + + +`,l.getElement().classList.add("tabulator-row-handle");function n(r){var o=s.element;s.open=r,o&&(s.open?(i.classList.add("open"),o.style.display=""):(i.classList.remove("open"),o.style.display="none"))}return i.addEventListener("click",function(r){r.stopImmediatePropagation(),n(!s.open),l.getTable().rowManager.adjustTableSize()}),n(s.open),i}var Yi={format:{formatters:{responsiveCollapse:qi}}};class De extends w{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),this.table.options.responsiveLayout==="collapse"&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){["fitColumns","fitDataStretch"].indexOf(this.layoutMode())===-1&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.collapseFormatter&&(this.collapseFormatter=this.collapseFormatter.bind(this.table)),this.table.columnManager.columnsByIndex.forEach((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),!t.visible&&this.mode==="collapse"&&this.hiddenColumns.push(t))}),e=e.reverse(),e=e.sort((t,i)=>{var s=i.modules.responsive.order-t.modules.responsive.order;return s||i.modules.responsive.index-t.modules.responsive.index}),this.columns=e,this.mode==="collapse"&&this.generateCollapsedContent();for(let t of this.table.columnManager.columnsByIndex)if(t.definition.formatter=="responsiveCollapse"){this.collapseHandleColumn=t;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:typeof t.responsive>"u"?1:t.responsive,visible:t.visible!==!1}}initializeRow(e){var t;e.type!=="calc"&&(t=document.createElement("div"),t.classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),this.mode==="collapse"&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),this.mode==="collapse"&&(t=this.hiddenColumns.indexOf(e),t>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=!0;e;){let t=this.table.modules.layout.getMode()=="fitColumns"?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth(),i=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-t;if(i<0){let s=this.columns[this.index];s?(this.hideColumn(s),this.index++):e=!1}else{let s=this.columns[this.index-1];s&&i>0&&i>=s.getWidth()?(this.showColumn(s),this.index--):e=!1}this.table.rowManager.activeRowsCount||this.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){var e=this.table.rowManager.getDisplayRows();e.forEach(t=>{this.generateCollapsedRowContent(t)})}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);i=this.collapseFormatter(this.generateCollapsedRowData(e)),i&&t.appendChild(i),e.calcHeight(!0)}}generateCollapsedRowData(e){var t=e.getData(),i=[],s;return this.hiddenColumns.forEach(n=>{var r=n.getFieldValue(t);if(n.definition.title&&n.field)if(n.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){let o=function(a){a()};s={value:!1,data:{},getValue:function(){return r},getData:function(){return t},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()},getTable:()=>this.table},i.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(this.table.modules.format,s,n.modules.format.params,o)})}else i.push({field:n.field,title:n.definition.title,value:r})}),i}formatCollapsedData(e){var t=document.createElement("table");return e.forEach(i=>{var s=document.createElement("tr"),n=document.createElement("td"),r=document.createElement("td"),o,a=document.createElement("strong");n.appendChild(a),this.modules.localize.bind("columns|"+i.field,function(h){a.innerHTML=h||i.title}),i.value instanceof Node?(o=document.createElement("div"),o.appendChild(i.value),r.appendChild(o)):r.innerHTML=i.value,s.appendChild(n),s.appendChild(r),t.appendChild(s)}),Object.keys(e).length?t:""}}b(De,"moduleName","responsiveLayout"),b(De,"moduleExtensions",Yi);function $i(l,e,t){var i=document.createElement("input"),s=!1;if(i.type="checkbox",i.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(i.addEventListener("click",r=>{r.stopPropagation()}),typeof l.getRow=="function"){var n=l.getRow();n instanceof oe?(i.addEventListener("change",r=>{this.table.options.selectableRowsRangeMode==="click"&&s?s=!1:n.toggleSelect()}),this.table.options.selectableRowsRangeMode==="click"&&i.addEventListener("click",r=>{s=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,r)}),i.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,i)):i=""}else i.addEventListener("change",r=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(e.rowRange)}),this.table.modules.selectRow.registerHeaderSelectCheckbox(i);return i}var Qi={format:{formatters:{rowSelection:$i}}};class ze extends w{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectableRows","highlight"),this.registerTableOption("selectableRowsRangeMode","drag"),this.registerTableOption("selectableRowsRollingSelection",!0),this.registerTableOption("selectableRowsPersistence",!0),this.registerTableOption("selectableRowsCheck",function(t,i){return!0}),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck(),this.table.options.selectableRows==="highlight"&&this.table.options.selectableRange&&(this.table.options.selectableRows=!1),this.table.options.selectableRows!==!1&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}deprecatedOptionsCheck(){}rowRetrieve(e,t){return e==="selected"?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){var t=this.selectedRows.length;this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],t&&e!==!0&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=t.checkRowSelectability(e),s=e.getElement(),n=function(){setTimeout(function(){t.selecting=!1},50),document.body.removeEventListener("mouseup",n)};e.modules.select={selected:!1},s.classList.toggle("tabulator-selectable",i),s.classList.toggle("tabulator-unselectable",!i),t.checkRowSelectability(e)&&t.table.options.selectableRows&&t.table.options.selectableRows!="highlight"&&(t.table.options.selectableRowsRangeMode==="click"?s.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(s.addEventListener("click",function(r){(!t.table.modExists("edit")||!t.table.modules.edit.getCurrentCell())&&t.table._clearSelection(),t.selecting||t.toggleRow(e)}),s.addEventListener("mousedown",function(r){if(r.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1}),s.addEventListener("mouseenter",function(r){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))}),s.addEventListener("mouseout",function(r){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))})))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),n=i<=s?i:s,r=i>=s?i:s,o=this.table.rowManager.getDisplayRows().slice(0),a=o.splice(n,r-n+1);t.ctrlKey||t.metaKey?(a.forEach(h=>{h!==this.lastClickedRow&&(this.table.options.selectableRows!==!0&&!this.isRowSelected(e)?this.selectedRows.lengththis.table.options.selectableRows&&(a=a.slice(0,this.table.options.selectableRows)),this.selectRows(a)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}checkRowSelectability(e){return e&&e.type==="row"?this.table.options.selectableRowsCheck.call(this.table,e.getComponent()):!1}toggleRow(e){this.checkRowSelectability(e)&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t=[],i,s;switch(typeof e){case"undefined":i=this.table.rowManager.rows;break;case"number":i=this.table.rowManager.findRow(e);break;case"string":i=this.table.rowManager.findRow(e),i||(i=this.table.rowManager.getRows(e));break;default:i=e;break}Array.isArray(i)?i.length&&(i.forEach(n=>{s=this._selectRow(n,!0,!0),s&&t.push(s)}),this._rowSelectionChanged(!1,t)):i&&this._selectRow(i,!1,!0)}_selectRow(e,t,i){if(!isNaN(this.table.options.selectableRows)&&this.table.options.selectableRows!==!0&&!i&&this.selectedRows.length>=this.table.options.selectableRows)if(this.table.options.selectableRowsRollingSelection)this._deselectRow(this.selectedRows[0]);else return!1;var s=this.table.rowManager.findRow(e);if(s){if(this.selectedRows.indexOf(s)==-1)return s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t,s),s}else t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return this.selectedRows.indexOf(e)!==-1}deselectRows(e,t){var i=[],s,n;switch(typeof e){case"undefined":s=Object.assign([],this.selectedRows);break;case"number":s=this.table.rowManager.findRow(e);break;case"string":s=this.table.rowManager.findRow(e),s||(s=this.table.rowManager.getRows(e));break;default:s=e;break}Array.isArray(s)?s.length&&(s.forEach(r=>{n=this._deselectRow(r,!0,!0),n&&i.push(n)}),this._rowSelectionChanged(t,[],i)):s&&this._deselectRow(s,t,!0)}_deselectRow(e,t){var i=this,s=i.table.rowManager.findRow(e),n,r;if(s){if(n=i.selectedRows.findIndex(function(o){return o==s}),n>-1)return r=s.getElement(),r&&r.classList.remove("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!1,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!1),i.selectedRows.splice(n,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!1),this.dispatchExternal("rowDeselected",s.getComponent()),i._rowSelectionChanged(t,void 0,s),s}else t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getData())}),e}getSelectedRows(){var e=[];return this.selectedRows.forEach(function(t){e.push(t.getComponent())}),e}_rowSelectionChanged(e,t=[],i=[]){this.headerCheckboxElement&&(this.selectedRows.length===0?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||(Array.isArray(t)||(t=[t]),t=t.map(s=>s.getComponent()),Array.isArray(i)||(i=[i]),i=i.map(s=>s.getComponent()),this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),t,i))}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0,!0);if(t)for(let s of i)this._selectRow(s,!0);else for(let s of i)this._deselectRow(s,!0)}}b(ze,"moduleName","selectRow"),b(ze,"moduleExtensions",Qi);class Zi{constructor(e){return this._range=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._range.table.componentFunctionBinder.handle("range",t._range,i)}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(!0,!0)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map(e=>e.getComponent())}getColumns(){return this._range.getColumns().map(e=>e.getComponent())}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(e,t){this._range.destroyedGuard("setBounds")&&this._range.setBounds(e&&e._cell,t&&t._cell)}setStartBound(e){this._range.destroyedGuard("setStartBound")&&(this._range.setEndBound(e&&e._cell),this._range.rangeManager.layoutElement())}setEndBound(e){this._range.destroyedGuard("setEndBound")&&(this._range.setEndBound(e&&e._cell),this._range.rangeManager.layoutElement())}clearValues(){this._range.destroyedGuard("clearValues")&&this._range.clearValues()}remove(){this._range.destroyedGuard("remove")&&this._range.destroy(!0)}}class es extends M{constructor(e,t,i,s){super(e),this.rangeManager=t,this.element=null,this.initialized=!1,this.initializing={start:!1,end:!1},this.destroyed=!1,this.top=0,this.bottom=0,this.left=0,this.right=0,this.table=e,this.start={row:0,col:0},this.end={row:0,col:0},this.rangeManager.rowHeader&&(this.left=1,this.right=1,this.start.col=1,this.end.col=1),this.initElement(),setTimeout(()=>{this.initBounds(i,s)})}initElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-range")}initBounds(e,t){this._updateMinMax(),e&&this.setBounds(e,t||e)}setStart(e,t){(this.start.row!==e||this.start.col!==t)&&(this.start.row=e,this.start.col=t,this.initializing.start=!0,this._updateMinMax())}setEnd(e,t){(this.end.row!==e||this.end.col!==t)&&(this.end.row=e,this.end.col=t,this.initializing.end=!0,this._updateMinMax())}setBounds(e,t,i){e&&this.setStartBound(e),this.setEndBound(t||e),this.rangeManager.layoutElement(i)}setStartBound(e){var t,i;e.type==="column"?this.rangeManager.columnSelection&&this.setStart(0,e.getPosition()-1):(t=e.row.position-1,i=e.column.getPosition()-1,e.column===this.rangeManager.rowHeader?this.setStart(t,1):this.setStart(t,i))}setEndBound(e){var t=this._getTableRows().length,i,s,n;e.type==="column"?this.rangeManager.columnSelection&&(this.rangeManager.selecting==="column"?this.setEnd(t-1,e.getPosition()-1):this.rangeManager.selecting==="cell"&&this.setEnd(0,e.getPosition()-1)):(i=e.row.position-1,s=e.column.getPosition()-1,n=e.column===this.rangeManager.rowHeader,this.rangeManager.selecting==="row"?this.setEnd(i,this._getTableColumns().length-1):this.rangeManager.selecting!=="row"&&n?this.setEnd(i,0):this.rangeManager.selecting==="column"?this.setEnd(t-1,s):this.setEnd(i,s))}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row),this.bottom=Math.max(this.start.row,this.end.row),this.left=Math.min(this.start.col,this.end.col),this.right=Math.max(this.start.col,this.end.col),this.initialized?this.dispatchExternal("rangeChanged",this.getComponent()):this.initializing.start&&this.initializing.end&&(this.initialized=!0,this.dispatchExternal("rangeAdded",this.getComponent()))}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter(e=>e.type==="row")}layout(){var e=this.table.rowManager.renderer.vDomTop,t=this.table.rowManager.renderer.vDomBottom,i=this.table.columnManager.renderer.leftCol,s=this.table.columnManager.renderer.rightCol,n,r,o,a,h,d,u,c,f,g;this.table.options.renderHorizontal==="virtual"&&this.rangeManager.rowHeader&&(s+=1),e==null&&(e=0),t==null&&(t=1/0),i==null&&(i=0),s==null&&(s=1/0),this.overlaps(i,e,s,t)&&(n=Math.max(this.top,e),r=Math.min(this.bottom,t),o=Math.max(this.left,i),a=Math.min(this.right,s),h=this.rangeManager.getCell(n,o),d=this.rangeManager.getCell(r,a),u=h.getElement(),c=d.getElement(),f=h.row.getElement(),g=d.row.getElement(),this.element.classList.add("tabulator-range-active"),this.table.rtl?(this.element.style.right=f.offsetWidth-u.offsetLeft-u.offsetWidth+"px",this.element.style.width=u.offsetLeft+u.offsetWidth-c.offsetLeft+"px"):(this.element.style.left=f.offsetLeft+u.offsetLeft+"px",this.element.style.width=c.offsetLeft+c.offsetWidth-u.offsetLeft+"px"),this.element.style.top=f.offsetTop+"px",this.element.style.height=g.offsetTop+g.offsetHeight-f.offsetTop+"px")}atTopLeft(e){return e.row.position-1===this.top&&e.column.getPosition()-1===this.left}atBottomRight(e){return e.row.position-1===this.bottom&&e.column.getPosition()-1===this.right}occupies(e){return this.occupiesRow(e.row)&&this.occupiesColumn(e.column)}occupiesRow(e){return this.top<=e.position-1&&e.position-1<=this.bottom}occupiesColumn(e){return this.left<=e.getPosition()-1&&e.getPosition()-1<=this.right}overlaps(e,t,i,s){return!(this.left>i||e>this.right||this.top>s||t>this.bottom)}getData(){var e=[],t=this.getRows(),i=this.getColumns();return t.forEach(s=>{var n=s.getData(),r={};i.forEach(o=>{r[o.field]=n[o.field]}),e.push(r)}),e}getCells(e,t){var i=[],s=this.getRows(),n=this.getColumns();return e?i=s.map(r=>{var o=[];return r.getCells().forEach(a=>{n.includes(a.column)&&o.push(t?a.getComponent():a)}),o}):s.forEach(r=>{r.getCells().forEach(o=>{n.includes(o.column)&&i.push(t?o.getComponent():o)})}),i}getStructuredCells(){return this.getCells(!0,!0)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var e=this.getCells(),t=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw(),e.forEach(i=>{i.setValue(t)}),this.table.restoreRedraw()}getBounds(e){var t=this.getCells(!1,e),i={start:null,end:null};return t.length?(i.start=t[0],i.end=t[t.length-1]):console.warn("No bounds defined on range"),i}getComponent(){return this.component||(this.component=new Zi(this)),this.component}destroy(e){this.destroyed=!0,this.element.remove(),e&&this.rangeManager.rangeRemoved(this),this.initialized&&this.dispatchExternal("rangeRemoved",this.getComponent())}destroyedGuard(e){return this.destroyed&&console.warn("You cannot call the "+e+" function on a destroyed range"),!this.destroyed}}var ts={rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]},is={rangeJumpLeft:function(l){this.dispatch("keybinding-nav-range",l,"left",!0,!1)},rangeJumpRight:function(l){this.dispatch("keybinding-nav-range",l,"right",!0,!1)},rangeJumpUp:function(l){this.dispatch("keybinding-nav-range",l,"up",!0,!1)},rangeJumpDown:function(l){this.dispatch("keybinding-nav-range",l,"down",!0,!1)},rangeExpandLeft:function(l){this.dispatch("keybinding-nav-range",l,"left",!1,!0)},rangeExpandRight:function(l){this.dispatch("keybinding-nav-range",l,"right",!1,!0)},rangeExpandUp:function(l){this.dispatch("keybinding-nav-range",l,"up",!1,!0)},rangeExpandDown:function(l){this.dispatch("keybinding-nav-range",l,"down",!1,!0)},rangeExpandJumpLeft:function(l){this.dispatch("keybinding-nav-range",l,"left",!0,!0)},rangeExpandJumpRight:function(l){this.dispatch("keybinding-nav-range",l,"right",!0,!0)},rangeExpandJumpUp:function(l){this.dispatch("keybinding-nav-range",l,"up",!0,!0)},rangeExpandJumpDown:function(l){this.dispatch("keybinding-nav-range",l,"down",!0,!0)}},ss={range:function(l){var e=[],t=this.table.modules.selectRange.activeRange,i=!1,s,n,r,o,a;return a=l.length,t&&(s=t.getBounds(),n=s.start,s.start===s.end&&(i=!0),n&&(e=this.table.rowManager.activeRows.slice(),r=e.indexOf(n.row),i?o=l.length:o=e.indexOf(s.end.row)-r+1,r>-1&&(this.table.blockRedraw(),e=e.slice(r,r+o),e.forEach((h,d)=>{h.updateData(l[d%a])}),this.table.restoreRedraw()))),e}},ns={range:function(l){var e=[],t=[],i=this.table.modules.selectRange.activeRange,s=!1,n,r,o,a,h;return i&&(n=i.getBounds(),r=n.start,n.start===n.end&&(s=!0),r&&(l=l.split(` +`),l.forEach(function(d){e.push(d.split(" "))}),e.length&&(a=this.table.columnManager.getVisibleColumnsByIndex(),h=a.indexOf(r.column),h>-1)))?(s?o=e[0].length:o=a.indexOf(n.end.column)-h+1,a=a.slice(h,h+o),e.forEach(d=>{var u={},c=d.length;a.forEach(function(f,g){u[f.field]=d[g%c]}),t.push(u)}),t):!1}},rs={range:function(){var l=this.modules.selectRange.selectedColumns();return this.columnManager.rowHeader&&l.unshift(this.columnManager.rowHeader),l}},os={range:function(){return this.modules.selectRange.selectedRows()}},as={keybindings:{bindings:ts,actions:is},clipboard:{pasteActions:ss,pasteParsers:ns},export:{columnLookups:rs,rowLookups:os}};class re extends w{constructor(e){super(e),this.selecting="cell",this.mousedown=!1,this.ranges=[],this.overlay=null,this.rowHeader=null,this.layoutChangeTimeout=null,this.columnSelection=!1,this.rowSelection=!1,this.maxRanges=0,this.activeRange=!1,this.blockKeydown=!1,this.keyDownEvent=this._handleKeyDown.bind(this),this.mouseUpEvent=this._handleMouseUp.bind(this),this.registerTableOption("selectableRange",!1),this.registerTableOption("selectableRangeColumns",!1),this.registerTableOption("selectableRangeRows",!1),this.registerTableOption("selectableRangeClearCells",!1),this.registerTableOption("selectableRangeClearCellsValue",void 0),this.registerTableFunction("getRangesData",this.getRangesData.bind(this)),this.registerTableFunction("getRanges",this.getRanges.bind(this)),this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this)),this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this)),this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this)),this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){this.options("selectableRange")&&(this.options("selectableRows")?console.warn("SelectRange functionality cannot be used in conjunction with row selection"):(this.maxRanges=this.options("selectableRange"),this.initializeTable(),this.initializeWatchers()),this.options("columns").findIndex(e=>e.frozen)>0&&console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior."),this.options("columns").filter(e=>e.frozen)>1&&console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior."))}initializeTable(){this.overlay=document.createElement("div"),this.overlay.classList.add("tabulator-range-overlay"),this.rangeContainer=document.createElement("div"),this.rangeContainer.classList.add("tabulator-range-container"),this.activeRangeCellElement=document.createElement("div"),this.activeRangeCellElement.classList.add("tabulator-range-cell-active"),this.overlay.appendChild(this.rangeContainer),this.overlay.appendChild(this.activeRangeCellElement),this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent),this.resetRanges(),this.table.rowManager.element.appendChild(this.overlay),this.table.columnManager.element.setAttribute("tabindex",0),this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns"),this.rowSelection=this.options("selectableRangeRows"),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this)),this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this)),this.subscribe("column-resized",this.handleColumnResized.bind(this)),this.subscribe("column-moving",this.handleColumnMoving.bind(this)),this.subscribe("column-moved",this.handleColumnMoved.bind(this)),this.subscribe("column-width",this.layoutChange.bind(this)),this.subscribe("column-height",this.layoutChange.bind(this)),this.subscribe("column-resized",this.layoutChange.bind(this)),this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this)),this.subscribe("cell-height",this.layoutChange.bind(this)),this.subscribe("cell-rendered",this.renderCell.bind(this)),this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this)),this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this)),this.subscribe("cell-click",this.handleCellClick.bind(this)),this.subscribe("cell-editing",this.handleEditingCell.bind(this)),this.subscribe("page-changed",this.redraw.bind(this)),this.subscribe("scroll-vertical",this.layoutChange.bind(this)),this.subscribe("scroll-horizontal",this.layoutChange.bind(this)),this.subscribe("data-destroy",this.tableDestroyed.bind(this)),this.subscribe("data-processed",this.resetRanges.bind(this)),this.subscribe("table-layout",this.layoutElement.bind(this)),this.subscribe("table-redraw",this.redraw.bind(this)),this.subscribe("table-destroy",this.tableDestroyed.bind(this)),this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this)),this.subscribe("edit-blur",this.restoreFocus.bind(this)),this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left")),this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right")),this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up")),this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down")),this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(e){this.columnSelection&&e.definition.headerSort&&this.options("headerSortClickElement")!=="icon"&&console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'."),e.modules.edit}updateHeaderColumn(){var e;this.rowSelection&&(this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0],this.rowHeader&&(this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header",this.rowHeader.definition.headerSort&&console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior"),this.rowHeader.definition.editor&&console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior"))),this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active&&(e=this.table.modules.frozenColumns.getFrozenColumns(),(e.length>1||e.length===1&&e[0]!==this.rowHeader)&&console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior"))}getRanges(){return this.ranges.map(e=>e.getComponent())}getRangesData(){return this.ranges.map(e=>e.getData())}addRangeFromComponent(e,t){return e=e?e._cell:null,t=t?t._cell:null,this.addRange(e,t)}cellGetRanges(e){var t=[];return e.column===this.rowHeader?t=this.ranges.filter(i=>i.occupiesRow(e.row)):t=this.ranges.filter(i=>i.occupies(e)),t.map(i=>i.getComponent())}rowGetRanges(e){var t=this.ranges.filter(i=>i.occupiesRow(e));return t.map(i=>i.getComponent())}colGetRanges(e){var t=this.ranges.filter(i=>i.occupiesColumn(e));return t.map(i=>i.getComponent())}_handleMouseUp(e){this.mousedown=!1,document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(e){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if(e.key==="Enter"){if(this.table.modules.edit&&this.table.modules.edit.currentCell)return;this.table.modules.edit.editCell(this.getActiveCell()),e.preventDefault()}(e.key==="Backspace"||e.key==="Delete")&&this.options("selectableRangeClearCells")&&this.activeRange&&this.activeRange.clearValues()}}initializeFocus(e){var t;this.restoreFocus();try{document.selection?(t=document.body.createTextRange(),t.moveToElementText(e.getElement()),t.select()):window.getSelection&&(t=document.createRange(),t.selectNode(e.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(t))}catch{}}restoreFocus(e){return this.table.rowManager.element.focus(),!0}handleColumnResized(e){var t;this.selecting!=="column"&&this.selecting!=="all"||(t=this.ranges.some(i=>i.occupiesColumn(e)),t&&this.ranges.forEach(i=>{var s=i.getColumns(!0);s.forEach(n=>{n!==e&&n.setWidth(e.width)})}))}handleColumnMoving(e,t){this.resetRanges().setBounds(t),this.overlay.style.visibility="hidden"}handleColumnMoved(e,t,i){this.activeRange.setBounds(e),this.layoutElement()}handleColumnMouseDown(e,t){e.button===2&&(this.selecting==="column"||this.selecting==="all")&&this.activeRange.occupiesColumn(t)||this.table.options.movableColumns&&this.selecting==="column"&&this.activeRange.occupiesColumn(t)||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t))}handleColumnMouseMove(e,t){t===this.rowHeader||!this.mousedown||this.selecting==="all"||this.activeRange.setBounds(!1,t,!0)}renderCell(e){var t=e.getElement(),i=this.ranges.findIndex(s=>s.occupies(e));t.classList.toggle("tabulator-range-selected",i!==-1),t.classList.toggle("tabulator-range-only-cell-selected",this.ranges.length===1&&this.ranges[0].atTopLeft(e)&&this.ranges[0].atBottomRight(e)),t.dataset.range=i}handleCellMouseDown(e,t){e.button===2&&(this.activeRange.occupies(t)||(this.selecting==="row"||this.selecting==="all")&&this.activeRange.occupiesRow(t.row))||(this.mousedown=!0,document.addEventListener("mouseup",this.mouseUpEvent),this.newSelection(e,t))}handleCellMouseMove(e,t){!this.mousedown||this.selecting==="all"||this.activeRange.setBounds(!1,t,!0)}handleCellClick(e,t){this.initializeFocus(t)}handleEditingCell(e){this.activeRange&&this.activeRange.setBounds(e)}finishEditingCell(){this.blockKeydown=!0,this.table.rowManager.element.focus(),setTimeout(()=>{this.blockKeydown=!1},10)}keyNavigate(e,t){this.navigate(!1,!1,e),t.preventDefault()}keyNavigateRange(e,t,i,s){this.navigate(i,s,t),e.preventDefault()}navigate(e,t,i){var s=!1,n,r,o,a,h,d;if(this.table.modules.edit&&this.table.modules.edit.currentCell)return!1;if(this.ranges.length>1&&(this.ranges=this.ranges.filter(u=>u===this.activeRange?(u.setEnd(u.start.row,u.start.col),!0):(u.destroy(),!1))),n=this.activeRange,r=t?n.end:n.start,o=r.row,a=r.col,e)switch(i){case"left":a=this.findJumpCellLeft(n.start.row,r.col);break;case"right":a=this.findJumpCellRight(n.start.row,r.col);break;case"up":o=this.findJumpCellUp(r.row,n.start.col);break;case"down":o=this.findJumpCellDown(r.row,n.start.col);break}else{if(t&&(this.selecting==="row"&&(i==="left"||i==="right")||this.selecting==="column"&&(i==="up"||i==="down")))return;switch(i){case"left":a=Math.max(a-1,0);break;case"right":a=Math.min(a+1,this.getTableColumns().length-1);break;case"up":o=Math.max(o-1,0);break;case"down":o=Math.min(o+1,this.getTableRows().length-1);break}}if(this.rowHeader&&a===0&&(a=1),s=a!==r.col||o!==r.row,t||n.setStart(o,a),n.setEnd(o,a),t||(this.selecting="cell"),s)return h=this.getRowByRangePos(n.end.row),d=this.getColumnByRangePos(n.end.col),(i==="left"||i==="right")&&d.getElement().parentNode===null?d.getComponent().scrollTo(void 0,!1):(i==="up"||i==="down")&&h.getElement().parentNode===null?h.getComponent().scrollTo(void 0,!1):this.autoScroll(n,h.getElement(),d.getElement()),this.layoutElement(),!0}rangeRemoved(e){this.ranges=this.ranges.filter(t=>t!==e),this.activeRange===e&&(this.ranges.length?this.activeRange=this.ranges[this.ranges.length-1]:this.addRange()),this.layoutElement()}findJumpRow(e,t,i,s,n){return i&&(t=t.reverse()),this.findJumpItem(s,n,t,function(r){return r.getData()[e.getField()]})}findJumpCol(e,t,i,s,n){return i&&(t=t.reverse()),this.findJumpItem(s,n,t,function(r){return e.getData()[r.getField()]})}findJumpItem(e,t,i,s){var n;for(let r of i){let o=s(r);if(e){if(n=r,o)break}else if(t){if(n=r,o)break}else if(o)n=r;else break}return n}findJumpCellLeft(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[t].getField()]),r=s[t-1]?this.isEmpty(i.getData()[s[t-1].getField()]):!1,o=this.rowHeader?s.slice(1,t):s.slice(0,t),a=this.findJumpCol(i,o,!0,n,r);return a?a.getPosition()-1:t}findJumpCellRight(e,t){var i=this.getRowByRangePos(e),s=this.getTableColumns(),n=this.isEmpty(i.getData()[s[t].getField()]),r=s[t+1]?this.isEmpty(i.getData()[s[t+1].getField()]):!1,o=this.findJumpCol(i,s.slice(t+1,s.length),!1,n,r);return o?o.getPosition()-1:t}findJumpCellUp(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),n=this.isEmpty(s[e].getData()[i.getField()]),r=s[e-1]?this.isEmpty(s[e-1].getData()[i.getField()]):!1,o=this.findJumpRow(i,s.slice(0,e),!0,n,r);return o?o.position-1:e}findJumpCellDown(e,t){var i=this.getColumnByRangePos(t),s=this.getTableRows(),n=this.isEmpty(s[e].getData()[i.getField()]),r=s[e+1]?this.isEmpty(s[e+1].getData()[i.getField()]):!1,o=this.findJumpRow(i,s.slice(e+1,s.length),!1,n,r);return o?o.position-1:e}newSelection(e,t){var i;if(t.type==="column"){if(!this.columnSelection)return;if(t===this.rowHeader){i=this.resetRanges(),this.selecting="all";var s,n=this.getCell(-1,-1);this.rowHeader?s=this.getCell(0,1):s=this.getCell(0,0),i.setBounds(s,n);return}else this.selecting="column"}else t.column===this.rowHeader?this.selecting="row":this.selecting="cell";e.shiftKey?this.activeRange.setBounds(!1,t):e.ctrlKey?this.addRange().setBounds(t):this.resetRanges().setBounds(t)}autoScroll(e,t,i){var s=this.table.rowManager.element,n,r,o,a,h;typeof t>"u"&&(t=this.getRowByRangePos(e.end.row).getElement()),typeof i>"u"&&(i=this.getColumnByRangePos(e.end.col).getElement()),this.rowHeader&&(n=this.rowHeader.getElement()),r={left:i.offsetLeft,right:i.offsetLeft+i.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight},o={left:s.scrollLeft,right:Math.ceil(s.scrollLeft+s.clientWidth),top:s.scrollTop,bottom:s.scrollTop+s.offsetHeight-this.table.rowManager.scrollbarWidth},n&&(o.left+=n.offsetWidth),a=o.lefto.right&&(s.scrollLeft=r.right-s.clientWidth)),h||(r.topo.bottom&&(s.scrollTop=r.bottom-s.clientHeight))}layoutChange(){this.overlay.style.visibility="hidden",clearTimeout(this.layoutChangeTimeout),this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(e){e&&(this.selecting="cell",this.resetRanges(),this.layoutElement())}layoutElement(e){var t;e?t=this.table.rowManager.getVisibleRows(!0):t=this.table.rowManager.getRows(),t.forEach(i=>{i.type==="row"&&(this.layoutRow(i),i.cells.forEach(s=>this.renderCell(s)))}),this.getTableColumns().forEach(i=>{this.layoutColumn(i)}),this.layoutRanges()}layoutRow(e){var t=e.getElement(),i=!1,s=this.ranges.some(n=>n.occupiesRow(e));this.selecting==="row"?i=s:this.selecting==="all"&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutColumn(e){var t=e.getElement(),i=!1,s=this.ranges.some(n=>n.occupiesColumn(e));this.selecting==="column"?i=s:this.selecting==="all"&&(i=!0),t.classList.toggle("tabulator-range-selected",i),t.classList.toggle("tabulator-range-highlight",s)}layoutRanges(){var e,t,i;this.table.initialized&&(e=this.getActiveCell(),e&&(t=e.getElement(),i=e.row.getElement(),this.table.rtl?this.activeRangeCellElement.style.right=i.offsetWidth-t.offsetLeft-t.offsetWidth+"px":this.activeRangeCellElement.style.left=i.offsetLeft+t.offsetLeft+"px",this.activeRangeCellElement.style.top=i.offsetTop+"px",this.activeRangeCellElement.style.width=t.offsetWidth+"px",this.activeRangeCellElement.style.height=i.offsetHeight+"px",this.ranges.forEach(s=>s.layout()),this.overlay.style.visibility="visible"))}getCell(e,t){var i;return t<0&&(t=this.getTableColumns().length+t,t<0)?null:(e<0&&(e=this.getTableRows().length+e),i=this.table.rowManager.getRowFromPosition(e+1),i?i.getCells(!1,!0).filter(s=>s.column.visible)[t]:null)}getActiveCell(){return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(e){return this.getTableRows()[e]}getColumnByRangePos(e){return this.getTableColumns()[e]}getTableRows(){return this.table.rowManager.getDisplayRows().filter(e=>e.type==="row")}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(e,t){var i;return this.maxRanges!==!0&&this.ranges.length>=this.maxRanges&&this.ranges.shift().destroy(),i=new es(this.table,this,e,t),this.activeRange=i,this.ranges.push(i),this.rangeContainer.appendChild(i.element),i}resetRanges(){var e,t,i;return this.ranges.forEach(s=>s.destroy()),this.ranges=[],e=this.addRange(),this.table.rowManager.activeRows.length&&(i=this.table.rowManager.activeRows[0].cells.filter(s=>s.column.visible),t=i[this.rowHeader?1:0],t&&(e.setBounds(t),this.initializeFocus(t))),e}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent),this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(e){return e?this.activeRange.getRows().map(t=>t.getComponent()):this.activeRange.getRows()}selectedColumns(e){return e?this.activeRange.getColumns().map(t=>t.getComponent()):this.activeRange.getColumns()}isEmpty(e){return e==null||e===""}}b(re,"moduleName","selectRange"),b(re,"moduleInitOrder",1),b(re,"moduleExtensions",as);function ls(l,e,t,i,s,n,r){var o=r.alignEmptyValues,a=r.decimalSeparator,h=r.thousandSeparator,d=0;if(l=String(l),e=String(e),h&&(l=l.split(h).join(""),e=e.split(h).join("")),a&&(l=l.split(a).join("."),e=e.split(a).join(".")),l=parseFloat(l),e=parseFloat(e),isNaN(l))d=isNaN(e)?0:-1;else if(isNaN(e))d=1;else return l-e;return(o==="top"&&n==="desc"||o==="bottom"&&n==="asc")&&(d*=-1),d}function hs(l,e,t,i,s,n,r){var o=r.alignEmptyValues,a=0,h;if(!l)a=e?-1:0;else if(!e)a=1;else{switch(typeof r.locale){case"boolean":r.locale&&(h=this.langLocale());break;case"string":h=r.locale;break}return String(l).toLowerCase().localeCompare(String(e).toLowerCase(),h)}return(o==="top"&&n==="desc"||o==="bottom"&&n==="asc")&&(a*=-1),a}function Ve(l,e,t,i,s,n,r){var o=window.DateTime||luxon.DateTime,a=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(typeof o<"u"){if(o.isDateTime(l)||(a==="iso"?l=o.fromISO(String(l)):l=o.fromFormat(String(l),a)),o.isDateTime(e)||(a==="iso"?e=o.fromISO(String(e)):e=o.fromFormat(String(e),a)),!l.isValid)d=e.isValid?-1:0;else if(!e.isValid)d=1;else return l-e;return(h==="top"&&n==="desc"||h==="bottom"&&n==="asc")&&(d*=-1),d}else console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}function ds(l,e,t,i,s,n,r){return r.format||(r.format="dd/MM/yyyy"),Ve.call(this,l,e,t,i,s,n,r)}function us(l,e,t,i,s,n,r){return r.format||(r.format="HH:mm"),Ve.call(this,l,e,t,i,s,n,r)}function cs(l,e,t,i,s,n,r){var o=l===!0||l==="true"||l==="True"||l===1?1:0,a=e===!0||e==="true"||e==="True"||e===1?1:0;return o-a}function fs(l,e,t,i,s,n,r){var o=r.type||"length",a=r.alignEmptyValues,h=0;function d(u){var c;switch(o){case"length":c=u.length;break;case"sum":c=u.reduce(function(f,g){return f+g});break;case"max":c=Math.max.apply(null,u);break;case"min":c=Math.min.apply(null,u);break;case"avg":c=u.reduce(function(f,g){return f+g})/u.length;break}return c}if(!Array.isArray(l))h=Array.isArray(e)?-1:0;else if(!Array.isArray(e))h=1;else return d(e)-d(l);return(a==="top"&&n==="desc"||a==="bottom"&&n==="asc")&&(h*=-1),h}function ps(l,e,t,i,s,n,r){var o=typeof l>"u"?0:1,a=typeof e>"u"?0:1;return o-a}function ms(l,e,t,i,s,n,r){var o,a,h,d,u=0,c,f=/(\d+)|(\D+)/g,g=/\d/,p=r.alignEmptyValues,v=0;if(!l&&l!==0)v=!e&&e!==0?0:-1;else if(!e&&e!==0)v=1;else{if(isFinite(l)&&isFinite(e))return l-e;if(o=String(l).toLowerCase(),a=String(e).toLowerCase(),o===a)return 0;if(!(g.test(o)&&g.test(a)))return o>a?1:-1;for(o=o.match(f),a=a.match(f),c=o.length>a.length?a.length:o.length;ud?1:-1;return o.length>a.length}return(p==="top"&&n==="desc"||p==="bottom"&&n==="asc")&&(v*=-1),v}var gs={number:ls,string:hs,date:ds,time:us,datetime:Ve,boolean:cs,array:fs,exists:ps,alphanum:ms};const j=class j extends w{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerTableOption("headerSortClickElement","header"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),this.table.options.sortMode==="remote"&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var n=this.getSort();return n.forEach(r=>{delete r.column}),s.sort=n,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t=!1,i,s;switch(typeof e.definition.sorter){case"string":j.sorters[e.definition.sorter]?t=j.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":t=e.definition.sorter;break}if(e.modules.sort={sorter:t,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},e.definition.headerSort!==!1){switch(i=e.getElement(),i.classList.add("tabulator-sortable"),s=document.createElement("div"),s.classList.add("tabulator-col-sorter"),this.table.options.headerSortClickElement){case"icon":s.classList.add("tabulator-col-sorter-element");break;case"header":i.classList.add("tabulator-col-sorter-element");break;default:i.classList.add("tabulator-col-sorter-element");break}switch(this.table.options.headerSortElement){case"function":break;case"object":s.appendChild(this.table.options.headerSortElement);break;default:s.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(s),e.modules.sort.element=s,this.setColumnHeaderSortIcon(e,"none"),this.table.options.headerSortClickElement==="icon"&&s.addEventListener("mousedown",n=>{n.stopPropagation()}),(this.table.options.headerSortClickElement==="icon"?s:i).addEventListener("click",n=>{var r="",o=[],a=!1;if(e.modules.sort){if(e.modules.sort.tristate)e.modules.sort.dir=="none"?r=e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?r=e.modules.sort.dir=="asc"?"desc":"asc":r="none";else switch(e.modules.sort.dir){case"asc":r="desc";break;case"desc":r="asc";break;default:r=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(n.shiftKey||n.ctrlKey)?(o=this.getSort(),a=o.findIndex(h=>h.field===e.getField()),a>-1?(o[a].dir=r,a=o.splice(a,1)[0],r!="none"&&o.push(a)):r!="none"&&o.push({column:e,dir:r}),this.setSort(o)):r=="none"?this.clear():this.setSort(e,r),this.refreshSort()}})}}refreshSort(){this.table.options.sortMode==="remote"?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=this,t=[];return e.sortList.forEach(function(i){i.column&&t.push({column:i.column.getComponent(),field:i.column.getField(),dir:i.dir})}),t}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach(function(n){var r;r=i.table.columnManager.findColumn(n.column),r?(n.column=r,s.push(n),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",n.column)}),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t=this.table.rowManager.activeRows[0],i="string",s,n;if(t&&(t=t.getData(),s=e.getField(),s))switch(n=e.getFieldValue(t),typeof n){case"undefined":i="string";break;case"boolean":i="boolean";break;default:!isNaN(n)&&n!==""?i="number":n.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(i="alphanum");break}return j.sorters[i]}sort(e,t){var i=this,s=this.table.options.sortOrderReverse?i.sortList.slice().reverse():i.sortList,n=[],r=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",i.getSort()),t||i.clearColumnHeaders(),this.table.options.sortMode!=="remote"?(s.forEach(function(o,a){var h;o.column&&(h=o.column.modules.sort,h&&(h.sorter||(h.sorter=i.findSorter(o.column)),o.params=typeof h.params=="function"?h.params(o.column.getComponent(),o.dir):h.params,n.push(o)),t||i.setColumnHeader(o.column,o.dir))}),n.length&&i._sortItems(e,n)):t||s.forEach(function(o,a){i.setColumnHeader(o.column,o.dir)}),this.subscribedExternal("dataSorted")&&(e.forEach(o=>{r.push(o.getComponent())}),this.dispatchExternal("dataSorted",i.getSort(),r)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach(e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))})}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort",t==="asc"?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i=e.modules.sort.element,s;if(e.definition.headerSort&&typeof this.table.options.headerSortElement=="function"){for(;i.firstChild;)i.removeChild(i.firstChild);s=this.table.options.headerSortElement.call(this.table,e.getComponent(),t),typeof s=="object"?i.appendChild(s):i.innerHTML=s}}_sortItems(e,t){var i=t.length-1;e.sort((s,n)=>{for(var r,o=i;o>=0;o--){let a=t[o];if(r=this._sortRow(s,n,a.column,a.dir,a.params),r!==0)break}return r})}_sortRow(e,t,i,s,n){var r,o,a=s=="asc"?e:t,h=s=="asc"?t:e;return e=i.getFieldValue(a.getData()),t=i.getFieldValue(h.getData()),e=typeof e<"u"?e:"",t=typeof t<"u"?t:"",r=a.getComponent(),o=h.getComponent(),i.modules.sort.sorter.call(this,e,t,r,o,i.getComponent(),s,n)}};b(j,"moduleName","sort"),b(j,"sorters",gs);let He=j;class bs{constructor(e,t){this.columnCount=e,this.rowCount=t,this.columnString=[],this.columns=[],this.rows=[]}genColumns(e){var t=Math.max(this.columnCount,Math.max(...e.map(i=>i.length)));this.columnString=[],this.columns=[];for(let i=1;i<=t;i++)this.incrementChar(this.columnString.length-1),this.columns.push(this.columnString.join(""));return this.columns}genRows(e){var t=Math.max(this.rowCount,e.length);this.rows=[];for(let i=1;i<=t;i++)this.rows.push(i);return this.rows}incrementChar(e){let t=this.columnString[e];t?t!=="Z"?this.columnString[e]=String.fromCharCode(this.columnString[e].charCodeAt(0)+1):(this.columnString[e]="A",e?this.incrementChar(e-1):this.columnString.push("A")):this.columnString.push("A")}setRowCount(e){this.rowCount=e}setColumnCount(e){this.columnCount=e}}class ft{constructor(e){return this._sheet=e,new Proxy(this,{get:function(t,i,s){return typeof t[i]<"u"?t[i]:t._sheet.table.componentFunctionBinder.handle("sheet",t._sheet,i)}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(e){return this._sheet.setData(e)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(e){return this._sheet.setTitle(e)}setRows(e){return this._sheet.setRows(e)}setColumns(e){return this._sheet.setColumns(e)}}class Xe extends M{constructor(e,t){super(e.table),this.spreadsheetManager=e,this.definition=t,this.title=this.definition.title||"",this.key=this.definition.key||this.definition.title,this.rowCount=this.definition.rows,this.columnCount=this.definition.columns,this.data=this.definition.data||[],this.element=null,this.isActive=!1,this.grid=new bs(this.columnCount,this.rowCount),this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:!1},this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition")),this.columnDefs=[],this.rowDefs=[],this.columnFields=[],this.columns=[],this.rows=[],this.scrollTop=null,this.scrollLeft=null,this.initialize(),this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement(),this.initializeColumns(),this.initializeRows()}reinitialize(){this.initializeColumns(),this.initializeRows()}initializeElement(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tab"),this.element.innerText=this.title,this.element.addEventListener("click",()=>{this.spreadsheetManager.loadSheet(this)})}initializeColumns(){this.grid.setColumnCount(this.columnCount),this.columnFields=this.grid.genColumns(this.data),this.columnDefs=[],this.columnFields.forEach(e=>{var t=Object.assign({},this.columnDefinition);t.field=e,t.title=e,this.columnDefs.push(t)})}initializeRows(){var e;this.grid.setRowCount(this.rowCount),e=this.grid.genRows(this.data),this.rowDefs=[],e.forEach((t,i)=>{var s={_id:t},n=this.data[i];n&&n.forEach((r,o)=>{var a=this.columnFields[o];a&&(s[a]=r)}),this.rowDefs.push(s)})}unload(){this.isActive=!1,this.scrollTop=this.table.rowManager.scrollTop,this.scrollLeft=this.table.rowManager.scrollLeft,this.data=this.getData(!0),this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var e=!this.isActive;this.isActive=!0,this.table.blockRedraw(),this.table.setData([]),this.table.setColumns(this.columnDefs),this.table.setData(this.rowDefs),this.table.restoreRedraw(),e&&this.scrollTop!==null&&(this.table.rowManager.element.scrollLeft=this.scrollLeft,this.table.rowManager.element.scrollTop=this.scrollTop),this.element.classList.add("tabulator-spreadsheet-tab-active"),this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new ft(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(e){var t=[],i,s,n;return this.rowDefs.forEach(r=>{var o=[];this.columnFields.forEach(a=>{o.push(r[a])}),t.push(o)}),!e&&!this.options("spreadsheetOutputFull")&&(i=t.map(r=>r.findLastIndex(o=>typeof o<"u")+1),s=Math.max(...i),n=i.findLastIndex(r=>r>0)+1,t=t.slice(0,n),t=t.map(r=>r.slice(0,s))),t}setData(e){this.data=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}clear(){this.setData([])}setTitle(e){this.title=e,this.element.innerText=e,this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(e){this.rowCount=e,this.initializeRows(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}setColumns(e){this.columnCount=e,this.reinitialize(),this.dispatchExternal("sheetUpdated",this.getComponent()),this.isActive&&this.load()}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}class pt extends w{constructor(e){super(e),this.sheets=[],this.element=null,this.registerTableOption("spreadsheet",!1),this.registerTableOption("spreadsheetRows",50),this.registerTableOption("spreadsheetColumns",50),this.registerTableOption("spreadsheetColumnDefinition",{}),this.registerTableOption("spreadsheetOutputFull",!1),this.registerTableOption("spreadsheetData",!1),this.registerTableOption("spreadsheetSheets",!1),this.registerTableOption("spreadsheetSheetTabs",!1),this.registerTableOption("spreadsheetSheetTabsElement",!1),this.registerTableFunction("setSheets",this.setSheets.bind(this)),this.registerTableFunction("addSheet",this.addSheet.bind(this)),this.registerTableFunction("getSheets",this.getSheets.bind(this)),this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this)),this.registerTableFunction("setSheetData",this.setSheetData.bind(this)),this.registerTableFunction("getSheet",this.getSheet.bind(this)),this.registerTableFunction("getSheetData",this.getSheetData.bind(this)),this.registerTableFunction("clearSheet",this.clearSheet.bind(this)),this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this)),this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){this.options("spreadsheet")&&(this.subscribe("table-initialized",this.tableInitialized.bind(this)),this.subscribe("data-loaded",this.loadRemoteData.bind(this)),this.table.options.index="_id",this.options("spreadsheetData")&&this.options("spreadsheetSheets")&&(console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData"),this.table.options.spreadsheetData=!1),this.compatibilityCheck(),this.options("spreadsheetSheetTabs")&&this.initializeTabset())}compatibilityCheck(){this.options("data")&&console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table"),this.options("pagination")&&console.warn("The spreadsheet module is not compatible with the pagination module"),this.options("groupBy")&&console.warn("The spreadsheet module is not compatible with the row grouping module"),this.options("responsiveCollapse")&&console.warn("The spreadsheet module is not compatible with the responsive collapse module")}initializeTabset(){this.element=document.createElement("div"),this.element.classList.add("tabulator-spreadsheet-tabs");var e=this.options("spreadsheetSheetTabsElement");e&&!(e instanceof HTMLElement)&&(e=document.querySelector(e),e||console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement"))),e?e.appendChild(this.element):this.footerAppend(this.element)}tableInitialized(){this.sheets.length?this.loadSheet(this.sheets[0]):this.options("spreadsheetSheets")?this.loadSheets(this.options("spreadsheetSheets")):this.options("spreadsheetData")&&this.loadData(this.options("spreadsheetData"))}loadRemoteData(e,t,i){return console.log("data",e,t,i),Array.isArray(e)?(this.table.dataLoader.clearAlert(),this.dispatchExternal("dataLoaded",e),!e.length||Array.isArray(e[0])?this.loadData(e):this.loadSheets(e)):console.error(`Spreadsheet Loading Error - Unable to process remote data due to invalid data type +Expecting: array +Received: `,typeof e,` +Data: `,e),!1}loadData(e){var t={data:e};this.loadSheet(this.newSheet(t))}destroySheets(){this.sheets.forEach(e=>{e.destroy()}),this.sheets=[],this.activeSheet=null}loadSheets(e){Array.isArray(e)||(e=[]),this.destroySheets(),e.forEach(t=>{this.newSheet(t)}),this.loadSheet(this.sheets[0])}loadSheet(e){this.activeSheet!==e&&(this.activeSheet&&this.activeSheet.unload(),this.activeSheet=e,e.load())}newSheet(e={}){var t;return e.rows||(e.rows=this.options("spreadsheetRows")),e.columns||(e.columns=this.options("spreadsheetColumns")),t=new Xe(this,e),this.sheets.push(t),this.element&&this.element.appendChild(t.element),t}removeSheet(e){var t=this.sheets.indexOf(e),i;this.sheets.length>1?t>-1&&(this.sheets.splice(t,1),e.destroy(),this.activeSheet===e&&(i=this.sheets[t-1]||this.sheets[0],i?this.loadSheet(i):this.activeSheet=null)):console.warn("Unable to remove sheet, at least one sheet must be active")}lookupSheet(e){return e?e instanceof Xe?e:e instanceof ft?e._sheet:this.sheets.find(t=>t.key===e)||!1:this.activeSheet}setSheets(e){return this.loadSheets(e),this.getSheets()}addSheet(e){return this.newSheet(e).getComponent()}getSheetDefinitions(){return this.sheets.map(e=>e.getDefinition())}getSheets(){return this.sheets.map(e=>e.getComponent())}getSheet(e){var t=this.lookupSheet(e);return t?t.getComponent():!1}setSheetData(e,t){e&&!t&&(t=e,e=!1);var i=this.lookupSheet(e);return i?i.setData(t):!1}getSheetData(e){var t=this.lookupSheet(e);return t?t.getData():!1}clearSheet(e){var t=this.lookupSheet(e);return t?t.clear():!1}removeSheetFunc(e){var t=this.lookupSheet(e);t&&this.removeSheet(t)}activeSheetFunc(e){var t=this.lookupSheet(e);return t?this.loadSheet(t):!1}}b(pt,"moduleName","spreadsheet");class mt extends w{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s=e==="tooltip"?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,n,r;function o(a){n=a}typeof i=="function"&&(i=i(e,t.getComponent(),o)),i instanceof HTMLElement?s=i:(s=document.createElement("div"),i===!0&&(t instanceof ne?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,a=>{s.innerHTML=i=a||t.definition.title}):i=t.definition.title),s.innerHTML=i),(i||i===0||i===!1)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",a=>a.preventDefault()),this.popupInstance=this.popup(s),typeof n=="function"&&this.popupInstance.renderCallback(n),r=this.popupInstance.containerEventCoords(e),this.popupInstance.show(r.x+15,r.y+15).hideOnBlur(()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null}),this.dispatchExternal("TooltipOpened",t.getComponent()))}}b(mt,"moduleName","tooltip");var vs={integer:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:(e=Number(e),!isNaN(e)&&isFinite(e)&&Math.floor(e)===e)},float:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:(e=Number(e),!isNaN(e)&&isFinite(e)&&e%1!==0)},numeric:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:!isNaN(e)},string:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:isNaN(e)},alphanumeric:function(l,e,t){if(e===""||e===null||typeof e>"u")return!0;var i=new RegExp(/^[a-z0-9]+$/i);return i.test(e)},max:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:parseFloat(e)<=t},min:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:parseFloat(e)>=t},starts:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).toLowerCase().startsWith(String(t).toLowerCase())},ends:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).toLowerCase().endsWith(String(t).toLowerCase())},minLength:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).length>=t},maxLength:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:String(e).length<=t},in:function(l,e,t){return e===""||e===null||typeof e>"u"?!0:(typeof t=="string"&&(t=t.split("|")),t.indexOf(e)>-1)},regex:function(l,e,t){if(e===""||e===null||typeof e>"u")return!0;var i=new RegExp(t);return i.test(e)},unique:function(l,e,t){if(e===""||e===null||typeof e>"u")return!0;var i=!0,s=l.getData(),n=l.getColumn()._getSelf();return this.table.rowManager.rows.forEach(function(r){var o=r.getData();o!==s&&e==n.getFieldValue(o)&&(i=!1)}),i},required:function(l,e,t){return e!==""&&e!==null&&typeof e<"u"}};const ie=class ie extends w{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s=this.table.options.validationMode!=="manual"?this.validate(e.column.modules.validate,e,t):!0;return s!==!0&&setTimeout(()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)}),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach(i=>{this.cellValidate(i)!==!0&&t.push(i.getComponent())}),t.length?t:!0}rowValidate(e){var t=[];return e.cells.forEach(i=>{this.cellValidate(i)!==!0&&t.push(i.getComponent())}),t.length?t:!0}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach(t=>{this.clearValidation(t._getSelf())})}userValidate(e){var t=[];return this.table.rowManager.rows.forEach(i=>{i=i.getComponent();var s=i.validate();s!==!0&&(t=t.concat(s))}),t.length?t:!0}initializeColumnCheck(e){typeof e.definition.validator<"u"&&this.initializeColumn(e)}initializeColumn(e){var t=this,i=[],s;e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach(n=>{s=t._extractValidator(n),s&&i.push(s)}):(s=this._extractValidator(e.definition.validator),s&&i.push(s)),e.modules.validate=i.length?i:!1)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return s=e.indexOf(":"),s>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i=typeof e=="function"?e:ie.validators[e];return i?{type:typeof e=="function"?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,n=[],r=this.invalidCells.indexOf(t);return e&&e.forEach(o=>{o.func.call(s,t.getComponent(),i,o.params)||n.push({type:o.type,parameters:o.params})}),t.modules.validate||(t.modules.validate={}),n.length?(t.modules.validate.invalid=n,this.table.options.validationMode!=="manual"&&t.getElement().classList.add("tabulator-validation-fail"),r==-1&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),r>-1&&this.invalidCells.splice(r,1)),n.length?n:!0}getInvalidCells(){var e=[];return this.invalidCells.forEach(t=>{e.push(t.getComponent())}),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,t=this.invalidCells.indexOf(e),t>-1&&this.invalidCells.splice(t,1))}};b(ie,"moduleName","validate"),b(ie,"validators",vs);let Fe=ie;var ue=Object.freeze({__proto__:null,AccessorModule:ce,AjaxModule:me,ClipboardModule:ge,ColumnCalcsModule:be,DataTreeModule:Ze,DownloadModule:ve,EditModule:we,ExportModule:Ce,FilterModule:Ee,FormatModule:ye,FrozenColumnsModule:et,FrozenRowsModule:tt,GroupRowsModule:it,HistoryModule:Re,HtmlTableImportModule:st,ImportModule:xe,InteractionModule:nt,KeybindingsModule:Te,MenuModule:rt,MoveColumnsModule:ot,MoveRowsModule:ke,MutatorModule:Me,PageModule:Le,PersistenceModule:Se,PopupModule:at,PrintModule:lt,ReactiveDataModule:ht,ResizeColumnsModule:dt,ResizeRowsModule:ut,ResizeTableModule:ct,ResponsiveLayoutModule:De,SelectRangeModule:re,SelectRowModule:ze,SortModule:He,SpreadsheetModule:pt,TooltipModule:mt,ValidateModule:Fe}),ws={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},rowHeader:!1,data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}};class gt{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||t.debugInvalidOptions===!0;Object.assign(i,e);for(let n in t)i.hasOwnProperty(n)||(s&&console.warn("Invalid "+this.msgType+" option:",n),i[n]=t.key);for(let n in i)n in t?i[n]=t[n]:Array.isArray(i[n])?i[n]=Object.assign([],i[n]):typeof i[n]=="object"&&i[n]!==null?i[n]=Object.assign({},i[n]):typeof i[n]>"u"&&delete i[n];return i}}class le extends M{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,t,i){var s=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise((o,a)=>{if(s>-1){if(typeof i>"u"&&(i=this.table.options.scrollToRowIfVisible),!i&&x.elVisible(n)&&(r=x.elOffset(n).top-x.elOffset(this.elementVertical).top,r>0&&r"u"&&(t=this.table.options.scrollToRowPosition),t==="nearest"&&(t=this.scrollToRowNearestTop(e)?"top":"bottom"),this.scrollToRow(e),t){case"middle":case"center":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop+(n.offsetTop-this.elementVertical.scrollTop)-(this.elementVertical.scrollHeight-n.offsetTop)/2:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight/2;break;case"bottom":this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight?this.elementVertical.scrollTop=this.elementVertical.scrollTop-(this.elementVertical.scrollHeight-n.offsetTop)+n.offsetHeight:this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight+n.offsetHeight;break;case"top":this.elementVertical.scrollTop=n.offsetTop;break}o()}else console.warn("Scroll Error - Row not visible"),a("Scroll Error - Row not visible")})}}class Cs extends le{constructor(e){super(e)}renderRowCells(e,t){const i=document.createDocumentFragment();e.cells.forEach(s=>{i.appendChild(s.getElement())}),e.element.appendChild(i),t||e.cells.forEach(s=>{s.cellRendered()})}reinitializeColumnWidths(e){e.forEach(function(t){t.reinitializeWidth()})}}class Es extends le{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){this.options("layout")=="fitDataTable"&&console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),this.options("responsiveLayout")&&console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),this.options("rtl")&&console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach(t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}}),this.windowBuffer=e*2}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach(n=>{var r={},o;n.visible&&(n.modules.frozen||(o=n.getWidth(),r.leftPos=s,r.rightPos=s+o,r.width=o,this.isFitData&&(r.fitDataCheck=n.modules.vdomHoz?n.modules.vdomHoz.fitDataCheck:!0),s+o>this.vDomScrollPosLeft&&s{t.appendChild(i.getElement())}),e.element.appendChild(t),e.cells.forEach(i=>{i.cellRendered()})}}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let t=this.leftCol;t<=this.rightCol;t++)this.columns[t].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e=!1,t,i;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach(s=>{!s.definition.width&&s.visible&&(e=!0)}),e&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,t=this.chain("rows-sample",[1],[],()=>this.table.rowManager.getDisplayRows())[0],t)){i=t.getElement(),t.generateCells(),this.tableElement.appendChild(i);for(let s=0;s{i!==this.columns[s]&&(t=!1)}),!t)}reinitializeRows(){var e=this.getVisibleRows(),t=this.table.rowManager.getRows().filter(i=>!e.includes(i));e.forEach(i=>{this.reinitializeRow(i,!0)}),t.forEach(i=>{i.deinitialize()})}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if(s.type!=="group"){var n=s.getCell(i);s.getElement().insertBefore(n.getElement(),s.getCell(this.columns[this.rightCol]).getElement().nextSibling),n.cellRendered()}}),this.fitDataColActualWidthCheck(i),this.rightCol++,this.getVisibleRows().forEach(s=>{s.type!=="group"&&(s.modules.vdomHoz.rightCol=this.rightCol)}),this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach(n=>{if(n.type!=="group"){var r=n.getCell(i);n.getElement().insertBefore(r.getElement(),n.getCell(this.columns[this.leftCol]).getElement()),r.cellRendered()}}),this.leftCol--,this.getVisibleRows().forEach(n=>{n.type!=="group"&&(n.modules.vdomHoz.leftCol=this.leftCol)}),this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let s=this.fitDataColActualWidthCheck(i);s&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+s,this.vDomPadRight-=s)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach(s=>{if(s.type!=="group"){var n=s.getCell(i);try{s.getElement().removeChild(n.getElement())}catch(r){console.warn("Could not removeColRight",r.message)}}}),this.vDomPadRight+=i.getWidth(),this.rightCol--,this.getVisibleRows().forEach(s=>{s.type!=="group"&&(s.modules.vdomHoz.rightCol=this.rightCol)})):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos{if(s.type!=="group"){var n=s.getCell(i);try{s.getElement().removeChild(n.getElement())}catch(r){console.warn("Could not removeColLeft",r.message)}}}),this.vDomPadLeft+=i.getWidth(),this.leftCol++,this.getVisibleRows().forEach(s=>{s.type!=="group"&&(s.modules.vdomHoz.leftCol=this.leftCol)})):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),t=e.getWidth(),i=t-e.modules.vdomHoz.width,i&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if(e.type!=="group"){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol},this.table.modules.frozenColumns&&this.table.modules.frozenColumns.leftColumns.forEach(t=>{this.appendCell(e,t)});for(let t=this.leftCol;t<=this.rightCol;t++)this.appendCell(e,this.columns[t]);this.table.modules.frozenColumns&&this.table.modules.frozenColumns.rightColumns.forEach(t=>{this.appendCell(e,t)})}}appendCell(e,t){if(t&&t.visible){let i=e.getCell(t);e.getElement().appendChild(i.getElement()),i.cellRendered()}}reinitializeRow(e,t){if(e.type!=="group"&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class ys extends M{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.contentsElement=null,this.rowHeader=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new gt(this.table,"column definition",Qe),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.contentsElement=this.createHeaderContentsElement(),this.element=this.createHeaderElement(),this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild),this.element.insertBefore(this.contentsElement,this.element.firstChild),this.initializeScrollWheelWatcher(),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(e){this.table.rtl?this.headersElement.style.marginLeft=e+"px":this.headersElement.style.marginRight=e+"px"}initializeRenderer(){var e,t={virtual:Es,basic:Cs};typeof this.table.options.renderHorizontal=="string"?e=t[this.table.options.renderHorizontal]:e=this.table.options.renderHorizontal,e?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderContentsElement(){var e=document.createElement("div");return e.classList.add("tabulator-header-contents"),e.setAttribute("role","rowgroup"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(e){this.contentsElement.scrollLeft=e,this.scrollLeft=e,this.renderer.scrollColumns(e)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",e=>{var t;e.deltaX&&(t=this.contentsElement.scrollLeft+e.deltaX,this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})}generateColumnsFromRowData(e){var t=[],i={},s=this.table.options.autoColumns==="full"?e:[e[0]],n=this.table.options.autoColumnsDefinitions;if(e&&e.length){if(s.forEach(r=>{Object.keys(r).forEach((o,a)=>{let h=r[o],d;i[o]?i[o]!==!0&&typeof h<"u"&&(i[o].sorter=this.calculateSorterFromValue(h),i[o]=!0):(d={field:o,title:o,sorter:this.calculateSorterFromValue(h)},t.splice(a,0,d),i[o]=typeof h>"u"?d:!0)})}),n)switch(typeof n){case"function":this.table.options.columns=n.call(this.table,t);break;case"object":Array.isArray(n)?t.forEach(r=>{var o=n.find(a=>a.field===r.field);o&&Object.assign(r,o)}):t.forEach(r=>{n[r.field]&&Object.assign(r,n[r.field])}),this.table.options.columns=t;break}else this.table.options.columns=t;this.setColumns(this.table.options.columns)}}calculateSorterFromValue(e){var t;switch(typeof e){case"undefined":t="string";break;case"boolean":t="boolean";break;case"number":t="number";break;case"object":Array.isArray(e)?t="array":t="string";break;default:!isNaN(e)&&e!==""?t="number":e.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?t="alphanum":t="string";break}return t}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),this.dispatchExternal("columnsLoading"),this.table.options.rowHeader&&(this.rowHeader=new U(this.table.options.rowHeader===!0?{}:this.table.options.rowHeader,this,!0),this.columns.push(this.rowHeader),this.headersElement.appendChild(this.rowHeader.getElement()),this.rowHeader.columnRendered()),e.forEach((i,s)=>{this._addColumn(i)}),this._reIndexColumns(),this.dispatch("columns-loaded"),this.subscribedExternal("columnsLoaded")&&this.dispatchExternal("columnsLoaded",this.getComponents()),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new U(e,this),n=s.getElement(),r=i&&this.findColumnIndex(i);if(t&&this.rowHeader&&(!i||i===this.rowHeader)&&(t=!1,i=this.rowHeader,r=0),i&&r>-1){var o=i.getTopColumn(),a=this.columns.indexOf(o),h=o.getElement();t?(this.columns.splice(a,0,s),h.parentNode.insertBefore(n,h)):(this.columns.splice(a+1,0,s),h.parentNode.insertBefore(n,h.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach(function(e){e.reRegisterPosition()})}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach(t=>{t.clearVerticalAlign()}),this.columns.forEach(t=>{var i=t.getHeight();i>e&&(e=i)}),this.headersElement.style.height=e+"px",this.columns.forEach(t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)}),this.table.rowManager.adjustTableSize())}findColumn(e){var t;if(typeof e=="object"){if(e instanceof U)return e;if(e instanceof $e)return e._getSelf()||!1;if(typeof HTMLElement<"u"&&e instanceof HTMLElement)return t=[],this.columns.forEach(s=>{t.push(s),t=t.concat(s.getColumns(!0))}),t.find(s=>s.element===e)||!1}else return this.columnsByField[e]||!1;return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach(i=>{var s=this.table.options.nestedFieldSeparator?i.split(this.table.options.nestedFieldSeparator)[0]:i;s===e&&t.push(this.columnsByField[i])}),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex(t=>t.visible);return e>-1?this.columnsByIndex[e]:!1}getVisibleColumnsByIndex(){return this.columnsByIndex.filter(e=>e.visible)}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex(t=>e===t)}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach((t,i)=>{e(t,i)})}getDefinitions(e){var t=[];return this.columnsByIndex.forEach(i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())}),t}getDefinitionTree(){var e=[];return this.columns.forEach(t=>{e.push(t.getDefinition(!0))}),e}getComponents(e){var t=[],i=e?this.columns:this.columnsByIndex;return i.forEach(s=>{t.push(s.getComponent())}),t}getWidth(){var e=0;return this.columnsByIndex.forEach(t=>{t.visible&&(e+=t.getWidth())}),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,n){var r=e.indexOf(t),o,a=[];r>-1&&(e.splice(r,1),o=e.indexOf(i),o>-1?s&&(o=o+1):o=r,e.splice(o,0,t),n&&(a=this.chain("column-moving-rows",[t,i,s],null,[])||[],a=a.concat(this.table.rowManager.rows),a.forEach(function(h){if(h.cells.length){var d=h.cells.splice(r,1)[0];h.cells.splice(o,0,d)}})))}scrollToColumn(e,t,i){var s=0,n=e.getLeftOffset(),r=0,o=e.getElement();return new Promise((a,h)=>{if(typeof t>"u"&&(t=this.table.options.scrollToColumnPosition),typeof i>"u"&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":r=-this.element.clientWidth/2;break;case"right":r=o.clientWidth-this.headersElement.clientWidth;break}if(!i&&n>0&&n+o.offsetWidth{t.push(i.generateCell(e))}),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach(function(i){var s,n,r;i.visible&&(s=i.definition.width||0,n=parseInt(i.minWidth),typeof s=="string"?s.indexOf("%")>-1?r=e/100*parseInt(s):r=parseInt(s):r=s,t+=r>n?r:n)}),t}addColumn(e,t,i){return new Promise((s,n)=>{var r=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),this.layoutMode()!="fitColumns"&&r.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(r)})}deregisterColumn(e){var t=e.getField(),i;t&&delete this.columnsByField[t],i=this.columnsByIndex.indexOf(e),i>-1&&this.columnsByIndex.splice(i,1),i=this.columns.indexOf(e),i>-1&&this.columns.splice(i,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(e===!1||e===!0&&this.redrawBlockUpdate===null)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){x.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class Rs extends le{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0,i=document.createDocumentFragment(),s=this.rows();s.forEach((n,r)=>{this.styleRow(n,r),n.initialize(!1,!0),n.type!=="group"&&(t=!1),i.appendChild(n.getElement())}),e.appendChild(i),s.forEach(n=>{n.rendered(),n.heightInitialized||n.calcHeight(!0)}),s.forEach(n=>{n.heightInitialized||n.setCellHeight()}),t?e.style.minWidth=this.table.columnManager.getWidth()+"px":e.style.minWidth=""}rerenderRows(e){this.clearRows(),e&&e(),this.renderRows(),this.rows().length||this.table.rowManager.tableEmpty()}scrollToRowNearestTop(e){var t=x.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-t)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}scrollToRow(e){var t=e.getElement();this.elementVertical.scrollTop=x.elOffset(t).top-x.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class xs extends le{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,n=this.table.rowManager.scrollLeft,r=this.rows(),o=this.vDomTop;o<=this.vDomBottom;o++)if(r[o]){var a=t-r[o].getElement().offsetTop;if(s===!1||Math.abs(a){h.deinitializeHeight()}),e&&e(),this.rows().length?this._virtualRenderFill(i===!1?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager.tableEmpty()),this.scrollColumns(n)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,n=this.vDomWindowBuffer*2,r=this.rows();if(this.scrollTop=e,-i>n||s>n){var o=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*r.length)),this.scrollColumns(o)}else t?(i<0&&this._addTopRow(r,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(r,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(r,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(r,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,n=0,r=0,o=this.rows();if(e)n=this.vDomTop,r=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(o[a])if(s)if(i-o[a].getElement().offsetTop>=0)r=a;else break;else if(t-o[a].getElement().offsetTop>=0)n=a;else if(s=!0,i-o[a].getElement().offsetTop>=0)r=a;else break;return o.slice(n,r+1)}_virtualRenderFill(e,t,i){var s=this.tableElement,n=this.elementVertical,r=0,o=0,a=0,h=0,d=0,u=0,c=this.rows(),f=c.length,g=0,p,v,m=[],C=0,T=0,y=this.table.rowManager.fixedHeight,k=this.elementVertical.clientHeight,P=this.table.options.rowHeight,X=!0;if(e=e||0,i=i||0,!e)this.clear();else{for(;s.firstChild;)s.removeChild(s.firstChild);h=(f-e+1)*this.vDomRowHeight,h{L.rendered(),L.heightInitialized||L.calcHeight(!0)}),m.forEach(L=>{L.heightInitialized||L.setCellHeight()}),m.forEach(L=>{a=L.getHeight(),Cthis.vDomWindowBuffer&&(this.vDomWindowBuffer=a*2),C++}),X=this.table.rowManager.adjustTableSize(),k=this.elementVertical.clientHeight,X&&(y||this.table.options.maxHeight)&&(P=o/C,T=Math.max(this.vDomWindowMinTotalRows,Math.ceil(k/P+this.vDomWindowBuffer/P)))}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-d,this.vDomBottomPad=this.vDomBottom==f-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-o-d,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((o+d)/C),this.vDomBottomPad=this.vDomRowHeight*(f-this.vDomBottom-1),this.vDomScrollHeight=d+o+this.vDomBottomPad-k),s.style.paddingTop=this.vDomTopPad+"px",s.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+d+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-k:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-k),this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-k),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,n.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],n=0,r=this.vDomTop-1,o=0,a=!0;a;)if(this.vDomTop){let h=e[r],d,u;h&&o=d?(this.styleRow(h,r),i.insertBefore(h.getElement(),i.firstChild),(!h.initialized||!h.heightInitialized)&&s.push(h),h.initialize(),u||(d=h.getElement().offsetHeight,d>this.vDomWindowBuffer&&(this.vDomWindowBuffer=d*2)),t-=d,n+=d,this.vDomTop--,r--,o++):a=!1):a=!1}else a=!1;for(let h of s)h.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomTopPad-=n,this.vDomTopPad<0&&(this.vDomTopPad=r*this.vDomRowHeight),r<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=n)}_removeTopRow(e,t){for(var i=[],s=0,n=0,r=!0;r;){let o=e[this.vDomTop],a;o&&n=a?(this.vDomTop++,t-=a,s+=a,i.push(o),n++):r=!1):r=!1}for(let o of i){let a=o.getElement();a.parentNode&&a.parentNode.removeChild(a)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],n=0,r=this.vDomBottom+1,o=0,a=!0;a;){let h=e[r],d,u;h&&o=d?(this.styleRow(h,r),i.appendChild(h.getElement()),(!h.initialized||!h.heightInitialized)&&s.push(h),h.initialize(),u||(d=h.getElement().offsetHeight,d>this.vDomWindowBuffer&&(this.vDomWindowBuffer=d*2)),t-=d,n+=d,this.vDomBottom++,r++,o++):a=!1):a=!1}for(let h of s)h.clearCellHeight();this._quickNormalizeRowHeight(s),n&&(this.vDomBottomPad-=n,(this.vDomBottomPad<0||r==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=n)}_removeBottomRow(e,t){for(var i=[],s=0,n=0,r=!0;r;){let o=e[this.vDomBottom],a;o&&n=a?(this.vDomBottom--,t-=a,s+=a,i.push(o),n++):r=!1):r=!1}for(let o of i){let a=o.getElement();a.parentNode&&a.parentNode.removeChild(a)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class Ts extends M{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.scrollbarWidth=0,this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){var e=this.table.options.placeholder;if(typeof e=="function"&&(e=e.call(this.table)),e=this.chain("placeholder",[e],e,e)||e,e){let t=document.createElement("div");if(t.classList.add("tabulator-placeholder"),typeof e=="string"){let i=document.createElement("div");i.classList.add("tabulator-placeholder-contents"),i.innerHTML=e,t.appendChild(i),this.placeholderContents=i}else typeof HTMLElement<"u"&&e instanceof HTMLElement?(t.appendChild(e),this.placeholderContents=e):(console.warn("Invalid placeholder provided, must be string or HTML Element",e),this.el=null);this.placeholder=t}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))})}findRow(e){if(typeof e=="object"){if(e instanceof S)return e;if(e instanceof oe)return e._getSelf()||!1;if(typeof HTMLElement<"u"&&e instanceof HTMLElement)return this.rows.find(i=>i.getElement()===e)||!1;if(e===null)return!1}else return typeof e>"u"?!1:this.rows.find(i=>i.data[this.table.options.index]==e)||!1;return!1}getRowFromDataObject(e){var t=this.rows.find(i=>i.data===e);return t||!1}getRowFromPosition(e){return this.getDisplayRows().find(t=>t.type==="row"&&t.getPosition()===e&&t.isDisplayed())}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise((s,n)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition(()=>{this._setDataActual(e)}):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()})}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach((i,s)=>{if(i&&typeof i=="object"){var n=new S(i,this);this.rows.push(n)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",i)}),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error(`Data Loading Error - Unable to process data due to invalid data type +Expecting: array +Received: `,typeof e,` +Data: `,e)}_wipeElements(){this.dispatch("rows-wipe"),this.destroy(),this.adjustTableSize(),this.dispatch("rows-wiped")}destroy(){this.rows.forEach(e=>{e.wipe()}),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator(n=>{var r=n.indexOf(e);r>-1&&n.splice(r,1)}),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this.tableEmpty(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){var n=this.addRowActual(e,t,i,s);return n}addRows(e,t,i,s){var n=[];return new Promise((r,o)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(typeof i>"u"&&t||typeof i<"u"&&!t)&&e.reverse(),e.forEach((a,h)=>{var d=this.addRow(a,t,i,!0);n.push(d),this.dispatch("row-added",d,a,t,i)}),this.refreshActiveData(s?"displayPipeline":!1,!1,!0),this.regenerateRowPositions(),this.displayRowsCount&&this._clearPlaceholder(),r(n)})}findAddRowPos(e){return typeof e>"u"&&(e=this.table.options.addRowPos),e==="pos"&&(e=!0),e==="bottom"&&(e=!1),e}addRowActual(e,t,i,s){var n=e instanceof S?e:new S(e||{},this),r=this.findAddRowPos(t),o=-1,a,h;return i||(h=this.chain("row-adding-position",[n,r],null,{index:i,top:r}),i=h.index,r=h.top),typeof i<"u"&&(i=this.findRow(i)),i=this.chain("row-adding-index",[n,i,r],null,i),i&&(o=this.rows.indexOf(i)),i&&o>-1?(a=this.activeRows.indexOf(i),this.displayRowIterator(function(d){var u=d.indexOf(i);u>-1&&d.splice(r?u:u+1,0,n)}),a>-1&&this.activeRows.splice(r?a:a+1,0,n),this.rows.splice(r?o:o+1,0,n)):r?(this.displayRowIterator(function(d){d.unshift(n)}),this.activeRows.unshift(n),this.rows.unshift(n)):(this.displayRowIterator(function(d){d.push(n)}),this.activeRows.push(n),this.rows.push(n)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",n.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),n}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator(s=>{this.moveRowInArray(s,e,t,i)}),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var n,r,o,a;if(t!==i&&(n=e.indexOf(t),n>-1&&(e.splice(n,1),r=e.indexOf(i),r>-1?s?e.splice(r+1,0,t):e.splice(r,0,t):e.splice(n,0,t)),e===this.getDisplayRows())){o=nn?r:n+1;for(let h=o;h<=a;h++)e[h]&&this.styleRow(e[h],h)}}clearData(){this.setData([])}getRowIndex(e){return this.findRowIndex(e,this.rows)}getDisplayRowIndex(e){var t=this.getDisplayRows().indexOf(e);return t>-1?t:!1}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return i!==!1&&i-1)?i:!1}getData(e,t){var i=[],s=this.getRows(e);return s.forEach(function(n){n.type=="row"&&i.push(n.getData(t||"data"))}),i}getComponents(e){var t=[],i=this.getRows(e);return i.forEach(function(s){t.push(s.getComponent())}),t}getDataCount(e){var t=this.getRows(e);return t.length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){typeof t<"u"?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((i,s)=>i.priority-s.priority)):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){typeof t<"u"?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((i,s)=>i.priority-s.priority)):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,t,i){var s=this.table,n="",r=0,o=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if(typeof e=="function")if(r=this.dataPipeline.findIndex(a=>a.handler===e),r>-1)n="dataPipeline",t&&(r==this.dataPipeline.length-1?n="display":r++);else if(r=this.displayPipeline.findIndex(a=>a.handler===e),r>-1)n="displayPipeline",t&&(r==this.displayPipeline.length-1?n="end":r++);else{console.error("Unable to refresh data, invalid handler provided",e);return}else n=e||"all",r=0;if(this.redrawBlock){(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{i.type==="row"&&(i.setPosition(t),t++)})}setActiveRows(e){this.activeRows=this.activeRows=Object.assign([],e),this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return typeof e>"u"?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0);break;default:t=this.chain("rows-retrieve",e,null,this.rows)||this.rows}return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.scrollBarCheck(),this.dispatchExternal("renderComplete"))}scrollBarCheck(){var e=0;this.element.scrollHeight>this.element.clientHeight&&(e=this.element.offsetWidth-this.element.clientWidth),e!==this.scrollbarWidth&&(this.scrollbarWidth=e,this.dispatch("scrollbar-vertical",e))}initializeRenderer(){var e,t={virtual:xs,basic:Rs};typeof this.table.options.renderVertical=="string"?e=t[this.table.options.renderVertical]:e=this.table.options.renderVertical,e?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),(this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight)?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.fixedHeight||this.adjustTableSize(),this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.scrollBarCheck(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll(),this._showPlaceholder()}checkPlaceholder(){this.displayRowsCount?this._clearPlaceholder():this.tableEmpty()}_showPlaceholder(){this.placeholder&&(this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.initializePlaceholder(),this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder(),this.adjustTableSize())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="",this.tableElement.style.display=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach(function(e){e.normalizeHeight()})}adjustTableSize(){let e=this.element.clientHeight,t,i=!1;if(this.renderer.verticalFillMode==="fill"){let s=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){t=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const n="calc(100% - "+s+"px)";this.element.style.minHeight=t||"calc(100% - "+s+"px)",this.element.style.height=n,this.element.style.maxHeight=n}else this.element.style.height="",this.element.style.height=this.table.element.clientHeight-s+"px",this.element.scrollTop=this.scrollTop;this.renderer.resize(),!this.fixedHeight&&e!=this.element.clientHeight&&(i=!0,this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw()),this.scrollBarCheck()}return this._positionPlaceholder(),i}reinitialize(){this.rows.forEach(function(e){e.reinitialize(!0)})}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(this.scrollLeft))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,this.table.browser==="ie"){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class ks extends M{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":this.table.options.footerElement[0]==="<"?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement;break}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){(!this.element.firstChild||e)&&(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Ms extends M{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach(t=>{e[t]={handler:null,components:[]}}),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach(e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)}),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};i=i.filter(n=>{var r=s[e];return n!==e&&(!r||r&&!r.includes(n))}),i.forEach(n=>{var r=this.pseudoTrackers[n].target;this.pseudoTrackers[n].target&&(this.dispatch(n+"-mouseleave",t,r),this.pseudoTrackers[n].target=null)})}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let s of e){let n=i+"-"+s;this.subscriptionChange(n,this.subscriptionChanged.bind(this,i,s))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,n=s.indexOf(e),r=!1;i?n===-1&&(s.push(e),r=!0):this.subscribed(e+"-"+t)||n>-1&&(s.splice(n,1),r=!0),(t==="mouseenter"||t==="mouseleave")&&!this.pseudoTracking&&this.bindPseudoEvents(),r&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),this.pseudoTracking&&(e=="mouseover"||e=="mouseleave")&&!Object.keys(s).length&&this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let n=s.classList?[...s.classList]:[];if(n.filter(a=>this.abortClasses.includes(a)).length)break;let o=n.filter(a=>i.includes(a));for(let a of o)t[this.componentMap[a]]||(t[this.componentMap[a]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],n={},r={};for(let o of i){let a,h=t[o],d=this.previousTargets[o];if(d&&d.target===h)a=d.component;else switch(o){case"row":case"group":(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group"))&&(a=this.table.rowManager.getVisibleRows(!0).find(c=>c.getElement()===h),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[o]=!1));break;case"column":s.components.includes("column")&&(a=this.table.columnManager.findColumn(h));break;case"cell":s.components.includes("cell")&&(n.row instanceof S?a=n.row.findCell(h):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"));break}a&&(n[o]=a,r[o]={target:h,component:a})}return this.previousTargets=r,n}triggerEvents(e,t,i){var s=this.listeners[e];for(let n in i)i[n]&&s.components.includes(n)&&this.dispatch(n+"-"+e,t,i[n])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class Ls{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&typeof this.bindings[e][i].bind=="function")return this.bindings[e][i].bind(null,t);i!=="then"&&typeof i=="string"&&!i.startsWith("_")&&this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class Ss extends M{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,n,r){var o=++this.requestOrder;if(this.table.destroyed)return Promise.resolve();if(this.dispatchExternal("dataLoading",e),e&&(e.indexOf("{")==0||e.indexOf("[")==0)&&(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,n])){this.loading=!0,n||this.alertLoader(),t=this.chain("data-params",[e,i,n],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams);var a=this.chain("data-load",[e,t,i,n],!1,Promise.resolve([]));return a.then(h=>{if(this.table.destroyed)console.warn("Data Load Response Blocked - Table has been destroyed");else{!Array.isArray(h)&&typeof h=="object"&&(h=this.mapParams(h,this.objectInvert(this.table.options.dataReceiveParams)));var d=this.chain("data-loaded",[h],null,h);o==this.requestOrder?(this.clearAlert(),d!==!1&&(this.dispatchExternal("dataLoaded",d),this.table.rowManager.setData(d,s,typeof r>"u"?!s:r))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}).catch(h=>{console.error("Data Load Error: ",h),this.dispatchExternal("dataLoadError",h),n||this.alertError(),setTimeout(()=>{this.clearAlert()},this.table.options.dataLoaderErrorTimeout)}).finally(()=>{this.loading=!1})}else return this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,typeof r>"u"?!s:r),Promise.resolve()}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){var e=typeof this.table.options.dataLoader=="function"?this.table.options.dataLoader():this.table.options.dataLoader;e&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Ds{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e])if(t)if(i=this.events[e].findIndex(s=>s===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}else delete this.events[e];else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(s=>{s(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift(),i;return this.events[t]&&this.events[t].forEach((s,n)=>{let r=s.apply(this.table,e);n||(i=r)}),i}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class zs{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((s,n)=>s.priority-n.priority),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t)if(i=this.events[e].findIndex(s=>s.callback===t),i>-1)this.events[e].splice(i,1);else{console.warn("Cannot remove event, no matching event found:",e,t);return}}else{console.warn("Cannot remove event, no events set on:",e);return}this._notifySubscriptionChange(e,!1)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var n=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((r,o)=>{n=r.callback.apply(this,t.concat([n]))}),n):typeof s=="function"?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((s,n)=>{s.callback.apply(this,t)&&(i=!0)}),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach(s=>{s(t)})}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach(i=>{i.callback.apply(this,e)})}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(this.debug===!0||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Hs extends M{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t,i){var s="";return typeof this.options(e)<"u"?(s="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(s=s+", Please use the %c"+t+"%c option instead",this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;"),i&&(this.table.options[t]=this.table.options[e])):this._warnUser(s,"font-weight: bold;","font-weight: normal;"),!1):!0}checkMsg(e,t){return typeof this.options(e)<"u"?(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1):!0}msg(e){this._warnUser(e)}}function Fs(l,e){e&&this.table.columnManager.renderer.reinitializeColumnWidths(l),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Je(l,e){l.forEach(function(t){t.reinitializeWidth()}),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Ps(l,e){var t=0,i=this.table.rowManager.element.clientWidth,s=0,n=!1;l.forEach((r,o)=>{r.widthFixed||r.reinitializeWidth(),(this.table.options.responsiveLayout?r.modules.responsive.visible:r.visible)&&(n=r),r.visible&&(t+=r.getWidth())}),n?(s=i-t+n.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(n.setWidth(0),this.table.modules.responsiveLayout.update()),s>0?n.setWidth(s):n.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}function Os(l,e){var t=this.table.rowManager.element.getBoundingClientRect().width,i=0,s=0,n=0,r=0,o=[],a=[],h=0,d=0,u=0;function c(g){var p;return typeof g=="string"?g.indexOf("%")>-1?p=t/100*parseInt(g):p=parseInt(g):p=g,p}function f(g,p,v,m){var C=[],T=0,y=0,k=0,P=n,X=0,L=0,he=[];function Ie(E){return v*(E.column.definition.widthGrow||1)}function Ne(E){return c(E.width)-v*(E.column.definition.widthShrink||0)}return g.forEach(function(E,Ws){var We=m?Ne(E):Ie(E);E.column.minWidth>=We?C.push(E):E.column.maxWidth&&E.column.maxWidththis.table.rowManager.element.clientHeight&&(t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),l.forEach(function(g){var p,v,m;g.visible&&(p=g.definition.width,v=parseInt(g.minWidth),p?(m=c(p),i+=m>v?m:v,g.definition.widthShrink&&(a.push({column:g,width:m>v?m:v}),h+=g.definition.widthShrink)):(o.push({column:g,width:0}),n+=g.definition.widthGrow||1))}),s=t-i,r=Math.floor(s/n),u=f(o,s,r,!1),o.length&&u>0&&(o[o.length-1].width+=u),o.forEach(function(g){s-=g.width}),d=Math.abs(u)+s,d>0&&h&&(u=f(a,d,Math.floor(d/h),!0)),u&&a.length&&(a[a.length-1].width-=u),o.forEach(function(g){g.column.setWidth(g.width)}),a.forEach(function(g){g.column.setWidth(g.width)})}var As={fitData:Fs,fitDataFill:Je,fitDataTable:Je,fitDataStretch:Ps,fitColumns:Os};const $=class $ extends w{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;$.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){e.definition.widthGrow&&(e.definition.widthGrow=Number(e.definition.widthGrow)),e.definition.widthShrink&&(e.definition.widthShrink=Number(e.definition.widthShrink))}getMode(){return this.mode}layout(e){this.dispatch("layout-refreshing"),$.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}};b($,"moduleName","layout"),b($,"modes",As);let Pe=$;var _s={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};const se=class se extends w{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=x.deepClone(se.langs),this.table.options.columnDefaults.headerFilterPlaceholder!==!1&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&typeof e[i]=="object"?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){e=e||"default";function t(i,s){for(var n in i)typeof i[n]=="object"?(s[n]||(s[n]={}),t(i[n],s[n])):s[n]=i[n]}if(e===!0&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let i=e.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,i),e=i):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=x.deepClone(this.langList.default||{}),e!="default"&&t(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=t?e+"|"+t:e,s=i.split("|"),n=this._getLangElement(s,this.locale);return n||""}_getLangElement(e,t){var i=this.lang;return e.forEach(function(s){var n;i&&(n=i[s],typeof n<"u"?i=n:i=!1)}),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach(t=>{t(this.getText(e),this.lang)})}};b(se,"moduleName","localize"),b(se,"langs",_s);let Oe=se;class bt extends w{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[],i;return i=this.table.constructor.registry.lookupTable(e),i.forEach(s=>{this.table!==s&&t.push(s)}),t}send(e,t,i,s){var n=this.getConnections(e);n.forEach(r=>{r.tableComms(this.table.element,t,i,s)}),!n.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}b(bt,"moduleName","comms");var Bs=Object.freeze({__proto__:null,CommsModule:bt,LayoutModule:Pe,LocalizeModule:Oe});const z=class z{static findTable(e){var t=z.registry.lookupTable(e,!0);return Array.isArray(t)&&!t.length?!1:t}};b(z,"registry",{tables:[],register(e){z.registry.tables.push(e)},deregister(e){var t=z.registry.tables.indexOf(e);t>-1&&z.registry.tables.splice(t,1)},lookupTable(e,t){var i=[],s,n;if(typeof e=="string"){if(s=document.querySelectorAll(e),s.length)for(var r=0;r{s.prototype.moduleCore=!0}),R._registerModule(i)}static _registerModule(e){Array.isArray(e)||(e=[e]),e.forEach(t=>{R._registerModuleBinding(t),R._registerModuleExtensions(t)})}static _registerModuleBinding(e){e.moduleName?R.moduleBindings[e.moduleName]=e:console.error("Unable to bind module, no moduleName defined",e.moduleName)}static _registerModuleExtensions(e){var t=e.moduleExtensions;if(e.moduleExtensions)for(let i in t){let s=t[i];if(R.moduleBindings[i])for(let n in s)R._extendModule(i,n,s[n]);else{R.moduleExtensions[i]||(R.moduleExtensions[i]={});for(let n in s)R.moduleExtensions[i][n]||(R.moduleExtensions[i][n]={}),Object.assign(R.moduleExtensions[i][n],s[n])}}R._extendModuleFromQueue(e)}static _extendModuleFromQueue(e){var t=R.moduleExtensions[e.moduleName];if(t)for(let i in t)R._extendModule(e.moduleName,i,t[i])}_bindModules(){var e=[],t=[],i=[];this.modules={};for(var s in R.moduleBindings){let n=R.moduleBindings[s],r=new n(this);this.modules[s]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?e.push(r):t.push(r):i.push(r)}e.sort((n,r)=>n.moduleInitOrder>r.moduleInitOrder?1:-1),t.sort((n,r)=>n.moduleInitOrder>r.moduleInitOrder?1:-1),this.modulesRegular=e.concat(i.concat(t))}};b(R,"moduleBindings",{}),b(R,"moduleExtensions",{}),b(R,"modulesRegistered",!1),b(R,"defaultModules",!1);let _e=R;class Vs extends M{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.dispatch("alert-show",t),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),typeof e=="function"&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}const A=class A extends _e{static extendModule(){A.initializeModuleBinder(),A._extendModule(...arguments)}static registerModule(){A.initializeModuleBinder(),A._registerModule(...arguments)}constructor(e,t,i){super(),A.initializeModuleBinder(i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Ls(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Hs(this),this.optionsList=new gt(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout(()=>{this._create()})),this.constructor.registry.register(this)}initializeElement(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement?(this.element=e,!0):typeof e=="string"?(this.element=document.querySelector(e),this.element?!0:(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new ys(this),this.rowManager=new Ts(this),this.footerManager=new ks(this),this.dataLoader=new Ss(this),this.alertManager=new Vs(this),this._bindModules(),this.options=this.optionsList.generate(A.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Ds(this,this.options,this.options.debugEventsExternal),this.eventBus=new zs(this.options.debugEventsInternal),this.interactionMonitor=new Ms(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this.initialized=!0,this._loadInitialData().finally(()=>{this.eventBus.dispatch("table-initialized"),this.externalEvents.dispatch("tableBuilt")})}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(e.direction!=="rtl")break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e=this.element,t=this.options,i;if(e.tagName==="TABLE"){this.originalElement=this.element,i=document.createElement("div");var s=e.attributes;for(var n in s)typeof s[n]=="object"&&i.setAttribute(s[n].name,s[n].value);e.parentNode.replaceChild(i,e),this.element=e=i}for(e.classList.add("tabulator"),e.setAttribute("role","grid");e.firstChild;)e.removeChild(e.firstChild);t.height&&(t.height=isNaN(t.height)?t.height:t.height+"px",e.style.height=t.height),t.minHeight!==!1&&(t.minHeight=isNaN(t.minHeight)?t.minHeight:t.minHeight+"px",e.style.minHeight=t.minHeight),t.maxHeight!==!1&&(t.maxHeight=isNaN(t.maxHeight)?t.maxHeight:t.maxHeight+"px",e.style.maxHeight=t.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach(i=>{i.initialize()}),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach(i=>{i.initialize()}),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally(()=>{this.columnManager.verticalAlignHeaders()})}destroy(){var e=this.element;for(this.destroyed=!0,this.constructor.registry.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.destroy();e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):e.indexOf("Mac OS")>-1?(this.browser="safari",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(i=new Error().stack.split(` +`),s=i[0]=="Error"?i[2]:i[1],s[0]==" "?e=s.trim().split(" ")[1].split(".")[1]:e=s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise((i,s)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(n=>{var r=this.rowManager.findRow(n[this.options.index]);r?(t++,r.updateData(n).then(()=>{t--,t||i()}).catch(o=>{s("Update Error - Unable to update row",n,o)})):s("Update Error - Unable to find row",n)}):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))})}addData(e,t,i){return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then(r=>{var o=[];r.forEach(function(a){o.push(a.getComponent())}),s(o)}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise((s,n)=>{this.dataLoader.blockActiveLoad(),typeof e=="string"&&(e=JSON.parse(e)),e&&e.length>0?e.forEach(r=>{var o=this.rowManager.findRow(r[this.options.index]);i++,o?o.updateData(r).then(()=>{i--,t.push(o.getComponent()),i||s(t)}):this.rowManager.addRows(r).then(a=>{i--,t.push(a[0].getComponent()),i||s(t)})}):(console.warn("Update Error - No data provided"),n("Update Error - No data provided"))})}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let s=this.rowManager.findRow(i,!0);if(s)t.push(s);else return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found")}return t.sort((i,s)=>this.rowManager.rows.indexOf(i)>this.rowManager.rows.indexOf(s)?1:-1),t.forEach(i=>{i.delete()}),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),typeof e=="string"&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i,!0).then(s=>s[0].getComponent())}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>i.getComponent()):this.rowManager.addRows(t).then(s=>s[0].getComponent())}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),typeof t=="string"&&(t=JSON.parse(t)),i?i.updateData(t).then(()=>Promise.resolve(i.getComponent())):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.show();else return console.warn("Column Show Error - No matching column found:",e),!1}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.hide();else return console.warn("Column Hide Error - No matching column found:",e),!1}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),t)t.visible?t.hide():t.show();else return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then(n=>n.getComponent())}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),n=this.columnManager.findColumn(t);this.initGuard(),s?n?this.columnManager.moveColumn(s,n,i):console.warn("Move Error - No matching column found:",n):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise((s,n)=>{var r=this.columnManager.findColumn(e);return r?this.columnManager.scrollToColumn(r,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))})}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw(!0)}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){var e=Array.from(arguments);e.shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return this.modules[e]?!0:(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}};b(A,"defaultOptions",ws);let Be=A;var Q=Be;class Is extends Q{static extendModule(){Q.initializeModuleBinder(ue),Q._extendModule(...arguments)}static registerModule(){Q.initializeModuleBinder(ue),Q._registerModule(...arguments)}constructor(e,t,i){super(e,t,ue)}}var Ns=Is;const Xs=Ct({__name:"Tabulator",props:{columns:{},tableData:{}},setup(l){const e=l,t=Ge(null),i=Ge(null);je(()=>e.columns,()=>{i.value?i.value.setColumns(e.columns):s()}),je(()=>e.tableData,()=>{n()}),Et(async()=>{await yt(),s()}),Rt(()=>{i.value&&(i.value.destroy(),i.value=null)});const s=()=>{!t.value||i.value||(i.value=new Ns(t.value,{data:e.tableData??[],reactiveData:!0,columns:e.columns,height:"auto",pagination:!0,paginationSize:6,paginationSizeSelector:[3,6,8,10],movableColumns:!0,paginationCounter:"rows"}))},n=()=>{if(!i.value){s();return}i.value.replaceData(e.tableData??[])};return(r,o)=>(Tt(),xt("div",{ref_key:"table",ref:t},null,512))}});export{Xs as _}; diff --git a/src/main/resources/static/assets/YamlGenerate-CY7vMkIK.js b/src/main/resources/static/assets/YamlGenerate-CY7vMkIK.js new file mode 100644 index 0000000..4da6e75 --- /dev/null +++ b/src/main/resources/static/assets/YamlGenerate-CY7vMkIK.js @@ -0,0 +1 @@ +import{d as B,g as A,h as I,r as f,o as n,c as a,a as e,t as F,f as O,i as G,j as c,l as m,F as D,k as j,m as W,n as K,b as N,p as X}from"./index-D89BCYsX.js";import{s as J}from"./request-CuP4O-bn.js";import{_ as Q}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z=P=>J.post("/manifest/v1/generator/yaml/pod",P),ee=P=>J.post("/manifest/v1/generator/yaml/service",P),te=P=>J.post("/manifest/v1/generator/yaml/hpa",P),le=P=>J.post("/manifest/v1/generator/yaml/deployments",P),oe=P=>J.post("/manifest/v1/generator/yaml/configmap",P),se={class:"modal",id:"modal-pod",tabindex:"-1"},ne={class:"modal-dialog modal-lg",role:"document"},ae={class:"modal-content"},re={class:"modal-header"},ie={class:"modal-title"},de={class:"modal-body"},ue={class:"card"},ce={class:"card-body"},me=B({__name:"podModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{$.value&&await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",se,[e("div",ne,[e("div",ae,[e("div",re,[e("h5",ie,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",de,[e("div",ue,[e("div",ce,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),pe={class:"tab-pane active show",id:"tabs-pod"},ve={class:"card"},be={class:"card-body"},he={class:"mb-3"},ye={class:"mb-3"},fe={class:"mb-3"},ge=["onUpdate:modelValue"],_e=["onUpdate:modelValue"],we={class:"btn-list"},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},$e=["onClick"],xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ce={class:"card mt-4"},Ue={class:"card-body"},Me={class:"mb-3"},Ve={class:"btn-list"},Pe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},qe=["onClick"],Se={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},De={class:"row",style:{width:"68% !important"}},je={class:"col mt-4"},ze=["onUpdate:modelValue"],He={class:"col mt-4"},Le=["onUpdate:modelValue"],Be={class:"mb-3"},Re=["onUpdate:modelValue"],Ne=["onUpdate:modelValue"],Fe={class:"btn-list"},Ae=["onClick"],Ee={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Te=["onClick"],Ye={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Oe={class:"mb-3"},Ge={class:"btn-list"},Ie=["onClick"],Ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Je=["onClick"],Qe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},We={class:"row",style:{width:"68% !important"}},Xe={class:"col mt-4"},Ze=["onUpdate:modelValue"],et={class:"col mt-4"},tt=["onUpdate:modelValue"],lt={class:"row",style:{width:"68% !important"}},ot={class:"col mt-4"},st=["onUpdate:modelValue"],nt={class:"col mt-4"},at=["onUpdate:modelValue"],rt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},it={class:"mb-3"},dt={class:"row",style:{width:"68% !important"}},ut={class:"col mt-4"},ct=["onUpdate:modelValue"],mt={class:"col mt-4"},pt=["onUpdate:modelValue"],vt={class:"row",style:{width:"68% !important"}},bt={class:"col mt-4"},ht=["onUpdate:modelValue"],yt={class:"col mt-4"},ft=["onUpdate:modelValue"],gt={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},_t={class:"mb-3"},wt={class:"mt-4"},kt={class:"btn-list justify-content-end mt-4"},$t=B({__name:"podForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f(""),V=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const i of p.value)if(!i.name||i.name.trim()===""||!i.image||i.image.trim()==="")return!1;return!0});G(async()=>{await L()});const L=()=>{$.value="Pod",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value={containers:[],restartPolicy:""},p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter pod name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=i,w.value.metadata=l.value,r.value.containers=p.value,w.value.spec=r.value;const{data:t}=await Z(w.value);M.value=t},E=()=>{_.value.push({key:"",value:""})},T=i=>{_.value.length!==1&&_.value.splice(i,1)},H=()=>{p.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{name:"",containerPort:"",hostPort:"",protocol:""}],resources:{limits:{memory:"",cpu:""},requests:{memory:"",cpu:""}}})},u=i=>{p.value.length!==1&&p.value.splice(i,1)},o=i=>{p.value[i].env.push({name:"",value:""})},U=(i,t)=>{p.value[i].env.length!==1&&p.value[i].env.splice(t,1)},x=i=>{p.value[i].ports.push({name:"",containerPort:"",hostPort:"",protocol:""})},k=(i,t)=>{p.value[i].ports.length!==1&&p.value[i].ports.splice(t,1)};return(i,t)=>(n(),a("div",pe,[e("div",ve,[t[9]||(t[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",be,[e("div",he,[t[4]||(t[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[0]||(t[0]=s=>l.value.name=s),placeholder:"pod-01"},null,512),[[m,l.value.name]])]),e("div",ye,[t[5]||(t[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":t[1]||(t[1]=s=>l.value.namespace=s),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",fe,[t[8]||(t[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(s,b)=>(n(),a("div",{class:"generate-form",key:b},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.key=y,placeholder:"key"},null,8,ge),[[m,s.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":y=>s.value=y,placeholder:"value"},null,8,_e),[[m,s.value]]),e("div",we,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",ke,t[6]||(t[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>T(b)},[(n(),a("svg",xe,t[7]||(t[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,$e)])]))),128))])])]),e("div",Ce,[t[31]||(t[31]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Ue,[(n(!0),a(D,null,j(p.value,(s,b)=>(n(),a("div",{class:"mt-4",key:b},[e("div",Me,[e("div",Ve,[t[12]||(t[12]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Pe,t[10]||(t[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:y=>u(b)},[(n(),a("svg",Se,t[11]||(t[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,qe)]),e("div",De,[e("div",je,[t[13]||(t[13]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.name=y},null,8,ze),[[m,s.name]])]),e("div",He,[t[14]||(t[14]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.image=y},null,8,Le),[[m,s.image]])])])]),e("div",Be,[t[17]||(t[17]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(s.env,(y,Y)=>(n(),a("div",{class:"generate-form",key:Y},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.name=g,placeholder:"key"},null,8,Re),[[m,y.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":g=>y.value=g,placeholder:"value"},null,8,Ne),[[m,y.value]]),e("div",Fe,[e("button",{class:"btn btn-primary",onClick:g=>o(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ee,t[15]||(t[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ae),e("button",{class:"btn btn-primary",onClick:g=>U(b,Y)},[(n(),a("svg",Ye,t[16]||(t[16]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Te)])]))),128))]),e("div",Oe,[(n(!0),a(D,null,j(s.ports,(y,Y)=>(n(),a("div",{class:"mt-4",key:Y},[e("div",Ge,[t[20]||(t[20]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:g=>x(b),style:{"text-align":"center !important"}},[(n(),a("svg",Ke,t[18]||(t[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Ie),e("button",{class:"btn btn-primary",onClick:g=>k(b,Y)},[(n(),a("svg",Qe,t[19]||(t[19]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Je)]),e("div",We,[e("div",Xe,[t[21]||(t[21]=e("label",{class:"form-label"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.name=g},null,8,Ze),[[m,y.name]])]),e("div",et,[t[22]||(t[22]=e("label",{class:"form-label"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.containerPort=g},null,8,tt),[[m,y.containerPort]])])]),e("div",lt,[e("div",ot,[t[23]||(t[23]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.protocol=g},null,8,st),[[m,y.protocol]])]),e("div",nt,[t[24]||(t[24]=e("label",{class:"form-label"},"- Host Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":g=>y.hostPort=g},null,8,at),[[m,y.hostPort]])])]),s.ports.length>1?(n(),a("div",rt)):W("",!0)]))),128))]),e("div",it,[t[29]||(t[29]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"Resources")],-1)),e("div",dt,[e("div",ut,[t[25]||(t[25]=e("label",{class:"form-label"},"- Limits CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.cpu=y},null,8,ct),[[m,s.resources.limits.cpu]])]),e("div",mt,[t[26]||(t[26]=e("label",{class:"form-label"},"- Limits Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.limits.memory=y},null,8,pt),[[m,s.resources.limits.memory]])])]),e("div",vt,[e("div",bt,[t[27]||(t[27]=e("label",{class:"form-label"},"- Requests CPU",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.cpu=y},null,8,ht),[[m,s.resources.requests.cpu]])]),e("div",yt,[t[28]||(t[28]=e("label",{class:"form-label"},"- Requests Memory",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":y=>s.resources.requests.memory=y},null,8,ft),[[m,s.resources.requests.memory]])])])]),p.value.length>1?(n(),a("div",gt)):W("",!0)]))),128)),e("div",_t,[e("div",wt,[t[30]||(t[30]=e("label",{class:"form-label"},"- Restart Policy",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":t[2]||(t[2]=s=>r.value.restartPolicy=s)},null,512),[[m,r.value.restartPolicy]])])])])]),e("div",kt,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:t[3]||(t[3]=s=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-pod"},"GENERATE",2)]),N(me,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),xt=Q($t,[["__scopeId","data-v-ebbc4037"]]),Ct={class:"modal",id:"modal-deploy",tabindex:"-1"},Ut={class:"modal-dialog modal-lg",role:"document"},Mt={class:"modal-content"},Vt={class:"modal-header"},Pt={class:"modal-title"},qt={class:"modal-body"},St={class:"card"},Dt={class:"card-body"},jt=B({__name:"deployModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ct,[e("div",Ut,[e("div",Mt,[e("div",Vt,[e("h5",Pt,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",qt,[e("div",St,[e("div",Dt,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),zt={class:"tab-pane",id:"tabs-deployment"},Ht={class:"card"},Lt={class:"card-body"},Bt={class:"mb-3"},Rt={class:"mb-3"},Nt={class:"mb-3"},Ft=["onUpdate:modelValue"],At=["onUpdate:modelValue"],Et={class:"btn-list"},Tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Yt=["onClick"],Ot={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Gt={class:"card mt-4"},It={class:"card-body"},Kt={class:"mb-3"},Jt={class:"mb-3"},Qt=["onUpdate:modelValue"],Wt=["onUpdate:modelValue"],Xt={class:"btn-list"},Zt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},el=["onClick"],tl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ll={class:"mb-3"},ol=["onUpdate:modelValue"],sl=["onUpdate:modelValue"],nl={class:"btn-list"},al={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},rl=["onClick"],il={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},dl={class:"mb-3"},ul={class:"btn-list"},cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},ml=["onClick"],pl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vl={class:"row",style:{width:"68% !important"}},bl={class:"col mt-4"},hl=["onUpdate:modelValue"],yl={class:"col mt-4"},fl=["onUpdate:modelValue"],gl={class:"mb-3"},_l=["onUpdate:modelValue"],wl={class:"btn-list"},kl=["onClick"],$l={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},xl=["onClick"],Cl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ul={class:"mb-3"},Ml=["onUpdate:modelValue"],Vl=["onUpdate:modelValue"],Pl={class:"btn-list"},ql=["onClick"],Sl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Dl=["onClick"],jl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},zl={class:"btn-list justify-content-end mt-4"},Hl=B({__name:"deploymentForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f([]),M=f({}),V=f([]),L=f(""),R=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const g of V.value)if(!g.name||g.name.trim()===""||!g.image||g.image.trim()==="")return!1;return!0});G(async()=>{await E()});const E=()=>{$.value="Deployment",l.value.name="",l.value.namespace="",_.value.push({key:"",value:""}),r.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value={replicas:"",selector:{matchLabels:{}},template:{metadata:{labels:{}},spec:{containers:[]}}},V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},T=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter deployment name.");const v=document.querySelector('input[v-model="metadata.name"]');v==null||v.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const v=document.querySelector('input[v-model="metadata.namespace"]');v==null||v.focus();return}for(let v=0;v(v[q.key]=q.value,v),{}),d=r.value.reduce((v,q)=>(v[q.key]=q.value,v),{}),C=p.value.reduce((v,q)=>(v[q.key]=q.value,v),{});l.value.labels=g,w.value.metadata=l.value,M.value.selector.matchLabels=d,M.value.template.metadata.labels=C,M.value.template.spec.containers=V.value,w.value.spec=M.value,console.log("deployFormData.value : ",w.value);const{data:S}=await le(w.value);L.value=S},H=()=>{_.value.push({key:"",value:""})},u=g=>{_.value.length!==1&&_.value.splice(g,1)},o=()=>{r.value.push({key:"",value:""})},U=g=>{r.value.length!==1&&r.value.splice(g,1)},x=()=>{p.value.push({key:"",value:""})},k=g=>{p.value.length!==1&&p.value.splice(g,1)},i=()=>{V.value.push({name:"",image:"",env:[{name:"",value:""}],ports:[{containerPort:""}]})},t=g=>{V.value.length!==1&&V.value.splice(g,1)},s=g=>{V.value[g].env.push({name:"",value:""})},b=(g,d)=>{V.value[g].env.length!==1&&V.value[g].env.splice(d,1)},y=g=>{V.value[g].ports.push({containerPort:""})},Y=(g,d)=>{V.value[g].ports.length!==1&&V.value[g].ports.splice(d,1)};return(g,d)=>(n(),a("div",zt,[e("div",Ht,[d[9]||(d[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Lt,[e("div",Bt,[d[4]||(d[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[0]||(d[0]=C=>l.value.name=C),placeholder:"deployment-01"},null,512),[[m,l.value.name]])]),e("div",Rt,[d[5]||(d[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":d[1]||(d[1]=C=>l.value.namespace=C),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Nt,[d[8]||(d[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Ft),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,At),[[m,C.value]]),e("div",Et,[e("button",{class:"btn btn-primary",onClick:H,style:{"text-align":"center !important"}},[(n(),a("svg",Tt,d[6]||(d[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>u(S)},[(n(),a("svg",Ot,d[7]||(d[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Yt)])]))),128))])])]),e("div",Gt,[d[29]||(d[29]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",It,[e("div",Kt,[d[10]||(d[10]=e("label",{class:"form-label"},"- Replicas",-1)),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":d[2]||(d[2]=C=>M.value.replicas=C)},null,512),[[m,M.value.replicas]])]),e("div",Jt,[d[13]||(d[13]=e("label",{class:"form-label"},"- Match Labels",-1)),(n(!0),a(D,null,j(r.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,Qt),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,Wt),[[m,C.value]]),e("div",Xt,[e("button",{class:"btn btn-primary",onClick:o,style:{"text-align":"center !important"}},[(n(),a("svg",Zt,d[11]||(d[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>U(S)},[(n(),a("svg",tl,d[12]||(d[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,el)])]))),128))]),d[28]||(d[28]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Template")],-1)),e("div",ll,[d[16]||(d[16]=e("div",{class:"btn-list"},[e("label",{class:"form-label"},"- Labels")],-1)),(n(!0),a(D,null,j(p.value,(C,S)=>(n(),a("div",{class:"generate-form",key:S},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.key=v,placeholder:"key"},null,8,ol),[[m,C.key]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":v=>C.value=v,placeholder:"value"},null,8,sl),[[m,C.value]]),e("div",nl,[e("button",{class:"btn btn-primary",onClick:x,style:{"text-align":"center !important"}},[(n(),a("svg",al,d[14]||(d[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>k(S)},[(n(),a("svg",il,d[15]||(d[15]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,rl)])]))),128))]),(n(!0),a(D,null,j(V.value,(C,S)=>(n(),a("div",{key:S},[e("div",dl,[e("div",ul,[d[19]||(d[19]=e("label",{class:"form-label"},"Containers",-1)),e("button",{class:"btn btn-primary",onClick:i,style:{"text-align":"center !important"}},[(n(),a("svg",cl,d[17]||(d[17]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:v=>t(S)},[(n(),a("svg",pl,d[18]||(d[18]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ml)]),e("div",vl,[e("div",bl,[d[20]||(d[20]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.name=v},null,8,hl),[[m,C.name]])]),e("div",yl,[d[21]||(d[21]=e("label",{class:"form-label required"},"- Image",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":v=>C.image=v},null,8,fl),[[m,C.image]])])])]),e("div",gl,[d[24]||(d[24]=e("label",{class:"form-label"},"- Port",-1)),(n(!0),a(D,null,j(C.ports,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.containerPort=z,placeholder:"value"},null,8,_l),[[m,v.containerPort]]),e("div",wl,[e("button",{class:"btn btn-primary",onClick:z=>y(S),style:{"text-align":"center !important"}},[(n(),a("svg",$l,d[22]||(d[22]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,kl),e("button",{class:"btn btn-primary",onClick:z=>Y(S,q)},[(n(),a("svg",Cl,d[23]||(d[23]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,xl)])]))),128))]),e("div",Ul,[d[27]||(d[27]=e("label",{class:"form-label"},"- Env",-1)),(n(!0),a(D,null,j(C.env,(v,q)=>(n(),a("div",{class:"generate-form",key:q},[c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.name=z,placeholder:"key"},null,8,Ml),[[m,v.name]]),c(e("input",{type:"text",class:"form-control w-33","onUpdate:modelValue":z=>v.value=z,placeholder:"value"},null,8,Vl),[[m,v.value]]),e("div",Pl,[e("button",{class:"btn btn-primary",onClick:z=>s(S),style:{"text-align":"center !important"}},[(n(),a("svg",Sl,d[25]||(d[25]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,ql),e("button",{class:"btn btn-primary",onClick:z=>b(S,q)},[(n(),a("svg",jl,d[26]||(d[26]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Dl)])]))),128))])]))),128))])]),e("div",zl,[e("a",{class:K(["btn btn-primary",{disabled:!R.value}]),onClick:d[3]||(d[3]=C=>R.value?T():null),"data-bs-toggle":"modal","data-bs-target":"#modal-deploy"},"GENERATE",2)]),N(jt,{"yaml-data":L.value,title:$.value},null,8,["yaml-data","title"])]))}}),Ll=Q(Hl,[["__scopeId","data-v-f08d5135"]]),Bl={class:"modal",id:"modal-service",tabindex:"-1"},Rl={class:"modal-dialog modal-lg",role:"document"},Nl={class:"modal-content"},Fl={class:"modal-header"},Al={class:"modal-title"},El={class:"modal-body"},Tl={class:"card"},Yl={class:"card-body"},Ol=B({__name:"servcieModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Bl,[e("div",Rl,[e("div",Nl,[e("div",Fl,[e("h5",Al,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",El,[e("div",Tl,[e("div",Yl,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Gl={class:"tab-pane",id:"tabs-service"},Il={class:"card"},Kl={class:"card-body"},Jl={class:"mb-3"},Ql={class:"mb-3"},Wl={class:"mb-3"},Xl=["onUpdate:modelValue"],Zl=["onUpdate:modelValue"],eo={class:"btn-list"},to={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},lo=["onClick"],oo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},so={class:"card mt-4"},no={class:"card-body"},ao={class:"mb-3"},ro=["onUpdate:modelValue"],io=["onUpdate:modelValue"],uo={class:"btn-list"},co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},mo=["onClick"],po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},vo={class:"mb-3"},bo={class:"btn-list"},ho={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},yo=["onClick"],fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},go={class:"row",style:{width:"68% !important"}},_o={class:"col mt-4"},wo=["onUpdate:modelValue"],ko={class:"col mt-4"},$o=["onUpdate:modelValue"],xo={class:"row",style:{width:"68% !important"}},Co={class:"col mt-4"},Uo=["onUpdate:modelValue"],Mo={class:"col mt-4"},Vo=["onUpdate:modelValue"],Po={key:0,class:"border-bottom",style:{width:"100%","margin-top":"10px"}},qo={class:"row",style:{width:"68% !important"}},So={class:"col mt-4"},Do={class:"btn-list justify-content-end mt-4"},jo=B({__name:"serviceForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f([]),M=f([]);f("");const V=f(""),L=A(()=>{if(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()==="")return!1;for(const k of M.value)if(!k.port||k.port.trim()===""||!k.targetPort||k.targetPort.trim()==="")return!1;return!0});G(async()=>{await R()});const R=()=>{$.value="Service",l.value={name:"",namespace:"",labels:{}},r.value={selector:{},ports:[],type:""},_.value.push({key:"",value:""}),p.value.push({key:"",value:""}),M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},E=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter service name.");const s=document.querySelector('input[v-model="metadata.name"]');s==null||s.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const s=document.querySelector('input[v-model="metadata.namespace"]');s==null||s.focus();return}for(let s=0;s(s[b.key]=b.value,s),{});l.value.labels=k,w.value.metadata=l.value;const i=p.value.reduce((s,b)=>(s[b.key]=b.value,s),{});r.value.selector=i,r.value.ports=M.value,w.value.spec=r.value;const{data:t}=await ee(w.value);V.value=t},T=()=>{_.value.push({key:"",value:""})},H=k=>{_.value.length!==1&&_.value.splice(k,1)},u=()=>{p.value.push({key:"",value:""})},o=k=>{p.value.length!==1&&p.value.splice(k,1)},U=()=>{M.value.push({protocol:"",port:"",targetPort:"",nodePort:""})},x=k=>{M.value.length!==1&&M.value.splice(k,1)};return(k,i)=>(n(),a("div",Gl,[e("div",Il,[i[9]||(i[9]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Kl,[e("div",Jl,[i[4]||(i[4]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[0]||(i[0]=t=>l.value.name=t),placeholder:"name-01"},null,512),[[m,l.value.name]])]),e("div",Ql,[i[5]||(i[5]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":i[1]||(i[1]=t=>l.value.namespace=t),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Wl,[i[8]||(i[8]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,Xl),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,Zl),[[m,t.value]]),e("div",eo,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",to,i[6]||(i[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>H(s)},[(n(),a("svg",oo,i[7]||(i[7]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,lo)])]))),128))])])]),e("div",so,[i[21]||(i[21]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",no,[e("div",ao,[i[12]||(i[12]=e("label",{class:"form-label"},"- Selector",-1)),(n(!0),a(D,null,j(p.value,(t,s)=>(n(),a("div",{class:"generate-form",key:s},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.key=b,placeholder:"key"},null,8,ro),[[m,t.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":b=>t.value=b,placeholder:"value"},null,8,io),[[m,t.value]]),e("div",uo,[e("button",{class:"btn btn-primary",onClick:u,style:{"text-align":"center !important"}},[(n(),a("svg",co,i[10]||(i[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>o(s)},[(n(),a("svg",po,i[11]||(i[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,mo)])]))),128))]),e("div",vo,[(n(!0),a(D,null,j(M.value,(t,s)=>(n(),a("div",{class:"mt-4",key:s},[e("div",bo,[i[15]||(i[15]=e("label",{class:"form-label"},"Ports",-1)),e("button",{class:"btn btn-primary",onClick:U,style:{"text-align":"center !important"}},[(n(),a("svg",ho,i[13]||(i[13]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:b=>x(s)},[(n(),a("svg",fo,i[14]||(i[14]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,yo)]),e("div",go,[e("div",_o,[i[16]||(i[16]=e("label",{class:"form-label required"},"- Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.port=b},null,8,wo),[[m,t.port]])]),e("div",ko,[i[17]||(i[17]=e("label",{class:"form-label required"},"- Target Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.targetPort=b},null,8,$o),[[m,t.targetPort]])])]),e("div",xo,[e("div",Co,[i[18]||(i[18]=e("label",{class:"form-label"},"- Protocol",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.protocol=b},null,8,Uo),[[m,t.protocol]])]),e("div",Mo,[i[19]||(i[19]=e("label",{class:"form-label"},"- Node Port",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":b=>t.nodePort=b},null,8,Vo),[[m,t.nodePort]])])]),M.value.length>1?(n(),a("div",Po)):W("",!0)]))),128)),e("div",qo,[e("div",So,[i[20]||(i[20]=e("label",{class:"form-label"},"- Type",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":i[2]||(i[2]=t=>r.value.type=t)},null,512),[[m,r.value.type]])])])])])]),e("div",Do,[e("a",{class:K(["btn btn-primary",{disabled:!L.value}]),onClick:i[3]||(i[3]=t=>L.value?E():null),"data-bs-toggle":"modal","data-bs-target":"#modal-service"},"GENERATE",2)]),N(Ol,{"yaml-data":V.value,title:$.value},null,8,["yaml-data","title"])]))}}),zo=Q(jo,[["__scopeId","data-v-b9ba3952"]]),Ho={class:"modal",id:"modal-yaml",tabindex:"-1"},Lo={class:"modal-dialog modal-lg",role:"document"},Bo={class:"modal-content"},Ro={class:"modal-header"},No={class:"modal-title"},Fo={class:"modal-body"},Ao={class:"card"},Eo={class:"card-body"},To=B({__name:"yamlModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",Ho,[e("div",Lo,[e("div",Bo,[e("div",Ro,[e("h5",No,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",Fo,[e("div",Ao,[e("div",Eo,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Yo={class:"tab-pane",id:"tabs-hpa"},Oo={class:"card"},Go={class:"card-body"},Io={class:"mb-3"},Ko={class:"mb-3"},Jo={class:"mb-3"},Qo=["onUpdate:modelValue"],Wo=["onUpdate:modelValue"],Xo={class:"btn-list"},Zo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},es=["onClick"],ts={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},ls={class:"card mt-4"},os={class:"card-body"},ss={class:"row",style:{width:"68% !important"}},ns={class:"col"},as={class:"col"},rs={class:"row",style:{width:"68% !important"}},is={class:"col"},ds={class:"row",style:{width:"68% !important"}},us={class:"col"},cs={class:"row",style:{width:"68% !important"}},ms={class:"col"},ps={class:"row",style:{width:"68% !important"}},vs={class:"col"},bs={class:"btn-list justify-content-end mt-4"},hs=B({__name:"hpaForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f({}),p=f({}),M=f(""),V=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""||!p.value.apiVersion||p.value.apiVersion.trim()===""||!p.value.kind||p.value.kind.trim()===""||!p.value.name||p.value.name.trim()===""||!r.value.minReplicas||r.value.minReplicas.trim()===""||!r.value.maxReplicas||r.value.maxReplicas.trim()===""||!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""));G(async()=>{await L()});const L=()=>{$.value="HPA",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value={scaleTargetRef:{},minReplicas:"",maxReplicas:"",targetCPUUtilizationPercentage:""},p.value={apiVersion:"",kind:"",name:""}},R=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter HPA name.");const o=document.querySelector('input[v-model="metadata.name"]');o==null||o.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const o=document.querySelector('input[v-model="metadata.namespace"]');o==null||o.focus();return}if(!p.value.apiVersion||p.value.apiVersion.trim()===""){h.error("Please enter API version.");const o=document.querySelector('input[v-model="scaleTargetRef.apiVersion"]');o==null||o.focus();return}if(!p.value.kind||p.value.kind.trim()===""){h.error("Please enter kind.");const o=document.querySelector('input[v-model="scaleTargetRef.kind"]');o==null||o.focus();return}if(!p.value.name||p.value.name.trim()===""){h.error("Please enter target name.");const o=document.querySelector('input[v-model="scaleTargetRef.name"]');o==null||o.focus();return}if(!r.value.minReplicas||r.value.minReplicas.trim()===""){h.error("Please enter min replicas.");const o=document.querySelector('input[v-model="spec.minReplicas"]');o==null||o.focus();return}if(!r.value.maxReplicas||r.value.maxReplicas.trim()===""){h.error("Please enter max replicas.");const o=document.querySelector('input[v-model="spec.maxReplicas"]');o==null||o.focus();return}if(!r.value.targetCPUUtilizationPercentage||r.value.targetCPUUtilizationPercentage.trim()===""){h.error("Please enter CPU percentage.");const o=document.querySelector('input[v-model="spec.targetCPUUtilizationPercentage"]');o==null||o.focus();return}const H=_.value.reduce((o,U)=>(o[U.key]=U.value,o),{});l.value.labels=H,r.value.scaleTargetRef=p.value,w.value.metadata=l.value,w.value.spec=r.value;const{data:u}=await te(w.value);M.value=u},E=()=>{_.value.push({key:"",value:""})},T=H=>{_.value.length!==1&&_.value.splice(H,1)};return(H,u)=>(n(),a("div",Yo,[e("div",Oo,[u[14]||(u[14]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Go,[e("div",Io,[u[9]||(u[9]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[0]||(u[0]=o=>l.value.name=o),placeholder:"name"},null,512),[[m,l.value.name]])]),e("div",Ko,[u[10]||(u[10]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":u[1]||(u[1]=o=>l.value.namespace=o),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Jo,[u[13]||(u[13]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(o,U)=>(n(),a("div",{class:"generate-form",key:U},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.key=x,placeholder:"key"},null,8,Qo),[[m,o.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":x=>o.value=x,placeholder:"value"},null,8,Wo),[[m,o.value]]),e("div",Xo,[e("button",{class:"btn btn-primary",onClick:E,style:{"text-align":"center !important"}},[(n(),a("svg",Zo,u[11]||(u[11]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:x=>T(U)},[(n(),a("svg",ts,u[12]||(u[12]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,es)])]))),128))])])]),e("div",ls,[u[22]||(u[22]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",os,[u[21]||(u[21]=e("div",{class:"mb-3"},[e("label",{class:"form-label"},"Scale Target")],-1)),e("div",ss,[e("div",ns,[u[15]||(u[15]=e("label",{class:"form-label required"},"- Api Version",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[2]||(u[2]=o=>p.value.apiVersion=o)},null,512),[[m,p.value.apiVersion]])]),e("div",as,[u[16]||(u[16]=e("label",{class:"form-label required"},"- Kind",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[3]||(u[3]=o=>p.value.kind=o)},null,512),[[m,p.value.kind]])])]),e("div",rs,[e("div",is,[u[17]||(u[17]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[4]||(u[4]=o=>p.value.name=o)},null,512),[[m,p.value.name]])])]),e("div",ds,[e("div",us,[u[18]||(u[18]=e("label",{class:"form-label required"},"- Min Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[5]||(u[5]=o=>r.value.minReplicas=o)},null,512),[[m,r.value.minReplicas]])])]),e("div",cs,[e("div",ms,[u[19]||(u[19]=e("label",{class:"form-label required"},"- Max Replicas",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[6]||(u[6]=o=>r.value.maxReplicas=o)},null,512),[[m,r.value.maxReplicas]])])]),e("div",ps,[e("div",vs,[u[20]||(u[20]=e("label",{class:"form-label required"},"- CPU Percentage",-1)),c(e("input",{type:"text",class:"form-control","onUpdate:modelValue":u[7]||(u[7]=o=>r.value.targetCPUUtilizationPercentage=o)},null,512),[[m,r.value.targetCPUUtilizationPercentage]])])])])]),e("div",bs,[e("a",{class:K(["btn btn-primary",{disabled:!V.value}]),onClick:u[8]||(u[8]=o=>V.value?R():null),"data-bs-toggle":"modal","data-bs-target":"#modal-yaml"},"GENERATE",2)]),N(To,{"yaml-data":M.value,title:$.value},null,8,["yaml-data","title"])]))}}),ys=Q(hs,[["__scopeId","data-v-b0620f31"]]),fs={class:"modal",id:"modal-config-map",tabindex:"-1"},gs={class:"modal-dialog modal-lg",role:"document"},_s={class:"modal-content"},ws={class:"modal-header"},ks={class:"modal-title"},$s={class:"modal-body"},xs={class:"card"},Cs={class:"card-body"},Us=B({__name:"configMapModal",props:{title:{},yamlData:{}},setup(P){const h=P,$=A(()=>h.yamlData);I($,async()=>{await l()});const w=f(""),l=async()=>{w.value=h.yamlData};return(_,r)=>(n(),a("div",fs,[e("div",gs,[e("div",_s,[e("div",ws,[e("h5",ks,F(h.title),1),r[0]||(r[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",$s,[e("div",xs,[e("div",Cs,[r[1]||(r[1]=e("h4",null,"YAML",-1)),e("div",null,[e("pre",null,F(w.value),1)])])])])])])]))}}),Ms={class:"tab-pane",id:"tabs-configMap"},Vs={class:"card"},Ps={class:"card-body"},qs={class:"mb-3"},Ss={class:"mb-3"},Ds={class:"mb-3"},js=["onUpdate:modelValue"],zs=["onUpdate:modelValue"],Hs={class:"btn-list"},Ls={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Bs=["onClick"],Rs={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ns={class:"card mt-4"},Fs={class:"card-body"},As={class:"mb-3"},Es=["onUpdate:modelValue"],Ts=["onUpdate:modelValue"],Ys={class:"btn-list"},Os={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",style:{margin:"0 !important"}},Gs=["onClick"],Is={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-minus",style:{margin:"0 !important"}},Ks={class:"btn-list justify-content-end mt-4"},Js=B({__name:"configmapForm",setup(P){const h=O(),$=f(""),w=f({}),l=f({}),_=f([]),r=f([]),p=f(""),M=A(()=>!(!l.value.name||l.value.name.trim()===""||!l.value.namespace||l.value.namespace.trim()===""));G(async()=>{await V()});const V=()=>{$.value="ConfigMap",l.value={name:"",namespace:"",labels:{}},_.value.push({key:"",value:""}),r.value.push({key:"",value:""})},L=async()=>{if(!l.value.name||l.value.name.trim()===""){h.error("Please enter ConfigMap name.");const x=document.querySelector('input[v-model="metadata.name"]');x==null||x.focus();return}if(!l.value.namespace||l.value.namespace.trim()===""){h.error("Please enter namespace.");const x=document.querySelector('input[v-model="metadata.namespace"]');x==null||x.focus();return}const u=_.value.reduce((x,k)=>(x[k.key]=k.value,x),{});l.value.labels=u;const o=r.value.reduce((x,k)=>(x[k.key]=k.value,x),{});w.value.metadata=l.value,w.value.data=o;const{data:U}=await oe(w.value);p.value=U},R=()=>{_.value.push({key:"",value:""})},E=u=>{_.value.length!==1&&_.value.splice(u,1)},T=()=>{r.value.push({key:"",value:""})},H=u=>{r.value.length!==1&&r.value.splice(u,1)};return(u,o)=>(n(),a("div",Ms,[e("div",Vs,[o[8]||(o[8]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Metadata Section")],-1)),e("div",Ps,[e("div",qs,[o[3]||(o[3]=e("label",{class:"form-label required"},"- Name",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[0]||(o[0]=U=>l.value.name=U),placeholder:"configMap-01"},null,512),[[m,l.value.name]])]),e("div",Ss,[o[4]||(o[4]=e("label",{class:"form-label required"},"- Namespace",-1)),c(e("input",{type:"text",class:"form-control w-33",name:"example-text-input","onUpdate:modelValue":o[1]||(o[1]=U=>l.value.namespace=U),placeholder:"namespace"},null,512),[[m,l.value.namespace]])]),e("div",Ds,[o[7]||(o[7]=e("label",{class:"form-label"},"- Labels",-1)),(n(!0),a(D,null,j(_.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,js),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,zs),[[m,U.value]]),e("div",Hs,[e("button",{class:"btn btn-primary",onClick:R,style:{"text-align":"center !important"}},[(n(),a("svg",Ls,o[5]||(o[5]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>E(x)},[(n(),a("svg",Rs,o[6]||(o[6]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Bs)])]))),128))])])]),e("div",Ns,[o[12]||(o[12]=e("div",{class:"card-header"},[e("h3",{class:"card-title"},"Spec Section")],-1)),e("div",Fs,[e("div",As,[o[11]||(o[11]=e("label",{class:"form-label"},"- Data",-1)),(n(!0),a(D,null,j(r.value,(U,x)=>(n(),a("div",{class:"generate-form",key:x},[c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.key=k,placeholder:"key"},null,8,Es),[[m,U.key]]),c(e("input",{type:"text",class:"form-control w-33",name:"example-password-input","onUpdate:modelValue":k=>U.value=k,placeholder:"value"},null,8,Ts),[[m,U.value]]),e("div",Ys,[e("button",{class:"btn btn-primary",onClick:T,style:{"text-align":"center !important"}},[(n(),a("svg",Os,o[9]||(o[9]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M12 5l0 14"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))]),e("button",{class:"btn btn-primary",onClick:k=>H(x)},[(n(),a("svg",Is,o[10]||(o[10]=[e("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e("path",{d:"M5 12l14 0"},null,-1)])))],8,Gs)])]))),128))])])]),e("div",Ks,[e("a",{class:K(["btn btn-primary",{disabled:!M.value}]),onClick:o[2]||(o[2]=U=>M.value?L():null),"data-bs-toggle":"modal","data-bs-target":"#modal-config-map"},"GENERATE",2)]),N(Us,{"yaml-data":p.value,title:$.value},null,8,["yaml-data","title"])]))}}),Qs=Q(Js,[["__scopeId","data-v-e0b005d8"]]),Ws={class:"card w-100",ref:"workflowForm"},Xs={class:"card-body"},Zs={class:"card"},en={class:"card-body"},tn={class:"tab-content"},nn=B({__name:"YamlGenerate",setup(P){return O(),G(async()=>{}),(h,$)=>(n(),a("div",Ws,[$[1]||($[1]=e("div",{class:"card-header"},[e("div",{class:"card-title"},[e("h1",null,"YAML Generator")])],-1)),e("div",Xs,[e("div",Zs,[$[0]||($[0]=X('',1)),e("div",en,[e("div",tn,[N(xt),N(Ll),N(zo),N(ys),N(Qs)])])])])],512))}});export{nn as default}; diff --git a/src/main/resources/static/assets/applicationDetailModal-B5NPsj3q.js b/src/main/resources/static/assets/applicationDetailModal-B5NPsj3q.js new file mode 100644 index 0000000..d2c8b6c --- /dev/null +++ b/src/main/resources/static/assets/applicationDetailModal-B5NPsj3q.js @@ -0,0 +1,11 @@ +import{c as nt}from"./createVueComponent-DOVlSFKE.js";import{d as Pt,f as Dt,r as h,g as y,c as u,a as t,b as Ct,u as Lt,t as a,e as F,n as c,m as A,F as I,k as _,o as i,D as Mt}from"./index-D89BCYsX.js";import{q as Ut,t as at,v as xt,w as wt}from"./softwareCatalog-CAQVjm80.js";import{_ as kt}from"./_plugin-vue_export-helper-DlAUqK2U.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var Gt=nt("outline","package","IconPackage",[["path",{d:"M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5",key:"svg-0"}],["path",{d:"M12 12l8 -4.5",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}],["path",{d:"M12 12l-8 -4.5",key:"svg-3"}],["path",{d:"M16 5.25l-8 4.5",key:"svg-4"}]]);/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var ks=nt("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);const Ot={PREPARING_RUNTIME:"Initializing",PREPARING_METRICS_SERVER:"Initializing",PREPARING_INGRESS_NGINX:"Initializing",DEPLOYING:"Deploying",INSTALL:"Installing",IN_PROGRESS:"In Progress",PENDING:"Pending",START:"Starting",STARTING:"Starting",RESTART:"Restarting",RESTARTING:"Restarting",RUN:"Running",RUNNING:"Running",SUCCESS:"Running",COMPLETED:"Completed",STOP:"Stopped",STOPPED:"Stopped",UNINSTALL:"Uninstalling",UNINSTALLED:"Uninstalled",NOT_FOUND:"Not Found",UNKNOWN:"Unknown",IMAGE_PULL_ERROR:"Image Pull Error",FAILED:"Failed",ERROR:"Error"},$t=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","IN_PROGRESS","INSTALL","START","STARTING","RESTART","RESTARTING"]),Ft=new Set(["RUN","RUNNING","SUCCESS","COMPLETED"]),Bt=new Set(["NOT_FOUND","PENDING","UNKNOWN"]),zt=new Set(["STOP","STOPPED","UNINSTALL","UNINSTALLED"]),Yt=new Set(["FAILED","ERROR","IMAGE_PULL_ERROR"]),Vt=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","IN_PROGRESS","INSTALL","START","STARTING","RESTART","RESTARTING","UNINSTALL","UNINSTALLED","FAILED"]),Ht=new Set(["PREPARING_RUNTIME","PREPARING_METRICS_SERVER","PREPARING_INGRESS_NGINX","DEPLOYING","INSTALL","IN_PROGRESS","PENDING","START","STARTING","RESTART","RESTARTING","RUN","RUNNING","SUCCESS"]),U=g=>String(g||"").trim().toUpperCase(),Kt=g=>{const p=U(g);return p&&(Ot[p]||g)||"-"},Wt=g=>{const p=U(g);return Ft.has(p)?"badge bg-success":$t.has(p)?"badge bg-primary":Bt.has(p)?"badge bg-warning":zt.has(p)?"badge bg-secondary":Yt.has(p)?"badge bg-danger":"badge bg-secondary"},Gs=g=>Vt.has(U(g)),jt=(g,p)=>g===!0?{label:"Healthy",className:"text-success"}:g===!1?{label:"Unhealthy",className:"text-danger"}:Ht.has(U(p))?{label:"Checking",className:"text-warning"}:{label:"Unknown",className:"text-muted"},Xt=["id"],qt={class:"modal-dialog modal-xl modal-dialog-centered",role:"document"},Zt={class:"modal-content"},Jt={class:"modal-body",style:{"max-height":"80vh","overflow-y":"auto"}},Qt={key:0,class:"text-center"},te={key:1},ee={class:"mb-4"},se={class:"row"},le={class:"col-md-2 text-center"},ae=["src","alt"],ne={key:1,class:"application-detail-logo-fallback d-inline-flex align-items-center justify-content-center"},oe={class:"col-md-10"},re={class:"text-muted"},ue={class:"row"},ie={class:"col-md-3"},de={class:"col-md-3"},ce={class:"col-md-3"},me={class:"col-md-3"},ve={class:"mb-4"},ge={key:0,class:"text-muted small mb-2"},pe={class:"row"},be={class:"col-md-3"},Ne={class:"card text-center"},ye={class:"card-body"},Se={class:"card-title"},he={class:"col-md-3"},Ae={class:"card text-center"},Ee={class:"card-body"},Ie={class:"card-title"},_e={class:"col-md-3"},Re={class:"card text-center"},Te={class:"card-body"},fe={class:"card-title"},Pe={class:"col-md-3"},De={class:"card text-center"},Ce={class:"card-body"},Le={class:"card-title"},Me={class:"mb-4"},Ue={class:"d-flex justify-content-between align-items-center mb-2"},xe={class:"text-muted small"},we={class:"btn-list"},ke=["disabled"],Ge={key:0,class:"text-center text-muted py-3"},Oe={key:1,class:"border rounded p-3"},$e={key:0,class:"alert alert-light border text-muted py-2 mb-3"},Fe={class:"d-flex justify-content-between flex-wrap gap-2 mb-3"},Be={class:"badge bg-secondary"},ze={class:"badge bg-info"},Ye={class:"table-responsive mb-3"},Ve={class:"table table-sm mb-0"},He={key:1,class:"row g-2 mb-3"},Ke={class:"col-md-3"},We={class:"col-md-3"},je={class:"col-md-3"},Xe={class:"col-md-3"},qe={class:"mb-3"},Ze={class:"mb-3"},Je={key:2,class:"mb-3"},Qe={class:"policy-evidence-list mb-0"},ts={key:2,class:"text-muted border rounded p-3"},es={class:"mb-4"},ss={class:"table-responsive"},ls={class:"table table-sm"},as={key:0},ns={class:"mb-4"},os={class:"table-responsive"},rs={class:"table table-sm"},us={key:1},is={class:"mb-4"},ds={class:"mb-3"},cs={class:"table-responsive"},ms={class:"table table-sm"},vs={class:"mb-3"},gs={class:"table-responsive"},ps={class:"table table-sm"},bs={class:"mb-3"},Ns={class:"table-responsive"},ys={class:"table table-sm"},Ss={key:0,class:"mb-3"},hs={class:"table-responsive"},As={class:"table table-sm"},Es={key:1,class:"mb-3"},Is={class:"table-responsive"},_s={class:"table table-sm"},Rs={key:0,class:"mb-4"},Ts={class:"table-responsive"},fs={class:"table table-sm"},Ps={key:2,class:"text-center text-muted"},Ds=Pt({__name:"applicationDetailModal",props:{deploymentId:{},modalId:{default:"application-detail-modal"}},emits:["close"],setup(g,{expose:p,emit:ot}){const B=g,rt=ot,T=Dt(),f=h(!1),S=h(!1),l=h(null),m=h(null),E=h([]),d=h(null),P=h(!1),z=[7,30,90],N=h(0);let b=0;const ut={"apache tomcat":"/catalog-icons/apache-tomcat.png",redis:"/catalog-icons/redis.svg",nginx:"/catalog-icons/nginx.svg","apache http server":"/catalog-icons/apache-http-server.svg","nexus repository":"/catalog-icons/nexus-repository.svg",mariadb:"/catalog-icons/mariadb.svg",grafana:"/catalog-icons/grafana.svg",prometheus:"/catalog-icons/prometheus.svg",elasticsearch:"/catalog-icons/elasticsearch.svg"},it=s=>String(s||"").trim().toLowerCase(),dt=s=>ut[it(s)]||"",Y=y(()=>{const s=l.value;return s?Mt(dt(s.catalogName)||s.logoUrlLarge||s.logoUrlSmall||""):""});p({refreshData:s=>{const e=++b;N.value=s,l.value=null,m.value=null,E.value=[],d.value=null,N.value&&(ct(s,e),V(s,e))},resetData:()=>{b+=1,N.value=0,l.value=null,m.value=null,E.value=[],d.value=null,P.value=!1,f.value=!1,S.value=!1,$()}});const ct=async(s,e)=>{if(s){f.value=!0;try{P.value=!1;const{data:o}=await Ut(s);e===b&&s===N.value&&o&&(l.value=o.integratedInfo)}catch(o){if(e!==b)return;console.error("Failed to load application detail:",o),T.error("Failed to load application detail")}finally{e===b&&(f.value=!1)}}},V=async(s,e)=>{if(s){S.value=!0;try{const o=await at(s);if(e!==b||s!==N.value)return;m.value=o.data||null;const r=await Promise.all(z.map(async v=>{try{return(await at(s,v)).data||null}catch{return null}}));if(e!==b||s!==N.value)return;E.value=r.filter(Boolean);const n=await xt(s);if(e!==b||s!==N.value)return;d.value=n.data||null}catch(o){if(e!==b)return;console.error("Failed to load policy recommendation:",o),m.value=null,E.value=[],d.value=null}finally{e===b&&(S.value=!1)}}},R=s=>{if(!s)return null;const e=new Date(String(s).replace(" ","T"));return Number.isNaN(e.getTime())?null:e},mt=s=>{const e=s instanceof Date?s:R(s);if(!e)return"-";const o=r=>String(r).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}:${o(e.getSeconds())}`},x=s=>String(s||"").trim().toUpperCase(),vt=new Set(["RUN","RUNNING","SUCCESS"]),gt=new Set(["UNINSTALL","UNINSTALLED","NOT_FOUND","STOP","STOPPED","FAILED","ERROR"]),w=y(()=>{var s,e,o;return x(((s=l.value)==null?void 0:s.applicationStatus)||((e=l.value)==null?void 0:e.podStatus)||((o=l.value)==null?void 0:o.status))}),H=y(()=>{var s;return jt((s=l.value)==null?void 0:s.healthCheck,w.value)}),pt=y(()=>{var o,r;const s=R((o=l.value)==null?void 0:o.executedAt);return(Array.isArray((r=l.value)==null?void 0:r.operationHistories)?l.value.operationHistories:[]).some(n=>{if(x(n==null?void 0:n.operationType)!=="UNINSTALL")return!1;const v=R((n==null?void 0:n.executedAt)||(n==null?void 0:n.createdAt));return!s||!v?!0:v.getTime()>=s.getTime()})}),D=y(()=>pt.value||gt.has(w.value)?!1:vt.has(w.value)),k=y(()=>D.value),bt=y(()=>{var v;const s=R((v=l.value)==null?void 0:v.executedAt);if(!s)return 0;const e=new Date,o=new Date(s.getFullYear(),s.getMonth(),s.getDate()),n=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-o.getTime();return Math.max(Math.floor(n/(1e3*60*60*24)),0)}),Nt=y(()=>{const s=new Map;return E.value.forEach(e=>{const o=Z(e);typeof o=="number"&&s.set(o,e)}),s}),yt=y(()=>z.map(s=>{const e=Nt.value.get(s)||null,o=bt.value>=s,r=(e==null?void 0:e.dataStatus)||(o?"PENDING_ANALYSIS":"ACCUMULATING");return{period:s,profile:e,eligible:o,dataStatus:r,dimmed:!o||["INSUFFICIENT_DATA","PENDING_ANALYSIS","ACCUMULATING"].includes(r)}})),St=y(()=>{var e,o,r;const s=[(e=d.value)==null?void 0:e.updatedAt,(o=d.value)==null?void 0:o.createdAt,(r=m.value)==null?void 0:r.createdAt,...E.value.map(n=>n==null?void 0:n.createdAt)].map(R).filter(n=>!!n).sort((n,v)=>v.getTime()-n.getTime());return s.length?mt(s[0]):"분석 이력 없음"}),ht=async()=>{if(N.value){if(!k.value){T.info("현재 실행 중인 배포만 정책 추천을 분석할 수 있습니다.");return}S.value=!0;try{await wt(N.value),await V(N.value,b),T.success("Policy recommendation analyzed")}catch(s){console.error("Failed to analyze policy recommendation:",s),T.error("Failed to analyze policy recommendation")}finally{S.value=!1}}},C=s=>Wt(s),L=s=>Kt(s),At=s=>{switch(s==null?void 0:s.toLowerCase()){case"critical":return"badge bg-danger";case"warning":return"badge bg-warning";case"error":return"badge bg-danger";default:return"badge bg-info"}},Et=s=>{switch(s==null?void 0:s.toLowerCase()){case"info":return"badge bg-info";case"warning":return"badge bg-warning";case"error":return"badge bg-danger";case"debug":return"badge bg-secondary";default:return"badge bg-primary"}},It=s=>{switch(s){case"CPU_INTENSIVE":return"badge bg-primary";case"MEMORY_INTENSIVE":return"badge bg-purple";case"CPU_MEMORY_INTENSIVE":return"badge bg-warning";case"GENERAL_PURPOSE":return"badge bg-success";default:return"badge bg-secondary"}},G=s=>{switch(s){case"CPU_INTENSIVE":return"CPU 중심";case"MEMORY_INTENSIVE":return"Memory 중심";case"CPU_MEMORY_INTENSIVE":return"CPU/Memory 복합";case"GENERAL_PURPOSE":return"현행/범용";default:return s||"N/A"}},K=s=>{switch(x(s)){case"UNDER_PROVISIONED":return"용량 부족";case"OVER_PROVISIONED":return"사용률 낮음";case"RIGHT_SIZED":return"적정";default:return s||"N/A"}},W=s=>{switch(s){case"SUFFICIENT":return"badge bg-success";case"PARTIAL_DATA":return"badge bg-warning";case"INSUFFICIENT_DATA":case"ACCUMULATING":case"PENDING_ANALYSIS":return"badge bg-secondary";default:return"badge bg-secondary"}},j=s=>{switch(s){case"SUFFICIENT":return"충분";case"PARTIAL_DATA":return"부분 데이터";case"INSUFFICIENT_DATA":case"ACCUMULATING":return"데이터 축적 중";case"PENDING_ANALYSIS":return"분석 대기";default:return s||"N/A"}},_t=s=>s?s.split(",").map(e=>e.trim()).filter(Boolean):["NO_ACTION"],Rt=s=>{switch(s){case"INCREASE_CPU":return"CPU 정책 검토";case"INCREASE_MEMORY":return"Memory 정책 검토";case"REVIEW_CPU_MEMORY_POLICY":return"CPU/Memory 복합 검토";case"CHANGE_RESOURCE_TYPE":return"운영 유형 검토";case"DOWNSIZE":return"현행/하향 검토";case"INVESTIGATE_STABILITY":return"안정성 점검";case"NO_ACTION":return"현행 유지";default:return s}},X=s=>{if(s==null)return"N/A";const e=Math.round(s*100);return e>=80?`높음 ${e}%`:e>=60?`보통 ${e}%`:e>=40?`낮음 ${e}%`:`판단 보류 ${e}%`},q=s=>{if(!s)return[];try{const e=JSON.parse(s);return Array.isArray(e)?e:[]}catch{return s.split(",").map(e=>e.trim()).filter(Boolean)}},Tt=s=>{const e=s.match(/^validDays=(\d+) is below (\d+)$/);if(e)return`유효 분석일이 ${e[1]}일로 최소 기준 ${e[2]}일에 미달합니다.`;const o=s.match(/^cpuPressureP95=([\d.]+)$/);if(o)return`CPU p95 사용률이 ${o[1]}%입니다.`;const r=s.match(/^memoryPressureP95=([\d.]+)$/);if(r)return`Memory p95 사용률이 ${r[1]}%입니다.`;const n=s.match(/^oomCount=(\d+)$/);if(n)return`OOM 이벤트가 ${n[1]}건 발생했습니다.`;const v=s.match(/^restartCount=(\d+), crashLoopCount=(\d+)$/);if(v)return`재시작 이벤트 ${v[1]}건, CrashLoop 이벤트 ${v[2]}건이 확인되었습니다.`;const M=s.match(/^networkEvidence=maxInBytes=(\d+), maxOutBytes=(\d+)$/);if(M)return`네트워크 최대 수신 ${O(Number(M[1]))}, 최대 송신 ${O(Number(M[2]))}가 확인되었습니다.`;const et=s.match(/^errorLogCount=(\d+)$/);if(et)return`ERROR 로그가 ${et[1]}건 확인되었습니다.`;const st=s.match(/^oomRelatedLogCount=(\d+)$/);if(st)return`OOM 관련 로그가 ${st[1]}건 확인되었습니다.`;const lt=s.match(/^networkOrTimeoutLogCount=(\d+)$/);return lt?`네트워크 또는 timeout 관련 로그가 ${lt[1]}건 확인되었습니다.`:s==="cpuPressureP95 and memoryPressureP95 are below 40"?"CPU와 Memory p95 사용률이 모두 40% 미만입니다.":s==="CPU/Memory pressure is within right-sized range"?"CPU와 Memory 사용률이 적정 범위입니다.":s==="K8s percentage metrics require request/limit normalization; confidence capped at 0.60"?"K8s 백분율 지표는 request/limit 기준 정규화가 필요하여 신뢰도가 60%로 제한됩니다.":s},Z=s=>{if(!(s!=null&&s.analysisStartDate)||!(s!=null&&s.analysisEndDate))return"-";const e=new Date(s.analysisStartDate),o=new Date(s.analysisEndDate);return Math.round((o.getTime()-e.getTime())/(1e3*60*60*24))+1},ft=(s,e)=>{const o=Z(s);if(typeof o=="number")return o;const r=(s==null?void 0:s.validDays)??0,n=(s==null?void 0:s.missingDays)??0;return r+n||e||0},J=(s,e)=>{const o=(s==null?void 0:s.validDays)??0,r=ft(s,e);return r?`${o}일 확보 / ${r}일 기준`:`${o}일 확보`},Q=s=>!D.value||s===null||s===void 0?"-":`${s}%`,tt=s=>D.value?O(s):"-",O=s=>{if(s===0)return"0 Bytes";if(!s)return"N/A";const e=1024,o=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(s)/Math.log(e));return parseFloat((s/Math.pow(e,r)).toFixed(2))+" "+o[r]},$=()=>{const s=document.getElementById(B.modalId);if(s)try{if(window.bootstrap&&window.bootstrap.Modal){const e=window.bootstrap.Modal.getInstance(s);e?e.hide():new window.bootstrap.Modal(s).hide()}else s.style.display="none",s.classList.remove("show"),s.setAttribute("aria-hidden","true"),s.removeAttribute("aria-modal"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(o=>o.remove()),document.body.style.overflow="",document.body.style.paddingRight=""}catch(e){console.error("Error closing modal:",e),s.style.display="none",s.classList.remove("show"),document.body.classList.remove("modal-open"),document.querySelectorAll(".modal-backdrop").forEach(r=>r.remove())}l.value=null,m.value=null,E.value=[],d.value=null,rt("close")};return(s,e)=>{var o,r;return i(),u("div",{class:"modal modal-blur fade",id:B.modalId,tabindex:"-1",role:"dialog","aria-hidden":"true"},[t("div",qt,[t("div",Zt,[t("div",{class:"modal-header"},[e[1]||(e[1]=t("h5",{class:"modal-title"},"Application Detail",-1)),t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:$})]),t("div",Jt,[f.value?(i(),u("div",Qt,e[2]||(e[2]=[t("div",{class:"spinner-border",role:"status"},[t("span",{class:"visually-hidden"},"Loading...")],-1)]))):l.value?(i(),u("div",te,[t("div",ee,[e[7]||(e[7]=t("h6",{class:"text-primary"},"Application Overview",-1)),t("div",se,[t("div",le,[Y.value&&!P.value?(i(),u("img",{key:0,src:Y.value,alt:l.value.catalogName,class:"img-fluid application-detail-logo",onError:e[0]||(e[0]=n=>P.value=!0)},null,40,ae)):(i(),u("div",ne,[Ct(Lt(Gt),{class:"icon",size:"32","stroke-width":"1.75"})]))]),t("div",oe,[t("h5",null,a(l.value.catalogName),1),t("p",re,a(l.value.catalogDescription),1),t("div",ue,[t("div",ie,[e[3]||(e[3]=t("strong",null,"Category:",-1)),F(" "+a(l.value.catalogCategory),1)]),t("div",de,[e[4]||(e[4]=t("strong",null,"Default Port:",-1)),F(" "+a(l.value.defaultPort),1)]),t("div",ce,[e[5]||(e[5]=t("strong",{class:"me-2"},"Status:",-1)),t("span",{class:c(C(l.value.applicationStatus))},a(L(l.value.applicationStatus)),3)]),t("div",me,[e[6]||(e[6]=t("strong",{class:"me-2"},"Health Check:",-1)),t("span",{class:c(H.value.className)},a(H.value.label),3)])])])])]),t("div",ve,[e[12]||(e[12]=t("h6",{class:"text-primary"},"성능 지표",-1)),D.value?A("",!0):(i(),u("div",ge," 현재 실행 중인 상태가 아니므로 최신 성능 지표를 표시하지 않습니다. ")),t("div",pe,[t("div",be,[t("div",Ne,[t("div",ye,[t("h5",Se,a(Q(l.value.cpuUsage)),1),e[8]||(e[8]=t("p",{class:"card-text"},"CPU 사용률",-1))])])]),t("div",he,[t("div",Ae,[t("div",Ee,[t("h5",Ie,a(Q(l.value.memoryUsage)),1),e[9]||(e[9]=t("p",{class:"card-text"},"Memory 사용률",-1))])])]),t("div",_e,[t("div",Re,[t("div",Te,[t("h5",fe,a(tt(l.value.networkIn)),1),e[10]||(e[10]=t("p",{class:"card-text"},"네트워크 수신",-1))])])]),t("div",Pe,[t("div",De,[t("div",Ce,[t("h5",Le,a(tt(l.value.networkOut)),1),e[11]||(e[11]=t("p",{class:"card-text"},"네트워크 송신",-1))])])])])]),t("div",Me,[t("div",Ue,[t("div",null,[e[13]||(e[13]=t("h6",{class:"text-primary mb-0"},"정책 추천",-1)),t("div",xe,"최근 분석 시각: "+a(St.value),1)]),t("div",we,[t("button",{type:"button",class:"btn btn-outline-primary",disabled:S.value||!l.value.deploymentId||!k.value,onClick:ht},a(S.value?"Analyzing...":"Analyze"),9,ke)])]),S.value?(i(),u("div",Ge,e[14]||(e[14]=[t("div",{class:"spinner-border spinner-border-sm me-2",role:"status"},null,-1),F(" 정책 추천 정보를 불러오는 중입니다. ")]))):d.value?(i(),u("div",Oe,[k.value?A("",!0):(i(),u("div",$e," 운영 종료 또는 미확인 상태의 배포는 정책 추천 분석을 실행하지 않습니다. 아래 내용은 마지막으로 저장된 분석 결과입니다. ")),t("div",Fe,[t("div",null,[e[15]||(e[15]=t("div",{class:"text-muted small"},"현재 설정 유형",-1)),t("span",Be,a(G(d.value.selectedResourceType)),1)]),t("div",null,[e[16]||(e[16]=t("div",{class:"text-muted small"},"추천 운영 유형",-1)),t("span",{class:c(It(d.value.recommendedResourceType))},a(G(d.value.recommendedResourceType)),3)]),t("div",null,[e[17]||(e[17]=t("div",{class:"text-muted small"},"정책 차이",-1)),t("span",{class:c(d.value.mismatch?"badge bg-warning":"badge bg-success")},a(d.value.mismatch?"검토 필요":"일치"),3)]),t("div",null,[e[18]||(e[18]=t("div",{class:"text-muted small"},"분석 신뢰도",-1)),t("span",ze,a(X(d.value.confidence)),1)])]),t("div",Ye,[t("table",Ve,[e[19]||(e[19]=t("thead",null,[t("tr",null,[t("th",null,"분석 기간"),t("th",null,"추천 유형"),t("th",null,"데이터 상태"),t("th",null,"신뢰도"),t("th",null,"분석 데이터")])],-1)),t("tbody",null,[(i(!0),u(I,null,_(yt.value,n=>(i(),u("tr",{key:n.period,class:c({"policy-period-muted":n.dimmed})},[t("td",null,a(n.period)+"d",1),t("td",null,a(n.profile?G(n.profile.recommendedResourceType):"-"),1),t("td",null,[t("span",{class:c(W(n.dataStatus))},a(j(n.dataStatus)),3)]),t("td",null,a(n.profile?X(n.profile.confidence):"-"),1),t("td",null,a(J(n.profile,n.period)),1)],2))),128))])])]),m.value?(i(),u("div",He,[t("div",Ke,[e[20]||(e[20]=t("div",{class:"text-muted small"},"데이터 상태",-1)),t("span",{class:c(W(m.value.dataStatus))},a(j(m.value.dataStatus)),3)]),t("div",We,[e[21]||(e[21]=t("div",{class:"text-muted small"},"CPU 상태",-1)),t("span",null,a(K(m.value.cpuSizingStatus)),1)]),t("div",je,[e[22]||(e[22]=t("div",{class:"text-muted small"},"Memory 상태",-1)),t("span",null,a(K(m.value.memorySizingStatus)),1)]),t("div",Xe,[e[23]||(e[23]=t("div",{class:"text-muted small"},"분석 데이터",-1)),t("span",null,a(J(m.value)),1)])])):A("",!0),t("div",qe,[e[24]||(e[24]=t("div",{class:"text-muted small"},"검토 항목",-1)),(i(!0),u(I,null,_(_t(d.value.actions),n=>(i(),u("span",{key:n,class:"badge bg-light text-dark me-1"},a(Rt(n)),1))),128))]),t("p",Ze,a(d.value.message),1),m.value&&q(m.value.reasons).length?(i(),u("div",Je,[e[25]||(e[25]=t("div",{class:"text-muted small"},"분석 근거",-1)),t("ul",Qe,[(i(!0),u(I,null,_(q(m.value.reasons),n=>(i(),u("li",{key:n},a(Tt(n)),1))),128))])])):A("",!0)])):(i(),u("div",ts," 정책 추천 정보가 없습니다. "))]),t("div",es,[e[28]||(e[28]=t("h6",{class:"text-primary"},"Action History",-1)),t("div",ss,[t("table",ls,[e[27]||(e[27]=t("thead",null,[t("tr",null,[t("th",null,"Action"),t("th",null,"Timestamp"),t("th",null,"User"),t("th",null,"Status"),t("th",null,"Description")])],-1)),t("tbody",null,[l.value.operationHistories.length===0?(i(),u("tr",as,e[26]||(e[26]=[t("td",{colspan:"5",class:"text-center text-muted"},"No action history available",-1)]))):A("",!0),(i(!0),u(I,null,_(l.value.operationHistories,n=>(i(),u("tr",{key:n.id},[t("td",null,a(n.operationType),1),t("td",null,a(n.executedAt),1),t("td",null,a(n.executedBy||"system"),1),t("td",null,[t("span",{class:c(C(n.status))},a(L(n.status)),3)]),t("td",null,a(n.detailReason||n.reason),1)]))),128))])])])]),t("div",ns,[e[31]||(e[31]=t("h6",{class:"text-primary"},"Error Logs",-1)),t("div",os,[t("table",rs,[e[30]||(e[30]=t("thead",null,[t("tr",null,[t("th",null,"Timestamp"),t("th",null,"Error Code"),t("th",null,"Severity"),t("th",null,"Module"),t("th",null,"Description")])],-1)),t("tbody",null,[l.value.errorLogs.length>0?(i(!0),u(I,{key:0},_(l.value.errorLogs,n=>(i(),u("tr",{key:n.errorCode},[t("td",null,a(n.loggedAt),1),t("td",null,a(n.errorCode),1),t("td",null,[t("span",{class:c(At(n.severity))},a(n.severity),3)]),t("td",null,a(n.module),1),t("td",null,a(n.logMessage),1)]))),128)):(i(),u("tr",us,e[29]||(e[29]=[t("td",{colspan:"5",class:"text-center text-muted"},"No error logs available",-1)])))])])])]),t("div",is,[e[42]||(e[42]=t("h6",{class:"text-primary"},"Deployment History",-1)),t("div",ds,[e[33]||(e[33]=t("h6",null,"Basic Deployment Information",-1)),t("div",cs,[t("table",ms,[e[32]||(e[32]=t("thead",null,[t("tr",null,[t("th",null,"ID"),t("th",null,"Action Type"),t("th",null,"Executed At"),t("th",null,"Executed By"),t("th",null,"Status")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,a(l.value.deploymentId),1),t("td",null,a(l.value.actionType),1),t("td",null,a(l.value.executedAt),1),t("td",null,a(l.value.executedBy||"system"),1),t("td",null,[t("span",{class:c(C(l.value.status))},a(L(l.value.status)),3)])])])])])]),t("div",vs,[e[35]||(e[35]=t("h6",null,"Cloud & Cluster Information",-1)),t("div",gs,[t("table",ps,[e[34]||(e[34]=t("thead",null,[t("tr",null,[t("th",null,"Cloud Provider"),t("th",null,"Cloud Region"),t("th",null,"Cluster Name"),t("th",null,"Deployment Type"),t("th",null,"MCI ID"),t("th",null,"UID")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,a(l.value.cloudProvider),1),t("td",null,a(l.value.cloudRegion),1),t("td",null,a(l.value.clusterName||"N/A"),1),t("td",null,a(l.value.deploymentType),1),t("td",null,a(l.value.mciId),1),t("td",null,a(l.value.vmId),1)])])])])]),t("div",bs,[e[37]||(e[37]=t("h6",null,"Network & Service Information",-1)),t("div",Ns,[t("table",ys,[e[36]||(e[36]=t("thead",null,[t("tr",null,[t("th",null,"Namespace"),t("th",null,"Pod Status"),t("th",null,"Public IP"),t("th",null,"Service Port"),t("th",null,"VM ID"),t("th",null,"Catalog ID")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,a(l.value.namespace),1),t("td",null,[t("span",{class:c(C(l.value.podStatus||l.value.applicationStatus))},a(L(l.value.podStatus||l.value.applicationStatus)),3)]),t("td",null,a(l.value.publicIp),1),t("td",null,a(l.value.servicePort||l.value.defaultPort),1),t("td",null,a(l.value.vmId),1),t("td",null,a(l.value.catalogName),1)])])])])]),l.value.deploymentType==="K8S"?(i(),u("div",Ss,[e[39]||(e[39]=t("h6",null,"Deployment Options",-1)),t("div",hs,[t("table",As,[e[38]||(e[38]=t("thead",null,[t("tr",null,[t("th",null,"Resource Type"),t("th",null,"HPA"),t("th",null,"Rebalancing"),t("th",null,"Min Replicas"),t("th",null,"Max Replicas"),t("th",null,"CPU Threshold"),t("th",null,"Memory Threshold")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,a(l.value.resourceType||"N/A"),1),t("td",null,[t("span",{class:c(l.value.hpaEnabled?"text-success":"text-muted")},a(l.value.hpaEnabled?"Enabled":"Disabled"),3)]),t("td",null,[t("span",{class:c(l.value.workloadRebalancingEnabled?"text-success":"text-muted")},a(l.value.workloadRebalancingEnabled?"Enabled":"Disabled"),3)]),t("td",null,a(l.value.minReplicas||"N/A"),1),t("td",null,a(l.value.maxReplicas||"N/A"),1),t("td",null,a(l.value.cpuThreshold?`${l.value.cpuThreshold}%`:"N/A"),1),t("td",null,a(l.value.memoryThreshold?`${l.value.memoryThreshold}%`:"N/A"),1)])])])])])):A("",!0),l.value.ingressEnabled?(i(),u("div",Es,[e[41]||(e[41]=t("h6",null,"Ingress Information",-1)),t("div",Is,[t("table",_s,[e[40]||(e[40]=t("thead",null,[t("tr",null,[t("th",null,"Enabled"),t("th",null,"Host"),t("th",null,"Access Port"),t("th",null,"Public IP (Worker / IBM Load Balancer)"),t("th",null,"Path"),t("th",null,"Class"),t("th",null,"TLS Enabled"),t("th",null,"TLS Secret")])],-1)),t("tbody",null,[t("tr",null,[t("td",null,[t("span",{class:c(l.value.ingressEnabled?"text-success":"text-danger")},a(l.value.ingressEnabled?"Yes":"No"),3)]),t("td",null,a(l.value.ingressHost||"N/A"),1),t("td",null,a(((o=l.value.ingressAccessPorts)==null?void 0:o.join(", "))||"-"),1),t("td",null,a(((r=l.value.ingressPublicIps)==null?void 0:r.join(", "))||"-"),1),t("td",null,a(l.value.ingressPath||"N/A"),1),t("td",null,a(l.value.ingressClass||"N/A"),1),t("td",null,[t("span",{class:c(l.value.ingressTlsEnabled?"text-success":"text-danger")},a(l.value.ingressTlsEnabled?"Yes":"No"),3)]),t("td",null,a(l.value.ingressTlsSecret||"N/A"),1)])])])])])):A("",!0)]),l.value.deploymentLogs&&l.value.deploymentLogs.length>0?(i(),u("div",Rs,[e[44]||(e[44]=t("h6",{class:"text-primary"},"Deployment Logs",-1)),t("div",Ts,[t("table",fs,[e[43]||(e[43]=t("thead",null,[t("tr",null,[t("th",null,"Timestamp"),t("th",null,"Type"),t("th",null,"Message")])],-1)),t("tbody",null,[(i(!0),u(I,null,_(l.value.deploymentLogs,n=>(i(),u("tr",{key:n.id},[t("td",null,a(n.loggedAt),1),t("td",null,[t("span",{class:c(["me-4 mt-2",Et(n.logType)])},a(n.logType),3)]),t("td",null,a(n.logMessage),1)]))),128))])])])])):A("",!0)])):(i(),u("div",Ps," No data available "))]),t("div",{class:"modal-footer"},[t("button",{type:"button",class:"btn btn-secondary","data-bs-dismiss":"modal",onClick:$},"Close")])])])],8,Xt)}}}),Os=kt(Ds,[["__scopeId","data-v-076cc661"]]);export{Os as A,Gt as I,ks as a,Wt as b,Kt as g,Gs as i}; diff --git a/src/main/resources/static/assets/applicationDetailModal-BFNmmqoF.css b/src/main/resources/static/assets/applicationDetailModal-BFNmmqoF.css new file mode 100644 index 0000000..6cb84bd --- /dev/null +++ b/src/main/resources/static/assets/applicationDetailModal-BFNmmqoF.css @@ -0,0 +1 @@ +.table th[data-v-076cc661]{font-weight:600;background-color:#f8f9fa}.table-responsive[data-v-076cc661]{border-radius:6px;border:1px solid #dee2e6}.badge[data-v-076cc661]{font-size:.75rem}h6[data-v-076cc661]{color:#495057;font-weight:600;margin-bottom:.75rem}.text-primary[data-v-076cc661]{color:#0d6efd!important}.card[data-v-076cc661]{border:1px solid #dee2e6;border-radius:8px;margin-bottom:1rem}.card-body[data-v-076cc661]{padding:1rem}.card-title[data-v-076cc661]{font-size:1.5rem;font-weight:600;margin-bottom:.5rem}.card-text[data-v-076cc661]{color:#6c757d;font-size:.875rem;margin-bottom:0}.img-fluid[data-v-076cc661]{border-radius:8px}.application-detail-logo[data-v-076cc661],.application-detail-logo-fallback[data-v-076cc661]{width:80px;height:80px}.application-detail-logo[data-v-076cc661]{object-fit:contain}.application-detail-logo-fallback[data-v-076cc661]{border:1px solid #dee2e6;border-radius:8px;color:#6c757d;background-color:#f8f9fa}.row[data-v-076cc661]{margin-bottom:1rem}.col-md-3 strong[data-v-076cc661],.col-md-10 strong[data-v-076cc661]{color:#495057}.policy-evidence-list[data-v-076cc661]{padding-left:1rem;color:#495057;font-size:.8125rem}.policy-period-muted[data-v-076cc661]{color:#6c757d;opacity:.62}.policy-period-muted .badge[data-v-076cc661]{opacity:.82} diff --git a/src/main/resources/static/assets/applicationInstallationForm-CeRjQOiG.js b/src/main/resources/static/assets/applicationInstallationForm-CeRjQOiG.js new file mode 100644 index 0000000..229d502 --- /dev/null +++ b/src/main/resources/static/assets/applicationInstallationForm-CeRjQOiG.js @@ -0,0 +1 @@ +import{d as jl,f as Ul,q as Ol,J as _l,g as y,r as p,x as Dl,h as ie,i as Ll,c as s,a as l,t as d,m as c,n as he,C as Gl,e as de,j as m,y as Kl,F as R,k as _,v as $,z as ut,l as M,A as ce,o}from"./index-D89BCYsX.js";import{M as $l}from"./bootstrap.esm-Ceob_0pG.js";import{_ as Se}from"./lodash-QU4yi6a5.js";import{s as it}from"./request-CuP4O-bn.js";import{m as Bl,y as Hl,z as Fl,A as zl,B as ql,C as Jl,D as Yl,r as Yt,E as Wl,F as Ql,G as Xl,H as Zl,I as ea,J as ta,K as la}from"./softwareCatalog-CAQVjm80.js";import{_ as aa}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Wt=["targetType","requestId","mciId","vmId","nodeGroupId","clusterId"],sa=["namespace","namespaceId"],Qt=200,oa=/[/?#]/,na=v=>oa.test(v)||Array.from(v).some(E=>{const f=E.charCodeAt(0);return f<=31||f===127}),ra=(v,E)=>{const f=v.getAll(E);return f.length>1?{ok:!1,error:`Query parameter "${E}" must be provided only once.`}:{ok:!0,value:String(f[0]||"").trim()}},Re=(v,E,f=!1)=>E?E.length>Qt?`${v} must be ${Qt} characters or fewer.`:na(E)?`${v} contains unsupported path characters.`:"":f?`${v} is required.`:"",$n=(v,E=()=>`am-install-${Date.now()}`)=>{const f=typeof v=="string"?new URLSearchParams(v.startsWith("?")?v.slice(1):v):v;for(const r of sa)if(f.has(r))return{ok:!1,error:`${r} must not be supplied in the URL. Namespace comes from the selected Project context.`};for(const r of f.keys())if(!Wt.includes(r))return{ok:!1,error:`Unsupported query parameter "${r}".`};const k={};for(const r of Wt){const P=ra(f,r);if(!P.ok)return P;k[r]=P.value}const A=k.targetType.toUpperCase();if(A!=="VM"&&A!=="K8S")return{ok:!1,error:"targetType must be VM or K8S."};const b=k.requestId||E(),z=[Re("requestId",b,!0),Re("mciId",k.mciId),Re("vmId",k.vmId),Re("nodeGroupId",k.nodeGroupId),Re("clusterId",k.clusterId)].filter(Boolean);if(z.length>0)return{ok:!1,error:z[0]};if(A==="VM"){const r=[Re("mciId",k.mciId,!0)].filter(Boolean);if(r.length>0)return{ok:!1,error:r[0]};if(!k.vmId&&!k.nodeGroupId)return{ok:!1,error:"vmId or nodeGroupId is required."};if(k.clusterId)return{ok:!1,error:"clusterId cannot be used with a VM target."}}if(A==="K8S"){const r=Re("clusterId",k.clusterId,!0);if(r)return{ok:!1,error:r};if(k.mciId||k.vmId)return{ok:!1,error:"mciId and vmId cannot be used with a K8S target."};if(k.nodeGroupId)return{ok:!1,error:"nodeGroupId cannot be used with a K8S target."}}return{ok:!0,target:{requestId:b,targetType:A,mciId:k.mciId,vmId:k.vmId,nodeGroupId:k.nodeGroupId,clusterId:k.clusterId}}},Xt=v=>String((v==null?void 0:v.id)||(v==null?void 0:v.name)||"").trim(),ua=(v,E)=>{const f=String(E||"").trim().toLowerCase();return[v==null?void 0:v.id,v==null?void 0:v.name].map(k=>String(k||"").trim().toLowerCase()).filter(Boolean).includes(f)},ia=(v,E)=>{const f=Array.isArray(v)?v:[],k=String((E==null?void 0:E.vmId)||"").trim(),A=String((E==null?void 0:E.nodeGroupId)||"").trim();if(k){const r=f.find(P=>ua(P,k));return r?A&&String(r.subGroupId||"").trim()!==A?{ok:!1,error:`VM "${k}" does not belong to NodeGroup "${A}".`}:{ok:!0,mode:"VM",vm:r,vmId:Xt(r),nodeGroupId:A}:{ok:!1,error:`VM "${k}" was not found.`}}const b=f.filter(r=>String((r==null?void 0:r.subGroupId)||"").trim()===A);if(b.length===0)return{ok:!1,error:`NodeGroup "${A}" was not found.`};const z=Array.from(new Set(b.filter(r=>String((r==null?void 0:r.status)||"").trim().toUpperCase()==="RUNNING").map(Xt).filter(Boolean)));return z.length===0?{ok:!1,error:`NodeGroup "${A}" has no running VMs.`}:{ok:!0,mode:"NODE_GROUP",members:b,runningVmIds:z,nodeGroupId:A}},da=()=>it.get("/cbtumblebug/ns"),ca=v=>it.get(`/cbtumblebug/ns/${v}/infra`),va=v=>it.get(`/cbtumblebug/ns/${v.nsId}/infra/${v.mciId}`),pa=v=>it.get(`/cbtumblebug/ns/${v}/k8scluster`);function ma(v){var A,b;const f=(b=String(((A=v==null?void 0:v.packageInfo)==null?void 0:A.packageName)||"").trim().toLowerCase().split("/").pop())==null?void 0:b.split(/[:@]/)[0];if(f!=="redis"&&f!=="elasticsearch")return!1;const k=String((v==null?void 0:v.name)||"").trim().toLowerCase();return new RegExp(`(^|[^a-z0-9])${f}([^a-z0-9]|$)`).test(k)&&!(f==="redis"&&k.includes("elasticsearch"))}async function fa(v,E,f,k,A,b=()=>new Promise(r=>setTimeout(r,3e3)),z=3e3){let r=v;const P=v==null?void 0:v.id;for(let V=0;V<=z;V++){if(!A())throw new Error("The form or Project changed. Preparation may continue, but no application will be deployed from this request.");if(!P||(r==null?void 0:r.id)!==P||r.namespace!==E.namespace||r.clusterName!==E.clusterName)throw new Error("Ingress preparation returned a different target. Deployment stopped.");if(k(r.message||"Preparing IBM Ingress and HTTPS…"),r.state==="READY")return;if(r.state==="FAILED")throw new Error(r.message||"Ingress preparation failed.");if(!["QUEUED","RUNNING"].includes(r.state))throw new Error("Unknown Ingress preparation state.");if(V===z)break;if(await b(),!A())throw new Error("The form or Project changed. Check the existing preparation before retrying Deploy.");r=await f(P)}throw new Error("Ingress preparation is taking longer than expected. Check cluster status before retrying; no application was deployed.")}const ba=["id","tabindex"],ga={class:"modal-content"},ya={class:"modal-header"},ka={class:"modal-title"},Ia={key:0,class:"alert alert-success mb-0",role:"status"},ha={key:1,class:"alert alert-warning",role:"status"},Sa=["disabled"],Ca=["disabled"],wa={key:0,class:"alert alert-info py-2",role:"status"},Ea={key:1,class:"alert alert-warning py-2",role:"alert"},Va={key:2,class:"alert alert-secondary py-2",role:"status"},Na={class:"mb-3"},Aa={key:0,class:"text-muted"},Ta={key:1,class:"text-muted"},Ra=["disabled"],Ma=["value"],Pa={class:"mb-3"},xa={key:0,class:"text-muted"},ja={key:1,class:"text-muted"},Ua=["disabled"],Oa=["value"],_a={key:3,class:"form-select",id:"vm-namespace-empty",disabled:""},Da={class:"mb-3"},La={key:0,class:"text-muted"},Ga={key:1,class:"text-muted"},Ka=["disabled"],$a={key:0,value:""},Ba=["value","title"],Ha={key:0,class:"mb-3"},Fa={class:"d-flex gap-3"},za={class:"form-check"},qa={class:"form-check"},Ja={key:1,class:"mb-3"},Ya=["disabled"],Wa=["value"],Qa={key:0,class:"mt-2",style:{display:"flex",gap:"10px","flex-wrap":"wrap"}},Xa=["onClick"],Za={key:2,class:"mb-3"},es=["disabled"],ts=["value","disabled"],ls={key:0,class:"mt-2"},as={class:"d-flex gap-2 flex-wrap"},ss={key:1,class:"text-warning mt-2"},os={key:3,class:"mb-3"},ns={style:{display:"flex",gap:"10px"}},rs={class:"form-check"},us=["disabled"],is={key:0,class:"form-check"},ds=["disabled"],cs={key:0,class:"form-text"},vs={key:4,class:"mb-3"},ps={class:"mb-3"},ms=["value"],fs={class:"mb-3"},bs={key:5,class:"mb-3"},gs={key:0,class:"mt-2"},ys={key:6,class:"mb-3"},ks={key:7,class:"mb-3"},Is={class:"form-check mb-2"},hs=["disabled"],Ss={key:0},Cs={class:"d-flex align-items-center justify-content-between mb-2"},ws=["disabled"],Es={key:0,class:"text-muted"},Vs={key:1,class:"alert alert-danger py-2"},Ns={key:2,class:"alert alert-warning py-2"},As={key:3,class:"border rounded p-2"},Ts=["id","value","disabled"],Rs=["for"],Ms={class:"text-muted"},Ps={class:"d-flex justify-content-between mt-2"},xs={class:"w-50 me-2"},js={class:"w-50 ms-2"},Us={class:"mt-2"},Os={class:"text-muted mt-1 mb-0"},_s={class:"mb-0 ps-3"},Ds={class:"mb-3"},Ls={key:0,class:"text-muted"},Gs={key:1,class:"text-muted"},Ks=["disabled"],$s=["value"],Bs={key:3,class:"form-select",id:"k8s-namespace-empty",disabled:""},Hs={class:"mb-3"},Fs={key:0,class:"text-muted"},zs={key:1,class:"text-muted"},qs=["disabled"],Js={key:0,value:""},Ys=["value"],Ws={class:"mb-3"},Qs=["value"],Xs={key:0,class:"mb-3"},Zs=["disabled"],eo={key:1,class:"mb-3"},to={key:2,class:"mb-3"},lo=["disabled"],ao={value:"",disabled:""},so=["value"],oo={key:0,class:"text-danger mt-1 mb-0"},no=["disabled"],ro={key:1,class:"text-danger mt-2",role:"alert"},uo={key:2,class:"border rounded p-2 mt-2"},io={role:"status",class:"mb-2"},co={class:"mb-2"},vo={key:1,class:"text-muted mt-1 mb-0"},po={key:0},mo=["disabled"],fo=["disabled"],bo=["disabled"],go={key:3,class:"mt-2"},yo=["min"],ko={class:"text-muted"},Io={key:3,class:"mb-3"},ho={key:0,class:"form-check mt-2"},So={key:1,class:"text-muted mt-1"},Co={key:2,class:"text-muted mt-1"},wo={key:4,class:"mb-3"},Eo={class:"mb-2"},Vo={class:"form-check"},No={key:0,class:"d-flex justify-content-between"},Ao={key:5,class:"mb-3"},To={class:"mb-2"},Ro={class:"form-check"},Mo={key:6,class:"mb-3"},Po={class:"mb-2"},xo={class:"form-check"},jo={key:0},Uo={class:"mb-2"},Oo={key:0,class:"text-muted mb-1"},_o={class:"mb-2"},Do={class:"mb-2"},Lo=["value"],Go={key:7,class:"mb-3"},Ko={class:"form-check mb-2"},$o=["disabled"],Bo={key:0},Ho={class:"d-flex align-items-center justify-content-between mb-2"},Fo=["disabled"],zo={key:0,class:"text-muted"},qo={key:1,class:"alert alert-danger py-2"},Jo={key:2,class:"alert alert-warning py-2"},Yo={key:3,class:"border rounded p-2"},Wo=["id","value","disabled"],Qo=["for"],Xo={class:"text-muted"},Zo={class:"d-flex justify-content-between mt-2"},en={class:"w-50 me-2"},tn={class:"w-50 ms-2"},ln={class:"mt-2"},an={class:"mb-0 ps-3"},sn={key:8,class:"mb-3"},on={class:"mb-2"},nn={class:"form-check"},rn=["disabled"],un={key:0},dn={class:"d-flex justify-content-between"},cn={class:"w-50 me-2"},vn=["value"],pn={class:"mt-2 mb-2"},mn=["placeholder"],fn={class:"d-flex justify-content-between"},bn={class:"w-50 me-2"},gn=["placeholder"],yn={class:"w-50 ms-2"},kn={class:"d-flex justify-content-between mt-2"},In={class:"w-50 me-2"},hn={class:"w-50 ms-2"},Sn={class:"d-flex gap-4 mt-3"},Cn={class:"form-check"},wn={class:"mb-0 ps-3"},En={key:0,class:"px-3",role:"status"},Vn={key:1,class:"px-3","aria-live":"polite"},Nn={class:"modal-footer d-flex justify-content-between"},An=["data-bs-dismiss"],Tn={key:1},Rn=["disabled"],Mn=["disabled"],Pn=["disabled"],xn="object-storage",jn="storage-class",Un=jl({__name:"applicationInstallationForm",props:{nsId:{default:""},title:{default:"Application Installation"},embedded:{type:Boolean,default:!1},formId:{default:"install-form"},targetType:{default:""},targetMciId:{default:""},targetVmId:{default:""},targetNodeGroupId:{default:""},targetClusterId:{default:""}},emits:["ready","deployment-event","cancel"],setup(v,{emit:E}){const f=Ul(),k=Ol(),A=_l(),b=v,z=E,r=y(()=>b.title),P=y(()=>String(b.targetType||"").toUpperCase()),V=y(()=>b.embedded&&["VM","K8S"].includes(P.value)),xt=y(()=>V.value&&P.value==="VM"&&!!String(b.targetNodeGroupId||"").trim()&&!String(b.targetVmId||"").trim()),Zt=y(()=>{if(P.value!=="VM")return`Kubernetes cluster ${b.targetClusterId}`;if(xt.value)return`NodeGroup ${b.targetNodeGroupId} in ${b.targetMciId}`;const a=String(b.targetNodeGroupId||"").trim();return a?`VM ${b.targetVmId} in NodeGroup ${a} / ${b.targetMciId}`:`VM ${b.targetVmId} in ${b.targetMciId}`}),dt=a=>(Array.isArray(a)?a:[a]).flatMap(n=>typeof n=="string"?n.split(","):[n]).map(n=>String((n==null?void 0:n.id)||(n==null?void 0:n.name)||n||"").trim()).filter(Boolean),Ce=(...a)=>{for(const e of a){const n=dt(e);if(n.length>0)return n[0]}return""},K=y(()=>k.projectInfo||{}),Je=y(()=>k.workspaceInfo||{}),Me=y(()=>Ce(K.value.ns_id,K.value.nsId)),Ye=y(()=>dt(K.value.mci_ids??K.value.mciIds??K.value.mci_id??K.value.mciId)),We=y(()=>dt(K.value.cluster_ids??K.value.clusterIds??K.value.cluster_id??K.value.clusterId)),ct=y(()=>!!Ce(K.value.id,K.value.name,Me.value)),jt=y(()=>ct.value&&!!Me.value),Ut=y(()=>{const a=Ce(Je.value.name,Je.value.id),e=Ce(K.value.name,K.value.id);return[a,e].filter(Boolean).join(" / ")||"the selected project"}),Qe=y(()=>JSON.stringify([Ce(Je.value.id,Je.value.name),Ce(K.value.id,K.value.name),Me.value,Ye.value,We.value])),vt=p([]),we=p([]),be=p([]),q=p([]),J=p([]),Pe=p([]),g=p(""),I=p(""),D=p(""),B=p(""),w=p([]),U=p("VM"),L=p(""),x=p("Standalone"),N=p({}),Le=p(!1),C=p({}),u=p({}),j=p(null),Ge=p(!1),ve=p([]),Ee=p(!1),xe=p(!1),Ke=p(null),pt=p(!1),el=async()=>{const a=Ke.value;if(!(!a||!confirm("Check Apps Status and confirm that no installation is still running before closing this interrupted tracking record. This does not cancel or uninstall an application. Continue?"))){pt.value=!0;try{await zl(a.id,a.namespace),Ke.value=null,f.warning("Interrupted tracking closed. The application itself was not changed.")}catch{f.error("Could not close interrupted tracking. Reload its status before retrying.")}finally{pt.value=!1}}},pe=p(!1),Z=p(!1);let $e=0,Ot=!0;const _t=()=>{$e++};Dl(()=>{var a;Ot=!1,(a=document.getElementById(b.formId))==null||a.removeEventListener("hide.bs.modal",_t)});const Ve=p("GENERAL_PURPOSE"),ee=p([]),X=p(""),ge=p(!1),ye=p(!1),Xe=p(""),Y=p(null),ke=p(""),me=p(!1),Ze=p("mcmp-nhn-notebooks"),mt=p("General HDD"),te=p(10);let le=0;const ft=a=>{var e,n;return String(((n=(e=a==null?void 0:a.response)==null?void 0:e.data)==null?void 0:n.detail)||(a==null?void 0:a.message)||"Storage API request failed. Check cluster connectivity and permissions.")},Be=y(()=>{var a;return Number(((a=ee.value.find(e=>e.name===X.value))==null?void 0:a.minimumSizeGi)||1)});ie(X,()=>{te.value=Math.max(te.value,Be.value)}),ie(te,()=>{oe()});const fe=p([]),T=p(""),ne=p(""),ae=p(""),Ne=p("PRIVATE"),H=p(""),bt=p(!0),se=p(!0),Ae=p(!1),je=p([]),He=p([]);let Ie=0;const W=p(0),S=p("");let G=0;const Ue=a=>(a==null?void 0:a.id)||(a==null?void 0:a.name)||"",Dt=a=>(a==null?void 0:a.id)||(a==null?void 0:a.name)||"",Fe=a=>(a==null?void 0:a.id)||(a==null?void 0:a.name)||"",et=a=>(a==null?void 0:a.name)||(a==null?void 0:a.id)||"",tl=a=>String((a==null?void 0:a.status)||"").trim().toUpperCase()==="RUNNING",gt=y(()=>{const a=new Map;for(const e of J.value){const n=String((e==null?void 0:e.subGroupId)||"").trim();if(!n)continue;const i=a.get(n)||{id:n,totalVmCount:0,runningVmIds:[]};i.totalVmCount+=1;const t=Fe(e);tl(e)&&t&&!i.runningVmIds.includes(t)&&i.runningVmIds.push(t),a.set(n,i)}return Array.from(a.values()).sort((e,n)=>e.id.localeCompare(n.id))}),yt=y(()=>{var a;return((a=gt.value.find(e=>e.id===L.value))==null?void 0:a.runningVmIds)||[]}),Oe=(a,e)=>{if(e.length===0)return!0;const n=[a==null?void 0:a.id,a==null?void 0:a.name,a==null?void 0:a.uid].map(t=>String(t||"").trim().toLowerCase()).filter(Boolean),i=e.map(t=>t.toLowerCase());return n.some(t=>i.includes(t))},Lt=()=>{we.value=[],be.value=[],q.value=[],J.value=[],fe.value=[],ve.value=[],xe.value=!1,I.value="",D.value="",B.value="",w.value=[],L.value="",T.value="",S.value=""};ie([g,I,T,D,w,U,L,W,X,C,H,Qe,r],()=>{oe()},{deep:!0,flush:"sync"}),ie(g,async a=>{Se.isEmpty(I.value)||(a==="VM"?(U.value="VM",D.value="",B.value="",w.value=[],L.value="",q.value=[],J.value=[],await kt()):a==="K8S"&&(T.value="",await ht()),ne.value="",oe())}),ie(u,()=>{j.value=null},{deep:!0}),ie(X,()=>{oe()}),ie(Qe,async(a,e)=>{if(a===e)return;G+=1,Lt(),ne.value="",W.value=0,Kt();const n=document.getElementById(b.formId);(b.embedded||n!=null&&n.classList.contains("show"))&&await tt()}),ie(x,()=>{if(U.value==="NODE_GROUP"){x.value="Standalone";return}x.value==="Standalone"?(w.value=[],q.value=[...J.value]):x.value==="Clustering"&&(w.value=[],q.value=[...J.value])}),ie(U,a=>{B.value="",w.value=[],L.value=a==="NODE_GROUP"&&xt.value?String(b.targetNodeGroupId||"").trim():"",q.value=[...J.value],a==="NODE_GROUP"&&(x.value="Standalone"),oe()}),Ll(async()=>{var e;if((e=document.getElementById(b.formId))==null||e.addEventListener("hide.bs.modal",_t),b.embedded){try{if(await tt(),S.value){z("deployment-event",{status:"FORM_ERROR",message:S.value});return}await Gt(),z("ready",{targetType:P.value,namespace:I.value})}catch{S.value=S.value||"The software catalog could not be loaded.",z("deployment-event",{status:"FORM_ERROR",message:"The installation form could not be initialized."})}return}const a=document.getElementById(b.formId);a&&a.addEventListener("show.bs.modal",async()=>{await tt(),await Gt()})});const tt=async()=>{$e++,Z.value=!1,Ke.value=null,le++;const a=++G;Lt(),g.value=V.value?P.value:"VM",U.value="VM",L.value="",x.value="Standalone",N.value={hpaEnabled:!1,hpaMinReplicas:1,hpaMaxReplicas:10,hpaCpuUtilization:60,hpaMemoryUtilization:80},Le.value=!1,C.value={ingressEnabled:!1,ingressHost:"",ingressPath:"/",ingressClass:"nginx",ingressTlsEnabled:!1,ingressTlsSecret:""},u.value=nt(),j.value=null,Ge.value=!1,ve.value=[],Ee.value=!1,xe.value=!1,ee.value=[],X.value="",ge.value=!1,ye.value=!1,Xe.value="",Y.value=null,ke.value="",me.value=!1,te.value=10,Ve.value="GENERAL_PURPOSE",ae.value="",Ne.value="PRIVATE",H.value="",ne.value="",W.value=0,al(),Kt(),await sl(a)},ll=a=>{let e=(a||"").trim();if(!e)return e;e=e.replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"");const n=e.lastIndexOf("@");n>=0&&(e=e.slice(n+1));const i=e.search(/[/?#]/);i>=0&&(e=e.slice(0,i));const t=e.indexOf(":");return t>=0&&e.indexOf(":",t+1)<0&&(e=e.slice(0,t)),e.trim().toLowerCase()},Gt=async()=>{await Bl("").then(({data:a})=>{Pe.value=a})},al=()=>{if(V.value){vt.value=[{key:P.value,value:P.value}];return}vt.value=[{key:"VM",value:"VM"},{key:"k8s",value:"K8S"}]},Kt=()=>{r.value==="Application Uninstallation"?se.value=!1:se.value=!0},sl=async(a=G)=>{try{const{data:e}=await da();if(a!==G)return;const n=Array.isArray(e)?e:[];if(ct.value){if(Se.isEmpty(Me.value)){S.value=`Project "${Ut.value}" has no namespace mapping.`;return}const i=n.find(t=>Oe(t,[Me.value]));if(!i){S.value=`Namespace "${Me.value}" assigned to this project was not found.`;return}we.value=[i],I.value=Ue(i)}else{we.value=n;const i=Ce(b.nsId),h=(i?n.find(F=>Oe(F,[i])):void 0)||n[0];I.value=h?Ue(h):""}Se.isEmpty(I.value)||(g.value==="VM"?await kt(a):g.value==="K8S"&&await ht(a))}catch{if(a!==G)return;S.value="Namespaces could not be loaded for the selected project."}},kt=async(a=G)=>{S.value="";try{const{data:e}=await ca(I.value);if(a!==G)return;const i=(Array.isArray(e)?e:[]).filter(t=>Oe(t,Ye.value));if(V.value&&P.value==="VM"){const t=i.find(h=>Oe(h,[b.targetMciId]));if(!t){be.value=[],D.value="",S.value=`Infra "${b.targetMciId}" was not found in the selected project namespace.`;return}be.value=[t],D.value=Dt(t),await It(a);return}be.value=i,be.value.length>0?(D.value=Dt(be.value[0]),await It(a)):(D.value="",S.value=Ye.value.length>0?`Infra "${Ye.value.join(", ")}" assigned to this project was not found.`:"No VM infrastructure is available in this project.")}catch{if(a!==G)return;S.value="VM infrastructure could not be loaded for the selected project."}},It=async(a=G)=>{const e={nsId:I.value,mciId:D.value};try{const{data:n}=await va(e);if(a!==G)return;const i=Array.isArray(n==null?void 0:n.node)?n.node:[];if(V.value&&P.value==="VM"){const t=ia(i,{vmId:b.targetVmId,nodeGroupId:b.targetNodeGroupId});if(!t.ok){J.value=[],q.value=[],B.value="",w.value=[],L.value="",S.value=`${t.error} Infra: "${b.targetMciId}".`;return}if(t.mode==="NODE_GROUP"){J.value=t.members,q.value=[...t.members],U.value="NODE_GROUP",L.value=t.nodeGroupId,x.value="Standalone",B.value="",w.value=[];return}J.value=[t.vm],q.value=[t.vm],U.value="VM",B.value=t.vmId,w.value=[t.vmId];return}J.value=i,q.value=J.value.filter(t=>!w.value.includes(t.id)),B.value="",gt.value.some(t=>t.id===L.value)||(L.value=""),q.value.length===0&&(S.value="No VM is available in the infrastructure assigned to this project.")}catch{if(a!==G)return;S.value="VMs could not be loaded for the selected project."}},ht=async(a=G)=>{S.value="";try{const{data:e}=await pa(I.value);if(a!==G)return;const i=(Array.isArray(e)?e:[]).filter(t=>Oe(t,We.value));if(V.value&&P.value==="K8S"){const t=i.find(h=>Oe(h,[b.targetClusterId]));if(!t){fe.value=[],T.value="",S.value=`Cluster "${b.targetClusterId}" was not found in the selected project namespace.`;return}fe.value=[t],T.value=et(t)}else fe.value=i,fe.value.length>0?T.value=et(fe.value[0]):(T.value="",S.value=We.value.length>0?`Cluster "${We.value.join(", ")}" assigned to this project was not found.`:"No Kubernetes cluster is available in this project.");g.value==="K8S"&&O.value&&(C.value.ingressEnabled=!0,N.value.hpaEnabled=!1,N.value.hpaMinReplicas=1),u.value=nt(),j.value=null,await ze()}catch{if(a!==G)return;S.value="Kubernetes clusters could not be loaded for the selected project."}},lt=async()=>{if(ve.value=[],xe.value=!1,!(!["VM","K8S"].includes(g.value)||!O.value||Se.isEmpty(I.value))){Ee.value=!0;try{const{data:a}=await ql(I.value);ve.value=Array.isArray(a)?a:[];const e=ve.value.filter(n=>String(n.status||"").toLowerCase()==="available").map(n=>n.id);u.value.selectedStorageIds=(u.value.selectedStorageIds||[]).filter(n=>e.includes(n)),u.value.selectedStorageIds.length===0&&e.length===1&&(u.value.selectedStorageIds=[e[0]])}catch{xe.value=!0}finally{Ee.value=!1}}},ze=async(a="")=>{const e=++le;if(ee.value=[],X.value="",ye.value=!1,Xe.value="",Y.value=null,ke.value="",ge.value=!1,g.value!=="K8S"||!Vt.value||!I.value||!T.value)return;const n={namespace:I.value,clusterName:T.value};ge.value=!0;try{const{data:i}=await Hl(n);if(e!==le)return;if(!Array.isArray(i))throw new Error("Invalid StorageClass API response. Retry the lookup.");ee.value=[...i].sort((t,h)=>Number(at(h))-Number(at(t))),X.value=i.some(t=>t.name===a)?a:nl(i),!a&&_e.value==="alibaba"&&(te.value=Math.max(te.value,20))}catch(i){if(e!==le)return;ye.value=!0,Xe.value=ft(i)}finally{e===le&&(ge.value=!1)}if(!(e!==le||ye.value||ee.value.length||!Bt.value))try{const{data:i}=await Fl(n);e===le&&(Y.value=i)}catch(i){e===le&&(ke.value=ft(i))}},ol=async()=>{var n;if(me.value||!((n=Y.value)!=null&&n.canCreate))return;const a=le,e={namespace:I.value,clusterName:T.value};me.value=!0,ke.value="";try{const{data:i}=await Jl(e,{name:Ze.value,diskType:mt.value});a===le&&await ze(i.name)}catch(i){a===le&&(ke.value=ft(i))}finally{me.value=!1}},at=a=>_e.value==="alibaba"&&a.name==="alicloud-disk-topology-alltype"&&a.provisioner==="diskplugin.csi.alibabacloud.com",nl=a=>{var i;const e=a.find(at),n=a.find(t=>t.defaultClass);return(e==null?void 0:e.name)||(n==null?void 0:n.name)||((i=a[0])==null?void 0:i.name)||""},rl=async()=>{w.value=[],await kt(G),await lt(),oe()},ul=async()=>{w.value=[],L.value="",S.value="",await It(G),oe()},il=async()=>{await ht(G),oe()},oe=()=>{Ie+=1,je.value=[],He.value=[],r.value==="Application Installation"?se.value=!0:r.value==="Application Uninstallation"&&(se.value=!1)},dl=()=>{if(B.value!==""){if(x.value==="Standalone")w.value=[B.value];else if(x.value==="Clustering"&&!w.value.includes(B.value)){w.value.push(B.value);const a=q.value.findIndex(e=>e.id===B.value);a!==-1&&q.value.splice(a,1)}B.value="",oe()}},cl=()=>{w.value=[],x.value="Standalone",oe()},vl=a=>{if(V.value)return;const e=w.value[a];if(w.value.splice(a,1),x.value==="Clustering"){const n=J.value.find(i=>i.id===e);n&&q.value.push(n)}oe()},$t=async()=>{$e++,z("cancel"),!pe.value&&(Z.value||await tt())},pl=async()=>{const a=document.getElementById(b.formId),e=a&&!b.embedded?$l.getInstance(a):null;e&&(a!=null&&a.classList.contains("show"))&&await new Promise(n=>{a.addEventListener("hidden.bs.modal",()=>n(),{once:!0}),e.hide()}),await A.push({name:"applicationStatus"})},ml=()=>g.value==="VM"?U.value==="NODE_GROUP"?{targetType:"VM",namespace:I.value,mciId:D.value,nodeGroupId:L.value}:{targetType:"VM",namespace:I.value,mciId:D.value,vmId:w.value[0]||"",...V.value&&b.targetNodeGroupId?{nodeGroupId:b.targetNodeGroupId}:{}}:{targetType:"K8S",namespace:I.value,clusterId:T.value},qe=(a,e={})=>{z("deployment-event",{status:a,target:ml(),...e})},fl=a=>{if(!(!a||typeof a!="object"))return a.deploymentId||a.applicationId||a.id||void 0},bl=async()=>{if(pe.value||Z.value)return;if(Et.value){f.error("Jupyter installation is unavailable for KT because AM does not support KT Object Storage integration.");return}if(r.value==="Application Installation"&&g.value==="VM"&&x.value==="Clustering"&&!Ct.value){f.error("Clustering is available only for Redis and Elasticsearch on individually selected VMs");return}if(r.value==="Application Installation"&&(se.value||Ae.value)){f.error("Please complete Spec Check for the current settings before deploying");return}if(S.value){f.error(S.value);return}if(g.value!=="VM"&&g.value!=="K8S"){f.error("Please Select Infra");return}if(g.value==="VM"&&r.value==="Application Installation"&&Ne.value==="RESTRICTED"&&(!H.value||H.value==="0.0.0.0/0")){f.error("Enter a restricted IPv4 CIDR such as 203.0.113.10/32");return}if(g.value==="K8S"&&r.value==="Application Installation"&&C.value.ingressEnabled&&(!H.value||H.value==="0.0.0.0/0")){f.error("Enter a restricted IPv4 CIDR for external access");return}if(g.value==="K8S"&&O.value){if(!C.value.ingressEnabled||!C.value.ingressHost||!H.value||H.value==="0.0.0.0/0"){f.error("Enter an Ingress hostname and a restricted IPv4 CIDR for Jupyter");return}if(C.value.ingressPath!=="/"||!ue.value&&C.value.ingressTlsEnabled||N.value.hpaEnabled||Le.value){f.error(ue.value?"Jupyter uses one replica and path / without HPA or rebalancing":"Jupyter uses one replica, path / and HTTP NodePort 30880 without HPA or rebalancing");return}}if(O.value){if((u.value.selectedStorageIds||[]).length===0){f.error("Select at least one registered Object Storage resource");return}if(String(u.value.jupyterToken||"").length<12){f.error("Enter a Jupyter access token with at least 12 characters");return}if(!At.value){f.error("Run the Object Storage check before deployment");return}}if(g.value==="K8S"&&!zt())return;pe.value=!0;const a=Qe.value,e=Ie,n=$e,i=()=>Ot&&$e===n&&Qe.value===a&&Ie===e;qe("DEPLOY_STARTED");try{let t={};if(g.value==="VM"){let h={};if(r.value=="Application Installation"){const F=U.value==="NODE_GROUP",Q=!F&&x.value==="Clustering"?`${ne.value}-cluster`:`${ne.value}-standalone`,Pt=ae.value===""?void 0:Number(ae.value);h={namespace:I.value,mciId:D.value,vmIds:F?[]:w.value,vmNodeGroupId:F?L.value:V.value&&b.targetNodeGroupId?b.targetNodeGroupId:void 0,clusterName:Q,catalogId:W.value,servicePort:Pt,openServicePort:Ne.value==="RESTRICTED",servicePortCidr:Ne.value==="RESTRICTED"?H.value:void 0,username:"admin",deploymentType:g.value,vmDeploymentMode:F?"STANDALONE":x.value.toUpperCase(),resourceType:Ve.value,additionalConfig:Al()},t=await Yl(h,i)}else t=await Yt(h)}else{const h=ae.value===""?void 0:Number(ae.value),F=Tl(),Q={namespace:I.value,clusterName:T.value,openServicePort:C.value.ingressEnabled&&!ue.value&&bt.value,servicePortCidr:C.value.ingressEnabled?H.value:void 0,catalogId:W.value,servicePort:h,username:"",deploymentType:g.value,hpaEnabled:N.value.hpaEnabled,minReplicas:N.value.hpaMinReplicas,maxReplicas:N.value.hpaMaxReplicas,cpuThreshold:N.value.hpaCpuUtilization,memoryThreshold:N.value.hpaMemoryUtilization,workloadRebalancingEnabled:Le.value,resourceType:Ve.value,...St(),additionalConfig:F};if(r.value==="Application Installation"&&ue.value&&Q.ingressEnabled){const{data:Pt}=await Wl({namespace:Q.namespace,clusterName:Q.clusterName,catalogId:Q.catalogId,servicePortCidr:Q.servicePortCidr,...St()});await fa(Pt,Q,async xl=>(await Ql(Q.namespace,xl)).data,()=>{},i)}t=r.value=="Application Installation"?await Xl(Q,i):await Yt(Q)}if(!i())return;t.data?(Z.value=!0,f.success("SUCCESS"),qe("DEPLOY_SUCCEEDED",{deploymentId:fl(t.data)})):(f.error("FAIL"),qe("DEPLOY_FAILED",{message:"The deployment API did not return a success result."}))}catch(t){if(!i())return;const h=t instanceof Error?t.message:"The deployment request failed.";t!=null&&t.deploymentStatusUnknown?(t.interruptedOperation&&(Ke.value=t.interruptedOperation),f.warning(h),qe("DEPLOY_STATUS_UNKNOWN",{message:h})):(f.error(h),qe("DEPLOY_FAILED",{message:h}))}finally{pe.value=!1}},St=()=>({ingressEnabled:C.value.ingressEnabled,ingressHost:ll(C.value.ingressHost),ingressPath:C.value.ingressPath,ingressClass:Ht.value,ingressTlsEnabled:ue.value?!1:C.value.ingressTlsEnabled,ingressTlsSecret:ue.value||C.value.ingressTlsSecret===""?null:C.value.ingressTlsSecret}),gl=async()=>{if(Ae.value)return;if(S.value){f.error(S.value);return}if(g.value!=="VM"&&g.value!=="K8S"){f.error("Please Select Infra");return}if(!zt())return;const a=Ie;se.value=!0,je.value=[],He.value=[],Ae.value=!0;try{if(g.value==="K8S"){if(!I.value||!T.value||!W.value){f.error("Please select all items");return}const{data:n}=await Zl({namespace:I.value,clusterName:T.value,catalogId:W.value,servicePortCidr:H.value,...St()});if(a!==Ie)return;if(He.value=Array.isArray(n==null?void 0:n.warnings)?n.warnings:[],(n==null?void 0:n.valid)!==!0){je.value=Array.isArray(n==null?void 0:n.errors)&&n.errors.length?n.errors:["Ingress check failed. Resolve the issue and retry Spec Check."];return}}const e=await yl();if(a!==Ie)return;if(e==null){f.error("Please select all items");return}if(e===!1){const n=g.value==="VM"?"VM":"CLUSTER";if(!confirm("Your selected "+n+" has lower specifications than recommended. Would you like to continue with the installation?"))return}if(a!==Ie)return;f.success("Please click Deploy"),se.value=!1}catch{a===Ie&&(je.value=["Spec Check could not be completed. Check connectivity and permissions, then retry."])}finally{Ae.value=!1}},yl=async()=>{let a=!1;if(g.value==="VM"){const e=U.value==="NODE_GROUP"?yt.value:w.value;if(I.value===""||D.value===""||U.value==="NODE_GROUP"&&L.value===""||e.length===0||W.value===0)return null;{const n=U.value==="NODE_GROUP"?e:[e[0]];a=!0;for(const i of n){const t={namespace:I.value,mciName:D.value,vmName:i,catalogId:W.value},{data:h}=await ea(t);if(!h){a=!1;break}}}}else if(g.value==="K8S"){if(I.value===""||T.value===""||W.value===0)return null;const e={namespace:I.value,clusterName:T.value,catalogId:W.value};await ta(e).then(({data:n})=>{a=n})}return a},re=y(()=>Pe.value.find(a=>a.id===W.value)),Ct=y(()=>g.value==="VM"&&U.value==="VM"&&!V.value&&ma(re.value));ie(Ct,a=>{!a&&x.value==="Clustering"&&(x.value="Standalone")},{flush:"sync"});const _e=y(()=>{var e;const a=fe.value.find(n=>n.id===T.value||n.name===T.value);return String(((e=a==null?void 0:a.connectionConfig)==null?void 0:e.providerName)||"").trim().toLowerCase()}),ue=y(()=>/^(ibm|ibmcloud|ibm-cloud|ibm-vpc|ibmvpc)(-|$)/i.test(_e.value)),Bt=y(()=>_e.value==="nhn"),Ht=y(()=>ue.value?"public-iks-k8s-nginx":"nginx"),kl=y(()=>{var n;const a=w.value[0],e=J.value.find(i=>Fe(i)===a);return((n=e==null?void 0:e.connectionConfig)==null?void 0:n.providerName)||(e==null?void 0:e.connectionName)||""}),st=y(()=>g.value==="VM"?kl.value:_e.value),Il=y(()=>{var a,e;return String(((e=(a=re.value)==null?void 0:a.helmChart)==null?void 0:e.chartName)||"").toLowerCase()}),hl=["CAPABILITY","TAG"],wt=y(()=>Il.value==="loki"),O=y(()=>{var e,n;return String(((n=(e=re.value)==null?void 0:e.packageInfo)==null?void 0:n.packageName)||"").toLowerCase().includes("jupyter")&&Rt(re.value)}),Et=y(()=>{if(r.value!=="Application Installation"||!O.value)return!1;const a=e=>/^kt(?:classic|cloud|-cloud)?(?:[-_]|$)/i.test(String(e||"").trim());return g.value==="K8S"?a(_e.value):J.value.some(e=>{var n;return w.value.includes(Fe(e))&&a(((n=e==null?void 0:e.connectionConfig)==null?void 0:n.providerName)||(e==null?void 0:e.connectionName))})}),Vt=y(()=>{var a;return g.value!=="K8S"?!1:O.value?!0:!((a=re.value)!=null&&a.helmChart)||!wt.value?!1:Ft(re.value,jn)}),Te=y(()=>Vt.value&&(wt.value||O.value)),Sl=y(()=>Vt.value&&r.value==="Application Installation"&&(Te.value||ee.value.length>0||ye.value)),Cl=y(()=>ge.value||ee.value.length<=1),wl=y(()=>ge.value?"Loading StorageClasses...":ye.value?"Failed to load StorageClasses":ee.value.length===0?"No StorageClass found":"Select StorageClass"),ot=y(()=>Te.value?ge.value?"StorageClass list is loading.":ye.value?Xe.value||"StorageClass list could not be loaded.":ee.value.length===0?"This application requires a StorageClass, but none was found.":Se.isEmpty(X.value)?"This application requires a StorageClass.":O.value&&(!Number.isInteger(te.value)||te.valueTt(st.value)?"Optional: https://s3.ap-northeast-2.amazonaws.com":"https://object-storage.example.com"),Vl=y(()=>Tt(st.value)?"ap-northeast-2":"region from object storage service"),De=y(()=>!re.value||!Rt(re.value)?!1:g.value==="VM"?!!re.value.packageInfo&&O.value:g.value==="K8S"?!!re.value.helmChart||O.value:!1),Nt=y(()=>De.value&&u.value.enabled),At=y(()=>{var a;return!Nt.value||((a=j.value)==null?void 0:a.success)===!0}),Nl=y(()=>pe.value||Z.value||Et.value||Ae.value||!!S.value||se.value||!At.value||Te.value&&!Se.isEmpty(ot.value));function nt(a=st.value,e=rt.value){const n=Tt(a);return{enabled:!!e,selectedStorageIds:[],accessMode:"READ_ONLY",backendType:"s3",endpoint:"",region:"",bucket:"",prefix:"",accessKey:"",secretKey:"",sessionToken:"",jupyterToken:"",forcePathStyle:!n}}function Tt(a){return String(a||"").toLowerCase().includes("aws")}const rt=y(()=>g.value==="K8S"&&wt.value||O.value);function Rt(a){return Ft(a,xn)}function Ft(a,e){return(a.catalogRefs||[]).some(i=>{const t=String(i.refType||"").toUpperCase();return String(i.refValue||"").toLowerCase()===e&&hl.includes(t)})}function Mt(){if(g.value==="VM"||O.value){const a=u.value.selectedStorageIds||[];return{enabled:u.value.enabled,jupyterToken:u.value.jupyterToken,storages:a.map(e=>({objectStorageId:e,alias:e,prefix:u.value.prefix,accessMode:u.value.accessMode}))}}return{enabled:u.value.enabled,backendType:u.value.backendType,endpoint:u.value.endpoint,region:u.value.region,bucket:u.value.bucket,prefix:u.value.prefix,accessKey:u.value.accessKey,secretKey:u.value.secretKey,sessionToken:u.value.sessionToken,jupyterToken:u.value.jupyterToken,forcePathStyle:u.value.forcePathStyle,insecure:Rl(u.value.endpoint)}}function Al(){if(!(!De.value||!u.value.enabled))return{objectStorage:Mt()}}function Tl(){const a={};return Te.value&&!Se.isEmpty(X.value)&&(a.storageClass=X.value,O.value&&(a.storageSize=te.value+"Gi",a.storageAccessMode="ReadWriteOnce")),De.value&&u.value.enabled&&(a.objectStorage=Mt()),Object.keys(a).length>0?a:void 0}function zt(){if(!Te.value)return!0;const a=ot.value;return Se.isEmpty(a)?!0:(f.error(a),!1)}function Rl(a){return String(a||"").trim().toLowerCase().startsWith("http://")}const Ml=async(a=!0)=>{if(!Nt.value)return!0;Ge.value=!0,j.value=null;const e={targetType:g.value,namespace:I.value,clusterName:g.value==="K8S"?T.value:void 0,mciId:g.value==="VM"?D.value:void 0,vmId:g.value==="VM"?w.value[0]:void 0,catalogId:W.value,objectStorage:Mt()};try{const{data:n}=await la(e);return j.value=n,n!=null&&n.success?(a&&f.success("Object Storage check succeeded"),!0):(a&&f.error("Object Storage check failed"),!1)}catch{return a&&f.error("Object Storage check failed"),!1}finally{Ge.value=!1}},qt=y(()=>g.value==="VM"?Pe.value.filter(a=>a.packageInfo):g.value==="K8S"?Pe.value.filter(a=>{var e;return a.helmChart||String(((e=a.packageInfo)==null?void 0:e.packageName)||"").toLowerCase().includes("jupyter")&&Rt(a)}):Pe.value),Jt=async()=>{r.value==="Application Installation"&&(se.value=!0);const a=Pe.value.find(e=>ne.value===e.name);a&&(W.value=a.id,ae.value=g.value==="K8S"&&O.value?"8888":a.defaultPort?String(a.defaultPort):"",N.value={hpaEnabled:!!a.hpaEnabled,hpaMinReplicas:a.minReplicas||1,hpaMaxReplicas:a.maxReplicas||10,hpaCpuUtilization:a.cpuThreshold||60,hpaMemoryUtilization:a.memoryThreshold||80},C.value={ingressEnabled:!!a.ingressEnabled,ingressHost:a.ingressHost||"",ingressPath:a.ingressPath||"/",ingressClass:a.ingressClass||"nginx",ingressTlsEnabled:!!a.ingressTlsEnabled,ingressTlsSecret:a.ingressTlsSecret||""},g.value==="K8S"&&O.value&&(C.value.ingressEnabled=!0,N.value.hpaEnabled=!1,N.value.hpaMinReplicas=1),u.value=nt(),j.value=null),await lt(),await ze()},Pl=async()=>{r.value==="Application Installation"&&(se.value=!0),u.value=nt(),j.value=null,await ze()};return(a,e)=>{var n,i;return o(),s("div",{class:he(a.embedded?"install-embedded":"modal fade"),id:a.formId,tabindex:a.embedded?void 0:-1},[l("div",{class:he(["modal-dialog modal-lg",{"install-embedded-dialog":a.embedded}]),role:"document"},[l("div",ga,[l("div",ya,[l("h5",ka,d(r.value),1),a.embedded?c("",!0):(o(),s("button",{key:0,type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close",onClick:$t}))]),l("div",{class:he(["modal-body",{"install-embedded-body":a.embedded}]),style:Gl(a.embedded?void 0:"max-height: calc(100vh - 200px);overflow-y: auto;")},[Z.value?(o(),s("div",Ia,e[53]||(e[53]=[l("strong",null,"Deployment completed.",-1),l("p",{class:"mb-0"},"Check the application's running status in Apps Status.",-1)]))):c("",!0),Ke.value?(o(),s("div",ha,[e[54]||(e[54]=de(" AM restarted while tracking this installation. Check Apps Status before starting another installation. ")),l("button",{type:"button",class:"btn btn-sm btn-outline-warning ms-2",disabled:pt.value,onClick:el},"Close interrupted tracking",8,Sa)])):c("",!0),m(l("fieldset",{disabled:pe.value||Z.value,class:"border-0 p-0 m-0"},[ct.value?(o(),s("div",wa,[e[55]||(e[55]=de(" Deployment targets are scoped to ")),l("strong",null,d(Ut.value),1),e[56]||(e[56]=de(". "))])):c("",!0),S.value?(o(),s("div",Ea,d(S.value),1)):c("",!0),V.value?(o(),s("div",Va,[e[57]||(e[57]=de(" The deployment target was fixed by the Workload screen: ")),l("strong",null,d(Zt.value),1),e[58]||(e[58]=de(". "))])):c("",!0),l("div",Na,[e[59]||(e[59]=l("label",{class:"form-label"},"Target Infra",-1)),r.value=="Application Installation"?(o(),s("p",Aa," Select the Infra what is the Infra will be installed ")):r.value=="Application Uninstallation"?(o(),s("p",Ta," Select the Infra what is the Infra will be uninstalled ")):c("",!0),m(l("select",{class:"form-select",id:"infra","onUpdate:modelValue":e[0]||(e[0]=t=>g.value=t),disabled:V.value},[(o(!0),s(R,null,_(vt.value,t=>(o(),s("option",{value:t.value,key:t.value},d(t.value),9,Ma))),128))],8,Ra),[[$,g.value]])]),g.value=="VM"?(o(),s(R,{key:3},[l("div",Pa,[e[61]||(e[61]=l("label",{class:"form-label"},"Namespace",-1)),r.value=="Application Installation"?(o(),s("p",xa," Select the namespace where the application will be installed")):r.value=="Application Uninstallation"?(o(),s("p",ja," Select the namespace where the application will be uninstalled")):c("",!0),we.value.length>0?m((o(),s("select",{key:2,class:"form-select",id:"vm-namespace","onUpdate:modelValue":e[1]||(e[1]=t=>I.value=t),disabled:jt.value,onChange:rl},[(o(!0),s(R,null,_(we.value,t=>(o(),s("option",{value:Ue(t),key:Ue(t)},d(t.name||t.id),9,Oa))),128))],40,Ua)),[[$,I.value]]):(o(),s("select",_a,e[60]||(e[60]=[l("option",{value:""}," No namespace available ",-1)])))]),l("div",Da,[e[62]||(e[62]=l("label",{class:"form-label"},"Infra ID",-1)),r.value=="Application Installation"?(o(),s("p",La," Select the infra ID where the application will be deployed")):r.value=="Application Uninstallation"?(o(),s("p",Ga," Remove the application and associated resources from the infra")):c("",!0),m(l("select",{class:"form-select",id:"vm-mci",disabled:I.value==""||V.value,"onUpdate:modelValue":e[2]||(e[2]=t=>D.value=t),onChange:ul},[be.value.length===0?(o(),s("option",$a,"No infra available")):c("",!0),(o(!0),s(R,null,_(be.value,t=>(o(),s("option",{value:t.id||t.name,key:t.id||t.name,title:t.id||t.name},d(t.id||t.name),9,Ba))),128))],40,Ka),[[$,D.value]])]),r.value=="Application Installation"&&!V.value?(o(),s("div",Ha,[e[65]||(e[65]=l("label",{class:"form-label"},"Deployment Target",-1)),e[66]||(e[66]=l("p",{class:"text-muted"},"Choose one VM or one CB-Tumblebug NodeGroup.",-1)),l("div",Fa,[l("div",za,[m(l("input",{class:"form-check-input",type:"radio",id:"vm-target-single","onUpdate:modelValue":e[3]||(e[3]=t=>U.value=t),value:"VM"},null,512),[[ut,U.value]]),e[63]||(e[63]=l("label",{class:"form-check-label",for:"vm-target-single"},"VM",-1))]),l("div",qa,[m(l("input",{class:"form-check-input",type:"radio",id:"vm-target-node-group","onUpdate:modelValue":e[4]||(e[4]=t=>U.value=t),value:"NODE_GROUP"},null,512),[[ut,U.value]]),e[64]||(e[64]=l("label",{class:"form-check-label",for:"vm-target-node-group"},"NodeGroup (Standalone)",-1))])])])):c("",!0),U.value==="VM"?(o(),s("div",Ja,[e[68]||(e[68]=l("label",{class:"form-label"},"VM Name",-1)),e[69]||(e[69]=l("p",{class:"text-muted"}," Select the virtual machine (VM) within the chosen multi-cloud infrastructure where the application will be deployed",-1)),m(l("select",{class:"form-select",id:"vm-name",disabled:D.value==""||V.value,"onUpdate:modelValue":e[5]||(e[5]=t=>B.value=t),onChange:dl},[e[67]||(e[67]=l("option",{value:""},"Select VM",-1)),(o(!0),s(R,null,_(q.value,t=>(o(),s("option",{value:Fe(t),key:Fe(t)},d(t.name||t.id),9,Wa))),128))],40,Ya),[[$,B.value]]),w.value.length>0?(o(),s("div",Qa,[(o(!0),s(R,null,_(w.value,(t,h)=>(o(),s("label",{key:h,class:"form-check-label",style:{border:"1px solid #000",padding:"5px","border-radius":"5px",cursor:"pointer"}},[de(d(t)+" ",1),V.value?c("",!0):(o(),s("span",{key:0,onClick:F=>vl(h),style:{"margin-left":"5px","font-weight":"bold"}},"X",8,Xa))]))),128))])):c("",!0)])):(o(),s("div",Za,[e[72]||(e[72]=l("label",{class:"form-label"},"NodeGroup",-1)),e[73]||(e[73]=l("p",{class:"text-muted"}," Deploy one independent application instance to every currently running VM in the selected NodeGroup. ",-1)),m(l("select",{class:"form-select",id:"vm-node-group",disabled:D.value==""||V.value,"onUpdate:modelValue":e[6]||(e[6]=t=>L.value=t),onChange:cl},[e[70]||(e[70]=l("option",{value:""},"Select NodeGroup",-1)),(o(!0),s(R,null,_(gt.value,t=>(o(),s("option",{key:t.id,value:t.id,disabled:t.runningVmIds.length===0},d(t.id)+" ("+d(t.runningVmIds.length)+"/"+d(t.totalVmCount)+" running) ",9,ts))),128))],40,es),[[$,L.value]]),L.value&&yt.value.length>0?(o(),s("div",ls,[e[71]||(e[71]=l("div",{class:"text-muted small mb-1"},"Deployment targets",-1)),l("div",as,[(o(!0),s(R,null,_(yt.value,t=>(o(),s("span",{key:t,class:"badge bg-light text-dark"},d(t),1))),128))])])):L.value?(o(),s("div",ss," The selected NodeGroup has no running VMs. ")):c("",!0)])),U.value==="VM"?(o(),s("div",os,[e[76]||(e[76]=l("label",{class:"form-label"},"Deployment Type",-1)),e[77]||(e[77]=l("p",{class:"text-muted"},"Select the deployment type",-1)),l("div",ns,[l("div",rs,[m(l("input",{class:"form-check-input",type:"radio",id:"Standalone","onUpdate:modelValue":e[7]||(e[7]=t=>x.value=t),value:"Standalone",disabled:V.value},null,8,us),[[ut,x.value]]),e[74]||(e[74]=l("label",{class:"form-check-label",for:"Standalone"},"Standalone",-1))]),Ct.value?(o(),s("div",is,[m(l("input",{class:"form-check-input",type:"radio",id:"Clustering","onUpdate:modelValue":e[8]||(e[8]=t=>x.value=t),value:"Clustering",disabled:V.value},null,8,ds),[[ut,x.value]]),e[75]||(e[75]=l("label",{class:"form-check-label",for:"Clustering"},"Clustering",-1))])):c("",!0)]),V.value?c("",!0):(o(),s("div",cs,"Clustering is available only for Redis and Elasticsearch server catalogs."))])):(o(),s("div",vs,e[78]||(e[78]=[l("label",{class:"form-label"},"Deployment Type",-1),l("input",{type:"text",class:"form-control",value:"Standalone",disabled:""},null,-1),l("div",{class:"form-text"},"NodeGroup deployment does not use application clustering.",-1)]))),l("div",ps,[e[79]||(e[79]=l("label",{class:"form-label"},"Application",-1)),e[80]||(e[80]=l("p",{class:"text-muted"},"Select the application",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[9]||(e[9]=t=>ne.value=t),onChange:Jt},[(o(!0),s(R,null,_(qt.value,(t,h)=>{var F;return o(),s("option",{key:h,value:t.name}," ["+d(t.name)+"] "+d(((F=t.packageInfo)==null?void 0:F.packageVersion)||"latest"),9,ms)}),128))],544),[[$,ne.value]])]),l("div",fs,[e[81]||(e[81]=l("label",{class:"form-label"},"Port",-1)),e[82]||(e[82]=l("p",{class:"text-muted"},"Docker host port. Security Group access is configured separately below.",-1)),m(l("input",{type:"number",class:"form-control",placeholder:"8080","onUpdate:modelValue":e[10]||(e[10]=t=>ae.value=t)},null,512),[[M,ae.value]])]),r.value=="Application Installation"?(o(),s("div",bs,[e[86]||(e[86]=l("label",{class:"form-label"},"Network Exposure",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[11]||(e[11]=t=>Ne.value=t)},e[83]||(e[83]=[l("option",{value:"PRIVATE"},"Do not change Security Group (recommended)",-1),l("option",{value:"RESTRICTED"},"Add restricted direct access",-1)]),512),[[$,Ne.value]]),e[87]||(e[87]=l("p",{class:"text-muted mt-1 mb-0"}," Direct access appends one inbound TCP rule through Tumblebug. It never resaves existing rules. ",-1)),Ne.value==="RESTRICTED"?(o(),s("div",gs,[e[84]||(e[84]=l("label",{class:"form-label required"},"Allowed IPv4 CIDR",-1)),m(l("input",{type:"text",class:"form-control",placeholder:"203.0.113.10/32","onUpdate:modelValue":e[12]||(e[12]=t=>H.value=t)},null,512),[[M,H.value,void 0,{trim:!0}]]),e[85]||(e[85]=l("p",{class:"text-warning mt-1 mb-0"}," Public any (0.0.0.0/0) is rejected. Broader rules already present in the Security Group are not removed. ",-1))])):c("",!0)])):c("",!0),r.value=="Application Installation"?(o(),s("div",ys,[e[89]||(e[89]=l("label",{class:"form-label"},"Resource Type",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[13]||(e[13]=t=>Ve.value=t)},e[88]||(e[88]=[l("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),l("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),l("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[$,Ve.value]])])):c("",!0),r.value=="Application Installation"&&De.value?(o(),s("div",ks,[e[97]||(e[97]=l("label",{class:"form-label"},"Object Storage Configuration",-1)),e[98]||(e[98]=l("p",{class:"text-muted"}," Select Object Storage resources already registered in Tumblebug. CSP access keys are not sent to JupyterLab. ",-1)),l("div",Is,[m(l("input",{class:"form-check-input",type:"checkbox",id:"vmObjectStorageEnabled","onUpdate:modelValue":e[14]||(e[14]=t=>u.value.enabled=t),disabled:rt.value},null,8,hs),[[ce,u.value.enabled]]),e[90]||(e[90]=l("label",{class:"form-check-label",for:"vmObjectStorageEnabled"},"Enable Object Storage",-1))]),u.value.enabled?(o(),s("div",Ss,[l("div",Cs,[e[91]||(e[91]=l("label",{class:"form-label mb-0 required"},"Registered Object Storage",-1)),l("button",{type:"button",class:"btn btn-sm btn-outline-secondary",disabled:Ee.value,onClick:lt}," Refresh ",8,ws)]),Ee.value?(o(),s("div",Es,"Loading Object Storage resources...")):xe.value?(o(),s("div",Vs," Object Storage resources could not be loaded from Tumblebug. ")):ve.value.length===0?(o(),s("div",Ns," No Object Storage resource is registered in this namespace. ")):(o(),s("div",As,[(o(!0),s(R,null,_(ve.value,t=>(o(),s("div",{class:"form-check",key:t.id},[m(l("input",{class:"form-check-input",type:"checkbox",id:`vm-object-storage-${t.id}`,value:t.id,disabled:String(t.status||"").toLowerCase()!=="available","onUpdate:modelValue":e[15]||(e[15]=h=>u.value.selectedStorageIds=h)},null,8,Ts),[[ce,u.value.selectedStorageIds]]),l("label",{class:"form-check-label",for:`vm-object-storage-${t.id}`},[de(d(t.name||t.id)+" ",1),l("span",Ms," ("+d(t.provider||"unknown CSP")+d(t.region?` / ${t.region}`:"")+" / "+d(t.status||"unknown")+") ",1)],8,Rs)]))),128))])),l("div",Ps,[l("div",xs,[e[92]||(e[92]=l("label",{class:"form-label"},"Allowed Object Prefix",-1)),m(l("input",{type:"text",class:"form-control",placeholder:"Optional: data/project-a/","onUpdate:modelValue":e[16]||(e[16]=t=>u.value.prefix=t)},null,512),[[M,u.value.prefix,void 0,{trim:!0}]])]),l("div",js,[e[94]||(e[94]=l("label",{class:"form-label"},"Access Mode",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[17]||(e[17]=t=>u.value.accessMode=t)},e[93]||(e[93]=[l("option",{value:"READ_ONLY"},"Read only",-1),l("option",{value:"READ_WRITE"},"Read and write",-1)]),512),[[$,u.value.accessMode]])])]),l("div",Us,[e[95]||(e[95]=l("label",{class:"form-label required"},"Jupyter Access Token",-1)),m(l("input",{type:"password",class:"form-control",placeholder:"At least 12 characters","onUpdate:modelValue":e[18]||(e[18]=t=>u.value.jupyterToken=t),autocomplete:"new-password"},null,512),[[M,u.value.jupyterToken]]),l("p",Os," This is the Jupyter login token, not a CSP secret key. Use it at http://:"+d(ae.value)+". ",1)]),e[96]||(e[96]=l("p",{class:"text-muted mt-2 mb-0"}," Jupyter requests short-lived presigned URLs through Application Manager. Multiple CSPs can be selected. ",-1)),j.value?(o(),s("div",{key:4,class:he(["alert mt-3",j.value.success?"alert-success":"alert-danger"])},[l("div",null,d(j.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),l("ul",_s,[(o(!0),s(R,null,_(j.value.checks,t=>(o(),s("li",{key:t.name},d(t.name)+" - "+d(t.success?"OK":"FAIL"),1))),128))])],2)):c("",!0)])):c("",!0)])):c("",!0)],64)):g.value=="K8S"?(o(),s(R,{key:4},[l("div",Ds,[e[100]||(e[100]=l("label",{class:"form-label"},"Namespace",-1)),r.value=="Application Installation"?(o(),s("p",Ls,"Select the namespace where the application will be installed")):r.value=="Application Uninstallation"?(o(),s("p",Gs,"Select the namespace where the application will be uninstalled")):c("",!0),we.value.length>0?m((o(),s("select",{key:2,class:"form-select",id:"k8s-namespace","onUpdate:modelValue":e[19]||(e[19]=t=>I.value=t),disabled:jt.value,onChange:il},[(o(!0),s(R,null,_(we.value,t=>(o(),s("option",{value:Ue(t),key:Ue(t)},d(t.name||t.id),9,$s))),128))],40,Ks)),[[$,I.value]]):(o(),s("select",Bs,e[99]||(e[99]=[l("option",{value:""}," No namespace available ",-1)])))]),l("div",Hs,[e[101]||(e[101]=l("label",{class:"form-label"},"ClusterName",-1)),r.value=="Application Installation"?(o(),s("p",Fs,"Select the name of the cluster where the application will be deployed")):r.value=="Application Uninstallation"?(o(),s("p",zs,"Remove the application and associated resources from the multi-cloud infrastructure")):c("",!0),m(l("select",{class:"form-select",id:"k8s-cluster",disabled:I.value==""||V.value,"onUpdate:modelValue":e[20]||(e[20]=t=>T.value=t),onChange:Pl},[fe.value.length===0?(o(),s("option",Js,"No cluster available")):c("",!0),(o(!0),s(R,null,_(fe.value,t=>(o(),s("option",{value:et(t),key:et(t)},d(t.name||t.id),9,Ys))),128))],40,qs),[[$,T.value]])]),l("div",Ws,[e[102]||(e[102]=l("label",{class:"form-label"},"Helm chart",-1)),e[103]||(e[103]=l("p",{class:"text-muted"},"Select the application",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[21]||(e[21]=t=>ne.value=t),onChange:Jt},[(o(!0),s(R,null,_(qt.value,(t,h)=>{var F,Q;return o(),s("option",{key:h,value:t.name}," ["+d(t.name)+"] "+d(((F=t.helmChart)==null?void 0:F.chartVersion)||((Q=t.packageInfo)==null?void 0:Q.packageVersion)||"latest"),9,Qs)}),128))],544),[[$,ne.value]])]),r.value=="Application Installation"?(o(),s("div",Xs,[e[104]||(e[104]=l("label",{class:"form-label"},"Port",-1)),e[105]||(e[105]=l("p",{class:"text-muted"},"Please enter a service port for the Kubernetes service",-1)),m(l("input",{type:"number",class:"form-control",placeholder:"80","onUpdate:modelValue":e[22]||(e[22]=t=>ae.value=t),disabled:O.value},null,8,Zs),[[M,ae.value]])])):c("",!0),r.value=="Application Installation"?(o(),s("div",eo,[e[107]||(e[107]=l("label",{class:"form-label"},"Resource Type",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[23]||(e[23]=t=>Ve.value=t)},e[106]||(e[106]=[l("option",{value:"GENERAL_PURPOSE"},"General Purpose",-1),l("option",{value:"CPU_INTENSIVE"},"CPU Intensive",-1),l("option",{value:"MEMORY_INTENSIVE"},"Memory Intensive",-1)]),512),[[$,Ve.value]])])):c("",!0),r.value=="Application Installation"&&Sl.value?(o(),s("div",to,[l("label",{class:he(["form-label",{required:Te.value}])},"Storage Class",2),m(l("select",{class:"form-select","onUpdate:modelValue":e[24]||(e[24]=t=>X.value=t),disabled:Cl.value},[l("option",ao,d(wl.value),1),(o(!0),s(R,null,_(ee.value,t=>(o(),s("option",{key:t.name,value:t.name},d(t.name)+d(at(t)?" (recommended)":"")+d(t.defaultClass?" (default)":""),9,so))),128))],8,lo),[[$,X.value]]),Te.value&&ot.value?(o(),s("p",oo,d(ot.value),1)):c("",!0),l("button",{type:"button",class:"btn btn-outline-secondary btn-sm mt-2",disabled:ge.value||me.value,onClick:e[25]||(e[25]=t=>ze(X.value))},"Refresh StorageClasses",8,no),ke.value?(o(),s("p",ro,d(ke.value),1)):c("",!0),Bt.value&&!ye.value&&!ee.value.length?(o(),s("div",uo,[e[114]||(e[114]=l("div",{class:"fw-bold mb-2"},"NHN block storage setup",-1)),l("p",io,d(((n=Y.value)==null?void 0:n.message)||(ke.value?"NHN storage setup is unavailable.":"Checking Cinder CSI and AM permissions...")),1),l("div",co,[e[108]||(e[108]=l("span",{class:"fw-semibold"},"1. Cinder CSI Plugin add-on",-1)),Y.value?(o(),s("span",{key:0,class:he(["badge ms-2",Y.value.driverReady?"bg-success":"bg-warning text-dark"])},d(Y.value.driverReady?"Ready":"Required"),3)):c("",!0),Y.value&&!Y.value.driverReady?(o(),s("p",vo," Install cinder-csi-plugin from the selected cluster's NHN NKS Add-ons page, wait until it is active, and refresh StorageClasses here. ")):c("",!0)]),(i=Y.value)!=null&&i.driverReady?(o(),s("div",po,[e[110]||(e[110]=l("div",{class:"fw-semibold mb-2"},"2. Create StorageClass",-1)),e[111]||(e[111]=l("label",{class:"form-label"},"StorageClass name",-1)),m(l("input",{class:"form-control","onUpdate:modelValue":e[26]||(e[26]=t=>Ze.value=t),disabled:me.value||!Y.value.canCreate,maxlength:"63"},null,8,mo),[[M,Ze.value]]),e[112]||(e[112]=l("label",{class:"form-label mt-2"},"Disk type",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[27]||(e[27]=t=>mt.value=t),disabled:me.value||!Y.value.canCreate},e[109]||(e[109]=[l("option",null,"General HDD",-1),l("option",null,"General SSD",-1)]),8,fo),[[$,mt.value]]),e[113]||(e[113]=l("p",{class:"text-muted mt-2"},"Volumes are created when a Pod uses the claim. Retain policy keeps disks after claim deletion; remove unused disks separately.",-1)),l("button",{type:"button",class:"btn btn-outline-primary",disabled:me.value||!Y.value.canCreate||!Ze.value,onClick:ol},d(me.value?"Creating...":"Create NHN StorageClass"),9,bo)])):c("",!0)])):c("",!0),O.value?(o(),s("div",go,[e[115]||(e[115]=l("label",{class:"form-label"},"Notebook volume capacity (GiB)",-1)),m(l("input",{type:"number",class:"form-control","onUpdate:modelValue":e[28]||(e[28]=t=>te.value=t),min:Be.value,step:"1"},null,8,yo),[[M,te.value,void 0,{number:!0}]]),l("p",ko,"Minimum "+d(Be.value)+" GiB for the known disk limits. Access mode: ReadWriteOnce. Provider quotas and disk availability are checked during provisioning.",1)])):c("",!0)])):c("",!0),r.value=="Application Installation"&&C.value.ingressEnabled?(o(),s("div",Io,[e[117]||(e[117]=l("label",{class:"form-label required"},"Allowed IPv4 CIDR",-1)),m(l("input",{class:"form-control",placeholder:"203.0.113.10/32","onUpdate:modelValue":e[29]||(e[29]=t=>H.value=t)},null,512),[[M,H.value,void 0,{trim:!0}]]),ue.value?c("",!0):(o(),s("div",ho,[m(l("input",{class:"form-check-input",type:"checkbox",id:"k8sOpenIngress","onUpdate:modelValue":e[30]||(e[30]=t=>bt.value=t)},null,512),[[ce,bt.value]]),e[116]||(e[116]=l("label",{class:"form-check-label",for:"k8sOpenIngress"},"Allow this CIDR on the worker Security Group (TCP 30880)",-1))])),ue.value?(o(),s("p",So,"HTTP via the IBM-managed load balancer. Only the allowed client IP range can access this application.")):(o(),s("p",Co,"Access: http://"+d(C.value.ingressHost||"your-ingress-host")+":30880. For testing, map this hostname to an accessible Kubernetes node public IP in your PC hosts file. With source-IP preservation, use a node running the Ingress Controller.",1))])):c("",!0),r.value=="Application Installation"?(o(),s("div",wo,[e[125]||(e[125]=l("label",{class:"form-label"},"HPA Configuration",-1)),l("div",Eo,[l("div",Vo,[m(l("input",{class:"form-check-input",type:"checkbox",id:"hpaEnabled","onUpdate:modelValue":e[31]||(e[31]=t=>N.value.hpaEnabled=t)},null,512),[[ce,N.value.hpaEnabled]]),e[118]||(e[118]=l("label",{class:"form-check-label",for:"hpaEnabled"}," Enable HPA (Horizontal Pod Autoscaler) ",-1))])]),N.value.hpaEnabled?(o(),s("div",No,[l("div",null,[e[119]||(e[119]=l("label",{class:"form-label required"}," minReplicas ",-1)),m(l("input",{type:"number",class:"form-control w-90-per",placeholder:"1","onUpdate:modelValue":e[32]||(e[32]=t=>N.value.hpaMinReplicas=t)},null,512),[[M,N.value.hpaMinReplicas]])]),l("div",null,[e[120]||(e[120]=l("label",{class:"form-label required"}," maxReplicas ",-1)),m(l("input",{type:"number",class:"form-control w-90-per",placeholder:"10","onUpdate:modelValue":e[33]||(e[33]=t=>N.value.hpaMaxReplicas=t)},null,512),[[M,N.value.hpaMaxReplicas]])]),l("div",null,[e[121]||(e[121]=l("label",{class:"form-check-label mb-2"}," CPU (%) ",-1)),m(l("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"60","onUpdate:modelValue":e[34]||(e[34]=t=>N.value.hpaCpuUtilization=t)},null,512),[[M,N.value.hpaCpuUtilization]]),e[122]||(e[122]=de(" % "))]),l("div",null,[e[123]||(e[123]=l("label",{class:"form-check-label mb-2"}," MEMORY (%) ",-1)),m(l("input",{type:"number",class:"form-control w-80-per d-inline",placeholder:"80","onUpdate:modelValue":e[35]||(e[35]=t=>N.value.hpaMemoryUtilization=t)},null,512),[[M,N.value.hpaMemoryUtilization]]),e[124]||(e[124]=de(" % "))])])):c("",!0)])):c("",!0),r.value=="Application Installation"?(o(),s("div",Ao,[e[127]||(e[127]=l("label",{class:"form-label"},"Workload Rebalancing",-1)),l("div",To,[l("div",Ro,[m(l("input",{class:"form-check-input",type:"checkbox",id:"workloadRebalancingEnabled","onUpdate:modelValue":e[36]||(e[36]=t=>Le.value=t)},null,512),[[ce,Le.value]]),e[126]||(e[126]=l("label",{class:"form-check-label",for:"workloadRebalancingEnabled"}," Enable Workload Rebalancing ",-1))])])])):c("",!0),r.value=="Application Installation"?(o(),s("div",Mo,[e[132]||(e[132]=l("label",{class:"form-label"},"Ingress Configuration",-1)),l("div",Po,[l("div",xo,[m(l("input",{class:"form-check-input",type:"checkbox",id:"ingressEnabled","onUpdate:modelValue":e[37]||(e[37]=t=>C.value.ingressEnabled=t)},null,512),[[ce,C.value.ingressEnabled]]),e[128]||(e[128]=l("label",{class:"form-check-label",for:"ingressEnabled"}," Enable Ingress ",-1))])]),C.value.ingressEnabled?(o(),s("div",jo,[l("div",Uo,[e[129]||(e[129]=l("label",{class:"form-label"},"Host",-1)),m(l("input",{type:"text",class:"form-control",placeholder:"example.com","onUpdate:modelValue":e[38]||(e[38]=t=>C.value.ingressHost=t)},null,512),[[M,C.value.ingressHost]]),ue.value?(o(),s("p",Oo,"For local testing, map this hostname to the IBM load balancer IP in your hosts file. HTTP does not require a certificate and is not encrypted.")):c("",!0)]),l("div",_o,[e[130]||(e[130]=l("label",{class:"form-label"},"Path",-1)),m(l("input",{type:"text",class:"form-control",placeholder:"/","onUpdate:modelValue":e[39]||(e[39]=t=>C.value.ingressPath=t)},null,512),[[M,C.value.ingressPath]])]),l("div",Do,[e[131]||(e[131]=l("label",{class:"form-label"},"Ingress Class",-1)),l("input",{type:"text",class:"form-control",placeholder:"nginx",value:Ht.value,disabled:""},null,8,Lo)])])):c("",!0)])):c("",!0),r.value=="Application Installation"&&De.value&&O.value?(o(),s("div",Go,[e[141]||(e[141]=l("label",{class:"form-label"},"Object Storage Configuration",-1)),e[142]||(e[142]=l("p",{class:"text-muted"}," Select Object Storage resources already registered in Tumblebug. CSP access keys are not sent to JupyterLab. ",-1)),l("div",Ko,[m(l("input",{class:"form-check-input",type:"checkbox",id:"k8sJupyterObjectStorageEnabled","onUpdate:modelValue":e[40]||(e[40]=t=>u.value.enabled=t),disabled:rt.value},null,8,$o),[[ce,u.value.enabled]]),e[133]||(e[133]=l("label",{class:"form-check-label",for:"k8sJupyterObjectStorageEnabled"},"Enable Object Storage",-1))]),u.value.enabled?(o(),s("div",Bo,[l("div",Ho,[e[134]||(e[134]=l("label",{class:"form-label mb-0 required"},"Registered Object Storage",-1)),l("button",{type:"button",class:"btn btn-sm btn-outline-secondary",disabled:Ee.value,onClick:lt}," Refresh ",8,Fo)]),Ee.value?(o(),s("div",zo,"Loading Object Storage resources...")):xe.value?(o(),s("div",qo," Object Storage resources could not be loaded from Tumblebug. ")):ve.value.length===0?(o(),s("div",Jo," No Object Storage resource is registered in this namespace. ")):(o(),s("div",Yo,[(o(!0),s(R,null,_(ve.value,t=>(o(),s("div",{class:"form-check",key:t.id},[m(l("input",{class:"form-check-input",type:"checkbox",id:`vm-object-storage-${t.id}`,value:t.id,disabled:String(t.status||"").toLowerCase()!=="available","onUpdate:modelValue":e[41]||(e[41]=h=>u.value.selectedStorageIds=h)},null,8,Wo),[[ce,u.value.selectedStorageIds]]),l("label",{class:"form-check-label",for:`vm-object-storage-${t.id}`},[de(d(t.name||t.id)+" ",1),l("span",Xo," ("+d(t.provider||"unknown CSP")+d(t.region?` / ${t.region}`:"")+" / "+d(t.status||"unknown")+") ",1)],8,Qo)]))),128))])),l("div",Zo,[l("div",en,[e[135]||(e[135]=l("label",{class:"form-label"},"Allowed Object Prefix",-1)),m(l("input",{type:"text",class:"form-control",placeholder:"Optional: data/project-a/","onUpdate:modelValue":e[42]||(e[42]=t=>u.value.prefix=t)},null,512),[[M,u.value.prefix,void 0,{trim:!0}]])]),l("div",tn,[e[137]||(e[137]=l("label",{class:"form-label"},"Access Mode",-1)),m(l("select",{class:"form-select","onUpdate:modelValue":e[43]||(e[43]=t=>u.value.accessMode=t)},e[136]||(e[136]=[l("option",{value:"READ_ONLY"},"Read only",-1),l("option",{value:"READ_WRITE"},"Read and write",-1)]),512),[[$,u.value.accessMode]])])]),l("div",ln,[e[138]||(e[138]=l("label",{class:"form-label required"},"Jupyter Access Token",-1)),m(l("input",{type:"password",class:"form-control",placeholder:"At least 12 characters","onUpdate:modelValue":e[44]||(e[44]=t=>u.value.jupyterToken=t),autocomplete:"new-password"},null,512),[[M,u.value.jupyterToken]]),e[139]||(e[139]=l("p",{class:"text-muted mt-1 mb-0"}," This is the Jupyter login token, not a CSP secret key. Use it at the Ingress URL shown below. ",-1))]),e[140]||(e[140]=l("p",{class:"text-muted mt-2 mb-0"}," Jupyter requests short-lived presigned URLs through Application Manager. Multiple CSPs can be selected. ",-1)),j.value?(o(),s("div",{key:4,class:he(["alert mt-3",j.value.success?"alert-success":"alert-danger"])},[l("div",null,d(j.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),l("ul",an,[(o(!0),s(R,null,_(j.value.checks,t=>(o(),s("li",{key:t.name},d(t.name)+" - "+d(t.success?"OK":"FAIL"),1))),128))])],2)):c("",!0)])):c("",!0)])):c("",!0),r.value=="Application Installation"&&De.value&&!O.value?(o(),s("div",sn,[e[152]||(e[152]=l("label",{class:"form-label"},"Object Storage Configuration",-1)),l("div",on,[l("div",nn,[m(l("input",{class:"form-check-input",type:"checkbox",id:"objectStorageEnabled","onUpdate:modelValue":e[45]||(e[45]=t=>u.value.enabled=t),disabled:rt.value},null,8,rn),[[ce,u.value.enabled]]),e[143]||(e[143]=l("label",{class:"form-check-label",for:"objectStorageEnabled"}," Enable Object Storage ",-1))])]),u.value.enabled?(o(),s("div",un,[l("div",dn,[l("div",cn,[e[144]||(e[144]=l("label",{class:"form-label"},"Target CSP",-1)),l("input",{type:"text",class:"form-control",value:st.value||"-",disabled:""},null,8,vn)]),e[145]||(e[145]=l("div",{class:"w-50 ms-2"},[l("label",{class:"form-label"},"Storage API"),l("input",{type:"text",class:"form-control",value:"S3-compatible",disabled:""})],-1))]),l("div",pn,[e[146]||(e[146]=l("label",{class:"form-label"},"S3-compatible Endpoint",-1)),m(l("input",{type:"text",class:"form-control",placeholder:El.value,"onUpdate:modelValue":e[46]||(e[46]=t=>u.value.endpoint=t)},null,8,mn),[[M,u.value.endpoint]])]),l("div",fn,[l("div",bn,[e[147]||(e[147]=l("label",{class:"form-label"},"Region",-1)),m(l("input",{type:"text",class:"form-control",placeholder:Vl.value,"onUpdate:modelValue":e[47]||(e[47]=t=>u.value.region=t)},null,8,gn),[[M,u.value.region]])]),l("div",yn,[e[148]||(e[148]=l("label",{class:"form-label"},"Bucket Name",-1)),m(l("input",{type:"text",class:"form-control",placeholder:"object-storage-bucket","onUpdate:modelValue":e[48]||(e[48]=t=>u.value.bucket=t)},null,512),[[M,u.value.bucket]])])]),l("div",kn,[l("div",In,[e[149]||(e[149]=l("label",{class:"form-label"},"Access Key ID",-1)),m(l("input",{type:"password",class:"form-control",placeholder:"access key id","onUpdate:modelValue":e[49]||(e[49]=t=>u.value.accessKey=t),autocomplete:"off"},null,512),[[M,u.value.accessKey]])]),l("div",hn,[e[150]||(e[150]=l("label",{class:"form-label"},"Secret Access Key",-1)),m(l("input",{type:"password",class:"form-control",placeholder:"secret access key","onUpdate:modelValue":e[50]||(e[50]=t=>u.value.secretKey=t),autocomplete:"off"},null,512),[[M,u.value.secretKey]])])]),l("div",Sn,[l("div",Cn,[m(l("input",{class:"form-check-input",type:"checkbox",id:"forcePathStyle","onUpdate:modelValue":e[51]||(e[51]=t=>u.value.forcePathStyle=t)},null,512),[[ce,u.value.forcePathStyle]]),e[151]||(e[151]=l("label",{class:"form-check-label",for:"forcePathStyle",title:"On: endpoint/bucket/object. Off: bucket.endpoint/object."},"Use path-style URL",-1))])]),j.value?(o(),s("div",{key:0,class:he(["alert mt-3",j.value.success?"alert-success":"alert-danger"])},[l("div",null,d(j.value.success?"Object Storage: SUCCESS":"Object Storage: FAILED"),1),l("ul",wn,[(o(!0),s(R,null,_(j.value.checks,t=>(o(),s("li",{key:t.name},d(t.name)+" - "+d(t.success?"OK":"FAIL"),1))),128))])],2)):c("",!0)])):c("",!0)])):c("",!0)],64)):c("",!0)],8,Ca),[[Kl,!Z.value]])],6),Et.value&&!Z.value?(o(),s("div",En,e[153]||(e[153]=[l("p",{class:"alert alert-warning"},"Jupyter installation is unavailable for KT because AM does not support KT Object Storage integration.",-1)]))):c("",!0),!Z.value&&(je.value.length||He.value.length)?(o(),s("div",Vn,[(o(!0),s(R,null,_(je.value,t=>(o(),s("div",{key:t,class:"alert alert-danger",role:"alert"},d(t),1))),128)),(o(!0),s(R,null,_(He.value,t=>(o(),s("div",{key:t,class:"alert alert-warning"},d(t),1))),128))])):c("",!0),l("div",Nn,[l("a",{class:"btn btn-link link-secondary","data-bs-dismiss":a.embedded?void 0:"modal",onClick:$t},d(Z.value?"Close":"Cancel"),9,An),Z.value?(o(),s("button",{key:0,type:"button",class:"btn btn-primary",onClick:pl}," View Apps Status ")):(o(),s("div",Tn,[r.value=="Application Installation"&&Nt.value?(o(),s("button",{key:0,class:"btn btn-outline-danger ms-auto me-1",onClick:e[52]||(e[52]=t=>Ml()),disabled:pe.value||Ge.value||At.value,title:"Writes, reads, and deletes a temporary object in the selected bucket."},d(Ge.value?"Checking...":"Storage Check"),9,Rn)):c("",!0),r.value=="Application Installation"?(o(),s("button",{key:1,class:"btn btn-danger ms-auto me-1",onClick:gl,disabled:pe.value||Ae.value||!se.value||!!S.value},d(Ae.value?"Checking...":"Spec Check"),9,Mn)):c("",!0),l("button",{class:"btn btn-primary ms-auto",onClick:bl,disabled:Nl.value},d(pe.value?"Deploying…":"Deploy"),9,Pn)]))])])],2)],10,ba)}}}),Bn=aa(Un,[["__scopeId","data-v-f8b6bfa2"]]);export{Bn as A,$n as p}; diff --git a/src/main/resources/static/assets/applicationInstallationForm-xd8qJ2_F.css b/src/main/resources/static/assets/applicationInstallationForm-xd8qJ2_F.css new file mode 100644 index 0000000..fc82172 --- /dev/null +++ b/src/main/resources/static/assets/applicationInstallationForm-xd8qJ2_F.css @@ -0,0 +1 @@ +.install-embedded[data-v-f8b6bfa2]{width:100%}.install-embedded-dialog[data-v-f8b6bfa2]{width:100%;max-width:960px;margin:0 auto}.install-embedded-body[data-v-f8b6bfa2]{overflow-y:visible}.w-80-per[data-v-f8b6bfa2]{width:80%!important}.w-90-per[data-v-f8b6bfa2]{width:90%!important} diff --git a/src/main/resources/static/assets/createVueComponent-DOVlSFKE.js b/src/main/resources/static/assets/createVueComponent-DOVlSFKE.js new file mode 100644 index 0000000..86fa9ca --- /dev/null +++ b/src/main/resources/static/assets/createVueComponent-DOVlSFKE.js @@ -0,0 +1,11 @@ +import{M as r}from"./index-D89BCYsX.js";/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */var s={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/** + * @license @tabler/icons-vue v3.22.0 - MIT + * + * This source code is licensed under the MIT license. + * See the LICENSE file in the root directory of this source tree. + */const m=(t,a,f,h)=>({color:o="currentColor",size:l=24,stroke:w=2,title:i,class:g,...c},{attrs:d,slots:n})=>{let e=[...h.map(u=>r(...u)),...n.default?[n.default()]:[]];return i&&(e=[r("title",i),...e]),r("svg",{...s[t],width:l,height:l,...d,class:["tabler-icon",`tabler-icon-${a}`],...t==="filled"?{fill:o}:{"stroke-width":w??s[t]["stroke-width"],stroke:o},...c},e)};export{m as c}; diff --git a/src/main/resources/static/assets/index-D89BCYsX.js b/src/main/resources/static/assets/index-D89BCYsX.js new file mode 100644 index 0000000..3c835ab --- /dev/null +++ b/src/main/resources/static/assets/index-D89BCYsX.js @@ -0,0 +1,42 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OssList-L1_lVc8d.js","assets/IconPlus-CDLv8nZC.js","assets/createVueComponent-DOVlSFKE.js","assets/Tabulator.vue_vue_type_style_index_0_lang-DdZDJSEi.js","assets/Tabulator-C0-hRjAn.css","assets/request-CuP4O-bn.js","assets/bootstrap.esm-Ceob_0pG.js","assets/YamlGenerate-CY7vMkIK.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/YamlGenerate-B5_cwrRZ.css","assets/InstallSoftwareIframe-Dl_2Qi7t.js","assets/applicationInstallationForm-CeRjQOiG.js","assets/lodash-QU4yi6a5.js","assets/softwareCatalog-CAQVjm80.js","assets/applicationInstallationForm-xd8qJ2_F.css","assets/InstallSoftwareIframe-DWV8wQFf.css","assets/SoftwareCatalog-qoXeieRx.js","assets/applicationDetailModal-B5NPsj3q.js","assets/applicationDetailModal-BFNmmqoF.css","assets/SoftwareCatalog-KiPa5CHK.css","assets/ApplicationStatus-BKVG0wix.js","assets/ApplicationStatus-DB1vt_4c.css","assets/ApplicationRepository-BBRiVMU8.js","assets/RepositoryList-e6fBx0-3.js","assets/repository-CPO7R4t0.js","assets/RepositoryDetail-DCPVJP7B.js","assets/SoftwareCatalogListTest-v-qS7pn0.js","assets/SoftwareCatalogListTest-C5HTJg28.css"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();/** +* @vue/shared v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**//*! #__NO_SIDE_EFFECTS__ */function Ca(e,t){const n=new Set(e.split(","));return s=>n.has(s)}const Me={},$s=[],cn=()=>{},Lm=()=>!1,Ii=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Sa=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Ta=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Dm=Object.prototype.hasOwnProperty,Ie=(e,t)=>Dm.call(e,t),ee=Array.isArray,Fs=e=>Ar(e)==="[object Map]",Ws=e=>Ar(e)==="[object Set]",Rc=e=>Ar(e)==="[object Date]",fe=e=>typeof e=="function",qe=e=>typeof e=="string",fn=e=>typeof e=="symbol",$e=e=>e!==null&&typeof e=="object",nf=e=>($e(e)||fe(e))&&fe(e.then)&&fe(e.catch),sf=Object.prototype.toString,Ar=e=>sf.call(e),Nm=e=>Ar(e).slice(8,-1),rf=e=>Ar(e)==="[object Object]",Aa=e=>qe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ar=Ca(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Li=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},km=/-(\w)/g,Gt=Li(e=>e.replace(km,(t,n)=>n?n.toUpperCase():"")),Mm=/\B([A-Z])/g,gs=Li(e=>e.replace(Mm,"-$1").toLowerCase()),Di=Li(e=>e.charAt(0).toUpperCase()+e.slice(1)),ui=Li(e=>e?`on${Di(e)}`:""),Bn=(e,t)=>!Object.is(e,t),fi=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},yi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$m=e=>{const t=qe(e)?Number(e):NaN;return isNaN(t)?e:t};let Pc;const af=()=>Pc||(Pc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Or(e){if(ee(e)){const t={};for(let n=0;n{if(n){const s=n.split(jm);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Hn(e){let t="";if(qe(e))t=e;else if(ee(e))for(let n=0;nds(n,t))}const cf=e=>!!(e&&e.__v_isRef===!0),xa=e=>qe(e)?e:e==null?"":ee(e)||$e(e)&&(e.toString===sf||!fe(e.toString))?cf(e)?xa(e.value):JSON.stringify(e,uf,2):String(e),uf=(e,t)=>cf(t)?uf(e,t.value):Fs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,i],o)=>(n[Do(s,o)+" =>"]=i,n),{})}:Ws(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Do(n))}:fn(t)?Do(t):$e(t)&&!ee(t)&&!rf(t)?String(t):t,Do=(e,t="")=>{var n;return fn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +* @vue/reactivity v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let mt;class ff{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=mt,!t&&mt&&(this.index=(mt.scopes||(mt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0)return;let e;for(;lr;){let t=lr;for(lr=void 0;t;){const n=t.nextEffect;if(t.nextEffect=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function gf(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _f(e){let t,n=e.depsTail;for(let s=n;s;s=s.prevDep)s.version===-1?(s===n&&(n=s.prevDep),Ia(s),zm(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0;e.deps=t,e.depsTail=n}function Zo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&bf(t.dep.computed)===!1||t.dep.version!==t.version)return!0;return!!e._dirty}function bf(e){if(e.flags&2)return!1;if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===gr))return;e.globalVersion=gr;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&!Zo(e)){e.flags&=-3;return}const n=ke,s=zt;ke=e,zt=!0;try{gf(e);const i=e.fn(e._value);(t.version===0||Bn(i,e._value))&&(e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ke=n,zt=s,_f(e),e.flags&=-3}}function Ia(e){const{dep:t,prevSub:n,nextSub:s}=e;if(n&&(n.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=n,e.nextSub=void 0),t.subs===e&&(t.subs=n),!t.subs&&t.computed){t.computed.flags&=-5;for(let i=t.computed.deps;i;i=i.nextDep)Ia(i)}}function zm(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let zt=!0;const yf=[];function Un(){yf.push(zt),zt=!1}function qn(){const e=yf.pop();zt=e===void 0?!0:e}function Ic(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ke;ke=void 0;try{t()}finally{ke=n}}}let gr=0;class La{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!ke||!zt||ke===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ke)n=this.activeLink={dep:this,sub:ke,version:this.version,nextDep:void 0,prevDep:void 0,nextSub:void 0,prevSub:void 0,prevActiveLink:void 0},ke.deps?(n.prevDep=ke.depsTail,ke.depsTail.nextDep=n,ke.depsTail=n):ke.deps=ke.depsTail=n,ke.flags&4&&vf(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=ke.depsTail,n.nextDep=void 0,ke.depsTail.nextDep=n,ke.depsTail=n,ke.deps===n&&(ke.deps=s)}return n}trigger(t){this.version++,gr++,this.notify(t)}notify(t){Ra();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()}finally{Pa()}}}function vf(e){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)vf(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}const vi=new WeakMap,cs=Symbol(""),ea=Symbol(""),_r=Symbol("");function ot(e,t,n){if(zt&&ke){let s=vi.get(e);s||vi.set(e,s=new Map);let i=s.get(n);i||s.set(n,i=new La),i.track()}}function En(e,t,n,s,i,o){const a=vi.get(e);if(!a){gr++;return}let c=[];if(t==="clear")c=[...a.values()];else{const f=ee(e),p=f&&Aa(n);if(f&&n==="length"){const d=Number(s);a.forEach((m,b)=>{(b==="length"||b===_r||!fn(b)&&b>=d)&&c.push(m)})}else{const d=m=>m&&c.push(m);switch(n!==void 0&&d(a.get(n)),p&&d(a.get(_r)),t){case"add":f?p&&d(a.get("length")):(d(a.get(cs)),Fs(e)&&d(a.get(ea)));break;case"delete":f||(d(a.get(cs)),Fs(e)&&d(a.get(ea)));break;case"set":Fs(e)&&d(a.get(cs));break}}}Ra();for(const f of c)f.trigger();Pa()}function Km(e,t){var n;return(n=vi.get(e))==null?void 0:n.get(t)}function Is(e){const t=Ee(e);return t===e?t:(ot(t,"iterate",_r),Kt(e)?t:t.map(it))}function Ni(e){return ot(e=Ee(e),"iterate",_r),e}const Gm={__proto__:null,[Symbol.iterator](){return ko(this,Symbol.iterator,it)},concat(...e){return Is(this).concat(...e.map(t=>ee(t)?Is(t):t))},entries(){return ko(this,"entries",e=>(e[1]=it(e[1]),e))},every(e,t){return gn(this,"every",e,t,void 0,arguments)},filter(e,t){return gn(this,"filter",e,t,n=>n.map(it),arguments)},find(e,t){return gn(this,"find",e,t,it,arguments)},findIndex(e,t){return gn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gn(this,"findLast",e,t,it,arguments)},findLastIndex(e,t){return gn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Mo(this,"includes",e)},indexOf(...e){return Mo(this,"indexOf",e)},join(e){return Is(this).join(e)},lastIndexOf(...e){return Mo(this,"lastIndexOf",e)},map(e,t){return gn(this,"map",e,t,void 0,arguments)},pop(){return tr(this,"pop")},push(...e){return tr(this,"push",e)},reduce(e,...t){return Lc(this,"reduce",e,t)},reduceRight(e,...t){return Lc(this,"reduceRight",e,t)},shift(){return tr(this,"shift")},some(e,t){return gn(this,"some",e,t,void 0,arguments)},splice(...e){return tr(this,"splice",e)},toReversed(){return Is(this).toReversed()},toSorted(e){return Is(this).toSorted(e)},toSpliced(...e){return Is(this).toSpliced(...e)},unshift(...e){return tr(this,"unshift",e)},values(){return ko(this,"values",it)}};function ko(e,t,n){const s=Ni(e),i=s[t]();return s!==e&&!Kt(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.value&&(o.value=n(o.value)),o}),i}const Jm=Array.prototype;function gn(e,t,n,s,i,o){const a=Ni(e),c=a!==e&&!Kt(e),f=a[t];if(f!==Jm[t]){const m=f.apply(e,o);return c?it(m):m}let p=n;a!==e&&(c?p=function(m,b){return n.call(this,it(m),b,e)}:n.length>2&&(p=function(m,b){return n.call(this,m,b,e)}));const d=f.call(a,p,s);return c&&i?i(d):d}function Lc(e,t,n,s){const i=Ni(e);let o=n;return i!==e&&(Kt(e)?n.length>3&&(o=function(a,c,f){return n.call(this,a,c,f,e)}):o=function(a,c,f){return n.call(this,a,it(c),f,e)}),i[t](o,...s)}function Mo(e,t,n){const s=Ee(e);ot(s,"iterate",_r);const i=s[t](...n);return(i===-1||i===!1)&&Ma(n[0])?(n[0]=Ee(n[0]),s[t](...n)):i}function tr(e,t,n=[]){Un(),Ra();const s=Ee(e)[t].apply(e,n);return Pa(),qn(),s}const Xm=Ca("__proto__,__v_isRef,__isVue"),wf=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(fn));function Qm(e){fn(e)||(e=String(e));const t=Ee(this);return ot(t,"has",e),t.hasOwnProperty(e)}class Ef{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return s===(i?o?ug:Af:o?Tf:Sf).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=ee(t);if(!i){let f;if(a&&(f=Gm[n]))return f;if(n==="hasOwnProperty")return Qm}const c=Reflect.get(t,n,ze(t)?t:s);return(fn(n)?wf.has(n):Xm(n))||(i||ot(t,"get",n),o)?c:ze(c)?a&&Aa(n)?c:c.value:$e(c)?i?xf(c):xr(c):c}}class Cf extends Ef{constructor(t=!1){super(!1,t)}set(t,n,s,i){let o=t[n];if(!this._isShallow){const f=hs(o);if(!Kt(s)&&!hs(s)&&(o=Ee(o),s=Ee(s)),!ee(t)&&ze(o)&&!ze(s))return f?!1:(o.value=s,!0)}const a=ee(t)&&Aa(n)?Number(n)e,ki=e=>Reflect.getPrototypeOf(e);function si(e,t,n=!1,s=!1){e=e.__v_raw;const i=Ee(e),o=Ee(t);n||(Bn(t,o)&&ot(i,"get",t),ot(i,"get",o));const{has:a}=ki(i),c=s?Da:n?Fa:it;if(a.call(i,t))return c(e.get(t));if(a.call(i,o))return c(e.get(o));e!==i&&e.get(t)}function ri(e,t=!1){const n=this.__v_raw,s=Ee(n),i=Ee(e);return t||(Bn(e,i)&&ot(s,"has",e),ot(s,"has",i)),e===i?n.has(e):n.has(e)||n.has(i)}function ii(e,t=!1){return e=e.__v_raw,!t&&ot(Ee(e),"iterate",cs),Reflect.get(e,"size",e)}function Dc(e,t=!1){!t&&!Kt(e)&&!hs(e)&&(e=Ee(e));const n=Ee(this);return ki(n).has.call(n,e)||(n.add(e),En(n,"add",e,e)),this}function Nc(e,t,n=!1){!n&&!Kt(t)&&!hs(t)&&(t=Ee(t));const s=Ee(this),{has:i,get:o}=ki(s);let a=i.call(s,e);a||(e=Ee(e),a=i.call(s,e));const c=o.call(s,e);return s.set(e,t),a?Bn(t,c)&&En(s,"set",e,t):En(s,"add",e,t),this}function kc(e){const t=Ee(this),{has:n,get:s}=ki(t);let i=n.call(t,e);i||(e=Ee(e),i=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return i&&En(t,"delete",e,void 0),o}function Mc(){const e=Ee(this),t=e.size!==0,n=e.clear();return t&&En(e,"clear",void 0,void 0),n}function oi(e,t){return function(s,i){const o=this,a=o.__v_raw,c=Ee(a),f=t?Da:e?Fa:it;return!e&&ot(c,"iterate",cs),a.forEach((p,d)=>s.call(i,f(p),f(d),o))}}function ai(e,t,n){return function(...s){const i=this.__v_raw,o=Ee(i),a=Fs(o),c=e==="entries"||e===Symbol.iterator&&a,f=e==="keys"&&a,p=i[e](...s),d=n?Da:t?Fa:it;return!t&&ot(o,"iterate",f?ea:cs),{next(){const{value:m,done:b}=p.next();return b?{value:m,done:b}:{value:c?[d(m[0]),d(m[1])]:d(m),done:b}},[Symbol.iterator](){return this}}}}function Rn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ng(){const e={get(o){return si(this,o)},get size(){return ii(this)},has:ri,add:Dc,set:Nc,delete:kc,clear:Mc,forEach:oi(!1,!1)},t={get(o){return si(this,o,!1,!0)},get size(){return ii(this)},has:ri,add(o){return Dc.call(this,o,!0)},set(o,a){return Nc.call(this,o,a,!0)},delete:kc,clear:Mc,forEach:oi(!1,!0)},n={get(o){return si(this,o,!0)},get size(){return ii(this,!0)},has(o){return ri.call(this,o,!0)},add:Rn("add"),set:Rn("set"),delete:Rn("delete"),clear:Rn("clear"),forEach:oi(!0,!1)},s={get(o){return si(this,o,!0,!0)},get size(){return ii(this,!0)},has(o){return ri.call(this,o,!0)},add:Rn("add"),set:Rn("set"),delete:Rn("delete"),clear:Rn("clear"),forEach:oi(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=ai(o,!1,!1),n[o]=ai(o,!0,!1),t[o]=ai(o,!1,!0),s[o]=ai(o,!0,!0)}),[e,n,t,s]}const[sg,rg,ig,og]=ng();function Na(e,t){const n=t?e?og:ig:e?rg:sg;return(s,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(Ie(n,i)&&i in s?n:s,i,o)}const ag={get:Na(!1,!1)},lg={get:Na(!1,!0)},cg={get:Na(!0,!1)};const Sf=new WeakMap,Tf=new WeakMap,Af=new WeakMap,ug=new WeakMap;function fg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dg(e){return e.__v_skip||!Object.isExtensible(e)?0:fg(Nm(e))}function xr(e){return hs(e)?e:ka(e,!1,Zm,ag,Sf)}function Of(e){return ka(e,!1,tg,lg,Tf)}function xf(e){return ka(e,!0,eg,cg,Af)}function ka(e,t,n,s,i){if(!$e(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=i.get(e);if(o)return o;const a=dg(e);if(a===0)return e;const c=new Proxy(e,a===2?s:n);return i.set(e,c),c}function Fn(e){return hs(e)?Fn(e.__v_raw):!!(e&&e.__v_isReactive)}function hs(e){return!!(e&&e.__v_isReadonly)}function Kt(e){return!!(e&&e.__v_isShallow)}function Ma(e){return e?!!e.__v_raw:!1}function Ee(e){const t=e&&e.__v_raw;return t?Ee(t):e}function $a(e){return Object.isExtensible(e)&&of(e,"__v_skip",!0),e}const it=e=>$e(e)?xr(e):e,Fa=e=>$e(e)?xf(e):e;function ze(e){return e?e.__v_isRef===!0:!1}function ja(e){return Rf(e,!1)}function hg(e){return Rf(e,!0)}function Rf(e,t){return ze(e)?e:new pg(e,t)}class pg{constructor(t,n){this.dep=new La,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ee(t),this._value=n?t:it(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Kt(t)||hs(t);t=s?t:Ee(t),Bn(t,n)&&(this._rawValue=t,this._value=s?t:it(t),this.dep.trigger())}}function jn(e){return ze(e)?e.value:e}const mg={get:(e,t,n)=>t==="__v_raw"?e:jn(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const i=e[t];return ze(i)&&!ze(n)?(i.value=n,!0):Reflect.set(e,t,n,s)}};function Pf(e){return Fn(e)?e:new Proxy(e,mg)}function gg(e){const t=ee(e)?new Array(e.length):{};for(const n in e)t[n]=bg(e,n);return t}class _g{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Km(Ee(this._object),this._key)}}function bg(e,t,n){const s=e[t];return ze(s)?s:new _g(e,t,n)}class yg{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new La(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gr-1,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){ke!==this&&(this.flags|=16,this.dep.notify())}get value(){const t=this.dep.track();return bf(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function vg(e,t,n=!1){let s,i;return fe(e)?s=e:(s=e.get,i=e.set),new yg(s,i,n)}const li={},wi=new WeakMap;let os;function wg(e,t=!1,n=os){if(n){let s=wi.get(n);s||wi.set(n,s=[]),s.push(e)}}function Eg(e,t,n=Me){const{immediate:s,deep:i,once:o,scheduler:a,augmentJob:c,call:f}=n,p=H=>i?H:Kt(H)||i===!1||i===0?vn(H,1):vn(H);let d,m,b,w,C=!1,P=!1;if(ze(e)?(m=()=>e.value,C=Kt(e)):Fn(e)?(m=()=>p(e),C=!0):ee(e)?(P=!0,C=e.some(H=>Fn(H)||Kt(H)),m=()=>e.map(H=>{if(ze(H))return H.value;if(Fn(H))return p(H);if(fe(H))return f?f(H,2):H()})):fe(e)?t?m=f?()=>f(e,2):e:m=()=>{if(b){Un();try{b()}finally{qn()}}const H=os;os=d;try{return f?f(e,3,[w]):e(w)}finally{os=H}}:m=cn,t&&i){const H=m,Y=i===!0?1/0:i;m=()=>vn(H(),Y)}const R=hf(),$=()=>{d.stop(),R&&Ta(R.effects,d)};if(o)if(t){const H=t;t=(...Y)=>{H(...Y),$()}}else{const H=m;m=()=>{H(),$()}}let N=P?new Array(e.length).fill(li):li;const B=H=>{if(!(!(d.flags&1)||!d.dirty&&!H))if(t){const Y=d.run();if(i||C||(P?Y.some((ge,le)=>Bn(ge,N[le])):Bn(Y,N))){b&&b();const ge=os;os=d;try{const le=[Y,N===li?void 0:P&&N[0]===li?[]:N,w];f?f(t,3,le):t(...le),N=Y}finally{os=ge}}}else d.run()};return c&&c(B),d=new pf(m),d.scheduler=a?()=>a(B,!1):B,w=H=>wg(H,!1,d),b=d.onStop=()=>{const H=wi.get(d);if(H){if(f)f(H,4);else for(const Y of H)Y();wi.delete(d)}},t?s?B(!0):N=d.run():a?a(B.bind(null,!0),!0):d.run(),$.pause=d.pause.bind(d),$.resume=d.resume.bind(d),$.stop=$,$}function vn(e,t=1/0,n){if(t<=0||!$e(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,ze(e))vn(e.value,t,n);else if(ee(e))for(let s=0;s{vn(s,t,n)});else if(rf(e)){for(const s in e)vn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&vn(e[s],t,n)}return e}/** +* @vue/runtime-core v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Rr(e,t,n,s){try{return s?e(...s):e()}catch(i){Mi(i,t,n)}}function Jt(e,t,n,s){if(fe(e)){const i=Rr(e,t,n,s);return i&&nf(i)&&i.catch(o=>{Mi(o,t,n)}),i}if(ee(e)){const i=[];for(let o=0;o>>1,i=gt[s],o=yr(i);o=yr(n)?gt.push(e):gt.splice(Sg(t),0,e),e.flags|=1,Lf()}}function Lf(){!br&&!ta&&(ta=!0,Ba=If.then(Nf))}function Tg(e){ee(e)?js.push(...e):kn&&e.id===-1?kn.splice(Ns+1,0,e):e.flags&1||(js.push(e),e.flags|=1),Lf()}function $c(e,t,n=br?an+1:0){for(;nyr(n)-yr(s));if(js.length=0,kn){kn.push(...t);return}for(kn=t,Ns=0;Nse.id==null?e.flags&2?-1:1/0:e.id;function Nf(e){ta=!1,br=!0;try{for(an=0;an{s._d&&Kc(-1);const o=Ei(t);let a;try{a=e(...i)}finally{Ei(o),s._d&&Kc(1)}return a};return s._n=!0,s._c=!0,s._d=!0,s}function n0(e,t){if(Je===null)return e;const n=Ui(Je),s=e.dirs||(e.dirs=[]);for(let i=0;ie.__isTeleport,Ls=Symbol("_leaveCb"),ci=Symbol("_enterCb");function xg(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Bf(()=>{e.isMounted=!0}),Vf(()=>{e.isUnmounting=!0}),e}const $t=[Function,Array],Rg={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$t,onEnter:$t,onAfterEnter:$t,onEnterCancelled:$t,onBeforeLeave:$t,onLeave:$t,onAfterLeave:$t,onLeaveCancelled:$t,onBeforeAppear:$t,onAppear:$t,onAfterAppear:$t,onAppearCancelled:$t};function Pg(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function na(e,t,n,s,i){const{appear:o,mode:a,persisted:c=!1,onBeforeEnter:f,onEnter:p,onAfterEnter:d,onEnterCancelled:m,onBeforeLeave:b,onLeave:w,onAfterLeave:C,onLeaveCancelled:P,onBeforeAppear:R,onAppear:$,onAfterAppear:N,onAppearCancelled:B}=t,H=String(e.key),Y=Pg(n,e),ge=(q,oe)=>{q&&Jt(q,s,9,oe)},le=(q,oe)=>{const ve=oe[1];ge(q,oe),ee(q)?q.every(G=>G.length<=1)&&ve():q.length<=1&&ve()},te={mode:a,persisted:c,beforeEnter(q){let oe=f;if(!n.isMounted)if(o)oe=R||f;else return;q[Ls]&&q[Ls](!0);const ve=Y[H];ve&&ks(e,ve)&&ve.el[Ls]&&ve.el[Ls](),ge(oe,[q])},enter(q){let oe=p,ve=d,G=m;if(!n.isMounted)if(o)oe=$||p,ve=N||d,G=B||m;else return;let be=!1;const He=q[ci]=st=>{be||(be=!0,st?ge(G,[q]):ge(ve,[q]),te.delayedLeave&&te.delayedLeave(),q[ci]=void 0)};oe?le(oe,[q,He]):He()},leave(q,oe){const ve=String(e.key);if(q[ci]&&q[ci](!0),n.isUnmounting)return oe();ge(b,[q]);let G=!1;const be=q[Ls]=He=>{G||(G=!0,oe(),He?ge(P,[q]):ge(C,[q]),q[Ls]=void 0,Y[ve]===e&&delete Y[ve])};Y[ve]=e,w?le(w,[q,be]):be()},clone(q){return na(q,t,n,s)}};return te}function vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Mf(e,t=!1,n){let s=[],i=0;for(let o=0;o1)for(let o=0;osa(C,t&&(ee(t)?t[P]:t),n,s,i));return}if(Bs(s)&&!i)return;const o=s.shapeFlag&4?Ui(s.component):s.el,a=i?null:o,{i:c,r:f}=e,p=t&&t.r,d=c.refs===Me?c.refs={}:c.refs,m=c.setupState,b=Ee(m),w=m===Me?()=>!1:C=>Ie(b,C);if(p!=null&&p!==f&&(qe(p)?(d[p]=null,w(p)&&(m[p]=null)):ze(p)&&(p.value=null)),fe(f))Rr(f,c,12,[a,d]);else{const C=qe(f),P=ze(f);if(C||P){const R=()=>{if(e.f){const $=C?w(f)?m[f]:d[f]:f.value;i?ee($)&&Ta($,o):ee($)?$.includes(o)||$.push(o):C?(d[f]=[o],w(f)&&(m[f]=d[f])):(f.value=[o],e.k&&(d[e.k]=f.value))}else C?(d[f]=a,w(f)&&(m[f]=a)):P&&(f.value=a,e.k&&(d[e.k]=a))};a?(R.id=-1,St(R,n)):R()}}}const Bs=e=>!!e.type.__asyncLoader,Ff=e=>e.type.__isKeepAlive;function Ig(e,t){jf(e,"a",t)}function Lg(e,t){jf(e,"da",t)}function jf(e,t,n=Ze){const s=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if($i(t,s,n),n){let i=n.parent;for(;i&&i.parent;)Ff(i.parent.vnode)&&Dg(s,t,n,i),i=i.parent}}function Dg(e,t,n,s){const i=$i(t,e,s,!0);Uf(()=>{Ta(s[t],i)},n)}function $i(e,t,n=Ze,s=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...a)=>{Un();const c=Lr(n),f=Jt(t,n,e,a);return c(),qn(),f});return s?i.unshift(o):i.push(o),o}}const Tn=e=>(t,n=Ze)=>{(!Vi||e==="sp")&&$i(e,(...s)=>t(...s),n)},Ng=Tn("bm"),Bf=Tn("m"),kg=Tn("bu"),Hf=Tn("u"),Vf=Tn("bum"),Uf=Tn("um"),Mg=Tn("sp"),$g=Tn("rtg"),Fg=Tn("rtc");function jg(e,t=Ze){$i("ec",e,t)}const qf="components";function cr(e,t){return zf(qf,e,!0,t)||e}const Wf=Symbol.for("v-ndc");function Va(e){return qe(e)?zf(qf,e,!1)||e:e||Wf}function zf(e,t,n=!0,s=!1){const i=Je||Ze;if(i){const o=i.type;{const c=O_(o,!1);if(c&&(c===t||c===Gt(t)||c===Di(Gt(t))))return o}const a=Fc(i[e]||o[e],t)||Fc(i.appContext[e],t);return!a&&s?o:a}}function Fc(e,t){return e&&(e[t]||e[Gt(t)]||e[Di(Gt(t))])}function jc(e,t,n,s){let i;const o=n,a=ee(e);if(a||qe(e)){const c=a&&Fn(e);c&&(e=Ni(e)),i=new Array(e.length);for(let f=0,p=e.length;ft(c,f,void 0,o));else{const c=Object.keys(e);i=new Array(c.length);for(let f=0,p=c.length;fSi(t)?!(t.type===Sn||t.type===tt&&!Kf(t.children)):!0)?e:null}function Hg(e,t){const n={};for(const s in e)n[ui(s)]=e[s];return n}const ra=e=>e?pd(e)?Ui(e):ra(e.parent):null,ur=Ge(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ra(e.parent),$root:e=>ra(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ua(e),$forceUpdate:e=>e.f||(e.f=()=>{Ha(e.update)}),$nextTick:e=>e.n||(e.n=Pr.bind(e.proxy)),$watch:e=>c_.bind(e)}),$o=(e,t)=>e!==Me&&!e.__isScriptSetup&&Ie(e,t),Vg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:o,accessCache:a,type:c,appContext:f}=e;let p;if(t[0]!=="$"){const w=a[t];if(w!==void 0)switch(w){case 1:return s[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if($o(s,t))return a[t]=1,s[t];if(i!==Me&&Ie(i,t))return a[t]=2,i[t];if((p=e.propsOptions[0])&&Ie(p,t))return a[t]=3,o[t];if(n!==Me&&Ie(n,t))return a[t]=4,n[t];ia&&(a[t]=0)}}const d=ur[t];let m,b;if(d)return t==="$attrs"&&ot(e.attrs,"get",""),d(e);if((m=c.__cssModules)&&(m=m[t]))return m;if(n!==Me&&Ie(n,t))return a[t]=4,n[t];if(b=f.config.globalProperties,Ie(b,t))return b[t]},set({_:e},t,n){const{data:s,setupState:i,ctx:o}=e;return $o(i,t)?(i[t]=n,!0):s!==Me&&Ie(s,t)?(s[t]=n,!0):Ie(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:i,propsOptions:o}},a){let c;return!!n[a]||e!==Me&&Ie(e,a)||$o(t,a)||(c=o[0])&&Ie(c,a)||Ie(s,a)||Ie(ur,a)||Ie(i.config.globalProperties,a)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ie(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Bc(e){return ee(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ia=!0;function Ug(e){const t=Ua(e),n=e.proxy,s=e.ctx;ia=!1,t.beforeCreate&&Hc(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:a,watch:c,provide:f,inject:p,created:d,beforeMount:m,mounted:b,beforeUpdate:w,updated:C,activated:P,deactivated:R,beforeDestroy:$,beforeUnmount:N,destroyed:B,unmounted:H,render:Y,renderTracked:ge,renderTriggered:le,errorCaptured:te,serverPrefetch:q,expose:oe,inheritAttrs:ve,components:G,directives:be,filters:He}=t;if(p&&qg(p,s,null),a)for(const ae in a){const Se=a[ae];fe(Se)&&(s[ae]=Se.bind(n))}if(i){const ae=i.call(n,n);$e(ae)&&(e.data=xr(ae))}if(ia=!0,o)for(const ae in o){const Se=o[ae],Pt=fe(Se)?Se.bind(n,n):fe(Se.get)?Se.get.bind(n,n):cn,I=!fe(Se)&&fe(Se.set)?Se.set.bind(n):cn,_t=Ft({get:Pt,set:I});Object.defineProperty(s,ae,{enumerable:!0,configurable:!0,get:()=>_t.value,set:et=>_t.value=et})}if(c)for(const ae in c)Gf(c[ae],s,n,ae);if(f){const ae=fe(f)?f.call(n):f;Reflect.ownKeys(ae).forEach(Se=>{di(Se,ae[Se])})}d&&Hc(d,e,"c");function Oe(ae,Se){ee(Se)?Se.forEach(Pt=>ae(Pt.bind(n))):Se&&ae(Se.bind(n))}if(Oe(Ng,m),Oe(Bf,b),Oe(kg,w),Oe(Hf,C),Oe(Ig,P),Oe(Lg,R),Oe(jg,te),Oe(Fg,ge),Oe($g,le),Oe(Vf,N),Oe(Uf,H),Oe(Mg,q),ee(oe))if(oe.length){const ae=e.exposed||(e.exposed={});oe.forEach(Se=>{Object.defineProperty(ae,Se,{get:()=>n[Se],set:Pt=>n[Se]=Pt})})}else e.exposed||(e.exposed={});Y&&e.render===cn&&(e.render=Y),ve!=null&&(e.inheritAttrs=ve),G&&(e.components=G),be&&(e.directives=be),q&&$f(e)}function qg(e,t,n=cn){ee(e)&&(e=oa(e));for(const s in e){const i=e[s];let o;$e(i)?"default"in i?o=xt(i.from||s,i.default,!0):o=xt(i.from||s):o=xt(i),ze(o)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):t[s]=o}}function Hc(e,t,n){Jt(ee(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Gf(e,t,n,s){let i=s.includes(".")?ld(n,s):()=>n[s];if(qe(e)){const o=t[e];fe(o)&&fr(i,o)}else if(fe(e))fr(i,e.bind(n));else if($e(e))if(ee(e))e.forEach(o=>Gf(o,t,n,s));else{const o=fe(e.handler)?e.handler.bind(n):t[e.handler];fe(o)&&fr(i,o,e)}}function Ua(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,c=o.get(t);let f;return c?f=c:!i.length&&!n&&!s?f=t:(f={},i.length&&i.forEach(p=>Ci(f,p,a,!0)),Ci(f,t,a)),$e(t)&&o.set(t,f),f}function Ci(e,t,n,s=!1){const{mixins:i,extends:o}=t;o&&Ci(e,o,n,!0),i&&i.forEach(a=>Ci(e,a,n,!0));for(const a in t)if(!(s&&a==="expose")){const c=Wg[a]||n&&n[a];e[a]=c?c(e[a],t[a]):t[a]}return e}const Wg={data:Vc,props:Uc,emits:Uc,methods:or,computed:or,beforeCreate:pt,created:pt,beforeMount:pt,mounted:pt,beforeUpdate:pt,updated:pt,beforeDestroy:pt,beforeUnmount:pt,destroyed:pt,unmounted:pt,activated:pt,deactivated:pt,errorCaptured:pt,serverPrefetch:pt,components:or,directives:or,watch:Kg,provide:Vc,inject:zg};function Vc(e,t){return t?e?function(){return Ge(fe(e)?e.call(this,this):e,fe(t)?t.call(this,this):t)}:t:e}function zg(e,t){return or(oa(e),oa(t))}function oa(e){if(ee(e)){const t={};for(let n=0;n1)return n&&fe(t)?t.call(s&&s.proxy):t}}function Xg(){return!!(Ze||Je||us)}const Xf={},Qf=()=>Object.create(Xf),Yf=e=>Object.getPrototypeOf(e)===Xf;function Qg(e,t,n,s=!1){const i={},o=Qf();e.propsDefaults=Object.create(null),Zf(e,t,i,o);for(const a in e.propsOptions[0])a in i||(i[a]=void 0);n?e.props=s?i:Of(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function Yg(e,t,n,s){const{props:i,attrs:o,vnode:{patchFlag:a}}=e,c=Ee(i),[f]=e.propsOptions;let p=!1;if((s||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m{f=!0;const[b,w]=ed(m,t,!0);Ge(a,b),w&&c.push(...w)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!o&&!f)return $e(e)&&s.set(e,$s),$s;if(ee(o))for(let d=0;de[0]==="_"||e==="$stable",qa=e=>ee(e)?e.map(ln):[ln(e)],e_=(e,t,n)=>{if(t._n)return t;const s=Ir((...i)=>qa(t(...i)),n);return s._c=!1,s},nd=(e,t,n)=>{const s=e._ctx;for(const i in e){if(td(i))continue;const o=e[i];if(fe(o))t[i]=e_(i,o,s);else if(o!=null){const a=qa(o);t[i]=()=>a}}},sd=(e,t)=>{const n=qa(t);e.slots.default=()=>n},rd=(e,t,n)=>{for(const s in t)(n||s!=="_")&&(e[s]=t[s])},t_=(e,t,n)=>{const s=e.slots=Qf();if(e.vnode.shapeFlag&32){const i=t._;i?(rd(s,t,n),n&&of(s,"_",i,!0)):nd(t,s)}else t&&sd(e,t)},n_=(e,t,n)=>{const{vnode:s,slots:i}=e;let o=!0,a=Me;if(s.shapeFlag&32){const c=t._;c?n&&c===1?o=!1:rd(i,t,n):(o=!t.$stable,nd(t,i)),a=t}else t&&(sd(e,t),a={default:1});if(o)for(const c in i)!td(c)&&a[c]==null&&delete i[c]},St=g_;function s_(e){return r_(e)}function r_(e,t){const n=af();n.__VUE__=!0;const{insert:s,remove:i,patchProp:o,createElement:a,createText:c,createComment:f,setText:p,setElementText:d,parentNode:m,nextSibling:b,setScopeId:w=cn,insertStaticContent:C}=e,P=(g,_,E,D=null,O=null,k=null,W=void 0,V=null,F=!!_.dynamicChildren)=>{if(g===_)return;g&&!ks(g,_)&&(D=x(g),et(g,O,k,!0),g=null),_.patchFlag===-2&&(F=!1,_.dynamicChildren=null);const{type:M,ref:ne,shapeFlag:z}=_;switch(M){case ji:R(g,_,E,D);break;case Sn:$(g,_,E,D);break;case hi:g==null&&N(_,E,D,W);break;case tt:G(g,_,E,D,O,k,W,V,F);break;default:z&1?Y(g,_,E,D,O,k,W,V,F):z&6?be(g,_,E,D,O,k,W,V,F):(z&64||z&128)&&M.process(g,_,E,D,O,k,W,V,F,Z)}ne!=null&&O&&sa(ne,g&&g.ref,k,_||g,!_)},R=(g,_,E,D)=>{if(g==null)s(_.el=c(_.children),E,D);else{const O=_.el=g.el;_.children!==g.children&&p(O,_.children)}},$=(g,_,E,D)=>{g==null?s(_.el=f(_.children||""),E,D):_.el=g.el},N=(g,_,E,D)=>{[g.el,g.anchor]=C(g.children,_,E,D,g.el,g.anchor)},B=({el:g,anchor:_},E,D)=>{let O;for(;g&&g!==_;)O=b(g),s(g,E,D),g=O;s(_,E,D)},H=({el:g,anchor:_})=>{let E;for(;g&&g!==_;)E=b(g),i(g),g=E;i(_)},Y=(g,_,E,D,O,k,W,V,F)=>{_.type==="svg"?W="svg":_.type==="math"&&(W="mathml"),g==null?ge(_,E,D,O,k,W,V,F):q(g,_,O,k,W,V,F)},ge=(g,_,E,D,O,k,W,V)=>{let F,M;const{props:ne,shapeFlag:z,transition:Q,dirs:re}=g;if(F=g.el=a(g.type,k,ne&&ne.is,ne),z&8?d(F,g.children):z&16&&te(g.children,F,null,D,O,Fo(g,k),W,V),re&&ss(g,null,D,"created"),le(F,g,g.scopeId,W,D),ne){for(const Ce in ne)Ce!=="value"&&!ar(Ce)&&o(F,Ce,null,ne[Ce],k,D);"value"in ne&&o(F,"value",null,ne.value,k),(M=ne.onVnodeBeforeMount)&&rn(M,D,g)}re&&ss(g,null,D,"beforeMount");const pe=i_(O,Q);pe&&Q.beforeEnter(F),s(F,_,E),((M=ne&&ne.onVnodeMounted)||pe||re)&&St(()=>{M&&rn(M,D,g),pe&&Q.enter(F),re&&ss(g,null,D,"mounted")},O)},le=(g,_,E,D,O)=>{if(E&&w(g,E),D)for(let k=0;k{for(let M=F;M{const V=_.el=g.el;let{patchFlag:F,dynamicChildren:M,dirs:ne}=_;F|=g.patchFlag&16;const z=g.props||Me,Q=_.props||Me;let re;if(E&&rs(E,!1),(re=Q.onVnodeBeforeUpdate)&&rn(re,E,_,g),ne&&ss(_,g,E,"beforeUpdate"),E&&rs(E,!0),(z.innerHTML&&Q.innerHTML==null||z.textContent&&Q.textContent==null)&&d(V,""),M?oe(g.dynamicChildren,M,V,E,D,Fo(_,O),k):W||Se(g,_,V,null,E,D,Fo(_,O),k,!1),F>0){if(F&16)ve(V,z,Q,E,O);else if(F&2&&z.class!==Q.class&&o(V,"class",null,Q.class,O),F&4&&o(V,"style",z.style,Q.style,O),F&8){const pe=_.dynamicProps;for(let Ce=0;Ce{re&&rn(re,E,_,g),ne&&ss(_,g,E,"updated")},D)},oe=(g,_,E,D,O,k,W)=>{for(let V=0;V<_.length;V++){const F=g[V],M=_[V],ne=F.el&&(F.type===tt||!ks(F,M)||F.shapeFlag&70)?m(F.el):E;P(F,M,ne,null,D,O,k,W,!0)}},ve=(g,_,E,D,O)=>{if(_!==E){if(_!==Me)for(const k in _)!ar(k)&&!(k in E)&&o(g,k,_[k],null,O,D);for(const k in E){if(ar(k))continue;const W=E[k],V=_[k];W!==V&&k!=="value"&&o(g,k,V,W,O,D)}"value"in E&&o(g,"value",_.value,E.value,O)}},G=(g,_,E,D,O,k,W,V,F)=>{const M=_.el=g?g.el:c(""),ne=_.anchor=g?g.anchor:c("");let{patchFlag:z,dynamicChildren:Q,slotScopeIds:re}=_;re&&(V=V?V.concat(re):re),g==null?(s(M,E,D),s(ne,E,D),te(_.children||[],E,ne,O,k,W,V,F)):z>0&&z&64&&Q&&g.dynamicChildren?(oe(g.dynamicChildren,Q,E,O,k,W,V),(_.key!=null||O&&_===O.subTree)&&id(g,_,!0)):Se(g,_,E,ne,O,k,W,V,F)},be=(g,_,E,D,O,k,W,V,F)=>{_.slotScopeIds=V,g==null?_.shapeFlag&512?O.ctx.activate(_,E,D,W,F):He(_,E,D,O,k,W,F):st(g,_,F)},He=(g,_,E,D,O,k,W)=>{const V=g.component=E_(g,D,O);if(Ff(g)&&(V.ctx.renderer=Z),C_(V,!1,W),V.asyncDep){if(O&&O.registerDep(V,Oe,W),!g.el){const F=V.subTree=nt(Sn);$(null,F,_,E)}}else Oe(V,g,_,E,O,k,W)},st=(g,_,E)=>{const D=_.component=g.component;if(p_(g,_,E))if(D.asyncDep&&!D.asyncResolved){ae(D,_,E);return}else D.next=_,D.update();else _.el=g.el,D.vnode=_},Oe=(g,_,E,D,O,k,W)=>{const V=()=>{if(g.isMounted){let{next:z,bu:Q,u:re,parent:pe,vnode:Ce}=g;{const lt=od(g);if(lt){z&&(z.el=Ce.el,ae(g,z,W)),lt.asyncDep.then(()=>{g.isUnmounted||V()});return}}let ye=z,Xe;rs(g,!1),z?(z.el=Ce.el,ae(g,z,W)):z=Ce,Q&&fi(Q),(Xe=z.props&&z.props.onVnodeBeforeUpdate)&&rn(Xe,pe,z,Ce),rs(g,!0);const Qe=jo(g),at=g.subTree;g.subTree=Qe,P(at,Qe,m(at.el),x(at),g,O,k),z.el=Qe.el,ye===null&&m_(g,Qe.el),re&&St(re,O),(Xe=z.props&&z.props.onVnodeUpdated)&&St(()=>rn(Xe,pe,z,Ce),O)}else{let z;const{el:Q,props:re}=_,{bm:pe,m:Ce,parent:ye,root:Xe,type:Qe}=g,at=Bs(_);if(rs(g,!1),pe&&fi(pe),!at&&(z=re&&re.onVnodeBeforeMount)&&rn(z,ye,_),rs(g,!0),Q&&je){const lt=()=>{g.subTree=jo(g),je(Q,g.subTree,g,O,null)};at&&Qe.__asyncHydrate?Qe.__asyncHydrate(Q,g,lt):lt()}else{Xe.ce&&Xe.ce._injectChildStyle(Qe);const lt=g.subTree=jo(g);P(null,lt,E,D,g,O,k),_.el=lt.el}if(Ce&&St(Ce,O),!at&&(z=re&&re.onVnodeMounted)){const lt=_;St(()=>rn(z,ye,lt),O)}(_.shapeFlag&256||ye&&Bs(ye.vnode)&&ye.vnode.shapeFlag&256)&&g.a&&St(g.a,O),g.isMounted=!0,_=E=D=null}};g.scope.on();const F=g.effect=new pf(V);g.scope.off();const M=g.update=F.run.bind(F),ne=g.job=F.runIfDirty.bind(F);ne.i=g,ne.id=g.uid,F.scheduler=()=>Ha(ne),rs(g,!0),M()},ae=(g,_,E)=>{_.component=g;const D=g.vnode.props;g.vnode=_,g.next=null,Yg(g,_.props,D,E),n_(g,_.children,E),Un(),$c(g),qn()},Se=(g,_,E,D,O,k,W,V,F=!1)=>{const M=g&&g.children,ne=g?g.shapeFlag:0,z=_.children,{patchFlag:Q,shapeFlag:re}=_;if(Q>0){if(Q&128){I(M,z,E,D,O,k,W,V,F);return}else if(Q&256){Pt(M,z,E,D,O,k,W,V,F);return}}re&8?(ne&16&&Be(M,O,k),z!==M&&d(E,z)):ne&16?re&16?I(M,z,E,D,O,k,W,V,F):Be(M,O,k,!0):(ne&8&&d(E,""),re&16&&te(z,E,D,O,k,W,V,F))},Pt=(g,_,E,D,O,k,W,V,F)=>{g=g||$s,_=_||$s;const M=g.length,ne=_.length,z=Math.min(M,ne);let Q;for(Q=0;Qne?Be(g,O,k,!0,!1,z):te(_,E,D,O,k,W,V,F,z)},I=(g,_,E,D,O,k,W,V,F)=>{let M=0;const ne=_.length;let z=g.length-1,Q=ne-1;for(;M<=z&&M<=Q;){const re=g[M],pe=_[M]=F?Mn(_[M]):ln(_[M]);if(ks(re,pe))P(re,pe,E,null,O,k,W,V,F);else break;M++}for(;M<=z&&M<=Q;){const re=g[z],pe=_[Q]=F?Mn(_[Q]):ln(_[Q]);if(ks(re,pe))P(re,pe,E,null,O,k,W,V,F);else break;z--,Q--}if(M>z){if(M<=Q){const re=Q+1,pe=reQ)for(;M<=z;)et(g[M],O,k,!0),M++;else{const re=M,pe=M,Ce=new Map;for(M=pe;M<=Q;M++){const ct=_[M]=F?Mn(_[M]):ln(_[M]);ct.key!=null&&Ce.set(ct.key,M)}let ye,Xe=0;const Qe=Q-pe+1;let at=!1,lt=0;const Wn=new Array(Qe);for(M=0;M=Qe){et(ct,O,k,!0);continue}let It;if(ct.key!=null)It=Ce.get(ct.key);else for(ye=pe;ye<=Q;ye++)if(Wn[ye-pe]===0&&ks(ct,_[ye])){It=ye;break}It===void 0?et(ct,O,k,!0):(Wn[It-pe]=M+1,It>=lt?lt=It:at=!0,P(ct,_[It],E,null,O,k,W,V,F),Xe++)}const $r=at?o_(Wn):$s;for(ye=$r.length-1,M=Qe-1;M>=0;M--){const ct=pe+M,It=_[ct],Fr=ct+1{const{el:k,type:W,transition:V,children:F,shapeFlag:M}=g;if(M&6){_t(g.component.subTree,_,E,D);return}if(M&128){g.suspense.move(_,E,D);return}if(M&64){W.move(g,_,E,Z);return}if(W===tt){s(k,_,E);for(let z=0;zV.enter(k),O);else{const{leave:z,delayLeave:Q,afterLeave:re}=V,pe=()=>s(k,_,E),Ce=()=>{z(k,()=>{pe(),re&&re()})};Q?Q(k,pe,Ce):Ce()}else s(k,_,E)},et=(g,_,E,D=!1,O=!1)=>{const{type:k,props:W,ref:V,children:F,dynamicChildren:M,shapeFlag:ne,patchFlag:z,dirs:Q,cacheIndex:re}=g;if(z===-2&&(O=!1),V!=null&&sa(V,null,E,g,!0),re!=null&&(_.renderCache[re]=void 0),ne&256){_.ctx.deactivate(g);return}const pe=ne&1&&Q,Ce=!Bs(g);let ye;if(Ce&&(ye=W&&W.onVnodeBeforeUnmount)&&rn(ye,_,g),ne&6)Zt(g.component,E,D);else{if(ne&128){g.suspense.unmount(E,D);return}pe&&ss(g,null,_,"beforeUnmount"),ne&64?g.type.remove(g,_,E,Z,D):M&&!M.hasOnce&&(k!==tt||z>0&&z&64)?Be(M,_,E,!1,!0):(k===tt&&z&384||!O&&ne&16)&&Be(F,_,E),D&&Yt(g)}(Ce&&(ye=W&&W.onVnodeUnmounted)||pe)&&St(()=>{ye&&rn(ye,_,g),pe&&ss(g,null,_,"unmounted")},E)},Yt=g=>{const{type:_,el:E,anchor:D,transition:O}=g;if(_===tt){rt(E,D);return}if(_===hi){H(g);return}const k=()=>{i(E),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(g.shapeFlag&1&&O&&!O.persisted){const{leave:W,delayLeave:V}=O,F=()=>W(E,k);V?V(g.el,k,F):F()}else k()},rt=(g,_)=>{let E;for(;g!==_;)E=b(g),i(g),g=E;i(_)},Zt=(g,_,E)=>{const{bum:D,scope:O,job:k,subTree:W,um:V,m:F,a:M}=g;Wc(F),Wc(M),D&&fi(D),O.stop(),k&&(k.flags|=8,et(W,g,_,E)),V&&St(V,_),St(()=>{g.isUnmounted=!0},_),_&&_.pendingBranch&&!_.isUnmounted&&g.asyncDep&&!g.asyncResolved&&g.suspenseId===_.pendingId&&(_.deps--,_.deps===0&&_.resolve())},Be=(g,_,E,D=!1,O=!1,k=0)=>{for(let W=k;W{if(g.shapeFlag&6)return x(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const _=b(g.anchor||g.el),E=_&&_[Ag];return E?b(E):_};let A=!1;const U=(g,_,E)=>{g==null?_._vnode&&et(_._vnode,null,null,!0):P(_._vnode||null,g,_,null,null,null,E),_._vnode=g,A||(A=!0,$c(),Df(),A=!1)},Z={p:P,um:et,m:_t,r:Yt,mt:He,mc:te,pc:Se,pbc:oe,n:x,o:e};let Te,je;return{render:U,hydrate:Te,createApp:Jg(U,Te)}}function Fo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function rs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function i_(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function id(e,t,n=!1){const s=e.children,i=t.children;if(ee(s)&&ee(i))for(let o=0;o>1,e[n[c]]0&&(t[s]=n[o-1]),n[o]=s)}}for(o=n.length,a=n[o-1];o-- >0;)n[o]=a,a=t[a];return n}function od(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:od(t)}function Wc(e){if(e)for(let t=0;txt(a_);function fr(e,t,n){return ad(e,t,n)}function ad(e,t,n=Me){const{immediate:s,deep:i,flush:o,once:a}=n,c=Ge({},n);let f;if(Vi)if(o==="sync"){const b=l_();f=b.__watcherHandles||(b.__watcherHandles=[])}else if(!t||s)c.once=!0;else return{stop:cn,resume:cn,pause:cn};const p=Ze;c.call=(b,w,C)=>Jt(b,p,w,C);let d=!1;o==="post"?c.scheduler=b=>{St(b,p&&p.suspense)}:o!=="sync"&&(d=!0,c.scheduler=(b,w)=>{w?b():Ha(b)}),c.augmentJob=b=>{t&&(b.flags|=4),d&&(b.flags|=2,p&&(b.id=p.uid,b.i=p))};const m=Eg(e,t,c);return f&&f.push(m),m}function c_(e,t,n){const s=this.proxy,i=qe(e)?e.includes(".")?ld(s,e):()=>s[e]:e.bind(s,s);let o;fe(t)?o=t:(o=t.handler,n=t);const a=Lr(this),c=ad(i,o.bind(s),n);return a(),c}function ld(e,t){const n=t.split(".");return()=>{let s=e;for(let i=0;it==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Gt(t)}Modifiers`]||e[`${gs(t)}Modifiers`];function f_(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Me;let i=n;const o=t.startsWith("update:"),a=o&&u_(s,t.slice(7));a&&(a.trim&&(i=n.map(d=>qe(d)?d.trim():d)),a.number&&(i=n.map(yi)));let c,f=s[c=ui(t)]||s[c=ui(Gt(t))];!f&&o&&(f=s[c=ui(gs(t))]),f&&Jt(f,e,6,i);const p=s[c+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Jt(p,e,6,i)}}function cd(e,t,n=!1){const s=t.emitsCache,i=s.get(e);if(i!==void 0)return i;const o=e.emits;let a={},c=!1;if(!fe(e)){const f=p=>{const d=cd(p,t,!0);d&&(c=!0,Ge(a,d))};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}return!o&&!c?($e(e)&&s.set(e,null),null):(ee(o)?o.forEach(f=>a[f]=null):Ge(a,o),$e(e)&&s.set(e,a),a)}function Fi(e,t){return!e||!Ii(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ie(e,t[0].toLowerCase()+t.slice(1))||Ie(e,gs(t))||Ie(e,t))}function jo(e){const{type:t,vnode:n,proxy:s,withProxy:i,propsOptions:[o],slots:a,attrs:c,emit:f,render:p,renderCache:d,props:m,data:b,setupState:w,ctx:C,inheritAttrs:P}=e,R=Ei(e);let $,N;try{if(n.shapeFlag&4){const H=i||s,Y=H;$=ln(p.call(Y,H,d,m,w,b,C)),N=c}else{const H=t;$=ln(H.length>1?H(m,{attrs:c,slots:a,emit:f}):H(m,null)),N=t.props?c:d_(c)}}catch(H){dr.length=0,Mi(H,e,1),$=nt(Sn)}let B=$;if(N&&P!==!1){const H=Object.keys(N),{shapeFlag:Y}=B;H.length&&Y&7&&(o&&H.some(Sa)&&(N=h_(N,o)),B=ps(B,N,!1,!0))}return n.dirs&&(B=ps(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition&&vr(B,n.transition),$=B,Ei(R),$}const d_=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ii(n))&&((t||(t={}))[n]=e[n]);return t},h_=(e,t)=>{const n={};for(const s in e)(!Sa(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function p_(e,t,n){const{props:s,children:i,component:o}=e,{props:a,children:c,patchFlag:f}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&f>=0){if(f&1024)return!0;if(f&16)return s?zc(s,a,p):!!a;if(f&8){const d=t.dynamicProps;for(let m=0;me.__isSuspense;function g_(e,t){t&&t.pendingBranch?ee(e)?t.effects.push(...e):t.effects.push(e):Tg(e)}const tt=Symbol.for("v-fgt"),ji=Symbol.for("v-txt"),Sn=Symbol.for("v-cmt"),hi=Symbol.for("v-stc"),dr=[];let Ot=null;function Ve(e=!1){dr.push(Ot=e?null:[])}function __(){dr.pop(),Ot=dr[dr.length-1]||null}let wr=1;function Kc(e){wr+=e,e<0&&Ot&&(Ot.hasOnce=!0)}function fd(e){return e.dynamicChildren=wr>0?Ot||$s:null,__(),wr>0&&Ot&&Ot.push(e),e}function qt(e,t,n,s,i,o){return fd(_s(e,t,n,s,i,o,!0))}function jt(e,t,n,s,i){return fd(nt(e,t,n,s,i,!0))}function Si(e){return e?e.__v_isVNode===!0:!1}function ks(e,t){return e.type===t.type&&e.key===t.key}const dd=({key:e})=>e??null,pi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?qe(e)||ze(e)||fe(e)?{i:Je,r:e,k:t,f:!!n}:e:null);function _s(e,t=null,n=null,s=0,i=null,o=e===tt?0:1,a=!1,c=!1){const f={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&dd(t),ref:t&&pi(t),scopeId:kf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Je};return c?(Wa(f,n),o&128&&e.normalize(f)):n&&(f.shapeFlag|=qe(n)?8:16),wr>0&&!a&&Ot&&(f.patchFlag>0||o&6)&&f.patchFlag!==32&&Ot.push(f),f}const nt=b_;function b_(e,t=null,n=null,s=0,i=null,o=!1){if((!e||e===Wf)&&(e=Sn),Si(e)){const c=ps(e,t,!0);return n&&Wa(c,n),wr>0&&!o&&Ot&&(c.shapeFlag&6?Ot[Ot.indexOf(e)]=c:Ot.push(c)),c.patchFlag=-2,c}if(x_(e)&&(e=e.__vccOpts),t){t=y_(t);let{class:c,style:f}=t;c&&!qe(c)&&(t.class=Hn(c)),$e(f)&&(Ma(f)&&!ee(f)&&(f=Ge({},f)),t.style=Or(f))}const a=qe(e)?1:ud(e)?128:Og(e)?64:$e(e)?4:fe(e)?2:0;return _s(e,t,n,s,i,a,o,!0)}function y_(e){return e?Ma(e)||Yf(e)?Ge({},e):e:null}function ps(e,t,n=!1,s=!1){const{props:i,ref:o,patchFlag:a,children:c,transition:f}=e,p=t?Hi(i||{},t):i,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&dd(p),ref:t&&t.ref?n&&o?ee(o)?o.concat(pi(t)):[o,pi(t)]:pi(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==tt?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:f,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ps(e.ssContent),ssFallback:e.ssFallback&&ps(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return f&&s&&vr(d,f.clone(d)),d}function Bi(e=" ",t=0){return nt(ji,null,e,t)}function s0(e,t){const n=nt(hi,null,e);return n.staticCount=t,n}function Bo(e="",t=!1){return t?(Ve(),jt(Sn,null,e)):nt(Sn,null,e)}function ln(e){return e==null||typeof e=="boolean"?nt(Sn):ee(e)?nt(tt,null,e.slice()):typeof e=="object"?Mn(e):nt(ji,null,String(e))}function Mn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ps(e)}function Wa(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ee(t))n=16;else if(typeof t=="object")if(s&65){const i=t.default;i&&(i._c&&(i._d=!1),Wa(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Yf(t)?t._ctx=Je:i===3&&Je&&(Je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else fe(t)?(t={default:t,_ctx:Je},n=32):(t=String(t),s&64?(n=16,t=[Bi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Hi(...e){const t={};for(let n=0;nZe||Je;let Ti,la;{const e=af(),t=(n,s)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(s),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};Ti=t("__VUE_INSTANCE_SETTERS__",n=>Ze=n),la=t("__VUE_SSR_SETTERS__",n=>Vi=n)}const Lr=e=>{const t=Ze;return Ti(e),e.scope.on(),()=>{e.scope.off(),Ti(t)}},Gc=()=>{Ze&&Ze.scope.off(),Ti(null)};function pd(e){return e.vnode.shapeFlag&4}let Vi=!1;function C_(e,t=!1,n=!1){t&&la(t);const{props:s,children:i}=e.vnode,o=pd(e);Qg(e,s,o,t),t_(e,i,n);const a=o?S_(e,t):void 0;return t&&la(!1),a}function S_(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Vg);const{setup:s}=n;if(s){const i=e.setupContext=s.length>1?A_(e):null,o=Lr(e);Un();const a=Rr(s,e,0,[e.props,i]);if(qn(),o(),nf(a)){if(Bs(e)||$f(e),a.then(Gc,Gc),t)return a.then(c=>{Jc(e,c,t)}).catch(c=>{Mi(c,e,0)});e.asyncDep=a}else Jc(e,a,t)}else md(e,t)}function Jc(e,t,n){fe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:$e(t)&&(e.setupState=Pf(t)),md(e,n)}let Xc;function md(e,t,n){const s=e.type;if(!e.render){if(!t&&Xc&&!s.render){const i=s.template||Ua(e).template;if(i){const{isCustomElement:o,compilerOptions:a}=e.appContext.config,{delimiters:c,compilerOptions:f}=s,p=Ge(Ge({isCustomElement:o,delimiters:c},a),f);s.render=Xc(i,p)}}e.render=s.render||cn}{const i=Lr(e);Un();try{Ug(e)}finally{qn(),i()}}}const T_={get(e,t){return ot(e,"get",""),e[t]}};function A_(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,T_),slots:e.slots,emit:e.emit,expose:t}}function Ui(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Pf($a(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ur)return ur[n](e)},has(t,n){return n in t||n in ur}})):e.proxy}function O_(e,t=!0){return fe(e)?e.displayName||e.name:e.name||t&&e.__name}function x_(e){return fe(e)&&"__vccOpts"in e}const Ft=(e,t)=>vg(e,t,Vi);function gd(e,t,n){const s=arguments.length;return s===2?$e(t)&&!ee(t)?Si(t)?nt(e,null,[t]):nt(e,t):nt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Si(n)&&(n=[n]),nt(e,t,n))}const R_="3.5.3";/** +* @vue/runtime-dom v3.5.3 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let ca;const Qc=typeof window<"u"&&window.trustedTypes;if(Qc)try{ca=Qc.createPolicy("vue",{createHTML:e=>e})}catch{}const _d=ca?e=>ca.createHTML(e):e=>e,P_="http://www.w3.org/2000/svg",I_="http://www.w3.org/1998/Math/MathML",yn=typeof document<"u"?document:null,Yc=yn&&yn.createElement("template"),L_={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const i=t==="svg"?yn.createElementNS(P_,e):t==="mathml"?yn.createElementNS(I_,e):n?yn.createElement(e,{is:n}):yn.createElement(e);return e==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:e=>yn.createTextNode(e),createComment:e=>yn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,i,o){const a=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{Yc.innerHTML=_d(s==="svg"?`${e}`:s==="mathml"?`${e}`:e);const c=Yc.content;if(s==="svg"||s==="mathml"){const f=c.firstChild;for(;f.firstChild;)c.appendChild(f.firstChild);c.removeChild(f)}t.insertBefore(c,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Pn="transition",nr="animation",Hs=Symbol("_vtc"),bd={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},D_=Ge({},Rg,bd),is=(e,t=[])=>{ee(e)?e.forEach(n=>n(...t)):e&&e(...t)},Zc=e=>e?ee(e)?e.some(t=>t.length>1):e.length>1:!1;function N_(e){const t={};for(const G in e)G in bd||(t[G]=e[G]);if(e.css===!1)return t;const{name:n="v",type:s,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:a=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:f=o,appearActiveClass:p=a,appearToClass:d=c,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,C=k_(i),P=C&&C[0],R=C&&C[1],{onBeforeEnter:$,onEnter:N,onEnterCancelled:B,onLeave:H,onLeaveCancelled:Y,onBeforeAppear:ge=$,onAppear:le=N,onAppearCancelled:te=B}=t,q=(G,be,He)=>{Dn(G,be?d:c),Dn(G,be?p:a),He&&He()},oe=(G,be)=>{G._isLeaving=!1,Dn(G,m),Dn(G,w),Dn(G,b),be&&be()},ve=G=>(be,He)=>{const st=G?le:N,Oe=()=>q(be,G,He);is(st,[be,Oe]),eu(()=>{Dn(be,G?f:o),bn(be,G?d:c),Zc(st)||tu(be,s,P,Oe)})};return Ge(t,{onBeforeEnter(G){is($,[G]),bn(G,o),bn(G,a)},onBeforeAppear(G){is(ge,[G]),bn(G,f),bn(G,p)},onEnter:ve(!1),onAppear:ve(!0),onLeave(G,be){G._isLeaving=!0;const He=()=>oe(G,be);bn(G,m),bn(G,b),vd(),eu(()=>{G._isLeaving&&(Dn(G,m),bn(G,w),Zc(H)||tu(G,s,R,He))}),is(H,[G,He])},onEnterCancelled(G){q(G,!1),is(B,[G])},onAppearCancelled(G){q(G,!0),is(te,[G])},onLeaveCancelled(G){oe(G),is(Y,[G])}})}function k_(e){if(e==null)return null;if($e(e))return[Ho(e.enter),Ho(e.leave)];{const t=Ho(e);return[t,t]}}function Ho(e){return $m(e)}function bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Hs]||(e[Hs]=new Set)).add(t)}function Dn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[Hs];n&&(n.delete(t),n.size||(e[Hs]=void 0))}function eu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let M_=0;function tu(e,t,n,s){const i=e._endId=++M_,o=()=>{i===e._endId&&s()};if(n)return setTimeout(o,n);const{type:a,timeout:c,propCount:f}=yd(e,t);if(!a)return s();const p=a+"end";let d=0;const m=()=>{e.removeEventListener(p,b),o()},b=w=>{w.target===e&&++d>=f&&m()};setTimeout(()=>{d(n[C]||"").split(", "),i=s(`${Pn}Delay`),o=s(`${Pn}Duration`),a=nu(i,o),c=s(`${nr}Delay`),f=s(`${nr}Duration`),p=nu(c,f);let d=null,m=0,b=0;t===Pn?a>0&&(d=Pn,m=a,b=o.length):t===nr?p>0&&(d=nr,m=p,b=f.length):(m=Math.max(a,p),d=m>0?a>p?Pn:nr:null,b=d?d===Pn?o.length:f.length:0);const w=d===Pn&&/\b(transform|all)(,|$)/.test(s(`${Pn}Property`).toString());return{type:d,timeout:m,propCount:b,hasTransform:w}}function nu(e,t){for(;e.lengthsu(n)+su(e[s])))}function su(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function vd(){return document.body.offsetHeight}function $_(e,t,n){const s=e[Hs];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ai=Symbol("_vod"),wd=Symbol("_vsh"),r0={beforeMount(e,{value:t},{transition:n}){e[Ai]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):sr(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),sr(e,!0),s.enter(e)):s.leave(e,()=>{sr(e,!1)}):sr(e,t))},beforeUnmount(e,{value:t}){sr(e,t)}};function sr(e,t){e.style.display=t?e[Ai]:"none",e[wd]=!t}const F_=Symbol(""),j_=/(^|;)\s*display\s*:/;function B_(e,t,n){const s=e.style,i=qe(n);let o=!1;if(n&&!i){if(t)if(qe(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();n[c]==null&&mi(s,c,"")}else for(const a in t)n[a]==null&&mi(s,a,"");for(const a in n)a==="display"&&(o=!0),mi(s,a,n[a])}else if(i){if(t!==n){const a=s[F_];a&&(n+=";"+a),s.cssText=n,o=j_.test(n)}}else t&&e.removeAttribute("style");Ai in e&&(e[Ai]=o?s.display:"",e[wd]&&(s.display="none"))}const ru=/\s*!important$/;function mi(e,t,n){if(ee(n))n.forEach(s=>mi(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=H_(e,t);ru.test(n)?e.setProperty(gs(s),n.replace(ru,""),"important"):e[s]=n}}const iu=["Webkit","Moz","ms"],Vo={};function H_(e,t){const n=Vo[t];if(n)return n;let s=Gt(t);if(s!=="filter"&&s in e)return Vo[t]=s;s=Di(s);for(let i=0;iUo||(z_.then(()=>Uo=0),Uo=Date.now());function G_(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Jt(J_(s,n.value),t,5,[s])};return n.value=e,n.attached=K_(),n}function J_(e,t){if(ee(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>i=>!i._stopped&&s&&s(i))}else return t}const uu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,X_=(e,t,n,s,i,o)=>{const a=i==="svg";t==="class"?$_(e,s,a):t==="style"?B_(e,n,s):Ii(t)?Sa(t)||q_(e,t,n,s,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Q_(e,t,s,a))?(V_(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&au(e,t,s,a,o,t!=="value")):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),au(e,t,s,a))};function Q_(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&uu(t)&&fe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return uu(t)&&qe(n)?!1:!!(t in e||e._isVueCE&&(/[A-Z]/.test(t)||!qe(n)))}const Ed=new WeakMap,Cd=new WeakMap,Oi=Symbol("_moveCb"),fu=Symbol("_enterCb"),Y_=e=>(delete e.props.mode,e),Z_=Y_({name:"TransitionGroup",props:Ge({},D_,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=hd(),s=xg();let i,o;return Hf(()=>{if(!i.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!rb(i[0].el,n.vnode.el,a))return;i.forEach(tb),i.forEach(nb);const c=i.filter(sb);vd(),c.forEach(f=>{const p=f.el,d=p.style;bn(p,a),d.transform=d.webkitTransform=d.transitionDuration="";const m=p[Oi]=b=>{b&&b.target!==p||(!b||/transform$/.test(b.propertyName))&&(p.removeEventListener("transitionend",m),p[Oi]=null,Dn(p,a))};p.addEventListener("transitionend",m)})}),()=>{const a=Ee(e),c=N_(a);let f=a.tag||tt;if(i=[],o)for(let p=0;p{c.split(/\s+/).forEach(f=>f&&s.classList.remove(f))}),n.split(/\s+/).forEach(c=>c&&s.classList.add(c)),s.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(s);const{hasTransform:a}=yd(s);return o.removeChild(s),a}const Vn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ee(t)?n=>fi(t,n):t};function ib(e){e.target.composing=!0}function du(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Bt=Symbol("_assign"),i0={created(e,{modifiers:{lazy:t,trim:n,number:s}},i){e[Bt]=Vn(i);const o=s||i.props&&i.props.type==="number";wn(e,t?"change":"input",a=>{if(a.target.composing)return;let c=e.value;n&&(c=c.trim()),o&&(c=yi(c)),e[Bt](c)}),n&&wn(e,"change",()=>{e.value=e.value.trim()}),t||(wn(e,"compositionstart",ib),wn(e,"compositionend",du),wn(e,"change",du))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:i,number:o}},a){if(e[Bt]=Vn(a),e.composing)return;const c=(o||e.type==="number")&&!/^0\d/.test(e.value)?yi(e.value):e.value,f=t??"";c!==f&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||i&&e.value.trim()===f)||(e.value=f))}},o0={deep:!0,created(e,t,n){e[Bt]=Vn(n),wn(e,"change",()=>{const s=e._modelValue,i=Vs(e),o=e.checked,a=e[Bt];if(ee(s)){const c=Oa(s,i),f=c!==-1;if(o&&!f)a(s.concat(i));else if(!o&&f){const p=[...s];p.splice(c,1),a(p)}}else if(Ws(s)){const c=new Set(s);o?c.add(i):c.delete(i),a(c)}else a(Sd(e,o))})},mounted:hu,beforeUpdate(e,t,n){e[Bt]=Vn(n),hu(e,t,n)}};function hu(e,{value:t,oldValue:n},s){e._modelValue=t;let i;ee(t)?i=Oa(t,s.props.value)>-1:Ws(t)?i=t.has(s.props.value):i=ds(t,Sd(e,!0)),e.checked!==i&&(e.checked=i)}const a0={created(e,{value:t},n){e.checked=ds(t,n.props.value),e[Bt]=Vn(n),wn(e,"change",()=>{e[Bt](Vs(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Bt]=Vn(s),t!==n&&(e.checked=ds(t,s.props.value))}},l0={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const i=Ws(t);wn(e,"change",()=>{const o=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?yi(Vs(a)):Vs(a));e[Bt](e.multiple?i?new Set(o):o:o[0]),e._assigning=!0,Pr(()=>{e._assigning=!1})}),e[Bt]=Vn(s)},mounted(e,{value:t,modifiers:{number:n}}){pu(e,t)},beforeUpdate(e,t,n){e[Bt]=Vn(n)},updated(e,{value:t,modifiers:{number:n}}){e._assigning||pu(e,t)}};function pu(e,t,n){const s=e.multiple,i=ee(t);if(!(s&&!i&&!Ws(t))){for(let o=0,a=e.options.length;oString(d)===String(f)):c.selected=Oa(t,f)>-1}else c.selected=t.has(f);else if(ds(Vs(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Vs(e){return"_value"in e?e._value:e.value}function Sd(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ob=["ctrl","shift","alt","meta"],ab={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ob.some(n=>e[`${n}Key`]&&!t.includes(n))},lb=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(i,...o)=>{for(let a=0;a{const t=ub().createApp(...e),{mount:n}=t;return t.mount=s=>{const i=db(s);if(!i)return;const o=t._component;!fe(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const a=n(i,!1,fb(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),a},t};function fb(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function db(e){return qe(e)?document.querySelector(e):e}var hb=!1;/*! + * pinia v2.2.2 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */let Ad;const qi=e=>Ad=e,Od=Symbol();function ua(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var hr;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(hr||(hr={}));function pb(){const e=df(!0),t=e.run(()=>ja({}));let n=[],s=[];const i=$a({install(o){qi(i),i._a=o,o.provide(Od,i),o.config.globalProperties.$pinia=i,s.forEach(a=>n.push(a)),s=[]},use(o){return!this._a&&!hb?s.push(o):n.push(o),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const xd=()=>{};function gu(e,t,n,s=xd){e.push(t);const i=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),s())};return!n&&hf()&&Wm(i),i}function Ds(e,...t){e.slice().forEach(n=>{n(...t)})}const mb=e=>e(),_u=Symbol(),qo=Symbol();function fa(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];ua(i)&&ua(s)&&e.hasOwnProperty(n)&&!ze(s)&&!Fn(s)?e[n]=fa(i,s):e[n]=s}return e}const gb=Symbol();function _b(e){return!ua(e)||!e.hasOwnProperty(gb)}const{assign:Nn}=Object;function bb(e){return!!(ze(e)&&e.effect)}function yb(e,t,n,s){const{state:i,actions:o,getters:a}=t,c=n.state.value[e];let f;function p(){c||(n.state.value[e]=i?i():{});const d=gg(n.state.value[e]);return Nn(d,o,Object.keys(a||{}).reduce((m,b)=>(m[b]=$a(Ft(()=>{qi(n);const w=n._s.get(e);return a[b].call(w,w)})),m),{}))}return f=Rd(e,p,t,n,s,!0),f}function Rd(e,t,n={},s,i,o){let a;const c=Nn({actions:{}},n),f={deep:!0};let p,d,m=[],b=[],w;const C=s.state.value[e];!o&&!C&&(s.state.value[e]={}),ja({});let P;function R(te){let q;p=d=!1,typeof te=="function"?(te(s.state.value[e]),q={type:hr.patchFunction,storeId:e,events:w}):(fa(s.state.value[e],te),q={type:hr.patchObject,payload:te,storeId:e,events:w});const oe=P=Symbol();Pr().then(()=>{P===oe&&(p=!0)}),d=!0,Ds(m,q,s.state.value[e])}const $=o?function(){const{state:q}=n,oe=q?q():{};this.$patch(ve=>{Nn(ve,oe)})}:xd;function N(){a.stop(),m=[],b=[],s._s.delete(e)}const B=(te,q="")=>{if(_u in te)return te[qo]=q,te;const oe=function(){qi(s);const ve=Array.from(arguments),G=[],be=[];function He(ae){G.push(ae)}function st(ae){be.push(ae)}Ds(b,{args:ve,name:oe[qo],store:Y,after:He,onError:st});let Oe;try{Oe=te.apply(this&&this.$id===e?this:Y,ve)}catch(ae){throw Ds(be,ae),ae}return Oe instanceof Promise?Oe.then(ae=>(Ds(G,ae),ae)).catch(ae=>(Ds(be,ae),Promise.reject(ae))):(Ds(G,Oe),Oe)};return oe[_u]=!0,oe[qo]=q,oe},H={_p:s,$id:e,$onAction:gu.bind(null,b),$patch:R,$reset:$,$subscribe(te,q={}){const oe=gu(m,te,q.detached,()=>ve()),ve=a.run(()=>fr(()=>s.state.value[e],G=>{(q.flush==="sync"?d:p)&&te({storeId:e,type:hr.direct,events:w},G)},Nn({},f,q)));return oe},$dispose:N},Y=xr(H);s._s.set(e,Y);const le=(s._a&&s._a.runWithContext||mb)(()=>s._e.run(()=>(a=df()).run(()=>t({action:B}))));for(const te in le){const q=le[te];if(ze(q)&&!bb(q)||Fn(q))o||(C&&_b(q)&&(ze(q)?q.value=C[te]:fa(q,C[te])),s.state.value[e][te]=q);else if(typeof q=="function"){const oe=B(q,te);le[te]=oe,c.actions[te]=q}}return Nn(Y,le),Nn(Ee(Y),le),Object.defineProperty(Y,"$state",{get:()=>s.state.value[e],set:te=>{R(q=>{Nn(q,te)})}}),s._p.forEach(te=>{Nn(Y,a.run(()=>te({store:Y,app:s._a,pinia:s,options:c})))}),C&&o&&n.hydrate&&n.hydrate(Y.$state,C),p=!0,d=!0,Y}function vb(e,t,n){let s,i;const o=typeof t=="function";s=e,i=o?n:t;function a(c,f){const p=Xg();return c=c||(p?xt(Od,null):null),c&&qi(c),c=Ad,c._s.has(s)||(o?Rd(s,t,i,c):yb(s,i,c)),c._s.get(s)}return a.$id=s,a}/*! + * vue-router v4.4.3 + * (c) 2024 Eduardo San Martin Morote + * @license MIT + */const Ms=typeof document<"u";function wb(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Pe=Object.assign;function Wo(e,t){const n={};for(const s in t){const i=t[s];n[s]=Xt(i)?i.map(e):e(i)}return n}const pr=()=>{},Xt=Array.isArray,Pd=/#/g,Eb=/&/g,Cb=/\//g,Sb=/=/g,Tb=/\?/g,Id=/\+/g,Ab=/%5B/g,Ob=/%5D/g,Ld=/%5E/g,xb=/%60/g,Dd=/%7B/g,Rb=/%7C/g,Nd=/%7D/g,Pb=/%20/g;function za(e){return encodeURI(""+e).replace(Rb,"|").replace(Ab,"[").replace(Ob,"]")}function Ib(e){return za(e).replace(Dd,"{").replace(Nd,"}").replace(Ld,"^")}function da(e){return za(e).replace(Id,"%2B").replace(Pb,"+").replace(Pd,"%23").replace(Eb,"%26").replace(xb,"`").replace(Dd,"{").replace(Nd,"}").replace(Ld,"^")}function Lb(e){return da(e).replace(Sb,"%3D")}function Db(e){return za(e).replace(Pd,"%23").replace(Tb,"%3F")}function Nb(e){return e==null?"":Db(e).replace(Cb,"%2F")}function Er(e){try{return decodeURIComponent(""+e)}catch{}return""+e}const kb=/\/$/,Mb=e=>e.replace(kb,"");function zo(e,t,n="/"){let s,i={},o="",a="";const c=t.indexOf("#");let f=t.indexOf("?");return c=0&&(f=-1),f>-1&&(s=t.slice(0,f),o=t.slice(f+1,c>-1?c:t.length),i=e(o)),c>-1&&(s=s||t.slice(0,c),a=t.slice(c,t.length)),s=Bb(s??t,n),{fullPath:s+(o&&"?")+o+a,path:s,query:i,hash:Er(a)}}function $b(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function bu(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Fb(e,t,n){const s=t.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&Us(t.matched[s],n.matched[i])&&kd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Us(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function kd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!jb(e[n],t[n]))return!1;return!0}function jb(e,t){return Xt(e)?yu(e,t):Xt(t)?yu(t,e):e===t}function yu(e,t){return Xt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function Bb(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let o=n.length-1,a,c;for(a=0;a1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(a).join("/")}const In={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Cr;(function(e){e.pop="pop",e.push="push"})(Cr||(Cr={}));var mr;(function(e){e.back="back",e.forward="forward",e.unknown=""})(mr||(mr={}));function Hb(e){if(!e)if(Ms){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Mb(e)}const Vb=/^[^#]+#/;function Ub(e,t){return e.replace(Vb,"#")+t}function qb(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const Wi=()=>({left:window.scrollX,top:window.scrollY});function Wb(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=qb(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function vu(e,t){return(history.state?history.state.position-t:-1)+e}const ha=new Map;function zb(e,t){ha.set(e,t)}function Kb(e){const t=ha.get(e);return ha.delete(e),t}let Gb=()=>location.protocol+"//"+location.host;function Md(e,t){const{pathname:n,search:s,hash:i}=t,o=e.indexOf("#");if(o>-1){let c=i.includes(e.slice(o))?e.slice(o).length:1,f=i.slice(c);return f[0]!=="/"&&(f="/"+f),bu(f,"")}return bu(n,e)+s+i}function Jb(e,t,n,s){let i=[],o=[],a=null;const c=({state:b})=>{const w=Md(e,location),C=n.value,P=t.value;let R=0;if(b){if(n.value=w,t.value=b,a&&a===C){a=null;return}R=P?b.position-P.position:0}else s(w);i.forEach($=>{$(n.value,C,{delta:R,type:Cr.pop,direction:R?R>0?mr.forward:mr.back:mr.unknown})})};function f(){a=n.value}function p(b){i.push(b);const w=()=>{const C=i.indexOf(b);C>-1&&i.splice(C,1)};return o.push(w),w}function d(){const{history:b}=window;b.state&&b.replaceState(Pe({},b.state,{scroll:Wi()}),"")}function m(){for(const b of o)b();o=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:f,listen:p,destroy:m}}function wu(e,t,n,s=!1,i=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:i?Wi():null}}function Xb(e){const{history:t,location:n}=window,s={value:Md(e,n)},i={value:t.state};i.value||o(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(f,p,d){const m=e.indexOf("#"),b=m>-1?(n.host&&document.querySelector("base")?e:e.slice(m))+f:Gb()+e+f;try{t[d?"replaceState":"pushState"](p,"",b),i.value=p}catch(w){console.error(w),n[d?"replace":"assign"](b)}}function a(f,p){const d=Pe({},t.state,wu(i.value.back,f,i.value.forward,!0),p,{position:i.value.position});o(f,d,!0),s.value=f}function c(f,p){const d=Pe({},i.value,t.state,{forward:f,scroll:Wi()});o(d.current,d,!0);const m=Pe({},wu(s.value,f,null),{position:d.position+1},p);o(f,m,!1),s.value=f}return{location:s,state:i,push:c,replace:a}}function Qb(e){e=Hb(e);const t=Xb(e),n=Jb(e,t.state,t.location,t.replace);function s(o,a=!0){a||n.pauseListeners(),history.go(o)}const i=Pe({location:"",base:e,go:s,createHref:Ub.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function Yb(e){return typeof e=="string"||e&&typeof e=="object"}function $d(e){return typeof e=="string"||typeof e=="symbol"}const Fd=Symbol("");var Eu;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(Eu||(Eu={}));function qs(e,t){return Pe(new Error,{type:e,[Fd]:!0},t)}function _n(e,t){return e instanceof Error&&Fd in e&&(t==null||!!(e.type&t))}const Cu="[^/]+?",Zb={sensitive:!1,strict:!1,start:!0,end:!0},ey=/[.+*?^${}()[\]/\\]/g;function ty(e,t){const n=Pe({},Zb,t),s=[];let i=n.start?"^":"";const o=[];for(const p of e){const d=p.length?[]:[90];n.strict&&!p.length&&(i+="/");for(let m=0;mt.length?t.length===1&&t[0]===80?1:-1:0}function jd(e,t){let n=0;const s=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const sy={type:0,value:""},ry=/[a-zA-Z0-9_]/;function iy(e){if(!e)return[[]];if(e==="/")return[[sy]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(w){throw new Error(`ERR (${n})/"${p}": ${w}`)}let n=0,s=n;const i=[];let o;function a(){o&&i.push(o),o=[]}let c=0,f,p="",d="";function m(){p&&(n===0?o.push({type:0,value:p}):n===1||n===2||n===3?(o.length>1&&(f==="*"||f==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:p,regexp:d,repeatable:f==="*"||f==="+",optional:f==="*"||f==="?"})):t("Invalid state to consume buffer"),p="")}function b(){p+=f}for(;c{a(B)}:pr}function a(m){if($d(m)){const b=s.get(m);b&&(s.delete(m),n.splice(n.indexOf(b),1),b.children.forEach(a),b.alias.forEach(a))}else{const b=n.indexOf(m);b>-1&&(n.splice(b,1),m.record.name&&s.delete(m.record.name),m.children.forEach(a),m.alias.forEach(a))}}function c(){return n}function f(m){const b=fy(m,n);n.splice(b,0,m),m.record.name&&!Au(m)&&s.set(m.record.name,m)}function p(m,b){let w,C={},P,R;if("name"in m&&m.name){if(w=s.get(m.name),!w)throw qs(1,{location:m});R=w.record.name,C=Pe(Tu(b.params,w.keys.filter(B=>!B.optional).concat(w.parent?w.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),m.params&&Tu(m.params,w.keys.map(B=>B.name))),P=w.stringify(C)}else if(m.path!=null)P=m.path,w=n.find(B=>B.re.test(P)),w&&(C=w.parse(P),R=w.record.name);else{if(w=b.name?s.get(b.name):n.find(B=>B.re.test(b.path)),!w)throw qs(1,{location:m,currentLocation:b});R=w.record.name,C=Pe({},b.params,m.params),P=w.stringify(C)}const $=[];let N=w;for(;N;)$.unshift(N.record),N=N.parent;return{name:R,path:P,params:C,matched:$,meta:uy($)}}e.forEach(m=>o(m));function d(){n.length=0,s.clear()}return{addRoute:o,resolve:p,removeRoute:a,clearRoutes:d,getRoutes:c,getRecordMatcher:i}}function Tu(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function ly(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:cy(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}function cy(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Au(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function uy(e){return e.reduce((t,n)=>Pe(t,n.meta),{})}function Ou(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function fy(e,t){let n=0,s=t.length;for(;n!==s;){const o=n+s>>1;jd(e,t[o])<0?s=o:n=o+1}const i=dy(e);return i&&(s=t.lastIndexOf(i,s-1)),s}function dy(e){let t=e;for(;t=t.parent;)if(Bd(t)&&jd(e,t)===0)return t}function Bd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function hy(e){const t={};if(e===""||e==="?")return t;const s=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;io&&da(o)):[s&&da(s)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function py(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=Xt(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return t}const my=Symbol(""),Ru=Symbol(""),zi=Symbol(""),Ka=Symbol(""),pa=Symbol("");function rr(){let e=[];function t(s){return e.push(s),()=>{const i=e.indexOf(s);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $n(e,t,n,s,i,o=a=>a()){const a=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((c,f)=>{const p=b=>{b===!1?f(qs(4,{from:n,to:t})):b instanceof Error?f(b):Yb(b)?f(qs(2,{from:t,to:b})):(a&&s.enterCallbacks[i]===a&&typeof b=="function"&&a.push(b),c())},d=o(()=>e.call(s&&s.instances[i],t,n,p));let m=Promise.resolve(d);e.length<3&&(m=m.then(p)),m.catch(b=>f(b))})}function Ko(e,t,n,s,i=o=>o()){const o=[];for(const a of e)for(const c in a.components){let f=a.components[c];if(!(t!=="beforeRouteEnter"&&!a.instances[c]))if(gy(f)){const d=(f.__vccOpts||f)[t];d&&o.push($n(d,n,s,a,c,i))}else{let p=f();o.push(()=>p.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${a.path}"`));const m=wb(d)?d.default:d;a.components[c]=m;const w=(m.__vccOpts||m)[t];return w&&$n(w,n,s,a,c,i)()}))}}return o}function gy(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Pu(e){const t=xt(zi),n=xt(Ka),s=Ft(()=>{const f=jn(e.to);return t.resolve(f)}),i=Ft(()=>{const{matched:f}=s.value,{length:p}=f,d=f[p-1],m=n.matched;if(!d||!m.length)return-1;const b=m.findIndex(Us.bind(null,d));if(b>-1)return b;const w=Iu(f[p-2]);return p>1&&Iu(d)===w&&m[m.length-1].path!==w?m.findIndex(Us.bind(null,f[p-2])):b}),o=Ft(()=>i.value>-1&&vy(n.params,s.value.params)),a=Ft(()=>i.value>-1&&i.value===n.matched.length-1&&kd(n.params,s.value.params));function c(f={}){return yy(f)?t[jn(e.replace)?"replace":"push"](jn(e.to)).catch(pr):Promise.resolve()}return{route:s,href:Ft(()=>s.value.href),isActive:o,isExactActive:a,navigate:c}}const _y=dn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Pu,setup(e,{slots:t}){const n=xr(Pu(e)),{options:s}=xt(zi),i=Ft(()=>({[Lu(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Lu(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&t.default(n);return e.custom?o:gd("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},o)}}}),by=_y;function yy(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function vy(e,t){for(const n in t){const s=t[n],i=e[n];if(typeof s=="string"){if(s!==i)return!1}else if(!Xt(i)||i.length!==s.length||s.some((o,a)=>o!==i[a]))return!1}return!0}function Iu(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Lu=(e,t,n)=>e??t??n,wy=dn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=xt(pa),i=Ft(()=>e.route||s.value),o=xt(Ru,0),a=Ft(()=>{let p=jn(o);const{matched:d}=i.value;let m;for(;(m=d[p])&&!m.components;)p++;return p}),c=Ft(()=>i.value.matched[a.value]);di(Ru,Ft(()=>a.value+1)),di(my,c),di(pa,i);const f=ja();return fr(()=>[f.value,c.value,e.name],([p,d,m],[b,w,C])=>{d&&(d.instances[m]=p,w&&w!==d&&p&&p===b&&(d.leaveGuards.size||(d.leaveGuards=w.leaveGuards),d.updateGuards.size||(d.updateGuards=w.updateGuards))),p&&d&&(!w||!Us(d,w)||!b)&&(d.enterCallbacks[m]||[]).forEach(P=>P(p))},{flush:"post"}),()=>{const p=i.value,d=e.name,m=c.value,b=m&&m.components[d];if(!b)return Du(n.default,{Component:b,route:p});const w=m.props[d],C=w?w===!0?p.params:typeof w=="function"?w(p):w:null,R=gd(b,Pe({},C,t,{onVnodeUnmounted:$=>{$.component.isUnmounted&&(m.instances[d]=null)},ref:f}));return Du(n.default,{Component:R,route:p})||R}}});function Du(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Hd=wy;function Ey(e){const t=ay(e.routes,e),n=e.parseQuery||hy,s=e.stringifyQuery||xu,i=e.history,o=rr(),a=rr(),c=rr(),f=hg(In);let p=In;Ms&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Wo.bind(null,x=>""+x),m=Wo.bind(null,Nb),b=Wo.bind(null,Er);function w(x,A){let U,Z;return $d(x)?(U=t.getRecordMatcher(x),Z=A):Z=x,t.addRoute(Z,U)}function C(x){const A=t.getRecordMatcher(x);A&&t.removeRoute(A)}function P(){return t.getRoutes().map(x=>x.record)}function R(x){return!!t.getRecordMatcher(x)}function $(x,A){if(A=Pe({},A||f.value),typeof x=="string"){const _=zo(n,x,A.path),E=t.resolve({path:_.path},A),D=i.createHref(_.fullPath);return Pe(_,E,{params:b(E.params),hash:Er(_.hash),redirectedFrom:void 0,href:D})}let U;if(x.path!=null)U=Pe({},x,{path:zo(n,x.path,A.path).path});else{const _=Pe({},x.params);for(const E in _)_[E]==null&&delete _[E];U=Pe({},x,{params:m(_)}),A.params=m(A.params)}const Z=t.resolve(U,A),Te=x.hash||"";Z.params=d(b(Z.params));const je=$b(s,Pe({},x,{hash:Ib(Te),path:Z.path})),g=i.createHref(je);return Pe({fullPath:je,hash:Te,query:s===xu?py(x.query):x.query||{}},Z,{redirectedFrom:void 0,href:g})}function N(x){return typeof x=="string"?zo(n,x,f.value.path):Pe({},x)}function B(x,A){if(p!==x)return qs(8,{from:A,to:x})}function H(x){return le(x)}function Y(x){return H(Pe(N(x),{replace:!0}))}function ge(x){const A=x.matched[x.matched.length-1];if(A&&A.redirect){const{redirect:U}=A;let Z=typeof U=="function"?U(x):U;return typeof Z=="string"&&(Z=Z.includes("?")||Z.includes("#")?Z=N(Z):{path:Z},Z.params={}),Pe({query:x.query,hash:x.hash,params:Z.path!=null?{}:x.params},Z)}}function le(x,A){const U=p=$(x),Z=f.value,Te=x.state,je=x.force,g=x.replace===!0,_=ge(U);if(_)return le(Pe(N(_),{state:typeof _=="object"?Pe({},Te,_.state):Te,force:je,replace:g}),A||U);const E=U;E.redirectedFrom=A;let D;return!je&&Fb(s,Z,U)&&(D=qs(16,{to:E,from:Z}),_t(Z,Z,!0,!1)),(D?Promise.resolve(D):oe(E,Z)).catch(O=>_n(O)?_n(O,2)?O:I(O):Se(O,E,Z)).then(O=>{if(O){if(_n(O,2))return le(Pe({replace:g},N(O.to),{state:typeof O.to=="object"?Pe({},Te,O.to.state):Te,force:je}),A||E)}else O=G(E,Z,!0,g,Te);return ve(E,Z,O),O})}function te(x,A){const U=B(x,A);return U?Promise.reject(U):Promise.resolve()}function q(x){const A=rt.values().next().value;return A&&typeof A.runWithContext=="function"?A.runWithContext(x):x()}function oe(x,A){let U;const[Z,Te,je]=Cy(x,A);U=Ko(Z.reverse(),"beforeRouteLeave",x,A);for(const _ of Z)_.leaveGuards.forEach(E=>{U.push($n(E,x,A))});const g=te.bind(null,x,A);return U.push(g),Be(U).then(()=>{U=[];for(const _ of o.list())U.push($n(_,x,A));return U.push(g),Be(U)}).then(()=>{U=Ko(Te,"beforeRouteUpdate",x,A);for(const _ of Te)_.updateGuards.forEach(E=>{U.push($n(E,x,A))});return U.push(g),Be(U)}).then(()=>{U=[];for(const _ of je)if(_.beforeEnter)if(Xt(_.beforeEnter))for(const E of _.beforeEnter)U.push($n(E,x,A));else U.push($n(_.beforeEnter,x,A));return U.push(g),Be(U)}).then(()=>(x.matched.forEach(_=>_.enterCallbacks={}),U=Ko(je,"beforeRouteEnter",x,A,q),U.push(g),Be(U))).then(()=>{U=[];for(const _ of a.list())U.push($n(_,x,A));return U.push(g),Be(U)}).catch(_=>_n(_,8)?_:Promise.reject(_))}function ve(x,A,U){c.list().forEach(Z=>q(()=>Z(x,A,U)))}function G(x,A,U,Z,Te){const je=B(x,A);if(je)return je;const g=A===In,_=Ms?history.state:{};U&&(Z||g?i.replace(x.fullPath,Pe({scroll:g&&_&&_.scroll},Te)):i.push(x.fullPath,Te)),f.value=x,_t(x,A,U,g),I()}let be;function He(){be||(be=i.listen((x,A,U)=>{if(!Zt.listening)return;const Z=$(x),Te=ge(Z);if(Te){le(Pe(Te,{replace:!0}),Z).catch(pr);return}p=Z;const je=f.value;Ms&&zb(vu(je.fullPath,U.delta),Wi()),oe(Z,je).catch(g=>_n(g,12)?g:_n(g,2)?(le(g.to,Z).then(_=>{_n(_,20)&&!U.delta&&U.type===Cr.pop&&i.go(-1,!1)}).catch(pr),Promise.reject()):(U.delta&&i.go(-U.delta,!1),Se(g,Z,je))).then(g=>{g=g||G(Z,je,!1),g&&(U.delta&&!_n(g,8)?i.go(-U.delta,!1):U.type===Cr.pop&&_n(g,20)&&i.go(-1,!1)),ve(Z,je,g)}).catch(pr)}))}let st=rr(),Oe=rr(),ae;function Se(x,A,U){I(x);const Z=Oe.list();return Z.length?Z.forEach(Te=>Te(x,A,U)):console.error(x),Promise.reject(x)}function Pt(){return ae&&f.value!==In?Promise.resolve():new Promise((x,A)=>{st.add([x,A])})}function I(x){return ae||(ae=!x,He(),st.list().forEach(([A,U])=>x?U(x):A()),st.reset()),x}function _t(x,A,U,Z){const{scrollBehavior:Te}=e;if(!Ms||!Te)return Promise.resolve();const je=!U&&Kb(vu(x.fullPath,0))||(Z||!U)&&history.state&&history.state.scroll||null;return Pr().then(()=>Te(x,A,je)).then(g=>g&&Wb(g)).catch(g=>Se(g,x,A))}const et=x=>i.go(x);let Yt;const rt=new Set,Zt={currentRoute:f,listening:!0,addRoute:w,removeRoute:C,clearRoutes:t.clearRoutes,hasRoute:R,getRoutes:P,resolve:$,options:e,push:H,replace:Y,go:et,back:()=>et(-1),forward:()=>et(1),beforeEach:o.add,beforeResolve:a.add,afterEach:c.add,onError:Oe.add,isReady:Pt,install(x){const A=this;x.component("RouterLink",by),x.component("RouterView",Hd),x.config.globalProperties.$router=A,Object.defineProperty(x.config.globalProperties,"$route",{enumerable:!0,get:()=>jn(f)}),Ms&&!Yt&&f.value===In&&(Yt=!0,H(i.location).catch(Te=>{}));const U={};for(const Te in In)Object.defineProperty(U,Te,{get:()=>f.value[Te],enumerable:!0});x.provide(zi,A),x.provide(Ka,Of(U)),x.provide(pa,f);const Z=x.unmount;rt.add(x),x.unmount=function(){rt.delete(x),rt.size<1&&(p=In,be&&be(),be=null,f.value=In,Yt=!1,ae=!1),Z()}}};function Be(x){return x.reduce((A,U)=>A.then(()=>q(U)),Promise.resolve())}return Zt}function Cy(e,t){const n=[],s=[],i=[],o=Math.max(t.matched.length,e.matched.length);for(let a=0;aUs(p,c))?s.push(c):n.push(c));const f=e.matched[a];f&&(t.matched.find(p=>Us(p,f))||i.push(f))}return[n,s,i]}function c0(){return xt(zi)}function u0(e){return xt(Ka)}const Sy=dn({__name:"App",setup(e){return(t,n)=>(Ve(),jt(jn(Hd)))}});function Vd(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ty}=Object.prototype,{getPrototypeOf:Ga}=Object,Ki=(e=>t=>{const n=Ty.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Qt=e=>(e=e.toLowerCase(),t=>Ki(t)===e),Gi=e=>t=>typeof t===e,{isArray:zs}=Array,Sr=Gi("undefined");function Ay(e){return e!==null&&!Sr(e)&&e.constructor!==null&&!Sr(e.constructor)&&Rt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ud=Qt("ArrayBuffer");function Oy(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ud(e.buffer),t}const xy=Gi("string"),Rt=Gi("function"),qd=Gi("number"),Ji=e=>e!==null&&typeof e=="object",Ry=e=>e===!0||e===!1,gi=e=>{if(Ki(e)!=="object")return!1;const t=Ga(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Py=Qt("Date"),Iy=Qt("File"),Ly=Qt("Blob"),Dy=Qt("FileList"),Ny=e=>Ji(e)&&Rt(e.pipe),ky=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Rt(e.append)&&((t=Ki(e))==="formdata"||t==="object"&&Rt(e.toString)&&e.toString()==="[object FormData]"))},My=Qt("URLSearchParams"),[$y,Fy,jy,By]=["ReadableStream","Request","Response","Headers"].map(Qt),Hy=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Dr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,i;if(typeof e!="object"&&(e=[e]),zs(e))for(s=0,i=e.length;s0;)if(i=n[s],t===i.toLowerCase())return i;return null}const as=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zd=e=>!Sr(e)&&e!==as;function ma(){const{caseless:e}=zd(this)&&this||{},t={},n=(s,i)=>{const o=e&&Wd(t,i)||i;gi(t[o])&&gi(s)?t[o]=ma(t[o],s):gi(s)?t[o]=ma({},s):zs(s)?t[o]=s.slice():t[o]=s};for(let s=0,i=arguments.length;s(Dr(t,(i,o)=>{n&&Rt(i)?e[o]=Vd(i,n):e[o]=i},{allOwnKeys:s}),e),Uy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qy=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Wy=(e,t,n,s)=>{let i,o,a;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!s||s(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&Ga(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},Ky=e=>{if(!e)return null;if(zs(e))return e;let t=e.length;if(!qd(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Gy=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ga(Uint8Array)),Jy=(e,t)=>{const s=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=s.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Xy=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Qy=Qt("HTMLFormElement"),Yy=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,i){return s.toUpperCase()+i}),Nu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Zy=Qt("RegExp"),Kd=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Dr(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(s[o]=a||i)}),Object.defineProperties(e,s)},ev=e=>{Kd(e,(t,n)=>{if(Rt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(Rt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},tv=(e,t)=>{const n={},s=i=>{i.forEach(o=>{n[o]=!0})};return zs(e)?s(e):s(String(e).split(t)),n},nv=()=>{},sv=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Go="abcdefghijklmnopqrstuvwxyz",ku="0123456789",Gd={DIGIT:ku,ALPHA:Go,ALPHA_DIGIT:Go+Go.toUpperCase()+ku},rv=(e=16,t=Gd.ALPHA_DIGIT)=>{let n="";const{length:s}=t;for(;e--;)n+=t[Math.random()*s|0];return n};function iv(e){return!!(e&&Rt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ov=e=>{const t=new Array(10),n=(s,i)=>{if(Ji(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const o=zs(s)?[]:{};return Dr(s,(a,c)=>{const f=n(a,i+1);!Sr(f)&&(o[c]=f)}),t[i]=void 0,o}}return s};return n(e,0)},av=Qt("AsyncFunction"),lv=e=>e&&(Ji(e)||Rt(e))&&Rt(e.then)&&Rt(e.catch),Jd=((e,t)=>e?setImmediate:t?((n,s)=>(as.addEventListener("message",({source:i,data:o})=>{i===as&&o===n&&s.length&&s.shift()()},!1),i=>{s.push(i),as.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Rt(as.postMessage)),cv=typeof queueMicrotask<"u"?queueMicrotask.bind(as):typeof process<"u"&&process.nextTick||Jd,T={isArray:zs,isArrayBuffer:Ud,isBuffer:Ay,isFormData:ky,isArrayBufferView:Oy,isString:xy,isNumber:qd,isBoolean:Ry,isObject:Ji,isPlainObject:gi,isReadableStream:$y,isRequest:Fy,isResponse:jy,isHeaders:By,isUndefined:Sr,isDate:Py,isFile:Iy,isBlob:Ly,isRegExp:Zy,isFunction:Rt,isStream:Ny,isURLSearchParams:My,isTypedArray:Gy,isFileList:Dy,forEach:Dr,merge:ma,extend:Vy,trim:Hy,stripBOM:Uy,inherits:qy,toFlatObject:Wy,kindOf:Ki,kindOfTest:Qt,endsWith:zy,toArray:Ky,forEachEntry:Jy,matchAll:Xy,isHTMLForm:Qy,hasOwnProperty:Nu,hasOwnProp:Nu,reduceDescriptors:Kd,freezeMethods:ev,toObjectSet:tv,toCamelCase:Yy,noop:nv,toFiniteNumber:sv,findKey:Wd,global:as,isContextDefined:zd,ALPHABET:Gd,generateString:rv,isSpecCompliantForm:iv,toJSONObject:ov,isAsyncFn:av,isThenable:lv,setImmediate:Jd,asap:cv};function de(e,t,n,s,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),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}T.inherits(de,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:T.toJSONObject(this.config),code:this.code,status:this.status}}});const Xd=de.prototype,Qd={};["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=>{Qd[e]={value:e}});Object.defineProperties(de,Qd);Object.defineProperty(Xd,"isAxiosError",{value:!0});de.from=(e,t,n,s,i,o)=>{const a=Object.create(Xd);return T.toFlatObject(e,a,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),de.call(a,e.message,t,n,s,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const uv=null;function ga(e){return T.isPlainObject(e)||T.isArray(e)}function Yd(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function Mu(e,t,n){return e?e.concat(t).map(function(i,o){return i=Yd(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function fv(e){return T.isArray(e)&&!e.some(ga)}const dv=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function Xi(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(P,R){return!T.isUndefined(R[P])});const s=n.metaTokens,i=n.visitor||d,o=n.dots,a=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(i))throw new TypeError("visitor must be a function");function p(C){if(C===null)return"";if(T.isDate(C))return C.toISOString();if(!f&&T.isBlob(C))throw new de("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(C)||T.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function d(C,P,R){let $=C;if(C&&!R&&typeof C=="object"){if(T.endsWith(P,"{}"))P=s?P:P.slice(0,-2),C=JSON.stringify(C);else if(T.isArray(C)&&fv(C)||(T.isFileList(C)||T.endsWith(P,"[]"))&&($=T.toArray(C)))return P=Yd(P),$.forEach(function(B,H){!(T.isUndefined(B)||B===null)&&t.append(a===!0?Mu([P],H,o):a===null?P:P+"[]",p(B))}),!1}return ga(C)?!0:(t.append(Mu(R,P,o),p(C)),!1)}const m=[],b=Object.assign(dv,{defaultVisitor:d,convertValue:p,isVisitable:ga});function w(C,P){if(!T.isUndefined(C)){if(m.indexOf(C)!==-1)throw Error("Circular reference detected in "+P.join("."));m.push(C),T.forEach(C,function($,N){(!(T.isUndefined($)||$===null)&&i.call(t,$,T.isString(N)?N.trim():N,P,b))===!0&&w($,P?P.concat(N):[N])}),m.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return w(e),t}function $u(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ja(e,t){this._pairs=[],e&&Xi(e,this,t)}const Zd=Ja.prototype;Zd.append=function(t,n){this._pairs.push([t,n])};Zd.toString=function(t){const n=t?function(s){return t.call(this,s,$u)}:$u;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function hv(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function eh(e,t,n){if(!t)return e;const s=n&&n.encode||hv,i=n&&n.serialize;let o;if(i?o=i(t,n):o=T.isURLSearchParams(t)?t.toString():new Ja(t,n).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Fu{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(s){s!==null&&t(s)})}}const th={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pv=typeof URLSearchParams<"u"?URLSearchParams:Ja,mv=typeof FormData<"u"?FormData:null,gv=typeof Blob<"u"?Blob:null,_v={isBrowser:!0,classes:{URLSearchParams:pv,FormData:mv,Blob:gv},protocols:["http","https","file","blob","url","data"]},Xa=typeof window<"u"&&typeof document<"u",_a=typeof navigator=="object"&&navigator||void 0,bv=Xa&&(!_a||["ReactNative","NativeScript","NS"].indexOf(_a.product)<0),yv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vv=Xa&&window.location.href||"http://localhost",wv=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Xa,hasStandardBrowserEnv:bv,hasStandardBrowserWebWorkerEnv:yv,navigator:_a,origin:vv},Symbol.toStringTag,{value:"Module"})),bt={...wv,..._v};function Ev(e,t){return Xi(e,new bt.classes.URLSearchParams,Object.assign({visitor:function(n,s,i,o){return bt.isNode&&T.isBuffer(n)?(this.append(s,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Cv(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Sv(e){const t={},n=Object.keys(e);let s;const i=n.length;let o;for(s=0;s=n.length;return a=!a&&T.isArray(i)?i.length:a,f?(T.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!c):((!i[a]||!T.isObject(i[a]))&&(i[a]=[]),t(n,s,i[a],o)&&T.isArray(i[a])&&(i[a]=Sv(i[a])),!c)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(s,i)=>{t(Cv(s),i,n,0)}),n}return null}function Tv(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Nr={transitional:th,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",i=s.indexOf("application/json")>-1,o=T.isObject(t);if(o&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return i?JSON.stringify(nh(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ev(t,this.formSerializer).toString();if((c=T.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Xi(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Tv(t)):t}],transformResponse:[function(t){const n=this.transitional||Nr.transitional,s=n&&n.forcedJSONParsing,i=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(s&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(c){if(a)throw c.name==="SyntaxError"?de.from(c,de.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Nr.headers[e]={}});const Av=T.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"]),Ov=e=>{const t={};let n,s,i;return e&&e.split(` +`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!n||t[n]&&Av[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},ju=Symbol("internals");function ir(e){return e&&String(e).trim().toLowerCase()}function _i(e){return e===!1||e==null?e:T.isArray(e)?e.map(_i):String(e)}function xv(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Rv=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jo(e,t,n,s,i){if(T.isFunction(s))return s.call(this,t,n);if(i&&(t=n),!!T.isString(t)){if(T.isString(s))return t.indexOf(s)!==-1;if(T.isRegExp(s))return s.test(t)}}function Pv(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Iv(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(i,o,a){return this[s].call(this,t,i,o,a)},configurable:!0})})}class yt{constructor(t){t&&this.set(t)}set(t,n,s){const i=this;function o(c,f,p){const d=ir(f);if(!d)throw new Error("header name must be a non-empty string");const m=T.findKey(i,d);(!m||i[m]===void 0||p===!0||p===void 0&&i[m]!==!1)&&(i[m||f]=_i(c))}const a=(c,f)=>T.forEach(c,(p,d)=>o(p,d,f));if(T.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(T.isString(t)&&(t=t.trim())&&!Rv(t))a(Ov(t),n);else if(T.isHeaders(t))for(const[c,f]of t.entries())o(f,c,s);else t!=null&&o(n,t,s);return this}get(t,n){if(t=ir(t),t){const s=T.findKey(this,t);if(s){const i=this[s];if(!n)return i;if(n===!0)return xv(i);if(T.isFunction(n))return n.call(this,i,s);if(T.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ir(t),t){const s=T.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Jo(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let i=!1;function o(a){if(a=ir(a),a){const c=T.findKey(s,a);c&&(!n||Jo(s,s[c],c,n))&&(delete s[c],i=!0)}}return T.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let s=n.length,i=!1;for(;s--;){const o=n[s];(!t||Jo(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,s={};return T.forEach(this,(i,o)=>{const a=T.findKey(s,o);if(a){n[a]=_i(i),delete n[o];return}const c=t?Pv(o):String(o).trim();c!==o&&delete n[o],n[c]=_i(i),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(s,i)=>{s!=null&&s!==!1&&(n[i]=t&&T.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ju]=this[ju]={accessors:{}}).accessors,i=this.prototype;function o(a){const c=ir(a);s[c]||(Iv(i,a),s[c]=!0)}return T.isArray(t)?t.forEach(o):o(t),this}}yt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(yt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});T.freezeMethods(yt);function Xo(e,t){const n=this||Nr,s=t||n,i=yt.from(s.headers);let o=s.data;return T.forEach(e,function(c){o=c.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function sh(e){return!!(e&&e.__CANCEL__)}function Ks(e,t,n){de.call(this,e??"canceled",de.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Ks,de,{__CANCEL__:!0});function rh(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new de("Request failed with status code "+n.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lv(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Dv(e,t){e=e||10;const n=new Array(e),s=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(f){const p=Date.now(),d=s[o];a||(a=p),n[i]=f,s[i]=p;let m=o,b=0;for(;m!==i;)b+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),p-a{n=d,i=null,o&&(clearTimeout(o),o=null),e.apply(null,p)};return[(...p)=>{const d=Date.now(),m=d-n;m>=s?a(p,d):(i=p,o||(o=setTimeout(()=>{o=null,a(i)},s-m)))},()=>i&&a(i)]}const xi=(e,t,n=3)=>{let s=0;const i=Dv(50,250);return Nv(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,f=a-s,p=i(f),d=a<=c;s=a;const m={loaded:a,total:c,progress:c?a/c:void 0,bytes:f,rate:p||void 0,estimated:p&&c&&d?(c-a)/p:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},Bu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},Hu=e=>(...t)=>T.asap(()=>e(...t)),kv=bt.hasStandardBrowserEnv?function(){const t=bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent),n=document.createElement("a");let s;function i(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=i(window.location.href),function(a){const c=T.isString(a)?i(a):a;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}(),Mv=bt.hasStandardBrowserEnv?{write(e,t,n,s,i,o){const a=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),T.isString(s)&&a.push("path="+s),T.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $v(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fv(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ih(e,t){return e&&!$v(t)?Fv(e,t):t}const Vu=e=>e instanceof yt?{...e}:e;function ms(e,t){t=t||{};const n={};function s(p,d,m){return T.isPlainObject(p)&&T.isPlainObject(d)?T.merge.call({caseless:m},p,d):T.isPlainObject(d)?T.merge({},d):T.isArray(d)?d.slice():d}function i(p,d,m){if(T.isUndefined(d)){if(!T.isUndefined(p))return s(void 0,p,m)}else return s(p,d,m)}function o(p,d){if(!T.isUndefined(d))return s(void 0,d)}function a(p,d){if(T.isUndefined(d)){if(!T.isUndefined(p))return s(void 0,p)}else return s(void 0,d)}function c(p,d,m){if(m in t)return s(p,d);if(m in e)return s(void 0,p)}const f={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(p,d)=>i(Vu(p),Vu(d),!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(d){const m=f[d]||i,b=m(e[d],t[d],d);T.isUndefined(b)&&m!==c||(n[d]=b)}),n}const oh=e=>{const t=ms({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:c}=t;t.headers=a=yt.from(a),t.url=eh(ih(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(T.isFormData(n)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((f=a.getContentType())!==!1){const[p,...d]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...d].join("; "))}}if(bt.hasStandardBrowserEnv&&(s&&T.isFunction(s)&&(s=s(t)),s||s!==!1&&kv(t.url))){const p=i&&o&&Mv.read(o);p&&a.set(i,p)}return t},jv=typeof XMLHttpRequest<"u",Bv=jv&&function(e){return new Promise(function(n,s){const i=oh(e);let o=i.data;const a=yt.from(i.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:p}=i,d,m,b,w,C;function P(){w&&w(),C&&C(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let R=new XMLHttpRequest;R.open(i.method.toUpperCase(),i.url,!0),R.timeout=i.timeout;function $(){if(!R)return;const B=yt.from("getAllResponseHeaders"in R&&R.getAllResponseHeaders()),Y={data:!c||c==="text"||c==="json"?R.responseText:R.response,status:R.status,statusText:R.statusText,headers:B,config:e,request:R};rh(function(le){n(le),P()},function(le){s(le),P()},Y),R=null}"onloadend"in R?R.onloadend=$:R.onreadystatechange=function(){!R||R.readyState!==4||R.status===0&&!(R.responseURL&&R.responseURL.indexOf("file:")===0)||setTimeout($)},R.onabort=function(){R&&(s(new de("Request aborted",de.ECONNABORTED,e,R)),R=null)},R.onerror=function(){s(new de("Network Error",de.ERR_NETWORK,e,R)),R=null},R.ontimeout=function(){let H=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const Y=i.transitional||th;i.timeoutErrorMessage&&(H=i.timeoutErrorMessage),s(new de(H,Y.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,R)),R=null},o===void 0&&a.setContentType(null),"setRequestHeader"in R&&T.forEach(a.toJSON(),function(H,Y){R.setRequestHeader(Y,H)}),T.isUndefined(i.withCredentials)||(R.withCredentials=!!i.withCredentials),c&&c!=="json"&&(R.responseType=i.responseType),p&&([b,C]=xi(p,!0),R.addEventListener("progress",b)),f&&R.upload&&([m,w]=xi(f),R.upload.addEventListener("progress",m),R.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(d=B=>{R&&(s(!B||B.type?new Ks(null,e,R):B),R.abort(),R=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const N=Lv(i.url);if(N&&bt.protocols.indexOf(N)===-1){s(new de("Unsupported protocol "+N+":",de.ERR_BAD_REQUEST,e));return}R.send(o||null)})},Hv=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,i;const o=function(p){if(!i){i=!0,c();const d=p instanceof Error?p:this.reason;s.abort(d instanceof de?d:new Ks(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,o(new de(`timeout ${t} of ms exceeded`,de.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(o):p.removeEventListener("abort",o)}),e=null)};e.forEach(p=>p.addEventListener("abort",o));const{signal:f}=s;return f.unsubscribe=()=>T.asap(c),f}},Vv=function*(e,t){let n=e.byteLength;if(!t||n{const i=Uv(e,t);let o=0,a,c=f=>{a||(a=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:p,value:d}=await i.next();if(p){c(),f.close();return}let m=d.byteLength;if(n){let b=o+=m;n(b)}f.enqueue(new Uint8Array(d))}catch(p){throw c(p),p}},cancel(f){return c(f),i.return()}},{highWaterMark:2})},Qi=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ah=Qi&&typeof ReadableStream=="function",Wv=Qi&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),lh=(e,...t)=>{try{return!!e(...t)}catch{return!1}},zv=ah&&lh(()=>{let e=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),qu=64*1024,ba=ah&&lh(()=>T.isReadableStream(new Response("").body)),Ri={stream:ba&&(e=>e.body)};Qi&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ri[t]&&(Ri[t]=T.isFunction(e[t])?n=>n[t]():(n,s)=>{throw new de(`Response type '${t}' is not supported`,de.ERR_NOT_SUPPORT,s)})})})(new Response);const Kv=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(bt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await Wv(e)).byteLength},Gv=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??Kv(t)},Jv=Qi&&(async e=>{let{url:t,method:n,data:s,signal:i,cancelToken:o,timeout:a,onDownloadProgress:c,onUploadProgress:f,responseType:p,headers:d,withCredentials:m="same-origin",fetchOptions:b}=oh(e);p=p?(p+"").toLowerCase():"text";let w=Hv([i,o&&o.toAbortSignal()],a),C;const P=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let R;try{if(f&&zv&&n!=="get"&&n!=="head"&&(R=await Gv(d,s))!==0){let Y=new Request(t,{method:"POST",body:s,duplex:"half"}),ge;if(T.isFormData(s)&&(ge=Y.headers.get("content-type"))&&d.setContentType(ge),Y.body){const[le,te]=Bu(R,xi(Hu(f)));s=Uu(Y.body,qu,le,te)}}T.isString(m)||(m=m?"include":"omit");const $="credentials"in Request.prototype;C=new Request(t,{...b,signal:w,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:$?m:void 0});let N=await fetch(C);const B=ba&&(p==="stream"||p==="response");if(ba&&(c||B&&P)){const Y={};["status","statusText","headers"].forEach(q=>{Y[q]=N[q]});const ge=T.toFiniteNumber(N.headers.get("content-length")),[le,te]=c&&Bu(ge,xi(Hu(c),!0))||[];N=new Response(Uu(N.body,qu,le,()=>{te&&te(),P&&P()}),Y)}p=p||"text";let H=await Ri[T.findKey(Ri,p)||"text"](N,e);return!B&&P&&P(),await new Promise((Y,ge)=>{rh(Y,ge,{data:H,headers:yt.from(N.headers),status:N.status,statusText:N.statusText,config:e,request:C})})}catch($){throw P&&P(),$&&$.name==="TypeError"&&/fetch/i.test($.message)?Object.assign(new de("Network Error",de.ERR_NETWORK,e,C),{cause:$.cause||$}):de.from($,$&&$.code,e,C)}}),ya={http:uv,xhr:Bv,fetch:Jv};T.forEach(ya,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wu=e=>`- ${e}`,Xv=e=>T.isFunction(e)||e===null||e===!1,ch={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,s;const i={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : +`+o.map(Wu).join(` +`):" "+Wu(o[0]):"as no adapter specified";throw new de("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:ya};function Qo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ks(null,e)}function zu(e){return Qo(e),e.headers=yt.from(e.headers),e.data=Xo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ch.getAdapter(e.adapter||Nr.adapter)(e).then(function(s){return Qo(e),s.data=Xo.call(e,e.transformResponse,s),s.headers=yt.from(s.headers),s},function(s){return sh(s)||(Qo(e),s&&s.response&&(s.response.data=Xo.call(e,e.transformResponse,s.response),s.response.headers=yt.from(s.response.headers))),Promise.reject(s)})}const uh="1.7.7",Qa={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Qa[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ku={};Qa.transitional=function(t,n,s){function i(o,a){return"[Axios v"+uh+"] Transitional option '"+o+"'"+a+(s?". "+s:"")}return(o,a,c)=>{if(t===!1)throw new de(i(a," has been removed"+(n?" in "+n:"")),de.ERR_DEPRECATED);return n&&!Ku[a]&&(Ku[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};function Qv(e,t,n){if(typeof e!="object")throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let i=s.length;for(;i-- >0;){const o=s[i],a=t[o];if(a){const c=e[o],f=c===void 0||a(c,o,e);if(f!==!0)throw new de("option "+o+" must be "+f,de.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new de("Unknown option "+o,de.ERR_BAD_OPTION)}}const va={assertOptions:Qv,validators:Qa},Ln=va.validators;class fs{constructor(t){this.defaults=t,this.interceptors={request:new Fu,response:new Fu}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=` +`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ms(this.defaults,n);const{transitional:s,paramsSerializer:i,headers:o}=n;s!==void 0&&va.assertOptions(s,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1),i!=null&&(T.isFunction(i)?n.paramsSerializer={serialize:i}:va.assertOptions(i,{encode:Ln.function,serialize:Ln.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&T.merge(o.common,o[n.method]);o&&T.forEach(["delete","get","head","post","put","patch","common"],C=>{delete o[C]}),n.headers=yt.concat(a,o);const c=[];let f=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(f=f&&P.synchronous,c.unshift(P.fulfilled,P.rejected))});const p=[];this.interceptors.response.forEach(function(P){p.push(P.fulfilled,P.rejected)});let d,m=0,b;if(!f){const C=[zu.bind(this),void 0];for(C.unshift.apply(C,c),C.push.apply(C,p),b=C.length,d=Promise.resolve(n);m{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](i);s._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(c=>{s.subscribe(c),o=c}).then(i);return a.cancel=function(){s.unsubscribe(o)},a},t(function(o,a,c){s.reason||(s.reason=new Ks(o,a,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ya(function(i){t=i}),cancel:t}}}function Yv(e){return function(n){return e.apply(null,n)}}function Zv(e){return T.isObject(e)&&e.isAxiosError===!0}const wa={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(wa).forEach(([e,t])=>{wa[t]=e});function fh(e){const t=new fs(e),n=Vd(fs.prototype.request,t);return T.extend(n,fs.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return fh(ms(e,i))},n}const Ke=fh(Nr);Ke.Axios=fs;Ke.CanceledError=Ks;Ke.CancelToken=Ya;Ke.isCancel=sh;Ke.VERSION=uh;Ke.toFormData=Xi;Ke.AxiosError=de;Ke.Cancel=Ke.CanceledError;Ke.all=function(t){return Promise.all(t)};Ke.spread=Yv;Ke.isAxiosError=Zv;Ke.mergeConfig=ms;Ke.AxiosHeaders=yt;Ke.formToJSON=e=>nh(T.isHTMLForm(e)?new FormData(e):e);Ke.getAdapter=ch.getAdapter;Ke.HttpStatusCode=wa;Ke.default=Ke;const ew="modulepreload",tw=function(e){return"/"+e},Gu={},on=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=tw(c),c in Gu)return;Gu[c]=!0;const f=c.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":ew,f||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),f)return new Promise((m,b)=>{d.addEventListener("load",m),d.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},dh=Ey({history:Qb(),routes:[{path:"/",name:"home",redirect:"/web/applications/swcatalog"},{path:"/web",name:"rootOssList",component:()=>on(()=>import("./OssList-L1_lVc8d.js"),__vite__mapDeps([0,1,2,3,4,5,6]))},{path:"/web/oss/list",name:"ossList",component:()=>on(()=>import("./OssList-L1_lVc8d.js"),__vite__mapDeps([0,1,2,3,4,5,6]))},{path:"/web/generate/yaml",name:"yamlGenerate",component:()=>on(()=>import("./YamlGenerate-CY7vMkIK.js"),__vite__mapDeps([7,5,8,9]))},{path:"/web/repository/list",redirect:e=>({name:"repositoryList",query:e.query,hash:e.hash})},{path:"/web/repository/detail/:repositoryName",redirect:e=>({name:"repositoryDetail",params:{repositoryName:e.params.repositoryName},query:e.query,hash:e.hash})},{path:"/web/softwareCatalog/install",name:"softwareCatalogInstall",component:()=>on(()=>import("./InstallSoftwareIframe-Dl_2Qi7t.js"),__vite__mapDeps([10,11,6,12,5,13,8,14,15]))},{path:"/web/softwareCatalog",redirect:e=>({name:"softwareCatalog",query:e.query,hash:e.hash})},{path:"/web/applications/swcatalog",name:"softwareCatalog",component:()=>on(()=>import("./SoftwareCatalog-qoXeieRx.js"),__vite__mapDeps([16,11,6,12,5,13,8,14,2,17,18,19]))},{path:"/web/applications/status",name:"applicationStatus",component:()=>on(()=>import("./ApplicationStatus-BKVG0wix.js"),__vite__mapDeps([20,17,2,13,5,8,18,3,4,21]))},{path:"/web/applications/repository",component:()=>on(()=>import("./ApplicationRepository-BBRiVMU8.js"),__vite__mapDeps([22,1,2])),children:[{path:"",name:"repositoryList",component:()=>on(()=>import("./RepositoryList-e6fBx0-3.js"),__vite__mapDeps([23,3,4,24,5,6]))},{path:":repositoryName",name:"repositoryDetail",component:()=>on(()=>import("./RepositoryDetail-DCPVJP7B.js"),__vite__mapDeps([25,24,5,12,3,4]))}]},{path:"/web/softwareCatalog/list/test",name:"softwareCatalogListTest",component:()=>on(()=>import("./SoftwareCatalogListTest-v-qS7pn0.js"),__vite__mapDeps([26,1,2,13,5,8,12,11,6,14,27]))}]}),nw=vb("user",{state:()=>({accessToken:"",workspaceInfo:{id:"",name:"",description:"",created_at:"",updated_at:""},projectInfo:{id:"",ns_id:"",mci_id:"",cluster_id:"",name:"",description:"",created_at:"",updated_at:""},operationId:""}),actions:{setUser(e){this.accessToken=e.accessToken,this.workspaceInfo=e.workspaceInfo,this.projectInfo=e.projectInfo,this.operationId=e.operationId},getNsId(){var e,t,n,s;return((e=this.projectInfo)==null?void 0:e.ns_id)||((t=this.projectInfo)==null?void 0:t.nsid)||((n=this.projectInfo)==null?void 0:n.nsId)||((s=this.projectInfo)==null?void 0:s.NsId)||null},clearUser(){this.accessToken=null,this.workspaceInfo=null,this.projectInfo=null,this.operationId=null}}});let Ju=!1;dh.beforeEach(async(e,t,n)=>{Ju||(window.addEventListener("message",function(s){var f,p,d,m;const i=s.data;if(!i||typeof i!="object")return;const o=String(i.accessToken??"").trim(),a=((f=i.workspaceInfo)==null?void 0:f.id)??((p=i.workspaceInfo)==null?void 0:p.Id),c=((d=i.projectInfo)==null?void 0:d.id)??((m=i.projectInfo)==null?void 0:m.Id);if(!(!o||["undefined","null"].includes(o.toLowerCase())||!a||!c))try{nw().setUser(i)}catch{console.error("Unable to apply Web Console project context.")}}),Ju=!0),n()});const sw=e=>{const t=e==null?void 0:e.trim();if(!t)return window.location.origin;try{const n=new URL(t),s=new Set(["localhost","127.0.0.1","::1"]);if(s.has(n.hostname)&&!s.has(window.location.hostname))return window.location.origin}catch{return t}return t!=null&&t.startsWith("http://")&&window.location.protocol==="https:"?window.location.origin:t},f0=e=>e?/^(?:[a-z][a-z\d+\-.]*:)?\/\//i.test(e)||e.startsWith("data:")?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`:"";var rw=Object.defineProperty,Xu=Object.getOwnPropertySymbols,iw=Object.prototype.hasOwnProperty,ow=Object.prototype.propertyIsEnumerable,Qu=(e,t,n)=>t in e?rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hh=(e,t)=>{for(var n in t||(t={}))iw.call(t,n)&&Qu(e,n,t[n]);if(Xu)for(var n of Xu(t))ow.call(t,n)&&Qu(e,n,t[n]);return e},Yi=e=>typeof e=="function",Zi=e=>typeof e=="string",ph=e=>Zi(e)&&e.trim().length>0,aw=e=>typeof e=="number",ls=e=>typeof e>"u",Tr=e=>typeof e=="object"&&e!==null,lw=e=>un(e,"tag")&&ph(e.tag),mh=e=>window.TouchEvent&&e instanceof TouchEvent,gh=e=>un(e,"component")&&_h(e.component),cw=e=>Yi(e)||Tr(e),_h=e=>!ls(e)&&(Zi(e)||cw(e)||gh(e)),Yu=e=>Tr(e)&&["height","width","right","left","top","bottom"].every(t=>aw(e[t])),un=(e,t)=>(Tr(e)||Yi(e))&&t in e,uw=(e=>()=>e++)(0);function Yo(e){return mh(e)?e.targetTouches[0].clientX:e.clientX}function Zu(e){return mh(e)?e.targetTouches[0].clientY:e.clientY}var fw=e=>{ls(e.remove)?e.parentNode&&e.parentNode.removeChild(e):e.remove()},kr=e=>gh(e)?kr(e.component):lw(e)?dn({render(){return e}}):typeof e=="string"?e:Ee(jn(e)),dw=e=>{if(typeof e=="string")return e;const t=un(e,"props")&&Tr(e.props)?e.props:{},n=un(e,"listeners")&&Tr(e.listeners)?e.listeners:{};return{component:kr(e),props:t,listeners:n}},hw=()=>typeof window<"u",Za=class{constructor(){this.allHandlers={}}getHandlers(e){return this.allHandlers[e]||[]}on(e,t){const n=this.getHandlers(e);n.push(t),this.allHandlers[e]=n}off(e,t){const n=this.getHandlers(e);n.splice(n.indexOf(t)>>>0,1)}emit(e,t){this.getHandlers(e).forEach(s=>s(t))}},pw=e=>["on","off","emit"].every(t=>un(e,t)&&Yi(e[t])),Tt;(function(e){e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.DEFAULT="default"})(Tt||(Tt={}));var Pi;(function(e){e.TOP_LEFT="top-left",e.TOP_CENTER="top-center",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_CENTER="bottom-center",e.BOTTOM_RIGHT="bottom-right"})(Pi||(Pi={}));var At;(function(e){e.ADD="add",e.DISMISS="dismiss",e.UPDATE="update",e.CLEAR="clear",e.UPDATE_DEFAULTS="update_defaults"})(At||(At={}));var Wt="Vue-Toastification",Ut={type:{type:String,default:Tt.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},bh={type:Ut.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},bi={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:Ut.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},Ea={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},yh={transition:{type:[Object,String],default:`${Wt}__bounce`}},mw={position:{type:String,default:Pi.TOP_RIGHT},draggable:Ut.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:Ut.trueBoolean,pauseOnHover:Ut.trueBoolean,closeOnClick:Ut.trueBoolean,timeout:Ea.timeout,hideProgressBar:Ea.hideProgressBar,toastClassName:Ut.classNames,bodyClassName:Ut.classNames,icon:bh.customIcon,closeButton:bi.component,closeButtonClassName:bi.classNames,showCloseButtonOnHover:bi.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Za}},gw={id:{type:[String,Number],required:!0,default:0},type:Ut.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},_w={container:{type:[Object,Function],default:()=>document.body},newestOnTop:Ut.trueBoolean,maxToasts:{type:Number,default:20},transition:yh.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:e=>e},filterToasts:{type:Function,default:e=>e},containerClassName:Ut.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},Cn={CORE_TOAST:mw,TOAST:gw,CONTAINER:_w,PROGRESS_BAR:Ea,ICON:bh,TRANSITION:yh,CLOSE_BUTTON:bi},vh=dn({name:"VtProgressBar",props:Cn.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${Wt}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function bw(e,t){return Ve(),qt("div",{style:Or(e.style),class:Hn(e.cpClass)},null,6)}vh.render=bw;var yw=vh,wh=dn({name:"VtCloseButton",props:Cn.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?kr(this.component):"button"},classes(){const e=[`${Wt}__close-button`];return this.showOnHover&&e.push("show-on-hover"),e.concat(this.classNames)}}}),vw=Bi(" × ");function ww(e,t){return Ve(),jt(Va(e.buttonComponent),Hi({"aria-label":e.ariaLabel,class:e.classes},e.$attrs),{default:Ir(()=>[vw]),_:1},16,["aria-label","class"])}wh.render=ww;var Ew=wh,Eh={},Cw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Sw=_s("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),Tw=[Sw];function Aw(e,t){return Ve(),qt("svg",Cw,Tw)}Eh.render=Aw;var Ow=Eh,Ch={},xw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Rw=_s("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),Pw=[Rw];function Iw(e,t){return Ve(),qt("svg",xw,Pw)}Ch.render=Iw;var ef=Ch,Sh={},Lw={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Dw=_s("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),Nw=[Dw];function kw(e,t){return Ve(),qt("svg",Lw,Nw)}Sh.render=kw;var Mw=Sh,Th={},$w={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},Fw=_s("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),jw=[Fw];function Bw(e,t){return Ve(),qt("svg",$w,jw)}Th.render=Bw;var Hw=Th,Ah=dn({name:"VtIcon",props:Cn.ICON,computed:{customIconChildren(){return un(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Zi(this.customIcon)?this.trimValue(this.customIcon):un(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return un(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:_h(this.customIcon)?kr(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[Tt.DEFAULT]:ef,[Tt.INFO]:ef,[Tt.SUCCESS]:Ow,[Tt.ERROR]:Hw,[Tt.WARNING]:Mw}[this.type]},iconClasses(){const e=[`${Wt}__icon`];return this.hasCustomIcon?e.concat(this.customIconClass):e}},methods:{trimValue(e,t=""){return ph(e)?e.trim():t}}});function Vw(e,t){return Ve(),jt(Va(e.component),{class:Hn(e.iconClasses)},{default:Ir(()=>[Bi(xa(e.customIconChildren),1)]),_:1},8,["class"])}Ah.render=Vw;var Uw=Ah,Oh=dn({name:"VtToast",components:{ProgressBar:yw,CloseButton:Ew,Icon:Uw},inheritAttrs:!1,props:Object.assign({},Cn.CORE_TOAST,Cn.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const e=[`${Wt}__toast`,`${Wt}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&e.push("disable-transition"),this.rtl&&e.push(`${Wt}__toast--rtl`),e},bodyClasses(){return[`${Wt}__toast-${Zi(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return Yu(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:un,getVueComponentFromObj:kr,closeToast(){this.eventBus.emit(At.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const e=this.$el;e.addEventListener("touchstart",this.onDragStart,{passive:!0}),e.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const e=this.$el;e.removeEventListener("touchstart",this.onDragStart),e.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(e){this.beingDragged=!0,this.dragPos={x:Yo(e),y:Zu(e)},this.dragStart=Yo(e),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(e){this.beingDragged&&(e.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:Yo(e),y:Zu(e)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,Yu(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),qw=["role"];function Ww(e,t){const n=cr("Icon"),s=cr("CloseButton"),i=cr("ProgressBar");return Ve(),qt("div",{class:Hn(e.classes),style:Or(e.draggableStyle),onClick:t[0]||(t[0]=(...o)=>e.clickHandler&&e.clickHandler(...o)),onMouseenter:t[1]||(t[1]=(...o)=>e.hoverPause&&e.hoverPause(...o)),onMouseleave:t[2]||(t[2]=(...o)=>e.hoverPlay&&e.hoverPlay(...o))},[e.icon?(Ve(),jt(n,{key:0,"custom-icon":e.icon,type:e.type},null,8,["custom-icon","type"])):Bo("v-if",!0),_s("div",{role:e.accessibility.toastRole||"alert",class:Hn(e.bodyClasses)},[typeof e.content=="string"?(Ve(),qt(tt,{key:0},[Bi(xa(e.content),1)],2112)):(Ve(),jt(Va(e.getVueComponentFromObj(e.content)),Hi({key:1,"toast-id":e.id},e.hasProp(e.content,"props")?e.content.props:{},Hg(e.hasProp(e.content,"listeners")?e.content.listeners:{}),{onCloseToast:e.closeToast}),null,16,["toast-id","onCloseToast"]))],10,qw),e.closeButton?(Ve(),jt(s,{key:1,component:e.closeButton,"class-names":e.closeButtonClassName,"show-on-hover":e.showCloseButtonOnHover,"aria-label":e.accessibility.closeButtonLabel,onClick:lb(e.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):Bo("v-if",!0),e.timeout?(Ve(),jt(i,{key:2,"is-running":e.isRunning,"hide-progress-bar":e.hideProgressBar,timeout:e.timeout,onCloseToast:e.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):Bo("v-if",!0)],38)}Oh.render=Ww;var zw=Oh,xh=dn({name:"VtTransition",props:Cn.TRANSITION,emits:["leave"],methods:{hasProp:un,leave(e){e instanceof HTMLElement&&(e.style.left=e.offsetLeft+"px",e.style.top=e.offsetTop+"px",e.style.width=getComputedStyle(e).width,e.style.position="absolute")}}});function Kw(e,t){return Ve(),jt(eb,{tag:"div","enter-active-class":e.transition.enter?e.transition.enter:`${e.transition}-enter-active`,"move-class":e.transition.move?e.transition.move:`${e.transition}-move`,"leave-active-class":e.transition.leave?e.transition.leave:`${e.transition}-leave-active`,onLeave:e.leave},{default:Ir(()=>[Bg(e.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}xh.render=Kw;var Gw=xh,Rh=dn({name:"VueToastification",devtools:{hide:!0},components:{Toast:zw,VtTransition:Gw},props:Object.assign({},Cn.CORE_TOAST,Cn.CONTAINER,Cn.TRANSITION),data(){return{count:0,positions:Object.values(Pi),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const e=this.eventBus;e.on(At.ADD,this.addToast),e.on(At.CLEAR,this.clearToasts),e.on(At.DISMISS,this.dismissToast),e.on(At.UPDATE,this.updateToast),e.on(At.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(e){Yi(e)&&(e=await e()),fw(this.$el),e.appendChild(this.$el)},setToast(e){ls(e.id)||(this.toasts[e.id]=e)},addToast(e){e.content=dw(e.content);const t=Object.assign({},this.defaults,e.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[e.type],e),n=this.defaults.filterBeforeCreate(t,this.toastArray);n&&this.setToast(n)},dismissToast(e){const t=this.toasts[e];!ls(t)&&!ls(t.onClose)&&t.onClose(),delete this.toasts[e]},clearToasts(){Object.keys(this.toasts).forEach(e=>{this.dismissToast(e)})},getPositionToasts(e){const t=this.filteredToasts.filter(n=>n.position===e).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?t.reverse():t},updateDefaults(e){ls(e.container)||this.setup(e.container),this.defaults=Object.assign({},this.defaults,e)},updateToast({id:e,options:t,create:n}){this.toasts[e]?(t.timeout&&t.timeout===this.toasts[e].timeout&&t.timeout++,this.setToast(Object.assign({},this.toasts[e],t))):n&&this.addToast(Object.assign({},{id:e},t))},getClasses(e){return[`${Wt}__container`,e].concat(this.defaults.containerClassName)}}});function Jw(e,t){const n=cr("Toast"),s=cr("VtTransition");return Ve(),qt("div",null,[(Ve(!0),qt(tt,null,jc(e.positions,i=>(Ve(),qt("div",{key:i},[nt(s,{transition:e.defaults.transition,class:Hn(e.getClasses(i))},{default:Ir(()=>[(Ve(!0),qt(tt,null,jc(e.getPositionToasts(i),o=>(Ve(),jt(n,Hi({key:o.id},o),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}Rh.render=Jw;var Xw=Rh,tf=(e={},t=!0)=>{const n=e.eventBus=e.eventBus||new Za;t&&Pr(()=>{const o=Td(Xw,hh({},e)),a=o.mount(document.createElement("div")),c=e.onMounted;if(ls(c)||c(a,o),e.shareAppContext){const f=e.shareAppContext;f===!0?console.warn(`[${Wt}] App to share context with was not provided.`):(o._context.components=f._context.components,o._context.directives=f._context.directives,o._context.mixins=f._context.mixins,o._context.provides=f._context.provides,o.config.globalProperties=f.config.globalProperties)}});const s=(o,a)=>{const c=Object.assign({},{id:uw(),type:Tt.DEFAULT},a,{content:o});return n.emit(At.ADD,c),c.id};s.clear=()=>n.emit(At.CLEAR,void 0),s.updateDefaults=o=>{n.emit(At.UPDATE_DEFAULTS,o)},s.dismiss=o=>{n.emit(At.DISMISS,o)};function i(o,{content:a,options:c},f=!1){const p=Object.assign({},c,{content:a});n.emit(At.UPDATE,{id:o,options:p,create:f})}return s.update=i,s.success=(o,a)=>s(o,Object.assign({},a,{type:Tt.SUCCESS})),s.info=(o,a)=>s(o,Object.assign({},a,{type:Tt.INFO})),s.error=(o,a)=>s(o,Object.assign({},a,{type:Tt.ERROR})),s.warning=(o,a)=>s(o,Object.assign({},a,{type:Tt.WARNING})),s},Qw=()=>{const e=()=>console.warn(`[${Wt}] This plugin does not support SSR!`);return new Proxy(e,{get(){return e}})};function Ph(e){return hw()?pw(e)?tf({eventBus:e},!1):tf(e,!0):Qw()}var Ih=Symbol("VueToastification"),Lh=new Za,Yw=(e,t)=>{(t==null?void 0:t.shareAppContext)===!0&&(t.shareAppContext=e);const n=Ph(hh({eventBus:Lh},t));e.provide(Ih,n)},d0=e=>{const t=hd()?xt(Ih,void 0):void 0;return t||Ph(Lh)},Zw=Yw,e0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function h0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t0={exports:{}};/*! + * Bootstrap v5.3.3 (https://getbootstrap.com/) + * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */(function(e,t){(function(n,s){e.exports=s()})(e0,function(){const n=new Map,s={set(u,r,l){n.has(u)||n.set(u,new Map);const h=n.get(u);h.has(r)||h.size===0?h.set(r,l):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(h.keys())[0]}.`)},get:(u,r)=>n.has(u)&&n.get(u).get(r)||null,remove(u,r){if(!n.has(u))return;const l=n.get(u);l.delete(r),l.size===0&&n.delete(u)}},i="transitionend",o=u=>(u&&window.CSS&&window.CSS.escape&&(u=u.replace(/#([^\s"#']+)/g,(r,l)=>`#${CSS.escape(l)}`)),u),a=u=>{u.dispatchEvent(new Event(i))},c=u=>!(!u||typeof u!="object")&&(u.jquery!==void 0&&(u=u[0]),u.nodeType!==void 0),f=u=>c(u)?u.jquery?u[0]:u:typeof u=="string"&&u.length>0?document.querySelector(o(u)):null,p=u=>{if(!c(u)||u.getClientRects().length===0)return!1;const r=getComputedStyle(u).getPropertyValue("visibility")==="visible",l=u.closest("details:not([open])");if(!l)return r;if(l!==u){const h=u.closest("summary");if(h&&h.parentNode!==l||h===null)return!1}return r},d=u=>!u||u.nodeType!==Node.ELEMENT_NODE||!!u.classList.contains("disabled")||(u.disabled!==void 0?u.disabled:u.hasAttribute("disabled")&&u.getAttribute("disabled")!=="false"),m=u=>{if(!document.documentElement.attachShadow)return null;if(typeof u.getRootNode=="function"){const r=u.getRootNode();return r instanceof ShadowRoot?r:null}return u instanceof ShadowRoot?u:u.parentNode?m(u.parentNode):null},b=()=>{},w=u=>{u.offsetHeight},C=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,P=[],R=()=>document.documentElement.dir==="rtl",$=u=>{var r;r=()=>{const l=C();if(l){const h=u.NAME,y=l.fn[h];l.fn[h]=u.jQueryInterface,l.fn[h].Constructor=u,l.fn[h].noConflict=()=>(l.fn[h]=y,u.jQueryInterface)}},document.readyState==="loading"?(P.length||document.addEventListener("DOMContentLoaded",()=>{for(const l of P)l()}),P.push(r)):r()},N=(u,r=[],l=u)=>typeof u=="function"?u(...r):l,B=(u,r,l=!0)=>{if(!l)return void N(u);const h=(S=>{if(!S)return 0;let{transitionDuration:L,transitionDelay:j}=window.getComputedStyle(S);const J=Number.parseFloat(L),X=Number.parseFloat(j);return J||X?(L=L.split(",")[0],j=j.split(",")[0],1e3*(Number.parseFloat(L)+Number.parseFloat(j))):0})(r)+5;let y=!1;const v=({target:S})=>{S===r&&(y=!0,r.removeEventListener(i,v),N(u))};r.addEventListener(i,v),setTimeout(()=>{y||a(r)},h)},H=(u,r,l,h)=>{const y=u.length;let v=u.indexOf(r);return v===-1?!l&&h?u[y-1]:u[0]:(v+=l?1:-1,h&&(v=(v+y)%y),u[Math.max(0,Math.min(v,y-1))])},Y=/[^.]*(?=\..*)\.|.*/,ge=/\..*/,le=/::\d+$/,te={};let q=1;const oe={mouseenter:"mouseover",mouseleave:"mouseout"},ve=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function G(u,r){return r&&`${r}::${q++}`||u.uidEvent||q++}function be(u){const r=G(u);return u.uidEvent=r,te[r]=te[r]||{},te[r]}function He(u,r,l=null){return Object.values(u).find(h=>h.callable===r&&h.delegationSelector===l)}function st(u,r,l){const h=typeof r=="string",y=h?l:r||l;let v=Pt(u);return ve.has(v)||(v=u),[h,y,v]}function Oe(u,r,l,h,y){if(typeof r!="string"||!u)return;let[v,S,L]=st(r,l,h);r in oe&&(S=(ce=>function(ie){if(!ie.relatedTarget||ie.relatedTarget!==ie.delegateTarget&&!ie.delegateTarget.contains(ie.relatedTarget))return ce.call(this,ie)})(S));const j=be(u),J=j[L]||(j[L]={}),X=He(J,S,v?l:null);if(X)return void(X.oneOff=X.oneOff&&y);const K=G(S,r.replace(Y,"")),he=v?function(se,ce,ie){return function ue(Le){const Fe=se.querySelectorAll(ce);for(let{target:_e}=Le;_e&&_e!==this;_e=_e.parentNode)for(const Ae of Fe)if(Ae===_e)return _t(Le,{delegateTarget:_e}),ue.oneOff&&I.off(se,Le.type,ce,ie),ie.apply(_e,[Le])}}(u,l,S):function(se,ce){return function ie(ue){return _t(ue,{delegateTarget:se}),ie.oneOff&&I.off(se,ue.type,ce),ce.apply(se,[ue])}}(u,S);he.delegationSelector=v?l:null,he.callable=S,he.oneOff=y,he.uidEvent=K,J[K]=he,u.addEventListener(L,he,v)}function ae(u,r,l,h,y){const v=He(r[l],h,y);v&&(u.removeEventListener(l,v,!!y),delete r[l][v.uidEvent])}function Se(u,r,l,h){const y=r[l]||{};for(const[v,S]of Object.entries(y))v.includes(h)&&ae(u,r,l,S.callable,S.delegationSelector)}function Pt(u){return u=u.replace(ge,""),oe[u]||u}const I={on(u,r,l,h){Oe(u,r,l,h,!1)},one(u,r,l,h){Oe(u,r,l,h,!0)},off(u,r,l,h){if(typeof r!="string"||!u)return;const[y,v,S]=st(r,l,h),L=S!==r,j=be(u),J=j[S]||{},X=r.startsWith(".");if(v===void 0){if(X)for(const K of Object.keys(j))Se(u,j,K,r.slice(1));for(const[K,he]of Object.entries(J)){const se=K.replace(le,"");L&&!r.includes(se)||ae(u,j,S,he.callable,he.delegationSelector)}}else{if(!Object.keys(J).length)return;ae(u,j,S,v,y?l:null)}},trigger(u,r,l){if(typeof r!="string"||!u)return null;const h=C();let y=null,v=!0,S=!0,L=!1;r!==Pt(r)&&h&&(y=h.Event(r,l),h(u).trigger(y),v=!y.isPropagationStopped(),S=!y.isImmediatePropagationStopped(),L=y.isDefaultPrevented());const j=_t(new Event(r,{bubbles:v,cancelable:!0}),l);return L&&j.preventDefault(),S&&u.dispatchEvent(j),j.defaultPrevented&&y&&y.preventDefault(),j}};function _t(u,r={}){for(const[l,h]of Object.entries(r))try{u[l]=h}catch{Object.defineProperty(u,l,{configurable:!0,get:()=>h})}return u}function et(u){if(u==="true")return!0;if(u==="false")return!1;if(u===Number(u).toString())return Number(u);if(u===""||u==="null")return null;if(typeof u!="string")return u;try{return JSON.parse(decodeURIComponent(u))}catch{return u}}function Yt(u){return u.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}const rt={setDataAttribute(u,r,l){u.setAttribute(`data-bs-${Yt(r)}`,l)},removeDataAttribute(u,r){u.removeAttribute(`data-bs-${Yt(r)}`)},getDataAttributes(u){if(!u)return{};const r={},l=Object.keys(u.dataset).filter(h=>h.startsWith("bs")&&!h.startsWith("bsConfig"));for(const h of l){let y=h.replace(/^bs/,"");y=y.charAt(0).toLowerCase()+y.slice(1,y.length),r[y]=et(u.dataset[h])}return r},getDataAttribute:(u,r)=>et(u.getAttribute(`data-bs-${Yt(r)}`))};class Zt{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(r){return r=this._mergeConfigObj(r),r=this._configAfterMerge(r),this._typeCheckConfig(r),r}_configAfterMerge(r){return r}_mergeConfigObj(r,l){const h=c(l)?rt.getDataAttribute(l,"config"):{};return{...this.constructor.Default,...typeof h=="object"?h:{},...c(l)?rt.getDataAttributes(l):{},...typeof r=="object"?r:{}}}_typeCheckConfig(r,l=this.constructor.DefaultType){for(const[y,v]of Object.entries(l)){const S=r[y],L=c(S)?"element":(h=S)==null?`${h}`:Object.prototype.toString.call(h).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(v).test(L))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${y}" provided type "${L}" but expected type "${v}".`)}var h}}class Be extends Zt{constructor(r,l){super(),(r=f(r))&&(this._element=r,this._config=this._getConfig(l),s.set(this._element,this.constructor.DATA_KEY,this))}dispose(){s.remove(this._element,this.constructor.DATA_KEY),I.off(this._element,this.constructor.EVENT_KEY);for(const r of Object.getOwnPropertyNames(this))this[r]=null}_queueCallback(r,l,h=!0){B(r,l,h)}_getConfig(r){return r=this._mergeConfigObj(r,this._element),r=this._configAfterMerge(r),this._typeCheckConfig(r),r}static getInstance(r){return s.get(f(r),this.DATA_KEY)}static getOrCreateInstance(r,l={}){return this.getInstance(r)||new this(r,typeof l=="object"?l:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(r){return`${r}${this.EVENT_KEY}`}}const x=u=>{let r=u.getAttribute("data-bs-target");if(!r||r==="#"){let l=u.getAttribute("href");if(!l||!l.includes("#")&&!l.startsWith("."))return null;l.includes("#")&&!l.startsWith("#")&&(l=`#${l.split("#")[1]}`),r=l&&l!=="#"?l.trim():null}return r?r.split(",").map(l=>o(l)).join(","):null},A={find:(u,r=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(r,u)),findOne:(u,r=document.documentElement)=>Element.prototype.querySelector.call(r,u),children:(u,r)=>[].concat(...u.children).filter(l=>l.matches(r)),parents(u,r){const l=[];let h=u.parentNode.closest(r);for(;h;)l.push(h),h=h.parentNode.closest(r);return l},prev(u,r){let l=u.previousElementSibling;for(;l;){if(l.matches(r))return[l];l=l.previousElementSibling}return[]},next(u,r){let l=u.nextElementSibling;for(;l;){if(l.matches(r))return[l];l=l.nextElementSibling}return[]},focusableChildren(u){const r=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(l=>`${l}:not([tabindex^="-"])`).join(",");return this.find(r,u).filter(l=>!d(l)&&p(l))},getSelectorFromElement(u){const r=x(u);return r&&A.findOne(r)?r:null},getElementFromSelector(u){const r=x(u);return r?A.findOne(r):null},getMultipleElementsFromSelector(u){const r=x(u);return r?A.find(r):[]}},U=(u,r="hide")=>{const l=`click.dismiss${u.EVENT_KEY}`,h=u.NAME;I.on(document,l,`[data-bs-dismiss="${h}"]`,function(y){if(["A","AREA"].includes(this.tagName)&&y.preventDefault(),d(this))return;const v=A.getElementFromSelector(this)||this.closest(`.${h}`);u.getOrCreateInstance(v)[r]()})},Z=".bs.alert",Te=`close${Z}`,je=`closed${Z}`;class g extends Be{static get NAME(){return"alert"}close(){if(I.trigger(this._element,Te).defaultPrevented)return;this._element.classList.remove("show");const r=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,r)}_destroyElement(){this._element.remove(),I.trigger(this._element,je),this.dispose()}static jQueryInterface(r){return this.each(function(){const l=g.getOrCreateInstance(this);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r](this)}})}}U(g,"close"),$(g);const _='[data-bs-toggle="button"]';class E extends Be{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(r){return this.each(function(){const l=E.getOrCreateInstance(this);r==="toggle"&&l[r]()})}}I.on(document,"click.bs.button.data-api",_,u=>{u.preventDefault();const r=u.target.closest(_);E.getOrCreateInstance(r).toggle()}),$(E);const D=".bs.swipe",O=`touchstart${D}`,k=`touchmove${D}`,W=`touchend${D}`,V=`pointerdown${D}`,F=`pointerup${D}`,M={endCallback:null,leftCallback:null,rightCallback:null},ne={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class z extends Zt{constructor(r,l){super(),this._element=r,r&&z.isSupported()&&(this._config=this._getConfig(l),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return M}static get DefaultType(){return ne}static get NAME(){return"swipe"}dispose(){I.off(this._element,D)}_start(r){this._supportPointerEvents?this._eventIsPointerPenTouch(r)&&(this._deltaX=r.clientX):this._deltaX=r.touches[0].clientX}_end(r){this._eventIsPointerPenTouch(r)&&(this._deltaX=r.clientX-this._deltaX),this._handleSwipe(),N(this._config.endCallback)}_move(r){this._deltaX=r.touches&&r.touches.length>1?0:r.touches[0].clientX-this._deltaX}_handleSwipe(){const r=Math.abs(this._deltaX);if(r<=40)return;const l=r/this._deltaX;this._deltaX=0,l&&N(l>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(I.on(this._element,V,r=>this._start(r)),I.on(this._element,F,r=>this._end(r)),this._element.classList.add("pointer-event")):(I.on(this._element,O,r=>this._start(r)),I.on(this._element,k,r=>this._move(r)),I.on(this._element,W,r=>this._end(r)))}_eventIsPointerPenTouch(r){return this._supportPointerEvents&&(r.pointerType==="pen"||r.pointerType==="touch")}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Q=".bs.carousel",re=".data-api",pe="next",Ce="prev",ye="left",Xe="right",Qe=`slide${Q}`,at=`slid${Q}`,lt=`keydown${Q}`,Wn=`mouseenter${Q}`,$r=`mouseleave${Q}`,ct=`dragstart${Q}`,It=`load${Q}${re}`,Fr=`click${Q}${re}`,el="carousel",jr="active",tl=".active",nl=".carousel-item",Dh=tl+nl,Nh={ArrowLeft:Xe,ArrowRight:ye},kh={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Mh={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class bs extends Be{constructor(r,l){super(r,l),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=A.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===el&&this.cycle()}static get Default(){return kh}static get DefaultType(){return Mh}static get NAME(){return"carousel"}next(){this._slide(pe)}nextWhenVisible(){!document.hidden&&p(this._element)&&this.next()}prev(){this._slide(Ce)}pause(){this._isSliding&&a(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?I.one(this._element,at,()=>this.cycle()):this.cycle())}to(r){const l=this._getItems();if(r>l.length-1||r<0)return;if(this._isSliding)return void I.one(this._element,at,()=>this.to(r));const h=this._getItemIndex(this._getActive());if(h===r)return;const y=r>h?pe:Ce;this._slide(y,l[r])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(r){return r.defaultInterval=r.interval,r}_addEventListeners(){this._config.keyboard&&I.on(this._element,lt,r=>this._keydown(r)),this._config.pause==="hover"&&(I.on(this._element,Wn,()=>this.pause()),I.on(this._element,$r,()=>this._maybeEnableCycle())),this._config.touch&&z.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const l of A.find(".carousel-item img",this._element))I.on(l,ct,h=>h.preventDefault());const r={leftCallback:()=>this._slide(this._directionToOrder(ye)),rightCallback:()=>this._slide(this._directionToOrder(Xe)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new z(this._element,r)}_keydown(r){if(/input|textarea/i.test(r.target.tagName))return;const l=Nh[r.key];l&&(r.preventDefault(),this._slide(this._directionToOrder(l)))}_getItemIndex(r){return this._getItems().indexOf(r)}_setActiveIndicatorElement(r){if(!this._indicatorsElement)return;const l=A.findOne(tl,this._indicatorsElement);l.classList.remove(jr),l.removeAttribute("aria-current");const h=A.findOne(`[data-bs-slide-to="${r}"]`,this._indicatorsElement);h&&(h.classList.add(jr),h.setAttribute("aria-current","true"))}_updateInterval(){const r=this._activeElement||this._getActive();if(!r)return;const l=Number.parseInt(r.getAttribute("data-bs-interval"),10);this._config.interval=l||this._config.defaultInterval}_slide(r,l=null){if(this._isSliding)return;const h=this._getActive(),y=r===pe,v=l||H(this._getItems(),h,y,this._config.wrap);if(v===h)return;const S=this._getItemIndex(v),L=K=>I.trigger(this._element,K,{relatedTarget:v,direction:this._orderToDirection(r),from:this._getItemIndex(h),to:S});if(L(Qe).defaultPrevented||!h||!v)return;const j=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(S),this._activeElement=v;const J=y?"carousel-item-start":"carousel-item-end",X=y?"carousel-item-next":"carousel-item-prev";v.classList.add(X),w(v),h.classList.add(J),v.classList.add(J),this._queueCallback(()=>{v.classList.remove(J,X),v.classList.add(jr),h.classList.remove(jr,X,J),this._isSliding=!1,L(at)},h,this._isAnimated()),j&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return A.findOne(Dh,this._element)}_getItems(){return A.find(nl,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(r){return R()?r===ye?Ce:pe:r===ye?pe:Ce}_orderToDirection(r){return R()?r===Ce?ye:Xe:r===Ce?Xe:ye}static jQueryInterface(r){return this.each(function(){const l=bs.getOrCreateInstance(this,r);if(typeof r!="number"){if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r]()}}else l.to(r)})}}I.on(document,Fr,"[data-bs-slide], [data-bs-slide-to]",function(u){const r=A.getElementFromSelector(this);if(!r||!r.classList.contains(el))return;u.preventDefault();const l=bs.getOrCreateInstance(r),h=this.getAttribute("data-bs-slide-to");return h?(l.to(h),void l._maybeEnableCycle()):rt.getDataAttribute(this,"slide")==="next"?(l.next(),void l._maybeEnableCycle()):(l.prev(),void l._maybeEnableCycle())}),I.on(window,It,()=>{const u=A.find('[data-bs-ride="carousel"]');for(const r of u)bs.getOrCreateInstance(r)}),$(bs);const Gs=".bs.collapse",$h=`show${Gs}`,Fh=`shown${Gs}`,jh=`hide${Gs}`,Bh=`hidden${Gs}`,Hh=`click${Gs}.data-api`,eo="show",ys="collapse",Br="collapsing",Vh=`:scope .${ys} .${ys}`,to='[data-bs-toggle="collapse"]',Uh={parent:null,toggle:!0},qh={parent:"(null|element)",toggle:"boolean"};class vs extends Be{constructor(r,l){super(r,l),this._isTransitioning=!1,this._triggerArray=[];const h=A.find(to);for(const y of h){const v=A.getSelectorFromElement(y),S=A.find(v).filter(L=>L===this._element);v!==null&&S.length&&this._triggerArray.push(y)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Uh}static get DefaultType(){return qh}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let r=[];if(this._config.parent&&(r=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(y=>y!==this._element).map(y=>vs.getOrCreateInstance(y,{toggle:!1}))),r.length&&r[0]._isTransitioning||I.trigger(this._element,$h).defaultPrevented)return;for(const y of r)y.hide();const l=this._getDimension();this._element.classList.remove(ys),this._element.classList.add(Br),this._element.style[l]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const h=`scroll${l[0].toUpperCase()+l.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Br),this._element.classList.add(ys,eo),this._element.style[l]="",I.trigger(this._element,Fh)},this._element,!0),this._element.style[l]=`${this._element[h]}px`}hide(){if(this._isTransitioning||!this._isShown()||I.trigger(this._element,jh).defaultPrevented)return;const r=this._getDimension();this._element.style[r]=`${this._element.getBoundingClientRect()[r]}px`,w(this._element),this._element.classList.add(Br),this._element.classList.remove(ys,eo);for(const l of this._triggerArray){const h=A.getElementFromSelector(l);h&&!this._isShown(h)&&this._addAriaAndCollapsedClass([l],!1)}this._isTransitioning=!0,this._element.style[r]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(Br),this._element.classList.add(ys),I.trigger(this._element,Bh)},this._element,!0)}_isShown(r=this._element){return r.classList.contains(eo)}_configAfterMerge(r){return r.toggle=!!r.toggle,r.parent=f(r.parent),r}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const r=this._getFirstLevelChildren(to);for(const l of r){const h=A.getElementFromSelector(l);h&&this._addAriaAndCollapsedClass([l],this._isShown(h))}}_getFirstLevelChildren(r){const l=A.find(Vh,this._config.parent);return A.find(r,this._config.parent).filter(h=>!l.includes(h))}_addAriaAndCollapsedClass(r,l){if(r.length)for(const h of r)h.classList.toggle("collapsed",!l),h.setAttribute("aria-expanded",l)}static jQueryInterface(r){const l={};return typeof r=="string"&&/show|hide/.test(r)&&(l.toggle=!1),this.each(function(){const h=vs.getOrCreateInstance(this,l);if(typeof r=="string"){if(h[r]===void 0)throw new TypeError(`No method named "${r}"`);h[r]()}})}}I.on(document,Hh,to,function(u){(u.target.tagName==="A"||u.delegateTarget&&u.delegateTarget.tagName==="A")&&u.preventDefault();for(const r of A.getMultipleElementsFromSelector(this))vs.getOrCreateInstance(r,{toggle:!1}).toggle()}),$(vs);var ut="top",vt="bottom",wt="right",ft="left",Hr="auto",ws=[ut,vt,wt,ft],zn="start",Es="end",sl="clippingParents",no="viewport",Cs="popper",rl="reference",so=ws.reduce(function(u,r){return u.concat([r+"-"+zn,r+"-"+Es])},[]),ro=[].concat(ws,[Hr]).reduce(function(u,r){return u.concat([r,r+"-"+zn,r+"-"+Es])},[]),il="beforeRead",ol="read",al="afterRead",ll="beforeMain",cl="main",ul="afterMain",fl="beforeWrite",dl="write",hl="afterWrite",pl=[il,ol,al,ll,cl,ul,fl,dl,hl];function en(u){return u?(u.nodeName||"").toLowerCase():null}function Et(u){if(u==null)return window;if(u.toString()!=="[object Window]"){var r=u.ownerDocument;return r&&r.defaultView||window}return u}function Kn(u){return u instanceof Et(u).Element||u instanceof Element}function Lt(u){return u instanceof Et(u).HTMLElement||u instanceof HTMLElement}function io(u){return typeof ShadowRoot<"u"&&(u instanceof Et(u).ShadowRoot||u instanceof ShadowRoot)}const oo={name:"applyStyles",enabled:!0,phase:"write",fn:function(u){var r=u.state;Object.keys(r.elements).forEach(function(l){var h=r.styles[l]||{},y=r.attributes[l]||{},v=r.elements[l];Lt(v)&&en(v)&&(Object.assign(v.style,h),Object.keys(y).forEach(function(S){var L=y[S];L===!1?v.removeAttribute(S):v.setAttribute(S,L===!0?"":L)}))})},effect:function(u){var r=u.state,l={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,l.popper),r.styles=l,r.elements.arrow&&Object.assign(r.elements.arrow.style,l.arrow),function(){Object.keys(r.elements).forEach(function(h){var y=r.elements[h],v=r.attributes[h]||{},S=Object.keys(r.styles.hasOwnProperty(h)?r.styles[h]:l[h]).reduce(function(L,j){return L[j]="",L},{});Lt(y)&&en(y)&&(Object.assign(y.style,S),Object.keys(v).forEach(function(L){y.removeAttribute(L)}))})}},requires:["computeStyles"]};function tn(u){return u.split("-")[0]}var Gn=Math.max,Vr=Math.min,Ss=Math.round;function ao(){var u=navigator.userAgentData;return u!=null&&u.brands&&Array.isArray(u.brands)?u.brands.map(function(r){return r.brand+"/"+r.version}).join(" "):navigator.userAgent}function ml(){return!/^((?!chrome|android).)*safari/i.test(ao())}function Ts(u,r,l){r===void 0&&(r=!1),l===void 0&&(l=!1);var h=u.getBoundingClientRect(),y=1,v=1;r&&Lt(u)&&(y=u.offsetWidth>0&&Ss(h.width)/u.offsetWidth||1,v=u.offsetHeight>0&&Ss(h.height)/u.offsetHeight||1);var S=(Kn(u)?Et(u):window).visualViewport,L=!ml()&&l,j=(h.left+(L&&S?S.offsetLeft:0))/y,J=(h.top+(L&&S?S.offsetTop:0))/v,X=h.width/y,K=h.height/v;return{width:X,height:K,top:J,right:j+X,bottom:J+K,left:j,x:j,y:J}}function lo(u){var r=Ts(u),l=u.offsetWidth,h=u.offsetHeight;return Math.abs(r.width-l)<=1&&(l=r.width),Math.abs(r.height-h)<=1&&(h=r.height),{x:u.offsetLeft,y:u.offsetTop,width:l,height:h}}function gl(u,r){var l=r.getRootNode&&r.getRootNode();if(u.contains(r))return!0;if(l&&io(l)){var h=r;do{if(h&&u.isSameNode(h))return!0;h=h.parentNode||h.host}while(h)}return!1}function hn(u){return Et(u).getComputedStyle(u)}function Wh(u){return["table","td","th"].indexOf(en(u))>=0}function An(u){return((Kn(u)?u.ownerDocument:u.document)||window.document).documentElement}function Ur(u){return en(u)==="html"?u:u.assignedSlot||u.parentNode||(io(u)?u.host:null)||An(u)}function _l(u){return Lt(u)&&hn(u).position!=="fixed"?u.offsetParent:null}function Js(u){for(var r=Et(u),l=_l(u);l&&Wh(l)&&hn(l).position==="static";)l=_l(l);return l&&(en(l)==="html"||en(l)==="body"&&hn(l).position==="static")?r:l||function(h){var y=/firefox/i.test(ao());if(/Trident/i.test(ao())&&Lt(h)&&hn(h).position==="fixed")return null;var v=Ur(h);for(io(v)&&(v=v.host);Lt(v)&&["html","body"].indexOf(en(v))<0;){var S=hn(v);if(S.transform!=="none"||S.perspective!=="none"||S.contain==="paint"||["transform","perspective"].indexOf(S.willChange)!==-1||y&&S.willChange==="filter"||y&&S.filter&&S.filter!=="none")return v;v=v.parentNode}return null}(u)||r}function co(u){return["top","bottom"].indexOf(u)>=0?"x":"y"}function Xs(u,r,l){return Gn(u,Vr(r,l))}function bl(u){return Object.assign({},{top:0,right:0,bottom:0,left:0},u)}function yl(u,r){return r.reduce(function(l,h){return l[h]=u,l},{})}const vl={name:"arrow",enabled:!0,phase:"main",fn:function(u){var r,l=u.state,h=u.name,y=u.options,v=l.elements.arrow,S=l.modifiersData.popperOffsets,L=tn(l.placement),j=co(L),J=[ft,wt].indexOf(L)>=0?"height":"width";if(v&&S){var X=function(De,Re){return bl(typeof(De=typeof De=="function"?De(Object.assign({},Re.rects,{placement:Re.placement})):De)!="number"?De:yl(De,ws))}(y.padding,l),K=lo(v),he=j==="y"?ut:ft,se=j==="y"?vt:wt,ce=l.rects.reference[J]+l.rects.reference[j]-S[j]-l.rects.popper[J],ie=S[j]-l.rects.reference[j],ue=Js(v),Le=ue?j==="y"?ue.clientHeight||0:ue.clientWidth||0:0,Fe=ce/2-ie/2,_e=X[he],Ae=Le-K[J]-X[se],me=Le/2-K[J]/2+Fe,we=Xs(_e,me,Ae),xe=j;l.modifiersData[h]=((r={})[xe]=we,r.centerOffset=we-me,r)}},effect:function(u){var r=u.state,l=u.options.element,h=l===void 0?"[data-popper-arrow]":l;h!=null&&(typeof h!="string"||(h=r.elements.popper.querySelector(h)))&&gl(r.elements.popper,h)&&(r.elements.arrow=h)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function As(u){return u.split("-")[1]}var zh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wl(u){var r,l=u.popper,h=u.popperRect,y=u.placement,v=u.variation,S=u.offsets,L=u.position,j=u.gpuAcceleration,J=u.adaptive,X=u.roundOffsets,K=u.isFixed,he=S.x,se=he===void 0?0:he,ce=S.y,ie=ce===void 0?0:ce,ue=typeof X=="function"?X({x:se,y:ie}):{x:se,y:ie};se=ue.x,ie=ue.y;var Le=S.hasOwnProperty("x"),Fe=S.hasOwnProperty("y"),_e=ft,Ae=ut,me=window;if(J){var we=Js(l),xe="clientHeight",De="clientWidth";we===Et(l)&&hn(we=An(l)).position!=="static"&&L==="absolute"&&(xe="scrollHeight",De="scrollWidth"),(y===ut||(y===ft||y===wt)&&v===Es)&&(Ae=vt,ie-=(K&&we===me&&me.visualViewport?me.visualViewport.height:we[xe])-h.height,ie*=j?1:-1),y!==ft&&(y!==ut&&y!==vt||v!==Es)||(_e=wt,se-=(K&&we===me&&me.visualViewport?me.visualViewport.width:we[De])-h.width,se*=j?1:-1)}var Re,We=Object.assign({position:L},J&&zh),Ct=X===!0?function(Vt,dt){var Nt=Vt.x,kt=Vt.y,Ue=dt.devicePixelRatio||1;return{x:Ss(Nt*Ue)/Ue||0,y:Ss(kt*Ue)/Ue||0}}({x:se,y:ie},Et(l)):{x:se,y:ie};return se=Ct.x,ie=Ct.y,j?Object.assign({},We,((Re={})[Ae]=Fe?"0":"",Re[_e]=Le?"0":"",Re.transform=(me.devicePixelRatio||1)<=1?"translate("+se+"px, "+ie+"px)":"translate3d("+se+"px, "+ie+"px, 0)",Re)):Object.assign({},We,((r={})[Ae]=Fe?ie+"px":"",r[_e]=Le?se+"px":"",r.transform="",r))}const uo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(u){var r=u.state,l=u.options,h=l.gpuAcceleration,y=h===void 0||h,v=l.adaptive,S=v===void 0||v,L=l.roundOffsets,j=L===void 0||L,J={placement:tn(r.placement),variation:As(r.placement),popper:r.elements.popper,popperRect:r.rects.popper,gpuAcceleration:y,isFixed:r.options.strategy==="fixed"};r.modifiersData.popperOffsets!=null&&(r.styles.popper=Object.assign({},r.styles.popper,wl(Object.assign({},J,{offsets:r.modifiersData.popperOffsets,position:r.options.strategy,adaptive:S,roundOffsets:j})))),r.modifiersData.arrow!=null&&(r.styles.arrow=Object.assign({},r.styles.arrow,wl(Object.assign({},J,{offsets:r.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:j})))),r.attributes.popper=Object.assign({},r.attributes.popper,{"data-popper-placement":r.placement})},data:{}};var qr={passive:!0};const fo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(u){var r=u.state,l=u.instance,h=u.options,y=h.scroll,v=y===void 0||y,S=h.resize,L=S===void 0||S,j=Et(r.elements.popper),J=[].concat(r.scrollParents.reference,r.scrollParents.popper);return v&&J.forEach(function(X){X.addEventListener("scroll",l.update,qr)}),L&&j.addEventListener("resize",l.update,qr),function(){v&&J.forEach(function(X){X.removeEventListener("scroll",l.update,qr)}),L&&j.removeEventListener("resize",l.update,qr)}},data:{}};var Kh={left:"right",right:"left",bottom:"top",top:"bottom"};function Wr(u){return u.replace(/left|right|bottom|top/g,function(r){return Kh[r]})}var Gh={start:"end",end:"start"};function El(u){return u.replace(/start|end/g,function(r){return Gh[r]})}function ho(u){var r=Et(u);return{scrollLeft:r.pageXOffset,scrollTop:r.pageYOffset}}function po(u){return Ts(An(u)).left+ho(u).scrollLeft}function mo(u){var r=hn(u),l=r.overflow,h=r.overflowX,y=r.overflowY;return/auto|scroll|overlay|hidden/.test(l+y+h)}function Cl(u){return["html","body","#document"].indexOf(en(u))>=0?u.ownerDocument.body:Lt(u)&&mo(u)?u:Cl(Ur(u))}function Qs(u,r){var l;r===void 0&&(r=[]);var h=Cl(u),y=h===((l=u.ownerDocument)==null?void 0:l.body),v=Et(h),S=y?[v].concat(v.visualViewport||[],mo(h)?h:[]):h,L=r.concat(S);return y?L:L.concat(Qs(Ur(S)))}function go(u){return Object.assign({},u,{left:u.x,top:u.y,right:u.x+u.width,bottom:u.y+u.height})}function Sl(u,r,l){return r===no?go(function(h,y){var v=Et(h),S=An(h),L=v.visualViewport,j=S.clientWidth,J=S.clientHeight,X=0,K=0;if(L){j=L.width,J=L.height;var he=ml();(he||!he&&y==="fixed")&&(X=L.offsetLeft,K=L.offsetTop)}return{width:j,height:J,x:X+po(h),y:K}}(u,l)):Kn(r)?function(h,y){var v=Ts(h,!1,y==="fixed");return v.top=v.top+h.clientTop,v.left=v.left+h.clientLeft,v.bottom=v.top+h.clientHeight,v.right=v.left+h.clientWidth,v.width=h.clientWidth,v.height=h.clientHeight,v.x=v.left,v.y=v.top,v}(r,l):go(function(h){var y,v=An(h),S=ho(h),L=(y=h.ownerDocument)==null?void 0:y.body,j=Gn(v.scrollWidth,v.clientWidth,L?L.scrollWidth:0,L?L.clientWidth:0),J=Gn(v.scrollHeight,v.clientHeight,L?L.scrollHeight:0,L?L.clientHeight:0),X=-S.scrollLeft+po(h),K=-S.scrollTop;return hn(L||v).direction==="rtl"&&(X+=Gn(v.clientWidth,L?L.clientWidth:0)-j),{width:j,height:J,x:X,y:K}}(An(u)))}function Tl(u){var r,l=u.reference,h=u.element,y=u.placement,v=y?tn(y):null,S=y?As(y):null,L=l.x+l.width/2-h.width/2,j=l.y+l.height/2-h.height/2;switch(v){case ut:r={x:L,y:l.y-h.height};break;case vt:r={x:L,y:l.y+l.height};break;case wt:r={x:l.x+l.width,y:j};break;case ft:r={x:l.x-h.width,y:j};break;default:r={x:l.x,y:l.y}}var J=v?co(v):null;if(J!=null){var X=J==="y"?"height":"width";switch(S){case zn:r[J]=r[J]-(l[X]/2-h[X]/2);break;case Es:r[J]=r[J]+(l[X]/2-h[X]/2)}}return r}function Os(u,r){r===void 0&&(r={});var l=r,h=l.placement,y=h===void 0?u.placement:h,v=l.strategy,S=v===void 0?u.strategy:v,L=l.boundary,j=L===void 0?sl:L,J=l.rootBoundary,X=J===void 0?no:J,K=l.elementContext,he=K===void 0?Cs:K,se=l.altBoundary,ce=se!==void 0&&se,ie=l.padding,ue=ie===void 0?0:ie,Le=bl(typeof ue!="number"?ue:yl(ue,ws)),Fe=he===Cs?rl:Cs,_e=u.rects.popper,Ae=u.elements[ce?Fe:he],me=function(dt,Nt,kt,Ue){var nn=Nt==="clippingParents"?function(Ne){var ht=Qs(Ur(Ne)),Mt=["absolute","fixed"].indexOf(hn(Ne).position)>=0&&Lt(Ne)?Js(Ne):Ne;return Kn(Mt)?ht.filter(function(xn){return Kn(xn)&&gl(xn,Mt)&&en(xn)!=="body"}):[]}(dt):[].concat(Nt),sn=[].concat(nn,[kt]),Ps=sn[0],Ye=sn.reduce(function(Ne,ht){var Mt=Sl(dt,ht,Ue);return Ne.top=Gn(Mt.top,Ne.top),Ne.right=Vr(Mt.right,Ne.right),Ne.bottom=Vr(Mt.bottom,Ne.bottom),Ne.left=Gn(Mt.left,Ne.left),Ne},Sl(dt,Ps,Ue));return Ye.width=Ye.right-Ye.left,Ye.height=Ye.bottom-Ye.top,Ye.x=Ye.left,Ye.y=Ye.top,Ye}(Kn(Ae)?Ae:Ae.contextElement||An(u.elements.popper),j,X,S),we=Ts(u.elements.reference),xe=Tl({reference:we,element:_e,strategy:"absolute",placement:y}),De=go(Object.assign({},_e,xe)),Re=he===Cs?De:we,We={top:me.top-Re.top+Le.top,bottom:Re.bottom-me.bottom+Le.bottom,left:me.left-Re.left+Le.left,right:Re.right-me.right+Le.right},Ct=u.modifiersData.offset;if(he===Cs&&Ct){var Vt=Ct[y];Object.keys(We).forEach(function(dt){var Nt=[wt,vt].indexOf(dt)>=0?1:-1,kt=[ut,vt].indexOf(dt)>=0?"y":"x";We[dt]+=Vt[kt]*Nt})}return We}function Jh(u,r){r===void 0&&(r={});var l=r,h=l.placement,y=l.boundary,v=l.rootBoundary,S=l.padding,L=l.flipVariations,j=l.allowedAutoPlacements,J=j===void 0?ro:j,X=As(h),K=X?L?so:so.filter(function(ce){return As(ce)===X}):ws,he=K.filter(function(ce){return J.indexOf(ce)>=0});he.length===0&&(he=K);var se=he.reduce(function(ce,ie){return ce[ie]=Os(u,{placement:ie,boundary:y,rootBoundary:v,padding:S})[tn(ie)],ce},{});return Object.keys(se).sort(function(ce,ie){return se[ce]-se[ie]})}const Al={name:"flip",enabled:!0,phase:"main",fn:function(u){var r=u.state,l=u.options,h=u.name;if(!r.modifiersData[h]._skip){for(var y=l.mainAxis,v=y===void 0||y,S=l.altAxis,L=S===void 0||S,j=l.fallbackPlacements,J=l.padding,X=l.boundary,K=l.rootBoundary,he=l.altBoundary,se=l.flipVariations,ce=se===void 0||se,ie=l.allowedAutoPlacements,ue=r.options.placement,Le=tn(ue),Fe=j||(Le!==ue&&ce?function(Ne){if(tn(Ne)===Hr)return[];var ht=Wr(Ne);return[El(Ne),ht,El(ht)]}(ue):[Wr(ue)]),_e=[ue].concat(Fe).reduce(function(Ne,ht){return Ne.concat(tn(ht)===Hr?Jh(r,{placement:ht,boundary:X,rootBoundary:K,padding:J,flipVariations:ce,allowedAutoPlacements:ie}):ht)},[]),Ae=r.rects.reference,me=r.rects.popper,we=new Map,xe=!0,De=_e[0],Re=0;Re<_e.length;Re++){var We=_e[Re],Ct=tn(We),Vt=As(We)===zn,dt=[ut,vt].indexOf(Ct)>=0,Nt=dt?"width":"height",kt=Os(r,{placement:We,boundary:X,rootBoundary:K,altBoundary:he,padding:J}),Ue=dt?Vt?wt:ft:Vt?vt:ut;Ae[Nt]>me[Nt]&&(Ue=Wr(Ue));var nn=Wr(Ue),sn=[];if(v&&sn.push(kt[Ct]<=0),L&&sn.push(kt[Ue]<=0,kt[nn]<=0),sn.every(function(Ne){return Ne})){De=We,xe=!1;break}we.set(We,sn)}if(xe)for(var Ps=function(Ne){var ht=_e.find(function(Mt){var xn=we.get(Mt);if(xn)return xn.slice(0,Ne).every(function(ei){return ei})});if(ht)return De=ht,"break"},Ye=ce?3:1;Ye>0&&Ps(Ye)!=="break";Ye--);r.placement!==De&&(r.modifiersData[h]._skip=!0,r.placement=De,r.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ol(u,r,l){return l===void 0&&(l={x:0,y:0}),{top:u.top-r.height-l.y,right:u.right-r.width+l.x,bottom:u.bottom-r.height+l.y,left:u.left-r.width-l.x}}function xl(u){return[ut,wt,vt,ft].some(function(r){return u[r]>=0})}const Rl={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(u){var r=u.state,l=u.name,h=r.rects.reference,y=r.rects.popper,v=r.modifiersData.preventOverflow,S=Os(r,{elementContext:"reference"}),L=Os(r,{altBoundary:!0}),j=Ol(S,h),J=Ol(L,y,v),X=xl(j),K=xl(J);r.modifiersData[l]={referenceClippingOffsets:j,popperEscapeOffsets:J,isReferenceHidden:X,hasPopperEscaped:K},r.attributes.popper=Object.assign({},r.attributes.popper,{"data-popper-reference-hidden":X,"data-popper-escaped":K})}},Pl={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(u){var r=u.state,l=u.options,h=u.name,y=l.offset,v=y===void 0?[0,0]:y,S=ro.reduce(function(X,K){return X[K]=function(he,se,ce){var ie=tn(he),ue=[ft,ut].indexOf(ie)>=0?-1:1,Le=typeof ce=="function"?ce(Object.assign({},se,{placement:he})):ce,Fe=Le[0],_e=Le[1];return Fe=Fe||0,_e=(_e||0)*ue,[ft,wt].indexOf(ie)>=0?{x:_e,y:Fe}:{x:Fe,y:_e}}(K,r.rects,v),X},{}),L=S[r.placement],j=L.x,J=L.y;r.modifiersData.popperOffsets!=null&&(r.modifiersData.popperOffsets.x+=j,r.modifiersData.popperOffsets.y+=J),r.modifiersData[h]=S}},_o={name:"popperOffsets",enabled:!0,phase:"read",fn:function(u){var r=u.state,l=u.name;r.modifiersData[l]=Tl({reference:r.rects.reference,element:r.rects.popper,strategy:"absolute",placement:r.placement})},data:{}},Il={name:"preventOverflow",enabled:!0,phase:"main",fn:function(u){var r=u.state,l=u.options,h=u.name,y=l.mainAxis,v=y===void 0||y,S=l.altAxis,L=S!==void 0&&S,j=l.boundary,J=l.rootBoundary,X=l.altBoundary,K=l.padding,he=l.tether,se=he===void 0||he,ce=l.tetherOffset,ie=ce===void 0?0:ce,ue=Os(r,{boundary:j,rootBoundary:J,padding:K,altBoundary:X}),Le=tn(r.placement),Fe=As(r.placement),_e=!Fe,Ae=co(Le),me=Ae==="x"?"y":"x",we=r.modifiersData.popperOffsets,xe=r.rects.reference,De=r.rects.popper,Re=typeof ie=="function"?ie(Object.assign({},r.rects,{placement:r.placement})):ie,We=typeof Re=="number"?{mainAxis:Re,altAxis:Re}:Object.assign({mainAxis:0,altAxis:0},Re),Ct=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,Vt={x:0,y:0};if(we){if(v){var dt,Nt=Ae==="y"?ut:ft,kt=Ae==="y"?vt:wt,Ue=Ae==="y"?"height":"width",nn=we[Ae],sn=nn+ue[Nt],Ps=nn-ue[kt],Ye=se?-De[Ue]/2:0,Ne=Fe===zn?xe[Ue]:De[Ue],ht=Fe===zn?-De[Ue]:-xe[Ue],Mt=r.elements.arrow,xn=se&&Mt?lo(Mt):{width:0,height:0},ei=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},_c=ei[Nt],bc=ei[kt],ti=Xs(0,xe[Ue],xn[Ue]),Sm=_e?xe[Ue]/2-Ye-ti-_c-We.mainAxis:Ne-ti-_c-We.mainAxis,Tm=_e?-xe[Ue]/2+Ye+ti+bc+We.mainAxis:ht+ti+bc+We.mainAxis,Po=r.elements.arrow&&Js(r.elements.arrow),Am=Po?Ae==="y"?Po.clientTop||0:Po.clientLeft||0:0,yc=(dt=Ct==null?void 0:Ct[Ae])!=null?dt:0,Om=nn+Tm-yc,vc=Xs(se?Vr(sn,nn+Sm-yc-Am):sn,nn,se?Gn(Ps,Om):Ps);we[Ae]=vc,Vt[Ae]=vc-nn}if(L){var wc,xm=Ae==="x"?ut:ft,Rm=Ae==="x"?vt:wt,ns=we[me],ni=me==="y"?"height":"width",Ec=ns+ue[xm],Cc=ns-ue[Rm],Io=[ut,ft].indexOf(Le)!==-1,Sc=(wc=Ct==null?void 0:Ct[me])!=null?wc:0,Tc=Io?Ec:ns-xe[ni]-De[ni]-Sc+We.altAxis,Ac=Io?ns+xe[ni]+De[ni]-Sc-We.altAxis:Cc,Oc=se&&Io?function(Pm,Im,Lo){var xc=Xs(Pm,Im,Lo);return xc>Lo?Lo:xc}(Tc,ns,Ac):Xs(se?Tc:Ec,ns,se?Ac:Cc);we[me]=Oc,Vt[me]=Oc-ns}r.modifiersData[h]=Vt}},requiresIfExists:["offset"]};function Xh(u,r,l){l===void 0&&(l=!1);var h,y,v=Lt(r),S=Lt(r)&&function(K){var he=K.getBoundingClientRect(),se=Ss(he.width)/K.offsetWidth||1,ce=Ss(he.height)/K.offsetHeight||1;return se!==1||ce!==1}(r),L=An(r),j=Ts(u,S,l),J={scrollLeft:0,scrollTop:0},X={x:0,y:0};return(v||!v&&!l)&&((en(r)!=="body"||mo(L))&&(J=(h=r)!==Et(h)&&Lt(h)?{scrollLeft:(y=h).scrollLeft,scrollTop:y.scrollTop}:ho(h)),Lt(r)?((X=Ts(r,!0)).x+=r.clientLeft,X.y+=r.clientTop):L&&(X.x=po(L))),{x:j.left+J.scrollLeft-X.x,y:j.top+J.scrollTop-X.y,width:j.width,height:j.height}}function Qh(u){var r=new Map,l=new Set,h=[];function y(v){l.add(v.name),[].concat(v.requires||[],v.requiresIfExists||[]).forEach(function(S){if(!l.has(S)){var L=r.get(S);L&&y(L)}}),h.push(v)}return u.forEach(function(v){r.set(v.name,v)}),u.forEach(function(v){l.has(v.name)||y(v)}),h}var Ll={placement:"bottom",modifiers:[],strategy:"absolute"};function Dl(){for(var u=arguments.length,r=new Array(u),l=0;lNumber.parseInt(l,10)):typeof r=="function"?l=>r(l,this._element):r}_getPopperConfig(){const r={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(rt.setDataAttribute(this._menu,"popper","static"),r.modifiers=[{name:"applyStyles",enabled:!1}]),{...r,...N(this._config.popperConfig,[r])}}_selectMenuItem({key:r,target:l}){const h=A.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(y=>p(y));h.length&&H(h,l,r===Ml,!h.includes(l)).focus()}static jQueryInterface(r){return this.each(function(){const l=Ht.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r]()}})}static clearMenus(r){if(r.button===2||r.type==="keyup"&&r.key!=="Tab")return;const l=A.find(op);for(const h of l){const y=Ht.getInstance(h);if(!y||y._config.autoClose===!1)continue;const v=r.composedPath(),S=v.includes(y._menu);if(v.includes(y._element)||y._config.autoClose==="inside"&&!S||y._config.autoClose==="outside"&&S||y._menu.contains(r.target)&&(r.type==="keyup"&&r.key==="Tab"||/input|select|option|textarea|form/i.test(r.target.tagName)))continue;const L={relatedTarget:y._element};r.type==="click"&&(L.clickEvent=r),y._completeHide(L)}}static dataApiKeydownHandler(r){const l=/input|textarea/i.test(r.target.tagName),h=r.key==="Escape",y=[ep,Ml].includes(r.key);if(!y&&!h||l&&!h)return;r.preventDefault();const v=this.matches(Xn)?this:A.prev(this,Xn)[0]||A.next(this,Xn)[0]||A.findOne(Xn,r.delegateTarget.parentNode),S=Ht.getOrCreateInstance(v);if(y)return r.stopPropagation(),S.show(),void S._selectMenuItem(r);S._isShown()&&(r.stopPropagation(),S.hide(),v.focus())}}I.on(document,Fl,Xn,Ht.dataApiKeydownHandler),I.on(document,Fl,Kr,Ht.dataApiKeydownHandler),I.on(document,$l,Ht.clearMenus),I.on(document,ip,Ht.clearMenus),I.on(document,$l,Xn,function(u){u.preventDefault(),Ht.getOrCreateInstance(this).toggle()}),$(Ht);const jl="backdrop",Bl="show",Hl=`mousedown.bs.${jl}`,mp={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},gp={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Vl extends Zt{constructor(r){super(),this._config=this._getConfig(r),this._isAppended=!1,this._element=null}static get Default(){return mp}static get DefaultType(){return gp}static get NAME(){return jl}show(r){if(!this._config.isVisible)return void N(r);this._append();const l=this._getElement();this._config.isAnimated&&w(l),l.classList.add(Bl),this._emulateAnimation(()=>{N(r)})}hide(r){this._config.isVisible?(this._getElement().classList.remove(Bl),this._emulateAnimation(()=>{this.dispose(),N(r)})):N(r)}dispose(){this._isAppended&&(I.off(this._element,Hl),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const r=document.createElement("div");r.className=this._config.className,this._config.isAnimated&&r.classList.add("fade"),this._element=r}return this._element}_configAfterMerge(r){return r.rootElement=f(r.rootElement),r}_append(){if(this._isAppended)return;const r=this._getElement();this._config.rootElement.append(r),I.on(r,Hl,()=>{N(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(r){B(r,this._getElement(),this._config.isAnimated)}}const Gr=".bs.focustrap",_p=`focusin${Gr}`,bp=`keydown.tab${Gr}`,Ul="backward",yp={autofocus:!0,trapElement:null},vp={autofocus:"boolean",trapElement:"element"};class ql extends Zt{constructor(r){super(),this._config=this._getConfig(r),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return yp}static get DefaultType(){return vp}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),I.off(document,Gr),I.on(document,_p,r=>this._handleFocusin(r)),I.on(document,bp,r=>this._handleKeydown(r)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,I.off(document,Gr))}_handleFocusin(r){const{trapElement:l}=this._config;if(r.target===document||r.target===l||l.contains(r.target))return;const h=A.focusableChildren(l);h.length===0?l.focus():this._lastTabNavDirection===Ul?h[h.length-1].focus():h[0].focus()}_handleKeydown(r){r.key==="Tab"&&(this._lastTabNavDirection=r.shiftKey?Ul:"forward")}}const Wl=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",zl=".sticky-top",Jr="padding-right",Kl="margin-right";class vo{constructor(){this._element=document.body}getWidth(){const r=document.documentElement.clientWidth;return Math.abs(window.innerWidth-r)}hide(){const r=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,Jr,l=>l+r),this._setElementAttributes(Wl,Jr,l=>l+r),this._setElementAttributes(zl,Kl,l=>l-r)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Jr),this._resetElementAttributes(Wl,Jr),this._resetElementAttributes(zl,Kl)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(r,l,h){const y=this.getWidth();this._applyManipulationCallback(r,v=>{if(v!==this._element&&window.innerWidth>v.clientWidth+y)return;this._saveInitialAttribute(v,l);const S=window.getComputedStyle(v).getPropertyValue(l);v.style.setProperty(l,`${h(Number.parseFloat(S))}px`)})}_saveInitialAttribute(r,l){const h=r.style.getPropertyValue(l);h&&rt.setDataAttribute(r,l,h)}_resetElementAttributes(r,l){this._applyManipulationCallback(r,h=>{const y=rt.getDataAttribute(h,l);y!==null?(rt.removeDataAttribute(h,l),h.style.setProperty(l,y)):h.style.removeProperty(l)})}_applyManipulationCallback(r,l){if(c(r))l(r);else for(const h of A.find(r,this._element))l(h)}}const Dt=".bs.modal",wp=`hide${Dt}`,Ep=`hidePrevented${Dt}`,Gl=`hidden${Dt}`,Jl=`show${Dt}`,Cp=`shown${Dt}`,Sp=`resize${Dt}`,Tp=`click.dismiss${Dt}`,Ap=`mousedown.dismiss${Dt}`,Op=`keydown.dismiss${Dt}`,xp=`click${Dt}.data-api`,Xl="modal-open",Ql="show",wo="modal-static",Rp={backdrop:!0,focus:!0,keyboard:!0},Pp={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Qn extends Be{constructor(r,l){super(r,l),this._dialog=A.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new vo,this._addEventListeners()}static get Default(){return Rp}static get DefaultType(){return Pp}static get NAME(){return"modal"}toggle(r){return this._isShown?this.hide():this.show(r)}show(r){this._isShown||this._isTransitioning||I.trigger(this._element,Jl,{relatedTarget:r}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Xl),this._adjustDialog(),this._backdrop.show(()=>this._showElement(r)))}hide(){this._isShown&&!this._isTransitioning&&(I.trigger(this._element,wp).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ql),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){I.off(window,Dt),I.off(this._dialog,Dt),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Vl({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ql({trapElement:this._element})}_showElement(r){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const l=A.findOne(".modal-body",this._dialog);l&&(l.scrollTop=0),w(this._element),this._element.classList.add(Ql),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,I.trigger(this._element,Cp,{relatedTarget:r})},this._dialog,this._isAnimated())}_addEventListeners(){I.on(this._element,Op,r=>{r.key==="Escape"&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),I.on(window,Sp,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),I.on(this._element,Ap,r=>{I.one(this._element,Tp,l=>{this._element===r.target&&this._element===l.target&&(this._config.backdrop!=="static"?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Xl),this._resetAdjustments(),this._scrollBar.reset(),I.trigger(this._element,Gl)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(I.trigger(this._element,Ep).defaultPrevented)return;const r=this._element.scrollHeight>document.documentElement.clientHeight,l=this._element.style.overflowY;l==="hidden"||this._element.classList.contains(wo)||(r||(this._element.style.overflowY="hidden"),this._element.classList.add(wo),this._queueCallback(()=>{this._element.classList.remove(wo),this._queueCallback(()=>{this._element.style.overflowY=l},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const r=this._element.scrollHeight>document.documentElement.clientHeight,l=this._scrollBar.getWidth(),h=l>0;if(h&&!r){const y=R()?"paddingLeft":"paddingRight";this._element.style[y]=`${l}px`}if(!h&&r){const y=R()?"paddingRight":"paddingLeft";this._element.style[y]=`${l}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(r,l){return this.each(function(){const h=Qn.getOrCreateInstance(this,r);if(typeof r=="string"){if(h[r]===void 0)throw new TypeError(`No method named "${r}"`);h[r](l)}})}}I.on(document,xp,'[data-bs-toggle="modal"]',function(u){const r=A.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&u.preventDefault(),I.one(r,Jl,h=>{h.defaultPrevented||I.one(r,Gl,()=>{p(this)&&this.focus()})});const l=A.findOne(".modal.show");l&&Qn.getInstance(l).hide(),Qn.getOrCreateInstance(r).toggle(this)}),U(Qn),$(Qn);const pn=".bs.offcanvas",Yl=".data-api",Ip=`load${pn}${Yl}`,Zl="show",ec="showing",tc="hiding",nc=".offcanvas.show",Lp=`show${pn}`,Dp=`shown${pn}`,Np=`hide${pn}`,sc=`hidePrevented${pn}`,rc=`hidden${pn}`,kp=`resize${pn}`,Mp=`click${pn}${Yl}`,$p=`keydown.dismiss${pn}`,Fp={backdrop:!0,keyboard:!0,scroll:!1},jp={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class mn extends Be{constructor(r,l){super(r,l),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Fp}static get DefaultType(){return jp}static get NAME(){return"offcanvas"}toggle(r){return this._isShown?this.hide():this.show(r)}show(r){this._isShown||I.trigger(this._element,Lp,{relatedTarget:r}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||new vo().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ec),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Zl),this._element.classList.remove(ec),I.trigger(this._element,Dp,{relatedTarget:r})},this._element,!0))}hide(){this._isShown&&(I.trigger(this._element,Np).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(tc),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Zl,tc),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new vo().reset(),I.trigger(this._element,rc)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const r=!!this._config.backdrop;return new Vl({className:"offcanvas-backdrop",isVisible:r,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:r?()=>{this._config.backdrop!=="static"?this.hide():I.trigger(this._element,sc)}:null})}_initializeFocusTrap(){return new ql({trapElement:this._element})}_addEventListeners(){I.on(this._element,$p,r=>{r.key==="Escape"&&(this._config.keyboard?this.hide():I.trigger(this._element,sc))})}static jQueryInterface(r){return this.each(function(){const l=mn.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r](this)}})}}I.on(document,Mp,'[data-bs-toggle="offcanvas"]',function(u){const r=A.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&u.preventDefault(),d(this))return;I.one(r,rc,()=>{p(this)&&this.focus()});const l=A.findOne(nc);l&&l!==r&&mn.getInstance(l).hide(),mn.getOrCreateInstance(r).toggle(this)}),I.on(window,Ip,()=>{for(const u of A.find(nc))mn.getOrCreateInstance(u).show()}),I.on(window,kp,()=>{for(const u of A.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(u).position!=="fixed"&&mn.getOrCreateInstance(u).hide()}),U(mn),$(mn);const ic={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Bp=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Hp=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Vp=(u,r)=>{const l=u.nodeName.toLowerCase();return r.includes(l)?!Bp.has(l)||!!Hp.test(u.nodeValue):r.filter(h=>h instanceof RegExp).some(h=>h.test(l))},Up={allowList:ic,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},qp={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Wp={entry:"(string|element|function|null)",selector:"(string|element)"};class zp extends Zt{constructor(r){super(),this._config=this._getConfig(r)}static get Default(){return Up}static get DefaultType(){return qp}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(r=>this._resolvePossibleFunction(r)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(r){return this._checkContent(r),this._config.content={...this._config.content,...r},this}toHtml(){const r=document.createElement("div");r.innerHTML=this._maybeSanitize(this._config.template);for(const[y,v]of Object.entries(this._config.content))this._setContent(r,v,y);const l=r.children[0],h=this._resolvePossibleFunction(this._config.extraClass);return h&&l.classList.add(...h.split(" ")),l}_typeCheckConfig(r){super._typeCheckConfig(r),this._checkContent(r.content)}_checkContent(r){for(const[l,h]of Object.entries(r))super._typeCheckConfig({selector:l,entry:h},Wp)}_setContent(r,l,h){const y=A.findOne(h,r);y&&((l=this._resolvePossibleFunction(l))?c(l)?this._putElementInTemplate(f(l),y):this._config.html?y.innerHTML=this._maybeSanitize(l):y.textContent=l:y.remove())}_maybeSanitize(r){return this._config.sanitize?function(l,h,y){if(!l.length)return l;if(y&&typeof y=="function")return y(l);const v=new window.DOMParser().parseFromString(l,"text/html"),S=[].concat(...v.body.querySelectorAll("*"));for(const L of S){const j=L.nodeName.toLowerCase();if(!Object.keys(h).includes(j)){L.remove();continue}const J=[].concat(...L.attributes),X=[].concat(h["*"]||[],h[j]||[]);for(const K of J)Vp(K,X)||L.removeAttribute(K.nodeName)}return v.body.innerHTML}(r,this._config.allowList,this._config.sanitizeFn):r}_resolvePossibleFunction(r){return N(r,[this])}_putElementInTemplate(r,l){if(this._config.html)return l.innerHTML="",void l.append(r);l.textContent=r.textContent}}const Kp=new Set(["sanitize","allowList","sanitizeFn"]),Eo="fade",Xr="show",oc=".modal",ac="hide.bs.modal",Ys="hover",Co="focus",Gp={AUTO:"auto",TOP:"top",RIGHT:R()?"left":"right",BOTTOM:"bottom",LEFT:R()?"right":"left"},Jp={allowList:ic,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},Xp={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Yn extends Be{constructor(r,l){if(Nl===void 0)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(r,l),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Jp}static get DefaultType(){return Xp}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),I.off(this._element.closest(oc),ac,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const r=I.trigger(this._element,this.constructor.eventName("show")),l=(m(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(r.defaultPrevented||!l)return;this._disposePopper();const h=this._getTipElement();this._element.setAttribute("aria-describedby",h.getAttribute("id"));const{container:y}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(y.append(h),I.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(h),h.classList.add(Xr),"ontouchstart"in document.documentElement)for(const v of[].concat(...document.body.children))I.on(v,"mouseover",b);this._queueCallback(()=>{I.trigger(this._element,this.constructor.eventName("shown")),this._isHovered===!1&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!I.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Xr),"ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))I.off(r,"mouseover",b);this._activeTrigger.click=!1,this._activeTrigger[Co]=!1,this._activeTrigger[Ys]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),I.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(r){const l=this._getTemplateFactory(r).toHtml();if(!l)return null;l.classList.remove(Eo,Xr),l.classList.add(`bs-${this.constructor.NAME}-auto`);const h=(y=>{do y+=Math.floor(1e6*Math.random());while(document.getElementById(y));return y})(this.constructor.NAME).toString();return l.setAttribute("id",h),this._isAnimated()&&l.classList.add(Eo),l}setContent(r){this._newContent=r,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(r){return this._templateFactory?this._templateFactory.changeContent(r):this._templateFactory=new zp({...this._config,content:r,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{".tooltip-inner":this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(r){return this.constructor.getOrCreateInstance(r.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(Eo)}_isShown(){return this.tip&&this.tip.classList.contains(Xr)}_createPopper(r){const l=N(this._config.placement,[this,r,this._element]),h=Gp[l.toUpperCase()];return bo(this._element,r,this._getPopperConfig(h))}_getOffset(){const{offset:r}=this._config;return typeof r=="string"?r.split(",").map(l=>Number.parseInt(l,10)):typeof r=="function"?l=>r(l,this._element):r}_resolvePossibleFunction(r){return N(r,[this._element])}_getPopperConfig(r){const l={placement:r,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:h=>{this._getTipElement().setAttribute("data-popper-placement",h.state.placement)}}]};return{...l,...N(this._config.popperConfig,[l])}}_setListeners(){const r=this._config.trigger.split(" ");for(const l of r)if(l==="click")I.on(this._element,this.constructor.eventName("click"),this._config.selector,h=>{this._initializeOnDelegatedTarget(h).toggle()});else if(l!=="manual"){const h=l===Ys?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),y=l===Ys?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");I.on(this._element,h,this._config.selector,v=>{const S=this._initializeOnDelegatedTarget(v);S._activeTrigger[v.type==="focusin"?Co:Ys]=!0,S._enter()}),I.on(this._element,y,this._config.selector,v=>{const S=this._initializeOnDelegatedTarget(v);S._activeTrigger[v.type==="focusout"?Co:Ys]=S._element.contains(v.relatedTarget),S._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},I.on(this._element.closest(oc),ac,this._hideModalHandler)}_fixTitle(){const r=this._element.getAttribute("title");r&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",r),this._element.setAttribute("data-bs-original-title",r),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(r,l){clearTimeout(this._timeout),this._timeout=setTimeout(r,l)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(r){const l=rt.getDataAttributes(this._element);for(const h of Object.keys(l))Kp.has(h)&&delete l[h];return r={...l,...typeof r=="object"&&r?r:{}},r=this._mergeConfigObj(r),r=this._configAfterMerge(r),this._typeCheckConfig(r),r}_configAfterMerge(r){return r.container=r.container===!1?document.body:f(r.container),typeof r.delay=="number"&&(r.delay={show:r.delay,hide:r.delay}),typeof r.title=="number"&&(r.title=r.title.toString()),typeof r.content=="number"&&(r.content=r.content.toString()),r}_getDelegateConfig(){const r={};for(const[l,h]of Object.entries(this._config))this.constructor.Default[l]!==h&&(r[l]=h);return r.selector=!1,r.trigger="manual",r}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(r){return this.each(function(){const l=Yn.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r]()}})}}$(Yn);const Qp={...Yn.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},Yp={...Yn.DefaultType,content:"(null|string|element|function)"};class Qr extends Yn{static get Default(){return Qp}static get DefaultType(){return Yp}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{".popover-header":this._getTitle(),".popover-body":this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(r){return this.each(function(){const l=Qr.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r]()}})}}$(Qr);const So=".bs.scrollspy",Zp=`activate${So}`,lc=`click${So}`,em=`load${So}.data-api`,Rs="active",To="[href]",cc=".nav-link",tm=`${cc}, .nav-item > ${cc}, .list-group-item`,nm={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},sm={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Zs extends Be{constructor(r,l){super(r,l),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return nm}static get DefaultType(){return sm}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const r of this._observableSections.values())this._observer.observe(r)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(r){return r.target=f(r.target)||document.body,r.rootMargin=r.offset?`${r.offset}px 0px -30%`:r.rootMargin,typeof r.threshold=="string"&&(r.threshold=r.threshold.split(",").map(l=>Number.parseFloat(l))),r}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(I.off(this._config.target,lc),I.on(this._config.target,lc,To,r=>{const l=this._observableSections.get(r.target.hash);if(l){r.preventDefault();const h=this._rootElement||window,y=l.offsetTop-this._element.offsetTop;if(h.scrollTo)return void h.scrollTo({top:y,behavior:"smooth"});h.scrollTop=y}}))}_getNewObserver(){const r={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(l=>this._observerCallback(l),r)}_observerCallback(r){const l=S=>this._targetLinks.get(`#${S.target.id}`),h=S=>{this._previousScrollData.visibleEntryTop=S.target.offsetTop,this._process(l(S))},y=(this._rootElement||document.documentElement).scrollTop,v=y>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=y;for(const S of r){if(!S.isIntersecting){this._activeTarget=null,this._clearActiveClass(l(S));continue}const L=S.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(v&&L){if(h(S),!y)return}else v||L||h(S)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const r=A.find(To,this._config.target);for(const l of r){if(!l.hash||d(l))continue;const h=A.findOne(decodeURI(l.hash),this._element);p(h)&&(this._targetLinks.set(decodeURI(l.hash),l),this._observableSections.set(l.hash,h))}}_process(r){this._activeTarget!==r&&(this._clearActiveClass(this._config.target),this._activeTarget=r,r.classList.add(Rs),this._activateParents(r),I.trigger(this._element,Zp,{relatedTarget:r}))}_activateParents(r){if(r.classList.contains("dropdown-item"))A.findOne(".dropdown-toggle",r.closest(".dropdown")).classList.add(Rs);else for(const l of A.parents(r,".nav, .list-group"))for(const h of A.prev(l,tm))h.classList.add(Rs)}_clearActiveClass(r){r.classList.remove(Rs);const l=A.find(`${To}.${Rs}`,r);for(const h of l)h.classList.remove(Rs)}static jQueryInterface(r){return this.each(function(){const l=Zs.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r]()}})}}I.on(window,em,()=>{for(const u of A.find('[data-bs-spy="scroll"]'))Zs.getOrCreateInstance(u)}),$(Zs);const Zn=".bs.tab",rm=`hide${Zn}`,im=`hidden${Zn}`,om=`show${Zn}`,am=`shown${Zn}`,lm=`click${Zn}`,cm=`keydown${Zn}`,um=`load${Zn}`,fm="ArrowLeft",uc="ArrowRight",dm="ArrowUp",fc="ArrowDown",Ao="Home",dc="End",es="active",hc="fade",Oo="show",pc=".dropdown-toggle",xo=`:not(${pc})`,mc='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ro=`.nav-link${xo}, .list-group-item${xo}, [role="tab"]${xo}, ${mc}`,hm=`.${es}[data-bs-toggle="tab"], .${es}[data-bs-toggle="pill"], .${es}[data-bs-toggle="list"]`;class ts extends Be{constructor(r){super(r),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),I.on(this._element,cm,l=>this._keydown(l)))}static get NAME(){return"tab"}show(){const r=this._element;if(this._elemIsActive(r))return;const l=this._getActiveElem(),h=l?I.trigger(l,rm,{relatedTarget:r}):null;I.trigger(r,om,{relatedTarget:l}).defaultPrevented||h&&h.defaultPrevented||(this._deactivate(l,r),this._activate(r,l))}_activate(r,l){r&&(r.classList.add(es),this._activate(A.getElementFromSelector(r)),this._queueCallback(()=>{r.getAttribute("role")==="tab"?(r.removeAttribute("tabindex"),r.setAttribute("aria-selected",!0),this._toggleDropDown(r,!0),I.trigger(r,am,{relatedTarget:l})):r.classList.add(Oo)},r,r.classList.contains(hc)))}_deactivate(r,l){r&&(r.classList.remove(es),r.blur(),this._deactivate(A.getElementFromSelector(r)),this._queueCallback(()=>{r.getAttribute("role")==="tab"?(r.setAttribute("aria-selected",!1),r.setAttribute("tabindex","-1"),this._toggleDropDown(r,!1),I.trigger(r,im,{relatedTarget:l})):r.classList.remove(Oo)},r,r.classList.contains(hc)))}_keydown(r){if(![fm,uc,dm,fc,Ao,dc].includes(r.key))return;r.stopPropagation(),r.preventDefault();const l=this._getChildren().filter(y=>!d(y));let h;if([Ao,dc].includes(r.key))h=l[r.key===Ao?0:l.length-1];else{const y=[uc,fc].includes(r.key);h=H(l,r.target,y,!0)}h&&(h.focus({preventScroll:!0}),ts.getOrCreateInstance(h).show())}_getChildren(){return A.find(Ro,this._parent)}_getActiveElem(){return this._getChildren().find(r=>this._elemIsActive(r))||null}_setInitialAttributes(r,l){this._setAttributeIfNotExists(r,"role","tablist");for(const h of l)this._setInitialAttributesOnChild(h)}_setInitialAttributesOnChild(r){r=this._getInnerElement(r);const l=this._elemIsActive(r),h=this._getOuterElement(r);r.setAttribute("aria-selected",l),h!==r&&this._setAttributeIfNotExists(h,"role","presentation"),l||r.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(r,"role","tab"),this._setInitialAttributesOnTargetPanel(r)}_setInitialAttributesOnTargetPanel(r){const l=A.getElementFromSelector(r);l&&(this._setAttributeIfNotExists(l,"role","tabpanel"),r.id&&this._setAttributeIfNotExists(l,"aria-labelledby",`${r.id}`))}_toggleDropDown(r,l){const h=this._getOuterElement(r);if(!h.classList.contains("dropdown"))return;const y=(v,S)=>{const L=A.findOne(v,h);L&&L.classList.toggle(S,l)};y(pc,es),y(".dropdown-menu",Oo),h.setAttribute("aria-expanded",l)}_setAttributeIfNotExists(r,l,h){r.hasAttribute(l)||r.setAttribute(l,h)}_elemIsActive(r){return r.classList.contains(es)}_getInnerElement(r){return r.matches(Ro)?r:A.findOne(Ro,r)}_getOuterElement(r){return r.closest(".nav-item, .list-group-item")||r}static jQueryInterface(r){return this.each(function(){const l=ts.getOrCreateInstance(this);if(typeof r=="string"){if(l[r]===void 0||r.startsWith("_")||r==="constructor")throw new TypeError(`No method named "${r}"`);l[r]()}})}}I.on(document,lm,mc,function(u){["A","AREA"].includes(this.tagName)&&u.preventDefault(),d(this)||ts.getOrCreateInstance(this).show()}),I.on(window,um,()=>{for(const u of A.find(hm))ts.getOrCreateInstance(u)}),$(ts);const On=".bs.toast",pm=`mouseover${On}`,mm=`mouseout${On}`,gm=`focusin${On}`,_m=`focusout${On}`,bm=`hide${On}`,ym=`hidden${On}`,vm=`show${On}`,wm=`shown${On}`,gc="hide",Yr="show",Zr="showing",Em={animation:"boolean",autohide:"boolean",delay:"number"},Cm={animation:!0,autohide:!0,delay:5e3};class er extends Be{constructor(r,l){super(r,l),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Cm}static get DefaultType(){return Em}static get NAME(){return"toast"}show(){I.trigger(this._element,vm).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(gc),w(this._element),this._element.classList.add(Yr,Zr),this._queueCallback(()=>{this._element.classList.remove(Zr),I.trigger(this._element,wm),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(I.trigger(this._element,bm).defaultPrevented||(this._element.classList.add(Zr),this._queueCallback(()=>{this._element.classList.add(gc),this._element.classList.remove(Zr,Yr),I.trigger(this._element,ym)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Yr),super.dispose()}isShown(){return this._element.classList.contains(Yr)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(r,l){switch(r.type){case"mouseover":case"mouseout":this._hasMouseInteraction=l;break;case"focusin":case"focusout":this._hasKeyboardInteraction=l}if(l)return void this._clearTimeout();const h=r.relatedTarget;this._element===h||this._element.contains(h)||this._maybeScheduleHide()}_setListeners(){I.on(this._element,pm,r=>this._onInteraction(r,!0)),I.on(this._element,mm,r=>this._onInteraction(r,!1)),I.on(this._element,gm,r=>this._onInteraction(r,!0)),I.on(this._element,_m,r=>this._onInteraction(r,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(r){return this.each(function(){const l=er.getOrCreateInstance(this,r);if(typeof r=="string"){if(l[r]===void 0)throw new TypeError(`No method named "${r}"`);l[r](this)}})}}return U(er),$(er),{Alert:g,Button:E,Carousel:bs,Collapse:vs,Dropdown:Ht,Modal:Qn,Offcanvas:mn,Popover:Qr,ScrollSpy:Zs,Tab:ts,Toast:er,Tooltip:Yn}})})(t0);/*! +* Tabler v1.0.0-beta19 (https://tabler.io) +* @version 1.0.0-beta19 +* @link https://tabler.io +* Copyright 2018-2023 The Tabler Authors +* Copyright 2018-2023 codecalm.net Paweł Kuna +* Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE) +*/(function(e){typeof define=="function"&&define.amd?define(e):e()})(function(){var e,t="tablerTheme",n=new Proxy(new URLSearchParams(window.location.search),{get:function(i,o){return i.get(o)}});if(n.theme)localStorage.setItem(t,n.theme),e=n.theme;else{var s=localStorage.getItem(t);e=s||"light"}e==="dark"?document.body.setAttribute("data-bs-theme",e):document.body.removeAttribute("data-bs-theme")});const Mr=Td(Sy);Ke.defaults.baseURL=sw("http://localhost:18084");Mr.config.globalProperties.axios=Ke;Mr.use(pb());Mr.use(dh);Mr.use(Zw,{});Mr.mount("#app");export{o0 as A,Pr as B,Or as C,f0 as D,u0 as E,tt as F,Ir as G,Va as H,dh as I,c0 as J,sw as K,Ke as L,gd as M,e0 as N,h0 as O,Hd as R,_s as a,nt as b,qt as c,dn as d,Bi as e,d0 as f,Ft as g,fr as h,Bf as i,n0 as j,jc as k,i0 as l,Bo as m,Hn as n,Ve as o,s0 as p,nw as q,ja as r,jt as s,xa as t,jn as u,l0 as v,lb as w,Vf as x,r0 as y,a0 as z}; diff --git a/src/main/resources/static/assets/lodash-QU4yi6a5.js b/src/main/resources/static/assets/lodash-QU4yi6a5.js new file mode 100644 index 0000000..449ee60 --- /dev/null +++ b/src/main/resources/static/assets/lodash-QU4yi6a5.js @@ -0,0 +1,27 @@ +import{N as jt,O as rp}from"./index-D89BCYsX.js";var Je={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Je.exports;(function(Qe,Ve){(function(){var o,rl="4.17.21",ke=200,il="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",sn="Expected a function",ul="Invalid `variable` option passed into `_.template`",je="__lodash_hash_undefined__",fl=500,ne="__lodash_placeholder__",qn=1,Ii=2,at=4,ct=1,te=2,an=1,jn=2,Si=4,Tn=8,ht=16,Ln=32,gt=64,Wn=128,Ot=256,nr=512,ll=30,ol="...",sl=800,al=16,Ei=1,cl=2,hl=3,nt=1/0,Kn=9007199254740991,gl=17976931348623157e292,ee=NaN,yn=4294967295,_l=yn-1,pl=yn>>>1,vl=[["ary",Wn],["bind",an],["bindKey",jn],["curry",Tn],["curryRight",ht],["flip",nr],["partial",Ln],["partialRight",gt],["rearg",Ot]],_t="[object Arguments]",re="[object Array]",dl="[object AsyncFunction]",Wt="[object Boolean]",Pt="[object Date]",wl="[object DOMException]",ie="[object Error]",ue="[object Function]",Ti="[object GeneratorFunction]",xn="[object Map]",Bt="[object Number]",xl="[object Null]",Pn="[object Object]",Li="[object Promise]",Al="[object Proxy]",bt="[object RegExp]",An="[object Set]",Ft="[object String]",fe="[object Symbol]",Rl="[object Undefined]",Mt="[object WeakMap]",Il="[object WeakSet]",Ut="[object ArrayBuffer]",pt="[object DataView]",tr="[object Float32Array]",er="[object Float64Array]",rr="[object Int8Array]",ir="[object Int16Array]",ur="[object Int32Array]",fr="[object Uint8Array]",lr="[object Uint8ClampedArray]",or="[object Uint16Array]",sr="[object Uint32Array]",Sl=/\b__p \+= '';/g,El=/\b(__p \+=) '' \+/g,Tl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yi=/&(?:amp|lt|gt|quot|#39);/g,Ci=/[&<>"']/g,Ll=RegExp(yi.source),yl=RegExp(Ci.source),Cl=/<%-([\s\S]+?)%>/g,ml=/<%([\s\S]+?)%>/g,mi=/<%=([\s\S]+?)%>/g,Ol=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wl=/^\w*$/,Pl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ar=/[\\^$.*+?()[\]{}|]/g,Bl=RegExp(ar.source),cr=/^\s+/,bl=/\s/,Fl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ml=/\{\n\/\* \[wrapped with (.+)\] \*/,Ul=/,? & /,Dl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nl=/[()=,{}\[\]\/\s]/,Gl=/\\(\\)?/g,Hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oi=/\w*$/,ql=/^[-+]0x[0-9a-f]+$/i,Kl=/^0b[01]+$/i,$l=/^\[object .+?Constructor\]$/,zl=/^0o[0-7]+$/i,Zl=/^(?:0|[1-9]\d*)$/,Yl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,le=/($^)/,Xl=/['\n\r\u2028\u2029\\]/g,oe="\\ud800-\\udfff",Jl="\\u0300-\\u036f",Ql="\\ufe20-\\ufe2f",Vl="\\u20d0-\\u20ff",Wi=Jl+Ql+Vl,Pi="\\u2700-\\u27bf",Bi="a-z\\xdf-\\xf6\\xf8-\\xff",kl="\\xac\\xb1\\xd7\\xf7",jl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",no="\\u2000-\\u206f",to=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bi="A-Z\\xc0-\\xd6\\xd8-\\xde",Fi="\\ufe0e\\ufe0f",Mi=kl+jl+no+to,hr="['’]",eo="["+oe+"]",Ui="["+Mi+"]",se="["+Wi+"]",Di="\\d+",ro="["+Pi+"]",Ni="["+Bi+"]",Gi="[^"+oe+Mi+Di+Pi+Bi+bi+"]",gr="\\ud83c[\\udffb-\\udfff]",io="(?:"+se+"|"+gr+")",Hi="[^"+oe+"]",_r="(?:\\ud83c[\\udde6-\\uddff]){2}",pr="[\\ud800-\\udbff][\\udc00-\\udfff]",vt="["+bi+"]",qi="\\u200d",Ki="(?:"+Ni+"|"+Gi+")",uo="(?:"+vt+"|"+Gi+")",$i="(?:"+hr+"(?:d|ll|m|re|s|t|ve))?",zi="(?:"+hr+"(?:D|LL|M|RE|S|T|VE))?",Zi=io+"?",Yi="["+Fi+"]?",fo="(?:"+qi+"(?:"+[Hi,_r,pr].join("|")+")"+Yi+Zi+")*",lo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",oo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xi=Yi+Zi+fo,so="(?:"+[ro,_r,pr].join("|")+")"+Xi,ao="(?:"+[Hi+se+"?",se,_r,pr,eo].join("|")+")",co=RegExp(hr,"g"),ho=RegExp(se,"g"),vr=RegExp(gr+"(?="+gr+")|"+ao+Xi,"g"),go=RegExp([vt+"?"+Ni+"+"+$i+"(?="+[Ui,vt,"$"].join("|")+")",uo+"+"+zi+"(?="+[Ui,vt+Ki,"$"].join("|")+")",vt+"?"+Ki+"+"+$i,vt+"+"+zi,oo,lo,Di,so].join("|"),"g"),_o=RegExp("["+qi+oe+Wi+Fi+"]"),po=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],wo=-1,M={};M[tr]=M[er]=M[rr]=M[ir]=M[ur]=M[fr]=M[lr]=M[or]=M[sr]=!0,M[_t]=M[re]=M[Ut]=M[Wt]=M[pt]=M[Pt]=M[ie]=M[ue]=M[xn]=M[Bt]=M[Pn]=M[bt]=M[An]=M[Ft]=M[Mt]=!1;var F={};F[_t]=F[re]=F[Ut]=F[pt]=F[Wt]=F[Pt]=F[tr]=F[er]=F[rr]=F[ir]=F[ur]=F[xn]=F[Bt]=F[Pn]=F[bt]=F[An]=F[Ft]=F[fe]=F[fr]=F[lr]=F[or]=F[sr]=!0,F[ie]=F[ue]=F[Mt]=!1;var xo={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ao={"&":"&","<":"<",">":">",'"':""","'":"'"},Ro={"&":"&","<":"<",">":">",""":'"',"'":"'"},Io={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},So=parseFloat,Eo=parseInt,Ji=typeof jt=="object"&&jt&&jt.Object===Object&&jt,To=typeof self=="object"&&self&&self.Object===Object&&self,z=Ji||To||Function("return this")(),dr=Ve&&!Ve.nodeType&&Ve,tt=dr&&!0&&Qe&&!Qe.nodeType&&Qe,Qi=tt&&tt.exports===dr,wr=Qi&&Ji.process,cn=function(){try{var a=tt&&tt.require&&tt.require("util").types;return a||wr&&wr.binding&&wr.binding("util")}catch{}}(),Vi=cn&&cn.isArrayBuffer,ki=cn&&cn.isDate,ji=cn&&cn.isMap,nu=cn&&cn.isRegExp,tu=cn&&cn.isSet,eu=cn&&cn.isTypedArray;function en(a,g,h){switch(h.length){case 0:return a.call(g);case 1:return a.call(g,h[0]);case 2:return a.call(g,h[0],h[1]);case 3:return a.call(g,h[0],h[1],h[2])}return a.apply(g,h)}function Lo(a,g,h,w){for(var S=-1,W=a==null?0:a.length;++S-1}function xr(a,g,h){for(var w=-1,S=a==null?0:a.length;++w-1;);return h}function au(a,g){for(var h=a.length;h--&&dt(g,a[h],0)>-1;);return h}function Fo(a,g){for(var h=a.length,w=0;h--;)a[h]===g&&++w;return w}var Mo=Sr(xo),Uo=Sr(Ao);function Do(a){return"\\"+Io[a]}function No(a,g){return a==null?o:a[g]}function wt(a){return _o.test(a)}function Go(a){return po.test(a)}function Ho(a){for(var g,h=[];!(g=a.next()).done;)h.push(g.value);return h}function yr(a){var g=-1,h=Array(a.size);return a.forEach(function(w,S){h[++g]=[S,w]}),h}function cu(a,g){return function(h){return a(g(h))}}function Zn(a,g){for(var h=-1,w=a.length,S=0,W=[];++h-1}function Cs(n,t){var e=this.__data__,r=ye(e,n);return r<0?(++this.size,e.push([n,t])):e[r][1]=t,this}Bn.prototype.clear=Es,Bn.prototype.delete=Ts,Bn.prototype.get=Ls,Bn.prototype.has=ys,Bn.prototype.set=Cs;function bn(n){var t=-1,e=n==null?0:n.length;for(this.clear();++t=t?n:t)),n}function pn(n,t,e,r,i,f){var l,s=t&qn,c=t&Ii,_=t&at;if(e&&(l=i?e(n,r,i,f):e(n)),l!==o)return l;if(!D(n))return n;var p=E(n);if(p){if(l=Pa(n),!s)return k(n,l)}else{var v=X(n),d=v==ue||v==Ti;if(kn(n))return Yu(n,s);if(v==Pn||v==_t||d&&!i){if(l=c||d?{}:gf(n),!s)return c?Ra(n,$s(l,n)):Aa(n,Su(l,n))}else{if(!F[v])return i?n:{};l=Ba(n,v,s)}}f||(f=new In);var x=f.get(n);if(x)return x;f.set(n,l),qf(n)?n.forEach(function(I){l.add(pn(I,t,e,I,n,f))}):Gf(n)&&n.forEach(function(I,C){l.set(C,pn(I,t,e,C,n,f))});var R=_?c?jr:kr:c?nn:$,L=p?o:R(n);return hn(L||n,function(I,C){L&&(C=I,I=n[C]),$t(l,C,pn(I,t,e,C,n,f))}),l}function zs(n){var t=$(n);return function(e){return Eu(e,n,t)}}function Eu(n,t,e){var r=e.length;if(n==null)return!r;for(n=b(n);r--;){var i=e[r],f=t[i],l=n[i];if(l===o&&!(i in n)||!f(l))return!1}return!0}function Tu(n,t,e){if(typeof n!="function")throw new gn(sn);return Vt(function(){n.apply(o,e)},t)}function zt(n,t,e,r){var i=-1,f=ae,l=!0,s=n.length,c=[],_=t.length;if(!s)return c;e&&(t=U(t,rn(e))),r?(f=xr,l=!1):t.length>=ke&&(f=Dt,l=!1,t=new it(t));n:for(;++ii?0:i+e),r=r===o||r>i?i:T(r),r<0&&(r+=i),r=e>r?0:$f(r);e0&&e(s)?t>1?Z(s,t-1,e,r,i):zn(i,s):r||(i[i.length]=s)}return i}var br=ju(),Cu=ju(!0);function Cn(n,t){return n&&br(n,t,$)}function Fr(n,t){return n&&Cu(n,t,$)}function me(n,t){return $n(t,function(e){return Nn(n[e])})}function ft(n,t){t=Qn(t,n);for(var e=0,r=t.length;n!=null&&et}function Xs(n,t){return n!=null&&B.call(n,t)}function Js(n,t){return n!=null&&t in b(n)}function Qs(n,t,e){return n>=Y(t,e)&&n=120&&p.length>=120)?new it(l&&p):o}p=n[0];var v=-1,d=s[0];n:for(;++v-1;)s!==n&&Ae.call(s,c,1),Ae.call(n,c,1);return n}function Nu(n,t){for(var e=n?t.length:0,r=e-1;e--;){var i=t[e];if(e==r||i!==f){var f=i;Dn(i)?Ae.call(n,i,1):zr(n,i)}}return n}function qr(n,t){return n+Se(xu()*(t-n+1))}function sa(n,t,e,r){for(var i=-1,f=K(Ie((t-n)/(e||1)),0),l=h(f);f--;)l[r?f:++i]=n,n+=e;return l}function Kr(n,t){var e="";if(!n||t<1||t>Kn)return e;do t%2&&(e+=n),t=Se(t/2),t&&(n+=n);while(t);return e}function y(n,t){return fi(vf(n,t,tn),n+"")}function aa(n){return Iu(mt(n))}function ca(n,t){var e=mt(n);return Ge(e,ut(t,0,e.length))}function Xt(n,t,e,r){if(!D(n))return n;t=Qn(t,n);for(var i=-1,f=t.length,l=f-1,s=n;s!=null&&++ii?0:i+t),e=e>i?i:e,e<0&&(e+=i),i=t>e?0:e-t>>>0,t>>>=0;for(var f=h(i);++r>>1,l=n[f];l!==null&&!fn(l)&&(e?l<=t:l=ke){var _=t?null:Ta(n);if(_)return he(_);l=!1,i=Dt,c=new it}else c=t?[]:s;n:for(;++r=r?n:vn(n,t,e)}var Zu=es||function(n){return z.clearTimeout(n)};function Yu(n,t){if(t)return n.slice();var e=n.length,r=_u?_u(e):new n.constructor(e);return n.copy(r),r}function Jr(n){var t=new n.constructor(n.byteLength);return new we(t).set(new we(n)),t}function va(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.byteLength)}function da(n){var t=new n.constructor(n.source,Oi.exec(n));return t.lastIndex=n.lastIndex,t}function wa(n){return Kt?b(Kt.call(n)):{}}function Xu(n,t){var e=t?Jr(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}function Ju(n,t){if(n!==t){var e=n!==o,r=n===null,i=n===n,f=fn(n),l=t!==o,s=t===null,c=t===t,_=fn(t);if(!s&&!_&&!f&&n>t||f&&l&&c&&!s&&!_||r&&l&&c||!e&&c||!i)return 1;if(!r&&!f&&!_&&n=s)return c;var _=e[r];return c*(_=="desc"?-1:1)}}return n.index-t.index}function Qu(n,t,e,r){for(var i=-1,f=n.length,l=e.length,s=-1,c=t.length,_=K(f-l,0),p=h(c+_),v=!r;++s1?e[i-1]:o,l=i>2?e[2]:o;for(f=n.length>3&&typeof f=="function"?(i--,f):o,l&&Q(e[0],e[1],l)&&(f=i<3?o:f,i=1),t=b(t);++r-1?i[f?t[l]:l]:o}}function ef(n){return Un(function(t){var e=t.length,r=e,i=_n.prototype.thru;for(n&&t.reverse();r--;){var f=t[r];if(typeof f!="function")throw new gn(sn);if(i&&!l&&De(f)=="wrapper")var l=new _n([],!0)}for(r=l?r:e;++r1&&O.reverse(),p&&cs))return!1;var _=f.get(n),p=f.get(t);if(_&&p)return _==t&&p==n;var v=-1,d=!0,x=e&te?new it:o;for(f.set(n,t),f.set(t,n);++v1?"& ":"")+t[r],t=t.join(e>2?", ":" "),n.replace(Fl,`{ +/* [wrapped with `+t+`] */ +`)}function Fa(n){return E(n)||st(n)||!!(du&&n&&n[du])}function Dn(n,t){var e=typeof n;return t=t??Kn,!!t&&(e=="number"||e!="symbol"&&Zl.test(n))&&n>-1&&n%1==0&&n0){if(++t>=sl)return arguments[0]}else t=0;return n.apply(o,arguments)}}function Ge(n,t){var e=-1,r=n.length,i=r-1;for(t=t===o?r:t;++e1?n[t-1]:o;return e=typeof e=="function"?(n.pop(),e):o,Cf(n,e)});function mf(n){var t=u(n);return t.__chain__=!0,t}function Zc(n,t){return t(n),n}function He(n,t){return t(n)}var Yc=Un(function(n){var t=n.length,e=t?n[0]:0,r=this.__wrapped__,i=function(f){return Br(f,n)};return t>1||this.__actions__.length||!(r instanceof m)||!Dn(e)?this.thru(i):(r=r.slice(e,+e+(t?1:0)),r.__actions__.push({func:He,args:[i],thisArg:o}),new _n(r,this.__chain__).thru(function(f){return t&&!f.length&&f.push(o),f}))});function Xc(){return mf(this)}function Jc(){return new _n(this.value(),this.__chain__)}function Qc(){this.__values__===o&&(this.__values__=Kf(this.value()));var n=this.__index__>=this.__values__.length,t=n?o:this.__values__[this.__index__++];return{done:n,value:t}}function Vc(){return this}function kc(n){for(var t,e=this;e instanceof Le;){var r=If(e);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;e=e.__wrapped__}return i.__wrapped__=n,t}function jc(){var n=this.__wrapped__;if(n instanceof m){var t=n;return this.__actions__.length&&(t=new m(this)),t=t.reverse(),t.__actions__.push({func:He,args:[li],thisArg:o}),new _n(t,this.__chain__)}return this.thru(li)}function nh(){return $u(this.__wrapped__,this.__actions__)}var th=Be(function(n,t,e){B.call(n,e)?++n[e]:Fn(n,e,1)});function eh(n,t,e){var r=E(n)?ru:Zs;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}function rh(n,t){var e=E(n)?$n:yu;return e(n,A(t,3))}var ih=tf(Sf),uh=tf(Ef);function fh(n,t){return Z(qe(n,t),1)}function lh(n,t){return Z(qe(n,t),nt)}function oh(n,t,e){return e=e===o?1:T(e),Z(qe(n,t),e)}function Of(n,t){var e=E(n)?hn:Xn;return e(n,A(t,3))}function Wf(n,t){var e=E(n)?yo:Lu;return e(n,A(t,3))}var sh=Be(function(n,t,e){B.call(n,e)?n[e].push(t):Fn(n,e,[t])});function ah(n,t,e,r){n=j(n)?n:mt(n),e=e&&!r?T(e):0;var i=n.length;return e<0&&(e=K(i+e,0)),Ye(n)?e<=i&&n.indexOf(t,e)>-1:!!i&&dt(n,t,e)>-1}var ch=y(function(n,t,e){var r=-1,i=typeof t=="function",f=j(n)?h(n.length):[];return Xn(n,function(l){f[++r]=i?en(t,l,e):Zt(l,t,e)}),f}),hh=Be(function(n,t,e){Fn(n,e,t)});function qe(n,t){var e=E(n)?U:Bu;return e(n,A(t,3))}function gh(n,t,e,r){return n==null?[]:(E(t)||(t=t==null?[]:[t]),e=r?o:e,E(e)||(e=e==null?[]:[e]),Uu(n,t,e))}var _h=Be(function(n,t,e){n[e?0:1].push(t)},function(){return[[],[]]});function ph(n,t,e){var r=E(n)?Ar:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Xn)}function vh(n,t,e){var r=E(n)?Co:lu,i=arguments.length<3;return r(n,A(t,4),e,i,Lu)}function dh(n,t){var e=E(n)?$n:yu;return e(n,ze(A(t,3)))}function wh(n){var t=E(n)?Iu:aa;return t(n)}function xh(n,t,e){(e?Q(n,t,e):t===o)?t=1:t=T(t);var r=E(n)?Hs:ca;return r(n,t)}function Ah(n){var t=E(n)?qs:ga;return t(n)}function Rh(n){if(n==null)return 0;if(j(n))return Ye(n)?xt(n):n.length;var t=X(n);return t==xn||t==An?n.size:Nr(n).length}function Ih(n,t,e){var r=E(n)?Rr:_a;return e&&Q(n,t,e)&&(t=o),r(n,A(t,3))}var Sh=y(function(n,t){if(n==null)return[];var e=t.length;return e>1&&Q(n,t[0],t[1])?t=[]:e>2&&Q(t[0],t[1],t[2])&&(t=[t[0]]),Uu(n,Z(t,1),[])}),Ke=rs||function(){return z.Date.now()};function Eh(n,t){if(typeof t!="function")throw new gn(sn);return n=T(n),function(){if(--n<1)return t.apply(this,arguments)}}function Pf(n,t,e){return t=e?o:t,t=n&&t==null?n.length:t,Mn(n,Wn,o,o,o,o,t)}function Bf(n,t){var e;if(typeof t!="function")throw new gn(sn);return n=T(n),function(){return--n>0&&(e=t.apply(this,arguments)),n<=1&&(t=o),e}}var si=y(function(n,t,e){var r=an;if(e.length){var i=Zn(e,yt(si));r|=Ln}return Mn(n,r,t,e,i)}),bf=y(function(n,t,e){var r=an|jn;if(e.length){var i=Zn(e,yt(bf));r|=Ln}return Mn(t,r,n,e,i)});function Ff(n,t,e){t=e?o:t;var r=Mn(n,Tn,o,o,o,o,o,t);return r.placeholder=Ff.placeholder,r}function Mf(n,t,e){t=e?o:t;var r=Mn(n,ht,o,o,o,o,o,t);return r.placeholder=Mf.placeholder,r}function Uf(n,t,e){var r,i,f,l,s,c,_=0,p=!1,v=!1,d=!0;if(typeof n!="function")throw new gn(sn);t=wn(t)||0,D(e)&&(p=!!e.leading,v="maxWait"in e,f=v?K(wn(e.maxWait)||0,t):f,d="trailing"in e?!!e.trailing:d);function x(H){var En=r,Hn=i;return r=i=o,_=H,l=n.apply(Hn,En),l}function R(H){return _=H,s=Vt(C,t),p?x(H):l}function L(H){var En=H-c,Hn=H-_,el=t-En;return v?Y(el,f-Hn):el}function I(H){var En=H-c,Hn=H-_;return c===o||En>=t||En<0||v&&Hn>=f}function C(){var H=Ke();if(I(H))return O(H);s=Vt(C,L(H))}function O(H){return s=o,d&&r?x(H):(r=i=o,l)}function ln(){s!==o&&Zu(s),_=0,r=c=i=s=o}function V(){return s===o?l:O(Ke())}function on(){var H=Ke(),En=I(H);if(r=arguments,i=this,c=H,En){if(s===o)return R(c);if(v)return Zu(s),s=Vt(C,t),x(c)}return s===o&&(s=Vt(C,t)),l}return on.cancel=ln,on.flush=V,on}var Th=y(function(n,t){return Tu(n,1,t)}),Lh=y(function(n,t,e){return Tu(n,wn(t)||0,e)});function yh(n){return Mn(n,nr)}function $e(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new gn(sn);var e=function(){var r=arguments,i=t?t.apply(this,r):r[0],f=e.cache;if(f.has(i))return f.get(i);var l=n.apply(this,r);return e.cache=f.set(i,l)||f,l};return e.cache=new($e.Cache||bn),e}$e.Cache=bn;function ze(n){if(typeof n!="function")throw new gn(sn);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Ch(n){return Bf(2,n)}var mh=pa(function(n,t){t=t.length==1&&E(t[0])?U(t[0],rn(A())):U(Z(t,1),rn(A()));var e=t.length;return y(function(r){for(var i=-1,f=Y(r.length,e);++i=t}),st=Ou(function(){return arguments}())?Ou:function(n){return N(n)&&B.call(n,"callee")&&!vu.call(n,"callee")},E=h.isArray,$h=Vi?rn(Vi):ks;function j(n){return n!=null&&Ze(n.length)&&!Nn(n)}function G(n){return N(n)&&j(n)}function zh(n){return n===!0||n===!1||N(n)&&J(n)==Wt}var kn=us||Ri,Zh=ki?rn(ki):js;function Yh(n){return N(n)&&n.nodeType===1&&!kt(n)}function Xh(n){if(n==null)return!0;if(j(n)&&(E(n)||typeof n=="string"||typeof n.splice=="function"||kn(n)||Ct(n)||st(n)))return!n.length;var t=X(n);if(t==xn||t==An)return!n.size;if(Qt(n))return!Nr(n).length;for(var e in n)if(B.call(n,e))return!1;return!0}function Jh(n,t){return Yt(n,t)}function Qh(n,t,e){e=typeof e=="function"?e:o;var r=e?e(n,t):o;return r===o?Yt(n,t,o,e):!!r}function ci(n){if(!N(n))return!1;var t=J(n);return t==ie||t==wl||typeof n.message=="string"&&typeof n.name=="string"&&!kt(n)}function Vh(n){return typeof n=="number"&&wu(n)}function Nn(n){if(!D(n))return!1;var t=J(n);return t==ue||t==Ti||t==dl||t==Al}function Nf(n){return typeof n=="number"&&n==T(n)}function Ze(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Kn}function D(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function N(n){return n!=null&&typeof n=="object"}var Gf=ji?rn(ji):ta;function kh(n,t){return n===t||Dr(n,t,ti(t))}function jh(n,t,e){return e=typeof e=="function"?e:o,Dr(n,t,ti(t),e)}function ng(n){return Hf(n)&&n!=+n}function tg(n){if(Da(n))throw new S(il);return Wu(n)}function eg(n){return n===null}function rg(n){return n==null}function Hf(n){return typeof n=="number"||N(n)&&J(n)==Bt}function kt(n){if(!N(n)||J(n)!=Pn)return!1;var t=xe(n);if(t===null)return!0;var e=B.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&pe.call(e)==jo}var hi=nu?rn(nu):ea;function ig(n){return Nf(n)&&n>=-Kn&&n<=Kn}var qf=tu?rn(tu):ra;function Ye(n){return typeof n=="string"||!E(n)&&N(n)&&J(n)==Ft}function fn(n){return typeof n=="symbol"||N(n)&&J(n)==fe}var Ct=eu?rn(eu):ia;function ug(n){return n===o}function fg(n){return N(n)&&X(n)==Mt}function lg(n){return N(n)&&J(n)==Il}var og=Ue(Gr),sg=Ue(function(n,t){return n<=t});function Kf(n){if(!n)return[];if(j(n))return Ye(n)?Rn(n):k(n);if(Nt&&n[Nt])return Ho(n[Nt]());var t=X(n),e=t==xn?yr:t==An?he:mt;return e(n)}function Gn(n){if(!n)return n===0?n:0;if(n=wn(n),n===nt||n===-nt){var t=n<0?-1:1;return t*gl}return n===n?n:0}function T(n){var t=Gn(n),e=t%1;return t===t?e?t-e:t:0}function $f(n){return n?ut(T(n),0,yn):0}function wn(n){if(typeof n=="number")return n;if(fn(n))return ee;if(D(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=D(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=ou(n);var e=Kl.test(n);return e||zl.test(n)?Eo(n.slice(2),e?2:8):ql.test(n)?ee:+n}function zf(n){return mn(n,nn(n))}function ag(n){return n?ut(T(n),-Kn,Kn):n===0?n:0}function P(n){return n==null?"":un(n)}var cg=Tt(function(n,t){if(Qt(t)||j(t)){mn(t,$(t),n);return}for(var e in t)B.call(t,e)&&$t(n,e,t[e])}),Zf=Tt(function(n,t){mn(t,nn(t),n)}),Xe=Tt(function(n,t,e,r){mn(t,nn(t),n,r)}),hg=Tt(function(n,t,e,r){mn(t,$(t),n,r)}),gg=Un(Br);function _g(n,t){var e=Et(n);return t==null?e:Su(e,t)}var pg=y(function(n,t){n=b(n);var e=-1,r=t.length,i=r>2?t[2]:o;for(i&&Q(t[0],t[1],i)&&(r=1);++e1),f}),mn(n,jr(n),e),r&&(e=pn(e,qn|Ii|at,La));for(var i=t.length;i--;)zr(e,t[i]);return e});function Bg(n,t){return Xf(n,ze(A(t)))}var bg=Un(function(n,t){return n==null?{}:la(n,t)});function Xf(n,t){if(n==null)return{};var e=U(jr(n),function(r){return[r]});return t=A(t),Du(n,e,function(r,i){return t(r,i[0])})}function Fg(n,t,e){t=Qn(t,n);var r=-1,i=t.length;for(i||(i=1,n=o);++rt){var r=n;n=t,t=r}if(e||n%1||t%1){var i=xu();return Y(n+i*(t-n+So("1e-"+((i+"").length-1))),t)}return qr(n,t)}var Zg=Lt(function(n,t,e){return t=t.toLowerCase(),n+(e?Vf(t):t)});function Vf(n){return pi(P(n).toLowerCase())}function kf(n){return n=P(n),n&&n.replace(Yl,Mo).replace(ho,"")}function Yg(n,t,e){n=P(n),t=un(t);var r=n.length;e=e===o?r:ut(T(e),0,r);var i=e;return e-=t.length,e>=0&&n.slice(e,i)==t}function Xg(n){return n=P(n),n&&yl.test(n)?n.replace(Ci,Uo):n}function Jg(n){return n=P(n),n&&Bl.test(n)?n.replace(ar,"\\$&"):n}var Qg=Lt(function(n,t,e){return n+(e?"-":"")+t.toLowerCase()}),Vg=Lt(function(n,t,e){return n+(e?" ":"")+t.toLowerCase()}),kg=nf("toLowerCase");function jg(n,t,e){n=P(n),t=T(t);var r=t?xt(n):0;if(!t||r>=t)return n;var i=(t-r)/2;return Me(Se(i),e)+n+Me(Ie(i),e)}function n_(n,t,e){n=P(n),t=T(t);var r=t?xt(n):0;return t&&r>>0,e?(n=P(n),n&&(typeof t=="string"||t!=null&&!hi(t))&&(t=un(t),!t&&wt(n))?Vn(Rn(n),0,e):n.split(t,e)):[]}var l_=Lt(function(n,t,e){return n+(e?" ":"")+pi(t)});function o_(n,t,e){return n=P(n),e=e==null?0:ut(T(e),0,n.length),t=un(t),n.slice(e,e+t.length)==t}function s_(n,t,e){var r=u.templateSettings;e&&Q(n,t,e)&&(t=o),n=P(n),t=Xe({},t,r,of);var i=Xe({},t.imports,r.imports,of),f=$(i),l=Lr(i,f),s,c,_=0,p=t.interpolate||le,v="__p += '",d=Cr((t.escape||le).source+"|"+p.source+"|"+(p===mi?Hl:le).source+"|"+(t.evaluate||le).source+"|$","g"),x="//# sourceURL="+(B.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++wo+"]")+` +`;n.replace(d,function(I,C,O,ln,V,on){return O||(O=ln),v+=n.slice(_,on).replace(Xl,Do),C&&(s=!0,v+=`' + +__e(`+C+`) + +'`),V&&(c=!0,v+=`'; +`+V+`; +__p += '`),O&&(v+=`' + +((__t = (`+O+`)) == null ? '' : __t) + +'`),_=on+I.length,I}),v+=`'; +`;var R=B.call(t,"variable")&&t.variable;if(!R)v=`with (obj) { +`+v+` +} +`;else if(Nl.test(R))throw new S(ul);v=(c?v.replace(Sl,""):v).replace(El,"$1").replace(Tl,"$1;"),v="function("+(R||"obj")+`) { +`+(R?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+v+`return __p +}`;var L=nl(function(){return W(f,x+"return "+v).apply(o,l)});if(L.source=v,ci(L))throw L;return L}function a_(n){return P(n).toLowerCase()}function c_(n){return P(n).toUpperCase()}function h_(n,t,e){if(n=P(n),n&&(e||t===o))return ou(n);if(!n||!(t=un(t)))return n;var r=Rn(n),i=Rn(t),f=su(r,i),l=au(r,i)+1;return Vn(r,f,l).join("")}function g_(n,t,e){if(n=P(n),n&&(e||t===o))return n.slice(0,hu(n)+1);if(!n||!(t=un(t)))return n;var r=Rn(n),i=au(r,Rn(t))+1;return Vn(r,0,i).join("")}function __(n,t,e){if(n=P(n),n&&(e||t===o))return n.replace(cr,"");if(!n||!(t=un(t)))return n;var r=Rn(n),i=su(r,Rn(t));return Vn(r,i).join("")}function p_(n,t){var e=ll,r=ol;if(D(t)){var i="separator"in t?t.separator:i;e="length"in t?T(t.length):e,r="omission"in t?un(t.omission):r}n=P(n);var f=n.length;if(wt(n)){var l=Rn(n);f=l.length}if(e>=f)return n;var s=e-xt(r);if(s<1)return r;var c=l?Vn(l,0,s).join(""):n.slice(0,s);if(i===o)return c+r;if(l&&(s+=c.length-s),hi(i)){if(n.slice(s).search(i)){var _,p=c;for(i.global||(i=Cr(i.source,P(Oi.exec(i))+"g")),i.lastIndex=0;_=i.exec(p);)var v=_.index;c=c.slice(0,v===o?s:v)}}else if(n.indexOf(un(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r}function v_(n){return n=P(n),n&&Ll.test(n)?n.replace(yi,zo):n}var d_=Lt(function(n,t,e){return n+(e?" ":"")+t.toUpperCase()}),pi=nf("toUpperCase");function jf(n,t,e){return n=P(n),t=e?o:t,t===o?Go(n)?Xo(n):Wo(n):n.match(t)||[]}var nl=y(function(n,t){try{return en(n,o,t)}catch(e){return ci(e)?e:new S(e)}}),w_=Un(function(n,t){return hn(t,function(e){e=On(e),Fn(n,e,si(n[e],n))}),n});function x_(n){var t=n==null?0:n.length,e=A();return n=t?U(n,function(r){if(typeof r[1]!="function")throw new gn(sn);return[e(r[0]),r[1]]}):[],y(function(r){for(var i=-1;++iKn)return[];var e=yn,r=Y(n,yn);t=A(t),n-=yn;for(var i=Tr(r,t);++e0||t<0)?new m(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==o&&(t=T(t),e=t<0?e.dropRight(-t):e.take(t-n)),e)},m.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},m.prototype.toArray=function(){return this.take(yn)},Cn(m.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=u[r?"take"+(t=="last"?"Right":""):t],f=r||/^find/.test(t);i&&(u.prototype[t]=function(){var l=this.__wrapped__,s=r?[1]:arguments,c=l instanceof m,_=s[0],p=c||E(l),v=function(C){var O=i.apply(u,zn([C],s));return r&&d?O[0]:O};p&&e&&typeof _=="function"&&_.length!=1&&(c=p=!1);var d=this.__chain__,x=!!this.__actions__.length,R=f&&!d,L=c&&!x;if(!f&&p){l=L?l:new m(this);var I=n.apply(l,s);return I.__actions__.push({func:He,args:[v],thisArg:o}),new _n(I,d)}return R&&L?n.apply(this,s):(I=this.thru(v),R?r?I.value()[0]:I.value():I)})}),hn(["pop","push","shift","sort","splice","unshift"],function(n){var t=ge[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);u.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var f=this.value();return t.apply(E(f)?f:[],i)}return this[e](function(l){return t.apply(E(l)?l:[],i)})}}),Cn(m.prototype,function(n,t){var e=u[t];if(e){var r=e.name+"";B.call(St,r)||(St[r]=[]),St[r].push({name:t,func:e})}}),St[be(o,jn).name]=[{name:"wrapper",func:o}],m.prototype.clone=vs,m.prototype.reverse=ds,m.prototype.value=ws,u.prototype.at=Yc,u.prototype.chain=Xc,u.prototype.commit=Jc,u.prototype.next=Qc,u.prototype.plant=kc,u.prototype.reverse=jc,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=nh,u.prototype.first=u.prototype.head,Nt&&(u.prototype[Nt]=Vc),u},At=Jo();tt?((tt.exports=At)._=At,dr._=At):z._=At}).call(jt)})(Je,Je.exports);var ip=Je.exports;const fp=rp(ip);export{fp as _}; diff --git a/src/main/resources/static/assets/repository-CPO7R4t0.js b/src/main/resources/static/assets/repository-CPO7R4t0.js new file mode 100644 index 0000000..5739d5b --- /dev/null +++ b/src/main/resources/static/assets/repository-CPO7R4t0.js @@ -0,0 +1 @@ +import{s}from"./request-CuP4O-bn.js";const n=e=>s.get(`/oss/v1/repositories/${e}/list`);function i(e,t){return s.delete(`/oss/v1/repositories/${e}/delete/${t}`)}function p(e,t){return s.post(`/oss/v1/repositories/${e}/create`,t)}const a=(e,t)=>s.get(`/oss/v1/repositories/${e}/detail/${t}`),u=(e,t)=>s.put(`/oss/v1/repositories/${e}/update`,t);function c(e,t){return s.delete(`/oss/v1/components/${e}/delete/${t}`)}const $=(e,t)=>s.get(`/oss/v1/components/${e}/list/${t}`),d=(e,t,o)=>s.post(`/oss/v1/components/${e}/create/${t}`,o);export{n as a,c as b,d as c,i as d,$ as e,a as g,p as r,u}; diff --git a/src/main/resources/static/assets/request-CuP4O-bn.js b/src/main/resources/static/assets/request-CuP4O-bn.js new file mode 100644 index 0000000..777ee91 --- /dev/null +++ b/src/main/resources/static/assets/request-CuP4O-bn.js @@ -0,0 +1 @@ +import{K as m,f as I,L as p,q as h}from"./index-D89BCYsX.js";const P=m("http://localhost:18084"),d=I(),f=p.create({baseURL:P,timeout:3e5}),i=e=>{const t=String(e??"").trim();return["undefined","null"].includes(t.toLowerCase())?"":t},g=e=>{if(typeof document>"u")return"";const t=`${e}=`,n=document.cookie.split(";").map(s=>s.trim()).find(s=>s.startsWith(t));return n?n.slice(t.length):""},j=()=>{var c,u,r,l;let e;try{e=h()}catch{return{}}const t=i(g("Authorization")||e.accessToken),n=i(((c=e.workspaceInfo)==null?void 0:c.id)??((u=e.workspaceInfo)==null?void 0:u.Id)),s=i(((r=e.projectInfo)==null?void 0:r.id)??((l=e.projectInfo)==null?void 0:l.Id)),o=i(e.getNsId()),a={};return t&&(a.Authorization=t.toLowerCase().startsWith("bearer ")?`Bearer ${t.slice(7).trim()}`:`Bearer ${t}`),n&&(a["X-MCMP-Workspace-ID"]=n),s&&(a["X-MCMP-Project-ID"]=s),o&&(a["X-MCMP-Namespace-ID"]=o),a};f.interceptors.request.use(e=>{const t=j();return Object.entries(t).forEach(([n,s])=>{var o;typeof((o=e.headers)==null?void 0:o.set)=="function"?e.headers.set(n,s):e.headers[n]=s}),e},e=>(console.warn("API request setup failed",(e==null?void 0:e.message)||"Unknown error"),Promise.reject(e)));f.interceptors.response.use(e=>{var n,s;const t=e.data;return t.code===200?t:((s=(n=e.config)==null?void 0:n.url)!=null&&s.startsWith("/applications/deployment-submissions/")||d.error(t.detail),Promise.reject(new Error(t.message||"Error")))},e=>{var n,s,o;const t=e.response;return console.warn("API request failed",{url:(n=e==null?void 0:e.config)==null?void 0:n.url,status:t==null?void 0:t.status,message:e==null?void 0:e.message}),(t==null?void 0:t.status)===404&&!((o=(s=e==null?void 0:e.config)==null?void 0:s.url)!=null&&o.startsWith("/applications/deployment-submissions/"))&&d.error("API Call Fail :: Code 404"),p.isCancel(e),Promise.reject(e)});export{j as g,f as s}; diff --git a/src/main/resources/static/assets/softwareCatalog-CAQVjm80.js b/src/main/resources/static/assets/softwareCatalog-CAQVjm80.js new file mode 100644 index 0000000..a6b98ac --- /dev/null +++ b/src/main/resources/static/assets/softwareCatalog-CAQVjm80.js @@ -0,0 +1 @@ +var S=Object.defineProperty;var $=(t,e,n)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var f=(t,e,n)=>$(t,typeof e!="symbol"?e+"":e,n);import{s as a,g as w}from"./request-CuP4O-bn.js";import{K as A,L as I}from"./index-D89BCYsX.js";function C(t=globalThis.crypto){const e=t.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const n=Array.from(e).map(s=>s.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}class i extends Error{constructor(n,s){super(n);f(this,"deploymentStatusUnknown",!0);this.interruptedOperation=s}}async function b(t,e,n,s,c=()=>!0,l=()=>new Promise(o=>setTimeout(o,2e3)),g=3600,d=()=>{}){var h;let o;try{o=await n()}catch(r){const p=(h=r==null?void 0:r.response)==null?void 0:h.status;if(p===409){let u;try{u=await s()}catch{throw r}throw u.id!==t||u.namespace!==e?new i("Existing operation did not match this target. Check Apps Status."):["SUCCEEDED","FAILED","PARTIAL_SUCCESS","ABANDONED"].includes(u.state)?(d(),new Error("The previous operation finished. Review Apps Status, then click Deploy again if you intend to use the changed settings. No new installation was started.")):u.state==="INTERRUPTED"?new i(u.message,{id:t,namespace:e}):new i("An installation with the previous settings is still active. Check Apps Status before changing settings; no new installation was started.")}if(p&&p>=400&&p<500&&p!==408&&p!==429)throw r}let m=0;for(let r=0;r=5)throw new i("Could not retrieve installation status. The operation may still be running. Check Apps Status or retry tracking; do not start a second installation.")}}throw new i("Installation is taking longer than expected. Check Apps Status; no replacement installation was submitted.")}const E=A("http://localhost:18084").replace(/\/$/,""),v=[90,30,7],N=t=>{const e=String((t==null?void 0:t.detail)||"");return e.includes("No static resource")&&e.includes("/policy-recommendation/analyze")},T=t=>a.get(`/catalog/software?name=${t}`),L=t=>a.get(`/catalog/software/${t}`),j=t=>a.get(`/search/dockerhub/${t}`),O=t=>a.get(`/search/artifacthub/${t}`);async function k(t,e,n){const s=w(),c="am-deployment:"+JSON.stringify([s["X-MCMP-Workspace-ID"],s["X-MCMP-Project-ID"],e.namespace,t,e.catalogId,t==="VM"?e.mciId:e.clusterName,t==="VM"?e.vmNodeGroupId||[...e.vmIds||[]].sort():null]);let l=sessionStorage.getItem(c);l||(l=C(),sessionStorage.setItem(c,l));const g=l;return b(g,e.namespace,async()=>(await a.post(`/applications/deployment-submissions/${t}`,e,{headers:{"Idempotency-Key":g},timeout:3e4})).data,async()=>(await a.get(`/applications/deployment-submissions/${g}`,{params:{namespace:e.namespace},timeout:3e4})).data,n,void 0,void 0,()=>sessionStorage.removeItem(c))}async function x(t,e){const n=await a.post(`/applications/deployment-submissions/${t}/close-interrupted`,null,{params:{namespace:e}});for(const s of Object.keys(sessionStorage))s.startsWith("am-deployment:")&&sessionStorage.getItem(s)===t&&sessionStorage.removeItem(s);return n}const z=(t,e)=>k("VM",t,e),M=t=>a.post("/applications/action",t),B=(t,e)=>k("K8S",t,e),K=t=>{const e=t.targetType==="VM"?"/applications/vm/object-storage/smoke-check":"/applications/k8s/object-storage/smoke-check",{targetType:n,...s}=t;return a.post(e,s)},V=t=>a.get(`/applications/object-storages?namespace=${encodeURIComponent(t)}`),F=t=>a.get(`/applications/k8s/storage-classes?namespace=${t.namespace}&clusterName=${t.clusterName}`),H=t=>a.get(`/applications/vm/check?namespace=${t.namespace}&mciId=${t.mciName}&vmId=${t.vmName}&catalogId=${t.catalogId}`),_=t=>a.get(`/applications/k8s/check?namespace=${t.namespace}&clusterName=${t.clusterName}&catalogId=${t.catalogId}`),q=t=>a.post("/applications/k8s/ingress/preparations",t),G=(t,e)=>a.get(`/applications/k8s/ingress/preparations/${encodeURIComponent(e)}?${new URLSearchParams({namespace:t})}`),W=t=>a.post("/applications/k8s/ingress/check",t),J=t=>a.get(`/ape/log/${t}`);function X(t){return a.post("/catalog/software",t)}function Q(t){return a.put(`/catalog/software/${t.id}`,t)}function Y(t){return a.delete(`/catalog/software/${t}`)}function Z(t){return a.get("/api/applications/status/groups",{params:t?{namespace:t}:void 0})}function tt(t){return a.get(`/api/applications/integrated/catalog/${t}`)}function et(t){return a.post("/catalog/application/category",t)}function at(t){return a.post("/catalog/application/package",t)}function nt(t){const e={target:t.target,applicationName:t.packageName,availableOnly:t.availableOnly};return a.post("/catalog/application/package/version",e)}function st(t){return a.get(`/search/dockerhub/tag/${t.path}`)}function ot(t){return a.get(`/search/artifacthub/version/${t.kind}/${t.repository}/${t.packageName}`)}function it(t){return a.post("/catalog/docker/register",t)}function rt(t){return a.post("/catalog/helm/register",t)}function ct(t){return a.post("/catalog/rating/overall",t)}function lt(t){return a.get(`/api/applications/integrated/deployment/${t}`)}function P(t,e=14){return a.post(`/api/applications/${t}/operation-profile/analyze?days=${e}`)}async function pt(t){var e;try{const s=(await I.post(`${E}/api/applications/${t}/policy-recommendation/analyze`,void 0,{headers:w()})).data;return(s==null?void 0:s.code)===200?s:N(s)?y(t):Promise.reject(new Error((s==null?void 0:s.detail)||(s==null?void 0:s.message)||"Failed to analyze policy recommendation"))}catch(n){return((e=n==null?void 0:n.response)==null?void 0:e.status)===404?y(t):Promise.reject(n)}}async function y(t){const e=[];for(const n of v){const s=await P(t,n);e.push(s.data)}return{code:200,data:e,detail:null,message:"OK"}}function ut(t,e){const n=e?`?days=${e}`:"";return a.get(`/api/applications/${t}/operation-profile${n}`)}function gt(t){return a.get(`/api/applications/${t}/policy-recommendation`)}function dt(t){return a.get(`/catalog/selectbox/options?type=${t}`)}const mt=t=>a.get("/applications/k8s/storage-classes/nhn-capability",{params:t}),ht=(t,e)=>a.post("/applications/k8s/storage-classes/nhn",e,{params:t});export{x as A,V as B,ht as C,z as D,q as E,G as F,B as G,W as H,H as I,_ as J,K,O as a,st as b,ot as c,X as d,L as e,at as f,et as g,nt as h,it as i,rt as j,tt as k,Y as l,T as m,dt as n,ct as o,Z as p,lt as q,M as r,j as s,ut as t,Q as u,gt as v,pt as w,J as x,F as y,mt as z}; diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index 812de48..48ff71f 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -5,7 +5,7 @@ App - + diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionControllerTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionControllerTest.java new file mode 100644 index 0000000..259d09b --- /dev/null +++ b/src/test/java/kr/co/mcmp/softwarecatalog/application/controller/DeploymentSubmissionControllerTest.java @@ -0,0 +1,26 @@ +package kr.co.mcmp.softwarecatalog.application.controller; +import com.fasterxml.jackson.databind.ObjectMapper; +import kr.co.mcmp.security.project.ProjectScopeAuthorizationService; +import kr.co.mcmp.softwarecatalog.application.constants.DeploymentType; +import kr.co.mcmp.softwarecatalog.application.service.DeploymentSubmissionService; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import static org.mockito.Mockito.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + +class DeploymentSubmissionControllerTest { + @ParameterizedTest @EnumSource(value=DeploymentType.class,names={"VM","K8S"}) + void bothVmAndK8sSubmitAsyncWithAuthorizedNamespace(DeploymentType type) throws Exception { + var auth=mock(ProjectScopeAuthorizationService.class);var jobs=mock(DeploymentSubmissionService.class); + when(auth.authorizeNamespace(any(),eq("default"))).thenReturn("default"); + when(jobs.submit(any(),eq("some-operation"),any())).thenReturn(new DeploymentSubmissionService.Status("some-operation","default","QUEUED","accepted",null)); + var mvc=MockMvcBuilders.standaloneSetup(new DeploymentSubmissionController(auth,jobs,new ObjectMapper())).build(); + mvc.perform(post("/applications/deployment-submissions/"+type.name()).header("Idempotency-Key","some-operation") + .contentType("application/json").content("{\"namespace\":\"default\",\"catalogId\":11}")) + .andExpect(status().isOk()).andExpect(jsonPath("$.data.state").value("QUEUED")); + verify(auth).authorizeNamespace(any(),eq("default")); + verify(jobs).submit(any(),eq("some-operation"),argThat(r->r.getDeploymentType()==type)); + } +} diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionServiceTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionServiceTest.java new file mode 100644 index 0000000..396504a --- /dev/null +++ b/src/test/java/kr/co/mcmp/softwarecatalog/application/service/DeploymentSubmissionServiceTest.java @@ -0,0 +1,123 @@ +package kr.co.mcmp.softwarecatalog.application.service; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.*; +import java.util.concurrent.*; +import kr.co.mcmp.softwarecatalog.application.constants.DeploymentType; +import kr.co.mcmp.softwarecatalog.application.dto.DeploymentRequestDTO; +import kr.co.mcmp.softwarecatalog.application.model.DeploymentHistory; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.datasource.DriverManagerDataSource; +import org.springframework.web.server.ResponseStatusException; +import static org.assertj.core.api.Assertions.*; +import static org.mockito.Mockito.*; + +class DeploymentSubmissionServiceTest { + JdbcTemplate jdbc; + ApplicationOrchestrationService orchestration; + DeploymentSubmissionService jobs; + QueueExecutor executor; + DeploymentSubmissionService.Scope scope = new DeploymentSubmissionService.Scope("w1","p1","default","user1"); + @BeforeEach void setup() { + jdbc=new JdbcTemplate(new DriverManagerDataSource("jdbc:h2:mem:"+UUID.randomUUID()+";MODE=PostgreSQL;DB_CLOSE_DELAY=-1","sa","")); + jdbc.execute("CREATE TABLE deployment_history(id BIGINT, namespace VARCHAR, catalog_id BIGINT, deployment_type VARCHAR, mci_id VARCHAR, cluster_name VARCHAR, action_type VARCHAR, status VARCHAR)"); + orchestration=mock(ApplicationOrchestrationService.class); executor=new QueueExecutor(); + jobs=new DeploymentSubmissionService(jdbc,orchestration,new ObjectMapper(),executor); jobs.initialize(); + } + DeploymentRequestDTO request(DeploymentType type) { + return DeploymentRequestDTO.builder().namespace("default").catalogId(11L).deploymentType(type) + .mciId("test-mci").vmIds(List.of("vm1")).clusterName("test-cluster").build(); + } + @Test void returnsReceiptBeforeWorkAndRetriesSameIdWithoutDuplicateInstall() { + String id=UUID.randomUUID().toString(); var req=request(DeploymentType.VM); + when(orchestration.deployApplication(any())).thenReturn(DeploymentHistory.builder().id(22L).status("SUCCESS").build()); + assertThat(jobs.submit(scope,id,req).state()).isEqualTo("QUEUED"); + assertThat(jobs.submit(scope,id,req).id()).isEqualTo(id); + verifyNoInteractions(orchestration); assertThat(executor.tasks).hasSize(1); + executor.runNext(); + assertThat(jobs.get(scope,id).state()).isEqualTo("SUCCEEDED"); + assertThat(jobs.get(scope,id).deploymentId()).isEqualTo(22L); + jobs.submit(scope,id,req); verify(orchestration,times(1)).deployApplication(any()); + } + @Test void concurrentTargetAndChangedPayloadAreRejected() { + var req=request(DeploymentType.K8S); String id=UUID.randomUUID().toString();jobs.submit(scope,id,req); + assertThatThrownBy(()->jobs.submit(scope,UUID.randomUUID().toString(),req)).isInstanceOf(ResponseStatusException.class); + req.setServicePort(8088); + assertThatThrownBy(()->jobs.submit(scope,id,req)).isInstanceOf(ResponseStatusException.class); + assertThat(executor.tasks).hasSize(1); + } + @Test void propagatesFailedAndPartialResultsInsteadOfTreatingAnyHistoryAsSuccess() { + for(String state:List.of("FAILED","PARTIAL_SUCCESS")) { + when(orchestration.deployApplication(any())).thenReturn(DeploymentHistory.builder().id(23L).status(state).build()); + String id=UUID.randomUUID().toString();jobs.submit(scope,id,request(DeploymentType.K8S));executor.runNext(); + assertThat(jobs.get(scope,id).state()).isEqualTo(state); + } + } + @Test void persistsRestartStateAndRetainsGuardRatherThanReplayingRemoteWork() { + String id=UUID.randomUUID().toString();jobs.submit(scope,id,request(DeploymentType.VM)); + jdbc.update("UPDATE application_deployment_submission SET state='RUNNING' WHERE id=?",id); + var restarted=new DeploymentSubmissionService(jdbc,orchestration,new ObjectMapper(),new QueueExecutor());restarted.initialize(); + assertThat(restarted.get(scope,id).state()).isEqualTo("INTERRUPTED"); + assertThatThrownBy(()->restarted.submit(scope,UUID.randomUUID().toString(),request(DeploymentType.VM))).isInstanceOf(ResponseStatusException.class); + verifyNoInteractions(orchestration); + } + @Test void isolatesOwnerAndProjectAndDoesNotPersistCredentialsOrExceptionText() { + String id=UUID.randomUUID().toString();var req=request(DeploymentType.VM);req.setAdditionalConfig(Map.of("password","sensitive-test-value")); + when(orchestration.deployApplication(any())).thenThrow(new IllegalStateException("sensitive-test-value")); + jobs.submit(scope,id,req); + assertThatThrownBy(()->jobs.get(new DeploymentSubmissionService.Scope("w1","p1","default","user2"),id)).isInstanceOf(ResponseStatusException.class); + assertThatThrownBy(()->jobs.get(new DeploymentSubmissionService.Scope("w1","p2","default","user1"),id)).isInstanceOf(ResponseStatusException.class); + executor.runNext();assertThat(jobs.get(scope,id).state()).isEqualTo("FAILED"); + assertThat(jdbc.queryForList("SELECT * FROM application_deployment_submission").toString()).doesNotContain("sensitive-test-value"); + } + @Test void restartClosesNeverStartedQueueAndReconcilesOnlyUniqueTerminalHistory() { + String queued=UUID.randomUUID().toString();jobs.submit(scope,queued,request(DeploymentType.VM));jobs.initialize(); + assertThat(jobs.get(scope,queued).state()).isEqualTo("FAILED"); + String running=UUID.randomUUID().toString();jobs.submit(scope,running,request(DeploymentType.VM)); + jdbc.update("UPDATE application_deployment_submission SET state='RUNNING' WHERE id=?",running);jobs.initialize(); + jdbc.update("INSERT INTO deployment_history VALUES(22,'default',11,'VM','test-mci',NULL,'INSTALL','SUCCESS')"); + assertThat(jobs.get(scope,running).state()).isEqualTo("SUCCEEDED"); + assertThat(jobs.get(scope,running).deploymentId()).isEqualTo(22L); + verifyNoInteractions(orchestration); + } + @Test void returnsWhileDeploymentIsStillBlockedOnRemoteWork() throws Exception { + var real=Executors.newSingleThreadExecutor();var started=new CountDownLatch(1);var release=new CountDownLatch(1); + when(orchestration.deployApplication(any())).thenAnswer(invocation->{started.countDown();release.await(5,TimeUnit.SECONDS);return DeploymentHistory.builder().id(24L).status("SUCCESS").build();}); + var async=new DeploymentSubmissionService(jdbc,orchestration,new ObjectMapper(),real); + String id=UUID.randomUUID().toString(); + try { + var receipt=async.submit(scope,id,request(DeploymentType.K8S)); + assertThat(started.await(2,TimeUnit.SECONDS)).isTrue(); + assertThat(receipt.state()).isIn("QUEUED","RUNNING"); + assertThat(async.get(scope,id).state()).isEqualTo("RUNNING"); + } finally {release.countDown();real.shutdown();assertThat(real.awaitTermination(5,TimeUnit.SECONDS)).isTrue();} + assertThat(async.get(scope,id).state()).isEqualTo("SUCCEEDED"); + } + @Test void multiVmPartialHistoryCannotReconcileAndOnlyOwnerCanCloseInterruptedTracking() { + String id=UUID.randomUUID().toString();var req=request(DeploymentType.VM);req.setVmIds(List.of("vm1","vm2")); + jobs.submit(scope,id,req);jdbc.update("UPDATE application_deployment_submission SET state='RUNNING' WHERE id=?",id);jobs.initialize(); + jdbc.update("INSERT INTO deployment_history VALUES(25,'default',11,'VM','test-mci',NULL,'INSTALL','SUCCESS')"); + assertThat(jobs.get(scope,id).state()).isEqualTo("INTERRUPTED"); + assertThatThrownBy(()->jobs.closeInterrupted(new DeploymentSubmissionService.Scope("w1","p1","default","other"),id)).isInstanceOf(ResponseStatusException.class); + assertThat(jobs.closeInterrupted(scope,id).state()).isEqualTo("ABANDONED"); + assertThat(jdbc.queryForObject("SELECT status FROM deployment_history WHERE id=25",String.class)).isEqualTo("SUCCESS"); + jobs.submit(scope,UUID.randomUUID().toString(),req); + verifyNoInteractions(orchestration); + } + @Test void runningTrackingCannotBeClosedAndDeletedHistoryDoesNotReportSuccess() { + String id=UUID.randomUUID().toString();jobs.submit(scope,id,request(DeploymentType.K8S)); + assertThatThrownBy(()->jobs.closeInterrupted(scope,id)).isInstanceOf(ResponseStatusException.class); + jdbc.update("UPDATE application_deployment_submission SET state='RUNNING' WHERE id=?",id);jobs.initialize(); + jdbc.update("INSERT INTO deployment_history VALUES(26,'default',11,'K8S',NULL,'test-cluster','INSTALL','DELETED')"); + assertThat(jobs.get(scope,id).state()).isEqualTo("FAILED"); + } + static class QueueExecutor extends AbstractExecutorService { + List tasks=new ArrayList<>(); public void execute(Runnable task){tasks.add(task);} + void runNext(){tasks.remove(0).run();} + public void shutdown(){} public List shutdownNow(){return List.of();} + public boolean isShutdown(){return false;} public boolean isTerminated(){return false;} + public boolean awaitTermination(long timeout,TimeUnit unit){return true;} + } +} diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/CloudPiratesNginxHelmTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/CloudPiratesNginxHelmTest.java new file mode 100644 index 0000000..cd8c715 --- /dev/null +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/CloudPiratesNginxHelmTest.java @@ -0,0 +1,76 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import kr.co.mcmp.softwarecatalog.application.dto.DeploymentConfigDTO; +import kr.co.mcmp.softwarecatalog.application.model.HelmChart; +import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.yaml.snakeyaml.Yaml; +import static org.assertj.core.api.Assertions.assertThat; + +@EnabledIfEnvironmentVariable(named = "AM_HELM_BIN", matches = ".+") +class CloudPiratesNginxHelmTest { + @TempDir Path temp; + + @ParameterizedTest + @CsvSource({"false,nginx", "true,nginx", "false,public-iks-k8s-nginx", "true,public-iks-k8s-nginx"}) + void rendersTheActualAmIngressAdapterAndCidr(boolean tls, String ingressClass) throws Exception { + var chart = HelmChart.builder().chartName("nginx").chartRepositoryUrl("https://cloudpirates-io.github.io/helm-charts").build(); + var config = DeploymentConfigDTO.builder().ingressEnabled(true).ingressHost("nginx.example.com") + .servicePort(8088).ingressClass(ingressClass).ingressPath("/").ingressTlsEnabled(tls).ingressTlsSecret("nginx-tls").build(); + Map values = new HashMap<>(HelmIngressValues.from(chart, config)); + K8sIngressPolicy.configureValues("nginx", new HashMap<>(), values, config, "210.217.178.130/32"); + Path file = temp.resolve("values.yaml"); + Files.writeString(file, new Yaml().dump(values)); + Path output = temp.resolve("manifest.yaml"); + // Pull into an isolated directory: Helm otherwise prefers a local directory named nginx. + Path pullLog = temp.resolve("pull.log"); + var pull = new ProcessBuilder(System.getenv("AM_HELM_BIN"), "pull", "nginx", + "--repo", chart.getChartRepositoryUrl(), "--version", "0.16.8", "--destination", temp.toString()) + .directory(temp.toFile()).redirectErrorStream(true).redirectOutput(pullLog.toFile()).start(); + assertThat(pull.waitFor(120, TimeUnit.SECONDS)).isTrue(); + assertThat(pull.exitValue()).as(Files.readString(pullLog)).isZero(); + var process = new ProcessBuilder(System.getenv("AM_HELM_BIN"), "template", "nginx-test", + temp.resolve("nginx-0.16.8.tgz").toString(), + "--values", file.toString(), "--set", "autoscaling.enabled=true") + .redirectErrorStream(true).redirectOutput(output.toFile()).start(); + assertThat(process.waitFor(120, TimeUnit.SECONDS)).isTrue(); + String manifest = Files.readString(output); + assertThat(process.exitValue()).as(manifest).isZero(); + K8sIngressPolicy.verifyManifest(manifest, "210.217.178.130/32", "nginx.example.com", ingressClass); + assertThat(manifest).contains("kind: HorizontalPodAutoscaler", "nginx:1.31.5", "port: 8088") + .doesNotContain("PersistentVolumeClaim"); + List> resources = new ArrayList<>(); + for (Object document : new Yaml().loadAll(manifest)) { + if (document instanceof Map) resources.add(asMap(document)); + } + var deployment = resources.stream().filter(r -> "Deployment".equals(r.get("kind"))).findFirst().orElseThrow(); + var pod = asMap(asMap(asMap(deployment.get("spec")).get("template")).get("spec")); + var container = asMap(((List) pod.get("containers")).get(0)); + var ports = (List) container.get("ports"); + assertThat(ports).hasSize(1); + assertThat(asMap(ports.get(0))).containsEntry("containerPort", 8080).containsEntry("name", "http"); + assertThat(asMap(container.get("securityContext"))).containsEntry("runAsUser", 101) + .containsEntry("runAsNonRoot", true).containsEntry("allowPrivilegeEscalation", false); + var service = resources.stream().filter(r -> "Service".equals(r.get("kind"))).findFirst().orElseThrow(); + var servicePort = asMap(((List) asMap(service.get("spec")).get("ports")).get(0)); + assertThat(servicePort).containsEntry("port", 8088).containsEntry("targetPort", "http"); + var serverConfig = resources.stream().filter(r -> "ConfigMap".equals(r.get("kind"))) + .flatMap(r -> asMap(r.get("data")).values().stream()).map(String::valueOf) + .filter(value -> value.contains("server_name")).findFirst().orElseThrow(); + assertThat(serverConfig).contains("listen 8080;").doesNotContain("listen 80;"); + if (tls) assertThat(manifest).contains("secretName: nginx-tls"); + } + @SuppressWarnings("unchecked") + private static Map asMap(Object value) { + return (Map) value; + } +} diff --git a/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressServiceTest.java b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressServiceTest.java new file mode 100644 index 0000000..702ac77 --- /dev/null +++ b/src/test/java/kr/co/mcmp/softwarecatalog/kubernetes/service/IngressAddressServiceTest.java @@ -0,0 +1,156 @@ +package kr.co.mcmp.softwarecatalog.kubernetes.service; + +import io.fabric8.kubernetes.api.model.*; +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.dsl.MixedOperation; +import io.fabric8.kubernetes.client.dsl.PodResource; +import io.fabric8.kubernetes.client.dsl.ServiceResource; +import io.fabric8.kubernetes.client.dsl.Resource; +import kr.co.mcmp.softwarecatalog.application.constants.DeploymentType; +import kr.co.mcmp.softwarecatalog.application.model.DeploymentHistory; +import kr.co.mcmp.softwarecatalog.kubernetes.config.KubernetesClientFactory; +import org.junit.jupiter.api.Test; +import java.util.List; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +class IngressAddressServiceTest { + private final KubernetesClient client = mock(KubernetesClient.class, RETURNS_DEEP_STUBS); + private final KubernetesClientFactory factory = mock(KubernetesClientFactory.class); + private final IngressAddressService service = new IngressAddressService(factory, mock(kr.co.mcmp.ape.cbtumblebug.api.CbtumblebugRestApi.class)); + + @SuppressWarnings("unchecked") + IngressAddressServiceTest() { + MixedOperation podOperation = mock(MixedOperation.class); + when(client.pods()).thenReturn(podOperation); + when(podOperation.inNamespace("default")).thenReturn(podOperation); + when(podOperation.withLabel(anyString(), anyString())).thenReturn(podOperation); + MixedOperation> serviceOperation = mock(MixedOperation.class); + when(client.services()).thenReturn(serviceOperation); + when(serviceOperation.withLabel(anyString(), anyString())).thenReturn(serviceOperation); + when(serviceOperation.inNamespace("default")).thenReturn(serviceOperation); + when(serviceOperation.inNamespace("kube-system")).thenReturn(serviceOperation); + when(serviceOperation.withName(anyString())).thenReturn(mock(ServiceResource.class)); + MixedOperation> nodeOperation = mock(MixedOperation.class); + when(client.nodes()).thenReturn(nodeOperation); + when(nodeOperation.withName(anyString())).thenReturn(mock(Resource.class)); + clearInvocations(client); + } + + private void pods(Pod... pods) { + when(client.pods().inNamespace("default") + .withLabel("app.kubernetes.io/instance", "nginx-ingress-ns") + .withLabel("app.kubernetes.io/component", "controller").list()) + .thenReturn(new PodListBuilder().withItems(pods).build()); + } + + private Pod pod(String node, String phase) { + return new PodBuilder().withNewMetadata().endMetadata() + .withNewSpec().withNodeName(node).endSpec() + .withNewStatus().withPhase(phase).endStatus().build(); + } + + @Test void onlyRunningControllerNodesAreUsedAndAddressesAreDeduplicated() { + pods(pod("worker", "Running"), pod("worker", "Running"), pod("pending", "Pending")); + when(client.nodes().withName("worker").get()).thenReturn(new NodeBuilder().withNewStatus() + .addNewAddress().withType("InternalIP").withAddress("10.0.0.1").endAddress() + .addNewAddress().withType("ExternalIP").withAddress("54.1.2.3").endAddress().endStatus().build()); + assertEquals(List.of("54.1.2.3"), service.resolve(client, "ns", "AWS", "nginx")); + verify(client.nodes().withName("worker"), times(1)).get(); + } + + @Test void privateOnlyWorkerReturnsNoAddress() { + pods(pod("worker", "Running")); + when(client.nodes().withName("worker").get()).thenReturn(new NodeBuilder().withNewStatus() + .addNewAddress().withType("InternalIP").withAddress("10.0.0.1").endAddress().endStatus().build()); + assertEquals(List.of(), service.resolve(client, "ns", "ALIBABA", "nginx")); + assertEquals(List.of(), service.resolve(client, "ns", "NHN", "nginx")); + } + + @Test void ibmUsesManagedPublicLoadBalancerInsteadOfWorker() { + when(client.services().inNamespace("kube-system").list()) + .thenReturn(new ServiceListBuilder().withItems(new ServiceBuilder() + .withNewMetadata().withName("public-alb1").addToLabels("app.kubernetes.io/part-of", "managed-ingress").endMetadata() + .withNewSpec().withType("LoadBalancer").endSpec().withNewStatus().withNewLoadBalancer() + .addNewIngress().withIp("161.1.2.3").endIngress() + .endLoadBalancer().endStatus().build()).build()); + assertEquals(List.of("161.1.2.3"), service.resolve(client, "ns", "IBM", "public-iks-k8s-nginx")); + verify(client, never()).nodes(); + } + + @Test void pendingLoadBalancerAndMissingControllerReturnNoAddress() { + when(client.services().inNamespace("kube-system").list()).thenReturn(new ServiceListBuilder().build()); + assertTrue(service.resolve(client, "ns", "IBM", "public-iks-k8s-nginx").isEmpty()); + pods(); + assertTrue(service.resolve(client, "ns", "AWS", "nginx").isEmpty()); + } + + @Test void dnsAddressesExcludePrivateAndSharedAddresses() throws Exception { + var resolving = spy(service); + doReturn(new java.net.InetAddress[]{java.net.InetAddress.getByName("161.1.2.3"), + java.net.InetAddress.getByName("10.1.2.3"), java.net.InetAddress.getByName("100.64.0.1")}) + .when(resolving).lookup("alb.example.test"); + var addresses = new java.util.TreeSet(); + resolving.addPublicAddresses(addresses, "alb.example.test"); + assertEquals(java.util.Set.of("161.1.2.3"), addresses); + assertTrue(service.resolve(client, "ns", "IBM", "private-iks-k8s-nginx").isEmpty()); + } + + @Test void disabledIngressDoesNotConnectAndConnectionFailureIsContained() { + DeploymentHistory history = new DeploymentHistory(); + history.setDeploymentType(DeploymentType.K8S); + history.setNamespace("ns"); + history.setClusterName("cluster"); + assertTrue(service.getPublicIps(history, false, "nginx").isEmpty()); + verifyNoInteractions(factory); + when(factory.getClient("ns", "cluster")).thenThrow(new IllegalStateException("unavailable")); + assertTrue(service.getPublicIps(history, true, "nginx").isEmpty()); + } + + @Test void workerAccessUsesNodePortAndSelectsTheRouteProtocol() { + when(client.services().inNamespace("default").withLabel("app.kubernetes.io/instance", "nginx-ingress-ns") + .withLabel("app.kubernetes.io/component", "controller").list()) + .thenReturn(new ServiceListBuilder().withItems(new ServiceBuilder().withNewMetadata().withName("controller").endMetadata() + .withNewSpec().withType("NodePort") + .addNewPort().withName("http").withPort(80).withNodePort(30880).endPort() + .addNewPort().withName("https").withPort(443).withNodePort(30443).endPort() + .addNewPort().withName("metrics").withPort(10254).withNodePort(30254).endPort() + .endSpec().build()).build()); + assertEquals(List.of(30880), service.resolvePorts(client, "ns", "AWS", "nginx", false)); + assertEquals(List.of(30443), service.resolvePorts(client, "ns", "AWS", "nginx", true)); + } + + @Test void ibmAccessUsesLoadBalancerPortNotNodePortAndDeduplicates() { + var alb = new ServiceBuilder().withNewMetadata().withName("public-alb1") + .addToLabels("app.kubernetes.io/part-of", "managed-ingress").endMetadata() + .withNewSpec().withType("LoadBalancer") + .addNewPort().withName("http").withPort(80).withNodePort(31080).endPort() + .addNewPort().withName("https").withPort(443).withNodePort(31443).endPort().endSpec().build(); + when(client.services().inNamespace("kube-system").list()).thenReturn(new ServiceListBuilder() + .withItems(alb, new ServiceBuilder(alb).editMetadata().withName("public-alb2").endMetadata().build()).build()); + assertEquals(List.of(80), service.resolvePorts(client, "ns", "IBM", "public-iks-k8s-nginx", false)); + assertEquals(List.of(443), service.resolvePorts(client, "ns", "IBM", "public-iks-k8s-nginx", true)); + assertEquals(List.of(), service.resolvePorts(client, "ns", "IBM", "private-iks-k8s-nginx", false)); + } + + @Test void missingNodePortDoesNotExposeInternalServicePort() { + when(client.services().inNamespace("default").withLabel(anyString(), anyString()).withLabel(anyString(), anyString()).list()) + .thenReturn(new ServiceListBuilder().withItems(new ServiceBuilder().withNewMetadata().withName("controller").endMetadata() + .withNewSpec().withType("ClusterIP").addNewPort().withName("http").withPort(80).endPort().endSpec().build()).build()); + assertTrue(service.resolvePorts(client, "ns", "NHN", "nginx", false).isEmpty()); + } + + @Test void endpointUsesOneClientAndDisabledIngressSkipsAllLookups() { + DeploymentHistory history = new DeploymentHistory(); + history.setDeploymentType(DeploymentType.K8S); history.setNamespace("ns"); + history.setClusterName("cluster"); history.setCloudProvider("AWS"); + assertEquals(new IngressAddressService.Endpoint(List.of(), List.of()), service.getEndpoint(history, false, "nginx", false)); + verifyNoInteractions(factory); + when(factory.getClient("ns", "cluster")).thenReturn(client); + pods(); + when(client.services().inNamespace("default").withLabel(anyString(), anyString()).withLabel(anyString(), anyString()).list()) + .thenReturn(new ServiceListBuilder().build()); + assertEquals(new IngressAddressService.Endpoint(List.of(), List.of()), service.getEndpoint(history, true, "nginx", false)); + verify(factory, times(1)).getClient("ns", "cluster"); + } +} diff --git a/src/test/java/kr/co/mcmp/util/NginxHelmCatalogTest.java b/src/test/java/kr/co/mcmp/util/NginxHelmCatalogTest.java new file mode 100644 index 0000000..ff64309 --- /dev/null +++ b/src/test/java/kr/co/mcmp/util/NginxHelmCatalogTest.java @@ -0,0 +1,86 @@ +package kr.co.mcmp.util; + +import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.datasource.DriverManagerDataSource; +import org.springframework.test.util.ReflectionTestUtils; +import static org.assertj.core.api.Assertions.assertThat; + +class NginxHelmCatalogTest { + private JdbcTemplate jdbc; + private DatabaseInitializer initializer; + + @BeforeEach + void setUp() { + jdbc = new JdbcTemplate(new DriverManagerDataSource( + "jdbc:h2:mem:" + UUID.randomUUID() + ";MODE=PostgreSQL;DB_CLOSE_DELAY=-1", "sa", "")); + jdbc.execute(""" + CREATE TABLE SOFTWARE_CATALOG ( + ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + TITLE VARCHAR, DESCRIPTION VARCHAR, SUMMARY VARCHAR, CATEGORY VARCHAR, + LOGO_URL_LARGE VARCHAR, LOGO_URL_SMALL VARCHAR, MIN_CPU DOUBLE PRECISION, + RECOMMENDED_CPU DOUBLE PRECISION, MIN_MEMORY DOUBLE PRECISION, + RECOMMENDED_MEMORY DOUBLE PRECISION, MIN_DISK INTEGER, RECOMMENDED_DISK INTEGER, + CPU_THRESHOLD DOUBLE PRECISION, MEMORY_THRESHOLD DOUBLE PRECISION, + MIN_REPLICAS INTEGER, MAX_REPLICAS INTEGER, HPA_ENABLED BOOLEAN, + DEFAULT_PORT INTEGER, INGRESS_ENABLED BOOLEAN, CREATED_AT TIMESTAMP, UPDATED_AT TIMESTAMP) + """); + jdbc.execute(""" + CREATE TABLE HELM_CHART (CATALOG_ID BIGINT, CHART_NAME VARCHAR, CHART_VERSION VARCHAR, + CHART_REPOSITORY_URL VARCHAR, REPOSITORY_NAME VARCHAR, REPOSITORY_DISPLAY_NAME VARCHAR, + REPOSITORY_OFFICIAL BOOLEAN, PACKAGE_ID VARCHAR, NORMALIZED_NAME VARCHAR, + APP_VERSION VARCHAR, DESCRIPTION VARCHAR, CATEGORY VARCHAR, IMAGE_REPOSITORY VARCHAR, + TAG VARCHAR, HAS_VALUES_SCHEMA BOOLEAN) + """); + jdbc.execute("CREATE TABLE SOFTWARE_CATALOG_REF (CATALOG_ID BIGINT, REF_IDX INTEGER, REF_VALUE VARCHAR, REF_DESC VARCHAR, REF_TYPE VARCHAR)"); + initializer = new DatabaseInitializer(); + ReflectionTestUtils.setField(initializer, "jdbcTemplate", jdbc); + } + + @Test + void createsExternalChartAndIsIdempotent() { + synchronize(); + synchronize(); + assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM HELM_CHART", Integer.class)).isEqualTo(1); + assertThat(jdbc.queryForObject("SELECT CHART_REPOSITORY_URL FROM HELM_CHART", String.class)) + .isEqualTo("https://cloudpirates-io.github.io/helm-charts"); + assertThat(jdbc.queryForObject("SELECT CHART_VERSION FROM HELM_CHART", String.class)).isEqualTo("0.16.8"); + assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM SOFTWARE_CATALOG_REF", Integer.class)).isEqualTo(1); + } + + @Test + void migratesExactLegacyMappingWithoutDuplicatingIt() { + legacy(11, "Nginx for Kubernetes", "http://localhost:18084/charts", "0.1.0"); + synchronize(); + synchronize(); + assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM HELM_CHART WHERE CATALOG_ID=11", Integer.class)).isEqualTo(1); + assertThat(jdbc.queryForObject("SELECT PACKAGE_ID FROM HELM_CHART WHERE CATALOG_ID=11", String.class)).isEqualTo("cloudpirates-nginx"); + assertThat(jdbc.queryForObject("SELECT APP_VERSION FROM HELM_CHART WHERE CATALOG_ID=11", String.class)).isEqualTo("1.31.5"); + } + + @Test + void preservesCustomizedRepositoryAndVersionAndOtherCatalog() { + legacy(11, "Nginx for Kubernetes", "https://example.org/custom", "0.1.0"); + legacy(12, "Nginx for Kubernetes", "http://localhost:18084/charts", "9.0.0"); + legacy(13, "Another catalog", "http://localhost:18084/charts", "0.1.0"); + synchronize(); + assertThat(jdbc.queryForList("SELECT PACKAGE_ID FROM HELM_CHART", String.class)) + .containsExactly("mcmp-builtin-nginx", "mcmp-builtin-nginx", "mcmp-builtin-nginx"); + assertThat(jdbc.queryForObject("SELECT CHART_REPOSITORY_URL FROM HELM_CHART WHERE CATALOG_ID=11", String.class)) + .isEqualTo("https://example.org/custom"); + } + + private void legacy(long id, String title, String url, String version) { + jdbc.update("INSERT INTO SOFTWARE_CATALOG (ID, TITLE) VALUES (?, ?)", id, title); + jdbc.update(""" + INSERT INTO HELM_CHART (CATALOG_ID, CHART_NAME, CHART_VERSION, CHART_REPOSITORY_URL, REPOSITORY_NAME, PACKAGE_ID) + VALUES (?, 'nginx', ?, ?, 'mcmp-builtin', 'mcmp-builtin-nginx') + """, id, version, url); + } + + private void synchronize() { + ReflectionTestUtils.invokeMethod(initializer, "ensureNginxHelmCatalog"); + } +} From 222d752ad1c60e09ba34411bd82ea46a34613fff Mon Sep 17 00:00:00 2001 From: LeeKyungBeom Date: Thu, 17 Sep 2026 10:10:50 +0900 Subject: [PATCH 2/2] feat: unify Nginx catalog view for VM and Kubernetes --- .../scripts/test-catalog-grouping.mjs | 35 ++++++++++++ .../views/softwareCatalog/catalogGrouping.ts | 34 +++++++++++ .../applicationInstallationForm.vue | 7 ++- .../components/softwareCatalogList.vue | 38 +++++++++++-- doc/nginx-unified-catalog-20260917.md | 29 ++++++++++ .../assets/ApplicationRepository-ddPLFfmd.js | 1 + .../assets/ApplicationStatus-Cv3W0VuO.js | 57 +++++++++++++++++++ .../static/assets/IconPlus-C2-r8cl0.js | 6 ++ .../assets/InstallSoftwareIframe-BxmK4Foz.js | 1 + .../static/assets/OssList-CQFflbr5.js | 17 ++++++ .../assets/RepositoryDetail-CJXxD7ic.js | 15 +++++ .../static/assets/RepositoryList-B_BlTun_.js | 17 ++++++ .../static/assets/SoftwareCatalog-CvFn0UxT.js | 21 +++++++ .../SoftwareCatalogListTest-DaTbDtlw.js | 11 ++++ ...ue_vue_type_style_index_0_lang-CKVAW0Fg.js | 22 +++++++ .../static/assets/YamlGenerate-C19ZruvS.js | 1 + .../assets/applicationDetailModal-CUWbvpf0.js | 11 ++++ .../applicationInstallationForm-BdUcF3sq.css | 1 + .../applicationInstallationForm-DS9dKKPI.js | 1 + .../assets/createVueComponent-BxhDzlaY.js | 11 ++++ .../resources/static/assets/index-Bv_T9-LS.js | 42 ++++++++++++++ .../static/assets/lodash-DNz--_OJ.js | 27 +++++++++ .../static/assets/repository-C8d3EBI_.js | 1 + .../static/assets/request-ChBRPmtg.js | 1 + .../static/assets/softwareCatalog--9tqzSS5.js | 1 + src/main/resources/static/index.html | 26 ++++----- 26 files changed, 412 insertions(+), 22 deletions(-) create mode 100644 applicationFE/scripts/test-catalog-grouping.mjs create mode 100644 applicationFE/src/views/softwareCatalog/catalogGrouping.ts create mode 100644 doc/nginx-unified-catalog-20260917.md create mode 100644 src/main/resources/static/assets/ApplicationRepository-ddPLFfmd.js create mode 100644 src/main/resources/static/assets/ApplicationStatus-Cv3W0VuO.js create mode 100644 src/main/resources/static/assets/IconPlus-C2-r8cl0.js create mode 100644 src/main/resources/static/assets/InstallSoftwareIframe-BxmK4Foz.js create mode 100644 src/main/resources/static/assets/OssList-CQFflbr5.js create mode 100644 src/main/resources/static/assets/RepositoryDetail-CJXxD7ic.js create mode 100644 src/main/resources/static/assets/RepositoryList-B_BlTun_.js create mode 100644 src/main/resources/static/assets/SoftwareCatalog-CvFn0UxT.js create mode 100644 src/main/resources/static/assets/SoftwareCatalogListTest-DaTbDtlw.js create mode 100644 src/main/resources/static/assets/Tabulator.vue_vue_type_style_index_0_lang-CKVAW0Fg.js create mode 100644 src/main/resources/static/assets/YamlGenerate-C19ZruvS.js create mode 100644 src/main/resources/static/assets/applicationDetailModal-CUWbvpf0.js create mode 100644 src/main/resources/static/assets/applicationInstallationForm-BdUcF3sq.css create mode 100644 src/main/resources/static/assets/applicationInstallationForm-DS9dKKPI.js create mode 100644 src/main/resources/static/assets/createVueComponent-BxhDzlaY.js create mode 100644 src/main/resources/static/assets/index-Bv_T9-LS.js create mode 100644 src/main/resources/static/assets/lodash-DNz--_OJ.js create mode 100644 src/main/resources/static/assets/repository-C8d3EBI_.js create mode 100644 src/main/resources/static/assets/request-ChBRPmtg.js create mode 100644 src/main/resources/static/assets/softwareCatalog--9tqzSS5.js diff --git a/applicationFE/scripts/test-catalog-grouping.mjs b/applicationFE/scripts/test-catalog-grouping.mjs new file mode 100644 index 0000000..45ee7f2 --- /dev/null +++ b/applicationFE/scripts/test-catalog-grouping.mjs @@ -0,0 +1,35 @@ +import assert from 'node:assert/strict' +import { readFile } from 'node:fs/promises' +import ts from 'typescript' +const source = await readFile(new URL('../src/views/softwareCatalog/catalogGrouping.ts', import.meta.url), 'utf8') +const js = ts.transpileModule(source, { compilerOptions: { module: ts.ModuleKind.ESNext, target: ts.ScriptTarget.ES2022 } }).outputText +const { groupCatalogs, catalogDisplayName, loadGroupedDeploymentStatus } = await import(`data:text/javascript;base64,${Buffer.from(js).toString('base64')}`) +const vm = { id: 3, name: 'Nginx', packageInfo: { packageName: 'nginx' }, downloadCount: 1, ratingCount: 2, averageRating: 4 } +const k8s = { id: 12, name: 'Nginx for Kubernetes', helmChart: { chartName: 'nginx', chartRepositoryUrl: 'https://cloudpirates-io.github.io/helm-charts' }, downloadCount: 1, ratingCount: 1, averageRating: 1 } +const jupyter = { id: 11, name: 'JupyterLab for Object Storage', packageInfo: { packageName: 'quay.io/jupyter/scipy-notebook' } } +const catalogs = [vm, jupyter, k8s] +const original = JSON.stringify(catalogs) +const grouped = groupCatalogs(catalogs) +assert.deepEqual(grouped.map(c => c.name), ['Nginx', jupyter.name]) +assert.deepEqual(grouped[0].deploymentCatalogIds, [3, 12]) +assert.equal(grouped[0].downloadCount, 2) +assert.equal(grouped[0].averageRating, 3) +assert.equal(grouped[0].ratingCount, 3) +assert.equal(catalogDisplayName(k8s, catalogs), 'Nginx') +assert.equal(k8s.id, 12) +assert.equal(JSON.stringify(catalogs), original) +assert.equal(groupCatalogs([vm]).length, 1) +assert.equal(groupCatalogs([k8s]).length, 1) +assert.equal(catalogDisplayName(k8s, [k8s]), k8s.name) +assert.equal(groupCatalogs([vm, {...vm, id: 99}, k8s]).length, 3) +assert.equal(groupCatalogs([vm, {...k8s, helmChart: {...k8s.helmChart, chartRepositoryUrl: 'https://custom.example'}}]).length, 2) +const calls = [] +const status = await loadGroupedDeploymentStatus([3, 12, 3], async id => { + calls.push(id) + return { data: { deploymentHistories: [{ id: id + 20 }], applicationStatuses: [{id, deploymentHistoryId: id + 20, status: id === 3 ? 'RUNNING' : 'UNINSTALLED'}] } } +}) +assert.deepEqual(calls, [3, 12]) +assert.deepEqual(status.applicationStatuses.map(s => s.deploymentHistoryId), [23, 32]) +assert.equal(status.applicationStatuses[1].status, 'UNINSTALLED') +await assert.rejects(loadGroupedDeploymentStatus([3, 12], async id => { if (id === 12) throw Error('offline'); return { data: {} } }), /offline/) +console.log('Catalog grouping: preservation, aggregation, custom/ambiguous catalogs, names and refresh failure checks passed') diff --git a/applicationFE/src/views/softwareCatalog/catalogGrouping.ts b/applicationFE/src/views/softwareCatalog/catalogGrouping.ts new file mode 100644 index 0000000..63b5e22 --- /dev/null +++ b/applicationFE/src/views/softwareCatalog/catalogGrouping.ts @@ -0,0 +1,34 @@ +// Group only the unique AM-provided Docker/Helm pair. Keep persistent IDs intact. +export function nginxCatalogPair(catalogs: any[]) { + const vm = catalogs.filter(c => c.name === 'Nginx' && c.packageInfo?.packageName === 'nginx' && !c.helmChart) + const k8s = catalogs.filter(c => c.name === 'Nginx for Kubernetes' && !c.packageInfo + && c.helmChart?.chartName === 'nginx' + && c.helmChart?.chartRepositoryUrl?.replace(/\/$/, '') === 'https://cloudpirates-io.github.io/helm-charts') + return vm.length === 1 && k8s.length === 1 ? { vm: vm[0], k8s: k8s[0] } : null +} + +export function catalogDisplayName(catalog: any, catalogs: any[]): string { + const pair = nginxCatalogPair(catalogs) + return pair && catalog.id === pair.k8s.id ? pair.vm.name : catalog.name +} + +export function groupCatalogs(catalogs: any[]) { + const pair = nginxCatalogPair(catalogs) + return catalogs.filter(c => !pair || c.id !== pair.k8s.id).map(c => { + const members = pair && c.id === pair.vm.id ? [pair.vm, pair.k8s] : [c] + const ratingCount = members.reduce((sum, m) => sum + Number(m.ratingCount || 0), 0) + return { ...c, catalogMembers: members, deploymentCatalogIds: members.map(m => m.id), + downloadCount: members.reduce((sum, m) => sum + Number(m.downloadCount || 0), 0), + ratingCount, averageRating: ratingCount + ? members.reduce((sum, m) => sum + Number(m.averageRating || 0) * Number(m.ratingCount || 0), 0) / ratingCount : 0 } + }) +} + +// Fail the refresh as a whole if one source fails, rather than hiding its deployments. +export async function loadGroupedDeploymentStatus(ids: number[], load: (id: number) => Promise) { + const responses = await Promise.all([...new Set(ids)].map(load)) + return { + deploymentHistories: responses.flatMap(r => r.data?.deploymentHistories || []), + applicationStatuses: responses.flatMap(r => r.data?.applicationStatuses || []) + } +} diff --git a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue index 15e44a2..b92fdcc 100644 --- a/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/applicationInstallationForm.vue @@ -279,7 +279,7 @@ v-model="inputApplications" @change="onChangeCatalog">
@@ -482,7 +482,7 @@

Select the application

@@ -914,6 +914,7 @@ + + + + + + + App + - - -
- - + + +
+ +