@undefineds.co/xpod 0.4.10 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/components-ignore.json +5 -1
- package/config/notifications.json +68 -0
- package/config/xpod.base.json +9 -11
- package/dist/ai/service/AiCredentialSecret.d.ts +30 -0
- package/dist/ai/service/AiCredentialSecret.js +120 -0
- package/dist/ai/service/CredentialReaderImpl.d.ts +18 -0
- package/dist/ai/service/CredentialReaderImpl.js +81 -5
- package/dist/ai/service/CredentialReaderImpl.jsonld +42 -2
- package/dist/ai/service/EmbeddingModelPolicy.d.ts +79 -0
- package/dist/ai/service/EmbeddingModelPolicy.js +134 -0
- package/dist/ai/service/EmbeddingProviderError.js +6 -0
- package/dist/ai/service/EmbeddingServiceImpl.d.ts +13 -1
- package/dist/ai/service/EmbeddingServiceImpl.js +18 -5
- package/dist/ai/service/EmbeddingServiceImpl.jsonld +35 -0
- package/dist/ai/service/index.d.ts +2 -0
- package/dist/ai/service/index.js +2 -0
- package/dist/api/ai-gateway/connect/index.d.ts +20 -2
- package/dist/api/ai-gateway/connect/index.js +162 -16
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.d.ts +12 -0
- package/dist/api/ai-gateway/credentials/AiCredentialSecretDecoder.js +30 -0
- package/dist/api/ai-gateway/errors.d.ts +1 -1
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.d.ts +11 -0
- package/dist/api/ai-gateway/models/GatewayEmbeddingModelCatalog.js +31 -0
- package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +7 -3
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.d.ts +18 -0
- package/dist/api/ai-gateway/models/ProviderCustomModelsService.js +23 -0
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.d.ts +3 -1
- package/dist/api/ai-gateway/models/ProviderModelDiscoveryAdapters.js +2 -45
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelSelectionService.js +57 -20
- package/dist/api/ai-gateway/models/ProviderModelType.d.ts +28 -0
- package/dist/api/ai-gateway/models/ProviderModelType.js +34 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.d.ts +10 -0
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +3 -4
- package/dist/api/ai-gateway/models/index.d.ts +1 -0
- package/dist/api/ai-gateway/models/index.js +3 -1
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.d.ts +7 -0
- package/dist/api/ai-gateway/providers/CustomRuntimeAdapter.js +9 -2
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -1
- package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +4 -10
- package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +107 -0
- package/dist/api/ai-gateway/providers/ProviderRegistry.js +244 -21
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.d.ts +5 -0
- package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +5 -1
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.d.ts +12 -4
- package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +11 -11
- package/dist/api/ai-gateway/routing/ModelRouter.d.ts +14 -0
- package/dist/api/ai-gateway/routing/ModelRouter.js +43 -4
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.d.ts +9 -1
- package/dist/api/ai-gateway/service-access/AiConnectionsServiceAccess.js +3 -27
- package/dist/api/auth/ClientCredentialsAuthenticator.d.ts +0 -1
- package/dist/api/auth/ClientCredentialsAuthenticator.js +0 -3
- package/dist/api/auth/index.d.ts +1 -0
- package/dist/api/auth/index.js +1 -1
- package/dist/api/chatkit/pod-store.d.ts +31 -0
- package/dist/api/chatkit/pod-store.js +132 -8
- package/dist/api/container/common.js +24 -4
- package/dist/api/container/routes.js +17 -2
- package/dist/api/container/types.d.ts +3 -1
- package/dist/api/handlers/AdminHandler.d.ts +13 -0
- package/dist/api/handlers/AdminHandler.js +47 -18
- package/dist/api/handlers/AiConfigHandler.d.ts +6 -0
- package/dist/api/handlers/AiConfigHandler.js +28 -0
- package/dist/api/handlers/AiGatewayManagementHandler.js +36 -0
- package/dist/api/runs/RdfRunContextRetriever.d.ts +14 -0
- package/dist/api/runs/RdfRunContextRetriever.js +41 -5
- package/dist/api/runtime.js +2 -1
- package/dist/cli/commands/secret.d.ts +1 -0
- package/dist/cli/commands/secret.js +25 -7
- package/dist/components/components.jsonld +3 -1
- package/dist/components/context.jsonld +53 -1
- package/dist/http/SubgraphSparqlHttpHandler.d.ts +59 -2
- package/dist/http/SubgraphSparqlHttpHandler.js +145 -13
- package/dist/http/SubgraphSparqlHttpHandler.jsonld +37 -0
- package/dist/identity/drizzle/AccountRoleRepository.d.ts +30 -2
- package/dist/identity/drizzle/AccountRoleRepository.js +163 -15
- package/dist/identity/drizzle/EdgeNodeRepository.d.ts +0 -12
- package/dist/identity/drizzle/EdgeNodeRepository.js +5 -13
- package/dist/identity/drizzle/PodLookupRepository.d.ts +58 -4
- package/dist/identity/drizzle/PodLookupRepository.js +248 -105
- package/dist/identity/drizzle/db.d.ts +19 -0
- package/dist/identity/drizzle/db.js +39 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/logging/log-file.d.ts +17 -0
- package/dist/logging/log-file.js +69 -0
- package/dist/main.js +2 -1
- package/dist/notifications/NotificationChannelSweeper.d.ts +50 -0
- package/dist/notifications/NotificationChannelSweeper.js +131 -0
- package/dist/notifications/NotificationChannelSweeper.jsonld +136 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.d.ts +25 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.js +56 -0
- package/dist/notifications/ReclaimingWebSocket2023Storer.jsonld +77 -0
- package/dist/notifications/index.d.ts +2 -0
- package/dist/notifications/index.js +2 -0
- package/dist/runtime/Proxy.d.ts +37 -0
- package/dist/runtime/Proxy.js +88 -16
- package/dist/runtime/bootstrap.js +2 -1
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.d.ts +116 -0
- package/dist/runtime/upgrade/BunNativeUpgradeRelay.js +423 -0
- package/dist/runtime/upgrade/UpgradeHandshake.d.ts +63 -0
- package/dist/runtime/upgrade/UpgradeHandshake.js +199 -0
- package/dist/runtime/upgrade/WebSocketFrames.d.ts +67 -0
- package/dist/runtime/upgrade/WebSocketFrames.js +224 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +8 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.d.ts +11 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiAuthorizationActions.js +27 -10
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +13 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +10 -6
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +29 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMainHeader.js +18 -3
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +16 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +92 -20
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.d.ts +35 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCopyButton.js +45 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +71 -11
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialRow.js +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.d.ts +23 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiEndpointList.js +24 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +13 -4
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +35 -38
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayModelsSection.js +51 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiInfoTooltip.js +16 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.d.ts +175 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiModelCatalog.js +133 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiOfferingDetails.js +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +13 -64
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.d.ts +21 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderHeader.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiRowAction.js +12 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.d.ts +7 -0
- package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +6 -0
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.d.ts +36 -5
- package/node_modules/@undefineds.co/ai-connections/dist/authorization-methods.js +52 -9
- package/node_modules/@undefineds.co/ai-connections/dist/client/normalize.js +30 -3
- package/node_modules/@undefineds.co/ai-connections/dist/client/types.d.ts +21 -1
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.d.ts +1 -3
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.js +3 -7
- package/node_modules/@undefineds.co/ai-connections/dist/client-config/index.cjs +9 -7
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.d.ts +46 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +231 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.d.ts +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.js +173 -0
- package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +71 -5
- package/node_modules/@undefineds.co/ai-connections/dist/controller.js +285 -16
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.d.ts +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/credential-labels.js +8 -3
- package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.d.ts +59 -0
- package/node_modules/@undefineds.co/ai-connections/dist/credential-storage.js +131 -0
- package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.d.ts +15 -0
- package/node_modules/@undefineds.co/ai-connections/dist/endpoint-urls.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/gateway-endpoints.js +20 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +8 -0
- package/node_modules/@undefineds.co/ai-connections/dist/index.js +8 -0
- package/node_modules/@undefineds.co/ai-connections/dist/manifest.js +1 -1
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.d.ts +14 -0
- package/node_modules/@undefineds.co/ai-connections/dist/offering-endpoints.js +17 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.cjs +68 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.d.ts +75 -1
- package/node_modules/@undefineds.co/ai-connections/dist/provider-catalog.js +119 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.d.ts +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +5 -0
- package/node_modules/@undefineds.co/ai-connections/dist/service-access.js +2 -27
- package/node_modules/@undefineds.co/ai-connections/package.json +1 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.d.ts +1 -1
- package/node_modules/@undefineds.co/extension-sdk/dist/manifest.js +2 -0
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +150 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +2 -1
- package/node_modules/@undefineds.co/models/README.md +1 -1
- package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +3 -3
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.d.ts +5 -0
- package/node_modules/@undefineds.co/models/dist/ai-gateway.schema.js +9 -0
- package/node_modules/@undefineds.co/models/dist/ai-runtime.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/approval.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/audit.presentation.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/capture.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat-project.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/control-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/conversation-share.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +12 -0
- package/node_modules/@undefineds.co/models/dist/credential.schema.js +15 -1
- package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/discovery/providers.json +248 -7
- package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +31 -0
- package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/import/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/index.d.ts +73 -73
- package/node_modules/@undefineds.co/models/dist/index.js +1 -1
- package/node_modules/@undefineds.co/models/dist/input-request.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/namespaces.js +5 -0
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.d.ts +4815 -26
- package/node_modules/@undefineds.co/models/dist/pod-storage-descriptor.js +482 -132
- package/node_modules/@undefineds.co/models/dist/schema.d.ts +4 -0
- package/node_modules/@undefineds.co/models/dist/session/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +5 -5
- package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +2 -2
- package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +1 -1
- package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +10 -10
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +1 -0
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +1 -0
- package/node_modules/@undefineds.co/models/package.json +4 -2
- package/node_modules/@undefineds.co/pod-collections/README.md +71 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.d.ts +85 -0
- package/node_modules/@undefineds.co/pod-collections/dist/diff.js +166 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.d.ts +17 -0
- package/node_modules/@undefineds.co/pod-collections/dist/feed.js +27 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +1042 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.d.ts +37 -0
- package/node_modules/@undefineds.co/pod-collections/dist/index.js +89 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.d.ts +75 -0
- package/node_modules/@undefineds.co/pod-collections/dist/layout.js +173 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +78 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +287 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.d.ts +83 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +273 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.d.ts +21 -0
- package/node_modules/@undefineds.co/pod-collections/dist/react.js +22 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.d.ts +65 -0
- package/node_modules/@undefineds.co/pod-collections/dist/read.js +31 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.d.ts +66 -0
- package/node_modules/@undefineds.co/pod-collections/dist/sync.js +260 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.d.ts +155 -0
- package/node_modules/@undefineds.co/pod-collections/dist/types.js +9 -0
- package/node_modules/@undefineds.co/pod-collections/package.json +42 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +0 -1
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +0 -1
- package/package.json +15 -7
- package/static/app/assets/main.css +1 -1
- package/static/app/assets/main.js +12 -13
- package/static/auth-callback/assets/AiConfigContext-DnQs1ZpW.js +1 -0
- package/static/auth-callback/assets/AiConfigPage-DOtvlxH0.js +1 -0
- package/static/auth-callback/assets/DocumentProcessingPanel-BS2voQgL.js +1 -0
- package/static/auth-callback/assets/IndexLifecyclePanel-Cvt0cJtN.js +1 -0
- package/static/auth-callback/assets/{IndexSubjectPanel-C4YG0whI.js → IndexSubjectPanel-Dhf01GqF.js} +1 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-BJutWaAF.js +1 -0
- package/static/auth-callback/assets/ModelsPage-BRS0sje3.js +11 -0
- package/static/auth-callback/assets/{NetworkPage-Cbdn_P1e.js → NetworkPage-B3qBfANA.js} +2 -2
- package/static/auth-callback/assets/{PaneListHeader-jy70Q00L.js → PaneListHeader-QQeJGTp4.js} +1 -1
- package/static/auth-callback/assets/SearchIndexingPanel-MyNUSEwT.js +1 -0
- package/static/auth-callback/assets/{StatusSubjectPanel-hfjoB5aS.js → StatusSubjectPanel-DQkEVsFs.js} +1 -1
- package/static/{settings/assets/StatusWorkspace-CKD_Rzdr.js → auth-callback/assets/StatusWorkspace-Dkv63Uwk.js} +1 -1
- package/static/auth-callback/assets/SystemSettingsPage-TIsUfX5d.js +1 -0
- package/static/auth-callback/assets/SystemSettingsSubjectPanel-BJWEt2-7.js +33 -0
- package/static/auth-callback/assets/XpodAiConnectionsPodStore-BJiXm-PF.js +3 -0
- package/static/auth-callback/assets/{activity-BcsZZxxw.js → activity-5hNeNKnL.js} +1 -1
- package/static/auth-callback/assets/admin-C6qCRFiY.js +1 -0
- package/static/auth-callback/assets/ai-connections-CryuHGKW.js +1 -0
- package/static/auth-callback/assets/{auth-callback-atKg_oig.js → auth-callback-CAFZ3R0B.js} +80 -84
- package/static/auth-callback/assets/auth-callback-rk080mvG.css +1 -0
- package/static/auth-callback/assets/{badge-BWbRHThQ.js → badge-CAIPI0CB.js} +1 -1
- package/static/auth-callback/assets/collection-runtime-D9s7h9YA.js +1 -0
- package/static/auth-callback/assets/dialog-BjA109aX.js +1 -0
- package/static/auth-callback/assets/{download-BmvG1Vya.js → download-B3Up5W2G.js} +1 -1
- package/static/auth-callback/assets/{external-link-DZ34d3g3.js → external-link-BTXgSPzB.js} +1 -1
- package/static/auth-callback/assets/index-BppXlxcp.js +41 -0
- package/static/auth-callback/assets/index-CirW4CJf.js +1 -0
- package/static/auth-callback/assets/index-DlLYWOhw.js +4 -0
- package/static/auth-callback/assets/{index-browser-B9Z7GU-T.js → index-browser-DtU38ni3.js} +1 -1
- package/static/auth-callback/assets/{key-round-tjP76Se-.js → key-round-CQCOrZ7x.js} +1 -1
- package/static/auth-callback/assets/layout-DB3pMyTl.js +1 -0
- package/static/auth-callback/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/auth-callback/assets/{rotate-ccw-C_L5ZLx1.js → rotate-ccw-C1zM2KtS.js} +1 -1
- package/static/auth-callback/assets/settings-projection-CUkyprDQ.js +1 -0
- package/static/auth-callback/assets/{skeleton-C7tGDQIs.js → skeleton-Cqp7_M9-.js} +1 -1
- package/static/auth-callback/assets/{waypoints-VMNQlWdU.js → waypoints-Bj6gAUSQ.js} +1 -1
- package/static/auth-callback/assets/{workspace-layout-SAp6BtYK.js → workspace-layout-DK8mDzrY.js} +1 -1
- package/static/auth-callback/auth-callback.html +2 -2
- package/static/dashboard/assets/AiConfigContext-BsE7MqX8.js +1 -0
- package/static/dashboard/assets/AiConfigPage-DvM-lRXa.js +1 -0
- package/static/dashboard/assets/DocumentProcessingPanel-BPfdlfuf.js +1 -0
- package/static/dashboard/assets/IndexLifecyclePanel--m0AGxvh.js +1 -0
- package/static/dashboard/assets/{IndexSubjectPanel-DQFPP6-p.js → IndexSubjectPanel-Bb7m1k3d.js} +1 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-BLi_zbMa.js +1 -0
- package/static/dashboard/assets/ModelsPage-CxdpgnfR.js +11 -0
- package/static/dashboard/assets/{NetworkPage-CHQ3YxIB.js → NetworkPage-BAIPw-D_.js} +2 -2
- package/static/dashboard/assets/{PaneListHeader-DsXemAdR.js → PaneListHeader-BBCMei0r.js} +1 -1
- package/static/dashboard/assets/SearchIndexingPanel-Ck4Y-xjR.js +1 -0
- package/static/dashboard/assets/{StatusSubjectPanel-D3PGEYT4.js → StatusSubjectPanel-D1KWfAXE.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-BcpePYUW.js → StatusWorkspace-JbA5gzXx.js} +1 -1
- package/static/dashboard/assets/SystemSettingsPage-BbwQWsSR.js +1 -0
- package/static/dashboard/assets/SystemSettingsSubjectPanel-N117nMt5.js +33 -0
- package/static/dashboard/assets/XpodAiConnectionsPodStore-CdDOb4SV.js +18 -0
- package/static/dashboard/assets/{activity-j5zrznu-.js → activity-DX1I96o_.js} +1 -1
- package/static/dashboard/assets/admin-C6qCRFiY.js +1 -0
- package/static/dashboard/assets/ai-connections-DwCRqOQa.js +1 -0
- package/static/dashboard/assets/{badge-CzeBdG7h.js → badge-k2vhtDqH.js} +1 -1
- package/static/dashboard/assets/collection-runtime-BFQ8teQJ.js +1 -0
- package/static/dashboard/assets/{dashboard-D-xANHk1.js → dashboard-DWZ-fmCT.js} +105 -109
- package/static/dashboard/assets/dashboard-rk080mvG.css +1 -0
- package/static/dashboard/assets/dialog-1CCw-iHT.js +1 -0
- package/static/dashboard/assets/{download-IcNdEZWi.js → download-C6-SNY1q.js} +1 -1
- package/static/dashboard/assets/{external-link-DxBxK8Vu.js → external-link-BgPcZ_j2.js} +1 -1
- package/static/dashboard/assets/index-6LcIUIYO.js +1 -0
- package/static/dashboard/assets/index-D7A8U6Pt.js +41 -0
- package/static/dashboard/assets/index-UD6QOE7H.js +4 -0
- package/static/dashboard/assets/{key-round-D1K7warM.js → key-round-BOd7Jo0Q.js} +1 -1
- package/static/dashboard/assets/layout-DB3pMyTl.js +1 -0
- package/static/dashboard/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/dashboard/assets/{rotate-ccw-CcN1N6p9.js → rotate-ccw-CCgJqsvx.js} +1 -1
- package/static/dashboard/assets/settings-projection-CUkyprDQ.js +1 -0
- package/static/dashboard/assets/{skeleton-CKnmJMUH.js → skeleton-Bc7abAn5.js} +1 -1
- package/static/dashboard/assets/{waypoints-DuZPO_wu.js → waypoints-s-opmJxx.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-BUj3wZ_m.js → workspace-layout-DqIQeTBV.js} +1 -1
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/AiConfigContext-BB9KZySa.js +1 -0
- package/static/settings/assets/AiConfigPage-DGSXUkLs.js +1 -0
- package/static/settings/assets/DocumentProcessingPanel-Da2Re6Rg.js +1 -0
- package/static/settings/assets/IndexLifecyclePanel-BSZuIzgr.js +1 -0
- package/static/settings/assets/{IndexSubjectPanel-73sM16Ma.js → IndexSubjectPanel-CFd0ay-r.js} +1 -1
- package/static/settings/assets/ModelAssignmentsPanel-CSAryvWJ.js +1 -0
- package/static/settings/assets/ModelsPage-BQwCwLHU.js +11 -0
- package/static/settings/assets/{NetworkPage-i6j-M2RY.js → NetworkPage-BKymvsQc.js} +2 -2
- package/static/settings/assets/{PaneListHeader-DpqC0jd5.js → PaneListHeader-Bjh3hRdQ.js} +1 -1
- package/static/settings/assets/SearchIndexingPanel-MjKL5QLU.js +1 -0
- package/static/settings/assets/{StatusSubjectPanel-Dv4q3PGh.js → StatusSubjectPanel-Bvl6K4mx.js} +1 -1
- package/static/settings/assets/StatusWorkspace-B0NzrP--.js +1 -0
- package/static/settings/assets/SystemSettingsPage-D2z6Z4FE.js +1 -0
- package/static/settings/assets/SystemSettingsSubjectPanel-4sxma4X4.js +33 -0
- package/static/settings/assets/XpodAiConnectionsPodStore-BkNQ8fZx.js +3 -0
- package/static/settings/assets/{activity-DaFkk8f3.js → activity-CgJJGpjx.js} +1 -1
- package/static/settings/assets/admin-C6qCRFiY.js +1 -0
- package/static/settings/assets/ai-connections-CryuHGKW.js +1 -0
- package/static/settings/assets/{badge-d5SHdc-x.js → badge-C4NypVyT.js} +1 -1
- package/static/settings/assets/collection-runtime-CTLCDxAi.js +1 -0
- package/static/settings/assets/dialog-Csq0vWUi.js +1 -0
- package/static/settings/assets/{download-CpkwomDr.js → download-DaLJJ-Wp.js} +1 -1
- package/static/settings/assets/{external-link-_4YT42Mf.js → external-link--w_iW5Au.js} +1 -1
- package/static/settings/assets/index-B0mQa59b.js +4 -0
- package/static/settings/assets/index-BukHiu4y.js +1 -0
- package/static/settings/assets/index-COmVnZi2.js +41 -0
- package/static/settings/assets/{index-browser-B06xjBdZ.js → index-browser-BGpvHwD0.js} +1 -1
- package/static/settings/assets/{key-round-Dlqmp1Kq.js → key-round-Bk4YRjBu.js} +1 -1
- package/static/settings/assets/layout-DB3pMyTl.js +1 -0
- package/static/settings/assets/pod-collections-host-KnnGFZHL.js +8 -0
- package/static/settings/assets/{rotate-ccw-TAY65xWT.js → rotate-ccw-TCabbqsr.js} +1 -1
- package/static/settings/assets/{settings-ExBXGgbj.js → settings-CJWpdbNC.js} +105 -109
- package/static/settings/assets/settings-projection-CUkyprDQ.js +1 -0
- package/static/settings/assets/settings-rk080mvG.css +1 -0
- package/static/settings/assets/{skeleton-DKIWjNr9.js → skeleton-JDHYVe7t.js} +1 -1
- package/static/settings/assets/{waypoints-9erLIxyR.js → waypoints-DDvEl-MU.js} +1 -1
- package/static/settings/assets/{workspace-layout-CYXfYIa3.js → workspace-layout-DV5QU30U.js} +1 -1
- package/static/settings/settings.html +2 -2
- package/node_modules/@undefineds.co/shared-ui/dist/oidc-consent.d.ts +0 -54
- package/node_modules/@undefineds.co/shared-ui/dist/oidc-consent.js +0 -21
- package/static/auth-callback/assets/AiConfigContext-C81deMM9.js +0 -1
- package/static/auth-callback/assets/AiConfigPage-evWI8T56.js +0 -1
- package/static/auth-callback/assets/DocumentProcessingPanel-B9GrDEMe.js +0 -1
- package/static/auth-callback/assets/IndexLifecyclePanel-qCo8ABQZ.js +0 -1
- package/static/auth-callback/assets/ModelAssignmentsPanel-DG7Lxh3t.js +0 -1
- package/static/auth-callback/assets/ModelsPage-CgEuqE6p.js +0 -10
- package/static/auth-callback/assets/SearchIndexingPanel-ByU3u7kp.js +0 -1
- package/static/auth-callback/assets/StatusWorkspace-BZd617sV.js +0 -1
- package/static/auth-callback/assets/SystemSettingsPage-BirzWAQM.js +0 -1
- package/static/auth-callback/assets/SystemSettingsSubjectPanel-CmsVWNCx.js +0 -31
- package/static/auth-callback/assets/admin-BU4m6Ko2.js +0 -1
- package/static/auth-callback/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/auth-callback/assets/auth-callback-C_7MUXJb.css +0 -1
- package/static/auth-callback/assets/index-BpV1hsqs.js +0 -4
- package/static/auth-callback/assets/index-D9oE6FXK.js +0 -41
- package/static/dashboard/assets/AiConfigContext-De-OtAWo.js +0 -1
- package/static/dashboard/assets/AiConfigPage-macP4Mop.js +0 -1
- package/static/dashboard/assets/DocumentProcessingPanel-C5ObvCCl.js +0 -1
- package/static/dashboard/assets/IndexLifecyclePanel-xVNa2l40.js +0 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-DMOATFpQ.js +0 -1
- package/static/dashboard/assets/ModelsPage-91UbnETA.js +0 -25
- package/static/dashboard/assets/SearchIndexingPanel-Dh70PNFZ.js +0 -1
- package/static/dashboard/assets/SystemSettingsPage-BiN5GcKx.js +0 -1
- package/static/dashboard/assets/SystemSettingsSubjectPanel-B9QrSiFp.js +0 -31
- package/static/dashboard/assets/admin-BU4m6Ko2.js +0 -1
- package/static/dashboard/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/dashboard/assets/dashboard-C_7MUXJb.css +0 -1
- package/static/dashboard/assets/index-FWZ-s52O.js +0 -41
- package/static/dashboard/assets/index-ZiQZ96oC.js +0 -4
- package/static/settings/assets/AiConfigContext-C0cQMPfG.js +0 -1
- package/static/settings/assets/AiConfigPage-CPhB4iFb.js +0 -1
- package/static/settings/assets/DocumentProcessingPanel-sYI7OpuH.js +0 -1
- package/static/settings/assets/IndexLifecyclePanel-yj8iyiT8.js +0 -1
- package/static/settings/assets/ModelAssignmentsPanel-BFIgUX5v.js +0 -1
- package/static/settings/assets/ModelsPage-BdppXl7E.js +0 -10
- package/static/settings/assets/SearchIndexingPanel-BlPnrkT3.js +0 -1
- package/static/settings/assets/SystemSettingsPage-CiOm2NzV.js +0 -1
- package/static/settings/assets/SystemSettingsSubjectPanel-Cd-GECon.js +0 -31
- package/static/settings/assets/admin-BU4m6Ko2.js +0 -1
- package/static/settings/assets/ai-connections-CHNTKemd.js +0 -1
- package/static/settings/assets/index-BFi9yn7_.js +0 -41
- package/static/settings/assets/index-BGgEhIUy.js +0 -4
- package/static/settings/assets/settings-C_7MUXJb.css +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{a0 as xe,a1 as Nu,a2 as It,a3 as nt,a4 as wt,a5 as it,a6 as xu,k as pe,a7 as Xe,h as Ma,a8 as Zl}from"./dashboard-DWZ-fmCT.js";import{QueryEngine as ef}from"@comunica/query-sparql-solid";import{b as Cu,s as On,d as Bn,c as Mn,o as La,p as tf,e as Un,f as rf,C as Ln}from"./ai-connections-DwCRqOQa.js";function nf(e){const t=new TextEncoder().encode(JSON.stringify(e));let r="";for(const n of t)r+=String.fromCharCode(n);return btoa(r)}function of(e){const t=atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return JSON.parse(new TextDecoder().decode(r))}function af(e){return JSON.stringify({algorithm:"PLAINTEXT",encoding:"base64",ciphertext:nf(e.secret),webId:e.webId,credentialIri:e.credentialIri,provider:e.provider})}function sf(e){if(!(typeof e.envelope!="string"||!e.envelope.trim()))try{const t=JSON.parse(e.envelope);if(t.algorithm!=="PLAINTEXT"||t.webId!==e.webId||t.provider!==e.provider||t.credentialIri!==e.credentialIri)return;const r=t.encoding==="base64"?of(String(t.ciphertext)):JSON.parse(String(t.ciphertext));return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:void 0}catch{return}}function uf(e){return xe.buildId({id:e})}function lf(e){return xe.buildId({id:`custom-instance-${encodeURIComponent(e)}.ttl#this`})}function Da(e,t){const r=crypto.randomUUID();return t==="local"?`${e}-local-${r}`:`${e}-${r}`}function _d(e){const t=(e.split("#",1)[0]??e).split("/").filter(Boolean).at(-1)??"",r=t.endsWith(".ttl")?t.slice(0,-4):t;if(r)return r.startsWith("custom-")||r==="custom"?"custom":Cu.find(n=>r===n||r.startsWith(`${n}-`))}function nr(e){if(!e)return;const t=e.split("#",1)[0]??e,r=t.split("/").filter(Boolean).at(-1)??t;if(!r)return;const n=r.endsWith(".ttl")?r:`${r}.ttl`,i=e.indexOf("#");return i<0?n:`${n}${e.slice(i)}`}function Lt(e){const t=nr(e);if(t)return(t.split("#",1)[0]??t).replace(/\.ttl$/u,"")}var Ht={},kr={},Vt={},Gt={};var Kn="@@__IMMUTABLE_INDEXED__@@";function tt(e){return!!(e&&e[Kn])}var Hn="@@__IMMUTABLE_KEYED__@@";function Ae(e){return!!(e&&e[Hn])}function Qn(e){return Ae(e)||tt(e)}var ku="@@__IMMUTABLE_ITERABLE__@@";function rt(e){return!!(e&&e[ku])}var $e=function(t){return rt(t)?t:Be(t)},dt=(function(e){function t(r){return Ae(r)?r:$t(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})($e),ir=(function(e){function t(r){return tt(r)?r:pt(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})($e),wr=(function(e){function t(r){return rt(r)&&!Qn(r)?r:Er(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})($e);$e.Keyed=dt;$e.Indexed=ir;$e.Set=wr;var Sr=0,lt=1,ft=2,Ro=typeof Symbol=="function"&&Symbol.iterator,$u="@@iterator",Jn=Ro||$u,_e=function(t){this.next=t};_e.prototype.toString=function(){return"[Iterator]"};_e.KEYS=Sr;_e.VALUES=lt;_e.ENTRIES=ft;_e.prototype.inspect=_e.prototype.toSource=function(){return this.toString()};_e.prototype[Jn]=function(){return this};function Te(e,t,r,n){var i=e===Sr?t:e===lt?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function Fe(){return{value:void 0,done:!0}}function $o(e){return Array.isArray(e)?!0:!!Xn(e)}function Pa(e){return!!(e&&typeof e.next=="function")}function Io(e){var t=Xn(e);return t&&t.call(e)}function Xn(e){var t=e&&(Ro&&e[Ro]||e[$u]);if(typeof t=="function")return t}function ff(e){var t=Xn(e);return t&&t===e.entries}function cf(e){var t=Xn(e);return t&&t===e.keys}var pn="delete",Ee=5,ut=1<<Ee,Ge=ut-1,he={};function To(){return{value:!1}}function ct(e){e&&(e.value=!0)}function qo(){}function cr(e){return e.size===void 0&&(e.size=e.__iterate(qu)),e.size}function Pt(e,t){if(typeof t!="number"){var r=t>>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?cr(e)+t:t}function qu(){return!0}function _n(e,t,r){return(e===0&&!Wu(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function mr(e,t){return ju(e,t,0)}function yn(e,t){return ju(e,t,t)}function ju(e,t,r){return e===void 0?r:Wu(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function Wu(e){return e<0||e===0&&1/e===-1/0}var Fu="@@__IMMUTABLE_RECORD__@@";function kt(e){return!!(e&&e[Fu])}function ht(e){return rt(e)||kt(e)}var Nt="@@__IMMUTABLE_ORDERED__@@";function yt(e){return!!(e&&e[Nt])}var Bu="@@__IMMUTABLE_SEQ__@@";function Zn(e){return!!(e&&e[Bu])}var vr=Object.prototype.hasOwnProperty;function jo(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var Be=(function(e){function t(r){return r==null?Fo():ht(r)?r.toSeq():hf(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,i){var o=this._cache;if(o){for(var a=o.length,s=0;s!==a;){var d=o[i?a-++s:s++];if(n(d[1],d[0],this)===!1)break}return s}return this.__iterateUncached(n,i)},t.prototype.__iterator=function(n,i){var o=this._cache;if(o){var a=o.length,s=0;return new _e(function(){if(s===a)return Fe();var d=o[i?a-++s:s++];return Te(n,d[0],d[1])})}return this.__iteratorUncached(n,i)},t})($e),$t=(function(e){function t(r){return r==null?Fo().toKeyedSeq():rt(r)?Ae(r)?r.toSeq():r.fromEntrySeq():kt(r)?r.toSeq():Bo(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t})(Be),pt=(function(e){function t(r){return r==null?Fo():rt(r)?Ae(r)?r.entrySeq():r.toIndexedSeq():kt(r)?r.toSeq().entrySeq():zu(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t})(Be),Er=(function(e){function t(r){return(rt(r)&&!Qn(r)?r:pt(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t})(Be);Be.isSeq=Zn;Be.Keyed=$t;Be.Set=Er;Be.Indexed=pt;Be.prototype[Bu]=!0;var dr=(function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this.has(n)?this._array[Pt(this,n)]:i},t.prototype.__iterate=function(n,i){for(var o=this._array,a=o.length,s=0;s!==a;){var d=i?a-++s:s++;if(n(o[d],d,this)===!1)break}return s},t.prototype.__iterator=function(n,i){var o=this._array,a=o.length,s=0;return new _e(function(){if(s===a)return Fe();var d=i?a-++s:s++;return Te(n,d,o[d])})},t})(pt),Wo=(function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return i!==void 0&&!this.has(n)?i:this._object[n]},t.prototype.has=function(n){return vr.call(this._object,n)},t.prototype.__iterate=function(n,i){for(var o=this._object,a=this._keys,s=a.length,d=0;d!==s;){var h=a[i?s-++d:d++];if(n(o[h],h,this)===!1)break}return d},t.prototype.__iterator=function(n,i){var o=this._object,a=this._keys,s=a.length,d=0;return new _e(function(){if(d===s)return Fe();var h=a[i?s-++d:d++];return Te(n,h,o[h])})},t})($t);Wo.prototype[Nt]=!0;var df=(function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(i)return this.cacheResult().__iterate(n,i);var o=this._collection,a=Io(o),s=0;if(Pa(a))for(var d;!(d=a.next()).done&&n(d.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=this._collection,a=Io(o);if(!Pa(a))return new _e(Fe);var s=0;return new _e(function(){var d=a.next();return d.done?d:Te(n,s++,d.value)})},t})(pt),Na;function Fo(){return Na||(Na=new dr([]))}function Bo(e){var t=zo(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new Wo(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function zu(e){var t=zo(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function hf(e){var t=zo(e);if(t)return ff(e)?t.fromEntrySeq():cf(e)?t.toSetSeq():t;if(typeof e=="object")return new Wo(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function zo(e){return jo(e)?new dr(e):$o(e)?new df(e):void 0}function bn(){return this.__ensureOwner()}function gn(){return this.__ownerID?this:this.__ensureOwner(new qo)}var $r=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,i=r&65535;return n*i+((t>>>16)*i+n*(r>>>16)<<16>>>0)|0};function ei(e){return e>>>1&1073741824|e&3221225471}var pf=Object.prototype.valueOf;function Ve(e){if(e==null)return xa(e);if(typeof e.hashCode=="function")return ei(e.hashCode(e));var t=mf(e);if(t==null)return xa(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return _f(t);case"string":return t.length>vf?yf(t):Oo(t);case"object":case"function":return wf(t);case"symbol":return gf(t);default:if(typeof t.toString=="function")return Oo(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function xa(e){return e===null?1108378658:1108378659}function _f(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return ei(t)}function yf(e){var t=vi[e];return t===void 0&&(t=Oo(e),mi===Ef&&(mi=0,vi={}),mi++,vi[e]=t),t}function Oo(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return ei(t)}var bf=(Math.random()*1048576|1)%1048576||40503;function Uo(e){if(typeof e!="string")return Ve(e);for(var t=0,r=0;r<e.length;r++)t=bf*t+e.charCodeAt(r)|0;return t}function gf(e){var t=$a[e];return t!==void 0||(t=Uu(),$a[e]=t),t}function wf(e){var t;if(Mo&&(t=Lo.get(e),t!==void 0)||(t=e[er],t!==void 0)||!ka&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[er],t!==void 0||(t=Sf(e),t!==void 0)))return t;if(t=Uu(),Mo)Lo.set(e,t);else{if(Ca!==void 0&&Ca(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(ka)Object.defineProperty(e,er,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[er]=t;else if(e.nodeType!==void 0)e[er]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}var Ca=Object.isExtensible,ka=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();function Sf(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function mf(e){return e.valueOf!==pf&&typeof e.valueOf=="function"?e.valueOf(e):e}function Uu(){var e=++Si;return Si&1073741824&&(Si=0),e}var Mo=typeof WeakMap=="function",Lo;Mo&&(Lo=new WeakMap);var $a=Object.create(null),Si=0,er="__immutablehash__";typeof Symbol=="function"&&(er=Symbol(er));var vf=16,Ef=255,mi=0,vi={},ti=(function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this._iter.get(n,i)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,i=Ko(this,!0);return this._useKeys||(i.valueSeq=function(){return n._iter.toSeq().reverse()}),i},t.prototype.map=function(n,i){var o=this,a=Yu(this,n,i);return this._useKeys||(a.valueSeq=function(){return o._iter.toSeq().map(n,i)}),a},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a,s){return n(a,s,o)},i)},t.prototype.__iterator=function(n,i){return this._iter.__iterator(n,i)},t})($t);ti.prototype[Nt]=!0;var Ku=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var o=this,a=0;return i&&cr(this),this._iter.__iterate(function(s){return n(s,i?o.size-++a:a++,o)},i)},t.prototype.__iterator=function(n,i){var o=this,a=this._iter.__iterator(lt,i),s=0;return i&&cr(this),new _e(function(){var d=a.next();return d.done?d:Te(n,i?o.size-++s:s++,d.value,d)})},t})(pt),Hu=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a){return n(a,a,o)},i)},t.prototype.__iterator=function(n,i){var o=this._iter.__iterator(lt,i);return new _e(function(){var a=o.next();return a.done?a:Te(n,a.value,a.value,a)})},t})(Er),Vu=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a){if(a){ja(a);var s=rt(a);return n(s?a.get(1):a[1],s?a.get(0):a[0],o)}},i)},t.prototype.__iterator=function(n,i){var o=this._iter.__iterator(lt,i);return new _e(function(){for(;;){var a=o.next();if(a.done)return a;var s=a.value;if(s){ja(s);var d=rt(s);return Te(n,d?s.get(0):s[0],d?s.get(1):s[1],a)}}})},t})($t);Ku.prototype.cacheResult=ti.prototype.cacheResult=Hu.prototype.cacheResult=Vu.prototype.cacheResult=Go;function Gu(e){var t=mt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=Go,t.__iterateUncached=function(r,n){var i=this;return e.__iterate(function(o,a){return r(a,o,i)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===ft){var i=e.__iterator(r,n);return new _e(function(){var o=i.next();if(!o.done){var a=o.value[0];o.value[0]=o.value[1],o.value[1]=a}return o})}return e.__iterator(r===lt?Sr:lt,n)},t}function Yu(e,t,r){var n=mt(e);return n.size=e.size,n.has=function(i){return e.has(i)},n.get=function(i,o){var a=e.get(i,he);return a===he?o:t.call(r,a,i,e)},n.__iterateUncached=function(i,o){var a=this;return e.__iterate(function(s,d,h){return i(t.call(r,s,d,h),d,a)!==!1},o)},n.__iteratorUncached=function(i,o){var a=e.__iterator(ft,o);return new _e(function(){var s=a.next();if(s.done)return s;var d=s.value,h=d[0];return Te(i,h,t.call(r,d[1],h,e),s)})},n}function Ko(e,t){var r=mt(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var n=Gu(e);return n.reverse=function(){return e.flip()},n}),r.get=function(n,i){return e.get(t?n:-1-n,i)},r.has=function(n){return e.has(t?n:-1-n)},r.includes=function(n){return e.includes(n)},r.cacheResult=Go,r.__iterate=function(n,i){var o=this,a=0;return i&&cr(e),e.__iterate(function(s,d){return n(s,t?d:i?o.size-++a:a++,o)},!i)},r.__iterator=function(n,i){var o=0;i&&cr(e);var a=e.__iterator(ft,!i);return new _e(function(){var s=a.next();if(s.done)return s;var d=s.value;return Te(n,t?d[0]:i?r.size-++o:o++,d[1],s)})},r}function Qu(e,t,r,n){var i=mt(e);return n&&(i.has=function(o){var a=e.get(o,he);return a!==he&&!!t.call(r,a,o,e)},i.get=function(o,a){var s=e.get(o,he);return s!==he&&t.call(r,s,o,e)?s:a}),i.__iterateUncached=function(o,a){var s=this,d=0;return e.__iterate(function(h,_,g){if(t.call(r,h,_,g))return d++,o(h,n?_:d-1,s)},a),d},i.__iteratorUncached=function(o,a){var s=e.__iterator(ft,a),d=0;return new _e(function(){for(;;){var h=s.next();if(h.done)return h;var _=h.value,g=_[0],v=_[1];if(t.call(r,v,g,e))return Te(o,n?g:d++,v,h)}})},i}function Af(e,t,r){var n=or().asMutable();return e.__iterate(function(i,o){n.update(t.call(r,i,o,e),0,function(a){return a+1})}),n.asImmutable()}function Rf(e,t,r){var n=Ae(e),i=(yt(e)?St():or()).asMutable();e.__iterate(function(a,s){i.update(t.call(r,a,s,e),function(d){return d=d||[],d.push(n?[s,a]:a),d})});var o=Vo(e);return i.map(function(a){return ve(e,o(a))}).asImmutable()}function If(e,t,r){var n=Ae(e),i=[[],[]];e.__iterate(function(a,s){i[t.call(r,a,s,e)?1:0].push(n?[s,a]:a)});var o=Vo(e);return i.map(function(a){return ve(e,o(a))})}function Ho(e,t,r,n){var i=e.size;if(_n(t,r,i))return e;if(typeof i>"u"&&(t<0||r<0))return Ho(e.toSeq().cacheResult(),t,r,n);var o=mr(t,i),a=yn(r,i),s=a-o,d;s===s&&(d=s<0?0:s);var h=mt(e);return h.size=d===0?d:e.size&&d||void 0,!n&&Zn(e)&&d>=0&&(h.get=function(_,g){return _=Pt(this,_),_>=0&&_<d?e.get(_+o,g):g}),h.__iterateUncached=function(_,g){var v=this;if(d===0)return 0;if(g)return this.cacheResult().__iterate(_,g);var x=0,q=!0,A=0;return e.__iterate(function(w,M){if(!(q&&(q=x++<o)))return A++,_(w,n?M:A-1,v)!==!1&&A!==d}),A},h.__iteratorUncached=function(_,g){if(d!==0&&g)return this.cacheResult().__iterator(_,g);if(d===0)return new _e(Fe);var v=e.__iterator(_,g),x=0,q=0;return new _e(function(){for(;x++<o;)v.next();if(++q>d)return Fe();var A=v.next();return n||_===lt||A.done?A:_===Sr?Te(_,q-1,void 0,A):Te(_,q-1,A.value[1],A)})},h}function Tf(e,t,r){var n=mt(e);return n.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=0;return e.__iterate(function(d,h,_){return t.call(r,d,h,_)&&++s&&i(d,h,a)}),s},n.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(ft,o),d=!0;return new _e(function(){if(!d)return Fe();var h=s.next();if(h.done)return h;var _=h.value,g=_[0],v=_[1];return t.call(r,v,g,a)?i===ft?h:Te(i,g,v,h):(d=!1,Fe())})},n}function Ju(e,t,r,n){var i=mt(e);return i.__iterateUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterate(o,a);var d=!0,h=0;return e.__iterate(function(_,g,v){if(!(d&&(d=t.call(r,_,g,v))))return h++,o(_,n?g:h-1,s)}),h},i.__iteratorUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterator(o,a);var d=e.__iterator(ft,a),h=!0,_=0;return new _e(function(){var g,v,x;do{if(g=d.next(),g.done)return n||o===lt?g:o===Sr?Te(o,_++,void 0,g):Te(o,_++,g.value[1],g);var q=g.value;v=q[0],x=q[1],h&&(h=t.call(r,x,v,s))}while(h);return o===ft?g:Te(o,v,x,g)})},i}var Of=(function(e){function t(r){this._wrappedIterables=r.flatMap(function(n){return n._wrappedIterables?n._wrappedIterables:[n]}),this.size=this._wrappedIterables.reduce(function(n,i){if(n!==void 0){var o=i.size;if(o!==void 0)return n+o}},0),this[Hn]=this._wrappedIterables[0][Hn],this[Kn]=this._wrappedIterables[0][Kn],this[Nt]=this._wrappedIterables[0][Nt]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(this._wrappedIterables.length!==0){if(i)return this.cacheResult().__iterate(n,i);for(var o=0,a=Ae(this),s=a?ft:lt,d=this._wrappedIterables[o].__iterator(s,i),h=!0,_=0;h;){for(var g=d.next();g.done;){if(o++,o===this._wrappedIterables.length)return _;d=this._wrappedIterables[o].__iterator(s,i),g=d.next()}var v=a?n(g.value[1],g.value[0],this):n(g.value,_,this);h=v!==!1,_++}return _}},t.prototype.__iteratorUncached=function(n,i){var o=this;if(this._wrappedIterables.length===0)return new _e(Fe);if(i)return this.cacheResult().__iterator(n,i);var a=0,s=this._wrappedIterables[a].__iterator(n,i);return new _e(function(){for(var d=s.next();d.done;){if(a++,a===o._wrappedIterables.length)return d;s=o._wrappedIterables[a].__iterator(n,i),d=s.next()}return d})},t})(Be);function Mf(e,t){var r=Ae(e),n=[e].concat(t).map(function(o){return rt(o)?r&&(o=dt(o)):o=r?Bo(o):zu(Array.isArray(o)?o:[o]),o}).filter(function(o){return o.size!==0});if(n.length===0)return e;if(n.length===1){var i=n[0];if(i===e||r&&Ae(i)||tt(e)&&tt(i))return i}return new Of(n)}function Xu(e,t,r){var n=mt(e);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;function d(h,_){h.__iterate(function(g,v){return(!t||_<t)&&rt(g)?d(g,_+1):(a++,i(g,r?v:a-1,n)===!1&&(s=!0)),!s},o)}return d(e,0),a},n.__iteratorUncached=function(i,o){if(o)return this.cacheResult().__iterator(i,o);var a=e.__iterator(i,o),s=[],d=0;return new _e(function(){for(;a;){var h=a.next();if(h.done!==!1){a=s.pop();continue}var _=h.value;if(i===ft&&(_=_[1]),(!t||s.length<t)&&rt(_))s.push(a),a=_.__iterator(i,o);else return r?h:Te(i,d++,_,h)}return Fe()})},n}function Lf(e,t,r){var n=Vo(e);return e.toSeq().map(function(i,o){return n(t.call(r,i,o,e))}).flatten(!0)}function Df(e,t){var r=mt(e);return r.size=e.size&&e.size*2-1,r.__iterateUncached=function(n,i){var o=this,a=0;return e.__iterate(function(s){return(!a||n(t,a++,o)!==!1)&&n(s,a++,o)!==!1},i),a},r.__iteratorUncached=function(n,i){var o=e.__iterator(lt,i),a=0,s;return new _e(function(){return(!s||a%2)&&(s=o.next(),s.done)?s:a%2?Te(n,a++,t):Te(n,a++,s.value,s)})},r}function hr(e,t,r){t||(t=Zu);var n=Ae(e),i=0,o=e.toSeq().map(function(a,s){return[s,a,i++,r?r(a,s,e):a]}).valueSeq().toArray();return o.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(n?function(a,s){o[s].length=2}:function(a,s){o[s]=a[1]}),n?$t(o):tt(e)?pt(o):Er(o)}function Dn(e,t,r){if(t||(t=Zu),r){var n=e.toSeq().map(function(i,o){return[i,r(i,o,e)]}).reduce(function(i,o){return qa(t,i[1],o[1])?o:i});return n&&n[0]}return e.reduce(function(i,o){return qa(t,i,o)?o:i})}function qa(e,t,r){var n=e(r,t);return n===0&&r!==t&&(r==null||r!==r)||n>0}function Pn(e,t,r,n){var i=mt(e),o=new dr(r).map(function(a){return a.size});return i.size=n?o.max():o.min(),i.__iterate=function(a,s){for(var d=this.__iterator(lt,s),h,_=0;!(h=d.next()).done&&a(h.value,_++,this)!==!1;);return _},i.__iteratorUncached=function(a,s){var d=r.map(function(g){return g=$e(g),Io(s?g.reverse():g)}),h=0,_=!1;return new _e(function(){var g;return _||(g=d.map(function(v){return v.next()}),_=n?g.every(function(v){return v.done}):g.some(function(v){return v.done})),_?Fe():Te(a,h++,t.apply(null,g.map(function(v){return v.value})))})},i}function ve(e,t){return e===t?e:Zn(e)?t:e.constructor(t)}function ja(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Vo(e){return Ae(e)?dt:tt(e)?ir:wr}function mt(e){return Object.create((Ae(e)?$t:tt(e)?pt:Er).prototype)}function Go(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Be.prototype.cacheResult.call(this)}function Zu(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function Do(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function ke(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(Do(e)&&Do(t)&&e.equals(t))}function Yo(e,t,r,n){return ar(e,[t],r,n)}function el(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return rl(this,e)}function tl(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return rl(this,t,e)}function rl(e,t,r){for(var n=[],i=0;i<t.length;i++){var o=dt(t[i]);o.size!==0&&n.push(o)}return n.length===0?e:e.toSeq().size===0&&!e.__ownerID&&n.length===1?kt(e)?e:e.constructor(n[0]):e.withMutations(function(a){for(var s=r?function(h,_){Yo(a,_,he,function(g){return g===he?h:r(g,h,_)})}:function(h,_){a.set(_,h)},d=0;d<n.length;d++)n[d].forEach(s)})}var Pf=Object.prototype.toString;function Qo(e){if(!e||typeof e!="object"||Pf.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t,n=Object.getPrototypeOf(t);n!==null;)r=n,n=Object.getPrototypeOf(r);return r===t}function xt(e){return typeof e=="object"&&(ht(e)||Array.isArray(e)||Qo(e))}function wn(e){return typeof e=="string"&&(e==="__proto__"||e==="constructor")}function bt(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function Vn(e){if(Array.isArray(e))return bt(e);var t={};for(var r in e)wn(r)||vr.call(e,r)&&(t[r]=e[r]);return t}function Nf(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return mn(e,t)}function xf(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return mn(t,r,e)}function Cf(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Sn(e,t)}function kf(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Sn(t,r,e)}function Sn(e,t,r){return mn(e,t,$f(r))}function mn(e,t,r){if(!xt(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(ht(e))return typeof r=="function"&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,o=n?ir:dt,a=n?function(d){i===e&&(i=Vn(i)),i.push(d)}:function(d,h){if(!wn(h)){var _=vr.call(i,h),g=_&&r?r(i[h],d,h):d;(!_||g!==i[h])&&(i===e&&(i=Vn(i)),i[h]=g)}},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function $f(e){function t(r,n,i){return xt(r)&&xt(n)&&qf(r,n)?mn(r,[n],t):e?e(r,n,i):n}return t}function qf(e,t){var r=Be(e),n=Be(t);return tt(r)===tt(n)&&Ae(r)===Ae(n)}function nl(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Sn(this,e)}function il(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Sn(this,t,e)}function Jo(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ar(this,e,gt(),function(n){return Sn(n,t)})}function Xo(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ar(this,e,gt(),function(n){return mn(n,t)})}function ol(e,t,r){return ar(e,t,he,function(){return r})}function Zo(e,t){return ol(this,e,t)}function ea(e,t,r){return arguments.length===1?e(this):Yo(this,e,t,r)}function ta(e,t,r){return ar(this,e,t,r)}function ra(){return this.__altered}function vn(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}var al="@@__IMMUTABLE_MAP__@@";function ri(e){return!!(e&&e[al])}function an(e,t){if(!e)throw new Error(t)}function st(e){an(e!==1/0,"Cannot perform this action with an infinite size.")}var or=(function(e){function t(r){return r==null?gt():ri(r)&&!yt(r)?r:gt().withMutations(function(n){var i=e(r);st(i.size),i.forEach(function(o,a){return n.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,i){return this._root?this._root.get(0,void 0,n,i):i},t.prototype.set=function(n,i){return Ba(this,n,i)},t.prototype.remove=function(n){return Ba(this,n,he)},t.prototype.deleteAll=function(n){var i=$e(n);return i.size===0?this:this.withMutations(function(o){i.forEach(function(a){return o.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):gt()},t.prototype.sort=function(n){return St(hr(this,n))},t.prototype.sortBy=function(n,i){return St(hr(this,i,n))},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(a){a.forEach(function(s,d){a.set(d,n.call(i,s,d,o))})})},t.prototype.__iterator=function(n,i){return new jf(this,n,i)},t.prototype.__iterate=function(n,i){var o=this,a=0;return this._root&&this._root.iterate(function(s){return a++,n(s[1],s[0],o)},i),a},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?na(this.size,this._root,n,this.__hash):this.size===0?gt():(this.__ownerID=n,this.__altered=!1,this)},t})(dt);or.isMap=ri;var Oe=or.prototype;Oe[al]=!0;Oe[pn]=Oe.remove;Oe.removeAll=Oe.deleteAll;Oe.setIn=Zo;Oe.removeIn=Oe.deleteIn=sa;Oe.update=ea;Oe.updateIn=ta;Oe.merge=Oe.concat=el;Oe.mergeWith=tl;Oe.mergeDeep=nl;Oe.mergeDeepWith=il;Oe.mergeIn=Xo;Oe.mergeDeepIn=Jo;Oe.withMutations=vn;Oe.wasAltered=ra;Oe.asImmutable=bn;Oe["@@transducer/init"]=Oe.asMutable=gn;Oe["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Oe["@@transducer/result"]=function(e){return e.asImmutable()};var un=function(t,r){this.ownerID=t,this.entries=r};un.prototype.get=function(t,r,n,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(ke(n,o[a][0]))return o[a][1];return i};un.prototype.update=function(t,r,n,i,o,a,s){for(var d=o===he,h=this.entries,_=0,g=h.length;_<g&&!ke(i,h[_][0]);_++);var v=_<g;if(v?h[_][1]===o:d)return this;if(ct(s),(d||!v)&&ct(a),!(d&&h.length===1)){if(!v&&!d&&h.length>=Kf)return Wf(t,h,i,o);var x=t&&t===this.ownerID,q=x?h:bt(h);return v?d?_===g-1?q.pop():q[_]=q.pop():q[_]=[i,o]:q.push([i,o]),x?(this.entries=q,this):new un(t,q)}};var pr=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};pr.prototype.get=function(t,r,n,i){r===void 0&&(r=Ve(n));var o=1<<((t===0?r:r>>>t)&Ge),a=this.bitmap;return(a&o)===0?i:this.nodes[sl(a&o-1)].get(t+Ee,r,n,i)};pr.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=Ve(i));var d=(r===0?n:n>>>r)&Ge,h=1<<d,_=this.bitmap,g=(_&h)!==0;if(!g&&o===he)return this;var v=sl(_&h-1),x=this.nodes,q=g?x[v]:void 0,A=ia(q,t,r+Ee,n,i,o,a,s);if(A===q)return this;if(!g&&A&&x.length>=Hf)return Bf(t,x,_,d,A);if(g&&!A&&x.length===2&&za(x[v^1]))return x[v^1];if(g&&A&&x.length===1&&za(A))return A;var w=t&&t===this.ownerID,M=g?A?_:_^h:_|h,E=g?A?ul(x,v,A,w):Uf(x,v,w):zf(x,v,A,w);return w?(this.bitmap=M,this.nodes=E,this):new pr(t,M,E)};var ln=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};ln.prototype.get=function(t,r,n,i){r===void 0&&(r=Ve(n));var o=(t===0?r:r>>>t)&Ge,a=this.nodes[o];return a?a.get(t+Ee,r,n,i):i};ln.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=Ve(i));var d=(r===0?n:n>>>r)&Ge,h=o===he,_=this.nodes,g=_[d];if(h&&!g)return this;var v=ia(g,t,r+Ee,n,i,o,a,s);if(v===g)return this;var x=this.count;if(!g)x++;else if(!v&&(x--,x<Vf))return Ff(t,_,x,d);var q=t&&t===this.ownerID,A=ul(_,d,v,q);return q?(this.count=x,this.nodes=A,this):new ln(t,x,A)};var Ct=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entries=n,this._index=void 0};Ct.prototype._positionOf=function(t,r){var n=this.entries,i=this._index;if(i===void 0&&r&&n.length>=Gf&&(i=this._buildIndex()),i!==void 0){var o=i[Uo(t)];if(o!==void 0)for(var a=0;a<o.length;a++){var s=o[a];if(ke(t,n[s][0]))return s}return-1}for(var d=0,h=n.length;d<h;d++)if(ke(t,n[d][0]))return d;return-1};Ct.prototype._buildIndex=function(){for(var t=Object.create(null),r=this.entries,n=0,i=r.length;n<i;n++){var o=Uo(r[n][0]),a=t[o];a!==void 0?a.push(n):t[o]=[n]}return this._index=t,t};Ct.prototype.get=function(t,r,n,i){var o=this._positionOf(n,!0);return o===-1?i:this.entries[o][1]};Ct.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=Ve(i));var d=o===he;if(n!==this.keyHash)return d?this:(ct(s),ct(a),oa(this,t,r,n,[i,o]));var h=this.entries,_=h.length,g=t&&t===this.ownerID,v=this._positionOf(i,g),x=v===-1?_:v,q=v!==-1;if(q?h[x][1]===o:d)return this;if(ct(s),(d||!q)&&ct(a),d&&_===2)return new Et(t,this.keyHash,h[x^1]);var A=g?h:bt(h);if(q)d?(x===_-1?A.pop():A[x]=A.pop(),g&&(this._index=void 0)):A[x]=[i,o];else if(A.push([i,o]),g&&this._index!==void 0){var w=Uo(i),M=this._index[w];M!==void 0?M.push(_):this._index[w]=[_]}return g?(this.entries=A,this):new Ct(t,this.keyHash,A)};var Et=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entry=n};Et.prototype.get=function(t,r,n,i){return ke(n,this.entry[0])?this.entry[1]:i};Et.prototype.update=function(t,r,n,i,o,a,s){var d=o===he,h=ke(i,this.entry[0]);if(h?o===this.entry[1]:d)return this;if(ct(s),d){ct(a);return}return h?t&&t===this.ownerID?(this.entry[1]=o,this):new Et(t,this.keyHash,[i,o]):(ct(a),oa(this,t,r,Ve(i),[i,o]))};un.prototype.iterate=Ct.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(e(r[t?i-n:n])===!1)return!1};pr.prototype.iterate=ln.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&o.iterate(e,t)===!1)return!1}};Et.prototype.iterate=function(e,t){return e(this.entry)};var jf=(function(e){function t(r,n,i){this._type=n,this._reverse=i,this._stack=r._root&&Wa(r._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var n=this._type,i=this._stack;i;){var o=i.node,a=i.index++,s=void 0;if(o.entry){if(a===0)return Ei(n,o.entry)}else if(o.entries){if(s=o.entries.length-1,a<=s)return Ei(n,o.entries[this._reverse?s-a:a])}else if(s=o.nodes.length-1,a<=s){var d=o.nodes[this._reverse?s-a:a];if(d){if(d.entry)return Ei(n,d.entry);i=this._stack=Wa(d,i)}continue}i=this._stack=this._stack.__prev}return Fe()},t})(_e);function Ei(e,t){return Te(e,t[0],t[1])}function Wa(e,t){return{node:e,index:0,__prev:t}}function na(e,t,r,n){var i=Object.create(Oe);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Fa;function gt(){return Fa||(Fa=na(0))}function Ba(e,t,r){var n,i;if(e._root){var o=To(),a=To();if(n=ia(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===he?-1:1:0)}else{if(r===he)return e;i=1,n=new un(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?na(i,n):gt()}function ia(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===he?e:(ct(s),ct(a),new Et(t,n,[i,o]))}function za(e){return e.constructor===Et||e.constructor===Ct}function oa(e,t,r,n,i){if(e.keyHash===n)return new Ct(t,n,[e.entry,i]);var o=(r===0?e.keyHash:e.keyHash>>>r)&Ge,a=(r===0?n:n>>>r)&Ge,s,d=o===a?[oa(e,t,r+Ee,n,i)]:(s=new Et(t,n,i),o<a?[e,s]:[s,e]);return new pr(t,1<<o|1<<a,d)}function Wf(e,t,r,n){e||(e=new qo);for(var i=new Et(e,Ve(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function Ff(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,d=1,h=t.length;s<h;s++,d<<=1){var _=t[s];_!==void 0&&s!==n&&(i|=d,a[o++]=_)}return new pr(e,i,a)}function Bf(e,t,r,n,i){for(var o=0,a=new Array(ut),s=0;r!==0;s++,r>>>=1)a[s]=r&1?t[o++]:void 0;return a[n]=i,new ln(e,o+1,a)}function sl(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function ul(e,t,r,n){var i=n?e:bt(e);return i[t]=r,i}function zf(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}function Uf(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}var Kf=ut/4,Hf=ut/2,Vf=ut/4,Gf=16;function ll(e){if(jo(e)&&typeof e!="string")return e;if(yt(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}function fn(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function fl(e,t){return ht(e)?e.has(t):xt(e)&&vr.call(e,t)}function aa(e,t,r){return ht(e)?e.get(t,r):fl(e,t)?typeof e.get=="function"?e.get(t):e[t]:r}function cl(e,t){if(!xt(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(ht(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!vr.call(e,t))return e;var r=Vn(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function dl(e,t,r){if(wn(t))return e;if(!xt(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(ht(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(vr.call(e,t)&&r===e[t])return e;var n=Vn(e);return n[t]=r,n}function ar(e,t,r,n){n||(n=r,r=void 0);var i=hl(ht(e),e,ll(t),0,r,n);return i===he?r:i}function hl(e,t,r,n,i,o){var a=t===he;if(n===r.length){var s=a?i:t,d=o(s);return d===s?t:d}if(!a&&!xt(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(fn)+"]: "+t);var h=r[n],_=a?he:aa(t,h,he),g=hl(_===he?e:ht(_),_,r,n+1,i,o);return g===_?t:g===he?cl(t,h):dl(a?e?gt():{}:t,h,g)}function pl(e,t){return ar(e,t,function(){return he})}function sa(e){return pl(this,e)}var _l="@@__IMMUTABLE_LIST__@@";function ua(e){return!!(e&&e[_l])}var En=(function(e){function t(r){var n=zn();if(r==null)return n;if(ua(r))return r;var i=e(r),o=i.size;return o===0?n:(st(o),o>0&&o<ut?cn(0,o,Ee,void 0,new Dt(i.toArray())):n.withMutations(function(a){a.setSize(o),i.forEach(function(s,d){return a.set(d,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(n,i){if(n=Pt(this,n),n>=0&&n<this.size){n+=this._origin;var o=yl(this,n);return o&&o.array[n&Ge]}return i},t.prototype.set=function(n,i){return Yf(this,n,i)},t.prototype.remove=function(n){return this.has(n)?n===0?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,i){return this.splice(n,0,i)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Ee,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):zn()},t.prototype.push=function(){var n=arguments,i=this.size;return this.withMutations(function(o){Mt(o,0,i+n.length);for(var a=0;a<n.length;a++)o.set(i+a,n[a])})},t.prototype.pop=function(){return Mt(this,0,-1)},t.prototype.unshift=function(){var n=arguments;return this.withMutations(function(i){Mt(i,-n.length);for(var o=0;o<n.length;o++)i.set(o,n[o])})},t.prototype.shift=function(){return Mt(this,1)},t.prototype.shuffle=function(n){return n===void 0&&(n=Math.random),this.withMutations(function(i){for(var o=i.size,a,s;o;)a=Math.floor(n()*o--),s=i.get(a),i.set(a,i.get(o)),i.set(o,s)})},t.prototype.concat=function(){for(var n=arguments,i=[],o=0;o<arguments.length;o++){var a=n[o],s=e(typeof a!="string"&&$o(a)?a:[a]);s.size!==0&&i.push(s)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(d){i.forEach(function(h){return h.forEach(function(_){return d.push(_)})})})},t.prototype.setSize=function(n){return Mt(this,0,n)},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(a){for(var s=0;s<o.size;s++)a.set(s,n.call(i,a.get(s),s,o))})},t.prototype.slice=function(n,i){var o=this.size;return _n(n,i,o)?this:Mt(this,mr(n,o),yn(i,o))},t.prototype.__iterator=function(n,i){var o=i?this.size:0,a=Ua(this,i);return new _e(function(){var s=a();return s===sn?Fe():Te(n,i?--o:o++,s)})},t.prototype.__iterate=function(n,i){for(var o=i?this.size:0,a=Ua(this,i),s;(s=a())!==sn&&n(s,i?--o:o++,this)!==!1;);return o},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?cn(this._origin,this._capacity,this._level,this._root,this._tail,n,this.__hash):this.size===0?zn():(this.__ownerID=n,this.__altered=!1,this)},t})(ir);En.isList=ua;var Pe=En.prototype;Pe[_l]=!0;Pe[pn]=Pe.remove;Pe.merge=Pe.concat;Pe.setIn=Zo;Pe.deleteIn=Pe.removeIn=sa;Pe.update=ea;Pe.updateIn=ta;Pe.mergeIn=Xo;Pe.mergeDeepIn=Jo;Pe.withMutations=vn;Pe.wasAltered=ra;Pe.asImmutable=bn;Pe["@@transducer/init"]=Pe.asMutable=gn;Pe["@@transducer/step"]=function(e,t){return e.push(t)};Pe["@@transducer/result"]=function(e){return e.asImmutable()};var Dt=function(t,r){this.array=t,this.ownerID=r};Dt.prototype.removeBefore=function(t,r,n){if((n&(1<<r+Ee)-1)===0||this.array.length===0)return this;var i=n>>>r&Ge;if(i>=this.array.length)return new Dt([],t);var o=i===0,a;if(r>0){var s=this.array[i];if(a=s&&s.removeBefore(t,r-Ee,n),a===s&&o)return this}if(o&&!a)return this;var d=_r(this,t);if(!o)for(var h=0;h<i;h++)d.array[h]=void 0;return a&&(d.array[i]=a),d};Dt.prototype.removeAfter=function(t,r,n){if(n===(r?1<<r+Ee:ut)||this.array.length===0)return this;var i=n-1>>>r&Ge;if(i>=this.array.length)return this;var o;if(r>0){var a=this.array[i];if(o=a&&a.removeAfter(t,r-Ee,n),o===a&&i===this.array.length-1)return this}var s=_r(this,t);return s.array.splice(i+1),o&&(s.array[i]=o),s};var sn={};function Ua(e,t){var r=e._origin,n=e._capacity,i=dn(n),o=e._tail;return a(e._root,e._level,0);function a(h,_,g){return _===0?s(h,g):d(h,_,g)}function s(h,_){var g=_===i?o&&o.array:h&&h.array,v=_>r?0:r-_,x=n-_;return x>ut&&(x=ut),function(){if(v===x)return sn;var q=t?--x:v++;return g&&g[q]}}function d(h,_,g){var v,x=h&&h.array,q=g>r?0:r-g>>_,A=(n-g>>_)+1;return A>ut&&(A=ut),function(){for(;;){if(v){var w=v();if(w!==sn)return w;v=null}if(q===A)return sn;var M=t?--A:q++;v=a(x&&x[M],_-Ee,g+(M<<_))}}}}function cn(e,t,r,n,i,o,a){var s=Object.create(Pe);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function zn(){return cn(0,0,Ee)}function Yf(e,t,r){if(t=Pt(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?Mt(a,t).set(0,r):Mt(a,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,i=e._root,o=To();return t>=dn(e._capacity)?n=Po(n,e.__ownerID,0,t,r,o):i=Po(i,e.__ownerID,e._level,t,r,o),o.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):cn(e._origin,e._capacity,e._level,i,n):e}function Po(e,t,r,n,i,o){var a=n>>>r&Ge,s=e&&a<e.array.length;if(!s&&i===void 0)return e;var d;if(r>0){var h=e&&e.array[a],_=Po(h,t,r-Ee,n,i,o);return _===h?e:(d=_r(e,t),d.array[a]=_,d)}return s&&e.array[a]===i?e:(o&&ct(o),d=_r(e,t),i===void 0&&a===d.array.length-1?d.array.pop():d.array[a]=i,d)}function _r(e,t){return t&&e&&t===e.ownerID?e:new Dt(e?e.array.slice():[],t)}function yl(e,t){if(t>=dn(e._capacity))return e._tail;if(t<1<<e._level+Ee){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&Ge],n-=Ee;return r}}function Qf(e,t,r){var n=e._origin+(t===void 0?0:t),i=r===void 0?e._capacity:r<0?e._capacity+r:e._origin+r;if(Number.isFinite(i)&&i>Nn||Number.isFinite(n)&&n<-Nn||Number.isFinite(i)&&Number.isFinite(n)&&i-n>Nn)throw new RangeError("Invalid List size: a List cannot hold more than "+Nn+" (2 ** 30) values.")}function Mt(e,t,r){Qf(e,t,r),t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new qo,i=e._origin,o=e._capacity,a=i+t,s=r===void 0?o:r<0?o+r:i+r;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var d=e._level,h=e._root,_=0;a+_<0;)h=new Dt(h&&h.array.length?[void 0,h]:[],n),d+=Ee,_+=Ka(d);_&&(a+=_,i+=_,s+=_,o+=_);for(var g=dn(o),v=dn(s);v>=Ka(d+Ee);)h=new Dt(h&&h.array.length?[h]:[],n),d+=Ee;var x=e._tail,q=v<g?yl(e,s-1):v>g?new Dt([],n):x;if(x&&v>g&&a<o&&x.array.length){h=_r(h,n);for(var A=h,w=d;w>Ee;w-=Ee){var M=g>>>w&Ge;A=A.array[M]=_r(A.array[M],n)}A.array[g>>>Ee&Ge]=x}if(s<o&&(q=q&&q.removeAfter(n,0,s)),a>=v)a-=v,s-=v,d=Ee,h=void 0,q=q&&q.removeBefore(n,0,a);else if(a>i||v<g){for(_=0;h;){var E=a>>>d&Ge;if(E!==v>>>d&Ge)break;E&&(_+=(1<<d)*E),d-=Ee,h=h.array[E]}h&&a>i&&(h=h.removeBefore(n,d,a-_)),h&&v<g&&(h=h.removeAfter(n,d,v-_)),_&&(a-=_,s-=_)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=d,e._root=h,e._tail=q,e.__hash=void 0,e.__altered=!0,e):cn(a,s,d,h,q)}function dn(e){return e<ut?0:e-1>>>Ee<<Ee}var Nn=Math.pow(2,30);function Ka(e){return e<31?1<<e:Math.pow(2,e)}function la(e){return ri(e)&&yt(e)}var St=(function(e){function t(r){return r==null?Zr():la(r)?r:Zr().withMutations(function(n){var i=dt(r);st(i.size),i.forEach(function(o,a){return n.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(n,i){var o=this._map.get(n);return o!==void 0?this._list.get(o)[1]:i},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Zr()},t.prototype.set=function(n,i){return Va(this,n,i)},t.prototype.remove=function(n){return Va(this,n,he)},t.prototype.__iterate=function(n,i){var o=this;return this._list.__iterate(function(a){return a&&n(a[1],a[0],o)},i)},t.prototype.__iterator=function(n,i){return this._list.fromEntrySeq().__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n),o=this._list.__ensureOwner(n);return n?fa(i,o,n,this.__hash):this.size===0?Zr():(this.__ownerID=n,this.__altered=!1,this._map=i,this._list=o,this)},t})(or);St.isOrderedMap=la;St.prototype[Nt]=!0;St.prototype[pn]=St.prototype.remove;function fa(e,t,r,n){var i=Object.create(St.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Ha;function Zr(){return Ha||(Ha=fa(gt(),zn()))}function Va(e,t,r){var n=e._map,i=e._list,o=n.get(t),a=o!==void 0,s,d;if(r===he){if(!a)return e;i.size>=ut&&i.size>=n.size*2?(d=i.filter(function(h,_){return h!==void 0&&o!==_}),s=d.toKeyedSeq().map(function(h){return h[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=d.__ownerID=e.__ownerID)):(s=n.remove(t),d=o===i.size-1?i.pop():i.set(o,void 0))}else if(a){if(r===i.get(o)[1])return e;s=n,d=i.set(o,[t,r])}else s=n.set(t,i.size),d=i.set(i.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=d,e.__hash=void 0,e.__altered=!0,e):fa(s,d)}var bl="@@__IMMUTABLE_STACK__@@";function Gn(e){return!!(e&&e[bl])}var ni=(function(e){function t(r){return r==null?xn():Gn(r)?r:xn().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,i){var o=this._head;for(n=Pt(this,n);o&&n--;)o=o.next;return o?o.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,o=this._head,a=arguments.length-1;a>=0;a--)o={value:n[a],next:o};return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):en(i,o)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&Gn(n))return n;st(n.size);var i=this.size,o=this._head;return n.__iterate(function(a){i++,o={value:a,next:o}},!0),this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):en(i,o)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):xn()},t.prototype.slice=function(n,i){if(_n(n,i,this.size))return this;var o=mr(n,this.size),a=yn(i,this.size);if(a!==this.size)return e.prototype.slice.call(this,n,i);for(var s=this.size-o,d=this._head;o--;)d=d.next;return this.__ownerID?(this.size=s,this._head=d,this.__hash=void 0,this.__altered=!0,this):en(s,d)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?en(this.size,this._head,n,this.__hash):this.size===0?xn():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,i){var o=this;if(i)return new dr(this.toArray()).__iterate(function(d,h){return n(d,h,o)},i);for(var a=0,s=this._head;s&&n(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(n,i){if(i)return new dr(this.toArray()).__iterator(n,i);var o=0,a=this._head;return new _e(function(){if(a){var s=a.value;return a=a.next,Te(n,o++,s)}return Fe()})},t})(ir);ni.isStack=Gn;var Ye=ni.prototype;Ye[bl]=!0;Ye.shift=Ye.pop;Ye.unshift=Ye.push;Ye.unshiftAll=Ye.pushAll;Ye.withMutations=vn;Ye.wasAltered=ra;Ye.asImmutable=bn;Ye["@@transducer/init"]=Ye.asMutable=gn;Ye["@@transducer/step"]=function(e,t){return e.unshift(t)};Ye["@@transducer/result"]=function(e){return e.asImmutable()};function en(e,t,r,n){var i=Object.create(Ye);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Ga;function xn(){return Ga||(Ga=en(0))}function Ya(e,t,r,n,i,o){return st(e.size),e.__iterate(function(a,s,d){i?(i=!1,r=a):r=t.call(n,r,a,s,d)},o),r}function Jf(e,t){return t}function Xf(e,t){return[t,e]}function Ai(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return!e.apply(this,t)}}function Qa(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return-e.apply(this,t)}}function Ja(e,t){return e<t?1:e>t?-1:0}function ca(e,t){if(e===t)return!0;if(!rt(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Ae(e)!==Ae(t)||tt(e)!==tt(t)||yt(e)!==yt(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!Qn(e);if(yt(e)){var n=e.entries();return t.every(function(d,h){var _=n.next().value;return _&&ke(_[1],d)&&(r||ke(_[0],h))})&&n.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate(function(d,h){if(r?!e.has(d):i?!ke(d,e.get(h,he)):!ke(e.get(h,he),d))return a=!1,!1});return a&&e.size===s}var gl=(function(e){function t(r,n,i){if(i===void 0&&(i=1),!(this instanceof t))return new t(r,n,i);if(an(i!==0,"Cannot step a Range by 0"),an(r!==void 0,"You must define a start value when using Range"),an(n!==void 0,"You must define an end value when using Range"),i=Math.abs(i),n<r&&(i=-i),this._start=r,this._end=n,this._step=i,this.size=Math.max(0,Math.ceil((n-r)/i-1)+1),this.size===0){if(Ri)return Ri;Ri=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(n,i){return this.has(n)?this._start+Pt(this,n)*this._step:i},t.prototype.includes=function(n){var i=(n-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},t.prototype.slice=function(n,i){return _n(n,i,this.size)?this:(n=mr(n,this.size),i=yn(i,this.size),i<=n?new t(0,0):new t(this.get(n,this._end),this.get(i,this._end),this._step))},t.prototype.indexOf=function(n){var i=n-this._start;if(i%this._step===0){var o=i/this._step;if(o>=0&&o<this.size)return o}return-1},t.prototype.lastIndexOf=function(n){return this.indexOf(n)},t.prototype.__iterate=function(n,i){for(var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,d=0;d!==o&&n(s,i?o-++d:d++,this)!==!1;)s+=i?-a:a;return d},t.prototype.__iterator=function(n,i){var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,d=0;return new _e(function(){if(d===o)return Fe();var h=s;return s+=i?-a:a,Te(n,i?o-++d:d++,h)})},t.prototype.equals=function(n){return n instanceof t?this._start===n._start&&this._end===n._end&&this._step===n._step:ca(this,n)},t})(pt),Ri,wl="@@__IMMUTABLE_SET__@@";function ii(e){return!!(e&&e[wl])}var An=(function(e){function t(r){return r==null?tn():ii(r)&&!yt(r)?r:tn().withMutations(function(n){var i=e(r);st(i.size),i.forEach(function(o){return n.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(dt(n).keySeq())},t.intersect=function(n){return n=$e(n).toArray(),n.length?We.intersect.apply(t(n.pop()),n):tn()},t.union=function(n){return n=$e(n).toArray(),n.length?We.union.apply(t(n.pop()),n):tn()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return Cn(this,this._map.set(n,n))},t.prototype.remove=function(n){return Cn(this,this._map.remove(n))},t.prototype.clear=function(){return Cn(this,this._map.clear())},t.prototype.map=function(n,i){var o=this,a=!1,s=Cn(this,this._map.mapEntries(function(d){var h=d[1],_=n.call(i,h,h,o);return _!==h&&(a=!0),[_,_]},i));return a?s:this},t.prototype.union=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return n=n.filter(function(o){return o.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(o){for(var a=0;a<n.length;a++)typeof n[a]=="string"?o.add(n[a]):e(n[a]).forEach(function(s){return o.add(s)})})},t.prototype.intersect=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(a){return e(a)});var o=[];return this.forEach(function(a){n.every(function(s){return s.includes(a)})||o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(a){return e(a)});var o=[];return this.forEach(function(a){n.some(function(s){return s.includes(a)})&&o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(n){return br(hr(this,n))},t.prototype.sortBy=function(n,i){return br(hr(this,i,n))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(n,i){var o=this;return this._map.__iterate(function(a){return n(a,a,o)},i)},t.prototype.__iterator=function(n,i){return this._map.__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n);return n?this.__make(i,n):this.size===0?this.__empty():(this.__ownerID=n,this._map=i,this)},t})(wr);An.isSet=ii;var We=An.prototype;We[wl]=!0;We[pn]=We.remove;We.merge=We.concat=We.union;We.withMutations=vn;We.asImmutable=bn;We["@@transducer/init"]=We.asMutable=gn;We["@@transducer/step"]=function(e,t){return e.add(t)};We["@@transducer/result"]=function(e){return e.asImmutable()};We.__empty=tn;We.__make=Sl;function Cn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function Sl(e,t){var r=Object.create(We);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var Xa;function tn(){return Xa||(Xa=Sl(gt()))}function da(e,t,r){for(var n=ll(t),i=0;i!==n.length;)if(e=aa(e,n[i++],he),e===he)return r;return e}function ml(e,t){return da(this,e,t)}function vl(e,t){return da(e,t,he)!==he}function Zf(e){return vl(this,e)}function El(){st(this.size);var e={};return this.__iterate(function(t,r){wn(r)||(e[r]=t)}),e}function Yn(e){if(!e||typeof e!="object")return e;if(!rt(e)){if(!xt(e))return e;e=Be(e)}if(Ae(e)){var t={};return e.__iterate(function(n,i){wn(i)||(t[i]=Yn(n))}),t}var r=[];return e.__iterate(function(n){r.push(Yn(n))}),r}function ec(e){if(e.size===1/0)return 0;var t=yt(e),r=Ae(e),n=t?1:0;return e.__iterate(r?t?function(i,o){n=31*n+Za(Ve(i),Ve(o))|0}:function(i,o){n=n+Za(Ve(i),Ve(o))|0}:t?function(i){n=31*n+Ve(i)|0}:function(i){n=n+Ve(i)|0}),tc(e.size,n)}function tc(e,t){return t=$r(t,3432918353),t=$r(t<<15|t>>>-15,461845907),t=$r(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=$r(t^t>>>16,2246822507),t=$r(t^t>>>13,3266489909),t=ei(t^t>>>16),t}function Za(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}function sr(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}$e.Iterator=_e;sr($e,{toArray:function(){st(this.size);var t=new Array(this.size||0),r=Ae(this),n=0;return this.__iterate(function(i,o){t[n++]=r?[o,i]:i}),t},toIndexedSeq:function(){return new Ku(this)},toJS:function(){return Yn(this)},toKeyedSeq:function(){return new ti(this,!0)},toMap:function(){return or(this.toKeyedSeq())},toObject:El,toOrderedMap:function(){return St(this.toKeyedSeq())},toOrderedSet:function(){return br(Ae(this)?this.valueSeq():this)},toSet:function(){return An(Ae(this)?this.valueSeq():this)},toSetSeq:function(){return new Hu(this)},toSeq:function(){return tt(this)?this.toIndexedSeq():Ae(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return ni(Ae(this)?this.valueSeq():this)},toList:function(){return En(Ae(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,r){return this.size===0?t+r:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return ve(this,Mf(this,t))},includes:function(t){return this.some(function(r){return ke(r,t)})},entries:function(){return this.__iterator(ft)},every:function(t,r){st(this.size);var n=!0;return this.__iterate(function(i,o,a){if(!t.call(r,i,o,a))return n=!1,!1}),n},filter:function(t,r){return ve(this,Qu(this,t,r,!0))},partition:function(t,r){return If(this,t,r)},find:function(t,r,n){var i=this.findEntry(t,r);return i?i[1]:n},forEach:function(t,r){return st(this.size),this.__iterate(r?t.bind(r):t)},join:function(t){st(this.size),t=t!==void 0?""+t:",";var r="",n=!0;return this.__iterate(function(i){n?n=!1:r+=t,r+=i!=null?i.toString():""}),r},keys:function(){return this.__iterator(Sr)},map:function(t,r){return ve(this,Yu(this,t,r))},reduce:function(t,r,n){return Ya(this,t,r,n,arguments.length<2,!1)},reduceRight:function(t,r,n){return Ya(this,t,r,n,arguments.length<2,!0)},reverse:function(){return ve(this,Ko(this,!0))},slice:function(t,r){return ve(this,Ho(this,t,r,!0))},some:function(t,r){st(this.size);var n=!1;return this.__iterate(function(i,o,a){if(t.call(r,i,o,a))return n=!0,!1}),n},sort:function(t){return ve(this,hr(this,t))},values:function(){return this.__iterator(lt)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,r){return cr(t?this.toSeq().filter(t,r):this)},countBy:function(t,r){return Af(this,t,r)},equals:function(t){return ca(this,t)},entrySeq:function(){var t=this;if(t._cache)return new dr(t._cache);var r=t.toSeq().map(Xf).toIndexedSeq();return r.fromEntrySeq=function(){return t.toSeq()},r},filterNot:function(t,r){return this.filter(Ai(t),r)},findEntry:function(t,r,n){var i=n;return this.__iterate(function(o,a,s){if(t.call(r,o,a,s))return i=[a,o],!1}),i},findKey:function(t,r){var n=this.findEntry(t,r);return n&&n[0]},findLast:function(t,r,n){return this.toKeyedSeq().reverse().find(t,r,n)},findLastEntry:function(t,r,n){return this.toKeyedSeq().reverse().findEntry(t,r,n)},findLastKey:function(t,r){return this.toKeyedSeq().reverse().findKey(t,r)},first:function(t){return this.find(qu,null,t)},flatMap:function(t,r){return ve(this,Lf(this,t,r))},flatten:function(t){return ve(this,Xu(this,t,!0))},fromEntrySeq:function(){return new Vu(this)},get:function(t,r){return this.find(function(n,i){return ke(i,t)},void 0,r)},getIn:ml,groupBy:function(t,r){return Rf(this,t,r)},has:function(t){return this.get(t,he)!==he},hasIn:Zf,isSubset:function(t){return t=typeof t.includes=="function"?t:$e(t),this.every(function(r){return t.includes(r)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:$e(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(r){return ke(r,t)})},keySeq:function(){return this.toSeq().map(Jf).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Dn(this,t)},maxBy:function(t,r){return Dn(this,r,t)},min:function(t){return Dn(this,t?Qa(t):Ja)},minBy:function(t,r){return Dn(this,r?Qa(r):Ja,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,r){return ve(this,Ju(this,t,r,!0))},skipUntil:function(t,r){return this.skipWhile(Ai(t),r)},sortBy:function(t,r){return ve(this,hr(this,r,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,r){return ve(this,Tf(this,t,r))},takeUntil:function(t,r){return this.takeWhile(Ai(t),r)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ec(this))}});var ze=$e.prototype;ze[ku]=!0;ze[Jn]=ze.values;ze.toJSON=ze.toArray;ze.__toStringMapper=fn;ze.inspect=ze.toSource=function(){return this.toString()};ze.chain=ze.flatMap;ze.contains=ze.includes;sr(dt,{flip:function(){return ve(this,Gu(this))},mapEntries:function(t,r){var n=this,i=0;return ve(this,this.toSeq().map(function(o,a){return t.call(r,[a,o],i++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return ve(this,this.toSeq().flip().map(function(i,o){return t.call(r,i,o,n)}).flip())}});var Rn=dt.prototype;Rn[Hn]=!0;Rn[Jn]=ze.entries;Rn.toJSON=El;Rn.__toStringMapper=function(e,t){return fn(t)+": "+fn(e)};sr(ir,{toKeyedSeq:function(){return new ti(this,!1)},filter:function(t,r){return ve(this,Qu(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return r===void 0?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return r===void 0?-1:r},reverse:function(){return ve(this,Ko(this,!1))},slice:function(t,r){return ve(this,Ho(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),n===0||n===2&&!r)return this;t=mr(t,t<0?this.count():this.size);var i=this.slice(0,t);return ve(this,n===1?i:i.concat(bt(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return ve(this,Xu(this,t,!1))},get:function(t,r){return t=Pt(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?r:this.find(function(n,i){return i===t},void 0,r)},has:function(t){return t=Pt(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.find(function(r,n){return n===t},void 0,he)!==he)},interpose:function(t){return ve(this,Df(this,t))},interleave:function(){var t=[this].concat(bt(arguments)),r=Pn(this.toSeq(),pt.of,t),n=r.flatten(!0);return r.size&&(n.size=r.size*t.length),ve(this,n)},keySeq:function(){return gl(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,r){return ve(this,Ju(this,t,r,!1))},zip:function(){var t=[this].concat(bt(arguments));return ve(this,Pn(this,es,t))},zipAll:function(){var t=[this].concat(bt(arguments));return ve(this,Pn(this,es,t,!0))},zipWith:function(t){var r=bt(arguments);return r[0]=this,ve(this,Pn(this,t,r))}});var Ar=ir.prototype;Ar[Kn]=!0;Ar[Nt]=!0;sr(wr,{get:function(t,r){return this.has(t)?t:r},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var yr=wr.prototype;yr.has=ze.includes;yr.contains=yr.includes;yr.keys=yr.values;sr($t,Rn);sr(pt,Ar);sr(Er,yr);function es(){return bt(arguments)}function ha(e){return ii(e)&&yt(e)}var br=(function(e){function t(r){return r==null?No():ha(r)?r:No().withMutations(function(n){var i=wr(r);st(i.size),i.forEach(function(o){return n.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(dt(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t})(An);br.isOrderedSet=ha;var ur=br.prototype;ur[Nt]=!0;ur.zip=Ar.zip;ur.zipWith=Ar.zipWith;ur.zipAll=Ar.zipAll;ur.__empty=No;ur.__make=Al;function Al(e,t){var r=Object.create(ur);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var ts;function No(){return ts||(ts=Al(Zr()))}var rc={LeftThenRight:-1,RightThenLeft:1};function nc(e){if(kt(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(ht(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ce=function(t,r){var n;nc(t);var i=function(s){var d=this;if(s instanceof i)return s;if(!(this instanceof i))return new i(s);if(!n){n=!0;var h=Object.keys(t),_=o._indices={};o._name=r,o._keys=h,o._defaultValues=t;for(var g=0;g<h.length;g++){var v=h[g];_[v]=g,o[v]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+_a(this)+' with property "'+v+'" since that property name is part of the Record API.'):ic(o,v)}}return this.__ownerID=void 0,this._values=En().withMutations(function(x){x.setSize(d._keys.length),dt(s).forEach(function(q,A){x.set(d._indices[A],q===d._defaultValues[A]?void 0:q)})}),this},o=i.prototype=Object.create(Re);return o.constructor=i,r&&(i.displayName=r),i};Ce.prototype.toString=function(){for(var t=_a(this)+" { ",r=this._keys,n,i=0,o=r.length;i!==o;i++)n=r[i],t+=(i?", ":"")+n+": "+fn(this.get(n));return t+" }"};Ce.prototype.equals=function(t){return this===t||kt(t)&&gr(this).equals(gr(t))};Ce.prototype.hashCode=function(){return gr(this).hashCode()};Ce.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Ce.prototype.get=function(t,r){if(!this.has(t))return r;var n=this._indices[t],i=this._values.get(n);return i===void 0?this._defaultValues[t]:i};Ce.prototype.set=function(t,r){if(this.has(t)){var n=this._values.set(this._indices[t],r===this._defaultValues[t]?void 0:r);if(n!==this._values&&!this.__ownerID)return pa(this,n)}return this};Ce.prototype.remove=function(t){return this.set(t)};Ce.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:pa(this,t)};Ce.prototype.wasAltered=function(){return this._values.wasAltered()};Ce.prototype.toSeq=function(){return gr(this)};Ce.prototype.toJS=function(){return Yn(this)};Ce.prototype.entries=function(){return this.__iterator(ft)};Ce.prototype.__iterator=function(t,r){return gr(this).__iterator(t,r)};Ce.prototype.__iterate=function(t,r){return gr(this).__iterate(t,r)};Ce.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._values.__ensureOwner(t);return t?pa(this,r,t):(this.__ownerID=t,this._values=r,this)};Ce.isRecord=kt;Ce.getDescriptiveName=_a;var Re=Ce.prototype;Re[Fu]=!0;Re[pn]=Re.remove;Re.deleteIn=Re.removeIn=sa;Re.getIn=ml;Re.hasIn=ze.hasIn;Re.merge=el;Re.mergeWith=tl;Re.mergeIn=Xo;Re.mergeDeep=nl;Re.mergeDeepWith=il;Re.mergeDeepIn=Jo;Re.setIn=Zo;Re.update=ea;Re.updateIn=ta;Re.withMutations=vn;Re.asMutable=gn;Re.asImmutable=bn;Re[Jn]=Re.entries;Re.toJSON=Re.toObject=ze.toObject;Re.inspect=Re.toSource=function(){return this.toString()};function pa(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function _a(e){return e.constructor.displayName||e.constructor.name||"Record"}function gr(e){return Bo(e._keys.map(function(t){return[t,e.get(t)]}))}function ic(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(r){an(this.__ownerID,"Cannot set on an immutable record."),this.set(t,r)}})}catch{}}var oc=(function(e){function t(r,n){if(!(this instanceof t))return new t(r,n);if(this._value=r,this.size=n===void 0?1/0:Math.max(0,n),this.size===0){if(Ii)return Ii;Ii=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},t.prototype.get=function(n,i){return this.has(n)?this._value:i},t.prototype.includes=function(n){return ke(this._value,n)},t.prototype.slice=function(n,i){var o=this.size;return _n(n,i,o)?this:new t(this._value,yn(i,o)-mr(n,o))},t.prototype.reverse=function(){return this},t.prototype.indexOf=function(n){return this.size!==0&&ke(this._value,n)?0:-1},t.prototype.lastIndexOf=function(n){return this.size!==0&&ke(this._value,n)?this.size-1:-1},t.prototype.__iterate=function(n,i){for(var o=this.size,a=0;a!==o&&n(this._value,i?o-++a:a++,this)!==!1;);return a},t.prototype.__iterator=function(n,i){var o=this,a=this.size,s=0;return new _e(function(){return s===a?Fe():Te(n,i?a-++s:s++,o._value)})},t.prototype.equals=function(n){return n instanceof t?ke(this._value,n._value):ca(this,n)},t})(pt),Ii;function ac(e,t){return Rl([],t||sc,e,"",t&&t.length>2?[]:void 0,{"":e})}function Rl(e,t,r,n,i,o){if(typeof r!="string"&&!ht(r)&&(jo(r)||$o(r)||Qo(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&n!==""&&i.push(n);var a=t.call(o,n,Be(r).map(function(s,d){return Rl(e,t,s,d,i,r)}),i&&i.slice());return e.pop(),i&&i.pop(),a}return r}function sc(e,t){return tt(t)?t.toList():Ae(t)?t.toMap():t.toSet()}var uc="5.1.9",lc=$e;const fc=Object.freeze(Object.defineProperty({__proto__:null,Collection:$e,Iterable:lc,List:En,Map:or,OrderedMap:St,OrderedSet:br,PairSorting:rc,Range:gl,Record:Ce,Repeat:oc,Seq:Be,Set:An,Stack:ni,fromJS:ac,get:aa,getIn:da,has:fl,hasIn:vl,hash:Ve,is:ke,isAssociative:Qn,isCollection:rt,isImmutable:ht,isIndexed:tt,isKeyed:Ae,isList:ua,isMap:ri,isOrdered:yt,isOrderedMap:la,isOrderedSet:ha,isPlainObject:Qo,isRecord:kt,isSeq:Zn,isSet:ii,isStack:Gn,isValueObject:Do,merge:Nf,mergeDeep:Cf,mergeDeepWith:kf,mergeWith:xf,remove:cl,removeIn:pl,set:dl,setIn:ol,update:Yo,updateIn:ar,version:uc},Symbol.toStringTag,{value:"Module"})),cc=Nu(fc);var rs;function Il(){if(rs)return Gt;rs=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.ActionContextKey=Gt.ActionContext=void 0;const e=cc;let t=class rn{constructor(i={}){this.map=(0,e.Map)(i)}setDefault(i,o){return this.has(i)?this:this.set(i,o)}set(i,o){return this.setRaw(i.name,o)}setRaw(i,o){return new rn(this.map.set(i,o))}delete(i){return new rn(this.map.delete(i.name))}get(i){return this.getRaw(i.name)}getRaw(i){return this.map.get(i)}getSafe(i){if(!this.has(i))throw new Error(`Context entry ${i.name} is required but not available`);return this.get(i)}has(i){return this.hasRaw(i.name)}hasRaw(i){return this.map.has(i)}merge(...i){let o=this;for(const a of i)for(const s of a.keys())o=o.set(s,a.get(s));return o}keys(){return[...this.map.keys()].map(i=>new r(i))}toJS(){return this.map.toJS()}toString(){return`ActionContext(${JSON.stringify(this.map.toJS())})`}[Symbol.for("nodejs.util.inspect.custom")](){return`ActionContext(${JSON.stringify(this.map.toJS(),null," ")})`}static ensureActionContext(i){return i instanceof rn?i:new rn((0,e.Map)(i??{}))}};Gt.ActionContext=t;class r{constructor(i){this.name=i}}return Gt.ActionContextKey=r,Gt}var qr={},ns;function Tl(){if(ns)return qr;ns=1,Object.defineProperty(qr,"__esModule",{value:!0}),qr.Bus=void 0;let e=class{constructor(r){this.actors=[],this.observers=[],this.dependencyLinks=new Map,Object.assign(this,r),this.failMessage=`All actors over bus ${this.name} failed to handle an action`}subscribe(r){this.actors.push(r),this.reorderForDependencies()}subscribeObserver(r){this.observers.push(r)}unsubscribe(r){const n=this.actors.indexOf(r);return n>=0?(this.actors.splice(n,1),!0):!1}unsubscribeObserver(r){const n=this.observers.indexOf(r);return n>=0?(this.observers.splice(n,1),!0):!1}publish(r){return this.actors.map(n=>({actor:n,reply:n.test(r)}))}onRun(r,n,i){for(const o of this.observers)o.onRun(r,n,i)}addDependencies(r,n){for(const i of n){let o=this.dependencyLinks.get(i);o||(o=[],this.dependencyLinks.set(i,o)),o.push(r)}this.reorderForDependencies()}reorderForDependencies(){if(this.dependencyLinks.size>0){const r=[];for(const n of this.dependencyLinks.keys()){const i=this.actors.indexOf(n);i>=0&&(this.actors.splice(i,1),r.push(n))}for(;r.length>0;){let n=-1;for(let o=0;o<r.length;o++){let a=!0;for(const s of this.dependencyLinks.get(r[o]))if(!this.actors.includes(s)&&r.includes(s)){a=!1;break}if(a){n=o;break}}if(n<0)throw new Error(`Cyclic dependency links detected in bus ${this.name}`);const i=r.splice(n,1)[0];this.actors.push(i)}}}};return qr.Bus=e,qr}var jr={},is;function dc(){if(is)return jr;is=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.BusIndexed=void 0;const e=Tl();let t=class extends e.Bus{constructor(n){super(n),this.actorsIndex={}}subscribe(n){const i=this.getActorIdentifiers(n)??["_undefined_"];for(const o of i){let a=this.actorsIndex[o];a||(a=this.actorsIndex[o]=[]),a.push(n),super.subscribe(n)}}unsubscribe(n){const i=this.getActorIdentifiers(n)??["_undefined_"];let o=!1;for(const a of i){const s=this.actorsIndex[a];if(s){const d=s.indexOf(n);d>=0&&s.splice(d,1),s.length===0&&delete this.actorsIndex[a]}o=o||super.unsubscribe(n)}return o}publish(n){const i=this.getActionIdentifier(n);return i?[...this.actorsIndex[i]||[],...this.actorsIndex._undefined_||[]].map(a=>({actor:a,reply:a.test(n)})):super.publish(n)}getActorIdentifiers(n){const i=this.actorIdentifierFields.reduce((o,a)=>o[a],n);if(i)return Array.isArray(i)?i:[i]}getActionIdentifier(n){return this.actionIdentifierFields.reduce((i,o)=>i[o],n)}};return jr.BusIndexed=t,jr}var Wr={},os;function Ol(){if(os)return Wr;os=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.CONTEXT_KEY_LOGGER=void 0;const e=Il();return Wr.CONTEXT_KEY_LOGGER=new e.ActionContextKey("@comunica/core:log"),Wr}var Fr={},as;function hc(){if(as)return Fr;as=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.ActionObserver=void 0;let e=class{constructor(r){Object.assign(this,r)}};return Fr.ActionObserver=e,Fr}var Br={},ss;function pc(){if(ss)return Br;ss=1,Object.defineProperty(Br,"__esModule",{value:!0}),Br.Actor=void 0;const e=Ol();let t=class Zt{constructor(n){this.beforeActors=[],Object.assign(this,n),this.bus.subscribe(this),this.beforeActors.length>0&&this.bus.addDependencies(this,this.beforeActors),n.busFailMessage&&(this.bus.failMessage=n.busFailMessage)}static getContextLogger(n){return n.get(e.CONTEXT_KEY_LOGGER)}runObservable(n,i){const o=this.run(n,i);return this.bus.onRun(this,n,o),o}getDefaultLogData(n,i){const o=i?i():{};return o.actor=this.name,o}logTrace(n,i,o){const a=Zt.getContextLogger(n);a&&a.trace(i,this.getDefaultLogData(n,o))}logDebug(n,i,o){const a=Zt.getContextLogger(n);a&&a.debug(i,this.getDefaultLogData(n,o))}logInfo(n,i,o){const a=Zt.getContextLogger(n);a&&a.info(i,this.getDefaultLogData(n,o))}logWarn(n,i,o){const a=Zt.getContextLogger(n);a&&a.warn(i,this.getDefaultLogData(n,o))}logError(n,i,o){const a=Zt.getContextLogger(n);a&&a.error(i,this.getDefaultLogData(n,o))}logFatal(n,i,o){const a=Zt.getContextLogger(n);a&&a.fatal(i,this.getDefaultLogData(n,o))}};return Br.Actor=t,Br}var zr={},us;function _c(){if(us)return zr;us=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.Mediator=void 0;let e=class xo{constructor(r){Object.assign(this,r)}publish(r){const n=this.bus.publish(r);if(n.length===0)throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`);return n}async mediateActor(r){return await this.mediateWith(r,this.publish(r))}async mediateTestable(r){return(await this.mediateActor(r)).mapAsync((i,o)=>i.runObservable(r,o))}async mediate(r){return(await this.mediateTestable(r)).getOrThrow()}constructFailureMessage(r,n){const i=`
|
|
2
|
+
`;return`${this.bus.failMessage.replaceAll(/\$\{(.*?)\}/gu,(a,s)=>xo.getObjectValue({action:r},s.split("."))||a)}
|
|
3
|
+
Error messages of failing actors:${i}${n.join(i)}`}static getObjectValue(r,n){if(n.length===0)return r;if(r)return xo.getObjectValue(r[n[0]],n.slice(1))}};return zr.Mediator=e,zr}var je={},ls;function yc(){if(ls)return je;ls=1,Object.defineProperty(je,"__esModule",{value:!0}),je.TestResultFailed=je.TestResultPassed=je.failTest=je.passTestVoidWithSideData=je.passTestWithSideData=je.passTestVoid=je.passTest=void 0;function e(s){return new o(s,void 0)}je.passTest=e;function t(){return new o(!0,void 0)}je.passTestVoid=t;function r(s,d){return new o(s,d)}je.passTestWithSideData=r;function n(s){return new o(!0,s)}je.passTestVoidWithSideData=n;function i(s){return new a(s)}je.failTest=i;class o{constructor(d,h){this.value=d,this.sideData=h}isPassed(){return!0}isFailed(){return!1}get(){return this.value}getOrThrow(){return this.value}getSideData(){return this.sideData}getFailMessage(){}map(d){return new o(d(this.value,this.sideData),this.sideData)}async mapAsync(d){return new o(await d(this.value,this.sideData),this.sideData)}}je.TestResultPassed=o;class a{constructor(d){this.failMessage=d}isPassed(){return!1}isFailed(){return!0}get(){}getOrThrow(){throw new Error(this.getFailMessage())}getSideData(){throw new Error(this.getFailMessage())}getFailMessage(){return this.failMessage}map(){return this}async mapAsync(){return this}}return je.TestResultFailed=a,je}var fs;function qt(){return fs||(fs=1,(function(e){var t=Vt&&Vt.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Vt&&Vt.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Il(),e),r(Tl(),e),r(dc(),e),r(Ol(),e),r(hc(),e),r(pc(),e),r(_c(),e),r(yc(),e)})(Vt)),Vt}var cs;function bc(){if(cs)return kr;cs=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.ActionObserverHttp=void 0;const e=qt();class t extends e.ActionObserver{constructor(n){super(n),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener(()=>{this.requests=0})}onRun(n,i,o){this.observedActors.includes(n.name)&&this.requests++}}return kr.ActionObserverHttp=t,kr}var Ur={},Yt={},Kr={},Qt={},Hr={},ds;function Ml(){if(ds)return Hr;ds=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.ActorAbstractMediaTyped=void 0;const e=qt();let t=class extends e.Actor{constructor(n){super(n)}async run(n){if("handle"in n){const i=n;return{handle:await this.runHandle(i.handle,i.handleMediaType,n.context)}}if("mediaTypes"in n)return{mediaTypes:await this.getMediaTypes(n.context)};if("mediaTypeFormats"in n)return{mediaTypeFormats:await this.getMediaTypeFormats(n.context)};throw new Error("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}async test(n){if("handle"in n){const i=n;return(await this.testHandle(i.handle,i.handleMediaType,n.context)).map(o=>({handle:o}))}return"mediaTypes"in n?(await this.testMediaType(n.context)).map(i=>({mediaTypes:i})):"mediaTypeFormats"in n?(await this.testMediaTypeFormats(n.context)).map(i=>({mediaTypeFormats:i})):(0,e.failTest)("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}};return Hr.ActorAbstractMediaTyped=t,Hr}var Vr={},hs;function gc(){if(hs)return Vr;hs=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.ActorAbstractMediaTypedFixed=void 0;const e=qt(),t=Ml();let r=class extends t.ActorAbstractMediaTyped{constructor(i){super(i);const o=this.priorityScale||this.priorityScale===0?this.priorityScale:1;if(this.mediaTypePriorities)for(const[a,[s,d]]of Object.entries(this.mediaTypePriorities).entries())this.mediaTypePriorities[s]=o*d;this.mediaTypePriorities=Object.freeze(this.mediaTypePriorities),this.mediaTypeFormats=Object.freeze(this.mediaTypeFormats)}async testHandle(i,o,a){return!o||!(o in this.mediaTypePriorities)?(0,e.failTest)(`Unrecognized media type: ${o}`):await this.testHandleChecked(i,a)}async testMediaType(i){return(0,e.passTestVoid)()}async getMediaTypes(i){return this.mediaTypePriorities}async testMediaTypeFormats(i){return(0,e.passTestVoid)()}async getMediaTypeFormats(i){return this.mediaTypeFormats}};return Vr.ActorAbstractMediaTypedFixed=r,Vr}var ps;function Ll(){return ps||(ps=1,(function(e){var t=Qt&&Qt.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Qt&&Qt.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ml(),e),r(gc(),e)})(Qt)),Qt}var _s;function wc(){if(_s)return Kr;_s=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.ActorQueryResultSerialize=void 0;const e=Ll();let t=class extends e.ActorAbstractMediaTyped{constructor(n){super(n)}};return Kr.ActorQueryResultSerialize=t,Kr}var Gr={},ys;function Sc(){if(ys)return Gr;ys=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.ActorQueryResultSerializeFixedMediaTypes=void 0;const e=Ll(),t=qt();let r=class extends e.ActorAbstractMediaTypedFixed{constructor(i){super(i)}async testHandleChecked(i,o){return(0,t.passTestVoid)()}};return Gr.ActorQueryResultSerializeFixedMediaTypes=r,Gr}var bs;function Dl(){return bs||(bs=1,(function(e){var t=Yt&&Yt.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Yt&&Yt.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(wc(),e),r(Sc(),e)})(Yt)),Yt}var Jt={},ge={},gs;function mc(){if(gs)return ge;gs=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.KeysStatistics=ge.KeysRdfJoin=ge.KeysMergeBindingsContext=ge.KeysRdfUpdateQuads=ge.KeysQuerySourceIdentify=ge.KeysRdfParseHtmlScript=ge.KeysRdfParseJsonLd=ge.KeysQueryOperation=ge.KeysExpressionEvaluator=ge.KeysInitQuery=ge.KeysHttpProxy=ge.KeysHttpMemento=ge.KeysHttpWayback=ge.KeysHttp=ge.KeysCore=void 0;const e=qt();return ge.KeysCore={log:e.CONTEXT_KEY_LOGGER},ge.KeysHttp={includeCredentials:new e.ActionContextKey("@comunica/bus-http:include-credentials"),auth:new e.ActionContextKey("@comunica/bus-http:auth"),fetch:new e.ActionContextKey("@comunica/bus-http:fetch"),httpTimeout:new e.ActionContextKey("@comunica/bus-http:http-timeout"),httpBodyTimeout:new e.ActionContextKey("@comunica/bus-http:http-body-timeout"),httpRetryCount:new e.ActionContextKey("@comunica/bus-http:http-retry-count"),httpRetryDelayFallback:new e.ActionContextKey("@comunica/bus-http:http-retry-delay-fallback"),httpRetryDelayLimit:new e.ActionContextKey("@comunica/bus-http:http-retry-delay-limit"),httpRetryStatusCodes:new e.ActionContextKey("@comunica/bus-http:http-retry-status-codes")},ge.KeysHttpWayback={recoverBrokenLinks:new e.ActionContextKey("@comunica/bus-http:recover-broken-links")},ge.KeysHttpMemento={datetime:new e.ActionContextKey("@comunica/actor-http-memento:datetime")},ge.KeysHttpProxy={httpProxyHandler:new e.ActionContextKey("@comunica/actor-http-proxy:httpProxyHandler")},ge.KeysInitQuery={querySourcesUnidentified:new e.ActionContextKey("@comunica/actor-init-query:querySourcesUnidentified"),initialBindings:new e.ActionContextKey("@comunica/actor-init-query:initialBindings"),queryFormat:new e.ActionContextKey("@comunica/actor-init-query:queryFormat"),graphqlSingularizeVariables:new e.ActionContextKey("@comunica/actor-init-query:singularizeVariables"),lenient:new e.ActionContextKey("@comunica/actor-init-query:lenient"),queryString:new e.ActionContextKey("@comunica/actor-init-query:queryString"),query:new e.ActionContextKey("@comunica/actor-init-query:query"),baseIRI:new e.ActionContextKey("@comunica/actor-init-query:baseIRI"),fileBaseIRI:new e.ActionContextKey("@comunica/actor-init-query:fileBaseIRI"),functionArgumentsCache:new e.ActionContextKey("@comunica/actor-init-query:functionArgumentsCache"),queryTimestamp:new e.ActionContextKey("@comunica/actor-init-query:queryTimestamp"),queryTimestampHighResolution:new e.ActionContextKey("@comunica/actor-init-query:queryTimestampHighResolution"),extensionFunctionCreator:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctionCreator"),extensionFunctions:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctions"),extensionFunctionsAlwaysPushdown:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctionsAlwaysPushdown"),cliArgsHandlers:new e.ActionContextKey("@comunica/actor-init-query:cliArgsHandlers"),explain:new e.ActionContextKey("@comunica/actor-init-query:explain"),physicalQueryPlanLogger:new e.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanLogger"),physicalQueryPlanNode:new e.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanNode"),jsonLdContext:new e.ActionContextKey("@context"),invalidateCache:new e.ActionContextKey("@comunica/actor-init-query:invalidateCache"),dataFactory:new e.ActionContextKey("@comunica/actor-init-query:dataFactory"),distinctConstruct:new e.ActionContextKey("@comunica/actor-init-query:distinctConstruct")},ge.KeysExpressionEvaluator={extensionFunctionCreator:new e.ActionContextKey("@comunica/utils-expression-evaluator:extensionFunctionCreator"),superTypeProvider:new e.ActionContextKey("@comunica/utils-expression-evaluator:superTypeProvider"),defaultTimeZone:new e.ActionContextKey("@comunica/utils-expression-evaluator:defaultTimeZone"),actionContext:new e.ActionContextKey("@comunica/utils-expression-evaluator:actionContext")},ge.KeysQueryOperation={operation:new e.ActionContextKey("@comunica/bus-query-operation:operation"),joinLeftMetadata:new e.ActionContextKey("@comunica/bus-query-operation:joinLeftMetadata"),joinRightMetadatas:new e.ActionContextKey("@comunica/bus-query-operation:joinRightMetadatas"),joinBindings:new e.ActionContextKey("@comunica/bus-query-operation:joinBindings"),readOnly:new e.ActionContextKey("@comunica/bus-query-operation:readOnly"),isPathArbitraryLengthDistinctKey:new e.ActionContextKey("@comunica/bus-query-operation:isPathArbitraryLengthDistinct"),limitIndicator:new e.ActionContextKey("@comunica/bus-query-operation:limitIndicator"),unionDefaultGraph:new e.ActionContextKey("@comunica/bus-query-operation:unionDefaultGraph"),querySources:new e.ActionContextKey("@comunica/bus-query-operation:querySources")},ge.KeysRdfParseJsonLd={documentLoader:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:documentLoader"),strictValues:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:strictValues"),parserOptions:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:parserOptions")},ge.KeysRdfParseHtmlScript={processingHtmlScript:new e.ActionContextKey("@comunica/actor-rdf-parse-html-script:processingHtmlScript"),extractAllScripts:new e.ActionContextKey("extractAllScripts")},ge.KeysQuerySourceIdentify={sourceIds:new e.ActionContextKey("@comunica/bus-query-source-identify:sourceIds"),hypermediaSourcesAggregatedStores:new e.ActionContextKey("@comunica/bus-query-source-identify:hypermediaSourcesAggregatedStores"),traverse:new e.ActionContextKey("@comunica/bus-query-source-identify:traverse")},ge.KeysRdfUpdateQuads={destination:new e.ActionContextKey("@comunica/bus-rdf-update-quads:destination")},ge.KeysMergeBindingsContext={sourcesBinding:new e.ActionContextKey("@comunica/bus-merge-bindings-context:sourcesBinding")},ge.KeysRdfJoin={lastPhysicalJoin:new e.ActionContextKey("@comunica/bus-rdf-join:lastPhysicalJoin")},ge.KeysStatistics={discoveredLinks:new e.ActionContextKey("@comunica/statistic:discoveredLinks"),dereferencedLinks:new e.ActionContextKey("@comunica/statistic:dereferencedLinks"),intermediateResults:new e.ActionContextKey("@comunica/statistic:intermediateResults")},ge}var ws;function vc(){return ws||(ws=1,(function(e){var t=Jt&&Jt.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Jt&&Jt.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(mc(),e)})(Jt)),Jt}var Ti={},Yr={},Ss;function Ec(){if(Ss)return Yr;Ss=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.LinkedList=void 0;class e{constructor(){this._length=0,this._head=null,this._tail=null}get length(){return this._length}get first(){var r;return(r=this._head)===null||r===void 0?void 0:r.value}get last(){var r;return(r=this._tail)===null||r===void 0?void 0:r.value}get empty(){return this._head===null}push(r){const n={value:r,next:null};this._tail===null?this._head=this._tail=n:this._tail.next=this._tail=n,this._length++}shift(){if(this._head===null)return;const{value:r,next:n}=this._head;return this._head=n,n===null&&(this._tail=null),this._length--,r}clear(){this._length=0,this._head=this._tail=null}}return Yr.LinkedList=e,Yr}var Qr={};let Oi=1;const ya=new Map;let Mi=!1,ba,Pl=(e,...t)=>(ya.set(Oi,[e,t]),ba(Oi),Oi++),ga=e=>{ya.delete(e)};function wa(e){if(Mi)setTimeout(wa,0,e);else{const t=ya.get(e);if(t){Mi=!0;try{t[0](...t[1])}finally{ga(e),Mi=!1}}}}function Ac(){const e=new MessageChannel;e.port1.onmessage=t=>{wa(t.data)},ba=t=>{e.port2.postMessage(t)}}function Rc(){const e=`setImmediate$${Math.random()}$`;window.addEventListener("message",t=>{typeof t.data=="string"&&t.data.startsWith(e)&&wa(+t.data.slice(e.length))}),ba=t=>{window.postMessage(e+t,"*")}}const kn=typeof self>"u"?typeof global>"u"?void 0:global:self;kn.setImmediate?(Pl=kn.setImmediate,ga=kn.clearImmediate):kn.importScripts?Ac():Rc();const Ic=Object.freeze(Object.defineProperty({__proto__:null,get clearImmediate(){return ga},get setImmediate(){return Pl}},Symbol.toStringTag,{value:"Module"})),Tc=Nu(Ic);var ms;function Oc(){if(ms)return Qr;ms=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.createTaskScheduler=void 0;const e=Tc,t=Promise.resolve(void 0);function r(n=e.setImmediate){const i=typeof queueMicrotask=="function"?queueMicrotask:s=>t.then(s);let o=0,a=null;return s=>{a!==null?a.push(s):++o<100?i(s):(a=[s],n(()=>{for(const d of a)i(d);a=null,o=0}))}}return Qr.createTaskScheduler=r,Qr}var vs;function Nl(){return vs||(vs=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isIterator=e.isIterable=e.isSourceExpression=e.isPromise=e.isEventEmitter=e.isFunction=e.range=e.union=e.fromIterable=e.fromIterator=e.fromArray=e.single=e.empty=e.wrap=e.WrappingIterator=e.ClonedIterator=e.UnionIterator=e.MultiTransformIterator=e.SimpleTransformIterator=e.TransformIterator=e.BufferedIterator=e.MappingIterator=e.DESTINATION=e.identity=e.IntegerIterator=e.ArrayIterator=e.SingletonIterator=e.EmptyIterator=e.AsyncIterator=e.DESTROYED=e.ENDED=e.CLOSED=e.CLOSING=e.OPEN=e.INIT=e.setTaskScheduler=e.getTaskScheduler=e.scheduleTask=e.LinkedList=void 0;const t=It(),r=Ec();Object.defineProperty(e,"LinkedList",{enumerable:!0,get:function(){return r.LinkedList}});let i=Oc().createTaskScheduler();function o(W){i(W)}e.scheduleTask=o;function a(){return i}e.getTaskScheduler=a;function s(W){i=W}e.setTaskScheduler=s,e.INIT=1,e.OPEN=2,e.CLOSING=4,e.CLOSED=8,e.ENDED=16,e.DESTROYED=32;class d extends t.EventEmitter{constructor(u=e.OPEN){super(),this._readable=!1,this._state=u,this.on("newListener",h)}_changeState(u,f=!1){const b=u>this._state&&this._state<e.ENDED;return b&&(this._state=u,u===e.ENDED&&(f?i(()=>this.emit("end")):this.emit("end"))),b}read(){return null}forEach(u,f){this.on("data",re(u,f))}close(){this._changeState(e.CLOSED)&&this._endAsync()}destroy(u){this.done||this._destroy(u,f=>{u=u||f,u&&this.emit("error",u),this._end(!0)})}_destroy(u,f){f()}_end(u=!1){this._changeState(u?e.DESTROYED:e.ENDED)&&(this._readable=!1,this.removeAllListeners("readable"),this.removeAllListeners("data"),this.removeAllListeners("end"))}_endAsync(){i(()=>this._end())}get readable(){return this._readable}set readable(u){u=!!u&&!this.done,this._readable!==u&&(this._readable=u,u&&i(()=>this.emit("readable")))}get closed(){return this._state>=e.CLOSING}get ended(){return this._state===e.ENDED}get destroyed(){return this._state===e.DESTROYED}get done(){return this._state>=e.ENDED}toString(){const u=this._toStringDetails();return`[${this.constructor.name}${u?` ${u}`:""}]`}_toStringDetails(){return""}toArray(u){const f=[],b=typeof u?.limit=="number"?u.limit:1/0;return this.ended||b<=0?Promise.resolve(f):new Promise((T,$)=>{const j=()=>T(f),y=O=>{f.push(O),f.length>=b&&(this.removeListener("error",$),this.removeListener("data",y),this.removeListener("end",j),T(f))};this.on("error",$),this.on("data",y),this.on("end",j)})}getProperty(u,f){const b=this._properties;if(!f)return b&&b[u];if(b&&u in b)i(()=>f(b[u]));else{let T;(T=this._propertyCallbacks)||(this._propertyCallbacks=T=Object.create(null)),u in T?T[u].push(f):T[u]=[f]}}setProperty(u,f){const b=this._properties||(this._properties=Object.create(null));b[u]=f;const T=this._propertyCallbacks||{},$=T[u];if($){delete T[u],i(()=>{for(const j of $)j(f)});for(u in T)return;delete this._propertyCallbacks}}getProperties(){const u=this._properties,f={};for(const b in u)f[b]=u[b];return f}setProperties(u){for(const f in u)this.setProperty(f,u[f])}copyProperties(u,f){for(const b of f)u.getProperty(b,T=>this.setProperty(b,T))}transform(u){return new D(this,u)}map(u,f){return new M(this,re(u,f))}filter(u,f){return this.map(function(b){return u.call(f||this,b)?b:null})}uniq(u=w){const f=new Set;return this.filter(function(b){const T=u.call(this,b);return f.has(T)?!1:(f.add(T),!0)})}prepend(u){return this.transform({prepend:u})}append(u){return this.transform({append:u})}surround(u,f){return this.transform({prepend:u,append:f})}skip(u){return this.map(f=>u-- >0?null:f)}take(u){return this.transform({limit:u})}range(u,f){return this.transform({offset:u,limit:Math.max(f-u+1,0)})}clone(){return new K(this)}[Symbol.asyncIterator](){const u=this;let f=null,b=null,T=null;u.addListener("readable",$),u.addListener("end",$),u.addListener("error",j);function $(){if(f!==null)if(T!==null)j(T);else if(u.done)f({done:!0,value:void 0}),f=b=null,y();else{const O=u.read();O!==null&&(f({done:!1,value:O}),f=b=null)}}function j(O){b!==null?(b(O),f=b=T=null,y()):T===null&&(T=O)}function y(){u.removeListener("readable",$),u.removeListener("end",$),u.removeListener("error",j)}return{next(){return new Promise((O,B)=>{f=O,b=B,$()})}}}}e.AsyncIterator=d;function h(W){W==="data"&&(this.removeListener("newListener",h),g(this,"readable",_),this.readable&&i(()=>_.call(this)))}function _(){let W;for(;this.listenerCount("data")!==0&&(W=this.read())!==null;)this.emit("data",W);this.listenerCount("data")===0&&!this.done&&(this.removeListener("readable",_),g(this,"newListener",h))}function g(W,u,f){W.listeners(u).includes(f)||W.on(u,f)}class v extends d{constructor(){super(),this._changeState(e.ENDED,!0)}}e.EmptyIterator=v;class x extends d{constructor(u){super(),this._item=u,u===null?this.close():this.readable=!0}read(){const u=this._item;return this._item=null,this.close(),u}_toStringDetails(){return this._item===null?"":`(${this._item})`}}e.SingletonIterator=x;class q extends d{constructor(u=[],{autoStart:f=!0,preserve:b=!0}={}){super();const T=b||!Array.isArray(u)?[...u]:u;this._index=0,this._sourceStarted=f!==!1,this._truncateThreshold=b?-1:64,this._sourceStarted&&T.length===0?this.close():this._buffer=T,this.readable=!0}read(){this._sourceStarted||(this._sourceStarted=!0);let u=null;return this._buffer&&(this._index<this._buffer.length&&(u=this._buffer[this._index++]),this._index===this._buffer.length?(delete this._buffer,this.close()):this._index===this._truncateThreshold&&(this._buffer.splice(0,this._truncateThreshold),this._index=0)),u}_toStringDetails(){return`(${this._buffer?this._buffer.length-this._index:0})`}_destroy(u,f){delete this._buffer,f()}toArray(u={}){if(!this._buffer)return Promise.resolve([]);const{length:f}=this._buffer,b=this._index,T=typeof u.limit!="number"?f:b+u.limit,$=this._buffer.slice(b,T);return this._index=T,T>=f&&this.close(),Promise.resolve($)}}e.ArrayIterator=q;class A extends d{constructor({start:u=0,step:f=1,end:b}={}){super(),Number.isFinite(u)&&(u=Math.trunc(u)),this._next=u,Number.isFinite(f)&&(f=Math.trunc(f)),this._step=f;const T=f>=0,$=T?1/0:-1/0;Number.isFinite(b)?b=Math.trunc(b):b!==-$&&(b=$),this._last=b,!Number.isFinite(u)||(T?u>b:u<b)?this.close():this.readable=!0}read(){if(this.closed)return null;const u=this._next,f=this._step,b=this._last,T=this._next+=f;return(f>=0?T>b:T<b)&&this.close(),u}_toStringDetails(){return`(${this._next}...${this._last})`}}e.IntegerIterator=A;function w(W){return W}e.identity=w,e.DESTINATION=Symbol("destination");class M extends d{constructor(u,f=w,b={}){super(),this._map=f,this._source=E(u),this._destroySource=b.destroySource!==!1,u.done?this.close():(this._source[e.DESTINATION]=this,this._source.on("end",ae),this._source.on("error",se),this._source.on("readable",G),this.readable=this._source.readable)}read(){if(!this.done){if(this._source.readable){let u,f;for(;(u=this._source.read())!==null;)if((f=this._map(u))!==null)return f}this.readable=!1,this._source.done&&this.close()}return null}_end(u){this._source.removeListener("end",ae),this._source.removeListener("error",se),this._source.removeListener("readable",G),delete this._source[e.DESTINATION],this._destroySource&&this._source.destroy(),super._end(u)}}e.MappingIterator=M;function E(W,u=!1){if(!W||!oe(W.read)||!oe(W.on))throw new TypeError(`Invalid source: ${W}`);if(!u&&W[e.DESTINATION])throw new Error("The source already has a destination");return W}class S extends d{constructor({maxBufferSize:u=4,autoStart:f=!0}={}){super(e.INIT),this._buffer=new r.LinkedList,this._maxBufferSize=4,this._reading=!0,this._pushedCount=0,this.maxBufferSize=u,i(()=>this._init(f)),this._sourceStarted=f!==!1}get maxBufferSize(){return this._maxBufferSize}set maxBufferSize(u){u!==1/0&&(u=Number.isFinite(u)?Math.max(Math.trunc(u),1):4),this._maxBufferSize!==u&&(this._maxBufferSize=u,this._state===e.OPEN&&this._fillBuffer())}_init(u){let f=!1;this._reading=!0,this._begin(()=>{if(f)throw new Error("done callback called multiple times");f=!0,this._reading=!1,this._changeState(e.OPEN),u?this._fillBufferAsync():this.readable=!0})}_begin(u){u()}read(){if(this.done)return null;this._sourceStarted||(this._sourceStarted=!0);const u=this._buffer;let f;return u.empty?(f=null,this.readable=!1):f=u.shift(),!this._reading&&u.length<this._maxBufferSize&&(this.closed?u.empty&&this._endAsync():this._fillBufferAsync()),f}_read(u,f){f()}_push(u){this.done||(this._pushedCount++,this._buffer.push(u),this.readable=!0)}_fillBuffer(){let u;this._reading||(this.closed?this._completeClose():(u=Math.min(this._maxBufferSize-this._buffer.length,128))>0&&(this._pushedCount=0,this._reading=!0,this._read(u,()=>{if(!u)throw new Error("done callback called multiple times");u=0,this._reading=!1,this.closed?this._completeClose():this._pushedCount&&(this.readable=!0,this._buffer.length<this._maxBufferSize/2&&this._fillBufferAsync())})))}_fillBufferAsync(){this._reading||(this._reading=!0,i(()=>{this._reading=!1,this._fillBuffer()}))}close(){this._reading?this._changeState(e.CLOSING):this._completeClose()}_completeClose(){this._changeState(e.CLOSED)&&(this._reading=!0,this._flush(()=>{if(!this._reading)throw new Error("done callback called multiple times");this._reading=!1,this._buffer.empty&&this._endAsync()}))}_destroy(u,f){this._buffer.clear(),f()}_flush(u){u()}_toStringDetails(){const u=this._buffer;return`{${u.empty?"":`next: ${u.first}, `}buffer: ${u.length}}`}}e.BufferedIterator=S;class J extends S{constructor(u,f=u||{}){super(f),this._boundPush=b=>this._push(b),C(u)||(u=f.source),ie(u)?this.source=u:u&&(this._createSource=I(u)?()=>u:u,this._sourceStarted&&this._loadSourceAsync()),this._optional=!!f.optional,this._destroySource=f.destroySource!==!1}get source(){return oe(this._createSource)&&this._loadSourceAsync(),this._source}set source(u){const f=this._source=this._validateSource(u);f[e.DESTINATION]=this,this.done?this._destroySource&&f.destroy():f.done?this.close():(f.on("end",Y),f.on("readable",fe),f.on("error",se))}_loadSourceAsync(){oe(this._createSource)&&(Promise.resolve(this._createSource()).then(u=>{delete this._createSource,this.source=u,this._fillBuffer()},u=>this.emit("error",u)),this._createSource=null)}_validateSource(u,f=!1){if(this._source||typeof this._createSource<"u")throw new Error("The source cannot be changed after it has been set");return E(u,f)}_read(u,f){const b=()=>{this._pushedCount<u&&!this.closed?i(()=>this._readAndTransform(b,f)):f()};this._readAndTransform(b,f)}_readAndTransform(u,f){let b;const T=this.source;!T||T.done||(b=T.read())===null?f():this._optional?this._optionalTransform(b,u):this._transform(b,u,this._boundPush)}_optionalTransform(u,f){const b=this._pushedCount;this._transform(u,()=>{b===this._pushedCount&&this._push(u),f()},this._boundPush)}_transform(u,f,b){b(u),f()}_closeWhenDone(){this.close()}_end(u){const f=this._source;f&&(f.removeListener("end",Y),f.removeListener("error",se),f.removeListener("readable",fe),delete f[e.DESTINATION],this._destroySource&&f.destroy()),super._end(u)}}e.TransformIterator=J;function G(){this[e.DESTINATION].readable=!0}function se(W){this[e.DESTINATION].emit("error",W)}function ae(){this[e.DESTINATION].close()}function Y(){this[e.DESTINATION]._closeWhenDone()}function fe(){this[e.DESTINATION]._sourceStarted!==!1&&this[e.DESTINATION]._fillBuffer()}class D extends J{constructor(u,f){if(super(u,f),this._offset=0,this._limit=1/0,this._filter=b=>!0,f=f||(C(u)?null:u),f){const b=oe(f)?f:f.transform,{limit:T,offset:$,filter:j,map:y,prepend:O,append:B}=f;$===1/0||T===-1/0?this._limit=0:(Number.isFinite($)&&(this._offset=Math.max(Math.trunc($),0)),Number.isFinite(T)&&(this._limit=Math.max(Math.trunc(T),0)),oe(j)&&(this._filter=j),oe(y)&&(this._map=y),this._transform=oe(b)?b:null),O&&(this._prepender=ie(O)?O:p(O)),B&&(this._appender=ie(B)?B:p(B))}}_read(u,f){const b=()=>this._readAndTransformSimple(u,T,f);this._readAndTransformSimple(u,T,f);function T(){i(b)}}_readAndTransformSimple(u,f,b){let T;const{source:$}=this;if(!$||$.done){b();return}for(this._limit===0&&this.close();!this.closed&&this._pushedCount<u&&(T=$.read())!==null;){if(!this._filter(T)||this._offset!==0&&this._offset--)continue;const j=typeof this._map>"u"?T:this._map(T);if(j===null)this._optional&&this._push(T);else if(!oe(this._transform))this._push(j);else{this._optional?this._optionalTransform(j,f):this._transform(j,f,this._boundPush);return}--this._limit===0&&this.close()}b()}_begin(u){this._insert(this._prepender,u),delete this._prepender}_flush(u){this._insert(this._appender,u),delete this._appender}_insert(u,f){const b=$=>this._push($);!u||u.done?f():(u.on("data",b),u.on("end",T));function T(){u.removeListener("data",b),u.removeListener("end",T),f()}}}e.SimpleTransformIterator=D;class R extends J{constructor(u,f){if(super(u,f),this._transformerQueue=[],f){const b=oe(f)?f:f.multiTransform;b&&(this._createTransformer=b)}}_read(u,f){const b=this._transformerQueue,T=this._optional;let $,j;for(;($=b[0])&&$.transformer.done;){T&&$.item!==null&&(u--,this._push($.item)),b.shift();const{transformer:O}=$;O.removeListener("end",fe),O.removeListener("readable",fe),O.removeListener("error",se)}const{source:y}=this;for(;y&&!y.done&&b.length<this.maxBufferSize&&(j=y.read(),j!==null);){const O=this._createTransformer(j)||new v;O[e.DESTINATION]=this,O.on("end",fe),O.on("readable",fe),O.on("error",se),b.push({transformer:O,item:j})}if($=b[0],$){const{transformer:O}=$;for(;u-- >0&&(j=O.read())!==null;)this._push(j),T&&($.item=null)}else y&&y.done&&this.close();f()}_createTransformer(u){return new x(u)}_closeWhenDone(){this._transformerQueue.length||this.close()}_end(u){if(super._end(u),this._destroySource)for(const f of this._transformerQueue)f.transformer.destroy()}}e.MultiTransformIterator=R;class F extends S{constructor(u,f={}){super(f),this._sources=[],this._currentSource=-1;const b=f.autoStart!==!1;if(ie(u))u.on("error",T=>this.emit("error",T)),this._pending={loading:!1,sources:u},b&&this._loadSources();else if(Array.isArray(u)&&u.length>0)for(const T of u)this._addSource(T);else b&&this.close();this._destroySources=f.destroySources!==!1}_loadSources(){const u=this._pending.sources;this._pending.loading=!0,u.done?(delete this._pending,this.close()):(u.on("data",f=>{this._addSource(f),this._fillBufferAsync()}),u.on("end",()=>{delete this._pending,this._fillBuffer()}))}_addSource(u){I(u)&&(u=ue(u)),u.done||(this._sources.push(u),u[e.DESTINATION]=this,u.on("error",se),u.on("readable",fe),u.on("end",m))}_removeEmptySources(){this._sources=this._sources.filter((u,f)=>(u.done&&f<=this._currentSource&&this._currentSource--,!u.done)),this._fillBuffer()}_read(u,f){var b;((b=this._pending)===null||b===void 0?void 0:b.loading)===!1&&this._loadSources();let T=0,$;for(;T!==(T=u);)for(let j=0;j<this._sources.length&&u>0;j++)this._currentSource=(this._currentSource+1)%this._sources.length,($=this._sources[this._currentSource].read())!==null&&(u--,this._push($));!this._pending&&this._sources.length===0&&this.close(),f()}_end(u=!1){if(super._end(u),this._destroySources){for(const f of this._sources)f.destroy();this._pending&&(this._pending.sources.destroy(),delete this._pending)}}}e.UnionIterator=F;function m(){this[e.DESTINATION]._removeEmptySources()}class K extends J{constructor(u){super(u,{autoStart:!1}),this._readPosition=0,this._reading=!1,u&&(this.readable=!0)}_init(){}close(){d.prototype.close.call(this)}get source(){return super.source}set source(u){const f=this._source=this._validateSource(u),b=f&&f[e.DESTINATION]||(f[e.DESTINATION]=new Q(f));this.done?this._destroySource&&f.destroy():b.endsAt(0)?this.close():(b.register(this),(f._sourceStarted===!1||b.readAt(0)!==null)&&(this.readable=!0));const T=this._propertyCallbacks;for(const $ in T){const j=T[$];for(const y of j)this._getSourceProperty($,y)}}_validateSource(u,f=!1){const b=u&&u[e.DESTINATION];return super._validateSource(u,!b||b instanceof Q)}getProperty(u,f){const{source:b}=this,T=this._properties,$=T&&u in T;if(!f)return $?T&&T[u]:b&&b.getProperty(u);super.getProperty(u,f),b&&!$&&this._getSourceProperty(u,f)}_getSourceProperty(u,f){this.source.getProperty(u,b=>{(!this._properties||!(u in this._properties))&&f(b)})}getProperties(){const u=this.source?this.source.getProperties():{},f=this._properties;for(const b in f)u[b]=f[b];return u}_toStringDetails(){return`{source: ${this.source?this.source.toString():"none"}}`}read(){this._sourceStarted||(this._sourceStarted=!0);const u=this.source;let f=null;if(!this.done&&u){const b=u[e.DESTINATION];(f=b.readAt(this._readPosition))!==null?this._readPosition++:this.readable=!1,b.endsAt(this._readPosition)&&this.close()}return f}_end(u){const f=this.source,b=f?.[e.DESTINATION];b&&b.unregister(this),S.prototype._end.call(this,u)}}e.ClonedIterator=K;class Q{constructor(u){if(this._history=[],this._trackers=new Set,this._source=u,!u.done){const f=()=>{for(const $ of this._trackers)$.readable=!0},b=$=>{for(const j of this._trackers)j.emit("error",$)},T=()=>{for(const $ of this._trackers)$._sourceStarted!==!1&&$._readPosition===this._history.length&&$.close();this._trackers.clear(),u.removeListener("end",T),u.removeListener("error",b),u.removeListener("readable",f)};u.on("end",T),u.on("error",b),u.on("readable",f)}}register(u){this._source.done||this._trackers.add(u)}unregister(u){this._trackers.delete(u)}readAt(u){let f=null;return u<this._history.length?f=this._history[u]:!this._source.done&&(f=this._source.read())!==null&&(this._history[u]=f),f}endsAt(u){return this._source.done&&this._history.length===u}}class ee extends d{constructor(u,f){super(),this._source=null,this._destroySource=f?.destroySource!==!1,I(u)?(this._source=new d,u.then(b=>{this._source=null,this.source=b}).catch(b=>this.emit("error",b))):u&&(this.source=u)}set source(u){let f=u;if(this._source!==null)throw new Error("The source cannot be changed after it has been set");if(V(f)&&(f=f[Symbol.iterator]()),ne(f)){let b=f;f=new t.EventEmitter,f.read=()=>{if(b!==null){let T;for(;!(T=b.next()).done;)if(T.value!==null)return T.value;b=null,this.close()}return null}}else f=E(f);if(this.done){this._destroySource&&oe(f.destroy)&&f.destroy();return}f[e.DESTINATION]=this,f.on("end",ae),f.on("error",se),f.on("readable",G),this._source=f,this.readable=f.readable!==!1}read(){if(this._source!==null&&this._source.readable!==!1){const u=this._source.read();if(u!==null)return u;this.readable=!1}return null}_end(u=!1){this._source!==null&&(this._source.removeListener("end",ae),this._source.removeListener("error",se),this._source.removeListener("readable",G),delete this._source[e.DESTINATION],this._destroySource&&oe(this._source.destroy)&&this._source.destroy(),this._source=null),super._end(u)}}e.WrappingIterator=ee;function ue(W,u){if(u&&("autoStart"in u||"optional"in u||"source"in u||"maxBufferSize"in u))return W&&!ie(W)&&(W=new ee(W)),new J(W,u);if(!W)return P();if(I(W))return new ee(W,u);if(W instanceof d)return W;if(Array.isArray(W))return p(W);if(V(W)||ne(W)||ie(W))return new ee(W,u);throw new TypeError(`Invalid source: ${W}`)}e.wrap=ue;function P(){return new v}e.empty=P;function Z(W){return new x(W)}e.single=Z;function p(W){return new q(W)}e.fromArray=p;function k(W){return new ee(W)}e.fromIterator=k;function H(W){return new ee(W)}e.fromIterable=H;function L(W){return new F(W)}e.union=L;function X(W,u,f){return new A({start:W,end:u,step:f})}e.range=X;function re(W,u){return u?W.bind(u):W}function oe(W){return typeof W=="function"}e.isFunction=oe;function ie(W){return oe(W?.on)}e.isEventEmitter=ie;function I(W){return oe(W?.then)}e.isPromise=I;function C(W){return W&&(ie(W)||I(W)||oe(W))}e.isSourceExpression=C;function V(W){return W&&Symbol.iterator in W}e.isIterable=V;function ne(W){return oe(W?.next)}e.isIterator=ne})(Ti)),Ti}var Li={exports:{}},Di={exports:{}},Pi,Es;function Le(){if(Es)return Pi;Es=1;class e extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let i=0;i<r.length;i++)n+=` ${r[i].stack}
|
|
4
|
+
`;super(n),this.name="AggregateError",this.errors=r}}return Pi={AggregateError:e,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,r){return t.includes(r)},ArrayPrototypeIndexOf(t,r){return t.indexOf(r)},ArrayPrototypeJoin(t,r){return t.join(r)},ArrayPrototypeMap(t,r){return t.map(r)},ArrayPrototypePop(t,r){return t.pop(r)},ArrayPrototypePush(t,r){return t.push(r)},ArrayPrototypeSlice(t,r,n){return t.slice(r,n)},Error,FunctionPrototypeCall(t,r,...n){return t.call(r,...n)},FunctionPrototypeSymbolHasInstance(t,r){return Function.prototype[Symbol.hasInstance].call(t,r)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,r){return Object.defineProperties(t,r)},ObjectDefineProperty(t,r,n){return Object.defineProperty(t,r,n)},ObjectGetOwnPropertyDescriptor(t,r){return Object.getOwnPropertyDescriptor(t,r)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,r){return Object.setPrototypeOf(t,r)},Promise,PromisePrototypeCatch(t,r){return t.catch(r)},PromisePrototypeThen(t,r,n){return t.then(r,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,r){return t.test(r)},SafeSet:Set,String,StringPrototypeSlice(t,r,n){return t.slice(r,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,r,n){return t.set(r,n)},Boolean,Uint8Array},Pi}var Ni={exports:{}},xi,As;function xl(){return As||(As=1,xi={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){const i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}),xi}var Ci,Rs;function Qe(){if(Rs)return Ci;Rs=1;const{format:e,inspect:t}=xl(),{AggregateError:r}=Le(),n=globalThis.AggregateError||r,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",d={};function h(w,M){if(!w)throw new d.ERR_INTERNAL_ASSERTION(M)}function _(w){let M="",E=w.length;const S=w[0]==="-"?1:0;for(;E>=S+4;E-=3)M=`_${w.slice(E-3,E)}${M}`;return`${w.slice(0,E)}${M}`}function g(w,M,E){if(typeof M=="function")return h(M.length<=E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${M.length}).`),M(...E);const S=(M.match(/%[dfijoOs]/g)||[]).length;return h(S===E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${S}).`),E.length===0?M:e(M,...E)}function v(w,M,E){E||(E=Error);class S extends E{constructor(...G){super(g(w,M,G))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(S.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),S.prototype.code=w,S.prototype[i]=!0,d[w]=S}function x(w){const M=s+w.name;return Object.defineProperty(w,"name",{value:M}),w}function q(w,M){if(w&&M&&w!==M){if(Array.isArray(M.errors))return M.errors.push(w),M;const E=new n([M,w],M.message);return E.code=M.code,E}return w||M}class A extends Error{constructor(M="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new d.ERR_INVALID_ARG_TYPE("options","Object",E);super(M,E),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(w,M,E)=>{h(typeof w=="string","'name' must be a string"),Array.isArray(M)||(M=[M]);let S="The ";w.endsWith(" argument")?S+=`${w} `:S+=`"${w}" ${w.includes(".")?"property":"argument"} `,S+="must be ";const J=[],G=[],se=[];for(const Y of M)h(typeof Y=="string","All expected entries have to be of type string"),o.includes(Y)?J.push(Y.toLowerCase()):a.test(Y)?G.push(Y):(h(Y!=="object",'The value "object" should be written as "Object"'),se.push(Y));if(G.length>0){const Y=J.indexOf("object");Y!==-1&&(J.splice(J,Y,1),G.push("Object"))}if(J.length>0){switch(J.length){case 1:S+=`of type ${J[0]}`;break;case 2:S+=`one of type ${J[0]} or ${J[1]}`;break;default:{const Y=J.pop();S+=`one of type ${J.join(", ")}, or ${Y}`}}(G.length>0||se.length>0)&&(S+=" or ")}if(G.length>0){switch(G.length){case 1:S+=`an instance of ${G[0]}`;break;case 2:S+=`an instance of ${G[0]} or ${G[1]}`;break;default:{const Y=G.pop();S+=`an instance of ${G.join(", ")}, or ${Y}`}}se.length>0&&(S+=" or ")}switch(se.length){case 0:break;case 1:se[0].toLowerCase()!==se[0]&&(S+="an "),S+=`${se[0]}`;break;case 2:S+=`one of ${se[0]} or ${se[1]}`;break;default:{const Y=se.pop();S+=`one of ${se.join(", ")}, or ${Y}`}}if(E==null)S+=`. Received ${E}`;else if(typeof E=="function"&&E.name)S+=`. Received function ${E.name}`;else if(typeof E=="object"){var ae;if((ae=E.constructor)!==null&&ae!==void 0&&ae.name)S+=`. Received an instance of ${E.constructor.name}`;else{const Y=t(E,{depth:-1});S+=`. Received ${Y}`}}else{let Y=t(E,{colors:!1});Y.length>25&&(Y=`${Y.slice(0,25)}...`),S+=`. Received type ${typeof E} (${Y})`}return S},TypeError),v("ERR_INVALID_ARG_VALUE",(w,M,E="is invalid")=>{let S=t(M);return S.length>128&&(S=S.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${E}. Received ${S}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(w,M,E)=>{var S;const J=E!=null&&(S=E.constructor)!==null&&S!==void 0&&S.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${w} to be returned from the "${M}" function but got ${J}.`},TypeError),v("ERR_MISSING_ARGS",(...w)=>{h(w.length>0,"At least one arg needs to be specified");let M;const E=w.length;switch(w=(Array.isArray(w)?w:[w]).map(S=>`"${S}"`).join(" or "),E){case 1:M+=`The ${w[0]} argument`;break;case 2:M+=`The ${w[0]} and ${w[1]} arguments`;break;default:{const S=w.pop();M+=`The ${w.join(", ")}, and ${S} arguments`}break}return`${M} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(w,M,E)=>{h(M,'Missing "range" argument');let S;if(Number.isInteger(E)&&Math.abs(E)>2**32)S=_(String(E));else if(typeof E=="bigint"){S=String(E);const J=BigInt(2)**BigInt(32);(E>J||E<-J)&&(S=_(S)),S+="n"}else S=t(E);return`The value of "${w}" is out of range. It must be ${M}. Received ${S}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Ci={AbortError:A,aggregateTwoErrors:x(q),hideStackFrames:x,codes:d},Ci}var Is;function Ze(){return Is||(Is=1,(function(e){const t=nt(),{format:r,inspect:n}=xl(),{codes:{ERR_INVALID_ARG_TYPE:i}}=Qe(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=Le(),d=globalThis.AbortSignal||wt().AbortSignal,h=globalThis.AbortController||wt().AbortController,_=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,v=typeof g<"u"?function(w){return w instanceof g}:function(w){return!1},x=(A,w)=>{if(A!==void 0&&(A===null||typeof A!="object"||!("aborted"in A)))throw new i(w,"AbortSignal",A)},q=(A,w)=>{if(typeof A!="function")throw new i(w,"Function",A)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(A){let w=!1;return function(...M){w||(w=!0,A.apply(this,M))}},createDeferredPromise:function(){let A,w;return{promise:new Promise((E,S)=>{A=E,w=S}),resolve:A,reject:w}},promisify(A){return new Promise((w,M)=>{A((E,...S)=>E?M(E):w(...S))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(A){return A instanceof _},isArrayBufferView(A){return ArrayBuffer.isView(A)}},isBlob:v,deprecate(A,w){return A},addAbortListener:It().addAbortListener||function(w,M){if(w===void 0)throw new i("signal","AbortSignal",w);x(w,"signal"),q(M,"listener");let E;return w.aborted?queueMicrotask(()=>M()):(w.addEventListener("abort",M,{__proto__:null,once:!0,[o]:!0}),E=()=>{w.removeEventListener("abort",M)}),{__proto__:null,[s](){var S;(S=E)===null||S===void 0||S()}}},AbortSignalAny:d.any||function(w){if(w.length===1)return w[0];const M=new h,E=()=>M.abort();return w.forEach(S=>{x(S,"signals"),S.addEventListener("abort",E,{once:!0})}),M.signal.addEventListener("abort",()=>{w.forEach(S=>S.removeEventListener("abort",E))},{once:!0}),M.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Ni)),Ni.exports}var $n={},ki,Ts;function In(){if(Ts)return ki;Ts=1;const{ArrayIsArray:e,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:r,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:d,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:_,String:g,StringPrototypeToUpperCase:v,StringPrototypeTrim:x}=Le(),{hideStackFrames:q,codes:{ERR_SOCKET_BAD_PORT:A,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:M,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:S}}=Qe(),{normalizeEncoding:J}=Ze(),{isAsyncFunction:G,isArrayBufferView:se}=Ze().types,ae={};function Y(y){return y===(y|0)}function fe(y){return y===y>>>0}const D=/^[0-7]+$/,R="must be a 32-bit unsigned integer or an octal string";function F(y,O,B){if(typeof y>"u"&&(y=B),typeof y=="string"){if(_(D,y)===null)throw new M(O,y,R);y=d(y,8)}return Q(y,O),y}const m=q((y,O,B=s,N=a)=>{if(typeof y!="number")throw new w(O,"number",y);if(!i(y))throw new E(O,"an integer",y);if(y<B||y>N)throw new E(O,`>= ${B} && <= ${N}`,y)}),K=q((y,O,B=-2147483648,N=2147483647)=>{if(typeof y!="number")throw new w(O,"number",y);if(!i(y))throw new E(O,"an integer",y);if(y<B||y>N)throw new E(O,`>= ${B} && <= ${N}`,y)}),Q=q((y,O,B=!1)=>{if(typeof y!="number")throw new w(O,"number",y);if(!i(y))throw new E(O,"an integer",y);const N=B?1:0,ce=4294967295;if(y<N||y>ce)throw new E(O,`>= ${N} && <= ${ce}`,y)});function ee(y,O){if(typeof y!="string")throw new w(O,"string",y)}function ue(y,O,B=void 0,N){if(typeof y!="number")throw new w(O,"number",y);if(B!=null&&y<B||N!=null&&y>N||(B!=null||N!=null)&&o(y))throw new E(O,`${B!=null?`>= ${B}`:""}${B!=null&&N!=null?" && ":""}${N!=null?`<= ${N}`:""}`,y)}const P=q((y,O,B)=>{if(!t(B,y)){const ce="must be one of: "+r(n(B,we=>typeof we=="string"?`'${we}'`:g(we)),", ");throw new M(O,y,ce)}});function Z(y,O){if(typeof y!="boolean")throw new w(O,"boolean",y)}function p(y,O,B){return y==null||!h(y,O)?B:y[O]}const k=q((y,O,B=null)=>{const N=p(B,"allowArray",!1),ce=p(B,"allowFunction",!1);if(!p(B,"nullable",!1)&&y===null||!N&&e(y)||typeof y!="object"&&(!ce||typeof y!="function"))throw new w(O,"Object",y)}),H=q((y,O)=>{if(y!=null&&typeof y!="object"&&typeof y!="function")throw new w(O,"a dictionary",y)}),L=q((y,O,B=0)=>{if(!e(y))throw new w(O,"Array",y);if(y.length<B){const N=`must be longer than ${B}`;throw new M(O,y,N)}});function X(y,O){L(y,O);for(let B=0;B<y.length;B++)ee(y[B],`${O}[${B}]`)}function re(y,O){L(y,O);for(let B=0;B<y.length;B++)Z(y[B],`${O}[${B}]`)}function oe(y,O){L(y,O);for(let B=0;B<y.length;B++){const N=y[B],ce=`${O}[${B}]`;if(N==null)throw new w(ce,"AbortSignal",N);ne(N,ce)}}function ie(y,O="signal"){if(ee(y,O),ae[y]===void 0)throw ae[v(y)]!==void 0?new S(y+" (signals must use all capital letters)"):new S(y)}const I=q((y,O="buffer")=>{if(!se(y))throw new w(O,["Buffer","TypedArray","DataView"],y)});function C(y,O){const B=J(O),N=y.length;if(B==="hex"&&N%2!==0)throw new M("encoding",O,`is invalid for data of length ${N}`)}function V(y,O="Port",B=!0){if(typeof y!="number"&&typeof y!="string"||typeof y=="string"&&x(y).length===0||+y!==+y>>>0||y>65535||y===0&&!B)throw new A(O,y,B);return y|0}const ne=q((y,O)=>{if(y!==void 0&&(y===null||typeof y!="object"||!("aborted"in y)))throw new w(O,"AbortSignal",y)}),W=q((y,O)=>{if(typeof y!="function")throw new w(O,"Function",y)}),u=q((y,O)=>{if(typeof y!="function"||G(y))throw new w(O,"Function",y)}),f=q((y,O)=>{if(y!==void 0)throw new w(O,"undefined",y)});function b(y,O,B){if(!t(B,y))throw new w(O,`('${r(B,"|")}')`,y)}const T=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $(y,O){if(typeof y>"u"||!_(T,y))throw new M(O,y,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function j(y){if(typeof y=="string")return $(y,"hints"),y;if(e(y)){const O=y.length;let B="";if(O===0)return B;for(let N=0;N<O;N++){const ce=y[N];$(ce,"hints"),B+=ce,N!==O-1&&(B+=", ")}return B}throw new M("hints",y,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return ki={isInt32:Y,isUint32:fe,parseFileMode:F,validateArray:L,validateStringArray:X,validateBooleanArray:re,validateAbortSignalArray:oe,validateBoolean:Z,validateBuffer:I,validateDictionary:H,validateEncoding:C,validateFunction:W,validateInt32:K,validateInteger:m,validateNumber:ue,validateObject:k,validateOneOf:P,validatePlainFunction:u,validatePort:V,validateSignalName:ie,validateString:ee,validateUint32:Q,validateUndefined:f,validateUnion:b,validateAbortSignal:ne,validateLinkHeaderValue:j},ki}var qn={exports:{}},$i,Os;function Tt(){if(Os)return $i;Os=1;const{SymbolAsyncIterator:e,SymbolIterator:t,SymbolFor:r}=Le(),n=r("nodejs.stream.destroyed"),i=r("nodejs.stream.errored"),o=r("nodejs.stream.readable"),a=r("nodejs.stream.writable"),s=r("nodejs.stream.disturbed"),d=r("nodejs.webstream.isClosedPromise"),h=r("nodejs.webstream.controllerErrorFunction");function _(p,k=!1){var H;return!!(p&&typeof p.pipe=="function"&&typeof p.on=="function"&&(!k||typeof p.pause=="function"&&typeof p.resume=="function")&&(!p._writableState||((H=p._readableState)===null||H===void 0?void 0:H.readable)!==!1)&&(!p._writableState||p._readableState))}function g(p){var k;return!!(p&&typeof p.write=="function"&&typeof p.on=="function"&&(!p._readableState||((k=p._writableState)===null||k===void 0?void 0:k.writable)!==!1))}function v(p){return!!(p&&typeof p.pipe=="function"&&p._readableState&&typeof p.on=="function"&&typeof p.write=="function")}function x(p){return p&&(p._readableState||p._writableState||typeof p.write=="function"&&typeof p.on=="function"||typeof p.pipe=="function"&&typeof p.on=="function")}function q(p){return!!(p&&!x(p)&&typeof p.pipeThrough=="function"&&typeof p.getReader=="function"&&typeof p.cancel=="function")}function A(p){return!!(p&&!x(p)&&typeof p.getWriter=="function"&&typeof p.abort=="function")}function w(p){return!!(p&&!x(p)&&typeof p.readable=="object"&&typeof p.writable=="object")}function M(p){return q(p)||A(p)||w(p)}function E(p,k){return p==null?!1:k===!0?typeof p[e]=="function":k===!1?typeof p[t]=="function":typeof p[e]=="function"||typeof p[t]=="function"}function S(p){if(!x(p))return null;const k=p._writableState,H=p._readableState,L=k||H;return!!(p.destroyed||p[n]||L!=null&&L.destroyed)}function J(p){if(!g(p))return null;if(p.writableEnded===!0)return!0;const k=p._writableState;return k!=null&&k.errored?!1:typeof k?.ended!="boolean"?null:k.ended}function G(p,k){if(!g(p))return null;if(p.writableFinished===!0)return!0;const H=p._writableState;return H!=null&&H.errored?!1:typeof H?.finished!="boolean"?null:!!(H.finished||k===!1&&H.ended===!0&&H.length===0)}function se(p){if(!_(p))return null;if(p.readableEnded===!0)return!0;const k=p._readableState;return!k||k.errored?!1:typeof k?.ended!="boolean"?null:k.ended}function ae(p,k){if(!_(p))return null;const H=p._readableState;return H!=null&&H.errored?!1:typeof H?.endEmitted!="boolean"?null:!!(H.endEmitted||k===!1&&H.ended===!0&&H.length===0)}function Y(p){return p&&p[o]!=null?p[o]:typeof p?.readable!="boolean"?null:S(p)?!1:_(p)&&p.readable&&!ae(p)}function fe(p){return p&&p[a]!=null?p[a]:typeof p?.writable!="boolean"?null:S(p)?!1:g(p)&&p.writable&&!J(p)}function D(p,k){return x(p)?S(p)?!0:!(k?.readable!==!1&&Y(p)||k?.writable!==!1&&fe(p)):null}function R(p){var k,H;return x(p)?p.writableErrored?p.writableErrored:(k=(H=p._writableState)===null||H===void 0?void 0:H.errored)!==null&&k!==void 0?k:null:null}function F(p){var k,H;return x(p)?p.readableErrored?p.readableErrored:(k=(H=p._readableState)===null||H===void 0?void 0:H.errored)!==null&&k!==void 0?k:null:null}function m(p){if(!x(p))return null;if(typeof p.closed=="boolean")return p.closed;const k=p._writableState,H=p._readableState;return typeof k?.closed=="boolean"||typeof H?.closed=="boolean"?k?.closed||H?.closed:typeof p._closed=="boolean"&&K(p)?p._closed:null}function K(p){return typeof p._closed=="boolean"&&typeof p._defaultKeepAlive=="boolean"&&typeof p._removedConnection=="boolean"&&typeof p._removedContLen=="boolean"}function Q(p){return typeof p._sent100=="boolean"&&K(p)}function ee(p){var k;return typeof p._consuming=="boolean"&&typeof p._dumped=="boolean"&&((k=p.req)===null||k===void 0?void 0:k.upgradeOrConnect)===void 0}function ue(p){if(!x(p))return null;const k=p._writableState,H=p._readableState,L=k||H;return!L&&Q(p)||!!(L&&L.autoDestroy&&L.emitClose&&L.closed===!1)}function P(p){var k;return!!(p&&((k=p[s])!==null&&k!==void 0?k:p.readableDidRead||p.readableAborted))}function Z(p){var k,H,L,X,re,oe,ie,I,C,V;return!!(p&&((k=(H=(L=(X=(re=(oe=p[i])!==null&&oe!==void 0?oe:p.readableErrored)!==null&&re!==void 0?re:p.writableErrored)!==null&&X!==void 0?X:(ie=p._readableState)===null||ie===void 0?void 0:ie.errorEmitted)!==null&&L!==void 0?L:(I=p._writableState)===null||I===void 0?void 0:I.errorEmitted)!==null&&H!==void 0?H:(C=p._readableState)===null||C===void 0?void 0:C.errored)!==null&&k!==void 0?k:!((V=p._writableState)===null||V===void 0)&&V.errored))}return $i={isDestroyed:S,kIsDestroyed:n,isDisturbed:P,kIsDisturbed:s,isErrored:Z,kIsErrored:i,isReadable:Y,kIsReadable:o,kIsClosedPromise:d,kControllerErrorFunction:h,kIsWritable:a,isClosed:m,isDuplexNodeStream:v,isFinished:D,isIterable:E,isReadableNodeStream:_,isReadableStream:q,isReadableEnded:se,isReadableFinished:ae,isReadableErrored:F,isNodeStream:x,isWebStream:M,isWritable:fe,isWritableNodeStream:g,isWritableStream:A,isWritableEnded:J,isWritableFinished:G,isWritableErrored:R,isServerRequest:ee,isServerResponse:Q,willEmitClose:ue,isTransformStream:w},$i}var Ms;function jt(){if(Ms)return qn.exports;Ms=1;const e=it(),{AbortError:t,codes:r}=Qe(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=r,{kEmptyObject:o,once:a}=Ze(),{validateAbortSignal:s,validateFunction:d,validateObject:h,validateBoolean:_}=In(),{Promise:g,PromisePrototypeThen:v,SymbolDispose:x}=Le(),{isClosed:q,isReadable:A,isReadableNodeStream:w,isReadableStream:M,isReadableFinished:E,isReadableErrored:S,isWritable:J,isWritableNodeStream:G,isWritableStream:se,isWritableFinished:ae,isWritableErrored:Y,isNodeStream:fe,willEmitClose:D,kIsClosedPromise:R}=Tt();let F;function m(P){return P.setHeader&&typeof P.abort=="function"}const K=()=>{};function Q(P,Z,p){var k,H;if(arguments.length===2?(p=Z,Z=o):Z==null?Z=o:h(Z,"options"),d(p,"callback"),s(Z.signal,"options.signal"),p=a(p),M(P)||se(P))return ee(P,Z,p);if(!fe(P))throw new n("stream",["ReadableStream","WritableStream","Stream"],P);const L=(k=Z.readable)!==null&&k!==void 0?k:w(P),X=(H=Z.writable)!==null&&H!==void 0?H:G(P),re=P._writableState,oe=P._readableState,ie=()=>{P.writable||V()};let I=D(P)&&w(P)===L&&G(P)===X,C=ae(P,!1);const V=()=>{C=!0,P.destroyed&&(I=!1),!(I&&(!P.readable||L))&&(!L||ne)&&p.call(P)};let ne=E(P,!1);const W=()=>{ne=!0,P.destroyed&&(I=!1),!(I&&(!P.writable||X))&&(!X||C)&&p.call(P)},u=y=>{p.call(P,y)};let f=q(P);const b=()=>{f=!0;const y=Y(P)||S(P);if(y&&typeof y!="boolean")return p.call(P,y);if(L&&!ne&&w(P,!0)&&!E(P,!1))return p.call(P,new i);if(X&&!C&&!ae(P,!1))return p.call(P,new i);p.call(P)},T=()=>{f=!0;const y=Y(P)||S(P);if(y&&typeof y!="boolean")return p.call(P,y);p.call(P)},$=()=>{P.req.on("finish",V)};m(P)?(P.on("complete",V),I||P.on("abort",b),P.req?$():P.on("request",$)):X&&!re&&(P.on("end",ie),P.on("close",ie)),!I&&typeof P.aborted=="boolean"&&P.on("aborted",b),P.on("end",W),P.on("finish",V),Z.error!==!1&&P.on("error",u),P.on("close",b),f?e.nextTick(b):re!=null&&re.errorEmitted||oe!=null&&oe.errorEmitted?I||e.nextTick(T):(!L&&(!I||A(P))&&(C||J(P)===!1)||!X&&(!I||J(P))&&(ne||A(P)===!1)||oe&&P.req&&P.aborted)&&e.nextTick(T);const j=()=>{p=K,P.removeListener("aborted",b),P.removeListener("complete",V),P.removeListener("abort",b),P.removeListener("request",$),P.req&&P.req.removeListener("finish",V),P.removeListener("end",ie),P.removeListener("close",ie),P.removeListener("finish",V),P.removeListener("end",W),P.removeListener("error",u),P.removeListener("close",b)};if(Z.signal&&!f){const y=()=>{const O=p;j(),O.call(P,new t(void 0,{cause:Z.signal.reason}))};if(Z.signal.aborted)e.nextTick(y);else{F=F||Ze().addAbortListener;const O=F(Z.signal,y),B=p;p=a((...N)=>{O[x](),B.apply(P,N)})}}return j}function ee(P,Z,p){let k=!1,H=K;if(Z.signal)if(H=()=>{k=!0,p.call(P,new t(void 0,{cause:Z.signal.reason}))},Z.signal.aborted)e.nextTick(H);else{F=F||Ze().addAbortListener;const X=F(Z.signal,H),re=p;p=a((...oe)=>{X[x](),re.apply(P,oe)})}const L=(...X)=>{k||e.nextTick(()=>p.apply(P,X))};return v(P[R].promise,L,L),K}function ue(P,Z){var p;let k=!1;return Z===null&&(Z=o),(p=Z)!==null&&p!==void 0&&p.cleanup&&(_(Z.cleanup,"cleanup"),k=Z.cleanup),new g((H,L)=>{const X=Q(P,Z,re=>{k&&X(),re?L(re):H()})})}return qn.exports=Q,qn.exports.finished=ue,qn.exports}var qi,Ls;function Rr(){if(Ls)return qi;Ls=1;const e=it(),{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:n}=Qe(),{Symbol:i}=Le(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:d}=Tt(),h=i("kDestroy"),_=i("kConstruct");function g(D,R,F){D&&(D.stack,R&&!R.errored&&(R.errored=D),F&&!F.errored&&(F.errored=D))}function v(D,R){const F=this._readableState,m=this._writableState,K=m||F;return m!=null&&m.destroyed||F!=null&&F.destroyed?(typeof R=="function"&&R(),this):(g(D,m,F),m&&(m.destroyed=!0),F&&(F.destroyed=!0),K.constructed?x(this,D,R):this.once(h,function(Q){x(this,t(Q,D),R)}),this)}function x(D,R,F){let m=!1;function K(Q){if(m)return;m=!0;const ee=D._readableState,ue=D._writableState;g(Q,ue,ee),ue&&(ue.closed=!0),ee&&(ee.closed=!0),typeof F=="function"&&F(Q),Q?e.nextTick(q,D,Q):e.nextTick(A,D)}try{D._destroy(R||null,K)}catch(Q){K(Q)}}function q(D,R){w(D,R),A(D)}function A(D){const R=D._readableState,F=D._writableState;F&&(F.closeEmitted=!0),R&&(R.closeEmitted=!0),(F!=null&&F.emitClose||R!=null&&R.emitClose)&&D.emit("close")}function w(D,R){const F=D._readableState,m=D._writableState;m!=null&&m.errorEmitted||F!=null&&F.errorEmitted||(m&&(m.errorEmitted=!0),F&&(F.errorEmitted=!0),D.emit("error",R))}function M(){const D=this._readableState,R=this._writableState;D&&(D.constructed=!0,D.closed=!1,D.closeEmitted=!1,D.destroyed=!1,D.errored=null,D.errorEmitted=!1,D.reading=!1,D.ended=D.readable===!1,D.endEmitted=D.readable===!1),R&&(R.constructed=!0,R.destroyed=!1,R.closed=!1,R.closeEmitted=!1,R.errored=null,R.errorEmitted=!1,R.finalCalled=!1,R.prefinished=!1,R.ended=R.writable===!1,R.ending=R.writable===!1,R.finished=R.writable===!1)}function E(D,R,F){const m=D._readableState,K=D._writableState;if(K!=null&&K.destroyed||m!=null&&m.destroyed)return this;m!=null&&m.autoDestroy||K!=null&&K.autoDestroy?D.destroy(R):R&&(R.stack,K&&!K.errored&&(K.errored=R),m&&!m.errored&&(m.errored=R),F?e.nextTick(w,D,R):w(D,R))}function S(D,R){if(typeof D._construct!="function")return;const F=D._readableState,m=D._writableState;F&&(F.constructed=!1),m&&(m.constructed=!1),D.once(_,R),!(D.listenerCount(_)>1)&&e.nextTick(J,D)}function J(D){let R=!1;function F(m){if(R){E(D,m??new r);return}R=!0;const K=D._readableState,Q=D._writableState,ee=Q||K;K&&(K.constructed=!0),Q&&(Q.constructed=!0),ee.destroyed?D.emit(h,m):m?E(D,m,!0):e.nextTick(G,D)}try{D._construct(m=>{e.nextTick(F,m)})}catch(m){e.nextTick(F,m)}}function G(D){D.emit(_)}function se(D){return D?.setHeader&&typeof D.abort=="function"}function ae(D){D.emit("close")}function Y(D,R){D.emit("error",R),e.nextTick(ae,D)}function fe(D,R){!D||a(D)||(!R&&!s(D)&&(R=new n),d(D)?(D.socket=null,D.destroy(R)):se(D)?D.abort():se(D.req)?D.req.abort():typeof D.destroy=="function"?D.destroy(R):typeof D.close=="function"?D.close():R?e.nextTick(Y,D,R):e.nextTick(ae,D),D.destroyed||(D[o]=!0))}return qi={construct:S,destroyer:fe,destroy:v,undestroy:M,errorOrDestroy:E},qi}var ji,Ds;function Sa(){if(Ds)return ji;Ds=1;const{ArrayIsArray:e,ObjectSetPrototypeOf:t}=Le(),{EventEmitter:r}=It();function n(o){r.call(this,o)}t(n.prototype,r.prototype),t(n,r),n.prototype.pipe=function(o,a){const s=this;function d(A){o.writable&&o.write(A)===!1&&s.pause&&s.pause()}s.on("data",d);function h(){s.readable&&s.resume&&s.resume()}o.on("drain",h),!o._isStdio&&(!a||a.end!==!1)&&(s.on("end",g),s.on("close",v));let _=!1;function g(){_||(_=!0,o.end())}function v(){_||(_=!0,typeof o.destroy=="function"&&o.destroy())}function x(A){q(),r.listenerCount(this,"error")===0&&this.emit("error",A)}i(s,"error",x),i(o,"error",x);function q(){s.removeListener("data",d),o.removeListener("drain",h),s.removeListener("end",g),s.removeListener("close",v),s.removeListener("error",x),o.removeListener("error",x),s.removeListener("end",q),s.removeListener("close",q),o.removeListener("close",q)}return s.on("end",q),s.on("close",q),o.on("close",q),o.emit("pipe",s),o};function i(o,a,s){if(typeof o.prependListener=="function")return o.prependListener(a,s);!o._events||!o._events[a]?o.on(a,s):e(o._events[a])?o._events[a].unshift(s):o._events[a]=[s,o._events[a]]}return ji={Stream:n,prependListener:i},ji}var Wi={exports:{}},Ps;function oi(){return Ps||(Ps=1,(function(e){const{SymbolDispose:t}=Le(),{AbortError:r,codes:n}=Qe(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=Tt(),s=jt(),{ERR_INVALID_ARG_TYPE:d}=n;let h;const _=(g,v)=>{if(typeof g!="object"||!("aborted"in g))throw new d(v,"AbortSignal",g)};e.exports.addAbortSignal=function(v,x){if(_(v,"signal"),!i(x)&&!o(x))throw new d("stream",["ReadableStream","WritableStream","Stream"],x);return e.exports.addAbortSignalNoValidate(v,x)},e.exports.addAbortSignalNoValidate=function(g,v){if(typeof g!="object"||!("aborted"in g))return v;const x=i(v)?()=>{v.destroy(new r(void 0,{cause:g.reason}))}:()=>{v[a](new r(void 0,{cause:g.reason}))};if(g.aborted)x();else{h=h||Ze().addAbortListener;const q=h(g,x);s(v,q[t])}return v}})(Wi)),Wi.exports}var Fi,Ns;function Mc(){if(Ns)return Fi;Ns=1;const{StringPrototypeSlice:e,SymbolIterator:t,TypedArrayPrototypeSet:r,Uint8Array:n}=Le(),{Buffer:i}=nt(),{inspect:o}=Ze();return Fi=class{constructor(){this.head=null,this.tail=null,this.length=0}push(s){const d={data:s,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length}unshift(s){const d={data:s,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}shift(){if(this.length===0)return;const s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}clear(){this.head=this.tail=null,this.length=0}join(s){if(this.length===0)return"";let d=this.head,h=""+d.data;for(;(d=d.next)!==null;)h+=s+d.data;return h}concat(s){if(this.length===0)return i.alloc(0);const d=i.allocUnsafe(s>>>0);let h=this.head,_=0;for(;h;)r(d,h.data,_),_+=h.data.length,h=h.next;return d}consume(s,d){const h=this.head.data;if(s<h.length){const _=h.slice(0,s);return this.head.data=h.slice(s),_}return s===h.length?this.shift():d?this._getString(s):this._getBuffer(s)}first(){return this.head.data}*[t](){for(let s=this.head;s;s=s.next)yield s.data}_getString(s){let d="",h=this.head,_=0;do{const g=h.data;if(s>g.length)d+=g,s-=g.length;else{s===g.length?(d+=g,++_,h.next?this.head=h.next:this.head=this.tail=null):(d+=e(g,0,s),this.head=h,h.data=e(g,s));break}++_}while((h=h.next)!==null);return this.length-=_,d}_getBuffer(s){const d=i.allocUnsafe(s),h=s;let _=this.head,g=0;do{const v=_.data;if(s>v.length)r(d,v,h-s),s-=v.length;else{s===v.length?(r(d,v,h-s),++g,_.next?this.head=_.next:this.head=this.tail=null):(r(d,new n(v.buffer,v.byteOffset,s),h-s),this.head=_,_.data=v.slice(s));break}++g}while((_=_.next)!==null);return this.length-=g,d}[Symbol.for("nodejs.util.inspect.custom")](s,d){return o(this,{...d,depth:0,customInspect:!1})}},Fi}var Bi,xs;function ai(){if(xs)return Bi;xs=1;const{MathFloor:e,NumberIsInteger:t}=Le(),{validateInteger:r}=In(),{ERR_INVALID_ARG_VALUE:n}=Qe().codes;let i=16*1024,o=16;function a(_,g,v){return _.highWaterMark!=null?_.highWaterMark:g?_[v]:null}function s(_){return _?o:i}function d(_,g){r(g,"value",0),_?o=g:i=g}function h(_,g,v,x){const q=a(g,x,v);if(q!=null){if(!t(q)||q<0){const A=x?`options.${v}`:"options.highWaterMark";throw new n(A,q)}return e(q)}return s(_.objectMode)}return Bi={getHighWaterMark:h,getDefaultHighWaterMark:s,setDefaultHighWaterMark:d},Bi}var zi,Cs;function Cl(){if(Cs)return zi;Cs=1;const e=it(),{PromisePrototypeThen:t,SymbolAsyncIterator:r,SymbolIterator:n}=Le(),{Buffer:i}=nt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=Qe().codes;function s(d,h,_){let g;if(typeof h=="string"||h instanceof i)return new d({objectMode:!0,..._,read(){this.push(h),this.push(null)}});let v;if(h&&h[r])v=!0,g=h[r]();else if(h&&h[n])v=!1,g=h[n]();else throw new o("iterable",["Iterable"],h);const x=new d({objectMode:!0,highWaterMark:1,..._});let q=!1;x._read=function(){q||(q=!0,w())},x._destroy=function(M,E){t(A(M),()=>e.nextTick(E,M),S=>e.nextTick(E,S||M))};async function A(M){const E=M!=null,S=typeof g.throw=="function";if(E&&S){const{value:J,done:G}=await g.throw(M);if(await J,G)return}if(typeof g.return=="function"){const{value:J}=await g.return();await J}}async function w(){for(;;){try{const{value:M,done:E}=v?await g.next():g.next();if(E)x.push(null);else{const S=M&&typeof M.then=="function"?await M:M;if(S===null)throw q=!1,new a;if(x.push(S))continue;q=!1}}catch(M){x.destroy(M)}break}}return x}return zi=s,zi}var Ui,ks;function si(){if(ks)return Ui;ks=1;const e=it(),{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:d,SafeSet:h,SymbolAsyncDispose:_,SymbolAsyncIterator:g,Symbol:v}=Le();Ui=N,N.ReadableState=B;const{EventEmitter:x}=It(),{Stream:q,prependListener:A}=Sa(),{Buffer:w}=nt(),{addAbortSignal:M}=oi(),E=jt();let S=Ze().debuglog("stream",l=>{S=l});const J=Mc(),G=Rr(),{getHighWaterMark:se,getDefaultHighWaterMark:ae}=ai(),{aggregateTwoErrors:Y,codes:{ERR_INVALID_ARG_TYPE:fe,ERR_METHOD_NOT_IMPLEMENTED:D,ERR_OUT_OF_RANGE:R,ERR_STREAM_PUSH_AFTER_EOF:F,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:m},AbortError:K}=Qe(),{validateObject:Q}=In(),ee=v("kPaused"),{StringDecoder:ue}=xu(),P=Cl();s(N.prototype,q.prototype),s(N,q);const Z=()=>{},{errorOrDestroy:p}=G,k=1,H=2,L=4,X=8,re=16,oe=32,ie=64,I=128,C=256,V=512,ne=1024,W=2048,u=4096,f=8192,b=16384,T=32768,$=65536,j=1<<17,y=1<<18;function O(l){return{enumerable:!1,get(){return(this.state&l)!==0},set(c){c?this.state|=l:this.state&=~l}}}o(B.prototype,{objectMode:O(k),ended:O(H),endEmitted:O(L),reading:O(X),constructed:O(re),sync:O(oe),needReadable:O(ie),emittedReadable:O(I),readableListening:O(C),resumeScheduled:O(V),errorEmitted:O(ne),emitClose:O(W),autoDestroy:O(u),destroyed:O(f),closed:O(b),closeEmitted:O(T),multiAwaitDrain:O($),readingMore:O(j),dataEmitted:O(y)});function B(l,c,z){typeof z!="boolean"&&(z=c instanceof At()),this.state=W|u|re|oe,l&&l.objectMode&&(this.state|=k),z&&l&&l.readableObjectMode&&(this.state|=k),this.highWaterMark=l?se(this,l,"readableHighWaterMark",z):ae(!1),this.buffer=new J,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,l&&l.emitClose===!1&&(this.state&=~W),l&&l.autoDestroy===!1&&(this.state&=~u),this.errored=null,this.defaultEncoding=l&&l.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,l&&l.encoding&&(this.decoder=new ue(l.encoding),this.encoding=l.encoding)}function N(l){if(!(this instanceof N))return new N(l);const c=this instanceof At();this._readableState=new B(l,this,c),l&&(typeof l.read=="function"&&(this._read=l.read),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.construct=="function"&&(this._construct=l.construct),l.signal&&!c&&M(l.signal,this)),q.call(this,l),G.construct(this,()=>{this._readableState.needReadable&&me(this,this._readableState)})}N.prototype.destroy=G.destroy,N.prototype._undestroy=G.undestroy,N.prototype._destroy=function(l,c){c(l)},N.prototype[x.captureRejectionSymbol]=function(l){this.destroy(l)},N.prototype[_]=function(){let l;return this.destroyed||(l=this.readableEnded?null:new K,this.destroy(l)),new d((c,z)=>E(this,U=>U&&U!==l?z(U):c(null)))},N.prototype.push=function(l,c){return ce(this,l,c,!1)},N.prototype.unshift=function(l,c){return ce(this,l,c,!0)};function ce(l,c,z,U){S("readableAddChunk",c);const te=l._readableState;let be;if((te.state&k)===0&&(typeof c=="string"?(z=z||te.defaultEncoding,te.encoding!==z&&(U&&te.encoding?c=w.from(c,z).toString(te.encoding):(c=w.from(c,z),z=""))):c instanceof w?z="":q._isUint8Array(c)?(c=q._uint8ArrayToBuffer(c),z=""):c!=null&&(be=new fe("chunk",["string","Buffer","Uint8Array"],c))),be)p(l,be);else if(c===null)te.state&=~X,Me(l,te);else if((te.state&k)!==0||c&&c.length>0)if(U)if((te.state&L)!==0)p(l,new m);else{if(te.destroyed||te.errored)return!1;we(l,te,c,!0)}else if(te.ended)p(l,new F);else{if(te.destroyed||te.errored)return!1;te.state&=~X,te.decoder&&!z?(c=te.decoder.write(c),te.objectMode||c.length!==0?we(l,te,c,!1):me(l,te)):we(l,te,c,!1)}else U||(te.state&=~X,me(l,te));return!te.ended&&(te.length<te.highWaterMark||te.length===0)}function we(l,c,z,U){c.flowing&&c.length===0&&!c.sync&&l.listenerCount("data")>0?((c.state&$)!==0?c.awaitDrainWriters.clear():c.awaitDrainWriters=null,c.dataEmitted=!0,l.emit("data",z)):(c.length+=c.objectMode?1:z.length,U?c.buffer.unshift(z):c.buffer.push(z),(c.state&ie)!==0&&qe(l)),me(l,c)}N.prototype.isPaused=function(){const l=this._readableState;return l[ee]===!0||l.flowing===!1},N.prototype.setEncoding=function(l){const c=new ue(l);this._readableState.decoder=c,this._readableState.encoding=this._readableState.decoder.encoding;const z=this._readableState.buffer;let U="";for(const te of z)U+=c.write(te);return z.clear(),U!==""&&z.push(U),this._readableState.length=U.length,this};const de=1073741824;function Se(l){if(l>de)throw new R("size","<= 1GiB",l);return l--,l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,l|=l>>>16,l++,l}function ye(l,c){return l<=0||c.length===0&&c.ended?0:(c.state&k)!==0?1:n(l)?c.flowing&&c.length?c.buffer.first().length:c.length:l<=c.length?l:c.ended?c.length:0}N.prototype.read=function(l){S("read",l),l===void 0?l=NaN:r(l)||(l=i(l,10));const c=this._readableState,z=l;if(l>c.highWaterMark&&(c.highWaterMark=Se(l)),l!==0&&(c.state&=~I),l===0&&c.needReadable&&((c.highWaterMark!==0?c.length>=c.highWaterMark:c.length>0)||c.ended))return S("read: emitReadable",c.length,c.ended),c.length===0&&c.ended?Ft(this):qe(this),null;if(l=ye(l,c),l===0&&c.ended)return c.length===0&&Ft(this),null;let U=(c.state&ie)!==0;if(S("need readable",U),(c.length===0||c.length-l<c.highWaterMark)&&(U=!0,S("length less than watermark",U)),c.ended||c.reading||c.destroyed||c.errored||!c.constructed)U=!1,S("reading, ended or constructing",U);else if(U){S("do read"),c.state|=X|oe,c.length===0&&(c.state|=ie);try{this._read(c.highWaterMark)}catch(be){p(this,be)}c.state&=~oe,c.reading||(l=ye(z,c))}let te;return l>0?te=Lr(l,c):te=null,te===null?(c.needReadable=c.length<=c.highWaterMark,l=0):(c.length-=l,c.multiAwaitDrain?c.awaitDrainWriters.clear():c.awaitDrainWriters=null),c.length===0&&(c.ended||(c.needReadable=!0),z!==l&&c.ended&&Ft(this)),te!==null&&!c.errorEmitted&&!c.closeEmitted&&(c.dataEmitted=!0,this.emit("data",te)),te};function Me(l,c){if(S("onEofChunk"),!c.ended){if(c.decoder){const z=c.decoder.end();z&&z.length&&(c.buffer.push(z),c.length+=c.objectMode?1:z.length)}c.ended=!0,c.sync?qe(l):(c.needReadable=!1,c.emittedReadable=!0,vt(l))}}function qe(l){const c=l._readableState;S("emitReadable",c.needReadable,c.emittedReadable),c.needReadable=!1,c.emittedReadable||(S("emitReadable",c.flowing),c.emittedReadable=!0,e.nextTick(vt,l))}function vt(l){const c=l._readableState;S("emitReadable_",c.destroyed,c.length,c.ended),!c.destroyed&&!c.errored&&(c.length||c.ended)&&(l.emit("readable"),c.emittedReadable=!1),c.needReadable=!c.flowing&&!c.ended&&c.length<=c.highWaterMark,Or(l)}function me(l,c){!c.readingMore&&c.constructed&&(c.readingMore=!0,e.nextTick(ci,l,c))}function ci(l,c){for(;!c.reading&&!c.ended&&(c.length<c.highWaterMark||c.flowing&&c.length===0);){const z=c.length;if(S("maybeReadMore read 0"),l.read(0),z===c.length)break}c.readingMore=!1}N.prototype._read=function(l){throw new D("_read()")},N.prototype.pipe=function(l,c){const z=this,U=this._readableState;U.pipes.length===1&&(U.multiAwaitDrain||(U.multiAwaitDrain=!0,U.awaitDrainWriters=new h(U.awaitDrainWriters?[U.awaitDrainWriters]:[]))),U.pipes.push(l),S("pipe count=%d opts=%j",U.pipes.length,c);const be=(!c||c.end!==!1)&&l!==e.stdout&&l!==e.stderr?Pr:_t;U.endEmitted?e.nextTick(be):z.once("end",be),l.on("unpipe",Ie);function Ie(Ke,Ne){S("onunpipe"),Ke===z&&Ne&&Ne.hasUnpiped===!1&&(Ne.hasUnpiped=!0,wi())}function Pr(){S("onend"),l.end()}let Ue,Nr=!1;function wi(){S("cleanup"),l.removeListener("close",Ut),l.removeListener("finish",Kt),Ue&&l.removeListener("drain",Ue),l.removeListener("error",zt),l.removeListener("unpipe",Ie),z.removeListener("end",Pr),z.removeListener("end",_t),z.removeListener("data",Cr),Nr=!0,Ue&&U.awaitDrainWriters&&(!l._writableState||l._writableState.needDrain)&&Ue()}function xr(){Nr||(U.pipes.length===1&&U.pipes[0]===l?(S("false write response, pause",0),U.awaitDrainWriters=l,U.multiAwaitDrain=!1):U.pipes.length>1&&U.pipes.includes(l)&&(S("false write response, pause",U.awaitDrainWriters.size),U.awaitDrainWriters.add(l)),z.pause()),Ue||(Ue=di(z,l),l.on("drain",Ue))}z.on("data",Cr);function Cr(Ke){S("ondata");const Ne=l.write(Ke);S("dest.write",Ne),Ne===!1&&xr()}function zt(Ke){if(S("onerror",Ke),_t(),l.removeListener("error",zt),l.listenerCount("error")===0){const Ne=l._writableState||l._readableState;Ne&&!Ne.errorEmitted?p(l,Ke):l.emit("error",Ke)}}A(l,"error",zt);function Ut(){l.removeListener("finish",Kt),_t()}l.once("close",Ut);function Kt(){S("onfinish"),l.removeListener("close",Ut),_t()}l.once("finish",Kt);function _t(){S("unpipe"),z.unpipe(l)}return l.emit("pipe",z),l.writableNeedDrain===!0?xr():U.flowing||(S("pipe resume"),z.resume()),l};function di(l,c){return function(){const U=l._readableState;U.awaitDrainWriters===c?(S("pipeOnDrain",1),U.awaitDrainWriters=null):U.multiAwaitDrain&&(S("pipeOnDrain",U.awaitDrainWriters.size),U.awaitDrainWriters.delete(c)),(!U.awaitDrainWriters||U.awaitDrainWriters.size===0)&&l.listenerCount("data")&&l.resume()}}N.prototype.unpipe=function(l){const c=this._readableState,z={hasUnpiped:!1};if(c.pipes.length===0)return this;if(!l){const te=c.pipes;c.pipes=[],this.pause();for(let be=0;be<te.length;be++)te[be].emit("unpipe",this,{hasUnpiped:!1});return this}const U=t(c.pipes,l);return U===-1?this:(c.pipes.splice(U,1),c.pipes.length===0&&this.pause(),l.emit("unpipe",this,z),this)},N.prototype.on=function(l,c){const z=q.prototype.on.call(this,l,c),U=this._readableState;return l==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):l==="readable"&&!U.endEmitted&&!U.readableListening&&(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,S("on readable",U.length,U.reading),U.length?qe(this):U.reading||e.nextTick(hi,this)),z},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(l,c){const z=q.prototype.removeListener.call(this,l,c);return l==="readable"&&e.nextTick(Tr,this),z},N.prototype.off=N.prototype.removeListener,N.prototype.removeAllListeners=function(l){const c=q.prototype.removeAllListeners.apply(this,arguments);return(l==="readable"||l===void 0)&&e.nextTick(Tr,this),c};function Tr(l){const c=l._readableState;c.readableListening=l.listenerCount("readable")>0,c.resumeScheduled&&c[ee]===!1?c.flowing=!0:l.listenerCount("data")>0?l.resume():c.readableListening||(c.flowing=null)}function hi(l){S("readable nexttick read 0"),l.read(0)}N.prototype.resume=function(){const l=this._readableState;return l.flowing||(S("resume"),l.flowing=!l.readableListening,pi(this,l)),l[ee]=!1,this};function pi(l,c){c.resumeScheduled||(c.resumeScheduled=!0,e.nextTick(_i,l,c))}function _i(l,c){S("resume",c.reading),c.reading||l.read(0),c.resumeScheduled=!1,l.emit("resume"),Or(l),c.flowing&&!c.reading&&l.read(0)}N.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function Or(l){const c=l._readableState;for(S("flow",c.flowing);c.flowing&&l.read()!==null;);}N.prototype.wrap=function(l){let c=!1;l.on("data",U=>{!this.push(U)&&l.pause&&(c=!0,l.pause())}),l.on("end",()=>{this.push(null)}),l.on("error",U=>{p(this,U)}),l.on("close",()=>{this.destroy()}),l.on("destroy",()=>{this.destroy()}),this._read=()=>{c&&l.resume&&(c=!1,l.resume())};const z=a(l);for(let U=1;U<z.length;U++){const te=z[U];this[te]===void 0&&typeof l[te]=="function"&&(this[te]=l[te].bind(l))}return this},N.prototype[g]=function(){return Mr(this)},N.prototype.iterator=function(l){return l!==void 0&&Q(l,"options"),Mr(this,l)};function Mr(l,c){typeof l.read!="function"&&(l=N.wrap(l,{objectMode:!0}));const z=yi(l,c);return z.stream=l,z}async function*yi(l,c){let z=Z;function U(Ie){this===l?(z(),z=Z):z=Ie}l.on("readable",U);let te;const be=E(l,{writable:!1},Ie=>{te=Ie?Y(te,Ie):null,z(),z=Z});try{for(;;){const Ie=l.destroyed?null:l.read();if(Ie!==null)yield Ie;else{if(te)throw te;if(te===null)return;await new d(U)}}}catch(Ie){throw te=Y(te,Ie),te}finally{(te||c?.destroyOnReturn!==!1)&&(te===void 0||l._readableState.autoDestroy)?G.destroyer(l,null):(l.off("readable",U),be())}}o(N.prototype,{readable:{__proto__:null,get(){const l=this._readableState;return!!l&&l.readable!==!1&&!l.destroyed&&!l.errorEmitted&&!l.endEmitted},set(l){this._readableState&&(this._readableState.readable=!!l)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(l){this._readableState&&(this._readableState.flowing=l)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(l){this._readableState&&(this._readableState.destroyed=l)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(B.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(l){this[ee]=!!l}}}),N._fromList=Lr;function Lr(l,c){if(c.length===0)return null;let z;return c.objectMode?z=c.buffer.shift():!l||l>=c.length?(c.decoder?z=c.buffer.join(""):c.buffer.length===1?z=c.buffer.first():z=c.buffer.concat(c.length),c.buffer.clear()):z=c.buffer.consume(l,c.decoder),z}function Ft(l){const c=l._readableState;S("endReadable",c.endEmitted),c.endEmitted||(c.ended=!0,e.nextTick(bi,c,l))}function bi(l,c){if(S("endReadableNT",l.endEmitted,l.length),!l.errored&&!l.closeEmitted&&!l.endEmitted&&l.length===0){if(l.endEmitted=!0,c.emit("end"),c.writable&&c.allowHalfOpen===!1)e.nextTick(gi,c);else if(l.autoDestroy){const z=c._writableState;(!z||z.autoDestroy&&(z.finished||z.writable===!1))&&c.destroy()}}}function gi(l){l.writable&&!l.writableEnded&&!l.destroyed&&l.end()}N.from=function(l,c){return P(N,l,c)};let Bt;function Dr(){return Bt===void 0&&(Bt={}),Bt}return N.fromWeb=function(l,c){return Dr().newStreamReadableFromReadableStream(l,c)},N.toWeb=function(l,c){return Dr().newReadableStreamFromStreamReadable(l,c)},N.wrap=function(l,c){var z,U;return new N({objectMode:(z=(U=l.readableObjectMode)!==null&&U!==void 0?U:l.objectMode)!==null&&z!==void 0?z:!0,...c,destroy(te,be){G.destroyer(l,te),be(te)}}).wrap(l)},Ui}var Ki,$s;function ma(){if($s)return Ki;$s=1;const e=it(),{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:d,SymbolHasInstance:h}=Le();Ki=Q,Q.WritableState=m;const{EventEmitter:_}=It(),g=Sa().Stream,{Buffer:v}=nt(),x=Rr(),{addAbortSignal:q}=oi(),{getHighWaterMark:A,getDefaultHighWaterMark:w}=ai(),{ERR_INVALID_ARG_TYPE:M,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:J,ERR_STREAM_DESTROYED:G,ERR_STREAM_ALREADY_FINISHED:se,ERR_STREAM_NULL_VALUES:ae,ERR_STREAM_WRITE_AFTER_END:Y,ERR_UNKNOWN_ENCODING:fe}=Qe().codes,{errorOrDestroy:D}=x;a(Q.prototype,g.prototype),a(Q,g);function R(){}const F=d("kOnFinished");function m(u,f,b){typeof b!="boolean"&&(b=f instanceof At()),this.objectMode=!!(u&&u.objectMode),b&&(this.objectMode=this.objectMode||!!(u&&u.writableObjectMode)),this.highWaterMark=u?A(this,u,"writableHighWaterMark",b):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const T=!!(u&&u.decodeStrings===!1);this.decodeStrings=!T,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=p.bind(void 0,f),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,K(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!u||u.emitClose!==!1,this.autoDestroy=!u||u.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[F]=[]}function K(u){u.buffered=[],u.bufferedIndex=0,u.allBuffers=!0,u.allNoop=!0}m.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(m.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Q(u){const f=this instanceof At();if(!f&&!n(Q,this))return new Q(u);this._writableState=new m(u,this,f),u&&(typeof u.write=="function"&&(this._write=u.write),typeof u.writev=="function"&&(this._writev=u.writev),typeof u.destroy=="function"&&(this._destroy=u.destroy),typeof u.final=="function"&&(this._final=u.final),typeof u.construct=="function"&&(this._construct=u.construct),u.signal&&q(u.signal,this)),g.call(this,u),x.construct(this,()=>{const b=this._writableState;b.writing||X(this,b),I(this,b)})}i(Q,h,{__proto__:null,value:function(u){return n(this,u)?!0:this!==Q?!1:u&&u._writableState instanceof m}}),Q.prototype.pipe=function(){D(this,new J)};function ee(u,f,b,T){const $=u._writableState;if(typeof b=="function")T=b,b=$.defaultEncoding;else{if(!b)b=$.defaultEncoding;else if(b!=="buffer"&&!v.isEncoding(b))throw new fe(b);typeof T!="function"&&(T=R)}if(f===null)throw new ae;if(!$.objectMode)if(typeof f=="string")$.decodeStrings!==!1&&(f=v.from(f,b),b="buffer");else if(f instanceof v)b="buffer";else if(g._isUint8Array(f))f=g._uint8ArrayToBuffer(f),b="buffer";else throw new M("chunk",["string","Buffer","Uint8Array"],f);let j;return $.ending?j=new Y:$.destroyed&&(j=new G("write")),j?(e.nextTick(T,j),D(u,j,!0),j):($.pendingcb++,ue(u,$,f,b,T))}Q.prototype.write=function(u,f,b){return ee(this,u,f,b)===!0},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){const u=this._writableState;u.corked&&(u.corked--,u.writing||X(this,u))},Q.prototype.setDefaultEncoding=function(f){if(typeof f=="string"&&(f=s(f)),!v.isEncoding(f))throw new fe(f);return this._writableState.defaultEncoding=f,this};function ue(u,f,b,T,$){const j=f.objectMode?1:b.length;f.length+=j;const y=f.length<f.highWaterMark;return y||(f.needDrain=!0),f.writing||f.corked||f.errored||!f.constructed?(f.buffered.push({chunk:b,encoding:T,callback:$}),f.allBuffers&&T!=="buffer"&&(f.allBuffers=!1),f.allNoop&&$!==R&&(f.allNoop=!1)):(f.writelen=j,f.writecb=$,f.writing=!0,f.sync=!0,u._write(b,T,f.onwrite),f.sync=!1),y&&!f.errored&&!f.destroyed}function P(u,f,b,T,$,j,y){f.writelen=T,f.writecb=y,f.writing=!0,f.sync=!0,f.destroyed?f.onwrite(new G("write")):b?u._writev($,f.onwrite):u._write($,j,f.onwrite),f.sync=!1}function Z(u,f,b,T){--f.pendingcb,T(b),L(f),D(u,b)}function p(u,f){const b=u._writableState,T=b.sync,$=b.writecb;if(typeof $!="function"){D(u,new S);return}b.writing=!1,b.writecb=null,b.length-=b.writelen,b.writelen=0,f?(f.stack,b.errored||(b.errored=f),u._readableState&&!u._readableState.errored&&(u._readableState.errored=f),T?e.nextTick(Z,u,b,f,$):Z(u,b,f,$)):(b.buffered.length>b.bufferedIndex&&X(u,b),T?b.afterWriteTickInfo!==null&&b.afterWriteTickInfo.cb===$?b.afterWriteTickInfo.count++:(b.afterWriteTickInfo={count:1,cb:$,stream:u,state:b},e.nextTick(k,b.afterWriteTickInfo)):H(u,b,1,$))}function k({stream:u,state:f,count:b,cb:T}){return f.afterWriteTickInfo=null,H(u,f,b,T)}function H(u,f,b,T){for(!f.ending&&!u.destroyed&&f.length===0&&f.needDrain&&(f.needDrain=!1,u.emit("drain"));b-- >0;)f.pendingcb--,T();f.destroyed&&L(f),I(u,f)}function L(u){if(u.writing)return;for(let $=u.bufferedIndex;$<u.buffered.length;++$){var f;const{chunk:j,callback:y}=u.buffered[$],O=u.objectMode?1:j.length;u.length-=O,y((f=u.errored)!==null&&f!==void 0?f:new G("write"))}const b=u[F].splice(0);for(let $=0;$<b.length;$++){var T;b[$]((T=u.errored)!==null&&T!==void 0?T:new G("end"))}K(u)}function X(u,f){if(f.corked||f.bufferProcessing||f.destroyed||!f.constructed)return;const{buffered:b,bufferedIndex:T,objectMode:$}=f,j=b.length-T;if(!j)return;let y=T;if(f.bufferProcessing=!0,j>1&&u._writev){f.pendingcb-=j-1;const O=f.allNoop?R:N=>{for(let ce=y;ce<b.length;++ce)b[ce].callback(N)},B=f.allNoop&&y===0?b:t(b,y);B.allBuffers=f.allBuffers,P(u,f,!0,f.length,B,"",O),K(f)}else{do{const{chunk:O,encoding:B,callback:N}=b[y];b[y++]=null;const ce=$?1:O.length;P(u,f,!1,ce,O,B,N)}while(y<b.length&&!f.writing);y===b.length?K(f):y>256?(b.splice(0,y),f.bufferedIndex=0):f.bufferedIndex=y}f.bufferProcessing=!1}Q.prototype._write=function(u,f,b){if(this._writev)this._writev([{chunk:u,encoding:f}],b);else throw new E("_write()")},Q.prototype._writev=null,Q.prototype.end=function(u,f,b){const T=this._writableState;typeof u=="function"?(b=u,u=null,f=null):typeof f=="function"&&(b=f,f=null);let $;if(u!=null){const j=ee(this,u,f);j instanceof r&&($=j)}return T.corked&&(T.corked=1,this.uncork()),$||(!T.errored&&!T.ending?(T.ending=!0,I(this,T,!0),T.ended=!0):T.finished?$=new se("end"):T.destroyed&&($=new G("end"))),typeof b=="function"&&($||T.finished?e.nextTick(b,$):T[F].push(b)),this};function re(u){return u.ending&&!u.destroyed&&u.constructed&&u.length===0&&!u.errored&&u.buffered.length===0&&!u.finished&&!u.writing&&!u.errorEmitted&&!u.closeEmitted}function oe(u,f){let b=!1;function T($){if(b){D(u,$??S());return}if(b=!0,f.pendingcb--,$){const j=f[F].splice(0);for(let y=0;y<j.length;y++)j[y]($);D(u,$,f.sync)}else re(f)&&(f.prefinished=!0,u.emit("prefinish"),f.pendingcb++,e.nextTick(C,u,f))}f.sync=!0,f.pendingcb++;try{u._final(T)}catch($){T($)}f.sync=!1}function ie(u,f){!f.prefinished&&!f.finalCalled&&(typeof u._final=="function"&&!f.destroyed?(f.finalCalled=!0,oe(u,f)):(f.prefinished=!0,u.emit("prefinish")))}function I(u,f,b){re(f)&&(ie(u,f),f.pendingcb===0&&(b?(f.pendingcb++,e.nextTick((T,$)=>{re($)?C(T,$):$.pendingcb--},u,f)):re(f)&&(f.pendingcb++,C(u,f))))}function C(u,f){f.pendingcb--,f.finished=!0;const b=f[F].splice(0);for(let T=0;T<b.length;T++)b[T]();if(u.emit("finish"),f.autoDestroy){const T=u._readableState;(!T||T.autoDestroy&&(T.endEmitted||T.readable===!1))&&u.destroy()}}o(Q.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(u){this._writableState&&(this._writableState.destroyed=u)}},writable:{__proto__:null,get(){const u=this._writableState;return!!u&&u.writable!==!1&&!u.destroyed&&!u.errored&&!u.ending&&!u.ended},set(u){this._writableState&&(this._writableState.writable=!!u)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const u=this._writableState;return u?!u.destroyed&&!u.ending&&u.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const V=x.destroy;Q.prototype.destroy=function(u,f){const b=this._writableState;return!b.destroyed&&(b.bufferedIndex<b.buffered.length||b[F].length)&&e.nextTick(L,b),V.call(this,u,f),this},Q.prototype._undestroy=x.undestroy,Q.prototype._destroy=function(u,f){f(u)},Q.prototype[_.captureRejectionSymbol]=function(u){this.destroy(u)};let ne;function W(){return ne===void 0&&(ne={}),ne}return Q.fromWeb=function(u,f){return W().newStreamWritableFromWritableStream(u,f)},Q.toWeb=function(u){return W().newWritableStreamFromStreamWritable(u)},Ki}var Hi,qs;function Lc(){if(qs)return Hi;qs=1;const e=it(),t=nt(),{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:_}=Tt(),g=jt(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:x,ERR_INVALID_RETURN_VALUE:q}}=Qe(),{destroyer:A}=Rr(),w=At(),M=si(),E=ma(),{createDeferredPromise:S}=Ze(),J=Cl(),G=globalThis.Blob||t.Blob,se=typeof G<"u"?function(m){return m instanceof G}:function(m){return!1},ae=globalThis.AbortController||wt().AbortController,{FunctionPrototypeCall:Y}=Le();class fe extends w{constructor(m){super(m),m?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),m?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Hi=function F(m,K){if(d(m))return m;if(a(m))return R({readable:m});if(s(m))return R({writable:m});if(o(m))return R({writable:!1,readable:!1});if(h(m))return R({readable:M.fromWeb(m)});if(_(m))return R({writable:E.fromWeb(m)});if(typeof m=="function"){const{value:ee,write:ue,final:P,destroy:Z}=D(m);if(i(ee))return J(fe,ee,{objectMode:!0,write:ue,final:P,destroy:Z});const p=ee?.then;if(typeof p=="function"){let k;const H=Y(p,ee,L=>{if(L!=null)throw new q("nully","body",L)},L=>{A(k,L)});return k=new fe({objectMode:!0,readable:!1,write:ue,final(L){P(async()=>{try{await H,e.nextTick(L,null)}catch(X){e.nextTick(L,X)}})},destroy:Z})}throw new q("Iterable, AsyncIterable or AsyncFunction",K,ee)}if(se(m))return F(m.arrayBuffer());if(i(m))return J(fe,m,{objectMode:!0,writable:!1});if(h(m?.readable)&&_(m?.writable))return fe.fromWeb(m);if(typeof m?.writable=="object"||typeof m?.readable=="object"){const ee=m!=null&&m.readable?a(m?.readable)?m?.readable:F(m.readable):void 0,ue=m!=null&&m.writable?s(m?.writable)?m?.writable:F(m.writable):void 0;return R({readable:ee,writable:ue})}const Q=m?.then;if(typeof Q=="function"){let ee;return Y(Q,m,ue=>{ue!=null&&ee.push(ue),ee.push(null)},ue=>{A(ee,ue)}),ee=new fe({objectMode:!0,writable:!1,read(){}})}throw new x(K,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],m)};function D(F){let{promise:m,resolve:K}=S();const Q=new ae,ee=Q.signal;return{value:F((async function*(){for(;;){const P=m;m=null;const{chunk:Z,done:p,cb:k}=await P;if(e.nextTick(k),p)return;if(ee.aborted)throw new v(void 0,{cause:ee.reason});({promise:m,resolve:K}=S()),yield Z}})(),{signal:ee}),write(P,Z,p){const k=K;K=null,k({chunk:P,done:!1,cb:p})},final(P){const Z=K;K=null,Z({done:!0,cb:P})},destroy(P,Z){Q.abort(),Z(P)}}}function R(F){const m=F.readable&&typeof F.readable.read!="function"?M.wrap(F.readable):F.readable,K=F.writable;let Q=!!r(m),ee=!!n(K),ue,P,Z,p,k;function H(L){const X=p;p=null,X?X(L):L&&k.destroy(L)}return k=new fe({readableObjectMode:!!(m!=null&&m.readableObjectMode),writableObjectMode:!!(K!=null&&K.writableObjectMode),readable:Q,writable:ee}),ee&&(g(K,L=>{ee=!1,L&&A(m,L),H(L)}),k._write=function(L,X,re){K.write(L,X)?re():ue=re},k._final=function(L){K.end(),P=L},K.on("drain",function(){if(ue){const L=ue;ue=null,L()}}),K.on("finish",function(){if(P){const L=P;P=null,L()}})),Q&&(g(m,L=>{Q=!1,L&&A(m,L),H(L)}),m.on("readable",function(){if(Z){const L=Z;Z=null,L()}}),m.on("end",function(){k.push(null)}),k._read=function(){for(;;){const L=m.read();if(L===null){Z=k._read;return}if(!k.push(L))return}}),k._destroy=function(L,X){!L&&p!==null&&(L=new v),Z=null,ue=null,P=null,p===null?X(L):(p=X,A(K,L),A(m,L))},k}return Hi}var Vi,js;function At(){if(js)return Vi;js=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=Le();Vi=a;const i=si(),o=ma();n(a.prototype,i.prototype),n(a,i);{const _=r(o.prototype);for(let g=0;g<_.length;g++){const v=_[g];a.prototype[v]||(a.prototype[v]=o.prototype[v])}}function a(_){if(!(this instanceof a))return new a(_);i.call(this,_),o.call(this,_),_?(this.allowHalfOpen=_.allowHalfOpen!==!1,_.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),_.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(a.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(_){this._readableState&&this._writableState&&(this._readableState.destroyed=_,this._writableState.destroyed=_)}}});let s;function d(){return s===void 0&&(s={}),s}a.fromWeb=function(_,g){return d().newStreamDuplexFromReadableWritablePair(_,g)},a.toWeb=function(_){return d().newReadableWritablePairFromDuplex(_)};let h;return a.from=function(_){return h||(h=Lc()),h(_,"body")},Vi}var Gi,Ws;function kl(){if(Ws)return Gi;Ws=1;const{ObjectSetPrototypeOf:e,Symbol:t}=Le();Gi=a;const{ERR_METHOD_NOT_IMPLEMENTED:r}=Qe().codes,n=At(),{getHighWaterMark:i}=ai();e(a.prototype,n.prototype),e(a,n);const o=t("kCallback");function a(h){if(!(this instanceof a))return new a(h);const _=h?i(this,h,"readableHighWaterMark",!0):null;_===0&&(h={...h,highWaterMark:null,readableHighWaterMark:_,writableHighWaterMark:h.writableHighWaterMark||0}),n.call(this,h),this._readableState.sync=!1,this[o]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",d)}function s(h){typeof this._flush=="function"&&!this.destroyed?this._flush((_,g)=>{if(_){h?h(_):this.destroy(_);return}g!=null&&this.push(g),this.push(null),h&&h()}):(this.push(null),h&&h())}function d(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(h,_,g){throw new r("_transform()")},a.prototype._write=function(h,_,g){const v=this._readableState,x=this._writableState,q=v.length;this._transform(h,_,(A,w)=>{if(A){g(A);return}w!=null&&this.push(w),x.ended||q===v.length||v.length<v.highWaterMark?g():this[o]=g})},a.prototype._read=function(){if(this[o]){const h=this[o];this[o]=null,h()}},Gi}var Yi,Fs;function $l(){if(Fs)return Yi;Fs=1;const{ObjectSetPrototypeOf:e}=Le();Yi=r;const t=kl();e(r.prototype,t.prototype),e(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,i,o){o(null,n)},Yi}var Qi,Bs;function va(){if(Bs)return Qi;Bs=1;const e=it(),{ArrayIsArray:t,Promise:r,SymbolAsyncIterator:n,SymbolDispose:i}=Le(),o=jt(),{once:a}=Ze(),s=Rr(),d=At(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:x,ERR_STREAM_PREMATURE_CLOSE:q},AbortError:A}=Qe(),{validateFunction:w,validateAbortSignal:M}=In(),{isIterable:E,isReadable:S,isReadableNodeStream:J,isNodeStream:G,isTransformStream:se,isWebStream:ae,isReadableStream:Y,isReadableFinished:fe}=Tt(),D=globalThis.AbortController||wt().AbortController;let R,F,m;function K(L,X,re){let oe=!1;L.on("close",()=>{oe=!0});const ie=o(L,{readable:X,writable:re},I=>{oe=!I});return{destroy:I=>{oe||(oe=!0,s.destroyer(L,I||new x("pipe")))},cleanup:ie}}function Q(L){return w(L[L.length-1],"streams[stream.length - 1]"),L.pop()}function ee(L){if(E(L))return L;if(J(L))return ue(L);throw new _("val",["Readable","Iterable","AsyncIterable"],L)}async function*ue(L){F||(F=si()),yield*F.prototype[n].call(L)}async function P(L,X,re,{end:oe}){let ie,I=null;const C=W=>{if(W&&(ie=W),I){const u=I;I=null,u()}},V=()=>new r((W,u)=>{ie?u(ie):I=()=>{ie?u(ie):W()}});X.on("drain",C);const ne=o(X,{readable:!1},C);try{X.writableNeedDrain&&await V();for await(const W of L)X.write(W)||await V();oe&&(X.end(),await V()),re()}catch(W){re(ie!==W?h(ie,W):W)}finally{ne(),X.off("drain",C)}}async function Z(L,X,re,{end:oe}){se(X)&&(X=X.writable);const ie=X.getWriter();try{for await(const I of L)await ie.ready,ie.write(I).catch(()=>{});await ie.ready,oe&&await ie.close(),re()}catch(I){try{await ie.abort(I),re(I)}catch(C){re(C)}}}function p(...L){return k(L,a(Q(L)))}function k(L,X,re){if(L.length===1&&t(L[0])&&(L=L[0]),L.length<2)throw new v("streams");const oe=new D,ie=oe.signal,I=re?.signal,C=[];M(I,"options.signal");function V(){$(new A)}m=m||Ze().addAbortListener;let ne;I&&(ne=m(I,V));let W,u;const f=[];let b=0;function T(B){$(B,--b===0)}function $(B,N){var ce;if(B&&(!W||W.code==="ERR_STREAM_PREMATURE_CLOSE")&&(W=B),!(!W&&!N)){for(;f.length;)f.shift()(W);(ce=ne)===null||ce===void 0||ce[i](),oe.abort(),N&&(W||C.forEach(we=>we()),e.nextTick(X,W,u))}}let j;for(let B=0;B<L.length;B++){const N=L[B],ce=B<L.length-1,we=B>0,de=ce||re?.end!==!1,Se=B===L.length-1;if(G(N)){let ye=function(Me){Me&&Me.name!=="AbortError"&&Me.code!=="ERR_STREAM_PREMATURE_CLOSE"&&T(Me)};if(de){const{destroy:Me,cleanup:qe}=K(N,ce,we);f.push(Me),S(N)&&Se&&C.push(qe)}N.on("error",ye),S(N)&&Se&&C.push(()=>{N.removeListener("error",ye)})}if(B===0)if(typeof N=="function"){if(j=N({signal:ie}),!E(j))throw new g("Iterable, AsyncIterable or Stream","source",j)}else E(N)||J(N)||se(N)?j=N:j=d.from(N);else if(typeof N=="function"){if(se(j)){var y;j=ee((y=j)===null||y===void 0?void 0:y.readable)}else j=ee(j);if(j=N(j,{signal:ie}),ce){if(!E(j,!0))throw new g("AsyncIterable",`transform[${B-1}]`,j)}else{var O;R||(R=$l());const ye=new R({objectMode:!0}),Me=(O=j)===null||O===void 0?void 0:O.then;if(typeof Me=="function")b++,Me.call(j,me=>{u=me,me!=null&&ye.write(me),de&&ye.end(),e.nextTick(T)},me=>{ye.destroy(me),e.nextTick(T,me)});else if(E(j,!0))b++,P(j,ye,T,{end:de});else if(Y(j)||se(j)){const me=j.readable||j;b++,P(me,ye,T,{end:de})}else throw new g("AsyncIterable or Promise","destination",j);j=ye;const{destroy:qe,cleanup:vt}=K(j,!1,!0);f.push(qe),Se&&C.push(vt)}}else if(G(N)){if(J(j)){b+=2;const ye=H(j,N,T,{end:de});S(N)&&Se&&C.push(ye)}else if(se(j)||Y(j)){const ye=j.readable||j;b++,P(ye,N,T,{end:de})}else if(E(j))b++,P(j,N,T,{end:de});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],j);j=N}else if(ae(N)){if(J(j))b++,Z(ee(j),N,T,{end:de});else if(Y(j)||E(j))b++,Z(j,N,T,{end:de});else if(se(j))b++,Z(j.readable,N,T,{end:de});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],j);j=N}else j=d.from(N)}return(ie!=null&&ie.aborted||I!=null&&I.aborted)&&e.nextTick(V),j}function H(L,X,re,{end:oe}){let ie=!1;if(X.on("close",()=>{ie||re(new q)}),L.pipe(X,{end:!1}),oe){let I=function(){ie=!0,X.end()};fe(L)?e.nextTick(I):L.once("end",I)}else re();return o(L,{readable:!0,writable:!1},I=>{const C=L._readableState;I&&I.code==="ERR_STREAM_PREMATURE_CLOSE"&&C&&C.ended&&!C.errored&&!C.errorEmitted?L.once("end",re).once("error",re):re(I)}),o(X,{readable:!1,writable:!0},re)}return Qi={pipelineImpl:k,pipeline:p},Qi}var Ji,zs;function ql(){if(zs)return Ji;zs=1;const{pipeline:e}=va(),t=At(),{destroyer:r}=Rr(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:d,isReadableStream:h}=Tt(),{AbortError:_,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:v}}=Qe(),x=jt();return Ji=function(...A){if(A.length===0)throw new v("streams");if(A.length===1)return t.from(A[0]);const w=[...A];if(typeof A[0]=="function"&&(A[0]=t.from(A[0])),typeof A[A.length-1]=="function"){const R=A.length-1;A[R]=t.from(A[R])}for(let R=0;R<A.length;++R)if(!(!n(A[R])&&!a(A[R]))){if(R<A.length-1&&!(i(A[R])||h(A[R])||s(A[R])))throw new g(`streams[${R}]`,w[R],"must be readable");if(R>0&&!(o(A[R])||d(A[R])||s(A[R])))throw new g(`streams[${R}]`,w[R],"must be writable")}let M,E,S,J,G;function se(R){const F=J;J=null,F?F(R):R?G.destroy(R):!D&&!fe&&G.destroy()}const ae=A[0],Y=e(A,se),fe=!!(o(ae)||d(ae)||s(ae)),D=!!(i(Y)||h(Y)||s(Y));if(G=new t({writableObjectMode:!!(ae!=null&&ae.writableObjectMode),readableObjectMode:!!(Y!=null&&Y.readableObjectMode),writable:fe,readable:D}),fe){if(n(ae))G._write=function(F,m,K){ae.write(F,m)?K():M=K},G._final=function(F){ae.end(),E=F},ae.on("drain",function(){if(M){const F=M;M=null,F()}});else if(a(ae)){const m=(s(ae)?ae.writable:ae).getWriter();G._write=async function(K,Q,ee){try{await m.ready,m.write(K).catch(()=>{}),ee()}catch(ue){ee(ue)}},G._final=async function(K){try{await m.ready,m.close().catch(()=>{}),E=K}catch(Q){K(Q)}}}const R=s(Y)?Y.readable:Y;x(R,()=>{if(E){const F=E;E=null,F()}})}if(D){if(n(Y))Y.on("readable",function(){if(S){const R=S;S=null,R()}}),Y.on("end",function(){G.push(null)}),G._read=function(){for(;;){const R=Y.read();if(R===null){S=G._read;return}if(!G.push(R))return}};else if(a(Y)){const F=(s(Y)?Y.readable:Y).getReader();G._read=async function(){for(;;)try{const{value:m,done:K}=await F.read();if(!G.push(m))return;if(K){G.push(null);return}}catch{return}}}}return G._destroy=function(R,F){!R&&J!==null&&(R=new _),S=null,M=null,E=null,J===null?F(R):(J=F,n(Y)&&r(Y,R))},G},Ji}var Us;function Dc(){if(Us)return $n;Us=1;const e=globalThis.AbortController||wt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=Qe(),{validateAbortSignal:a,validateInteger:s,validateObject:d}=In(),h=Le().Symbol("kWeak"),_=Le().Symbol("kResistStopPropagation"),{finished:g}=jt(),v=ql(),{addAbortSignalNoValidate:x}=oi(),{isWritable:q,isNodeStream:A}=Tt(),{deprecate:w}=Ze(),{ArrayPrototypePush:M,Boolean:E,MathFloor:S,Number:J,NumberIsNaN:G,Promise:se,PromiseReject:ae,PromiseResolve:Y,PromisePrototypeThen:fe,Symbol:D}=Le(),R=D("kEmpty"),F=D("kEof");function m(I,C){if(C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),A(I)&&!q(I))throw new t("stream",I,"must be writable");const V=v(this,I);return C!=null&&C.signal&&x(C.signal,V),V}function K(I,C){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal");let V=1;C?.concurrency!=null&&(V=S(C.concurrency));let ne=V-1;return C?.highWaterMark!=null&&(ne=S(C.highWaterMark)),s(V,"options.concurrency",1),s(ne,"options.highWaterMark",0),ne+=V,(async function*(){const u=Ze().AbortSignalAny([C?.signal].filter(E)),f=this,b=[],T={signal:u};let $,j,y=!1,O=0;function B(){y=!0,N()}function N(){O-=1,ce()}function ce(){j&&!y&&O<V&&b.length<ne&&(j(),j=null)}async function we(){try{for await(let de of f){if(y)return;if(u.aborted)throw new o;try{if(de=I(de,T),de===R)continue;de=Y(de)}catch(Se){de=ae(Se)}O+=1,fe(de,N,B),b.push(de),$&&($(),$=null),!y&&(b.length>=ne||O>=V)&&await new se(Se=>{j=Se})}b.push(F)}catch(de){const Se=ae(de);fe(Se,N,B),b.push(Se)}finally{y=!0,$&&($(),$=null)}}we();try{for(;;){for(;b.length>0;){const de=await b[0];if(de===F)return;if(u.aborted)throw new o;de!==R&&(yield de),b.shift(),ce()}await new se(de=>{$=de})}}finally{y=!0,j&&(j(),j=null)}}).call(this)}function Q(I=void 0){return I!=null&&d(I,"options"),I?.signal!=null&&a(I.signal,"options.signal"),(async function*(){let V=0;for await(const W of this){var ne;if(I!=null&&(ne=I.signal)!==null&&ne!==void 0&&ne.aborted)throw new o({cause:I.signal.reason});yield[V++,W]}}).call(this)}async function ee(I,C=void 0){for await(const V of p.call(this,I,C))return!0;return!1}async function ue(I,C=void 0){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);return!await ee.call(this,async(...V)=>!await I(...V),C)}async function P(I,C){for await(const V of p.call(this,I,C))return V}async function Z(I,C){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);async function V(ne,W){return await I(ne,W),R}for await(const ne of K.call(this,V,C));}function p(I,C){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);async function V(ne,W){return await I(ne,W)?ne:R}return K.call(this,V,C)}class k extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function H(I,C,V){var ne;if(typeof I!="function")throw new r("reducer",["Function","AsyncFunction"],I);V!=null&&d(V,"options"),V?.signal!=null&&a(V.signal,"options.signal");let W=arguments.length>1;if(V!=null&&(ne=V.signal)!==null&&ne!==void 0&&ne.aborted){const $=new o(void 0,{cause:V.signal.reason});throw this.once("error",()=>{}),await g(this.destroy($)),$}const u=new e,f=u.signal;if(V!=null&&V.signal){const $={once:!0,[h]:this,[_]:!0};V.signal.addEventListener("abort",()=>u.abort(),$)}let b=!1;try{for await(const $ of this){var T;if(b=!0,V!=null&&(T=V.signal)!==null&&T!==void 0&&T.aborted)throw new o;W?C=await I(C,$,{signal:f}):(C=$,W=!0)}if(!b&&!W)throw new k}finally{u.abort()}return C}async function L(I){I!=null&&d(I,"options"),I?.signal!=null&&a(I.signal,"options.signal");const C=[];for await(const ne of this){var V;if(I!=null&&(V=I.signal)!==null&&V!==void 0&&V.aborted)throw new o(void 0,{cause:I.signal.reason});M(C,ne)}return C}function X(I,C){const V=K.call(this,I,C);return(async function*(){for await(const W of V)yield*W}).call(this)}function re(I){if(I=J(I),G(I))return 0;if(I<0)throw new i("number",">= 0",I);return I}function oe(I,C=void 0){return C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),I=re(I),(async function*(){var ne;if(C!=null&&(ne=C.signal)!==null&&ne!==void 0&&ne.aborted)throw new o;for await(const u of this){var W;if(C!=null&&(W=C.signal)!==null&&W!==void 0&&W.aborted)throw new o;I--<=0&&(yield u)}}).call(this)}function ie(I,C=void 0){return C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),I=re(I),(async function*(){var ne;if(C!=null&&(ne=C.signal)!==null&&ne!==void 0&&ne.aborted)throw new o;for await(const u of this){var W;if(C!=null&&(W=C.signal)!==null&&W!==void 0&&W.aborted)throw new o;if(I-- >0&&(yield u),I<=0)return}}).call(this)}return $n.streamReturningOperators={asIndexedPairs:w(Q,"readable.asIndexedPairs will be removed in a future version."),drop:oe,filter:p,flatMap:X,map:K,take:ie,compose:m},$n.promiseReturningOperators={every:ue,forEach:Z,reduce:H,toArray:L,some:ee,find:P},$n}var Xi,Ks;function jl(){if(Ks)return Xi;Ks=1;const{ArrayPrototypePop:e,Promise:t}=Le(),{isIterable:r,isNodeStream:n,isWebStream:i}=Tt(),{pipelineImpl:o}=va(),{finished:a}=jt();Wl();function s(...d){return new t((h,_)=>{let g,v;const x=d[d.length-1];if(x&&typeof x=="object"&&!n(x)&&!r(x)&&!i(x)){const q=e(d);g=q.signal,v=q.end}o(d,(q,A)=>{q?_(q):h(A)},{signal:g,end:v})})}return Xi={finished:a,pipeline:s},Xi}var Hs;function Wl(){if(Hs)return Di.exports;Hs=1;const{Buffer:e}=nt(),{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=Le(),{promisify:{custom:i}}=Ze(),{streamReturningOperators:o,promiseReturningOperators:a}=Dc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=Qe(),d=ql(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:_}=ai(),{pipeline:g}=va(),{destroyer:v}=Rr(),x=jt(),q=jl(),A=Tt(),w=Di.exports=Sa().Stream;w.isDestroyed=A.isDestroyed,w.isDisturbed=A.isDisturbed,w.isErrored=A.isErrored,w.isReadable=A.isReadable,w.isWritable=A.isWritable,w.Readable=si();for(const E of r(o)){let J=function(...G){if(new.target)throw s();return w.Readable.from(n(S,this,G))};const S=o[E];t(J,"name",{__proto__:null,value:S.name}),t(J,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:J,enumerable:!1,configurable:!0,writable:!0})}for(const E of r(a)){let J=function(...G){if(new.target)throw s();return n(S,this,G)};const S=a[E];t(J,"name",{__proto__:null,value:S.name}),t(J,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:J,enumerable:!1,configurable:!0,writable:!0})}w.Writable=ma(),w.Duplex=At(),w.Transform=kl(),w.PassThrough=$l(),w.pipeline=g;const{addAbortSignal:M}=oi();return w.addAbortSignal=M,w.finished=x,w.destroy=v,w.compose=d,w.setDefaultHighWaterMark=h,w.getDefaultHighWaterMark=_,t(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return q}}),t(g,i,{__proto__:null,enumerable:!0,get(){return q.pipeline}}),t(x,i,{__proto__:null,enumerable:!0,get(){return q.finished}}),w.Stream=w,w._isUint8Array=function(S){return S instanceof Uint8Array},w._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},Di.exports}var Vs;function Pc(){return Vs||(Vs=1,(function(e){const t=Wl(),r=jl(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Li)),Li.exports}var Gs;function Nc(){if(Gs)return Ur;Gs=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.ActorQueryResultSerializeStats=void 0;const e=Dl(),t=vc(),r=qt(),n=Nl(),i=Pc();let o=class extends e.ActorQueryResultSerializeFixedMediaTypes{constructor(s){super(s)}async testHandleChecked(s,d){return["bindings","quads"].includes(s.type)?(0,r.passTestVoid)():(0,r.failTest)("This actor can only handle bindings streams or quad streams.")}pushHeader(s){const d=["Result","Delay (ms)","HTTP requests"].join(",");s.push(`${d}
|
|
5
|
+
`)}createStat(s,d){return`${[d,this.delay(s),this.httpObserver.requests].join(",")}
|
|
6
|
+
`}createSpecialLine(s,d){return`${[s,this.delay(d),this.httpObserver.requests].join(",")}
|
|
7
|
+
`}async runHandle(s,d,h){const _=new i.Readable,g=s.type==="bindings"?s.bindingsStream:s.quadStream,v=s.context.getSafe(t.KeysInitQuery.queryTimestampHighResolution);let x=1;function*q(w){yield w()}const A=(0,n.wrap)(g).map(()=>this.createStat(v,x++)).prepend([this.createSpecialLine("PLANNING",v)]).append((0,n.wrap)(q(()=>this.createSpecialLine("TOTAL",v))));return this.pushHeader(_),_.wrap(A),{data:_}}now(){return performance.now()}delay(s){return this.now()-s}};return Ur.ActorQueryResultSerializeStats=o,Ur}var Ys;function xc(){return Ys||(Ys=1,(function(e){var t=Ht&&Ht.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Ht&&Ht.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(bc(),e),r(Nc(),e)})(Ht)),Ht}var Cc=xc(),Xt={},Jr={},Qs;function kc(){if(Qs)return Jr;Qs=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.ActionObserverHttp=void 0;const e=qt();let t=class extends e.ActionObserver{constructor(n){super(n),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener(()=>{this.requests=0})}onRun(n,i,o){this.observedActors.includes(n.name)&&this.requests++}};return Jr.ActionObserverHttp=t,Jr}var Xr={},Zi={exports:{}},eo={exports:{}},to,Js;function De(){if(Js)return to;Js=1;class e extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let i=0;i<r.length;i++)n+=` ${r[i].stack}
|
|
8
|
+
`;super(n),this.name="AggregateError",this.errors=r}}return to={AggregateError:e,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,r){return t.includes(r)},ArrayPrototypeIndexOf(t,r){return t.indexOf(r)},ArrayPrototypeJoin(t,r){return t.join(r)},ArrayPrototypeMap(t,r){return t.map(r)},ArrayPrototypePop(t,r){return t.pop(r)},ArrayPrototypePush(t,r){return t.push(r)},ArrayPrototypeSlice(t,r,n){return t.slice(r,n)},Error,FunctionPrototypeCall(t,r,...n){return t.call(r,...n)},FunctionPrototypeSymbolHasInstance(t,r){return Function.prototype[Symbol.hasInstance].call(t,r)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,r){return Object.defineProperties(t,r)},ObjectDefineProperty(t,r,n){return Object.defineProperty(t,r,n)},ObjectGetOwnPropertyDescriptor(t,r){return Object.getOwnPropertyDescriptor(t,r)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,r){return Object.setPrototypeOf(t,r)},Promise,PromisePrototypeCatch(t,r){return t.catch(r)},PromisePrototypeThen(t,r,n){return t.then(r,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,r){return t.test(r)},SafeSet:Set,String,StringPrototypeSlice(t,r,n){return t.slice(r,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,r,n){return t.set(r,n)},Boolean,Uint8Array},to}var ro={exports:{}},no,Xs;function Fl(){return Xs||(Xs=1,no={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){const i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}),no}var io,Zs;function Je(){if(Zs)return io;Zs=1;const{format:e,inspect:t}=Fl(),{AggregateError:r}=De(),n=globalThis.AggregateError||r,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",d={};function h(w,M){if(!w)throw new d.ERR_INTERNAL_ASSERTION(M)}function _(w){let M="",E=w.length;const S=w[0]==="-"?1:0;for(;E>=S+4;E-=3)M=`_${w.slice(E-3,E)}${M}`;return`${w.slice(0,E)}${M}`}function g(w,M,E){if(typeof M=="function")return h(M.length<=E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${M.length}).`),M(...E);const S=(M.match(/%[dfijoOs]/g)||[]).length;return h(S===E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${S}).`),E.length===0?M:e(M,...E)}function v(w,M,E){E||(E=Error);class S extends E{constructor(...G){super(g(w,M,G))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(S.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),S.prototype.code=w,S.prototype[i]=!0,d[w]=S}function x(w){const M=s+w.name;return Object.defineProperty(w,"name",{value:M}),w}function q(w,M){if(w&&M&&w!==M){if(Array.isArray(M.errors))return M.errors.push(w),M;const E=new n([M,w],M.message);return E.code=M.code,E}return w||M}class A extends Error{constructor(M="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new d.ERR_INVALID_ARG_TYPE("options","Object",E);super(M,E),this.code="ABORT_ERR",this.name="AbortError"}}return v("ERR_ASSERTION","%s",Error),v("ERR_INVALID_ARG_TYPE",(w,M,E)=>{h(typeof w=="string","'name' must be a string"),Array.isArray(M)||(M=[M]);let S="The ";w.endsWith(" argument")?S+=`${w} `:S+=`"${w}" ${w.includes(".")?"property":"argument"} `,S+="must be ";const J=[],G=[],se=[];for(const Y of M)h(typeof Y=="string","All expected entries have to be of type string"),o.includes(Y)?J.push(Y.toLowerCase()):a.test(Y)?G.push(Y):(h(Y!=="object",'The value "object" should be written as "Object"'),se.push(Y));if(G.length>0){const Y=J.indexOf("object");Y!==-1&&(J.splice(J,Y,1),G.push("Object"))}if(J.length>0){switch(J.length){case 1:S+=`of type ${J[0]}`;break;case 2:S+=`one of type ${J[0]} or ${J[1]}`;break;default:{const Y=J.pop();S+=`one of type ${J.join(", ")}, or ${Y}`}}(G.length>0||se.length>0)&&(S+=" or ")}if(G.length>0){switch(G.length){case 1:S+=`an instance of ${G[0]}`;break;case 2:S+=`an instance of ${G[0]} or ${G[1]}`;break;default:{const Y=G.pop();S+=`an instance of ${G.join(", ")}, or ${Y}`}}se.length>0&&(S+=" or ")}switch(se.length){case 0:break;case 1:se[0].toLowerCase()!==se[0]&&(S+="an "),S+=`${se[0]}`;break;case 2:S+=`one of ${se[0]} or ${se[1]}`;break;default:{const Y=se.pop();S+=`one of ${se.join(", ")}, or ${Y}`}}if(E==null)S+=`. Received ${E}`;else if(typeof E=="function"&&E.name)S+=`. Received function ${E.name}`;else if(typeof E=="object"){var ae;if((ae=E.constructor)!==null&&ae!==void 0&&ae.name)S+=`. Received an instance of ${E.constructor.name}`;else{const Y=t(E,{depth:-1});S+=`. Received ${Y}`}}else{let Y=t(E,{colors:!1});Y.length>25&&(Y=`${Y.slice(0,25)}...`),S+=`. Received type ${typeof E} (${Y})`}return S},TypeError),v("ERR_INVALID_ARG_VALUE",(w,M,E="is invalid")=>{let S=t(M);return S.length>128&&(S=S.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${E}. Received ${S}`},TypeError),v("ERR_INVALID_RETURN_VALUE",(w,M,E)=>{var S;const J=E!=null&&(S=E.constructor)!==null&&S!==void 0&&S.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${w} to be returned from the "${M}" function but got ${J}.`},TypeError),v("ERR_MISSING_ARGS",(...w)=>{h(w.length>0,"At least one arg needs to be specified");let M;const E=w.length;switch(w=(Array.isArray(w)?w:[w]).map(S=>`"${S}"`).join(" or "),E){case 1:M+=`The ${w[0]} argument`;break;case 2:M+=`The ${w[0]} and ${w[1]} arguments`;break;default:{const S=w.pop();M+=`The ${w.join(", ")}, and ${S} arguments`}break}return`${M} must be specified`},TypeError),v("ERR_OUT_OF_RANGE",(w,M,E)=>{h(M,'Missing "range" argument');let S;if(Number.isInteger(E)&&Math.abs(E)>2**32)S=_(String(E));else if(typeof E=="bigint"){S=String(E);const J=BigInt(2)**BigInt(32);(E>J||E<-J)&&(S=_(S)),S+="n"}else S=t(E);return`The value of "${w}" is out of range. It must be ${M}. Received ${S}`},RangeError),v("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),v("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),v("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),v("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),v("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),v("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),v("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),v("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),v("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),v("ERR_STREAM_WRITE_AFTER_END","write after end",Error),v("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),io={AbortError:A,aggregateTwoErrors:x(q),hideStackFrames:x,codes:d},io}var eu;function et(){return eu||(eu=1,(function(e){const t=nt(),{format:r,inspect:n}=Fl(),{codes:{ERR_INVALID_ARG_TYPE:i}}=Je(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=De(),d=globalThis.AbortSignal||wt().AbortSignal,h=globalThis.AbortController||wt().AbortController,_=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,v=typeof g<"u"?function(w){return w instanceof g}:function(w){return!1},x=(A,w)=>{if(A!==void 0&&(A===null||typeof A!="object"||!("aborted"in A)))throw new i(w,"AbortSignal",A)},q=(A,w)=>{if(typeof A!="function")throw new i(w,"Function",A)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(A){let w=!1;return function(...M){w||(w=!0,A.apply(this,M))}},createDeferredPromise:function(){let A,w;return{promise:new Promise((E,S)=>{A=E,w=S}),resolve:A,reject:w}},promisify(A){return new Promise((w,M)=>{A((E,...S)=>E?M(E):w(...S))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(A){return A instanceof _},isArrayBufferView(A){return ArrayBuffer.isView(A)}},isBlob:v,deprecate(A,w){return A},addAbortListener:It().addAbortListener||function(w,M){if(w===void 0)throw new i("signal","AbortSignal",w);x(w,"signal"),q(M,"listener");let E;return w.aborted?queueMicrotask(()=>M()):(w.addEventListener("abort",M,{__proto__:null,once:!0,[o]:!0}),E=()=>{w.removeEventListener("abort",M)}),{__proto__:null,[s](){var S;(S=E)===null||S===void 0||S()}}},AbortSignalAny:d.any||function(w){if(w.length===1)return w[0];const M=new h,E=()=>M.abort();return w.forEach(S=>{x(S,"signals"),S.addEventListener("abort",E,{once:!0})}),M.signal.addEventListener("abort",()=>{w.forEach(S=>S.removeEventListener("abort",E))},{once:!0}),M.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(ro)),ro.exports}var jn={},oo,tu;function Tn(){if(tu)return oo;tu=1;const{ArrayIsArray:e,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:r,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:d,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:_,String:g,StringPrototypeToUpperCase:v,StringPrototypeTrim:x}=De(),{hideStackFrames:q,codes:{ERR_SOCKET_BAD_PORT:A,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:M,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:S}}=Je(),{normalizeEncoding:J}=et(),{isAsyncFunction:G,isArrayBufferView:se}=et().types,ae={};function Y(y){return y===(y|0)}function fe(y){return y===y>>>0}const D=/^[0-7]+$/,R="must be a 32-bit unsigned integer or an octal string";function F(y,O,B){if(typeof y>"u"&&(y=B),typeof y=="string"){if(_(D,y)===null)throw new M(O,y,R);y=d(y,8)}return Q(y,O),y}const m=q((y,O,B=s,N=a)=>{if(typeof y!="number")throw new w(O,"number",y);if(!i(y))throw new E(O,"an integer",y);if(y<B||y>N)throw new E(O,`>= ${B} && <= ${N}`,y)}),K=q((y,O,B=-2147483648,N=2147483647)=>{if(typeof y!="number")throw new w(O,"number",y);if(!i(y))throw new E(O,"an integer",y);if(y<B||y>N)throw new E(O,`>= ${B} && <= ${N}`,y)}),Q=q((y,O,B=!1)=>{if(typeof y!="number")throw new w(O,"number",y);if(!i(y))throw new E(O,"an integer",y);const N=B?1:0,ce=4294967295;if(y<N||y>ce)throw new E(O,`>= ${N} && <= ${ce}`,y)});function ee(y,O){if(typeof y!="string")throw new w(O,"string",y)}function ue(y,O,B=void 0,N){if(typeof y!="number")throw new w(O,"number",y);if(B!=null&&y<B||N!=null&&y>N||(B!=null||N!=null)&&o(y))throw new E(O,`${B!=null?`>= ${B}`:""}${B!=null&&N!=null?" && ":""}${N!=null?`<= ${N}`:""}`,y)}const P=q((y,O,B)=>{if(!t(B,y)){const ce="must be one of: "+r(n(B,we=>typeof we=="string"?`'${we}'`:g(we)),", ");throw new M(O,y,ce)}});function Z(y,O){if(typeof y!="boolean")throw new w(O,"boolean",y)}function p(y,O,B){return y==null||!h(y,O)?B:y[O]}const k=q((y,O,B=null)=>{const N=p(B,"allowArray",!1),ce=p(B,"allowFunction",!1);if(!p(B,"nullable",!1)&&y===null||!N&&e(y)||typeof y!="object"&&(!ce||typeof y!="function"))throw new w(O,"Object",y)}),H=q((y,O)=>{if(y!=null&&typeof y!="object"&&typeof y!="function")throw new w(O,"a dictionary",y)}),L=q((y,O,B=0)=>{if(!e(y))throw new w(O,"Array",y);if(y.length<B){const N=`must be longer than ${B}`;throw new M(O,y,N)}});function X(y,O){L(y,O);for(let B=0;B<y.length;B++)ee(y[B],`${O}[${B}]`)}function re(y,O){L(y,O);for(let B=0;B<y.length;B++)Z(y[B],`${O}[${B}]`)}function oe(y,O){L(y,O);for(let B=0;B<y.length;B++){const N=y[B],ce=`${O}[${B}]`;if(N==null)throw new w(ce,"AbortSignal",N);ne(N,ce)}}function ie(y,O="signal"){if(ee(y,O),ae[y]===void 0)throw ae[v(y)]!==void 0?new S(y+" (signals must use all capital letters)"):new S(y)}const I=q((y,O="buffer")=>{if(!se(y))throw new w(O,["Buffer","TypedArray","DataView"],y)});function C(y,O){const B=J(O),N=y.length;if(B==="hex"&&N%2!==0)throw new M("encoding",O,`is invalid for data of length ${N}`)}function V(y,O="Port",B=!0){if(typeof y!="number"&&typeof y!="string"||typeof y=="string"&&x(y).length===0||+y!==+y>>>0||y>65535||y===0&&!B)throw new A(O,y,B);return y|0}const ne=q((y,O)=>{if(y!==void 0&&(y===null||typeof y!="object"||!("aborted"in y)))throw new w(O,"AbortSignal",y)}),W=q((y,O)=>{if(typeof y!="function")throw new w(O,"Function",y)}),u=q((y,O)=>{if(typeof y!="function"||G(y))throw new w(O,"Function",y)}),f=q((y,O)=>{if(y!==void 0)throw new w(O,"undefined",y)});function b(y,O,B){if(!t(B,y))throw new w(O,`('${r(B,"|")}')`,y)}const T=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function $(y,O){if(typeof y>"u"||!_(T,y))throw new M(O,y,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function j(y){if(typeof y=="string")return $(y,"hints"),y;if(e(y)){const O=y.length;let B="";if(O===0)return B;for(let N=0;N<O;N++){const ce=y[N];$(ce,"hints"),B+=ce,N!==O-1&&(B+=", ")}return B}throw new M("hints",y,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return oo={isInt32:Y,isUint32:fe,parseFileMode:F,validateArray:L,validateStringArray:X,validateBooleanArray:re,validateAbortSignalArray:oe,validateBoolean:Z,validateBuffer:I,validateDictionary:H,validateEncoding:C,validateFunction:W,validateInt32:K,validateInteger:m,validateNumber:ue,validateObject:k,validateOneOf:P,validatePlainFunction:u,validatePort:V,validateSignalName:ie,validateString:ee,validateUint32:Q,validateUndefined:f,validateUnion:b,validateAbortSignal:ne,validateLinkHeaderValue:j},oo}var Wn={exports:{}},ao,ru;function Ot(){if(ru)return ao;ru=1;const{SymbolAsyncIterator:e,SymbolIterator:t,SymbolFor:r}=De(),n=r("nodejs.stream.destroyed"),i=r("nodejs.stream.errored"),o=r("nodejs.stream.readable"),a=r("nodejs.stream.writable"),s=r("nodejs.stream.disturbed"),d=r("nodejs.webstream.isClosedPromise"),h=r("nodejs.webstream.controllerErrorFunction");function _(p,k=!1){var H;return!!(p&&typeof p.pipe=="function"&&typeof p.on=="function"&&(!k||typeof p.pause=="function"&&typeof p.resume=="function")&&(!p._writableState||((H=p._readableState)===null||H===void 0?void 0:H.readable)!==!1)&&(!p._writableState||p._readableState))}function g(p){var k;return!!(p&&typeof p.write=="function"&&typeof p.on=="function"&&(!p._readableState||((k=p._writableState)===null||k===void 0?void 0:k.writable)!==!1))}function v(p){return!!(p&&typeof p.pipe=="function"&&p._readableState&&typeof p.on=="function"&&typeof p.write=="function")}function x(p){return p&&(p._readableState||p._writableState||typeof p.write=="function"&&typeof p.on=="function"||typeof p.pipe=="function"&&typeof p.on=="function")}function q(p){return!!(p&&!x(p)&&typeof p.pipeThrough=="function"&&typeof p.getReader=="function"&&typeof p.cancel=="function")}function A(p){return!!(p&&!x(p)&&typeof p.getWriter=="function"&&typeof p.abort=="function")}function w(p){return!!(p&&!x(p)&&typeof p.readable=="object"&&typeof p.writable=="object")}function M(p){return q(p)||A(p)||w(p)}function E(p,k){return p==null?!1:k===!0?typeof p[e]=="function":k===!1?typeof p[t]=="function":typeof p[e]=="function"||typeof p[t]=="function"}function S(p){if(!x(p))return null;const k=p._writableState,H=p._readableState,L=k||H;return!!(p.destroyed||p[n]||L!=null&&L.destroyed)}function J(p){if(!g(p))return null;if(p.writableEnded===!0)return!0;const k=p._writableState;return k!=null&&k.errored?!1:typeof k?.ended!="boolean"?null:k.ended}function G(p,k){if(!g(p))return null;if(p.writableFinished===!0)return!0;const H=p._writableState;return H!=null&&H.errored?!1:typeof H?.finished!="boolean"?null:!!(H.finished||k===!1&&H.ended===!0&&H.length===0)}function se(p){if(!_(p))return null;if(p.readableEnded===!0)return!0;const k=p._readableState;return!k||k.errored?!1:typeof k?.ended!="boolean"?null:k.ended}function ae(p,k){if(!_(p))return null;const H=p._readableState;return H!=null&&H.errored?!1:typeof H?.endEmitted!="boolean"?null:!!(H.endEmitted||k===!1&&H.ended===!0&&H.length===0)}function Y(p){return p&&p[o]!=null?p[o]:typeof p?.readable!="boolean"?null:S(p)?!1:_(p)&&p.readable&&!ae(p)}function fe(p){return p&&p[a]!=null?p[a]:typeof p?.writable!="boolean"?null:S(p)?!1:g(p)&&p.writable&&!J(p)}function D(p,k){return x(p)?S(p)?!0:!(k?.readable!==!1&&Y(p)||k?.writable!==!1&&fe(p)):null}function R(p){var k,H;return x(p)?p.writableErrored?p.writableErrored:(k=(H=p._writableState)===null||H===void 0?void 0:H.errored)!==null&&k!==void 0?k:null:null}function F(p){var k,H;return x(p)?p.readableErrored?p.readableErrored:(k=(H=p._readableState)===null||H===void 0?void 0:H.errored)!==null&&k!==void 0?k:null:null}function m(p){if(!x(p))return null;if(typeof p.closed=="boolean")return p.closed;const k=p._writableState,H=p._readableState;return typeof k?.closed=="boolean"||typeof H?.closed=="boolean"?k?.closed||H?.closed:typeof p._closed=="boolean"&&K(p)?p._closed:null}function K(p){return typeof p._closed=="boolean"&&typeof p._defaultKeepAlive=="boolean"&&typeof p._removedConnection=="boolean"&&typeof p._removedContLen=="boolean"}function Q(p){return typeof p._sent100=="boolean"&&K(p)}function ee(p){var k;return typeof p._consuming=="boolean"&&typeof p._dumped=="boolean"&&((k=p.req)===null||k===void 0?void 0:k.upgradeOrConnect)===void 0}function ue(p){if(!x(p))return null;const k=p._writableState,H=p._readableState,L=k||H;return!L&&Q(p)||!!(L&&L.autoDestroy&&L.emitClose&&L.closed===!1)}function P(p){var k;return!!(p&&((k=p[s])!==null&&k!==void 0?k:p.readableDidRead||p.readableAborted))}function Z(p){var k,H,L,X,re,oe,ie,I,C,V;return!!(p&&((k=(H=(L=(X=(re=(oe=p[i])!==null&&oe!==void 0?oe:p.readableErrored)!==null&&re!==void 0?re:p.writableErrored)!==null&&X!==void 0?X:(ie=p._readableState)===null||ie===void 0?void 0:ie.errorEmitted)!==null&&L!==void 0?L:(I=p._writableState)===null||I===void 0?void 0:I.errorEmitted)!==null&&H!==void 0?H:(C=p._readableState)===null||C===void 0?void 0:C.errored)!==null&&k!==void 0?k:!((V=p._writableState)===null||V===void 0)&&V.errored))}return ao={isDestroyed:S,kIsDestroyed:n,isDisturbed:P,kIsDisturbed:s,isErrored:Z,kIsErrored:i,isReadable:Y,kIsReadable:o,kIsClosedPromise:d,kControllerErrorFunction:h,kIsWritable:a,isClosed:m,isDuplexNodeStream:v,isFinished:D,isIterable:E,isReadableNodeStream:_,isReadableStream:q,isReadableEnded:se,isReadableFinished:ae,isReadableErrored:F,isNodeStream:x,isWebStream:M,isWritable:fe,isWritableNodeStream:g,isWritableStream:A,isWritableEnded:J,isWritableFinished:G,isWritableErrored:R,isServerRequest:ee,isServerResponse:Q,willEmitClose:ue,isTransformStream:w},ao}var nu;function Wt(){if(nu)return Wn.exports;nu=1;const e=it(),{AbortError:t,codes:r}=Je(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=r,{kEmptyObject:o,once:a}=et(),{validateAbortSignal:s,validateFunction:d,validateObject:h,validateBoolean:_}=Tn(),{Promise:g,PromisePrototypeThen:v,SymbolDispose:x}=De(),{isClosed:q,isReadable:A,isReadableNodeStream:w,isReadableStream:M,isReadableFinished:E,isReadableErrored:S,isWritable:J,isWritableNodeStream:G,isWritableStream:se,isWritableFinished:ae,isWritableErrored:Y,isNodeStream:fe,willEmitClose:D,kIsClosedPromise:R}=Ot();let F;function m(P){return P.setHeader&&typeof P.abort=="function"}const K=()=>{};function Q(P,Z,p){var k,H;if(arguments.length===2?(p=Z,Z=o):Z==null?Z=o:h(Z,"options"),d(p,"callback"),s(Z.signal,"options.signal"),p=a(p),M(P)||se(P))return ee(P,Z,p);if(!fe(P))throw new n("stream",["ReadableStream","WritableStream","Stream"],P);const L=(k=Z.readable)!==null&&k!==void 0?k:w(P),X=(H=Z.writable)!==null&&H!==void 0?H:G(P),re=P._writableState,oe=P._readableState,ie=()=>{P.writable||V()};let I=D(P)&&w(P)===L&&G(P)===X,C=ae(P,!1);const V=()=>{C=!0,P.destroyed&&(I=!1),!(I&&(!P.readable||L))&&(!L||ne)&&p.call(P)};let ne=E(P,!1);const W=()=>{ne=!0,P.destroyed&&(I=!1),!(I&&(!P.writable||X))&&(!X||C)&&p.call(P)},u=y=>{p.call(P,y)};let f=q(P);const b=()=>{f=!0;const y=Y(P)||S(P);if(y&&typeof y!="boolean")return p.call(P,y);if(L&&!ne&&w(P,!0)&&!E(P,!1))return p.call(P,new i);if(X&&!C&&!ae(P,!1))return p.call(P,new i);p.call(P)},T=()=>{f=!0;const y=Y(P)||S(P);if(y&&typeof y!="boolean")return p.call(P,y);p.call(P)},$=()=>{P.req.on("finish",V)};m(P)?(P.on("complete",V),I||P.on("abort",b),P.req?$():P.on("request",$)):X&&!re&&(P.on("end",ie),P.on("close",ie)),!I&&typeof P.aborted=="boolean"&&P.on("aborted",b),P.on("end",W),P.on("finish",V),Z.error!==!1&&P.on("error",u),P.on("close",b),f?e.nextTick(b):re!=null&&re.errorEmitted||oe!=null&&oe.errorEmitted?I||e.nextTick(T):(!L&&(!I||A(P))&&(C||J(P)===!1)||!X&&(!I||J(P))&&(ne||A(P)===!1)||oe&&P.req&&P.aborted)&&e.nextTick(T);const j=()=>{p=K,P.removeListener("aborted",b),P.removeListener("complete",V),P.removeListener("abort",b),P.removeListener("request",$),P.req&&P.req.removeListener("finish",V),P.removeListener("end",ie),P.removeListener("close",ie),P.removeListener("finish",V),P.removeListener("end",W),P.removeListener("error",u),P.removeListener("close",b)};if(Z.signal&&!f){const y=()=>{const O=p;j(),O.call(P,new t(void 0,{cause:Z.signal.reason}))};if(Z.signal.aborted)e.nextTick(y);else{F=F||et().addAbortListener;const O=F(Z.signal,y),B=p;p=a((...N)=>{O[x](),B.apply(P,N)})}}return j}function ee(P,Z,p){let k=!1,H=K;if(Z.signal)if(H=()=>{k=!0,p.call(P,new t(void 0,{cause:Z.signal.reason}))},Z.signal.aborted)e.nextTick(H);else{F=F||et().addAbortListener;const X=F(Z.signal,H),re=p;p=a((...oe)=>{X[x](),re.apply(P,oe)})}const L=(...X)=>{k||e.nextTick(()=>p.apply(P,X))};return v(P[R].promise,L,L),K}function ue(P,Z){var p;let k=!1;return Z===null&&(Z=o),(p=Z)!==null&&p!==void 0&&p.cleanup&&(_(Z.cleanup,"cleanup"),k=Z.cleanup),new g((H,L)=>{const X=Q(P,Z,re=>{k&&X(),re?L(re):H()})})}return Wn.exports=Q,Wn.exports.finished=ue,Wn.exports}var so,iu;function Ir(){if(iu)return so;iu=1;const e=it(),{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:n}=Je(),{Symbol:i}=De(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:d}=Ot(),h=i("kDestroy"),_=i("kConstruct");function g(D,R,F){D&&(D.stack,R&&!R.errored&&(R.errored=D),F&&!F.errored&&(F.errored=D))}function v(D,R){const F=this._readableState,m=this._writableState,K=m||F;return m!=null&&m.destroyed||F!=null&&F.destroyed?(typeof R=="function"&&R(),this):(g(D,m,F),m&&(m.destroyed=!0),F&&(F.destroyed=!0),K.constructed?x(this,D,R):this.once(h,function(Q){x(this,t(Q,D),R)}),this)}function x(D,R,F){let m=!1;function K(Q){if(m)return;m=!0;const ee=D._readableState,ue=D._writableState;g(Q,ue,ee),ue&&(ue.closed=!0),ee&&(ee.closed=!0),typeof F=="function"&&F(Q),Q?e.nextTick(q,D,Q):e.nextTick(A,D)}try{D._destroy(R||null,K)}catch(Q){K(Q)}}function q(D,R){w(D,R),A(D)}function A(D){const R=D._readableState,F=D._writableState;F&&(F.closeEmitted=!0),R&&(R.closeEmitted=!0),(F!=null&&F.emitClose||R!=null&&R.emitClose)&&D.emit("close")}function w(D,R){const F=D._readableState,m=D._writableState;m!=null&&m.errorEmitted||F!=null&&F.errorEmitted||(m&&(m.errorEmitted=!0),F&&(F.errorEmitted=!0),D.emit("error",R))}function M(){const D=this._readableState,R=this._writableState;D&&(D.constructed=!0,D.closed=!1,D.closeEmitted=!1,D.destroyed=!1,D.errored=null,D.errorEmitted=!1,D.reading=!1,D.ended=D.readable===!1,D.endEmitted=D.readable===!1),R&&(R.constructed=!0,R.destroyed=!1,R.closed=!1,R.closeEmitted=!1,R.errored=null,R.errorEmitted=!1,R.finalCalled=!1,R.prefinished=!1,R.ended=R.writable===!1,R.ending=R.writable===!1,R.finished=R.writable===!1)}function E(D,R,F){const m=D._readableState,K=D._writableState;if(K!=null&&K.destroyed||m!=null&&m.destroyed)return this;m!=null&&m.autoDestroy||K!=null&&K.autoDestroy?D.destroy(R):R&&(R.stack,K&&!K.errored&&(K.errored=R),m&&!m.errored&&(m.errored=R),F?e.nextTick(w,D,R):w(D,R))}function S(D,R){if(typeof D._construct!="function")return;const F=D._readableState,m=D._writableState;F&&(F.constructed=!1),m&&(m.constructed=!1),D.once(_,R),!(D.listenerCount(_)>1)&&e.nextTick(J,D)}function J(D){let R=!1;function F(m){if(R){E(D,m??new r);return}R=!0;const K=D._readableState,Q=D._writableState,ee=Q||K;K&&(K.constructed=!0),Q&&(Q.constructed=!0),ee.destroyed?D.emit(h,m):m?E(D,m,!0):e.nextTick(G,D)}try{D._construct(m=>{e.nextTick(F,m)})}catch(m){e.nextTick(F,m)}}function G(D){D.emit(_)}function se(D){return D?.setHeader&&typeof D.abort=="function"}function ae(D){D.emit("close")}function Y(D,R){D.emit("error",R),e.nextTick(ae,D)}function fe(D,R){!D||a(D)||(!R&&!s(D)&&(R=new n),d(D)?(D.socket=null,D.destroy(R)):se(D)?D.abort():se(D.req)?D.req.abort():typeof D.destroy=="function"?D.destroy(R):typeof D.close=="function"?D.close():R?e.nextTick(Y,D,R):e.nextTick(ae,D),D.destroyed||(D[o]=!0))}return so={construct:S,destroyer:fe,destroy:v,undestroy:M,errorOrDestroy:E},so}var uo,ou;function Ea(){if(ou)return uo;ou=1;const{ArrayIsArray:e,ObjectSetPrototypeOf:t}=De(),{EventEmitter:r}=It();function n(o){r.call(this,o)}t(n.prototype,r.prototype),t(n,r),n.prototype.pipe=function(o,a){const s=this;function d(A){o.writable&&o.write(A)===!1&&s.pause&&s.pause()}s.on("data",d);function h(){s.readable&&s.resume&&s.resume()}o.on("drain",h),!o._isStdio&&(!a||a.end!==!1)&&(s.on("end",g),s.on("close",v));let _=!1;function g(){_||(_=!0,o.end())}function v(){_||(_=!0,typeof o.destroy=="function"&&o.destroy())}function x(A){q(),r.listenerCount(this,"error")===0&&this.emit("error",A)}i(s,"error",x),i(o,"error",x);function q(){s.removeListener("data",d),o.removeListener("drain",h),s.removeListener("end",g),s.removeListener("close",v),s.removeListener("error",x),o.removeListener("error",x),s.removeListener("end",q),s.removeListener("close",q),o.removeListener("close",q)}return s.on("end",q),s.on("close",q),o.on("close",q),o.emit("pipe",s),o};function i(o,a,s){if(typeof o.prependListener=="function")return o.prependListener(a,s);!o._events||!o._events[a]?o.on(a,s):e(o._events[a])?o._events[a].unshift(s):o._events[a]=[s,o._events[a]]}return uo={Stream:n,prependListener:i},uo}var lo={exports:{}},au;function ui(){return au||(au=1,(function(e){const{SymbolDispose:t}=De(),{AbortError:r,codes:n}=Je(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=Ot(),s=Wt(),{ERR_INVALID_ARG_TYPE:d}=n;let h;const _=(g,v)=>{if(typeof g!="object"||!("aborted"in g))throw new d(v,"AbortSignal",g)};e.exports.addAbortSignal=function(v,x){if(_(v,"signal"),!i(x)&&!o(x))throw new d("stream",["ReadableStream","WritableStream","Stream"],x);return e.exports.addAbortSignalNoValidate(v,x)},e.exports.addAbortSignalNoValidate=function(g,v){if(typeof g!="object"||!("aborted"in g))return v;const x=i(v)?()=>{v.destroy(new r(void 0,{cause:g.reason}))}:()=>{v[a](new r(void 0,{cause:g.reason}))};if(g.aborted)x();else{h=h||et().addAbortListener;const q=h(g,x);s(v,q[t])}return v}})(lo)),lo.exports}var fo,su;function $c(){if(su)return fo;su=1;const{StringPrototypeSlice:e,SymbolIterator:t,TypedArrayPrototypeSet:r,Uint8Array:n}=De(),{Buffer:i}=nt(),{inspect:o}=et();return fo=class{constructor(){this.head=null,this.tail=null,this.length=0}push(s){const d={data:s,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length}unshift(s){const d={data:s,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}shift(){if(this.length===0)return;const s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}clear(){this.head=this.tail=null,this.length=0}join(s){if(this.length===0)return"";let d=this.head,h=""+d.data;for(;(d=d.next)!==null;)h+=s+d.data;return h}concat(s){if(this.length===0)return i.alloc(0);const d=i.allocUnsafe(s>>>0);let h=this.head,_=0;for(;h;)r(d,h.data,_),_+=h.data.length,h=h.next;return d}consume(s,d){const h=this.head.data;if(s<h.length){const _=h.slice(0,s);return this.head.data=h.slice(s),_}return s===h.length?this.shift():d?this._getString(s):this._getBuffer(s)}first(){return this.head.data}*[t](){for(let s=this.head;s;s=s.next)yield s.data}_getString(s){let d="",h=this.head,_=0;do{const g=h.data;if(s>g.length)d+=g,s-=g.length;else{s===g.length?(d+=g,++_,h.next?this.head=h.next:this.head=this.tail=null):(d+=e(g,0,s),this.head=h,h.data=e(g,s));break}++_}while((h=h.next)!==null);return this.length-=_,d}_getBuffer(s){const d=i.allocUnsafe(s),h=s;let _=this.head,g=0;do{const v=_.data;if(s>v.length)r(d,v,h-s),s-=v.length;else{s===v.length?(r(d,v,h-s),++g,_.next?this.head=_.next:this.head=this.tail=null):(r(d,new n(v.buffer,v.byteOffset,s),h-s),this.head=_,_.data=v.slice(s));break}++g}while((_=_.next)!==null);return this.length-=g,d}[Symbol.for("nodejs.util.inspect.custom")](s,d){return o(this,{...d,depth:0,customInspect:!1})}},fo}var co,uu;function li(){if(uu)return co;uu=1;const{MathFloor:e,NumberIsInteger:t}=De(),{validateInteger:r}=Tn(),{ERR_INVALID_ARG_VALUE:n}=Je().codes;let i=16*1024,o=16;function a(_,g,v){return _.highWaterMark!=null?_.highWaterMark:g?_[v]:null}function s(_){return _?o:i}function d(_,g){r(g,"value",0),_?o=g:i=g}function h(_,g,v,x){const q=a(g,x,v);if(q!=null){if(!t(q)||q<0){const A=x?`options.${v}`:"options.highWaterMark";throw new n(A,q)}return e(q)}return s(_.objectMode)}return co={getHighWaterMark:h,getDefaultHighWaterMark:s,setDefaultHighWaterMark:d},co}var ho,lu;function Bl(){if(lu)return ho;lu=1;const e=it(),{PromisePrototypeThen:t,SymbolAsyncIterator:r,SymbolIterator:n}=De(),{Buffer:i}=nt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=Je().codes;function s(d,h,_){let g;if(typeof h=="string"||h instanceof i)return new d({objectMode:!0,..._,read(){this.push(h),this.push(null)}});let v;if(h&&h[r])v=!0,g=h[r]();else if(h&&h[n])v=!1,g=h[n]();else throw new o("iterable",["Iterable"],h);const x=new d({objectMode:!0,highWaterMark:1,..._});let q=!1;x._read=function(){q||(q=!0,w())},x._destroy=function(M,E){t(A(M),()=>e.nextTick(E,M),S=>e.nextTick(E,S||M))};async function A(M){const E=M!=null,S=typeof g.throw=="function";if(E&&S){const{value:J,done:G}=await g.throw(M);if(await J,G)return}if(typeof g.return=="function"){const{value:J}=await g.return();await J}}async function w(){for(;;){try{const{value:M,done:E}=v?await g.next():g.next();if(E)x.push(null);else{const S=M&&typeof M.then=="function"?await M:M;if(S===null)throw q=!1,new a;if(x.push(S))continue;q=!1}}catch(M){x.destroy(M)}break}}return x}return ho=s,ho}var po,fu;function fi(){if(fu)return po;fu=1;const e=it(),{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:d,SafeSet:h,SymbolAsyncDispose:_,SymbolAsyncIterator:g,Symbol:v}=De();po=N,N.ReadableState=B;const{EventEmitter:x}=It(),{Stream:q,prependListener:A}=Ea(),{Buffer:w}=nt(),{addAbortSignal:M}=ui(),E=Wt();let S=et().debuglog("stream",l=>{S=l});const J=$c(),G=Ir(),{getHighWaterMark:se,getDefaultHighWaterMark:ae}=li(),{aggregateTwoErrors:Y,codes:{ERR_INVALID_ARG_TYPE:fe,ERR_METHOD_NOT_IMPLEMENTED:D,ERR_OUT_OF_RANGE:R,ERR_STREAM_PUSH_AFTER_EOF:F,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:m},AbortError:K}=Je(),{validateObject:Q}=Tn(),ee=v("kPaused"),{StringDecoder:ue}=xu(),P=Bl();s(N.prototype,q.prototype),s(N,q);const Z=()=>{},{errorOrDestroy:p}=G,k=1,H=2,L=4,X=8,re=16,oe=32,ie=64,I=128,C=256,V=512,ne=1024,W=2048,u=4096,f=8192,b=16384,T=32768,$=65536,j=1<<17,y=1<<18;function O(l){return{enumerable:!1,get(){return(this.state&l)!==0},set(c){c?this.state|=l:this.state&=~l}}}o(B.prototype,{objectMode:O(k),ended:O(H),endEmitted:O(L),reading:O(X),constructed:O(re),sync:O(oe),needReadable:O(ie),emittedReadable:O(I),readableListening:O(C),resumeScheduled:O(V),errorEmitted:O(ne),emitClose:O(W),autoDestroy:O(u),destroyed:O(f),closed:O(b),closeEmitted:O(T),multiAwaitDrain:O($),readingMore:O(j),dataEmitted:O(y)});function B(l,c,z){typeof z!="boolean"&&(z=c instanceof Rt()),this.state=W|u|re|oe,l&&l.objectMode&&(this.state|=k),z&&l&&l.readableObjectMode&&(this.state|=k),this.highWaterMark=l?se(this,l,"readableHighWaterMark",z):ae(!1),this.buffer=new J,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,l&&l.emitClose===!1&&(this.state&=~W),l&&l.autoDestroy===!1&&(this.state&=~u),this.errored=null,this.defaultEncoding=l&&l.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,l&&l.encoding&&(this.decoder=new ue(l.encoding),this.encoding=l.encoding)}function N(l){if(!(this instanceof N))return new N(l);const c=this instanceof Rt();this._readableState=new B(l,this,c),l&&(typeof l.read=="function"&&(this._read=l.read),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.construct=="function"&&(this._construct=l.construct),l.signal&&!c&&M(l.signal,this)),q.call(this,l),G.construct(this,()=>{this._readableState.needReadable&&me(this,this._readableState)})}N.prototype.destroy=G.destroy,N.prototype._undestroy=G.undestroy,N.prototype._destroy=function(l,c){c(l)},N.prototype[x.captureRejectionSymbol]=function(l){this.destroy(l)},N.prototype[_]=function(){let l;return this.destroyed||(l=this.readableEnded?null:new K,this.destroy(l)),new d((c,z)=>E(this,U=>U&&U!==l?z(U):c(null)))},N.prototype.push=function(l,c){return ce(this,l,c,!1)},N.prototype.unshift=function(l,c){return ce(this,l,c,!0)};function ce(l,c,z,U){S("readableAddChunk",c);const te=l._readableState;let be;if((te.state&k)===0&&(typeof c=="string"?(z=z||te.defaultEncoding,te.encoding!==z&&(U&&te.encoding?c=w.from(c,z).toString(te.encoding):(c=w.from(c,z),z=""))):c instanceof w?z="":q._isUint8Array(c)?(c=q._uint8ArrayToBuffer(c),z=""):c!=null&&(be=new fe("chunk",["string","Buffer","Uint8Array"],c))),be)p(l,be);else if(c===null)te.state&=~X,Me(l,te);else if((te.state&k)!==0||c&&c.length>0)if(U)if((te.state&L)!==0)p(l,new m);else{if(te.destroyed||te.errored)return!1;we(l,te,c,!0)}else if(te.ended)p(l,new F);else{if(te.destroyed||te.errored)return!1;te.state&=~X,te.decoder&&!z?(c=te.decoder.write(c),te.objectMode||c.length!==0?we(l,te,c,!1):me(l,te)):we(l,te,c,!1)}else U||(te.state&=~X,me(l,te));return!te.ended&&(te.length<te.highWaterMark||te.length===0)}function we(l,c,z,U){c.flowing&&c.length===0&&!c.sync&&l.listenerCount("data")>0?((c.state&$)!==0?c.awaitDrainWriters.clear():c.awaitDrainWriters=null,c.dataEmitted=!0,l.emit("data",z)):(c.length+=c.objectMode?1:z.length,U?c.buffer.unshift(z):c.buffer.push(z),(c.state&ie)!==0&&qe(l)),me(l,c)}N.prototype.isPaused=function(){const l=this._readableState;return l[ee]===!0||l.flowing===!1},N.prototype.setEncoding=function(l){const c=new ue(l);this._readableState.decoder=c,this._readableState.encoding=this._readableState.decoder.encoding;const z=this._readableState.buffer;let U="";for(const te of z)U+=c.write(te);return z.clear(),U!==""&&z.push(U),this._readableState.length=U.length,this};const de=1073741824;function Se(l){if(l>de)throw new R("size","<= 1GiB",l);return l--,l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,l|=l>>>16,l++,l}function ye(l,c){return l<=0||c.length===0&&c.ended?0:(c.state&k)!==0?1:n(l)?c.flowing&&c.length?c.buffer.first().length:c.length:l<=c.length?l:c.ended?c.length:0}N.prototype.read=function(l){S("read",l),l===void 0?l=NaN:r(l)||(l=i(l,10));const c=this._readableState,z=l;if(l>c.highWaterMark&&(c.highWaterMark=Se(l)),l!==0&&(c.state&=~I),l===0&&c.needReadable&&((c.highWaterMark!==0?c.length>=c.highWaterMark:c.length>0)||c.ended))return S("read: emitReadable",c.length,c.ended),c.length===0&&c.ended?Ft(this):qe(this),null;if(l=ye(l,c),l===0&&c.ended)return c.length===0&&Ft(this),null;let U=(c.state&ie)!==0;if(S("need readable",U),(c.length===0||c.length-l<c.highWaterMark)&&(U=!0,S("length less than watermark",U)),c.ended||c.reading||c.destroyed||c.errored||!c.constructed)U=!1,S("reading, ended or constructing",U);else if(U){S("do read"),c.state|=X|oe,c.length===0&&(c.state|=ie);try{this._read(c.highWaterMark)}catch(be){p(this,be)}c.state&=~oe,c.reading||(l=ye(z,c))}let te;return l>0?te=Lr(l,c):te=null,te===null?(c.needReadable=c.length<=c.highWaterMark,l=0):(c.length-=l,c.multiAwaitDrain?c.awaitDrainWriters.clear():c.awaitDrainWriters=null),c.length===0&&(c.ended||(c.needReadable=!0),z!==l&&c.ended&&Ft(this)),te!==null&&!c.errorEmitted&&!c.closeEmitted&&(c.dataEmitted=!0,this.emit("data",te)),te};function Me(l,c){if(S("onEofChunk"),!c.ended){if(c.decoder){const z=c.decoder.end();z&&z.length&&(c.buffer.push(z),c.length+=c.objectMode?1:z.length)}c.ended=!0,c.sync?qe(l):(c.needReadable=!1,c.emittedReadable=!0,vt(l))}}function qe(l){const c=l._readableState;S("emitReadable",c.needReadable,c.emittedReadable),c.needReadable=!1,c.emittedReadable||(S("emitReadable",c.flowing),c.emittedReadable=!0,e.nextTick(vt,l))}function vt(l){const c=l._readableState;S("emitReadable_",c.destroyed,c.length,c.ended),!c.destroyed&&!c.errored&&(c.length||c.ended)&&(l.emit("readable"),c.emittedReadable=!1),c.needReadable=!c.flowing&&!c.ended&&c.length<=c.highWaterMark,Or(l)}function me(l,c){!c.readingMore&&c.constructed&&(c.readingMore=!0,e.nextTick(ci,l,c))}function ci(l,c){for(;!c.reading&&!c.ended&&(c.length<c.highWaterMark||c.flowing&&c.length===0);){const z=c.length;if(S("maybeReadMore read 0"),l.read(0),z===c.length)break}c.readingMore=!1}N.prototype._read=function(l){throw new D("_read()")},N.prototype.pipe=function(l,c){const z=this,U=this._readableState;U.pipes.length===1&&(U.multiAwaitDrain||(U.multiAwaitDrain=!0,U.awaitDrainWriters=new h(U.awaitDrainWriters?[U.awaitDrainWriters]:[]))),U.pipes.push(l),S("pipe count=%d opts=%j",U.pipes.length,c);const be=(!c||c.end!==!1)&&l!==e.stdout&&l!==e.stderr?Pr:_t;U.endEmitted?e.nextTick(be):z.once("end",be),l.on("unpipe",Ie);function Ie(Ke,Ne){S("onunpipe"),Ke===z&&Ne&&Ne.hasUnpiped===!1&&(Ne.hasUnpiped=!0,wi())}function Pr(){S("onend"),l.end()}let Ue,Nr=!1;function wi(){S("cleanup"),l.removeListener("close",Ut),l.removeListener("finish",Kt),Ue&&l.removeListener("drain",Ue),l.removeListener("error",zt),l.removeListener("unpipe",Ie),z.removeListener("end",Pr),z.removeListener("end",_t),z.removeListener("data",Cr),Nr=!0,Ue&&U.awaitDrainWriters&&(!l._writableState||l._writableState.needDrain)&&Ue()}function xr(){Nr||(U.pipes.length===1&&U.pipes[0]===l?(S("false write response, pause",0),U.awaitDrainWriters=l,U.multiAwaitDrain=!1):U.pipes.length>1&&U.pipes.includes(l)&&(S("false write response, pause",U.awaitDrainWriters.size),U.awaitDrainWriters.add(l)),z.pause()),Ue||(Ue=di(z,l),l.on("drain",Ue))}z.on("data",Cr);function Cr(Ke){S("ondata");const Ne=l.write(Ke);S("dest.write",Ne),Ne===!1&&xr()}function zt(Ke){if(S("onerror",Ke),_t(),l.removeListener("error",zt),l.listenerCount("error")===0){const Ne=l._writableState||l._readableState;Ne&&!Ne.errorEmitted?p(l,Ke):l.emit("error",Ke)}}A(l,"error",zt);function Ut(){l.removeListener("finish",Kt),_t()}l.once("close",Ut);function Kt(){S("onfinish"),l.removeListener("close",Ut),_t()}l.once("finish",Kt);function _t(){S("unpipe"),z.unpipe(l)}return l.emit("pipe",z),l.writableNeedDrain===!0?xr():U.flowing||(S("pipe resume"),z.resume()),l};function di(l,c){return function(){const U=l._readableState;U.awaitDrainWriters===c?(S("pipeOnDrain",1),U.awaitDrainWriters=null):U.multiAwaitDrain&&(S("pipeOnDrain",U.awaitDrainWriters.size),U.awaitDrainWriters.delete(c)),(!U.awaitDrainWriters||U.awaitDrainWriters.size===0)&&l.listenerCount("data")&&l.resume()}}N.prototype.unpipe=function(l){const c=this._readableState,z={hasUnpiped:!1};if(c.pipes.length===0)return this;if(!l){const te=c.pipes;c.pipes=[],this.pause();for(let be=0;be<te.length;be++)te[be].emit("unpipe",this,{hasUnpiped:!1});return this}const U=t(c.pipes,l);return U===-1?this:(c.pipes.splice(U,1),c.pipes.length===0&&this.pause(),l.emit("unpipe",this,z),this)},N.prototype.on=function(l,c){const z=q.prototype.on.call(this,l,c),U=this._readableState;return l==="data"?(U.readableListening=this.listenerCount("readable")>0,U.flowing!==!1&&this.resume()):l==="readable"&&!U.endEmitted&&!U.readableListening&&(U.readableListening=U.needReadable=!0,U.flowing=!1,U.emittedReadable=!1,S("on readable",U.length,U.reading),U.length?qe(this):U.reading||e.nextTick(hi,this)),z},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(l,c){const z=q.prototype.removeListener.call(this,l,c);return l==="readable"&&e.nextTick(Tr,this),z},N.prototype.off=N.prototype.removeListener,N.prototype.removeAllListeners=function(l){const c=q.prototype.removeAllListeners.apply(this,arguments);return(l==="readable"||l===void 0)&&e.nextTick(Tr,this),c};function Tr(l){const c=l._readableState;c.readableListening=l.listenerCount("readable")>0,c.resumeScheduled&&c[ee]===!1?c.flowing=!0:l.listenerCount("data")>0?l.resume():c.readableListening||(c.flowing=null)}function hi(l){S("readable nexttick read 0"),l.read(0)}N.prototype.resume=function(){const l=this._readableState;return l.flowing||(S("resume"),l.flowing=!l.readableListening,pi(this,l)),l[ee]=!1,this};function pi(l,c){c.resumeScheduled||(c.resumeScheduled=!0,e.nextTick(_i,l,c))}function _i(l,c){S("resume",c.reading),c.reading||l.read(0),c.resumeScheduled=!1,l.emit("resume"),Or(l),c.flowing&&!c.reading&&l.read(0)}N.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function Or(l){const c=l._readableState;for(S("flow",c.flowing);c.flowing&&l.read()!==null;);}N.prototype.wrap=function(l){let c=!1;l.on("data",U=>{!this.push(U)&&l.pause&&(c=!0,l.pause())}),l.on("end",()=>{this.push(null)}),l.on("error",U=>{p(this,U)}),l.on("close",()=>{this.destroy()}),l.on("destroy",()=>{this.destroy()}),this._read=()=>{c&&l.resume&&(c=!1,l.resume())};const z=a(l);for(let U=1;U<z.length;U++){const te=z[U];this[te]===void 0&&typeof l[te]=="function"&&(this[te]=l[te].bind(l))}return this},N.prototype[g]=function(){return Mr(this)},N.prototype.iterator=function(l){return l!==void 0&&Q(l,"options"),Mr(this,l)};function Mr(l,c){typeof l.read!="function"&&(l=N.wrap(l,{objectMode:!0}));const z=yi(l,c);return z.stream=l,z}async function*yi(l,c){let z=Z;function U(Ie){this===l?(z(),z=Z):z=Ie}l.on("readable",U);let te;const be=E(l,{writable:!1},Ie=>{te=Ie?Y(te,Ie):null,z(),z=Z});try{for(;;){const Ie=l.destroyed?null:l.read();if(Ie!==null)yield Ie;else{if(te)throw te;if(te===null)return;await new d(U)}}}catch(Ie){throw te=Y(te,Ie),te}finally{(te||c?.destroyOnReturn!==!1)&&(te===void 0||l._readableState.autoDestroy)?G.destroyer(l,null):(l.off("readable",U),be())}}o(N.prototype,{readable:{__proto__:null,get(){const l=this._readableState;return!!l&&l.readable!==!1&&!l.destroyed&&!l.errorEmitted&&!l.endEmitted},set(l){this._readableState&&(this._readableState.readable=!!l)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(l){this._readableState&&(this._readableState.flowing=l)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(l){this._readableState&&(this._readableState.destroyed=l)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(B.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(l){this[ee]=!!l}}}),N._fromList=Lr;function Lr(l,c){if(c.length===0)return null;let z;return c.objectMode?z=c.buffer.shift():!l||l>=c.length?(c.decoder?z=c.buffer.join(""):c.buffer.length===1?z=c.buffer.first():z=c.buffer.concat(c.length),c.buffer.clear()):z=c.buffer.consume(l,c.decoder),z}function Ft(l){const c=l._readableState;S("endReadable",c.endEmitted),c.endEmitted||(c.ended=!0,e.nextTick(bi,c,l))}function bi(l,c){if(S("endReadableNT",l.endEmitted,l.length),!l.errored&&!l.closeEmitted&&!l.endEmitted&&l.length===0){if(l.endEmitted=!0,c.emit("end"),c.writable&&c.allowHalfOpen===!1)e.nextTick(gi,c);else if(l.autoDestroy){const z=c._writableState;(!z||z.autoDestroy&&(z.finished||z.writable===!1))&&c.destroy()}}}function gi(l){l.writable&&!l.writableEnded&&!l.destroyed&&l.end()}N.from=function(l,c){return P(N,l,c)};let Bt;function Dr(){return Bt===void 0&&(Bt={}),Bt}return N.fromWeb=function(l,c){return Dr().newStreamReadableFromReadableStream(l,c)},N.toWeb=function(l,c){return Dr().newReadableStreamFromStreamReadable(l,c)},N.wrap=function(l,c){var z,U;return new N({objectMode:(z=(U=l.readableObjectMode)!==null&&U!==void 0?U:l.objectMode)!==null&&z!==void 0?z:!0,...c,destroy(te,be){G.destroyer(l,te),be(te)}}).wrap(l)},po}var _o,cu;function Aa(){if(cu)return _o;cu=1;const e=it(),{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:d,SymbolHasInstance:h}=De();_o=Q,Q.WritableState=m;const{EventEmitter:_}=It(),g=Ea().Stream,{Buffer:v}=nt(),x=Ir(),{addAbortSignal:q}=ui(),{getHighWaterMark:A,getDefaultHighWaterMark:w}=li(),{ERR_INVALID_ARG_TYPE:M,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:J,ERR_STREAM_DESTROYED:G,ERR_STREAM_ALREADY_FINISHED:se,ERR_STREAM_NULL_VALUES:ae,ERR_STREAM_WRITE_AFTER_END:Y,ERR_UNKNOWN_ENCODING:fe}=Je().codes,{errorOrDestroy:D}=x;a(Q.prototype,g.prototype),a(Q,g);function R(){}const F=d("kOnFinished");function m(u,f,b){typeof b!="boolean"&&(b=f instanceof Rt()),this.objectMode=!!(u&&u.objectMode),b&&(this.objectMode=this.objectMode||!!(u&&u.writableObjectMode)),this.highWaterMark=u?A(this,u,"writableHighWaterMark",b):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const T=!!(u&&u.decodeStrings===!1);this.decodeStrings=!T,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=p.bind(void 0,f),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,K(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!u||u.emitClose!==!1,this.autoDestroy=!u||u.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[F]=[]}function K(u){u.buffered=[],u.bufferedIndex=0,u.allBuffers=!0,u.allNoop=!0}m.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(m.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Q(u){const f=this instanceof Rt();if(!f&&!n(Q,this))return new Q(u);this._writableState=new m(u,this,f),u&&(typeof u.write=="function"&&(this._write=u.write),typeof u.writev=="function"&&(this._writev=u.writev),typeof u.destroy=="function"&&(this._destroy=u.destroy),typeof u.final=="function"&&(this._final=u.final),typeof u.construct=="function"&&(this._construct=u.construct),u.signal&&q(u.signal,this)),g.call(this,u),x.construct(this,()=>{const b=this._writableState;b.writing||X(this,b),I(this,b)})}i(Q,h,{__proto__:null,value:function(u){return n(this,u)?!0:this!==Q?!1:u&&u._writableState instanceof m}}),Q.prototype.pipe=function(){D(this,new J)};function ee(u,f,b,T){const $=u._writableState;if(typeof b=="function")T=b,b=$.defaultEncoding;else{if(!b)b=$.defaultEncoding;else if(b!=="buffer"&&!v.isEncoding(b))throw new fe(b);typeof T!="function"&&(T=R)}if(f===null)throw new ae;if(!$.objectMode)if(typeof f=="string")$.decodeStrings!==!1&&(f=v.from(f,b),b="buffer");else if(f instanceof v)b="buffer";else if(g._isUint8Array(f))f=g._uint8ArrayToBuffer(f),b="buffer";else throw new M("chunk",["string","Buffer","Uint8Array"],f);let j;return $.ending?j=new Y:$.destroyed&&(j=new G("write")),j?(e.nextTick(T,j),D(u,j,!0),j):($.pendingcb++,ue(u,$,f,b,T))}Q.prototype.write=function(u,f,b){return ee(this,u,f,b)===!0},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){const u=this._writableState;u.corked&&(u.corked--,u.writing||X(this,u))},Q.prototype.setDefaultEncoding=function(f){if(typeof f=="string"&&(f=s(f)),!v.isEncoding(f))throw new fe(f);return this._writableState.defaultEncoding=f,this};function ue(u,f,b,T,$){const j=f.objectMode?1:b.length;f.length+=j;const y=f.length<f.highWaterMark;return y||(f.needDrain=!0),f.writing||f.corked||f.errored||!f.constructed?(f.buffered.push({chunk:b,encoding:T,callback:$}),f.allBuffers&&T!=="buffer"&&(f.allBuffers=!1),f.allNoop&&$!==R&&(f.allNoop=!1)):(f.writelen=j,f.writecb=$,f.writing=!0,f.sync=!0,u._write(b,T,f.onwrite),f.sync=!1),y&&!f.errored&&!f.destroyed}function P(u,f,b,T,$,j,y){f.writelen=T,f.writecb=y,f.writing=!0,f.sync=!0,f.destroyed?f.onwrite(new G("write")):b?u._writev($,f.onwrite):u._write($,j,f.onwrite),f.sync=!1}function Z(u,f,b,T){--f.pendingcb,T(b),L(f),D(u,b)}function p(u,f){const b=u._writableState,T=b.sync,$=b.writecb;if(typeof $!="function"){D(u,new S);return}b.writing=!1,b.writecb=null,b.length-=b.writelen,b.writelen=0,f?(f.stack,b.errored||(b.errored=f),u._readableState&&!u._readableState.errored&&(u._readableState.errored=f),T?e.nextTick(Z,u,b,f,$):Z(u,b,f,$)):(b.buffered.length>b.bufferedIndex&&X(u,b),T?b.afterWriteTickInfo!==null&&b.afterWriteTickInfo.cb===$?b.afterWriteTickInfo.count++:(b.afterWriteTickInfo={count:1,cb:$,stream:u,state:b},e.nextTick(k,b.afterWriteTickInfo)):H(u,b,1,$))}function k({stream:u,state:f,count:b,cb:T}){return f.afterWriteTickInfo=null,H(u,f,b,T)}function H(u,f,b,T){for(!f.ending&&!u.destroyed&&f.length===0&&f.needDrain&&(f.needDrain=!1,u.emit("drain"));b-- >0;)f.pendingcb--,T();f.destroyed&&L(f),I(u,f)}function L(u){if(u.writing)return;for(let $=u.bufferedIndex;$<u.buffered.length;++$){var f;const{chunk:j,callback:y}=u.buffered[$],O=u.objectMode?1:j.length;u.length-=O,y((f=u.errored)!==null&&f!==void 0?f:new G("write"))}const b=u[F].splice(0);for(let $=0;$<b.length;$++){var T;b[$]((T=u.errored)!==null&&T!==void 0?T:new G("end"))}K(u)}function X(u,f){if(f.corked||f.bufferProcessing||f.destroyed||!f.constructed)return;const{buffered:b,bufferedIndex:T,objectMode:$}=f,j=b.length-T;if(!j)return;let y=T;if(f.bufferProcessing=!0,j>1&&u._writev){f.pendingcb-=j-1;const O=f.allNoop?R:N=>{for(let ce=y;ce<b.length;++ce)b[ce].callback(N)},B=f.allNoop&&y===0?b:t(b,y);B.allBuffers=f.allBuffers,P(u,f,!0,f.length,B,"",O),K(f)}else{do{const{chunk:O,encoding:B,callback:N}=b[y];b[y++]=null;const ce=$?1:O.length;P(u,f,!1,ce,O,B,N)}while(y<b.length&&!f.writing);y===b.length?K(f):y>256?(b.splice(0,y),f.bufferedIndex=0):f.bufferedIndex=y}f.bufferProcessing=!1}Q.prototype._write=function(u,f,b){if(this._writev)this._writev([{chunk:u,encoding:f}],b);else throw new E("_write()")},Q.prototype._writev=null,Q.prototype.end=function(u,f,b){const T=this._writableState;typeof u=="function"?(b=u,u=null,f=null):typeof f=="function"&&(b=f,f=null);let $;if(u!=null){const j=ee(this,u,f);j instanceof r&&($=j)}return T.corked&&(T.corked=1,this.uncork()),$||(!T.errored&&!T.ending?(T.ending=!0,I(this,T,!0),T.ended=!0):T.finished?$=new se("end"):T.destroyed&&($=new G("end"))),typeof b=="function"&&($||T.finished?e.nextTick(b,$):T[F].push(b)),this};function re(u){return u.ending&&!u.destroyed&&u.constructed&&u.length===0&&!u.errored&&u.buffered.length===0&&!u.finished&&!u.writing&&!u.errorEmitted&&!u.closeEmitted}function oe(u,f){let b=!1;function T($){if(b){D(u,$??S());return}if(b=!0,f.pendingcb--,$){const j=f[F].splice(0);for(let y=0;y<j.length;y++)j[y]($);D(u,$,f.sync)}else re(f)&&(f.prefinished=!0,u.emit("prefinish"),f.pendingcb++,e.nextTick(C,u,f))}f.sync=!0,f.pendingcb++;try{u._final(T)}catch($){T($)}f.sync=!1}function ie(u,f){!f.prefinished&&!f.finalCalled&&(typeof u._final=="function"&&!f.destroyed?(f.finalCalled=!0,oe(u,f)):(f.prefinished=!0,u.emit("prefinish")))}function I(u,f,b){re(f)&&(ie(u,f),f.pendingcb===0&&(b?(f.pendingcb++,e.nextTick((T,$)=>{re($)?C(T,$):$.pendingcb--},u,f)):re(f)&&(f.pendingcb++,C(u,f))))}function C(u,f){f.pendingcb--,f.finished=!0;const b=f[F].splice(0);for(let T=0;T<b.length;T++)b[T]();if(u.emit("finish"),f.autoDestroy){const T=u._readableState;(!T||T.autoDestroy&&(T.endEmitted||T.readable===!1))&&u.destroy()}}o(Q.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(u){this._writableState&&(this._writableState.destroyed=u)}},writable:{__proto__:null,get(){const u=this._writableState;return!!u&&u.writable!==!1&&!u.destroyed&&!u.errored&&!u.ending&&!u.ended},set(u){this._writableState&&(this._writableState.writable=!!u)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const u=this._writableState;return u?!u.destroyed&&!u.ending&&u.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const V=x.destroy;Q.prototype.destroy=function(u,f){const b=this._writableState;return!b.destroyed&&(b.bufferedIndex<b.buffered.length||b[F].length)&&e.nextTick(L,b),V.call(this,u,f),this},Q.prototype._undestroy=x.undestroy,Q.prototype._destroy=function(u,f){f(u)},Q.prototype[_.captureRejectionSymbol]=function(u){this.destroy(u)};let ne;function W(){return ne===void 0&&(ne={}),ne}return Q.fromWeb=function(u,f){return W().newStreamWritableFromWritableStream(u,f)},Q.toWeb=function(u){return W().newWritableStreamFromStreamWritable(u)},_o}var yo,du;function qc(){if(du)return yo;du=1;const e=it(),t=nt(),{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:_}=Ot(),g=Wt(),{AbortError:v,codes:{ERR_INVALID_ARG_TYPE:x,ERR_INVALID_RETURN_VALUE:q}}=Je(),{destroyer:A}=Ir(),w=Rt(),M=fi(),E=Aa(),{createDeferredPromise:S}=et(),J=Bl(),G=globalThis.Blob||t.Blob,se=typeof G<"u"?function(m){return m instanceof G}:function(m){return!1},ae=globalThis.AbortController||wt().AbortController,{FunctionPrototypeCall:Y}=De();class fe extends w{constructor(m){super(m),m?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),m?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}yo=function F(m,K){if(d(m))return m;if(a(m))return R({readable:m});if(s(m))return R({writable:m});if(o(m))return R({writable:!1,readable:!1});if(h(m))return R({readable:M.fromWeb(m)});if(_(m))return R({writable:E.fromWeb(m)});if(typeof m=="function"){const{value:ee,write:ue,final:P,destroy:Z}=D(m);if(i(ee))return J(fe,ee,{objectMode:!0,write:ue,final:P,destroy:Z});const p=ee?.then;if(typeof p=="function"){let k;const H=Y(p,ee,L=>{if(L!=null)throw new q("nully","body",L)},L=>{A(k,L)});return k=new fe({objectMode:!0,readable:!1,write:ue,final(L){P(async()=>{try{await H,e.nextTick(L,null)}catch(X){e.nextTick(L,X)}})},destroy:Z})}throw new q("Iterable, AsyncIterable or AsyncFunction",K,ee)}if(se(m))return F(m.arrayBuffer());if(i(m))return J(fe,m,{objectMode:!0,writable:!1});if(h(m?.readable)&&_(m?.writable))return fe.fromWeb(m);if(typeof m?.writable=="object"||typeof m?.readable=="object"){const ee=m!=null&&m.readable?a(m?.readable)?m?.readable:F(m.readable):void 0,ue=m!=null&&m.writable?s(m?.writable)?m?.writable:F(m.writable):void 0;return R({readable:ee,writable:ue})}const Q=m?.then;if(typeof Q=="function"){let ee;return Y(Q,m,ue=>{ue!=null&&ee.push(ue),ee.push(null)},ue=>{A(ee,ue)}),ee=new fe({objectMode:!0,writable:!1,read(){}})}throw new x(K,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],m)};function D(F){let{promise:m,resolve:K}=S();const Q=new ae,ee=Q.signal;return{value:F((async function*(){for(;;){const P=m;m=null;const{chunk:Z,done:p,cb:k}=await P;if(e.nextTick(k),p)return;if(ee.aborted)throw new v(void 0,{cause:ee.reason});({promise:m,resolve:K}=S()),yield Z}})(),{signal:ee}),write(P,Z,p){const k=K;K=null,k({chunk:P,done:!1,cb:p})},final(P){const Z=K;K=null,Z({done:!0,cb:P})},destroy(P,Z){Q.abort(),Z(P)}}}function R(F){const m=F.readable&&typeof F.readable.read!="function"?M.wrap(F.readable):F.readable,K=F.writable;let Q=!!r(m),ee=!!n(K),ue,P,Z,p,k;function H(L){const X=p;p=null,X?X(L):L&&k.destroy(L)}return k=new fe({readableObjectMode:!!(m!=null&&m.readableObjectMode),writableObjectMode:!!(K!=null&&K.writableObjectMode),readable:Q,writable:ee}),ee&&(g(K,L=>{ee=!1,L&&A(m,L),H(L)}),k._write=function(L,X,re){K.write(L,X)?re():ue=re},k._final=function(L){K.end(),P=L},K.on("drain",function(){if(ue){const L=ue;ue=null,L()}}),K.on("finish",function(){if(P){const L=P;P=null,L()}})),Q&&(g(m,L=>{Q=!1,L&&A(m,L),H(L)}),m.on("readable",function(){if(Z){const L=Z;Z=null,L()}}),m.on("end",function(){k.push(null)}),k._read=function(){for(;;){const L=m.read();if(L===null){Z=k._read;return}if(!k.push(L))return}}),k._destroy=function(L,X){!L&&p!==null&&(L=new v),Z=null,ue=null,P=null,p===null?X(L):(p=X,A(K,L),A(m,L))},k}return yo}var bo,hu;function Rt(){if(hu)return bo;hu=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=De();bo=a;const i=fi(),o=Aa();n(a.prototype,i.prototype),n(a,i);{const _=r(o.prototype);for(let g=0;g<_.length;g++){const v=_[g];a.prototype[v]||(a.prototype[v]=o.prototype[v])}}function a(_){if(!(this instanceof a))return new a(_);i.call(this,_),o.call(this,_),_?(this.allowHalfOpen=_.allowHalfOpen!==!1,_.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),_.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(a.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(_){this._readableState&&this._writableState&&(this._readableState.destroyed=_,this._writableState.destroyed=_)}}});let s;function d(){return s===void 0&&(s={}),s}a.fromWeb=function(_,g){return d().newStreamDuplexFromReadableWritablePair(_,g)},a.toWeb=function(_){return d().newReadableWritablePairFromDuplex(_)};let h;return a.from=function(_){return h||(h=qc()),h(_,"body")},bo}var go,pu;function zl(){if(pu)return go;pu=1;const{ObjectSetPrototypeOf:e,Symbol:t}=De();go=a;const{ERR_METHOD_NOT_IMPLEMENTED:r}=Je().codes,n=Rt(),{getHighWaterMark:i}=li();e(a.prototype,n.prototype),e(a,n);const o=t("kCallback");function a(h){if(!(this instanceof a))return new a(h);const _=h?i(this,h,"readableHighWaterMark",!0):null;_===0&&(h={...h,highWaterMark:null,readableHighWaterMark:_,writableHighWaterMark:h.writableHighWaterMark||0}),n.call(this,h),this._readableState.sync=!1,this[o]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",d)}function s(h){typeof this._flush=="function"&&!this.destroyed?this._flush((_,g)=>{if(_){h?h(_):this.destroy(_);return}g!=null&&this.push(g),this.push(null),h&&h()}):(this.push(null),h&&h())}function d(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(h,_,g){throw new r("_transform()")},a.prototype._write=function(h,_,g){const v=this._readableState,x=this._writableState,q=v.length;this._transform(h,_,(A,w)=>{if(A){g(A);return}w!=null&&this.push(w),x.ended||q===v.length||v.length<v.highWaterMark?g():this[o]=g})},a.prototype._read=function(){if(this[o]){const h=this[o];this[o]=null,h()}},go}var wo,_u;function Ul(){if(_u)return wo;_u=1;const{ObjectSetPrototypeOf:e}=De();wo=r;const t=zl();e(r.prototype,t.prototype),e(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,i,o){o(null,n)},wo}var So,yu;function Ra(){if(yu)return So;yu=1;const e=it(),{ArrayIsArray:t,Promise:r,SymbolAsyncIterator:n,SymbolDispose:i}=De(),o=Wt(),{once:a}=et(),s=Ir(),d=Rt(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:v,ERR_STREAM_DESTROYED:x,ERR_STREAM_PREMATURE_CLOSE:q},AbortError:A}=Je(),{validateFunction:w,validateAbortSignal:M}=Tn(),{isIterable:E,isReadable:S,isReadableNodeStream:J,isNodeStream:G,isTransformStream:se,isWebStream:ae,isReadableStream:Y,isReadableFinished:fe}=Ot(),D=globalThis.AbortController||wt().AbortController;let R,F,m;function K(L,X,re){let oe=!1;L.on("close",()=>{oe=!0});const ie=o(L,{readable:X,writable:re},I=>{oe=!I});return{destroy:I=>{oe||(oe=!0,s.destroyer(L,I||new x("pipe")))},cleanup:ie}}function Q(L){return w(L[L.length-1],"streams[stream.length - 1]"),L.pop()}function ee(L){if(E(L))return L;if(J(L))return ue(L);throw new _("val",["Readable","Iterable","AsyncIterable"],L)}async function*ue(L){F||(F=fi()),yield*F.prototype[n].call(L)}async function P(L,X,re,{end:oe}){let ie,I=null;const C=W=>{if(W&&(ie=W),I){const u=I;I=null,u()}},V=()=>new r((W,u)=>{ie?u(ie):I=()=>{ie?u(ie):W()}});X.on("drain",C);const ne=o(X,{readable:!1},C);try{X.writableNeedDrain&&await V();for await(const W of L)X.write(W)||await V();oe&&(X.end(),await V()),re()}catch(W){re(ie!==W?h(ie,W):W)}finally{ne(),X.off("drain",C)}}async function Z(L,X,re,{end:oe}){se(X)&&(X=X.writable);const ie=X.getWriter();try{for await(const I of L)await ie.ready,ie.write(I).catch(()=>{});await ie.ready,oe&&await ie.close(),re()}catch(I){try{await ie.abort(I),re(I)}catch(C){re(C)}}}function p(...L){return k(L,a(Q(L)))}function k(L,X,re){if(L.length===1&&t(L[0])&&(L=L[0]),L.length<2)throw new v("streams");const oe=new D,ie=oe.signal,I=re?.signal,C=[];M(I,"options.signal");function V(){$(new A)}m=m||et().addAbortListener;let ne;I&&(ne=m(I,V));let W,u;const f=[];let b=0;function T(B){$(B,--b===0)}function $(B,N){var ce;if(B&&(!W||W.code==="ERR_STREAM_PREMATURE_CLOSE")&&(W=B),!(!W&&!N)){for(;f.length;)f.shift()(W);(ce=ne)===null||ce===void 0||ce[i](),oe.abort(),N&&(W||C.forEach(we=>we()),e.nextTick(X,W,u))}}let j;for(let B=0;B<L.length;B++){const N=L[B],ce=B<L.length-1,we=B>0,de=ce||re?.end!==!1,Se=B===L.length-1;if(G(N)){let ye=function(Me){Me&&Me.name!=="AbortError"&&Me.code!=="ERR_STREAM_PREMATURE_CLOSE"&&T(Me)};if(de){const{destroy:Me,cleanup:qe}=K(N,ce,we);f.push(Me),S(N)&&Se&&C.push(qe)}N.on("error",ye),S(N)&&Se&&C.push(()=>{N.removeListener("error",ye)})}if(B===0)if(typeof N=="function"){if(j=N({signal:ie}),!E(j))throw new g("Iterable, AsyncIterable or Stream","source",j)}else E(N)||J(N)||se(N)?j=N:j=d.from(N);else if(typeof N=="function"){if(se(j)){var y;j=ee((y=j)===null||y===void 0?void 0:y.readable)}else j=ee(j);if(j=N(j,{signal:ie}),ce){if(!E(j,!0))throw new g("AsyncIterable",`transform[${B-1}]`,j)}else{var O;R||(R=Ul());const ye=new R({objectMode:!0}),Me=(O=j)===null||O===void 0?void 0:O.then;if(typeof Me=="function")b++,Me.call(j,me=>{u=me,me!=null&&ye.write(me),de&&ye.end(),e.nextTick(T)},me=>{ye.destroy(me),e.nextTick(T,me)});else if(E(j,!0))b++,P(j,ye,T,{end:de});else if(Y(j)||se(j)){const me=j.readable||j;b++,P(me,ye,T,{end:de})}else throw new g("AsyncIterable or Promise","destination",j);j=ye;const{destroy:qe,cleanup:vt}=K(j,!1,!0);f.push(qe),Se&&C.push(vt)}}else if(G(N)){if(J(j)){b+=2;const ye=H(j,N,T,{end:de});S(N)&&Se&&C.push(ye)}else if(se(j)||Y(j)){const ye=j.readable||j;b++,P(ye,N,T,{end:de})}else if(E(j))b++,P(j,N,T,{end:de});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],j);j=N}else if(ae(N)){if(J(j))b++,Z(ee(j),N,T,{end:de});else if(Y(j)||E(j))b++,Z(j,N,T,{end:de});else if(se(j))b++,Z(j.readable,N,T,{end:de});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],j);j=N}else j=d.from(N)}return(ie!=null&&ie.aborted||I!=null&&I.aborted)&&e.nextTick(V),j}function H(L,X,re,{end:oe}){let ie=!1;if(X.on("close",()=>{ie||re(new q)}),L.pipe(X,{end:!1}),oe){let I=function(){ie=!0,X.end()};fe(L)?e.nextTick(I):L.once("end",I)}else re();return o(L,{readable:!0,writable:!1},I=>{const C=L._readableState;I&&I.code==="ERR_STREAM_PREMATURE_CLOSE"&&C&&C.ended&&!C.errored&&!C.errorEmitted?L.once("end",re).once("error",re):re(I)}),o(X,{readable:!1,writable:!0},re)}return So={pipelineImpl:k,pipeline:p},So}var mo,bu;function Kl(){if(bu)return mo;bu=1;const{pipeline:e}=Ra(),t=Rt(),{destroyer:r}=Ir(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:d,isReadableStream:h}=Ot(),{AbortError:_,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:v}}=Je(),x=Wt();return mo=function(...A){if(A.length===0)throw new v("streams");if(A.length===1)return t.from(A[0]);const w=[...A];if(typeof A[0]=="function"&&(A[0]=t.from(A[0])),typeof A[A.length-1]=="function"){const R=A.length-1;A[R]=t.from(A[R])}for(let R=0;R<A.length;++R)if(!(!n(A[R])&&!a(A[R]))){if(R<A.length-1&&!(i(A[R])||h(A[R])||s(A[R])))throw new g(`streams[${R}]`,w[R],"must be readable");if(R>0&&!(o(A[R])||d(A[R])||s(A[R])))throw new g(`streams[${R}]`,w[R],"must be writable")}let M,E,S,J,G;function se(R){const F=J;J=null,F?F(R):R?G.destroy(R):!D&&!fe&&G.destroy()}const ae=A[0],Y=e(A,se),fe=!!(o(ae)||d(ae)||s(ae)),D=!!(i(Y)||h(Y)||s(Y));if(G=new t({writableObjectMode:!!(ae!=null&&ae.writableObjectMode),readableObjectMode:!!(Y!=null&&Y.readableObjectMode),writable:fe,readable:D}),fe){if(n(ae))G._write=function(F,m,K){ae.write(F,m)?K():M=K},G._final=function(F){ae.end(),E=F},ae.on("drain",function(){if(M){const F=M;M=null,F()}});else if(a(ae)){const m=(s(ae)?ae.writable:ae).getWriter();G._write=async function(K,Q,ee){try{await m.ready,m.write(K).catch(()=>{}),ee()}catch(ue){ee(ue)}},G._final=async function(K){try{await m.ready,m.close().catch(()=>{}),E=K}catch(Q){K(Q)}}}const R=s(Y)?Y.readable:Y;x(R,()=>{if(E){const F=E;E=null,F()}})}if(D){if(n(Y))Y.on("readable",function(){if(S){const R=S;S=null,R()}}),Y.on("end",function(){G.push(null)}),G._read=function(){for(;;){const R=Y.read();if(R===null){S=G._read;return}if(!G.push(R))return}};else if(a(Y)){const F=(s(Y)?Y.readable:Y).getReader();G._read=async function(){for(;;)try{const{value:m,done:K}=await F.read();if(!G.push(m))return;if(K){G.push(null);return}}catch{return}}}}return G._destroy=function(R,F){!R&&J!==null&&(R=new _),S=null,M=null,E=null,J===null?F(R):(J=F,n(Y)&&r(Y,R))},G},mo}var gu;function jc(){if(gu)return jn;gu=1;const e=globalThis.AbortController||wt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=Je(),{validateAbortSignal:a,validateInteger:s,validateObject:d}=Tn(),h=De().Symbol("kWeak"),_=De().Symbol("kResistStopPropagation"),{finished:g}=Wt(),v=Kl(),{addAbortSignalNoValidate:x}=ui(),{isWritable:q,isNodeStream:A}=Ot(),{deprecate:w}=et(),{ArrayPrototypePush:M,Boolean:E,MathFloor:S,Number:J,NumberIsNaN:G,Promise:se,PromiseReject:ae,PromiseResolve:Y,PromisePrototypeThen:fe,Symbol:D}=De(),R=D("kEmpty"),F=D("kEof");function m(I,C){if(C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),A(I)&&!q(I))throw new t("stream",I,"must be writable");const V=v(this,I);return C!=null&&C.signal&&x(C.signal,V),V}function K(I,C){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal");let V=1;C?.concurrency!=null&&(V=S(C.concurrency));let ne=V-1;return C?.highWaterMark!=null&&(ne=S(C.highWaterMark)),s(V,"options.concurrency",1),s(ne,"options.highWaterMark",0),ne+=V,(async function*(){const u=et().AbortSignalAny([C?.signal].filter(E)),f=this,b=[],T={signal:u};let $,j,y=!1,O=0;function B(){y=!0,N()}function N(){O-=1,ce()}function ce(){j&&!y&&O<V&&b.length<ne&&(j(),j=null)}async function we(){try{for await(let de of f){if(y)return;if(u.aborted)throw new o;try{if(de=I(de,T),de===R)continue;de=Y(de)}catch(Se){de=ae(Se)}O+=1,fe(de,N,B),b.push(de),$&&($(),$=null),!y&&(b.length>=ne||O>=V)&&await new se(Se=>{j=Se})}b.push(F)}catch(de){const Se=ae(de);fe(Se,N,B),b.push(Se)}finally{y=!0,$&&($(),$=null)}}we();try{for(;;){for(;b.length>0;){const de=await b[0];if(de===F)return;if(u.aborted)throw new o;de!==R&&(yield de),b.shift(),ce()}await new se(de=>{$=de})}}finally{y=!0,j&&(j(),j=null)}}).call(this)}function Q(I=void 0){return I!=null&&d(I,"options"),I?.signal!=null&&a(I.signal,"options.signal"),(async function*(){let V=0;for await(const W of this){var ne;if(I!=null&&(ne=I.signal)!==null&&ne!==void 0&&ne.aborted)throw new o({cause:I.signal.reason});yield[V++,W]}}).call(this)}async function ee(I,C=void 0){for await(const V of p.call(this,I,C))return!0;return!1}async function ue(I,C=void 0){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);return!await ee.call(this,async(...V)=>!await I(...V),C)}async function P(I,C){for await(const V of p.call(this,I,C))return V}async function Z(I,C){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);async function V(ne,W){return await I(ne,W),R}for await(const ne of K.call(this,V,C));}function p(I,C){if(typeof I!="function")throw new r("fn",["Function","AsyncFunction"],I);async function V(ne,W){return await I(ne,W)?ne:R}return K.call(this,V,C)}class k extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function H(I,C,V){var ne;if(typeof I!="function")throw new r("reducer",["Function","AsyncFunction"],I);V!=null&&d(V,"options"),V?.signal!=null&&a(V.signal,"options.signal");let W=arguments.length>1;if(V!=null&&(ne=V.signal)!==null&&ne!==void 0&&ne.aborted){const $=new o(void 0,{cause:V.signal.reason});throw this.once("error",()=>{}),await g(this.destroy($)),$}const u=new e,f=u.signal;if(V!=null&&V.signal){const $={once:!0,[h]:this,[_]:!0};V.signal.addEventListener("abort",()=>u.abort(),$)}let b=!1;try{for await(const $ of this){var T;if(b=!0,V!=null&&(T=V.signal)!==null&&T!==void 0&&T.aborted)throw new o;W?C=await I(C,$,{signal:f}):(C=$,W=!0)}if(!b&&!W)throw new k}finally{u.abort()}return C}async function L(I){I!=null&&d(I,"options"),I?.signal!=null&&a(I.signal,"options.signal");const C=[];for await(const ne of this){var V;if(I!=null&&(V=I.signal)!==null&&V!==void 0&&V.aborted)throw new o(void 0,{cause:I.signal.reason});M(C,ne)}return C}function X(I,C){const V=K.call(this,I,C);return(async function*(){for await(const W of V)yield*W}).call(this)}function re(I){if(I=J(I),G(I))return 0;if(I<0)throw new i("number",">= 0",I);return I}function oe(I,C=void 0){return C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),I=re(I),(async function*(){var ne;if(C!=null&&(ne=C.signal)!==null&&ne!==void 0&&ne.aborted)throw new o;for await(const u of this){var W;if(C!=null&&(W=C.signal)!==null&&W!==void 0&&W.aborted)throw new o;I--<=0&&(yield u)}}).call(this)}function ie(I,C=void 0){return C!=null&&d(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),I=re(I),(async function*(){var ne;if(C!=null&&(ne=C.signal)!==null&&ne!==void 0&&ne.aborted)throw new o;for await(const u of this){var W;if(C!=null&&(W=C.signal)!==null&&W!==void 0&&W.aborted)throw new o;if(I-- >0&&(yield u),I<=0)return}}).call(this)}return jn.streamReturningOperators={asIndexedPairs:w(Q,"readable.asIndexedPairs will be removed in a future version."),drop:oe,filter:p,flatMap:X,map:K,take:ie,compose:m},jn.promiseReturningOperators={every:ue,forEach:Z,reduce:H,toArray:L,some:ee,find:P},jn}var vo,wu;function Hl(){if(wu)return vo;wu=1;const{ArrayPrototypePop:e,Promise:t}=De(),{isIterable:r,isNodeStream:n,isWebStream:i}=Ot(),{pipelineImpl:o}=Ra(),{finished:a}=Wt();Vl();function s(...d){return new t((h,_)=>{let g,v;const x=d[d.length-1];if(x&&typeof x=="object"&&!n(x)&&!r(x)&&!i(x)){const q=e(d);g=q.signal,v=q.end}o(d,(q,A)=>{q?_(q):h(A)},{signal:g,end:v})})}return vo={finished:a,pipeline:s},vo}var Su;function Vl(){if(Su)return eo.exports;Su=1;const{Buffer:e}=nt(),{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=De(),{promisify:{custom:i}}=et(),{streamReturningOperators:o,promiseReturningOperators:a}=jc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=Je(),d=Kl(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:_}=li(),{pipeline:g}=Ra(),{destroyer:v}=Ir(),x=Wt(),q=Hl(),A=Ot(),w=eo.exports=Ea().Stream;w.isDestroyed=A.isDestroyed,w.isDisturbed=A.isDisturbed,w.isErrored=A.isErrored,w.isReadable=A.isReadable,w.isWritable=A.isWritable,w.Readable=fi();for(const E of r(o)){let J=function(...G){if(new.target)throw s();return w.Readable.from(n(S,this,G))};const S=o[E];t(J,"name",{__proto__:null,value:S.name}),t(J,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:J,enumerable:!1,configurable:!0,writable:!0})}for(const E of r(a)){let J=function(...G){if(new.target)throw s();return n(S,this,G)};const S=a[E];t(J,"name",{__proto__:null,value:S.name}),t(J,"length",{__proto__:null,value:S.length}),t(w.Readable.prototype,E,{__proto__:null,value:J,enumerable:!1,configurable:!0,writable:!0})}w.Writable=Aa(),w.Duplex=Rt(),w.Transform=zl(),w.PassThrough=Ul(),w.pipeline=g;const{addAbortSignal:M}=ui();return w.addAbortSignal=M,w.finished=x,w.destroy=v,w.compose=d,w.setDefaultHighWaterMark=h,w.getDefaultHighWaterMark=_,t(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return q}}),t(g,i,{__proto__:null,enumerable:!0,get(){return q.pipeline}}),t(x,i,{__proto__:null,enumerable:!0,get(){return q.finished}}),w.Stream=w,w._isUint8Array=function(S){return S instanceof Uint8Array},w._uint8ArrayToBuffer=function(S){return e.from(S.buffer,S.byteOffset,S.byteLength)},eo.exports}var mu;function Wc(){return mu||(mu=1,(function(e){const t=Vl(),r=Hl(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Zi)),Zi.exports}var vu;function Fc(){if(vu)return Xr;vu=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.ActorQueryResultSerializeSparqlJson=void 0;const e=Dl(),t=qt(),r=Nl(),n=Wc();let i=class nn extends e.ActorQueryResultSerializeFixedMediaTypes{constructor(a){super(a)}static bindingToJsonBindings(a){if(a.termType==="Literal"){const s=a,d={value:s.value,type:"literal"},{language:h,datatype:_}=s;return h?d["xml:lang"]=h:_&&_.value!=="http://www.w3.org/2001/XMLSchema#string"&&(d.datatype=_.value),d}return a.termType==="BlankNode"?{value:a.value,type:"bnode"}:a.termType==="Quad"?{value:{subject:nn.bindingToJsonBindings(a.subject),predicate:nn.bindingToJsonBindings(a.predicate),object:nn.bindingToJsonBindings(a.object)},type:"triple"}:{value:a.value,type:"uri"}}async testHandleChecked(a,s){return["bindings","boolean"].includes(a.type)?(0,t.passTestVoid)():(0,t.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(a,s,d){const h=new n.Readable,_={};if(a.type==="bindings"){const g=await a.metadata();g.variables.length>0&&(_.vars=g.variables.map(v=>v.variable.value))}if(h.push(`{"head": ${JSON.stringify(_)},
|
|
9
|
+
`),a.type==="bindings"){const g=a.bindingsStream;h.push(`"results": { "bindings": [
|
|
10
|
+
`);let v=!0;function*x(q){yield q()}h.wrap((0,r.wrap)(g).map(q=>{const A=`${v?"":`,
|
|
11
|
+
`}${JSON.stringify(Object.fromEntries([...q].map(([w,M])=>[w.value,nn.bindingToJsonBindings(M)])))}`;return v=!1,A}).append((0,r.wrap)(x(()=>`
|
|
12
|
+
]}${this.emitMetadata?`,
|
|
13
|
+
"metadata": { "httpRequests": ${this.httpObserver.requests} }`:""}}
|
|
14
|
+
`))))}else h.wrap((0,r.wrap)(a.execute().then(g=>[`"boolean":${g}
|
|
15
|
+
}
|
|
16
|
+
`])));return{data:h}}};return Xr.ActorQueryResultSerializeSparqlJson=i,Xr}var Eu;function Bc(){return Eu||(Eu=1,(function(e){var t=Xt&&Xt.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Xt&&Xt.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(kc(),e),r(Fc(),e)})(Xt)),Xt}var zc=Bc();const hn=Array.from(new Set([...Cu,"zhipu","ollama","custom"])),Au=new WeakMap,Uc=Ma.storage.base.slice(Ma.storage.base.lastIndexOf("/")+1);function Kc(e){const t=e.indexOf("#");return t<0?e:e.slice(0,t)}function Td(e){Gc(),Zl({createQueryEngine:async()=>new ef});const t=new URL("settings/-/sparql",e.podUrl).toString();return pe.setSparqlEndpoint(t),xe.setSparqlEndpoint(t),Xe.setSparqlEndpoint(t),{credentialsTableDocument(){return pe.buildIri(e.podUrl,{id:Uc})},providerTableDocument(r,n){const i=ot(r);if(!i)throw new Error("unsupported_provider");const o=i==="custom"&&n?Co(n):tr(i);return xe.buildIri(e.podUrl,{id:Kc(o)})},async listModels(){return await e.database.init?.(Xe),(await e.database.select().from(Xe).execute()).map(Zc).filter(fr)},async listProviders(){await e.database.init?.(pe,xe,Xe);const r=await e.database.select().from(pe).execute(),n=await e.database.select().from(xe).execute(),i=await e.database.select().from(Xe).execute();return Yc(e,r,n,i)},async createApiKeyCredential(r,n){const i=ot(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(pe,xe);const o=le(n.id),a=o??pe.buildId({id:Da(i,"apiKey")}),s=1,d=On(i,n.offeringId??Bn(i,"apiKey")),h=n.baseUrl??La(i,d),_=Ao(n.proxyUrl),g={id:a,provider:i==="custom"?Co(a):tr(i),service:"ai",authMode:"apiKey",offeringId:d,status:"active",accountLabel:n.label,label:n.label,baseUrl:h,proxyUrl:_,keyVersion:String(s),reauthRequired:!1,encryptedSecret:Fn(e,i,a,{type:"apiKey",apiKey:n.apiKey}),encryptionAlgorithm:"PLAINTEXT",metadata:{...Mn({offeringId:d,baseUrl:h,priority:n.priority}),...n.compatibility?{compatibility:n.compatibility}:{}}};return await Tu(e,a,g,o!==void 0),He(e,i,g)},async createLocalCredential(r,n){const i=ot(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(pe,xe);const o=le(n.id),a=o??pe.buildId({id:Da(i,"local")}),s=On(i,n.offeringId??Bn(i,"local")),d=n.baseUrl??La(i,s),h={id:a,provider:tr(i),service:"ai",authMode:"local",offeringId:s,status:"active",accountLabel:n.label??"Local",label:n.label??"Local",baseUrl:d,keyVersion:"1",reauthRequired:!1,encryptedSecret:Fn(e,i,a,{type:"local"}),encryptionAlgorithm:"PLAINTEXT",metadata:Mn({offeringId:s,baseUrl:d,priority:n.priority})};return await Tu(e,a,h,o!==void 0),He(e,i,h)},async saveOAuthCredential(r,n){const i=ot(r);if(!i)throw new Error("unsupported_provider");const a=(Au.get(e.database)??Promise.resolve()).then(async()=>{await e.database.init?.(pe,xe);const s=On(i,n.offeringId??Bn(i,"deviceCode")),h=(await e.database.select().from(pe).execute()).find(E=>{const S=He(e,i,E);if(!S||S.authMode!=="deviceCode"&&S.authMode!=="oauth"||Mu(i,S.offeringId)!==Mu(i,s)||E.status!=="active"&&E.status!=="disabled")return!1;const J=on(e,i,S.id,E.encryptedSecret);return Qc(n,at(E.metadata),J)}),_=h&&He(e,i,h),g=at(h?.metadata),v=_&&on(e,i,_.id,h?.encryptedSecret),x=_?.id??pe.buildId({id:`${i}-oauth-${crypto.randomUUID()}`}),q=n.accountLabel??"OAuth",A=n.accountId??le(g?.accountId)??le(v?.accountId),w=n.accountSubject??le(g?.authoritativeSubject)??le(v?.accountSubject)??le(v?.authoritativeSubject),M={...h,id:x,provider:tr(i),service:"ai",authMode:"deviceCodeOAuth",offeringId:s,status:_?.enabled===!1?"disabled":"active",accountLabel:h?.accountLabel??q,label:h?.label??q,expiresAt:n.expiresAt,scopes:n.scope?n.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String((_?.version??0)+1),reauthRequired:!1,encryptedSecret:Fn(e,i,x,{type:"deviceCodeOAuth",accessToken:n.accessToken,refreshToken:n.refreshToken,expiresAt:n.expiresAt,scope:n.scope,idToken:n.idToken,accountId:A,accountSubject:w,accountLabel:n.accountLabel,offeringId:s,authorizationMethodId:n.authorizationMethodId}),encryptionAlgorithm:"PLAINTEXT",metadata:{...g,...Mn({offeringId:s,priority:_?.priority,enabled:_?.enabled,health:"healthy"}),authoritativeSubject:w,accountId:A,authorizationMethodId:n.authorizationMethodId}};if(h){const E={...M};if(delete E.id,!await e.database.updateById(pe,x,E))throw new Error("credential_version_conflict")}else await e.database.insert(pe).values(M).execute();return He(e,i,M)});return Au.set(e.database,a.then(()=>{},()=>{})),a},async updateOAuthCredential(r,n,i,o){const a=ot(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(pe,xe);const s=await e.database.findById(pe,n),d=s&&He(e,a,s);if(!s||!d||d.authMode!=="deviceCode")throw new Error("oauth_credential_not_found");if(d.version!==i)throw new Error("credential_version_conflict");const h=on(e,a,n,s.encryptedSecret),_=o.accountId??le(at(s.metadata)?.accountId)??le(h?.accountId),g=o.accountSubject??le(at(s.metadata)?.authoritativeSubject)??le(h?.accountSubject)??le(h?.authoritativeSubject),v=On(a,o.offeringId??d.offeringId),x={expiresAt:o.expiresAt,scopes:o.scope?o.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String(i+1),reauthRequired:!1,status:"active",encryptedSecret:Fn(e,a,n,{type:"deviceCodeOAuth",accessToken:o.accessToken,refreshToken:o.refreshToken,expiresAt:o.expiresAt,scope:o.scope,idToken:o.idToken,accountId:_,accountSubject:g,accountLabel:o.accountLabel??le(s.accountLabel),offeringId:v,authorizationMethodId:o.authorizationMethodId??le(at(s.metadata)?.authorizationMethodId)}),accountLabel:o.accountLabel??le(s.accountLabel),label:o.accountLabel??le(s.label),offeringId:v,metadata:{...at(s.metadata),...Mn({offeringId:v,health:"healthy"}),authoritativeSubject:g,accountId:_,authorizationMethodId:o.authorizationMethodId??le(at(s.metadata)?.authorizationMethodId)}},q=await e.database.updateById(pe,n,x);if(!q)throw new Error("credential_version_conflict");return He(e,a,q)},async updateProviderCredential(r,n,i){const o=ot(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(pe,xe);const a=await e.database.findById(pe,n),s=a&&He(e,o,a);if(!a||!s)throw new Error("credential_not_found");if(s.version!==i.expectedVersion)throw new Error("credential_version_conflict");const d={...at(a.metadata),...i.priority===void 0?{}:{priority:i.priority},...i.enabled===void 0?{}:{enabled:i.enabled},...i.baseUrl===void 0?{}:{baseUrl:i.baseUrl},...i.proxyUrl===void 0?{}:{proxyUrl:Ao(i.proxyUrl)}},h={...i.label===void 0?{}:{accountLabel:i.label,label:i.label},...i.baseUrl===void 0?{}:{baseUrl:i.baseUrl},...i.proxyUrl===void 0?{}:{proxyUrl:Ao(i.proxyUrl)},...i.enabled===void 0?{}:{status:i.enabled?"active":"disabled"},keyVersion:String(s.version+1),metadata:d},_=await e.database.updateById(pe,n,h);if(!_)throw new Error("credential_update_failed");const g=He(e,o,_);if(!g)throw new Error("credential_update_failed");return g},async markCredentialHealth(r,n,i,o){const a=ot(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(pe);const s=await e.database.findById(pe,n),d=s&&He(e,a,s);if(!s||!d)throw new Error("credential_not_found");if(d.version!==o)throw new Error("credential_version_conflict");const h=await e.database.updateById(pe,n,{keyVersion:String(d.version+1),metadata:{...at(s.metadata),health:i}});if(!h)throw new Error("credential_update_failed");const _=He(e,a,h);if(!_)throw new Error("credential_update_failed");return _},async deleteProviderCredential(r,n){const i=ot(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(pe,xe);const o=await e.database.findById(pe,n),a=o&&He(e,i,o);if(a)return await e.database.deleteById(pe,n),a},async readCredentialSecret(r,n){const i=ot(r);if(!i)throw new Error("unsupported_provider");const o=await e.database.findById(pe,n);if(!o||!He(e,i,o))throw new Error("credential_not_found");const a=on(e,i,n,o.encryptedSecret);if(!a)throw new Error("credential_secret_unavailable");return a},async saveDiscoveredModels(r,n,i){const o=ot(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(pe,xe,Xe);const a=await Ru(e,n),s=Ou(o,a);await Lu(e.database,s,Un(o));const d=await e.database.select().from(Xe).execute(),h=new Set(d.map(v=>le(v.id)).filter(fr)),_=i.map(ed).filter(fr),g=new Set(_.map(v=>v.id));for(const v of d.filter(x=>td(x,s,o))){const x=rr(le(v.id),s)??Yl(le(v.id));x&&!g.has(x)&&le(v.status)!=="unavailable"&&await e.database.updateById(Xe,String(v.id),{status:"unavailable"})}for(const v of _)await rd(e.database,s,v,h)},async saveModelSelection(r,n,i){const o=ot(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(xe,Xe);const a=o==="custom"&&i?await Ru(e,i):null;if(o==="custom"&&i&&!a)throw new Error("credential_not_found");const s=a?Ou(o,a):tr(o);await Lu(e.database,s,Un(o));const h=(await e.database.select().from(xe).execute()).find(A=>lr(le(A.id),s)),_=le(h?.id)??s,g=Jl(h?.hasModel),v=await e.database.select().from(Xe).execute(),x=[...new Set(n.map(A=>id(o,A,v,a?s:void 0)))];if(!await e.database.updateById(xe,_,{hasModel:x}))throw new Error("provider_model_selection_update_failed");e.authenticatedFetch&&await Vc(e,_,g,x)}}}const Hc="https://undefineds.co/ns#hasModel";async function Vc(e,t,r,n){const i=Eo(xe,e.podUrl,t),o=r.map(_=>Eo(Xe,e.podUrl,_)),a=n.map(_=>Eo(Xe,e.podUrl,_)),s=_=>_.map(g=>`<${i}> <${Hc}> <${g}> .`).join(`
|
|
17
|
+
`),d=[o.length>0?`DELETE DATA { ${s(o)} }`:void 0,a.length>0?`INSERT DATA { ${s(a)} }`:void 0].filter(_=>!!_);if(d.length===0)return;const h=await e.authenticatedFetch(i.split("#",1)[0],{method:"PATCH",headers:{"content-type":"application/sparql-update"},body:d.join(`;
|
|
18
|
+
`)});if(!h.ok)throw new Error(`provider_model_selection_persist_failed:${h.status}`)}function Eo(e,t,r){return/^https?:\/\//u.test(r)?r:e.buildIri(t,{id:r})}async function Ru(e,t){const r=await e.database.findById(pe,t);return r||((await e.database.select().from(pe).execute()).find(i=>{const o=le(i.id);return o===t||(o?pe.buildIri(e.podUrl,{id:o})===t:!1)})??null)}function Gc(){Iu(Cc.ActionObserverHttp.prototype),Iu(zc.ActionObserverHttp.prototype)}function Iu(e){const t=e;if(t.__xpodObservedActorsPatch)return;const r=t.onRun;t.onRun=function(n,i,o){return Array.isArray(this.observedActors)||(this.observedActors=[]),r.call(this,n,i,o)},t.__xpodObservedActorsPatch=!0}function Yc(e,t,r,n){const i=t.filter(o=>le(o.service)==="ai").filter(o=>le(o.status)!=="revoked");return hn.map(o=>{const a=i.map(_=>He(e,o,_)).filter(fr).sort((_,g)=>_.priority-g.priority||_.id.localeCompare(g.id)),s=r.find(_=>Lt(le(_.id))===o),h=Jl(s?.hasModel).map(_=>Xc(o,_,n));return{id:o,name:o==="custom"?a.find(_=>_.label)?.label??Un(o):Un(o),offerings:o==="custom"?od(i.filter(_=>He(e,o,_))):tf(o,e.openAiSubscriptionImportAvailable===!0),credentials:a,selectedModels:h,status:ad(a)}})}async function Tu(e,t,r,n){if(!(n?await e.database.findById(pe,t):null)){await e.database.insert(pe).values(r).execute();return}const o={...r};if(delete o.id,!await e.database.updateById(pe,t,o))throw new Error("credential_create_failed")}function Fn(e,t,r,n){return af({webId:e.webId,provider:t,credentialIri:pe.buildIri(e.podUrl,{id:r}),secret:n})}function Qc(e,t,r){let n=!1;for(const[i,o]of[[e.accountId,[t?.accountId,r?.accountId]],[e.accountSubject,[t?.authoritativeSubject,r?.accountSubject,r?.authoritativeSubject]]]){const a=[...new Set(o.map(le).filter(fr).filter(s=>s.trim()))];if(a.length>1)return!1;if(!(!i?.trim()||!a.length)){if(a[0]!==i)return!1;n=!0}}return n}function He(e,t,r){const n=le(r.id);if(!n)return;const i=Ta(le(r.provider))??ud(n);if(i!==t)return;const o=at(r.metadata),a=Xl(r.authMode);if(a)return{id:n,provider:i,offeringId:Gl(r,i,a),authMode:a,label:le(r.accountLabel)??le(r.label),enabled:Pu(o?.enabled)??le(r.status)==="active",priority:Du(o?.priority)??100,health:fd(o?.health)??(Pu(r.reauthRequired)?"expired":"healthy"),maskedHint:sd(e,i,n,r.encryptedSecret),baseUrl:le(r.baseUrl),proxyUrl:ld(le(r.proxyUrl)??le(o?.proxyUrl)),compatibility:Jc(o?.compatibility),expiresAt:cd(r.expiresAt),version:Du(r.keyVersion)??0}}function Jc(e){return e==="auto"||e==="openai"||e==="anthropic"?e:void 0}function Gl(e,t,r){return le(e.offeringId)??le(at(e.metadata)?.offeringId)??Oa(le(e.provider))??Bn(t,r)}function Xc(e,t,r){const n=r.find(s=>nr(le(s.id))===nr(t)),i=le(n?.isProvidedBy),o=n?rr(t,i??e)??t:rr(t,e)??t,a=n??r.find(s=>{const d=le(s.id),h=le(s.isProvidedBy);return d===t||rr(d,e)===o||Ta(h)===e&&rr(d,h??e)===o});return{id:o,provider:e,offeringId:Oa(le(a?.isProvidedBy)),credentialId:Ia(i),resourceId:le(a?.id)??t,displayName:le(a?.displayName),availability:le(a?.status)==="unavailable"||!a?"unavailable":"available"}}function Zc(e){const t=le(e.isProvidedBy),r=Ta(t),n=r&&rr(le(e.id),t??r);if(!(!r||!n))return{id:n,provider:r,offeringId:Oa(t),credentialId:Ia(t),resourceId:le(e.id),displayName:le(e.displayName),availability:le(e.status)==="unavailable"?"unavailable":"available",...nd(e)}}function ed(e){const t=at(e),r=le(t?.id);if(r)return{id:r,displayName:le(t?.displayName),modelType:Ql(t?.modelType)}}function Ou(e,t){const r=Ia(le(t?.provider));return r?Co(r):tr(e)}function tr(e){return uf(e)}function Co(e){return lf(e)}function Ia(e){const t=Lt(e),r=t?.startsWith("custom-instance-")?t.slice(16):void 0;if(r)try{return decodeURIComponent(r)}catch{return}}function Mu(e,t){if(!t)return;const r=t.trim().toLowerCase();if(e==="bailian"){if(r==="token-plan")return"token-plan-personal";if(r==="coding-plan")return"coding-plan-pro";if(r==="payg")return"pay-as-you-go"}return r}function lr(e,t){const r=nr(e),n=nr(t);return r!==void 0&&r===n}function td(e,t,r){const n=le(e.isProvidedBy);return lr(n,t)?!0:r==="custom"?!1:Lt(n)?.startsWith(`${r}-`)===!0}function Yl(e){if(!e)return;const t=e.lastIndexOf("#");if(t<0||t===e.length-1)return;const r=e.slice(t+1);try{return decodeURIComponent(r)}catch{return r}}async function Lu(e,t,r){(await e.select().from(xe).execute()).some(i=>lr(le(i.id),t))||await e.insert(xe).values({id:t,displayName:r}).execute()}async function rd(e,t,r,n){const i=ko(t,r.id),o={displayName:r.displayName??r.id,isProvidedBy:t,status:"active",...r.modelType?{modelType:r.modelType}:{}};if(n.has(i)){await e.updateById(Xe,i,o);return}await e.insert(Xe).values({id:i,...o}).execute(),n.add(i)}function nd(e){const t=Ql(e.modelType);return t?{modelType:t,...t==="embedding"?{capabilities:["embedding"]}:{}}:{}}function Ql(e){const t=le(e)?.trim().toLowerCase();return t==="chat"||t==="embedding"?t:void 0}function ko(e,t){const r=nr(e)??`${e}.ttl`;return`${r.split("#",1)[0]??r}#${encodeURIComponent(t)}`}function id(e,t,r,n){const i=le(t.resourceId),o=n??tr(e),a=le(t.id),s=a?r.filter(h=>{const _=le(h.isProvidedBy),g=Lt(_);return(n?lr(_,n):g===e||g?.startsWith(`${e}-`)===!0)&&rr(le(h.id),_??o)===a}):[],d=n||s.length===1?s[0]:void 0;if(i){const h=r.find(x=>le(x.id)===i);if(!h&&d)return String(d.id);const _=le(h?.isProvidedBy),g=Lt(_),v=n?lr(_,n):g===e||g?.startsWith(`${e}-`)===!0;if(h&&!v)throw new Error("invalid_model_selection_resource");if(!h){const x=a??Yl(i),q=Lt(i),A=n?lr(q,n):q===e||q?.startsWith(`${e}-`)===!0;if(!x||!A)throw new Error("invalid_model_selection_resource");return ko(o,x)}return i}if(!a)throw new Error("invalid_model_selection_resource");return le(d?.id)??ko(o,a)}function rr(e,t){if(!e)return;const n=nr(t)?.split("#",1)[0]??t,i=n.endsWith(".ttl")?`${n}#`:`${n}.ttl#`,o=e.lastIndexOf(i);if(!(o<0))try{return decodeURIComponent(e.slice(o+i.length))}catch{return e.slice(o+i.length)}}function Jl(e){if(Array.isArray(e))return e.map(le).filter(fr);const t=le(e);return t?[t]:[]}function od(e){const t=new Map;for(const r of e){const n=at(r.metadata),i=Gl(r,"custom",Xl(r.authMode)??"apiKey"),o=rf(n?.compatibility,i),a=le(r.baseUrl)??le(n?.baseUrl),s=Ln.find(d=>d.id===i)??Ln.find(d=>d.id===`${o}-compatible`)??Ln[0];t.set(i,{...s,id:i,endpoints:a?[{protocol:o==="anthropic"?"anthropic":"chatCompletions",baseUrl:a}]:s.endpoints,modelDiscovery:o==="anthropic"?{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"}:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"}})}return t.size>0?[...t.values()]:Ln}function ad(e){return e.some(t=>t.health==="expired"||t.health==="invalid")?"attention":e.some(t=>t.enabled)?"available":e.length>0?"configured":"unconfigured"}function sd(e,t,r,n){const i=on(e,t,r,n),o=le(i?.apiKey);if(o)return o.length<=8?`${o.slice(0,2)}…`:`${o.slice(0,3)}...${o.slice(-4)}`}function on(e,t,r,n){return sf({webId:e.webId,provider:t,credentialIri:pe.buildIri(e.podUrl,{id:r}),envelope:n})}function Ta(e){const t=Lt(e),r=ot(t);return r||hn.find(n=>t?.startsWith(`${n}-`))}function Oa(e){const t=Lt(e);if(t&&!t.startsWith("custom-instance-")){if(t==="bailian-token-plan-personal")return"token-plan";if(t==="bailian-token-plan-team")return"token-plan-team";if(t==="bailian-coding-plan-pro")return"coding-plan";if(t==="bailian-pay-as-you-go")return"pay-as-you-go";for(const r of hn)if(t.startsWith(`${r}-`))return t.slice(r.length+1)}}function ud(e){const t=/\/([^/#]+)\.ttl#/u.exec(e);return ot(t?.[1])}function ot(e){if(typeof e!="string"||!e.trim())return;const t=e.trim().toLowerCase();if(t==="zhipu"||t.startsWith("zhipu-"))return"zhipu";if(hn.includes(t))return t;for(const r of hn)if(t.startsWith(`${r}-`)||r==="bailian"&&(t==="bailian-token-plan"||t==="bailian-coding-plan"))return r}function Ao(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{throw new Error("invalid_proxy_url")}if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.hash||!t.hostname)throw new Error("invalid_proxy_url");return t.toString().replace(/\/$/u,"")}function ld(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{return}if(!(!["http:","https:"].includes(t.protocol)||!t.hostname))return t.username="",t.password="",t.search="",t.hash="",t.toString().replace(/\/$/u,"")}function Xl(e){if(e==="oauth"||e==="deviceCode"||e==="apiKey"||e==="local")return e;if(e==="deviceCodeOAuth")return"deviceCode"}function fd(e){if(e==="healthy"||e==="expired"||e==="invalid"||e==="unknown")return e;if(e==="reauthRequired")return"expired";if(e==="disabled")return"unknown"}function at(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function le(e){return typeof e=="string"&&e.trim()?e:void 0}function Du(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function Pu(e){if(typeof e=="boolean")return e;if(e==="true")return!0;if(e==="false")return!1}function cd(e){return e instanceof Date?e.toISOString():le(e)}function fr(e){return e!==void 0}export{lf as a,uf as b,Da as c,Td as d,_d as e,Lt as p};
|