n9router 0.3.87 → 0.3.89
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/translator/send/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/translator/translate/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/chart/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/request-details/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/request-logs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/stats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/usage/stream/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/api/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/embeddings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/messages/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/responses/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/callback/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/callback.html +1 -1
- package/.next/standalone/.next/server/app/callback.rsc +12 -12
- package/.next/standalone/.next/server/app/callback.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/callback.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/callback.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/callback.segments/callback.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/basic-chat.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/basic-chat.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/cli-tools.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/cli-tools.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/combos.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/combos.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/combos.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/combos.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/endpoint.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/endpoint.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/mitm.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/mitm.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/profile.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/profile.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/profile.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/profile.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/providers/new.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/providers/new.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/providers.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/providers.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/providers.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/providers.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/quota.html +2 -2
- package/.next/standalone/.next/server/app/dashboard/quota.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/quota.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/quota.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/translator.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/translator.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/translator.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/translator.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard/usage.html +1 -1
- package/.next/standalone/.next/server/app/dashboard/usage.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/usage.segments/_full.segment.rsc +13 -13
- package/.next/standalone/.next/server/app/dashboard/usage.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/dashboard.html +1 -1
- package/.next/standalone/.next/server/app/dashboard.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/dashboard.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/dashboard.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/landing.html +1 -1
- package/.next/standalone/.next/server/app/landing.rsc +12 -12
- package/.next/standalone/.next/server/app/landing.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/landing.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/landing.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/landing.segments/landing.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login.html +1 -1
- package/.next/standalone/.next/server/app/login.rsc +12 -12
- package/.next/standalone/.next/server/app/login.segments/_full.segment.rsc +12 -12
- package/.next/standalone/.next/server/app/login.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/login.segments/_index.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/login.segments/login/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/login.segments/login.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.yvcis._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0148t9m._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b802lh._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kpc-o6._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lc~.sk._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lp_pm5._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pwrfp1._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uw3x8s._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y.reft._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y5ae.7._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0itng60._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_00c58qj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0_xhepz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_(dashboard)_dashboard_providers_[id]_page_0-3xvzc.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/static/chunks/0b285gqd-hcvu.js +1 -0
- package/.next/standalone/.next/static/chunks/{0fic3ew7j~9an.js → 0hgyabetclndg.js} +1 -1
- package/.next/standalone/mitm/paths.js +17 -0
- package/.next/standalone/package-lock.json +2 -2
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/scripts/publish-npm.sh +2 -0
- package/.next/standalone/src/app/(dashboard)/dashboard/providers/[id]/page.js +2 -1
- package/.next/standalone/src/mitm/paths.js +17 -0
- package/.next/static/chunks/0b285gqd-hcvu.js +1 -0
- package/.next/static/chunks/{0fic3ew7j~9an.js → 0hgyabetclndg.js} +1 -1
- package/package.json +1 -1
- package/.next/standalone/.next/static/chunks/09g0cm09ynuao.js +0 -1
- package/.next/static/chunks/09g0cm09ynuao.js +0 -1
- /package/.next/standalone/.next/static/{p9jVbJQhFsaISYB4CfDfF → XSoZ0BJFg1b0W2IGyybf7}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{p9jVbJQhFsaISYB4CfDfF → XSoZ0BJFg1b0W2IGyybf7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{p9jVbJQhFsaISYB4CfDfF → XSoZ0BJFg1b0W2IGyybf7}/_ssgManifest.js +0 -0
- /package/.next/static/{p9jVbJQhFsaISYB4CfDfF → XSoZ0BJFg1b0W2IGyybf7}/_buildManifest.js +0 -0
- /package/.next/static/{p9jVbJQhFsaISYB4CfDfF → XSoZ0BJFg1b0W2IGyybf7}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{p9jVbJQhFsaISYB4CfDfF → XSoZ0BJFg1b0W2IGyybf7}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports=[32662,(e,t,r)=>{function a(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}t.exports={log:e=>console.log(`[${a()}] [MITM] ${e}`),err:e=>console.error(`[${a()}] ❌ [MITM] ${e}`)}},50230,(e,t,r)=>{let{exec:a,spawn:i,execSync:n}=e.r(33405),s=e.r(22734),o=e.r(14747),c=e.r(46786),{log:u,err:l}=e.r(32662),f={antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]};process.platform,process.platform;let p="/etc/hosts";function h(){try{return n("command -v sudo",{stdio:"ignore"}),!0}catch{return!1}}function d(e,t){return new Promise((r,a)=>{let n=h(),s=n?i("sudo",["-S","sh","-c",e],{stdio:["pipe","pipe","pipe"]}):i("sh",["-c",e],{stdio:["ignore","pipe","pipe"]}),o="",c="";s.stdout.on("data",e=>{o+=e}),s.stderr.on("data",e=>{c+=e}),s.on("close",e=>{0===e?r(o):a(Error(c||`Exit code ${e}`))}),n&&(s.stdin.write(`${t}
|
|
2
2
|
`),s.stdin.end())})}async function y(e){await d("dscacheutil -flushcache && killall -HUP mDNSResponder",e)}function g(e=null){try{let t=s.readFileSync(p,"utf8");if(e)return t.includes(e);return f.antigravity.every(e=>t.includes(e))}catch{return!1}}async function m(e,t){let r=f[e];if(!r)throw Error(`Unknown tool: ${e}`);let a=r.filter(e=>!g(e));if(0===a.length)return void u(`🌐 DNS ${e}: already active`);let i=a.map(e=>`127.0.0.1 ${e}`).join("\n");try{await d(`echo "${i}" >> ${p}`,t),await y(t),u(`🌐 DNS ${e}: ✅ added ${a.join(", ")}`)}catch(e){throw Error(e.message?.includes("incorrect password")?"Wrong sudo password":"Failed to add DNS entry")}}async function v(e,t){let r=f[e];if(!r)throw Error(`Unknown tool: ${e}`);let a=r.filter(e=>g(e));if(0===a.length)return void u(`🌐 DNS ${e}: already inactive`);try{for(let e of a){let r=`sed -i '' '/${e}/d' ${p}`;await d(r,t)}await y(t),u(`🌐 DNS ${e}: ✅ removed ${a.join(", ")}`)}catch(e){throw Error(e.message?.includes("incorrect password")?"Wrong sudo password":"Failed to remove DNS entry")}}async function C(e){for(let t of Object.keys(f))try{await v(t,e)}catch(e){l(`DNS ${t}: failed to remove — ${e.message}`)}}t.exports={TOOL_HOSTS:f,addDNSEntry:m,removeDNSEntry:v,removeAllDNSEntries:C,execWithPassword:d,isSudoAvailable:h,executeElevatedPowerShell:function(e,t=3e4){let r=o.join(c.tmpdir(),`ps_done_${Date.now()}.flag`),i=s.readFileSync(e,"utf8");i+=`
|
|
3
3
|
Set-Content -Path '${r.replace(/'/g,"''")}' -Value 'done' -Encoding UTF8
|
|
4
|
-
`,s.writeFileSync(e,i,"utf8");let n=`Start-Process powershell -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-WindowStyle','Hidden','-File','${e.replace(/'/g,"''")}' -Verb RunAs -WindowStyle Hidden`;return new Promise((i,o)=>{let c=!1,u=(e,t)=>{c||(c=!0,e(t))};a(`powershell -NoProfile -NonInteractive -WindowStyle Hidden -Command "${n}"`,{windowsHide:!0},()=>{});let l=Date.now()+t,f=()=>{if(!c){if(s.existsSync(r)){try{s.unlinkSync(r),s.unlinkSync(e)}catch{}return u(i)}if(Date.now()>l){try{s.unlinkSync(e)}catch{}return u(o,Error("Timed out waiting for UAC confirmation"))}setTimeout(f,500)}};setTimeout(f,300)})},checkDNSEntry:g,checkAllDNSStatus:function(){try{let e=s.readFileSync(p,"utf8"),t={};for(let[r,a]of Object.entries(f))t[r]=a.every(t=>e.includes(t));return t}catch{return Object.fromEntries(Object.keys(f).map(e=>[e,!1]))}}}},96266,(e,t,r)=>{let a=e.r(14747),i=e.r(46786),n=process.env.DATA_DIR?process.env.DATA_DIR:a.join(i.homedir(),".n9router"),s=a.join(n,"mitm");t.exports={DATA_DIR:n,MITM_DIR:s}},2015,(e,t,r)=>{t.exports={options:{usePureJavaScript:!1}}},95461,(e,t,r)=>{var a={};t.exports=a;var i={};a.encode=function(e,t,r){if("string"!=typeof t)throw TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw TypeError('"maxline" must be a number.');var a="";if(e instanceof Uint8Array){var i=0,n=t.length,s=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<o.length;++c)u+=o[c]<<8,o[c]=u%n,u=u/n|0;for(;u>0;)o.push(u%n),u=u/n|0}for(i=0;0===e[i]&&i<e.length-1;++i)a+=s;for(i=o.length-1;i>=0;--i)a+=t[o[i]]}else a=function(e,t){var r=0,a=t.length,i=t.charAt(0),n=[0];for(r=0;r<e.length();++r){for(var s=0,o=e.at(r);s<n.length;++s)o+=n[s]<<8,n[s]=o%a,o=o/a|0;for(;o>0;)n.push(o%a),o=o/a|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=n.length-1;r>=0;--r)c+=t[n[r]];return c}(e,t);if(r){var l=RegExp(".{1,"+r+"}","g");a=a.match(l).join("\r\n")}return a},a.decode=function(e,t){if("string"!=typeof e)throw TypeError('"input" must be a string.');if("string"!=typeof t)throw TypeError('"alphabet" must be a string.');var r=i[t];if(!r){r=i[t]=[];for(var a=0;a<t.length;++a)r[t.charCodeAt(a)]=a}e=e.replace(/\s/g,"");for(var n=t.length,s=t.charAt(0),o=[0],a=0;a<e.length;a++){var c=r[e.charCodeAt(a)];if(void 0===c)return;for(var u=0,l=c;u<o.length;++u)l+=o[u]*n,o[u]=255&l,l>>=8;for(;l>0;)o.push(255&l),l>>=8}for(var f=0;e[f]===s&&f<e.length-1;++f)o.push(0);return"u">typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())}},26706,(e,t,r)=>{var a=e.r(2015),i=e.r(95461),n=t.exports=a.util=a.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(n.isArrayBuffer(e)||n.isArrayBufferView(e))if("u">typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof o||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("u">typeof process&&process.nextTick&&1){n.nextTick=process.nextTick,"function"==typeof setImmediate?n.setImmediate=setImmediate:n.setImmediate=n.nextTick;return}if("function"==typeof setImmediate){n.setImmediate=function(){return setImmediate.apply(void 0,arguments)},n.nextTick=function(e){return setImmediate(e)};return}if(n.setImmediate=function(e){setTimeout(e,0)},"u">typeof MutationObserver){var e,t=Date.now(),r=!0,a=document.createElement("div"),e=[];new MutationObserver(function(){var t=e.slice();e.length=0,t.forEach(function(e){e()})}).observe(a,{attributes:!0});var i=n.setImmediate;n.setImmediate=function(n){Date.now()-t>15?(t=Date.now(),i(n)):(e.push(n),1===e.length&&a.setAttribute("a",r=!r))}}n.nextTick=n.setImmediate}(),n.isNodejs="u">typeof process&&process.versions&&process.versions.node,n.globalScope=n.isNodejs?e.g:"u"<typeof self?window:self,n.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isArrayBuffer=function(e){return"u">typeof ArrayBuffer&&e instanceof ArrayBuffer},n.isArrayBufferView=function(e){return e&&n.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},n.ByteBuffer=o,n.ByteStringBuffer=o,n.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},n.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},n.ByteStringBuffer.prototype.isEmpty=function(){return 0>=this.length()},n.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},n.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},n.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},n.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(n.encodeUtf8(e))},n.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},n.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},n.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},n.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},n.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},n.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},n.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0)return this.putBytes(r)},n.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},n.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},n.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},n.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},n.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},n.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},n.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},n.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},n.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},n.ByteStringBuffer.prototype.getInt=function(e){s(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0)return t},n.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},n.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},n.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},n.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},n.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},n.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},n.ByteStringBuffer.prototype.copy=function(){var e=n.createBuffer(this.data);return e.read=this.read,e},n.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},n.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},n.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},n.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},n.ByteStringBuffer.prototype.toString=function(){return n.decodeUtf8(this.bytes())},n.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=n.isArrayBuffer(e),a=n.isArrayBufferView(e);if(r||a){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},n.DataBuffer.prototype.length=function(){return this.write-this.read},n.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()},n.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),a=new Uint8Array(this.length()+t);return a.set(r),this.data=new DataView(a.buffer),this},n.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},n.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},n.DataBuffer.prototype.putBytes=function(e,t){if(n.isArrayBufferView(e)){var r,a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=a.byteLength-a.byteOffset;this.accommodate(i);var s=new Uint8Array(this.data.buffer,this.write);return s.set(a),this.write+=i,this}if(n.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof n.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&n.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var s=new Uint8Array(e.data.byteLength,this.write);return s.set(a),this.write+=a.byteLength,this}if(e instanceof n.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),r=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.hex.decode(e,r,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),r=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.base64.decode(e,r,this.write),this;if("utf8"===t&&(e=n.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),r=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.raw.decode(r),this;if("utf16"===t)return this.accommodate(2*e.length),r=new Uint16Array(this.data.buffer,this.write),this.write+=n.text.utf16.encode(r),this;throw Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},n.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},n.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},n.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},n.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},n.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},n.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},n.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},n.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},n.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0)return this},n.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},n.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},n.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},n.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},n.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},n.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},n.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},n.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},n.DataBuffer.prototype.getInt=function(e){s(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0)return t},n.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},n.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},n.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},n.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},n.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},n.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},n.DataBuffer.prototype.copy=function(){return new n.DataBuffer(this)},n.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},n.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},n.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},n.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},n.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return n.binary.raw.encode(t);if("hex"===e)return n.binary.hex.encode(t);if("base64"===e)return n.binary.base64.encode(t);if("utf8"===e)return n.text.utf8.decode(t);if("utf16"===e)return n.text.utf16.decode(t);throw Error("Invalid encoding: "+e)},n.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=n.encodeUtf8(e)),new n.ByteBuffer(e)},n.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},n.xorBytes=function(e,t,r){for(var a="",i="",n="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(a+=n,n="",o=0),n+=String.fromCharCode(i),++o;return a+n},n.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},n.bytesToHex=function(e){return n.createBuffer(e).toHex()},n.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";n.encode64=function(e,t){for(var r,a,i,n="",s="",o=0;o<e.length;)r=e.charCodeAt(o++),a=e.charCodeAt(o++),i=e.charCodeAt(o++),n+=c.charAt(r>>2),n+=c.charAt((3&r)<<4|a>>4),isNaN(a)?n+="==":(n+=c.charAt((15&a)<<2|i>>6),n+=isNaN(i)?"=":c.charAt(63&i)),t&&n.length>t&&(s+=n.substr(0,t)+"\r\n",n=n.substr(t));return s+n},n.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,a,i,n="",s=0;s<e.length;)t=u[e.charCodeAt(s++)-43],r=u[e.charCodeAt(s++)-43],a=u[e.charCodeAt(s++)-43],i=u[e.charCodeAt(s++)-43],n+=String.fromCharCode(t<<2|r>>4),64!==a&&(n+=String.fromCharCode((15&r)<<4|a>>2),64!==i&&(n+=String.fromCharCode((3&a)<<6|i)));return n},n.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},n.decodeUtf8=function(e){return decodeURIComponent(escape(e))},n.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},n.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},n.binary.raw.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length));for(var i=r=r||0,n=0;n<e.length;++n)a[i++]=e.charCodeAt(n);return t?i-r:a},n.binary.hex.encode=n.bytesToHex,n.binary.hex.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(Math.ceil(e.length/2)));var i=0,n=r=r||0;for(1&e.length&&(i=1,a[n++]=parseInt(e[0],16));i<e.length;i+=2)a[n++]=parseInt(e.substr(i,2),16);return t?n-r:a},n.binary.base64.encode=function(e,t){for(var r,a,i,n="",s="",o=0;o<e.byteLength;)r=e[o++],a=e[o++],i=e[o++],n+=c.charAt(r>>2),n+=c.charAt((3&r)<<4|a>>4),isNaN(a)?n+="==":(n+=c.charAt((15&a)<<2|i>>6),n+=isNaN(i)?"=":c.charAt(63&i)),t&&n.length>t&&(s+=n.substr(0,t)+"\r\n",n=n.substr(t));return s+n},n.binary.base64.decode=function(e,t,r){var a,i,n,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c<e.length;)a=u[e.charCodeAt(c++)-43],i=u[e.charCodeAt(c++)-43],n=u[e.charCodeAt(c++)-43],s=u[e.charCodeAt(c++)-43],o[l++]=a<<2|i>>4,64!==n&&(o[l++]=(15&i)<<4|n>>2,64!==s&&(o[l++]=(3&n)<<6|s));return t?l-r:o.subarray(0,l)},n.binary.base58.encode=function(e,t){return n.binary.baseN.encode(e,l,t)},n.binary.base58.decode=function(e,t){return n.binary.baseN.decode(e,l,t)},n.text={utf8:{},utf16:{}},n.text.utf8.encode=function(e,t,r){e=n.encodeUtf8(e);var a=t;a||(a=new Uint8Array(e.length));for(var i=r=r||0,s=0;s<e.length;++s)a[i++]=e.charCodeAt(s);return t?i-r:a},n.text.utf8.decode=function(e){return n.decodeUtf8(String.fromCharCode.apply(null,e))},n.text.utf16.encode=function(e,t,r){var a=t;a||(a=new Uint8Array(2*e.length));for(var i=new Uint16Array(a.buffer),n=r=r||0,s=r,o=0;o<e.length;++o)i[s++]=e.charCodeAt(o),n+=2;return t?n-r:a},n.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},n.deflate=function(e,t,r){if(t=n.decode64(e.deflate(n.encode64(t)).rval),r){var a=2;32&t.charCodeAt(1)&&(a=6),t=t.substring(a,t.length-4)}return t},n.inflate=function(e,t,r){var a=e.inflate(n.encode64(t)).rval;return null===a?null:n.decode64(a)};var f=function(e,t,r){if(!e)throw Error("WebStorage not available.");if(null===r?a=e.removeItem(t):(r=n.encode64(JSON.stringify(r)),a=e.setItem(t,r)),void 0!==a&&!0!==a.rval){var a,i=Error(a.error.message);throw i.id=a.error.id,i.name=a.error.name,i}},p=function(e,t){if(!e)throw Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var a=Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(n.decode64(r))),r},h=function(e,t,r,a){var i=p(e,t);null===i&&(i={}),i[r]=a,f(e,t,i)},d=function(e,t,r){var a=p(e,t);return null!==a&&(a=r in a?a[r]:null),a},y=function(e,t,r){var a=p(e,t);if(null!==a&&r in a){delete a[r];var i=!0;for(var n in a){i=!1;break}i&&(a=null),f(e,t,a)}},g=function(e,t){f(e,t,null)},m=function(e,t,r){var a,i=null;void 0===r&&(r=["web","flash"]);var n=!1,s=null;for(var o in r){a=r[o];try{if("flash"===a||"both"===a){if(null===t[0])throw Error("Flash local storage not available.");i=e.apply(this,t),n="flash"===a}("web"===a||"both"===a)&&(t[0]=localStorage,i=e.apply(this,t),n=!0)}catch(e){s=e}if(n)break}if(!n)throw s;return i};n.setItem=function(e,t,r,a,i){m(h,arguments,i)},n.getItem=function(e,t,r,a){return m(d,arguments,a)},n.removeItem=function(e,t,r,a){m(y,arguments,a)},n.clearItems=function(e,t,r){m(g,arguments,r)},n.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},n.format=function(e){for(var t,r,a=/%./g,i=0,n=[],s=0;t=a.exec(e);){(r=e.substring(s,a.lastIndex-2)).length>0&&n.push(r),s=a.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i<arguments.length?n.push(arguments[i+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+o+"?>")}}return n.push(e.substring(s)),n.join("")},n.formatNumber=function(e,t,r,a){var i=e,n=isNaN(t=Math.abs(t))?2:t,s=void 0===a?".":a,o=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(n),10)+"",u=c.length>3?c.length%3:0;return o+(u?c.substr(0,u)+s:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+s)+(n?(void 0===r?",":r)+Math.abs(i-c).toFixed(n).slice(2):"")},n.formatSize=function(e){return e>=0x40000000?n.formatNumber(e/0x40000000,2,".","")+" GiB":e>=1048576?n.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?n.formatNumber(e/1024,0)+" KiB":n.formatNumber(e,0)+" bytes"},n.bytesFromIP=function(e){return -1!==e.indexOf(".")?n.bytesFromIPv4(e):-1!==e.indexOf(":")?n.bytesFromIPv6(e):null},n.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=n.createBuffer(),r=0;r<e.length;++r){var a=parseInt(e[r],10);if(isNaN(a))return null;t.putByte(a)}return t.getBytes()},n.bytesFromIPv6=function(e){for(var t=0,r=(8-(e=e.split(":").filter(function(e){return 0===e.length&&++t,!0})).length+t)*2,a=n.createBuffer(),i=0;i<8;++i){if(!e[i]||0===e[i].length){a.fillWithByte(0,r),r=0;continue}var s=n.hexToBytes(e[i]);s.length<2&&a.putByte(0),a.putBytes(s)}return a.getBytes()},n.bytesToIP=function(e){return 4===e.length?n.bytesToIPv4(e):16===e.length?n.bytesToIPv6(e):null},n.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},n.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],a=0,i=0;i<e.length;i+=2){for(var s=n.bytesToHex(e[i]+e[i+1]);"0"===s[0]&&"0"!==s;)s=s.substr(1);if("0"===s){var o=r[r.length-1],c=t.length;o&&c===o.end+1?(o.end=c,o.end-o.start>r[a].end-r[a].start&&(a=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[a];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},n.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in n&&!e.update)return t(null,n.cores);if("u">typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return n.cores=navigator.hardwareConcurrency,t(null,n.cores);if("u"<typeof Worker)return n.cores=1,t(null,n.cores);if("u"<typeof Blob)return n.cores=2,t(null,n.cores);var r=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})})}).toString(),")()"],{type:"application/javascript"}));!function e(a,i,s){if(0===i)return n.cores=Math.max(1,Math.floor(a.reduce(function(e,t){return e+t},0)/a.length)),URL.revokeObjectURL(r),t(null,n.cores);!function(e,t){for(var a=[],i=[],n=0;n<e;++n){var s=new Worker(r);s.addEventListener("message",function(r){if(i.push(r.data),i.length===e){for(var n=0;n<e;++n)a[n].terminate();t(null,i)}}),a.push(s)}for(var n=0;n<e;++n)a[n].postMessage(n)}(s,function(t,r){a.push(function(e,t){for(var r=[],a=0;a<e;++a)for(var i=t[a],n=r[a]=[],s=0;s<e;++s)if(a!==s){var o=t[s];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&n.push(s)}return r.reduce(function(e,t){return Math.max(e,t.length)},0)}(s,r)),e(a,i-1,s)})}([],5,16)}},37170,(e,t,r)=>{var a=e.r(2015);e.r(26706),t.exports=a.cipher=a.cipher||{},a.cipher.algorithms=a.cipher.algorithms||{},a.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=a.cipher.getAlgorithm(r))&&(r=r()),!r)throw Error("Unsupported algorithm: "+e);return new a.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},a.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=a.cipher.getAlgorithm(r))&&(r=r()),!r)throw Error("Unsupported algorithm: "+e);return new a.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},a.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),a.cipher.algorithms[e]=t},a.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in a.cipher.algorithms?a.cipher.algorithms[e]:null};var i=a.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){var t={};for(var r in e=e||{})t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=a.util.createBuffer(),this.output=e.output||a.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){e&&("ECB"===this.mode.name||"CBC"===this.mode.name)&&(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,(!!this._decrypt||!this.mode.pad||!!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),(!this._decrypt||!this.mode.unpad||!!this.mode.unpad(this.output,t))&&(!this.mode.afterFinish||!!this.mode.afterFinish(this.output,t)))}},67424,(e,t,r)=>{var a=e.r(2015);e.r(26706),a.cipher=a.cipher||{};var i=t.exports=a.cipher.modes=a.cipher.modes||{};function n(e,t){if("string"==typeof e&&(e=a.util.createBuffer(e)),a.util.isArray(e)&&e.length>4){var r=e;e=a.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!a.util.isArray(e)){for(var n=[],s=t/4,i=0;i<s;++i)n.push(e.getInt32());e=n}return e}function s(e){e[e.length-1]=e[e.length-1]+1|0}function o(e){return[e/0x100000000|0,0|e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=n(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.")},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=this._prev[a]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._prev[a]^this._outBlock[a]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(n>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},i.cfb.prototype.decrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(n>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=0xe1000000},i.gcm.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");var t,r=a.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?a.util.createBuffer(e.additionalData):a.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=a.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw Error("Authentication tag does not match tag length.");this._hashBlock=Array(this._ints),this.tag=null,this._hashSubkey=Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=a.util.createBuffer(t),this._aDataLength=o(8*t.length());var n=t.length()%this.blockSize;for(n&&t.fillWithByte(0,this.blockSize-n),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n<=0||r){if(r){var o=a%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var a=e.length();if(a<this.blockSize&&!(r&&a>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);a<this.blockSize?this._cipherLength+=a%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=a.util.createBuffer();var i=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var n=[];this.cipher.encrypt(this._j0,n);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^n[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],a=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(r[0]^=a[0],r[1]^=a[1],r[2]^=a[2],r[3]^=a[3]),this.pow(a,a);return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],a=3;a>0;--a)t[a]=e[a]>>>1|(1&e[a-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var a=e[r/8|0]>>>(7-r%8)*4&15,i=this._m[r][a];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,a=4*r,i=16*r,n=Array(i),s=0;s<i;++s){var o=[0,0,0,0],c=s/a|0,u=(a-1-s%a)*t;o[c]=1<<t-1<<u,n[s]=this.generateSubHashTable(this.multiply(o,e),t)}return n},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,a=r>>>1,i=Array(r);i[a]=e.slice(0);for(var n=a>>>1;n>0;)this.pow(i[2*n],i[n]=[]),n>>=1;for(n=2;n<a;){for(var s=1;s<n;++s){var o=i[n],c=i[s];i[n+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}n*=2}for(i[0]=[0,0,0,0],n=a+1;n<r;++n){var u=i[n^a];i[n]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}},1258,(e,t,r)=>{var a,i,n,s,o,c=e.r(2015);function u(e,t){c.cipher.registerAlgorithm(e,function(){return new c.aes.Algorithm(e,t)})}e.r(37170),e.r(67424),e.r(26706),t.exports=c.aes=c.aes||{},c.aes.startEncrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!1,mode:a});return i.start(t),i},c.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},c.aes.startDecrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!0,mode:a});return i.start(t),i},c.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},c.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},c.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"==typeof r&&(16===r.length||24===r.length||32===r.length))r=c.util.createBuffer(r);else if(c.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=c.util.createBuffer();for(var a=0;a<t.length;++a)r.putByte(t[a])}if(!c.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i){i>>>=2;for(var a=0;a<i;++a)r.push(t.getInt32())}}if(!c.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw Error("Invalid key parameter.");var n=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=p(r,e.decrypt&&!n),this._init=!0}},c.aes._expandKey=function(e,t){return l||f(),p(e,t)},c.aes._updateBlock=h,u("AES-ECB",c.cipher.modes.ecb),u("AES-CBC",c.cipher.modes.cbc),u("AES-CFB",c.cipher.modes.cfb),u("AES-OFB",c.cipher.modes.ofb),u("AES-CTR",c.cipher.modes.ctr),u("AES-GCM",c.cipher.modes.gcm);var l=!1;function f(){l=!0,n=[0,1,2,4,8,16,32,64,128,27,54];for(var e=Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;a=Array(256),i=Array(256),s=[,,,,],o=[,,,,];for(var t=0;t<4;++t)s[t]=Array(256),o[t]=Array(256);for(var r,c,u,f,p,h,d,y=0,g=0,t=0;t<256;++t){f=(f=g^g<<1^g<<2^g<<3^g<<4)>>8^255&f^99,a[y]=f,i[f]=y,p=e[f],r=e[y],c=e[r],u=e[c],h=p<<24^f<<16^f<<8^(f^p),d=(r^c^u)<<24^(y^u)<<16^(y^c^u)<<8^(y^r^u);for(var m=0;m<4;++m)s[m][y]=h,o[m][f]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^u]]],g^=e[e[g]])}}function p(e,t){for(var r,i=e.slice(0),s=1,c=i.length,u=4*(c+6+1),l=c;l<u;++l)r=i[l-1],l%c==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^n[s]<<24,s++):c>6&&l%c==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),i[l]=i[l-c]^r;if(t){var f,p=o[0],h=o[1],d=o[2],y=o[3],g=i.slice(0);u=i.length;for(var l=0,m=u-4;l<u;l+=4,m-=4)if(0===l||l===u-4)g[l]=i[m],g[l+1]=i[m+3],g[l+2]=i[m+2],g[l+3]=i[m+1];else for(var v=0;v<4;++v)f=i[m+v],g[l+(3&-v)]=p[a[f>>>24]]^h[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];i=g}return i}function h(e,t,r,n){var c,u,l,f,p,h,d,y,g,m,v,C,E=e.length/4-1;n?(c=o[0],u=o[1],l=o[2],f=o[3],p=i):(c=s[0],u=s[1],l=s[2],f=s[3],p=a),h=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var S=3,T=1;T<E;++T)m=c[h>>>24]^u[d>>>16&255]^l[y>>>8&255]^f[255&g]^e[++S],v=c[d>>>24]^u[y>>>16&255]^l[g>>>8&255]^f[255&h]^e[++S],C=c[y>>>24]^u[g>>>16&255]^l[h>>>8&255]^f[255&d]^e[++S],g=c[g>>>24]^u[h>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],h=m,d=v,y=C;r[0]=p[h>>>24]<<24^p[d>>>16&255]<<16^p[y>>>8&255]<<8^p[255&g]^e[++S],r[n?3:1]=p[d>>>24]<<24^p[y>>>16&255]<<16^p[g>>>8&255]<<8^p[255&h]^e[++S],r[2]=p[y>>>24]<<24^p[g>>>16&255]<<16^p[h>>>8&255]<<8^p[255&d]^e[++S],r[n?1:3]=p[g>>>24]<<24^p[h>>>16&255]<<16^p[d>>>8&255]<<8^p[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),a=(t=e.decrypt?c.cipher.createDecipher(r,e.key):c.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof c.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,a.call(t,r)},t}},31808,(e,t,r)=>{var a=e.r(2015);a.pki=a.pki||{};var i=t.exports=a.pki.oids=a.oids=a.oids||{};function n(e,t){i[e]=t,i[t]=e}n("1.2.840.113549.1.1.1","rsaEncryption"),n("1.2.840.113549.1.1.4","md5WithRSAEncryption"),n("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),n("1.2.840.113549.1.1.7","RSAES-OAEP"),n("1.2.840.113549.1.1.8","mgf1"),n("1.2.840.113549.1.1.9","pSpecified"),n("1.2.840.113549.1.1.10","RSASSA-PSS"),n("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),n("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),n("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),n("1.3.101.112","EdDSA25519"),n("1.2.840.10040.4.3","dsa-with-sha1"),n("1.3.14.3.2.7","desCBC"),n("1.3.14.3.2.26","sha1"),n("1.3.14.3.2.29","sha1WithRSASignature"),n("2.16.840.1.101.3.4.2.1","sha256"),n("2.16.840.1.101.3.4.2.2","sha384"),n("2.16.840.1.101.3.4.2.3","sha512"),n("2.16.840.1.101.3.4.2.4","sha224"),n("2.16.840.1.101.3.4.2.5","sha512-224"),n("2.16.840.1.101.3.4.2.6","sha512-256"),n("1.2.840.113549.2.2","md2"),n("1.2.840.113549.2.5","md5"),n("1.2.840.113549.1.7.1","data"),n("1.2.840.113549.1.7.2","signedData"),n("1.2.840.113549.1.7.3","envelopedData"),n("1.2.840.113549.1.7.4","signedAndEnvelopedData"),n("1.2.840.113549.1.7.5","digestedData"),n("1.2.840.113549.1.7.6","encryptedData"),n("1.2.840.113549.1.9.1","emailAddress"),n("1.2.840.113549.1.9.2","unstructuredName"),n("1.2.840.113549.1.9.3","contentType"),n("1.2.840.113549.1.9.4","messageDigest"),n("1.2.840.113549.1.9.5","signingTime"),n("1.2.840.113549.1.9.6","counterSignature"),n("1.2.840.113549.1.9.7","challengePassword"),n("1.2.840.113549.1.9.8","unstructuredAddress"),n("1.2.840.113549.1.9.14","extensionRequest"),n("1.2.840.113549.1.9.20","friendlyName"),n("1.2.840.113549.1.9.21","localKeyId"),n("1.2.840.113549.1.9.22.1","x509Certificate"),n("1.2.840.113549.1.12.10.1.1","keyBag"),n("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),n("1.2.840.113549.1.12.10.1.3","certBag"),n("1.2.840.113549.1.12.10.1.4","crlBag"),n("1.2.840.113549.1.12.10.1.5","secretBag"),n("1.2.840.113549.1.12.10.1.6","safeContentsBag"),n("1.2.840.113549.1.5.13","pkcs5PBES2"),n("1.2.840.113549.1.5.12","pkcs5PBKDF2"),n("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),n("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),n("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),n("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),n("1.2.840.113549.2.7","hmacWithSHA1"),n("1.2.840.113549.2.8","hmacWithSHA224"),n("1.2.840.113549.2.9","hmacWithSHA256"),n("1.2.840.113549.2.10","hmacWithSHA384"),n("1.2.840.113549.2.11","hmacWithSHA512"),n("1.2.840.113549.3.7","des-EDE3-CBC"),n("2.16.840.1.101.3.4.1.2","aes128-CBC"),n("2.16.840.1.101.3.4.1.22","aes192-CBC"),n("2.16.840.1.101.3.4.1.42","aes256-CBC"),n("2.5.4.3","commonName"),n("2.5.4.4","surname"),n("2.5.4.5","serialNumber"),n("2.5.4.6","countryName"),n("2.5.4.7","localityName"),n("2.5.4.8","stateOrProvinceName"),n("2.5.4.9","streetAddress"),n("2.5.4.10","organizationName"),n("2.5.4.11","organizationalUnitName"),n("2.5.4.12","title"),n("2.5.4.13","description"),n("2.5.4.15","businessCategory"),n("2.5.4.17","postalCode"),n("2.5.4.42","givenName"),n("2.5.4.65","pseudonym"),n("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),n("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),n("2.16.840.1.113730.1.1","nsCertType"),n("2.16.840.1.113730.1.13","nsComment"),i["2.5.29.1"]="authorityKeyIdentifier",i["2.5.29.2"]="keyAttributes",i["2.5.29.3"]="certificatePolicies",i["2.5.29.4"]="keyUsageRestriction",i["2.5.29.5"]="policyMapping",i["2.5.29.6"]="subtreesConstraint",i["2.5.29.7"]="subjectAltName",i["2.5.29.8"]="issuerAltName",i["2.5.29.9"]="subjectDirectoryAttributes",i["2.5.29.10"]="basicConstraints",i["2.5.29.11"]="nameConstraints",i["2.5.29.12"]="policyConstraints",i["2.5.29.13"]="basicConstraints",n("2.5.29.14","subjectKeyIdentifier"),n("2.5.29.15","keyUsage"),i["2.5.29.16"]="privateKeyUsagePeriod",n("2.5.29.17","subjectAltName"),n("2.5.29.18","issuerAltName"),n("2.5.29.19","basicConstraints"),i["2.5.29.20"]="cRLNumber",i["2.5.29.21"]="cRLReason",i["2.5.29.22"]="expirationDate",i["2.5.29.23"]="instructionCode",i["2.5.29.24"]="invalidityDate",i["2.5.29.25"]="cRLDistributionPoints",i["2.5.29.26"]="issuingDistributionPoint",i["2.5.29.27"]="deltaCRLIndicator",i["2.5.29.28"]="issuingDistributionPoint",i["2.5.29.29"]="certificateIssuer",i["2.5.29.30"]="nameConstraints",n("2.5.29.31","cRLDistributionPoints"),n("2.5.29.32","certificatePolicies"),i["2.5.29.33"]="policyMappings",i["2.5.29.34"]="policyConstraints",n("2.5.29.35","authorityKeyIdentifier"),i["2.5.29.36"]="policyConstraints",n("2.5.29.37","extKeyUsage"),i["2.5.29.46"]="freshestCRL",i["2.5.29.54"]="inhibitAnyPolicy",n("1.3.6.1.4.1.11129.2.4.2","timestampList"),n("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),n("1.3.6.1.5.5.7.3.1","serverAuth"),n("1.3.6.1.5.5.7.3.2","clientAuth"),n("1.3.6.1.5.5.7.3.3","codeSigning"),n("1.3.6.1.5.5.7.3.4","emailProtection"),n("1.3.6.1.5.5.7.3.8","timeStamping")},74723,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(31808);var i=t.exports=a.asn1=a.asn1||{};function n(e,t,r){if(r>t){var a=Error("Too few bytes to parse DER.");throw a.available=e.length(),a.remaining=t,a.requested=r,a}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.maxDepth=256,i.create=function(e,t,r,n,s){if(a.util.isArray(n)){for(var o=[],c=0;c<n.length;++c)void 0!==n[c]&&o.push(n[c]);n=o}var u={tagClass:e,type:t,constructed:r,composed:r||a.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=i.copy(u)),u},i.copy=function(e,t){var r;if(a.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(i.copy(e[n],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(a.util.isArray(e)){if(!a.util.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!i.equals(e[n],t[n]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var s=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(s=s&&e.bitStringContents===t.bitStringContents),s},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};var s=function(e,t){var r,a=e.getByte();if(t--,128!==a){if(128&a){var i=127&a;n(e,t,i),r=e.getInt(i<<3)}else r=a;if(r<0)throw Error("Negative length: "+r);return r}};i.fromDer=function(e,t){void 0===t&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=i.maxDepth),"string"==typeof e&&(e=a.util.createBuffer(e));var r=e.length(),o=function e(t,r,a,o){if(a>=o.maxDepth)throw Error("ASN.1 parsing error: Max depth exceeded.");n(t,r,2);var c,u,l,f=t.getByte();r--;var p=192&f,h=31&f;c=t.length();var d=s(t,r);if(r-=c-t.length(),void 0!==d&&d>r){if(o.strict){var y=Error("Too few bytes to read ASN.1 value.");throw y.available=t.length(),y.remaining=r,y.requested=d,y}d=r}var g=(32&f)==32;if(g)if(u=[],void 0===d)for(;;){if(n(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}c=t.length(),u.push(e(t,r,a+1,o)),r-=c-t.length()}else for(;d>0;)c=t.length(),u.push(e(t,d,a+1,o)),r-=c-t.length(),d-=c-t.length();if(void 0===u&&p===i.Class.UNIVERSAL&&h===i.Type.BITSTRING&&(l=t.bytes(d)),void 0===u&&o.decodeBitStrings&&p===i.Class.UNIVERSAL&&h===i.Type.BITSTRING&&d>1){var m=t.read,v=r,C=0;if(h===i.Type.BITSTRING&&(n(t,r,1),C=t.getByte(),r--),0===C)try{c=t.length();var E=e(t,r,a+1,{strict:!0,decodeBitStrings:!0}),S=c-t.length();r-=S,h==i.Type.BITSTRING&&S++;var T=E.tagClass;S===d&&(T===i.Class.UNIVERSAL||T===i.Class.CONTEXT_SPECIFIC)&&(u=[E])}catch(e){}void 0===u&&(t.read=m,r=v)}if(void 0===u){if(void 0===d){if(o.strict)throw Error("Non-constructed ASN.1 object of indefinite length.");d=r}if(h===i.Type.BMPSTRING)for(u="";d>0;d-=2)n(t,r,2),u+=String.fromCharCode(t.getInt16()),r-=2;else u=t.getBytes(d),r-=d}var I=void 0===l?null:{bitStringContents:l};return i.create(p,h,g,u,I)}(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var c=Error("Unparsed DER bytes remain after ASN.1 parsing.");throw c.byteCount=r,c.remaining=e.length(),c}return o},i.toDer=function(e){var t=a.util.createBuffer(),r=e.tagClass|e.type,n=a.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=i.equals(e,e.original))),s)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&n.putBuffer(i.toDer(e.value[o]))}else if(e.type===i.Type.BMPSTRING)for(var o=0;o<e.value.length;++o)n.putInt16(e.value.charCodeAt(o));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&(128&e.value.charCodeAt(1))==0||255===e.value.charCodeAt(0)&&(128&e.value.charCodeAt(1))==128)?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),127>=n.length())t.putByte(127&n.length());else{var c=n.length(),u="";do u+=String.fromCharCode(255&c),c>>>=8;while(c>0)t.putByte(128|u.length);for(var o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(n),t},i.oidToDer=function(e){var t,r,i,n,s=e.split("."),o=a.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c<s.length;++c){if(t=!0,r=[],(i=parseInt(s[c],10))>0xffffffff)throw Error("OID value too large; max is 32-bits.");do n=127&i,i>>>=7,t||(n|=128),r.push(n),t=!1;while(i>0)for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},i.derToOid=function(e){"string"==typeof e&&(e=a.util.createBuffer(e));var t,r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;){if(i>0x3fffffffffff)throw Error("OID value too large; max is 53-bits.");r=e.getByte(),i*=128,128&r?i+=127&r:(t+="."+(i+r),i=0)}return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var a=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),n=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,a,i),t.setUTCHours(n,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),a=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),n=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,p=e.charAt(f);return("+"===p||"-"===p)&&(u=(60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10))*6e4,"+"===p&&(u*=-1),l=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,a,i),t.setUTCHours(n,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,a,i),t.setHours(n,s,o,c)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var a=0;a<r.length;++a)r[a].length<2&&(t+="0"),t+=r[a];return t+"Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var a=0;a<r.length;++a)r[a].length<2&&(t+="0"),t+=r[a];return t+"Z"},i.integerToDer=function(e){var t=a.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-0x80000000&&e<0x80000000)return t.putSignedInt(e,32);var r=Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=a.util.createBuffer(e));var t=8*e.length();if(t>32)throw Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,n){var s=!1;if((e.tagClass===t.tagClass||void 0===t.tagClass)&&(e.type===t.type||void 0===t.type))if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&a.util.isArray(t.value))for(var o=0,c=0;s&&c<t.value.length;++c){var u=t.value[c];s=!!u.optional;var l=e.value[o];if(!l){!u.optional&&(s=!1,n&&n.push("["+t.name+'] Missing required element. Expected tag class "'+u.tagClass+'", type "'+u.type+'"'));continue}if(void 0!==u.tagClass&&void 0!==u.type&&(l.tagClass!==u.tagClass||l.type!==u.type))if(u.optional){s=!0;continue}else{s=!1,n&&n.push("["+t.name+"] Tag mismatch. Expected ("+u.tagClass+","+u.type+"), got ("+l.tagClass+","+l.type+")");break}if(i.validate(l,u,r,n))++o,s=!0;else if(u.optional)s=!0;else{s=!1;break}}if(s&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return s};var o=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var n="";r=r||2,(t=t||0)>0&&(n+="\n");for(var s="",c=0;c<t*r;++c)s+=" ";switch(n+=s+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:n+="Universal:";break;case i.Class.APPLICATION:n+="Application:";break;case i.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case i.Class.PRIVATE:n+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(n+=e.type,e.type){case i.Type.NONE:n+=" (None)";break;case i.Type.BOOLEAN:n+=" (Boolean)";break;case i.Type.INTEGER:n+=" (Integer)";break;case i.Type.BITSTRING:n+=" (Bit string)";break;case i.Type.OCTETSTRING:n+=" (Octet string)";break;case i.Type.NULL:n+=" (Null)";break;case i.Type.OID:n+=" (Object Identifier)";break;case i.Type.ODESC:n+=" (Object Descriptor)";break;case i.Type.EXTERNAL:n+=" (External or Instance of)";break;case i.Type.REAL:n+=" (Real)";break;case i.Type.ENUMERATED:n+=" (Enumerated)";break;case i.Type.EMBEDDED:n+=" (Embedded PDV)";break;case i.Type.UTF8:n+=" (UTF8)";break;case i.Type.ROID:n+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:n+=" (Sequence)";break;case i.Type.SET:n+=" (Set)";break;case i.Type.PRINTABLESTRING:n+=" (Printable String)";break;case i.Type.IA5String:n+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:n+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case i.Type.BMPSTRING:n+=" (BMP String)"}else n+=e.type;if(n+="\n",n+=s+"Constructed: "+e.constructed+"\n",e.composed){for(var u=0,l="",c=0;c<e.value.length;++c)void 0!==e.value[c]&&(u+=1,l+=i.prettyPrint(e.value[c],t+1,r),c+1<e.value.length&&(l+=","));n+=s+"Sub values: "+u+l}else{if(n+=s+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);n+=f,a.pki&&a.pki.oids&&f in a.pki.oids&&(n+=" ("+a.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{n+=i.derToInteger(e.value)}catch(t){n+="0x"+a.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?n+="0x"+a.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?n+=" (1 unused bit shown)":p>1&&(n+=" ("+p+" unused bits shown)")}}else if(e.type===i.Type.OCTETSTRING)o.test(e.value)||(n+="("+e.value+") "),n+="0x"+a.util.bytesToHex(e.value);else if(e.type===i.Type.UTF8)try{n+=a.util.decodeUtf8(e.value)}catch(t){if("URI malformed"===t.message)n+="0x"+a.util.bytesToHex(e.value)+" (malformed UTF8)";else throw t}else e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?n+=e.value:o.test(e.value)?n+="0x"+a.util.bytesToHex(e.value):0===e.value.length?n+="[null]":n+=e.value}return n}},5189,(e,t,r)=>{var a=e.r(2015);t.exports=a.md=a.md||{},a.md.algorithms=a.md.algorithms||{}},82140,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706),(t.exports=a.hmac=a.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,n={};return n.start=function(n,s){if(null!==n)if("string"==typeof n)if((n=n.toLowerCase())in a.md.algorithms)t=a.md.algorithms[n].create();else throw Error('Unknown hash algorithm "'+n+'"');else t=n;if(null===s)s=e;else{if("string"==typeof s)s=a.util.createBuffer(s);else if(a.util.isArray(s)){var o=s;s=a.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var u=s.length();u>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=a.util.createBuffer(),i=a.util.createBuffer(),u=s.length();for(var c=0;c<u;++c){var o=s.at(c);r.putByte(54^o),i.putByte(92^o)}if(u<t.blockLength)for(var o=t.blockLength-u,c=0;c<o;++c)r.putByte(54),i.putByte(92);e=s,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},n.update=function(e){t.update(e)},n.getMac=function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()},n.digest=n.getMac,n}},99073,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.md5=a.md5||{};a.md.md5=a.md.algorithms.md5=i,i.create=function(){u||function(){n=String.fromCharCode(128)+a.util.fillString("\0",64),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(0x100000000*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=a.util.createBuffer(),r=Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:0x67452301,h1:0xefcdab89,h2:0x98badcfe,h3:0x10325476},i},i.start(),i.update=function(n,s){"utf8"===s&&(n=a.util.encodeUtf8(n));var o=n.length;i.messageLength+=o,o=[o/0x100000000>>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/0x100000000>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/0x100000000>>>0;return t.putBytes(n),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(n.substr(0,i.blockLength-o));for(var c,u=0,f=i.fullMessageLength.length-1;f>=0;--f)u=(c=8*i.fullMessageLength[f]+u)/0x100000000>>>0,s.putInt32Le(c>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(p,r,s);var h=a.util.createBuffer();return h.putInt32Le(p.h0),h.putInt32Le(p.h1),h.putInt32Le(p.h2),h.putInt32Le(p.h3),h},i};var n=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var a,i,n,u,l,f,p,h,d=r.length();d>=64;){for(h=0,i=e.h0,n=e.h1,u=e.h2,l=e.h3;h<16;++h)t[h]=r.getInt32Le(),a=i+(l^n&(u^l))+c[h]+t[h],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;for(;h<32;++h)a=i+(u^l&(n^u))+c[h]+t[s[h]],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;for(;h<48;++h)a=i+(n^u^l)+c[h]+t[s[h]],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;for(;h<64;++h)a=i+(u^(n|~l))+c[h]+t[s[h]],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;e.h0=e.h0+i|0,e.h1=e.h1+n|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,d-=64}}},93139,(e,t,r)=>{var a=e.r(2015);e.r(26706);var i=t.exports=a.pem=a.pem||{};function n(e){for(var t=e.name+": ",r=[],a=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,a));t+=r.join(",")+"\r\n";for(var n=0,s=-1,i=0;i<t.length;++i,++n)if(n>65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),n=i-s-1,s=-1,++i}else(" "===t[i]||" "===t[i]||","===t[i])&&(s=i);return t}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=n(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=n(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=n(r)),e.headers)for(var s=0;s<e.headers.length;++s)i+=n(e.headers[s]);return e.procType&&(i+="\r\n"),i+=a.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=i.exec(e);){var o=t[1];"NEW CERTIFICATE REQUEST"===o&&(o="CERTIFICATE REQUEST");var c={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(t[3])};if(r.push(c),t[2]){for(var u=t[2].split(s),l=0;t&&l<u.length;){for(var f=u[l].replace(/\s+$/,""),p=l+1;p<u.length;++p){var h=u[p];if(!/\s/.test(h[0]))break;f+=h,l=p}if(t=f.match(n)){for(var d={name:t[1],values:[]},y=t[2].split(","),g=0;g<y.length;++g)d.values.push(y[g].replace(/^\s+/,""));if(c.procType)if(c.contentDomain||"Content-Domain"!==d.name)if(c.dekInfo||"DEK-Info"!==d.name)c.headers.push(d);else{if(0===d.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');c.dekInfo={algorithm:y[0],parameters:y[1]||null}}else c.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');c.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===c.procType&&!c.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw Error("Invalid PEM formatted message.");return r}},30369,(e,t,r)=>{var a=e.r(2015);function i(e,t){a.cipher.registerAlgorithm(e,function(){return new a.des.Algorithm(e,t)})}e.r(37170),e.r(67424),e.r(26706),t.exports=a.des=a.des||{},a.des.startEncrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!1,mode:a||(null===t?"ECB":"CBC")});return i.start(t),i},a.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.des.startDecrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!0,mode:a||(null===t?"ECB":"CBC")});return i.start(t),i},a.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},a.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=a.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,0x20000000,0x20000004,65536,65540,0x20010000,0x20010004,512,516,0x20000200,0x20000204,66048,66052,0x20010200,0x20010204],a=[0,1,1048576,1048577,0x4000000,0x4000001,0x4100000,0x4100001,256,257,1048832,1048833,0x4000100,0x4000101,0x4100100,0x4100101],i=[0,8,2048,2056,0x1000000,0x1000008,0x1000800,0x1000808,0,8,2048,2056,0x1000000,0x1000008,0x1000800,0x1000808],n=[0,2097152,0x8000000,0x8200000,8192,2105344,0x8002000,0x8202000,131072,2228224,0x8020000,0x8220000,139264,2236416,0x8022000,0x8222000],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],c=[0,0x10000000,524288,0x10080000,2,0x10000002,524290,0x10080002,0,0x10000000,524288,0x10080000,2,0x10000002,524290,0x10080002],u=[0,65536,2048,67584,0x20000000,0x20010000,0x20000800,0x20010800,131072,196608,133120,198656,0x20020000,0x20030000,0x20020800,0x20030800],l=[0,262144,0,262144,2,262146,2,262146,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],f=[0,0x10000000,8,0x10000008,0,0x10000000,8,0x10000008,1024,0x10000400,1032,0x10000408,1024,0x10000400,1032,0x10000408],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,0x1000000,512,0x1000200,2097152,0x1200000,2097664,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],d=[0,4096,0x8000000,0x8001000,524288,528384,0x8080000,0x8081000,16,4112,0x8000010,0x8001010,524304,528400,0x8080010,0x8081010],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<g;E++){var S=e.getInt32(),T=e.getInt32();t=(S>>>4^T)&0xf0f0f0f,T^=t,S^=t<<4,t=(T>>>-16^S)&65535,S^=t,T^=t<<-16,t=(S>>>2^T)&0x33333333,T^=t,S^=t<<2,t=(T>>>-16^S)&65535,S^=t,T^=t<<-16,t=(S>>>1^T)&0x55555555,T^=t,S^=t<<1,t=(T>>>8^S)&0xff00ff,S^=t,T^=t<<8,t=(S>>>1^T)&0x55555555,T^=t,S^=t<<1,t=S<<8|T>>>20&240,S=T<<24|T<<8&0xff0000|T>>>8&65280|T>>>24&240,T=t;for(var I=0;I<v.length;++I){v[I]?(S=S<<2|S>>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27),T&=-15;var b=r[(S&=-15)>>>28]|a[S>>>24&15]|i[S>>>20&15]|n[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],A=u[T>>>28]|l[T>>>24&15]|f[T>>>20&15]|p[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=(A>>>16^b)&65535,m[C++]=b^t,m[C++]=A^t<<16}}return m}(t),this._init=!0}},i("DES-ECB",a.cipher.modes.ecb),i("DES-CBC",a.cipher.modes.cbc),i("DES-CFB",a.cipher.modes.cfb),i("DES-OFB",a.cipher.modes.ofb),i("DES-CTR",a.cipher.modes.ctr),i("3DES-ECB",a.cipher.modes.ecb),i("3DES-CBC",a.cipher.modes.cbc),i("3DES-CFB",a.cipher.modes.cfb),i("3DES-OFB",a.cipher.modes.ofb),i("3DES-CTR",a.cipher.modes.ctr);var n=[0x1010400,0,65536,0x1010404,0x1010004,66564,4,65536,1024,0x1010400,0x1010404,1024,0x1000404,0x1010004,0x1000000,4,1028,0x1000400,0x1000400,66560,66560,0x1010000,0x1010000,0x1000404,65540,0x1000004,0x1000004,65540,0,1028,66564,0x1000000,65536,0x1010404,4,0x1010000,0x1010400,0x1000000,0x1000000,1024,0x1010004,65536,66560,0x1000004,1024,4,0x1000404,66564,0x1010404,65540,0x1010000,0x1000404,0x1000004,1028,66564,0x1010400,1028,0x1000400,0x1000400,0,65540,66560,0,0x1010004],s=[-0x7fef7fe0,-0x7fff8000,32768,1081376,1048576,32,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,1048576,32,-0x7fefffe0,1081344,1048608,-0x7fff7fe0,0,-0x80000000,32768,1081376,-0x7ff00000,1048608,-0x7fffffe0,0,1081344,32800,-0x7fef8000,-0x7ff00000,32800,0,1081376,-0x7fefffe0,1048576,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,32768,-0x7ff00000,-0x7fff8000,32,-0x7fef7fe0,1081376,32,32768,-0x80000000,32800,-0x7fef8000,1048576,-0x7fffffe0,1048608,-0x7fff7fe0,-0x7fffffe0,1048608,1081344,0,-0x7fff8000,32800,-0x80000000,-0x7fefffe0,-0x7fef7fe0,1081344],o=[520,0x8020200,0,0x8020008,0x8000200,0,131592,0x8000200,131080,0x8000008,0x8000008,131072,0x8020208,131080,0x8020000,520,0x8000000,8,0x8020200,512,131584,0x8020000,0x8020008,131592,0x8000208,131584,131072,0x8000208,8,0x8020208,512,0x8000000,0x8020200,0x8000000,131080,520,131072,0x8020200,0x8000200,0,512,131080,0x8020208,0x8000200,0x8000008,512,0,0x8020008,0x8000208,131072,0x8000000,0x8020208,8,131592,131584,0x8000008,0x8020000,0x8000208,520,0x8020000,131592,8,0x8020008,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,0x2080100,0x2080000,0x42000100,524288,256,0x40000000,0x2080000,0x40080100,524288,0x2000100,0x40080100,0x42000100,0x42080000,524544,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,524544,524288,0x42000100,256,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,256,0x2000000,0x42080000,0x42080100,524544,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,524544,0x2000100,0x40000100,524288,0,0x40080000,0x2080100,0x40000100],l=[0x20000010,0x20400000,16384,0x20404010,0x20400000,16,0x20404010,4194304,0x20004000,4210704,4194304,0x20000010,4194320,0x20004000,0x20000000,16400,0,4194320,0x20004010,16384,4210688,0x20004010,16,0x20400010,0x20400010,0,4210704,0x20404000,16400,4210688,0x20404000,0x20000000,0x20004000,16,0x20400010,4210688,0x20404010,4194304,16400,0x20000010,4194304,0x20004000,0x20000000,16400,0x20000010,0x20404010,4210688,0x20400000,4210704,0x20404000,0,0x20400010,16,16384,0x20400000,4210704,16384,4194320,0x20004010,0,0x20404000,0x20000000,4194320,0x20004010],f=[2097152,0x4200002,0x4000802,0,2048,0x4000802,2099202,0x4200800,0x4200802,2097152,0,0x4000002,2,0x4000000,0x4200002,2050,0x4000800,2099202,2097154,0x4000800,0x4000002,0x4200000,0x4200800,2097154,0x4200000,2048,2050,0x4200802,2099200,2,0x4000000,2099200,0x4000000,2099200,2097152,0x4000802,0x4000802,0x4200002,0x4200002,2,2097154,0x4000000,0x4000800,2097152,0x4200800,2050,2099202,0x4200800,2050,0x4000002,0x4200802,0x4200000,2099200,0,2,0x4200802,0,2099202,0x4200000,2048,0x4000002,0x4000800,2048,2097154],p=[0x10001040,4096,262144,0x10041040,0x10000000,0x10001040,64,0x10000000,262208,0x10040000,0x10041040,266240,0x10041000,266304,4096,64,0x10040000,0x10000040,0x10001000,4160,266240,262208,0x10040040,0x10041000,4160,0,0,0x10040040,0x10000040,0x10001000,266304,262144,266304,262144,0x10041000,4096,64,0x10040040,4096,266304,0x10001000,64,0x10000040,0x10040000,0x10040040,0x10000000,262144,0x10001040,0,0x10041040,262208,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,266240,266240,4160,4160,262208,0x10000000,0x10041000];function h(e,t,r,a){var i,h,d=32===e.length?3:9;i=3===d?a?[30,-2,-2]:[0,32,2]:a?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];h=(y>>>4^g)&0xf0f0f0f,g^=h,y^=h<<4,h=(y>>>16^g)&65535,g^=h,y^=h<<16,h=(g>>>2^y)&0x33333333,y^=h,g^=h<<2,h=(g>>>8^y)&0xff00ff,y^=h,g^=h<<8,h=(y>>>1^g)&0x55555555,g^=h,y^=h<<1,y=y<<1|y>>>31,g=g<<1|g>>>31;for(var m=0;m<d;m+=3){for(var v=i[m+1],C=i[m+2],E=i[m];E!=v;E+=C){var S=g^e[E],T=(g>>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|p[63&S]|n[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|f[63&T])}h=y,y=g,g=h}h=((y=y>>>1|y<<31)>>>1^(g=g>>>1|g<<31))&0x55555555,g^=h,y^=h<<1,h=(g>>>8^y)&0xff00ff,y^=h,g^=h<<8,h=(g>>>2^y)&0x33333333,y^=h,g^=h<<2,h=(y>>>16^g)&65535,g^=h,y^=h<<16,h=(y>>>4^g)&0xf0f0f0f,g^=h,y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var n=null;r instanceof a.util.ByteBuffer&&(n=r,r={}),(r=r||{}).output=n,r.iv=e,i.call(t,r)},t}},80399,(e,t,r)=>{var a,i=e.r(2015);e.r(82140),e.r(5189),e.r(26706);var n=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(a=e.r(54799)),t.exports=i.pbkdf2=n.pbkdf2=function(e,t,r,n,s,o){if("function"==typeof s&&(o=s,s=null),i.util.isNodejs&&!i.options.usePureJavaScript&&a.pbkdf2&&(null===s||"object"!=typeof s)&&(a.pbkdf2Sync.length>4||!s||"sha1"===s))return("string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o)?4===a.pbkdf2Sync.length?a.pbkdf2(e,t,r,n,function(e,t){if(e)return o(e);o(null,t.toString("binary"))}):a.pbkdf2(e,t,r,n,s,function(e,t){if(e)return o(e);o(null,t.toString("binary"))}):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,t,r,n).toString("binary"):a.pbkdf2Sync(e,t,r,n,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in i.md.algorithms))throw Error("Unknown hash algorithm: "+s);s=i.md[s].create()}var c=s.digestLength;if(n>0xffffffff*c){var u=Error("Derived key is too long.");if(o)return o(u);throw u}var l=Math.ceil(n/c),f=n-(l-1)*c,p=i.hmac.create();p.start(s,e);var h="";if(!o){for(var d=1;d<=l;++d){p.start(null,null),p.update(t),p.update(i.util.int32ToBytes(d)),g=v=p.digest().getBytes();for(var y=2;y<=r;++y)p.start(null,null),p.update(v),m=p.digest().getBytes(),g=i.util.xorBytes(g,m,c),v=m;h+=d<l?g:g.substr(0,f)}return h}var g,m,v,y,d=1;!function e(){if(d>l)return o(null,h);p.start(null,null),p.update(t),p.update(i.util.int32ToBytes(d)),g=v=p.digest().getBytes(),y=2,function t(){if(y<=r)return p.start(null,null),p.update(v),m=p.digest().getBytes(),g=i.util.xorBytes(g,m,c),v=m,++y,i.util.setImmediate(t);h+=d<l?g:g.substr(0,f),++d,e()}()}()}},99470,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.sha256=a.sha256||{};a.md.sha256=a.md.algorithms.sha256=i,i.create=function(){s||(n=String.fromCharCode(128)+a.util.fillString("\0",64),o=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],s=!0);var e=null,t=a.util.createBuffer(),r=Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:0x6a09e667,h1:0xbb67ae85,h2:0x3c6ef372,h3:0xa54ff53a,h4:0x510e527f,h5:0x9b05688c,h6:0x1f83d9ab,h7:0x5be0cd19},i},i.start(),i.update=function(n,s){"utf8"===s&&(n=a.util.encodeUtf8(n));var o=n.length;i.messageLength+=o,o=[o/0x100000000>>>0,o>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=o[1],o[1]=o[0]+(i.fullMessageLength[u]/0x100000000>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,o[0]=o[1]/0x100000000>>>0;return t.putBytes(n),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s,o=a.util.createBuffer();o.putBytes(t.bytes());var u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(n.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/0x100000000>>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(p,r,o);var h=a.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h.putInt32(p.h5),h.putInt32(p.h6),h.putInt32(p.h7),h},i};var n=null,s=!1,o=null;function c(e,t,r){for(var a,i,n,s,c,u,l,f,p,h,d,y,g,m,v,C=r.length();C>=64;){for(l=0;l<16;++l)t[l]=r.getInt32();for(;l<64;++l)a=((a=t[l-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10,i=((i=t[l-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[l]=a+t[l-7]+i+t[l-16]|0;for(l=0,f=e.h0,p=e.h1,h=e.h2,d=e.h3,y=e.h4,g=e.h5,m=e.h6,v=e.h7;l<64;++l)s=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),c=m^y&(g^m),n=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&p|h&(f^p),a=v+s+c+o[l]+t[l],i=n+u,v=m,m=g,g=y,y=d+a>>>0,d=h,h=p,p=f,f=a+i>>>0;e.h0=e.h0+f|0,e.h1=e.h1+p|0,e.h2=e.h2+h|0,e.h3=e.h3+d|0,e.h4=e.h4+y|0,e.h5=e.h5+g|0,e.h6=e.h6+m|0,e.h7=e.h7+v|0,C-=64}}},30756,(e,t,r)=>{var a=e.r(2015);e.r(26706);var i=null;!a.util.isNodejs||a.options.usePureJavaScript||process.versions["node-webkit"]||(i=e.r(54799)),(t.exports=a.prng=a.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=Array(32),s=0;s<32;++s)n[s]=r.create();function o(){t.reseeds=0xffffffff===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,a=0;a<32;++a)t.reseeds%r==0&&(e.update(t.pools[a].digest().getBytes()),t.pools[a].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=a.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var n=a.util.createBuffer();if(t)for(;n.length()<e;){var s=new Uint32Array(Math.floor(Math.max(1,Math.min(e-n.length(),65536)/4)));try{t(s);for(var o=0;o<s.length;++o)n.putInt32(s[o])}catch(e){if(!("u">typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(n.length()<e)for(var c,u,l,f=Math.floor(65536*Math.random());n.length()<e;){f=0|(u=(0x7fffffff&(u=16807*(65535&f)+(((32767&(c=16807*(f>>16)))<<16)+(c>>15))))+(u>>31));for(var o=0;o<3;++o)l=f>>>(o<<3)^Math.floor(256*Math.random()),n.putByte(255&l)}return n.getBytes(e)}return t.pools=n,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,n=t.plugin.increment,s=t.plugin.formatKey,c=t.plugin.formatSeed,u=a.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(u.length()>=e)return r(null,u.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return a.util.nextTick(function(){!function(e){if(t.pools[0].messageLength>=32)return o(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,a){if(r)return e(r);t.collect(a),o(),e()})}(l)});var p=i(t.key,t.seed);t.generated+=p.length,u.putBytes(p),t.key=s(i(t.key,n(t.seed))),t.seed=c(i(t.key,t.seed)),a.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,n=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=a.util.createBuffer();c.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&function(){if(t.pools[0].messageLength>=32)return o();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),o()}();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=n(r(t.key,i(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,a=0;a<r;++a)t.pools[t.pool].update(e.substr(a,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var a="",i=0;i<r;i+=8)a+=String.fromCharCode(e>>i&255);t.collect(a)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",function e(r){var a=r.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",e),t(a.forge.prng.err,a.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",function(r){var a=r.data;a.forge&&a.forge.prng&&t.seedFile(a.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})})},t}},2828,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(99470),e.r(30756),e.r(26706),function(){if(a.random&&a.random.getBytes){t.exports=a.random;return}!function(e){var r={},i=[,,,,],n=a.util.createBuffer();function s(){var e=a.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=a.util.createBuffer(e);return(e=[,,,,])[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),a.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=a.util.createBuffer(e);return(e=[,,,,])[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return a.aes._updateBlock(e,t,i,!1),n.putInt32(i[0]),n.putInt32(i[1]),n.putInt32(i[2]),n.putInt32(i[3]),n.getBytes()},r.increment=function(e){return++e[3],e},r.md=a.md.sha256;var o=s(),c=null,u=a.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(c=function(e){return l.getRandomValues(e)}),a.options.usePureJavaScript||!a.util.isNodejs&&!c){if(o.collectInt(+new Date,32),"u">typeof navigator){var f="";for(var p in navigator)try{"string"==typeof navigator[p]&&(f+=navigator[p])}catch(e){}o.collect(f),f=null}e&&(e().mousemove(function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)}),e().keypress(function(e){o.collectInt(e.charCode,8)}))}if(a.random)for(var p in o)a.random[p]=o[p];else a.random=o;a.random.createInstance=s,t.exports=a.random}("u">typeof jQuery?jQuery:null)}()},63045,(e,t,r)=>{var a=e.r(2015);e.r(26706);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],n=[1,2,3,5];t.exports=a.rc2=a.rc2||{},a.rc2.expandKey=function(e,t){"string"==typeof e&&(e=a.util.createBuffer(e)),t=t||128;var r,n=e,s=e.length(),o=t,c=Math.ceil(o/8);for(r=s;r<128;r++)n.putByte(i[n.at(r-1)+n.at(r-s)&255]);for(n.setAt(128-c,i[n.at(128-c)&255>>(7&o)]),r=127-c;r>=0;r--)n.setAt(r,i[n.at(r+1)^n.at(r+c)]);return n};var s=function(e,t,r){var i,s,o,c,u=!1,l=null,f=null,p=null,h=[];for(o=0,e=a.rc2.expandKey(e,t);o<64;o++)h.push(e.getInt16Le());r?(i=function(e){for(o=0;o<4;o++){var t,r;e[o]+=h[c]+(e[(o+3)%4]&e[(o+2)%4])+(~e[(o+3)%4]&e[(o+1)%4]),e[o]=(t=e[o])<<(r=n[o])&65535|(65535&t)>>16-r,c++}},s=function(e){for(o=0;o<4;o++)e[o]+=h[63&e[(o+3)%4]]}):(i=function(e){for(o=3;o>=0;o--){var t,r;e[o]=(65535&(t=e[o]))>>(r=n[o])|t<<16-r&65535,e[o]-=h[c]+(e[(o+3)%4]&e[(o+2)%4])+(~e[(o+3)%4]&e[(o+1)%4]),c--}},s=function(e){for(o=3;o>=0;o--)e[o]-=h[63&e[(o+3)%4]]});var d=function(e){var t=[];for(o=0;o<4;o++){var a=l.getInt16Le();null!==p&&(r?a^=p.getInt16Le():p.putInt16Le(a)),t.push(65535&a)}c=63*!r;for(var i=0;i<e.length;i++)for(var n=0;n<e[i][0];n++)e[i][1](t);for(o=0;o<4;o++)null!==p&&(r?p.putInt16Le(t[o]):t[o]^=p.getInt16Le()),f.putInt16Le(t[o])},y=null;return y={start:function(e,t){e&&"string"==typeof e&&(e=a.util.createBuffer(e)),u=!1,l=a.util.createBuffer(),f=t||new a.util.createBuffer,p=e,y.output=f},update:function(e){for(u||l.putBuffer(e);l.length()>=8;)d([[5,i],[1,s],[6,i],[1,s],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,l,!r);else{var a=8===l.length()?8:8-l.length();l.fillWithByte(a,a)}if(t&&(u=!0,y.update()),!r&&(t=0===l.length()))if(e)t=e(8,f,!r);else{var i=f.length(),n=f.at(i-1);n>i?t=!1:f.truncate(n)}return t}}};a.rc2.startEncrypting=function(e,t,r){var i=a.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},a.rc2.createEncryptionCipher=function(e,t){return s(e,t,!0)},a.rc2.startDecrypting=function(e,t,r){var i=a.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},a.rc2.createDecryptionCipher=function(e,t){return s(e,t,!1)}},68995,(e,t,r)=>{var a,i,n,s=e.r(2015);t.exports=s.jsbn=s.jsbn||{};function o(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function c(){return new o(null)}function u(e,t,r,a,i,n){for(var s=16383&t,o=t>>14;--n>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;i=((c=s*c+((16383&l)<<14)+r.data[a]+i)>>28)+(l>>14)+o*u,r.data[a++]=0xfffffff&c}return i}s.jsbn.BigInteger=o,"u"<typeof navigator?(o.prototype.am=u,a=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(e,t,r,a,i,n){for(var s=32767&t,o=t>>15;--n>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;i=((c=s*c+((32767&l)<<15)+r.data[a]+(0x3fffffff&i))>>>30)+(l>>>15)+o*u+(i>>>30),r.data[a++]=0x3fffffff&c}return i},a=30):"Netscape"!=navigator.appName?(o.prototype.am=function(e,t,r,a,i,n){for(;--n>=0;){var s=t*this.data[e++]+r.data[a]+i;i=Math.floor(s/0x4000000),r.data[a++]=0x3ffffff&s}return i},a=26):(o.prototype.am=u,a=28),o.prototype.DB=a,o.prototype.DM=(1<<a)-1,o.prototype.DV=1<<a,o.prototype.FV=0x10000000000000,o.prototype.F1=52-a,o.prototype.F2=2*a-52;var l=[];for(n=0,i=48;n<=9;++n)l[i++]=n;for(n=10,i=97;n<36;++n)l[i++]=n;for(n=10,i=65;n<36;++n)l[i++]=n;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=c();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function v(e,t){return e|t}function C(e,t){return e^t}function E(e,t){return e&~t}function S(){}function T(e){return e}function I(e){this.r2=c(),this.q3=c(),o.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=c();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(o.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=c();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],a=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,a,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},o.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},o.prototype.fromString=function(e,t){if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var r,a=e.length,i=!1,n=0;--a>=0;){var s=8==r?255&e[a]:p(e,a);if(s<0){"-"==e.charAt(a)&&(i=!0);continue}i=!1,0==n?this.data[this.t++]=s:n+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this.data[this.t++]=s>>this.DB-n):this.data[this.t-1]|=s<<n,(n+=r)>=this.DB&&(n-=this.DB)}8==r&&(128&e[0])!=0&&(this.s=-1,n>0&&(this.data[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},o.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},o.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},o.prototype.lShiftTo=function(e,t){var r,a=e%this.DB,i=this.DB-a,n=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<a&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&n)<<a;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},o.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var a=e%this.DB,i=this.DB-a,n=(1<<a)-1;t.data[0]=this.data[r]>>a;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&n)<<i,t.data[s-r]=this.data[s]>>a;a>0&&(t.data[this.t-r-1]|=(this.s&n)<<i),t.t=this.t-r,t.clamp()},o.prototype.subTo=function(e,t){for(var r=0,a=0,i=Math.min(e.t,this.t);r<i;)a+=this.data[r]-e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a-=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a-=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a-=e.s}t.s=a<0?-1:0,a<-1?t.data[r++]=this.DV+a:a>0&&(t.data[r++]=a),t.t=r,t.clamp()},o.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),i=r.t;for(t.t=i+a.t;--i>=0;)t.data[i]=0;for(i=0;i<a.t;++i)t.data[i+r.t]=r.am(0,a.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&o.ZERO.subTo(t,t)},o.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var a=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,a,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},o.prototype.divRemTo=function(e,t,r){var a=e.abs();if(!(a.t<=0)){var i=this.abs();if(i.t<a.t){null!=t&&t.fromInt(0),null!=r&&this.copyTo(r);return}null==r&&(r=c());var n=c(),s=this.s,u=e.s,l=this.DB-d(a.data[a.t-1]);l>0?(a.lShiftTo(l,n),i.lShiftTo(l,r)):(a.copyTo(n),i.copyTo(r));var f=n.t,p=n.data[f-1];if(0!=p){var h=p*(1<<this.F1)+(f>1?n.data[f-2]>>this.F2:0),y=this.FV/h,g=(1<<this.F1)/h,m=1<<this.F2,v=r.t,C=v-f,E=null==t?c():t;for(n.dlShiftTo(C,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),o.ONE.dlShiftTo(f,E),E.subTo(n,n);n.t<f;)n.data[n.t++]=0;for(;--C>=0;){var S=r.data[--v]==p?this.DM:Math.floor(r.data[v]*y+(r.data[v-1]+m)*g);if((r.data[v]+=n.am(0,S,r,C,0,f))<S)for(n.dlShiftTo(C,E),r.subTo(E,r);r.data[v]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(f,t),s!=u&&o.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if((1&e)==0)return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},o.prototype.isEven=function(){return(this.t>0?1&this.data[0]:this.s)==0},o.prototype.exp=function(e,t){if(e>0xffffffff||e<1)return o.ONE;var r=c(),a=c(),i=t.convert(this),n=d(e)-1;for(i.copyTo(r);--n>=0;)if(t.sqrTo(r,a),(e&1<<n)>0)t.mulTo(a,i,r);else{var s=r;r=a,a=s}return t.revert(r)},o.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var t,r,a=(1<<t)-1,i=!1,n="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(i=!0,n=f(r));s>=0;)o<t?r=(this.data[s]&(1<<o)-1)<<t-o|this.data[--s]>>(o+=this.DB-t):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(n+=f(r));return i?n:"0"},o.prototype.negate=function(){var e=c();return o.ZERO.subTo(this,e),e},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(e){var t=c();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(o.ZERO)>0&&e.subTo(t,t),t},o.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},o.ZERO=h(0),o.ONE=h(1),S.prototype.convert=T,S.prototype.revert=T,S.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},S.prototype.sqrTo=function(e,t){e.squareTo(t)},I.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(0>e.compareTo(this.m))return e;var t=c();return e.copyTo(t),this.reduce(t),t},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>e.compareTo(this.r2);)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var b=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=0x4000000/b[b.length-1];o.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},o.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),a=h(r),i=c(),n=c(),s="";for(this.divRemTo(a,i,n);i.signum()>0;)s=(r+n.intValue()).toString(e).substr(1)+s,i.divRemTo(a,i,n);return n.intValue().toString(e)+s},o.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),i=!1,n=0,s=0,c=0;c<e.length;++c){var u=p(e,c);if(u<0){"-"==e.charAt(c)&&0==this.signum()&&(i=!0);continue}s=t*s+u,++n>=r&&(this.dMultiply(a),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(o.ONE.shiftLeft(e-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(o.ONE.shiftLeft(e-1),this);else{var a=[],i=7&e;a.length=(e>>3)+1,t.nextBytes(a),i>0?a[0]&=(1<<i)-1:a[0]=0,this.fromString(a,256)}},o.prototype.bitwiseTo=function(e,t,r){var a,i,n=Math.min(e.t,this.t);for(a=0;a<n;++a)r.data[a]=t(this.data[a],e.data[a]);if(e.t<this.t){for(i=e.s&this.DM,a=n;a<this.t;++a)r.data[a]=t(this.data[a],i);r.t=this.t}else{for(i=this.s&this.DM,a=n;a<e.t;++a)r.data[a]=t(i,e.data[a]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},o.prototype.changeBit=function(e,t){var r=o.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},o.prototype.addTo=function(e,t){for(var r=0,a=0,i=Math.min(e.t,this.t);r<i;)a+=this.data[r]+e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a+=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a+=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=e.s}t.s=a<0?-1:0,a>0?t.data[r++]=a:a<-1&&(t.data[r++]=this.DV+a),t.t=r,t.clamp()},o.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},o.prototype.multiplyLowerTo=function(e,t,r){var a,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(a=r.t-this.t;i<a;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(a=Math.min(e.t,t);i<a;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},o.prototype.multiplyUpperTo=function(e,t,r){--t;var a=r.t=this.t+e.t-t;for(r.s=0;--a>=0;)r.data[a]=0;for(a=Math.max(t-this.t,0);a<e.t;++a)r.data[this.t+a-t]=this.am(t-a,e.data[a],r,0,0,this.t+a-t);r.clamp(),r.drShiftTo(1,r)},o.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var a=this.t-1;a>=0;--a)r=(t*r+this.data[a])%e;return r},o.prototype.millerRabin=function(e){var t,r=this.subtract(o.ONE),a=r.getLowestSetBit();if(a<=0)return!1;for(var i=r.shiftRight(a),n={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do t=new o(this.bitLength(),n);while(0>=t.compareTo(o.ONE)||t.compareTo(r)>=0)var c=t.modPow(i,this);if(0!=c.compareTo(o.ONE)&&0!=c.compareTo(r)){for(var u=1;u++<a&&0!=c.compareTo(r);)if(0==(c=c.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=c.compareTo(r))return!1}}return!0},o.prototype.clone=function(){var e=c();return this.copyTo(e),e},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;else if(0==this.t)return -1}else if(1==this.t)return this.data[0];else if(0==this.t)return 0;return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,a=this.DB-e*this.DB%8,i=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[i++]=r|this.s<<this.DB-a);e>=0;)a<8?r=(this.data[e]&(1<<a)-1)<<8-a|this.data[--e]>>(a+=this.DB-8):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),(128&r)!=0&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},o.prototype.equals=function(e){return 0==this.compareTo(e)},o.prototype.min=function(e){return 0>this.compareTo(e)?this:e},o.prototype.max=function(e){return this.compareTo(e)>0?this:e},o.prototype.and=function(e){var t=c();return this.bitwiseTo(e,m,t),t},o.prototype.or=function(e){var t=c();return this.bitwiseTo(e,v,t),t},o.prototype.xor=function(e){var t=c();return this.bitwiseTo(e,C,t),t},o.prototype.andNot=function(e){var t=c();return this.bitwiseTo(e,E,t),t},o.prototype.not=function(){for(var e=c(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},o.prototype.shiftLeft=function(e){var t=c();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},o.prototype.shiftRight=function(e){var t=c();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},o.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+function(e){if(0==e)return -1;var t=0;return(65535&e)==0&&(e>>=16,t+=16),(255&e)==0&&(e>>=8,t+=8),(15&e)==0&&(e>>=4,t+=4),(3&e)==0&&(e>>=2,t+=2),(1&e)==0&&++t,t}(this.data[e]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=function(e){for(var t=0;0!=e;)e&=e-1,++t;return t}(this.data[r]^t);return e},o.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:(this.data[t]&1<<e%this.DB)!=0},o.prototype.setBit=function(e){return this.changeBit(e,v)},o.prototype.clearBit=function(e){return this.changeBit(e,E)},o.prototype.flipBit=function(e){return this.changeBit(e,C)},o.prototype.add=function(e){var t=c();return this.addTo(e,t),t},o.prototype.subtract=function(e){var t=c();return this.subTo(e,t),t},o.prototype.multiply=function(e){var t=c();return this.multiplyTo(e,t),t},o.prototype.divide=function(e){var t=c();return this.divRemTo(e,t,null),t},o.prototype.remainder=function(e){var t=c();return this.divRemTo(e,null,t),t},o.prototype.divideAndRemainder=function(e){var t=c(),r=c();return this.divRemTo(e,t,r),[t,r]},o.prototype.modPow=function(e,t){var r,a,i=e.bitLength(),n=h(1);if(i<=0)return n;r=i<18?1:i<48?3:i<144?4:i<768?5:6,a=i<8?new y(t):t.isEven()?new I(t):new g(t);var s=[],o=3,u=r-1,l=(1<<r)-1;if(s[1]=a.convert(this),r>1){var f=c();for(a.sqrTo(s[1],f);o<=l;)s[o]=c(),a.mulTo(f,s[o-2],s[o]),o+=2}var p,m,v=e.t-1,C=!0,E=c();for(i=d(e.data[v])-1;v>=0;){for(i>=u?p=e.data[v]>>i-u&l:(p=(e.data[v]&(1<<i+1)-1)<<u-i,v>0&&(p|=e.data[v-1]>>this.DB+i-u)),o=r;(1&p)==0;)p>>=1,--o;if((i-=o)<0&&(i+=this.DB,--v),C)s[p].copyTo(n),C=!1;else{for(;o>1;)a.sqrTo(n,E),a.sqrTo(E,n),o-=2;o>0?a.sqrTo(n,E):(m=n,n=E,E=m),a.mulTo(E,s[p],n)}for(;v>=0&&(e.data[v]&1<<i)==0;)a.sqrTo(n,E),m=n,n=E,E=m,--i<0&&(i=this.DB-1,--v)}return a.revert(n)},o.prototype.modInverse=function(e){if(0==this.signum())return o.ZERO;var t=e.isEven();if(this.isEven()&&t||0==e.signum())return o.ZERO;for(var r=e.clone(),a=this.clone(),i=h(1),n=h(0),s=h(0),c=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&n.isEven()||(i.addTo(this,i),n.subTo(e,n)),i.rShiftTo(1,i)):n.isEven()||n.subTo(e,n),n.rShiftTo(1,n);for(;a.isEven();)a.rShiftTo(1,a),t?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(e,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(a)>=0?(r.subTo(a,r),t&&i.subTo(s,i),n.subTo(c,n)):(a.subTo(r,a),t&&s.subTo(i,s),c.subTo(n,c))}return 0!=a.compareTo(o.ONE)?o.ZERO:c.compareTo(e)>=0?c.subtract(e):0>c.signum()&&(c.addTo(e,c),0>c.signum())?c.add(e):c},o.prototype.pow=function(e){return this.exp(e,new S)},o.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(0>t.compareTo(r)){var a=t;t=r,r=a}var i=t.getLowestSetBit(),n=r.getLowestSetBit();if(n<0)return t;for(i<n&&(n=i),n>0&&(t.rShiftTo(n,t),r.rShiftTo(n,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return n>0&&r.lShiftTo(n,r),r},o.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=b[b.length-1]){for(t=0;t<b.length;++t)if(r.data[0]==b[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<b.length;){for(var a=b[t],i=t+1;i<b.length&&a<A;)a*=b[i++];for(a=r.modInt(a);t<i;)if(a%b[t++]==0)return!1}return r.millerRabin(e)},o.prototype.square=function(){var e=c();return this.squareTo(e),e}},1500,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.sha1=a.sha1||{};a.md.sha1=a.md.algorithms.sha1=i,i.create=function(){s||(n=String.fromCharCode(128)+a.util.fillString("\0",64),s=!0);var e=null,t=a.util.createBuffer(),r=Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:0x67452301,h1:0xefcdab89,h2:0x98badcfe,h3:0x10325476,h4:0xc3d2e1f0},i},i.start(),i.update=function(n,s){"utf8"===s&&(n=a.util.encodeUtf8(n));var c=n.length;i.messageLength+=c,c=[c/0x100000000>>>0,c>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=c[1],c[1]=c[0]+(i.fullMessageLength[u]/0x100000000>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,c[0]=c[1]/0x100000000>>>0;return t.putBytes(n),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s,c=a.util.createBuffer();c.putBytes(t.bytes());var u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;c.putBytes(n.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/0x100000000>>>0,c.putInt32(l>>>0),l=s>>>0;c.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(p,r,c);var h=a.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h},i};var n=null,s=!1;function o(e,t,r){for(var a,i,n,s,o,c,u,l,f=r.length();f>=64;){for(l=0,i=e.h0,n=e.h1,s=e.h2,o=e.h3,c=e.h4;l<16;++l)a=r.getInt32(),t[l]=a,a=(i<<5|i>>>27)+(o^n&(s^o))+c+0x5a827999+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<20;++l)a=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31,t[l]=a,a=(i<<5|i>>>27)+(o^n&(s^o))+c+0x5a827999+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<32;++l)a=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31,t[l]=a,a=(i<<5|i>>>27)+(n^s^o)+c+0x6ed9eba1+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<40;++l)a=(a=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|a>>>30,t[l]=a,a=(i<<5|i>>>27)+(n^s^o)+c+0x6ed9eba1+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<60;++l)a=(a=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|a>>>30,t[l]=a,a=(i<<5|i>>>27)+(n&s|o&(n^s))+c+0x8f1bbcdc+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<80;++l)a=(a=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|a>>>30,t[l]=a,a=(i<<5|i>>>27)+(n^s^o)+c+0xca62c1d6+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;e.h0=e.h0+i|0,e.h1=e.h1+n|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,f-=64}}},36748,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(2828),e.r(1500);var i=t.exports=a.pkcs1=a.pkcs1||{};function n(e,t,r){r||(r=a.md.sha1.create());for(var i="",n=Math.ceil(t/r.digestLength),s=0;s<n;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){"string"==typeof r?(i=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=a.md.sha1.create(),c||(c=o);var i,s,o,c,u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l){var f=Error("RSAES-OAEP input message length is too long.");throw f.length=t.length,f.maxLength=l,f}i||(i=""),o.update(i,"raw");for(var p=o.digest(),h="",d=l-t.length,y=0;y<d;y++)h+="\0";var g=p.getBytes()+h+"\x01"+t;if(s){if(s.length!==o.digestLength){var f=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=s.length,f.digestLength=o.digestLength,f}}else s=a.random.getBytes(o.digestLength);var m=n(s,u-o.digestLength-1,c),v=a.util.xorBytes(g,m,g.length),C=n(v,o.digestLength,c);return"\0"+a.util.xorBytes(s,C,s.length)+v},i.decode_rsa_oaep=function(e,t,r){"string"==typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var i,s,o,c=Math.ceil(e.n.bitLength()/8);if(t.length!==c){var u=Error("RSAES-OAEP encoded message length is invalid.");throw u.length=t.length,u.expectedLength=c,u}if(void 0===s?s=a.md.sha1.create():s.start(),o||(o=s),c<2*s.digestLength+2)throw Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var l=s.digest().getBytes(),f=t.charAt(0),p=t.substring(1,s.digestLength+1),h=t.substring(1+s.digestLength),d=n(h,s.digestLength,o),y=n(a.util.xorBytes(p,d,p.length),c-s.digestLength-1,o),g=a.util.xorBytes(h,y,h.length),m=g.substring(0,s.digestLength),u="\0"!==f,v=0;v<s.digestLength;++v)u|=l.charAt(v)!==m.charAt(v);for(var C=1,E=s.digestLength,S=s.digestLength;S<g.length;S++){var T=g.charCodeAt(S),I=1&T^1;u|=T&65534*!!C,C&=I,E+=C}if(u||1!==g.charCodeAt(E))throw Error("Invalid RSAES-OAEP padding.");return g.substring(E+1)}},92054,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(68995),e.r(2828),function(){if(a.prime){t.exports=a.prime;return}var e=t.exports=a.prime=a.prime||{},r=a.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],n=new r(null);n.fromInt(30);var s=function(e,t){return e|t};function o(e,t,r,n){var s,o=c(e,t),u=(s=o.bitLength())<=100?27:s<=150?18:s<=200?15:s<=250?12:s<=300?9:s<=350?8:s<=400?7:s<=500?6:s<=600?5:s<=800?4:s<=1250?3:2;"millerRabinTests"in r&&(u=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function e(t,r,n,s,o,u,l){var f=+new Date;do{if(t.bitLength()>r&&(t=c(r,n)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(i[s++%8],0)}while(u<0||new Date-f<u)a.util.setImmediate(function(){e(t,r,n,s,o,u,l)})}(o,e,t,0,u,l,n)}function c(e,t){var a=new r(e,t),i=e-1;return a.testBit(i)||a.bitwiseTo(r.ONE.shiftLeft(i),s,a),a.dAddOffset(31-a.mod(n).byteValue(),0),a}e.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var n,s,u,l,f=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof f&&(f={name:f}),f.options=f.options||{};var p=t.prng||a.random;if("PRIMEINC"===f.name){return n=e,s={nextBytes:function(e){for(var t=p.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=f.options,l=i,"workers"in u?function(e,t,i,n){if("u"<typeof Worker)return o(e,t,i,n);var s=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,p=i.workerScript||"forge/prime.worker.js";if(-1===u)return a.util.estimateCores(function(e,t){e&&(t=2),u=t-1,h()});function h(){u=Math.max(1,u);for(var a=[],i=0;i<u;++i)a[i]=new Worker(p);for(var o=u,i=0;i<u;++i)a[i].addEventListener("message",d);var h=!1;function d(i){if(!h){--o;var u=i.data;if(u.found){for(var p=0;p<a.length;++p)a[p].terminate();return h=!0,n(null,new r(u.prime,16))}s.bitLength()>e&&(s=c(e,t));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:l}),s.dAddOffset(f,0)}}}h()}(n,s,u,l):o(n,s,u,l)}throw Error("Invalid prime generation algorithm: "+f.name)}}()},32721,(e,t,r)=>{var a=e.r(2015);if(e.r(74723),e.r(68995),e.r(31808),e.r(36748),e.r(92054),e.r(2828),e.r(26706),void 0===i)var i=a.jsbn.BigInteger;var n=a.util.isNodejs?e.r(54799):null,s=a.asn1,o=a.util;a.pki=a.pki||{},t.exports=a.pki.rsa=a.rsa=a.rsa||{};var c=a.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},y=function(e){if(e.algorithm in c.oids)t=c.oids[e.algorithm];else{var t,r=Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}var a=s.oidToDer(t).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);n.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,a)),n.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(n),i.value.push(o),s.toDer(i).getBytes()},g=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do n=new i(a.util.bytesToHex(a.random.getBytes(t.n.bitLength()/8)),16);while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(i.ONE))for(var n,s=(e=e.multiply(n.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);0>s.compareTo(o);)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c.multiply(n.modInverse(t.n)).mod(t.n)};function m(e,t,r){var i,n=a.util.createBuffer(),s=Math.ceil(t.n.bitLength()/8);if(e.length>s-11){var o=Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=s-11,o}n.putByte(0),n.putByte(r);var c=s-3-e.length;if(0===r||1===r){i=255*(0!==r);for(var u=0;u<c;++u)n.putByte(i)}else for(;c>0;){for(var l=0,f=a.random.getBytes(c),u=0;u<c;++u)0===(i=f.charCodeAt(u))?++l:n.putByte(i);c=l}return n.putByte(0),n.putBytes(e),n}function v(e,t,r,i,n){var s=Math.ceil(t.n.bitLength()/8),o=a.util.createBuffer(e),c=o.getByte(),u=o.getByte();if(0!==c||r&&0!==u&&1!==u||!r&&2!==u||r&&0===u&&void 0===i)throw Error("Encryption block is invalid.");var l=0;if(0===u){l=s-3-i;for(var f=0;f<l;++f)if(0!==o.getByte())throw Error("Encryption block is invalid.")}else if(1===u){for(l=0;o.length()>1;){if(255!==o.getByte()){--o.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw Error("Encryption block is invalid.")}else if(2===u){for(l=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw Error("Encryption block is invalid.")}if(0!==o.getByte()||l!==s-3-o.length())throw Error("Encryption block is invalid.");return o.getBytes()}function C(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=a.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&(128&r.charCodeAt(1))==0||255===r.charCodeAt(0)&&(128&r.charCodeAt(1))==128)?r.substr(1):r}function E(e){return a.util.isNodejs&&"function"==typeof n[e]}function S(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function T(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function I(e){for(var t=a.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}c.rsa.encrypt=function(e,t,r){var n,s=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,n=m(e,t,r)):(n=a.util.createBuffer()).putBytes(e);for(var c=g(new i(n.toHex(),16),t,s).toString(16),u=a.util.createBuffer(),l=o-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes(a.util.hexToBytes(c)),u.getBytes()},c.rsa.decrypt=function(e,t,r,n){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new i(a.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw Error("Encrypted message is invalid.");for(var u=g(c,t,r).toString(16),l=a.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)l.putByte(0),--f;return(l.putBytes(a.util.hexToBytes(u)),!1!==n)?v(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,s=(r=r||{}).prng||a.random,o=r.algorithm||"PRIMEINC";if("PRIMEINC"===o)(n={algorithm:o,state:0,bits:e,rng:{nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt);else throw Error("Invalid key generation algorithm: "+o);return n},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r,a=new i(null);a.fromInt(30);for(var n=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f,p=null===e.p?e.pBits:e.qBits,h=p-1;0===e.pqState?(e.num=new i(p,e.rng),e.num.testBit(h)||e.num.bitwiseTo(i.ONE.shiftLeft(h),s,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),n=0,++e.pqState):1===e.pqState?e.num.bitLength()>p?e.pqState=0:e.num.isProbablePrime((f=e.num.bitLength())<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2)?++e.pqState:e.num.dAddOffset(u[n++%8],0):2===e.pqState?e.pqState=3*(0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)):3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)0>e.p.compareTo(e.q)&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(r=+new Date)-o,o=r}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,u){if(1==arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(u=e,e=void 0):2==arguments.length?"number"==typeof e?"function"==typeof t?(u=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,u=t,e=void 0,t=void 0):3==arguments.length&&("number"==typeof t?"function"==typeof r&&(u=r,r=void 0):(u=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!a.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t)){if(u){if(E("generateKeyPair"))return n.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(e,t,r){if(e)return u(e);u(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})});if(S("generateKey")&&S("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:I(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){u(e)}).then(function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(e)));u(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}});if(T("generateKey")&&T("exportKey")){var l=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:I(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);l.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(t)));u(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){u(e)}},l.onerror=function(e){u(e)};return}}else if(E("generateKeyPairSync")){var f=n.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(f.privateKey),publicKey:c.publicKeyFromPem(f.publicKey)}}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!u)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;var h=p,d=r,y=u;"function"==typeof d&&(y=d,d={});var g={algorithm:{name:(d=d||{}).algorithm||"PRIMEINC",options:{workers:d.workers||2,workLoad:d.workLoad||100,workerScript:d.workerScript}}};function m(){v(h.pBits,function(e,t){return e?y(e):(h.p=t,null!==h.q)?C(e,h.q):void v(h.qBits,C)})}function v(e,t){a.prime.generateProbablePrime(e,g,t)}function C(e,t){if(e)return y(e);if(h.q=t,0>h.p.compareTo(h.q)){var r=h.p;h.p=h.q,h.q=r}if(0!==h.p.subtract(i.ONE).gcd(h.e).compareTo(i.ONE)){h.p=null,m();return}if(0!==h.q.subtract(i.ONE).gcd(h.e).compareTo(i.ONE)){h.q=null,v(h.qBits,C);return}if(h.p1=h.p.subtract(i.ONE),h.q1=h.q.subtract(i.ONE),h.phi=h.p1.multiply(h.q1),0!==h.phi.gcd(h.e).compareTo(i.ONE)){h.p=h.q=null,m();return}if(h.n=h.p.multiply(h.q),h.n.bitLength()!==h.bits){h.q=null,v(h.qBits,C);return}var a=h.e.modInverse(h.phi);h.keys={privateKey:c.rsa.setPrivateKey(h.n,h.e,a,h.p,h.q,a.mod(h.p1),a.mod(h.q1),h.q.modInverse(h.p)),publicKey:c.rsa.setPublicKey(h.n,h.e)},y(null,h.keys)}"prng"in d&&(g.prng=d.prng),m()},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.encrypt=function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return m(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return a.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw Error('Unsupported encryption scheme: "'+t+'".');var n=t.encode(e,r,!0);return c.rsa.encrypt(n,r,!0)},r.verify=function(e,t,i,n){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===n&&(n={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in n||(n._parseAllDigestBytes=!0),"_skipPaddingChecks"in n||(n._skipPaddingChecks=!1),"RSASSA-PKCS1-V1_5"===i?i={verify:function(e,t){t=v(t,r,!0,void 0,n);var i=s.fromDer(t,{parseAllBytes:n._parseAllDigestBytes}),o={},c=[];if(!s.validate(i,d,o,c)||2!==i.value.length){var u=Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw u.errors=c,u}var l=s.derToOid(o.algorithmIdentifier);if(l!==a.oids.md2&&l!==a.oids.md5&&l!==a.oids.sha1&&l!==a.oids.sha224&&l!==a.oids.sha256&&l!==a.oids.sha384&&l!==a.oids.sha512&&l!==a.oids["sha512-224"]&&l!==a.oids["sha512-256"]){var u=Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw u.oid=l,u}if((l===a.oids.md2||l===a.oids.md5)&&!("parameters"in o))throw Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return e===o.digest}}:("NONE"===i||"NULL"===i||null===i)&&(i={verify:function(e,t){return e===(t=v(t,r,!0,void 0,n))}});var o=c.rsa.decrypt(t,r,!0,!1);return i.verify(e,o,r.n.bitLength())},r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,i,n,s,o,u){var l={n:e,e:t,d:r,p:i,q:n,dP:s,dQ:o,qInv:u};return l.decrypt=function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:v};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return a.pkcs1.decode_rsa_oaep(t,e,r)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={decode:function(e){return e}};else throw Error('Unsupported encryption scheme: "'+t+'".');return t.decode(i,l,!1)},l.sign=function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:y},r=1):("NONE"===t||"NULL"===t||null===t)&&(t={encode:function(){return e}},r=1);var a=t.encode(e,l.n.bitLength());return c.rsa.encrypt(a,l,r)},l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,n,o,u,p,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(a.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,f,y,g)){var m=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return t=a.util.createBuffer(y.privateKeyModulus).toHex(),r=a.util.createBuffer(y.privateKeyPublicExponent).toHex(),n=a.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=a.util.createBuffer(y.privateKeyPrime1).toHex(),u=a.util.createBuffer(y.privateKeyPrime2).toHex(),p=a.util.createBuffer(y.privateKeyExponent1).toHex(),h=a.util.createBuffer(y.privateKeyExponent2).toHex(),d=a.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new i(t,16),new i(r,16),new i(n,16),new i(o,16),new i(u,16),new i(p,16),new i(h,16),new i(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var n=s.derToOid(t.publicKeyOid);if(n!==c.oids.rsaEncryption){var o=Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}e=t.rsaPublicKey}if(r=[],!s.validate(e,p,t,r)){var o=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var u=a.util.createBuffer(t.publicKeyModulus).toHex(),l=a.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(u,16),new i(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e))])}},38720,(e,t,r)=>{var a=e.r(2015);if(e.r(1258),e.r(74723),e.r(30369),e.r(5189),e.r(31808),e.r(80399),e.r(93139),e.r(2828),e.r(63045),e.r(32721),e.r(26706),void 0===i)var i=a.jsbn.BigInteger;var n=a.asn1,s=a.pki=a.pki||{};t.exports=s.pbe=a.pbe=a.pbe||{};var o=s.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function p(e){var t;if(e){if(!(t=s.oids[n.derToOid(e)])){var r=Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return h(t)}function h(e){var t=a.md;switch(e){case"hmacWithSHA224":t=a.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw Error("Unknown hash algorithm: "+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i=a.random.getBytesSync(r.saltSize),c=r.count,u=n.integerToDer(c);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){switch(r.algorithm){case"aes128":g=16,C=16,E=o["aes128-CBC"],S=a.aes.createEncryptionCipher;break;case"aes192":g=24,C=16,E=o["aes192-CBC"],S=a.aes.createEncryptionCipher;break;case"aes256":g=32,C=16,E=o["aes256-CBC"],S=a.aes.createEncryptionCipher;break;case"des":g=8,C=8,E=o.desCBC,S=a.des.createEncryptionCipher;break;default:var l,f,p,d,y,g,m,v,C,E,S,T=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw T.algorithm=r.algorithm,T}var I="hmacWith"+r.prfAlgorithm.toUpperCase(),b=h(I),A=a.pkcs5.pbkdf2(t,i,c,g,b),B=a.random.getBytesSync(C),x=S(A);x.start(B),x.update(n.toDer(e)),x.finish(),v=x.output.getBytes();var N=(l=i,f=u,p=g,d=I,y=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,l),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,f.getBytes())]),"hmacWithSHA1"!==d&&y.value.push(n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,a.util.hexToBytes(p.toString(16))),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s.oids[d]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])),y);m=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.pkcs5PBES2).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.pkcs5PBKDF2).getBytes()),N]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(E).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,B)])])])}else if("3des"===r.algorithm){g=24;var R=new a.util.ByteBuffer(i),A=s.pbe.generatePkcs12Key(t,R,1,c,g),B=s.pbe.generatePkcs12Key(t,R,2,c,g),x=a.des.createEncryptionCipher(A);x.start(B),x.update(n.toDer(e)),x.finish(),v=x.output.getBytes(),m=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,i),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u.getBytes())])])}else{var T=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw T.algorithm=r.algorithm,T}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[m,n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,v)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,i={},o=[];if(!n.validate(e,c,i,o)){var u=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=o,u}var l=n.derToOid(i.encryptionOid),f=s.pbe.getCipher(l,i.encryptionParams,t),p=a.util.createBuffer(i.encryptedData);return f.update(p),f.finish()&&(r=n.fromDer(f.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:n.toDer(e).getBytes()};return a.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=a.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return n.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i,o,c,u,l=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return l=s.encryptPrivateKeyInfo(l,t,r),s.encryptedPrivateKeyToPem(l)}switch(r.algorithm){case"aes128":i="AES-128-CBC",c=16,o=a.random.getBytesSync(16),u=a.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",c=24,o=a.random.getBytesSync(16),u=a.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",c=32,o=a.random.getBytesSync(16),u=a.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",c=24,o=a.random.getBytesSync(8),u=a.des.createEncryptionCipher;break;case"des":i="DES-CBC",c=8,o=a.random.getBytesSync(8),u=a.des.createEncryptionCipher;break;default:var f=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var p=u(a.pbe.opensslDeriveBytes(t,o.substr(0,8),c));p.start(o),p.update(n.toDer(s.privateKeyToAsn1(e))),p.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:a.util.bytesToHex(o).toUpperCase()},body:p.output.getBytes()};return a.pem.encode(h)},s.decryptRsaPrivateKey=function(e,t){var r=null,i=a.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type){var o=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(i.procType&&"ENCRYPTED"===i.procType.type){switch(i.dekInfo.algorithm){case"DES-CBC":c=8,u=a.des.createDecryptionCipher;break;case"DES-EDE3-CBC":c=24,u=a.des.createDecryptionCipher;break;case"AES-128-CBC":c=16,u=a.aes.createDecryptionCipher;break;case"AES-192-CBC":c=24,u=a.aes.createDecryptionCipher;break;case"AES-256-CBC":c=32,u=a.aes.createDecryptionCipher;break;case"RC2-40-CBC":c=5,u=function(e){return a.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":c=8,u=function(e){return a.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":c=16,u=function(e){return a.rc2.createDecryptionCipher(e,128)};break;default:var c,u,o=Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".');throw o.algorithm=i.dekInfo.algorithm,o}var l=a.util.hexToBytes(i.dekInfo.parameters),f=u(a.pbe.opensslDeriveBytes(t,l.substr(0,8),c));if(f.start(l),f.update(a.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(n.fromDer(r),t):n.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,i,n,s){if(null==s){if(!("sha1"in a.md))throw Error('"sha1" hash algorithm unavailable.');s=a.md.sha1.create()}var o,c,u=s.digestLength,l=s.blockLength,f=new a.util.ByteBuffer,p=new a.util.ByteBuffer;if(null!=e){for(c=0;c<e.length;c++)p.putInt16(e.charCodeAt(c));p.putInt16(0)}var h=p.length(),d=t.length(),y=new a.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(d/l),m=new a.util.ByteBuffer;for(c=0;c<g;c++)m.putByte(t.at(c%d));var v=l*Math.ceil(h/l),C=new a.util.ByteBuffer;for(c=0;c<v;c++)C.putByte(p.at(c%h));var E=m;E.putBuffer(C);for(var S=Math.ceil(n/u),T=1;T<=S;T++){var I=new a.util.ByteBuffer;I.putBytes(y.bytes()),I.putBytes(E.bytes());for(var b=0;b<i;b++)s.start(),s.update(I.getBytes()),I=s.digest();var A=new a.util.ByteBuffer;for(c=0;c<l;c++)A.putByte(I.at(c%u));var B=Math.ceil(d/l)+Math.ceil(h/l),x=new a.util.ByteBuffer;for(o=0;o<B;o++){var N=new a.util.ByteBuffer(E.getBytes(l)),R=511;for(c=A.length()-1;c>=0;c--)R>>=8,R+=A.at(c)+N.at(c),N.setAt(c,255&R);x.putBuffer(N)}E=x,f.putBuffer(I)}return f.truncate(f.length()-n),f},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var a=Error("Cannot read encrypted PBE data block. Unsupported OID.");throw a.oid=e,a.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],a}},s.pbe.getCipherForPBES2=function(e,t,r){var i,o,c={},l=[];if(!n.validate(t,u,c,l)){var f=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=l,f}if((e=n.derToOid(c.kdfOid))!==s.oids.pkcs5PBKDF2){var f=Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw f.oid=e,f.supportedOids=["pkcs5PBKDF2"],f}if((e=n.derToOid(c.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC){var f=Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw f.oid=e,f.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],f}var h=c.kdfSalt,d=a.util.createBuffer(c.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":i=16,o=a.aes.createDecryptionCipher;break;case"aes192-CBC":i=24,o=a.aes.createDecryptionCipher;break;case"aes256-CBC":i=32,o=a.aes.createDecryptionCipher;break;case"des-EDE3-CBC":i=24,o=a.des.createDecryptionCipher;break;case"desCBC":i=8,o=a.des.createDecryptionCipher}var y=p(c.prfOid),g=a.pkcs5.pbkdf2(r,h,d,i,y),m=c.encIv,v=o(g);return v.start(m),v},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var i,o,c,u={},f=[];if(!n.validate(t,l,u,f)){var h=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw h.errors=f,h}var d=a.util.createBuffer(u.salt),y=a.util.createBuffer(u.iterations);switch(y=y.getInt(y.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:i=24,o=8,c=a.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:i=5,o=8,c=function(e,t){var r=a.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var h=Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw h.oid=e,h}var g=p(u.prfOid),m=s.pbe.generatePkcs12Key(r,d,1,y,i,g);return g.start(),c(m,s.pbe.generatePkcs12Key(r,d,2,y,o,g))},s.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in a.md))throw Error('"md5" hash algorithm unavailable.');i=a.md.md5.create()}null===t&&(t="");for(var n=[f(i,e+t)],s=16,o=1;s<r;++o,s+=16)n.push(f(i,n[o-1]+e+t));return n.join("").substr(0,r)}},93197,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(26706);var i=a.asn1,n=t.exports=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=a.pkcs7||{},a.pkcs7.asn1=n;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};n.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};n.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},n.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};n.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},n.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},39839,(e,t,r)=>{var a=e.r(2015);e.r(26706),a.mgf=a.mgf||{},(t.exports=a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new a.util.ByteBuffer,n=Math.ceil(r/e.digestLength),s=0;s<n;s++){var o=new a.util.ByteBuffer;o.putInt32(s),e.start(),e.update(t+o.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},46551,(e,t,r)=>{var a=e.r(2015);e.r(39839),t.exports=a.mgf=a.mgf||{},a.mgf.mgf1=a.mgf1},15992,(e,t,r)=>{var a=e.r(2015);e.r(2828),e.r(26706),(t.exports=a.pss=a.pss||{}).create=function(e){3==arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,n=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=a.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else if(null!==s)t=s.length();else throw Error("Salt length not specified or specific salt not given.");if(null!==s&&s.length()!==t)throw Error("Given salt length does not match length of given salt.");var o=e.prng||a.random,c={};return c.encode=function(e,c){var u,l,f=c-1,p=Math.ceil(f/8),h=e.digest().getBytes();if(p<n+t+2)throw Error("Message is too long to encrypt.");l=null===s?o.getBytesSync(t):s.bytes();var d=new a.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(h),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),g=new a.util.ByteBuffer;g.fillWithByte(0,p-t-n-2),g.putByte(1),g.putBytes(l);var m=g.getBytes(),v=p-n-1,C=i.generate(y,v),E="";for(u=0;u<v;u++)E+=String.fromCharCode(m.charCodeAt(u)^C.charCodeAt(u));return(E=String.fromCharCode(E.charCodeAt(0)&~(65280>>8*p-f&255))+E.substr(1))+y+String.fromCharCode(188)},c.verify=function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l<n+t+2)throw Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(l-1))throw Error("Encoded message does not end in 0xBC.");var f=l-n-1,p=s.substr(0,f),h=s.substr(f,n),d=65280>>8*l-u&255;if((p.charCodeAt(0)&d)!=0)throw Error("Bits beyond keysize not zero as expected.");var y=i.generate(h,f),g="";for(c=0;c<f;c++)g+=String.fromCharCode(p.charCodeAt(c)^y.charCodeAt(c));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var m=l-n-t-2;for(c=0;c<m;c++)if(0!==g.charCodeAt(c))throw Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw Error("Inconsistent PSS signature, 0x01 marker not found");var v=g.substr(-t),C=new a.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(v),r.start(),r.update(C.getBytes()),h===r.digest().getBytes()},c}},9166,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(74723),e.r(30369),e.r(5189),e.r(46551),e.r(31808),e.r(93139),e.r(15992),e.r(32721),e.r(26706);var i=a.asn1,n=t.exports=a.pki=a.pki||{},s=n.oids,o={};o.CN=s.commonName,o.commonName="CN",o.C=s.countryName,o.countryName="C",o.L=s.localityName,o.localityName="L",o.ST=s.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=s.organizationName,o.organizationName="O",o.OU=s.organizationalUnitName,o.organizationalUnitName="OU",o.E=s.emailAddress,o.emailAddress="E";var c=a.pki.rsa.publicKeyValidator,u={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},c,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},c,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},p={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function h(e,t){"string"==typeof t&&(t={shortName:t});for(var r,a=null,i=0;null===a&&i<e.attributes.length;++i)r=e.attributes[i],t.type&&t.type===r.type||t.name&&t.name===r.name?a=r:t.shortName&&t.shortName===r.shortName&&(a=r);return a}n.RDNAttributesAsArray=function(e,t){for(var r,a,n,c=[],u=0;u<e.value.length;++u){r=e.value[u];for(var l=0;l<r.value.length;++l)n={},a=r.value[l],n.type=i.derToOid(a.value[0].value),n.value=a.value[1].value,n.valueTagClass=a.value[1].type,n.type in s&&(n.name=s[n.type],n.name in o&&(n.shortName=o[n.name])),t&&(t.update(n.type),t.update(n.value)),c.push(n)}return c},n.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var a=e[r],c=i.derToOid(a.value[0].value),u=a.value[1].value,l=0;l<u.length;++l){var f={};if(f.type=c,f.value=u[l].value,f.valueTagClass=u[l].type,f.type in s&&(f.name=s[f.type],f.name in o&&(f.shortName=o[f.name])),f.type===s.extensionRequest){f.extensions=[];for(var p=0;p<f.value.length;++p)f.extensions.push(n.certificateExtensionFromAsn1(f.value[p]))}t.push(f)}return t};var d=function(e,t,r){var a={};if(e!==s["RSASSA-PSS"])return a;r&&(a={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var n={},o=[];if(!i.validate(t,l,n,o)){var c=Error("Cannot read RSASSA-PSS parameter block.");throw c.errors=o,c}return void 0!==n.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=i.derToOid(n.hashOid)),void 0!==n.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=i.derToOid(n.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=i.derToOid(n.maskGenHashOid)),void 0!==n.saltLength&&(a.saltLength=n.saltLength.charCodeAt(0)),a},y=function(e){switch(s[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return a.md.sha1.create();case"md5WithRSAEncryption":return a.md.md5.create();case"sha256WithRSAEncryption":case"RSASSA-PSS":return a.md.sha256.create();case"sha384WithRSAEncryption":return a.md.sha384.create();case"sha512WithRSAEncryption":return a.md.sha512.create();default:var t=Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},g=function(e){var t,r,i,n=e.certificate;switch(n.signatureOid){case s.sha1WithRSAEncryption:case s.sha1WithRSASignature:break;case s["RSASSA-PSS"]:if(void 0===(r=s[n.signatureParameters.mgf.hash.algorithmOid])||void 0===a.md[r]){var o=Error("Unsupported MGF hash function.");throw o.oid=n.signatureParameters.mgf.hash.algorithmOid,o.name=r,o}if(void 0===(i=s[n.signatureParameters.mgf.algorithmOid])||void 0===a.mgf[i]){var o=Error("Unsupported MGF function.");throw o.oid=n.signatureParameters.mgf.algorithmOid,o.name=i,o}if(i=a.mgf[i].create(a.md[r].create()),void 0===(r=s[n.signatureParameters.hash.algorithmOid])||void 0===a.md[r]){var o=Error("Unsupported RSASSA-PSS hash function.");throw o.oid=n.signatureParameters.hash.algorithmOid,o.name=r,o}t=a.pss.create(a.md[r].create(),i,n.signatureParameters.saltLength)}return n.publicKey.verify(e.md.digest().getBytes(),e.signature,t)};function m(e){for(var t,r,n=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),s=e.attributes,o=0;o<s.length;++o){var c=(t=s[o]).value,u=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass)===i.Type.UTF8&&(c=a.util.encodeUtf8(c)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,u,!1,c)])]),n.value.push(r)}return n}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in n.oids?t.name=n.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=n.oids[o[t.shortName]])),void 0===t.type)if(t.name&&t.name in n.oids)t.type=n.oids[t.name];else{var a=Error("Attribute type not specified.");throw a.attribute=t,a}if(void 0===t.shortName&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===s.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var c=0;c<t.extensions.length;++c)t.value.push(n.certificateExtensionToAsn1(C(t.extensions[c])))}if(void 0===t.value){var a=Error("Attribute value not specified.");throw a.attribute=t,a}}}function C(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in n.oids&&(e.name=n.oids[e.id]),void 0===e.id)if(e.name&&e.name in n.oids)e.id=n.oids[e.name];else{var r=Error("Extension ID not specified.");throw r.extension=e,r}if(void 0!==e.value)return e;if("keyUsage"===e.name){var o=0,c=0,u=0;e.digitalSignature&&(c|=128,o=7),e.nonRepudiation&&(c|=64,o=6),e.keyEncipherment&&(c|=32,o=5),e.dataEncipherment&&(c|=16,o=4),e.keyAgreement&&(c|=8,o=3),e.keyCertSign&&(c|=4,o=2),e.cRLSign&&(c|=2,o=1),e.encipherOnly&&(c|=1,o=0),e.decipherOnly&&(u|=128,o=7);var l=String.fromCharCode(o);0!==u?l+=String.fromCharCode(c)+String.fromCharCode(u):0!==c&&(l+=String.fromCharCode(c)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,l)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var f=e.value.value;for(var p in e)!0===e[p]&&(p in s?f.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s[p]).getBytes())):-1!==p.indexOf(".")&&f.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(p).getBytes())))}else if("nsCertType"===e.name){var o=0,c=0;e.client&&(c|=128,o=7),e.server&&(c|=64,o=6),e.email&&(c|=32,o=5),e.objsign&&(c|=16,o=4),e.reserved&&(c|=8,o=3),e.sslCA&&(c|=4,o=2),e.emailCA&&(c|=2,o=1),e.objCA&&(c|=1,o=0);var l=String.fromCharCode(o);0!==c&&(l+=String.fromCharCode(c)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,l)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h,d=0;d<e.altNames.length;++d){var l=(h=e.altNames[d]).value;if(7===h.type&&h.ip){if(null===(l=a.util.bytesFromIP(h.ip))){var r=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else 8===h.type&&(l=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(l));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,l))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var y=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=y.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,y.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var f=e.value.value;if(e.keyIdentifier){var g=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;f.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,g))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];f.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var C=a.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);f.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,C))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h,f=e.value.value,E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),S=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]),d=0;d<e.altNames.length;++d){var l=(h=e.altNames[d]).value;if(7===h.type&&h.ip){if(null===(l=a.util.bytesFromIP(h.ip))){var r=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else 8===h.type&&(l=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(l));S.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,l))}E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[S])),f.push(E)}if(void 0===e.value){var r=Error("Extension value not specified.");throw r.extension=e,r}return e}function E(e,t){if(e!==s["RSASSA-PSS"])return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"");var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}n.certificateFromPem=function(e,t,r){var s=a.pem.decode(e)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var o=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var c=i.fromDer(s.body,r);return n.certificateFromAsn1(c,t)},n.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(n.certificateToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.publicKeyFromPem=function(e){var t=a.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return n.publicKeyFromAsn1(s)},n.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(n.publicKeyToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(n.publicKeyToRSAPublicKey(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.getPublicKeyFingerprint=function(e,t){var r,s=(t=t||{}).md||a.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(n.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(n.publicKeyToAsn1(e)).getBytes();break;default:throw Error('Unknown fingerprint type "'+t.type+'".')}s.start(),s.update(r);var o=s.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw Error('Unknown encoding "'+t.encoding+'".');return o},n.certificationRequestFromPem=function(e,t,r){var s=a.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==s.type){var o=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");var c=i.fromDer(s.body,r);return n.certificationRequestFromAsn1(c,t)},n.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(n.certificationRequestToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return h(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)C(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,a=null,i=0;null===a&&i<e.extensions.length;++i)r=e.extensions[i],t.id&&r.id===t.id?a=r:t.name&&r.name===t.name&&(a=r);return a},e.sign=function(t,r){e.md=r||a.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=n.getTBSCertificate(e);var u=i.toDer(e.tbsCertificate);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var a=t.issuer,s=e.subject,o=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw o.expectedIssuer=s.attributes,o.actualIssuer=a.attributes,o}var c=t.md;if(null===c){c=y({signatureOid:t.signatureOid,type:"certificate"});var u=t.tbsCertificate||n.getTBSCertificate(t),l=i.toDer(u);c.update(l.getBytes())}return null!==c&&(r=g({certificate:e,md:c,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,a=e.issuer,i=t.subject;if(a.hash&&i.hash)r=a.hash===i.hash;else if(a.attributes.length===i.attributes.length){r=!0;for(var n,s,o=0;r&&o<a.attributes.length;++o)n=a.attributes[o],s=i.attributes[o],(n.type!==s.type||n.value!==s.value)&&(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return n.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=s.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return a.util.hexToBytes(i.subjectKeyIdentifier)===n}}return!1},e},n.certificateFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,u,r,s)){var o=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw o.errors=s,o}if(i.derToOid(r.publicKeyOid)!==n.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var c=n.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0,c.serialNumber=a.util.createBuffer(r.certSerialNumber).toHex(),c.signatureOid=a.asn1.derToOid(r.certSignatureOid),c.signatureParameters=d(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=a.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var l=[];if(void 0!==r.certValidity1UTCTime&&l.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&l.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&l.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&l.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),l.length>2)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=l[0],c.validity.notAfter=l[1],c.tbsCertificate=r.tbsCertificate,t){c.md=y({signatureOid:c.signatureOid,type:"certificate"});var f=i.toDer(c.tbsCertificate);c.md.update(f.getBytes())}var p=a.md.sha1.create(),g=i.toDer(r.certIssuer);p.update(g.getBytes()),c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){v([e]),c.issuer.attributes.push(e)},c.issuer.attributes=n.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=p.digest().toHex();var m=a.md.sha1.create(),C=i.toDer(r.certSubject);return m.update(C.getBytes()),c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){v([e]),c.subject.attributes.push(e)},c.subject.attributes=n.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=n.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=n.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},n.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var a=e.value[r],i=0;i<a.value.length;++i)t.push(n.certificateExtensionFromAsn1(a.value[i]));return t},n.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in s){if(t.name=s[t.id],"keyUsage"===t.name){var r=i.fromDer(t.value),n=0,o=0;r.value.length>1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=(128&n)==128,t.nonRepudiation=(64&n)==64,t.keyEncipherment=(32&n)==32,t.dataEncipherment=(16&n)==16,t.keyAgreement=(8&n)==8,t.keyCertSign=(4&n)==4,t.cRLSign=(2&n)==2,t.encipherOnly=(1&n)==1,t.decipherOnly=(128&o)==128}else if("basicConstraints"===t.name){var r=i.fromDer(t.value);r.value.length>0&&r.value[0].type===i.Type.BOOLEAN?t.cA=0!==r.value[0].value.charCodeAt(0):t.cA=!1;var c=null;r.value.length>0&&r.value[0].type===i.Type.INTEGER?c=r.value[0].value:r.value.length>1&&(c=r.value[1].value),null!==c&&(t.pathLenConstraint=i.derToInteger(c))}else if("extKeyUsage"===t.name)for(var r=i.fromDer(t.value),u=0;u<r.value.length;++u){var l=i.derToOid(r.value[u].value);l in s?t[s[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){var r=i.fromDer(t.value),n=0;r.value.length>1&&(n=r.value.charCodeAt(1)),t.client=(128&n)==128,t.server=(64&n)==64,t.email=(32&n)==32,t.objsign=(16&n)==16,t.reserved=(8&n)==8,t.sslCA=(4&n)==4,t.emailCA=(2&n)==2,t.objCA=(1&n)==1}else if("subjectAltName"===t.name||"issuerAltName"===t.name){t.altNames=[];for(var f,r=i.fromDer(t.value),p=0;p<r.value.length;++p){var h={type:(f=r.value[p]).type,value:f.value};switch(t.altNames.push(h),f.type){case 1:case 2:case 6:break;case 7:h.ip=a.util.bytesToIP(f.value);break;case 8:h.oid=i.derToOid(f.value)}}}else if("subjectKeyIdentifier"===t.name){var r=i.fromDer(t.value);t.subjectKeyIdentifier=a.util.bytesToHex(r.value)}}return t},n.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,p,r,s)){var o=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw o.errors=s,o}if(i.derToOid(r.publicKeyOid)!==n.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var c=n.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=a.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=d(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=a.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){c.md=y({signatureOid:c.signatureOid,type:"certification request"});var u=i.toDer(c.certificationRequestInfo);c.md.update(u.getBytes())}var l=a.md.sha1.create();return c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){v([e]),c.subject.attributes.push(e)},c.subject.attributes=n.RDNAttributesAsArray(r.certificationRequestInfoSubject,l),c.subject.hash=l.digest().toHex(),c.publicKey=n.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return h(c,e)},c.addAttribute=function(e){v([e]),c.attributes.push(e)},c.attributes=n.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},n.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return h(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||a.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=n.getCertificationRequestInfo(e);var u=i.toDer(e.certificationRequestInfo);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){r=y({signatureOid:e.signatureOid,type:"certification request"});var a=e.certificationRequestInfo||n.getCertificationRequestInfo(e),s=i.toDer(a);r.update(s.getBytes())}return null!==r&&(t=g({certificate:e,md:r,signature:e.signature})),t},e};var S=new Date("1950-01-01T00:00:00Z"),T=new Date("2050-01-01T00:00:00Z");function I(e){return e>=S&&e<T?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}n.getTBSCertificate=function(e){var t=I(e.validity.notBefore),r=I(e.validity.notAfter),s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),E(e.siginfo.algorithmOid,e.siginfo.parameters)]),m(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),m(e.subject),n.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&s.value.push(n.certificateExtensionsToAsn1(e.extensions)),s},n.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),m(e.subject),n.publicKeyToAsn1(e.publicKey),function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,n=0;n<r.length;++n){var s=r[n],o=s.value,c=i.Type.UTF8;"valueTagClass"in s&&(c=s.valueTagClass),c===i.Type.UTF8&&(o=a.util.encodeUtf8(o));var u=!1;"valueConstructed"in s&&(u=s.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,c,u,o)])]);t.value.push(l)}return t}(e)])},n.distinguishedNameToAsn1=function(e){return m(e)},n.certificateToAsn1=function(e){var t=e.tbsCertificate||n.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.signature)])},n.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var a=0;a<e.length;++a)r.value.push(n.certificateExtensionToAsn1(e[a]));return t},n.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},n.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||n.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.signature)])},n.createCaStore=function(e){var t={certs:{}};function r(e){return s(e),t.certs[e.hash]||null}function s(e){if(!e.hash){var t=a.md.sha1.create();e.attributes=n.RDNAttributesAsArray(m(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=a.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];a.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=a.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;a.util.isArray(t)||(t=[t]);for(var s=i.toDer(n.certificateToAsn1(e)).getBytes(),o=0;o<t.length;++o)if(s===i.toDer(n.certificateToAsn1(t[o])).getBytes())return!0;return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(a.util.isArray(i))for(var n=0;n<i.length;++n)e.push(i[n]);else e.push(i)}return e},t.removeCertificate=function(e){if("string"==typeof e&&(e=a.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))return null;var o,c=r(e.subject);if(!a.util.isArray(c))return o=t.certs[e.subject.hash],delete t.certs[e.subject.hash],o;for(var u=i.toDer(n.certificateToAsn1(e)).getBytes(),l=0;l<c.length;++l)u===i.toDer(n.certificateToAsn1(c[l])).getBytes()&&(o=c[l],c.splice(l,1));return 0===c.length&&delete t.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var c=e[o];t.addCertificate(c)}return t},n.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},n.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),s=r.validityCheckDate;void 0===s&&(s=new Date);var o=!0,c=null,u=0;do{var l=t.shift(),f=null,p=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:n.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(p=!0,f=l),f){var h=f;a.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){f=h.shift();try{d=f.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:n.certificateError.bad_certificate})}null!==c||f&&!p||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:n.certificateError.unknown_ca})}if(null===c&&f&&!l.isIssuer(f)&&(c={message:"Certificate issuer is invalid.",error:n.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&g<l.extensions.length;++g){var m=l.extensions[g];!m.critical||m.name in y||(c={message:"Certificate has an unsupported critical extension.",error:n.certificateError.unsupported_certificate})}if(null===c&&(!o||0===t.length&&(!f||p))){var v=l.getExtension("basicConstraints"),C=l.getExtension("keyUsage");null===C||C.keyCertSign&&null!==v||(c={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:n.certificateError.bad_certificate}),null===c&&null===v&&(c={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:n.certificateError.bad_certificate}),null!==c||null===v||v.cA||(c={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:n.certificateError.bad_certificate}),null===c&&null!==C&&"pathLenConstraint"in v&&u-1>v.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:n.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,i):E;if(!0===S)c=null;else throw!0===E&&(c={message:"The application rejected the certificate.",error:n.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||a.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;o=!1,++u}while(t.length>0)return!0}},76915,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(82140),e.r(31808),e.r(93197),e.r(38720),e.r(2828),e.r(32721),e.r(1500),e.r(26706),e.r(9166);var i=a.asn1,n=a.pki,s=t.exports=a.pkcs12=a.pkcs12||{},o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},c={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},u={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function p(e,t,r,a){for(var i=[],n=0;n<e.length;n++)for(var s=0;s<e[n].safeBags.length;s++){var o=e[n].safeBags[s];if(void 0===a||o.type===a){if(null===t){i.push(o);continue}void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&i.push(o)}}return i}function h(e){if(e.composed||e.constructed){for(var t=a.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}s.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var d={};if(!i.validate(e,c,d,[])){var y=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw y.errors=y,y}var g={version:d.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=a.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=p(g.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=p(g.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=p(g.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return p(g.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return p(g.safeContents,"localKeyId",e,t)}};if(3!==d.version.charCodeAt(0)){var y=Error("PKCS#12 PFX of version other than 3 not supported.");throw y.version=d.version.charCodeAt(0),y}if(i.derToOid(d.contentType)!==n.oids.data){var y=Error("Only PKCS#12 PFX in password integrity mode supported.");throw y.oid=i.derToOid(d.contentType),y}var m=d.content.value[0];if(m.tagClass!==i.Class.UNIVERSAL||m.type!==i.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(m=h(m),d.mac){var v=null,C=0,E=i.derToOid(d.macAlgorithm);switch(E){case n.oids.sha1:v=a.md.sha1.create(),C=20;break;case n.oids.sha256:v=a.md.sha256.create(),C=32;break;case n.oids.sha384:v=a.md.sha384.create(),C=48;break;case n.oids.sha512:v=a.md.sha512.create(),C=64;break;case n.oids.md5:v=a.md.md5.create(),C=16}if(null===v)throw Error("PKCS#12 uses unsupported MAC algorithm: "+E);var S=new a.util.ByteBuffer(d.macSalt),T="macIterations"in d?parseInt(a.util.bytesToHex(d.macIterations),16):1,I=s.generateKey(r,S,3,T,C,v),b=a.hmac.create();if(b.start(v,I),b.update(m.value),b.getMac().getBytes()!==d.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not validated.");return function(e,t,r,s){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var c=0;c<t.value.length;c++){var p=t.value[c],d={},y=[];if(!i.validate(p,o,d,y)){var g=Error("Cannot read ContentInfo.");throw g.errors=y,g}var m={encrypted:!1},v=null,C=d.content.value[0];switch(i.derToOid(d.contentType)){case n.oids.data:if(C.tagClass!==i.Class.UNIVERSAL||C.type!==i.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");v=h(C).value;break;case n.oids.encryptedData:v=function(e,t){var r={},s=[];if(!i.validate(e,a.pkcs7.asn1.encryptedDataValidator,r,s)){var o=Error("Cannot read EncryptedContentInfo.");throw o.errors=s,o}var c=i.derToOid(r.contentType);if(c!==n.oids.data){var o=Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw o.oid=c,o}c=i.derToOid(r.encAlgorithm);var u=n.pbe.getCipher(c,r.encParameter,t),l=h(r.encryptedContentAsn1),f=a.util.createBuffer(l.value);if(u.update(f),!u.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");return u.output.getBytes()}(C,s),m.encrypted=!0;break;default:var g=Error("Unsupported PKCS#12 contentType.");throw g.contentType=i.derToOid(d.contentType),g}m.safeBags=function(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],s=0;s<e.value.length;s++){var o,c,p=e.value[s],h={},d=[];if(!i.validate(p,u,h,d)){var y=Error("Cannot read SafeBag.");throw y.errors=d,y}var g={type:i.derToOid(h.bagId),attributes:function(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var a={},s=[];if(!i.validate(e[r],l,a,s)){var o=Error("Cannot read PKCS#12 BagAttribute.");throw o.errors=s,o}var c=i.derToOid(a.oid);if(void 0!==n.oids[c]){t[n.oids[c]]=[];for(var u=0;u<a.values.length;++u)t[n.oids[c]].push(a.values[u].value)}}return t}(h.bagAttributes)};a.push(g);var m=h.bagValue.value[0];switch(g.type){case n.oids.pkcs8ShroudedKeyBag:if(null===(m=n.decryptPrivateKeyInfo(m,r)))throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case n.oids.keyBag:try{g.key=n.privateKeyFromAsn1(m)}catch(e){g.key=null,g.asn1=m}continue;case n.oids.certBag:o=f,c=function(){if(i.derToOid(h.certId)!==n.oids.x509Certificate){var e=Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(h.certId),e}var r=i.fromDer(h.cert,t);try{g.cert=n.certificateFromAsn1(r,!0)}catch(e){g.cert=null,g.asn1=r}};break;default:var y=Error("Unsupported PKCS#12 SafeBag type.");throw y.oid=g.type,y}if(void 0!==o&&!i.validate(m,o,h,d)){var y=Error("Cannot read PKCS#12 "+o.name);throw y.errors=d,y}c()}return a}(v,r,s),e.safeContents.push(m)}}(g,m.value,t,r),g},s.toPkcs12Asn1=function(e,t,r,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var c,u,l=o.localKeyId;if(null!==l)l=a.util.hexToBytes(l);else if(o.generateLocalKeyId)if(t){var f=a.util.isArray(t)?t[0]:t;"string"==typeof f&&(f=n.certificateFromPem(f));var p=a.md.sha1.create();p.update(i.toDer(n.certificateToAsn1(f)).getBytes()),l=p.digest().getBytes()}else l=a.random.getBytes(20);var h=[];null!==l&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,l)])])),"friendlyName"in o&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,o.friendlyName)])])),h.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,h));var d=[],y=[];null!==t&&(y=a.util.isArray(t)?t:[t]);for(var g=[],m=0;m<y.length;++m){"string"==typeof(t=y[m])&&(t=n.certificateFromPem(t));var v=0===m?c:void 0,C=n.certificateToAsn1(t),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])])]),v]);g.push(E)}if(g.length>0){var S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,g),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(S).getBytes())])]);d.push(T)}var I=null;if(null!==e){var b=n.wrapRsaPrivateKey(n.privateKeyToAsn1(e));I=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[b]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[n.encryptPrivateKeyInfo(b,r,o)]),c]);var A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[I]),B=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(A).getBytes())])]);d.push(B)}var x=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d);if(o.useMac){var p=a.md.sha1.create(),N=new a.util.ByteBuffer(a.random.getBytes(o.saltSize)),R=o.count,e=s.generateKey(r,N,3,R,20),k=a.hmac.create();k.start(p,e),k.update(i.toDer(x).getBytes());var _=k.getMac();u=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,N.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(R).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(x).getBytes())])]),u])},s.generateKey=a.pbe.generatePkcs12Key},68256,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(31808),e.r(38720),e.r(93139),e.r(80399),e.r(76915),e.r(15992),e.r(32721),e.r(26706),e.r(9166);var i=a.asn1,n=t.exports=a.pki=a.pki||{};n.pemToDer=function(e){var t=a.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert PEM to DER; PEM is encrypted.");return a.util.createBuffer(t.body)},n.privateKeyFromPem=function(e){var t=a.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert private key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return n.privateKeyFromAsn1(s)},n.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(n.privateKeyToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return a.pem.encode(r,{maxline:t})}},45771,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(82140),e.r(99073),e.r(93139),e.r(68256),e.r(2828),e.r(1500),e.r(26706);var i=function(e,t,r,i){var n=a.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=a.util.createBuffer(),f=a.hmac.create();r=t+r;var p=Math.ceil(i/16),h=Math.ceil(i/20);f.start("MD5",c);var d=a.util.createBuffer();l.putBytes(r);for(var y=0;y<p;++y)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),d.putBuffer(f.digest());f.start("SHA1",u);var g=a.util.createBuffer();l.clear(),l.putBytes(r);for(var y=0;y<h;++y)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),g.putBuffer(f.digest());return n.putBytes(a.util.xorBytes(d.getBytes(),g.getBytes(),i)),n},n=function(e,t,r){var i=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=a.util.createBuffer(n),t.length=n.length,i=!0}catch(e){}return i},s=function(e,t,r){var i=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=a.util.createBuffer(n),t.length=n.length,i=!0}catch(e){}return i},o=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return a.util.createBuffer(e.getBytes(r))},c=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},u={};u.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},u.SupportedVersions=[u.Versions.TLS_1_1,u.Versions.TLS_1_0],u.Version=u.SupportedVersions[0],u.MaxFragment=15360,u.ConnectionEnd={server:0,client:1},u.PRFAlgorithm={tls_prf_sha256:0},u.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},u.CipherType={stream:0,block:1,aead:2},u.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},u.CompressionMethod={none:0,deflate:1},u.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},u.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},u.Alert={},u.Alert.Level={warning:1,fatal:2},u.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},u.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},u.CipherSuites={},u.getCipherSuite=function(e){var t=null;for(var r in u.CipherSuites){var a=u.CipherSuites[r];if(a.id[0]===e.charCodeAt(0)&&a.id[1]===e.charCodeAt(1)){t=a;break}}return t},u.handleUnexpected=function(e,t){(e.open||e.entity!==u.ConnectionEnd.client)&&e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})},u.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var i=null,n=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(i={version:{major:s.getByte(),minor:s.getByte()},random:a.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},n?(i.cipher_suite=s.getBytes(2),i.compression_method=s.getByte()):(i.cipher_suites=o(s,2),i.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!n)for(var f=0;f<i.extensions.length;++f){var p=i.extensions[f];if(0===p.type[0]&&0===p.type[1])for(var h=o(p.data,2);h.length()>0&&0===h.getByte();)e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=u.getCipherSuite(i.cipher_suite);else for(var d=a.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(i.cipher_suite)});n?e.session.compressionMethod=i.compression_method:e.session.compressionMethod=u.CompressionMethod.none}return i},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,a=t.random.bytes(),i=r?e.session.sp.client_random:a,n=r?a:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:n}},u.handleServerHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(a.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=a.version.minor,e.session.version=e.version;var i=a.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=a.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,a)),e.session.id=i,e.process()}},u.handleClientHello=function(e,t,r){var i,n=u.parseHelloMessage(e,t,r);if(!e.fail){var s=n.session_id.bytes(),o=null;if(e.sessionCache&&(null===(o=e.sessionCache.getSession(s))?s="":(o.version.major!==n.version.major||o.version.minor>n.version.minor)&&(o=null,s="")),0===s.length&&(s=a.random.getBytes(32)),e.session.id=s,e.session.clientHelloVersion=n.version,e.session.sp={},o)e.version=e.session.version=o.version,e.session.sp=o.sp;else{for(var c=1;c<u.SupportedVersions.length&&!((i=u.SupportedVersions[c]).minor<=n.version.minor);++c);e.version={major:i.major,minor:i.minor},e.session.version=e.version}null!==o?(e.expect=S,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?v:C,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.open=!0,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHello(e)})),e.session.resuming?(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))):(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)})),e.fail||(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerKeyExchange(e)})),!1!==e.verifyClient&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateRequest(e)})),u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHelloDone(e)})))),u.flush(e),e.process()}},u.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i,n,s={certificate_list:o(t.fragment,3)},c=[];try{for(;s.certificate_list.length()>0;)i=o(s.certificate_list,3),n=a.asn1.fromDer(i),i=a.pki.certificateFromAsn1(n,!0),c.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var l=e.entity===u.ConnectionEnd.client;(l||!0===e.verifyClient)&&0===c.length?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}):0===c.length?e.expect=l?f:C:(l?e.session.serverCertificate=c[0]:e.session.clientCertificate=c[0],u.verifyCertificateChain(e,c)&&(e.expect=l?f:C)),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var i={enc_pre_master_secret:o(t.fragment,2).getBytes()},n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.serverCertificate),n=a.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===n)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=n.decrypt(i.enc_pre_master_secret);var c=e.session.clientHelloVersion;if(c.major!==s.pre_master_secret.charCodeAt(0)||c.minor!==s.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.")}catch(e){s.pre_master_secret=a.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment,i={certificate_types:o(a,1),certificate_authorities:o(a,2)};e.session.certificateRequest=i,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var n=i.bytes();i.read+=4;var s={signature:o(i,2).getBytes()},c=a.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},n=e.verify(e,i.alert.description,0,[]);if(!0!==n)return(n||0===n)&&("object"!=typeof n||a.util.isArray(n)?"number"==typeof n&&(i.alert.description=n):(n.message&&(i.message=n.message),n.alert&&(i.alert.description=n.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=m;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var s=n.bytes();n.read+=4;var o=t.fragment.getBytes();(n=a.util.createBuffer()).putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client;if((n=i(e.session.sp.master_secret,c?"server finished":"client finished",n.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:I,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,a=t.fragment,i={level:a.getByte(),description:a.getByte()};switch(i.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:i}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),n=r.getInt24();if(n>r.length())return e.fragmented=t,t.fragment=a.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(n+4);r.read+=4,i in O[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),i!==u.HandshakeType.hello_request&&i!==u.HandshakeType.certificate_verify&&i!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),O[e.entity][e.expect][i](e,t,n)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),n=r.getInt16(),s=r.getBytes(n);if(i===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(i===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,a.util.createBuffer(s))}e.process()};var l=1,f=2,p=3,h=4,d=5,y=6,g=7,m=8,v=1,C=2,E=3,S=4,T=5,I=6,b=u.handleUnexpected,A=u.handleChangeCipherSpec,B=u.handleAlert,x=u.handleHandshake,N=u.handleApplicationData,R=u.handleHeartbeat,k=[];k[u.ConnectionEnd.client]=[[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[A,B,b,b,R],[b,B,x,b,R],[b,B,x,N,R],[b,B,x,b,R]],k[u.ConnectionEnd.server]=[[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[A,B,b,b,R],[b,B,x,b,R],[b,B,x,N,R],[b,B,x,b,R]];var _=u.handleHelloRequest,L=u.handleServerHello,w=u.handleCertificate,U=u.handleServerKeyExchange,D=u.handleCertificateRequest,P=u.handleServerHelloDone,V=u.handleFinished,O=[];O[u.ConnectionEnd.client]=[[b,b,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,w,U,D,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,U,D,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,D,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,V],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]];var K=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;O[u.ConnectionEnd.server]=[[b,K,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,w,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,M,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,F,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,V],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]],u.generateKeys=function(e,t){var r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=i(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,n=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;n&&(a+=2*t.fixed_iv_length);var s=i(t.master_secret,"key expansion",r,a),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return n&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){0xffffffff===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},a={read:r(),write:r()};if(a.read.update=function(e,t){return a.read.cipherFunction(t,a.read)?a.read.compressFunction(e,t,a.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},a.write.update=function(e,t){return a.write.compressFunction(e,t,a.write)?a.write.cipherFunction(t,a.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=u.generateKeys(e,i),a.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,a.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(a,e,i),i.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:a.read.compressFunction=s,a.write.compressFunction=n;break;default:throw Error("Unsupported compression algorithm.")}}return a},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=a.util.createBuffer();return r.putInt32(t),r.putBytes(a.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=a.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=a.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var n=t.length(),s=a.util.createBuffer();s.putByte(u.CompressionMethod.none);var o=s.length(),l=a.util.createBuffer();if(e.virtualHost){var f=a.util.createBuffer();f.putByte(0),f.putByte(0);var p=a.util.createBuffer();p.putByte(0),c(p,2,a.util.createBuffer(e.virtualHost));var h=a.util.createBuffer();c(h,2,p),c(f,2,h),l.putBuffer(f)}var d=l.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+n+1+o+d,m=a.util.createBuffer();return m.putByte(u.HandshakeType.client_hello),m.putInt24(g),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),c(m,1,a.util.createBuffer(y)),c(m,2,t),c(m,1,s),d>0&&c(m,2,l),m},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=a.util.createBuffer();return i.putByte(u.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,a.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var n=a.util.createBuffer();if(null!==i)try{a.util.isArray(i)||(i=[i]);for(var s=null,o=0;o<i.length;++o){var l=a.pem.decode(i[o])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var f=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw f.headerType=l.type,f}if(l.procType&&"ENCRYPTED"===l.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var p=a.util.createBuffer(l.body);null===s&&(s=a.asn1.fromDer(p.bytes(),!1));var h=a.util.createBuffer();c(h,3,p),n.putBuffer(h)}i=a.pki.certificateFromAsn1(s),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var d=3+n.length(),y=a.util.createBuffer();return y.putByte(u.HandshakeType.certificate),y.putInt24(d),c(y,3,n),y},u.createClientKeyExchange=function(e){var t=a.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(a.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,n=a.util.createBuffer();return n.putByte(u.HandshakeType.client_key_exchange),n.putInt24(i),n.putInt16(t.length),n.putBytes(t),n},u.createServerKeyExchange=function(e){return a.util.createBuffer()},u.getClientSignature=function(e,t){var r=a.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=a.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},u.createCertificateVerify=function(e,t){var r=t.length+2,i=a.util.createBuffer();return i.putByte(u.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},u.createCertificateRequest=function(e){var t=a.util.createBuffer();t.putByte(1);var r=a.util.createBuffer();for(var i in e.caStore.certs){var n=e.caStore.certs[i],s=a.pki.distinguishedNameToAsn1(n.subject),o=a.asn1.toDer(s);r.putInt16(o.length()),r.putBuffer(o)}var l=1+t.length()+2+r.length(),f=a.util.createBuffer();return f.putByte(u.HandshakeType.certificate_request),f.putInt24(l),c(f,1,t),c(f,2,r),f},u.createServerHelloDone=function(e){var t=a.util.createBuffer();return t.putByte(u.HandshakeType.server_hello_done),t.putInt24(0),t},u.createChangeCipherSpec=function(){var e=a.util.createBuffer();return e.putByte(1),e},u.createFinished=function(e){var t=a.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===u.ConnectionEnd.client;t=i(e.session.sp.master_secret,r?"client finished":"server finished",t.getBytes(),12);var n=a.util.createBuffer();return n.putByte(u.HandshakeType.finished),n.putInt24(t.length()),n.putBuffer(t),n},u.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=a.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var n=Math.max(16,i.length()-r-3);return i.putBytes(a.random.getBytes(n)),i},u.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==u.ContentType.handshake&&t.type!==u.ContentType.alert&&t.type!==u.ContentType.change_cipher_spec)){if(t.type===u.ContentType.handshake){var r,i=t.fragment.bytes();e.session.md5.update(i),e.session.sha1.update(i),i=null}if(t.fragment.length()<=u.MaxFragment)r=[t];else{r=[];for(var n=t.fragment.bytes();n.length>u.MaxFragment;)r.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(n.slice(0,u.MaxFragment))})),n=n.slice(u.MaxFragment);n.length>0&&r.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(n)}))}for(var s=0;s<r.length&&!e.fail;++s){var o=r[s];e.state.current.write.update(e,o)&&e.records.push(o)}}},u.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var j=function(e){switch(e){case!0:return!0;case a.pki.certificateError.bad_certificate:return u.Alert.Description.bad_certificate;case a.pki.certificateError.unsupported_certificate:return u.Alert.Description.unsupported_certificate;case a.pki.certificateError.certificate_revoked:return u.Alert.Description.certificate_revoked;case a.pki.certificateError.certificate_expired:return u.Alert.Description.certificate_expired;case a.pki.certificateError.certificate_unknown:return u.Alert.Description.certificate_unknown;case a.pki.certificateError.unknown_ca:return u.Alert.Description.unknown_ca;default:return u.Alert.Description.bad_certificate}},H=function(e){switch(e){case!0:return!0;case u.Alert.Description.bad_certificate:return a.pki.certificateError.bad_certificate;case u.Alert.Description.unsupported_certificate:return a.pki.certificateError.unsupported_certificate;case u.Alert.Description.certificate_revoked:return a.pki.certificateError.certificate_revoked;case u.Alert.Description.certificate_expired:return a.pki.certificateError.certificate_expired;case u.Alert.Description.certificate_unknown:return a.pki.certificateError.certificate_unknown;case u.Alert.Description.unknown_ca:return a.pki.certificateError.unknown_ca;default:return a.pki.certificateError.bad_certificate}};for(var G in u.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){j(t);var n=e.verify(e,t,r,i);if(!0!==n){if("object"==typeof n&&!a.util.isArray(n)){var s=Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate},n.message&&(s.message=n.message),n.alert&&(s.alert.description=n.alert),s}n!==t&&(n=H(n))}return n},a.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var n=t;("object"!=typeof n||a.util.isArray(n))&&(n={send:!0,alert:{level:u.Alert.Level.fatal,description:j(t)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:u.Alert.Level.fatal,description:j(n.error)}),e.error(e,n)}return!e.fail},u.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=a.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache){for(var n in t=r.cache[i],delete r.cache[i],r.order)if(r.order[n]===i){r.order.splice(n,1);break}}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=a.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?a.util.isArray(e.caStore)?a.pki.createCaStore(e.caStore):e.caStore:a.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],u.CipherSuites)r.push(u.CipherSuites[i]);var n=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,a){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var a=!1!==r.fatal;a&&(t.fail=!0),e.error(t,r),a&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};o.reset=function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.entity,u.ConnectionEnd.client,o.expect=0,o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)},o.reset();var c=function(e,t){var r=t.type-u.ContentType.change_cipher_spec,a=k[e.entity][e.expect];r in a?a[r](e,t):u.handleUnexpected(e,t)},l=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:a.util.createBuffer(),ready:!1};var n=e.record.version.major===e.version.major;n&&e.session&&e.session.version&&(n=e.record.version.minor===e.version.minor),n||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t},f=function(e){var t=0,r=e.input,a=r.length();return a<e.record.length?t=e.record.length-a:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})),e.record.ready=!0)),t};return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=l(o)),o.fail||null===o.record||o.record.ready||(t=f(o)),!o.fail&&null!==o.record&&o.record.ready&&c(o,o.record)),t},o.prepare=function(e){return u.queue(o,u.createRecord(o,{type:u.ContentType.application_data,data:a.util.createBuffer(e)})),u.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof a.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,u.queue(o,u.createRecord(o,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_request,e,t)})),u.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,u.queue(o,u.createAlert(o,{level:u.Alert.Level.warning,description:u.Alert.Description.close_notify})),u.flush(o)),o.closed(o)),o.reset(e)},o},t.exports=a.tls=a.tls||{},u)"function"!=typeof u[G]&&(a.tls[G]=u[G]);a.tls.prf_tls1=i,a.tls.hmac_sha1=function(e,t,r){var i=a.hmac.create();i.start("SHA1",e);var n=a.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(r.type),n.putByte(r.version.major),n.putByte(r.version.minor),n.putInt16(r.length),n.putBytes(r.fragment.bytes()),i.update(n.getBytes()),i.digest().getBytes()},a.tls.createSessionCache=u.createSessionCache,a.tls.createConnection=u.createConnection},59060,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(45771);var i=t.exports=a.tls;function n(e,t,r){var n=t.entity===a.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:a.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:a.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=s,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function s(e,t){var r,n=!1,s=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(s),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:a.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),n=!0),n}function o(e,t,r){if(!r){var a=e-t.length()%e;t.fillWithByte(a-1,a)}return!0}function c(e,t,r){var a=!0;if(r){for(var i=t.length(),n=t.last(),s=i-1-n;s<i-1;++s)a=a&&t.at(s)==n;a&&t.truncate(n+1)}return a}function u(e,t){var r,n,s,o,u,l=!1;u=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var f=t.cipherState.cipher;f.start({iv:u}),f.update(e.fragment),l=f.finish(c);var p=t.macLength,h=a.random.getBytesSync(p),d=f.output.length();d>=p?(e.fragment=f.output.getBytes(d-p),h=f.output.getBytes(p)):e.fragment=f.output.getBytes(),e.fragment=a.util.createBuffer(e.fragment),e.length=e.fragment.length();var y=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),l=(r=t.macKey,n=h,s=y,(o=a.hmac.create()).start("SHA1",r),o.update(n),n=o.digest().getBytes(),o.start(null,null),o.update(s),n===(s=o.digest().getBytes())&&l)}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n}},9675,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.sha512=a.sha512||{};a.md.sha512=a.md.algorithms.sha512=i;var n=a.sha384=a.sha512.sha384=a.sha512.sha384||{};n.create=function(){return i.create("SHA-384")},a.md.sha384=a.md.algorithms.sha384=n,a.sha512.sha256=a.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256,a.sha512.sha224=a.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224,i.create=function(e){if(o||(s=String.fromCharCode(128)+a.util.fillString("\0",128),c=[[0x428a2f98,0xd728ae22],[0x71374491,0x23ef65cd],[0xb5c0fbcf,0xec4d3b2f],[0xe9b5dba5,0x8189dbbc],[0x3956c25b,0xf348b538],[0x59f111f1,0xb605d019],[0x923f82a4,0xaf194f9b],[0xab1c5ed5,0xda6d8118],[0xd807aa98,0xa3030242],[0x12835b01,0x45706fbe],[0x243185be,0x4ee4b28c],[0x550c7dc3,0xd5ffb4e2],[0x72be5d74,0xf27b896f],[0x80deb1fe,0x3b1696b1],[0x9bdc06a7,0x25c71235],[0xc19bf174,0xcf692694],[0xe49b69c1,0x9ef14ad2],[0xefbe4786,0x384f25e3],[0xfc19dc6,0x8b8cd5b5],[0x240ca1cc,0x77ac9c65],[0x2de92c6f,0x592b0275],[0x4a7484aa,0x6ea6e483],[0x5cb0a9dc,0xbd41fbd4],[0x76f988da,0x831153b5],[0x983e5152,0xee66dfab],[0xa831c66d,0x2db43210],[0xb00327c8,0x98fb213f],[0xbf597fc7,0xbeef0ee4],[0xc6e00bf3,0x3da88fc2],[0xd5a79147,0x930aa725],[0x6ca6351,0xe003826f],[0x14292967,0xa0e6e70],[0x27b70a85,0x46d22ffc],[0x2e1b2138,0x5c26c926],[0x4d2c6dfc,0x5ac42aed],[0x53380d13,0x9d95b3df],[0x650a7354,0x8baf63de],[0x766a0abb,0x3c77b2a8],[0x81c2c92e,0x47edaee6],[0x92722c85,0x1482353b],[0xa2bfe8a1,0x4cf10364],[0xa81a664b,0xbc423001],[0xc24b8b70,0xd0f89791],[0xc76c51a3,0x654be30],[0xd192e819,0xd6ef5218],[0xd6990624,0x5565a910],[0xf40e3585,0x5771202a],[0x106aa070,0x32bbd1b8],[0x19a4c116,0xb8d2d0c8],[0x1e376c08,0x5141ab53],[0x2748774c,0xdf8eeb99],[0x34b0bcb5,0xe19b48a8],[0x391c0cb3,0xc5c95a63],[0x4ed8aa4a,0xe3418acb],[0x5b9cca4f,0x7763e373],[0x682e6ff3,0xd6b2b8a3],[0x748f82ee,0x5defb2fc],[0x78a5636f,0x43172f60],[0x84c87814,0xa1f0ab72],[0x8cc70208,0x1a6439ec],[0x90befffa,0x23631e28],[0xa4506ceb,0xde82bde9],[0xbef9a3f7,0xb2c67915],[0xc67178f2,0xe372532b],[0xca273ece,0xea26619c],[0xd186b8c7,0x21c0c207],[0xeada7dd6,0xcde0eb1e],[0xf57d4f7f,0xee6ed178],[0x6f067aa,0x72176fba],[0xa637dc5,0xa2c898a6],[0x113f9804,0xbef90dae],[0x1b710b35,0x131c471b],[0x28db77f5,0x23047d84],[0x32caab7b,0x40c72493],[0x3c9ebe0a,0x15c9bebc],[0x431d67c4,0x9c100d4c],[0x4cc5d4be,0xcb3e42b6],[0x597f299c,0xfc657e2a],[0x5fcb6fab,0x3ad6faec],[0x6c44198c,0x4a475817]],(u={})["SHA-512"]=[[0x6a09e667,0xf3bcc908],[0xbb67ae85,0x84caa73b],[0x3c6ef372,0xfe94f82b],[0xa54ff53a,0x5f1d36f1],[0x510e527f,0xade682d1],[0x9b05688c,0x2b3e6c1f],[0x1f83d9ab,0xfb41bd6b],[0x5be0cd19,0x137e2179]],u["SHA-384"]=[[0xcbbb9d5d,0xc1059ed8],[0x629a292a,0x367cd507],[0x9159015a,0x3070dd17],[0x152fecd8,0xf70e5939],[0x67332667,0xffc00b31],[0x8eb44a87,0x68581511],[0xdb0c2e0d,0x64f98fa7],[0x47b5481d,0xbefa4fa4]],u["SHA-512/256"]=[[0x22312194,0xfc2bf72c],[0x9f555fa3,0xc84c64c2],[0x2393b86b,0x6f53b151],[0x96387719,0x5940eabd],[0x96283ee2,0xa88effe3],[0xbe5e1e25,0x53863992],[0x2b0199fc,0x2c85b8aa],[0xeb72ddc,0x81c52ca2]],u["SHA-512/224"]=[[0x8c3d37c8,0x19544da2],[0x73e19966,0x89dcd4d6],[0x1dfab7ae,0x32ff9c82],[0x679dd514,0x582f9fcf],[0xf6d2b69,0x7bd44da8],[0x77e36f73,0x4c48942],[0x3f9d85a8,0x6a1d36c8],[0x1112e6ad,0x91d692a1]],o=!0),void 0===e&&(e="SHA-512"),!(e in u))throw Error("Invalid SHA-512 algorithm: "+e);for(var t=u[e],r=null,i=a.util.createBuffer(),n=Array(80),f=0;f<80;++f)n[f]=[,,];var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var h={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16};return h.start=function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,n=0;n<e;++n)h.fullMessageLength.push(0);i=a.util.createBuffer(),r=Array(t.length);for(var n=0;n<t.length;++n)r[n]=t[n].slice(0);return h},h.start(),h.update=function(e,t){"utf8"===t&&(e=a.util.encodeUtf8(e));var s=e.length;h.messageLength+=s,s=[s/0x100000000>>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/0x100000000>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/0x100000000>>>0;return i.putBytes(e),l(r,n,i),(i.read>2048||0===i.length())&&i.compact(),h},h.digest=function(){var t,o,c=a.util.createBuffer();c.putBytes(i.bytes());var u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;c.putBytes(s.substr(0,h.blockLength-u));for(var f=8*h.fullMessageLength[0],p=0;p<h.fullMessageLength.length-1;++p)f+=(t=8*h.fullMessageLength[p+1])/0x100000000>>>0,c.putInt32(f>>>0),f=t>>>0;c.putInt32(f);for(var d=Array(r.length),p=0;p<r.length;++p)d[p]=r[p].slice(0);l(d,n,c);var y=a.util.createBuffer();o="SHA-512"===e?d.length:"SHA-384"===e?d.length-2:d.length-4;for(var p=0;p<o;++p)y.putInt32(d[p][0]),(p!==o-1||"SHA-512/224"!==e)&&y.putInt32(d[p][1]);return y},h};var s=null,o=!1,c=null,u=null;function l(e,t,r){for(var a,i,n,s,o,u,l,f,p,h,d,y,g,m,v,C,E,S,T,I,b,A,B,x,N,R,k,_,L,w,U,D,P,V,O,K=r.length();K>=128;){for(L=0;L<16;++L)t[L][0]=r.getInt32()>>>0,t[L][1]=r.getInt32()>>>0;for(;L<80;++L)a=(((w=(D=t[L-2])[0])>>>19|(U=D[1])<<13)^(U>>>29|w<<3)^w>>>6)>>>0,i=((w<<13|U>>>19)^(U<<3|w>>>29)^(w<<26|U>>>6))>>>0,n=(((w=(V=t[L-15])[0])>>>1|(U=V[1])<<31)^(w>>>8|U<<24)^w>>>7)>>>0,s=((w<<31|U>>>1)^(w<<24|U>>>8)^(w<<25|U>>>7))>>>0,P=t[L-7],O=t[L-16],U=i+P[1]+s+O[1],t[L][0]=a+P[0]+n+O[0]+(U/0x100000000>>>0)>>>0,t[L][1]=U>>>0;for(L=0,g=e[0][0],m=e[0][1],v=e[1][0],C=e[1][1],E=e[2][0],S=e[2][1],T=e[3][0],I=e[3][1],b=e[4][0],A=e[4][1],B=e[5][0],x=e[5][1],N=e[6][0],R=e[6][1],k=e[7][0],_=e[7][1];L<80;++L)l=((b>>>14|A<<18)^(b>>>18|A<<14)^(A>>>9|b<<23))>>>0,f=((b<<18|A>>>14)^(b<<14|A>>>18)^(A<<23|b>>>9))>>>0,p=(N^b&(B^N))>>>0,h=(R^A&(x^R))>>>0,o=((g>>>28|m<<4)^(m>>>2|g<<30)^(m>>>7|g<<25))>>>0,u=((g<<4|m>>>28)^(m<<30|g>>>2)^(m<<25|g>>>7))>>>0,d=(g&v|E&(g^v))>>>0,y=(m&C|S&(m^C))>>>0,U=_+f+h+c[L][1]+t[L][1],a=k+l+p+c[L][0]+t[L][0]+(U/0x100000000>>>0)>>>0,i=U>>>0,n=o+d+((U=u+y)/0x100000000>>>0)>>>0,s=U>>>0,k=N,_=R,N=B,R=x,B=b,x=A,b=T+a+((U=I+i)/0x100000000>>>0)>>>0,A=U>>>0,T=E,I=S,E=v,S=C,v=g,C=m,g=a+n+((U=i+s)/0x100000000>>>0)>>>0,m=U>>>0;U=e[0][1]+m,e[0][0]=e[0][0]+g+(U/0x100000000>>>0)>>>0,e[0][1]=U>>>0,U=e[1][1]+C,e[1][0]=e[1][0]+v+(U/0x100000000>>>0)>>>0,e[1][1]=U>>>0,U=e[2][1]+S,e[2][0]=e[2][0]+E+(U/0x100000000>>>0)>>>0,e[2][1]=U>>>0,U=e[3][1]+I,e[3][0]=e[3][0]+T+(U/0x100000000>>>0)>>>0,e[3][1]=U>>>0,U=e[4][1]+A,e[4][0]=e[4][0]+b+(U/0x100000000>>>0)>>>0,e[4][1]=U>>>0,U=e[5][1]+x,e[5][0]=e[5][0]+B+(U/0x100000000>>>0)>>>0,e[5][1]=U>>>0,U=e[6][1]+R,e[6][0]=e[6][0]+N+(U/0x100000000>>>0)>>>0,e[6][1]=U>>>0,U=e[7][1]+_,e[7][0]=e[7][0]+k+(U/0x100000000>>>0)>>>0,e[7][1]=U>>>0,K-=128}}},16445,(e,t,r)=>{var a=e.r(2015);e.r(74723);var i=a.asn1;r.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},r.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},99544,(e,t,r)=>{var a=e.r(2015);e.r(68995),e.r(2828),e.r(9675),e.r(26706);var i=e.r(16445),n=i.publicKeyValidator,s=i.privateKeyValidator;if(void 0===o)var o=a.jsbn.BigInteger;var c=a.util.ByteBuffer,u="u"<typeof Buffer?Uint8Array:Buffer;a.pki=a.pki||{},t.exports=a.pki.ed25519=a.ed25519=a.ed25519||{};var l=a.ed25519;function f(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t)if(e.md)t=e.md.digest().getBytes(),r="binary";else throw TypeError('"options.message" or "options.md" not specified.');if("string"==typeof t&&!r)throw TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("u">typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var a=new u(t.length()),i=0;i<a.length;++i)a[i]=t.at(i);return a}l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=a.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw TypeError('"seed" must be '+l.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=f({message:t,encoding:"binary"});for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),i=new u(l.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)i[n]=t[n];return function(e,t){var r,a=[D(),D(),D(),D()],i=E(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,_(a,i),A(e,a),r=0;r<32;++r)t[r+32]=e[r]}(r,i),{publicKey:r,privateKey:i}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!a.asn1.validate(e,s,t,r)){var i=Error("Invalid Key.");throw i.errors=r,i}var n=a.asn1.derToOid(t.privateKeyOid),o=a.oids.EdDSA25519;if(n!==o)throw Error('Invalid OID "'+n+'"; OID must be "'+o+'".');var c=t.privateKey;return{privateKeyBytes:f({message:a.asn1.fromDer(c).value,encoding:"binary"})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!a.asn1.validate(e,n,t,r)){var i=Error("Invalid Key.");throw i.errors=r,i}var s=a.asn1.derToOid(t.publicKeyOid),o=a.oids.EdDSA25519;if(s!==o)throw Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var c=t.ed25519PublicKey;if(c.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw Error("Key length is invalid.");return f({message:c,encoding:"binary"})},l.publicKeyFromPrivateKey=function(e){var t=f({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),a=0;a<r.length;++a)r[a]=t[32+a];return r},l.sign=function(e){var t=f(e=e||{}),r=f({message:e.privateKey,encoding:"binary"});if(r.length===l.constants.SEED_BYTE_LENGTH)r=l.generateKeyPair({seed:r}).privateKey;else if(r.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+l.constants.SEED_BYTE_LENGTH+" or "+l.constants.PRIVATE_KEY_BYTE_LENGTH);var a=new u(l.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,a){var i,n,s=new Float64Array(64),o=[D(),D(),D(),D()],c=E(a,32);for(c[0]&=248,c[31]&=127,c[31]|=64,i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=E(e.subarray(32),r+32);for(T(u),_(o,u),A(e,o),i=32;i<64;++i)e[i]=a[i];var l=E(e,r+64);for(T(l),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=u[i];for(i=0;i<32;++i)for(n=0;n<32;n++)s[i+n]+=l[i]*c[n];S(e.subarray(32),s)}(a,t,t.length,r);for(var i=new u(l.constants.SIGN_BYTE_LENGTH),n=0;n<i.length;++n)i[n]=a[n];return i},l.verify=function(e){var t,r=f(e=e||{});if(void 0===e.signature)throw TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=f({message:e.signature,encoding:"binary"});if(a.length!==l.constants.SIGN_BYTE_LENGTH)throw TypeError('"options.signature" must have a byte length of '+l.constants.SIGN_BYTE_LENGTH);var i=f({message:e.publicKey,encoding:"binary"});if(i.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw TypeError('"options.publicKey" must have a byte length of '+l.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new u(l.constants.SIGN_BYTE_LENGTH+r.length),s=new u(l.constants.SIGN_BYTE_LENGTH+r.length);for(t=0;t<l.constants.SIGN_BYTE_LENGTH;++t)n[t]=a[t];for(t=0;t<r.length;++t)n[t+l.constants.SIGN_BYTE_LENGTH]=r[t];return function(e,t,r,a){var i,n,s,o,c,l,f,y,g,m,S=new u(32),b=[D(),D(),D(),D()],B=[D(),D(),D(),D()];if(r<64||(i=B,n=a,s=D(),o=D(),c=D(),l=D(),f=D(),y=D(),g=D(),(L(i[2],h),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(i[1],n),function(e,t){O(e,t,t)}(c,i[1]),O(l,c,d),V(c,c,i[2]),P(l,i[2],l),function(e,t){O(e,t,t)}(f,l),function(e,t){O(e,t,t)}(y,f),O(g,y,f),O(s,g,c),O(s,s,l),function(e,t){var r,a=D();for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)(function(e,t){O(e,t,t)})(a,a),1!==r&&O(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(s,s),O(s,s,c),O(s,s,l),O(s,s,l),O(i[0],s,l),function(e,t){O(e,t,t)}(o,i[0]),O(o,o,l),x(o,c)&&O(i[0],i[0],C),function(e,t){O(e,t,t)}(o,i[0]),O(o,o,l),x(o,c))?-1:(R(i[0])===n[31]>>7&&V(i[0],p,i[0]),O(i[3],i[0],i[1]),0))||!function(e){var t;for(t=31;t>=0;--t){if(e[32+t]<v[t])return!0;if(e[32+t]>v[t])break}return!1}(t))return -1;for(m=0;m<r;++m)e[m]=t[m];for(m=0;m<32;++m)e[m+32]=a[m];var w=E(e,r);if(T(w),k(b,B,w),_(B,t.subarray(32)),I(b,B),A(S,b),r-=64,function(e,t,r,a){return N(e,t,r,a,32)}(t,0,S,0)){for(m=0;m<r;++m)e[m]=0;return -1}for(m=0;m<r;++m)e[m]=t[m+64];return r}(s,n,n.length,i)>=0};var p=D(),h=D([1]),d=D([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=D([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=D([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=D([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=D([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=a.md.sha512.create(),i=new c(e);r.update(i.getBytes(t),"binary");var n=r.digest().getBytes();if("u">typeof Buffer)return Buffer.from(n,"binary");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=n.charCodeAt(o);return s}function S(e,t){var r,a,i,n;for(a=63;a>=32;--a){for(r=0,i=a-32,n=a-12;i<n;++i)t[i]+=r-16*t[a]*v[i-(a-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[a]=0}for(i=0,r=0;i<32;++i)t[i]+=r-(t[31]>>4)*v[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*v[i];for(a=0;a<32;++a)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function I(e,t){var r=D(),a=D(),i=D(),n=D(),s=D(),o=D(),c=D(),u=D(),l=D();V(r,e[1],e[0]),V(l,t[1],t[0]),O(r,r,l),P(a,e[0],e[1]),P(l,t[0],t[1]),O(a,a,l),O(i,e[3],t[3]),O(i,i,y),O(n,e[2],t[2]),P(n,n,n),V(s,a,r),V(o,n,i),P(c,n,i),P(u,a,r),O(e[0],s,o),O(e[1],u,c),O(e[2],c,o),O(e[3],s,u)}function b(e,t,r){for(var a=0;a<4;++a)U(e[a],t[a],r)}function A(e,t){var r=D(),a=D(),i=D();(function(e,t){var r,a=D();for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)(function(e,t){O(e,t,t)})(a,a),2!==r&&4!==r&&O(a,a,t);for(r=0;r<16;++r)e[r]=a[r]})(i,t[2]),O(r,t[0],i),O(a,t[1],i),B(e,a),e[31]^=R(r)<<7}function B(e,t){var r,a,i,n=D(),s=D();for(r=0;r<16;++r)s[r]=t[r];for(w(s),w(s),w(s),a=0;a<2;++a){for(r=1,n[0]=s[0]-65517;r<15;++r)n[r]=s[r]-65535-(n[r-1]>>16&1),n[r-1]&=65535;n[15]=s[15]-32767-(n[14]>>16&1),i=n[15]>>16&1,n[14]&=65535,U(s,n,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function x(e,t){var r=new u(32),a=new u(32);return B(r,e),B(a,t),N(r,0,a,0,32)}function N(e,t,r,a,i){var n,s=0;for(n=0;n<i;++n)s|=e[t+n]^r[a+n];return(1&s-1>>>8)-1}function R(e){var t=new u(32);return B(t,e),1&t[0]}function k(e,t,r){var a,i;for(L(e[0],p),L(e[1],h),L(e[2],h),L(e[3],p),i=255;i>=0;--i)b(e,t,a=r[i/8|0]>>(7&i)&1),I(t,e),I(e,e),b(e,t,a)}function _(e,t){var r=[D(),D(),D(),D()];L(r[0],g),L(r[1],m),L(r[2],h),O(r[3],g,m),k(e,r,t)}function L(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function w(e){var t,r,a=1;for(t=0;t<16;++t)a=Math.floor((r=e[t]+a+65535)/65536),e[t]=r-65536*a;e[0]+=a-1+37*(a-1)}function U(e,t,r){for(var a,i=~(r-1),n=0;n<16;++n)a=i&(e[n]^t[n]),e[n]^=a,t[n]^=a}function D(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function P(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]+r[a]}function V(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]-r[a]}function O(e,t,r){var a,i,n=0,s=0,o=0,c=0,u=0,l=0,f=0,p=0,h=0,d=0,y=0,g=0,m=0,v=0,C=0,E=0,S=0,T=0,I=0,b=0,A=0,B=0,x=0,N=0,R=0,k=0,_=0,L=0,w=0,U=0,D=0,P=r[0],V=r[1],O=r[2],K=r[3],M=r[4],F=r[5],j=r[6],H=r[7],G=r[8],q=r[9],Q=r[10],z=r[11],$=r[12],Y=r[13],W=r[14],X=r[15];n+=(a=t[0])*P,s+=a*V,o+=a*O,c+=a*K,u+=a*M,l+=a*F,f+=a*j,p+=a*H,h+=a*G,d+=a*q,y+=a*Q,g+=a*z,m+=a*$,v+=a*Y,C+=a*W,E+=a*X,s+=(a=t[1])*P,o+=a*V,c+=a*O,u+=a*K,l+=a*M,f+=a*F,p+=a*j,h+=a*H,d+=a*G,y+=a*q,g+=a*Q,m+=a*z,v+=a*$,C+=a*Y,E+=a*W,S+=a*X,o+=(a=t[2])*P,c+=a*V,u+=a*O,l+=a*K,f+=a*M,p+=a*F,h+=a*j,d+=a*H,y+=a*G,g+=a*q,m+=a*Q,v+=a*z,C+=a*$,E+=a*Y,S+=a*W,T+=a*X,c+=(a=t[3])*P,u+=a*V,l+=a*O,f+=a*K,p+=a*M,h+=a*F,d+=a*j,y+=a*H,g+=a*G,m+=a*q,v+=a*Q,C+=a*z,E+=a*$,S+=a*Y,T+=a*W,I+=a*X,u+=(a=t[4])*P,l+=a*V,f+=a*O,p+=a*K,h+=a*M,d+=a*F,y+=a*j,g+=a*H,m+=a*G,v+=a*q,C+=a*Q,E+=a*z,S+=a*$,T+=a*Y,I+=a*W,b+=a*X,l+=(a=t[5])*P,f+=a*V,p+=a*O,h+=a*K,d+=a*M,y+=a*F,g+=a*j,m+=a*H,v+=a*G,C+=a*q,E+=a*Q,S+=a*z,T+=a*$,I+=a*Y,b+=a*W,A+=a*X,f+=(a=t[6])*P,p+=a*V,h+=a*O,d+=a*K,y+=a*M,g+=a*F,m+=a*j,v+=a*H,C+=a*G,E+=a*q,S+=a*Q,T+=a*z,I+=a*$,b+=a*Y,A+=a*W,B+=a*X,p+=(a=t[7])*P,h+=a*V,d+=a*O,y+=a*K,g+=a*M,m+=a*F,v+=a*j,C+=a*H,E+=a*G,S+=a*q,T+=a*Q,I+=a*z,b+=a*$,A+=a*Y,B+=a*W,x+=a*X,h+=(a=t[8])*P,d+=a*V,y+=a*O,g+=a*K,m+=a*M,v+=a*F,C+=a*j,E+=a*H,S+=a*G,T+=a*q,I+=a*Q,b+=a*z,A+=a*$,B+=a*Y,x+=a*W,N+=a*X,d+=(a=t[9])*P,y+=a*V,g+=a*O,m+=a*K,v+=a*M,C+=a*F,E+=a*j,S+=a*H,T+=a*G,I+=a*q,b+=a*Q,A+=a*z,B+=a*$,x+=a*Y,N+=a*W,R+=a*X,y+=(a=t[10])*P,g+=a*V,m+=a*O,v+=a*K,C+=a*M,E+=a*F,S+=a*j,T+=a*H,I+=a*G,b+=a*q,A+=a*Q,B+=a*z,x+=a*$,N+=a*Y,R+=a*W,k+=a*X,g+=(a=t[11])*P,m+=a*V,v+=a*O,C+=a*K,E+=a*M,S+=a*F,T+=a*j,I+=a*H,b+=a*G,A+=a*q,B+=a*Q,x+=a*z,N+=a*$,R+=a*Y,k+=a*W,_+=a*X,m+=(a=t[12])*P,v+=a*V,C+=a*O,E+=a*K,S+=a*M,T+=a*F,I+=a*j,b+=a*H,A+=a*G,B+=a*q,x+=a*Q,N+=a*z,R+=a*$,k+=a*Y,_+=a*W,L+=a*X,v+=(a=t[13])*P,C+=a*V,E+=a*O,S+=a*K,T+=a*M,I+=a*F,b+=a*j,A+=a*H,B+=a*G,x+=a*q,N+=a*Q,R+=a*z,k+=a*$,_+=a*Y,L+=a*W,w+=a*X,C+=(a=t[14])*P,E+=a*V,S+=a*O,T+=a*K,I+=a*M,b+=a*F,A+=a*j,B+=a*H,x+=a*G,N+=a*q,R+=a*Q,k+=a*z,_+=a*$,L+=a*Y,w+=a*W,U+=a*X,E+=(a=t[15])*P,S+=a*V,T+=a*O,I+=a*K,b+=a*M,A+=a*F,B+=a*j,x+=a*H,N+=a*G,R+=a*q,k+=a*Q,_+=a*z,L+=a*$,w+=a*Y,U+=a*W,D+=a*X,n+=38*S,s+=38*T,o+=38*I,c+=38*b,u+=38*A,l+=38*B,f+=38*x,p+=38*N,h+=38*R,d+=38*k,y+=38*_,g+=38*L,m+=38*w,v+=38*U,C+=38*D,i=Math.floor((a=n+(i=1)+65535)/65536),n=a-65536*i,i=Math.floor((a=s+i+65535)/65536),s=a-65536*i,i=Math.floor((a=o+i+65535)/65536),o=a-65536*i,i=Math.floor((a=c+i+65535)/65536),c=a-65536*i,i=Math.floor((a=u+i+65535)/65536),u=a-65536*i,i=Math.floor((a=l+i+65535)/65536),l=a-65536*i,i=Math.floor((a=f+i+65535)/65536),f=a-65536*i,i=Math.floor((a=p+i+65535)/65536),p=a-65536*i,i=Math.floor((a=h+i+65535)/65536),h=a-65536*i,i=Math.floor((a=d+i+65535)/65536),d=a-65536*i,i=Math.floor((a=y+i+65535)/65536),y=a-65536*i,i=Math.floor((a=g+i+65535)/65536),g=a-65536*i,i=Math.floor((a=m+i+65535)/65536),m=a-65536*i,i=Math.floor((a=v+i+65535)/65536),v=a-65536*i,i=Math.floor((a=C+i+65535)/65536),C=a-65536*i,i=Math.floor((a=E+i+65535)/65536),E=a-65536*i,n+=i-1+37*(i-1),i=Math.floor((a=n+(i=1)+65535)/65536),n=a-65536*i,i=Math.floor((a=s+i+65535)/65536),s=a-65536*i,i=Math.floor((a=o+i+65535)/65536),o=a-65536*i,i=Math.floor((a=c+i+65535)/65536),c=a-65536*i,i=Math.floor((a=u+i+65535)/65536),u=a-65536*i,i=Math.floor((a=l+i+65535)/65536),l=a-65536*i,i=Math.floor((a=f+i+65535)/65536),f=a-65536*i,i=Math.floor((a=p+i+65535)/65536),p=a-65536*i,i=Math.floor((a=h+i+65535)/65536),h=a-65536*i,i=Math.floor((a=d+i+65535)/65536),d=a-65536*i,i=Math.floor((a=y+i+65535)/65536),y=a-65536*i,i=Math.floor((a=g+i+65535)/65536),g=a-65536*i,i=Math.floor((a=m+i+65535)/65536),m=a-65536*i,i=Math.floor((a=v+i+65535)/65536),v=a-65536*i,i=Math.floor((a=C+i+65535)/65536),C=a-65536*i,i=Math.floor((a=E+i+65535)/65536),E=a-65536*i,n+=i-1+37*(i-1),e[0]=n,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=p,e[8]=h,e[9]=d,e[10]=y,e[11]=g,e[12]=m,e[13]=v,e[14]=C,e[15]=E}},7390,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(2828),e.r(68995),t.exports=a.kem=a.kem||{};var i=a.jsbn.BigInteger;function n(e,t,r,i){e.generate=function(e,n){for(var s=new a.util.ByteBuffer,o=Math.ceil(n/i)+r,c=new a.util.ByteBuffer,u=r;u<o;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var l=t.digest();s.putBytes(l.getBytes(i))}return s.truncate(s.length()-n),s.getBytes()}}a.kem.rsa={},a.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||a.random,n={};return n.encrypt=function(t,n){var s,o=Math.ceil(t.n.bitLength()/8);do s=new i(a.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n);while(0>=s.compareTo(i.ONE))var c=o-(s=a.util.hexToBytes(s.toString(16))).length;return c>0&&(s=a.util.fillString("\0",c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,n)}},n.decrypt=function(t,r,a){var i=t.decrypt(r,"NONE");return e.generate(i,a)},n},a.kem.kdf1=function(e,t){n(this,e,0,t||e.digestLength)},a.kem.kdf2=function(e,t){n(this,e,1,t||e.digestLength)}},56773,(e,t,r)=>{var a,i=e.r(2015);e.r(26706),t.exports=i.log=i.log||{},i.log.levels=["none","error","warning","info","debug","verbose","max"];var n={},s=[],o=null;i.log.LEVEL_LOCKED=2,i.log.NO_LEVEL_CHECK=4,i.log.INTERPOLATE=8;for(var c=0;c<i.log.levels.length;++c){var u=i.log.levels[c];n[u]={index:c,name:u.toUpperCase()}}i.log.logMessage=function(e){for(var t=n[e.level].index,r=0;r<s.length;++r){var a=s[r];a.flags&i.log.NO_LEVEL_CHECK?a.f(e):t<=n[a.level].index&&a.f(a,e)}},i.log.prepareStandard=function(e){"standard"in e||(e.standard=n[e.level].name+" ["+e.category+"] "+e.message)},i.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=i.util.format.apply(this,t)}},i.log.prepareStandardFull=function(e){"standardFull"in e||(i.log.prepareStandard(e),e.standardFull=e.standard)};for(var l=["error","warning","info","debug","verbose"],c=0;c<l.length;++c)!function(e){i.log[e]=function(t,r){var a=Array.prototype.slice.call(arguments).slice(2),n={timestamp:new Date,level:e,category:t,message:r,arguments:a};i.log.logMessage(n)}}(l[c]);if(i.log.makeLogger=function(e){var t={flags:0,f:e};return i.log.setLevel(t,"none"),t},i.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&i.log.LEVEL_LOCKED)){for(var a=0;a<i.log.levels.length;++a)if(t==i.log.levels[a]){e.level=t,r=!0;break}}return r},i.log.lock=function(e,t){void 0===t||t?e.flags|=i.log.LEVEL_LOCKED:e.flags&=~i.log.LEVEL_LOCKED},i.log.addLogger=function(e){s.push(e)},"u">typeof console&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug){var f={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){i.log.prepareStandard(t);var r=f[t.level],a=[t.standard];a=a.concat(t.arguments.slice()),r.apply(console,a)};a=i.log.makeLogger(p)}else{var p=function(e,t){i.log.prepareStandardFull(t),console.log(t.standardFull)};a=i.log.makeLogger(p)}i.log.setLevel(a,"debug"),i.log.addLogger(a),o=a}else console={log:function(){}};i.log.consoleLogger=o},89449,(e,t,r)=>{t.exports=e.r(5189),e.r(99073),e.r(1500),e.r(99470),e.r(9675)},1392,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(74723),e.r(30369),e.r(31808),e.r(93139),e.r(93197),e.r(2828),e.r(26706),e.r(9166);var i=a.asn1,n=t.exports=a.pkcs7=a.pkcs7||{};function s(e){var t;if(e.type===a.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===a.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===a.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),s=e.value;if("string"==typeof s){var o=Date.parse(s);s=isNaN(o)?13===s.length?i.utcTimeToDate(s):i.generalizedTimeToDate(s):new Date(o)}t=s>=r&&s<n?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(s)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(s))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function o(e,t,r){var n={};if(!i.validate(t,r,n,[])){var s=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(i.derToOid(n.contentType)!==a.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var o="";if(a.util.isArray(n.encryptedContent))for(var c=0;c<n.encryptedContent.length;++c){if(n.encryptedContent[c].type!==i.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=n.encryptedContent[c].value}else o=n.encryptedContent;e.encryptedContent={algorithm:i.derToOid(n.encAlgorithm),parameter:a.util.createBuffer(n.encParameter.value),content:a.util.createBuffer(o)}}if(n.content){var o="";if(a.util.isArray(n.content))for(var c=0;c<n.content.length;++c){if(n.content[c].type!==i.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=n.content[c].value}else o=n.content;e.content=a.util.createBuffer(o)}return e.version=n.version.charCodeAt(0),e.rawCapture=n,n}function c(e){if(void 0===e.encryptedContent.key)throw Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case a.pki.oids["aes128-CBC"]:case a.pki.oids["aes192-CBC"]:case a.pki.oids["aes256-CBC"]:t=a.aes.createDecryptionCipher(e.encryptedContent.key);break;case a.pki.oids.desCBC:case a.pki.oids["des-EDE3-CBC"]:t=a.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw Error("Symmetric decryption failed.");e.content=t.output}}n.messageFromPem=function(e){var t=a.pem.decode(e)[0];if("PKCS7"!==t.type){var r=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return n.messageFromAsn1(s)},n.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return a.pem.encode(r,{maxline:t})},n.messageFromAsn1=function(e){var t,r={},s=[];if(!i.validate(e,n.asn1.contentInfoValidator,r,s)){var o=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw o.errors=s,o}var c=i.derToOid(r.contentType);switch(c){case a.pki.oids.envelopedData:t=n.createEnvelopedData();break;case a.pki.oids.encryptedData:t=n.createEncryptedData();break;case a.pki.oids.signedData:t=n.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+c+" is not (yet) supported.")}return t.fromAsn1(r.content.value[0]),t},n.createSignedData=function(){var e=null;return e={type:a.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(o(e,t,n.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(a.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(a.pki.certificateToAsn1(e.certificates[r]));var n=[],s=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),n.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,n)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var n=t.certificate;"string"==typeof n&&(n=a.pki.certificateFromPem(n)),r=n.issuer.attributes,i=n.serialNumber}var s=t.key;if(!s)throw Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=a.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||a.pki.oids.sha1;switch(o){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,f=0;f<c.length;++f){var p=c[f];if(!u&&p.type===a.pki.oids.contentType){if(u=!0,l)break;continue}if(!l&&p.type===a.pki.oids.messageDigest){if(l=!0,u)break;continue}}if(!u||!l)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:r,serialNumber:i,digestAlgorithm:o,signatureAlgorithm:a.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(t){if(t=t||{},("object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.pki.oids.data).getBytes())]),"content"in e)){var r;e.content instanceof a.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=a.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))}0!==e.signers.length&&function(t){if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw Error("Could not sign PKCS#7 message; there is no content to sign.");var r,n=i.derToOid(e.contentInfo.value[0].value),o=i.toDer(r);for(var c in o.getByte(),i.getBerValueLength(o),o=o.getBytes(),t)t[c].start().update(o);for(var u=new Date,l=0;l<e.signers.length;++l){var f=e.signers[l];if(0===f.authenticatedAttributes.length){if(n!==a.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),h=0;h<f.authenticatedAttributes.length;++h){var d=f.authenticatedAttributes[h];d.type===a.pki.oids.messageDigest?d.value=t[f.digestAlgorithm].digest():d.type!==a.pki.oids.signingTime||d.value||(d.value=u),p.value.push(s(d)),f.authenticatedAttributesAsn1.value.push(s(d))}o=i.toDer(p).getBytes(),f.md.start().update(o)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<e.unauthenticatedAttributes.length;++n){var o=e.unauthenticatedAttributes[n];r.values.push(s(o))}t.value.push(r)}return t}(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var n=e.signers[r],s=n.digestAlgorithm;s in t||(t[s]=a.md[a.pki.oids[s]].create()),0===n.authenticatedAttributes.length?n.md=t[s]:n.md=a.md[a.pki.oids[s]].create()}for(var s in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=a.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw Error("PKCS#7 CRL support not yet implemented.")}}},n.createEncryptedData=function(){var e=null;return e={type:a.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(t){o(e,t,n.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),c(e)}}},n.createEnvelopedData=function(){var e=null;return e={type:a.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=o(e,t,n.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(function(e){var t={},r=[];if(!i.validate(e,n.asn1.recipientInfoValidator,t,r)){var s=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(t.issuer),serialNumber:a.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){var t;return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,function(e){for(var t,r=[],n=0;n<e.length;++n)r.push((t=e[n],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),t.parameter?i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes()):void 0]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,a=0;a<e.recipients.length;++a){var i=e.recipients[a],n=i.issuer;if(i.serialNumber===t.serialNumber&&n.length===r.length){for(var s=!0,o=0;o<r.length;++o)if(n[o].type!==r[o].type||n[o].value!==r[o].value){s=!1;break}if(s)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:case a.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=a.util.createBuffer(i);break;default:throw Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}c(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:a.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case a.pki.oids["aes128-CBC"]:i=16,n=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids["aes192-CBC"]:i=24,n=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids["aes256-CBC"]:i=32,n=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids["des-EDE3-CBC"]:i=24,n=8,s=a.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=a.util.createBuffer(a.random.getBytes(i));else if(t.length()!=i)throw Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=a.util.createBuffer(a.random.getBytes(n));var i,n,s,o=s(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var c=0;c<e.recipients.length;++c){var u=e.recipients[c];if(void 0===u.encryptedContent.content)if(u.encryptedContent.algorithm===a.pki.oids.rsaEncryption)u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);else throw Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}}},52849,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(82140),e.r(99073),e.r(1500),e.r(26706);var i=t.exports=a.ssh=a.ssh||{};function n(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=a.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=a.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){r=r||"";var i,c="ssh-rsa",u=""===(t=t||"")?"none":"aes256-cbc",l="PuTTY-User-Key-File-2: "+c+"\r\n";l+="Encryption: "+u+"\r\n",l+="Comment: "+r+"\r\n";var f=a.util.createBuffer();s(f,c),n(f,e.e),n(f,e.n);var p=a.util.encode64(f.bytes(),64),h=Math.floor(p.length/66)+1;l+="Public-Lines: "+h+"\r\n",l+=p;var d=a.util.createBuffer();if(n(d,e.d),n(d,e.p),n(d,e.q),n(d,e.qInv),t){var y=d.length()+16-1;y-=y%16;var g=o(d.bytes());g.truncate(g.length()-y+d.length()),d.putBuffer(g);var m=a.util.createBuffer();m.putBuffer(o("\0\0\0\0",t)),m.putBuffer(o("\0\0\0\x01",t));var v=a.aes.createEncryptionCipher(m.truncate(8),"CBC");v.start(a.util.createBuffer().fillWithByte(0,16)),v.update(d.copy()),v.finish();var C=v.output;C.truncate(16),i=a.util.encode64(C.bytes(),64)}else i=a.util.encode64(d.bytes(),64);l+="\r\nPrivate-Lines: "+(h=Math.floor(i.length/66)+1)+"\r\n",l+=i;var E=o("putty-private-key-file-mac-key",t),S=a.util.createBuffer();s(S,c),s(S,u),s(S,r),S.putInt32(f.length()),S.putBuffer(f),S.putInt32(d.length()),S.putBuffer(d);var T=a.hmac.create();return T.start("sha1",E),T.update(S.bytes()),l+="\r\nPrivate-MAC: "+T.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=a.util.createBuffer();return s(i,r),n(i,e.e),n(i,e.n),r+" "+a.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?a.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||a.md.md5.create(),i=a.util.createBuffer();s(i,"ssh-rsa"),n(i,e.e),n(i,e.n),r.start(),r.update(i.getBytes());var o=r.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw Error('Unknown encoding "'+t.encoding+'".');return o}},72545,(e,t,r)=>{t.exports=e.r(2015),e.r(1258),e.r(59060),e.r(74723),e.r(37170),e.r(30369),e.r(99544),e.r(82140),e.r(7390),e.r(56773),e.r(89449),e.r(39839),e.r(80399),e.r(93139),e.r(36748),e.r(76915),e.r(1392),e.r(68256),e.r(92054),e.r(30756),e.r(15992),e.r(2828),e.r(63045),e.r(52849),e.r(45771),e.r(26706)},85281,(e,t,r)=>{let a=e.r(14747),i=e.r(22734),n=e.r(72545),{MITM_DIR:s}=e.r(96266),o=a.join(s,"rootCA.key"),c=a.join(s,"rootCA.crt");function u(e){try{let t=n.pki.certificateFromPem(i.readFileSync(e,"utf8")),r=new Date(Date.now()+2592e6);return t.validity.notAfter<r}catch{return!0}}t.exports={generateRootCA:async function e(){let e=i.existsSync(o)&&i.existsSync(c);if(e&&!u(c))return console.log("✅ Root CA already exists"),{key:o,cert:c};if(e){console.log("🔐 Root CA expired or expiring soon — regenerating...");try{i.unlinkSync(o)}catch{}try{i.unlinkSync(c)}catch{}}i.existsSync(s)||i.mkdirSync(s,{recursive:!0}),console.log("🔐 Generating Root CA certificate...");let t=n.pki.rsa.generateKeyPair(2048),r=n.pki.createCertificate();r.publicKey=t.publicKey,r.serialNumber="01",r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.validity.notAfter.setFullYear(r.validity.notBefore.getFullYear()+10);let a=[{name:"commonName",value:"9Router MITM Root CA"},{name:"organizationName",value:"9Router"},{name:"countryName",value:"US"}];r.setSubject(a),r.setIssuer(a),r.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,cRLSign:!0,critical:!0},{name:"subjectKeyIdentifier"}]),r.sign(t.privateKey,n.md.sha256.create());let l=n.pki.privateKeyToPem(t.privateKey),f=n.pki.certificateToPem(r);return i.writeFileSync(o,l),i.writeFileSync(c,f),console.log("✅ Root CA generated successfully"),{key:o,cert:c}},loadRootCA:function(){if(!i.existsSync(o)||!i.existsSync(c))throw Error("Root CA not found. Generate it first.");let e=i.readFileSync(o,"utf8"),t=i.readFileSync(c,"utf8");return{key:n.pki.privateKeyFromPem(e),cert:n.pki.certificateFromPem(t)}},generateLeafCert:function(e,t){let r=n.pki.rsa.generateKeyPair(2048),a=n.pki.createCertificate();return a.publicKey=r.publicKey,a.serialNumber=Math.floor(1e6*Math.random()).toString(),a.validity.notBefore=new Date,a.validity.notAfter=new Date,a.validity.notAfter.setFullYear(a.validity.notBefore.getFullYear()+1),a.setSubject([{name:"commonName",value:e}]),a.setIssuer(t.cert.subject.attributes),a.setExtensions([{name:"basicConstraints",cA:!1},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0},{name:"subjectAltName",altNames:[{type:2,value:e},{type:2,value:`*.${e}`}]}]),a.sign(t.key,n.md.sha256.create()),{key:n.pki.privateKeyToPem(r.privateKey),cert:n.pki.certificateToPem(a)}},isCertExpired:u,ROOT_CA_CERT_PATH:c,ROOT_CA_KEY_PATH:o}},22432,(e,t,r)=>{e.r(14747),e.r(22734);let{MITM_DIR:a}=e.r(96266),{generateRootCA:i,loadRootCA:n,generateLeafCert:s}=e.r(85281);t.exports={generateCert:async function e(){return await i()},getCertForDomain:function(e){try{let t=n(),r=s(e,t);return{key:r.key,cert:r.cert}}catch(t){return console.error(`Failed to generate cert for ${e}:`,t.message),null}}}},50532,(e,t,r)=>{let a=e.r(22734),i=e.r(54799),{exec:n,execFileSync:s}=e.r(33405),{execWithPassword:o,isSudoAvailable:c}=e.r(50230),{log:u,err:l}=e.r(32662),f="win32"===process.platform;process.platform;let p="/usr/bin/security";function h(){return"certutil"}function d(e){let t=a.readFileSync(e,"utf-8"),r=Buffer.from(t.replace(/-----[^-]+-----/g,"").replace(/\s/g,""),"base64");return i.createHash("sha1").update(r).digest("hex").toUpperCase().match(/.{2}/g).join(":")}async function y(e){var t;let r;return f?(r=h(),new Promise(e=>{n(`${r} -store Root "9Router MITM Root CA"`,{windowsHide:!0},t=>{if(!t)return e(!0);n(`${r} -user -store Root "9Router MITM Root CA"`,{windowsHide:!0},t=>{if(!t)return e(!0);n("powershell -NoProfile -NonInteractive -Command \"$m = Get-ChildItem -Path Cert:\\LocalMachine\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' } | Select-Object -First 1; $u = Get-ChildItem -Path Cert:\\CurrentUser\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' } | Select-Object -First 1; if ($m -or $u) { exit 0 } else { exit 1 }\"",{windowsHide:!0},t=>{e(!t)})})})})):(t=e,new Promise(e=>{try{if(!a.existsSync(p))return e(!1);let r=d(t).replace(/:/g,"");n(`${p} verify-cert -c "${t}" -p ssl -k /Library/Keychains/System.keychain 2>/dev/null`,t=>{if(!t)return e(!0);n(`${p} dump-trust-settings -d 2>/dev/null | grep -i "${r}"`,(t,r)=>{e(!t&&!!r?.trim())})})}catch{e(!1)}}))}async function g(e,t){if(!a.existsSync(p))throw Error("Certificate install failed: macOS Keychain tools not found at /usr/bin/security. Trust the PEM manually or use a full macOS environment.");let r=`${p} delete-certificate -c "9Router MITM Root CA" /Library/Keychains/System.keychain 2>/dev/null || true`,i=`${p} add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "${t}"`;try{await o(`${r} && ${i}`,e),u("🔐 Cert: ✅ installed to system keychain")}catch(e){throw Error(e.message?.includes("canceled")?"User canceled authorization":`Certificate install failed: ${e.message||"unknown error"}`)}}async function m(e){let t=h();return new Promise((r,a)=>{n(`${t} -addstore Root "${e}"`,{windowsHide:!0},(i,s,o)=>{if(!i)return u("🔐 Cert: ✅ installed to Windows LocalMachine Root store"),r();n(`${t} -user -addstore Root "${e}"`,{windowsHide:!0},(t,i,s)=>{if(!t)return u("🔐 Cert: ✅ installed to Windows CurrentUser Root store"),r();let c=`Import-Certificate -FilePath '${e.replace(/'/g,"''")}' -CertStoreLocation 'Cert:\\CurrentUser\\Root' | Out-Null`;n(`powershell -NoProfile -NonInteractive -Command "${c}"`,{windowsHide:!0},(e,t,i)=>{if(!e)return u("🔐 Cert: ✅ installed to Windows CurrentUser Root store (PowerShell)"),r();let n=[o,s,i].filter(Boolean).join(" | ").trim();a(Error(`Failed to install certificate on Windows Root store(s)${n?`: ${n}`:""}`))})})})})}async function v(e,t){let r=d(t).replace(/:/g,""),a=`${p} delete-certificate -Z "${r}" /Library/Keychains/System.keychain`;try{await o(a,e),u("🔐 Cert: ✅ uninstalled from system keychain")}catch(e){throw Error("Failed to uninstall certificate")}}async function C(){let e=h();return new Promise((t,r)=>{n(`${e} -delstore Root "9Router MITM Root CA"`,{windowsHide:!0},()=>{n(`${e} -user -delstore Root "9Router MITM Root CA"`,{windowsHide:!0},()=>{n("powershell -NoProfile -NonInteractive -Command \"$m = Get-ChildItem -Path Cert:\\LocalMachine\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' }; $u = Get-ChildItem -Path Cert:\\CurrentUser\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' }; $m | Remove-Item -ErrorAction SilentlyContinue; $u | Remove-Item -ErrorAction SilentlyContinue\"",{windowsHide:!0},e=>{if(e)return r(Error(`Failed to uninstall certificate: ${e.message}`));u("🔐 Cert: ✅ uninstalled from Windows Root store(s)"),t()})})})})}t.exports={installCert:async function(e,t){if(!a.existsSync(t))throw Error(`Certificate file not found: ${t}`);await y(t)?u("🔐 Cert: already trusted ✅"):f?await m(t):await g(e,t)},uninstallCert:async function(e,t){await y(t)?f?await C():await v(e,t):u("🔐 Cert: not found in system store")},checkCertInstalled:y,isWSL:function(){return!1}}},9679,(e,t,r)=>{let{exec:a,spawn:i,execSync:n}=e.r(33405),s=e.r(14747),o=e.r(22734);e.r(46786);let c=e.r(4446),u=e.r(24836),l=e.r(54799),{addDNSEntry:f,removeDNSEntry:p,removeAllDNSEntries:h,checkAllDNSStatus:d,TOOL_HOSTS:y,isSudoAvailable:g}=e.r(50230),m="win32"===process.platform,v="darwin"===process.platform,{generateCert:C}=e.r(22432),{installCert:E,uninstallCert:S,checkCertInstalled:T,isWSL:I}=e.r(50532),{isCertExpired:b}=e.r(85281),{MITM_DIR:A}=e.r(96266),{log:B,err:x}=e.r(32662),N=s.join(A,".mitm.pid"),R=[5e3,1e4,2e4,3e4,6e4],k=0,_=0,L=!1,w=function(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let e=s.join("/ROOT/src/mitm","server.js");if(o.existsSync(e))return e;let t=s.join(process.cwd(),"src","mitm","server.js");if(o.existsSync(t))return t;let r=s.join(process.cwd(),"..","src","mitm","server.js");return o.existsSync(r)?r:t}(),U="aes-256-gcm",D="9router-mitm-pwd",P=null,V=null;function O(){return globalThis.__mitmSudoPassword||null}function K(e){globalThis.__mitmSudoPassword=e}function M(e){try{return process.kill(e,0),!0}catch(e){return"EACCES"===e.code}}function F(t,r=!1,i=null){{let n=r?"SIGKILL":"SIGTERM",s=`pkill -${n} -P ${t} 2>/dev/null; kill -${n} ${t} 2>/dev/null`;if(i){let{execWithPassword:t}=e.r(50230);t(s,i).catch(()=>a(s,()=>{}))}else a(s,()=>{})}}function j(){try{let{machineIdSync:t}=e.r(16828),r=t();return l.createHash("sha256").update(r+D).digest()}catch{return l.createHash("sha256").update(D).digest()}}let H=null,G=null;async function q(e,t){if(G)try{let r,a,i,n,s,o={mitmEnabled:e};t&&(r=j(),a=l.randomBytes(12),i=l.createCipheriv(U,r,a),n=Buffer.concat([i.update(t,"utf8"),i.final()]),s=i.getAuthTag(),o.mitmSudoEncrypted=`${a.toString("hex")}:${s.toString("hex")}:${n.toString("hex")}`),await G(o)}catch(e){x(`Failed to save settings: ${e.message}`)}}async function Q(){if(G)try{await G({mitmSudoEncrypted:null})}catch(e){x(`Failed to clear encrypted password: ${e.message}`)}}async function z(){if(!H)return null;try{let e=await H();if(!e.mitmSudoEncrypted)return null;return function(e){try{let[t,r,a]=e.split(":");if(!t||!r||!a)return null;let i=j(),n=l.createDecipheriv(U,i,Buffer.from(t,"hex"));return n.setAuthTag(Buffer.from(r,"hex")),n.update(Buffer.from(a,"hex"))+n.final("utf8")}catch{return null}}(e.mitmSudoEncrypted)}catch{return null}}async function $(t){if(P&&!P.killed){try{P.kill("SIGKILL")}catch{}P=null,V=null}try{if(o.existsSync(N)){let e=parseInt(o.readFileSync(N,"utf-8").trim(),10);e&&M(e)&&(F(e,!0,t),await new Promise(e=>setTimeout(e,500))),o.unlinkSync(N)}}catch{}if(!m&&w)try{let r=w.replace(/'/g,"'\\''");if(t){let{execWithPassword:a}=e.r(50230);await a(`pkill -SIGKILL -f "${r}" 2>/dev/null || true`,t).catch(()=>{})}else a(`pkill -SIGKILL -f "${r}" 2>/dev/null || true`,()=>{});await new Promise(e=>setTimeout(e,500))}catch{}}async function Y(){let e=null!==P&&!P.killed,t=V;if(!e)try{if(o.existsSync(N)){let r=parseInt(o.readFileSync(N,"utf-8").trim(),10);r&&M(r)?(e=!0,t=r):o.unlinkSync(N)}}catch{}let r=d(),a=s.join(A,"rootCA.crt"),i=o.existsSync(a),n=!!i&&await T(a);return{running:e,pid:t,certExists:i,certTrusted:n,dnsStatus:r}}async function W(e){if(L)return;if(Date.now()-_>=6e4&&(k=0),k>=5)return void x("Max restart attempts reached. Giving up.");let t=R[Math.min(k,R.length-1)];k++,L=!0,B(`Restarting in ${t/1e3}s... (${k}/5)`),await new Promise(e=>setTimeout(e,t));try{let t=H?await H():null;if(t&&!t.mitmEnabled){B("MITM disabled, skipping restart"),L=!1;return}let r=O()||await z();if(!r&&!m){x("No cached password, cannot auto-restart"),L=!1;return}await X(e,r),B("🔄 Restarted successfully"),k=0,L=!1}catch(t){x(`Restart attempt ${k}/5 failed: ${t.message}`),L=!1,W(e)}}async function X(t,r){if(!P||P.killed)try{if(o.existsSync(N)){let e=parseInt(o.readFileSync(N,"utf-8").trim(),10);if(e&&M(e))return V=e,B(`♻️ Reusing existing process (PID: ${e})`),await q(!0,r),r&&K(r),{running:!0,pid:e};o.unlinkSync(N)}}catch{}if(P&&!P.killed)throw Error("MITM server is already running");await $(r);{let t=await new Promise(e=>{let t=c.createServer();t.once("error",t=>{"EADDRINUSE"===t.code?e("in-use"):e("no-permission")}),t.once("listening",()=>{t.close(()=>e("free"))}),t.listen(443,"127.0.0.1")});if("in-use"===t||"no-permission"===t){let t=await new Promise(e=>{a('ps aux | grep "[s]erver.js"',(t,r)=>{if(!r?.trim())return e(null);for(let t of r.split("\n")){let r=parseInt(t.trim().split(/\s+/)[1],10);if(!isNaN(r))return e({pid:r,name:"node"})}e(null)})});if(t&&"node"===t.name){B(`Killing orphan node process on port 443 (PID ${t.pid})...`);try{let{execWithPassword:a}=e.r(50230);await a(`kill -9 ${t.pid}`,r),await new Promise(e=>setTimeout(e,800))}catch{}}else if(t){let e=t.name.includes("/")?t.name.split("/").filter(Boolean).pop():t.name;throw Error(`Port 443 is already in use by "${e}" (PID ${t.pid}). Stop that process first.`)}}}let l=s.join(A,"rootCA.crt"),f=s.join(A,"rootCA.key"),p=o.existsSync(l)&&o.existsSync(f);if(!p||b(l)){if(p){B("🔐 Cert expired — uninstalling old cert...");let e=r||O()||await z();try{await S(e,l)}catch{}}B("🔐 Generating Root CA..."),await C()}let h=await T(l);if(m||v||g()||I(),h)B("🔐 Cert: already trusted ✅");else{B("🔐 Cert: not trusted → installing...");let e=r||O()||await z();if(!e&&!m&&!I())throw Error("Sudo password required to install Root CA certificate");try{await E(e,l),B("🔐 Cert: ✅ trusted")}catch(e){throw Error(`Failed to trust certificate: ${e.message}`)}}B("🚀 Starting server..."),g()?((P=i("sudo",["-S","-E","sh","-c",`ROUTER_API_KEY='${t}' NODE_ENV='production' '${process.execPath}' '${w}'`],{detached:!1,stdio:["pipe","pipe","pipe"]})).stdin.write(`${r}
|
|
4
|
+
`,s.writeFileSync(e,i,"utf8");let n=`Start-Process powershell -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-WindowStyle','Hidden','-File','${e.replace(/'/g,"''")}' -Verb RunAs -WindowStyle Hidden`;return new Promise((i,o)=>{let c=!1,u=(e,t)=>{c||(c=!0,e(t))};a(`powershell -NoProfile -NonInteractive -WindowStyle Hidden -Command "${n}"`,{windowsHide:!0},()=>{});let l=Date.now()+t,f=()=>{if(!c){if(s.existsSync(r)){try{s.unlinkSync(r),s.unlinkSync(e)}catch{}return u(i)}if(Date.now()>l){try{s.unlinkSync(e)}catch{}return u(o,Error("Timed out waiting for UAC confirmation"))}setTimeout(f,500)}};setTimeout(f,300)})},checkDNSEntry:g,checkAllDNSStatus:function(){try{let e=s.readFileSync(p,"utf8"),t={};for(let[r,a]of Object.entries(f))t[r]=a.every(t=>e.includes(t));return t}catch{return Object.fromEntries(Object.keys(f).map(e=>[e,!1]))}}}},96266,(e,t,r)=>{let a=e.r(14747),i=e.r(46786);e.r(22734);let n=process.env.DATA_DIR?process.env.DATA_DIR:a.join(i.homedir(),".n9router"),s=a.join(n,"mitm");t.exports={DATA_DIR:n,MITM_DIR:s}},2015,(e,t,r)=>{t.exports={options:{usePureJavaScript:!1}}},95461,(e,t,r)=>{var a={};t.exports=a;var i={};a.encode=function(e,t,r){if("string"!=typeof t)throw TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw TypeError('"maxline" must be a number.');var a="";if(e instanceof Uint8Array){var i=0,n=t.length,s=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<o.length;++c)u+=o[c]<<8,o[c]=u%n,u=u/n|0;for(;u>0;)o.push(u%n),u=u/n|0}for(i=0;0===e[i]&&i<e.length-1;++i)a+=s;for(i=o.length-1;i>=0;--i)a+=t[o[i]]}else a=function(e,t){var r=0,a=t.length,i=t.charAt(0),n=[0];for(r=0;r<e.length();++r){for(var s=0,o=e.at(r);s<n.length;++s)o+=n[s]<<8,n[s]=o%a,o=o/a|0;for(;o>0;)n.push(o%a),o=o/a|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=n.length-1;r>=0;--r)c+=t[n[r]];return c}(e,t);if(r){var l=RegExp(".{1,"+r+"}","g");a=a.match(l).join("\r\n")}return a},a.decode=function(e,t){if("string"!=typeof e)throw TypeError('"input" must be a string.');if("string"!=typeof t)throw TypeError('"alphabet" must be a string.');var r=i[t];if(!r){r=i[t]=[];for(var a=0;a<t.length;++a)r[t.charCodeAt(a)]=a}e=e.replace(/\s/g,"");for(var n=t.length,s=t.charAt(0),o=[0],a=0;a<e.length;a++){var c=r[e.charCodeAt(a)];if(void 0===c)return;for(var u=0,l=c;u<o.length;++u)l+=o[u]*n,o[u]=255&l,l>>=8;for(;l>0;)o.push(255&l),l>>=8}for(var f=0;e[f]===s&&f<e.length-1;++f)o.push(0);return"u">typeof Buffer?Buffer.from(o.reverse()):new Uint8Array(o.reverse())}},26706,(e,t,r)=>{var a=e.r(2015),i=e.r(95461),n=t.exports=a.util=a.util||{};function s(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw Error("Only 8, 16, 24, or 32 bits supported: "+e)}function o(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(n.isArrayBuffer(e)||n.isArrayBufferView(e))if("u">typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof o||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("u">typeof process&&process.nextTick&&1){n.nextTick=process.nextTick,"function"==typeof setImmediate?n.setImmediate=setImmediate:n.setImmediate=n.nextTick;return}if("function"==typeof setImmediate){n.setImmediate=function(){return setImmediate.apply(void 0,arguments)},n.nextTick=function(e){return setImmediate(e)};return}if(n.setImmediate=function(e){setTimeout(e,0)},"u">typeof MutationObserver){var e,t=Date.now(),r=!0,a=document.createElement("div"),e=[];new MutationObserver(function(){var t=e.slice();e.length=0,t.forEach(function(e){e()})}).observe(a,{attributes:!0});var i=n.setImmediate;n.setImmediate=function(n){Date.now()-t>15?(t=Date.now(),i(n)):(e.push(n),1===e.length&&a.setAttribute("a",r=!r))}}n.nextTick=n.setImmediate}(),n.isNodejs="u">typeof process&&process.versions&&process.versions.node,n.globalScope=n.isNodejs?e.g:"u"<typeof self?window:self,n.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.isArrayBuffer=function(e){return"u">typeof ArrayBuffer&&e instanceof ArrayBuffer},n.isArrayBufferView=function(e){return e&&n.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},n.ByteBuffer=o,n.ByteStringBuffer=o,n.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},n.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},n.ByteStringBuffer.prototype.isEmpty=function(){return 0>=this.length()},n.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},n.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},n.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},n.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(n.encodeUtf8(e))},n.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},n.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},n.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},n.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},n.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},n.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},n.ByteStringBuffer.prototype.putInt=function(e,t){s(t);var r="";do t-=8,r+=String.fromCharCode(e>>t&255);while(t>0)return this.putBytes(r)},n.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},n.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},n.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},n.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},n.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},n.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},n.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},n.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},n.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},n.ByteStringBuffer.prototype.getInt=function(e){s(e);var t=0;do t=(t<<8)+this.data.charCodeAt(this.read++),e-=8;while(e>0)return t},n.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},n.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},n.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},n.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},n.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},n.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},n.ByteStringBuffer.prototype.copy=function(){var e=n.createBuffer(this.data);return e.read=this.read,e},n.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},n.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},n.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},n.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},n.ByteStringBuffer.prototype.toString=function(){return n.decodeUtf8(this.bytes())},n.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=n.isArrayBuffer(e),a=n.isArrayBufferView(e);if(r||a){r?this.data=new DataView(e):this.data=new DataView(e.buffer,e.byteOffset,e.byteLength),this.write="writeOffset"in t?t.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},n.DataBuffer.prototype.length=function(){return this.write-this.read},n.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()},n.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),a=new Uint8Array(this.length()+t);return a.set(r),this.data=new DataView(a.buffer),this},n.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},n.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},n.DataBuffer.prototype.putBytes=function(e,t){if(n.isArrayBufferView(e)){var r,a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=a.byteLength-a.byteOffset;this.accommodate(i);var s=new Uint8Array(this.data.buffer,this.write);return s.set(a),this.write+=i,this}if(n.isArrayBuffer(e)){var a=new Uint8Array(e);this.accommodate(a.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(a,this.write),this.write+=a.byteLength,this}if(e instanceof n.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&n.isArrayBufferView(e.data)){var a=new Uint8Array(e.data.byteLength,e.read,e.length());this.accommodate(a.byteLength);var s=new Uint8Array(e.data.byteLength,this.write);return s.set(a),this.write+=a.byteLength,this}if(e instanceof n.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),r=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.hex.decode(e,r,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),r=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.base64.decode(e,r,this.write),this;if("utf8"===t&&(e=n.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),r=new Uint8Array(this.data.buffer,this.write),this.write+=n.binary.raw.decode(r),this;if("utf16"===t)return this.accommodate(2*e.length),r=new Uint16Array(this.data.buffer,this.write),this.write+=n.text.utf16.encode(r),this;throw Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},n.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},n.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},n.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},n.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},n.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},n.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},n.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},n.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},n.DataBuffer.prototype.putInt=function(e,t){s(t),this.accommodate(t/8);do t-=8,this.data.setInt8(this.write++,e>>t&255);while(t>0)return this},n.DataBuffer.prototype.putSignedInt=function(e,t){return s(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},n.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},n.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},n.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},n.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},n.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},n.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},n.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},n.DataBuffer.prototype.getInt=function(e){s(e);var t=0;do t=(t<<8)+this.data.getInt8(this.read++),e-=8;while(e>0)return t},n.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},n.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},n.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},n.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},n.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},n.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},n.DataBuffer.prototype.copy=function(){return new n.DataBuffer(this)},n.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},n.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},n.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},n.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},n.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return n.binary.raw.encode(t);if("hex"===e)return n.binary.hex.encode(t);if("base64"===e)return n.binary.base64.encode(t);if("utf8"===e)return n.text.utf8.decode(t);if("utf16"===e)return n.text.utf16.decode(t);throw Error("Invalid encoding: "+e)},n.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=n.encodeUtf8(e)),new n.ByteBuffer(e)},n.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},n.xorBytes=function(e,t,r){for(var a="",i="",n="",s=0,o=0;r>0;--r,++s)i=e.charCodeAt(s)^t.charCodeAt(s),o>=10&&(a+=n,n="",o=0),n+=String.fromCharCode(i),++o;return a+n},n.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},n.bytesToHex=function(e){return n.createBuffer(e).toHex()},n.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";n.encode64=function(e,t){for(var r,a,i,n="",s="",o=0;o<e.length;)r=e.charCodeAt(o++),a=e.charCodeAt(o++),i=e.charCodeAt(o++),n+=c.charAt(r>>2),n+=c.charAt((3&r)<<4|a>>4),isNaN(a)?n+="==":(n+=c.charAt((15&a)<<2|i>>6),n+=isNaN(i)?"=":c.charAt(63&i)),t&&n.length>t&&(s+=n.substr(0,t)+"\r\n",n=n.substr(t));return s+n},n.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,a,i,n="",s=0;s<e.length;)t=u[e.charCodeAt(s++)-43],r=u[e.charCodeAt(s++)-43],a=u[e.charCodeAt(s++)-43],i=u[e.charCodeAt(s++)-43],n+=String.fromCharCode(t<<2|r>>4),64!==a&&(n+=String.fromCharCode((15&r)<<4|a>>2),64!==i&&(n+=String.fromCharCode((3&a)<<6|i)));return n},n.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},n.decodeUtf8=function(e){return decodeURIComponent(escape(e))},n.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},n.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},n.binary.raw.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(e.length));for(var i=r=r||0,n=0;n<e.length;++n)a[i++]=e.charCodeAt(n);return t?i-r:a},n.binary.hex.encode=n.bytesToHex,n.binary.hex.decode=function(e,t,r){var a=t;a||(a=new Uint8Array(Math.ceil(e.length/2)));var i=0,n=r=r||0;for(1&e.length&&(i=1,a[n++]=parseInt(e[0],16));i<e.length;i+=2)a[n++]=parseInt(e.substr(i,2),16);return t?n-r:a},n.binary.base64.encode=function(e,t){for(var r,a,i,n="",s="",o=0;o<e.byteLength;)r=e[o++],a=e[o++],i=e[o++],n+=c.charAt(r>>2),n+=c.charAt((3&r)<<4|a>>4),isNaN(a)?n+="==":(n+=c.charAt((15&a)<<2|i>>6),n+=isNaN(i)?"=":c.charAt(63&i)),t&&n.length>t&&(s+=n.substr(0,t)+"\r\n",n=n.substr(t));return s+n},n.binary.base64.decode=function(e,t,r){var a,i,n,s,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,l=r=r||0;c<e.length;)a=u[e.charCodeAt(c++)-43],i=u[e.charCodeAt(c++)-43],n=u[e.charCodeAt(c++)-43],s=u[e.charCodeAt(c++)-43],o[l++]=a<<2|i>>4,64!==n&&(o[l++]=(15&i)<<4|n>>2,64!==s&&(o[l++]=(3&n)<<6|s));return t?l-r:o.subarray(0,l)},n.binary.base58.encode=function(e,t){return n.binary.baseN.encode(e,l,t)},n.binary.base58.decode=function(e,t){return n.binary.baseN.decode(e,l,t)},n.text={utf8:{},utf16:{}},n.text.utf8.encode=function(e,t,r){e=n.encodeUtf8(e);var a=t;a||(a=new Uint8Array(e.length));for(var i=r=r||0,s=0;s<e.length;++s)a[i++]=e.charCodeAt(s);return t?i-r:a},n.text.utf8.decode=function(e){return n.decodeUtf8(String.fromCharCode.apply(null,e))},n.text.utf16.encode=function(e,t,r){var a=t;a||(a=new Uint8Array(2*e.length));for(var i=new Uint16Array(a.buffer),n=r=r||0,s=r,o=0;o<e.length;++o)i[s++]=e.charCodeAt(o),n+=2;return t?n-r:a},n.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},n.deflate=function(e,t,r){if(t=n.decode64(e.deflate(n.encode64(t)).rval),r){var a=2;32&t.charCodeAt(1)&&(a=6),t=t.substring(a,t.length-4)}return t},n.inflate=function(e,t,r){var a=e.inflate(n.encode64(t)).rval;return null===a?null:n.decode64(a)};var f=function(e,t,r){if(!e)throw Error("WebStorage not available.");if(null===r?a=e.removeItem(t):(r=n.encode64(JSON.stringify(r)),a=e.setItem(t,r)),void 0!==a&&!0!==a.rval){var a,i=Error(a.error.message);throw i.id=a.error.id,i.name=a.error.name,i}},p=function(e,t){if(!e)throw Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var a=Error(r.error.message);throw a.id=r.error.id,a.name=r.error.name,a}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(n.decode64(r))),r},h=function(e,t,r,a){var i=p(e,t);null===i&&(i={}),i[r]=a,f(e,t,i)},d=function(e,t,r){var a=p(e,t);return null!==a&&(a=r in a?a[r]:null),a},y=function(e,t,r){var a=p(e,t);if(null!==a&&r in a){delete a[r];var i=!0;for(var n in a){i=!1;break}i&&(a=null),f(e,t,a)}},g=function(e,t){f(e,t,null)},m=function(e,t,r){var a,i=null;void 0===r&&(r=["web","flash"]);var n=!1,s=null;for(var o in r){a=r[o];try{if("flash"===a||"both"===a){if(null===t[0])throw Error("Flash local storage not available.");i=e.apply(this,t),n="flash"===a}("web"===a||"both"===a)&&(t[0]=localStorage,i=e.apply(this,t),n=!0)}catch(e){s=e}if(n)break}if(!n)throw s;return i};n.setItem=function(e,t,r,a,i){m(h,arguments,i)},n.getItem=function(e,t,r,a){return m(d,arguments,a)},n.removeItem=function(e,t,r,a){m(y,arguments,a)},n.clearItems=function(e,t,r){m(g,arguments,r)},n.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},n.format=function(e){for(var t,r,a=/%./g,i=0,n=[],s=0;t=a.exec(e);){(r=e.substring(s,a.lastIndex-2)).length>0&&n.push(r),s=a.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i<arguments.length?n.push(arguments[i+++1]):n.push("<?>");break;case"%":n.push("%");break;default:n.push("<%"+o+"?>")}}return n.push(e.substring(s)),n.join("")},n.formatNumber=function(e,t,r,a){var i=e,n=isNaN(t=Math.abs(t))?2:t,s=void 0===a?".":a,o=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(n),10)+"",u=c.length>3?c.length%3:0;return o+(u?c.substr(0,u)+s:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+s)+(n?(void 0===r?",":r)+Math.abs(i-c).toFixed(n).slice(2):"")},n.formatSize=function(e){return e>=0x40000000?n.formatNumber(e/0x40000000,2,".","")+" GiB":e>=1048576?n.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?n.formatNumber(e/1024,0)+" KiB":n.formatNumber(e,0)+" bytes"},n.bytesFromIP=function(e){return -1!==e.indexOf(".")?n.bytesFromIPv4(e):-1!==e.indexOf(":")?n.bytesFromIPv6(e):null},n.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=n.createBuffer(),r=0;r<e.length;++r){var a=parseInt(e[r],10);if(isNaN(a))return null;t.putByte(a)}return t.getBytes()},n.bytesFromIPv6=function(e){for(var t=0,r=(8-(e=e.split(":").filter(function(e){return 0===e.length&&++t,!0})).length+t)*2,a=n.createBuffer(),i=0;i<8;++i){if(!e[i]||0===e[i].length){a.fillWithByte(0,r),r=0;continue}var s=n.hexToBytes(e[i]);s.length<2&&a.putByte(0),a.putBytes(s)}return a.getBytes()},n.bytesToIP=function(e){return 4===e.length?n.bytesToIPv4(e):16===e.length?n.bytesToIPv6(e):null},n.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},n.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],a=0,i=0;i<e.length;i+=2){for(var s=n.bytesToHex(e[i]+e[i+1]);"0"===s[0]&&"0"!==s;)s=s.substr(1);if("0"===s){var o=r[r.length-1],c=t.length;o&&c===o.end+1?(o.end=c,o.end-o.start>r[a].end-r[a].start&&(a=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[a];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},n.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in n&&!e.update)return t(null,n.cores);if("u">typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return n.cores=navigator.hardwareConcurrency,t(null,n.cores);if("u"<typeof Worker)return n.cores=1,t(null,n.cores);if("u"<typeof Blob)return n.cores=2,t(null,n.cores);var r=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})})}).toString(),")()"],{type:"application/javascript"}));!function e(a,i,s){if(0===i)return n.cores=Math.max(1,Math.floor(a.reduce(function(e,t){return e+t},0)/a.length)),URL.revokeObjectURL(r),t(null,n.cores);!function(e,t){for(var a=[],i=[],n=0;n<e;++n){var s=new Worker(r);s.addEventListener("message",function(r){if(i.push(r.data),i.length===e){for(var n=0;n<e;++n)a[n].terminate();t(null,i)}}),a.push(s)}for(var n=0;n<e;++n)a[n].postMessage(n)}(s,function(t,r){a.push(function(e,t){for(var r=[],a=0;a<e;++a)for(var i=t[a],n=r[a]=[],s=0;s<e;++s)if(a!==s){var o=t[s];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&n.push(s)}return r.reduce(function(e,t){return Math.max(e,t.length)},0)}(s,r)),e(a,i-1,s)})}([],5,16)}},37170,(e,t,r)=>{var a=e.r(2015);e.r(26706),t.exports=a.cipher=a.cipher||{},a.cipher.algorithms=a.cipher.algorithms||{},a.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=a.cipher.getAlgorithm(r))&&(r=r()),!r)throw Error("Unsupported algorithm: "+e);return new a.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},a.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=a.cipher.getAlgorithm(r))&&(r=r()),!r)throw Error("Unsupported algorithm: "+e);return new a.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},a.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),a.cipher.algorithms[e]=t},a.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in a.cipher.algorithms?a.cipher.algorithms[e]:null};var i=a.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){var t={};for(var r in e=e||{})t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=a.util.createBuffer(),this.output=e.output||a.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){e&&("ECB"===this.mode.name||"CBC"===this.mode.name)&&(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,(!!this._decrypt||!this.mode.pad||!!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),(!this._decrypt||!this.mode.unpad||!!this.mode.unpad(this.output,t))&&(!this.mode.afterFinish||!!this.mode.afterFinish(this.output,t)))}},67424,(e,t,r)=>{var a=e.r(2015);e.r(26706),a.cipher=a.cipher||{};var i=t.exports=a.cipher.modes=a.cipher.modes||{};function n(e,t){if("string"==typeof e&&(e=a.util.createBuffer(e)),a.util.isArray(e)&&e.length>4){var r=e;e=a.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!a.util.isArray(e)){for(var n=[],s=t/4,i=0;i<s;++i)n.push(e.getInt32());e=n}return e}function s(e){e[e.length-1]=e[e.length-1]+1|0}function o(e){return[e/0x100000000|0,0|e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in e)this._iv=n(e.iv,this.blockSize),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.")},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=this._prev[a]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._outBlock[a]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var a=0;a<this._ints;++a)this._inBlock[a]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var a=0;a<this._ints;++a)t.putInt32(this._prev[a]^this._outBlock[a]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),a=e.at(r-1);return!(a>this.blockSize<<2)&&(e.truncate(a),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);return}var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(n>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},i.cfb.prototype.decrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);return}var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(n>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var a=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];return}var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n>0)e.read-=this.blockSize;else for(var i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");this._iv=n(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=Array(this._ints),this._outBlock=Array(this._ints),this._partialOutput=a.util.createBuffer(),this._partialBytes=0,this._R=0xe1000000},i.gcm.prototype.start=function(e){if(!("iv"in e))throw Error("Invalid IV parameter.");var t,r=a.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?a.util.createBuffer(e.additionalData):a.util.createBuffer(),"tagLength"in e?this._tagLength=e.tagLength:this._tagLength=128,this._tag=null,e.decrypt&&(this._tag=a.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw Error("Authentication tag does not match tag length.");this._hashBlock=Array(this._ints),this.tag=null,this._hashSubkey=Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,t=a.util.createBuffer(t),this._aDataLength=o(8*t.length());var n=t.length()%this.blockSize;for(n&&t.fillWithByte(0,this.blockSize-n),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var a=e.length();if(0===a)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&a>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var n=(this.blockSize-a)%this.blockSize;n>0&&(n=this.blockSize-n),this._partialOutput.clear();for(var i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(n<=0||r){if(r){var o=a%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(var i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),n>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=n,!0;t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var a=e.length();if(a<this.blockSize&&!(r&&a>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);a<this.blockSize?this._cipherLength+=a%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=a.util.createBuffer();var i=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var n=[];this.cipher.encrypt(this._j0,n);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^n[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],a=t.slice(0),i=0;i<128;++i)e[i/32|0]&1<<31-i%32&&(r[0]^=a[0],r[1]^=a[1],r[2]^=a[2],r[3]^=a[3]),this.pow(a,a);return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],a=3;a>0;--a)t[a]=e[a]>>>1|(1&e[a-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var a=e[r/8|0]>>>(7-r%8)*4&15,i=this._m[r][a];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,a=4*r,i=16*r,n=Array(i),s=0;s<i;++s){var o=[0,0,0,0],c=s/a|0,u=(a-1-s%a)*t;o[c]=1<<t-1<<u,n[s]=this.generateSubHashTable(this.multiply(o,e),t)}return n},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,a=r>>>1,i=Array(r);i[a]=e.slice(0);for(var n=a>>>1;n>0;)this.pow(i[2*n],i[n]=[]),n>>=1;for(n=2;n<a;){for(var s=1;s<n;++s){var o=i[n],c=i[s];i[n+s]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}n*=2}for(i[0]=[0,0,0,0],n=a+1;n<r;++n){var u=i[n^a];i[n]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}},1258,(e,t,r)=>{var a,i,n,s,o,c=e.r(2015);function u(e,t){c.cipher.registerAlgorithm(e,function(){return new c.aes.Algorithm(e,t)})}e.r(37170),e.r(67424),e.r(26706),t.exports=c.aes=c.aes||{},c.aes.startEncrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!1,mode:a});return i.start(t),i},c.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},c.aes.startDecrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!0,mode:a});return i.start(t),i},c.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},c.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},c.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"==typeof r&&(16===r.length||24===r.length||32===r.length))r=c.util.createBuffer(r);else if(c.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=c.util.createBuffer();for(var a=0;a<t.length;++a)r.putByte(t[a])}if(!c.util.isArray(r)){t=r,r=[];var i=t.length();if(16===i||24===i||32===i){i>>>=2;for(var a=0;a<i;++a)r.push(t.getInt32())}}if(!c.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw Error("Invalid key parameter.");var n=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=p(r,e.decrypt&&!n),this._init=!0}},c.aes._expandKey=function(e,t){return l||f(),p(e,t)},c.aes._updateBlock=h,u("AES-ECB",c.cipher.modes.ecb),u("AES-CBC",c.cipher.modes.cbc),u("AES-CFB",c.cipher.modes.cfb),u("AES-OFB",c.cipher.modes.ofb),u("AES-CTR",c.cipher.modes.ctr),u("AES-GCM",c.cipher.modes.gcm);var l=!1;function f(){l=!0,n=[0,1,2,4,8,16,32,64,128,27,54];for(var e=Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;a=Array(256),i=Array(256),s=[,,,,],o=[,,,,];for(var t=0;t<4;++t)s[t]=Array(256),o[t]=Array(256);for(var r,c,u,f,p,h,d,y=0,g=0,t=0;t<256;++t){f=(f=g^g<<1^g<<2^g<<3^g<<4)>>8^255&f^99,a[y]=f,i[f]=y,p=e[f],r=e[y],c=e[r],u=e[c],h=p<<24^f<<16^f<<8^(f^p),d=(r^c^u)<<24^(y^u)<<16^(y^c^u)<<8^(y^r^u);for(var m=0;m<4;++m)s[m][y]=h,o[m][f]=d,h=h<<24|h>>>8,d=d<<24|d>>>8;0===y?y=g=1:(y=r^e[e[e[r^u]]],g^=e[e[g]])}}function p(e,t){for(var r,i=e.slice(0),s=1,c=i.length,u=4*(c+6+1),l=c;l<u;++l)r=i[l-1],l%c==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^n[s]<<24,s++):c>6&&l%c==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),i[l]=i[l-c]^r;if(t){var f,p=o[0],h=o[1],d=o[2],y=o[3],g=i.slice(0);u=i.length;for(var l=0,m=u-4;l<u;l+=4,m-=4)if(0===l||l===u-4)g[l]=i[m],g[l+1]=i[m+3],g[l+2]=i[m+2],g[l+3]=i[m+1];else for(var v=0;v<4;++v)f=i[m+v],g[l+(3&-v)]=p[a[f>>>24]]^h[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];i=g}return i}function h(e,t,r,n){var c,u,l,f,p,h,d,y,g,m,v,C,E=e.length/4-1;n?(c=o[0],u=o[1],l=o[2],f=o[3],p=i):(c=s[0],u=s[1],l=s[2],f=s[3],p=a),h=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],g=t[n?1:3]^e[3];for(var S=3,T=1;T<E;++T)m=c[h>>>24]^u[d>>>16&255]^l[y>>>8&255]^f[255&g]^e[++S],v=c[d>>>24]^u[y>>>16&255]^l[g>>>8&255]^f[255&h]^e[++S],C=c[y>>>24]^u[g>>>16&255]^l[h>>>8&255]^f[255&d]^e[++S],g=c[g>>>24]^u[h>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],h=m,d=v,y=C;r[0]=p[h>>>24]<<24^p[d>>>16&255]<<16^p[y>>>8&255]<<8^p[255&g]^e[++S],r[n?3:1]=p[d>>>24]<<24^p[y>>>16&255]<<16^p[g>>>8&255]<<8^p[255&h]^e[++S],r[2]=p[y>>>24]<<24^p[g>>>16&255]<<16^p[h>>>8&255]<<8^p[255&d]^e[++S],r[n?1:3]=p[g>>>24]<<24^p[h>>>16&255]<<16^p[d>>>8&255]<<8^p[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),a=(t=e.decrypt?c.cipher.createDecipher(r,e.key):c.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof c.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,a.call(t,r)},t}},31808,(e,t,r)=>{var a=e.r(2015);a.pki=a.pki||{};var i=t.exports=a.pki.oids=a.oids=a.oids||{};function n(e,t){i[e]=t,i[t]=e}n("1.2.840.113549.1.1.1","rsaEncryption"),n("1.2.840.113549.1.1.4","md5WithRSAEncryption"),n("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),n("1.2.840.113549.1.1.7","RSAES-OAEP"),n("1.2.840.113549.1.1.8","mgf1"),n("1.2.840.113549.1.1.9","pSpecified"),n("1.2.840.113549.1.1.10","RSASSA-PSS"),n("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),n("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),n("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),n("1.3.101.112","EdDSA25519"),n("1.2.840.10040.4.3","dsa-with-sha1"),n("1.3.14.3.2.7","desCBC"),n("1.3.14.3.2.26","sha1"),n("1.3.14.3.2.29","sha1WithRSASignature"),n("2.16.840.1.101.3.4.2.1","sha256"),n("2.16.840.1.101.3.4.2.2","sha384"),n("2.16.840.1.101.3.4.2.3","sha512"),n("2.16.840.1.101.3.4.2.4","sha224"),n("2.16.840.1.101.3.4.2.5","sha512-224"),n("2.16.840.1.101.3.4.2.6","sha512-256"),n("1.2.840.113549.2.2","md2"),n("1.2.840.113549.2.5","md5"),n("1.2.840.113549.1.7.1","data"),n("1.2.840.113549.1.7.2","signedData"),n("1.2.840.113549.1.7.3","envelopedData"),n("1.2.840.113549.1.7.4","signedAndEnvelopedData"),n("1.2.840.113549.1.7.5","digestedData"),n("1.2.840.113549.1.7.6","encryptedData"),n("1.2.840.113549.1.9.1","emailAddress"),n("1.2.840.113549.1.9.2","unstructuredName"),n("1.2.840.113549.1.9.3","contentType"),n("1.2.840.113549.1.9.4","messageDigest"),n("1.2.840.113549.1.9.5","signingTime"),n("1.2.840.113549.1.9.6","counterSignature"),n("1.2.840.113549.1.9.7","challengePassword"),n("1.2.840.113549.1.9.8","unstructuredAddress"),n("1.2.840.113549.1.9.14","extensionRequest"),n("1.2.840.113549.1.9.20","friendlyName"),n("1.2.840.113549.1.9.21","localKeyId"),n("1.2.840.113549.1.9.22.1","x509Certificate"),n("1.2.840.113549.1.12.10.1.1","keyBag"),n("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),n("1.2.840.113549.1.12.10.1.3","certBag"),n("1.2.840.113549.1.12.10.1.4","crlBag"),n("1.2.840.113549.1.12.10.1.5","secretBag"),n("1.2.840.113549.1.12.10.1.6","safeContentsBag"),n("1.2.840.113549.1.5.13","pkcs5PBES2"),n("1.2.840.113549.1.5.12","pkcs5PBKDF2"),n("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),n("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),n("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),n("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),n("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),n("1.2.840.113549.2.7","hmacWithSHA1"),n("1.2.840.113549.2.8","hmacWithSHA224"),n("1.2.840.113549.2.9","hmacWithSHA256"),n("1.2.840.113549.2.10","hmacWithSHA384"),n("1.2.840.113549.2.11","hmacWithSHA512"),n("1.2.840.113549.3.7","des-EDE3-CBC"),n("2.16.840.1.101.3.4.1.2","aes128-CBC"),n("2.16.840.1.101.3.4.1.22","aes192-CBC"),n("2.16.840.1.101.3.4.1.42","aes256-CBC"),n("2.5.4.3","commonName"),n("2.5.4.4","surname"),n("2.5.4.5","serialNumber"),n("2.5.4.6","countryName"),n("2.5.4.7","localityName"),n("2.5.4.8","stateOrProvinceName"),n("2.5.4.9","streetAddress"),n("2.5.4.10","organizationName"),n("2.5.4.11","organizationalUnitName"),n("2.5.4.12","title"),n("2.5.4.13","description"),n("2.5.4.15","businessCategory"),n("2.5.4.17","postalCode"),n("2.5.4.42","givenName"),n("2.5.4.65","pseudonym"),n("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),n("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),n("2.16.840.1.113730.1.1","nsCertType"),n("2.16.840.1.113730.1.13","nsComment"),i["2.5.29.1"]="authorityKeyIdentifier",i["2.5.29.2"]="keyAttributes",i["2.5.29.3"]="certificatePolicies",i["2.5.29.4"]="keyUsageRestriction",i["2.5.29.5"]="policyMapping",i["2.5.29.6"]="subtreesConstraint",i["2.5.29.7"]="subjectAltName",i["2.5.29.8"]="issuerAltName",i["2.5.29.9"]="subjectDirectoryAttributes",i["2.5.29.10"]="basicConstraints",i["2.5.29.11"]="nameConstraints",i["2.5.29.12"]="policyConstraints",i["2.5.29.13"]="basicConstraints",n("2.5.29.14","subjectKeyIdentifier"),n("2.5.29.15","keyUsage"),i["2.5.29.16"]="privateKeyUsagePeriod",n("2.5.29.17","subjectAltName"),n("2.5.29.18","issuerAltName"),n("2.5.29.19","basicConstraints"),i["2.5.29.20"]="cRLNumber",i["2.5.29.21"]="cRLReason",i["2.5.29.22"]="expirationDate",i["2.5.29.23"]="instructionCode",i["2.5.29.24"]="invalidityDate",i["2.5.29.25"]="cRLDistributionPoints",i["2.5.29.26"]="issuingDistributionPoint",i["2.5.29.27"]="deltaCRLIndicator",i["2.5.29.28"]="issuingDistributionPoint",i["2.5.29.29"]="certificateIssuer",i["2.5.29.30"]="nameConstraints",n("2.5.29.31","cRLDistributionPoints"),n("2.5.29.32","certificatePolicies"),i["2.5.29.33"]="policyMappings",i["2.5.29.34"]="policyConstraints",n("2.5.29.35","authorityKeyIdentifier"),i["2.5.29.36"]="policyConstraints",n("2.5.29.37","extKeyUsage"),i["2.5.29.46"]="freshestCRL",i["2.5.29.54"]="inhibitAnyPolicy",n("1.3.6.1.4.1.11129.2.4.2","timestampList"),n("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),n("1.3.6.1.5.5.7.3.1","serverAuth"),n("1.3.6.1.5.5.7.3.2","clientAuth"),n("1.3.6.1.5.5.7.3.3","codeSigning"),n("1.3.6.1.5.5.7.3.4","emailProtection"),n("1.3.6.1.5.5.7.3.8","timeStamping")},74723,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(31808);var i=t.exports=a.asn1=a.asn1||{};function n(e,t,r){if(r>t){var a=Error("Too few bytes to parse DER.");throw a.available=e.length(),a.remaining=t,a.requested=r,a}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.maxDepth=256,i.create=function(e,t,r,n,s){if(a.util.isArray(n)){for(var o=[],c=0;c<n.length;++c)void 0!==n[c]&&o.push(n[c]);n=o}var u={tagClass:e,type:t,constructed:r,composed:r||a.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=i.copy(u)),u},i.copy=function(e,t){var r;if(a.util.isArray(e)){r=[];for(var n=0;n<e.length;++n)r.push(i.copy(e[n],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(a.util.isArray(e)){if(!a.util.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!i.equals(e[n],t[n]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var s=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(s=s&&e.bitStringContents===t.bitStringContents),s},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};var s=function(e,t){var r,a=e.getByte();if(t--,128!==a){if(128&a){var i=127&a;n(e,t,i),r=e.getInt(i<<3)}else r=a;if(r<0)throw Error("Negative length: "+r);return r}};i.fromDer=function(e,t){void 0===t&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"maxDepth"in t||(t.maxDepth=i.maxDepth),"string"==typeof e&&(e=a.util.createBuffer(e));var r=e.length(),o=function e(t,r,a,o){if(a>=o.maxDepth)throw Error("ASN.1 parsing error: Max depth exceeded.");n(t,r,2);var c,u,l,f=t.getByte();r--;var p=192&f,h=31&f;c=t.length();var d=s(t,r);if(r-=c-t.length(),void 0!==d&&d>r){if(o.strict){var y=Error("Too few bytes to read ASN.1 value.");throw y.available=t.length(),y.remaining=r,y.requested=d,y}d=r}var g=(32&f)==32;if(g)if(u=[],void 0===d)for(;;){if(n(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}c=t.length(),u.push(e(t,r,a+1,o)),r-=c-t.length()}else for(;d>0;)c=t.length(),u.push(e(t,d,a+1,o)),r-=c-t.length(),d-=c-t.length();if(void 0===u&&p===i.Class.UNIVERSAL&&h===i.Type.BITSTRING&&(l=t.bytes(d)),void 0===u&&o.decodeBitStrings&&p===i.Class.UNIVERSAL&&h===i.Type.BITSTRING&&d>1){var m=t.read,v=r,C=0;if(h===i.Type.BITSTRING&&(n(t,r,1),C=t.getByte(),r--),0===C)try{c=t.length();var E=e(t,r,a+1,{strict:!0,decodeBitStrings:!0}),S=c-t.length();r-=S,h==i.Type.BITSTRING&&S++;var T=E.tagClass;S===d&&(T===i.Class.UNIVERSAL||T===i.Class.CONTEXT_SPECIFIC)&&(u=[E])}catch(e){}void 0===u&&(t.read=m,r=v)}if(void 0===u){if(void 0===d){if(o.strict)throw Error("Non-constructed ASN.1 object of indefinite length.");d=r}if(h===i.Type.BMPSTRING)for(u="";d>0;d-=2)n(t,r,2),u+=String.fromCharCode(t.getInt16()),r-=2;else u=t.getBytes(d),r-=d}var I=void 0===l?null:{bitStringContents:l};return i.create(p,h,g,u,I)}(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var c=Error("Unparsed DER bytes remain after ASN.1 parsing.");throw c.byteCount=r,c.remaining=e.length(),c}return o},i.toDer=function(e){var t=a.util.createBuffer(),r=e.tagClass|e.type,n=a.util.createBuffer(),s=!1;if("bitStringContents"in e&&(s=!0,e.original&&(s=i.equals(e,e.original))),s)n.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:n.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&n.putBuffer(i.toDer(e.value[o]))}else if(e.type===i.Type.BMPSTRING)for(var o=0;o<e.value.length;++o)n.putInt16(e.value.charCodeAt(o));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&(128&e.value.charCodeAt(1))==0||255===e.value.charCodeAt(0)&&(128&e.value.charCodeAt(1))==128)?n.putBytes(e.value.substr(1)):n.putBytes(e.value);if(t.putByte(r),127>=n.length())t.putByte(127&n.length());else{var c=n.length(),u="";do u+=String.fromCharCode(255&c),c>>>=8;while(c>0)t.putByte(128|u.length);for(var o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(n),t},i.oidToDer=function(e){var t,r,i,n,s=e.split("."),o=a.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var c=2;c<s.length;++c){if(t=!0,r=[],(i=parseInt(s[c],10))>0xffffffff)throw Error("OID value too large; max is 32-bits.");do n=127&i,i>>>=7,t||(n|=128),r.push(n),t=!1;while(i>0)for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},i.derToOid=function(e){"string"==typeof e&&(e=a.util.createBuffer(e));var t,r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;){if(i>0x3fffffffffff)throw Error("OID value too large; max is 53-bits.");r=e.getByte(),i*=128,128&r?i+=127&r:(t+="."+(i+r),i=0)}return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var a=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),n=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,a,i),t.setUTCHours(n,s,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),a=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),n=parseInt(e.substr(8,2),10),s=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,p=e.charAt(f);return("+"===p||"-"===p)&&(u=(60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10))*6e4,"+"===p&&(u*=-1),l=!0),"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,a,i),t.setUTCHours(n,s,o,c),t.setTime(+t+u)):(t.setFullYear(r,a,i),t.setHours(n,s,o,c)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var a=0;a<r.length;++a)r[a].length<2&&(t+="0"),t+=r[a];return t+"Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var a=0;a<r.length;++a)r[a].length<2&&(t+="0"),t+=r[a];return t+"Z"},i.integerToDer=function(e){var t=a.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-0x80000000&&e<0x80000000)return t.putSignedInt(e,32);var r=Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=a.util.createBuffer(e));var t=8*e.length();if(t>32)throw Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,n){var s=!1;if((e.tagClass===t.tagClass||void 0===t.tagClass)&&(e.type===t.type||void 0===t.type))if(e.constructed===t.constructed||void 0===t.constructed){if(s=!0,t.value&&a.util.isArray(t.value))for(var o=0,c=0;s&&c<t.value.length;++c){var u=t.value[c];s=!!u.optional;var l=e.value[o];if(!l){!u.optional&&(s=!1,n&&n.push("["+t.name+'] Missing required element. Expected tag class "'+u.tagClass+'", type "'+u.type+'"'));continue}if(void 0!==u.tagClass&&void 0!==u.type&&(l.tagClass!==u.tagClass||l.type!==u.type))if(u.optional){s=!0;continue}else{s=!1,n&&n.push("["+t.name+"] Tag mismatch. Expected ("+u.tagClass+","+u.type+"), got ("+l.tagClass+","+l.type+")");break}if(i.validate(l,u,r,n))++o,s=!0;else if(u.optional)s=!0;else{s=!1;break}}if(s&&r&&(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e))if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else n&&n.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');else n&&(e.tagClass!==t.tagClass&&n.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&n.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));return s};var o=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var n="";r=r||2,(t=t||0)>0&&(n+="\n");for(var s="",c=0;c<t*r;++c)s+=" ";switch(n+=s+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:n+="Universal:";break;case i.Class.APPLICATION:n+="Application:";break;case i.Class.CONTEXT_SPECIFIC:n+="Context-Specific:";break;case i.Class.PRIVATE:n+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(n+=e.type,e.type){case i.Type.NONE:n+=" (None)";break;case i.Type.BOOLEAN:n+=" (Boolean)";break;case i.Type.INTEGER:n+=" (Integer)";break;case i.Type.BITSTRING:n+=" (Bit string)";break;case i.Type.OCTETSTRING:n+=" (Octet string)";break;case i.Type.NULL:n+=" (Null)";break;case i.Type.OID:n+=" (Object Identifier)";break;case i.Type.ODESC:n+=" (Object Descriptor)";break;case i.Type.EXTERNAL:n+=" (External or Instance of)";break;case i.Type.REAL:n+=" (Real)";break;case i.Type.ENUMERATED:n+=" (Enumerated)";break;case i.Type.EMBEDDED:n+=" (Embedded PDV)";break;case i.Type.UTF8:n+=" (UTF8)";break;case i.Type.ROID:n+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:n+=" (Sequence)";break;case i.Type.SET:n+=" (Set)";break;case i.Type.PRINTABLESTRING:n+=" (Printable String)";break;case i.Type.IA5String:n+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:n+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:n+=" (Generalized time)";break;case i.Type.BMPSTRING:n+=" (BMP String)"}else n+=e.type;if(n+="\n",n+=s+"Constructed: "+e.constructed+"\n",e.composed){for(var u=0,l="",c=0;c<e.value.length;++c)void 0!==e.value[c]&&(u+=1,l+=i.prettyPrint(e.value[c],t+1,r),c+1<e.value.length&&(l+=","));n+=s+"Sub values: "+u+l}else{if(n+=s+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);n+=f,a.pki&&a.pki.oids&&f in a.pki.oids&&(n+=" ("+a.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{n+=i.derToInteger(e.value)}catch(t){n+="0x"+a.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?n+="0x"+a.util.bytesToHex(e.value.slice(1)):n+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?n+=" (1 unused bit shown)":p>1&&(n+=" ("+p+" unused bits shown)")}}else if(e.type===i.Type.OCTETSTRING)o.test(e.value)||(n+="("+e.value+") "),n+="0x"+a.util.bytesToHex(e.value);else if(e.type===i.Type.UTF8)try{n+=a.util.decodeUtf8(e.value)}catch(t){if("URI malformed"===t.message)n+="0x"+a.util.bytesToHex(e.value)+" (malformed UTF8)";else throw t}else e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?n+=e.value:o.test(e.value)?n+="0x"+a.util.bytesToHex(e.value):0===e.value.length?n+="[null]":n+=e.value}return n}},5189,(e,t,r)=>{var a=e.r(2015);t.exports=a.md=a.md||{},a.md.algorithms=a.md.algorithms||{}},82140,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706),(t.exports=a.hmac=a.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,n={};return n.start=function(n,s){if(null!==n)if("string"==typeof n)if((n=n.toLowerCase())in a.md.algorithms)t=a.md.algorithms[n].create();else throw Error('Unknown hash algorithm "'+n+'"');else t=n;if(null===s)s=e;else{if("string"==typeof s)s=a.util.createBuffer(s);else if(a.util.isArray(s)){var o=s;s=a.util.createBuffer();for(var c=0;c<o.length;++c)s.putByte(o[c])}var u=s.length();u>t.blockLength&&(t.start(),t.update(s.bytes()),s=t.digest()),r=a.util.createBuffer(),i=a.util.createBuffer(),u=s.length();for(var c=0;c<u;++c){var o=s.at(c);r.putByte(54^o),i.putByte(92^o)}if(u<t.blockLength)for(var o=t.blockLength-u,c=0;c<o;++c)r.putByte(54),i.putByte(92);e=s,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},n.update=function(e){t.update(e)},n.getMac=function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()},n.digest=n.getMac,n}},99073,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.md5=a.md5||{};a.md.md5=a.md.algorithms.md5=i,i.create=function(){u||function(){n=String.fromCharCode(128)+a.util.fillString("\0",64),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(0x100000000*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=a.util.createBuffer(),r=Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:0x67452301,h1:0xefcdab89,h2:0x98badcfe,h3:0x10325476},i},i.start(),i.update=function(n,s){"utf8"===s&&(n=a.util.encodeUtf8(n));var o=n.length;i.messageLength+=o,o=[o/0x100000000>>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/0x100000000>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/0x100000000>>>0;return t.putBytes(n),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s=a.util.createBuffer();s.putBytes(t.bytes());var o=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(n.substr(0,i.blockLength-o));for(var c,u=0,f=i.fullMessageLength.length-1;f>=0;--f)u=(c=8*i.fullMessageLength[f]+u)/0x100000000>>>0,s.putInt32Le(c>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(p,r,s);var h=a.util.createBuffer();return h.putInt32Le(p.h0),h.putInt32Le(p.h1),h.putInt32Le(p.h2),h.putInt32Le(p.h3),h},i};var n=null,s=null,o=null,c=null,u=!1;function l(e,t,r){for(var a,i,n,u,l,f,p,h,d=r.length();d>=64;){for(h=0,i=e.h0,n=e.h1,u=e.h2,l=e.h3;h<16;++h)t[h]=r.getInt32Le(),a=i+(l^n&(u^l))+c[h]+t[h],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;for(;h<32;++h)a=i+(u^l&(n^u))+c[h]+t[s[h]],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;for(;h<48;++h)a=i+(n^u^l)+c[h]+t[s[h]],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;for(;h<64;++h)a=i+(u^(n|~l))+c[h]+t[s[h]],p=o[h],i=l,l=u,u=n,n+=a<<p|a>>>32-p;e.h0=e.h0+i|0,e.h1=e.h1+n|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,d-=64}}},93139,(e,t,r)=>{var a=e.r(2015);e.r(26706);var i=t.exports=a.pem=a.pem||{};function n(e){for(var t=e.name+": ",r=[],a=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,a));t+=r.join(",")+"\r\n";for(var n=0,s=-1,i=0;i<t.length;++i,++n)if(n>65&&-1!==s){var o=t[s];","===o?(++s,t=t.substr(0,s)+"\r\n "+t.substr(s)):t=t.substr(0,s)+"\r\n"+o+t.substr(s+1),n=i-s-1,s=-1,++i}else(" "===t[i]||" "===t[i]||","===t[i])&&(s=i);return t}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=n(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=n(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=n(r)),e.headers)for(var s=0;s<e.headers.length;++s)i+=n(e.headers[s]);return e.procType&&(i+="\r\n"),i+=a.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,n=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=i.exec(e);){var o=t[1];"NEW CERTIFICATE REQUEST"===o&&(o="CERTIFICATE REQUEST");var c={type:o,procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(t[3])};if(r.push(c),t[2]){for(var u=t[2].split(s),l=0;t&&l<u.length;){for(var f=u[l].replace(/\s+$/,""),p=l+1;p<u.length;++p){var h=u[p];if(!/\s/.test(h[0]))break;f+=h,l=p}if(t=f.match(n)){for(var d={name:t[1],values:[]},y=t[2].split(","),g=0;g<y.length;++g)d.values.push(y[g].replace(/^\s+/,""));if(c.procType)if(c.contentDomain||"Content-Domain"!==d.name)if(c.dekInfo||"DEK-Info"!==d.name)c.headers.push(d);else{if(0===d.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');c.dekInfo={algorithm:y[0],parameters:y[1]||null}}else c.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');c.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===c.procType&&!c.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw Error("Invalid PEM formatted message.");return r}},30369,(e,t,r)=>{var a=e.r(2015);function i(e,t){a.cipher.registerAlgorithm(e,function(){return new a.des.Algorithm(e,t)})}e.r(37170),e.r(67424),e.r(26706),t.exports=a.des=a.des||{},a.des.startEncrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!1,mode:a||(null===t?"ECB":"CBC")});return i.start(t),i},a.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},a.des.startDecrypting=function(e,t,r,a){var i=d({key:e,output:r,decrypt:!0,mode:a||(null===t?"ECB":"CBC")});return i.start(t),i},a.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},a.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},a.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=a.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,0x20000000,0x20000004,65536,65540,0x20010000,0x20010004,512,516,0x20000200,0x20000204,66048,66052,0x20010200,0x20010204],a=[0,1,1048576,1048577,0x4000000,0x4000001,0x4100000,0x4100001,256,257,1048832,1048833,0x4000100,0x4000101,0x4100100,0x4100101],i=[0,8,2048,2056,0x1000000,0x1000008,0x1000800,0x1000808,0,8,2048,2056,0x1000000,0x1000008,0x1000800,0x1000808],n=[0,2097152,0x8000000,0x8200000,8192,2105344,0x8002000,0x8202000,131072,2228224,0x8020000,0x8220000,139264,2236416,0x8022000,0x8222000],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],c=[0,0x10000000,524288,0x10080000,2,0x10000002,524290,0x10080002,0,0x10000000,524288,0x10080000,2,0x10000002,524290,0x10080002],u=[0,65536,2048,67584,0x20000000,0x20010000,0x20000800,0x20010800,131072,196608,133120,198656,0x20020000,0x20030000,0x20020800,0x20030800],l=[0,262144,0,262144,2,262146,2,262146,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],f=[0,0x10000000,8,0x10000008,0,0x10000000,8,0x10000008,1024,0x10000400,1032,0x10000408,1024,0x10000400,1032,0x10000408],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,0x1000000,512,0x1000200,2097152,0x1200000,2097664,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],d=[0,4096,0x8000000,0x8001000,524288,528384,0x8080000,0x8081000,16,4112,0x8000010,0x8001010,524304,528400,0x8080010,0x8081010],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],C=0,E=0;E<g;E++){var S=e.getInt32(),T=e.getInt32();t=(S>>>4^T)&0xf0f0f0f,T^=t,S^=t<<4,t=(T>>>-16^S)&65535,S^=t,T^=t<<-16,t=(S>>>2^T)&0x33333333,T^=t,S^=t<<2,t=(T>>>-16^S)&65535,S^=t,T^=t<<-16,t=(S>>>1^T)&0x55555555,T^=t,S^=t<<1,t=(T>>>8^S)&0xff00ff,S^=t,T^=t<<8,t=(S>>>1^T)&0x55555555,T^=t,S^=t<<1,t=S<<8|T>>>20&240,S=T<<24|T<<8&0xff0000|T>>>8&65280|T>>>24&240,T=t;for(var I=0;I<v.length;++I){v[I]?(S=S<<2|S>>>26,T=T<<2|T>>>26):(S=S<<1|S>>>27,T=T<<1|T>>>27),T&=-15;var b=r[(S&=-15)>>>28]|a[S>>>24&15]|i[S>>>20&15]|n[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|c[S>>>4&15],A=u[T>>>28]|l[T>>>24&15]|f[T>>>20&15]|p[T>>>16&15]|h[T>>>12&15]|d[T>>>8&15]|y[T>>>4&15];t=(A>>>16^b)&65535,m[C++]=b^t,m[C++]=A^t<<16}}return m}(t),this._init=!0}},i("DES-ECB",a.cipher.modes.ecb),i("DES-CBC",a.cipher.modes.cbc),i("DES-CFB",a.cipher.modes.cfb),i("DES-OFB",a.cipher.modes.ofb),i("DES-CTR",a.cipher.modes.ctr),i("3DES-ECB",a.cipher.modes.ecb),i("3DES-CBC",a.cipher.modes.cbc),i("3DES-CFB",a.cipher.modes.cfb),i("3DES-OFB",a.cipher.modes.ofb),i("3DES-CTR",a.cipher.modes.ctr);var n=[0x1010400,0,65536,0x1010404,0x1010004,66564,4,65536,1024,0x1010400,0x1010404,1024,0x1000404,0x1010004,0x1000000,4,1028,0x1000400,0x1000400,66560,66560,0x1010000,0x1010000,0x1000404,65540,0x1000004,0x1000004,65540,0,1028,66564,0x1000000,65536,0x1010404,4,0x1010000,0x1010400,0x1000000,0x1000000,1024,0x1010004,65536,66560,0x1000004,1024,4,0x1000404,66564,0x1010404,65540,0x1010000,0x1000404,0x1000004,1028,66564,0x1010400,1028,0x1000400,0x1000400,0,65540,66560,0,0x1010004],s=[-0x7fef7fe0,-0x7fff8000,32768,1081376,1048576,32,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,1048576,32,-0x7fefffe0,1081344,1048608,-0x7fff7fe0,0,-0x80000000,32768,1081376,-0x7ff00000,1048608,-0x7fffffe0,0,1081344,32800,-0x7fef8000,-0x7ff00000,32800,0,1081376,-0x7fefffe0,1048576,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,32768,-0x7ff00000,-0x7fff8000,32,-0x7fef7fe0,1081376,32,32768,-0x80000000,32800,-0x7fef8000,1048576,-0x7fffffe0,1048608,-0x7fff7fe0,-0x7fffffe0,1048608,1081344,0,-0x7fff8000,32800,-0x80000000,-0x7fefffe0,-0x7fef7fe0,1081344],o=[520,0x8020200,0,0x8020008,0x8000200,0,131592,0x8000200,131080,0x8000008,0x8000008,131072,0x8020208,131080,0x8020000,520,0x8000000,8,0x8020200,512,131584,0x8020000,0x8020008,131592,0x8000208,131584,131072,0x8000208,8,0x8020208,512,0x8000000,0x8020200,0x8000000,131080,520,131072,0x8020200,0x8000200,0,512,131080,0x8020208,0x8000200,0x8000008,512,0,0x8020008,0x8000208,131072,0x8000000,0x8020208,8,131592,131584,0x8000008,0x8020000,0x8000208,520,0x8020000,131592,8,0x8020008,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,0x2080100,0x2080000,0x42000100,524288,256,0x40000000,0x2080000,0x40080100,524288,0x2000100,0x40080100,0x42000100,0x42080000,524544,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,524544,524288,0x42000100,256,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,256,0x2000000,0x42080000,0x42080100,524544,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,524544,0x2000100,0x40000100,524288,0,0x40080000,0x2080100,0x40000100],l=[0x20000010,0x20400000,16384,0x20404010,0x20400000,16,0x20404010,4194304,0x20004000,4210704,4194304,0x20000010,4194320,0x20004000,0x20000000,16400,0,4194320,0x20004010,16384,4210688,0x20004010,16,0x20400010,0x20400010,0,4210704,0x20404000,16400,4210688,0x20404000,0x20000000,0x20004000,16,0x20400010,4210688,0x20404010,4194304,16400,0x20000010,4194304,0x20004000,0x20000000,16400,0x20000010,0x20404010,4210688,0x20400000,4210704,0x20404000,0,0x20400010,16,16384,0x20400000,4210704,16384,4194320,0x20004010,0,0x20404000,0x20000000,4194320,0x20004010],f=[2097152,0x4200002,0x4000802,0,2048,0x4000802,2099202,0x4200800,0x4200802,2097152,0,0x4000002,2,0x4000000,0x4200002,2050,0x4000800,2099202,2097154,0x4000800,0x4000002,0x4200000,0x4200800,2097154,0x4200000,2048,2050,0x4200802,2099200,2,0x4000000,2099200,0x4000000,2099200,2097152,0x4000802,0x4000802,0x4200002,0x4200002,2,2097154,0x4000000,0x4000800,2097152,0x4200800,2050,2099202,0x4200800,2050,0x4000002,0x4200802,0x4200000,2099200,0,2,0x4200802,0,2099202,0x4200000,2048,0x4000002,0x4000800,2048,2097154],p=[0x10001040,4096,262144,0x10041040,0x10000000,0x10001040,64,0x10000000,262208,0x10040000,0x10041040,266240,0x10041000,266304,4096,64,0x10040000,0x10000040,0x10001000,4160,266240,262208,0x10040040,0x10041000,4160,0,0,0x10040040,0x10000040,0x10001000,266304,262144,266304,262144,0x10041000,4096,64,0x10040040,4096,266304,0x10001000,64,0x10000040,0x10040000,0x10040040,0x10000000,262144,0x10001040,0,0x10041040,262208,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,266240,266240,4160,4160,262208,0x10000000,0x10041000];function h(e,t,r,a){var i,h,d=32===e.length?3:9;i=3===d?a?[30,-2,-2]:[0,32,2]:a?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],g=t[1];h=(y>>>4^g)&0xf0f0f0f,g^=h,y^=h<<4,h=(y>>>16^g)&65535,g^=h,y^=h<<16,h=(g>>>2^y)&0x33333333,y^=h,g^=h<<2,h=(g>>>8^y)&0xff00ff,y^=h,g^=h<<8,h=(y>>>1^g)&0x55555555,g^=h,y^=h<<1,y=y<<1|y>>>31,g=g<<1|g>>>31;for(var m=0;m<d;m+=3){for(var v=i[m+1],C=i[m+2],E=i[m];E!=v;E+=C){var S=g^e[E],T=(g>>>4|g<<28)^e[E+1];h=y,y=g,g=h^(s[S>>>24&63]|c[S>>>16&63]|l[S>>>8&63]|p[63&S]|n[T>>>24&63]|o[T>>>16&63]|u[T>>>8&63]|f[63&T])}h=y,y=g,g=h}h=((y=y>>>1|y<<31)>>>1^(g=g>>>1|g<<31))&0x55555555,g^=h,y^=h<<1,h=(g>>>8^y)&0xff00ff,y^=h,g^=h<<8,h=(g>>>2^y)&0x33333333,y^=h,g^=h<<2,h=(y>>>16^g)&65535,g^=h,y^=h<<16,h=(y>>>4^g)&0xf0f0f0f,g^=h,y^=h<<4,r[0]=y,r[1]=g}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?a.cipher.createDecipher(r,e.key):a.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var n=null;r instanceof a.util.ByteBuffer&&(n=r,r={}),(r=r||{}).output=n,r.iv=e,i.call(t,r)},t}},80399,(e,t,r)=>{var a,i=e.r(2015);e.r(82140),e.r(5189),e.r(26706);var n=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(a=e.r(54799)),t.exports=i.pbkdf2=n.pbkdf2=function(e,t,r,n,s,o){if("function"==typeof s&&(o=s,s=null),i.util.isNodejs&&!i.options.usePureJavaScript&&a.pbkdf2&&(null===s||"object"!=typeof s)&&(a.pbkdf2Sync.length>4||!s||"sha1"===s))return("string"!=typeof s&&(s="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),o)?4===a.pbkdf2Sync.length?a.pbkdf2(e,t,r,n,function(e,t){if(e)return o(e);o(null,t.toString("binary"))}):a.pbkdf2(e,t,r,n,s,function(e,t){if(e)return o(e);o(null,t.toString("binary"))}):4===a.pbkdf2Sync.length?a.pbkdf2Sync(e,t,r,n).toString("binary"):a.pbkdf2Sync(e,t,r,n,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in i.md.algorithms))throw Error("Unknown hash algorithm: "+s);s=i.md[s].create()}var c=s.digestLength;if(n>0xffffffff*c){var u=Error("Derived key is too long.");if(o)return o(u);throw u}var l=Math.ceil(n/c),f=n-(l-1)*c,p=i.hmac.create();p.start(s,e);var h="";if(!o){for(var d=1;d<=l;++d){p.start(null,null),p.update(t),p.update(i.util.int32ToBytes(d)),g=v=p.digest().getBytes();for(var y=2;y<=r;++y)p.start(null,null),p.update(v),m=p.digest().getBytes(),g=i.util.xorBytes(g,m,c),v=m;h+=d<l?g:g.substr(0,f)}return h}var g,m,v,y,d=1;!function e(){if(d>l)return o(null,h);p.start(null,null),p.update(t),p.update(i.util.int32ToBytes(d)),g=v=p.digest().getBytes(),y=2,function t(){if(y<=r)return p.start(null,null),p.update(v),m=p.digest().getBytes(),g=i.util.xorBytes(g,m,c),v=m,++y,i.util.setImmediate(t);h+=d<l?g:g.substr(0,f),++d,e()}()}()}},99470,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.sha256=a.sha256||{};a.md.sha256=a.md.algorithms.sha256=i,i.create=function(){s||(n=String.fromCharCode(128)+a.util.fillString("\0",64),o=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],s=!0);var e=null,t=a.util.createBuffer(),r=Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:0x6a09e667,h1:0xbb67ae85,h2:0x3c6ef372,h3:0xa54ff53a,h4:0x510e527f,h5:0x9b05688c,h6:0x1f83d9ab,h7:0x5be0cd19},i},i.start(),i.update=function(n,s){"utf8"===s&&(n=a.util.encodeUtf8(n));var o=n.length;i.messageLength+=o,o=[o/0x100000000>>>0,o>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=o[1],o[1]=o[0]+(i.fullMessageLength[u]/0x100000000>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,o[0]=o[1]/0x100000000>>>0;return t.putBytes(n),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s,o=a.util.createBuffer();o.putBytes(t.bytes());var u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(n.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/0x100000000>>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(p,r,o);var h=a.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h.putInt32(p.h5),h.putInt32(p.h6),h.putInt32(p.h7),h},i};var n=null,s=!1,o=null;function c(e,t,r){for(var a,i,n,s,c,u,l,f,p,h,d,y,g,m,v,C=r.length();C>=64;){for(l=0;l<16;++l)t[l]=r.getInt32();for(;l<64;++l)a=((a=t[l-2])>>>17|a<<15)^(a>>>19|a<<13)^a>>>10,i=((i=t[l-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[l]=a+t[l-7]+i+t[l-16]|0;for(l=0,f=e.h0,p=e.h1,h=e.h2,d=e.h3,y=e.h4,g=e.h5,m=e.h6,v=e.h7;l<64;++l)s=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),c=m^y&(g^m),n=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&p|h&(f^p),a=v+s+c+o[l]+t[l],i=n+u,v=m,m=g,g=y,y=d+a>>>0,d=h,h=p,p=f,f=a+i>>>0;e.h0=e.h0+f|0,e.h1=e.h1+p|0,e.h2=e.h2+h|0,e.h3=e.h3+d|0,e.h4=e.h4+y|0,e.h5=e.h5+g|0,e.h6=e.h6+m|0,e.h7=e.h7+v|0,C-=64}}},30756,(e,t,r)=>{var a=e.r(2015);e.r(26706);var i=null;!a.util.isNodejs||a.options.usePureJavaScript||process.versions["node-webkit"]||(i=e.r(54799)),(t.exports=a.prng=a.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,n=Array(32),s=0;s<32;++s)n[s]=r.create();function o(){t.reseeds=0xffffffff===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,a=0;a<32;++a)t.reseeds%r==0&&(e.update(t.pools[a].digest().getBytes()),t.pools[a].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=a.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var n=a.util.createBuffer();if(t)for(;n.length()<e;){var s=new Uint32Array(Math.floor(Math.max(1,Math.min(e-n.length(),65536)/4)));try{t(s);for(var o=0;o<s.length;++o)n.putInt32(s[o])}catch(e){if(!("u">typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(n.length()<e)for(var c,u,l,f=Math.floor(65536*Math.random());n.length()<e;){f=0|(u=(0x7fffffff&(u=16807*(65535&f)+(((32767&(c=16807*(f>>16)))<<16)+(c>>15))))+(u>>31));for(var o=0;o<3;++o)l=f>>>(o<<3)^Math.floor(256*Math.random()),n.putByte(255&l)}return n.getBytes(e)}return t.pools=n,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,n=t.plugin.increment,s=t.plugin.formatKey,c=t.plugin.formatSeed,u=a.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(u.length()>=e)return r(null,u.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return a.util.nextTick(function(){!function(e){if(t.pools[0].messageLength>=32)return o(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,a){if(r)return e(r);t.collect(a),o(),e()})}(l)});var p=i(t.key,t.seed);t.generated+=p.length,u.putBytes(p),t.key=s(i(t.key,n(t.seed))),t.seed=c(i(t.key,t.seed)),a.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,n=t.plugin.formatKey,s=t.plugin.formatSeed;t.key=null;for(var c=a.util.createBuffer();c.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&function(){if(t.pools[0].messageLength>=32)return o();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),o()}();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=n(r(t.key,i(t.seed))),t.seed=s(r(t.key,t.seed))}return c.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,a=0;a<r;++a)t.pools[t.pool].update(e.substr(a,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var a="",i=0;i<r;i+=8)a+=String.fromCharCode(e>>i&255);t.collect(a)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",function e(r){var a=r.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",e),t(a.forge.prng.err,a.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",function(r){var a=r.data;a.forge&&a.forge.prng&&t.seedFile(a.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})})},t}},2828,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(99470),e.r(30756),e.r(26706),function(){if(a.random&&a.random.getBytes){t.exports=a.random;return}!function(e){var r={},i=[,,,,],n=a.util.createBuffer();function s(){var e=a.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=a.util.createBuffer(e);return(e=[,,,,])[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),a.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=a.util.createBuffer(e);return(e=[,,,,])[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return a.aes._updateBlock(e,t,i,!1),n.putInt32(i[0]),n.putInt32(i[1]),n.putInt32(i[2]),n.putInt32(i[3]),n.getBytes()},r.increment=function(e){return++e[3],e},r.md=a.md.sha256;var o=s(),c=null,u=a.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(c=function(e){return l.getRandomValues(e)}),a.options.usePureJavaScript||!a.util.isNodejs&&!c){if(o.collectInt(+new Date,32),"u">typeof navigator){var f="";for(var p in navigator)try{"string"==typeof navigator[p]&&(f+=navigator[p])}catch(e){}o.collect(f),f=null}e&&(e().mousemove(function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)}),e().keypress(function(e){o.collectInt(e.charCode,8)}))}if(a.random)for(var p in o)a.random[p]=o[p];else a.random=o;a.random.createInstance=s,t.exports=a.random}("u">typeof jQuery?jQuery:null)}()},63045,(e,t,r)=>{var a=e.r(2015);e.r(26706);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],n=[1,2,3,5];t.exports=a.rc2=a.rc2||{},a.rc2.expandKey=function(e,t){"string"==typeof e&&(e=a.util.createBuffer(e)),t=t||128;var r,n=e,s=e.length(),o=t,c=Math.ceil(o/8);for(r=s;r<128;r++)n.putByte(i[n.at(r-1)+n.at(r-s)&255]);for(n.setAt(128-c,i[n.at(128-c)&255>>(7&o)]),r=127-c;r>=0;r--)n.setAt(r,i[n.at(r+1)^n.at(r+c)]);return n};var s=function(e,t,r){var i,s,o,c,u=!1,l=null,f=null,p=null,h=[];for(o=0,e=a.rc2.expandKey(e,t);o<64;o++)h.push(e.getInt16Le());r?(i=function(e){for(o=0;o<4;o++){var t,r;e[o]+=h[c]+(e[(o+3)%4]&e[(o+2)%4])+(~e[(o+3)%4]&e[(o+1)%4]),e[o]=(t=e[o])<<(r=n[o])&65535|(65535&t)>>16-r,c++}},s=function(e){for(o=0;o<4;o++)e[o]+=h[63&e[(o+3)%4]]}):(i=function(e){for(o=3;o>=0;o--){var t,r;e[o]=(65535&(t=e[o]))>>(r=n[o])|t<<16-r&65535,e[o]-=h[c]+(e[(o+3)%4]&e[(o+2)%4])+(~e[(o+3)%4]&e[(o+1)%4]),c--}},s=function(e){for(o=3;o>=0;o--)e[o]-=h[63&e[(o+3)%4]]});var d=function(e){var t=[];for(o=0;o<4;o++){var a=l.getInt16Le();null!==p&&(r?a^=p.getInt16Le():p.putInt16Le(a)),t.push(65535&a)}c=63*!r;for(var i=0;i<e.length;i++)for(var n=0;n<e[i][0];n++)e[i][1](t);for(o=0;o<4;o++)null!==p&&(r?p.putInt16Le(t[o]):t[o]^=p.getInt16Le()),f.putInt16Le(t[o])},y=null;return y={start:function(e,t){e&&"string"==typeof e&&(e=a.util.createBuffer(e)),u=!1,l=a.util.createBuffer(),f=t||new a.util.createBuffer,p=e,y.output=f},update:function(e){for(u||l.putBuffer(e);l.length()>=8;)d([[5,i],[1,s],[6,i],[1,s],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,l,!r);else{var a=8===l.length()?8:8-l.length();l.fillWithByte(a,a)}if(t&&(u=!0,y.update()),!r&&(t=0===l.length()))if(e)t=e(8,f,!r);else{var i=f.length(),n=f.at(i-1);n>i?t=!1:f.truncate(n)}return t}}};a.rc2.startEncrypting=function(e,t,r){var i=a.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},a.rc2.createEncryptionCipher=function(e,t){return s(e,t,!0)},a.rc2.startDecrypting=function(e,t,r){var i=a.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},a.rc2.createDecryptionCipher=function(e,t){return s(e,t,!1)}},68995,(e,t,r)=>{var a,i,n,s=e.r(2015);t.exports=s.jsbn=s.jsbn||{};function o(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function c(){return new o(null)}function u(e,t,r,a,i,n){for(var s=16383&t,o=t>>14;--n>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*s;i=((c=s*c+((16383&l)<<14)+r.data[a]+i)>>28)+(l>>14)+o*u,r.data[a++]=0xfffffff&c}return i}s.jsbn.BigInteger=o,"u"<typeof navigator?(o.prototype.am=u,a=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(e,t,r,a,i,n){for(var s=32767&t,o=t>>15;--n>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*s;i=((c=s*c+((32767&l)<<15)+r.data[a]+(0x3fffffff&i))>>>30)+(l>>>15)+o*u+(i>>>30),r.data[a++]=0x3fffffff&c}return i},a=30):"Netscape"!=navigator.appName?(o.prototype.am=function(e,t,r,a,i,n){for(;--n>=0;){var s=t*this.data[e++]+r.data[a]+i;i=Math.floor(s/0x4000000),r.data[a++]=0x3ffffff&s}return i},a=26):(o.prototype.am=u,a=28),o.prototype.DB=a,o.prototype.DM=(1<<a)-1,o.prototype.DV=1<<a,o.prototype.FV=0x10000000000000,o.prototype.F1=52-a,o.prototype.F2=2*a-52;var l=[];for(n=0,i=48;n<=9;++n)l[i++]=n;for(n=10,i=97;n<36;++n)l[i++]=n;for(n=10,i=65;n<36;++n)l[i++]=n;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=c();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function v(e,t){return e|t}function C(e,t){return e^t}function E(e,t){return e&~t}function S(){}function T(e){return e}function I(e){this.r2=c(),this.q3=c(),o.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=c();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(o.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=c();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],a=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,a,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},o.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},o.prototype.fromString=function(e,t){if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var r,a=e.length,i=!1,n=0;--a>=0;){var s=8==r?255&e[a]:p(e,a);if(s<0){"-"==e.charAt(a)&&(i=!0);continue}i=!1,0==n?this.data[this.t++]=s:n+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-n)-1)<<n,this.data[this.t++]=s>>this.DB-n):this.data[this.t-1]|=s<<n,(n+=r)>=this.DB&&(n-=this.DB)}8==r&&(128&e[0])!=0&&(this.s=-1,n>0&&(this.data[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},o.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},o.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},o.prototype.lShiftTo=function(e,t){var r,a=e%this.DB,i=this.DB-a,n=(1<<i)-1,s=Math.floor(e/this.DB),o=this.s<<a&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&n)<<a;for(r=s-1;r>=0;--r)t.data[r]=0;t.data[s]=o,t.t=this.t+s+1,t.s=this.s,t.clamp()},o.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t){t.t=0;return}var a=e%this.DB,i=this.DB-a,n=(1<<a)-1;t.data[0]=this.data[r]>>a;for(var s=r+1;s<this.t;++s)t.data[s-r-1]|=(this.data[s]&n)<<i,t.data[s-r]=this.data[s]>>a;a>0&&(t.data[this.t-r-1]|=(this.s&n)<<i),t.t=this.t-r,t.clamp()},o.prototype.subTo=function(e,t){for(var r=0,a=0,i=Math.min(e.t,this.t);r<i;)a+=this.data[r]-e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a-=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a-=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a-=e.s}t.s=a<0?-1:0,a<-1?t.data[r++]=this.DV+a:a>0&&(t.data[r++]=a),t.t=r,t.clamp()},o.prototype.multiplyTo=function(e,t){var r=this.abs(),a=e.abs(),i=r.t;for(t.t=i+a.t;--i>=0;)t.data[i]=0;for(i=0;i<a.t;++i)t.data[i+r.t]=r.am(0,a.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&o.ZERO.subTo(t,t)},o.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var a=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,a,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},o.prototype.divRemTo=function(e,t,r){var a=e.abs();if(!(a.t<=0)){var i=this.abs();if(i.t<a.t){null!=t&&t.fromInt(0),null!=r&&this.copyTo(r);return}null==r&&(r=c());var n=c(),s=this.s,u=e.s,l=this.DB-d(a.data[a.t-1]);l>0?(a.lShiftTo(l,n),i.lShiftTo(l,r)):(a.copyTo(n),i.copyTo(r));var f=n.t,p=n.data[f-1];if(0!=p){var h=p*(1<<this.F1)+(f>1?n.data[f-2]>>this.F2:0),y=this.FV/h,g=(1<<this.F1)/h,m=1<<this.F2,v=r.t,C=v-f,E=null==t?c():t;for(n.dlShiftTo(C,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),o.ONE.dlShiftTo(f,E),E.subTo(n,n);n.t<f;)n.data[n.t++]=0;for(;--C>=0;){var S=r.data[--v]==p?this.DM:Math.floor(r.data[v]*y+(r.data[v-1]+m)*g);if((r.data[v]+=n.am(0,S,r,C,0,f))<S)for(n.dlShiftTo(C,E),r.subTo(E,r);r.data[v]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(f,t),s!=u&&o.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if((1&e)==0)return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},o.prototype.isEven=function(){return(this.t>0?1&this.data[0]:this.s)==0},o.prototype.exp=function(e,t){if(e>0xffffffff||e<1)return o.ONE;var r=c(),a=c(),i=t.convert(this),n=d(e)-1;for(i.copyTo(r);--n>=0;)if(t.sqrTo(r,a),(e&1<<n)>0)t.mulTo(a,i,r);else{var s=r;r=a,a=s}return t.revert(r)},o.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var t,r,a=(1<<t)-1,i=!1,n="",s=this.t,o=this.DB-s*this.DB%t;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(i=!0,n=f(r));s>=0;)o<t?r=(this.data[s]&(1<<o)-1)<<t-o|this.data[--s]>>(o+=this.DB-t):(r=this.data[s]>>(o-=t)&a,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(n+=f(r));return i?n:"0"},o.prototype.negate=function(){var e=c();return o.ZERO.subTo(this,e),e},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(e){var t=c();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(o.ZERO)>0&&e.subTo(t,t),t},o.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new g(t),this.exp(e,r)},o.ZERO=h(0),o.ONE=h(1),S.prototype.convert=T,S.prototype.revert=T,S.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},S.prototype.sqrTo=function(e,t){e.squareTo(t)},I.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(0>e.compareTo(this.m))return e;var t=c();return e.copyTo(t),this.reduce(t),t},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>e.compareTo(this.r2);)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var b=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=0x4000000/b[b.length-1];o.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},o.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),a=h(r),i=c(),n=c(),s="";for(this.divRemTo(a,i,n);i.signum()>0;)s=(r+n.intValue()).toString(e).substr(1)+s,i.divRemTo(a,i,n);return n.intValue().toString(e)+s},o.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),a=Math.pow(t,r),i=!1,n=0,s=0,c=0;c<e.length;++c){var u=p(e,c);if(u<0){"-"==e.charAt(c)&&0==this.signum()&&(i=!0);continue}s=t*s+u,++n>=r&&(this.dMultiply(a),this.dAddOffset(s,0),n=0,s=0)}n>0&&(this.dMultiply(Math.pow(t,n)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(o.ONE.shiftLeft(e-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(o.ONE.shiftLeft(e-1),this);else{var a=[],i=7&e;a.length=(e>>3)+1,t.nextBytes(a),i>0?a[0]&=(1<<i)-1:a[0]=0,this.fromString(a,256)}},o.prototype.bitwiseTo=function(e,t,r){var a,i,n=Math.min(e.t,this.t);for(a=0;a<n;++a)r.data[a]=t(this.data[a],e.data[a]);if(e.t<this.t){for(i=e.s&this.DM,a=n;a<this.t;++a)r.data[a]=t(this.data[a],i);r.t=this.t}else{for(i=this.s&this.DM,a=n;a<e.t;++a)r.data[a]=t(i,e.data[a]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},o.prototype.changeBit=function(e,t){var r=o.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},o.prototype.addTo=function(e,t){for(var r=0,a=0,i=Math.min(e.t,this.t);r<i;)a+=this.data[r]+e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;if(e.t<this.t){for(a+=e.s;r<this.t;)a+=this.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=this.s}else{for(a+=this.s;r<e.t;)a+=e.data[r],t.data[r++]=a&this.DM,a>>=this.DB;a+=e.s}t.s=a<0?-1:0,a>0?t.data[r++]=a:a<-1&&(t.data[r++]=this.DV+a),t.t=r,t.clamp()},o.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},o.prototype.multiplyLowerTo=function(e,t,r){var a,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(a=r.t-this.t;i<a;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(a=Math.min(e.t,t);i<a;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},o.prototype.multiplyUpperTo=function(e,t,r){--t;var a=r.t=this.t+e.t-t;for(r.s=0;--a>=0;)r.data[a]=0;for(a=Math.max(t-this.t,0);a<e.t;++a)r.data[this.t+a-t]=this.am(t-a,e.data[a],r,0,0,this.t+a-t);r.clamp(),r.drShiftTo(1,r)},o.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var a=this.t-1;a>=0;--a)r=(t*r+this.data[a])%e;return r},o.prototype.millerRabin=function(e){var t,r=this.subtract(o.ONE),a=r.getLowestSetBit();if(a<=0)return!1;for(var i=r.shiftRight(a),n={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do t=new o(this.bitLength(),n);while(0>=t.compareTo(o.ONE)||t.compareTo(r)>=0)var c=t.modPow(i,this);if(0!=c.compareTo(o.ONE)&&0!=c.compareTo(r)){for(var u=1;u++<a&&0!=c.compareTo(r);)if(0==(c=c.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=c.compareTo(r))return!1}}return!0},o.prototype.clone=function(){var e=c();return this.copyTo(e),e},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;else if(0==this.t)return -1}else if(1==this.t)return this.data[0];else if(0==this.t)return 0;return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,a=this.DB-e*this.DB%8,i=0;if(e-- >0)for(a<this.DB&&(r=this.data[e]>>a)!=(this.s&this.DM)>>a&&(t[i++]=r|this.s<<this.DB-a);e>=0;)a<8?r=(this.data[e]&(1<<a)-1)<<8-a|this.data[--e]>>(a+=this.DB-8):(r=this.data[e]>>(a-=8)&255,a<=0&&(a+=this.DB,--e)),(128&r)!=0&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},o.prototype.equals=function(e){return 0==this.compareTo(e)},o.prototype.min=function(e){return 0>this.compareTo(e)?this:e},o.prototype.max=function(e){return this.compareTo(e)>0?this:e},o.prototype.and=function(e){var t=c();return this.bitwiseTo(e,m,t),t},o.prototype.or=function(e){var t=c();return this.bitwiseTo(e,v,t),t},o.prototype.xor=function(e){var t=c();return this.bitwiseTo(e,C,t),t},o.prototype.andNot=function(e){var t=c();return this.bitwiseTo(e,E,t),t},o.prototype.not=function(){for(var e=c(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},o.prototype.shiftLeft=function(e){var t=c();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},o.prototype.shiftRight=function(e){var t=c();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},o.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+function(e){if(0==e)return -1;var t=0;return(65535&e)==0&&(e>>=16,t+=16),(255&e)==0&&(e>>=8,t+=8),(15&e)==0&&(e>>=4,t+=4),(3&e)==0&&(e>>=2,t+=2),(1&e)==0&&++t,t}(this.data[e]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=function(e){for(var t=0;0!=e;)e&=e-1,++t;return t}(this.data[r]^t);return e},o.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:(this.data[t]&1<<e%this.DB)!=0},o.prototype.setBit=function(e){return this.changeBit(e,v)},o.prototype.clearBit=function(e){return this.changeBit(e,E)},o.prototype.flipBit=function(e){return this.changeBit(e,C)},o.prototype.add=function(e){var t=c();return this.addTo(e,t),t},o.prototype.subtract=function(e){var t=c();return this.subTo(e,t),t},o.prototype.multiply=function(e){var t=c();return this.multiplyTo(e,t),t},o.prototype.divide=function(e){var t=c();return this.divRemTo(e,t,null),t},o.prototype.remainder=function(e){var t=c();return this.divRemTo(e,null,t),t},o.prototype.divideAndRemainder=function(e){var t=c(),r=c();return this.divRemTo(e,t,r),[t,r]},o.prototype.modPow=function(e,t){var r,a,i=e.bitLength(),n=h(1);if(i<=0)return n;r=i<18?1:i<48?3:i<144?4:i<768?5:6,a=i<8?new y(t):t.isEven()?new I(t):new g(t);var s=[],o=3,u=r-1,l=(1<<r)-1;if(s[1]=a.convert(this),r>1){var f=c();for(a.sqrTo(s[1],f);o<=l;)s[o]=c(),a.mulTo(f,s[o-2],s[o]),o+=2}var p,m,v=e.t-1,C=!0,E=c();for(i=d(e.data[v])-1;v>=0;){for(i>=u?p=e.data[v]>>i-u&l:(p=(e.data[v]&(1<<i+1)-1)<<u-i,v>0&&(p|=e.data[v-1]>>this.DB+i-u)),o=r;(1&p)==0;)p>>=1,--o;if((i-=o)<0&&(i+=this.DB,--v),C)s[p].copyTo(n),C=!1;else{for(;o>1;)a.sqrTo(n,E),a.sqrTo(E,n),o-=2;o>0?a.sqrTo(n,E):(m=n,n=E,E=m),a.mulTo(E,s[p],n)}for(;v>=0&&(e.data[v]&1<<i)==0;)a.sqrTo(n,E),m=n,n=E,E=m,--i<0&&(i=this.DB-1,--v)}return a.revert(n)},o.prototype.modInverse=function(e){if(0==this.signum())return o.ZERO;var t=e.isEven();if(this.isEven()&&t||0==e.signum())return o.ZERO;for(var r=e.clone(),a=this.clone(),i=h(1),n=h(0),s=h(0),c=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&n.isEven()||(i.addTo(this,i),n.subTo(e,n)),i.rShiftTo(1,i)):n.isEven()||n.subTo(e,n),n.rShiftTo(1,n);for(;a.isEven();)a.rShiftTo(1,a),t?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(e,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(a)>=0?(r.subTo(a,r),t&&i.subTo(s,i),n.subTo(c,n)):(a.subTo(r,a),t&&s.subTo(i,s),c.subTo(n,c))}return 0!=a.compareTo(o.ONE)?o.ZERO:c.compareTo(e)>=0?c.subtract(e):0>c.signum()&&(c.addTo(e,c),0>c.signum())?c.add(e):c},o.prototype.pow=function(e){return this.exp(e,new S)},o.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(0>t.compareTo(r)){var a=t;t=r,r=a}var i=t.getLowestSetBit(),n=r.getLowestSetBit();if(n<0)return t;for(i<n&&(n=i),n>0&&(t.rShiftTo(n,t),r.rShiftTo(n,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return n>0&&r.lShiftTo(n,r),r},o.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=b[b.length-1]){for(t=0;t<b.length;++t)if(r.data[0]==b[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<b.length;){for(var a=b[t],i=t+1;i<b.length&&a<A;)a*=b[i++];for(a=r.modInt(a);t<i;)if(a%b[t++]==0)return!1}return r.millerRabin(e)},o.prototype.square=function(){var e=c();return this.squareTo(e),e}},1500,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.sha1=a.sha1||{};a.md.sha1=a.md.algorithms.sha1=i,i.create=function(){s||(n=String.fromCharCode(128)+a.util.fillString("\0",64),s=!0);var e=null,t=a.util.createBuffer(),r=Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return i.start=function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,n=0;n<r;++n)i.fullMessageLength.push(0);return t=a.util.createBuffer(),e={h0:0x67452301,h1:0xefcdab89,h2:0x98badcfe,h3:0x10325476,h4:0xc3d2e1f0},i},i.start(),i.update=function(n,s){"utf8"===s&&(n=a.util.encodeUtf8(n));var c=n.length;i.messageLength+=c,c=[c/0x100000000>>>0,c>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=c[1],c[1]=c[0]+(i.fullMessageLength[u]/0x100000000>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,c[0]=c[1]/0x100000000>>>0;return t.putBytes(n),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var s,c=a.util.createBuffer();c.putBytes(t.bytes());var u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;c.putBytes(n.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/0x100000000>>>0,c.putInt32(l>>>0),l=s>>>0;c.putInt32(l);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(p,r,c);var h=a.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h},i};var n=null,s=!1;function o(e,t,r){for(var a,i,n,s,o,c,u,l,f=r.length();f>=64;){for(l=0,i=e.h0,n=e.h1,s=e.h2,o=e.h3,c=e.h4;l<16;++l)a=r.getInt32(),t[l]=a,a=(i<<5|i>>>27)+(o^n&(s^o))+c+0x5a827999+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<20;++l)a=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31,t[l]=a,a=(i<<5|i>>>27)+(o^n&(s^o))+c+0x5a827999+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<32;++l)a=(a=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|a>>>31,t[l]=a,a=(i<<5|i>>>27)+(n^s^o)+c+0x6ed9eba1+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<40;++l)a=(a=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|a>>>30,t[l]=a,a=(i<<5|i>>>27)+(n^s^o)+c+0x6ed9eba1+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<60;++l)a=(a=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|a>>>30,t[l]=a,a=(i<<5|i>>>27)+(n&s|o&(n^s))+c+0x8f1bbcdc+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;for(;l<80;++l)a=(a=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|a>>>30,t[l]=a,a=(i<<5|i>>>27)+(n^s^o)+c+0xca62c1d6+a,c=o,o=s,s=(n<<30|n>>>2)>>>0,n=i,i=a;e.h0=e.h0+i|0,e.h1=e.h1+n|0,e.h2=e.h2+s|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,f-=64}}},36748,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(2828),e.r(1500);var i=t.exports=a.pkcs1=a.pkcs1||{};function n(e,t,r){r||(r=a.md.sha1.create());for(var i="",n=Math.ceil(t/r.digestLength),s=0;s<n;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(e+o),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){"string"==typeof r?(i=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=a.md.sha1.create(),c||(c=o);var i,s,o,c,u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l){var f=Error("RSAES-OAEP input message length is too long.");throw f.length=t.length,f.maxLength=l,f}i||(i=""),o.update(i,"raw");for(var p=o.digest(),h="",d=l-t.length,y=0;y<d;y++)h+="\0";var g=p.getBytes()+h+"\x01"+t;if(s){if(s.length!==o.digestLength){var f=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");throw f.seedLength=s.length,f.digestLength=o.digestLength,f}}else s=a.random.getBytes(o.digestLength);var m=n(s,u-o.digestLength-1,c),v=a.util.xorBytes(g,m,g.length),C=n(v,o.digestLength,c);return"\0"+a.util.xorBytes(s,C,s.length)+v},i.decode_rsa_oaep=function(e,t,r){"string"==typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var i,s,o,c=Math.ceil(e.n.bitLength()/8);if(t.length!==c){var u=Error("RSAES-OAEP encoded message length is invalid.");throw u.length=t.length,u.expectedLength=c,u}if(void 0===s?s=a.md.sha1.create():s.start(),o||(o=s),c<2*s.digestLength+2)throw Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var l=s.digest().getBytes(),f=t.charAt(0),p=t.substring(1,s.digestLength+1),h=t.substring(1+s.digestLength),d=n(h,s.digestLength,o),y=n(a.util.xorBytes(p,d,p.length),c-s.digestLength-1,o),g=a.util.xorBytes(h,y,h.length),m=g.substring(0,s.digestLength),u="\0"!==f,v=0;v<s.digestLength;++v)u|=l.charAt(v)!==m.charAt(v);for(var C=1,E=s.digestLength,S=s.digestLength;S<g.length;S++){var T=g.charCodeAt(S),I=1&T^1;u|=T&65534*!!C,C&=I,E+=C}if(u||1!==g.charCodeAt(E))throw Error("Invalid RSAES-OAEP padding.");return g.substring(E+1)}},92054,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(68995),e.r(2828),function(){if(a.prime){t.exports=a.prime;return}var e=t.exports=a.prime=a.prime||{},r=a.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],n=new r(null);n.fromInt(30);var s=function(e,t){return e|t};function o(e,t,r,n){var s,o=c(e,t),u=(s=o.bitLength())<=100?27:s<=150?18:s<=200?15:s<=250?12:s<=300?9:s<=350?8:s<=400?7:s<=500?6:s<=600?5:s<=800?4:s<=1250?3:2;"millerRabinTests"in r&&(u=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function e(t,r,n,s,o,u,l){var f=+new Date;do{if(t.bitLength()>r&&(t=c(r,n)),t.isProbablePrime(o))return l(null,t);t.dAddOffset(i[s++%8],0)}while(u<0||new Date-f<u)a.util.setImmediate(function(){e(t,r,n,s,o,u,l)})}(o,e,t,0,u,l,n)}function c(e,t){var a=new r(e,t),i=e-1;return a.testBit(i)||a.bitwiseTo(r.ONE.shiftLeft(i),s,a),a.dAddOffset(31-a.mod(n).byteValue(),0),a}e.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var n,s,u,l,f=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof f&&(f={name:f}),f.options=f.options||{};var p=t.prng||a.random;if("PRIMEINC"===f.name){return n=e,s={nextBytes:function(e){for(var t=p.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=f.options,l=i,"workers"in u?function(e,t,i,n){if("u"<typeof Worker)return o(e,t,i,n);var s=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,p=i.workerScript||"forge/prime.worker.js";if(-1===u)return a.util.estimateCores(function(e,t){e&&(t=2),u=t-1,h()});function h(){u=Math.max(1,u);for(var a=[],i=0;i<u;++i)a[i]=new Worker(p);for(var o=u,i=0;i<u;++i)a[i].addEventListener("message",d);var h=!1;function d(i){if(!h){--o;var u=i.data;if(u.found){for(var p=0;p<a.length;++p)a[p].terminate();return h=!0,n(null,new r(u.prime,16))}s.bitLength()>e&&(s=c(e,t));var d=s.toString(16);i.target.postMessage({hex:d,workLoad:l}),s.dAddOffset(f,0)}}}h()}(n,s,u,l):o(n,s,u,l)}throw Error("Invalid prime generation algorithm: "+f.name)}}()},32721,(e,t,r)=>{var a=e.r(2015);if(e.r(74723),e.r(68995),e.r(31808),e.r(36748),e.r(92054),e.r(2828),e.r(26706),void 0===i)var i=a.jsbn.BigInteger;var n=a.util.isNodejs?e.r(54799):null,s=a.asn1,o=a.util;a.pki=a.pki||{},t.exports=a.pki.rsa=a.rsa=a.rsa||{};var c=a.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},h=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d={name:"DigestInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},y=function(e){if(e.algorithm in c.oids)t=c.oids[e.algorithm];else{var t,r=Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}var a=s.oidToDer(t).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);n.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,a)),n.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(n),i.value.push(o),s.toDer(i).getBytes()},g=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do n=new i(a.util.bytesToHex(a.random.getBytes(t.n.bitLength()/8)),16);while(n.compareTo(t.n)>=0||!n.gcd(t.n).equals(i.ONE))for(var n,s=(e=e.multiply(n.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);0>s.compareTo(o);)s=s.add(t.p);var c=s.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c.multiply(n.modInverse(t.n)).mod(t.n)};function m(e,t,r){var i,n=a.util.createBuffer(),s=Math.ceil(t.n.bitLength()/8);if(e.length>s-11){var o=Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=s-11,o}n.putByte(0),n.putByte(r);var c=s-3-e.length;if(0===r||1===r){i=255*(0!==r);for(var u=0;u<c;++u)n.putByte(i)}else for(;c>0;){for(var l=0,f=a.random.getBytes(c),u=0;u<c;++u)0===(i=f.charCodeAt(u))?++l:n.putByte(i);c=l}return n.putByte(0),n.putBytes(e),n}function v(e,t,r,i,n){var s=Math.ceil(t.n.bitLength()/8),o=a.util.createBuffer(e),c=o.getByte(),u=o.getByte();if(0!==c||r&&0!==u&&1!==u||!r&&2!==u||r&&0===u&&void 0===i)throw Error("Encryption block is invalid.");var l=0;if(0===u){l=s-3-i;for(var f=0;f<l;++f)if(0!==o.getByte())throw Error("Encryption block is invalid.")}else if(1===u){for(l=0;o.length()>1;){if(255!==o.getByte()){--o.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw Error("Encryption block is invalid.")}else if(2===u){for(l=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++l}if(l<8&&!(n&&n._skipPaddingChecks))throw Error("Encryption block is invalid.")}if(0!==o.getByte()||l!==s-3-o.length())throw Error("Encryption block is invalid.");return o.getBytes()}function C(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=a.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&(128&r.charCodeAt(1))==0||255===r.charCodeAt(0)&&(128&r.charCodeAt(1))==128)?r.substr(1):r}function E(e){return a.util.isNodejs&&"function"==typeof n[e]}function S(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function T(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function I(e){for(var t=a.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}c.rsa.encrypt=function(e,t,r){var n,s=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,n=m(e,t,r)):(n=a.util.createBuffer()).putBytes(e);for(var c=g(new i(n.toHex(),16),t,s).toString(16),u=a.util.createBuffer(),l=o-Math.ceil(c.length/2);l>0;)u.putByte(0),--l;return u.putBytes(a.util.hexToBytes(c)),u.getBytes()},c.rsa.decrypt=function(e,t,r,n){var s=Math.ceil(t.n.bitLength()/8);if(e.length!==s){var o=Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=s,o}var c=new i(a.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw Error("Encrypted message is invalid.");for(var u=g(c,t,r).toString(16),l=a.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)l.putByte(0),--f;return(l.putBytes(a.util.hexToBytes(u)),!1!==n)?v(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var n,s=(r=r||{}).prng||a.random,o=r.algorithm||"PRIMEINC";if("PRIMEINC"===o)(n={algorithm:o,state:0,bits:e,rng:{nextBytes:function(e){for(var t=s.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(n.eInt);else throw Error("Invalid key generation algorithm: "+o);return n},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r,a=new i(null);a.fromInt(30);for(var n=0,s=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f,p=null===e.p?e.pBits:e.qBits,h=p-1;0===e.pqState?(e.num=new i(p,e.rng),e.num.testBit(h)||e.num.bitwiseTo(i.ONE.shiftLeft(h),s,e.num),e.num.dAddOffset(31-e.num.mod(a).byteValue(),0),n=0,++e.pqState):1===e.pqState?e.num.bitLength()>p?e.pqState=0:e.num.isProbablePrime((f=e.num.bitLength())<=100?27:f<=150?18:f<=200?15:f<=250?12:f<=300?9:f<=350?8:f<=400?7:f<=500?6:f<=600?5:f<=800?4:f<=1250?3:2)?++e.pqState:e.num.dAddOffset(u[n++%8],0):2===e.pqState?e.pqState=3*(0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)):3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)0>e.p.compareTo(e.q)&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(r=+new Date)-o,o=r}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,u){if(1==arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(u=e,e=void 0):2==arguments.length?"number"==typeof e?"function"==typeof t?(u=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,u=t,e=void 0,t=void 0):3==arguments.length&&("number"==typeof t?"function"==typeof r&&(u=r,r=void 0):(u=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!a.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t)){if(u){if(E("generateKeyPair"))return n.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(e,t,r){if(e)return u(e);u(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})});if(S("generateKey")&&S("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:I(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){u(e)}).then(function(e){if(e){var t=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(e)));u(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}});if(T("generateKey")&&T("exportKey")){var l=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:I(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);l.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(s.fromDer(a.util.createBuffer(t)));u(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){u(e)}},l.onerror=function(e){u(e)};return}}else if(E("generateKeyPairSync")){var f=n.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(f.privateKey),publicKey:c.publicKeyFromPem(f.publicKey)}}}var p=c.rsa.createKeyPairGenerationState(e,t,r);if(!u)return c.rsa.stepKeyPairGenerationState(p,0),p.keys;var h=p,d=r,y=u;"function"==typeof d&&(y=d,d={});var g={algorithm:{name:(d=d||{}).algorithm||"PRIMEINC",options:{workers:d.workers||2,workLoad:d.workLoad||100,workerScript:d.workerScript}}};function m(){v(h.pBits,function(e,t){return e?y(e):(h.p=t,null!==h.q)?C(e,h.q):void v(h.qBits,C)})}function v(e,t){a.prime.generateProbablePrime(e,g,t)}function C(e,t){if(e)return y(e);if(h.q=t,0>h.p.compareTo(h.q)){var r=h.p;h.p=h.q,h.q=r}if(0!==h.p.subtract(i.ONE).gcd(h.e).compareTo(i.ONE)){h.p=null,m();return}if(0!==h.q.subtract(i.ONE).gcd(h.e).compareTo(i.ONE)){h.q=null,v(h.qBits,C);return}if(h.p1=h.p.subtract(i.ONE),h.q1=h.q.subtract(i.ONE),h.phi=h.p1.multiply(h.q1),0!==h.phi.gcd(h.e).compareTo(i.ONE)){h.p=h.q=null,m();return}if(h.n=h.p.multiply(h.q),h.n.bitLength()!==h.bits){h.q=null,v(h.qBits,C);return}var a=h.e.modInverse(h.phi);h.keys={privateKey:c.rsa.setPrivateKey(h.n,h.e,a,h.p,h.q,a.mod(h.p1),a.mod(h.q1),h.q.modInverse(h.p)),publicKey:c.rsa.setPublicKey(h.n,h.e)},y(null,h.keys)}"prng"in d&&(g.prng=d.prng),m()},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t};return r.encrypt=function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return m(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return a.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw Error('Unsupported encryption scheme: "'+t+'".');var n=t.encode(e,r,!0);return c.rsa.encrypt(n,r,!0)},r.verify=function(e,t,i,n){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===n&&(n={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in n||(n._parseAllDigestBytes=!0),"_skipPaddingChecks"in n||(n._skipPaddingChecks=!1),"RSASSA-PKCS1-V1_5"===i?i={verify:function(e,t){t=v(t,r,!0,void 0,n);var i=s.fromDer(t,{parseAllBytes:n._parseAllDigestBytes}),o={},c=[];if(!s.validate(i,d,o,c)||2!==i.value.length){var u=Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw u.errors=c,u}var l=s.derToOid(o.algorithmIdentifier);if(l!==a.oids.md2&&l!==a.oids.md5&&l!==a.oids.sha1&&l!==a.oids.sha224&&l!==a.oids.sha256&&l!==a.oids.sha384&&l!==a.oids.sha512&&l!==a.oids["sha512-224"]&&l!==a.oids["sha512-256"]){var u=Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw u.oid=l,u}if((l===a.oids.md2||l===a.oids.md5)&&!("parameters"in o))throw Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return e===o.digest}}:("NONE"===i||"NULL"===i||null===i)&&(i={verify:function(e,t){return e===(t=v(t,r,!0,void 0,n))}});var o=c.rsa.decrypt(t,r,!0,!1);return i.verify(e,o,r.n.bitLength())},r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,i,n,s,o,u){var l={n:e,e:t,d:r,p:i,q:n,dP:s,dQ:o,qInv:u};return l.decrypt=function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:v};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return a.pkcs1.decode_rsa_oaep(t,e,r)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={decode:function(e){return e}};else throw Error('Unsupported encryption scheme: "'+t+'".');return t.decode(i,l,!1)},l.sign=function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:y},r=1):("NONE"===t||"NULL"===t||null===t)&&(t={encode:function(){return e}},r=1);var a=t.encode(e,l.n.bitLength());return c.rsa.encrypt(a,l,r)},l},c.wrapRsaPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,n,o,u,p,h,d,y={},g=[];if(s.validate(e,l,y,g)&&(e=s.fromDer(a.util.createBuffer(y.privateKey))),y={},g=[],!s.validate(e,f,y,g)){var m=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=g,m}return t=a.util.createBuffer(y.privateKeyModulus).toHex(),r=a.util.createBuffer(y.privateKeyPublicExponent).toHex(),n=a.util.createBuffer(y.privateKeyPrivateExponent).toHex(),o=a.util.createBuffer(y.privateKeyPrime1).toHex(),u=a.util.createBuffer(y.privateKeyPrime2).toHex(),p=a.util.createBuffer(y.privateKeyExponent1).toHex(),h=a.util.createBuffer(y.privateKeyExponent2).toHex(),d=a.util.createBuffer(y.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new i(t,16),new i(r,16),new i(n,16),new i(o,16),new i(u,16),new i(p,16),new i(h,16),new i(d,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(s.validate(e,h,t,r)){var n=s.derToOid(t.publicKeyOid);if(n!==c.oids.rsaEncryption){var o=Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}e=t.rsaPublicKey}if(r=[],!s.validate(e,p,t,r)){var o=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var u=a.util.createBuffer(t.publicKeyModulus).toHex(),l=a.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(u,16),new i(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(c.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,C(e.e))])}},38720,(e,t,r)=>{var a=e.r(2015);if(e.r(1258),e.r(74723),e.r(30369),e.r(5189),e.r(31808),e.r(80399),e.r(93139),e.r(2828),e.r(63045),e.r(32721),e.r(26706),void 0===i)var i=a.jsbn.BigInteger;var n=a.asn1,s=a.pki=a.pki||{};t.exports=s.pbe=a.pbe=a.pbe||{};var o=s.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:n.Class.UNIVERSAL,type:n.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:n.Class.UNIVERSAL,type:n.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:n.Class.UNIVERSAL,type:n.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:n.Class.UNIVERSAL,type:n.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function p(e){var t;if(e){if(!(t=s.oids[n.derToOid(e)])){var r=Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return h(t)}function h(e){var t=a.md;switch(e){case"hmacWithSHA224":t=a.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw Error("Unknown hash algorithm: "+e);return t[e].create()}s.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i=a.random.getBytesSync(r.saltSize),c=r.count,u=n.integerToDer(c);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){switch(r.algorithm){case"aes128":g=16,C=16,E=o["aes128-CBC"],S=a.aes.createEncryptionCipher;break;case"aes192":g=24,C=16,E=o["aes192-CBC"],S=a.aes.createEncryptionCipher;break;case"aes256":g=32,C=16,E=o["aes256-CBC"],S=a.aes.createEncryptionCipher;break;case"des":g=8,C=8,E=o.desCBC,S=a.des.createEncryptionCipher;break;default:var l,f,p,d,y,g,m,v,C,E,S,T=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw T.algorithm=r.algorithm,T}var I="hmacWith"+r.prfAlgorithm.toUpperCase(),b=h(I),A=a.pkcs5.pbkdf2(t,i,c,g,b),B=a.random.getBytesSync(C),x=S(A);x.start(B),x.update(n.toDer(e)),x.finish(),v=x.output.getBytes();var N=(l=i,f=u,p=g,d=I,y=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,l),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,f.getBytes())]),"hmacWithSHA1"!==d&&y.value.push(n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,a.util.hexToBytes(p.toString(16))),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(s.oids[d]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])),y);m=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.pkcs5PBES2).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o.pkcs5PBKDF2).getBytes()),N]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(E).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,B)])])])}else if("3des"===r.algorithm){g=24;var R=new a.util.ByteBuffer(i),A=s.pbe.generatePkcs12Key(t,R,1,c,g),B=s.pbe.generatePkcs12Key(t,R,2,c,g),x=a.des.createEncryptionCipher(A);x.start(B),x.update(n.toDer(e)),x.finish(),v=x.output.getBytes(),m=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,i),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,u.getBytes())])])}else{var T=Error("Cannot encrypt private key. Unknown encryption algorithm.");throw T.algorithm=r.algorithm,T}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[m,n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,v)])},s.decryptPrivateKeyInfo=function(e,t){var r=null,i={},o=[];if(!n.validate(e,c,i,o)){var u=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=o,u}var l=n.derToOid(i.encryptionOid),f=s.pbe.getCipher(l,i.encryptionParams,t),p=a.util.createBuffer(i.encryptedData);return f.update(p),f.finish()&&(r=n.fromDer(f.output)),r},s.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:n.toDer(e).getBytes()};return a.pem.encode(r,{maxline:t})},s.encryptedPrivateKeyFromPem=function(e){var t=a.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return n.fromDer(t.body)},s.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i,o,c,u,l=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));return l=s.encryptPrivateKeyInfo(l,t,r),s.encryptedPrivateKeyToPem(l)}switch(r.algorithm){case"aes128":i="AES-128-CBC",c=16,o=a.random.getBytesSync(16),u=a.aes.createEncryptionCipher;break;case"aes192":i="AES-192-CBC",c=24,o=a.random.getBytesSync(16),u=a.aes.createEncryptionCipher;break;case"aes256":i="AES-256-CBC",c=32,o=a.random.getBytesSync(16),u=a.aes.createEncryptionCipher;break;case"3des":i="DES-EDE3-CBC",c=24,o=a.random.getBytesSync(8),u=a.des.createEncryptionCipher;break;case"des":i="DES-CBC",c=8,o=a.random.getBytesSync(8),u=a.des.createEncryptionCipher;break;default:var f=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var p=u(a.pbe.opensslDeriveBytes(t,o.substr(0,8),c));p.start(o),p.update(n.toDer(s.privateKeyToAsn1(e))),p.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:i,parameters:a.util.bytesToHex(o).toUpperCase()},body:p.output.getBytes()};return a.pem.encode(h)},s.decryptRsaPrivateKey=function(e,t){var r=null,i=a.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type){var o=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(i.procType&&"ENCRYPTED"===i.procType.type){switch(i.dekInfo.algorithm){case"DES-CBC":c=8,u=a.des.createDecryptionCipher;break;case"DES-EDE3-CBC":c=24,u=a.des.createDecryptionCipher;break;case"AES-128-CBC":c=16,u=a.aes.createDecryptionCipher;break;case"AES-192-CBC":c=24,u=a.aes.createDecryptionCipher;break;case"AES-256-CBC":c=32,u=a.aes.createDecryptionCipher;break;case"RC2-40-CBC":c=5,u=function(e){return a.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":c=8,u=function(e){return a.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":c=16,u=function(e){return a.rc2.createDecryptionCipher(e,128)};break;default:var c,u,o=Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".');throw o.algorithm=i.dekInfo.algorithm,o}var l=a.util.hexToBytes(i.dekInfo.parameters),f=u(a.pbe.opensslDeriveBytes(t,l.substr(0,8),c));if(f.start(l),f.update(a.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(n.fromDer(r),t):n.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(e,t,r,i,n,s){if(null==s){if(!("sha1"in a.md))throw Error('"sha1" hash algorithm unavailable.');s=a.md.sha1.create()}var o,c,u=s.digestLength,l=s.blockLength,f=new a.util.ByteBuffer,p=new a.util.ByteBuffer;if(null!=e){for(c=0;c<e.length;c++)p.putInt16(e.charCodeAt(c));p.putInt16(0)}var h=p.length(),d=t.length(),y=new a.util.ByteBuffer;y.fillWithByte(r,l);var g=l*Math.ceil(d/l),m=new a.util.ByteBuffer;for(c=0;c<g;c++)m.putByte(t.at(c%d));var v=l*Math.ceil(h/l),C=new a.util.ByteBuffer;for(c=0;c<v;c++)C.putByte(p.at(c%h));var E=m;E.putBuffer(C);for(var S=Math.ceil(n/u),T=1;T<=S;T++){var I=new a.util.ByteBuffer;I.putBytes(y.bytes()),I.putBytes(E.bytes());for(var b=0;b<i;b++)s.start(),s.update(I.getBytes()),I=s.digest();var A=new a.util.ByteBuffer;for(c=0;c<l;c++)A.putByte(I.at(c%u));var B=Math.ceil(d/l)+Math.ceil(h/l),x=new a.util.ByteBuffer;for(o=0;o<B;o++){var N=new a.util.ByteBuffer(E.getBytes(l)),R=511;for(c=A.length()-1;c>=0;c--)R>>=8,R+=A.at(c)+N.at(c),N.setAt(c,255&R);x.putBuffer(N)}E=x,f.putBuffer(I)}return f.truncate(f.length()-n),f},s.pbe.getCipher=function(e,t,r){switch(e){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(e,t,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(e,t,r);default:var a=Error("Cannot read encrypted PBE data block. Unsupported OID.");throw a.oid=e,a.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],a}},s.pbe.getCipherForPBES2=function(e,t,r){var i,o,c={},l=[];if(!n.validate(t,u,c,l)){var f=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw f.errors=l,f}if((e=n.derToOid(c.kdfOid))!==s.oids.pkcs5PBKDF2){var f=Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw f.oid=e,f.supportedOids=["pkcs5PBKDF2"],f}if((e=n.derToOid(c.encOid))!==s.oids["aes128-CBC"]&&e!==s.oids["aes192-CBC"]&&e!==s.oids["aes256-CBC"]&&e!==s.oids["des-EDE3-CBC"]&&e!==s.oids.desCBC){var f=Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw f.oid=e,f.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],f}var h=c.kdfSalt,d=a.util.createBuffer(c.kdfIterationCount);switch(d=d.getInt(d.length()<<3),s.oids[e]){case"aes128-CBC":i=16,o=a.aes.createDecryptionCipher;break;case"aes192-CBC":i=24,o=a.aes.createDecryptionCipher;break;case"aes256-CBC":i=32,o=a.aes.createDecryptionCipher;break;case"des-EDE3-CBC":i=24,o=a.des.createDecryptionCipher;break;case"desCBC":i=8,o=a.des.createDecryptionCipher}var y=p(c.prfOid),g=a.pkcs5.pbkdf2(r,h,d,i,y),m=c.encIv,v=o(g);return v.start(m),v},s.pbe.getCipherForPKCS12PBE=function(e,t,r){var i,o,c,u={},f=[];if(!n.validate(t,l,u,f)){var h=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw h.errors=f,h}var d=a.util.createBuffer(u.salt),y=a.util.createBuffer(u.iterations);switch(y=y.getInt(y.length()<<3),e){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:i=24,o=8,c=a.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:i=5,o=8,c=function(e,t){var r=a.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var h=Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw h.oid=e,h}var g=p(u.prfOid),m=s.pbe.generatePkcs12Key(r,d,1,y,i,g);return g.start(),c(m,s.pbe.generatePkcs12Key(r,d,2,y,o,g))},s.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in a.md))throw Error('"md5" hash algorithm unavailable.');i=a.md.md5.create()}null===t&&(t="");for(var n=[f(i,e+t)],s=16,o=1;s<r;++o,s+=16)n.push(f(i,n[o-1]+e+t));return n.join("").substr(0,r)}},93197,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(26706);var i=a.asn1,n=t.exports=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=a.pkcs7||{},a.pkcs7.asn1=n;var s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};n.contentInfoValidator=s;var o={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};n.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},n.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};n.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},s,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},n.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},39839,(e,t,r)=>{var a=e.r(2015);e.r(26706),a.mgf=a.mgf||{},(t.exports=a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new a.util.ByteBuffer,n=Math.ceil(r/e.digestLength),s=0;s<n;s++){var o=new a.util.ByteBuffer;o.putInt32(s),e.start(),e.update(t+o.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},46551,(e,t,r)=>{var a=e.r(2015);e.r(39839),t.exports=a.mgf=a.mgf||{},a.mgf.mgf1=a.mgf1},15992,(e,t,r)=>{var a=e.r(2015);e.r(2828),e.r(26706),(t.exports=a.pss=a.pss||{}).create=function(e){3==arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,n=r.digestLength,s=e.salt||null;if("string"==typeof s&&(s=a.util.createBuffer(s)),"saltLength"in e)t=e.saltLength;else if(null!==s)t=s.length();else throw Error("Salt length not specified or specific salt not given.");if(null!==s&&s.length()!==t)throw Error("Given salt length does not match length of given salt.");var o=e.prng||a.random,c={};return c.encode=function(e,c){var u,l,f=c-1,p=Math.ceil(f/8),h=e.digest().getBytes();if(p<n+t+2)throw Error("Message is too long to encrypt.");l=null===s?o.getBytesSync(t):s.bytes();var d=new a.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(h),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),g=new a.util.ByteBuffer;g.fillWithByte(0,p-t-n-2),g.putByte(1),g.putBytes(l);var m=g.getBytes(),v=p-n-1,C=i.generate(y,v),E="";for(u=0;u<v;u++)E+=String.fromCharCode(m.charCodeAt(u)^C.charCodeAt(u));return(E=String.fromCharCode(E.charCodeAt(0)&~(65280>>8*p-f&255))+E.substr(1))+y+String.fromCharCode(188)},c.verify=function(e,s,o){var c,u=o-1,l=Math.ceil(u/8);if(s=s.substr(-l),l<n+t+2)throw Error("Inconsistent parameters to PSS signature verification.");if(188!==s.charCodeAt(l-1))throw Error("Encoded message does not end in 0xBC.");var f=l-n-1,p=s.substr(0,f),h=s.substr(f,n),d=65280>>8*l-u&255;if((p.charCodeAt(0)&d)!=0)throw Error("Bits beyond keysize not zero as expected.");var y=i.generate(h,f),g="";for(c=0;c<f;c++)g+=String.fromCharCode(p.charCodeAt(c)^y.charCodeAt(c));g=String.fromCharCode(g.charCodeAt(0)&~d)+g.substr(1);var m=l-n-t-2;for(c=0;c<m;c++)if(0!==g.charCodeAt(c))throw Error("Leftmost octets not zero as expected");if(1!==g.charCodeAt(m))throw Error("Inconsistent PSS signature, 0x01 marker not found");var v=g.substr(-t),C=new a.util.ByteBuffer;return C.fillWithByte(0,8),C.putBytes(e),C.putBytes(v),r.start(),r.update(C.getBytes()),h===r.digest().getBytes()},c}},9166,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(74723),e.r(30369),e.r(5189),e.r(46551),e.r(31808),e.r(93139),e.r(15992),e.r(32721),e.r(26706);var i=a.asn1,n=t.exports=a.pki=a.pki||{},s=n.oids,o={};o.CN=s.commonName,o.commonName="CN",o.C=s.countryName,o.countryName="C",o.L=s.localityName,o.localityName="L",o.ST=s.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=s.organizationName,o.organizationName="O",o.OU=s.organizationalUnitName,o.organizationalUnitName="OU",o.E=s.emailAddress,o.emailAddress="E";var c=a.pki.rsa.publicKeyValidator,u={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},c,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},c,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},p={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function h(e,t){"string"==typeof t&&(t={shortName:t});for(var r,a=null,i=0;null===a&&i<e.attributes.length;++i)r=e.attributes[i],t.type&&t.type===r.type||t.name&&t.name===r.name?a=r:t.shortName&&t.shortName===r.shortName&&(a=r);return a}n.RDNAttributesAsArray=function(e,t){for(var r,a,n,c=[],u=0;u<e.value.length;++u){r=e.value[u];for(var l=0;l<r.value.length;++l)n={},a=r.value[l],n.type=i.derToOid(a.value[0].value),n.value=a.value[1].value,n.valueTagClass=a.value[1].type,n.type in s&&(n.name=s[n.type],n.name in o&&(n.shortName=o[n.name])),t&&(t.update(n.type),t.update(n.value)),c.push(n)}return c},n.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var a=e[r],c=i.derToOid(a.value[0].value),u=a.value[1].value,l=0;l<u.length;++l){var f={};if(f.type=c,f.value=u[l].value,f.valueTagClass=u[l].type,f.type in s&&(f.name=s[f.type],f.name in o&&(f.shortName=o[f.name])),f.type===s.extensionRequest){f.extensions=[];for(var p=0;p<f.value.length;++p)f.extensions.push(n.certificateExtensionFromAsn1(f.value[p]))}t.push(f)}return t};var d=function(e,t,r){var a={};if(e!==s["RSASSA-PSS"])return a;r&&(a={hash:{algorithmOid:s.sha1},mgf:{algorithmOid:s.mgf1,hash:{algorithmOid:s.sha1}},saltLength:20});var n={},o=[];if(!i.validate(t,l,n,o)){var c=Error("Cannot read RSASSA-PSS parameter block.");throw c.errors=o,c}return void 0!==n.hashOid&&(a.hash=a.hash||{},a.hash.algorithmOid=i.derToOid(n.hashOid)),void 0!==n.maskGenOid&&(a.mgf=a.mgf||{},a.mgf.algorithmOid=i.derToOid(n.maskGenOid),a.mgf.hash=a.mgf.hash||{},a.mgf.hash.algorithmOid=i.derToOid(n.maskGenHashOid)),void 0!==n.saltLength&&(a.saltLength=n.saltLength.charCodeAt(0)),a},y=function(e){switch(s[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return a.md.sha1.create();case"md5WithRSAEncryption":return a.md.md5.create();case"sha256WithRSAEncryption":case"RSASSA-PSS":return a.md.sha256.create();case"sha384WithRSAEncryption":return a.md.sha384.create();case"sha512WithRSAEncryption":return a.md.sha512.create();default:var t=Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},g=function(e){var t,r,i,n=e.certificate;switch(n.signatureOid){case s.sha1WithRSAEncryption:case s.sha1WithRSASignature:break;case s["RSASSA-PSS"]:if(void 0===(r=s[n.signatureParameters.mgf.hash.algorithmOid])||void 0===a.md[r]){var o=Error("Unsupported MGF hash function.");throw o.oid=n.signatureParameters.mgf.hash.algorithmOid,o.name=r,o}if(void 0===(i=s[n.signatureParameters.mgf.algorithmOid])||void 0===a.mgf[i]){var o=Error("Unsupported MGF function.");throw o.oid=n.signatureParameters.mgf.algorithmOid,o.name=i,o}if(i=a.mgf[i].create(a.md[r].create()),void 0===(r=s[n.signatureParameters.hash.algorithmOid])||void 0===a.md[r]){var o=Error("Unsupported RSASSA-PSS hash function.");throw o.oid=n.signatureParameters.hash.algorithmOid,o.name=r,o}t=a.pss.create(a.md[r].create(),i,n.signatureParameters.saltLength)}return n.publicKey.verify(e.md.digest().getBytes(),e.signature,t)};function m(e){for(var t,r,n=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),s=e.attributes,o=0;o<s.length;++o){var c=(t=s[o]).value,u=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass)===i.Type.UTF8&&(c=a.util.encodeUtf8(c)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,u,!1,c)])]),n.value.push(r)}return n}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in n.oids?t.name=n.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=n.oids[o[t.shortName]])),void 0===t.type)if(t.name&&t.name in n.oids)t.type=n.oids[t.name];else{var a=Error("Attribute type not specified.");throw a.attribute=t,a}if(void 0===t.shortName&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===s.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var c=0;c<t.extensions.length;++c)t.value.push(n.certificateExtensionToAsn1(C(t.extensions[c])))}if(void 0===t.value){var a=Error("Attribute value not specified.");throw a.attribute=t,a}}}function C(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in n.oids&&(e.name=n.oids[e.id]),void 0===e.id)if(e.name&&e.name in n.oids)e.id=n.oids[e.name];else{var r=Error("Extension ID not specified.");throw r.extension=e,r}if(void 0!==e.value)return e;if("keyUsage"===e.name){var o=0,c=0,u=0;e.digitalSignature&&(c|=128,o=7),e.nonRepudiation&&(c|=64,o=6),e.keyEncipherment&&(c|=32,o=5),e.dataEncipherment&&(c|=16,o=4),e.keyAgreement&&(c|=8,o=3),e.keyCertSign&&(c|=4,o=2),e.cRLSign&&(c|=2,o=1),e.encipherOnly&&(c|=1,o=0),e.decipherOnly&&(u|=128,o=7);var l=String.fromCharCode(o);0!==u?l+=String.fromCharCode(c)+String.fromCharCode(u):0!==c&&(l+=String.fromCharCode(c)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,l)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var f=e.value.value;for(var p in e)!0===e[p]&&(p in s?f.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s[p]).getBytes())):-1!==p.indexOf(".")&&f.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(p).getBytes())))}else if("nsCertType"===e.name){var o=0,c=0;e.client&&(c|=128,o=7),e.server&&(c|=64,o=6),e.email&&(c|=32,o=5),e.objsign&&(c|=16,o=4),e.reserved&&(c|=8,o=3),e.sslCA&&(c|=4,o=2),e.emailCA&&(c|=2,o=1),e.objCA&&(c|=1,o=0);var l=String.fromCharCode(o);0!==c&&(l+=String.fromCharCode(c)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,l)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h,d=0;d<e.altNames.length;++d){var l=(h=e.altNames[d]).value;if(7===h.type&&h.ip){if(null===(l=a.util.bytesFromIP(h.ip))){var r=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else 8===h.type&&(l=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(l));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,l))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var y=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=y.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,y.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var f=e.value.value;if(e.keyIdentifier){var g=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;f.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,g))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];f.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var C=a.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);f.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,C))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h,f=e.value.value,E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),S=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]),d=0;d<e.altNames.length;++d){var l=(h=e.altNames[d]).value;if(7===h.type&&h.ip){if(null===(l=a.util.bytesFromIP(h.ip))){var r=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');throw r.extension=e,r}}else 8===h.type&&(l=h.oid?i.oidToDer(i.oidToDer(h.oid)):i.oidToDer(l));S.value.push(i.create(i.Class.CONTEXT_SPECIFIC,h.type,!1,l))}E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[S])),f.push(E)}if(void 0===e.value){var r=Error("Extension value not specified.");throw r.extension=e,r}return e}function E(e,t){if(e!==s["RSASSA-PSS"])return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"");var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}n.certificateFromPem=function(e,t,r){var s=a.pem.decode(e)[0];if("CERTIFICATE"!==s.type&&"X509 CERTIFICATE"!==s.type&&"TRUSTED CERTIFICATE"!==s.type){var o=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var c=i.fromDer(s.body,r);return n.certificateFromAsn1(c,t)},n.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(n.certificateToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.publicKeyFromPem=function(e){var t=a.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return n.publicKeyFromAsn1(s)},n.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(n.publicKeyToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(n.publicKeyToRSAPublicKey(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.getPublicKeyFingerprint=function(e,t){var r,s=(t=t||{}).md||a.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(n.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(n.publicKeyToAsn1(e)).getBytes();break;default:throw Error('Unknown fingerprint type "'+t.type+'".')}s.start(),s.update(r);var o=s.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw Error('Unknown encoding "'+t.encoding+'".');return o},n.certificationRequestFromPem=function(e,t,r){var s=a.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==s.type){var o=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=s.type,o}if(s.procType&&"ENCRYPTED"===s.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");var c=i.fromDer(s.body,r);return n.certificationRequestFromAsn1(c,t)},n.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(n.certificationRequestToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.createCertificate=function(){var e={};return e.version=2,e.serialNumber="00",e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return h(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)C(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,a=null,i=0;null===a&&i<e.extensions.length;++i)r=e.extensions[i],t.id&&r.id===t.id?a=r:t.name&&r.name===t.name&&(a=r);return a},e.sign=function(t,r){e.md=r||a.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=n.getTBSCertificate(e);var u=i.toDer(e.tbsCertificate);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var a=t.issuer,s=e.subject,o=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw o.expectedIssuer=s.attributes,o.actualIssuer=a.attributes,o}var c=t.md;if(null===c){c=y({signatureOid:t.signatureOid,type:"certificate"});var u=t.tbsCertificate||n.getTBSCertificate(t),l=i.toDer(u);c.update(l.getBytes())}return null!==c&&(r=g({certificate:e,md:c,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,a=e.issuer,i=t.subject;if(a.hash&&i.hash)r=a.hash===i.hash;else if(a.attributes.length===i.attributes.length){r=!0;for(var n,s,o=0;r&&o<a.attributes.length;++o)n=a.attributes[o],s=i.attributes[o],(n.type!==s.type||n.value!==s.value)&&(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return n.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=s.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var n=e.generateSubjectKeyIdentifier().getBytes();return a.util.hexToBytes(i.subjectKeyIdentifier)===n}}return!1},e},n.certificateFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,u,r,s)){var o=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw o.errors=s,o}if(i.derToOid(r.publicKeyOid)!==n.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var c=n.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0,c.serialNumber=a.util.createBuffer(r.certSerialNumber).toHex(),c.signatureOid=a.asn1.derToOid(r.certSignatureOid),c.signatureParameters=d(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=a.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var l=[];if(void 0!==r.certValidity1UTCTime&&l.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&l.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&l.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&l.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),l.length>2)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(l.length<2)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=l[0],c.validity.notAfter=l[1],c.tbsCertificate=r.tbsCertificate,t){c.md=y({signatureOid:c.signatureOid,type:"certificate"});var f=i.toDer(c.tbsCertificate);c.md.update(f.getBytes())}var p=a.md.sha1.create(),g=i.toDer(r.certIssuer);p.update(g.getBytes()),c.issuer.getField=function(e){return h(c.issuer,e)},c.issuer.addField=function(e){v([e]),c.issuer.attributes.push(e)},c.issuer.attributes=n.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=p.digest().toHex();var m=a.md.sha1.create(),C=i.toDer(r.certSubject);return m.update(C.getBytes()),c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){v([e]),c.subject.attributes.push(e)},c.subject.attributes=n.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=n.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=n.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},n.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var a=e.value[r],i=0;i<a.value.length;++i)t.push(n.certificateExtensionFromAsn1(a.value[i]));return t},n.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in s){if(t.name=s[t.id],"keyUsage"===t.name){var r=i.fromDer(t.value),n=0,o=0;r.value.length>1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),t.digitalSignature=(128&n)==128,t.nonRepudiation=(64&n)==64,t.keyEncipherment=(32&n)==32,t.dataEncipherment=(16&n)==16,t.keyAgreement=(8&n)==8,t.keyCertSign=(4&n)==4,t.cRLSign=(2&n)==2,t.encipherOnly=(1&n)==1,t.decipherOnly=(128&o)==128}else if("basicConstraints"===t.name){var r=i.fromDer(t.value);r.value.length>0&&r.value[0].type===i.Type.BOOLEAN?t.cA=0!==r.value[0].value.charCodeAt(0):t.cA=!1;var c=null;r.value.length>0&&r.value[0].type===i.Type.INTEGER?c=r.value[0].value:r.value.length>1&&(c=r.value[1].value),null!==c&&(t.pathLenConstraint=i.derToInteger(c))}else if("extKeyUsage"===t.name)for(var r=i.fromDer(t.value),u=0;u<r.value.length;++u){var l=i.derToOid(r.value[u].value);l in s?t[s[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){var r=i.fromDer(t.value),n=0;r.value.length>1&&(n=r.value.charCodeAt(1)),t.client=(128&n)==128,t.server=(64&n)==64,t.email=(32&n)==32,t.objsign=(16&n)==16,t.reserved=(8&n)==8,t.sslCA=(4&n)==4,t.emailCA=(2&n)==2,t.objCA=(1&n)==1}else if("subjectAltName"===t.name||"issuerAltName"===t.name){t.altNames=[];for(var f,r=i.fromDer(t.value),p=0;p<r.value.length;++p){var h={type:(f=r.value[p]).type,value:f.value};switch(t.altNames.push(h),f.type){case 1:case 2:case 6:break;case 7:h.ip=a.util.bytesToIP(f.value);break;case 8:h.oid=i.derToOid(f.value)}}}else if("subjectKeyIdentifier"===t.name){var r=i.fromDer(t.value);t.subjectKeyIdentifier=a.util.bytesToHex(r.value)}}return t},n.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,p,r,s)){var o=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw o.errors=s,o}if(i.derToOid(r.publicKeyOid)!==n.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var c=n.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=a.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=d(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=a.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=d(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){c.md=y({signatureOid:c.signatureOid,type:"certification request"});var u=i.toDer(c.certificationRequestInfo);c.md.update(u.getBytes())}var l=a.md.sha1.create();return c.subject.getField=function(e){return h(c.subject,e)},c.subject.addField=function(e){v([e]),c.subject.attributes.push(e)},c.subject.attributes=n.RDNAttributesAsArray(r.certificationRequestInfoSubject,l),c.subject.hash=l.digest().toHex(),c.publicKey=n.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return h(c,e)},c.addAttribute=function(e){v([e]),c.attributes.push(e)},c.attributes=n.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},n.createCertificationRequest=function(){var e={};return e.version=0,e.signatureOid=null,e.signature=null,e.siginfo={},e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return h(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return h(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||a.md.sha1.create();var o=s[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=n.getCertificationRequestInfo(e);var u=i.toDer(e.certificationRequestInfo);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){r=y({signatureOid:e.signatureOid,type:"certification request"});var a=e.certificationRequestInfo||n.getCertificationRequestInfo(e),s=i.toDer(a);r.update(s.getBytes())}return null!==r&&(t=g({certificate:e,md:r,signature:e.signature})),t},e};var S=new Date("1950-01-01T00:00:00Z"),T=new Date("2050-01-01T00:00:00Z");function I(e){return e>=S&&e<T?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}n.getTBSCertificate=function(e){var t=I(e.validity.notBefore),r=I(e.validity.notAfter),s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),E(e.siginfo.algorithmOid,e.siginfo.parameters)]),m(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),m(e.subject),n.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.issuer.uniqueId)])),e.subject.uniqueId&&s.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.subject.uniqueId)])),e.extensions.length>0&&s.value.push(n.certificateExtensionsToAsn1(e.extensions)),s},n.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),m(e.subject),n.publicKeyToAsn1(e.publicKey),function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,n=0;n<r.length;++n){var s=r[n],o=s.value,c=i.Type.UTF8;"valueTagClass"in s&&(c=s.valueTagClass),c===i.Type.UTF8&&(o=a.util.encodeUtf8(o));var u=!1;"valueConstructed"in s&&(u=s.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,c,u,o)])]);t.value.push(l)}return t}(e)])},n.distinguishedNameToAsn1=function(e){return m(e)},n.certificateToAsn1=function(e){var t=e.tbsCertificate||n.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.signature)])},n.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var a=0;a<e.length;++a)r.value.push(n.certificateExtensionToAsn1(e[a]));return t},n.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},n.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||n.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),E(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,"\0"+e.signature)])},n.createCaStore=function(e){var t={certs:{}};function r(e){return s(e),t.certs[e.hash]||null}function s(e){if(!e.hash){var t=a.md.sha1.create();e.attributes=n.RDNAttributesAsArray(m(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=a.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];a.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=a.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;a.util.isArray(t)||(t=[t]);for(var s=i.toDer(n.certificateToAsn1(e)).getBytes(),o=0;o<t.length;++o)if(s===i.toDer(n.certificateToAsn1(t[o])).getBytes())return!0;return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(a.util.isArray(i))for(var n=0;n<i.length;++n)e.push(i[n]);else e.push(i)}return e},t.removeCertificate=function(e){if("string"==typeof e&&(e=a.pki.certificateFromPem(e)),s(e.subject),!t.hasCertificate(e))return null;var o,c=r(e.subject);if(!a.util.isArray(c))return o=t.certs[e.subject.hash],delete t.certs[e.subject.hash],o;for(var u=i.toDer(n.certificateToAsn1(e)).getBytes(),l=0;l<c.length;++l)u===i.toDer(n.certificateToAsn1(c[l])).getBytes()&&(o=c[l],c.splice(l,1));return 0===c.length&&delete t.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var c=e[o];t.addCertificate(c)}return t},n.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},n.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),s=r.validityCheckDate;void 0===s&&(s=new Date);var o=!0,c=null,u=0;do{var l=t.shift(),f=null,p=!1;if(s&&(s<l.validity.notBefore||s>l.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:n.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:s}),null===c){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(p=!0,f=l),f){var h=f;a.util.isArray(h)||(h=[h]);for(var d=!1;!d&&h.length>0;){f=h.shift();try{d=f.verify(l)}catch(e){}}d||(c={message:"Certificate signature is invalid.",error:n.certificateError.bad_certificate})}null!==c||f&&!p||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:n.certificateError.unknown_ca})}if(null===c&&f&&!l.isIssuer(f)&&(c={message:"Certificate issuer is invalid.",error:n.certificateError.bad_certificate}),null===c)for(var y={keyUsage:!0,basicConstraints:!0},g=0;null===c&&g<l.extensions.length;++g){var m=l.extensions[g];!m.critical||m.name in y||(c={message:"Certificate has an unsupported critical extension.",error:n.certificateError.unsupported_certificate})}if(null===c&&(!o||0===t.length&&(!f||p))){var v=l.getExtension("basicConstraints"),C=l.getExtension("keyUsage");null===C||C.keyCertSign&&null!==v||(c={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:n.certificateError.bad_certificate}),null===c&&null===v&&(c={message:"Certificate is missing basicConstraints extension and cannot be used as a CA.",error:n.certificateError.bad_certificate}),null!==c||null===v||v.cA||(c={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:n.certificateError.bad_certificate}),null===c&&null!==C&&"pathLenConstraint"in v&&u-1>v.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:n.certificateError.bad_certificate})}var E=null===c||c.error,S=r.verify?r.verify(E,u,i):E;if(!0===S)c=null;else throw!0===E&&(c={message:"The application rejected the certificate.",error:n.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||a.util.isArray(S)?"string"==typeof S&&(c.error=S):(S.message&&(c.message=S.message),S.error&&(c.error=S.error))),c;o=!1,++u}while(t.length>0)return!0}},76915,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(82140),e.r(31808),e.r(93197),e.r(38720),e.r(2828),e.r(32721),e.r(1500),e.r(26706),e.r(9166);var i=a.asn1,n=a.pki,s=t.exports=a.pkcs12=a.pkcs12||{},o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},c={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},u={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function p(e,t,r,a){for(var i=[],n=0;n<e.length;n++)for(var s=0;s<e[n].safeBags.length;s++){var o=e[n].safeBags[s];if(void 0===a||o.type===a){if(null===t){i.push(o);continue}void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&i.push(o)}}return i}function h(e){if(e.composed||e.constructed){for(var t=a.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}s.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var d={};if(!i.validate(e,c,d,[])){var y=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw y.errors=y,y}var g={version:d.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=a.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=p(g.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=p(g.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=p(g.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return p(g.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return p(g.safeContents,"localKeyId",e,t)}};if(3!==d.version.charCodeAt(0)){var y=Error("PKCS#12 PFX of version other than 3 not supported.");throw y.version=d.version.charCodeAt(0),y}if(i.derToOid(d.contentType)!==n.oids.data){var y=Error("Only PKCS#12 PFX in password integrity mode supported.");throw y.oid=i.derToOid(d.contentType),y}var m=d.content.value[0];if(m.tagClass!==i.Class.UNIVERSAL||m.type!==i.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(m=h(m),d.mac){var v=null,C=0,E=i.derToOid(d.macAlgorithm);switch(E){case n.oids.sha1:v=a.md.sha1.create(),C=20;break;case n.oids.sha256:v=a.md.sha256.create(),C=32;break;case n.oids.sha384:v=a.md.sha384.create(),C=48;break;case n.oids.sha512:v=a.md.sha512.create(),C=64;break;case n.oids.md5:v=a.md.md5.create(),C=16}if(null===v)throw Error("PKCS#12 uses unsupported MAC algorithm: "+E);var S=new a.util.ByteBuffer(d.macSalt),T="macIterations"in d?parseInt(a.util.bytesToHex(d.macIterations),16):1,I=s.generateKey(r,S,3,T,C,v),b=a.hmac.create();if(b.start(v,I),b.update(m.value),b.getMac().getBytes()!==d.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(e.value)&&e.value.length>2)throw Error("Invalid PKCS#12. macData field present but MAC was not validated.");return function(e,t,r,s){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var c=0;c<t.value.length;c++){var p=t.value[c],d={},y=[];if(!i.validate(p,o,d,y)){var g=Error("Cannot read ContentInfo.");throw g.errors=y,g}var m={encrypted:!1},v=null,C=d.content.value[0];switch(i.derToOid(d.contentType)){case n.oids.data:if(C.tagClass!==i.Class.UNIVERSAL||C.type!==i.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");v=h(C).value;break;case n.oids.encryptedData:v=function(e,t){var r={},s=[];if(!i.validate(e,a.pkcs7.asn1.encryptedDataValidator,r,s)){var o=Error("Cannot read EncryptedContentInfo.");throw o.errors=s,o}var c=i.derToOid(r.contentType);if(c!==n.oids.data){var o=Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");throw o.oid=c,o}c=i.derToOid(r.encAlgorithm);var u=n.pbe.getCipher(c,r.encParameter,t),l=h(r.encryptedContentAsn1),f=a.util.createBuffer(l.value);if(u.update(f),!u.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");return u.output.getBytes()}(C,s),m.encrypted=!0;break;default:var g=Error("Unsupported PKCS#12 contentType.");throw g.contentType=i.derToOid(d.contentType),g}m.safeBags=function(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var a=[],s=0;s<e.value.length;s++){var o,c,p=e.value[s],h={},d=[];if(!i.validate(p,u,h,d)){var y=Error("Cannot read SafeBag.");throw y.errors=d,y}var g={type:i.derToOid(h.bagId),attributes:function(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var a={},s=[];if(!i.validate(e[r],l,a,s)){var o=Error("Cannot read PKCS#12 BagAttribute.");throw o.errors=s,o}var c=i.derToOid(a.oid);if(void 0!==n.oids[c]){t[n.oids[c]]=[];for(var u=0;u<a.values.length;++u)t[n.oids[c]].push(a.values[u].value)}}return t}(h.bagAttributes)};a.push(g);var m=h.bagValue.value[0];switch(g.type){case n.oids.pkcs8ShroudedKeyBag:if(null===(m=n.decryptPrivateKeyInfo(m,r)))throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case n.oids.keyBag:try{g.key=n.privateKeyFromAsn1(m)}catch(e){g.key=null,g.asn1=m}continue;case n.oids.certBag:o=f,c=function(){if(i.derToOid(h.certId)!==n.oids.x509Certificate){var e=Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(h.certId),e}var r=i.fromDer(h.cert,t);try{g.cert=n.certificateFromAsn1(r,!0)}catch(e){g.cert=null,g.asn1=r}};break;default:var y=Error("Unsupported PKCS#12 SafeBag type.");throw y.oid=g.type,y}if(void 0!==o&&!i.validate(m,o,h,d)){var y=Error("Cannot read PKCS#12 "+o.name);throw y.errors=d,y}c()}return a}(v,r,s),e.safeContents.push(m)}}(g,m.value,t,r),g},s.toPkcs12Asn1=function(e,t,r,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var c,u,l=o.localKeyId;if(null!==l)l=a.util.hexToBytes(l);else if(o.generateLocalKeyId)if(t){var f=a.util.isArray(t)?t[0]:t;"string"==typeof f&&(f=n.certificateFromPem(f));var p=a.md.sha1.create();p.update(i.toDer(n.certificateToAsn1(f)).getBytes()),l=p.digest().getBytes()}else l=a.random.getBytes(20);var h=[];null!==l&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,l)])])),"friendlyName"in o&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,o.friendlyName)])])),h.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,h));var d=[],y=[];null!==t&&(y=a.util.isArray(t)?t:[t]);for(var g=[],m=0;m<y.length;++m){"string"==typeof(t=y[m])&&(t=n.certificateFromPem(t));var v=0===m?c:void 0,C=n.certificateToAsn1(t),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])])]),v]);g.push(E)}if(g.length>0){var S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,g),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(S).getBytes())])]);d.push(T)}var I=null;if(null!==e){var b=n.wrapRsaPrivateKey(n.privateKeyToAsn1(e));I=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[b]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[n.encryptPrivateKeyInfo(b,r,o)]),c]);var A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[I]),B=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(A).getBytes())])]);d.push(B)}var x=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d);if(o.useMac){var p=a.md.sha1.create(),N=new a.util.ByteBuffer(a.random.getBytes(o.saltSize)),R=o.count,e=s.generateKey(r,N,3,R,20),k=a.hmac.create();k.start(p,e),k.update(i.toDer(x).getBytes());var _=k.getMac();u=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,N.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(R).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(x).getBytes())])]),u])},s.generateKey=a.pbe.generatePkcs12Key},68256,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(31808),e.r(38720),e.r(93139),e.r(80399),e.r(76915),e.r(15992),e.r(32721),e.r(26706),e.r(9166);var i=a.asn1,n=t.exports=a.pki=a.pki||{};n.pemToDer=function(e){var t=a.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert PEM to DER; PEM is encrypted.");return a.util.createBuffer(t.body)},n.privateKeyFromPem=function(e){var t=a.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert private key from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return n.privateKeyFromAsn1(s)},n.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(n.privateKeyToAsn1(e)).getBytes()};return a.pem.encode(r,{maxline:t})},n.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return a.pem.encode(r,{maxline:t})}},45771,(e,t,r)=>{var a=e.r(2015);e.r(74723),e.r(82140),e.r(99073),e.r(93139),e.r(68256),e.r(2828),e.r(1500),e.r(26706);var i=function(e,t,r,i){var n=a.util.createBuffer(),s=e.length>>1,o=s+(1&e.length),c=e.substr(0,o),u=e.substr(s,o),l=a.util.createBuffer(),f=a.hmac.create();r=t+r;var p=Math.ceil(i/16),h=Math.ceil(i/20);f.start("MD5",c);var d=a.util.createBuffer();l.putBytes(r);for(var y=0;y<p;++y)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),d.putBuffer(f.digest());f.start("SHA1",u);var g=a.util.createBuffer();l.clear(),l.putBytes(r);for(var y=0;y<h;++y)f.start(null,null),f.update(l.getBytes()),l.putBuffer(f.digest()),f.start(null,null),f.update(l.bytes()+r),g.putBuffer(f.digest());return n.putBytes(a.util.xorBytes(d.getBytes(),g.getBytes(),i)),n},n=function(e,t,r){var i=!1;try{var n=e.deflate(t.fragment.getBytes());t.fragment=a.util.createBuffer(n),t.length=n.length,i=!0}catch(e){}return i},s=function(e,t,r){var i=!1;try{var n=e.inflate(t.fragment.getBytes());t.fragment=a.util.createBuffer(n),t.length=n.length,i=!0}catch(e){}return i},o=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return a.util.createBuffer(e.getBytes(r))},c=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},u={};u.Versions={TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}},u.SupportedVersions=[u.Versions.TLS_1_1,u.Versions.TLS_1_0],u.Version=u.SupportedVersions[0],u.MaxFragment=15360,u.ConnectionEnd={server:0,client:1},u.PRFAlgorithm={tls_prf_sha256:0},u.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},u.CipherType={stream:0,block:1,aead:2},u.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},u.CompressionMethod={none:0,deflate:1},u.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},u.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},u.Alert={},u.Alert.Level={warning:1,fatal:2},u.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},u.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},u.CipherSuites={},u.getCipherSuite=function(e){var t=null;for(var r in u.CipherSuites){var a=u.CipherSuites[r];if(a.id[0]===e.charCodeAt(0)&&a.id[1]===e.charCodeAt(1)){t=a;break}}return t},u.handleUnexpected=function(e,t){(e.open||e.entity!==u.ConnectionEnd.client)&&e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})},u.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var i=null,n=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:n?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var s=t.fragment,c=s.length();if(i={version:{major:s.getByte(),minor:s.getByte()},random:a.util.createBuffer(s.getBytes(32)),session_id:o(s,1),extensions:[]},n?(i.cipher_suite=s.getBytes(2),i.compression_method=s.getByte()):(i.cipher_suites=o(s,2),i.compression_methods=o(s,1)),(c=r-(c-s.length()))>0){for(var l=o(s,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!n)for(var f=0;f<i.extensions.length;++f){var p=i.extensions[f];if(0===p.type[0]&&0===p.type[1])for(var h=o(p.data,2);h.length()>0&&0===h.getByte();)e.session.extensions.server_name.serverNameList.push(o(h,2).getBytes())}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(n)e.session.cipherSuite=u.getCipherSuite(i.cipher_suite);else for(var d=a.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(e.session.cipherSuite=u.getCipherSuite(d.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(i.cipher_suite)});n?e.session.compressionMethod=i.compression_method:e.session.compressionMethod=u.CompressionMethod.none}return i},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,a=t.random.bytes(),i=r?e.session.sp.client_random:a,n=r?a:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:n}},u.handleServerHello=function(e,t,r){var a=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(a.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=a.version.minor,e.session.version=e.version;var i=a.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=a.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,a)),e.session.id=i,e.process()}},u.handleClientHello=function(e,t,r){var i,n=u.parseHelloMessage(e,t,r);if(!e.fail){var s=n.session_id.bytes(),o=null;if(e.sessionCache&&(null===(o=e.sessionCache.getSession(s))?s="":(o.version.major!==n.version.major||o.version.minor>n.version.minor)&&(o=null,s="")),0===s.length&&(s=a.random.getBytes(32)),e.session.id=s,e.session.clientHelloVersion=n.version,e.session.sp={},o)e.version=e.session.version=o.version,e.session.sp=o.sp;else{for(var c=1;c<u.SupportedVersions.length&&!((i=u.SupportedVersions[c]).minor<=n.version.minor);++c);e.version={major:i.major,minor:i.minor},e.session.version=e.version}null!==o?(e.expect=S,e.session.resuming=!0,e.session.sp.client_random=n.random.bytes()):(e.expect=!1!==e.verifyClient?v:C,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.open=!0,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHello(e)})),e.session.resuming?(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))):(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)})),e.fail||(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerKeyExchange(e)})),!1!==e.verifyClient&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateRequest(e)})),u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHelloDone(e)})))),u.flush(e),e.process()}},u.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i,n,s={certificate_list:o(t.fragment,3)},c=[];try{for(;s.certificate_list.length()>0;)i=o(s.certificate_list,3),n=a.asn1.fromDer(i),i=a.pki.certificateFromAsn1(n,!0),c.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var l=e.entity===u.ConnectionEnd.client;(l||!0===e.verifyClient)&&0===c.length?e.error(e,{message:l?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}):0===c.length?e.expect=l?f:C:(l?e.session.serverCertificate=c[0]:e.session.clientCertificate=c[0],u.verifyCertificateChain(e,c)&&(e.expect=l?f:C)),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=p,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var i={enc_pre_master_secret:o(t.fragment,2).getBytes()},n=null;if(e.getPrivateKey)try{n=e.getPrivateKey(e,e.session.serverCertificate),n=a.pki.privateKeyFromPem(n)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===n)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=n.decrypt(i.enc_pre_master_secret);var c=e.session.clientHelloVersion;if(c.major!==s.pre_master_secret.charCodeAt(0)||c.minor!==s.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.")}catch(e){s.pre_master_secret=a.random.getBytes(48)}e.expect=S,null!==e.session.clientCertificate&&(e.expect=E),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var a=t.fragment,i={certificate_types:o(a,1),certificate_authorities:o(a,2)};e.session.certificateRequest=i,e.expect=h,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var n=i.bytes();i.read+=4;var s={signature:o(i,2).getBytes()},c=a.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,s.signature,"NONE"))throw Error("CertificateVerify signature does not match.");e.session.md5.update(n),e.session.sha1.update(n)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=S,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},n=e.verify(e,i.alert.description,0,[]);if(!0!==n)return(n||0===n)&&("object"!=typeof n||a.util.isArray(n)?"number"==typeof n&&(i.alert.description=n):(n.message&&(i.message=n.message),n.alert&&(i.alert.description=n.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=m;var s=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=d,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return s(e,null);u.getClientSignature(e,s)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?y:T,e.process()},u.handleFinished=function(e,t,r){var n=t.fragment;n.read-=4;var s=n.bytes();n.read+=4;var o=t.fragment.getBytes();(n=a.util.createBuffer()).putBuffer(e.session.md5.digest()),n.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client;if((n=i(e.session.sp.master_secret,c?"server finished":"client finished",n.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(s),e.session.sha1.update(s),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?g:I,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,a=t.fragment,i={level:a.getByte(),description:a.getByte()};switch(i.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:i}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),n=r.getInt24();if(n>r.length())return e.fragmented=t,t.fragment=a.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var s=r.bytes(n+4);r.read+=4,i in O[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),i!==u.HandshakeType.hello_request&&i!==u.HandshakeType.certificate_verify&&i!==u.HandshakeType.finished&&(e.session.md5.update(s),e.session.sha1.update(s)),O[e.entity][e.expect][i](e,t,n)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),n=r.getInt16(),s=r.getBytes(n);if(i===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||n>s.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,s)})),u.flush(e)}else if(i===u.HeartbeatMessageType.heartbeat_response){if(s!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,a.util.createBuffer(s))}e.process()};var l=1,f=2,p=3,h=4,d=5,y=6,g=7,m=8,v=1,C=2,E=3,S=4,T=5,I=6,b=u.handleUnexpected,A=u.handleChangeCipherSpec,B=u.handleAlert,x=u.handleHandshake,N=u.handleApplicationData,R=u.handleHeartbeat,k=[];k[u.ConnectionEnd.client]=[[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[A,B,b,b,R],[b,B,x,b,R],[b,B,x,N,R],[b,B,x,b,R]],k[u.ConnectionEnd.server]=[[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[b,B,x,b,R],[A,B,b,b,R],[b,B,x,b,R],[b,B,x,N,R],[b,B,x,b,R]];var _=u.handleHelloRequest,L=u.handleServerHello,w=u.handleCertificate,U=u.handleServerKeyExchange,D=u.handleCertificateRequest,P=u.handleServerHelloDone,V=u.handleFinished,O=[];O[u.ConnectionEnd.client]=[[b,b,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,w,U,D,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,U,D,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,D,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,P,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,V],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[_,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]];var K=u.handleClientHello,M=u.handleClientKeyExchange,F=u.handleCertificateVerify;O[u.ConnectionEnd.server]=[[b,K,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,w,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,M,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,F,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,V],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b],[b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b]],u.generateKeys=function(e,t){var r=t.client_random+t.server_random;e.session.resuming||(t.master_secret=i(t.pre_master_secret,"master secret",r,48).bytes(),t.pre_master_secret=null),r=t.server_random+t.client_random;var a=2*t.mac_key_length+2*t.enc_key_length,n=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;n&&(a+=2*t.fixed_iv_length);var s=i(t.master_secret,"key expansion",r,a),o={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return n&&(o.client_write_IV=s.getBytes(t.fixed_iv_length),o.server_write_IV=s.getBytes(t.fixed_iv_length)),o},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){0xffffffff===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},a={read:r(),write:r()};if(a.read.update=function(e,t){return a.read.cipherFunction(t,a.read)?a.read.compressFunction(e,t,a.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},a.write.update=function(e,t){return a.write.compressFunction(e,t,a.write)?a.write.cipherFunction(t,a.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=u.generateKeys(e,i),a.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,a.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(a,e,i),i.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:a.read.compressFunction=s,a.write.compressFunction=n;break;default:throw Error("Unsupported compression algorithm.")}}return a},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=a.util.createBuffer();return r.putInt32(t),r.putBytes(a.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=a.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=a.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var n=t.length(),s=a.util.createBuffer();s.putByte(u.CompressionMethod.none);var o=s.length(),l=a.util.createBuffer();if(e.virtualHost){var f=a.util.createBuffer();f.putByte(0),f.putByte(0);var p=a.util.createBuffer();p.putByte(0),c(p,2,a.util.createBuffer(e.virtualHost));var h=a.util.createBuffer();c(h,2,p),c(f,2,h),l.putBuffer(f)}var d=l.length();d>0&&(d+=2);var y=e.session.id,g=y.length+1+2+4+28+2+n+1+o+d,m=a.util.createBuffer();return m.putByte(u.HandshakeType.client_hello),m.putInt24(g),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),c(m,1,a.util.createBuffer(y)),c(m,2,t),c(m,1,s),d>0&&c(m,2,l),m},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=a.util.createBuffer();return i.putByte(u.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,a.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var n=a.util.createBuffer();if(null!==i)try{a.util.isArray(i)||(i=[i]);for(var s=null,o=0;o<i.length;++o){var l=a.pem.decode(i[o])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var f=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw f.headerType=l.type,f}if(l.procType&&"ENCRYPTED"===l.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var p=a.util.createBuffer(l.body);null===s&&(s=a.asn1.fromDer(p.bytes(),!1));var h=a.util.createBuffer();c(h,3,p),n.putBuffer(h)}i=a.pki.certificateFromAsn1(s),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var d=3+n.length(),y=a.util.createBuffer();return y.putByte(u.HandshakeType.certificate),y.putInt24(d),c(y,3,n),y},u.createClientKeyExchange=function(e){var t=a.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(a.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,n=a.util.createBuffer();return n.putByte(u.HandshakeType.client_key_exchange),n.putInt24(i),n.putInt16(t.length),n.putBytes(t),n},u.createServerKeyExchange=function(e){return a.util.createBuffer()},u.getClientSignature=function(e,t){var r=a.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=a.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},u.createCertificateVerify=function(e,t){var r=t.length+2,i=a.util.createBuffer();return i.putByte(u.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},u.createCertificateRequest=function(e){var t=a.util.createBuffer();t.putByte(1);var r=a.util.createBuffer();for(var i in e.caStore.certs){var n=e.caStore.certs[i],s=a.pki.distinguishedNameToAsn1(n.subject),o=a.asn1.toDer(s);r.putInt16(o.length()),r.putBuffer(o)}var l=1+t.length()+2+r.length(),f=a.util.createBuffer();return f.putByte(u.HandshakeType.certificate_request),f.putInt24(l),c(f,1,t),c(f,2,r),f},u.createServerHelloDone=function(e){var t=a.util.createBuffer();return t.putByte(u.HandshakeType.server_hello_done),t.putInt24(0),t},u.createChangeCipherSpec=function(){var e=a.util.createBuffer();return e.putByte(1),e},u.createFinished=function(e){var t=a.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===u.ConnectionEnd.client;t=i(e.session.sp.master_secret,r?"client finished":"server finished",t.getBytes(),12);var n=a.util.createBuffer();return n.putByte(u.HandshakeType.finished),n.putInt24(t.length()),n.putBuffer(t),n},u.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=a.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var n=Math.max(16,i.length()-r-3);return i.putBytes(a.random.getBytes(n)),i},u.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==u.ContentType.handshake&&t.type!==u.ContentType.alert&&t.type!==u.ContentType.change_cipher_spec)){if(t.type===u.ContentType.handshake){var r,i=t.fragment.bytes();e.session.md5.update(i),e.session.sha1.update(i),i=null}if(t.fragment.length()<=u.MaxFragment)r=[t];else{r=[];for(var n=t.fragment.bytes();n.length>u.MaxFragment;)r.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(n.slice(0,u.MaxFragment))})),n=n.slice(u.MaxFragment);n.length>0&&r.push(u.createRecord(e,{type:t.type,data:a.util.createBuffer(n)}))}for(var s=0;s<r.length&&!e.fail;++s){var o=r[s];e.state.current.write.update(e,o)&&e.records.push(o)}}},u.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var j=function(e){switch(e){case!0:return!0;case a.pki.certificateError.bad_certificate:return u.Alert.Description.bad_certificate;case a.pki.certificateError.unsupported_certificate:return u.Alert.Description.unsupported_certificate;case a.pki.certificateError.certificate_revoked:return u.Alert.Description.certificate_revoked;case a.pki.certificateError.certificate_expired:return u.Alert.Description.certificate_expired;case a.pki.certificateError.certificate_unknown:return u.Alert.Description.certificate_unknown;case a.pki.certificateError.unknown_ca:return u.Alert.Description.unknown_ca;default:return u.Alert.Description.bad_certificate}},H=function(e){switch(e){case!0:return!0;case u.Alert.Description.bad_certificate:return a.pki.certificateError.bad_certificate;case u.Alert.Description.unsupported_certificate:return a.pki.certificateError.unsupported_certificate;case u.Alert.Description.certificate_revoked:return a.pki.certificateError.certificate_revoked;case u.Alert.Description.certificate_expired:return a.pki.certificateError.certificate_expired;case u.Alert.Description.certificate_unknown:return a.pki.certificateError.certificate_unknown;case u.Alert.Description.unknown_ca:return a.pki.certificateError.unknown_ca;default:return a.pki.certificateError.bad_certificate}};for(var G in u.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){j(t);var n=e.verify(e,t,r,i);if(!0!==n){if("object"==typeof n&&!a.util.isArray(n)){var s=Error("The application rejected the certificate.");throw s.send=!0,s.alert={level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate},n.message&&(s.message=n.message),n.alert&&(s.alert.description=n.alert),s}n!==t&&(n=H(n))}return n},a.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var n=t;("object"!=typeof n||a.util.isArray(n))&&(n={send:!0,alert:{level:u.Alert.Level.fatal,description:j(t)}}),"send"in n||(n.send=!0),"alert"in n||(n.alert={level:u.Alert.Level.fatal,description:j(n.error)}),e.error(e,n)}return!e.fail},u.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=a.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache){for(var n in t=r.cache[i],delete r.cache[i],r.order)if(r.order[n]===i){r.order.splice(n,1);break}}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}var i=a.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?a.util.isArray(e.caStore)?a.pki.createCaStore(e.caStore):e.caStore:a.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],u.CipherSuites)r.push(u.CipherSuites[i]);var n=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,s=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:n,sessionId:e.sessionId,caStore:t,sessionCache:s,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,a){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var a=!1!==r.fatal;a&&(t.fail=!0),e.error(t,r),a&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null};o.reset=function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.entity,u.ConnectionEnd.client,o.expect=0,o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)},o.reset();var c=function(e,t){var r=t.type-u.ContentType.change_cipher_spec,a=k[e.entity][e.expect];r in a?a[r](e,t):u.handleUnexpected(e,t)},l=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:a.util.createBuffer(),ready:!1};var n=e.record.version.major===e.version.major;n&&e.session&&e.session.version&&(n=e.record.version.minor===e.version.minor),n||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t},f=function(e){var t=0,r=e.input,a=r.length();return a<e.record.length?t=e.record.length-a:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})),e.record.ready=!0)),t};return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=l(o)),o.fail||null===o.record||o.record.ready||(t=f(o)),!o.fail&&null!==o.record&&o.record.ready&&c(o,o.record)),t},o.prepare=function(e){return u.queue(o,u.createRecord(o,{type:u.ContentType.application_data,data:a.util.createBuffer(e)})),u.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof a.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,u.queue(o,u.createRecord(o,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_request,e,t)})),u.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,u.queue(o,u.createAlert(o,{level:u.Alert.Level.warning,description:u.Alert.Description.close_notify})),u.flush(o)),o.closed(o)),o.reset(e)},o},t.exports=a.tls=a.tls||{},u)"function"!=typeof u[G]&&(a.tls[G]=u[G]);a.tls.prf_tls1=i,a.tls.hmac_sha1=function(e,t,r){var i=a.hmac.create();i.start("SHA1",e);var n=a.util.createBuffer();return n.putInt32(t[0]),n.putInt32(t[1]),n.putByte(r.type),n.putByte(r.version.major),n.putByte(r.version.minor),n.putInt16(r.length),n.putBytes(r.fragment.bytes()),i.update(n.getBytes()),i.digest().getBytes()},a.tls.createSessionCache=u.createSessionCache,a.tls.createConnection=u.createConnection},59060,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(45771);var i=t.exports=a.tls;function n(e,t,r){var n=t.entity===a.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:a.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:a.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=s,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function s(e,t){var r,n=!1,s=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(s),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:a.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),n=!0),n}function o(e,t,r){if(!r){var a=e-t.length()%e;t.fillWithByte(a-1,a)}return!0}function c(e,t,r){var a=!0;if(r){for(var i=t.length(),n=t.last(),s=i-1-n;s<i-1;++s)a=a&&t.at(s)==n;a&&t.truncate(n+1)}return a}function u(e,t){var r,n,s,o,u,l=!1;u=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var f=t.cipherState.cipher;f.start({iv:u}),f.update(e.fragment),l=f.finish(c);var p=t.macLength,h=a.random.getBytesSync(p),d=f.output.length();d>=p?(e.fragment=f.output.getBytes(d-p),h=f.output.getBytes(p)):e.fragment=f.output.getBytes(),e.fragment=a.util.createBuffer(e.fragment),e.length=e.fragment.length();var y=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),l=(r=t.macKey,n=h,s=y,(o=a.hmac.create()).start("SHA1",r),o.update(n),n=o.digest().getBytes(),o.start(null,null),o.update(s),n===(s=o.digest().getBytes())&&l)}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:n}},9675,(e,t,r)=>{var a=e.r(2015);e.r(5189),e.r(26706);var i=t.exports=a.sha512=a.sha512||{};a.md.sha512=a.md.algorithms.sha512=i;var n=a.sha384=a.sha512.sha384=a.sha512.sha384||{};n.create=function(){return i.create("SHA-384")},a.md.sha384=a.md.algorithms.sha384=n,a.sha512.sha256=a.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256,a.sha512.sha224=a.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224,i.create=function(e){if(o||(s=String.fromCharCode(128)+a.util.fillString("\0",128),c=[[0x428a2f98,0xd728ae22],[0x71374491,0x23ef65cd],[0xb5c0fbcf,0xec4d3b2f],[0xe9b5dba5,0x8189dbbc],[0x3956c25b,0xf348b538],[0x59f111f1,0xb605d019],[0x923f82a4,0xaf194f9b],[0xab1c5ed5,0xda6d8118],[0xd807aa98,0xa3030242],[0x12835b01,0x45706fbe],[0x243185be,0x4ee4b28c],[0x550c7dc3,0xd5ffb4e2],[0x72be5d74,0xf27b896f],[0x80deb1fe,0x3b1696b1],[0x9bdc06a7,0x25c71235],[0xc19bf174,0xcf692694],[0xe49b69c1,0x9ef14ad2],[0xefbe4786,0x384f25e3],[0xfc19dc6,0x8b8cd5b5],[0x240ca1cc,0x77ac9c65],[0x2de92c6f,0x592b0275],[0x4a7484aa,0x6ea6e483],[0x5cb0a9dc,0xbd41fbd4],[0x76f988da,0x831153b5],[0x983e5152,0xee66dfab],[0xa831c66d,0x2db43210],[0xb00327c8,0x98fb213f],[0xbf597fc7,0xbeef0ee4],[0xc6e00bf3,0x3da88fc2],[0xd5a79147,0x930aa725],[0x6ca6351,0xe003826f],[0x14292967,0xa0e6e70],[0x27b70a85,0x46d22ffc],[0x2e1b2138,0x5c26c926],[0x4d2c6dfc,0x5ac42aed],[0x53380d13,0x9d95b3df],[0x650a7354,0x8baf63de],[0x766a0abb,0x3c77b2a8],[0x81c2c92e,0x47edaee6],[0x92722c85,0x1482353b],[0xa2bfe8a1,0x4cf10364],[0xa81a664b,0xbc423001],[0xc24b8b70,0xd0f89791],[0xc76c51a3,0x654be30],[0xd192e819,0xd6ef5218],[0xd6990624,0x5565a910],[0xf40e3585,0x5771202a],[0x106aa070,0x32bbd1b8],[0x19a4c116,0xb8d2d0c8],[0x1e376c08,0x5141ab53],[0x2748774c,0xdf8eeb99],[0x34b0bcb5,0xe19b48a8],[0x391c0cb3,0xc5c95a63],[0x4ed8aa4a,0xe3418acb],[0x5b9cca4f,0x7763e373],[0x682e6ff3,0xd6b2b8a3],[0x748f82ee,0x5defb2fc],[0x78a5636f,0x43172f60],[0x84c87814,0xa1f0ab72],[0x8cc70208,0x1a6439ec],[0x90befffa,0x23631e28],[0xa4506ceb,0xde82bde9],[0xbef9a3f7,0xb2c67915],[0xc67178f2,0xe372532b],[0xca273ece,0xea26619c],[0xd186b8c7,0x21c0c207],[0xeada7dd6,0xcde0eb1e],[0xf57d4f7f,0xee6ed178],[0x6f067aa,0x72176fba],[0xa637dc5,0xa2c898a6],[0x113f9804,0xbef90dae],[0x1b710b35,0x131c471b],[0x28db77f5,0x23047d84],[0x32caab7b,0x40c72493],[0x3c9ebe0a,0x15c9bebc],[0x431d67c4,0x9c100d4c],[0x4cc5d4be,0xcb3e42b6],[0x597f299c,0xfc657e2a],[0x5fcb6fab,0x3ad6faec],[0x6c44198c,0x4a475817]],(u={})["SHA-512"]=[[0x6a09e667,0xf3bcc908],[0xbb67ae85,0x84caa73b],[0x3c6ef372,0xfe94f82b],[0xa54ff53a,0x5f1d36f1],[0x510e527f,0xade682d1],[0x9b05688c,0x2b3e6c1f],[0x1f83d9ab,0xfb41bd6b],[0x5be0cd19,0x137e2179]],u["SHA-384"]=[[0xcbbb9d5d,0xc1059ed8],[0x629a292a,0x367cd507],[0x9159015a,0x3070dd17],[0x152fecd8,0xf70e5939],[0x67332667,0xffc00b31],[0x8eb44a87,0x68581511],[0xdb0c2e0d,0x64f98fa7],[0x47b5481d,0xbefa4fa4]],u["SHA-512/256"]=[[0x22312194,0xfc2bf72c],[0x9f555fa3,0xc84c64c2],[0x2393b86b,0x6f53b151],[0x96387719,0x5940eabd],[0x96283ee2,0xa88effe3],[0xbe5e1e25,0x53863992],[0x2b0199fc,0x2c85b8aa],[0xeb72ddc,0x81c52ca2]],u["SHA-512/224"]=[[0x8c3d37c8,0x19544da2],[0x73e19966,0x89dcd4d6],[0x1dfab7ae,0x32ff9c82],[0x679dd514,0x582f9fcf],[0xf6d2b69,0x7bd44da8],[0x77e36f73,0x4c48942],[0x3f9d85a8,0x6a1d36c8],[0x1112e6ad,0x91d692a1]],o=!0),void 0===e&&(e="SHA-512"),!(e in u))throw Error("Invalid SHA-512 algorithm: "+e);for(var t=u[e],r=null,i=a.util.createBuffer(),n=Array(80),f=0;f<80;++f)n[f]=[,,];var p=64;switch(e){case"SHA-384":p=48;break;case"SHA-512/256":p=32;break;case"SHA-512/224":p=28}var h={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:p,messageLength:0,fullMessageLength:null,messageLengthSize:16};return h.start=function(){h.messageLength=0,h.fullMessageLength=h.messageLength128=[];for(var e=h.messageLengthSize/4,n=0;n<e;++n)h.fullMessageLength.push(0);i=a.util.createBuffer(),r=Array(t.length);for(var n=0;n<t.length;++n)r[n]=t[n].slice(0);return h},h.start(),h.update=function(e,t){"utf8"===t&&(e=a.util.encodeUtf8(e));var s=e.length;h.messageLength+=s,s=[s/0x100000000>>>0,s>>>0];for(var o=h.fullMessageLength.length-1;o>=0;--o)h.fullMessageLength[o]+=s[1],s[1]=s[0]+(h.fullMessageLength[o]/0x100000000>>>0),h.fullMessageLength[o]=h.fullMessageLength[o]>>>0,s[0]=s[1]/0x100000000>>>0;return i.putBytes(e),l(r,n,i),(i.read>2048||0===i.length())&&i.compact(),h},h.digest=function(){var t,o,c=a.util.createBuffer();c.putBytes(i.bytes());var u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;c.putBytes(s.substr(0,h.blockLength-u));for(var f=8*h.fullMessageLength[0],p=0;p<h.fullMessageLength.length-1;++p)f+=(t=8*h.fullMessageLength[p+1])/0x100000000>>>0,c.putInt32(f>>>0),f=t>>>0;c.putInt32(f);for(var d=Array(r.length),p=0;p<r.length;++p)d[p]=r[p].slice(0);l(d,n,c);var y=a.util.createBuffer();o="SHA-512"===e?d.length:"SHA-384"===e?d.length-2:d.length-4;for(var p=0;p<o;++p)y.putInt32(d[p][0]),(p!==o-1||"SHA-512/224"!==e)&&y.putInt32(d[p][1]);return y},h};var s=null,o=!1,c=null,u=null;function l(e,t,r){for(var a,i,n,s,o,u,l,f,p,h,d,y,g,m,v,C,E,S,T,I,b,A,B,x,N,R,k,_,L,w,U,D,P,V,O,K=r.length();K>=128;){for(L=0;L<16;++L)t[L][0]=r.getInt32()>>>0,t[L][1]=r.getInt32()>>>0;for(;L<80;++L)a=(((w=(D=t[L-2])[0])>>>19|(U=D[1])<<13)^(U>>>29|w<<3)^w>>>6)>>>0,i=((w<<13|U>>>19)^(U<<3|w>>>29)^(w<<26|U>>>6))>>>0,n=(((w=(V=t[L-15])[0])>>>1|(U=V[1])<<31)^(w>>>8|U<<24)^w>>>7)>>>0,s=((w<<31|U>>>1)^(w<<24|U>>>8)^(w<<25|U>>>7))>>>0,P=t[L-7],O=t[L-16],U=i+P[1]+s+O[1],t[L][0]=a+P[0]+n+O[0]+(U/0x100000000>>>0)>>>0,t[L][1]=U>>>0;for(L=0,g=e[0][0],m=e[0][1],v=e[1][0],C=e[1][1],E=e[2][0],S=e[2][1],T=e[3][0],I=e[3][1],b=e[4][0],A=e[4][1],B=e[5][0],x=e[5][1],N=e[6][0],R=e[6][1],k=e[7][0],_=e[7][1];L<80;++L)l=((b>>>14|A<<18)^(b>>>18|A<<14)^(A>>>9|b<<23))>>>0,f=((b<<18|A>>>14)^(b<<14|A>>>18)^(A<<23|b>>>9))>>>0,p=(N^b&(B^N))>>>0,h=(R^A&(x^R))>>>0,o=((g>>>28|m<<4)^(m>>>2|g<<30)^(m>>>7|g<<25))>>>0,u=((g<<4|m>>>28)^(m<<30|g>>>2)^(m<<25|g>>>7))>>>0,d=(g&v|E&(g^v))>>>0,y=(m&C|S&(m^C))>>>0,U=_+f+h+c[L][1]+t[L][1],a=k+l+p+c[L][0]+t[L][0]+(U/0x100000000>>>0)>>>0,i=U>>>0,n=o+d+((U=u+y)/0x100000000>>>0)>>>0,s=U>>>0,k=N,_=R,N=B,R=x,B=b,x=A,b=T+a+((U=I+i)/0x100000000>>>0)>>>0,A=U>>>0,T=E,I=S,E=v,S=C,v=g,C=m,g=a+n+((U=i+s)/0x100000000>>>0)>>>0,m=U>>>0;U=e[0][1]+m,e[0][0]=e[0][0]+g+(U/0x100000000>>>0)>>>0,e[0][1]=U>>>0,U=e[1][1]+C,e[1][0]=e[1][0]+v+(U/0x100000000>>>0)>>>0,e[1][1]=U>>>0,U=e[2][1]+S,e[2][0]=e[2][0]+E+(U/0x100000000>>>0)>>>0,e[2][1]=U>>>0,U=e[3][1]+I,e[3][0]=e[3][0]+T+(U/0x100000000>>>0)>>>0,e[3][1]=U>>>0,U=e[4][1]+A,e[4][0]=e[4][0]+b+(U/0x100000000>>>0)>>>0,e[4][1]=U>>>0,U=e[5][1]+x,e[5][0]=e[5][0]+B+(U/0x100000000>>>0)>>>0,e[5][1]=U>>>0,U=e[6][1]+R,e[6][0]=e[6][0]+N+(U/0x100000000>>>0)>>>0,e[6][1]=U>>>0,U=e[7][1]+_,e[7][0]=e[7][0]+k+(U/0x100000000>>>0)>>>0,e[7][1]=U>>>0,K-=128}}},16445,(e,t,r)=>{var a=e.r(2015);e.r(74723);var i=a.asn1;r.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},r.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},99544,(e,t,r)=>{var a=e.r(2015);e.r(68995),e.r(2828),e.r(9675),e.r(26706);var i=e.r(16445),n=i.publicKeyValidator,s=i.privateKeyValidator;if(void 0===o)var o=a.jsbn.BigInteger;var c=a.util.ByteBuffer,u="u"<typeof Buffer?Uint8Array:Buffer;a.pki=a.pki||{},t.exports=a.pki.ed25519=a.ed25519=a.ed25519||{};var l=a.ed25519;function f(e){var t=e.message;if(t instanceof Uint8Array||t instanceof u)return t;var r=e.encoding;if(void 0===t)if(e.md)t=e.md.digest().getBytes(),r="binary";else throw TypeError('"options.message" or "options.md" not specified.');if("string"==typeof t&&!r)throw TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("u">typeof Buffer)return Buffer.from(t,r);t=new c(t,r)}else if(!(t instanceof c))throw TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var a=new u(t.length()),i=0;i<a.length;++i)a[i]=t.at(i);return a}l.constants={},l.constants.PUBLIC_KEY_BYTE_LENGTH=32,l.constants.PRIVATE_KEY_BYTE_LENGTH=64,l.constants.SEED_BYTE_LENGTH=32,l.constants.SIGN_BYTE_LENGTH=64,l.constants.HASH_BYTE_LENGTH=64,l.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=a.random.getBytesSync(l.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==l.constants.SEED_BYTE_LENGTH)throw TypeError('"seed" must be '+l.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=f({message:t,encoding:"binary"});for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),i=new u(l.constants.PRIVATE_KEY_BYTE_LENGTH),n=0;n<32;++n)i[n]=t[n];return function(e,t){var r,a=[D(),D(),D(),D()],i=E(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,_(a,i),A(e,a),r=0;r<32;++r)t[r+32]=e[r]}(r,i),{publicKey:r,privateKey:i}},l.privateKeyFromAsn1=function(e){var t={},r=[];if(!a.asn1.validate(e,s,t,r)){var i=Error("Invalid Key.");throw i.errors=r,i}var n=a.asn1.derToOid(t.privateKeyOid),o=a.oids.EdDSA25519;if(n!==o)throw Error('Invalid OID "'+n+'"; OID must be "'+o+'".');var c=t.privateKey;return{privateKeyBytes:f({message:a.asn1.fromDer(c).value,encoding:"binary"})}},l.publicKeyFromAsn1=function(e){var t={},r=[];if(!a.asn1.validate(e,n,t,r)){var i=Error("Invalid Key.");throw i.errors=r,i}var s=a.asn1.derToOid(t.publicKeyOid),o=a.oids.EdDSA25519;if(s!==o)throw Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var c=t.ed25519PublicKey;if(c.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw Error("Key length is invalid.");return f({message:c,encoding:"binary"})},l.publicKeyFromPrivateKey=function(e){var t=f({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+l.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new u(l.constants.PUBLIC_KEY_BYTE_LENGTH),a=0;a<r.length;++a)r[a]=t[32+a];return r},l.sign=function(e){var t=f(e=e||{}),r=f({message:e.privateKey,encoding:"binary"});if(r.length===l.constants.SEED_BYTE_LENGTH)r=l.generateKeyPair({seed:r}).privateKey;else if(r.length!==l.constants.PRIVATE_KEY_BYTE_LENGTH)throw TypeError('"options.privateKey" must have a byte length of '+l.constants.SEED_BYTE_LENGTH+" or "+l.constants.PRIVATE_KEY_BYTE_LENGTH);var a=new u(l.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,a){var i,n,s=new Float64Array(64),o=[D(),D(),D(),D()],c=E(a,32);for(c[0]&=248,c[31]&=127,c[31]|=64,i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var u=E(e.subarray(32),r+32);for(T(u),_(o,u),A(e,o),i=32;i<64;++i)e[i]=a[i];var l=E(e,r+64);for(T(l),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=u[i];for(i=0;i<32;++i)for(n=0;n<32;n++)s[i+n]+=l[i]*c[n];S(e.subarray(32),s)}(a,t,t.length,r);for(var i=new u(l.constants.SIGN_BYTE_LENGTH),n=0;n<i.length;++n)i[n]=a[n];return i},l.verify=function(e){var t,r=f(e=e||{});if(void 0===e.signature)throw TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var a=f({message:e.signature,encoding:"binary"});if(a.length!==l.constants.SIGN_BYTE_LENGTH)throw TypeError('"options.signature" must have a byte length of '+l.constants.SIGN_BYTE_LENGTH);var i=f({message:e.publicKey,encoding:"binary"});if(i.length!==l.constants.PUBLIC_KEY_BYTE_LENGTH)throw TypeError('"options.publicKey" must have a byte length of '+l.constants.PUBLIC_KEY_BYTE_LENGTH);var n=new u(l.constants.SIGN_BYTE_LENGTH+r.length),s=new u(l.constants.SIGN_BYTE_LENGTH+r.length);for(t=0;t<l.constants.SIGN_BYTE_LENGTH;++t)n[t]=a[t];for(t=0;t<r.length;++t)n[t+l.constants.SIGN_BYTE_LENGTH]=r[t];return function(e,t,r,a){var i,n,s,o,c,l,f,y,g,m,S=new u(32),b=[D(),D(),D(),D()],B=[D(),D(),D(),D()];if(r<64||(i=B,n=a,s=D(),o=D(),c=D(),l=D(),f=D(),y=D(),g=D(),(L(i[2],h),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(i[1],n),function(e,t){O(e,t,t)}(c,i[1]),O(l,c,d),V(c,c,i[2]),P(l,i[2],l),function(e,t){O(e,t,t)}(f,l),function(e,t){O(e,t,t)}(y,f),O(g,y,f),O(s,g,c),O(s,s,l),function(e,t){var r,a=D();for(r=0;r<16;++r)a[r]=t[r];for(r=250;r>=0;--r)(function(e,t){O(e,t,t)})(a,a),1!==r&&O(a,a,t);for(r=0;r<16;++r)e[r]=a[r]}(s,s),O(s,s,c),O(s,s,l),O(s,s,l),O(i[0],s,l),function(e,t){O(e,t,t)}(o,i[0]),O(o,o,l),x(o,c)&&O(i[0],i[0],C),function(e,t){O(e,t,t)}(o,i[0]),O(o,o,l),x(o,c))?-1:(R(i[0])===n[31]>>7&&V(i[0],p,i[0]),O(i[3],i[0],i[1]),0))||!function(e){var t;for(t=31;t>=0;--t){if(e[32+t]<v[t])return!0;if(e[32+t]>v[t])break}return!1}(t))return -1;for(m=0;m<r;++m)e[m]=t[m];for(m=0;m<32;++m)e[m+32]=a[m];var w=E(e,r);if(T(w),k(b,B,w),_(B,t.subarray(32)),I(b,B),A(S,b),r-=64,function(e,t,r,a){return N(e,t,r,a,32)}(t,0,S,0)){for(m=0;m<r;++m)e[m]=0;return -1}for(m=0;m<r;++m)e[m]=t[m+64];return r}(s,n,n.length,i)>=0};var p=D(),h=D([1]),d=D([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=D([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=D([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=D([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),C=D([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function E(e,t){var r=a.md.sha512.create(),i=new c(e);r.update(i.getBytes(t),"binary");var n=r.digest().getBytes();if("u">typeof Buffer)return Buffer.from(n,"binary");for(var s=new u(l.constants.HASH_BYTE_LENGTH),o=0;o<64;++o)s[o]=n.charCodeAt(o);return s}function S(e,t){var r,a,i,n;for(a=63;a>=32;--a){for(r=0,i=a-32,n=a-12;i<n;++i)t[i]+=r-16*t[a]*v[i-(a-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[a]=0}for(i=0,r=0;i<32;++i)t[i]+=r-(t[31]>>4)*v[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*v[i];for(a=0;a<32;++a)t[a+1]+=t[a]>>8,e[a]=255&t[a]}function T(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function I(e,t){var r=D(),a=D(),i=D(),n=D(),s=D(),o=D(),c=D(),u=D(),l=D();V(r,e[1],e[0]),V(l,t[1],t[0]),O(r,r,l),P(a,e[0],e[1]),P(l,t[0],t[1]),O(a,a,l),O(i,e[3],t[3]),O(i,i,y),O(n,e[2],t[2]),P(n,n,n),V(s,a,r),V(o,n,i),P(c,n,i),P(u,a,r),O(e[0],s,o),O(e[1],u,c),O(e[2],c,o),O(e[3],s,u)}function b(e,t,r){for(var a=0;a<4;++a)U(e[a],t[a],r)}function A(e,t){var r=D(),a=D(),i=D();(function(e,t){var r,a=D();for(r=0;r<16;++r)a[r]=t[r];for(r=253;r>=0;--r)(function(e,t){O(e,t,t)})(a,a),2!==r&&4!==r&&O(a,a,t);for(r=0;r<16;++r)e[r]=a[r]})(i,t[2]),O(r,t[0],i),O(a,t[1],i),B(e,a),e[31]^=R(r)<<7}function B(e,t){var r,a,i,n=D(),s=D();for(r=0;r<16;++r)s[r]=t[r];for(w(s),w(s),w(s),a=0;a<2;++a){for(r=1,n[0]=s[0]-65517;r<15;++r)n[r]=s[r]-65535-(n[r-1]>>16&1),n[r-1]&=65535;n[15]=s[15]-32767-(n[14]>>16&1),i=n[15]>>16&1,n[14]&=65535,U(s,n,1-i)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function x(e,t){var r=new u(32),a=new u(32);return B(r,e),B(a,t),N(r,0,a,0,32)}function N(e,t,r,a,i){var n,s=0;for(n=0;n<i;++n)s|=e[t+n]^r[a+n];return(1&s-1>>>8)-1}function R(e){var t=new u(32);return B(t,e),1&t[0]}function k(e,t,r){var a,i;for(L(e[0],p),L(e[1],h),L(e[2],h),L(e[3],p),i=255;i>=0;--i)b(e,t,a=r[i/8|0]>>(7&i)&1),I(t,e),I(e,e),b(e,t,a)}function _(e,t){var r=[D(),D(),D(),D()];L(r[0],g),L(r[1],m),L(r[2],h),O(r[3],g,m),k(e,r,t)}function L(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function w(e){var t,r,a=1;for(t=0;t<16;++t)a=Math.floor((r=e[t]+a+65535)/65536),e[t]=r-65536*a;e[0]+=a-1+37*(a-1)}function U(e,t,r){for(var a,i=~(r-1),n=0;n<16;++n)a=i&(e[n]^t[n]),e[n]^=a,t[n]^=a}function D(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function P(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]+r[a]}function V(e,t,r){for(var a=0;a<16;++a)e[a]=t[a]-r[a]}function O(e,t,r){var a,i,n=0,s=0,o=0,c=0,u=0,l=0,f=0,p=0,h=0,d=0,y=0,g=0,m=0,v=0,C=0,E=0,S=0,T=0,I=0,b=0,A=0,B=0,x=0,N=0,R=0,k=0,_=0,L=0,w=0,U=0,D=0,P=r[0],V=r[1],O=r[2],K=r[3],M=r[4],F=r[5],j=r[6],H=r[7],G=r[8],q=r[9],Q=r[10],z=r[11],$=r[12],Y=r[13],W=r[14],X=r[15];n+=(a=t[0])*P,s+=a*V,o+=a*O,c+=a*K,u+=a*M,l+=a*F,f+=a*j,p+=a*H,h+=a*G,d+=a*q,y+=a*Q,g+=a*z,m+=a*$,v+=a*Y,C+=a*W,E+=a*X,s+=(a=t[1])*P,o+=a*V,c+=a*O,u+=a*K,l+=a*M,f+=a*F,p+=a*j,h+=a*H,d+=a*G,y+=a*q,g+=a*Q,m+=a*z,v+=a*$,C+=a*Y,E+=a*W,S+=a*X,o+=(a=t[2])*P,c+=a*V,u+=a*O,l+=a*K,f+=a*M,p+=a*F,h+=a*j,d+=a*H,y+=a*G,g+=a*q,m+=a*Q,v+=a*z,C+=a*$,E+=a*Y,S+=a*W,T+=a*X,c+=(a=t[3])*P,u+=a*V,l+=a*O,f+=a*K,p+=a*M,h+=a*F,d+=a*j,y+=a*H,g+=a*G,m+=a*q,v+=a*Q,C+=a*z,E+=a*$,S+=a*Y,T+=a*W,I+=a*X,u+=(a=t[4])*P,l+=a*V,f+=a*O,p+=a*K,h+=a*M,d+=a*F,y+=a*j,g+=a*H,m+=a*G,v+=a*q,C+=a*Q,E+=a*z,S+=a*$,T+=a*Y,I+=a*W,b+=a*X,l+=(a=t[5])*P,f+=a*V,p+=a*O,h+=a*K,d+=a*M,y+=a*F,g+=a*j,m+=a*H,v+=a*G,C+=a*q,E+=a*Q,S+=a*z,T+=a*$,I+=a*Y,b+=a*W,A+=a*X,f+=(a=t[6])*P,p+=a*V,h+=a*O,d+=a*K,y+=a*M,g+=a*F,m+=a*j,v+=a*H,C+=a*G,E+=a*q,S+=a*Q,T+=a*z,I+=a*$,b+=a*Y,A+=a*W,B+=a*X,p+=(a=t[7])*P,h+=a*V,d+=a*O,y+=a*K,g+=a*M,m+=a*F,v+=a*j,C+=a*H,E+=a*G,S+=a*q,T+=a*Q,I+=a*z,b+=a*$,A+=a*Y,B+=a*W,x+=a*X,h+=(a=t[8])*P,d+=a*V,y+=a*O,g+=a*K,m+=a*M,v+=a*F,C+=a*j,E+=a*H,S+=a*G,T+=a*q,I+=a*Q,b+=a*z,A+=a*$,B+=a*Y,x+=a*W,N+=a*X,d+=(a=t[9])*P,y+=a*V,g+=a*O,m+=a*K,v+=a*M,C+=a*F,E+=a*j,S+=a*H,T+=a*G,I+=a*q,b+=a*Q,A+=a*z,B+=a*$,x+=a*Y,N+=a*W,R+=a*X,y+=(a=t[10])*P,g+=a*V,m+=a*O,v+=a*K,C+=a*M,E+=a*F,S+=a*j,T+=a*H,I+=a*G,b+=a*q,A+=a*Q,B+=a*z,x+=a*$,N+=a*Y,R+=a*W,k+=a*X,g+=(a=t[11])*P,m+=a*V,v+=a*O,C+=a*K,E+=a*M,S+=a*F,T+=a*j,I+=a*H,b+=a*G,A+=a*q,B+=a*Q,x+=a*z,N+=a*$,R+=a*Y,k+=a*W,_+=a*X,m+=(a=t[12])*P,v+=a*V,C+=a*O,E+=a*K,S+=a*M,T+=a*F,I+=a*j,b+=a*H,A+=a*G,B+=a*q,x+=a*Q,N+=a*z,R+=a*$,k+=a*Y,_+=a*W,L+=a*X,v+=(a=t[13])*P,C+=a*V,E+=a*O,S+=a*K,T+=a*M,I+=a*F,b+=a*j,A+=a*H,B+=a*G,x+=a*q,N+=a*Q,R+=a*z,k+=a*$,_+=a*Y,L+=a*W,w+=a*X,C+=(a=t[14])*P,E+=a*V,S+=a*O,T+=a*K,I+=a*M,b+=a*F,A+=a*j,B+=a*H,x+=a*G,N+=a*q,R+=a*Q,k+=a*z,_+=a*$,L+=a*Y,w+=a*W,U+=a*X,E+=(a=t[15])*P,S+=a*V,T+=a*O,I+=a*K,b+=a*M,A+=a*F,B+=a*j,x+=a*H,N+=a*G,R+=a*q,k+=a*Q,_+=a*z,L+=a*$,w+=a*Y,U+=a*W,D+=a*X,n+=38*S,s+=38*T,o+=38*I,c+=38*b,u+=38*A,l+=38*B,f+=38*x,p+=38*N,h+=38*R,d+=38*k,y+=38*_,g+=38*L,m+=38*w,v+=38*U,C+=38*D,i=Math.floor((a=n+(i=1)+65535)/65536),n=a-65536*i,i=Math.floor((a=s+i+65535)/65536),s=a-65536*i,i=Math.floor((a=o+i+65535)/65536),o=a-65536*i,i=Math.floor((a=c+i+65535)/65536),c=a-65536*i,i=Math.floor((a=u+i+65535)/65536),u=a-65536*i,i=Math.floor((a=l+i+65535)/65536),l=a-65536*i,i=Math.floor((a=f+i+65535)/65536),f=a-65536*i,i=Math.floor((a=p+i+65535)/65536),p=a-65536*i,i=Math.floor((a=h+i+65535)/65536),h=a-65536*i,i=Math.floor((a=d+i+65535)/65536),d=a-65536*i,i=Math.floor((a=y+i+65535)/65536),y=a-65536*i,i=Math.floor((a=g+i+65535)/65536),g=a-65536*i,i=Math.floor((a=m+i+65535)/65536),m=a-65536*i,i=Math.floor((a=v+i+65535)/65536),v=a-65536*i,i=Math.floor((a=C+i+65535)/65536),C=a-65536*i,i=Math.floor((a=E+i+65535)/65536),E=a-65536*i,n+=i-1+37*(i-1),i=Math.floor((a=n+(i=1)+65535)/65536),n=a-65536*i,i=Math.floor((a=s+i+65535)/65536),s=a-65536*i,i=Math.floor((a=o+i+65535)/65536),o=a-65536*i,i=Math.floor((a=c+i+65535)/65536),c=a-65536*i,i=Math.floor((a=u+i+65535)/65536),u=a-65536*i,i=Math.floor((a=l+i+65535)/65536),l=a-65536*i,i=Math.floor((a=f+i+65535)/65536),f=a-65536*i,i=Math.floor((a=p+i+65535)/65536),p=a-65536*i,i=Math.floor((a=h+i+65535)/65536),h=a-65536*i,i=Math.floor((a=d+i+65535)/65536),d=a-65536*i,i=Math.floor((a=y+i+65535)/65536),y=a-65536*i,i=Math.floor((a=g+i+65535)/65536),g=a-65536*i,i=Math.floor((a=m+i+65535)/65536),m=a-65536*i,i=Math.floor((a=v+i+65535)/65536),v=a-65536*i,i=Math.floor((a=C+i+65535)/65536),C=a-65536*i,i=Math.floor((a=E+i+65535)/65536),E=a-65536*i,n+=i-1+37*(i-1),e[0]=n,e[1]=s,e[2]=o,e[3]=c,e[4]=u,e[5]=l,e[6]=f,e[7]=p,e[8]=h,e[9]=d,e[10]=y,e[11]=g,e[12]=m,e[13]=v,e[14]=C,e[15]=E}},7390,(e,t,r)=>{var a=e.r(2015);e.r(26706),e.r(2828),e.r(68995),t.exports=a.kem=a.kem||{};var i=a.jsbn.BigInteger;function n(e,t,r,i){e.generate=function(e,n){for(var s=new a.util.ByteBuffer,o=Math.ceil(n/i)+r,c=new a.util.ByteBuffer,u=r;u<o;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var l=t.digest();s.putBytes(l.getBytes(i))}return s.truncate(s.length()-n),s.getBytes()}}a.kem.rsa={},a.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||a.random,n={};return n.encrypt=function(t,n){var s,o=Math.ceil(t.n.bitLength()/8);do s=new i(a.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n);while(0>=s.compareTo(i.ONE))var c=o-(s=a.util.hexToBytes(s.toString(16))).length;return c>0&&(s=a.util.fillString("\0",c)+s),{encapsulation:t.encrypt(s,"NONE"),key:e.generate(s,n)}},n.decrypt=function(t,r,a){var i=t.decrypt(r,"NONE");return e.generate(i,a)},n},a.kem.kdf1=function(e,t){n(this,e,0,t||e.digestLength)},a.kem.kdf2=function(e,t){n(this,e,1,t||e.digestLength)}},56773,(e,t,r)=>{var a,i=e.r(2015);e.r(26706),t.exports=i.log=i.log||{},i.log.levels=["none","error","warning","info","debug","verbose","max"];var n={},s=[],o=null;i.log.LEVEL_LOCKED=2,i.log.NO_LEVEL_CHECK=4,i.log.INTERPOLATE=8;for(var c=0;c<i.log.levels.length;++c){var u=i.log.levels[c];n[u]={index:c,name:u.toUpperCase()}}i.log.logMessage=function(e){for(var t=n[e.level].index,r=0;r<s.length;++r){var a=s[r];a.flags&i.log.NO_LEVEL_CHECK?a.f(e):t<=n[a.level].index&&a.f(a,e)}},i.log.prepareStandard=function(e){"standard"in e||(e.standard=n[e.level].name+" ["+e.category+"] "+e.message)},i.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]),e.full=i.util.format.apply(this,t)}},i.log.prepareStandardFull=function(e){"standardFull"in e||(i.log.prepareStandard(e),e.standardFull=e.standard)};for(var l=["error","warning","info","debug","verbose"],c=0;c<l.length;++c)!function(e){i.log[e]=function(t,r){var a=Array.prototype.slice.call(arguments).slice(2),n={timestamp:new Date,level:e,category:t,message:r,arguments:a};i.log.logMessage(n)}}(l[c]);if(i.log.makeLogger=function(e){var t={flags:0,f:e};return i.log.setLevel(t,"none"),t},i.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&i.log.LEVEL_LOCKED)){for(var a=0;a<i.log.levels.length;++a)if(t==i.log.levels[a]){e.level=t,r=!0;break}}return r},i.log.lock=function(e,t){void 0===t||t?e.flags|=i.log.LEVEL_LOCKED:e.flags&=~i.log.LEVEL_LOCKED},i.log.addLogger=function(e){s.push(e)},"u">typeof console&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug){var f={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},p=function(e,t){i.log.prepareStandard(t);var r=f[t.level],a=[t.standard];a=a.concat(t.arguments.slice()),r.apply(console,a)};a=i.log.makeLogger(p)}else{var p=function(e,t){i.log.prepareStandardFull(t),console.log(t.standardFull)};a=i.log.makeLogger(p)}i.log.setLevel(a,"debug"),i.log.addLogger(a),o=a}else console={log:function(){}};i.log.consoleLogger=o},89449,(e,t,r)=>{t.exports=e.r(5189),e.r(99073),e.r(1500),e.r(99470),e.r(9675)},1392,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(74723),e.r(30369),e.r(31808),e.r(93139),e.r(93197),e.r(2828),e.r(26706),e.r(9166);var i=a.asn1,n=t.exports=a.pkcs7=a.pkcs7||{};function s(e){var t;if(e.type===a.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===a.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===a.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),n=new Date("2050-01-01T00:00:00Z"),s=e.value;if("string"==typeof s){var o=Date.parse(s);s=isNaN(o)?13===s.length?i.utcTimeToDate(s):i.generalizedTimeToDate(s):new Date(o)}t=s>=r&&s<n?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(s)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(s))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function o(e,t,r){var n={};if(!i.validate(t,r,n,[])){var s=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw s.errors=s,s}if(i.derToOid(n.contentType)!==a.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(n.encryptedContent){var o="";if(a.util.isArray(n.encryptedContent))for(var c=0;c<n.encryptedContent.length;++c){if(n.encryptedContent[c].type!==i.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=n.encryptedContent[c].value}else o=n.encryptedContent;e.encryptedContent={algorithm:i.derToOid(n.encAlgorithm),parameter:a.util.createBuffer(n.encParameter.value),content:a.util.createBuffer(o)}}if(n.content){var o="";if(a.util.isArray(n.content))for(var c=0;c<n.content.length;++c){if(n.content[c].type!==i.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=n.content[c].value}else o=n.content;e.content=a.util.createBuffer(o)}return e.version=n.version.charCodeAt(0),e.rawCapture=n,n}function c(e){if(void 0===e.encryptedContent.key)throw Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case a.pki.oids["aes128-CBC"]:case a.pki.oids["aes192-CBC"]:case a.pki.oids["aes256-CBC"]:t=a.aes.createDecryptionCipher(e.encryptedContent.key);break;case a.pki.oids.desCBC:case a.pki.oids["des-EDE3-CBC"]:t=a.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw Error("Symmetric decryption failed.");e.content=t.output}}n.messageFromPem=function(e){var t=a.pem.decode(e)[0];if("PKCS7"!==t.type){var r=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var s=i.fromDer(t.body);return n.messageFromAsn1(s)},n.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return a.pem.encode(r,{maxline:t})},n.messageFromAsn1=function(e){var t,r={},s=[];if(!i.validate(e,n.asn1.contentInfoValidator,r,s)){var o=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw o.errors=s,o}var c=i.derToOid(r.contentType);switch(c){case a.pki.oids.envelopedData:t=n.createEnvelopedData();break;case a.pki.oids.encryptedData:t=n.createEncryptedData();break;case a.pki.oids.signedData:t=n.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+c+" is not (yet) supported.")}return t.fromAsn1(r.content.value[0]),t},n.createSignedData=function(){var e=null;return e={type:a.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(o(e,t,n.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(a.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(a.pki.certificateToAsn1(e.certificates[r]));var n=[],s=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),n.length>0&&s.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,n)),s.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),s])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var n=t.certificate;"string"==typeof n&&(n=a.pki.certificateFromPem(n)),r=n.issuer.attributes,i=n.serialNumber}var s=t.key;if(!s)throw Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof s&&(s=a.pki.privateKeyFromPem(s));var o=t.digestAlgorithm||a.pki.oids.sha1;switch(o){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,f=0;f<c.length;++f){var p=c[f];if(!u&&p.type===a.pki.oids.contentType){if(u=!0,l)break;continue}if(!l&&p.type===a.pki.oids.messageDigest){if(l=!0,u)break;continue}}if(!u||!l)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:s,version:1,issuer:r,serialNumber:i,digestAlgorithm:o,signatureAlgorithm:a.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(t){if(t=t||{},("object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.pki.oids.data).getBytes())]),"content"in e)){var r;e.content instanceof a.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=a.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))}0!==e.signers.length&&function(t){if(!(r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0]))throw Error("Could not sign PKCS#7 message; there is no content to sign.");var r,n=i.derToOid(e.contentInfo.value[0].value),o=i.toDer(r);for(var c in o.getByte(),i.getBerValueLength(o),o=o.getBytes(),t)t[c].start().update(o);for(var u=new Date,l=0;l<e.signers.length;++l){var f=e.signers[l];if(0===f.authenticatedAttributes.length){if(n!==a.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{f.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),h=0;h<f.authenticatedAttributes.length;++h){var d=f.authenticatedAttributes[h];d.type===a.pki.oids.messageDigest?d.value=t[f.digestAlgorithm].digest():d.type!==a.pki.oids.signingTime||d.value||(d.value=u),p.value.push(s(d)),f.authenticatedAttributesAsn1.value.push(s(d))}o=i.toDer(p).getBytes(),f.md.start().update(o)}f.signature=f.key.sign(f.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n<e.unauthenticatedAttributes.length;++n){var o=e.unauthenticatedAttributes[n];r.values.push(s(o))}t.value.push(r)}return t}(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var n=e.signers[r],s=n.digestAlgorithm;s in t||(t[s]=a.md[a.pki.oids[s]].create()),0===n.authenticatedAttributes.length?n.md=t[s]:n.md=a.md[a.pki.oids[s]].create()}for(var s in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=a.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw Error("PKCS#7 CRL support not yet implemented.")}}},n.createEncryptedData=function(){var e=null;return e={type:a.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(t){o(e,t,n.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),c(e)}}},n.createEnvelopedData=function(){var e=null;return e={type:a.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=o(e,t,n.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(function(e){var t={},r=[];if(!i.validate(e,n.asn1.recipientInfoValidator,t,r)){var s=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw s.errors=r,s}return{version:t.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(t.issuer),serialNumber:a.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){var t;return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,function(e){for(var t,r=[],n=0;n<e.length;++n)r.push((t=e[n],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,a.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),t.parameter?i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes()):void 0]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])])},findRecipient:function(t){for(var r=t.issuer.attributes,a=0;a<e.recipients.length;++a){var i=e.recipients[a],n=i.issuer;if(i.serialNumber===t.serialNumber&&n.length===r.length){for(var s=!0,o=0;o<r.length;++o)if(n[o].type!==r[o].type||n[o].value!==r[o].value){s=!1;break}if(s)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:case a.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=a.util.createBuffer(i);break;default:throw Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}c(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:a.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case a.pki.oids["aes128-CBC"]:i=16,n=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids["aes192-CBC"]:i=24,n=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids["aes256-CBC"]:i=32,n=16,s=a.aes.createEncryptionCipher;break;case a.pki.oids["des-EDE3-CBC"]:i=24,n=8,s=a.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=a.util.createBuffer(a.random.getBytes(i));else if(t.length()!=i)throw Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=a.util.createBuffer(a.random.getBytes(n));var i,n,s,o=s(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var c=0;c<e.recipients.length;++c){var u=e.recipients[c];if(void 0===u.encryptedContent.content)if(u.encryptedContent.algorithm===a.pki.oids.rsaEncryption)u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data);else throw Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm)}}}}},52849,(e,t,r)=>{var a=e.r(2015);e.r(1258),e.r(82140),e.r(99073),e.r(1500),e.r(26706);var i=t.exports=a.ssh=a.ssh||{};function n(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=a.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function s(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=a.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){r=r||"";var i,c="ssh-rsa",u=""===(t=t||"")?"none":"aes256-cbc",l="PuTTY-User-Key-File-2: "+c+"\r\n";l+="Encryption: "+u+"\r\n",l+="Comment: "+r+"\r\n";var f=a.util.createBuffer();s(f,c),n(f,e.e),n(f,e.n);var p=a.util.encode64(f.bytes(),64),h=Math.floor(p.length/66)+1;l+="Public-Lines: "+h+"\r\n",l+=p;var d=a.util.createBuffer();if(n(d,e.d),n(d,e.p),n(d,e.q),n(d,e.qInv),t){var y=d.length()+16-1;y-=y%16;var g=o(d.bytes());g.truncate(g.length()-y+d.length()),d.putBuffer(g);var m=a.util.createBuffer();m.putBuffer(o("\0\0\0\0",t)),m.putBuffer(o("\0\0\0\x01",t));var v=a.aes.createEncryptionCipher(m.truncate(8),"CBC");v.start(a.util.createBuffer().fillWithByte(0,16)),v.update(d.copy()),v.finish();var C=v.output;C.truncate(16),i=a.util.encode64(C.bytes(),64)}else i=a.util.encode64(d.bytes(),64);l+="\r\nPrivate-Lines: "+(h=Math.floor(i.length/66)+1)+"\r\n",l+=i;var E=o("putty-private-key-file-mac-key",t),S=a.util.createBuffer();s(S,c),s(S,u),s(S,r),S.putInt32(f.length()),S.putBuffer(f),S.putInt32(d.length()),S.putBuffer(d);var T=a.hmac.create();return T.start("sha1",E),T.update(S.bytes()),l+="\r\nPrivate-MAC: "+T.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=a.util.createBuffer();return s(i,r),n(i,e.e),n(i,e.n),r+" "+a.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?a.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||a.md.md5.create(),i=a.util.createBuffer();s(i,"ssh-rsa"),n(i,e.e),n(i,e.n),r.start(),r.update(i.getBytes());var o=r.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw Error('Unknown encoding "'+t.encoding+'".');return o}},72545,(e,t,r)=>{t.exports=e.r(2015),e.r(1258),e.r(59060),e.r(74723),e.r(37170),e.r(30369),e.r(99544),e.r(82140),e.r(7390),e.r(56773),e.r(89449),e.r(39839),e.r(80399),e.r(93139),e.r(36748),e.r(76915),e.r(1392),e.r(68256),e.r(92054),e.r(30756),e.r(15992),e.r(2828),e.r(63045),e.r(52849),e.r(45771),e.r(26706)},85281,(e,t,r)=>{let a=e.r(14747),i=e.r(22734),n=e.r(72545),{MITM_DIR:s}=e.r(96266),o=a.join(s,"rootCA.key"),c=a.join(s,"rootCA.crt");function u(e){try{let t=n.pki.certificateFromPem(i.readFileSync(e,"utf8")),r=new Date(Date.now()+2592e6);return t.validity.notAfter<r}catch{return!0}}t.exports={generateRootCA:async function e(){let e=i.existsSync(o)&&i.existsSync(c);if(e&&!u(c))return console.log("✅ Root CA already exists"),{key:o,cert:c};if(e){console.log("🔐 Root CA expired or expiring soon — regenerating...");try{i.unlinkSync(o)}catch{}try{i.unlinkSync(c)}catch{}}i.existsSync(s)||i.mkdirSync(s,{recursive:!0}),console.log("🔐 Generating Root CA certificate...");let t=n.pki.rsa.generateKeyPair(2048),r=n.pki.createCertificate();r.publicKey=t.publicKey,r.serialNumber="01",r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.validity.notAfter.setFullYear(r.validity.notBefore.getFullYear()+10);let a=[{name:"commonName",value:"9Router MITM Root CA"},{name:"organizationName",value:"9Router"},{name:"countryName",value:"US"}];r.setSubject(a),r.setIssuer(a),r.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,cRLSign:!0,critical:!0},{name:"subjectKeyIdentifier"}]),r.sign(t.privateKey,n.md.sha256.create());let l=n.pki.privateKeyToPem(t.privateKey),f=n.pki.certificateToPem(r);return i.writeFileSync(o,l),i.writeFileSync(c,f),console.log("✅ Root CA generated successfully"),{key:o,cert:c}},loadRootCA:function(){if(!i.existsSync(o)||!i.existsSync(c))throw Error("Root CA not found. Generate it first.");let e=i.readFileSync(o,"utf8"),t=i.readFileSync(c,"utf8");return{key:n.pki.privateKeyFromPem(e),cert:n.pki.certificateFromPem(t)}},generateLeafCert:function(e,t){let r=n.pki.rsa.generateKeyPair(2048),a=n.pki.createCertificate();return a.publicKey=r.publicKey,a.serialNumber=Math.floor(1e6*Math.random()).toString(),a.validity.notBefore=new Date,a.validity.notAfter=new Date,a.validity.notAfter.setFullYear(a.validity.notBefore.getFullYear()+1),a.setSubject([{name:"commonName",value:e}]),a.setIssuer(t.cert.subject.attributes),a.setExtensions([{name:"basicConstraints",cA:!1},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0},{name:"subjectAltName",altNames:[{type:2,value:e},{type:2,value:`*.${e}`}]}]),a.sign(t.key,n.md.sha256.create()),{key:n.pki.privateKeyToPem(r.privateKey),cert:n.pki.certificateToPem(a)}},isCertExpired:u,ROOT_CA_CERT_PATH:c,ROOT_CA_KEY_PATH:o}},22432,(e,t,r)=>{e.r(14747),e.r(22734);let{MITM_DIR:a}=e.r(96266),{generateRootCA:i,loadRootCA:n,generateLeafCert:s}=e.r(85281);t.exports={generateCert:async function e(){return await i()},getCertForDomain:function(e){try{let t=n(),r=s(e,t);return{key:r.key,cert:r.cert}}catch(t){return console.error(`Failed to generate cert for ${e}:`,t.message),null}}}},50532,(e,t,r)=>{let a=e.r(22734),i=e.r(54799),{exec:n,execFileSync:s}=e.r(33405),{execWithPassword:o,isSudoAvailable:c}=e.r(50230),{log:u,err:l}=e.r(32662),f="win32"===process.platform;process.platform;let p="/usr/bin/security";function h(){return"certutil"}function d(e){let t=a.readFileSync(e,"utf-8"),r=Buffer.from(t.replace(/-----[^-]+-----/g,"").replace(/\s/g,""),"base64");return i.createHash("sha1").update(r).digest("hex").toUpperCase().match(/.{2}/g).join(":")}async function y(e){var t;let r;return f?(r=h(),new Promise(e=>{n(`${r} -store Root "9Router MITM Root CA"`,{windowsHide:!0},t=>{if(!t)return e(!0);n(`${r} -user -store Root "9Router MITM Root CA"`,{windowsHide:!0},t=>{if(!t)return e(!0);n("powershell -NoProfile -NonInteractive -Command \"$m = Get-ChildItem -Path Cert:\\LocalMachine\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' } | Select-Object -First 1; $u = Get-ChildItem -Path Cert:\\CurrentUser\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' } | Select-Object -First 1; if ($m -or $u) { exit 0 } else { exit 1 }\"",{windowsHide:!0},t=>{e(!t)})})})})):(t=e,new Promise(e=>{try{if(!a.existsSync(p))return e(!1);let r=d(t).replace(/:/g,"");n(`${p} verify-cert -c "${t}" -p ssl -k /Library/Keychains/System.keychain 2>/dev/null`,t=>{if(!t)return e(!0);n(`${p} dump-trust-settings -d 2>/dev/null | grep -i "${r}"`,(t,r)=>{e(!t&&!!r?.trim())})})}catch{e(!1)}}))}async function g(e,t){if(!a.existsSync(p))throw Error("Certificate install failed: macOS Keychain tools not found at /usr/bin/security. Trust the PEM manually or use a full macOS environment.");let r=`${p} delete-certificate -c "9Router MITM Root CA" /Library/Keychains/System.keychain 2>/dev/null || true`,i=`${p} add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "${t}"`;try{await o(`${r} && ${i}`,e),u("🔐 Cert: ✅ installed to system keychain")}catch(e){throw Error(e.message?.includes("canceled")?"User canceled authorization":`Certificate install failed: ${e.message||"unknown error"}`)}}async function m(e){let t=h();return new Promise((r,a)=>{n(`${t} -addstore Root "${e}"`,{windowsHide:!0},(i,s,o)=>{if(!i)return u("🔐 Cert: ✅ installed to Windows LocalMachine Root store"),r();n(`${t} -user -addstore Root "${e}"`,{windowsHide:!0},(t,i,s)=>{if(!t)return u("🔐 Cert: ✅ installed to Windows CurrentUser Root store"),r();let c=`Import-Certificate -FilePath '${e.replace(/'/g,"''")}' -CertStoreLocation 'Cert:\\CurrentUser\\Root' | Out-Null`;n(`powershell -NoProfile -NonInteractive -Command "${c}"`,{windowsHide:!0},(e,t,i)=>{if(!e)return u("🔐 Cert: ✅ installed to Windows CurrentUser Root store (PowerShell)"),r();let n=[o,s,i].filter(Boolean).join(" | ").trim();a(Error(`Failed to install certificate on Windows Root store(s)${n?`: ${n}`:""}`))})})})})}async function v(e,t){let r=d(t).replace(/:/g,""),a=`${p} delete-certificate -Z "${r}" /Library/Keychains/System.keychain`;try{await o(a,e),u("🔐 Cert: ✅ uninstalled from system keychain")}catch(e){throw Error("Failed to uninstall certificate")}}async function C(){let e=h();return new Promise((t,r)=>{n(`${e} -delstore Root "9Router MITM Root CA"`,{windowsHide:!0},()=>{n(`${e} -user -delstore Root "9Router MITM Root CA"`,{windowsHide:!0},()=>{n("powershell -NoProfile -NonInteractive -Command \"$m = Get-ChildItem -Path Cert:\\LocalMachine\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' }; $u = Get-ChildItem -Path Cert:\\CurrentUser\\Root -ErrorAction SilentlyContinue | Where-Object { $_.Subject -like '*CN=9Router MITM Root CA*' }; $m | Remove-Item -ErrorAction SilentlyContinue; $u | Remove-Item -ErrorAction SilentlyContinue\"",{windowsHide:!0},e=>{if(e)return r(Error(`Failed to uninstall certificate: ${e.message}`));u("🔐 Cert: ✅ uninstalled from Windows Root store(s)"),t()})})})})}t.exports={installCert:async function(e,t){if(!a.existsSync(t))throw Error(`Certificate file not found: ${t}`);await y(t)?u("🔐 Cert: already trusted ✅"):f?await m(t):await g(e,t)},uninstallCert:async function(e,t){await y(t)?f?await C():await v(e,t):u("🔐 Cert: not found in system store")},checkCertInstalled:y,isWSL:function(){return!1}}},9679,(e,t,r)=>{let{exec:a,spawn:i,execSync:n}=e.r(33405),s=e.r(14747),o=e.r(22734);e.r(46786);let c=e.r(4446),u=e.r(24836),l=e.r(54799),{addDNSEntry:f,removeDNSEntry:p,removeAllDNSEntries:h,checkAllDNSStatus:d,TOOL_HOSTS:y,isSudoAvailable:g}=e.r(50230),m="win32"===process.platform,v="darwin"===process.platform,{generateCert:C}=e.r(22432),{installCert:E,uninstallCert:S,checkCertInstalled:T,isWSL:I}=e.r(50532),{isCertExpired:b}=e.r(85281),{MITM_DIR:A}=e.r(96266),{log:B,err:x}=e.r(32662),N=s.join(A,".mitm.pid"),R=[5e3,1e4,2e4,3e4,6e4],k=0,_=0,L=!1,w=function(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let e=s.join("/ROOT/src/mitm","server.js");if(o.existsSync(e))return e;let t=s.join(process.cwd(),"src","mitm","server.js");if(o.existsSync(t))return t;let r=s.join(process.cwd(),"..","src","mitm","server.js");return o.existsSync(r)?r:t}(),U="aes-256-gcm",D="9router-mitm-pwd",P=null,V=null;function O(){return globalThis.__mitmSudoPassword||null}function K(e){globalThis.__mitmSudoPassword=e}function M(e){try{return process.kill(e,0),!0}catch(e){return"EACCES"===e.code}}function F(t,r=!1,i=null){{let n=r?"SIGKILL":"SIGTERM",s=`pkill -${n} -P ${t} 2>/dev/null; kill -${n} ${t} 2>/dev/null`;if(i){let{execWithPassword:t}=e.r(50230);t(s,i).catch(()=>a(s,()=>{}))}else a(s,()=>{})}}function j(){try{let{machineIdSync:t}=e.r(16828),r=t();return l.createHash("sha256").update(r+D).digest()}catch{return l.createHash("sha256").update(D).digest()}}let H=null,G=null;async function q(e,t){if(G)try{let r,a,i,n,s,o={mitmEnabled:e};t&&(r=j(),a=l.randomBytes(12),i=l.createCipheriv(U,r,a),n=Buffer.concat([i.update(t,"utf8"),i.final()]),s=i.getAuthTag(),o.mitmSudoEncrypted=`${a.toString("hex")}:${s.toString("hex")}:${n.toString("hex")}`),await G(o)}catch(e){x(`Failed to save settings: ${e.message}`)}}async function Q(){if(G)try{await G({mitmSudoEncrypted:null})}catch(e){x(`Failed to clear encrypted password: ${e.message}`)}}async function z(){if(!H)return null;try{let e=await H();if(!e.mitmSudoEncrypted)return null;return function(e){try{let[t,r,a]=e.split(":");if(!t||!r||!a)return null;let i=j(),n=l.createDecipheriv(U,i,Buffer.from(t,"hex"));return n.setAuthTag(Buffer.from(r,"hex")),n.update(Buffer.from(a,"hex"))+n.final("utf8")}catch{return null}}(e.mitmSudoEncrypted)}catch{return null}}async function $(t){if(P&&!P.killed){try{P.kill("SIGKILL")}catch{}P=null,V=null}try{if(o.existsSync(N)){let e=parseInt(o.readFileSync(N,"utf-8").trim(),10);e&&M(e)&&(F(e,!0,t),await new Promise(e=>setTimeout(e,500))),o.unlinkSync(N)}}catch{}if(!m&&w)try{let r=w.replace(/'/g,"'\\''");if(t){let{execWithPassword:a}=e.r(50230);await a(`pkill -SIGKILL -f "${r}" 2>/dev/null || true`,t).catch(()=>{})}else a(`pkill -SIGKILL -f "${r}" 2>/dev/null || true`,()=>{});await new Promise(e=>setTimeout(e,500))}catch{}}async function Y(){let e=null!==P&&!P.killed,t=V;if(!e)try{if(o.existsSync(N)){let r=parseInt(o.readFileSync(N,"utf-8").trim(),10);r&&M(r)?(e=!0,t=r):o.unlinkSync(N)}}catch{}let r=d(),a=s.join(A,"rootCA.crt"),i=o.existsSync(a),n=!!i&&await T(a);return{running:e,pid:t,certExists:i,certTrusted:n,dnsStatus:r}}async function W(e){if(L)return;if(Date.now()-_>=6e4&&(k=0),k>=5)return void x("Max restart attempts reached. Giving up.");let t=R[Math.min(k,R.length-1)];k++,L=!0,B(`Restarting in ${t/1e3}s... (${k}/5)`),await new Promise(e=>setTimeout(e,t));try{let t=H?await H():null;if(t&&!t.mitmEnabled){B("MITM disabled, skipping restart"),L=!1;return}let r=O()||await z();if(!r&&!m){x("No cached password, cannot auto-restart"),L=!1;return}await X(e,r),B("🔄 Restarted successfully"),k=0,L=!1}catch(t){x(`Restart attempt ${k}/5 failed: ${t.message}`),L=!1,W(e)}}async function X(t,r){if(!P||P.killed)try{if(o.existsSync(N)){let e=parseInt(o.readFileSync(N,"utf-8").trim(),10);if(e&&M(e))return V=e,B(`♻️ Reusing existing process (PID: ${e})`),await q(!0,r),r&&K(r),{running:!0,pid:e};o.unlinkSync(N)}}catch{}if(P&&!P.killed)throw Error("MITM server is already running");await $(r);{let t=await new Promise(e=>{let t=c.createServer();t.once("error",t=>{"EADDRINUSE"===t.code?e("in-use"):e("no-permission")}),t.once("listening",()=>{t.close(()=>e("free"))}),t.listen(443,"127.0.0.1")});if("in-use"===t||"no-permission"===t){let t=await new Promise(e=>{a('ps aux | grep "[s]erver.js"',(t,r)=>{if(!r?.trim())return e(null);for(let t of r.split("\n")){let r=parseInt(t.trim().split(/\s+/)[1],10);if(!isNaN(r))return e({pid:r,name:"node"})}e(null)})});if(t&&"node"===t.name){B(`Killing orphan node process on port 443 (PID ${t.pid})...`);try{let{execWithPassword:a}=e.r(50230);await a(`kill -9 ${t.pid}`,r),await new Promise(e=>setTimeout(e,800))}catch{}}else if(t){let e=t.name.includes("/")?t.name.split("/").filter(Boolean).pop():t.name;throw Error(`Port 443 is already in use by "${e}" (PID ${t.pid}). Stop that process first.`)}}}let l=s.join(A,"rootCA.crt"),f=s.join(A,"rootCA.key"),p=o.existsSync(l)&&o.existsSync(f);if(!p||b(l)){if(p){B("🔐 Cert expired — uninstalling old cert...");let e=r||O()||await z();try{await S(e,l)}catch{}}B("🔐 Generating Root CA..."),await C()}let h=await T(l);if(m||v||g()||I(),h)B("🔐 Cert: already trusted ✅");else{B("🔐 Cert: not trusted → installing...");let e=r||O()||await z();if(!e&&!m&&!I())throw Error("Sudo password required to install Root CA certificate");try{await E(e,l),B("🔐 Cert: ✅ trusted")}catch(e){throw Error(`Failed to trust certificate: ${e.message}`)}}B("🚀 Starting server..."),g()?((P=i("sudo",["-S","-E","sh","-c",`ROUTER_API_KEY='${t}' NODE_ENV='production' '${process.execPath}' '${w}'`],{detached:!1,stdio:["pipe","pipe","pipe"]})).stdin.write(`${r}
|
|
5
5
|
`),P.stdin.end()):P=i(process.execPath,[w],{detached:!1,stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:t,NODE_ENV:"production"}}),P&&(V=P.pid,o.writeFileSync(N,String(V)),_=Date.now());let y=null;P&&(P.stdout.on("data",e=>{process.stdout.write(e)}),P.stderr.on("data",e=>{let t=e.toString().trim();t&&(m||!t.includes("Password:")&&!t.includes("password for"))&&(x(t),y=t),!m&&(t.includes("incorrect password")||t.includes("no password was provided"))&&(K(null),Q(),L=!0)}),P.on("exit",e=>{B(`Server exited (code: ${e})`),P=null,V=null;try{o.unlinkSync(N)}catch{}0===e||L||W(t)}));let R=await function(e=443){return new Promise(t=>{let r=Date.now()+8e3,a=()=>{let i=u.request({hostname:"127.0.0.1",port:e,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},e=>{let r="";e.on("data",e=>{r+=e}),e.on("end",()=>{try{let e=JSON.parse(r);t(!0===e.ok?{ok:!0,pid:e.pid||null}:null)}catch{t(null)}})});i.on("error",()=>{Date.now()<r?setTimeout(a,500):t(null)}),i.end()};a()})}(443);if(!R){if(P&&!P.killed){try{P.kill()}catch{}P=null}let e=function(){try{{let e=n("lsof -i :443",{encoding:"utf8"}).trim().split("\n");if(e.length>1)return e[1].split(/\s+/)[0]}}catch{}return null}(),t=e?` Port 443 already in use by ${e}.`:"",r=y||`Check sudo password or port 443 access.${t}`;throw Error(`MITM server failed to start. ${r}`)}for(let[e,t]of(G&&await G({mitmCertInstalled:!0}).catch(()=>{}),B(`✅ Server healthy (PID: ${V||R.pid})`),Object.entries(d())))B(`🌐 DNS ${e}: ${t?"✅ active":"❌ inactive"}`);return await q(!0,r),r&&K(r),{running:!0,pid:V}}async function Z(e){L=!0,k=0,B("⏹ Stopping server...");let t=P,r=t&&!t.killed?t.pid:(()=>{try{return parseInt(o.readFileSync(N,"utf-8").trim(),10)}catch{return null}})();r&&M(r)&&(B(`Killing server (PID: ${r})...`),F(r,!1,e),await new Promise(e=>setTimeout(e,1e3)),M(r)&&F(r,!0,e)),P=null,V=null,await h(e);try{o.unlinkSync(N)}catch{}return await q(!1,null),L=!1,{running:!1,pid:null}}async function J(e,t){if(!(await Y()).running)throw Error("MITM server is not running. Start the server first.");let r=t||O()||await z();return await f(e,r),{success:!0}}t.exports={getMitmStatus:Y,startServer:X,stopServer:Z,enableToolDNS:J,disableToolDNS:async function e(e,t){let r=t||O()||await z();return await p(e,r),{success:!0}},trustCert:async function e(e){let t=s.join(A,"rootCA.crt");if(!o.existsSync(t))throw Error("Root CA not found. Start server first to generate it.");m||v||g()||I();let r=e||O()||await z();if(!r&&!m&&!I())throw Error("Sudo password required to trust certificate");await E(r,t),r&&K(r)},startMitm:X,stopMitm:Z,getCachedPassword:O,setCachedPassword:K,loadEncryptedPassword:z,clearEncryptedPassword:Q,initDbHooks:function(e,t){H=e,G=t}}}];
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=_0itng60._.js.map
|