@100mslive/roomkit-react 0.3.14-alpha.7 → 0.3.14-alpha.9

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.cjs.js CHANGED
@@ -109,7 +109,7 @@ var __async = (__this, __arguments, generator) => {
109
109
  var define_process_env_default;
110
110
  var init_define_process_env = __esm({
111
111
  "<define:process.env>"() {
112
- define_process_env_default = { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_5e2df5ff-9e88-48c5-ae09-3f35ab8bdfbe", npm_package_devDependencies_ts_node: "^10.4.0", npm_package_devDependencies__types_node: "^16.11.17", npm_package_exports___index_css: "./dist/index.css", npm_package_exports___require: "./dist/index.cjs.js", STATS_TRP: "true", DEPLOYMENT_BASEPATH: "/opt/runner", DOTNET_NOLOGO: "1", npm_package_dependencies_screenfull: "^5.1.0", npm_package_dependencies_react_draggable: "^4.4.5", npm_package_dependencies__radix_ui_react_switch: "1.0.0", npm_package_dependencies__100mslive_hms_whiteboard: "0.0.4-alpha.7", USER: "runner", npm_package_devDependencies_jest: "26.6.0", npm_config_version_commit_hooks: "true", npm_config_user_agent: "yarn/1.22.22 npm/? node/v18.20.3 linux x64", npm_config_always_auth: "", NX_WORKSPACE_ROOT: "/home/runner/work/web-sdks/web-sdks", npm_package_scripts_babel: "npx storybook@latest babelrc", CI: "true", npm_package_devDependencies__size_limit_file: "^5.0.3", npm_config_bin_links: "true", npm_config_wrap_output: "", npm_package_dependencies__radix_ui_react_tabs: "1.0.0", npm_package_dependencies__100mslive_react_sdk: "0.10.14-alpha.7", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_5e2df5ff-9e88-48c5-ae09-3f35ab8bdfbe", PIPX_HOME: "/opt/pipx", npm_node_execpath: "/opt/hostedtoolcache/node/18.20.3/x64/bin/node", npm_config_init_version: "1.0.0", npm_package_dependencies__emoji_mart_react: "^1.0.1", npm_package_dependencies__emoji_mart_data: "^1.0.6", npm_package_dependencies__100mslive_hms_virtual_background: "1.13.14-alpha.7", JAVA_HOME_8_X64: "/usr/lib/jvm/temurin-8-jdk-amd64", NODE_AUTH_TOKEN: "XXXXX-XXXXX-XXXXX-XXXXX", SHLVL: "1", npm_package_dependencies__radix_ui_react_tooltip: "1.0.6", npm_package_dependencies__radix_ui_react_popover: "1.0.6", npm_package_dependencies__100mslive_types_prebuilt: "0.12.9", npm_package_peerDependencies_react: ">=17.0.2 <19.0.0", npm_package_devDependencies__storybook_addon_links: "^7.0.27", npm_package_files_0: "dist", HOME: "/home/runner", npm_package_devDependencies__typescript_eslint_parser: "^5.4.0", npm_package_dependencies__radix_ui_react_dialog: "1.0.4", npm_package_devDependencies__types_react_window: "^1.8.5", npm_package_files_1: "src", npm_package_repository_directory: "packages/roomkit-react", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_package_scripts_controller: "cd packages/hls-controller && yarn start", npm_package_dependencies__stitches_react: "^1.2.8", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "100mslive", npm_package_engines_node: ">=16", npm_package_devDependencies_typedoc_plugin_markdown: "^3.14.0", npm_config_init_license: "MIT", GRADLE_HOME: "/usr/share/gradle-8.8", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/26.3.11579264", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", STATS_RDCL: "true", GITHUB_RETENTION_DAYS: "90", YARN_WRAP_OUTPUT: "false", npm_config_version_tag_prefix: "v", GITHUB_REPOSITORY_OWNER_ID: "73883131", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-ubuntu22", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", npm_package_scripts_lint_fix: "yarn lint --fix", npm_config_userconfig: "/home/runner/work/_temp/.npmrc", npm_package_devDependencies__storybook_addon_a11y: "^7.0.27", SYSTEMD_EXEC_PID: "592", npm_package_scripts_postinstall: "husky install && lerna bootstrap", npm_package_devDependencies_husky: "^6.0.0", npm_package_dependencies_recordrtc: "^5.6.2", npm_package_dependencies_eventemitter2: "^6.4.9", npm_package_dependencies__radix_ui_react_label: "1.0.0", npm_package_dependencies__radix_ui_react_dropdown_menu: "2.0.5", npm_package_keywords_0: "100mslive", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", npm_package_description: "100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.", npm_package_devDependencies_typescript: "~4.7.4", npm_package_devDependencies_typedoc: "^0.24.8", npm_package_devDependencies_babel_loader: "^8.2.5", npm_package_keywords_1: "react", GOROOT_1_20_X64: "/opt/hostedtoolcache/go/1.20.14/x64", NVM_DIR: "/home/runner/.nvm", npm_package_readmeFilename: "README.md", npm_package_devDependencies_react: "^18.1.0", npm_package_devDependencies__babel_preset_env: "^7.22.5", npm_package_keywords_2: "prebuilt", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", GOROOT_1_21_X64: "/opt/hostedtoolcache/go/1.21.11/x64", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20240616.1.0", npm_package_devDependencies_prettier: "^2.4.1", npm_package_devDependencies_babel_jest: "^26.6.0", npm_package_scripts_dev: "node ../../scripts/dev", npm_package_keywords_3: "roomkit", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", GOROOT_1_22_X64: "/opt/hostedtoolcache/go/1.22.4/x64", SWIFT_PATH: "/usr/share/swift/usr/bin", FORCE_COLOR: "true", npm_package_dependencies__radix_ui_react_toast: "1.0.0", npm_package_dependencies__radix_ui_react_radio_group: "1.0.0", npm_package_dependencies__100mslive_hms_noise_cancellation: "0.0.1", npm_package_devDependencies__babel_preset_typescript: "^7.22.5", npm_package_exports___default: "./dist/index.js", RUNNER_USER: "runner", STATS_V3PS: "true", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", JOURNAL_STREAM: "8:17308", GITHUB_WORKFLOW: "Publish Packages", _: "/usr/local/bin/yarn", npm_package_devDependencies_ts_jest: "26.5.6", npm_package_devDependencies_lerna: "^5.6.2", npm_package_devDependencies__types_jest: "^27.0.3", npm_package_devDependencies__commitlint_config_conventional: "^15.0.0", npm_package_private: "true", npm_package_dependencies__radix_ui_react_accordion: "1.0.0", npm_package_devDependencies__babel_preset_react: "^7.22.5", npm_package_module: "dist/index.js", npm_package_scripts_lint: "eslint -c .eslintrc --no-error-on-unmatched-pattern src --ext .js --ext .jsx --ext .ts --ext .tsx", npm_package_devDependencies__typescript_eslint_eslint_plugin: "^5.4.0", npm_config_registry: "https://registry.yarnpkg.com", npm_package_dependencies_react_window: "^1.8.7", npm_package_dependencies__100mslive_hls_player: "0.3.14-alpha.7", npm_package_devDependencies__types_lodash_merge: "^4.6.6", npm_package_devDependencies__storybook_cli: "^7.0.27", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", STATS_D: "false", GITHUB_RUN_ID: "9598388267", STATS_VMFE: "true", npm_package_workspaces_0: "packages/*", npm_package_scripts_store: "cd packages/hms-video-store && yarn start", npm_package_devDependencies__babel_core: "^7.18.2", npm_package_dependencies_ts_pattern: "4.3.0", npm_package_devDependencies__storybook_addon_interactions: "^7.0.27", npm_package_devDependencies__storybook_addon_actions: "^7.0.27", GITHUB_REF_TYPE: "branch", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "c57e858bbc09c5b82722610c4ae0fcf200e61161", GITHUB_BASE_REF: "", ImageOS: "ubuntu22", npm_package_workspaces_1: "examples/*", npm_package_scripts_start: 'concurrently "yarn dev" "yarn types"', npm_config_ignore_scripts: "", NX_TASK_HASH: "2c40941210fdfcce83d8f8ea6e75595dc23825a6d30d1f8b04ee1d5c13c011e8", npm_package_exports___import: "./dist/index.js", GITHUB_WORKFLOW_REF: "100mslive/web-sdks/.github/workflows/publish.yml@refs/heads/publish-alpha", PERFLOG_LOCATION_SETTING: "RUNNER_PERFLOG", GITHUB_ACTION_REPOSITORY: "", npm_package_scripts_prebuilt: "cd packages/roomkit-react && yarn start", npm_package_devDependencies_postcss_loader: "^6.2.1", npm_package_devDependencies_esbuild_loader: "^4.0.2", PATH: "/tmp/yarn--1718890248699-0.19677626630198497:/home/runner/work/web-sdks/web-sdks/packages/roomkit-react/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/tmp/yarn--1718890248506-0.34564658162174067:/home/runner/work/web-sdks/web-sdks/packages/roomkit-react/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/tmp/yarn--1718890223199-0.8761704666839227:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/tmp/yarn--1718890223022-0.05784877896719243:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", NODE: "/opt/hostedtoolcache/node/18.20.3/x64/bin/node", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_a00aa94b-086d-4f59-aff2-64b17cc8cc39", INVOCATION_ID: "ddaa7297c32e4415969cd4dbdf7c4640", NPM_CONFIG_USERCONFIG: "/home/runner/work/_temp/.npmrc", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", npm_package_scripts_size: "size-limit", npm_package_devDependencies_size_limit: "^5.0.3", npm_package_name: "@100mslive/roomkit-react", npm_package_devDependencies__storybook_react_webpack5: "^7.0.27", npm_package_repository_type: "git", GITHUB_ACTION: "__run_3", GITHUB_RUN_NUMBER: "584", GITHUB_TRIGGERING_ACTOR: "github-actions[bot]", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_package_lint_staged____js_ts_jsx_tsx_: "eslint", npm_package_devDependencies_babel_plugin_istanbul: "^6.1.1", LERNA_PACKAGE_NAME: "@100mslive/roomkit-react", npm_package_dependencies__radix_ui_react_select: "1.0.0", npm_package_size_limit_0_limit: "20 KB", npm_package_devDependencies__commitlint_cli: "^15.0.0", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", npm_package_size_limit_1_limit: "20 KB", npm_package_devDependencies_eslint_plugin_simple_import_sort: "^8.0.0", npm_package_devDependencies_eslint: "^8.9.0", npm_package_dependencies_react_intersection_observer: "^9.4.3", npm_package_devDependencies__types_mdx: "2.0.2", CONDA: "/usr/share/miniconda", RUNNER_NAME: "GitHub Actions 361", XDG_CONFIG_HOME: "/home/runner/.config", STATS_VMD: "true", GITHUB_REF_NAME: "publish-alpha", GITHUB_REPOSITORY: "100mslive/web-sdks", STATS_D_D: "false", npm_lifecycle_script: "rm -rf dist && node ../../scripts/build-webapp", npm_package_size_limit_2_limit: "400 KB", npm_package_resolutions_loader_utils: "^2.0.4", npm_package_devDependencies_dotenv: "^14.2.0", npm_package_dependencies__radix_ui_react_slider: "1.0.0", npm_package_scripts_types_build: "tsc -p tsconfig.json", npm_package_main: "dist/index.cjs.js", STATS_UE: "true", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/25.2.9519653", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", npm_package_size_limit_3_limit: "20 KB", npm_package_size_limit_0_path: "packages/hms-video-store/dist/index.cjs.js", npm_package_scripts_cypress_open: "cypress open", npm_package_scripts_lerna_publish: "lerna publish from-package --dist-tag $PUBLISH_FLAG --yes --no-verify-access", npm_package_scripts_test: "yarn build --no-private && lerna run test", npm_package_devDependencies_concurrently: "^6.4.0", npm_config_version_git_message: "v%s", npm_package_dependencies__radix_ui_react_checkbox: "1.0.0", npm_package_dependencies__100mslive_react_icons: "0.10.14-alpha.7", npm_package_scripts_types: "tsc -w", GITHUB_REPOSITORY_ID: "429826515", GITHUB_ACTIONS: "true", npm_lifecycle_event: "build:only", npm_package_version: "0.3.14-alpha.7", npm_package_size_limit_4_limit: "20 KB", npm_package_size_limit_1_path: "packages/hms-video-store/dist/index.js", npm_package_scripts_build_only: "rm -rf dist && node ../../scripts/build-webapp", npm_package_devDependencies__types_react: "^18.1.0", npm_package_sideEffects: "false", npm_package_repository_url: "https://github.com/100mslive/web-sdks.git", npm_package_source: "src/index.ts", GITHUB_REF_PROTECTED: "true", npm_config_argv: '{"remain":[],"cooked":["run","test"],"original":["test"]}', npm_package_size_limit_5_limit: "20 KB", npm_package_size_limit_2_path: "packages/roomkit-react/dist/index.cjs.js", npm_package_scripts_build: "yarn build:only && yarn types:build", npm_package_devDependencies_tslib: "^2.2.0", npm_package_devDependencies_nx: "^14.5.1", npm_package_devDependencies_lint_staged: "^12.0.3", NX_CLI_SET: "true", npm_package_dependencies_uuid: "^8.3.2", npm_package_dependencies_react_virtualized_auto_sizer: "^1.0.7", npm_package_dependencies_lodash_merge: "^4.6.2", npm_package_dependencies_emoji_mart: "^5.2.2", GITHUB_WORKSPACE: "/home/runner/work/web-sdks/web-sdks", ACCEPT_EULA: "Y", GITHUB_JOB: "publish_packages", RUNNER_PERFLOG: "/home/runner/perflog", npm_package_size_limit_6_limit: "150 KB", npm_package_size_limit_3_path: "packages/roomkit-react/dist/index.js", npm_package_devDependencies_cypress: "^9.5.2", GITHUB_SHA: "c57e858bbc09c5b82722610c4ae0fcf200e61161", GITHUB_RUN_ATTEMPT: "1", npm_package_size_limit_7_limit: "100 KB", npm_package_size_limit_4_path: "packages/hms-virtual-background/dist/index.cjs.js", npm_config_version_git_tag: "true", npm_config_version_git_sign: "", npm_package_dependencies_qrcode_react: "^3.1.0", GITHUB_REF: "refs/heads/publish-alpha", GITHUB_ACTOR: "github-actions[bot]", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", npm_package_license: "MIT", npm_package_size_limit_5_path: "packages/hms-virtual-background/dist/index.js", npm_config_strict_ssl: "true", LEIN_HOME: "/usr/local/lib/lein", npm_package_size_limit_6_path: "packages/react-icons/dist/index.cjs.js", npm_package_scripts_format: "prettier -w src/**", npm_package_devDependencies_eslint_plugin_prettier: "^4.0.0", npm_package_devDependencies_eslint_config_react_app: "^7.0.0", NX_TASK_TARGET_PROJECT: "@100mslive/roomkit-react", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_5e2df5ff-9e88-48c5-ae09-3f35ab8bdfbe", JAVA_HOME: "/usr/lib/jvm/temurin-11-jdk-amd64", PWD: "/home/runner/work/web-sdks/web-sdks/packages/roomkit-react", GITHUB_ACTOR_ID: "41898282", RUNNER_WORKSPACE: "/home/runner/work/web-sdks", npm_execpath: "/usr/local/lib/node_modules/yarn/bin/yarn.js", npm_package_size_limit_7_path: "packages/react-icons/dist/index.js", npm_package_scripts_ybys: "yarn && yarn build --no-private && yarn storybook", npm_package_dependencies__radix_ui_react_progress: "1.0.0", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", STATS_TIS: "mining", GITHUB_EVENT_NAME: "workflow_dispatch", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", LEIN_JAR: "/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_5e2df5ff-9e88-48c5-ae09-3f35ab8bdfbe", npm_package_scripts_prestart: "rm -rf dist && yarn types:build", npm_package_author_name: "100ms", EDGEWEBDRIVER: "/usr/local/share/edge_driver", STATS_EXT: "true", npm_package_scripts_build_storybook: "sb build", npm_package_devDependencies_postcss: "^8.4.5", npm_package_devDependencies_esbuild: "^0.18.13", npm_config_save_prefix: "^", npm_config_ignore_optional: "", npm_package_dependencies_worker_timers: "^7.0.40", npm_package_typings: "dist/index.d.ts", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/25.2.9519653", SGX_AESM_ADDR: "1", CHROME_BIN: "/usr/bin/google-chrome", npm_package_scripts_storybook: "sb dev -p 6006", npm_package_devDependencies_esbuild_plugin_postcss2: "0.1.1", npm_package_dependencies_react_swipeable: "^7.0.1", npm_package_devDependencies_babel_plugin_react_require: "3.1.3", npm_package_devDependencies__storybook_testing_library: "^0.2.0", npm_package_devDependencies__storybook_addon_essentials: "^7.0.27", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", STATS_EXTP: "https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.181+6/provjobd.data", npm_package_scripts_reactsdk: "cd packages/react-sdk && yarn start", npm_package_dependencies_react_use: "^17.4.0", npm_package_dependencies__radix_ui_react_collapsible: "1.0.0", npm_package_devDependencies_storybook_dark_mode: "^3.0.0", npm_package_devDependencies__storybook_react: "^7.0.27", INIT_CWD: "/home/runner/work/web-sdks/web-sdks", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/25.2.9519653", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_5e2df5ff-9e88-48c5-ae09-3f35ab8bdfbe" };
112
+ define_process_env_default = { GITHUB_STATE: "/home/runner/work/_temp/_runner_file_commands/save_state_64e68346-fe70-4da2-95d3-209214f9bdaf", npm_package_devDependencies_ts_node: "^10.4.0", npm_package_devDependencies__types_node: "^16.11.17", npm_package_exports___index_css: "./dist/index.css", npm_package_exports___require: "./dist/index.cjs.js", STATS_TRP: "true", DEPLOYMENT_BASEPATH: "/opt/runner", DOTNET_NOLOGO: "1", npm_package_dependencies_screenfull: "^5.1.0", npm_package_dependencies_react_draggable: "^4.4.5", npm_package_dependencies__radix_ui_react_switch: "1.0.0", npm_package_dependencies__100mslive_hms_whiteboard: "0.0.4-alpha.9", USER: "runner", npm_package_devDependencies_jest: "26.6.0", npm_config_version_commit_hooks: "true", npm_config_user_agent: "yarn/1.22.22 npm/? node/v18.20.3 linux x64", npm_config_always_auth: "", NX_WORKSPACE_ROOT: "/home/runner/work/web-sdks/web-sdks", npm_package_scripts_babel: "npx storybook@latest babelrc", CI: "true", npm_package_devDependencies__size_limit_file: "^5.0.3", npm_config_bin_links: "true", npm_config_wrap_output: "", npm_package_dependencies__radix_ui_react_tabs: "1.0.0", npm_package_dependencies__100mslive_react_sdk: "0.10.14-alpha.9", RUNNER_ENVIRONMENT: "github-hosted", GITHUB_ENV: "/home/runner/work/_temp/_runner_file_commands/set_env_64e68346-fe70-4da2-95d3-209214f9bdaf", PIPX_HOME: "/opt/pipx", npm_node_execpath: "/opt/hostedtoolcache/node/18.20.3/x64/bin/node", npm_config_init_version: "1.0.0", npm_package_dependencies__emoji_mart_react: "^1.0.1", npm_package_dependencies__emoji_mart_data: "^1.0.6", npm_package_dependencies__100mslive_hms_virtual_background: "1.13.14-alpha.9", JAVA_HOME_8_X64: "/usr/lib/jvm/temurin-8-jdk-amd64", NODE_AUTH_TOKEN: "XXXXX-XXXXX-XXXXX-XXXXX", SHLVL: "1", npm_package_dependencies__radix_ui_react_tooltip: "1.0.6", npm_package_dependencies__radix_ui_react_popover: "1.0.6", npm_package_dependencies__100mslive_types_prebuilt: "0.12.9", npm_package_peerDependencies_react: ">=17.0.2 <19.0.0", npm_package_devDependencies__storybook_addon_links: "^7.0.27", npm_package_files_0: "dist", HOME: "/home/runner", npm_package_devDependencies__typescript_eslint_parser: "^5.4.0", npm_package_dependencies__radix_ui_react_dialog: "1.0.4", npm_package_devDependencies__types_react_window: "^1.8.5", npm_package_files_1: "src", npm_package_repository_directory: "packages/roomkit-react", RUNNER_TEMP: "/home/runner/work/_temp", GITHUB_EVENT_PATH: "/home/runner/work/_temp/_github_workflow/event.json", npm_package_scripts_controller: "cd packages/hls-controller && yarn start", npm_package_dependencies__stitches_react: "^1.2.8", JAVA_HOME_11_X64: "/usr/lib/jvm/temurin-11-jdk-amd64", PIPX_BIN_DIR: "/opt/pipx_bin", GITHUB_REPOSITORY_OWNER: "100mslive", npm_package_engines_node: ">=16", npm_package_devDependencies_typedoc_plugin_markdown: "^3.14.0", npm_config_init_license: "MIT", GRADLE_HOME: "/usr/share/gradle-8.8", ANDROID_NDK_LATEST_HOME: "/usr/local/lib/android/sdk/ndk/26.3.11579264", JAVA_HOME_21_X64: "/usr/lib/jvm/temurin-21-jdk-amd64", STATS_RDCL: "true", GITHUB_RETENTION_DAYS: "90", YARN_WRAP_OUTPUT: "false", npm_config_version_tag_prefix: "v", GITHUB_REPOSITORY_OWNER_ID: "73883131", POWERSHELL_DISTRIBUTION_CHANNEL: "GitHub-Actions-ubuntu22", AZURE_EXTENSION_DIR: "/opt/az/azcliextensions", GITHUB_HEAD_REF: "", npm_package_scripts_lint_fix: "yarn lint --fix", npm_config_userconfig: "/home/runner/work/_temp/.npmrc", npm_package_devDependencies__storybook_addon_a11y: "^7.0.27", SYSTEMD_EXEC_PID: "592", npm_package_scripts_postinstall: "husky install && lerna bootstrap", npm_package_devDependencies_husky: "^6.0.0", npm_package_dependencies_recordrtc: "^5.6.2", npm_package_dependencies_eventemitter2: "^6.4.9", npm_package_dependencies__radix_ui_react_label: "1.0.0", npm_package_dependencies__radix_ui_react_dropdown_menu: "2.0.5", npm_package_keywords_0: "100mslive", GITHUB_GRAPHQL_URL: "https://api.github.com/graphql", npm_package_description: "100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.", npm_package_devDependencies_typescript: "~4.7.4", npm_package_devDependencies_typedoc: "^0.24.8", npm_package_devDependencies_babel_loader: "^8.2.5", npm_package_keywords_1: "react", GOROOT_1_20_X64: "/opt/hostedtoolcache/go/1.20.14/x64", NVM_DIR: "/home/runner/.nvm", npm_package_readmeFilename: "README.md", npm_package_devDependencies_react: "^18.1.0", npm_package_devDependencies__babel_preset_env: "^7.22.5", npm_package_keywords_2: "prebuilt", DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1", GOROOT_1_21_X64: "/opt/hostedtoolcache/go/1.21.11/x64", JAVA_HOME_17_X64: "/usr/lib/jvm/temurin-17-jdk-amd64", ImageVersion: "20240616.1.0", npm_package_devDependencies_prettier: "^2.4.1", npm_package_devDependencies_babel_jest: "^26.6.0", npm_package_scripts_dev: "node ../../scripts/dev", npm_package_keywords_3: "roomkit", RUNNER_OS: "Linux", GITHUB_API_URL: "https://api.github.com", GOROOT_1_22_X64: "/opt/hostedtoolcache/go/1.22.4/x64", SWIFT_PATH: "/usr/share/swift/usr/bin", FORCE_COLOR: "true", npm_package_dependencies__radix_ui_react_toast: "1.0.0", npm_package_dependencies__radix_ui_react_radio_group: "1.0.0", npm_package_dependencies__100mslive_hms_noise_cancellation: "0.0.1", npm_package_devDependencies__babel_preset_typescript: "^7.22.5", npm_package_exports___default: "./dist/index.js", RUNNER_USER: "runner", STATS_V3PS: "true", CHROMEWEBDRIVER: "/usr/local/share/chromedriver-linux64", JOURNAL_STREAM: "8:16186", GITHUB_WORKFLOW: "Publish Packages", _: "/usr/local/bin/yarn", npm_package_devDependencies_ts_jest: "26.5.6", npm_package_devDependencies_lerna: "^5.6.2", npm_package_devDependencies__types_jest: "^27.0.3", npm_package_devDependencies__commitlint_config_conventional: "^15.0.0", npm_package_private: "true", npm_package_dependencies__radix_ui_react_accordion: "1.0.0", npm_package_devDependencies__babel_preset_react: "^7.22.5", npm_package_module: "dist/index.js", npm_package_scripts_lint: "eslint -c .eslintrc --no-error-on-unmatched-pattern src --ext .js --ext .jsx --ext .ts --ext .tsx", npm_package_devDependencies__typescript_eslint_eslint_plugin: "^5.4.0", npm_config_registry: "https://registry.yarnpkg.com", npm_package_dependencies_react_window: "^1.8.7", npm_package_dependencies__100mslive_hls_player: "0.3.14-alpha.9", npm_package_devDependencies__types_lodash_merge: "^4.6.6", npm_package_devDependencies__storybook_cli: "^7.0.27", ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE: "/opt/actionarchivecache", STATS_D: "false", GITHUB_RUN_ID: "9643076846", STATS_VMFE: "true", npm_package_workspaces_0: "packages/*", npm_package_scripts_store: "cd packages/hms-video-store && yarn start", npm_package_devDependencies__babel_core: "^7.18.2", npm_package_dependencies_ts_pattern: "4.3.0", npm_package_devDependencies__storybook_addon_interactions: "^7.0.27", npm_package_devDependencies__storybook_addon_actions: "^7.0.27", GITHUB_REF_TYPE: "branch", BOOTSTRAP_HASKELL_NONINTERACTIVE: "1", GITHUB_WORKFLOW_SHA: "3caf5ae1abb71e5e7dede48bc4b9b8dfa5a25a8a", GITHUB_BASE_REF: "", ImageOS: "ubuntu22", npm_package_workspaces_1: "examples/*", npm_package_scripts_start: 'concurrently "yarn dev" "yarn types"', npm_config_ignore_scripts: "", NX_TASK_HASH: "45931fde6bf77d2d1cd3b95a11a2f9c9943817998bd64fda1e0d9d0cbbf7acbf", npm_package_exports___import: "./dist/index.js", GITHUB_WORKFLOW_REF: "100mslive/web-sdks/.github/workflows/publish.yml@refs/heads/publish-alpha", PERFLOG_LOCATION_SETTING: "RUNNER_PERFLOG", GITHUB_ACTION_REPOSITORY: "", npm_package_scripts_prebuilt: "cd packages/roomkit-react && yarn start", npm_package_devDependencies_postcss_loader: "^6.2.1", npm_package_devDependencies_esbuild_loader: "^4.0.2", PATH: "/tmp/yarn--1719221877947-0.7338311406643205:/home/runner/work/web-sdks/web-sdks/packages/roomkit-react/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/tmp/yarn--1719221877752-0.7893639730050881:/home/runner/work/web-sdks/web-sdks/packages/roomkit-react/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/tmp/yarn--1719221852672-0.07427928548185037:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/tmp/yarn--1719221852496-0.7880008360495065:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/home/runner/.config/yarn/link/node_modules/.bin:/home/runner/work/web-sdks/web-sdks/node_modules/.bin:/opt/hostedtoolcache/node/18.20.3/x64/libexec/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/lib/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin/node_modules/npm/bin/node-gyp-bin:/opt/hostedtoolcache/node/18.20.3/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin", NODE: "/opt/hostedtoolcache/node/18.20.3/x64/bin/node", ANT_HOME: "/usr/share/ant", DOTNET_MULTILEVEL_LOOKUP: "0", RUNNER_TRACKING_ID: "github_b19dd9ee-c4a0-4f55-ae8f-3ea51e07fb3d", INVOCATION_ID: "0c5c352daeb1430cbd335645819f2fd5", NPM_CONFIG_USERCONFIG: "/home/runner/work/_temp/.npmrc", RUNNER_TOOL_CACHE: "/opt/hostedtoolcache", npm_package_scripts_size: "size-limit", npm_package_devDependencies_size_limit: "^5.0.3", npm_package_name: "@100mslive/roomkit-react", npm_package_devDependencies__storybook_react_webpack5: "^7.0.27", npm_package_repository_type: "git", GITHUB_ACTION: "__run_3", GITHUB_RUN_NUMBER: "586", GITHUB_TRIGGERING_ACTOR: "github-actions[bot]", RUNNER_ARCH: "X64", XDG_RUNTIME_DIR: "/run/user/1001", AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache", npm_package_lint_staged____js_ts_jsx_tsx_: "eslint", npm_package_devDependencies_babel_plugin_istanbul: "^6.1.1", LERNA_PACKAGE_NAME: "@100mslive/roomkit-react", npm_package_dependencies__radix_ui_react_select: "1.0.0", npm_package_size_limit_0_limit: "20 KB", npm_package_devDependencies__commitlint_cli: "^15.0.0", LANG: "C.UTF-8", VCPKG_INSTALLATION_ROOT: "/usr/local/share/vcpkg", npm_package_size_limit_1_limit: "20 KB", npm_package_devDependencies_eslint_plugin_simple_import_sort: "^8.0.0", npm_package_devDependencies_eslint: "^8.9.0", npm_package_dependencies_react_intersection_observer: "^9.4.3", npm_package_devDependencies__types_mdx: "2.0.2", CONDA: "/usr/share/miniconda", RUNNER_NAME: "GitHub Actions 469", XDG_CONFIG_HOME: "/home/runner/.config", STATS_VMD: "true", GITHUB_REF_NAME: "publish-alpha", GITHUB_REPOSITORY: "100mslive/web-sdks", STATS_D_D: "false", npm_lifecycle_script: "rm -rf dist && node ../../scripts/build-webapp", npm_package_size_limit_2_limit: "400 KB", npm_package_resolutions_loader_utils: "^2.0.4", npm_package_devDependencies_dotenv: "^14.2.0", npm_package_dependencies__radix_ui_react_slider: "1.0.0", npm_package_scripts_types_build: "tsc -p tsconfig.json", npm_package_main: "dist/index.cjs.js", STATS_UE: "true", ANDROID_NDK_ROOT: "/usr/local/lib/android/sdk/ndk/25.2.9519653", GITHUB_ACTION_REF: "", DEBIAN_FRONTEND: "noninteractive", npm_package_size_limit_3_limit: "20 KB", npm_package_size_limit_0_path: "packages/hms-video-store/dist/index.cjs.js", npm_package_scripts_cypress_open: "cypress open", npm_package_scripts_lerna_publish: "lerna publish from-package --dist-tag $PUBLISH_FLAG --yes --no-verify-access", npm_package_scripts_test: "yarn build --no-private && lerna run test", npm_package_devDependencies_concurrently: "^6.4.0", npm_config_version_git_message: "v%s", npm_package_dependencies__radix_ui_react_checkbox: "1.0.0", npm_package_dependencies__100mslive_react_icons: "0.10.14-alpha.9", npm_package_scripts_types: "tsc -w", GITHUB_REPOSITORY_ID: "429826515", GITHUB_ACTIONS: "true", npm_lifecycle_event: "build:only", npm_package_version: "0.3.14-alpha.9", npm_package_size_limit_4_limit: "20 KB", npm_package_size_limit_1_path: "packages/hms-video-store/dist/index.js", npm_package_scripts_build_only: "rm -rf dist && node ../../scripts/build-webapp", npm_package_devDependencies__types_react: "^18.1.0", npm_package_sideEffects: "false", npm_package_repository_url: "https://github.com/100mslive/web-sdks.git", npm_package_source: "src/index.ts", GITHUB_REF_PROTECTED: "true", npm_config_argv: '{"remain":[],"cooked":["run","test"],"original":["test"]}', npm_package_size_limit_5_limit: "20 KB", npm_package_size_limit_2_path: "packages/roomkit-react/dist/index.cjs.js", npm_package_scripts_build: "yarn build:only && yarn types:build", npm_package_devDependencies_tslib: "^2.2.0", npm_package_devDependencies_nx: "^14.5.1", npm_package_devDependencies_lint_staged: "^12.0.3", NX_CLI_SET: "true", npm_package_dependencies_uuid: "^8.3.2", npm_package_dependencies_react_virtualized_auto_sizer: "^1.0.7", npm_package_dependencies_lodash_merge: "^4.6.2", npm_package_dependencies_emoji_mart: "^5.2.2", GITHUB_WORKSPACE: "/home/runner/work/web-sdks/web-sdks", ACCEPT_EULA: "Y", GITHUB_JOB: "publish_packages", RUNNER_PERFLOG: "/home/runner/perflog", npm_package_size_limit_6_limit: "150 KB", npm_package_size_limit_3_path: "packages/roomkit-react/dist/index.js", npm_package_devDependencies_cypress: "^9.5.2", GITHUB_SHA: "3caf5ae1abb71e5e7dede48bc4b9b8dfa5a25a8a", GITHUB_RUN_ATTEMPT: "1", npm_package_size_limit_7_limit: "100 KB", npm_package_size_limit_4_path: "packages/hms-virtual-background/dist/index.cjs.js", npm_config_version_git_tag: "true", npm_config_version_git_sign: "", npm_package_dependencies_qrcode_react: "^3.1.0", GITHUB_REF: "refs/heads/publish-alpha", GITHUB_ACTOR: "github-actions[bot]", ANDROID_SDK_ROOT: "/usr/local/lib/android/sdk", npm_package_license: "MIT", npm_package_size_limit_5_path: "packages/hms-virtual-background/dist/index.js", npm_config_strict_ssl: "true", LEIN_HOME: "/usr/local/lib/lein", npm_package_size_limit_6_path: "packages/react-icons/dist/index.cjs.js", npm_package_scripts_format: "prettier -w src/**", npm_package_devDependencies_eslint_plugin_prettier: "^4.0.0", npm_package_devDependencies_eslint_config_react_app: "^7.0.0", NX_TASK_TARGET_PROJECT: "@100mslive/roomkit-react", GITHUB_PATH: "/home/runner/work/_temp/_runner_file_commands/add_path_64e68346-fe70-4da2-95d3-209214f9bdaf", JAVA_HOME: "/usr/lib/jvm/temurin-11-jdk-amd64", PWD: "/home/runner/work/web-sdks/web-sdks/packages/roomkit-react", GITHUB_ACTOR_ID: "41898282", RUNNER_WORKSPACE: "/home/runner/work/web-sdks", npm_execpath: "/usr/local/lib/node_modules/yarn/bin/yarn.js", npm_package_size_limit_7_path: "packages/react-icons/dist/index.js", npm_package_scripts_ybys: "yarn && yarn build --no-private && yarn storybook", npm_package_dependencies__radix_ui_react_progress: "1.0.0", HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: "3650", STATS_TIS: "mining", GITHUB_EVENT_NAME: "workflow_dispatch", HOMEBREW_NO_AUTO_UPDATE: "1", ANDROID_HOME: "/usr/local/lib/android/sdk", GITHUB_SERVER_URL: "https://github.com", GECKOWEBDRIVER: "/usr/local/share/gecko_driver", LEIN_JAR: "/usr/local/lib/lein/self-installs/leiningen-2.11.2-standalone.jar", GHCUP_INSTALL_BASE_PREFIX: "/usr/local", GITHUB_OUTPUT: "/home/runner/work/_temp/_runner_file_commands/set_output_64e68346-fe70-4da2-95d3-209214f9bdaf", npm_package_scripts_prestart: "rm -rf dist && yarn types:build", npm_package_author_name: "100ms", EDGEWEBDRIVER: "/usr/local/share/edge_driver", STATS_EXT: "true", npm_package_scripts_build_storybook: "sb build", npm_package_devDependencies_postcss: "^8.4.5", npm_package_devDependencies_esbuild: "^0.18.13", npm_config_save_prefix: "^", npm_config_ignore_optional: "", npm_package_dependencies_worker_timers: "^7.0.40", npm_package_typings: "dist/index.d.ts", ANDROID_NDK: "/usr/local/lib/android/sdk/ndk/25.2.9519653", SGX_AESM_ADDR: "1", CHROME_BIN: "/usr/bin/google-chrome", npm_package_scripts_storybook: "sb dev -p 6006", npm_package_devDependencies_esbuild_plugin_postcss2: "0.1.1", npm_package_dependencies_react_swipeable: "^7.0.1", npm_package_devDependencies_babel_plugin_react_require: "3.1.3", npm_package_devDependencies__storybook_testing_library: "^0.2.0", npm_package_devDependencies__storybook_addon_essentials: "^7.0.27", SELENIUM_JAR_PATH: "/usr/share/java/selenium-server.jar", STATS_EXTP: "https://provjobdsettingscdn.blob.core.windows.net/settings/provjobdsettings-0.5.181+6/provjobd.data", npm_package_scripts_reactsdk: "cd packages/react-sdk && yarn start", npm_package_dependencies_react_use: "^17.4.0", npm_package_dependencies__radix_ui_react_collapsible: "1.0.0", npm_package_devDependencies_storybook_dark_mode: "^3.0.0", npm_package_devDependencies__storybook_react: "^7.0.27", INIT_CWD: "/home/runner/work/web-sdks/web-sdks", ANDROID_NDK_HOME: "/usr/local/lib/android/sdk/ndk/25.2.9519653", GITHUB_STEP_SUMMARY: "/home/runner/work/_temp/_runner_file_commands/step_summary_64e68346-fe70-4da2-95d3-209214f9bdaf" };
113
113
  }
114
114
  });
115
115
 
@@ -16876,11 +16876,11 @@ function shimOnTrack(window2) {
16876
16876
  get() {
16877
16877
  return this._ontrack;
16878
16878
  },
16879
- set(f3) {
16879
+ set(f2) {
16880
16880
  if (this._ontrack) {
16881
16881
  this.removeEventListener("track", this._ontrack);
16882
16882
  }
16883
- this.addEventListener("track", this._ontrack = f3);
16883
+ this.addEventListener("track", this._ontrack = f2);
16884
16884
  },
16885
16885
  enumerable: true,
16886
16886
  configurable: true
@@ -17888,12 +17888,12 @@ function shimRemoteStreamsAPI(window2) {
17888
17888
  get() {
17889
17889
  return this._onaddstream;
17890
17890
  },
17891
- set(f3) {
17891
+ set(f2) {
17892
17892
  if (this._onaddstream) {
17893
17893
  this.removeEventListener("addstream", this._onaddstream);
17894
17894
  this.removeEventListener("track", this._onaddstreampoly);
17895
17895
  }
17896
- this.addEventListener("addstream", this._onaddstream = f3);
17896
+ this.addEventListener("addstream", this._onaddstream = f2);
17897
17897
  this.addEventListener("track", this._onaddstreampoly = (e) => {
17898
17898
  e.streams.forEach((stream) => {
17899
17899
  if (!this._remoteStreams) {
@@ -19343,14 +19343,14 @@ function M(n2, r2, t2) {
19343
19343
  }
19344
19344
  return e.o;
19345
19345
  }
19346
- function A(e, i2, o2, a11, c3, s2, v2) {
19346
+ function A(e, i2, o2, a11, c3, s2, v3) {
19347
19347
  if ("production" !== define_process_env_default.NODE_ENV && c3 === o2 && n(5), r(c3)) {
19348
19348
  var p2 = M(e, c3, s2 && i2 && 3 !== i2.i && !u(i2.R, a11) ? s2.concat(a11) : void 0);
19349
19349
  if (f(o2, a11, p2), !r(p2))
19350
19350
  return;
19351
19351
  e.m = false;
19352
19352
  } else
19353
- v2 && o2.add(c3);
19353
+ v3 && o2.add(c3);
19354
19354
  if (t(c3) && !y(c3)) {
19355
19355
  if (!e.h.D && e._ < 1)
19356
19356
  return;
@@ -19383,8 +19383,8 @@ function N(n2, r2, t2) {
19383
19383
  var e = s(r2) ? b("MapSet").F(r2, t2) : v(r2) ? b("MapSet").T(r2, t2) : n2.O ? function(n3, r3) {
19384
19384
  var t3 = Array.isArray(n3), e2 = { i: t3 ? 1 : 0, A: r3 ? r3.A : _(), P: false, I: false, R: {}, l: r3, t: n3, k: null, o: null, j: null, C: false }, i2 = e2, o2 = en;
19385
19385
  t3 && (i2 = [e2], o2 = on);
19386
- var u2 = Proxy.revocable(i2, o2), a11 = u2.revoke, f3 = u2.proxy;
19387
- return e2.k = f3, e2.j = a11, f3;
19386
+ var u2 = Proxy.revocable(i2, o2), a11 = u2.revoke, f2 = u2.proxy;
19387
+ return e2.k = f2, e2.j = a11, f2;
19388
19388
  }(r2, t2) : b("ES5").J(r2, t2);
19389
19389
  return (t2 ? t2.A : _()).p.push(e), e;
19390
19390
  }
@@ -19519,26 +19519,26 @@ var init_immer_esm = __esm({
19519
19519
  });
19520
19520
  };
19521
19521
  }
19522
- var f3;
19522
+ var f2;
19523
19523
  if ("function" != typeof i3 && n(6), void 0 !== o2 && "function" != typeof o2 && n(7), t(r3)) {
19524
- var c3 = w(e2), s2 = N(e2, r3, void 0), v2 = true;
19524
+ var c3 = w(e2), s2 = N(e2, r3, void 0), v3 = true;
19525
19525
  try {
19526
- f3 = i3(s2), v2 = false;
19526
+ f2 = i3(s2), v3 = false;
19527
19527
  } finally {
19528
- v2 ? g(c3) : O(c3);
19528
+ v3 ? g(c3) : O(c3);
19529
19529
  }
19530
- return "undefined" != typeof Promise && f3 instanceof Promise ? f3.then(function(n2) {
19530
+ return "undefined" != typeof Promise && f2 instanceof Promise ? f2.then(function(n2) {
19531
19531
  return j(c3, o2), P3(n2, c3);
19532
19532
  }, function(n2) {
19533
19533
  throw g(c3), n2;
19534
- }) : (j(c3, o2), P3(f3, c3));
19534
+ }) : (j(c3, o2), P3(f2, c3));
19535
19535
  }
19536
19536
  if (!r3 || "object" != typeof r3) {
19537
- if (void 0 === (f3 = i3(r3)) && (f3 = r3), f3 === H && (f3 = void 0), e2.D && d(f3, true), o2) {
19537
+ if (void 0 === (f2 = i3(r3)) && (f2 = r3), f2 === H && (f2 = void 0), e2.D && d(f2, true), o2) {
19538
19538
  var p2 = [], l2 = [];
19539
- b("Patches").M(r3, f3, p2, l2), o2(p2, l2);
19539
+ b("Patches").M(r3, f2, p2, l2), o2(p2, l2);
19540
19540
  }
19541
- return f3;
19541
+ return f2;
19542
19542
  }
19543
19543
  n(21, r3);
19544
19544
  }, this.produceWithPatches = function(n2, r3) {
@@ -20144,8 +20144,8 @@ var require_grammar = __commonJS({
20144
20144
  var require_parser = __commonJS({
20145
20145
  "../../node_modules/sdp-transform/lib/parser.js"(exports) {
20146
20146
  init_define_process_env();
20147
- var toIntIfInt = function(v2) {
20148
- return String(Number(v2)) === v2 ? Number(v2) : v2;
20147
+ var toIntIfInt = function(v3) {
20148
+ return String(Number(v3)) === v3 ? Number(v3) : v3;
20149
20149
  };
20150
20150
  var attachProperties = function(match18, location, names, rawName) {
20151
20151
  if (rawName && !names) {
@@ -20378,35 +20378,35 @@ function xe(a11, e) {
20378
20378
  if (e)
20379
20379
  for (let r2 of e.auxiliaryTracks) {
20380
20380
  let s2 = a11[r2];
20381
- Za(s2) && (i2 = pt(s2) ? s2 : i2, t2 = ht(s2) ? s2 : t2);
20381
+ Za(s2) && (i2 = ut(s2) ? s2 : i2, t2 = pt(s2) ? s2 : t2);
20382
20382
  }
20383
20383
  return { video: t2, audio: i2 };
20384
20384
  }
20385
- function pt(a11) {
20385
+ function ut(a11) {
20386
20386
  return a11 && a11.type === "audio";
20387
20387
  }
20388
- function ht(a11) {
20388
+ function pt(a11) {
20389
20389
  return a11 && a11.type === "video";
20390
20390
  }
20391
20391
  function Za(a11) {
20392
20392
  return a11 && a11.source === "screen";
20393
20393
  }
20394
- function ri(a11) {
20394
+ function ii(a11) {
20395
20395
  return a11 && a11.source === "audioplaylist";
20396
20396
  }
20397
- function mt(a11) {
20397
+ function ht(a11) {
20398
20398
  return a11 && a11.source === "videoplaylist";
20399
20399
  }
20400
20400
  function os(a11) {
20401
20401
  return a11 ? !!(a11 != null && a11.degraded) : false;
20402
20402
  }
20403
- function qe(a11, e) {
20403
+ function je(a11, e) {
20404
20404
  return e && a11.tracks[e] ? a11.tracks[e].enabled : false;
20405
20405
  }
20406
20406
  function ns(a11, e) {
20407
20407
  return e && a11.tracks[e] ? a11.tracks[e].displayEnabled : false;
20408
20408
  }
20409
- function St(a11) {
20409
+ function mt(a11) {
20410
20410
  var r2;
20411
20411
  let e = false, t2 = false, i2 = false;
20412
20412
  return (r2 = a11 == null ? void 0 : a11.publishParams) != null && r2.allowed && (e = a11.publishParams.allowed.includes("video"), t2 = a11.publishParams.allowed.includes("audio"), i2 = a11.publishParams.allowed.includes("screen")), { video: e, audio: t2, screen: i2 };
@@ -20435,12 +20435,12 @@ function fr(a11) {
20435
20435
  function oe(a11) {
20436
20436
  return a11 != null;
20437
20437
  }
20438
- function ft(a11 = "prod", e) {
20439
- let t2 = "web", i2 = Je !== "LOCAL" && a11 === "prod" ? "prod" : "debug";
20438
+ function Tt(a11 = "prod", e) {
20439
+ let t2 = "web", i2 = Qe !== "LOCAL" && a11 === "prod" ? "prod" : "debug";
20440
20440
  if (Ue)
20441
- return vs({ os: "web_nodejs", os_version: process.version, sdk: t2, sdk_version: fs, env: i2, domain: Je, is_prebuilt: !!(e != null && e.isPrebuilt), framework: "node", framework_version: process.version, framework_sdk_version: e == null ? void 0 : e.sdkVersion });
20441
+ return vs({ os: "web_nodejs", os_version: process.version, sdk: t2, sdk_version: fs, env: i2, domain: Qe, is_prebuilt: !!(e != null && e.isPrebuilt), framework: "node", framework_version: process.version, framework_sdk_version: e == null ? void 0 : e.sdkVersion });
20442
20442
  let r2 = ge.getOS(), s2 = ge.getDevice(), o2 = ge.getBrowser(), n2 = yr(`web_${r2.name}`), l2 = r2.version || "", u2 = yr(`${o2.name}_${o2.version}`), p2 = u2;
20443
- return s2.type && (p2 = `${yr(`${s2.vendor}_${s2.type}`)}/${u2}`), vs({ os: n2, os_version: l2, sdk: t2, sdk_version: fs, device_model: p2, env: i2, domain: Je, is_prebuilt: !!(e != null && e.isPrebuilt), framework: e == null ? void 0 : e.type, framework_version: e == null ? void 0 : e.version, framework_sdk_version: e == null ? void 0 : e.sdkVersion });
20443
+ return s2.type && (p2 = `${yr(`${s2.vendor}_${s2.type}`)}/${u2}`), vs({ os: n2, os_version: l2, sdk: t2, sdk_version: fs, device_model: p2, env: i2, domain: Qe, is_prebuilt: !!(e != null && e.isPrebuilt), framework: e == null ? void 0 : e.type, framework_version: e == null ? void 0 : e.version, framework_sdk_version: e == null ? void 0 : e.sdkVersion });
20444
20444
  }
20445
20445
  function yr(a11) {
20446
20446
  return a11.replace(/ /g, "_");
@@ -20471,7 +20471,7 @@ function po(a11, e = "") {
20471
20471
  return uo(a11.message, e);
20472
20472
  }
20473
20473
  }
20474
- function Qe(a11, e) {
20474
+ function Ae(a11, e) {
20475
20475
  let t2 = po(a11, e);
20476
20476
  return t2.addNativeError(a11), t2;
20477
20477
  }
@@ -20480,7 +20480,7 @@ function ys(a11) {
20480
20480
  try {
20481
20481
  return (yield navigator.mediaDevices.getUserMedia({ audio: a11 ? a11.toConstraints() : false })).getAudioTracks()[0];
20482
20482
  } catch (e) {
20483
- throw Qe(e, "audio");
20483
+ throw Ae(e, "audio");
20484
20484
  }
20485
20485
  });
20486
20486
  }
@@ -20489,25 +20489,25 @@ function ks(a11) {
20489
20489
  try {
20490
20490
  return (yield navigator.mediaDevices.getUserMedia({ video: a11 ? a11.toConstraints() : false })).getVideoTracks()[0];
20491
20491
  } catch (e) {
20492
- throw Qe(e, "video");
20492
+ throw Ae(e, "video");
20493
20493
  }
20494
20494
  });
20495
20495
  }
20496
20496
  function ue(a11) {
20497
20497
  return "canvas" in a11 || a11.label === "MediaStreamAudioDestinationNode" || a11.label === "";
20498
20498
  }
20499
- function K(a11) {
20499
+ function Z2(a11) {
20500
20500
  if (a11 < 0)
20501
20501
  throw Error("`ms` should be a positive integer");
20502
20502
  return new Promise((e) => {
20503
20503
  setTimeout(e, a11);
20504
20504
  });
20505
20505
  }
20506
- function Ce(a11) {
20506
+ function Le(a11) {
20507
20507
  if (a11 < 0)
20508
20508
  throw Error("`ms` should be a positive integer");
20509
20509
  if (typeof Worker == "undefined")
20510
- return K(a11);
20510
+ return Z2(a11);
20511
20511
  let e = new Worker(URL.createObjectURL(new Blob([Ps], { type: "application/javascript" })));
20512
20512
  return e.postMessage(["start", a11]), new Promise((t2) => {
20513
20513
  e.onmessage = (i2) => {
@@ -20517,7 +20517,7 @@ function Ce(a11) {
20517
20517
  }
20518
20518
  function Es() {
20519
20519
  if (typeof Worker == "undefined")
20520
- return { sleep: (e) => K(e) };
20520
+ return { sleep: (e) => Z2(e) };
20521
20521
  let a11 = new Worker(URL.createObjectURL(new Blob([Ps], { type: "application/javascript" })));
20522
20522
  return { sleep: (e) => (a11.postMessage(["start", e]), new Promise((t2) => {
20523
20523
  a11.onmessage = (i2) => {
@@ -20525,7 +20525,7 @@ function Es() {
20525
20525
  };
20526
20526
  })) };
20527
20527
  }
20528
- function oi(a11, e = 300) {
20528
+ function ai(a11, e = 300) {
20529
20529
  let t2;
20530
20530
  return function(...i2) {
20531
20531
  clearTimeout(t2), t2 = void 0;
@@ -20545,7 +20545,7 @@ function xs(a11, e) {
20545
20545
  return !(0, import_lodash4.default)(a11[i2], e[i2]);
20546
20546
  };
20547
20547
  }
20548
- function I2(a11) {
20548
+ function A2(a11) {
20549
20549
  return (e) => (t2) => a11(t2, e);
20550
20550
  }
20551
20551
  function xm(a11) {
@@ -20557,23 +20557,9 @@ function xm(a11) {
20557
20557
  function Pa(a11) {
20558
20558
  return a11 instanceof se || a11 instanceof U2;
20559
20559
  }
20560
- function nt(a11) {
20561
- if (!a11 || a11.length === 0)
20562
- throw S2.APIErrors.InvalidTokenFormat("INIT", "Token cannot be an empty string or undefined or null");
20563
- let e = a11.split(".");
20564
- if (e.length !== 3)
20565
- throw S2.APIErrors.InvalidTokenFormat("INIT", "Expected 3 '.' separate fields - header, payload and signature respectively");
20566
- let t2 = atob(e[1]);
20567
- try {
20568
- let i2 = JSON.parse(t2);
20569
- return { roomId: i2.room_id, userId: i2.user_id, role: i2.role };
20570
- } catch (i2) {
20571
- throw S2.APIErrors.InvalidTokenFormat("INIT", `couldn't parse to json - ${i2.message}`);
20572
- }
20573
- }
20574
20560
  function Na(a11, e) {
20575
20561
  var r2;
20576
- let t2 = Kt.parse(a11.sdp);
20562
+ let t2 = $t.parse(a11.sdp);
20577
20563
  if (!((r2 = t2.origin) != null && r2.username.startsWith("mozilla")))
20578
20564
  return a11;
20579
20565
  let i2 = e ? Array.from(e.values()) : [];
@@ -20581,13 +20567,13 @@ function Na(a11, e) {
20581
20567
  var l2, u2, p2;
20582
20568
  let o2 = (l2 = s2.msid) == null ? void 0 : l2.split(" ")[0], n2 = (u2 = i2.find((h2) => h2.type === s2.type && h2.stream_id === o2)) == null ? void 0 : u2.track_id;
20583
20569
  n2 && (s2.msid = (p2 = s2.msid) == null ? void 0 : p2.replace(/\s(.+)/, ` ${n2}`));
20584
- }), { type: a11.type, sdp: Kt.write(t2) };
20570
+ }), { type: a11.type, sdp: $t.write(t2) };
20585
20571
  }
20586
20572
  function Oa(a11, e) {
20587
20573
  var s2;
20588
20574
  if (!(a11 != null && a11.sdp) || !e)
20589
20575
  return;
20590
- let i2 = Kt.parse(a11.sdp).media.find((o2) => oe(o2.mid) && parseInt(o2.mid) === parseInt(e));
20576
+ let i2 = $t.parse(a11.sdp).media.find((o2) => oe(o2.mid) && parseInt(o2.mid) === parseInt(e));
20591
20577
  return (s2 = i2 == null ? void 0 : i2.msid) == null ? void 0 : s2.split(" ")[1];
20592
20578
  }
20593
20579
  function xa(a11) {
@@ -20599,14 +20585,28 @@ function ln2(a11, e, t2, i2) {
20599
20585
  return i2 && i2.trim().length > 0 && r2.searchParams.set("region", i2.trim()), r2.searchParams.set("peer_id", e), r2.searchParams.set("user_agent_v2", t2), r2.toString();
20600
20586
  } catch (r2) {
20601
20587
  let s2 = r2;
20602
- throw d2.e(pr, s2.name, s2.message), s2;
20588
+ throw d2.e(ur, s2.name, s2.message), s2;
20603
20589
  }
20604
20590
  }
20605
20591
  function un2(a11, e) {
20606
20592
  var t2;
20607
20593
  return M2(m({}, a11), { rtcConfiguration: M2(m({}, a11.rtcConfiguration), { iceServers: Ua((t2 = a11.rtcConfiguration) == null ? void 0 : t2.ice_servers, e) }) });
20608
20594
  }
20609
- var import_ua_parser_js, import_lodash3, import_uuid3, import_uuid4, import_lodash4, import_uuid5, import_uuid6, import_uuid7, import_eventemitter2, import_eventemitter22, import_uuid8, import_eventemitter23, Kt, import_eventemitter24, import_uuid9, import_uuid10, qa, ja, Ja, ei, Qa, is, rs, za, ts, m, M2, mr, Ya, Q2, c2, Mr, Sr, ti, ii, Xa, ss, gr, as, cs, eo, d2, je, ge, O2, ds, Ue, io, tc, Te, ps, Tr, ls, us, hs, si, Re, Ae, ms, Je, P4, f2, so, S2, vr, Ss, le, gs, Ts, gt, Tt, fs, vs, H2, y2, kr, z2, Pr, Er, ne, ai, co, lo, vt, Ie, He, Ps, mo, So, ni, br, bs, Rs, As, Is, Hs, Be, Cs, ee, Ve, Y2, Fe, Le, ze, ce, se, Ye, Mt, To, ws, Rr, _s, Ar, Ns, Xe, Ir, Hr, yt, Ze, Os, vo, Mo, kt, ci, yo, di, Cr, pe, li, ve, F, et, ui, tt, Us, Bs, Pt, G2, Vs, Fs, Me, Dr, wr, Gs, Ws, U2, _r, Ge, fe, $s, Ks, Eo, Or, bo, qs, js, Et, Nr, xr, pi, hi, it, rt, We, bt, he, mi, st, De, Si, gi, Ti, Rt, B2, Io, Wh, $h, q2, fi, Js, N2, Qs, Ur, Ho, we, jh, Co, me, Lo, te, ye, Jh, Qh, ae, X2, Do, zs, zh, Yh, Br, Ys, Vr, wo, Zh, em, tm, im, rm, sm, am, om, At, _o, nm, ie, Xs, cm, dm, Se, lm, at, No, Zs, um, ea, pm, hm, mm, Sm, gm, Tm, fm, vm, Mm, ta, Em, Oo, bm, ra, Fr, sa, aa, oa, na, ca, da, la, ua, It, b2, Gr, Ht, pa, xo, Uo, j2, Wr, Bo, Vo, Fo, Go, Wo, Z2, Om, Bm, Vm, vi, ha, Fm, Gm, Wm, $o, Ko, Km, ma, qm, qo, jm, Jm, Qm, zm, Ym, Xm, Sa, ga, eS, tS, Ta, iS, rS, fa, sS, aS, oS, va, Ma, jo, Jo, Qo, nS, cS, dS, lS, uS, ya, PS, zo, ES, bS, RS, Xo, Zo, yi, Ct, ki, ka, $r, Pi, Ei, Ea, ba, Ra, Kr, Aa, qr, $e, jr, bi, re, Lt, _2, Dt, Ri, Ai, Ia, Ha, ot, Ca, Ii, tn2, de, _e, Hi, rn2, La, Da, Ci, Ne, Li, wt, Di, wi, _i, _t, Jr, Pe, Nt, Ot, Ni, Oi, wa, xt, xi, Ut, Ui, V, Bt, Bi, Vi, Fi, ct, Gi, Wi, C, $i, Ki, Vt, qi, Ft, ji, Ji, Qi, zi, Yi, Xi, Zi, er, tr, J, _a7, ir, rr, sr, ar, or, nr, dt, lt, cr, dr, Gt, Wt, zr, $t, Xr, ur, Ee, Ke, qt, jt, Jt, Ua, pr, Qt, zt, Ba, A2, Yt, Fa, hr, ut, Wa, Ga, vn2, Mn, yn, Xt, kn, Pn, En, bn, $a, Rn, Ka, Zr, be, An, In, Hn, Cn, Ln, Dn, wn, _n, Nn, On, es, xn, Un, Bn, Vn, Fn, Gn;
20595
+ function pr(a11) {
20596
+ if (!a11 || a11.length === 0)
20597
+ throw S2.APIErrors.InvalidTokenFormat("INIT", "Token cannot be an empty string or undefined or null");
20598
+ let e = a11.split(".");
20599
+ if (e.length !== 3)
20600
+ throw S2.APIErrors.InvalidTokenFormat("INIT", "Expected 3 '.' separate fields - header, payload and signature respectively");
20601
+ let t2 = atob(e[1]);
20602
+ try {
20603
+ let i2 = JSON.parse(t2);
20604
+ return { roomId: i2.room_id, userId: i2.user_id, role: i2.role };
20605
+ } catch (i2) {
20606
+ throw S2.APIErrors.InvalidTokenFormat("INIT", `couldn't parse to json - ${i2.message}`);
20607
+ }
20608
+ }
20609
+ var import_ua_parser_js, import_lodash3, import_uuid3, import_uuid4, import_lodash4, import_uuid5, import_uuid6, import_uuid7, import_eventemitter2, import_eventemitter22, import_uuid8, import_eventemitter23, $t, import_eventemitter24, import_uuid9, import_uuid10, qa, ja, Ja, Zt, Qa, is, rs, za, ts, m, M2, mr, Ya, J, c2, Mr, Sr, ei, ti, Xa, ss, gr, as, cs, eo, d2, Je, ge, O2, ds, Ue, io, tc, Te, ps, Tr, ls, us, hs, ri, Re, Ie, ms, Qe, E2, v2, so, S2, vr, Ss, le, gs, Ts, St, gt, fs, vs, H2, y2, kr, Q2, Pr, Er, ne, si, co, lo, ft, He, Ce, Ps, mo, So, oi, br, bs, Rs, Is, As, Hs, Be, Cs, ee, Ve, z2, Fe, De, ze, ce, se, Ye, vt, To, ws, Rr, _s, Ir, Ns, Xe, Ar, Hr, Mt, Ze, Os, vo, Mo, yt, ni, yo, ci, Cr, pe, di, ve, F, et, li, tt, Us, Bs, kt, G2, Vs, Fs, Me, Dr, wr, Gs, Ws, U2, _r, Ge, fe, $s, Ks, Eo, Or, bo, qs, js, Pt, Nr, xr, ui, pi, it, rt, We, Et, he, hi, st, we, mi, Si, gi, bt, B2, Ao, Wh, $h, K, Ti, Js, N2, Qs, Ur, Ho, _e, jh, Co, me, Lo, te, ye, Jh, Qh, ae, Y2, Do, zs, zh, Yh, Br, Ys, Vr, wo, Zh, em, tm, im, rm, sm, am, om, Rt, _o, nm, ie, Xs, cm, dm, Se, lm, at, No, Zs, um, ea, pm, hm, mm, Sm, gm, Tm, fm, vm, Mm, ta, Em, Oo, bm, ra, Fr, sa, aa, oa, na, ca, da, la, ua, It, b2, Gr, At, pa, xo, Uo, q2, Wr, Bo, Vo, Fo, Go, Wo, X2, Om, Bm, Vm, fi, ha, Fm, Gm, Wm, $o, Ko, Km, ma, qm, qo, jm, Jm, Qm, zm, Ym, Xm, Sa, ga, eS, tS, Ta, iS, rS, fa, sS, aS, oS, va, Ma, jo, Jo, Qo, nS, cS, dS, lS, uS, ya, PS, zo, ES, bS, RS, Xo, Zo, Mi, Ht, yi, ka, $r, ki, Pi, Ea, ba, Ra, Kr, Ia, qr, $e, jr, Ei, re, Ct, _2, Lt, bi, Ri, Aa, Ha, ot, Ca, Ii, tn2, de, Ne, Ai, rn2, La, Da, Hi, Ke, Ci, Dt, Li, Di, wi, wt, Jr, Pe, _t, Nt, _i, Ni, wa, Ot, Oi, xt, xi, V, Ut, Ui, Bi, Vi, nt, Fi, Gi, C, Wi, $i, Bt, Ki, Vt, qi, ji, Ji, Qi, zi, Yi, Xi, Zi, er, j2, _a7, tr, ir, rr, sr, ar, or, ct, dt, nr, cr, Ft, Gt, zr, Wt, Xr, lr, Ee, qe, Kt, qt, jt, Ua, ur, Jt, Qt, Ba, I2, zt, Fa, hr, lt, Wa, Ga, vn2, Mn, yn, Yt, kn, Pn, En, bn, $a, Rn, Ka, Zr, be, In, An, Hn, Cn, Ln, Dn, wn, _n, Nn, On, es, xn, Un, Bn, Vn, Fn, Gn;
20610
20610
  var init_dist = __esm({
20611
20611
  "../hms-video-store/dist/index.js"() {
20612
20612
  "use strict";
@@ -20632,7 +20632,7 @@ var init_dist = __esm({
20632
20632
  import_eventemitter22 = require("eventemitter2");
20633
20633
  import_uuid8 = require("uuid");
20634
20634
  import_eventemitter23 = require("eventemitter2");
20635
- Kt = __toESM(require_lib());
20635
+ $t = __toESM(require_lib());
20636
20636
  import_eventemitter24 = __toESM(require("eventemitter2"));
20637
20637
  import_uuid9 = require("uuid");
20638
20638
  import_uuid10 = require("uuid");
@@ -20640,7 +20640,7 @@ var init_dist = __esm({
20640
20640
  qa = Object.defineProperty;
20641
20641
  ja = Object.defineProperties;
20642
20642
  Ja = Object.getOwnPropertyDescriptors;
20643
- ei = Object.getOwnPropertySymbols;
20643
+ Zt = Object.getOwnPropertySymbols;
20644
20644
  Qa = Object.getPrototypeOf;
20645
20645
  is = Object.prototype.hasOwnProperty;
20646
20646
  rs = Object.prototype.propertyIsEnumerable;
@@ -20649,8 +20649,8 @@ var init_dist = __esm({
20649
20649
  m = (a11, e) => {
20650
20650
  for (var t2 in e || (e = {}))
20651
20651
  is.call(e, t2) && ts(a11, t2, e[t2]);
20652
- if (ei)
20653
- for (var t2 of ei(e))
20652
+ if (Zt)
20653
+ for (var t2 of Zt(e))
20654
20654
  rs.call(e, t2) && ts(a11, t2, e[t2]);
20655
20655
  return a11;
20656
20656
  };
@@ -20659,13 +20659,13 @@ var init_dist = __esm({
20659
20659
  var t2 = {};
20660
20660
  for (var i2 in a11)
20661
20661
  is.call(a11, i2) && e.indexOf(i2) < 0 && (t2[i2] = a11[i2]);
20662
- if (a11 != null && ei)
20663
- for (var i2 of ei(a11))
20662
+ if (a11 != null && Zt)
20663
+ for (var i2 of Zt(a11))
20664
20664
  e.indexOf(i2) < 0 && rs.call(a11, i2) && (t2[i2] = a11[i2]);
20665
20665
  return t2;
20666
20666
  };
20667
20667
  Ya = (a11, e) => () => (e || a11((e = { exports: {} }).exports, e), e.exports);
20668
- Q2 = (a11, e, t2) => za(Qa(a11), t2, e);
20668
+ J = (a11, e, t2) => za(Qa(a11), t2, e);
20669
20669
  c2 = (a11, e, t2) => new Promise((i2, r2) => {
20670
20670
  var s2 = (l2) => {
20671
20671
  try {
@@ -20683,11 +20683,11 @@ var init_dist = __esm({
20683
20683
  n2((t2 = t2.apply(a11, e)).next());
20684
20684
  });
20685
20685
  Mr = Ya((Vc, oo) => {
20686
- oo.exports = { version: "0.12.14-alpha.7", license: "MIT", repository: { type: "git", url: "https://github.com/100mslive/web-sdks.git", directory: "packages/hms-video-store" }, main: "dist/index.cjs.js", module: "dist/index.js", typings: "dist/index.d.ts", files: ["dist", "src"], engines: { node: ">=12" }, exports: { ".": { require: "./dist/index.cjs.js", import: "./dist/index.js", default: "./dist/index.js" } }, sideEffects: false, scripts: { prestart: "rm -rf dist && yarn types:build", start: 'concurrently "yarn dev" "yarn types"', dev: "node ../../scripts/dev", "build:only": "node ../../scripts/build", build: "yarn build:only && yarn types:build", types: "tsc -w", "types:build": "tsc -p tsconfig.json", format: "prettier --write src/**/*.ts", test: "jest --maxWorkers=1", "test:watch": "jest --watch", "test:coverage": "jest --coverage", lint: "eslint -c ../../.eslintrc .", "lint:fix": "yarn lint --fix", prepare: "yarn build", size: "size-limit", analyze: "size-limit --why", docs: "rm -rf ./docs && typedoc && rm -f ./docs/README.md && mkdir ./docs/home &&mv ./docs/modules.md ./docs/home/content.md && node ../../scripts/docs-store && npx prettier --write './docs/**/*'" }, name: "@100mslive/hms-video-store", author: "100ms", dependencies: { eventemitter2: "^6.4.9", immer: "^9.0.6", "lodash.isequal": "^4.5.0", reselect: "4.0.0", "sdp-transform": "^2.14.1", "ua-parser-js": "^1.0.1", uuid: "^8.3.2", "webrtc-adapter": "^8.0.0", zustand: "3.5.7" }, devDependencies: { "@types/dom-screen-wake-lock": "^1.0.1", "@types/lodash.isequal": "^4.5.8", "@types/sdp-transform": "^2.4.4", "@types/ua-parser-js": "^0.7.36", "@types/uuid": "^8.3.0", "jest-canvas-mock": "^2.3.1", "jsdom-worker": "^0.3.0", tslib: "^2.2.0" }, description: "@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow", keywords: ["video", "webrtc", "conferencing", "100ms"] };
20686
+ oo.exports = { version: "0.12.14-alpha.9", license: "MIT", repository: { type: "git", url: "https://github.com/100mslive/web-sdks.git", directory: "packages/hms-video-store" }, main: "dist/index.cjs.js", module: "dist/index.js", typings: "dist/index.d.ts", files: ["dist", "src"], engines: { node: ">=12" }, exports: { ".": { require: "./dist/index.cjs.js", import: "./dist/index.js", default: "./dist/index.js" } }, sideEffects: false, scripts: { prestart: "rm -rf dist && yarn types:build", start: 'concurrently "yarn dev" "yarn types"', dev: "node ../../scripts/dev", "build:only": "node ../../scripts/build", build: "yarn build:only && yarn types:build", types: "tsc -w", "types:build": "tsc -p tsconfig.json", format: "prettier --write src/**/*.ts", test: "jest --maxWorkers=1", "test:watch": "jest --watch", "test:coverage": "jest --coverage", lint: "eslint -c ../../.eslintrc .", "lint:fix": "yarn lint --fix", prepare: "yarn build", size: "size-limit", analyze: "size-limit --why", docs: "rm -rf ./docs && typedoc && rm -f ./docs/README.md && mkdir ./docs/home &&mv ./docs/modules.md ./docs/home/content.md && node ../../scripts/docs-store && npx prettier --write './docs/**/*'" }, name: "@100mslive/hms-video-store", author: "100ms", dependencies: { eventemitter2: "^6.4.9", immer: "^9.0.6", "lodash.isequal": "^4.5.0", reselect: "4.0.0", "sdp-transform": "^2.14.1", "ua-parser-js": "^1.0.1", uuid: "^8.3.2", "webrtc-adapter": "^8.0.0", zustand: "3.5.7" }, devDependencies: { "@types/dom-screen-wake-lock": "^1.0.1", "@types/lodash.isequal": "^4.5.8", "@types/sdp-transform": "^2.4.4", "@types/ua-parser-js": "^0.7.36", "@types/uuid": "^8.3.0", "jest-canvas-mock": "^2.3.1", "jsdom-worker": "^0.3.0", tslib: "^2.2.0" }, description: "@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow", keywords: ["video", "webrtc", "conferencing", "100ms"] };
20687
20687
  });
20688
20688
  Sr = ((n2) => (n2.Disconnected = "Disconnected", n2.Preview = "Preview", n2.Connecting = "Connecting", n2.Connected = "Connected", n2.Reconnecting = "Reconnecting", n2.Disconnecting = "Disconnecting", n2.Failed = "Failed", n2))(Sr || {});
20689
- ti = () => ({ room: { id: "", isConnected: false, name: "", peers: [], localPeer: "", roomState: "Disconnected", recording: { browser: { running: false }, server: { running: false }, hls: { running: false } }, rtmp: { running: false }, hls: { running: false, variants: [] }, sessionId: "" }, peers: {}, tracks: {}, playlist: { audio: { list: {}, selection: { id: "", hasPrevious: false, hasNext: false }, progress: 0, volume: 0, currentTime: 0, playbackRate: 1 }, video: { list: {}, selection: { id: "", hasPrevious: false, hasNext: false }, progress: 0, volume: 0, currentTime: 0, playbackRate: 1 } }, messages: { byID: {}, allIDs: [] }, speakers: {}, connectionQualities: {}, settings: { audioInputDeviceId: "", audioOutputDeviceId: "", videoInputDeviceId: "" }, devices: { audioInput: [], audioOutput: [], videoInput: [] }, roles: {}, roleChangeRequests: [], errors: [], sessionStore: {}, templateAppData: {}, polls: {}, whiteboards: {}, hideLocalPeer: false });
20690
- ii = () => ({ peerStats: {}, remoteTrackStats: {}, localTrackStats: {}, localPeer: { id: "" } });
20689
+ ei = () => ({ room: { id: "", isConnected: false, name: "", peers: [], localPeer: "", roomState: "Disconnected", recording: { browser: { running: false }, server: { running: false }, hls: { running: false } }, rtmp: { running: false }, hls: { running: false, variants: [] }, sessionId: "" }, peers: {}, tracks: {}, playlist: { audio: { list: {}, selection: { id: "", hasPrevious: false, hasNext: false }, progress: 0, volume: 0, currentTime: 0, playbackRate: 1 }, video: { list: {}, selection: { id: "", hasPrevious: false, hasNext: false }, progress: 0, volume: 0, currentTime: 0, playbackRate: 1 } }, messages: { byID: {}, allIDs: [] }, speakers: {}, connectionQualities: {}, settings: { audioInputDeviceId: "", audioOutputDeviceId: "", videoInputDeviceId: "" }, devices: { audioInput: [], audioOutput: [], videoInput: [] }, roles: {}, roleChangeRequests: [], errors: [], sessionStore: {}, templateAppData: {}, polls: {}, whiteboards: {}, hideLocalPeer: false });
20690
+ ti = () => ({ peerStats: {}, remoteTrackStats: {}, localTrackStats: {}, localPeer: { id: "" } });
20691
20691
  Xa = ((e) => (e.CHAT = "chat", e))(Xa || {});
20692
20692
  ss = ((t2) => (t2.INFO = "info", t2.ERROR = "error", t2))(ss || {});
20693
20693
  gr = ((D2) => (D2.PEER_JOINED = "PEER_JOINED", D2.PEER_LEFT = "PEER_LEFT", D2.PEER_LIST = "PEER_LIST", D2.NEW_MESSAGE = "NEW_MESSAGE", D2.ERROR = "ERROR", D2.RECONNECTING = "RECONNECTING", D2.RECONNECTED = "RECONNECTED", D2.TRACK_ADDED = "TRACK_ADDED", D2.TRACK_REMOVED = "TRACK_REMOVED", D2.TRACK_MUTED = "TRACK_MUTED", D2.TRACK_UNMUTED = "TRACK_UNMUTED", D2.TRACK_DEGRADED = "TRACK_DEGRADED", D2.TRACK_RESTORED = "TRACK_RESTORED", D2.TRACK_DESCRIPTION_CHANGED = "TRACK_DESCRIPTION_CHANGED", D2.ROLE_UPDATED = "ROLE_UPDATED", D2.CHANGE_TRACK_STATE_REQUEST = "CHANGE_TRACK_STATE_REQUEST", D2.CHANGE_MULTI_TRACK_STATE_REQUEST = "CHANGE_MULTI_TRACK_STATE_REQUEST", D2.ROOM_ENDED = "ROOM_ENDED", D2.REMOVED_FROM_ROOM = "REMOVED_FROM_ROOM", D2.DEVICE_CHANGE_UPDATE = "DEVICE_CHANGE_UPDATE", D2.PLAYLIST_TRACK_ENDED = "PLAYLIST_TRACK_ENDED", D2.NAME_UPDATED = "NAME_UPDATED", D2.METADATA_UPDATED = "METADATA_UPDATED", D2.POLL_CREATED = "POLL_CREATED", D2.POLL_STARTED = "POLL_STARTED", D2.POLL_STOPPED = "POLL_STOPPED", D2.POLL_VOTES_UPDATED = "POLL_VOTES_UPDATED", D2.POLLS_LIST = "POLLS_LIST", D2.HAND_RAISE_CHANGED = "HAND_RAISE_CHANGED", D2.TRANSCRIPTION_STATE_UPDATED = "TRANSCRIPTION_STATE_UPDATED", D2))(gr || {});
@@ -20760,7 +20760,7 @@ var init_dist = __esm({
20760
20760
  }
20761
20761
  };
20762
20762
  d2.level = eo ? 7 : 0;
20763
- je = class {
20763
+ Je = class {
20764
20764
  constructor(e) {
20765
20765
  this.tracks = new Array();
20766
20766
  this.nativeStream = e, this.id = e.id;
@@ -20781,7 +20781,7 @@ var init_dist = __esm({
20781
20781
  return ((a11 = ge.getOS().name) == null ? void 0 : a11.toLowerCase()) === "ios";
20782
20782
  };
20783
20783
  hs = ((us = (ls = ge.getBrowser()) == null ? void 0 : ls.name) == null ? void 0 : us.toLowerCase()) === "firefox";
20784
- si = (a11) => a11 ? `{
20784
+ ri = (a11) => a11 ? `{
20785
20785
  trackId: ${a11.id};
20786
20786
  kind: ${a11.kind};
20787
20787
  enabled: ${a11.enabled};
@@ -20827,11 +20827,11 @@ var init_dist = __esm({
20827
20827
  logIdentifier: ${this.logIdentifier};
20828
20828
  source: ${this.source};
20829
20829
  enabled: ${this.enabled};
20830
- nativeTrack: ${si(this.nativeTrack)};
20830
+ nativeTrack: ${ri(this.nativeTrack)};
20831
20831
  }`;
20832
20832
  }
20833
20833
  };
20834
- Ae = class extends Re {
20834
+ Ie = class extends Re {
20835
20835
  constructor(t2, i2, r2) {
20836
20836
  super(t2, i2, r2);
20837
20837
  this.type = "audio";
@@ -20886,9 +20886,9 @@ var init_dist = __esm({
20886
20886
  }
20887
20887
  };
20888
20888
  ms = ((i2) => (i2.CUSTOM = "CUSTOM", i2.LOCAL = "LOCAL", i2.HMS = "HMS", i2))(ms || {});
20889
- Je = ro();
20890
- P4 = { WebSocketConnectionErrors: { FAILED_TO_CONNECT: 1e3, WEBSOCKET_CONNECTION_LOST: 1003, ABNORMAL_CLOSE: 1006 }, APIErrors: { SERVER_ERRORS: 2e3, INIT_CONFIG_NOT_AVAILABLE: 2002, ENDPOINT_UNREACHABLE: 2003, INVALID_TOKEN_FORMAT: 2004 }, TracksErrors: { GENERIC_TRACK: 3e3, CANT_ACCESS_CAPTURE_DEVICE: 3001, DEVICE_NOT_AVAILABLE: 3002, DEVICE_IN_USE: 3003, DEVICE_LOST_MIDWAY: 3004, NOTHING_TO_RETURN: 3005, INVALID_VIDEO_SETTINGS: 3006, CODEC_CHANGE_NOT_PERMITTED: 3007, AUTOPLAY_ERROR: 3008, OVER_CONSTRAINED: 3009, NO_AUDIO_DETECTED: 3010, SYSTEM_DENIED_PERMISSION: 3011, CURRENT_TAB_NOT_SHARED: 3012, AUDIO_PLAYBACK_ERROR: 3013, SELECTED_DEVICE_MISSING: 3014 }, WebrtcErrors: { CREATE_OFFER_FAILED: 4001, CREATE_ANSWER_FAILED: 4002, SET_LOCAL_DESCRIPTION_FAILED: 4003, SET_REMOTE_DESCRIPTION_FAILED: 4004, ICE_FAILURE: 4005, ICE_DISCONNECTED: 4006, STATS_FAILED: 4007 }, WebsocketMethodErrors: { SERVER_ERRORS: 5e3, ALREADY_JOINED: 5001, CANNOT_JOIN_PREVIEW_IN_PROGRESS: 5002 }, GenericErrors: { NOT_CONNECTED: 6e3, SIGNALLING: 6001, UNKNOWN: 6002, NOT_READY: 6003, JSON_PARSING_FAILED: 6004, TRACK_METADATA_MISSING: 6005, RTC_TRACK_MISSING: 6006, PEER_METADATA_MISSING: 6007, INVALID_ROLE: 6008, PREVIEW_IN_PROGRESS: 6009, MISSING_MEDIADEVICES: 6010, MISSING_RTCPEERCONNECTION: 6011, LOCAL_STORAGE_ACCESS_DENIED: 6012, VALIDATION_FAILED: 6013 }, PlaylistErrors: { NO_ENTRY_TO_PLAY: 8001, NO_ENTRY_IS_PLAYING: 8002 } };
20891
- f2 = class a2 extends Error {
20889
+ Qe = ro();
20890
+ E2 = { WebSocketConnectionErrors: { FAILED_TO_CONNECT: 1e3, WEBSOCKET_CONNECTION_LOST: 1003, ABNORMAL_CLOSE: 1006 }, APIErrors: { SERVER_ERRORS: 2e3, INIT_CONFIG_NOT_AVAILABLE: 2002, ENDPOINT_UNREACHABLE: 2003, INVALID_TOKEN_FORMAT: 2004 }, TracksErrors: { GENERIC_TRACK: 3e3, CANT_ACCESS_CAPTURE_DEVICE: 3001, DEVICE_NOT_AVAILABLE: 3002, DEVICE_IN_USE: 3003, DEVICE_LOST_MIDWAY: 3004, NOTHING_TO_RETURN: 3005, INVALID_VIDEO_SETTINGS: 3006, CODEC_CHANGE_NOT_PERMITTED: 3007, AUTOPLAY_ERROR: 3008, OVER_CONSTRAINED: 3009, NO_AUDIO_DETECTED: 3010, SYSTEM_DENIED_PERMISSION: 3011, CURRENT_TAB_NOT_SHARED: 3012, AUDIO_PLAYBACK_ERROR: 3013, SELECTED_DEVICE_MISSING: 3014 }, WebrtcErrors: { CREATE_OFFER_FAILED: 4001, CREATE_ANSWER_FAILED: 4002, SET_LOCAL_DESCRIPTION_FAILED: 4003, SET_REMOTE_DESCRIPTION_FAILED: 4004, ICE_FAILURE: 4005, ICE_DISCONNECTED: 4006, STATS_FAILED: 4007 }, WebsocketMethodErrors: { SERVER_ERRORS: 5e3, ALREADY_JOINED: 5001, CANNOT_JOIN_PREVIEW_IN_PROGRESS: 5002 }, GenericErrors: { NOT_CONNECTED: 6e3, SIGNALLING: 6001, UNKNOWN: 6002, NOT_READY: 6003, JSON_PARSING_FAILED: 6004, TRACK_METADATA_MISSING: 6005, RTC_TRACK_MISSING: 6006, PEER_METADATA_MISSING: 6007, INVALID_ROLE: 6008, PREVIEW_IN_PROGRESS: 6009, MISSING_MEDIADEVICES: 6010, MISSING_RTCPEERCONNECTION: 6011, LOCAL_STORAGE_ACCESS_DENIED: 6012, VALIDATION_FAILED: 6013 }, PlaylistErrors: { NO_ENTRY_TO_PLAY: 8001, NO_ENTRY_IS_PLAYING: 8002 } };
20891
+ v2 = class a2 extends Error {
20892
20892
  constructor(t2, i2, r2, s2, o2, n2 = false) {
20893
20893
  super(s2);
20894
20894
  this.code = t2;
@@ -20919,111 +20919,111 @@ var init_dist = __esm({
20919
20919
  };
20920
20920
  so = ["join", "offer", "answer", "trickle", "on-error", "JOIN"];
20921
20921
  S2 = { WebSocketConnectionErrors: { FailedToConnect(a11, e = "") {
20922
- return new f2(P4.WebSocketConnectionErrors.FAILED_TO_CONNECT, "WebsocketFailedToConnect", a11, `[WS]: ${e}`, `[WS]: ${e}`);
20922
+ return new v2(E2.WebSocketConnectionErrors.FAILED_TO_CONNECT, "WebsocketFailedToConnect", a11, `[WS]: ${e}`, `[WS]: ${e}`);
20923
20923
  }, WebSocketConnectionLost(a11, e = "") {
20924
- return new f2(P4.WebSocketConnectionErrors.WEBSOCKET_CONNECTION_LOST, "WebSocketConnectionLost", a11, "Network connection lost", e);
20924
+ return new v2(E2.WebSocketConnectionErrors.WEBSOCKET_CONNECTION_LOST, "WebSocketConnectionLost", a11, "Network connection lost", e);
20925
20925
  }, AbnormalClose(a11, e = "") {
20926
- return new f2(P4.WebSocketConnectionErrors.ABNORMAL_CLOSE, "WebSocketAbnormalClose", a11, "Websocket closed abnormally", e);
20926
+ return new v2(E2.WebSocketConnectionErrors.ABNORMAL_CLOSE, "WebSocketAbnormalClose", a11, "Websocket closed abnormally", e);
20927
20927
  } }, APIErrors: { ServerErrors(a11, e, t2 = "", i2 = true) {
20928
- return new f2(a11, "ServerErrors", e, `[${e}]: Server error ${t2}`, t2, i2);
20928
+ return new v2(a11, "ServerErrors", e, `[${e}]: Server error ${t2}`, t2, i2);
20929
20929
  }, EndpointUnreachable(a11, e = "") {
20930
- return new f2(P4.APIErrors.ENDPOINT_UNREACHABLE, "EndpointUnreachable", a11, `Endpoint is not reachable - ${e}`, e);
20930
+ return new v2(E2.APIErrors.ENDPOINT_UNREACHABLE, "EndpointUnreachable", a11, `Endpoint is not reachable - ${e}`, e);
20931
20931
  }, InvalidTokenFormat(a11, e = "") {
20932
- return new f2(P4.APIErrors.INVALID_TOKEN_FORMAT, "InvalidTokenFormat", a11, `Token is not in proper JWT format - ${e}`, e, true);
20932
+ return new v2(E2.APIErrors.INVALID_TOKEN_FORMAT, "InvalidTokenFormat", a11, `Token is not in proper JWT format - ${e}`, e, true);
20933
20933
  }, InitConfigNotAvailable(a11, e = "") {
20934
- return new f2(P4.APIErrors.INIT_CONFIG_NOT_AVAILABLE, "InitError", a11, `[INIT]: ${e}`, `[INIT]: ${e}`);
20934
+ return new v2(E2.APIErrors.INIT_CONFIG_NOT_AVAILABLE, "InitError", a11, `[INIT]: ${e}`, `[INIT]: ${e}`);
20935
20935
  } }, TracksErrors: { GenericTrack(a11, e = "") {
20936
- return new f2(P4.TracksErrors.GENERIC_TRACK, "GenericTrack", a11, `[TRACK]: ${e}`, `[TRACK]: ${e}`);
20936
+ return new v2(E2.TracksErrors.GENERIC_TRACK, "GenericTrack", a11, `[TRACK]: ${e}`, `[TRACK]: ${e}`);
20937
20937
  }, CantAccessCaptureDevice(a11, e, t2 = "") {
20938
- return new f2(P4.TracksErrors.CANT_ACCESS_CAPTURE_DEVICE, "CantAccessCaptureDevice", a11, `User denied permission to access capture device - ${e}`, t2);
20938
+ return new v2(E2.TracksErrors.CANT_ACCESS_CAPTURE_DEVICE, "CantAccessCaptureDevice", a11, `User denied permission to access capture device - ${e}`, t2);
20939
20939
  }, DeviceNotAvailable(a11, e, t2 = "") {
20940
- return new f2(P4.TracksErrors.DEVICE_NOT_AVAILABLE, "DeviceNotAvailable", a11, `[TRACK]: Capture device is no longer available - ${e}`, t2);
20940
+ return new v2(E2.TracksErrors.DEVICE_NOT_AVAILABLE, "DeviceNotAvailable", a11, `[TRACK]: Capture device is no longer available - ${e}`, t2);
20941
20941
  }, DeviceInUse(a11, e, t2 = "") {
20942
- return new f2(P4.TracksErrors.DEVICE_IN_USE, "DeviceInUse", a11, `[TRACK]: Capture device is in use by another application - ${e}`, t2);
20942
+ return new v2(E2.TracksErrors.DEVICE_IN_USE, "DeviceInUse", a11, `[TRACK]: Capture device is in use by another application - ${e}`, t2);
20943
20943
  }, DeviceLostMidway(a11, e, t2 = "") {
20944
- return new f2(P4.TracksErrors.DEVICE_LOST_MIDWAY, "DeviceLostMidway", a11, `Lost access to capture device midway - ${e}`, t2);
20944
+ return new v2(E2.TracksErrors.DEVICE_LOST_MIDWAY, "DeviceLostMidway", a11, `Lost access to capture device midway - ${e}`, t2);
20945
20945
  }, NothingToReturn(a11, e = "", t2 = "There is no media to return. Please select either video or audio or both.") {
20946
- return new f2(P4.TracksErrors.NOTHING_TO_RETURN, "NothingToReturn", a11, t2, e);
20946
+ return new v2(E2.TracksErrors.NOTHING_TO_RETURN, "NothingToReturn", a11, t2, e);
20947
20947
  }, InvalidVideoSettings(a11, e = "") {
20948
- return new f2(P4.TracksErrors.INVALID_VIDEO_SETTINGS, "InvalidVideoSettings", a11, "Cannot enable simulcast when no video settings are provided", e);
20948
+ return new v2(E2.TracksErrors.INVALID_VIDEO_SETTINGS, "InvalidVideoSettings", a11, "Cannot enable simulcast when no video settings are provided", e);
20949
20949
  }, AutoplayBlocked(a11, e = "") {
20950
- return new f2(P4.TracksErrors.AUTOPLAY_ERROR, "AutoplayBlocked", a11, "Autoplay blocked because the user didn't interact with the document first", e);
20950
+ return new v2(E2.TracksErrors.AUTOPLAY_ERROR, "AutoplayBlocked", a11, "Autoplay blocked because the user didn't interact with the document first", e);
20951
20951
  }, CodecChangeNotPermitted(a11, e = "") {
20952
- return new f2(P4.TracksErrors.CODEC_CHANGE_NOT_PERMITTED, "CodecChangeNotPermitted", a11, "Codec can't be changed mid call.", e);
20952
+ return new v2(E2.TracksErrors.CODEC_CHANGE_NOT_PERMITTED, "CodecChangeNotPermitted", a11, "Codec can't be changed mid call.", e);
20953
20953
  }, OverConstrained(a11, e, t2 = "") {
20954
- return new f2(P4.TracksErrors.OVER_CONSTRAINED, "OverConstrained", a11, `[TRACK]: Requested constraints cannot be satisfied with the device hardware - ${e}`, t2);
20954
+ return new v2(E2.TracksErrors.OVER_CONSTRAINED, "OverConstrained", a11, `[TRACK]: Requested constraints cannot be satisfied with the device hardware - ${e}`, t2);
20955
20955
  }, NoAudioDetected(a11, e = "Please check the mic or use another audio input") {
20956
- return new f2(P4.TracksErrors.NO_AUDIO_DETECTED, "NoAudioDetected", a11, "No audio input detected from microphone", e);
20956
+ return new v2(E2.TracksErrors.NO_AUDIO_DETECTED, "NoAudioDetected", a11, "No audio input detected from microphone", e);
20957
20957
  }, SystemDeniedPermission(a11, e, t2 = "") {
20958
- return new f2(P4.TracksErrors.SYSTEM_DENIED_PERMISSION, "SystemDeniedPermission", a11, `Operating System denied permission to access capture device - ${e}`, t2);
20958
+ return new v2(E2.TracksErrors.SYSTEM_DENIED_PERMISSION, "SystemDeniedPermission", a11, `Operating System denied permission to access capture device - ${e}`, t2);
20959
20959
  }, CurrentTabNotShared() {
20960
- return new f2(P4.TracksErrors.CURRENT_TAB_NOT_SHARED, "CurrentTabNotShared", "TRACK", "The app requires you to share the current tab", "You must screen share the current tab in order to proceed");
20960
+ return new v2(E2.TracksErrors.CURRENT_TAB_NOT_SHARED, "CurrentTabNotShared", "TRACK", "The app requires you to share the current tab", "You must screen share the current tab in order to proceed");
20961
20961
  }, AudioPlaybackError(a11) {
20962
- return new f2(P4.TracksErrors.AUDIO_PLAYBACK_ERROR, "Audio playback error", "TRACK", a11, a11);
20962
+ return new v2(E2.TracksErrors.AUDIO_PLAYBACK_ERROR, "Audio playback error", "TRACK", a11, a11);
20963
20963
  }, SelectedDeviceMissing(a11) {
20964
- return new f2(P4.TracksErrors.SELECTED_DEVICE_MISSING, "SelectedDeviceMissing", "TRACK", `Could not detect selected ${a11} device`, `Please check connection to the ${a11} device`, false);
20964
+ return new v2(E2.TracksErrors.SELECTED_DEVICE_MISSING, "SelectedDeviceMissing", "TRACK", `Could not detect selected ${a11} device`, `Please check connection to the ${a11} device`, false);
20965
20965
  } }, WebrtcErrors: { CreateOfferFailed(a11, e = "") {
20966
- return new f2(P4.WebrtcErrors.CREATE_OFFER_FAILED, "CreateOfferFailed", a11, `[${a11.toString()}]: Failed to create offer. `, e);
20966
+ return new v2(E2.WebrtcErrors.CREATE_OFFER_FAILED, "CreateOfferFailed", a11, `[${a11.toString()}]: Failed to create offer. `, e);
20967
20967
  }, CreateAnswerFailed(a11, e = "") {
20968
- return new f2(P4.WebrtcErrors.CREATE_ANSWER_FAILED, "CreateAnswerFailed", a11, `[${a11.toString()}]: Failed to create answer. `, e);
20968
+ return new v2(E2.WebrtcErrors.CREATE_ANSWER_FAILED, "CreateAnswerFailed", a11, `[${a11.toString()}]: Failed to create answer. `, e);
20969
20969
  }, SetLocalDescriptionFailed(a11, e = "") {
20970
- return new f2(P4.WebrtcErrors.SET_LOCAL_DESCRIPTION_FAILED, "SetLocalDescriptionFailed", a11, `[${a11.toString()}]: Failed to set offer. `, e);
20970
+ return new v2(E2.WebrtcErrors.SET_LOCAL_DESCRIPTION_FAILED, "SetLocalDescriptionFailed", a11, `[${a11.toString()}]: Failed to set offer. `, e);
20971
20971
  }, SetRemoteDescriptionFailed(a11, e = "") {
20972
- return new f2(P4.WebrtcErrors.SET_REMOTE_DESCRIPTION_FAILED, "SetRemoteDescriptionFailed", a11, `[${a11.toString()}]: Failed to set answer. `, e, true);
20972
+ return new v2(E2.WebrtcErrors.SET_REMOTE_DESCRIPTION_FAILED, "SetRemoteDescriptionFailed", a11, `[${a11.toString()}]: Failed to set answer. `, e, true);
20973
20973
  }, ICEFailure(a11, e = "", t2 = false) {
20974
- return new f2(P4.WebrtcErrors.ICE_FAILURE, "ICEFailure", a11, `[${a11.toString()}]: Ice connection state FAILED`, e, t2);
20974
+ return new v2(E2.WebrtcErrors.ICE_FAILURE, "ICEFailure", a11, `[${a11.toString()}]: Ice connection state FAILED`, e, t2);
20975
20975
  }, ICEDisconnected(a11, e = "") {
20976
- return new f2(P4.WebrtcErrors.ICE_DISCONNECTED, "ICEDisconnected", a11, `[${a11.toString()}]: Ice connection state DISCONNECTED`, e);
20976
+ return new v2(E2.WebrtcErrors.ICE_DISCONNECTED, "ICEDisconnected", a11, `[${a11.toString()}]: Ice connection state DISCONNECTED`, e);
20977
20977
  }, StatsFailed(a11, e = "") {
20978
- return new f2(P4.WebrtcErrors.STATS_FAILED, "StatsFailed", a11, `Failed to WebRTC get stats - ${e}`, e);
20978
+ return new v2(E2.WebrtcErrors.STATS_FAILED, "StatsFailed", a11, `Failed to WebRTC get stats - ${e}`, e);
20979
20979
  } }, WebsocketMethodErrors: { ServerErrors(a11, e, t2) {
20980
- return new f2(a11, "ServerErrors", e, t2, t2, so.includes(e));
20980
+ return new v2(a11, "ServerErrors", e, t2, t2, so.includes(e));
20981
20981
  }, AlreadyJoined(a11, e = "") {
20982
- return new f2(P4.WebsocketMethodErrors.ALREADY_JOINED, "AlreadyJoined", a11, "[JOIN]: You have already joined this room.", e);
20982
+ return new v2(E2.WebsocketMethodErrors.ALREADY_JOINED, "AlreadyJoined", a11, "[JOIN]: You have already joined this room.", e);
20983
20983
  }, CannotJoinPreviewInProgress(a11, e = "") {
20984
- return new f2(P4.WebsocketMethodErrors.CANNOT_JOIN_PREVIEW_IN_PROGRESS, "CannotJoinPreviewInProgress", a11, "[JOIN]: Cannot join if preview is in progress", e);
20984
+ return new v2(E2.WebsocketMethodErrors.CANNOT_JOIN_PREVIEW_IN_PROGRESS, "CannotJoinPreviewInProgress", a11, "[JOIN]: Cannot join if preview is in progress", e);
20985
20985
  } }, GenericErrors: { NotConnected(a11, e = "") {
20986
- return new f2(P4.GenericErrors.NOT_CONNECTED, "NotConnected", a11, "Client is not connected", e);
20986
+ return new v2(E2.GenericErrors.NOT_CONNECTED, "NotConnected", a11, "Client is not connected", e);
20987
20987
  }, Signalling(a11, e) {
20988
- return new f2(P4.GenericErrors.SIGNALLING, "Signalling", a11, `Unknown signalling error: ${a11.toString()} ${e} `, e);
20988
+ return new v2(E2.GenericErrors.SIGNALLING, "Signalling", a11, `Unknown signalling error: ${a11.toString()} ${e} `, e);
20989
20989
  }, Unknown(a11, e) {
20990
- return new f2(P4.GenericErrors.UNKNOWN, "Unknown", a11, `Unknown exception: ${e}`, e);
20990
+ return new v2(E2.GenericErrors.UNKNOWN, "Unknown", a11, `Unknown exception: ${e}`, e);
20991
20991
  }, NotReady(a11, e = "") {
20992
- return new f2(P4.GenericErrors.NOT_READY, "NotReady", a11, e, e);
20992
+ return new v2(E2.GenericErrors.NOT_READY, "NotReady", a11, e, e);
20993
20993
  }, JsonParsingFailed(a11, e, t2 = "") {
20994
- return new f2(P4.GenericErrors.JSON_PARSING_FAILED, "JsonParsingFailed", a11, `Failed to parse JSON message - ${e}`, t2);
20994
+ return new v2(E2.GenericErrors.JSON_PARSING_FAILED, "JsonParsingFailed", a11, `Failed to parse JSON message - ${e}`, t2);
20995
20995
  }, TrackMetadataMissing(a11, e = "") {
20996
- return new f2(P4.GenericErrors.TRACK_METADATA_MISSING, "TrackMetadataMissing", a11, "Track Metadata Missing", e);
20996
+ return new v2(E2.GenericErrors.TRACK_METADATA_MISSING, "TrackMetadataMissing", a11, "Track Metadata Missing", e);
20997
20997
  }, RTCTrackMissing(a11, e = "") {
20998
- return new f2(P4.GenericErrors.RTC_TRACK_MISSING, "RTCTrackMissing", a11, "RTC Track missing", e);
20998
+ return new v2(E2.GenericErrors.RTC_TRACK_MISSING, "RTCTrackMissing", a11, "RTC Track missing", e);
20999
20999
  }, PeerMetadataMissing(a11, e = "") {
21000
- return new f2(P4.GenericErrors.PEER_METADATA_MISSING, "PeerMetadataMissing", a11, "Peer Metadata Missing", e);
21000
+ return new v2(E2.GenericErrors.PEER_METADATA_MISSING, "PeerMetadataMissing", a11, "Peer Metadata Missing", e);
21001
21001
  }, ValidationFailed(a11, e) {
21002
- return new f2(P4.GenericErrors.VALIDATION_FAILED, "ValidationFailed", "VALIDATION", a11, e ? JSON.stringify(e) : "");
21002
+ return new v2(E2.GenericErrors.VALIDATION_FAILED, "ValidationFailed", "VALIDATION", a11, e ? JSON.stringify(e) : "");
21003
21003
  }, InvalidRole(a11, e) {
21004
- return new f2(P4.GenericErrors.INVALID_ROLE, "InvalidRole", a11, "Invalid role. Join with valid role", e, true);
21004
+ return new v2(E2.GenericErrors.INVALID_ROLE, "InvalidRole", a11, "Invalid role. Join with valid role", e, true);
21005
21005
  }, PreviewAlreadyInProgress(a11, e = "") {
21006
- return new f2(P4.GenericErrors.PREVIEW_IN_PROGRESS, "PreviewAlreadyInProgress", a11, "[Preview]: Cannot join if preview is in progress", e);
21006
+ return new v2(E2.GenericErrors.PREVIEW_IN_PROGRESS, "PreviewAlreadyInProgress", a11, "[Preview]: Cannot join if preview is in progress", e);
21007
21007
  }, LocalStorageAccessDenied(a11 = "Access to localStorage has been denied") {
21008
- return new f2(P4.GenericErrors.LOCAL_STORAGE_ACCESS_DENIED, "LocalStorageAccessDenied", "NONE", "LocalStorageAccessDenied", a11);
21008
+ return new v2(E2.GenericErrors.LOCAL_STORAGE_ACCESS_DENIED, "LocalStorageAccessDenied", "NONE", "LocalStorageAccessDenied", a11);
21009
21009
  }, MissingMediaDevices() {
21010
- return new f2(P4.GenericErrors.MISSING_MEDIADEVICES, "MissingMediaDevices", "JOIN", "navigator.mediaDevices is undefined. 100ms SDK won't work on this website as WebRTC is not supported on HTTP endpoints(missing navigator.mediaDevices). Please ensure you're using the SDK either on localhost or a valid HTTPS endpoint.", "", true);
21010
+ return new v2(E2.GenericErrors.MISSING_MEDIADEVICES, "MissingMediaDevices", "JOIN", "navigator.mediaDevices is undefined. 100ms SDK won't work on this website as WebRTC is not supported on HTTP endpoints(missing navigator.mediaDevices). Please ensure you're using the SDK either on localhost or a valid HTTPS endpoint.", "", true);
21011
21011
  }, MissingRTCPeerConnection() {
21012
- return new f2(P4.GenericErrors.MISSING_RTCPEERCONNECTION, "MissingRTCPeerConnection", "JOIN", "RTCPeerConnection which is a core requirement for WebRTC call was not found, this could be due to an unsupported browser or browser extensions blocking WebRTC", "", true);
21012
+ return new v2(E2.GenericErrors.MISSING_RTCPEERCONNECTION, "MissingRTCPeerConnection", "JOIN", "RTCPeerConnection which is a core requirement for WebRTC call was not found, this could be due to an unsupported browser or browser extensions blocking WebRTC", "", true);
21013
21013
  } }, MediaPluginErrors: { PlatformNotSupported(a11, e = "") {
21014
- return new f2(7001, "PlatformNotSupported", a11, "Check HMS Docs to see the list of supported platforms", e);
21014
+ return new v2(7001, "PlatformNotSupported", a11, "Check HMS Docs to see the list of supported platforms", e);
21015
21015
  }, InitFailed(a11, e = "") {
21016
- return new f2(7002, "InitFailed", a11, "Plugin init failed", e);
21016
+ return new v2(7002, "InitFailed", a11, "Plugin init failed", e);
21017
21017
  }, ProcessingFailed(a11, e = "") {
21018
- return new f2(7003, "ProcessingFailed", a11, "Plugin processing failed", e);
21018
+ return new v2(7003, "ProcessingFailed", a11, "Plugin processing failed", e);
21019
21019
  }, AddAlreadyInProgress(a11, e = "") {
21020
- return new f2(7004, "AddAlreadyInProgress", a11, "Plugin add already in progress", e);
21020
+ return new v2(7004, "AddAlreadyInProgress", a11, "Plugin add already in progress", e);
21021
21021
  }, DeviceNotSupported(a11, e = "") {
21022
- return new f2(7005, "DeviceNotSupported", a11, "Check HMS Docs to see the list of supported devices", e);
21022
+ return new v2(7005, "DeviceNotSupported", a11, "Check HMS Docs to see the list of supported devices", e);
21023
21023
  } }, PlaylistErrors: { NoEntryToPlay(a11, e) {
21024
- return new f2(P4.PlaylistErrors.NO_ENTRY_TO_PLAY, "NoEntryToPlay", a11, "Reached end of playlist", e);
21024
+ return new v2(E2.PlaylistErrors.NO_ENTRY_TO_PLAY, "NoEntryToPlay", a11, "Reached end of playlist", e);
21025
21025
  }, NoEntryPlaying(a11, e) {
21026
- return new f2(P4.PlaylistErrors.NO_ENTRY_IS_PLAYING, "NoEntryIsPlaying", a11, "No entry is playing at this time", e);
21026
+ return new v2(E2.PlaylistErrors.NO_ENTRY_IS_PLAYING, "NoEntryIsPlaying", a11, "No entry is playing at this time", e);
21027
21027
  } } };
21028
21028
  vr = class {
21029
21029
  constructor() {
@@ -21089,13 +21089,13 @@ var init_dist = __esm({
21089
21089
  return t2 ? a11 = t2 : (a11 = (0, import_uuid4.v4)(), e.set(a11)), a11;
21090
21090
  };
21091
21091
  Ts = "[VALIDATIONS]";
21092
- gt = () => {
21092
+ St = () => {
21093
21093
  if (!oe(RTCPeerConnection)) {
21094
21094
  let a11 = S2.GenericErrors.MissingRTCPeerConnection();
21095
21095
  throw d2.e(Ts, a11), a11;
21096
21096
  }
21097
21097
  };
21098
- Tt = () => {
21098
+ gt = () => {
21099
21099
  if (!oe(navigator.mediaDevices)) {
21100
21100
  let a11 = S2.GenericErrors.MissingMediaDevices();
21101
21101
  throw d2.e(Ts, a11), a11;
@@ -21105,11 +21105,11 @@ var init_dist = __esm({
21105
21105
  vs = (a11, e = ",") => Object.keys(a11).filter((t2) => oe(a11[t2])).map((t2) => `${t2}:${a11[t2]}`).join(e);
21106
21106
  H2 = class {
21107
21107
  constructor({ name: e, level: t2, properties: i2, includesPII: r2, timestamp: s2 }) {
21108
- this.metadata = { peer: {}, userAgent: ft() };
21108
+ this.metadata = { peer: {}, userAgent: Tt() };
21109
21109
  this.name = e, this.level = t2, this.includesPII = r2 || false, this.properties = i2 || {}, this.timestamp = s2 || (/* @__PURE__ */ new Date()).getTime(), this.event_id = (0, import_uuid3.v4)(), this.device_id = gs();
21110
21110
  }
21111
21111
  toSignalParams() {
21112
- return { name: this.name, info: M2(m({}, this.properties), { timestamp: this.timestamp, domain: Je }), timestamp: (/* @__PURE__ */ new Date()).getTime() };
21112
+ return { name: this.name, info: M2(m({}, this.properties), { timestamp: this.timestamp, domain: Qe }), timestamp: (/* @__PURE__ */ new Date()).getTime() };
21113
21113
  }
21114
21114
  };
21115
21115
  y2 = class {
@@ -21205,7 +21205,7 @@ var init_dist = __esm({
21205
21205
  return e = m(m({}, i2), e), e;
21206
21206
  }
21207
21207
  static getErrorProperties(e) {
21208
- return e ? e instanceof f2 ? e.toAnalyticsProperties() : { error_name: e.name, error_message: e.message, error_description: e.cause } : {};
21208
+ return e ? e instanceof v2 ? e.toAnalyticsProperties() : { error_name: e.name, error_message: e.message, error_description: e.cause } : {};
21209
21209
  }
21210
21210
  };
21211
21211
  y2.KEY_REQUESTED_AT = "requested_at", y2.KEY_RESPONDED_AT = "responded_at";
@@ -21243,7 +21243,7 @@ var init_dist = __esm({
21243
21243
  return e.deviceId === t2.deviceId && (e.groupId === t2.groupId || !e.groupId);
21244
21244
  }
21245
21245
  };
21246
- z2 = new kr();
21246
+ Q2 = new kr();
21247
21247
  Pr = ((t2) => (t2.TRANSFORM = "TRANSFORM", t2.ANALYZE = "ANALYZE", t2))(Pr || {});
21248
21248
  Er = ((t2) => (t2.PLATFORM_NOT_SUPPORTED = "PLATFORM_NOT_SUPPORTED", t2.DEVICE_NOT_SUPPORTED = "DEVICE_NOT_SUPPORTED", t2))(Er || {});
21249
21249
  ne = class {
@@ -21268,7 +21268,7 @@ var init_dist = __esm({
21268
21268
  return new H2({ name: l2, level: u2, properties: p2 });
21269
21269
  }
21270
21270
  };
21271
- ai = class {
21271
+ si = class {
21272
21272
  constructor(e) {
21273
21273
  this.eventBus = e;
21274
21274
  this.TAG = "[AudioPluginsAnalytics]";
@@ -21314,12 +21314,12 @@ var init_dist = __esm({
21314
21314
  };
21315
21315
  co = 48e3;
21316
21316
  lo = () => navigator.userAgent.indexOf("Firefox") !== -1;
21317
- vt = class {
21317
+ ft = class {
21318
21318
  constructor(e, t2, i2) {
21319
21319
  this.eventBus = t2;
21320
21320
  this.TAG = "[AudioPluginsManager]";
21321
21321
  this.pluginAddInProgress = false;
21322
- this.hmsTrack = e, this.pluginsMap = /* @__PURE__ */ new Map(), this.analytics = new ai(t2), this.createAudioContext(), this.room = i2;
21322
+ this.hmsTrack = e, this.pluginsMap = /* @__PURE__ */ new Map(), this.analytics = new si(t2), this.createAudioContext(), this.room = i2;
21323
21323
  }
21324
21324
  getPlugins() {
21325
21325
  return Array.from(this.pluginsMap.keys());
@@ -21481,7 +21481,7 @@ var init_dist = __esm({
21481
21481
  this.audioContext || (lo() ? this.audioContext = new AudioContext() : this.audioContext = new AudioContext({ sampleRate: co }));
21482
21482
  }
21483
21483
  };
21484
- Ie = { audioContext: null, getAudioContext() {
21484
+ He = { audioContext: null, getAudioContext() {
21485
21485
  return this.audioContext || (this.audioContext = new AudioContext()), this.audioContext;
21486
21486
  }, resumeContext() {
21487
21487
  return c2(this, null, function* () {
@@ -21492,7 +21492,7 @@ var init_dist = __esm({
21492
21492
  }
21493
21493
  });
21494
21494
  } };
21495
- He = class {
21495
+ Ce = class {
21496
21496
  constructor(e = 1 / 0) {
21497
21497
  this.capacity = e;
21498
21498
  this.storage = [];
@@ -21530,7 +21530,7 @@ var init_dist = __esm({
21530
21530
  })()`;
21531
21531
  mo = 35;
21532
21532
  So = 5;
21533
- ni = class {
21533
+ oi = class {
21534
21534
  constructor(e, t2, i2) {
21535
21535
  this.track = e;
21536
21536
  this.audioLevelEvent = t2;
@@ -21540,7 +21540,7 @@ var init_dist = __esm({
21540
21540
  this.isMonitored = false;
21541
21541
  this.interval = 100;
21542
21542
  this.historyInterval = 700;
21543
- this.history = new He(this.historyInterval / this.interval);
21543
+ this.history = new Ce(this.historyInterval / this.interval);
21544
21544
  this.detectSilence = () => c2(this, null, function* () {
21545
21545
  let i3 = 0;
21546
21546
  for (; this.isMonitored; ) {
@@ -21552,7 +21552,7 @@ var init_dist = __esm({
21552
21552
  }
21553
21553
  } else
21554
21554
  break;
21555
- yield K(20);
21555
+ yield Z2(20);
21556
21556
  }
21557
21557
  });
21558
21558
  try {
@@ -21575,7 +21575,7 @@ var init_dist = __esm({
21575
21575
  loop() {
21576
21576
  return c2(this, null, function* () {
21577
21577
  for (; this.isMonitored; )
21578
- this.sendAudioLevel(this.getMaxAudioLevelOverPeriod()), yield K(this.interval);
21578
+ this.sendAudioLevel(this.getMaxAudioLevelOverPeriod()), yield Z2(this.interval);
21579
21579
  });
21580
21580
  }
21581
21581
  sendAudioLevel(e = 0) {
@@ -21615,15 +21615,15 @@ var init_dist = __esm({
21615
21615
  return this.analyserNode.getByteTimeDomainData(e), !e.some((t2) => t2 !== 128 && t2 !== 0);
21616
21616
  }
21617
21617
  createAnalyserNodeForStream(e) {
21618
- let t2 = Ie.getAudioContext(), i2 = t2.createAnalyser();
21618
+ let t2 = He.getAudioContext(), i2 = t2.createAnalyser();
21619
21619
  return t2.createMediaStreamSource(e).connect(i2), i2;
21620
21620
  }
21621
21621
  };
21622
21622
  br = ((t2) => (t2.SIP = "sip", t2.REGULAR = "regular", t2))(br || {});
21623
21623
  bs = ((n2) => (n2.NONE = "none", n2.INITIALISED = "initialised", n2.STARTED = "started", n2.PAUSED = "paused", n2.RESUMED = "resumed", n2.STOPPED = "stopped", n2.FAILED = "failed", n2))(bs || {});
21624
21624
  Rs = ((t2) => (t2.DVR = "dvr", t2.NO_DVR = "no-dvr", t2))(Rs || {});
21625
- As = ((i2) => (i2.REGULAR = "regular", i2.SCREEN = "screen", i2.COMPOSITE = "composite", i2))(As || {});
21626
- Is = ((r2) => (r2.INITIALISED = "initialised", r2.STARTED = "started", r2.STOPPED = "stopped", r2.FAILED = "failed", r2))(Is || {});
21625
+ Is = ((i2) => (i2.REGULAR = "regular", i2.SCREEN = "screen", i2.COMPOSITE = "composite", i2))(Is || {});
21626
+ As = ((r2) => (r2.INITIALISED = "initialised", r2.STARTED = "started", r2.STOPPED = "stopped", r2.FAILED = "failed", r2))(As || {});
21627
21627
  Hs = ((e) => (e.CAPTION = "caption", e))(Hs || {});
21628
21628
  Be = { f: "high", h: "medium", q: "low" };
21629
21629
  Cs = ((i2) => (i2.videoInput = "videoInput", i2.audioInput = "audioInput", i2.audioOutput = "audioOutput", i2))(Cs || {});
@@ -21673,7 +21673,7 @@ var init_dist = __esm({
21673
21673
  return { audio_bitrate: this.maxBitrate, audio_codec: this.codec };
21674
21674
  }
21675
21675
  };
21676
- Y2 = class {
21676
+ z2 = class {
21677
21677
  constructor() {
21678
21678
  this._width = 320;
21679
21679
  this._height = 180;
@@ -21731,11 +21731,11 @@ var init_dist = __esm({
21731
21731
  return Te() && this.height && this.width && this.height > this.width ? { width: this.height, height: this.width } : { width: this.width, height: this.height };
21732
21732
  }
21733
21733
  };
21734
- Le = class {
21734
+ De = class {
21735
21735
  constructor() {
21736
- this._video = new Y2().build();
21736
+ this._video = new z2().build();
21737
21737
  this._audio = new ee().build();
21738
- this._screen = new Y2().build();
21738
+ this._screen = new z2().build();
21739
21739
  this._simulcast = false;
21740
21740
  }
21741
21741
  video(e) {
@@ -21767,7 +21767,7 @@ var init_dist = __esm({
21767
21767
  return this.audio && (e = m(m({}, this.audio.toAnalyticsProperties()), e)), this.video && (e = m(m({}, this.video.toAnalyticsProperties()), e)), e;
21768
21768
  }
21769
21769
  };
21770
- ce = class a3 extends Ae {
21770
+ ce = class a3 extends Ie {
21771
21771
  constructor(t2, i2, r2, s2, o2 = new ee().build(), n2) {
21772
21772
  super(t2, i2, r2);
21773
21773
  this.eventBus = s2;
@@ -21791,10 +21791,10 @@ var init_dist = __esm({
21791
21791
  if (Ds(t3, this.settings)("deviceId")) {
21792
21792
  this.manuallySelectedDeviceId = i3 ? this.manuallySelectedDeviceId : t3.deviceId, d2.d(this.TAG, "device change", "manual selection:", this.manuallySelectedDeviceId, "new device:", t3.deviceId), yield this.replaceTrackWith(t3);
21793
21793
  let s3 = this.nativeTrack.getSettings().groupId;
21794
- !i3 && t3.deviceId && (z2.updateSelection("audioInput", { deviceId: t3.deviceId, groupId: s3 }), this.eventBus.deviceChange.publish({ isUserSelection: true, type: "audioInput", selection: { deviceId: t3.deviceId, groupId: s3 } }));
21794
+ !i3 && t3.deviceId && (Q2.updateSelection("audioInput", { deviceId: t3.deviceId, groupId: s3 }), this.eventBus.deviceChange.publish({ isUserSelection: true, type: "audioInput", selection: { deviceId: t3.deviceId, groupId: s3 } }));
21795
21795
  }
21796
21796
  });
21797
- t2.tracks.push(this), this.settings = o2, o2.deviceId !== i2.getSettings().deviceId && !ue(i2) && (this.settings = this.buildNewSettings({ deviceId: i2.getSettings().deviceId })), this.pluginsManager = new vt(this, s2, n2), this.setFirstTrackId(i2.id), Tr() && O2 && document.addEventListener("visibilitychange", this.handleVisibilityChange);
21797
+ t2.tracks.push(this), this.settings = o2, o2.deviceId !== i2.getSettings().deviceId && !ue(i2) && (this.settings = this.buildNewSettings({ deviceId: i2.getSettings().deviceId })), this.pluginsManager = new ft(this, s2, n2), this.setFirstTrackId(i2.id), Tr() && O2 && document.addEventListener("visibilitychange", this.handleVisibilityChange);
21798
21798
  }
21799
21799
  getManuallySelectedDeviceId() {
21800
21800
  return this.manuallySelectedDeviceId;
@@ -21822,7 +21822,7 @@ var init_dist = __esm({
21822
21822
  }
21823
21823
  setEnabled(t2) {
21824
21824
  return c2(this, null, function* () {
21825
- t2 !== this.enabled && (t2 && ue(this.nativeTrack) && (yield this.replaceTrackWith(this.settings)), yield Q2(a3.prototype, this, "setEnabled").call(this, t2), t2 && (this.settings = this.buildNewSettings({ deviceId: this.nativeTrack.getSettings().deviceId })), this.eventBus.localAudioEnabled.publish({ enabled: t2, track: this }));
21825
+ t2 !== this.enabled && (t2 && ue(this.nativeTrack) && (yield this.replaceTrackWith(this.settings)), yield J(a3.prototype, this, "setEnabled").call(this, t2), t2 && (this.settings = this.buildNewSettings({ deviceId: this.nativeTrack.getSettings().deviceId })), this.eventBus.localAudioEnabled.publish({ enabled: t2, track: this }));
21826
21826
  });
21827
21827
  }
21828
21828
  isPublishedTrackId(t2) {
@@ -21860,7 +21860,7 @@ var init_dist = __esm({
21860
21860
  });
21861
21861
  }
21862
21862
  initAudioLevelMonitor() {
21863
- this.audioLevelMonitor && this.destroyAudioLevelMonitor(), d2.d(this.TAG, "Monitor Audio Level for", this, this.getMediaTrackSettings().deviceId), this.audioLevelMonitor = new ni(this, this.eventBus.trackAudioLevelUpdate, this.eventBus.localAudioSilence), this.audioLevelMonitor.start(), this.audioLevelMonitor.detectSilence();
21863
+ this.audioLevelMonitor && this.destroyAudioLevelMonitor(), d2.d(this.TAG, "Monitor Audio Level for", this, this.getMediaTrackSettings().deviceId), this.audioLevelMonitor = new oi(this, this.eventBus.trackAudioLevelUpdate, this.eventBus.localAudioSilence), this.audioLevelMonitor.start(), this.audioLevelMonitor.detectSilence();
21864
21864
  }
21865
21865
  destroyAudioLevelMonitor() {
21866
21866
  var t2;
@@ -21869,7 +21869,7 @@ var init_dist = __esm({
21869
21869
  cleanup() {
21870
21870
  return c2(this, null, function* () {
21871
21871
  var t2;
21872
- Q2(a3.prototype, this, "cleanup").call(this), yield this.pluginsManager.cleanup(), yield this.pluginsManager.closeContext(), this.transceiver = void 0, (t2 = this.processedTrack) == null || t2.stop(), this.isPublished = false, this.destroyAudioLevelMonitor(), Tr() && O2 && document.removeEventListener("visibilitychange", this.handleVisibilityChange);
21872
+ J(a3.prototype, this, "cleanup").call(this), yield this.pluginsManager.cleanup(), yield this.pluginsManager.closeContext(), this.transceiver = void 0, (t2 = this.processedTrack) == null || t2.stop(), this.isPublished = false, this.destroyAudioLevelMonitor(), Tr() && O2 && document.removeEventListener("visibilitychange", this.handleVisibilityChange);
21873
21873
  });
21874
21874
  }
21875
21875
  getTrackIDBeingSent() {
@@ -21883,10 +21883,10 @@ var init_dist = __esm({
21883
21883
  return new Ve(i2, r2, s2, o2, n2, l2);
21884
21884
  }
21885
21885
  };
21886
- se = class a4 extends Ae {
21886
+ se = class a4 extends Ie {
21887
21887
  setEnabled(e) {
21888
21888
  return c2(this, null, function* () {
21889
- e !== this.enabled && (yield Q2(a4.prototype, this, "setEnabled").call(this, e), yield this.subscribeToAudio(e));
21889
+ e !== this.enabled && (yield J(a4.prototype, this, "setEnabled").call(this, e), yield this.subscribeToAudio(e));
21890
21890
  });
21891
21891
  }
21892
21892
  };
@@ -21948,10 +21948,10 @@ var init_dist = __esm({
21948
21948
  this.sinkCount > 0 && this.sinkCount--;
21949
21949
  }
21950
21950
  };
21951
- Mt = { none: -1, low: 0, medium: 1, high: 2 };
21951
+ vt = { none: -1, low: 0, medium: 1, high: 2 };
21952
21952
  To = 0.5;
21953
21953
  ws = (a11, e) => {
21954
- let t2 = "high", i2 = e.width > e.height ? "width" : "height", r2 = [...a11].sort((o2, n2) => Mt[o2.layer] - Mt[n2.layer]), s2 = e[i2] * ((window == null ? void 0 : window.devicePixelRatio) || 1);
21954
+ let t2 = "high", i2 = e.width > e.height ? "width" : "height", r2 = [...a11].sort((o2, n2) => vt[o2.layer] - vt[n2.layer]), s2 = e[i2] * ((window == null ? void 0 : window.devicePixelRatio) || 1);
21955
21955
  for (let o2 = 0; o2 < r2.length; o2++) {
21956
21956
  let { resolution: n2, layer: l2 } = r2[o2], u2 = n2[i2];
21957
21957
  if (s2 <= u2) {
@@ -21995,7 +21995,7 @@ var init_dist = __esm({
21995
21995
  }
21996
21996
  };
21997
21997
  _s = new Rr();
21998
- Ar = class {
21998
+ Ir = class {
21999
21999
  constructor() {
22000
22000
  this.TAG = "[HMSResizeObserverWrapper]";
22001
22001
  this.listeners = /* @__PURE__ */ new WeakMap();
@@ -22008,7 +22008,7 @@ var init_dist = __esm({
22008
22008
  (t2 = this.resizeObserver) == null || t2.unobserve(e), this.listeners.delete(e);
22009
22009
  };
22010
22010
  this.createObserver = () => {
22011
- this.isSupported() && !this.resizeObserver && (this.resizeObserver = new ResizeObserver(oi(this.handleResize, 300)));
22011
+ this.isSupported() && !this.resizeObserver && (this.resizeObserver = new ResizeObserver(ai(this.handleResize, 300)));
22012
22012
  };
22013
22013
  this.handleResize = (e) => {
22014
22014
  var t2;
@@ -22022,7 +22022,7 @@ var init_dist = __esm({
22022
22022
  return e || d2.w(this.TAG, "Resize Observer is not supported"), e;
22023
22023
  }
22024
22024
  };
22025
- Ns = new Ar();
22025
+ Ns = new Ir();
22026
22026
  Xe = class {
22027
22027
  constructor(e) {
22028
22028
  this.track = e;
@@ -22087,15 +22087,15 @@ var init_dist = __esm({
22087
22087
  if (r2 === 0 || s2 === 0)
22088
22088
  continue;
22089
22089
  let o2 = ws(this.track.getSimulcastDefinitions(), { width: r2, height: s2 });
22090
- e ? e = Mt[o2] > Mt[e] ? o2 : e : e = o2;
22090
+ e ? e = vt[o2] > vt[e] ? o2 : e : e = o2;
22091
22091
  }
22092
22092
  e && (d2.d(this.TAG, `selecting max layer ${e} for the track`, `${this.track}`), yield this.track.setPreferredLayer(e));
22093
22093
  });
22094
22094
  }
22095
22095
  };
22096
- Ir = ((t2) => (t2.TRANSFORM = "TRANSFORM", t2.ANALYZE = "ANALYZE", t2))(Ir || {});
22096
+ Ar = ((t2) => (t2.TRANSFORM = "TRANSFORM", t2.ANALYZE = "ANALYZE", t2))(Ar || {});
22097
22097
  Hr = ((t2) => (t2["2D"] = "2d", t2.WEBGL = "webgl", t2.WEBGL2 = "webgl2", t2))(Hr || {});
22098
- yt = class {
22098
+ Mt = class {
22099
22099
  constructor() {
22100
22100
  this.total = 0;
22101
22101
  this.count = 0;
@@ -22114,10 +22114,10 @@ var init_dist = __esm({
22114
22114
  constructor(e) {
22115
22115
  this.eventBus = e;
22116
22116
  this.TAG = "[VideoPluginsAnalytics]";
22117
- this.initTime = {}, this.preProcessingAvgs = new yt(), this.addedTimestamps = {}, this.processingAvgs = {}, this.pluginAdded = {}, this.pluginInputFrameRate = {}, this.pluginFrameRate = {};
22117
+ this.initTime = {}, this.preProcessingAvgs = new Mt(), this.addedTimestamps = {}, this.processingAvgs = {}, this.pluginAdded = {}, this.pluginInputFrameRate = {}, this.pluginFrameRate = {};
22118
22118
  }
22119
22119
  added(e, t2, i2) {
22120
- this.pluginAdded[e] = true, this.addedTimestamps[e] = Date.now(), this.initTime[e] = 0, this.processingAvgs[e] = new yt(), t2 && (this.pluginInputFrameRate[e] = t2, this.pluginFrameRate[e] = i2 || t2), this.eventBus.analytics.publish(ne.added(e, this.addedTimestamps[e]));
22120
+ this.pluginAdded[e] = true, this.addedTimestamps[e] = Date.now(), this.initTime[e] = 0, this.processingAvgs[e] = new Mt(), t2 && (this.pluginInputFrameRate[e] = t2, this.pluginFrameRate[e] = i2 || t2), this.eventBus.analytics.publish(ne.added(e, this.addedTimestamps[e]));
22121
22121
  }
22122
22122
  removed(e) {
22123
22123
  var t2;
@@ -22177,7 +22177,7 @@ var init_dist = __esm({
22177
22177
  Os = 24;
22178
22178
  vo = 320;
22179
22179
  Mo = 240;
22180
- kt = class {
22180
+ yt = class {
22181
22181
  constructor(e, t2) {
22182
22182
  this.TAG = "[VideoPluginsManager]";
22183
22183
  this.pluginsLoopRunning = false;
@@ -22269,7 +22269,7 @@ var init_dist = __esm({
22269
22269
  return c2(this, null, function* () {
22270
22270
  if (!(!this.pluginsLoopRunning || this.pluginsLoopState === "running"))
22271
22271
  for (; this.pluginsLoopState === "paused"; )
22272
- yield Ce(100);
22272
+ yield Le(100);
22273
22273
  });
22274
22274
  }
22275
22275
  cleanup() {
@@ -22400,7 +22400,7 @@ var init_dist = __esm({
22400
22400
  return this.pluginNumFramesSkipped[e] < this.pluginNumFramesToSkip[e] ? (this.pluginNumFramesSkipped[e]++, t2 = true) : (t2 = false, this.pluginNumFramesSkipped[e] = 0), t2;
22401
22401
  }
22402
22402
  };
22403
- ci = class {
22403
+ ni = class {
22404
22404
  constructor(e, t2) {
22405
22405
  this.TAG = "[MediaStreamPluginsManager]";
22406
22406
  this.plugins = /* @__PURE__ */ new Set(), this.analytics = new Ze(e), this.room = t2;
@@ -22445,7 +22445,7 @@ var init_dist = __esm({
22445
22445
  }
22446
22446
  };
22447
22447
  yo = ["init_response_time", "ws_connect_time", "on_policy_change_time", "local_audio_track_time", "local_video_track_time", "peer_list_time", "room_state_time", "join_response_time"];
22448
- di = class {
22448
+ ci = class {
22449
22449
  constructor() {
22450
22450
  this.eventPerformanceMeasures = {};
22451
22451
  }
@@ -22484,7 +22484,7 @@ var init_dist = __esm({
22484
22484
  }
22485
22485
  getTracksToPublish() {
22486
22486
  return c2(this, arguments, function* (e = Cr) {
22487
- var T, g2, v2, E2;
22487
+ var T, g2, f2, P8;
22488
22488
  let t2 = this.getAVTrackSettings(e);
22489
22489
  if (!t2)
22490
22490
  return [];
@@ -22498,7 +22498,7 @@ var init_dist = __esm({
22498
22498
  } catch (k2) {
22499
22499
  s2 = yield this.retryGetLocalTracks(k2, t2, h2, l2);
22500
22500
  }
22501
- return h2.audio && ((v2 = this.analyticsTimer) == null || v2.end("local_audio_track_time")), h2.video && ((E2 = this.analyticsTimer) == null || E2.end("local_video_track_time")), o2 && r2 && !u2 && s2.push(o2), n2 && i2 && !p2 && s2.push(n2), s2;
22501
+ return h2.audio && ((f2 = this.analyticsTimer) == null || f2.end("local_audio_track_time")), h2.video && ((P8 = this.analyticsTimer) == null || P8.end("local_video_track_time")), o2 && r2 && !u2 && s2.push(o2), n2 && i2 && !p2 && s2.push(n2), s2;
22502
22502
  });
22503
22503
  }
22504
22504
  getLocalTracks() {
@@ -22529,8 +22529,8 @@ var init_dist = __esm({
22529
22529
  r2.srcObject = e, r2.addEventListener("loadedmetadata", () => c2(this, null, function* () {
22530
22530
  let { videoWidth: l2, videoHeight: u2 } = r2, p2 = i2.screen, h2 = p2.width * p2.height, T = l2 / u2, g2 = p2.width / p2.height;
22531
22531
  if (T > g2) {
22532
- let v2 = t2.video, E2 = T / g2, k2 = Math.sqrt(E2);
22533
- l2 * u2 > h2 ? (v2.width = l2 / k2, v2.height = u2 / k2) : (v2.height = u2 * k2, v2.width = l2 * k2), yield e.getVideoTracks()[0].applyConstraints(v2);
22532
+ let f2 = t2.video, P8 = T / g2, k2 = Math.sqrt(P8);
22533
+ l2 * u2 > h2 ? (f2.width = l2 / k2, f2.height = u2 / k2) : (f2.height = u2 * k2, f2.width = l2 * k2), yield e.getVideoTracks()[0].applyConstraints(f2);
22534
22534
  }
22535
22535
  }));
22536
22536
  });
@@ -22548,8 +22548,8 @@ var init_dist = __esm({
22548
22548
  d2.d("retrieving screenshare with ", { config: i2 }, { constraints: s2 }), o2 = yield navigator.mediaDevices.getDisplayMedia(s2), t2 && (yield this.optimizeScreenShareConstraint(o2, s2));
22549
22549
  } catch (g2) {
22550
22550
  d2.w(this.TAG, "error in getting screenshare - ", g2);
22551
- let v2 = Qe(g2, "screen");
22552
- throw this.eventBus.analytics.publish(y2.publish({ error: v2, devices: this.deviceManager.getDevices(), settings: new ze(r2 == null ? void 0 : r2.video, r2 == null ? void 0 : r2.audio, false) })), v2;
22551
+ let f2 = Ae(g2, "screen");
22552
+ throw this.eventBus.analytics.publish(y2.publish({ error: f2, devices: this.deviceManager.getDevices(), settings: new ze(r2 == null ? void 0 : r2.video, r2 == null ? void 0 : r2.audio, false) })), f2;
22553
22553
  }
22554
22554
  let n2 = [], l2 = new Ge(o2), u2 = o2.getVideoTracks()[0], p2 = new F(l2, u2, "screen", this.eventBus, r2 == null ? void 0 : r2.video, this.store.getRoom());
22555
22555
  p2.setSimulcastDefinitons(this.store.getSimulcastDefinitionsForPeer(this.store.getLocalPeer(), "screen"));
@@ -22557,7 +22557,7 @@ var init_dist = __esm({
22557
22557
  let g2 = this.validateCurrentTabCapture(p2, i2.forceCurrentTab);
22558
22558
  p2.isCurrentTab = g2, yield p2.cropTo(i2.cropTarget);
22559
22559
  } catch (g2) {
22560
- throw o2.getTracks().forEach((v2) => v2.stop()), g2;
22560
+ throw o2.getTracks().forEach((f2) => f2.stop()), g2;
22561
22561
  }
22562
22562
  n2.push(p2);
22563
22563
  let h2 = o2.getAudioTracks()[0];
@@ -22590,7 +22590,7 @@ var init_dist = __esm({
22590
22590
  static getEmptyVideoTrack(e) {
22591
22591
  var n2, l2, u2;
22592
22592
  let t2 = ((n2 = e == null ? void 0 : e.getSettings()) == null ? void 0 : n2.width) || 320, i2 = ((l2 = e == null ? void 0 : e.getSettings()) == null ? void 0 : l2.height) || 240, r2 = 1;
22593
- pe || (pe = document.createElement("canvas"), pe.width = t2, pe.height = i2, (u2 = pe.getContext("2d")) == null || u2.fillRect(0, 0, t2, i2)), li || (li = setInterval(() => {
22593
+ pe || (pe = document.createElement("canvas"), pe.width = t2, pe.height = i2, (u2 = pe.getContext("2d")) == null || u2.fillRect(0, 0, t2, i2)), di || (di = setInterval(() => {
22594
22594
  let p2 = pe == null ? void 0 : pe.getContext("2d");
22595
22595
  p2 && p2.fillRect(0, 0, 1, 1);
22596
22596
  }, 1e3 / r2));
@@ -22598,13 +22598,13 @@ var init_dist = __esm({
22598
22598
  return o2.enabled = false, o2;
22599
22599
  }
22600
22600
  static getEmptyAudioTrack() {
22601
- let e = Ie.getAudioContext(), t2 = e.createOscillator(), i2 = e.createMediaStreamDestination();
22601
+ let e = He.getAudioContext(), t2 = e.createOscillator(), i2 = e.createMediaStreamDestination();
22602
22602
  t2.connect(i2), t2.start();
22603
22603
  let r2 = i2.stream.getAudioTracks()[0];
22604
22604
  return r2.enabled = false, r2;
22605
22605
  }
22606
22606
  static cleanup() {
22607
- clearInterval(li), li = void 0, pe = void 0;
22607
+ clearInterval(di), di = void 0, pe = void 0;
22608
22608
  }
22609
22609
  getAVTracks(e) {
22610
22610
  return c2(this, null, function* () {
@@ -22614,13 +22614,13 @@ var init_dist = __esm({
22614
22614
  } catch (t2) {
22615
22615
  yield this.deviceManager.init();
22616
22616
  let i2 = !!(!this.deviceManager.hasWebcamPermission && e.video), r2 = !!(!this.deviceManager.hasMicrophonePermission && e.audio), s2 = this.getErrorType(i2, r2);
22617
- throw Qe(t2, s2);
22617
+ throw Ae(t2, s2);
22618
22618
  }
22619
22619
  });
22620
22620
  }
22621
22621
  getAVTrackSettings(e) {
22622
22622
  let t2 = this.getAudioSettings(e), i2 = this.getVideoSettings(e);
22623
- return !t2 && !i2 ? null : new Le().video(i2).audio(t2).build();
22623
+ return !t2 && !i2 ? null : new De().video(i2).audio(t2).build();
22624
22624
  }
22625
22625
  isInIframe() {
22626
22626
  try {
@@ -22631,16 +22631,16 @@ var init_dist = __esm({
22631
22631
  }
22632
22632
  retryGetLocalTracks(e, t2, i2, r2) {
22633
22633
  return c2(this, null, function* () {
22634
- if (e instanceof f2 && e.action === "TRACK") {
22634
+ if (e instanceof v2 && e.action === "TRACK") {
22635
22635
  this.observer.onFailure(e);
22636
- let s2 = e.code === P4.TracksErrors.OVER_CONSTRAINED, o2 = e.message.includes("audio"), n2 = e.message.includes("video");
22636
+ let s2 = e.code === E2.TracksErrors.OVER_CONSTRAINED, o2 = e.message.includes("audio"), n2 = e.message.includes("video");
22637
22637
  if (s2) {
22638
- let l2 = new Le().video(new Fe()).audio(new Ve()).build();
22638
+ let l2 = new De().video(new Fe()).audio(new Ve()).build();
22639
22639
  d2.w(this.TAG, "Fetch AV Tracks failed with overconstrained error", { fetchTrackOptions: i2 }, { error: e });
22640
22640
  try {
22641
22641
  return yield this.getLocalTracks(i2, l2, r2);
22642
22642
  } catch (u2) {
22643
- let p2 = u2 instanceof f2 ? u2.nativeError : u2, h2 = u2;
22643
+ let p2 = u2 instanceof v2 ? u2.nativeError : u2, h2 = u2;
22644
22644
  if ((p2 == null ? void 0 : p2.name) === "OverconstrainedError") {
22645
22645
  let T = S2.TracksErrors.GenericTrack("TRACK", "Overconstrained error after dropping all constraints");
22646
22646
  T.addNativeError(p2), h2 = T;
@@ -22687,7 +22687,7 @@ var init_dist = __esm({
22687
22687
  if (!t2 || !((n2 = t2.allowed) != null && n2.includes("video")))
22688
22688
  return null;
22689
22689
  let i2 = this.store.getLocalPeer(), r2 = i2 == null ? void 0 : i2.videoTrack, s2 = (r2 == null ? void 0 : r2.settings.deviceId) || e.videoDeviceId, o2 = t2.video;
22690
- return new Y2().codec(o2.codec).maxBitrate(o2.bitRate).maxFramerate(o2.frameRate).setWidth(o2.width).setHeight(o2.height).deviceId(s2 || Cr.videoDeviceId).build();
22690
+ return new z2().codec(o2.codec).maxBitrate(o2.bitRate).maxFramerate(o2.frameRate).setWidth(o2.width).setHeight(o2.height).deviceId(s2 || Cr.videoDeviceId).build();
22691
22691
  }
22692
22692
  getScreenshareSettings(e = false) {
22693
22693
  var r2;
@@ -22695,7 +22695,7 @@ var init_dist = __esm({
22695
22695
  if (!t2 || !((r2 = t2.allowed) != null && r2.includes("screen")))
22696
22696
  return null;
22697
22697
  let i2 = t2.screen;
22698
- return { video: new Y2().maxBitrate(i2.bitRate, false).codec(i2.codec).maxFramerate(i2.frameRate).setWidth(i2.width).setHeight(i2.height).build(), audio: e ? void 0 : new ee().build() };
22698
+ return { video: new z2().maxBitrate(i2.bitRate, false).codec(i2.codec).maxFramerate(i2.frameRate).setWidth(i2.width).setHeight(i2.height).build(), audio: e ? void 0 : new ee().build() };
22699
22699
  }
22700
22700
  getOrDefaultScreenshareConfig(e) {
22701
22701
  return c2(this, null, function* () {
@@ -22720,7 +22720,7 @@ var init_dist = __esm({
22720
22720
  }
22721
22721
  };
22722
22722
  F = class a6 extends Ye {
22723
- constructor(t2, i2, r2, s2, o2 = new Y2().build(), n2) {
22723
+ constructor(t2, i2, r2, s2, o2 = new z2().build(), n2) {
22724
22724
  super(t2, i2, r2);
22725
22725
  this.eventBus = s2;
22726
22726
  this._layerDefinitions = [];
@@ -22756,7 +22756,7 @@ var init_dist = __esm({
22756
22756
  yield this.replaceSender(o3, this.enabled), this.nativeTrack = o3, yield this.processPlugins(), this.videoHandler.updateSinks();
22757
22757
  }
22758
22758
  let s3 = this.nativeTrack.getSettings().groupId;
22759
- !i3 && t3.deviceId && (z2.updateSelection("videoInput", { deviceId: t3.deviceId, groupId: s3 }), this.eventBus.deviceChange.publish({ isUserSelection: true, type: "video", selection: { deviceId: t3.deviceId, groupId: s3 } }));
22759
+ !i3 && t3.deviceId && (Q2.updateSelection("videoInput", { deviceId: t3.deviceId, groupId: s3 }), this.eventBus.deviceChange.publish({ isUserSelection: true, type: "video", selection: { deviceId: t3.deviceId, groupId: s3 } }));
22760
22760
  }
22761
22761
  });
22762
22762
  this.removeOrReplaceProcessedTrack = (t3) => c2(this, null, function* () {
@@ -22765,7 +22765,7 @@ var init_dist = __esm({
22765
22765
  this.handleVisibilityChange = () => c2(this, null, function* () {
22766
22766
  document.visibilityState === "hidden" && this.source === "regular" ? (this.enabledStateBeforeBackground = this.enabled, this.nativeTrack.enabled = false, this.replaceSenderTrack(this.nativeTrack)) : (this.nativeTrack.enabled = this.enabledStateBeforeBackground, this.replaceSenderTrack(this.processedTrack || this.nativeTrack)), this.eventBus.localVideoEnabled.publish({ enabled: this.nativeTrack.enabled, track: this });
22767
22767
  });
22768
- t2.tracks.push(this), this.setVideoHandler(new Xe(this)), this.settings = o2, o2.deviceId !== i2.getSettings().deviceId && i2.enabled && (this.settings = this.buildNewSettings({ deviceId: i2.getSettings().deviceId })), this.pluginsManager = new kt(this, s2), this.mediaStreamPluginsManager = new ci(s2, n2), this.setFirstTrackId(this.trackId), O2 && Te() && document.addEventListener("visibilitychange", this.handleVisibilityChange);
22768
+ t2.tracks.push(this), this.setVideoHandler(new Xe(this)), this.settings = o2, o2.deviceId !== i2.getSettings().deviceId && i2.enabled && (this.settings = this.buildNewSettings({ deviceId: i2.getSettings().deviceId })), this.pluginsManager = new yt(this, s2), this.mediaStreamPluginsManager = new ni(s2, n2), this.setFirstTrackId(this.trackId), O2 && Te() && document.addEventListener("visibilitychange", this.handleVisibilityChange);
22769
22769
  }
22770
22770
  setSimulcastDefinitons(t2) {
22771
22771
  this._layerDefinitions = t2;
@@ -22779,7 +22779,7 @@ var init_dist = __esm({
22779
22779
  if (t2 !== this.enabled) {
22780
22780
  if (this.source === "regular") {
22781
22781
  let r2;
22782
- t2 ? r2 = yield this.replaceTrackWith(this.settings) : r2 = yield this.replaceTrackWithBlank(), yield this.replaceSender(r2, t2), (i2 = this.nativeTrack) == null || i2.stop(), this.nativeTrack = r2, yield Q2(a6.prototype, this, "setEnabled").call(this, t2), t2 && (yield this.pluginsManager.waitForRestart(), yield this.processPlugins(), this.settings = this.buildNewSettings({ deviceId: r2.getSettings().deviceId })), this.videoHandler.updateSinks();
22782
+ t2 ? r2 = yield this.replaceTrackWith(this.settings) : r2 = yield this.replaceTrackWithBlank(), yield this.replaceSender(r2, t2), (i2 = this.nativeTrack) == null || i2.stop(), this.nativeTrack = r2, yield J(a6.prototype, this, "setEnabled").call(this, t2), t2 && (yield this.pluginsManager.waitForRestart(), yield this.processPlugins(), this.settings = this.buildNewSettings({ deviceId: r2.getSettings().deviceId })), this.videoHandler.updateSinks();
22783
22783
  }
22784
22784
  this.eventBus.localVideoEnabled.publish({ enabled: t2, track: this });
22785
22785
  }
@@ -22850,7 +22850,7 @@ var init_dist = __esm({
22850
22850
  cleanup() {
22851
22851
  return c2(this, null, function* () {
22852
22852
  var t2;
22853
- Q2(a6.prototype, this, "cleanup").call(this), this.transceiver = void 0, yield this.pluginsManager.cleanup(), (t2 = this.processedTrack) == null || t2.stop(), this.isPublished = false, O2 && Te() && document.removeEventListener("visibilitychange", this.handleVisibilityChange);
22853
+ J(a6.prototype, this, "cleanup").call(this), this.transceiver = void 0, yield this.pluginsManager.cleanup(), (t2 = this.processedTrack) == null || t2.stop(), this.isPublished = false, O2 && Te() && document.removeEventListener("visibilitychange", this.handleVisibilityChange);
22854
22854
  });
22855
22855
  }
22856
22856
  cropTo(t2) {
@@ -22893,7 +22893,7 @@ var init_dist = __esm({
22893
22893
  let i2 = t2 === "environment" ? "user" : "environment";
22894
22894
  (s2 = this.nativeTrack) == null || s2.stop();
22895
22895
  let r2 = yield this.replaceTrackWith(this.buildNewSettings({ facingMode: i2, deviceId: void 0 }));
22896
- yield this.replaceSender(r2, this.enabled), this.nativeTrack = r2, yield this.processPlugins(), this.videoHandler.updateSinks(), this.settings = this.buildNewSettings({ deviceId: this.nativeTrack.getSettings().deviceId, facingMode: i2 }), z2.updateSelection("videoInput", { deviceId: this.settings.deviceId, groupId: this.nativeTrack.getSettings().groupId });
22896
+ yield this.replaceSender(r2, this.enabled), this.nativeTrack = r2, yield this.processPlugins(), this.videoHandler.updateSinks(), this.settings = this.buildNewSettings({ deviceId: this.nativeTrack.getSettings().deviceId, facingMode: i2 }), Q2.updateSelection("videoInput", { deviceId: this.settings.deviceId, groupId: this.nativeTrack.getSettings().groupId });
22897
22897
  });
22898
22898
  }
22899
22899
  replaceTrackWith(t2) {
@@ -22921,11 +22921,11 @@ var init_dist = __esm({
22921
22921
  }
22922
22922
  };
22923
22923
  et = "renegotiation-callback-id";
22924
- ui = "ion-sfu";
22924
+ li = "ion-sfu";
22925
22925
  tt = "SUBSCRIBE_ICE_CONNECTION_CALLBACK_ID";
22926
22926
  Us = "https://event.100ms.live/v2/client/report";
22927
22927
  Bs = "https://event-nonprod.100ms.live/v2/client/report";
22928
- Pt = Math.pow(2, 31) - 1;
22928
+ kt = Math.pow(2, 31) - 1;
22929
22929
  G2 = { DEVICE_CHANGE: "device-change", LOCAL_AUDIO_ENABLED: "local-audio-enabled", LOCAL_VIDEO_ENABLED: "local-video-enabled", STATS_UPDATE: "stats-update", RTC_STATS_UPDATE: "rtc-stats-update", TRACK_DEGRADED: "track-degraded", TRACK_RESTORED: "track-restored", TRACK_AUDIO_LEVEL_UPDATE: "track-audio-level-update", LOCAL_AUDIO_SILENCE: "local-audio-silence", ANALYTICS: "analytics", AUDIO_PLUGIN_FAILED: "audio-plugin-failed", POLICY_CHANGE: "policy-change", LOCAL_ROLE_UPDATE: "local-role-update", AUDIO_TRACK_UPDATE: "audio-track-update", AUDIO_TRACK_ADDED: "audio-track-added", AUDIO_TRACK_REMOVED: "audio-track-removed", AUTOPLAY_ERROR: "autoplay-error", LEAVE: "leave" };
22930
22930
  Vs = "2.5";
22931
22931
  Fs = "20240521";
@@ -22958,7 +22958,7 @@ var init_dist = __esm({
22958
22958
  }
22959
22959
  setEnabled(t2) {
22960
22960
  return c2(this, null, function* () {
22961
- t2 !== this.enabled && (Q2(a7.prototype, this, "setEnabled").call(this, t2), this.videoHandler.updateSinks(true));
22961
+ t2 !== this.enabled && (J(a7.prototype, this, "setEnabled").call(this, t2), this.videoHandler.updateSinks(true));
22962
22962
  });
22963
22963
  }
22964
22964
  setPreferredLayer(t2) {
@@ -22997,12 +22997,12 @@ var init_dist = __esm({
22997
22997
  }
22998
22998
  addSink(t2, i2 = true) {
22999
22999
  return c2(this, null, function* () {
23000
- ue(this.nativeTrack) ? yield this.requestLayer(this.preferredLayer, "addSink") : (Q2(a7.prototype, this, "addSink").call(this, t2), i2 && (yield this.updateLayer("addSink"))), this.pushInHistory("uiSetLayer-high");
23000
+ ue(this.nativeTrack) ? yield this.requestLayer(this.preferredLayer, "addSink") : (J(a7.prototype, this, "addSink").call(this, t2), i2 && (yield this.updateLayer("addSink"))), this.pushInHistory("uiSetLayer-high");
23001
23001
  });
23002
23002
  }
23003
23003
  removeSink(t2, i2 = true) {
23004
23004
  return c2(this, null, function* () {
23005
- Q2(a7.prototype, this, "removeSink").call(this, t2), i2 && (yield this.updateLayer("removeSink")), this._degraded = false, this.pushInHistory("uiSetLayer-none");
23005
+ J(a7.prototype, this, "removeSink").call(this, t2), i2 && (yield this.updateLayer("removeSink")), this._degraded = false, this.pushInHistory("uiSetLayer-none");
23006
23006
  });
23007
23007
  }
23008
23008
  getSimulcastDefinitions() {
@@ -23062,7 +23062,7 @@ var init_dist = __esm({
23062
23062
  e.time = (/* @__PURE__ */ new Date()).toISOString().split("T")[1], this.history.push(e);
23063
23063
  }
23064
23064
  };
23065
- Ge = class extends je {
23065
+ Ge = class extends Je {
23066
23066
  constructor() {
23067
23067
  super(...arguments);
23068
23068
  this.TAG = "[HMSLocalStream]";
@@ -23113,7 +23113,7 @@ var init_dist = __esm({
23113
23113
  return r2;
23114
23114
  }
23115
23115
  };
23116
- fe = class extends je {
23116
+ fe = class extends Je {
23117
23117
  constructor(t2, i2) {
23118
23118
  super(t2);
23119
23119
  this.audio = true;
@@ -23175,8 +23175,8 @@ var init_dist = __esm({
23175
23175
  var k2, w2;
23176
23176
  let h2 = (k2 = l2[p2]) == null ? void 0 : k2.codecId, T = h2 ? n2[h2] : void 0, g2;
23177
23177
  T && (g2 = T.substring(T.indexOf("/") + 1));
23178
- let v2 = M2(m({}, l2[p2]), { rid: (w2 = l2[p2]) == null ? void 0 : w2.rid }), E2 = u2[v2.ssrc];
23179
- s2[p2] = M2(m({}, v2), { bitrate: Et("bytesSent", v2, i2 == null ? void 0 : i2[p2]), packetsLost: E2 == null ? void 0 : E2.packetsLost, jitter: E2 == null ? void 0 : E2.jitter, roundTripTime: E2 == null ? void 0 : E2.roundTripTime, totalRoundTripTime: E2 == null ? void 0 : E2.totalRoundTripTime, peerName: t2, peerID: e.peerId, enabled: e.enabled, codec: g2 });
23178
+ let f2 = M2(m({}, l2[p2]), { rid: (w2 = l2[p2]) == null ? void 0 : w2.rid }), P8 = u2[f2.ssrc];
23179
+ s2[p2] = M2(m({}, f2), { bitrate: Pt("bytesSent", f2, i2 == null ? void 0 : i2[p2]), packetsLost: P8 == null ? void 0 : P8.packetsLost, jitter: P8 == null ? void 0 : P8.jitter, roundTripTime: P8 == null ? void 0 : P8.roundTripTime, totalRoundTripTime: P8 == null ? void 0 : P8.totalRoundTripTime, peerName: t2, peerID: e.peerId, enabled: e.enabled, codec: g2 });
23180
23180
  });
23181
23181
  } catch (n2) {
23182
23182
  a11.analytics.publish(y2.rtcStatsFailed(S2.WebrtcErrors.StatsFailed("TRACK", `Error getting local track stats ${e.trackId} - ${n2.message}`))), d2.w("[HMSWebrtcStats]", "Error in getting local track stats", e, n2, n2.name);
@@ -23192,7 +23192,7 @@ var init_dist = __esm({
23192
23192
  } catch (u2) {
23193
23193
  a11.analytics.publish(y2.rtcStatsFailed(S2.WebrtcErrors.StatsFailed("TRACK", `Error getting remote track stats ${e.trackId} - ${u2.message}`))), d2.w("[HMSWebrtcStats]", "Error in getting remote track stats", e, u2);
23194
23194
  }
23195
- let s2 = Eo(r2), o2 = Et("bytesReceived", s2, i2), n2 = Nr("packetsLost", s2, i2);
23195
+ let s2 = Eo(r2), o2 = Pt("bytesReceived", s2, i2), n2 = Nr("packetsLost", s2, i2);
23196
23196
  return s2 != null && s2.remote && Object.assign(s2.remote, { packetsLostRate: Nr("packetsLost", s2.remote, i2 == null ? void 0 : i2.remote) }), s2 && M2(m({}, s2), { bitrate: o2, packetsLostRate: n2, peerID: e.peerId, enabled: e.enabled, peerName: t2, codec: s2.codec });
23197
23197
  });
23198
23198
  Eo = (a11) => {
@@ -23219,7 +23219,7 @@ var init_dist = __esm({
23219
23219
  return r2 && (s2 = r2.substring(r2.indexOf("/") + 1)), e && Object.assign(e, { remote: t2, codec: s2 });
23220
23220
  };
23221
23221
  Or = (a11, e, t2) => {
23222
- let i2 = bo(e), r2 = Et(a11 === "publish" ? "bytesSent" : "bytesReceived", i2, t2 && t2[a11]);
23222
+ let i2 = bo(e), r2 = Pt(a11 === "publish" ? "bytesSent" : "bytesReceived", i2, t2 && t2[a11]);
23223
23223
  return i2 && Object.assign(i2, { bitrate: r2 });
23224
23224
  };
23225
23225
  bo = (a11) => {
@@ -23237,13 +23237,13 @@ var init_dist = __esm({
23237
23237
  }), e;
23238
23238
  };
23239
23239
  js = (a11, e) => Array.from(new Set(a11.concat(e)));
23240
- Et = (a11, e, t2) => Nr(a11, e, t2) * 8;
23240
+ Pt = (a11, e, t2) => Nr(a11, e, t2) * 8;
23241
23241
  Nr = (a11, e, t2) => {
23242
23242
  let i2 = e && e[a11], r2 = t2 ? t2[a11] : null;
23243
23243
  return [e, t2, oe(i2), oe(r2)].every((o2) => !!o2) ? xr(i2, r2, e == null ? void 0 : e.timestamp, t2 == null ? void 0 : t2.timestamp) * 1e3 : 0;
23244
23244
  };
23245
23245
  xr = (a11, e, t2, i2) => oe(a11) && oe(e) && t2 && i2 ? (a11 - e) / (t2 - i2) : 0;
23246
- pi = class {
23246
+ ui = class {
23247
23247
  constructor(e, t2, i2) {
23248
23248
  this.getStats = e;
23249
23249
  this.store = t2;
@@ -23260,7 +23260,7 @@ var init_dist = __esm({
23260
23260
  yield this.updateLocalPeerStats(), yield this.updateLocalTrackStats(), yield this.updateRemoteTrackStats();
23261
23261
  });
23262
23262
  this.updateLocalPeerStats = () => c2(this, null, function* () {
23263
- var p2, h2, T, g2, v2, E2;
23263
+ var p2, h2, T, g2, f2, P8;
23264
23264
  let e2 = this.getLocalPeerStats(), t3;
23265
23265
  try {
23266
23266
  t3 = yield (h2 = (p2 = this.getStats).publish) == null ? void 0 : h2.call(p2);
@@ -23273,7 +23273,7 @@ var init_dist = __esm({
23273
23273
  } catch (k2) {
23274
23274
  this.eventBus.analytics.publish(y2.rtcStatsFailed(S2.WebrtcErrors.StatsFailed("SUBSCRIBE", k2.message))), d2.w(this.TAG, "Error in getting subscribe stats", k2);
23275
23275
  }
23276
- let s2 = r3 && Or("subscribe", r3, e2), { packetsLost: o2, jitter: n2 } = qs(r3), l2 = xr(o2, (v2 = e2 == null ? void 0 : e2.subscribe) == null ? void 0 : v2.packetsLost, s2 == null ? void 0 : s2.timestamp, (E2 = e2 == null ? void 0 : e2.subscribe) == null ? void 0 : E2.timestamp), u2 = s2 && Object.assign(s2, { packetsLostRate: l2, jitter: n2, packetsLost: o2 });
23276
+ let s2 = r3 && Or("subscribe", r3, e2), { packetsLost: o2, jitter: n2 } = qs(r3), l2 = xr(o2, (f2 = e2 == null ? void 0 : e2.subscribe) == null ? void 0 : f2.packetsLost, s2 == null ? void 0 : s2.timestamp, (P8 = e2 == null ? void 0 : e2.subscribe) == null ? void 0 : P8.timestamp), u2 = s2 && Object.assign(s2, { packetsLostRate: l2, jitter: n2, packetsLost: o2 });
23277
23277
  this.peerStats[this.localPeerID] = { publish: i3, subscribe: u2 };
23278
23278
  });
23279
23279
  this.updateRemoteTrackStats = () => c2(this, null, function* () {
@@ -23303,7 +23303,7 @@ var init_dist = __esm({
23303
23303
  this.localPeerID = (r2 = this.store.getLocalPeer()) == null ? void 0 : r2.peerId;
23304
23304
  }
23305
23305
  };
23306
- hi = class {
23306
+ pi = class {
23307
23307
  constructor(e, t2, i2, r2) {
23308
23308
  this.store = e;
23309
23309
  this.eventBus = t2;
@@ -23333,7 +23333,7 @@ var init_dist = __esm({
23333
23333
  }
23334
23334
  setPeerConnections({ publish: e, subscribe: t2 }) {
23335
23335
  var i2, r2;
23336
- this.publishConnection = e, this.subscribeConnection = t2, this.hmsStats = new pi({ publish: (i2 = this.publishConnection) == null ? void 0 : i2.getStats.bind(this.publishConnection), subscribe: (r2 = this.subscribeConnection) == null ? void 0 : r2.getStats.bind(this.subscribeConnection) }, this.store, this.eventBus);
23336
+ this.publishConnection = e, this.subscribeConnection = t2, this.hmsStats = new ui({ publish: (i2 = this.publishConnection) == null ? void 0 : i2.getStats.bind(this.publishConnection), subscribe: (r2 = this.subscribeConnection) == null ? void 0 : r2.getStats.bind(this.subscribeConnection) }, this.store, this.eventBus);
23337
23337
  }
23338
23338
  start() {
23339
23339
  return c2(this, null, function* () {
@@ -23352,7 +23352,7 @@ var init_dist = __esm({
23352
23352
  startLoop() {
23353
23353
  return c2(this, null, function* () {
23354
23354
  for (; this.isMonitored; )
23355
- yield this.handleStatsUpdate(), yield K(this.interval);
23355
+ yield this.handleStatsUpdate(), yield Z2(this.interval);
23356
23356
  });
23357
23357
  }
23358
23358
  cleanup() {
@@ -23424,7 +23424,7 @@ var init_dist = __esm({
23424
23424
  }`;
23425
23425
  }
23426
23426
  };
23427
- bt = class extends it {
23427
+ Et = class extends it {
23428
23428
  constructor(t2) {
23429
23429
  super(M2(m({}, t2), { isLocal: false }));
23430
23430
  this.isLocal = false;
@@ -23433,8 +23433,8 @@ var init_dist = __esm({
23433
23433
  this.fromRoomState = !!t2.fromRoomState;
23434
23434
  }
23435
23435
  };
23436
- he = (a11, e) => new bt({ peerId: a11.peer_id, name: a11.info.name, role: e.getPolicyForRole(a11.role), customerUserId: a11.info.user_id, metadata: a11.info.data, groups: a11.groups, type: a11.info.type });
23437
- mi = class {
23436
+ he = (a11, e) => new Et({ peerId: a11.peer_id, name: a11.info.name, role: e.getPolicyForRole(a11.role), customerUserId: a11.info.user_id, metadata: a11.info.data, groups: a11.groups, type: a11.info.type });
23437
+ hi = class {
23438
23438
  constructor(e, t2, i2) {
23439
23439
  this.transport = e;
23440
23440
  this.store = t2;
@@ -23500,7 +23500,7 @@ var init_dist = __esm({
23500
23500
  });
23501
23501
  }
23502
23502
  };
23503
- De = class extends import_eventemitter2.EventEmitter2 {
23503
+ we = class extends import_eventemitter2.EventEmitter2 {
23504
23504
  on(e, t2) {
23505
23505
  return super.on(e, t2);
23506
23506
  }
@@ -23514,7 +23514,7 @@ var init_dist = __esm({
23514
23514
  return super.listeners(e);
23515
23515
  }
23516
23516
  };
23517
- Si = class extends De {
23517
+ mi = class extends we {
23518
23518
  constructor() {
23519
23519
  super(...arguments);
23520
23520
  this.audioElement = null;
@@ -23566,7 +23566,7 @@ var init_dist = __esm({
23566
23566
  }), this.audioContextManager = new st(t2), t2;
23567
23567
  }
23568
23568
  };
23569
- gi = class extends De {
23569
+ Si = class extends we {
23570
23570
  constructor() {
23571
23571
  super(...arguments);
23572
23572
  this.TAG = "[PlaylistVideoManager]";
@@ -23640,13 +23640,13 @@ var init_dist = __esm({
23640
23640
  this.canvas || (this.canvas = document.createElement("canvas"), this.canvasContext = this.canvas.getContext("2d"));
23641
23641
  }
23642
23642
  };
23643
- Ti = { audio: { list: [], currentIndex: -1, isAutoplayOn: true }, video: { list: [], currentIndex: -1, isAutoplayOn: true } };
23644
- Rt = class extends De {
23643
+ gi = { audio: { list: [], currentIndex: -1, isAutoplayOn: true }, video: { list: [], currentIndex: -1, isAutoplayOn: true } };
23644
+ bt = class extends we {
23645
23645
  constructor(t2, i2) {
23646
23646
  super();
23647
23647
  this.sdk = t2;
23648
23648
  this.eventBus = i2;
23649
- this.state = { audio: m({}, Ti.audio), video: m({}, Ti.video) };
23649
+ this.state = { audio: m({}, gi.audio), video: m({}, gi.video) };
23650
23650
  this.TAG = "[PlaylistManager]";
23651
23651
  this.handlePausePlaylist = (r2) => c2(this, [r2], function* ({ enabled: t3, track: i3 }) {
23652
23652
  var o2;
@@ -23656,12 +23656,12 @@ var init_dist = __esm({
23656
23656
  i3.source === "audioplaylist" && (s2 = "audio"), i3.source === "videoplaylist" && (s2 = "video"), s2 && ((o2 = this.getElement(s2)) == null || o2.pause());
23657
23657
  });
23658
23658
  this.addTrack = (t3, i3) => c2(this, null, function* () {
23659
- yield this.sdk.addTrack(t3, i3), d2.d(this.TAG, "Playlist track added", si(t3));
23659
+ yield this.sdk.addTrack(t3, i3), d2.d(this.TAG, "Playlist track added", ri(t3));
23660
23660
  });
23661
23661
  this.removeTrack = (t3) => c2(this, null, function* () {
23662
23662
  yield this.sdk.removeTrack(t3, true), d2.d(this.TAG, "Playlist track removed", t3);
23663
23663
  });
23664
- this.audioManager = new Si(), this.videoManager = new gi(), this.addListeners();
23664
+ this.audioManager = new mi(), this.videoManager = new Si(), this.addListeners();
23665
23665
  }
23666
23666
  getList(t2 = "audio") {
23667
23667
  return this.state[t2].list;
@@ -23784,7 +23784,7 @@ var init_dist = __esm({
23784
23784
  });
23785
23785
  }
23786
23786
  cleanup() {
23787
- this.state = { audio: m({}, Ti.audio), video: m({}, Ti.video) }, this.eventBus.localAudioEnabled.unsubscribe(this.handlePausePlaylist), this.eventBus.localVideoEnabled.unsubscribe(this.handlePausePlaylist), this.audioManager.stop(), this.videoManager.stop();
23787
+ this.state = { audio: m({}, gi.audio), video: m({}, gi.video) }, this.eventBus.localAudioEnabled.unsubscribe(this.handlePausePlaylist), this.eventBus.localVideoEnabled.unsubscribe(this.handlePausePlaylist), this.audioManager.stop(), this.videoManager.stop();
23788
23788
  }
23789
23789
  onProgress(t2) {
23790
23790
  this.videoManager.on("progress", () => {
@@ -23862,34 +23862,34 @@ var init_dist = __esm({
23862
23862
  }
23863
23863
  };
23864
23864
  B2 = (a11) => a11.room;
23865
- Io = (a11) => a11.errors;
23866
- Wh = createSelector(Io, (a11) => a11.length === 0 ? null : a11.at(-1));
23865
+ Ao = (a11) => a11.errors;
23866
+ Wh = createSelector(Ao, (a11) => a11.length === 0 ? null : a11.at(-1));
23867
23867
  $h = createSelector(B2, (a11) => a11.id);
23868
- q2 = (a11) => a11.peers;
23869
- fi = (a11) => a11.messages.byID;
23868
+ K = (a11) => a11.peers;
23869
+ Ti = (a11) => a11.messages.byID;
23870
23870
  Js = (a11) => a11.messages.allIDs;
23871
23871
  N2 = (a11) => a11.tracks;
23872
23872
  Qs = (a11) => a11.settings;
23873
23873
  Ur = (a11) => a11.appData;
23874
23874
  Ho = (a11) => a11.speakers;
23875
- we = createSelector([B2], (a11) => a11 && a11.isConnected);
23876
- jh = createSelector([we, B2], (a11, e) => a11 ? e.peerCount !== void 0 ? e.peerCount || 1 : e.peers.length : Math.max(e.peerCount !== void 0 ? e.peerCount : e.peers.length - 1, 0));
23875
+ _e = createSelector([B2], (a11) => a11 && a11.isConnected);
23876
+ jh = createSelector([_e, B2], (a11, e) => a11 ? e.peerCount !== void 0 ? e.peerCount || 1 : e.peers.length : Math.max(e.peerCount !== void 0 ? e.peerCount : e.peers.length - 1, 0));
23877
23877
  Co = (a11) => a11.hideLocalPeer;
23878
- me = createSelector([B2, q2, Co], (a11, e, t2) => t2 ? a11.peers.filter((i2) => a11.localPeer !== i2).map((i2) => e[i2]) : a11.peers.map((i2) => e[i2]));
23878
+ me = createSelector([B2, K, Co], (a11, e, t2) => t2 ? a11.peers.filter((i2) => a11.localPeer !== i2).map((i2) => e[i2]) : a11.peers.map((i2) => e[i2]));
23879
23879
  Lo = createSelector(N2, (a11) => Object.values(a11));
23880
- te = createSelector(B2, q2, (a11, e) => e[a11.localPeer]);
23880
+ te = createSelector(B2, K, (a11, e) => e[a11.localPeer]);
23881
23881
  ye = createSelector(B2, (a11) => a11.localPeer);
23882
23882
  Jh = createSelector(te, (a11) => a11 == null ? void 0 : a11.name);
23883
23883
  Qh = createSelector(te, (a11) => a11 == null ? void 0 : a11.roleName);
23884
23884
  ae = createSelector(te, (a11) => a11 == null ? void 0 : a11.audioTrack);
23885
- X2 = createSelector(te, (a11) => a11 == null ? void 0 : a11.videoTrack);
23885
+ Y2 = createSelector(te, (a11) => a11 == null ? void 0 : a11.videoTrack);
23886
23886
  Do = createSelector(te, (a11) => a11 == null ? void 0 : a11.auxiliaryTracks);
23887
- zs = createSelector([ae, X2, Do], (a11, e, t2) => {
23887
+ zs = createSelector([ae, Y2, Do], (a11, e, t2) => {
23888
23888
  let i2 = t2 ? [...t2] : [];
23889
23889
  return a11 && i2.unshift(a11), e && i2.unshift(e), i2;
23890
23890
  });
23891
23891
  zh = createSelector(me, (a11) => a11.filter((e) => !e.isLocal));
23892
- Yh = createSelector(q2, Ho, (a11, e) => {
23892
+ Yh = createSelector(K, Ho, (a11, e) => {
23893
23893
  let t2 = Object.entries(e).sort((i2, r2) => {
23894
23894
  var n2, l2;
23895
23895
  let s2 = ((n2 = i2[1]) == null ? void 0 : n2.audioLevel) || 0;
@@ -23904,7 +23904,7 @@ var init_dist = __esm({
23904
23904
  });
23905
23905
  Br = (a11) => {
23906
23906
  let e = te(a11);
23907
- return qe(a11, e == null ? void 0 : e.videoTrack);
23907
+ return je(a11, e == null ? void 0 : e.videoTrack);
23908
23908
  };
23909
23909
  Ys = (a11) => {
23910
23910
  let e = te(a11);
@@ -23914,7 +23914,7 @@ var init_dist = __esm({
23914
23914
  let { video: t2, audio: i2 } = xe(e, a11);
23915
23915
  return !!(t2 || i2);
23916
23916
  });
23917
- wo = createSelector(q2, N2, (a11, e) => {
23917
+ wo = createSelector(K, N2, (a11, e) => {
23918
23918
  let t2;
23919
23919
  for (let i2 in a11) {
23920
23920
  let r2 = a11[i2], { video: s2, audio: o2 } = xe(e, r2);
@@ -23925,14 +23925,14 @@ var init_dist = __esm({
23925
23925
  return t2;
23926
23926
  });
23927
23927
  Zh = createSelector(wo, (a11) => !!a11);
23928
- em = createSelector(q2, N2, (a11, e) => {
23928
+ em = createSelector(K, N2, (a11, e) => {
23929
23929
  for (let t2 in a11) {
23930
23930
  let i2 = a11[t2], { audio: r2, video: s2 } = xe(e, i2);
23931
23931
  if (!s2 && r2)
23932
23932
  return i2;
23933
23933
  }
23934
23934
  });
23935
- tm = createSelector(q2, N2, (a11, e) => {
23935
+ tm = createSelector(K, N2, (a11, e) => {
23936
23936
  let t2 = [], i2 = [];
23937
23937
  for (let r2 in a11) {
23938
23938
  let s2 = a11[r2], { video: o2, audio: n2 } = xe(e, s2);
@@ -23940,30 +23940,30 @@ var init_dist = __esm({
23940
23940
  }
23941
23941
  return t2.concat(i2);
23942
23942
  });
23943
- im = createSelector(q2, N2, (a11, e) => {
23943
+ im = createSelector(K, N2, (a11, e) => {
23944
23944
  for (let t2 in e) {
23945
23945
  let i2 = e[t2];
23946
- if (mt(i2) && ht(i2) && i2.peerId)
23946
+ if (ht(i2) && pt(i2) && i2.peerId)
23947
23947
  return a11[i2.peerId];
23948
23948
  }
23949
23949
  });
23950
- rm = createSelector(q2, N2, (a11, e) => {
23950
+ rm = createSelector(K, N2, (a11, e) => {
23951
23951
  for (let t2 in e) {
23952
23952
  let i2 = e[t2];
23953
- if (ri(i2) && i2.peerId)
23953
+ if (ii(i2) && i2.peerId)
23954
23954
  return a11[i2.peerId];
23955
23955
  }
23956
23956
  });
23957
23957
  sm = createSelector(Lo, (a11) => a11.filter(os));
23958
23958
  am = createSelector(Js, (a11) => a11.length);
23959
- om = createSelector(fi, (a11) => Object.values(a11).filter((e) => !e.read).length);
23960
- At = createSelector(Js, fi, (a11, e) => {
23959
+ om = createSelector(Ti, (a11) => Object.values(a11).filter((e) => !e.read).length);
23960
+ Rt = createSelector(Js, Ti, (a11, e) => {
23961
23961
  let t2 = [];
23962
23962
  return a11.forEach((i2) => {
23963
23963
  t2.push(e[i2]);
23964
23964
  }), t2;
23965
23965
  });
23966
- _o = createSelector(At, (a11) => a11.filter((e) => {
23966
+ _o = createSelector(Rt, (a11) => a11.filter((e) => {
23967
23967
  var t2;
23968
23968
  return !e.recipientPeer && !(e.recipientRoles && ((t2 = e.recipientRoles) == null ? void 0 : t2.length) > 0);
23969
23969
  }));
@@ -24079,125 +24079,125 @@ var init_dist = __esm({
24079
24079
  };
24080
24080
  b2.level = 0;
24081
24081
  Gr = (a11, e) => e;
24082
- Ht = (a11, e) => e;
24082
+ At = (a11, e) => e;
24083
24083
  pa = (a11, e) => e;
24084
24084
  xo = (a11, e) => e;
24085
24085
  Uo = (a11, e) => e;
24086
- j2 = createSelector([q2, Gr], (a11, e) => e ? a11[e] : null);
24087
- Wr = createSelector([N2, Ht], (a11, e) => e ? a11[e] : null);
24088
- Bo = createSelector([N2, Ht], (a11, e) => {
24086
+ q2 = createSelector([K, Gr], (a11, e) => e ? a11[e] : null);
24087
+ Wr = createSelector([N2, At], (a11, e) => e ? a11[e] : null);
24088
+ Bo = createSelector([N2, At], (a11, e) => {
24089
24089
  if (!e)
24090
24090
  return null;
24091
24091
  let t2 = a11[e];
24092
24092
  return (t2 == null ? void 0 : t2.type) === "video" ? t2 : null;
24093
24093
  });
24094
- Vo = createSelector([N2, Ht], (a11, e) => {
24094
+ Vo = createSelector([N2, At], (a11, e) => {
24095
24095
  if (!e)
24096
24096
  return null;
24097
24097
  let t2 = a11[e];
24098
24098
  return (t2 == null ? void 0 : t2.type) === "audio" ? t2 : null;
24099
24099
  });
24100
- Fo = createSelector([N2, Ht], (a11, e) => {
24100
+ Fo = createSelector([N2, At], (a11, e) => {
24101
24101
  if (!e)
24102
24102
  return null;
24103
24103
  let t2 = a11[e];
24104
24104
  return (t2 == null ? void 0 : t2.type) === "audio" && (t2 == null ? void 0 : t2.source) === "screen" ? t2 : null;
24105
24105
  });
24106
- Go = createSelector([N2, Ht], (a11, e) => {
24106
+ Go = createSelector([N2, At], (a11, e) => {
24107
24107
  if (!e)
24108
24108
  return null;
24109
24109
  let t2 = a11[e];
24110
24110
  return (t2 == null ? void 0 : t2.type) === "video" && (t2 == null ? void 0 : t2.source) === "screen" ? t2 : null;
24111
24111
  });
24112
24112
  Wo = createSelector([ta, Uo], (a11, e) => e ? a11[e] : null);
24113
- Z2 = I2(j2);
24114
- Om = I2(createSelector([Ur, xo], (a11, e) => {
24113
+ X2 = A2(q2);
24114
+ Om = A2(createSelector([Ur, xo], (a11, e) => {
24115
24115
  if (a11)
24116
24116
  return e ? a11[e] : a11;
24117
24117
  }));
24118
- Bm = I2(createSelector(j2, (a11) => a11 == null ? void 0 : a11.name));
24119
- Vm = I2(createSelector(j2, (a11) => a11 == null ? void 0 : a11.type));
24120
- vi = I2(Wr);
24121
- ha = I2(Bo);
24122
- Fm = I2(Vo);
24123
- Gm = I2(Fo);
24124
- Wm = I2(Go);
24125
- $o = I2((a11, e) => {
24126
- let t2 = j2(a11, e);
24118
+ Bm = A2(createSelector(q2, (a11) => a11 == null ? void 0 : a11.name));
24119
+ Vm = A2(createSelector(q2, (a11) => a11 == null ? void 0 : a11.type));
24120
+ fi = A2(Wr);
24121
+ ha = A2(Bo);
24122
+ Fm = A2(Vo);
24123
+ Gm = A2(Fo);
24124
+ Wm = A2(Go);
24125
+ $o = A2((a11, e) => {
24126
+ let t2 = q2(a11, e);
24127
24127
  if (t2 && t2.videoTrack && t2.videoTrack !== "")
24128
24128
  return a11.tracks[t2.videoTrack];
24129
24129
  });
24130
- Ko = I2((a11, e) => {
24131
- let t2 = j2(a11, e);
24130
+ Ko = A2((a11, e) => {
24131
+ let t2 = q2(a11, e);
24132
24132
  if (t2 && t2.audioTrack && t2.audioTrack !== "")
24133
24133
  return a11.tracks[t2.audioTrack];
24134
24134
  });
24135
- Km = I2((a11, e) => {
24136
- let t2 = j2(a11, e);
24135
+ Km = A2((a11, e) => {
24136
+ let t2 = q2(a11, e);
24137
24137
  return (t2 == null ? void 0 : t2.auxiliaryTracks.map((i2) => a11.tracks[i2])) || [];
24138
24138
  });
24139
24139
  ma = (a11, e) => e ? a11.speakers[e] : null;
24140
- qm = I2(createSelector(ma, (a11) => (a11 == null ? void 0 : a11.audioLevel) || 0));
24140
+ qm = A2(createSelector(ma, (a11) => (a11 == null ? void 0 : a11.audioLevel) || 0));
24141
24141
  qo = (a11, e) => {
24142
24142
  let t2 = Ko(e)(a11);
24143
24143
  return ma(a11, t2 == null ? void 0 : t2.id);
24144
24144
  };
24145
- jm = I2(createSelector(qo, (a11) => (a11 == null ? void 0 : a11.audioLevel) || 0));
24146
- Jm = I2((a11, e) => {
24145
+ jm = A2(createSelector(qo, (a11) => (a11 == null ? void 0 : a11.audioLevel) || 0));
24146
+ Jm = A2((a11, e) => {
24147
24147
  if (e)
24148
24148
  return a11.connectionQualities[e];
24149
24149
  });
24150
- Qm = I2((a11, e) => {
24151
- let t2 = j2(a11, e);
24150
+ Qm = A2((a11, e) => {
24151
+ let t2 = q2(a11, e);
24152
24152
  if (t2) {
24153
- let i2 = t2 == null ? void 0 : t2.auxiliaryTracks.find((r2) => pt(a11.tracks[r2]));
24153
+ let i2 = t2 == null ? void 0 : t2.auxiliaryTracks.find((r2) => ut(a11.tracks[r2]));
24154
24154
  return i2 ? a11.tracks[i2] : void 0;
24155
24155
  }
24156
24156
  });
24157
- zm = I2(createSelector(N2, j2, (a11, e) => {
24157
+ zm = A2(createSelector(N2, q2, (a11, e) => {
24158
24158
  let t2 = e == null ? void 0 : e.auxiliaryTracks.find((i2) => {
24159
24159
  let r2 = a11[i2];
24160
- return mt(r2) && ht(r2);
24160
+ return ht(r2) && pt(r2);
24161
24161
  });
24162
24162
  return t2 ? a11[t2] : void 0;
24163
24163
  }));
24164
- Ym = I2(createSelector(N2, j2, (a11, e) => {
24164
+ Ym = A2(createSelector(N2, q2, (a11, e) => {
24165
24165
  let t2 = e == null ? void 0 : e.auxiliaryTracks.find((i2) => {
24166
24166
  let r2 = a11[i2];
24167
- return mt(r2) && pt(r2);
24167
+ return ht(r2) && ut(r2);
24168
24168
  });
24169
24169
  return t2 ? a11[t2] : void 0;
24170
24170
  }));
24171
- Xm = I2(createSelector(N2, j2, (a11, e) => {
24171
+ Xm = A2(createSelector(N2, q2, (a11, e) => {
24172
24172
  let t2 = e == null ? void 0 : e.auxiliaryTracks.find((i2) => {
24173
24173
  let r2 = a11[i2];
24174
- return ri(r2) && pt(r2);
24174
+ return ii(r2) && ut(r2);
24175
24175
  });
24176
24176
  return t2 ? a11[t2] : void 0;
24177
24177
  }));
24178
- Sa = I2(createSelector(N2, j2, (a11, e) => xe(a11, e)));
24178
+ Sa = A2(createSelector(N2, q2, (a11, e) => xe(a11, e)));
24179
24179
  ga = (a11) => createSelector(Sa(a11), (e) => e.audio);
24180
- eS = I2((a11, e) => {
24181
- let t2 = j2(a11, e);
24182
- return qe(a11, t2 == null ? void 0 : t2.audioTrack);
24180
+ eS = A2((a11, e) => {
24181
+ let t2 = q2(a11, e);
24182
+ return je(a11, t2 == null ? void 0 : t2.audioTrack);
24183
24183
  });
24184
- tS = I2((a11, e) => {
24185
- let t2 = j2(a11, e);
24186
- return qe(a11, t2 == null ? void 0 : t2.videoTrack);
24184
+ tS = A2((a11, e) => {
24185
+ let t2 = q2(a11, e);
24186
+ return je(a11, t2 == null ? void 0 : t2.videoTrack);
24187
24187
  });
24188
- Ta = I2((a11, e) => {
24188
+ Ta = A2((a11, e) => {
24189
24189
  if (e && a11.tracks[e])
24190
24190
  return a11.tracks[e].volume === 0;
24191
24191
  });
24192
- iS = I2((a11, e) => {
24193
- let t2 = j2(a11, e);
24192
+ iS = A2((a11, e) => {
24193
+ let t2 = q2(a11, e);
24194
24194
  return Ta(t2 == null ? void 0 : t2.audioTrack)(a11);
24195
24195
  });
24196
- rS = I2((a11, e) => {
24196
+ rS = A2((a11, e) => {
24197
24197
  let t2 = ga(e)(a11);
24198
24198
  return Ta(t2 == null ? void 0 : t2.id)(a11);
24199
24199
  });
24200
- fa = I2((a11, e) => {
24200
+ fa = A2((a11, e) => {
24201
24201
  let t2 = Wr(a11, e);
24202
24202
  if (t2) {
24203
24203
  if (t2.type !== "audio") {
@@ -24207,15 +24207,15 @@ var init_dist = __esm({
24207
24207
  return t2.volume;
24208
24208
  }
24209
24209
  });
24210
- sS = I2((a11, e) => {
24211
- let t2 = j2(a11, e);
24210
+ sS = A2((a11, e) => {
24211
+ let t2 = q2(a11, e);
24212
24212
  return fa(t2 == null ? void 0 : t2.audioTrack)(a11);
24213
24213
  });
24214
- aS = I2((a11, e) => {
24214
+ aS = A2((a11, e) => {
24215
24215
  let t2 = ga(e)(a11);
24216
24216
  return fa(t2 == null ? void 0 : t2.id)(a11);
24217
24217
  });
24218
- oS = I2((a11, e) => {
24218
+ oS = A2((a11, e) => {
24219
24219
  let t2 = Wr(a11, e);
24220
24220
  if (t2) {
24221
24221
  if (t2.type !== "video") {
@@ -24225,41 +24225,41 @@ var init_dist = __esm({
24225
24225
  return t2.layer;
24226
24226
  }
24227
24227
  });
24228
- va = createSelector([At, ye, Gr], (a11, e, t2) => {
24228
+ va = createSelector([Rt, ye, Gr], (a11, e, t2) => {
24229
24229
  if (t2)
24230
24230
  return a11.filter((i2) => {
24231
24231
  var r2;
24232
24232
  return !i2.recipientPeer && !((r2 = i2.recipientRoles) != null && r2.length) || i2.sender && ![e, t2].includes(i2.sender) ? false : [e, t2].includes(i2.recipientPeer);
24233
24233
  });
24234
24234
  });
24235
- Ma = createSelector([At, pa], (a11, e) => {
24235
+ Ma = createSelector([Rt, pa], (a11, e) => {
24236
24236
  if (e)
24237
24237
  return a11.filter((t2) => {
24238
24238
  var i2, r2;
24239
24239
  return (i2 = t2.recipientRoles) != null && i2.length ? (r2 = t2.recipientRoles) == null ? void 0 : r2.includes(e) : false;
24240
24240
  });
24241
24241
  });
24242
- jo = createSelector(At, (a11) => a11.filter((e) => {
24242
+ jo = createSelector(Rt, (a11) => a11.filter((e) => {
24243
24243
  var t2;
24244
24244
  return !e.recipientPeer && !((t2 = e.recipientRoles) != null && t2.length);
24245
24245
  }));
24246
24246
  Jo = createSelector([Ma, pa], (a11) => a11 ? a11.filter((e) => !e.read).length : 0);
24247
24247
  Qo = createSelector([va, Gr], (a11) => a11 ? a11.filter((e) => !e.read).length : 0);
24248
24248
  nS = createSelector(jo, (a11) => a11.filter((e) => !e.read).length);
24249
- cS = I2(va);
24250
- dS = I2(Ma);
24251
- lS = I2(Jo);
24252
- uS = I2(Qo);
24253
- ya = I2(Wo);
24254
- PS = createSelector([q2, N2], (a11, e) => Object.values(a11).map((i2) => {
24249
+ cS = A2(va);
24250
+ dS = A2(Ma);
24251
+ lS = A2(Jo);
24252
+ uS = A2(Qo);
24253
+ ya = A2(Wo);
24254
+ PS = createSelector([K, N2], (a11, e) => Object.values(a11).map((i2) => {
24255
24255
  var r2;
24256
24256
  return { peer: i2, isAudioEnabled: i2.audioTrack ? (r2 = e[i2.audioTrack]) == null ? void 0 : r2.enabled : false };
24257
24257
  }));
24258
24258
  zo = (a11) => a11.roleChangeRequests[0] || null;
24259
- ES = createSelector([zo, q2, Se], (a11, e, t2) => a11 ? { requestedBy: a11.requestedBy ? e[a11.requestedBy] : void 0, role: t2[a11.roleName], token: a11.token } : null);
24260
- bS = createSelector([at], (a11) => St(a11));
24261
- RS = createSelector([Zs], (a11) => St(a11));
24262
- Xo = createSelector([X2, N2], (a11, e) => {
24259
+ ES = createSelector([zo, K, Se], (a11, e, t2) => a11 ? { requestedBy: a11.requestedBy ? e[a11.requestedBy] : void 0, role: t2[a11.roleName], token: a11.token } : null);
24260
+ bS = createSelector([at], (a11) => mt(a11));
24261
+ RS = createSelector([Zs], (a11) => mt(a11));
24262
+ Xo = createSelector([Y2, N2], (a11, e) => {
24263
24263
  let t2 = null;
24264
24264
  return a11 && (t2 = e[a11]), (t2 == null ? void 0 : t2.plugins) || [];
24265
24265
  });
@@ -24267,12 +24267,12 @@ var init_dist = __esm({
24267
24267
  let t2 = null;
24268
24268
  return a11 && (t2 = e[a11]), (t2 == null ? void 0 : t2.plugins) || [];
24269
24269
  });
24270
- yi = { 0: "PEER_JOINED", 1: "PEER_LEFT", 8: "ROLE_UPDATED", 10: "NAME_UPDATED", 11: "METADATA_UPDATED", 12: "HAND_RAISE_CHANGED" };
24271
- Ct = { 0: "TRACK_ADDED", 1: "TRACK_REMOVED", 2: "TRACK_MUTED", 3: "TRACK_UNMUTED", 5: "TRACK_DEGRADED", 6: "TRACK_RESTORED", 4: "TRACK_DESCRIPTION_CHANGED" };
24272
- ki = { 0: "POLL_CREATED", 1: "POLL_STARTED", 2: "POLL_STOPPED", 4: "POLL_VOTES_UPDATED", 3: "POLLS_LIST" };
24270
+ Mi = { 0: "PEER_JOINED", 1: "PEER_LEFT", 8: "ROLE_UPDATED", 10: "NAME_UPDATED", 11: "METADATA_UPDATED", 12: "HAND_RAISE_CHANGED" };
24271
+ Ht = { 0: "TRACK_ADDED", 1: "TRACK_REMOVED", 2: "TRACK_MUTED", 3: "TRACK_UNMUTED", 5: "TRACK_DEGRADED", 6: "TRACK_RESTORED", 4: "TRACK_DESCRIPTION_CHANGED" };
24272
+ yi = { 0: "POLL_CREATED", 1: "POLL_STARTED", 2: "POLL_STOPPED", 4: "POLL_VOTES_UPDATED", 3: "POLLS_LIST" };
24273
24273
  ka = { TRANSCRIPTION_STATE_UPDATED: "TRANSCRIPTION_STATE_UPDATED" };
24274
24274
  $r = "hmsNotification";
24275
- Pi = class {
24275
+ ki = class {
24276
24276
  constructor(e) {
24277
24277
  this.id = 0;
24278
24278
  this.onNotification = (e2, t2) => {
@@ -24311,14 +24311,14 @@ var init_dist = __esm({
24311
24311
  this.emitEvent(t2);
24312
24312
  }
24313
24313
  sendPeerUpdate(e, t2) {
24314
- let i2 = this.store.getState(Z2(t2 == null ? void 0 : t2.id)) || t2, r2 = yi[e];
24314
+ let i2 = this.store.getState(X2(t2 == null ? void 0 : t2.id)) || t2, r2 = Mi[e];
24315
24315
  if (r2 && i2) {
24316
24316
  let s2 = this.createNotification(r2, i2, "info");
24317
24317
  this.emitEvent(s2);
24318
24318
  }
24319
24319
  }
24320
24320
  sendTrackUpdate(e, t2) {
24321
- let i2 = this.store.getState(vi(t2)), r2 = Ct[e];
24321
+ let i2 = this.store.getState(fi(t2)), r2 = Ht[e];
24322
24322
  if (r2) {
24323
24323
  let s2 = this.createNotification(r2, i2, "info");
24324
24324
  this.emitEvent(s2);
@@ -24349,7 +24349,7 @@ var init_dist = __esm({
24349
24349
  this.emitEvent(t2);
24350
24350
  }
24351
24351
  sendPollUpdate(e, t2) {
24352
- let i2 = ki[e], r2 = this.store.getState(ya(t2));
24352
+ let i2 = yi[e], r2 = this.store.getState(ya(t2));
24353
24353
  if (i2) {
24354
24354
  let s2 = this.createNotification(i2, r2, "info");
24355
24355
  this.emitEvent(s2);
@@ -24366,7 +24366,7 @@ var init_dist = __esm({
24366
24366
  return this.id++, { id: this.id, type: e, message: r2, data: t2, severity: i2 };
24367
24367
  }
24368
24368
  };
24369
- Ei = class {
24369
+ Pi = class {
24370
24370
  constructor(e) {
24371
24371
  this.queuedUpdates = {};
24372
24372
  this.timers = {};
@@ -24394,35 +24394,35 @@ var init_dist = __esm({
24394
24394
  }
24395
24395
  };
24396
24396
  Ea = (a11, e) => {
24397
- let t2 = Lt(Object.keys(a11), Object.keys(e));
24397
+ let t2 = Ct(Object.keys(a11), Object.keys(e));
24398
24398
  for (let i2 of t2) {
24399
24399
  let r2 = a11[i2], s2 = e[i2];
24400
- $e(r2, s2) ? (re(r2.auxiliaryTracks, s2.auxiliaryTracks) && (s2.auxiliaryTracks = r2.auxiliaryTracks), r2.groups && re(r2.groups, s2.groups) && (s2.groups = r2.groups), Object.assign(r2, s2)) : jr(r2, s2) ? delete a11[i2] : bi(r2, s2) && (a11[i2] = s2);
24400
+ $e(r2, s2) ? (re(r2.auxiliaryTracks, s2.auxiliaryTracks) && (s2.auxiliaryTracks = r2.auxiliaryTracks), r2.groups && re(r2.groups, s2.groups) && (s2.groups = r2.groups), Object.assign(r2, s2)) : jr(r2, s2) ? delete a11[i2] : Ei(r2, s2) && (a11[i2] = s2);
24401
24401
  }
24402
24402
  };
24403
24403
  ba = (a11, e) => {
24404
- let t2 = Lt(Object.keys(a11), Object.keys(e));
24404
+ let t2 = Ct(Object.keys(a11), Object.keys(e));
24405
24405
  for (let i2 of t2) {
24406
24406
  let r2 = a11[i2], s2 = e[i2];
24407
- $e(r2, s2) ? (qr(r2, s2), Object.assign(r2, s2)) : jr(r2, s2) ? delete a11[i2] : bi(r2, s2) && (a11[i2] = s2);
24407
+ $e(r2, s2) ? (qr(r2, s2), Object.assign(r2, s2)) : jr(r2, s2) ? delete a11[i2] : Ei(r2, s2) && (a11[i2] = s2);
24408
24408
  }
24409
24409
  };
24410
24410
  Ra = (a11, e) => {
24411
- let t2 = Lt(Object.keys(a11), Object.keys(e));
24411
+ let t2 = Ct(Object.keys(a11), Object.keys(e));
24412
24412
  for (let i2 of t2) {
24413
24413
  let r2 = a11[i2], s2 = e[i2];
24414
- $e(r2, s2) ? (r2.questions && re(r2.questions, s2.questions) && (s2.questions = r2.questions), Object.assign(r2, s2)) : bi(r2, s2) && (a11[i2] = s2);
24414
+ $e(r2, s2) ? (r2.questions && re(r2.questions, s2.questions) && (s2.questions = r2.questions), Object.assign(r2, s2)) : Ei(r2, s2) && (a11[i2] = s2);
24415
24415
  }
24416
24416
  };
24417
24417
  Kr = (a11, e) => {
24418
- let t2 = Lt(Object.keys(a11), Object.keys(e));
24418
+ let t2 = Ct(Object.keys(a11), Object.keys(e));
24419
24419
  for (let i2 of t2) {
24420
24420
  let r2 = a11[i2], s2 = e[i2];
24421
- $e(r2, s2) ? Object.assign(r2, s2) : jr(r2, s2) ? delete a11[i2] : bi(r2, s2) && (a11[i2] = s2);
24421
+ $e(r2, s2) ? Object.assign(r2, s2) : jr(r2, s2) ? delete a11[i2] : Ei(r2, s2) && (a11[i2] = s2);
24422
24422
  }
24423
24423
  };
24424
- Aa = (a11, e, t2) => {
24425
- let i2 = t2.reduce((s2, o2) => (s2[o2.firstTrackId] = Object.values(e[o2.getTrackIDBeingSent()] || {}).sort((n2, l2) => !n2.rid || !l2.rid ? 0 : n2.rid < l2.rid ? -1 : 1), s2), {}), r2 = Lt(Object.keys(a11), Object.keys(i2));
24424
+ Ia = (a11, e, t2) => {
24425
+ let i2 = t2.reduce((s2, o2) => (s2[o2.firstTrackId] = Object.values(e[o2.getTrackIDBeingSent()] || {}).sort((n2, l2) => !n2.rid || !l2.rid ? 0 : n2.rid < l2.rid ? -1 : 1), s2), {}), r2 = Ct(Object.keys(a11), Object.keys(i2));
24426
24426
  for (let s2 of r2) {
24427
24427
  if (!i2[s2]) {
24428
24428
  delete a11[s2];
@@ -24436,7 +24436,7 @@ var init_dist = __esm({
24436
24436
  };
24437
24437
  $e = (a11, e) => a11 && e;
24438
24438
  jr = (a11, e) => a11 && !e;
24439
- bi = (a11, e) => !a11 && e;
24439
+ Ei = (a11, e) => !a11 && e;
24440
24440
  re = (a11, e) => {
24441
24441
  if (a11 === e || a11.length === 0 && (e == null ? void 0 : e.length) === 0)
24442
24442
  return true;
@@ -24447,7 +24447,7 @@ var init_dist = __esm({
24447
24447
  return false;
24448
24448
  return true;
24449
24449
  };
24450
- Lt = (a11, e) => {
24450
+ Ct = (a11, e) => {
24451
24451
  let t2 = /* @__PURE__ */ new Set();
24452
24452
  for (let i2 of a11)
24453
24453
  t2.add(i2);
@@ -24532,7 +24532,7 @@ var init_dist = __esm({
24532
24532
  return { recording: { browser: m({ running: false }, e == null ? void 0 : e.browser), server: m({ running: false }, e == null ? void 0 : e.server), hls: m({ running: false }, e == null ? void 0 : e.hls) }, rtmp: m({ running: false }, t2), hls: { variants: ((s2 = i2 == null ? void 0 : i2.variants) == null ? void 0 : s2.map((o2) => o2)) || [], running: !!(i2 != null && i2.running), error: i2 == null ? void 0 : i2.error }, transcriptions: r2 || [] };
24533
24533
  }
24534
24534
  };
24535
- Dt = class {
24535
+ Lt = class {
24536
24536
  constructor(e, t2, i2, r2) {
24537
24537
  this.playlistManager = e;
24538
24538
  this.syncPlaylistState = i2;
@@ -24603,7 +24603,7 @@ var init_dist = __esm({
24603
24603
  });
24604
24604
  }
24605
24605
  };
24606
- Ri = class {
24606
+ bi = class {
24607
24607
  constructor(e, t2) {
24608
24608
  this.sdk = e;
24609
24609
  this.setLocally = t2;
@@ -24630,7 +24630,7 @@ var init_dist = __esm({
24630
24630
  });
24631
24631
  }
24632
24632
  };
24633
- Ai = class {
24633
+ Ri = class {
24634
24634
  constructor(e, t2) {
24635
24635
  this.intervalMs = 100, this.shouldMonitor = false, this.hasStarted = false, this.unsubs = [], this.analysers = {}, this.store = e, this.actions = t2;
24636
24636
  }
@@ -24639,9 +24639,9 @@ var init_dist = __esm({
24639
24639
  if (this.hasStarted)
24640
24640
  return;
24641
24641
  this.hasStarted = true, b2.d("starting audio level monitor for remote peers", this.store);
24642
- let e = this.store.getState(we);
24642
+ let e = this.store.getState(_e);
24643
24643
  b2.d("starting audio levels is connected to room", e), e && (yield this.monitorAudioLevels());
24644
- let t2 = this.store.subscribe(this.monitorAudioLevels.bind(this), we);
24644
+ let t2 = this.store.subscribe(this.monitorAudioLevels.bind(this), _e);
24645
24645
  this.unsubs.push(t2);
24646
24646
  });
24647
24647
  }
@@ -24652,7 +24652,7 @@ var init_dist = __esm({
24652
24652
  }
24653
24653
  monitorAudioLevels() {
24654
24654
  return c2(this, null, function* () {
24655
- if (!this.store.getState(we)) {
24655
+ if (!this.store.getState(_e)) {
24656
24656
  this.shouldMonitor && (b2.i("room no longer connected, stopping audio level monitoring for remote"), this.shouldMonitor = false);
24657
24657
  return;
24658
24658
  }
@@ -24706,7 +24706,7 @@ var init_dist = __esm({
24706
24706
  return Math.ceil(Math.min(Math.max(s2 * 100, 0), 100));
24707
24707
  }
24708
24708
  };
24709
- Ia = 2e4;
24709
+ Aa = 2e4;
24710
24710
  Ha = 1e4;
24711
24711
  ot = { name: "diagnostics-role", priority: 1, publishParams: { allowed: ["audio", "video"], audio: { bitRate: 32, codec: "opus" }, video: { bitRate: 100, codec: "vp8", frameRate: 30, height: 720, width: 1280 }, screen: { bitRate: 100, codec: "vp8", frameRate: 10, height: 1080, width: 1920 } }, subscribeParams: { subscribeToRoles: [], maxSubsBitRate: 3200 }, permissions: { browserRecording: false, changeRole: false, endRoom: false, hlsStreaming: false, mute: false, pollRead: false, pollWrite: false, removeOthers: false, rtmpStreaming: false, unmute: false } };
24712
24712
  Ca = "https://100ms.live/test-audio.wav";
@@ -24732,11 +24732,11 @@ var init_dist = __esm({
24732
24732
  };
24733
24733
  tn2 = (a11) => !!a11 && !isNaN(a11);
24734
24734
  de = (a11) => a11[a11.length - 1];
24735
- _e = (a11, e) => {
24735
+ Ne = (a11, e) => {
24736
24736
  let t2 = a11.filter((i2) => tn2(e(i2)));
24737
24737
  return t2.reduce((i2, r2) => i2 + (e(r2) || 0), 0) / t2.length;
24738
24738
  };
24739
- Hi = class {
24739
+ Ai = class {
24740
24740
  constructor(e) {
24741
24741
  this.sdk = e;
24742
24742
  this.peerStatsList = [];
@@ -24747,34 +24747,34 @@ var init_dist = __esm({
24747
24747
  }
24748
24748
  handleStatsUpdate(e) {
24749
24749
  return c2(this, null, function* () {
24750
- var n2, l2, u2, p2, h2, T, g2, v2;
24750
+ var n2, l2, u2, p2, h2, T, g2, f2;
24751
24751
  let t2 = e.getLocalPeerStats();
24752
24752
  t2 && this.peerStatsList.push(t2);
24753
24753
  let i2 = (u2 = (l2 = (n2 = this.sdk.getLocalPeer()) == null ? void 0 : n2.audioTrack) == null ? void 0 : l2.nativeTrack) == null ? void 0 : u2.id, r2 = (T = (h2 = (p2 = this.sdk.getLocalPeer()) == null ? void 0 : p2.videoTrack) == null ? void 0 : h2.nativeTrack) == null ? void 0 : T.id, s2 = e.getLocalTrackStats();
24754
24754
  s2 && (i2 && this.localAudioTrackStatsList.push(s2[i2]), r2 && this.localVideoTrackStatsList.push(s2[r2]));
24755
- let o2 = yield (v2 = (g2 = this.sdk.getWebrtcInternals()) == null ? void 0 : g2.getSubscribePeerConnection()) == null ? void 0 : v2.getStats();
24756
- o2 == null || o2.forEach((E2) => {
24757
- if (E2.type === "inbound-rtp") {
24758
- let k2 = E2.kind === "audio" ? this.remoteAudioTrackStatsList : this.remoteVideoTrackStatsList, w2 = Et("bytesReceived", E2, de(k2));
24759
- k2.push(M2(m({}, E2), { bitrate: w2 }));
24755
+ let o2 = yield (f2 = (g2 = this.sdk.getWebrtcInternals()) == null ? void 0 : g2.getSubscribePeerConnection()) == null ? void 0 : f2.getStats();
24756
+ o2 == null || o2.forEach((P8) => {
24757
+ if (P8.type === "inbound-rtp") {
24758
+ let k2 = P8.kind === "audio" ? this.remoteAudioTrackStatsList : this.remoteVideoTrackStatsList, w2 = Pt("bytesReceived", P8, de(k2));
24759
+ k2.push(M2(m({}, P8), { bitrate: w2 }));
24760
24760
  }
24761
24761
  });
24762
24762
  });
24763
24763
  }
24764
24764
  buildReport() {
24765
- var T, g2, v2, E2, k2, w2, Oe, Zt;
24766
- let e = (T = de(this.peerStatsList)) == null ? void 0 : T.publish, t2 = (g2 = de(this.peerStatsList)) == null ? void 0 : g2.subscribe, i2 = e != null && e.responsesReceived ? ((e == null ? void 0 : e.totalRoundTripTime) || 0) / e.responsesReceived : 0, r2 = t2 != null && t2.responsesReceived ? ((t2 == null ? void 0 : t2.totalRoundTripTime) || 0) / t2.responsesReceived : 0, s2 = Number(((i2 + r2) / 2 * 1e3).toFixed(2)), o2 = ((v2 = de(this.remoteAudioTrackStatsList)) == null ? void 0 : v2.packetsReceived) || 0, n2 = ((E2 = de(this.remoteVideoTrackStatsList)) == null ? void 0 : E2.packetsReceived) || 0, l2 = this.localAudioTrackStatsList.map((x2) => x2 ? _e(Object.values(x2), ($) => $.bitrate) : 0), u2 = this.localVideoTrackStatsList.map((x2) => x2 ? _e(Object.values(x2), ($) => $.bitrate) : 0), p2 = de(this.localAudioTrackStatsList), h2 = de(this.localVideoTrackStatsList);
24767
- return { combined: { roundTripTime: s2, packetsReceived: o2 + n2, packetsLost: (t2 == null ? void 0 : t2.packetsLost) || 0, bytesSent: (e == null ? void 0 : e.bytesSent) || 0, bytesReceived: (t2 == null ? void 0 : t2.bytesReceived) || 0, bitrateSent: _e(this.peerStatsList, (x2) => {
24765
+ var T, g2, f2, P8, k2, w2, Oe, Xt;
24766
+ let e = (T = de(this.peerStatsList)) == null ? void 0 : T.publish, t2 = (g2 = de(this.peerStatsList)) == null ? void 0 : g2.subscribe, i2 = e != null && e.responsesReceived ? ((e == null ? void 0 : e.totalRoundTripTime) || 0) / e.responsesReceived : 0, r2 = t2 != null && t2.responsesReceived ? ((t2 == null ? void 0 : t2.totalRoundTripTime) || 0) / t2.responsesReceived : 0, s2 = Number(((i2 + r2) / 2 * 1e3).toFixed(2)), o2 = ((f2 = de(this.remoteAudioTrackStatsList)) == null ? void 0 : f2.packetsReceived) || 0, n2 = ((P8 = de(this.remoteVideoTrackStatsList)) == null ? void 0 : P8.packetsReceived) || 0, l2 = this.localAudioTrackStatsList.map((x2) => x2 ? Ne(Object.values(x2), ($) => $.bitrate) : 0), u2 = this.localVideoTrackStatsList.map((x2) => x2 ? Ne(Object.values(x2), ($) => $.bitrate) : 0), p2 = de(this.localAudioTrackStatsList), h2 = de(this.localVideoTrackStatsList);
24767
+ return { combined: { roundTripTime: s2, packetsReceived: o2 + n2, packetsLost: (t2 == null ? void 0 : t2.packetsLost) || 0, bytesSent: (e == null ? void 0 : e.bytesSent) || 0, bytesReceived: (t2 == null ? void 0 : t2.bytesReceived) || 0, bitrateSent: Ne(this.peerStatsList, (x2) => {
24768
24768
  var $;
24769
24769
  return ($ = x2.publish) == null ? void 0 : $.bitrate;
24770
- }), bitrateReceived: _e(this.peerStatsList, (x2) => {
24770
+ }), bitrateReceived: Ne(this.peerStatsList, (x2) => {
24771
24771
  var $;
24772
24772
  return ($ = x2.subscribe) == null ? void 0 : $.bitrate;
24773
- }) }, audio: { roundTripTime: s2, packetsReceived: o2, packetsLost: ((k2 = de(this.remoteAudioTrackStatsList)) == null ? void 0 : k2.packetsLost) || 0, bytesReceived: ((w2 = de(this.remoteAudioTrackStatsList)) == null ? void 0 : w2.bytesReceived) || 0, bitrateSent: _e(l2, (x2) => x2), bitrateReceived: _e(this.remoteAudioTrackStatsList, (x2) => x2.bitrate), bytesSent: p2 ? Object.values(p2).reduce((x2, $) => x2 + ($.bytesSent || 0), 0) : 0 }, video: { roundTripTime: s2, packetsLost: ((Oe = de(this.remoteVideoTrackStatsList)) == null ? void 0 : Oe.packetsLost) || 0, bytesReceived: ((Zt = de(this.remoteVideoTrackStatsList)) == null ? void 0 : Zt.bytesReceived) || 0, packetsReceived: n2, bitrateSent: _e(u2, (x2) => x2), bitrateReceived: _e(this.remoteVideoTrackStatsList, (x2) => x2.bitrate), bytesSent: h2 ? Object.values(h2).reduce((x2, $) => x2 + ($.bytesSent || 0), 0) : 0 } };
24773
+ }) }, audio: { roundTripTime: s2, packetsReceived: o2, packetsLost: ((k2 = de(this.remoteAudioTrackStatsList)) == null ? void 0 : k2.packetsLost) || 0, bytesReceived: ((w2 = de(this.remoteAudioTrackStatsList)) == null ? void 0 : w2.bytesReceived) || 0, bitrateSent: Ne(l2, (x2) => x2), bitrateReceived: Ne(this.remoteAudioTrackStatsList, (x2) => x2.bitrate), bytesSent: p2 ? Object.values(p2).reduce((x2, $) => x2 + ($.bytesSent || 0), 0) : 0 }, video: { roundTripTime: s2, packetsLost: ((Oe = de(this.remoteVideoTrackStatsList)) == null ? void 0 : Oe.packetsLost) || 0, bytesReceived: ((Xt = de(this.remoteVideoTrackStatsList)) == null ? void 0 : Xt.bytesReceived) || 0, packetsReceived: n2, bitrateSent: Ne(u2, (x2) => x2), bitrateReceived: Ne(this.remoteVideoTrackStatsList, (x2) => x2.bitrate), bytesSent: h2 ? Object.values(h2).reduce((x2, $) => x2 + ($.bytesSent || 0), 0) : 0 } };
24774
24774
  }
24775
24775
  };
24776
24776
  rn2 = ((n2) => (n2[n2.STARTING = 0] = "STARTING", n2[n2.INIT_FETCHED = 1] = "INIT_FETCHED", n2[n2.SIGNAL_CONNECTED = 2] = "SIGNAL_CONNECTED", n2[n2.ICE_ESTABLISHED = 3] = "ICE_ESTABLISHED", n2[n2.MEDIA_CAPTURED = 4] = "MEDIA_CAPTURED", n2[n2.MEDIA_PUBLISHED = 5] = "MEDIA_PUBLISHED", n2[n2.COMPLETED = 6] = "COMPLETED", n2))(rn2 || {});
24777
- Ci = class {
24777
+ Hi = class {
24778
24778
  constructor(e, t2, i2, r2) {
24779
24779
  this.sdk = e;
24780
24780
  this.sdkListener = t2;
@@ -24815,7 +24815,7 @@ var init_dist = __esm({
24815
24815
  });
24816
24816
  this.cqsCalculator.pushScore(t3 == null ? void 0 : t3.downlinkQuality);
24817
24817
  };
24818
- this.statsCollector = new Hi(e), this.state = 0;
24818
+ this.statsCollector = new Ai(e), this.state = 0;
24819
24819
  }
24820
24820
  get state() {
24821
24821
  return this._state;
@@ -24856,7 +24856,7 @@ var init_dist = __esm({
24856
24856
  var t2, i2;
24857
24857
  this.sdkListener.onJoin(e), (t2 = this.sdk.getWebrtcInternals()) == null || t2.onStatsChange((r2) => this.statsCollector.handleStatsUpdate(r2)), (i2 = this.sdk.getWebrtcInternals()) == null || i2.start(), this.cleanupTimer = window.setTimeout(() => {
24858
24858
  this.cleanupAndReport();
24859
- }, Ia);
24859
+ }, Aa);
24860
24860
  }
24861
24861
  onError(e) {
24862
24862
  this.sdkListener.onError(e), this.errors.push(e), e != null && e.isTerminal && this.cleanupAndReport();
@@ -24881,7 +24881,7 @@ var init_dist = __esm({
24881
24881
  }
24882
24882
  cleanupAndReport() {
24883
24883
  var e;
24884
- clearTimeout(this.cleanupTimer), this.cleanupTimer = void 0, this.state === 5 && this.errors.length === 0 && (this.state = 6), (e = this.completionCallback) == null || e.call(this, this.buildReport()), this.sdk.leave();
24884
+ clearTimeout(this.cleanupTimer), this.cleanupTimer = void 0, this.state === 5 && (this.state = 6), (e = this.completionCallback) == null || e.call(this, this.buildReport()), this.sdk.leave();
24885
24885
  }
24886
24886
  buildReport() {
24887
24887
  this.cqsCalculator.addPendingCQSTillNow();
@@ -24889,7 +24889,7 @@ var init_dist = __esm({
24889
24889
  return { testTimestamp: this.timestamp, connectivityState: this.state, errors: this.errors, signallingReport: { isConnected: this.wsConnected, isInitConnected: this.initConnected, websocketUrl: this.websocketURL }, mediaServerReport: { stats: t2, connectionQualityScore: e, isPublishICEConnected: this.isPublishICEConnected, isSubscribeICEConnected: this.isSubscribeICEConnected, publishICECandidatePairSelected: this.selectedPublishICECandidate, subscribeICECandidatePairSelected: this.selectedSubscribeICECandidate, publishIceCandidatesGathered: this.gatheredPublishICECandidates, subscribeIceCandidatesGathered: this.gatheredSubscribeICECandidates } };
24890
24890
  }
24891
24891
  };
24892
- Ne = class {
24892
+ Ke = class {
24893
24893
  constructor(e) {
24894
24894
  this.recording = { server: { running: false }, browser: { running: false }, hls: { running: false } };
24895
24895
  this.rtmp = { running: false };
@@ -24898,7 +24898,7 @@ var init_dist = __esm({
24898
24898
  this.id = e;
24899
24899
  }
24900
24900
  };
24901
- Li = (a11, e, t2) => c2(void 0, null, function* () {
24901
+ Ci = (a11, e, t2) => c2(void 0, null, function* () {
24902
24902
  let r2 = Error("something went wrong during fetch");
24903
24903
  for (let s2 = 0; s2 < 4; s2++)
24904
24904
  try {
@@ -24911,24 +24911,28 @@ var init_dist = __esm({
24911
24911
  }
24912
24912
  throw ["Failed to fetch", "NetworkError"].some((s2) => r2.message.includes(s2)) ? S2.APIErrors.EndpointUnreachable("GET_TOKEN", r2.message) : r2;
24913
24913
  });
24914
- wt = class {
24914
+ Dt = class {
24915
24915
  constructor(e, t2) {
24916
24916
  this.sdk = e;
24917
24917
  this.sdkListener = t2;
24918
24918
  this.recordedAudio = Ca;
24919
- this.initSdkWithLocalPeer();
24919
+ this.sdk.setIsDiagnostics(true), this.initSdkWithLocalPeer();
24920
24920
  }
24921
24921
  get localPeer() {
24922
24922
  var e;
24923
24923
  return (e = this.sdk) == null ? void 0 : e.store.getLocalPeer();
24924
24924
  }
24925
24925
  checkBrowserSupport() {
24926
- Tt(), gt();
24926
+ gt(), St();
24927
24927
  }
24928
24928
  requestPermission(e) {
24929
24929
  return c2(this, null, function* () {
24930
- let t2 = yield navigator.mediaDevices.getUserMedia(e);
24931
- return t2.getTracks().forEach((i2) => i2.stop()), yield this.sdk.deviceManager.init(true), { audio: t2.getAudioTracks().length > 0, video: t2.getVideoTracks().length > 0 };
24930
+ try {
24931
+ let t2 = yield navigator.mediaDevices.getUserMedia(e);
24932
+ return t2.getTracks().forEach((i2) => i2.stop()), yield this.sdk.deviceManager.init(true), { audio: t2.getAudioTracks().length > 0, video: t2.getVideoTracks().length > 0 };
24933
+ } catch (t2) {
24934
+ throw Ae(t2, this.sdk.localTrackManager.getErrorType(!!e.video, !!e.audio));
24935
+ }
24932
24936
  });
24933
24937
  }
24934
24938
  startCameraCheck(e) {
@@ -24937,7 +24941,7 @@ var init_dist = __esm({
24937
24941
  if (this.initSdkWithLocalPeer(), !this.localPeer)
24938
24942
  throw new Error("Local peer not found");
24939
24943
  this.sdk.store.setSimulcastEnabled(false), this.localPeer.role = M2(m({}, ot), { publishParams: M2(m({}, ot.publishParams), { allowed: ["video"] }) });
24940
- let t2 = new Le().video(new Y2().deviceId(e || "default").build()).build(), i2 = yield (s2 = this.sdk) == null ? void 0 : s2.localTrackManager.getLocalTracks({ audio: false, video: true }, t2), r2 = i2 == null ? void 0 : i2.find((u2) => u2.type === "video");
24944
+ let t2 = new De().video(new z2().deviceId(e || "default").build()).build(), i2 = yield (s2 = this.sdk) == null ? void 0 : s2.localTrackManager.getLocalTracks({ audio: false, video: true }, t2), r2 = i2 == null ? void 0 : i2.find((u2) => u2.type === "video");
24941
24945
  if (!r2)
24942
24946
  throw new Error("No video track found");
24943
24947
  (o2 = this.sdk) == null || o2.deviceManager.init(true), this.localPeer.videoTrack = r2, (l2 = (n2 = this.sdk) == null ? void 0 : n2.listener) == null || l2.onPeerUpdate(9, [this.localPeer]);
@@ -24947,26 +24951,32 @@ var init_dist = __esm({
24947
24951
  var e, t2;
24948
24952
  (t2 = (e = this.localPeer) == null ? void 0 : e.videoTrack) == null || t2.cleanup(), this.localPeer && (this.localPeer.videoTrack = void 0);
24949
24953
  }
24950
- startMicCheck(r2, s2) {
24951
- return c2(this, arguments, function* (e, t2, i2 = Ha) {
24952
- var l2, u2, p2, h2;
24953
- this.initSdkWithLocalPeer();
24954
+ startMicCheck(s2) {
24955
+ return c2(this, arguments, function* ({ inputDevice: e, onError: t2, onStop: i2, time: r2 = Ha }) {
24956
+ var u2, p2, h2, T;
24957
+ this.initSdkWithLocalPeer((g2) => {
24958
+ this.stopMicCheck(), t2 == null || t2(g2);
24959
+ });
24954
24960
  let o2 = yield this.getLocalAudioTrack(e);
24955
- if ((l2 = this.sdk) == null || l2.deviceManager.init(true), !this.localPeer)
24961
+ if ((u2 = this.sdk) == null || u2.deviceManager.init(true), !this.localPeer)
24956
24962
  throw new Error("Local peer not found");
24957
24963
  if (!o2)
24958
24964
  throw new Error("No audio track found");
24959
- this.localPeer.audioTrack = o2, (u2 = this.sdk) == null || u2.initPreviewTrackAudioLevelMonitor(), (h2 = (p2 = this.sdk) == null ? void 0 : p2.listener) == null || h2.onPeerUpdate(9, [this.localPeer]), this.mediaRecorder = new MediaRecorder(o2.stream.nativeStream);
24965
+ this.localPeer.audioTrack = o2, (p2 = this.sdk) == null || p2.initPreviewTrackAudioLevelMonitor(), (T = (h2 = this.sdk) == null ? void 0 : h2.listener) == null || T.onPeerUpdate(9, [this.localPeer]), this.mediaRecorder = new MediaRecorder(o2.stream.nativeStream);
24960
24966
  let n2 = [];
24961
- this.mediaRecorder.ondataavailable = function(T) {
24962
- n2.push(T.data);
24967
+ this.mediaRecorder.ondataavailable = function(g2) {
24968
+ n2.push(g2.data);
24963
24969
  }, this.mediaRecorder.onstop = () => {
24964
- var g2;
24965
- let T = new Blob(n2, { type: (g2 = this.mediaRecorder) == null ? void 0 : g2.mimeType });
24966
- this.recordedAudio = URL.createObjectURL(T);
24967
- }, this.mediaRecorder.start(), K(i2).then(() => {
24968
- this.stopMicCheck(), t2 == null || t2();
24969
- });
24970
+ var f2, P8;
24971
+ let g2 = new Blob(n2, { type: (f2 = this.mediaRecorder) == null ? void 0 : f2.mimeType });
24972
+ this.recordedAudio = URL.createObjectURL(g2), (P8 = this.onStopMicCheck) == null || P8.call(this);
24973
+ }, this.mediaRecorder.start();
24974
+ let l2 = setTimeout(() => {
24975
+ this.stopMicCheck();
24976
+ }, r2);
24977
+ this.onStopMicCheck = () => {
24978
+ clearTimeout(l2), i2 == null || i2();
24979
+ };
24970
24980
  });
24971
24981
  }
24972
24982
  stopMicCheck() {
@@ -24978,14 +24988,13 @@ var init_dist = __esm({
24978
24988
  }
24979
24989
  startConnectivityCheck(e, t2, i2) {
24980
24990
  return c2(this, null, function* () {
24981
- var o2;
24982
24991
  if (!this.sdk)
24983
24992
  throw new Error("SDK not found");
24984
- this.connectivityCheck = new Ci(this.sdk, this.sdkListener, e, t2);
24985
- let r2 = yield this.getAuthToken(i2), { roomId: s2 } = nt(r2);
24986
- yield this.sdk.leave(), (o2 = this.sdk) == null || o2.store.setRoom(new Ne(s2)), yield this.sdk.join({ authToken: r2, userName: "diagonistic-test", initEndpoint: "https://qa-in2-ipv6.100ms.live/init" }, this.connectivityCheck), this.sdk.addConnectionQualityListener({ onConnectionQualityUpdate: (n2) => {
24987
- var l2;
24988
- (l2 = this.connectivityCheck) == null || l2.handleConnectionQualityUpdate(n2);
24993
+ this.connectivityCheck = new Hi(this.sdk, this.sdkListener, e, t2);
24994
+ let r2 = yield this.getAuthToken(i2);
24995
+ yield this.sdk.leave(), yield this.sdk.join({ authToken: r2, userName: "diagnostics-test" }, this.connectivityCheck), this.sdk.addConnectionQualityListener({ onConnectionQualityUpdate: (s2) => {
24996
+ var o2;
24997
+ (o2 = this.connectivityCheck) == null || o2.handleConnectionQualityUpdate(s2);
24989
24998
  } });
24990
24999
  });
24991
25000
  }
@@ -24995,19 +25004,21 @@ var init_dist = __esm({
24995
25004
  return (e = this.connectivityCheck) == null ? void 0 : e.cleanupAndReport();
24996
25005
  });
24997
25006
  }
24998
- initSdkWithLocalPeer() {
24999
- var i2, r2, s2;
25000
- this.sdkListener && ((i2 = this.sdk) == null || i2.initStoreAndManagers(this.sdkListener));
25001
- let e = new We({ name: "diagnostics-peer", role: ot, type: "regular" });
25002
- (r2 = this.sdk) == null || r2.store.addPeer(e);
25003
- let t2 = new Ne("diagnostics-room");
25004
- this.sdk.store.setRoom(t2), this.sdkListener.onRoomUpdate("ROOM_PEER_COUNT_UPDATED", t2), (s2 = this.sdk) == null || s2.deviceManager.init(true);
25007
+ initSdkWithLocalPeer(e) {
25008
+ var r2, s2, o2;
25009
+ this.sdkListener && ((r2 = this.sdk) == null || r2.initStoreAndManagers(M2(m({}, this.sdkListener), { onError: (n2) => {
25010
+ e == null || e(n2), this.sdkListener.onError(n2);
25011
+ } })));
25012
+ let t2 = new We({ name: "diagnostics-peer", role: ot, type: "regular" });
25013
+ (s2 = this.sdk) == null || s2.store.addPeer(t2);
25014
+ let i2 = new Ke("diagnostics-room");
25015
+ this.sdk.store.setRoom(i2), this.sdkListener.onRoomUpdate("ROOM_PEER_COUNT_UPDATED", i2), (o2 = this.sdk) == null || o2.deviceManager.init(true);
25005
25016
  }
25006
25017
  getAuthToken(e) {
25007
25018
  return c2(this, null, function* () {
25008
- let t2 = new URL("https://api-nonprod.100ms.live/v2/diagnostics/token");
25019
+ let t2 = new URL("https://api.100ms.live/v2/diagnostics/token");
25009
25020
  e && t2.searchParams.append("region", e);
25010
- let i2 = yield Li(t2.toString(), { method: "GET" }, [429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511]), r2 = yield i2.json();
25021
+ let i2 = yield Ci(t2.toString(), { method: "GET" }, [429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511]), r2 = yield i2.json();
25011
25022
  if (!i2.ok)
25012
25023
  throw S2.APIErrors.ServerErrors(r2.code, "GET_TOKEN", r2.message, false);
25013
25024
  let { token: s2 } = r2;
@@ -25022,12 +25033,12 @@ var init_dist = __esm({
25022
25033
  if (!this.localPeer)
25023
25034
  return;
25024
25035
  this.localPeer.role = M2(m({}, ot), { publishParams: M2(m({}, ot.publishParams), { allowed: ["audio"] }) });
25025
- let t2 = new Le().audio(new ee().deviceId(e || "default").build()).build(), i2 = yield (r2 = this.sdk) == null ? void 0 : r2.localTrackManager.getLocalTracks({ audio: true, video: false }, t2);
25036
+ let t2 = new De().audio(new ee().deviceId(e || "default").build()).build(), i2 = yield (r2 = this.sdk) == null ? void 0 : r2.localTrackManager.getLocalTracks({ audio: true, video: false }, t2);
25026
25037
  return i2 == null ? void 0 : i2.find((s2) => s2.type === "audio");
25027
25038
  });
25028
25039
  }
25029
25040
  };
25030
- Di = class {
25041
+ Li = class {
25031
25042
  constructor(e, t2, i2) {
25032
25043
  this.isRoomJoinCalled = false;
25033
25044
  this.ignoredMessageTypes = [];
@@ -25042,13 +25053,13 @@ var init_dist = __esm({
25042
25053
  }, e2);
25043
25054
  };
25044
25055
  this.sendPeerUpdateNotification = (e2, t3) => {
25045
- let i3 = this.store.getState(Z2(t3.peerId)), r2 = yi[e2] || "peerUpdate";
25056
+ let i3 = this.store.getState(X2(t3.peerId)), r2 = Mi[e2] || "peerUpdate";
25046
25057
  if (e2 === 8)
25047
25058
  this.syncRoomState(r2), this.updateMidCallPreviewRoomState(e2, t3);
25048
25059
  else if ([0, 1].includes(e2))
25049
- this.syncRoomState(r2), i3 || (i3 = this.store.getState(Z2(t3.peerId)));
25060
+ this.syncRoomState(r2), i3 || (i3 = this.store.getState(X2(t3.peerId)));
25050
25061
  else if ([12, 13, 14].includes(e2))
25051
- this.syncRoomState(r2), i3 || (i3 = this.store.getState(Z2(t3.peerId)));
25062
+ this.syncRoomState(r2), i3 || (i3 = this.store.getState(X2(t3.peerId)));
25052
25063
  else {
25053
25064
  let s2 = _2.convertPeer(t3);
25054
25065
  this.setState((o2) => {
@@ -25060,7 +25071,7 @@ var init_dist = __esm({
25060
25071
  };
25061
25072
  this.getSDKHMSPeer = (e2) => this.sdk.getPeerMap()[e2];
25062
25073
  this.setState = (e2, t3) => this.store.namedSetState(e2, t3);
25063
- this.store = e, this.sdk = t2, this.hmsNotifications = i2, this.sessionStore = new Ri(this.sdk, this.setSessionStoreValueLocally.bind(this)), this.actionBatcher = new Ei(e);
25074
+ this.store = e, this.sdk = t2, this.hmsNotifications = i2, this.sessionStore = new bi(this.sdk, this.setSessionStoreValueLocally.bind(this)), this.actionBatcher = new Pi(e);
25064
25075
  }
25065
25076
  getLocalTrack(e) {
25066
25077
  return this.sdk.store.getLocalPeerTracks().find((t2) => t2.trackId === e);
@@ -25165,7 +25176,7 @@ var init_dist = __esm({
25165
25176
  }
25166
25177
  leave() {
25167
25178
  return c2(this, null, function* () {
25168
- let e = this.store.getState(we), t2 = true;
25179
+ let e = this.store.getState(_e), t2 = true;
25169
25180
  e || (t2 = false, this.logPossibleInconsistency("room leave is called when no room is connected"));
25170
25181
  let i2 = this.store.getState(ie);
25171
25182
  return this.setState((r2) => {
@@ -25207,7 +25218,7 @@ var init_dist = __esm({
25207
25218
  }
25208
25219
  setLocalVideoEnabled(e) {
25209
25220
  return c2(this, null, function* () {
25210
- let t2 = this.store.getState(X2);
25221
+ let t2 = this.store.getState(Y2);
25211
25222
  t2 && (yield this.setEnabledTrack(t2, e));
25212
25223
  });
25213
25224
  }
@@ -25240,13 +25251,13 @@ var init_dist = __esm({
25240
25251
  }
25241
25252
  setVideoSettings(e) {
25242
25253
  return c2(this, null, function* () {
25243
- let t2 = this.store.getState(X2);
25254
+ let t2 = this.store.getState(Y2);
25244
25255
  t2 && (yield this.setSDKLocalVideoTrackSettings(t2, e), this.syncRoomState("setVideoSettings"));
25245
25256
  });
25246
25257
  }
25247
25258
  switchCamera() {
25248
25259
  return c2(this, null, function* () {
25249
- let e = this.store.getState(X2);
25260
+ let e = this.store.getState(Y2);
25250
25261
  if (e) {
25251
25262
  let t2 = this.sdk.store.getLocalPeerTracks().find((i2) => i2.trackId === e);
25252
25263
  t2 && (yield t2.switchCamera(), this.syncRoomState("switchCamera"));
@@ -25333,7 +25344,7 @@ var init_dist = __esm({
25333
25344
  let t2 = {};
25334
25345
  if (t2.isSupported = false, !e)
25335
25346
  return b2.w("no plugin passed in for checking support"), t2.errMsg = "no plugin passed in for checking support", t2;
25336
- let i2 = this.store.getState(X2);
25347
+ let i2 = this.store.getState(Y2);
25337
25348
  if (!i2)
25338
25349
  return b2.w("video Track not added to local peer yet"), t2.errMsg = "call this function only after local peer has video track", t2;
25339
25350
  let r2 = this.getTrackById(i2);
@@ -25564,16 +25575,16 @@ var init_dist = __esm({
25564
25575
  }
25565
25576
  enableBeamSpeakerLabelsLogging() {
25566
25577
  return c2(this, null, function* () {
25567
- this.beamSpeakerLabelsLogger || (b2.i("enabling beam speaker labels logging"), this.beamSpeakerLabelsLogger = new Ai(this.store, this), yield this.beamSpeakerLabelsLogger.start());
25578
+ this.beamSpeakerLabelsLogger || (b2.i("enabling beam speaker labels logging"), this.beamSpeakerLabelsLogger = new Ri(this.store, this), yield this.beamSpeakerLabelsLogger.start());
25568
25579
  });
25569
25580
  }
25570
25581
  initDiagnostics() {
25571
- let e = new wt(this.sdk, { onJoin: this.onJoin.bind(this), onPreview: this.onPreview.bind(this), onRoomUpdate: this.onRoomUpdate.bind(this), onPeerUpdate: this.onPeerUpdate.bind(this), onTrackUpdate: this.onTrackUpdate.bind(this), onMessageReceived: this.onMessageReceived.bind(this), onError: this.onError.bind(this), onReconnected: this.onReconnected.bind(this), onReconnecting: this.onReconnecting.bind(this), onRoleChangeRequest: this.onRoleChangeRequest.bind(this), onRoleUpdate: this.onRoleUpdate.bind(this), onDeviceChange: this.onDeviceChange.bind(this), onChangeTrackStateRequest: this.onChangeTrackStateRequest.bind(this), onChangeMultiTrackStateRequest: this.onChangeMultiTrackStateRequest.bind(this), onRemovedFromRoom: this.onRemovedFromRoom.bind(this), onNetworkQuality: this.onNetworkQuality.bind(this), onSessionStoreUpdate: this.onSessionStoreUpdate.bind(this), onPollsUpdate: this.onPollsUpdate.bind(this), onWhiteboardUpdate: this.onWhiteboardUpdate.bind(this) });
25582
+ let e = new Dt(this.sdk, { onJoin: this.onJoin.bind(this), onPreview: this.onPreview.bind(this), onRoomUpdate: this.onRoomUpdate.bind(this), onPeerUpdate: this.onPeerUpdate.bind(this), onTrackUpdate: this.onTrackUpdate.bind(this), onMessageReceived: this.onMessageReceived.bind(this), onError: this.onError.bind(this), onReconnected: this.onReconnected.bind(this), onReconnecting: this.onReconnecting.bind(this), onRoleChangeRequest: this.onRoleChangeRequest.bind(this), onRoleUpdate: this.onRoleUpdate.bind(this), onDeviceChange: this.onDeviceChange.bind(this), onChangeTrackStateRequest: this.onChangeTrackStateRequest.bind(this), onChangeMultiTrackStateRequest: this.onChangeMultiTrackStateRequest.bind(this), onRemovedFromRoom: this.onRemovedFromRoom.bind(this), onNetworkQuality: this.onNetworkQuality.bind(this), onSessionStoreUpdate: this.onSessionStoreUpdate.bind(this), onPollsUpdate: this.onPollsUpdate.bind(this), onWhiteboardUpdate: this.onWhiteboardUpdate.bind(this) });
25572
25583
  return this.sdk.addAudioListener({ onAudioLevelUpdate: this.onAudioLevelUpdate.bind(this) }), this.sdk.addConnectionQualityListener({ onConnectionQualityUpdate: this.onConnectionQualityUpdate.bind(this) }), e;
25573
25584
  }
25574
25585
  resetState(e = "resetState") {
25575
25586
  this.isRoomJoinCalled = false, b2.cleanup(), this.setState((t2) => {
25576
- Object.assign(t2, ti());
25587
+ Object.assign(t2, ei());
25577
25588
  }, e);
25578
25589
  }
25579
25590
  sdkJoinWithListeners(e) {
@@ -25583,7 +25594,7 @@ var init_dist = __esm({
25583
25594
  }
25584
25595
  onRemovedFromRoom(e) {
25585
25596
  var r2;
25586
- let t2 = this.store.getState(Z2((r2 = e.requestedBy) == null ? void 0 : r2.peerId));
25597
+ let t2 = this.store.getState(X2((r2 = e.requestedBy) == null ? void 0 : r2.peerId));
25587
25598
  this.hmsNotifications.sendLeaveRoom(M2(m({}, e), { requestedBy: t2 || void 0 }));
25588
25599
  let i2 = e.roomEnded || !t2 ? "roomEnded" : "removedFromRoom";
25589
25600
  b2.i(`resetting state after peer removed ${i2}`, e), this.resetState(i2);
@@ -25618,7 +25629,7 @@ var init_dist = __esm({
25618
25629
  this.setSessionStoreValueLocally(e, "sessionStoreUpdate");
25619
25630
  }
25620
25631
  onPollsUpdate(e, t2) {
25621
- let i2 = ki[e];
25632
+ let i2 = yi[e];
25622
25633
  this.setState((r2) => {
25623
25634
  let s2 = t2.reduce((o2, n2) => {
25624
25635
  var l2;
@@ -25655,10 +25666,10 @@ var init_dist = __esm({
25655
25666
  e = `${e}_fullSync`, b2.time(`store-sync-${e}`);
25656
25667
  let t2 = {}, i2 = [], r2 = {}, s2 = {}, o2 = {}, n2, l2 = this.sdk.getPeers();
25657
25668
  for (let g2 of l2) {
25658
- let v2 = _2.convertPeer(g2);
25659
- t2[v2.id] = v2, i2.push(v2.id), o2[v2.id] = { peerID: v2.id, downlinkQuality: g2.networkQuality || -1 };
25660
- let E2 = [g2.audioTrack, g2.videoTrack, ...g2.auxiliaryTracks];
25661
- for (let k2 of E2) {
25669
+ let f2 = _2.convertPeer(g2);
25670
+ t2[f2.id] = f2, i2.push(f2.id), o2[f2.id] = { peerID: f2.id, downlinkQuality: g2.networkQuality || -1 };
25671
+ let P8 = [g2.audioTrack, g2.videoTrack, ...g2.auxiliaryTracks];
25672
+ for (let k2 of P8) {
25662
25673
  if (!k2)
25663
25674
  continue;
25664
25675
  let w2 = _2.convertTrack(k2);
@@ -25673,8 +25684,8 @@ var init_dist = __esm({
25673
25684
  this.setState((g2) => {
25674
25685
  var k2;
25675
25686
  g2.room.peers = i2;
25676
- let v2 = g2.peers, E2 = g2.tracks;
25677
- Ea(v2, t2), ba(E2, r2), Object.assign(g2.settings, s2), g2.room.isConnected && Object.assign(g2.connectionQualities, o2), (k2 = g2.preview) != null && k2.localPeer && (n2 != null && n2.localPeer) ? Object.assign(g2.preview, n2) : g2.preview = n2, Object.assign(g2.roles, _2.convertRoles(this.sdk.getRoles())), Object.assign(g2.playlist, _2.convertPlaylist(this.sdk.getPlaylistManager())), Object.assign(g2.room, _2.convertRecordingStreamingState(u2, p2, h2, T)), Object.assign(g2.templateAppData, this.sdk.getTemplateAppData());
25687
+ let f2 = g2.peers, P8 = g2.tracks;
25688
+ Ea(f2, t2), ba(P8, r2), Object.assign(g2.settings, s2), g2.room.isConnected && Object.assign(g2.connectionQualities, o2), (k2 = g2.preview) != null && k2.localPeer && (n2 != null && n2.localPeer) ? Object.assign(g2.preview, n2) : g2.preview = n2, Object.assign(g2.roles, _2.convertRoles(this.sdk.getRoles())), Object.assign(g2.playlist, _2.convertPlaylist(this.sdk.getPlaylistManager())), Object.assign(g2.room, _2.convertRecordingStreamingState(u2, p2, h2, T)), Object.assign(g2.templateAppData, this.sdk.getTemplateAppData());
25678
25689
  }, e), b2.timeEnd(`store-sync-${e}`);
25679
25690
  }
25680
25691
  onPreview(e) {
@@ -25685,7 +25696,7 @@ var init_dist = __esm({
25685
25696
  }
25686
25697
  onJoin(e) {
25687
25698
  let t2 = this.sdk.getPlaylistManager();
25688
- this.audioPlaylist = new Dt(t2, "audio", this.syncPlaylistState.bind(this), this.store), this.videoPlaylist = new Dt(t2, "video", this.syncRoomState.bind(this), this.store), this.syncRoomState("joinSync"), this.setState((i2) => {
25699
+ this.audioPlaylist = new Lt(t2, "audio", this.syncPlaylistState.bind(this), this.store), this.videoPlaylist = new Lt(t2, "video", this.syncRoomState.bind(this), this.store), this.syncRoomState("joinSync"), this.setState((i2) => {
25689
25700
  var r2;
25690
25701
  Object.assign(i2.room, _2.convertRoom(e, (r2 = this.sdk.getLocalPeer()) == null ? void 0 : r2.peerId)), i2.room.isConnected = true, i2.room.roomState = "Connected";
25691
25702
  }, "joined"), t2.onProgress(this.setProgress), t2.onNewTrackStart((i2) => {
@@ -25705,17 +25716,17 @@ var init_dist = __esm({
25705
25716
  onPeerUpdate(e, t2) {
25706
25717
  if (![4, 5].includes(e)) {
25707
25718
  if (Array.isArray(t2)) {
25708
- let i2 = this.store.getState(q2), r2 = t2.filter((o2) => !i2[o2.peerId]);
25709
- if (this.syncRoomState("peersJoined"), this.store.getState(we)) {
25719
+ let i2 = this.store.getState(K), r2 = t2.filter((o2) => !i2[o2.peerId]);
25720
+ if (this.syncRoomState("peersJoined"), this.store.getState(_e)) {
25710
25721
  let o2 = [];
25711
25722
  for (let n2 of t2) {
25712
- let l2 = this.store.getState(Z2(n2.peerId));
25723
+ let l2 = this.store.getState(X2(n2.peerId));
25713
25724
  l2 && o2.push(l2);
25714
25725
  }
25715
25726
  this.hmsNotifications.sendPeerList(o2);
25716
25727
  } else
25717
25728
  r2.forEach((o2) => {
25718
- let n2 = this.store.getState(Z2(o2.peerId));
25729
+ let n2 = this.store.getState(X2(o2.peerId));
25719
25730
  n2 && this.hmsNotifications.sendPeerUpdate(0, n2);
25720
25731
  });
25721
25732
  return;
@@ -25727,10 +25738,10 @@ var init_dist = __esm({
25727
25738
  if (e === 1)
25728
25739
  this.hmsNotifications.sendTrackUpdate(e, t2.trackId), this.handleTrackRemove(t2, i2);
25729
25740
  else if ([0, 1].includes(e)) {
25730
- let r2 = Ct[e];
25741
+ let r2 = Ht[e];
25731
25742
  this.syncRoomState(r2), this.hmsNotifications.sendTrackUpdate(e, t2.trackId);
25732
25743
  } else {
25733
- let r2 = Ct[e] || "trackUpdate", s2 = _2.convertTrack(t2);
25744
+ let r2 = Ht[e] || "trackUpdate", s2 = _2.convertTrack(t2);
25734
25745
  this.setState((o2) => {
25735
25746
  let n2 = o2.tracks[s2.id];
25736
25747
  $e(n2, s2) && (qr(n2, s2), Object.assign(n2, s2));
@@ -25770,14 +25781,14 @@ var init_dist = __esm({
25770
25781
  }
25771
25782
  onChangeTrackStateRequest(e) {
25772
25783
  var s2;
25773
- let t2 = this.store.getState(Z2((s2 = e.requestedBy) == null ? void 0 : s2.peerId)), i2 = this.getStoreLocalTrackIDfromSDKTrack(e.track), r2 = this.store.getState(vi(i2));
25784
+ let t2 = this.store.getState(X2((s2 = e.requestedBy) == null ? void 0 : s2.peerId)), i2 = this.getStoreLocalTrackIDfromSDKTrack(e.track), r2 = this.store.getState(fi(i2));
25774
25785
  if (!r2)
25775
25786
  return this.logPossibleInconsistency(`Not found track for which track state change was requested, ${e.track}`);
25776
25787
  e.enabled || this.syncRoomState("changeTrackStateRequest"), this.hmsNotifications.sendChangeTrackStateRequest({ requestedBy: t2 || void 0, track: r2, enabled: e.enabled });
25777
25788
  }
25778
25789
  onChangeMultiTrackStateRequest(e) {
25779
25790
  var s2;
25780
- let t2 = this.store.getState(Z2((s2 = e.requestedBy) == null ? void 0 : s2.peerId));
25791
+ let t2 = this.store.getState(X2((s2 = e.requestedBy) == null ? void 0 : s2.peerId));
25781
25792
  e.enabled || this.syncRoomState("changeMultiTrackStateRequest");
25782
25793
  let i2 = [], r2 = this.store.getState(N2);
25783
25794
  for (let o2 of e.tracks) {
@@ -25803,7 +25814,7 @@ var init_dist = __esm({
25803
25814
  i2.room.roomState = "Failed", i2.errors.push(t2);
25804
25815
  }, "errorTerminal")) : this.store.getState().errors.length < 50 && this.setState((r2) => {
25805
25816
  r2.errors.push(t2);
25806
- }, "error"), this.syncRoomState("errorSync"), this.hmsNotifications.sendError(t2), b2.e("received error from sdk", t2 instanceof f2 ? `${t2}` : t2);
25817
+ }, "error"), this.syncRoomState("errorSync"), this.hmsNotifications.sendError(t2), b2.e("received error from sdk", t2 instanceof v2 ? `${t2}` : t2);
25807
25818
  }
25808
25819
  handleTrackRemove(e, t2) {
25809
25820
  this.setState((i2) => {
@@ -25853,7 +25864,7 @@ var init_dist = __esm({
25853
25864
  setTrackVolume(e, t2) {
25854
25865
  return c2(this, null, function* () {
25855
25866
  let i2 = this.getTrackById(t2);
25856
- i2 ? i2 instanceof Ae ? (yield i2.setVolume(e), this.setState((r2) => {
25867
+ i2 ? i2 instanceof Ie ? (yield i2.setVolume(e), this.setState((r2) => {
25857
25868
  let s2 = r2.tracks[t2];
25858
25869
  s2 && s2.type === "audio" && (s2.volume = e);
25859
25870
  }, "trackVolume")) : b2.w(`track ${t2} is not an audio track`) : this.logPossibleInconsistency(`track ${t2} not present, unable to set volume`);
@@ -25875,7 +25886,7 @@ var init_dist = __esm({
25875
25886
  b2.w("Invalid plugin received in store");
25876
25887
  return;
25877
25888
  }
25878
- let r2 = this.store.getState(X2);
25889
+ let r2 = this.store.getState(Y2);
25879
25890
  if (r2) {
25880
25891
  let s2 = this.getLocalTrack(r2);
25881
25892
  s2 ? (t2 === "add" ? yield s2.addPlugin(e, i2) : t2 === "remove" && (yield s2.removePlugin(e)), this.syncRoomState(`${t2}VideoPlugin`)) : this.logPossibleInconsistency(`track ${r2} not present, unable to ${t2} plugin`);
@@ -25888,7 +25899,7 @@ var init_dist = __esm({
25888
25899
  b2.w("Invalid plugin received in store");
25889
25900
  return;
25890
25901
  }
25891
- let i2 = this.store.getState(X2);
25902
+ let i2 = this.store.getState(Y2);
25892
25903
  if (i2) {
25893
25904
  let r2 = this.getLocalTrack(i2);
25894
25905
  r2 ? (t2 === "add" ? yield r2.addStreamPlugins(e) : t2 === "remove" && (yield r2.removeStreamPlugins(e)), this.syncRoomState(`${t2}MediaStreamPlugin`)) : this.logPossibleInconsistency(`track ${i2} not present, unable to ${t2} plugin`);
@@ -25942,8 +25953,8 @@ var init_dist = __esm({
25942
25953
  }, t2);
25943
25954
  }
25944
25955
  };
25945
- wi = (a11) => O2 ? `${a11} ${document.title}` : a11;
25946
- _i = class {
25956
+ Di = (a11) => O2 ? `${a11} ${document.title}` : a11;
25957
+ wi = class {
25947
25958
  constructor(e, t2) {
25948
25959
  this.eventBus = e;
25949
25960
  this.listener = t2;
@@ -25953,7 +25964,7 @@ var init_dist = __esm({
25953
25964
  var u2;
25954
25965
  if (!e2)
25955
25966
  return;
25956
- let { url: t3, timeout: i2, scoreMap: r2 } = e2, s2 = this.controller.signal, o2 = Date.now(), n2 = 0, l2 = K(i2).then(() => {
25967
+ let { url: t3, timeout: i2, scoreMap: r2 } = e2, s2 = this.controller.signal, o2 = Date.now(), n2 = 0, l2 = Z2(i2).then(() => {
25957
25968
  this.controller.abort();
25958
25969
  });
25959
25970
  try {
@@ -25965,8 +25976,8 @@ var init_dist = __esm({
25965
25976
  try {
25966
25977
  let g2 = false;
25967
25978
  for (; !g2; ) {
25968
- let { value: v2, done: E2 } = yield h2.read();
25969
- g2 = E2, v2 && (n2 += v2.byteLength, this.sendScore({ scoreMap: r2, downloadedSize: n2, startTime: o2 }));
25979
+ let { value: f2, done: P8 } = yield h2.read();
25980
+ g2 = P8, f2 && (n2 += f2.byteLength, this.sendScore({ scoreMap: r2, downloadedSize: n2, startTime: o2 }));
25970
25981
  }
25971
25982
  } catch (g2) {
25972
25983
  g2.name !== "AbortError" && d2.d(this.TAG, g2);
@@ -25998,7 +26009,7 @@ var init_dist = __esm({
25998
26009
  e !== this.score && (this.score = e, (i2 = (t2 = this.listener) == null ? void 0 : t2.onNetworkQuality) == null || i2.call(t2, e));
25999
26010
  }
26000
26011
  };
26001
- _t = class {
26012
+ wt = class {
26002
26013
  constructor(e, t2, i2, r2, s2, o2) {
26003
26014
  this.store = e;
26004
26015
  this.transport = t2;
@@ -26012,8 +26023,8 @@ var init_dist = __esm({
26012
26023
  r3 && (yield this.diffRolesAndPublishTracks({ oldRole: e2, newRole: t3 }), (s3 = this.listener) == null || s3.onPeerUpdate(8, r3));
26013
26024
  });
26014
26025
  this.diffRolesAndPublishTracks = (i3) => c2(this, [i3], function* ({ oldRole: e2, newRole: t3 }) {
26015
- var g2, v2, E2, k2, w2, Oe;
26016
- let r3 = new Set(e2.publishParams.allowed), s3 = new Set(t3.publishParams.allowed), o3 = this.removeTrack(r3, s3, "video"), n2 = this.removeTrack(r3, s3, "audio"), l2 = this.removeTrack(r3, s3, "screen"), u2 = this.hasSimulcastDifference((g2 = e2.publishParams.simulcast) == null ? void 0 : g2.video, (v2 = t3.publishParams.simulcast) == null ? void 0 : v2.video), p2 = this.hasSimulcastDifference((E2 = e2.publishParams.simulcast) == null ? void 0 : E2.screen, (k2 = t3.publishParams.simulcast) == null ? void 0 : k2.screen), h2 = (Oe = (w2 = this.store.getLocalPeer()) == null ? void 0 : w2.videoTrack) == null ? void 0 : Oe.enabled;
26026
+ var g2, f2, P8, k2, w2, Oe;
26027
+ let r3 = new Set(e2.publishParams.allowed), s3 = new Set(t3.publishParams.allowed), o3 = this.removeTrack(r3, s3, "video"), n2 = this.removeTrack(r3, s3, "audio"), l2 = this.removeTrack(r3, s3, "screen"), u2 = this.hasSimulcastDifference((g2 = e2.publishParams.simulcast) == null ? void 0 : g2.video, (f2 = t3.publishParams.simulcast) == null ? void 0 : f2.video), p2 = this.hasSimulcastDifference((P8 = e2.publishParams.simulcast) == null ? void 0 : P8.screen, (k2 = t3.publishParams.simulcast) == null ? void 0 : k2.screen), h2 = (Oe = (w2 = this.store.getLocalPeer()) == null ? void 0 : w2.videoTrack) == null ? void 0 : Oe.enabled;
26017
26028
  yield this.removeAudioTrack(n2), yield this.removeVideoTracks(o3 || u2), yield this.removeScreenTracks(l2 || p2);
26018
26029
  let T = this.getSettings();
26019
26030
  u2 && (T.isVideoMuted = !h2), yield this.publish(T), yield this.syncDevices(T, t3);
@@ -26120,12 +26131,12 @@ var init_dist = __esm({
26120
26131
  }
26121
26132
  };
26122
26133
  Pe = new Jr();
26123
- Nt = class {
26134
+ _t = class {
26124
26135
  constructor(e) {
26125
26136
  this.type = e.type, this.source = e.source || "regular", this.description = "", e instanceof Re ? (this.mute = !e.enabled, this.track_id = e.publishedTrackId, this.stream_id = e.stream.id) : (this.mute = e.mute, this.track_id = e.track_id, this.stream_id = e.stream_id);
26126
26137
  }
26127
26138
  };
26128
- Ot = class {
26139
+ Nt = class {
26129
26140
  constructor() {
26130
26141
  this.TAG = "[Store]:";
26131
26142
  this.knownRoles = {};
@@ -26136,7 +26147,7 @@ var init_dist = __esm({
26136
26147
  this.roleDetailsArrived = false;
26137
26148
  this.env = "prod";
26138
26149
  this.simulcastEnabled = false;
26139
- this.userAgent = ft(this.env);
26150
+ this.userAgent = Tt(this.env);
26140
26151
  this.polls = /* @__PURE__ */ new Map();
26141
26152
  this.whiteboards = /* @__PURE__ */ new Map();
26142
26153
  this.addPermissionToRole = (e, t2, i2, r2) => {
@@ -26256,7 +26267,7 @@ var init_dist = __esm({
26256
26267
  return this.userAgent;
26257
26268
  }
26258
26269
  createAndSetUserAgent(e) {
26259
- this.userAgent = ft(this.env, e);
26270
+ this.userAgent = Tt(this.env, e);
26260
26271
  }
26261
26272
  setRoom(e) {
26262
26273
  this.room = e;
@@ -26273,8 +26284,8 @@ var init_dist = __esm({
26273
26284
  }
26274
26285
  setConfig(e) {
26275
26286
  var t2, i2, r2;
26276
- if (z2.rememberDevices(!!e.rememberDeviceSelection), e.rememberDeviceSelection) {
26277
- let s2 = z2.getSelection();
26287
+ if (Q2.rememberDevices(!!e.rememberDeviceSelection), e.rememberDeviceSelection) {
26288
+ let s2 = Q2.getSelection();
26278
26289
  s2 && (e.settings || (e.settings = {}), (t2 = s2.audioInput) != null && t2.deviceId && (e.settings.audioInputDeviceId = e.settings.audioInputDeviceId || s2.audioInput.deviceId), (i2 = s2.audioOutput) != null && i2.deviceId && (e.settings.audioOutputDeviceId = e.settings.audioOutputDeviceId || s2.audioOutput.deviceId), (r2 = s2.videoInput) != null && r2.deviceId && (e.settings.videoDeviceId = e.settings.videoDeviceId || s2.videoInput.deviceId));
26279
26290
  }
26280
26291
  e.autoManageVideo = e.autoManageVideo !== false, e.autoManageWakeLock = e.autoManageWakeLock !== false, this.config = e, this.setEnv();
@@ -26396,7 +26407,7 @@ var init_dist = __esm({
26396
26407
  t2.startsWith("prod") ? i2 = "prod" : t2.startsWith("qa") ? i2 = "qa" : t2.startsWith("dev") && (i2 = "dev"), this.env = i2, Pe.setEnv(i2);
26397
26408
  }
26398
26409
  };
26399
- Ni = class {
26410
+ _i = class {
26400
26411
  constructor() {
26401
26412
  this.TAG = "[WakeLockManager]";
26402
26413
  this.wakeLock = null;
@@ -26430,7 +26441,7 @@ var init_dist = __esm({
26430
26441
  });
26431
26442
  }
26432
26443
  };
26433
- Oi = class {
26444
+ Ni = class {
26434
26445
  constructor(e) {
26435
26446
  this.store = e;
26436
26447
  this.bufferSize = 100;
@@ -26473,7 +26484,7 @@ var init_dist = __esm({
26473
26484
  }
26474
26485
  };
26475
26486
  wa = { autoplayFailed: void 0, initialized: false, autoplayCheckPromise: void 0 };
26476
- xt = class {
26487
+ Ot = class {
26477
26488
  constructor(e, t2, i2) {
26478
26489
  this.store = e;
26479
26490
  this.deviceManager = t2;
@@ -26500,7 +26511,7 @@ var init_dist = __esm({
26500
26511
  var u2, p2;
26501
26512
  d2.e(this.TAG, "error on audio element", s2.error);
26502
26513
  let l2 = S2.TracksErrors.AudioPlaybackError(`Audio playback error for track - ${e2.trackId} code - ${(u2 = s2 == null ? void 0 : s2.error) == null ? void 0 : u2.code}`);
26503
- this.eventBus.analytics.publish(y2.audioPlaybackError(l2)), ((p2 = s2 == null ? void 0 : s2.error) == null ? void 0 : p2.code) === MediaError.MEDIA_ERR_DECODE && (this.removeAudioElement(s2, e2), yield K(500), yield this.handleTrackAdd({ track: e2, peer: t3, callListener: false }));
26514
+ this.eventBus.analytics.publish(y2.audioPlaybackError(l2)), ((p2 = s2 == null ? void 0 : s2.error) == null ? void 0 : p2.code) === MediaError.MEDIA_ERR_DECODE && (this.removeAudioElement(s2, e2), yield Z2(500), yield this.handleTrackAdd({ track: e2, peer: t3, callListener: false }));
26504
26515
  }), e2.setAudioElement(s2), e2.setVolume(this.volume), d2.d(this.TAG, "Audio track added", `${e2}`), this.init(), (o2 = this.audioSink) == null || o2.append(s2), this.outputDevice && (yield e2.setOutputDevice(this.outputDevice)), s2.srcObject = new MediaStream([e2.nativeTrack]), i3 && ((n2 = this.listener) == null || n2.onTrackUpdate(0, e2, t3)), yield this.handleAutoplayError(e2);
26505
26516
  });
26506
26517
  this.handleAutoplayError = (e2) => c2(this, null, function* () {
@@ -26611,7 +26622,7 @@ var init_dist = __esm({
26611
26622
  });
26612
26623
  }
26613
26624
  };
26614
- xi = class {
26625
+ Oi = class {
26615
26626
  constructor(e) {
26616
26627
  this.eventBus = e;
26617
26628
  this.pluginUsage = /* @__PURE__ */ new Map();
@@ -26650,7 +26661,7 @@ var init_dist = __esm({
26650
26661
  this.eventBus.analytics.subscribe((t2) => this.updatePluginUsageData(t2));
26651
26662
  }
26652
26663
  };
26653
- Ut = class {
26664
+ xt = class {
26654
26665
  constructor(e, t2) {
26655
26666
  this.store = e;
26656
26667
  this.eventBus = t2;
@@ -26665,7 +26676,7 @@ var init_dist = __esm({
26665
26676
  this.audioInputChanged = false;
26666
26677
  this.updateOutputDevice = (e2, t3) => c2(this, null, function* () {
26667
26678
  let i3 = this.audioOutput.find((r2) => r2.deviceId === e2);
26668
- return i3 && (this.outputDevice = i3, yield this.store.updateAudioOutputDevice(i3), this.eventBus.analytics.publish(y2.deviceChange({ isUserSelection: t3, selection: { audioOutput: i3 }, devices: this.getDevices(), type: "audioOutput" })), z2.updateSelection("audioOutput", { deviceId: i3.deviceId, groupId: i3.groupId })), i3;
26679
+ return i3 && (this.outputDevice = i3, yield this.store.updateAudioOutputDevice(i3), this.eventBus.analytics.publish(y2.deviceChange({ isUserSelection: t3, selection: { audioOutput: i3 }, devices: this.getDevices(), type: "audioOutput" })), Q2.updateSelection("audioOutput", { deviceId: i3.deviceId, groupId: i3.groupId })), i3;
26669
26680
  });
26670
26681
  this.getCurrentSelection = () => {
26671
26682
  var o2, n2;
@@ -26678,7 +26689,7 @@ var init_dist = __esm({
26678
26689
  let e2 = yield navigator.mediaDevices.enumerateDevices(), t3 = this.videoInput.map(this.createIdentifier), i3 = this.audioInput.map(this.createIdentifier);
26679
26690
  this.audioInput = [], this.audioOutput = [], this.videoInput = [], e2.forEach((r2) => {
26680
26691
  r2.kind === "audioinput" && r2.label ? (this.hasMicrophonePermission = true, this.audioInput.push(r2)) : r2.kind === "audiooutput" ? this.audioOutput.push(r2) : r2.kind === "videoinput" && r2.label && (this.hasWebcamPermission = true, this.videoInput.push(r2));
26681
- }), this.videoInputChanged = this.computeChange(t3, this.videoInput), this.audioInputChanged = this.computeChange(i3, this.audioInput), z2.setDevices({ videoInput: [...this.videoInput], audioInput: [...this.audioInput], audioOutput: [...this.audioOutput] }), this.logDevices("Enumerate Devices");
26692
+ }), this.videoInputChanged = this.computeChange(t3, this.videoInput), this.audioInputChanged = this.computeChange(i3, this.audioInput), Q2.setDevices({ videoInput: [...this.videoInput], audioInput: [...this.audioInput], audioOutput: [...this.audioOutput] }), this.logDevices("Enumerate Devices");
26682
26693
  } catch (e2) {
26683
26694
  d2.e(this.TAG, "Failed enumerating devices", e2);
26684
26695
  }
@@ -26688,7 +26699,7 @@ var init_dist = __esm({
26688
26699
  let e2 = this.store.getLocalPeer();
26689
26700
  !((s2 = (r2 = this.store.getConfig()) == null ? void 0 : r2.settings) == null ? void 0 : s2.videoDeviceId) && (e2 != null && e2.videoTrack) && (yield e2.videoTrack.setSettings({ deviceId: (o2 = this.videoInput[0]) == null ? void 0 : o2.deviceId }, true)), !((l2 = (n2 = this.store.getConfig()) == null ? void 0 : n2.settings) == null ? void 0 : l2.audioInputDeviceId) && (e2 != null && e2.audioTrack) && (yield e2.audioTrack.setSettings({ deviceId: (u2 = this.audioInput[0]) == null ? void 0 : u2.deviceId }, true));
26690
26701
  });
26691
- this.handleDeviceChange = oi(() => c2(this, null, function* () {
26702
+ this.handleDeviceChange = ai(() => c2(this, null, function* () {
26692
26703
  yield this.enumerateDevices(), this.logDevices("After Device Change");
26693
26704
  let e2 = this.store.getLocalPeer();
26694
26705
  yield this.setOutputDevice(true), yield this.handleAudioInputDeviceChange(e2 == null ? void 0 : e2.audioTrack), yield this.handleVideoInputDeviceChange(e2 == null ? void 0 : e2.videoTrack), this.eventBus.analytics.publish(y2.deviceChange({ selection: this.getCurrentSelection(), type: "change", devices: this.getDevices() }));
@@ -26728,7 +26739,7 @@ var init_dist = __esm({
26728
26739
  this.eventBus.analytics.publish(y2.deviceChange({ selection: { videoInput: t3 }, error: S2.TracksErrors.SelectedDeviceMissing("video"), devices: this.getDevices(), type: "video" })), d2.e(this.TAG, "Video device not found");
26729
26740
  return;
26730
26741
  }
26731
- let { settings: i3 } = e2, r2 = new Y2().codec(i3.codec).maxBitrate(i3.maxBitrate).maxFramerate(i3.maxFramerate).setWidth(i3.width).setHeight(i3.height).deviceId(t3.deviceId).build();
26742
+ let { settings: i3 } = e2, r2 = new z2().codec(i3.codec).maxBitrate(i3.maxBitrate).maxFramerate(i3.maxFramerate).setWidth(i3.width).setHeight(i3.height).deviceId(t3.deviceId).build();
26732
26743
  try {
26733
26744
  yield e2.setSettings(r2, true), this.eventBus.deviceChange.publish({ devices: this.getDevices(), selection: t3, type: "video" }), this.logDevices("Video Device Change Success");
26734
26745
  } catch (s2) {
@@ -26794,7 +26805,7 @@ var init_dist = __esm({
26794
26805
  d2.d(this.TAG, e, JSON.stringify({ videoInput: [...this.videoInput], audioInput: [...this.audioInput], audioOutput: [...this.audioOutput], selected: this.getCurrentSelection() }, null, 4));
26795
26806
  }
26796
26807
  };
26797
- Ui = class {
26808
+ xi = class {
26798
26809
  constructor(e, t2) {
26799
26810
  this.deviceManager = e;
26800
26811
  this.audioSinkManager = t2;
@@ -26815,7 +26826,7 @@ var init_dist = __esm({
26815
26826
  }
26816
26827
  unblockAutoplay() {
26817
26828
  return c2(this, null, function* () {
26818
- yield this.audioSinkManager.unblockAutoplay(), yield Ie.resumeContext();
26829
+ yield this.audioSinkManager.unblockAutoplay(), yield He.resumeContext();
26819
26830
  });
26820
26831
  }
26821
26832
  };
@@ -26841,7 +26852,7 @@ var init_dist = __esm({
26841
26852
  };
26842
26853
  }
26843
26854
  };
26844
- Bt = class {
26855
+ Ut = class {
26845
26856
  constructor() {
26846
26857
  this.eventEmitter = new import_eventemitter23.EventEmitter2();
26847
26858
  this.analytics = new V(G2.ANALYTICS, this.eventEmitter);
@@ -26863,7 +26874,7 @@ var init_dist = __esm({
26863
26874
  this.leave = new V(G2.LEAVE, this.eventEmitter);
26864
26875
  }
26865
26876
  };
26866
- Bi = class {
26877
+ Ui = class {
26867
26878
  constructor(e, t2, i2) {
26868
26879
  this.store = e;
26869
26880
  this.listener = t2;
@@ -26881,7 +26892,7 @@ var init_dist = __esm({
26881
26892
  (n2 = this.listener) == null || n2.onPeerUpdate(5, null);
26882
26893
  }
26883
26894
  };
26884
- Vi = class {
26895
+ Bi = class {
26885
26896
  constructor(e) {
26886
26897
  this.listener = e;
26887
26898
  this.TAG = "[BroadcastManager]";
@@ -26894,7 +26905,7 @@ var init_dist = __esm({
26894
26905
  d2.d(this.TAG, `Received Message from sender=${(t2 = e == null ? void 0 : e.peer) == null ? void 0 : t2.peer_id}: ${e}`), (i2 = this.listener) == null || i2.onMessageReceived(e);
26895
26906
  }
26896
26907
  };
26897
- Fi = class {
26908
+ Vi = class {
26898
26909
  constructor(e, t2) {
26899
26910
  this.store = e;
26900
26911
  this.listener = t2;
@@ -26908,7 +26919,7 @@ var init_dist = __esm({
26908
26919
  (r2 = this.listener) == null || r2.onConnectionQualityUpdate(i2);
26909
26920
  }
26910
26921
  };
26911
- ct = class {
26922
+ nt = class {
26912
26923
  constructor(e, t2, i2) {
26913
26924
  this.store = e;
26914
26925
  this.eventBus = t2;
@@ -27040,7 +27051,7 @@ var init_dist = __esm({
27040
27051
  return t2.mute !== i2.mute ? (r2 = i2.mute ? 2 : 3, e.type === "audio" && this.eventBus.audioTrackUpdate.publish({ track: e, enabled: !i2.mute })) : t2.description !== i2.description && (r2 = 4), r2;
27041
27052
  }
27042
27053
  };
27043
- Gi = class extends ct {
27054
+ Fi = class extends nt {
27044
27055
  constructor(t2, i2, r2, s2) {
27045
27056
  super(t2, i2, s2);
27046
27057
  this.transport = r2;
@@ -27080,7 +27091,7 @@ var init_dist = __esm({
27080
27091
  return r2 && ((l2 = (o2 = (s2 = i2 == null ? void 0 : i2.role) == null ? void 0 : s2.subscribeParams) == null ? void 0 : o2.subscribeToRoles) == null ? void 0 : l2.includes((n2 = r2.role) == null ? void 0 : n2.name));
27081
27092
  }
27082
27093
  };
27083
- Wi = class {
27094
+ Gi = class {
27084
27095
  constructor(e, t2, i2, r2) {
27085
27096
  this.store = e;
27086
27097
  this.peerManager = t2;
@@ -27147,7 +27158,7 @@ var init_dist = __esm({
27147
27158
  }
27148
27159
  };
27149
27160
  C = (a11) => a11 ? new Date(a11) : void 0;
27150
- $i = class {
27161
+ Wi = class {
27151
27162
  constructor(e, t2, i2) {
27152
27163
  this.store = e;
27153
27164
  this.trackManager = t2;
@@ -27246,7 +27257,7 @@ var init_dist = __esm({
27246
27257
  });
27247
27258
  }
27248
27259
  };
27249
- Ki = class {
27260
+ $i = class {
27250
27261
  constructor(e, t2) {
27251
27262
  this.store = e;
27252
27263
  this.eventBus = t2;
@@ -27270,11 +27281,11 @@ var init_dist = __esm({
27270
27281
  }
27271
27282
  }
27272
27283
  };
27273
- Vt = (a11, e, t2) => {
27284
+ Bt = (a11, e, t2) => {
27274
27285
  let i2 = t2 === "qa" ? Ws : Gs, r2 = new URL(i2);
27275
27286
  return r2.searchParams.set("endpoint", `https://${e}`), r2.searchParams.set("token", a11), r2.toString();
27276
27287
  };
27277
- qi = class {
27288
+ Ki = class {
27278
27289
  constructor(e, t2, i2) {
27279
27290
  this.transport = e;
27280
27291
  this.store = t2;
@@ -27292,7 +27303,7 @@ var init_dist = __esm({
27292
27303
  let t2 = this.store.getWhiteboard(e == null ? void 0 : e.id), i2 = t2 == null ? void 0 : t2.id;
27293
27304
  if (t2 || (i2 = (yield this.transport.signal.createWhiteboard(this.getCreateOptionsWithDefaults(e))).id), !i2)
27294
27305
  throw new Error(`Whiteboard ID: ${i2} not found`);
27295
- let r2 = yield this.transport.signal.getWhiteboard({ id: i2 }), s2 = M2(m({}, t2), { title: e == null ? void 0 : e.title, attributes: e == null ? void 0 : e.attributes, id: r2.id, url: Vt(r2.token, r2.addr, this.store.getEnv()), token: r2.token, addr: r2.addr, owner: r2.owner, permissions: r2.permissions || [], open: true });
27306
+ let r2 = yield this.transport.signal.getWhiteboard({ id: i2 }), s2 = M2(m({}, t2), { title: e == null ? void 0 : e.title, attributes: e == null ? void 0 : e.attributes, id: r2.id, url: Bt(r2.token, r2.addr, this.store.getEnv()), token: r2.token, addr: r2.addr, owner: r2.owner, permissions: r2.permissions || [], open: true });
27296
27307
  this.store.setWhiteboard(s2), (o2 = this.listener) == null || o2.onWhiteboardUpdate(s2);
27297
27308
  });
27298
27309
  }
@@ -27317,7 +27328,7 @@ var init_dist = __esm({
27317
27328
  let e = this.store.getWhiteboards();
27318
27329
  for (let s2 of e.values())
27319
27330
  if (s2.url) {
27320
- let o2 = yield this.transport.signal.getWhiteboard({ id: s2.id }), n2 = this.store.getLocalPeer(), u2 = (n2 == null ? void 0 : n2.customerUserId) === o2.owner ? (i2 = (t2 = n2.role) == null ? void 0 : t2.permissions.whiteboard) == null ? void 0 : i2.includes("admin") : o2.permissions.length > 0, p2 = M2(m({}, s2), { id: o2.id, url: Vt(o2.token, o2.addr, this.store.getEnv()), token: o2.token, addr: o2.addr, owner: o2.owner, permissions: o2.permissions, open: u2 });
27331
+ let o2 = yield this.transport.signal.getWhiteboard({ id: s2.id }), n2 = this.store.getLocalPeer(), u2 = (n2 == null ? void 0 : n2.customerUserId) === o2.owner ? (i2 = (t2 = n2.role) == null ? void 0 : t2.permissions.whiteboard) == null ? void 0 : i2.includes("admin") : o2.permissions.length > 0, p2 = M2(m({}, s2), { id: o2.id, url: Bt(o2.token, o2.addr, this.store.getEnv()), token: o2.token, addr: o2.addr, owner: o2.owner, permissions: o2.permissions, open: u2 });
27321
27332
  this.store.setWhiteboard(p2), (r2 = this.listener) == null || r2.onWhiteboardUpdate(p2);
27322
27333
  }
27323
27334
  });
@@ -27331,12 +27342,12 @@ var init_dist = __esm({
27331
27342
  }), { title: (e == null ? void 0 : e.title) || `${(o2 = this.store.getRoom()) == null ? void 0 : o2.id} Whiteboard`, reader: (e == null ? void 0 : e.reader) || i2, writer: (e == null ? void 0 : e.writer) || r2, admin: (e == null ? void 0 : e.admin) || s2 };
27332
27343
  }
27333
27344
  };
27334
- Ft = class {
27345
+ Vt = class {
27335
27346
  constructor(e, t2, i2) {
27336
27347
  this.transport = e;
27337
27348
  this.store = t2;
27338
27349
  this.listener = i2;
27339
- this.whiteboard = new qi(e, t2, i2);
27350
+ this.whiteboard = new Ki(e, t2, i2);
27340
27351
  }
27341
27352
  setListener(e) {
27342
27353
  this.listener = e, this.whiteboard.setListener(e);
@@ -27346,7 +27357,7 @@ var init_dist = __esm({
27346
27357
  var o2, n2;
27347
27358
  let t2 = { customerID: "userid", peerID: "peerid", userName: "username" }, { poll_id: i2 } = yield this.transport.signal.setPollInfo(M2(m({}, e), { mode: e.mode ? t2[e.mode] : void 0, poll_id: e.id, vote: e.rolesThatCanVote, responses: e.rolesThatCanViewResponses }));
27348
27359
  e.id || (e.id = i2), Array.isArray(e.questions) && (yield this.addQuestionsToPoll(e.id, e.questions));
27349
- let r2 = yield this.transport.signal.getPollQuestions({ poll_id: e.id, index: 0, count: 50 }), s2 = ji(M2(m({}, e), { poll_id: e.id, state: "created", created_by: (o2 = this.store.getLocalPeer()) == null ? void 0 : o2.peerId }));
27360
+ let r2 = yield this.transport.signal.getPollQuestions({ poll_id: e.id, index: 0, count: 50 }), s2 = qi(M2(m({}, e), { poll_id: e.id, state: "created", created_by: (o2 = this.store.getLocalPeer()) == null ? void 0 : o2.peerId }));
27350
27361
  s2.questions = r2.questions.map(({ question: l2, options: u2, answer: p2 }) => M2(m({}, l2), { options: u2, answer: p2 })), (n2 = this.listener) == null || n2.onPollsUpdate(0, [s2]);
27351
27362
  });
27352
27363
  }
@@ -27399,8 +27410,8 @@ var init_dist = __esm({
27399
27410
  var h2, T;
27400
27411
  let p2 = (h2 = e == null ? void 0 : e.questions) == null ? void 0 : h2.find((g2) => g2.index === n2.question);
27401
27412
  if (p2) {
27402
- let g2 = { id: n2.response_id, questionIndex: n2.question, option: n2.option, options: n2.options, text: n2.text, responseFinal: u2, peer: { peerid: l2.peerid, userHash: l2.hash, userid: l2.userid, username: l2.username }, skipped: n2.skipped, type: n2.type, update: n2.update }, v2 = p2.responses && !t2 ? [...p2.responses] : [];
27403
- (T = r2.questions) != null && T[n2.question - 1] && (r2.questions[n2.question - 1].responses = [...v2, g2]);
27413
+ let g2 = { id: n2.response_id, questionIndex: n2.question, option: n2.option, options: n2.options, text: n2.text, responseFinal: u2, peer: { peerid: l2.peerid, userHash: l2.hash, userid: l2.userid, username: l2.username }, skipped: n2.skipped, type: n2.type, update: n2.update }, f2 = p2.responses && !t2 ? [...p2.responses] : [];
27414
+ (T = r2.questions) != null && T[n2.question - 1] && (r2.questions[n2.question - 1].responses = [...f2, g2]);
27404
27415
  }
27405
27416
  }), this.store.setPoll(r2), (o2 = this.listener) == null || o2.onPollsUpdate(4, [r2]);
27406
27417
  });
@@ -27414,10 +27425,10 @@ var init_dist = __esm({
27414
27425
  r2 = [...l2.polls, ...r2, ...u2.polls];
27415
27426
  }
27416
27427
  for (let l2 of r2) {
27417
- let u2 = yield this.transport.signal.getPollQuestions({ poll_id: l2.poll_id, index: 0, count: 50 }), p2 = ji(l2), h2 = this.store.getPoll(l2.poll_id);
27418
- p2.questions = u2.questions.map(({ question: T, options: g2, answer: v2 }, E2) => {
27428
+ let u2 = yield this.transport.signal.getPollQuestions({ poll_id: l2.poll_id, index: 0, count: 50 }), p2 = qi(l2), h2 = this.store.getPoll(l2.poll_id);
27429
+ p2.questions = u2.questions.map(({ question: T, options: g2, answer: f2 }, P8) => {
27419
27430
  var k2, w2;
27420
- return M2(m({}, T), { options: g2, answer: v2, responses: (w2 = (k2 = h2 == null ? void 0 : h2.questions) == null ? void 0 : k2[E2]) == null ? void 0 : w2.responses });
27431
+ return M2(m({}, T), { options: g2, answer: f2, responses: (w2 = (k2 = h2 == null ? void 0 : h2.questions) == null ? void 0 : k2[P8]) == null ? void 0 : w2.responses });
27421
27432
  }), t2.push(p2), this.store.setPoll(p2);
27422
27433
  }
27423
27434
  return (n2 = this.listener) == null || n2.onPollsUpdate(3, t2), t2;
@@ -27440,11 +27451,11 @@ var init_dist = __esm({
27440
27451
  return i2;
27441
27452
  }
27442
27453
  };
27443
- ji = (a11) => {
27454
+ qi = (a11) => {
27444
27455
  let e = { userid: "customerID", peerid: "peerID", username: "userName" };
27445
27456
  return { id: a11.poll_id, title: a11.title, startedBy: a11.started_by, createdBy: a11.created_by, anonymous: a11.anonymous, type: a11.type, duration: a11.duration, locked: a11.locked, mode: a11.mode ? e[a11.mode] : void 0, visibility: a11.visibility, rolesThatCanVote: a11.vote || [], rolesThatCanViewResponses: a11.responses || [], state: a11.state, stoppedBy: a11.stopped_by, startedAt: C(a11.started_at), stoppedAt: C(a11.stopped_at), createdAt: C(a11.created_at) };
27446
27457
  };
27447
- Ji = class {
27458
+ ji = class {
27448
27459
  constructor(e, t2, i2) {
27449
27460
  this.store = e;
27450
27461
  this.transport = t2;
@@ -27477,7 +27488,7 @@ var init_dist = __esm({
27477
27488
  (i2 = this.listener) == null || i2.onPollsUpdate(1, [o2]);
27478
27489
  return;
27479
27490
  }
27480
- let n2 = yield this.transport.signal.getPollQuestions({ poll_id: s2.poll_id, index: 0, count: 50 }), l2 = ji(s2);
27491
+ let n2 = yield this.transport.signal.getPollQuestions({ poll_id: s2.poll_id, index: 0, count: 50 }), l2 = qi(s2);
27481
27492
  l2.questions = n2.questions.map(({ question: u2, options: p2, answer: h2 }) => M2(m({}, u2), { options: p2, answer: h2 })), yield this.updatePollResponses(l2, true), t2.push(l2), this.store.setPoll(l2);
27482
27493
  }
27483
27494
  (r2 = this.listener) == null || r2.onPollsUpdate(1, t2);
@@ -27537,7 +27548,7 @@ var init_dist = __esm({
27537
27548
  });
27538
27549
  }
27539
27550
  };
27540
- Qi = class {
27551
+ Ji = class {
27541
27552
  constructor(e, t2) {
27542
27553
  this.store = e;
27543
27554
  this.listener = t2;
@@ -27598,7 +27609,7 @@ var init_dist = __esm({
27598
27609
  return e && (s2 = s2.filter((o2) => o2.type === e)), t2 && (s2 = s2.filter((o2) => o2.source === t2)), s2.filter((o2) => o2.enabled !== i2);
27599
27610
  }
27600
27611
  };
27601
- zi = class {
27612
+ Qi = class {
27602
27613
  constructor(e, t2) {
27603
27614
  this.store = e;
27604
27615
  this.listener = t2;
@@ -27751,11 +27762,11 @@ var init_dist = __esm({
27751
27762
  toSdkError(e) {
27752
27763
  if (!(e != null && e.code))
27753
27764
  return;
27754
- let t2 = e.message || "error in streaming/recording", i2 = new f2(e.code, "ServerErrors", "NONE", t2, t2);
27765
+ let t2 = e.message || "error in streaming/recording", i2 = new v2(e.code, "ServerErrors", "NONE", t2, t2);
27755
27766
  return d2.e(this.TAG, "error in streaming/recording", i2), i2;
27756
27767
  }
27757
27768
  };
27758
- Yi = class {
27769
+ zi = class {
27759
27770
  constructor(e, t2) {
27760
27771
  this.store = e;
27761
27772
  this.listener = t2;
@@ -27769,7 +27780,7 @@ var init_dist = __esm({
27769
27780
  (i2 = this.listener) == null || i2.onSessionStoreUpdate(t2);
27770
27781
  }
27771
27782
  };
27772
- Xi = class {
27783
+ Yi = class {
27773
27784
  constructor(e, t2, i2) {
27774
27785
  this.store = e;
27775
27786
  this.transport = t2;
@@ -27794,13 +27805,13 @@ var init_dist = __esm({
27794
27805
  o2.url = i2 == null ? void 0 : i2.url, o2.token = i2 == null ? void 0 : i2.token, o2.addr = i2 == null ? void 0 : i2.addr, o2.permissions = i2 == null ? void 0 : i2.permissions;
27795
27806
  else {
27796
27807
  let l2 = yield this.transport.signal.getWhiteboard({ id: e.id });
27797
- o2.url = Vt(l2.token, l2.addr, this.store.getEnv()), o2.token = l2.token, o2.addr = l2.addr, o2.permissions = l2.permissions, o2.open = l2.permissions.length > 0;
27808
+ o2.url = Bt(l2.token, l2.addr, this.store.getEnv()), o2.token = l2.token, o2.addr = l2.addr, o2.permissions = l2.permissions, o2.open = l2.permissions.length > 0;
27798
27809
  }
27799
27810
  this.store.setWhiteboard(o2), (n2 = this.listener) == null || n2.onWhiteboardUpdate(o2);
27800
27811
  });
27801
27812
  }
27802
27813
  };
27803
- Zi = class {
27814
+ Xi = class {
27804
27815
  constructor(e, t2, i2, r2, s2, o2) {
27805
27816
  this.store = e;
27806
27817
  this.transport = i2;
@@ -27827,7 +27838,7 @@ var init_dist = __esm({
27827
27838
  this.peerManager.handlePeerInfoUpdate({ peer: i3, name: e2, data: t3 });
27828
27839
  };
27829
27840
  let n2 = this.transport.isFlagEnabled("onDemandTracks");
27830
- this.trackManager = n2 ? new Gi(this.store, t2, this.transport, this.listener) : new ct(this.store, t2, this.listener), this.peerManager = new $i(this.store, this.trackManager, this.listener), this.peerListManager = new Wi(this.store, this.peerManager, this.trackManager, this.listener), this.broadcastManager = new Vi(this.listener), this.policyChangeManager = new Ki(this.store, t2), this.requestManager = new Qi(this.store, this.listener), this.activeSpeakerManager = new Bi(this.store, this.listener, this.audioListener), this.connectionQualityManager = new Fi(this.store, this.connectionQualityListener), this.roomUpdateManager = new zi(this.store, this.listener), this.sessionMetadataManager = new Yi(this.store, this.listener), this.pollsManager = new Ji(this.store, this.transport, this.listener), this.whiteboardManager = new Xi(this.store, this.transport, this.listener);
27841
+ this.trackManager = n2 ? new Fi(this.store, t2, this.transport, this.listener) : new nt(this.store, t2, this.listener), this.peerManager = new Wi(this.store, this.trackManager, this.listener), this.peerListManager = new Gi(this.store, this.peerManager, this.trackManager, this.listener), this.broadcastManager = new Bi(this.listener), this.policyChangeManager = new $i(this.store, t2), this.requestManager = new Ji(this.store, this.listener), this.activeSpeakerManager = new Ui(this.store, this.listener, this.audioListener), this.connectionQualityManager = new Vi(this.store, this.connectionQualityListener), this.roomUpdateManager = new Qi(this.store, this.listener), this.sessionMetadataManager = new zi(this.store, this.listener), this.pollsManager = new ji(this.store, this.transport, this.listener), this.whiteboardManager = new Yi(this.store, this.transport, this.listener);
27831
27842
  }
27832
27843
  setListener(e) {
27833
27844
  this.listener = e, this.trackManager.listener = e, this.peerManager.listener = e, this.peerListManager.listener = e, this.broadcastManager.listener = e, this.requestManager.listener = e, this.activeSpeakerManager.listener = e, this.roomUpdateManager.listener = e, this.sessionMetadataManager.listener = e, this.pollsManager.listener = e, this.whiteboardManager.listener = e;
@@ -27879,7 +27890,7 @@ var init_dist = __esm({
27879
27890
  }
27880
27891
  }
27881
27892
  };
27882
- er = class {
27893
+ Zi = class {
27883
27894
  constructor(e) {
27884
27895
  this.transport = e;
27885
27896
  this.observedKeys = /* @__PURE__ */ new Set();
@@ -27919,7 +27930,7 @@ var init_dist = __esm({
27919
27930
  });
27920
27931
  }
27921
27932
  };
27922
- tr = class {
27933
+ er = class {
27923
27934
  constructor(e, t2, i2 = "", r2 = "", s2 = "https://prod-init.100ms.live/init", o2 = false, n2) {
27924
27935
  this.authToken = e;
27925
27936
  this.peerId = t2;
@@ -27930,17 +27941,17 @@ var init_dist = __esm({
27930
27941
  this.iceServers = n2;
27931
27942
  }
27932
27943
  };
27933
- J = ((s2) => (s2[s2.ConnectFailed = 0] = "ConnectFailed", s2[s2.SignalDisconnect = 1] = "SignalDisconnect", s2[s2.JoinWSMessageFailed = 2] = "JoinWSMessageFailed", s2[s2.PublishIceConnectionFailed = 3] = "PublishIceConnectionFailed", s2[s2.SubscribeIceConnectionFailed = 4] = "SubscribeIceConnectionFailed", s2))(J || {});
27944
+ j2 = ((s2) => (s2[s2.ConnectFailed = 0] = "ConnectFailed", s2[s2.SignalDisconnect = 1] = "SignalDisconnect", s2[s2.JoinWSMessageFailed = 2] = "JoinWSMessageFailed", s2[s2.PublishIceConnectionFailed = 3] = "PublishIceConnectionFailed", s2[s2.SubscribeIceConnectionFailed = 4] = "SubscribeIceConnectionFailed", s2))(j2 || {});
27934
27945
  _a7 = { 0: [], 1: [], 2: [1], 3: [1], 4: [1] };
27935
- ir = ((n2) => (n2.Disconnected = "Disconnected", n2.Connecting = "Connecting", n2.Joined = "Joined", n2.Preview = "Preview", n2.Failed = "Failed", n2.Reconnecting = "Reconnecting", n2.Leaving = "Leaving", n2))(ir || {});
27936
- rr = class {
27946
+ tr = ((n2) => (n2.Disconnected = "Disconnected", n2.Connecting = "Connecting", n2.Joined = "Joined", n2.Preview = "Preview", n2.Failed = "Failed", n2.Reconnecting = "Reconnecting", n2.Leaving = "Leaving", n2))(tr || {});
27947
+ ir = class {
27937
27948
  constructor(e) {
27938
27949
  this.promise = new Promise((t2, i2) => {
27939
27950
  this.resolve = t2, this.reject = i2, e(t2, i2);
27940
27951
  });
27941
27952
  }
27942
27953
  };
27943
- sr = class {
27954
+ rr = class {
27944
27955
  constructor(e, t2) {
27945
27956
  this.onStateChange = e;
27946
27957
  this.sendEvent = t2;
@@ -27961,29 +27972,29 @@ var init_dist = __esm({
27961
27972
  }
27962
27973
  scheduleTask(l2) {
27963
27974
  return c2(this, arguments, function* ({ category: e, error: t2, changeState: i2, task: r2, originalState: s2, maxFailedRetries: o2 = 5, failedRetryCount: n2 = 0 }) {
27964
- if (d2.d(this.TAG, "schedule: ", { category: J[e], error: t2 }), n2 === 0) {
27975
+ if (d2.d(this.TAG, "schedule: ", { category: j2[e], error: t2 }), n2 === 0) {
27965
27976
  let g2 = this.inProgress.get(e);
27966
27977
  if (g2) {
27967
- d2.d(this.TAG, `schedule: Already a task for ${J[e]} scheduled, waiting for its completion`), yield g2.promise;
27978
+ d2.d(this.TAG, `schedule: Already a task for ${j2[e]} scheduled, waiting for its completion`), yield g2.promise;
27968
27979
  return;
27969
27980
  }
27970
- let v2 = new rr((E2, k2) => {
27981
+ let f2 = new ir((P8, k2) => {
27971
27982
  });
27972
- this.inProgress.set(e, v2), this.sendEvent(t2, e);
27983
+ this.inProgress.set(e, f2), this.sendEvent(t2, e);
27973
27984
  }
27974
27985
  let u2 = false, p2 = _a7[e];
27975
27986
  for (let g2 in p2) {
27976
- let v2 = p2[parseInt(g2)];
27987
+ let f2 = p2[parseInt(g2)];
27977
27988
  try {
27978
- let E2 = this.inProgress.get(v2);
27979
- E2 && (d2.d(this.TAG, `schedule: Suspending retry task of ${J[e]}, waiting for ${J[v2]} to recover`), yield E2.promise, d2.d(this.TAG, `schedule: Resuming retry task ${J[e]} as it's dependency ${J[v2]} is recovered`));
27980
- } catch (E2) {
27981
- d2.d(this.TAG, `schedule: Stopping retry task of ${J[e]} as it's dependency ${J[v2]} failed to recover`), u2 = true;
27989
+ let P8 = this.inProgress.get(f2);
27990
+ P8 && (d2.d(this.TAG, `schedule: Suspending retry task of ${j2[e]}, waiting for ${j2[f2]} to recover`), yield P8.promise, d2.d(this.TAG, `schedule: Resuming retry task ${j2[e]} as it's dependency ${j2[f2]} is recovered`));
27991
+ } catch (P8) {
27992
+ d2.d(this.TAG, `schedule: Stopping retry task of ${j2[e]} as it's dependency ${j2[f2]} failed to recover`), u2 = true;
27982
27993
  break;
27983
27994
  }
27984
27995
  }
27985
27996
  if (n2 >= o2 || u2) {
27986
- if (t2.description += `. [${J[e]}] Could not recover after ${n2} tries`, u2 && (t2.description += ` Could not recover all of it's required dependencies - [${p2.map((g2) => J[g2]).toString()}]`), t2.isTerminal = true, this.inProgress.delete(e), this.sendEvent(t2, e), this.reset(), i2)
27997
+ if (t2.description += `. [${j2[e]}] Could not recover after ${n2} tries`, u2 && (t2.description += ` Could not recover all of it's required dependencies - [${p2.map((g2) => j2[g2]).toString()}]`), t2.isTerminal = true, this.inProgress.delete(e), this.sendEvent(t2, e), this.reset(), i2)
27987
27998
  this.onStateChange("Failed", t2);
27988
27999
  else
27989
28000
  throw t2;
@@ -27991,16 +28002,16 @@ var init_dist = __esm({
27991
28002
  }
27992
28003
  i2 && this.onStateChange("Reconnecting", t2);
27993
28004
  let h2 = this.getDelayForRetryCount(e, n2);
27994
- d2.d(this.TAG, `schedule: [${J[e]}] [failedRetryCount=${n2}] Scheduling retry task in ${h2}ms`);
28005
+ d2.d(this.TAG, `schedule: [${j2[e]}] [failedRetryCount=${n2}] Scheduling retry task in ${h2}ms`);
27995
28006
  let T;
27996
28007
  try {
27997
28008
  T = yield this.setTimeoutPromise(r2, h2);
27998
28009
  } catch (g2) {
27999
- T = false, d2.w(this.TAG, `[${J[e]}] Un-caught exception ${g2.name} in retry-task, initiating retry`, g2);
28010
+ T = false, d2.w(this.TAG, `[${j2[e]}] Un-caught exception ${g2.name} in retry-task, initiating retry`, g2);
28000
28011
  }
28001
28012
  if (T) {
28002
28013
  let g2 = this.inProgress.get(e);
28003
- this.inProgress.delete(e), g2 == null || g2.resolve(n2), i2 && this.inProgress.size === 0 && this.onStateChange(s2), d2.d(this.TAG, `schedule: [${J[e]}] [failedRetryCount=${n2}] Recovered \u267B\uFE0F`);
28014
+ this.inProgress.delete(e), g2 == null || g2.resolve(n2), i2 && this.inProgress.size === 0 && this.onStateChange(s2), d2.d(this.TAG, `schedule: [${j2[e]}] [failedRetryCount=${n2}] Recovered \u267B\uFE0F`);
28004
28015
  } else
28005
28016
  yield this.scheduleTask({ category: e, error: t2, changeState: i2, task: r2, originalState: s2, maxFailedRetries: o2, failedRetryCount: n2 + 1 });
28006
28017
  });
@@ -28028,7 +28039,7 @@ var init_dist = __esm({
28028
28039
  });
28029
28040
  }
28030
28041
  };
28031
- ar = class extends He {
28042
+ sr = class extends Ce {
28032
28043
  constructor() {
28033
28044
  super(100);
28034
28045
  this.localStorage = new le("hms-analytics");
@@ -28049,7 +28060,7 @@ var init_dist = __esm({
28049
28060
  });
28050
28061
  }
28051
28062
  };
28052
- or = class {
28063
+ ar = class {
28053
28064
  constructor() {
28054
28065
  this.TAG = "[AnalyticsTransport]";
28055
28066
  }
@@ -28079,14 +28090,14 @@ var init_dist = __esm({
28079
28090
  }
28080
28091
  }
28081
28092
  };
28082
- nr = class extends or {
28093
+ or = class extends ar {
28083
28094
  constructor(t2) {
28084
28095
  super();
28085
28096
  this.transportProvider = t2;
28086
- this.failedEvents = new ar();
28097
+ this.failedEvents = new sr();
28087
28098
  }
28088
28099
  };
28089
- dt = class {
28100
+ ct = class {
28090
28101
  constructor(e, t2, i2, r2) {
28091
28102
  this.store = e;
28092
28103
  this.eventBus = t2;
@@ -28105,7 +28116,7 @@ var init_dist = __esm({
28105
28116
  startLoop() {
28106
28117
  return c2(this, null, function* () {
28107
28118
  for (; this.shouldSendEvent; )
28108
- yield K(this.pushInterval * 1e3), this.sendEvent();
28119
+ yield Z2(this.pushInterval * 1e3), this.sendEvent();
28109
28120
  });
28110
28121
  }
28111
28122
  sendEvent() {
@@ -28121,7 +28132,7 @@ var init_dist = __esm({
28121
28132
  });
28122
28133
  }
28123
28134
  };
28124
- lt = class {
28135
+ dt = class {
28125
28136
  constructor({ track: e, ssrc: t2, rid: i2, kind: r2, sampleWindowSize: s2 }) {
28126
28137
  this.samples = [];
28127
28138
  this.tempStats = [];
@@ -28164,10 +28175,10 @@ var init_dist = __esm({
28164
28175
  return this.tempStats.reduce((r2, s2) => r2 + ((s2[e] || 0) > t2 ? 1 : 0), 0);
28165
28176
  }
28166
28177
  };
28167
- cr = (a11, e) => a11 && e && (a11.frameWidth !== e.frameWidth || a11.frameHeight !== e.frameHeight);
28168
- dr = (a11, e) => a11 && e && a11.enabled !== e.enabled;
28169
- Gt = (a11) => Object.entries(a11).filter(([, e]) => e !== void 0).reduce((e, [t2, i2]) => (e[t2] = i2, e), {});
28170
- Wt = class extends dt {
28178
+ nr = (a11, e) => a11 && e && (a11.frameWidth !== e.frameWidth || a11.frameHeight !== e.frameHeight);
28179
+ cr = (a11, e) => a11 && e && a11.enabled !== e.enabled;
28180
+ Ft = (a11) => Object.entries(a11).filter(([, e]) => e !== void 0).reduce((e, [t2, i2]) => (e[t2] = i2, e), {});
28181
+ Gt = class extends ct {
28171
28182
  constructor() {
28172
28183
  super(...arguments);
28173
28184
  this.trackAnalytics = /* @__PURE__ */ new Map();
@@ -28187,13 +28198,13 @@ var init_dist = __esm({
28187
28198
  Object.keys(r2).forEach((s2) => {
28188
28199
  let o2 = r2[s2], n2 = this.store.getLocalPeerTracks().find((l2) => l2.getTrackIDBeingSent() === s2);
28189
28200
  Object.keys(o2).forEach((l2) => {
28190
- var g2, v2, E2;
28201
+ var g2, f2, P8;
28191
28202
  let u2 = o2[l2];
28192
28203
  if (!n2)
28193
28204
  return;
28194
- let p2 = this.getTrackIdentifier(n2.trackId, u2), h2 = M2(m({}, u2), { availableOutgoingBitrate: (v2 = (g2 = t2.getLocalPeerStats()) == null ? void 0 : g2.publish) == null ? void 0 : v2.availableOutgoingBitrate });
28205
+ let p2 = this.getTrackIdentifier(n2.trackId, u2), h2 = M2(m({}, u2), { availableOutgoingBitrate: (f2 = (g2 = t2.getLocalPeerStats()) == null ? void 0 : g2.publish) == null ? void 0 : f2.availableOutgoingBitrate });
28195
28206
  if (p2 && this.trackAnalytics.has(p2))
28196
- (E2 = this.trackAnalytics.get(p2)) == null || E2.pushTempStat(h2);
28207
+ (P8 = this.trackAnalytics.get(p2)) == null || P8.pushTempStat(h2);
28197
28208
  else if (n2) {
28198
28209
  let k2 = new zr({ track: n2, sampleWindowSize: this.sampleWindowSize, rid: u2.rid, ssrc: u2.ssrc.toString(), kind: u2.kind });
28199
28210
  k2.pushTempStat(h2), this.trackAnalytics.set(this.getTrackIdentifier(n2.trackId, u2), k2);
@@ -28207,22 +28218,22 @@ var init_dist = __esm({
28207
28218
  return i2.rid ? `${t2}:${i2.rid}` : t2;
28208
28219
  }
28209
28220
  };
28210
- zr = class extends lt {
28221
+ zr = class extends dt {
28211
28222
  constructor() {
28212
28223
  super(...arguments);
28213
28224
  this.samples = [];
28214
28225
  this.collateSample = () => {
28215
28226
  let t2 = this.getLatestStat(), i2 = t2.qualityLimitationDurations, r2 = i2 && { bandwidth_sec: i2.bandwidth, cpu_sec: i2.cpu, other_sec: i2.other }, s2 = t2.frameHeight ? { height_px: this.getLatestStat().frameHeight, width_px: this.getLatestStat().frameWidth } : void 0, o2 = this.calculateAverage("jitter", false), n2 = o2 ? Math.round(o2 * 1e3) : void 0, l2 = this.calculateAverage("roundTripTime", false), u2 = l2 ? Math.round(l2 * 1e3) : void 0;
28216
- return Gt({ timestamp: Date.now(), avg_available_outgoing_bitrate_bps: this.calculateAverage("availableOutgoingBitrate"), avg_bitrate_bps: this.calculateAverage("bitrate"), avg_fps: this.calculateAverage("framesPerSecond"), total_packets_lost: this.getLatestStat().packetsLost, total_packets_sent: this.getLatestStat().packetsSent, total_packet_sent_delay_sec: parseFloat(this.calculateDifferenceForSample("totalPacketSendDelay").toFixed(4)), total_fir_count: this.calculateDifferenceForSample("firCount"), total_pli_count: this.calculateDifferenceForSample("pliCount"), total_nack_count: this.calculateDifferenceForSample("nackCount"), avg_jitter_ms: n2, avg_round_trip_time_ms: u2, total_quality_limitation: r2, resolution: s2 });
28227
+ return Ft({ timestamp: Date.now(), avg_available_outgoing_bitrate_bps: this.calculateAverage("availableOutgoingBitrate"), avg_bitrate_bps: this.calculateAverage("bitrate"), avg_fps: this.calculateAverage("framesPerSecond"), total_packets_lost: this.getLatestStat().packetsLost, total_packets_sent: this.getLatestStat().packetsSent, total_packet_sent_delay_sec: parseFloat(this.calculateDifferenceForSample("totalPacketSendDelay").toFixed(4)), total_fir_count: this.calculateDifferenceForSample("firCount"), total_pli_count: this.calculateDifferenceForSample("pliCount"), total_nack_count: this.calculateDifferenceForSample("nackCount"), avg_jitter_ms: n2, avg_round_trip_time_ms: u2, total_quality_limitation: r2, resolution: s2 });
28217
28228
  };
28218
28229
  this.shouldCreateSample = () => {
28219
28230
  let t2 = this.tempStats.length, i2 = this.tempStats[t2 - 1], r2 = this.tempStats[t2 - 2];
28220
- return t2 === 30 || dr(i2, r2) || i2.kind === "video" && cr(i2, r2);
28231
+ return t2 === 30 || cr(i2, r2) || i2.kind === "video" && nr(i2, r2);
28221
28232
  };
28222
28233
  this.toAnalytics = () => ({ track_id: this.track_id, ssrc: this.ssrc, source: this.source, rid: this.rid, samples: this.samples });
28223
28234
  }
28224
28235
  };
28225
- $t = class extends dt {
28236
+ Wt = class extends ct {
28226
28237
  constructor() {
28227
28238
  super(...arguments);
28228
28239
  this.trackAnalytics = /* @__PURE__ */ new Map();
@@ -28240,9 +28251,9 @@ var init_dist = __esm({
28240
28251
  handleStatsUpdate(t2) {
28241
28252
  let i2 = t2.getAllRemoteTracksStats(), r2 = false;
28242
28253
  Object.keys(i2).forEach((s2) => {
28243
- var v2, E2;
28244
- let o2 = this.store.getTrackById(s2), n2 = i2[s2], l2 = (v2 = this.trackAnalytics.get(s2)) == null ? void 0 : v2.getLatestStat(), p2 = ((k2, w2) => {
28245
- let Oe = (w2 == null ? void 0 : w2.jitterBufferDelay) || 0, Zt = (w2 == null ? void 0 : w2.jitterBufferEmittedCount) || 0, x2 = ((k2 == null ? void 0 : k2.jitterBufferDelay) || 0) - Oe, $ = ((k2 == null ? void 0 : k2.jitterBufferEmittedCount) || 0) - Zt;
28254
+ var f2, P8;
28255
+ let o2 = this.store.getTrackById(s2), n2 = i2[s2], l2 = (f2 = this.trackAnalytics.get(s2)) == null ? void 0 : f2.getLatestStat(), p2 = ((k2, w2) => {
28256
+ let Oe = (w2 == null ? void 0 : w2.jitterBufferDelay) || 0, Xt = (w2 == null ? void 0 : w2.jitterBufferEmittedCount) || 0, x2 = ((k2 == null ? void 0 : k2.jitterBufferDelay) || 0) - Oe, $ = ((k2 == null ? void 0 : k2.jitterBufferEmittedCount) || 0) - Xt;
28246
28257
  return $ > 0 ? x2 * 1e3 / $ : (w2 == null ? void 0 : w2.calculatedJitterBufferDelay) || 0;
28247
28258
  })(n2, l2), h2 = this.calculateAvSyncForStat(n2, t2), T = M2(m({}, n2), { calculatedJitterBufferDelay: p2, avSync: h2 });
28248
28259
  if (n2.kind === "video") {
@@ -28250,7 +28261,7 @@ var init_dist = __esm({
28250
28261
  T.expectedFrameHeight = k2 == null ? void 0 : k2.resolution.height, T.expectedFrameWidth = k2 == null ? void 0 : k2.resolution.width;
28251
28262
  }
28252
28263
  if (this.trackAnalytics.has(s2))
28253
- (E2 = this.trackAnalytics.get(s2)) == null || E2.pushTempStat(T);
28264
+ (P8 = this.trackAnalytics.get(s2)) == null || P8.pushTempStat(T);
28254
28265
  else if (o2) {
28255
28266
  let k2 = new Xr({ track: o2, sampleWindowSize: this.sampleWindowSize, ssrc: n2.ssrc.toString(), kind: n2.kind });
28256
28267
  k2.pushTempStat(T), this.trackAnalytics.set(s2, k2);
@@ -28264,41 +28275,41 @@ var init_dist = __esm({
28264
28275
  return;
28265
28276
  let r2 = this.store.getPeerById(t2.peerID), s2 = r2 == null ? void 0 : r2.audioTrack, o2 = r2 == null ? void 0 : r2.videoTrack;
28266
28277
  if (!(s2 && o2 && s2.enabled && o2.enabled))
28267
- return Pt;
28278
+ return kt;
28268
28279
  let l2 = i2.getRemoteTrackStats(s2.trackId);
28269
28280
  if (!l2)
28270
- return Pt;
28281
+ return kt;
28271
28282
  if (l2.estimatedPlayoutTimestamp)
28272
28283
  return l2.estimatedPlayoutTimestamp - t2.estimatedPlayoutTimestamp;
28273
28284
  }
28274
28285
  };
28275
- Xr = class extends lt {
28286
+ Xr = class extends dt {
28276
28287
  constructor() {
28277
28288
  super(...arguments);
28278
28289
  this.samples = [];
28279
28290
  this.collateSample = () => {
28280
28291
  let t2 = this.getLatestStat(), i2 = this.getFirstStat(), r2 = { timestamp: Date.now(), total_pli_count: this.calculateDifferenceForSample("pliCount"), total_nack_count: this.calculateDifferenceForSample("nackCount"), avg_jitter_buffer_delay: this.calculateAverage("calculatedJitterBufferDelay", false) };
28281
28292
  if (t2.kind === "video")
28282
- return Gt(M2(m({}, r2), { avg_av_sync_ms: this.calculateAvgAvSyncForSample(), avg_frames_received_per_sec: this.calculateDifferenceAverage("framesReceived"), avg_frames_dropped_per_sec: this.calculateDifferenceAverage("framesDropped"), avg_frames_decoded_per_sec: this.calculateDifferenceAverage("framesDecoded"), frame_width: this.calculateAverage("frameWidth"), frame_height: this.calculateAverage("frameHeight"), expected_frame_width: this.calculateAverage("expectedFrameWidth"), expected_frame_height: this.calculateAverage("expectedFrameHeight"), pause_count: this.calculateDifferenceForSample("pauseCount"), pause_duration_seconds: this.calculateDifferenceForSample("totalPausesDuration"), freeze_count: this.calculateDifferenceForSample("freezeCount"), freeze_duration_seconds: this.calculateDifferenceForSample("totalFreezesDuration") }));
28293
+ return Ft(M2(m({}, r2), { avg_av_sync_ms: this.calculateAvgAvSyncForSample(), avg_frames_received_per_sec: this.calculateDifferenceAverage("framesReceived"), avg_frames_dropped_per_sec: this.calculateDifferenceAverage("framesDropped"), avg_frames_decoded_per_sec: this.calculateDifferenceAverage("framesDecoded"), frame_width: this.calculateAverage("frameWidth"), frame_height: this.calculateAverage("frameHeight"), expected_frame_width: this.calculateAverage("expectedFrameWidth"), expected_frame_height: this.calculateAverage("expectedFrameHeight"), pause_count: this.calculateDifferenceForSample("pauseCount"), pause_duration_seconds: this.calculateDifferenceForSample("totalPausesDuration"), freeze_count: this.calculateDifferenceForSample("freezeCount"), freeze_duration_seconds: this.calculateDifferenceForSample("totalFreezesDuration") }));
28283
28294
  {
28284
28295
  let s2 = (t2.concealedSamples || 0) - (t2.silentConcealedSamples || 0) - ((i2.concealedSamples || 0) - (i2.silentConcealedSamples || 0));
28285
- return Gt(M2(m({}, r2), { audio_level: this.calculateInstancesOfHigh("audioLevel", 0.05), audio_concealed_samples: s2, audio_total_samples_received: this.calculateDifferenceForSample("totalSamplesReceived"), audio_concealment_events: this.calculateDifferenceForSample("concealmentEvents"), fec_packets_discarded: this.calculateDifferenceForSample("fecPacketsDiscarded"), fec_packets_received: this.calculateDifferenceForSample("fecPacketsReceived"), total_samples_duration: this.calculateDifferenceForSample("totalSamplesDuration"), total_packets_received: this.calculateDifferenceForSample("packetsReceived"), total_packets_lost: this.calculateDifferenceForSample("packetsLost") }));
28296
+ return Ft(M2(m({}, r2), { audio_level: this.calculateInstancesOfHigh("audioLevel", 0.05), audio_concealed_samples: s2, audio_total_samples_received: this.calculateDifferenceForSample("totalSamplesReceived"), audio_concealment_events: this.calculateDifferenceForSample("concealmentEvents"), fec_packets_discarded: this.calculateDifferenceForSample("fecPacketsDiscarded"), fec_packets_received: this.calculateDifferenceForSample("fecPacketsReceived"), total_samples_duration: this.calculateDifferenceForSample("totalSamplesDuration"), total_packets_received: this.calculateDifferenceForSample("packetsReceived"), total_packets_lost: this.calculateDifferenceForSample("packetsLost") }));
28286
28297
  }
28287
28298
  };
28288
28299
  this.shouldCreateSample = () => {
28289
28300
  let t2 = this.tempStats.length, i2 = this.tempStats[t2 - 1], r2 = this.tempStats[t2 - 2];
28290
- return t2 === 10 || dr(i2, r2) || i2.kind === "video" && cr(i2, r2);
28301
+ return t2 === 10 || cr(i2, r2) || i2.kind === "video" && nr(i2, r2);
28291
28302
  };
28292
28303
  this.toAnalytics = () => ({ track_id: this.track_id, ssrc: this.ssrc, source: this.source, rid: this.rid, samples: this.samples });
28293
28304
  }
28294
28305
  calculateAvgAvSyncForSample() {
28295
- let i2 = this.tempStats.map((r2) => r2.avSync).filter((r2) => r2 !== void 0 && r2 !== Pt);
28296
- return i2.length === 0 ? Pt : i2.reduce((r2, s2) => r2 + s2, 0) / i2.length;
28306
+ let i2 = this.tempStats.map((r2) => r2.avSync).filter((r2) => r2 !== void 0 && r2 !== kt);
28307
+ return i2.length === 0 ? kt : i2.reduce((r2, s2) => r2 + s2, 0) / i2.length;
28297
28308
  }
28298
28309
  };
28299
- ur = ((t2) => (t2[t2.Publish = 0] = "Publish", t2[t2.Subscribe = 1] = "Subscribe", t2))(ur || {});
28310
+ lr = ((t2) => (t2[t2.Publish = 0] = "Publish", t2[t2.Subscribe = 1] = "Subscribe", t2))(lr || {});
28300
28311
  Ee = "[HMSConnection]";
28301
- Ke = class {
28312
+ qe = class {
28302
28313
  constructor(e, t2) {
28303
28314
  this.candidates = new Array();
28304
28315
  this.role = e, this.signal = t2;
@@ -28375,13 +28386,13 @@ var init_dist = __esm({
28375
28386
  let i2 = (r2 = t2.track) == null ? void 0 : r2.kind;
28376
28387
  if (t2.transport) {
28377
28388
  let s2 = t2.transport.iceTransport, o2 = () => {
28378
- typeof s2.getSelectedCandidatePair == "function" && (this.selectedCandidatePair = s2.getSelectedCandidatePair(), this.selectedCandidatePair && (this.observer.onSelectedCandidatePairChange(this.selectedCandidatePair), d2.d(Ee, `${ur[this.role]} connection`, `selected ${i2 || "unknown"} candidate pair`, JSON.stringify(this.selectedCandidatePair, null, 2))));
28389
+ typeof s2.getSelectedCandidatePair == "function" && (this.selectedCandidatePair = s2.getSelectedCandidatePair(), this.selectedCandidatePair && (this.observer.onSelectedCandidatePairChange(this.selectedCandidatePair), d2.d(Ee, `${lr[this.role]} connection`, `selected ${i2 || "unknown"} candidate pair`, JSON.stringify(this.selectedCandidatePair, null, 2))));
28379
28390
  };
28380
28391
  typeof s2.onselectedcandidatepairchange == "function" && (s2.onselectedcandidatepairchange = o2), o2();
28381
28392
  }
28382
28393
  });
28383
28394
  } catch (e) {
28384
- d2.w(Ee, `Error in logging selected ice candidate pair for ${ur[this.role]} connection`, e);
28395
+ d2.w(Ee, `Error in logging selected ice candidate pair for ${lr[this.role]} connection`, e);
28385
28396
  }
28386
28397
  }
28387
28398
  removeTrack(e) {
@@ -28414,11 +28425,11 @@ var init_dist = __esm({
28414
28425
  return this.nativeConnection.getReceivers();
28415
28426
  }
28416
28427
  };
28417
- qt = class extends Ke {
28428
+ Kt = class extends qe {
28418
28429
  constructor(t2, i2, r2) {
28419
28430
  super(0, t2);
28420
28431
  this.TAG = "[HMSPublishConnection]";
28421
- this.observer = r2, this.nativeConnection = new RTCPeerConnection(i2), this.channel = this.nativeConnection.createDataChannel(ui, { protocol: "SCTP" }), this.channel.onerror = (s2) => d2.e(this.TAG, `publish data channel onerror ${s2}`, s2), this.nativeConnection.onicecandidate = ({ candidate: s2 }) => {
28432
+ this.observer = r2, this.nativeConnection = new RTCPeerConnection(i2), this.channel = this.nativeConnection.createDataChannel(li, { protocol: "SCTP" }), this.channel.onerror = (s2) => d2.e(this.TAG, `publish data channel onerror ${s2}`, s2), this.nativeConnection.onicecandidate = ({ candidate: s2 }) => {
28422
28433
  s2 && (this.observer.onIceCandidate(s2), t2.trickle(this.role, s2));
28423
28434
  }, this.nativeConnection.oniceconnectionstatechange = () => {
28424
28435
  this.observer.onIceConnectionChange(this.nativeConnection.iceConnectionState);
@@ -28438,7 +28449,7 @@ var init_dist = __esm({
28438
28449
  });
28439
28450
  }
28440
28451
  };
28441
- jt = class {
28452
+ qt = class {
28442
28453
  constructor(e, t2, i2 = "") {
28443
28454
  this.TAG = "[HMSDataChannel]";
28444
28455
  this.nativeChannel = e, this.observer = t2, this.metadata = i2, e.onmessage = (r2) => {
@@ -28461,7 +28472,7 @@ var init_dist = __esm({
28461
28472
  this.nativeChannel.close();
28462
28473
  }
28463
28474
  };
28464
- Jt = class a9 extends Ke {
28475
+ jt = class a9 extends qe {
28465
28476
  constructor(t2, i2, r2, s2) {
28466
28477
  super(1, t2);
28467
28478
  this.isFlagEnabled = r2;
@@ -28488,7 +28499,7 @@ var init_dist = __esm({
28488
28499
  if (d2.d(this.TAG, `Failed sending ${i3}`, { request: t3, try: o2 + 1, error: n2 }), !(n2.code / 100 === 5 || n2.code === 429))
28489
28500
  throw Error(`code=${n2.code}, message=${n2.message}`);
28490
28501
  let u2 = (2 + Math.random() * 2) * 1e3;
28491
- yield Ce(u2);
28502
+ yield Le(u2);
28492
28503
  } else
28493
28504
  break;
28494
28505
  }
@@ -28508,7 +28519,7 @@ var init_dist = __esm({
28508
28519
  }, this.nativeConnection.onconnectionstatechange = () => {
28509
28520
  this.observer.onConnectionStateChange(this.nativeConnection.connectionState);
28510
28521
  }, this.nativeConnection.ondatachannel = (t2) => {
28511
- t2.channel.label === ui && (this.apiChannel = new jt(t2.channel, { onMessage: (i2) => {
28522
+ t2.channel.label === li && (this.apiChannel = new qt(t2.channel, { onMessage: (i2) => {
28512
28523
  this.eventEmitter.emit("message", i2), this.observer.onApiChannelMessage(i2);
28513
28524
  } }, `role=${this.role}`), t2.channel.onopen = this.handlePendingApiMessages);
28514
28525
  }, this.nativeConnection.onicecandidate = (t2) => {
@@ -28553,13 +28564,13 @@ var init_dist = __esm({
28553
28564
  close() {
28554
28565
  return c2(this, null, function* () {
28555
28566
  var t2;
28556
- yield Q2(a9.prototype, this, "close").call(this), (t2 = this.apiChannel) == null || t2.close();
28567
+ yield J(a9.prototype, this, "close").call(this), (t2 = this.apiChannel) == null || t2.close();
28557
28568
  });
28558
28569
  }
28559
28570
  };
28560
28571
  Ua = (a11, e) => !e || e.length === 0 ? a11 : e.map((i2) => ({ urls: i2.urls, credentialType: "password", credential: i2.password, username: i2.userName }));
28561
- pr = "[InitService]";
28562
- Qt = class {
28572
+ ur = "[InitService]";
28573
+ Jt = class {
28563
28574
  static handleError(e, t2) {
28564
28575
  switch (e.status) {
28565
28576
  case 404:
@@ -28572,16 +28583,16 @@ var init_dist = __esm({
28572
28583
  }
28573
28584
  static fetchInitConfig(n2) {
28574
28585
  return c2(this, arguments, function* ({ token: e, peerId: t2, userAgent: i2, initEndpoint: r2 = "https://prod-init.100ms.live", region: s2 = "", iceServers: o2 }) {
28575
- d2.d(pr, `fetchInitConfig: initEndpoint=${r2} token=${e} peerId=${t2} region=${s2} `);
28586
+ d2.d(ur, `fetchInitConfig: initEndpoint=${r2} token=${e} peerId=${t2} region=${s2} `);
28576
28587
  let l2 = ln2(r2, t2, i2, s2);
28577
28588
  try {
28578
28589
  let u2 = yield fetch(l2, { headers: { Authorization: `Bearer ${e}` } });
28579
28590
  try {
28580
28591
  let p2 = yield u2.clone().json();
28581
- return this.handleError(u2, p2), d2.d(pr, `config is ${JSON.stringify(p2, null, 2)}`), un2(p2, o2);
28592
+ return this.handleError(u2, p2), d2.d(ur, `config is ${JSON.stringify(p2, null, 2)}`), un2(p2, o2);
28582
28593
  } catch (p2) {
28583
28594
  let h2 = yield u2.text();
28584
- throw d2.e(pr, "json error", p2.message, h2), p2 instanceof f2 ? p2 : S2.APIErrors.ServerErrors(u2.status, "INIT", p2.message);
28595
+ throw d2.e(ur, "json error", p2.message, h2), p2 instanceof v2 ? p2 : S2.APIErrors.ServerErrors(u2.status, "INIT", p2.message);
28585
28596
  }
28586
28597
  } catch (u2) {
28587
28598
  let p2 = u2;
@@ -28590,10 +28601,10 @@ var init_dist = __esm({
28590
28601
  });
28591
28602
  }
28592
28603
  };
28593
- zt = class {
28604
+ Qt = class {
28594
28605
  constructor(e) {
28595
28606
  this.TAG = "[SIGNAL]: ";
28596
- this.pongResponseTimes = new He(5);
28607
+ this.pongResponseTimes = new Ce(5);
28597
28608
  this.isJoinCompleted = false;
28598
28609
  this.pendingTrickle = [];
28599
28610
  this.socket = null;
@@ -28635,7 +28646,7 @@ var init_dist = __esm({
28635
28646
  this.callbacks.set(i2, { resolve: n2, reject: l2, metadata: { method: e } });
28636
28647
  });
28637
28648
  } catch (o2) {
28638
- if (o2 instanceof f2)
28649
+ if (o2 instanceof v2)
28639
28650
  throw o2;
28640
28651
  let n2 = o2;
28641
28652
  throw S2.WebsocketMethodErrors.ServerErrors(Number(n2.code), fr(e), n2.message);
@@ -28949,7 +28960,7 @@ var init_dist = __esm({
28949
28960
  if (r2 = o2, d2.e(this.TAG, `Failed sending ${e} try: ${s2}`, { method: e, params: t2, error: r2 }), !(parseInt(`${r2.code / 100}`) === 5 || r2.code === 429))
28950
28961
  break;
28951
28962
  let l2 = (2 + Math.random() * 2) * 1e3;
28952
- yield Ce(l2);
28963
+ yield Le(l2);
28953
28964
  }
28954
28965
  throw d2.e(`Sending ${e} over WS failed after ${Math.min(s2, 3)} retries`, { method: e, params: t2, error: r2 }), r2;
28955
28966
  });
@@ -28961,8 +28972,8 @@ var init_dist = __esm({
28961
28972
  let a11 = navigator.connection;
28962
28973
  return { downlink: a11.downlink, downlinkMax: a11.downlinkMax, effectiveType: a11.effectiveType, rtt: a11.rtt, saveData: a11.saveData, type: a11.type };
28963
28974
  };
28964
- A2 = "[HMSTransport]:";
28965
- Yt = class {
28975
+ I2 = "[HMSTransport]:";
28976
+ zt = class {
28966
28977
  constructor(e, t2, i2, r2, s2, o2, n2) {
28967
28978
  this.observer = e;
28968
28979
  this.deviceManager = t2;
@@ -28982,16 +28993,16 @@ var init_dist = __esm({
28982
28993
  try {
28983
28994
  if (!this.subscribeConnection)
28984
28995
  return;
28985
- yield this.subscribeConnection.setRemoteDescription(e2), d2.d(A2, `[SUBSCRIBE] Adding ${this.subscribeConnection.candidates.length} ice-candidates`, this.subscribeConnection.candidates);
28996
+ yield this.subscribeConnection.setRemoteDescription(e2), d2.d(I2, `[SUBSCRIBE] Adding ${this.subscribeConnection.candidates.length} ice-candidates`, this.subscribeConnection.candidates);
28986
28997
  for (let i3 of this.subscribeConnection.candidates)
28987
28998
  yield this.subscribeConnection.addIceCandidate(i3);
28988
28999
  this.subscribeConnection.candidates.length = 0;
28989
29000
  let t3 = yield this.subscribeConnection.createAnswer();
28990
- yield this.subscribeConnection.setLocalDescription(t3), this.signal.answer(t3), d2.d(A2, "[role=SUBSCRIBE] onOffer renegotiation DONE \u2705");
29001
+ yield this.subscribeConnection.setLocalDescription(t3), this.signal.answer(t3), d2.d(I2, "[role=SUBSCRIBE] onOffer renegotiation DONE \u2705");
28991
29002
  } catch (t3) {
28992
- d2.d(A2, "[role=SUBSCRIBE] onOffer renegotiation FAILED \u274C", t3), this.state = "Failed";
29003
+ d2.d(I2, "[role=SUBSCRIBE] onOffer renegotiation FAILED \u274C", t3), this.state = "Failed";
28993
29004
  let i3;
28994
- t3 instanceof f2 ? i3 = t3 : i3 = S2.GenericErrors.Unknown("PUBLISH", t3.message), this.observer.onFailure(i3), this.eventBus.analytics.publish(y2.subscribeFail(i3));
29005
+ t3 instanceof v2 ? i3 = t3 : i3 = S2.GenericErrors.Unknown("PUBLISH", t3.message), this.observer.onFailure(i3), this.eventBus.analytics.publish(y2.subscribeFail(i3));
28995
29006
  }
28996
29007
  }), onTrickle: (e2) => c2(this, null, function* () {
28997
29008
  let t3 = e2.target === 0 ? this.publishConnection : this.subscribeConnection;
@@ -29001,7 +29012,7 @@ var init_dist = __esm({
29001
29012
  }), onFailure: (e2) => {
29002
29013
  this.joinParameters && this.retryScheduler.schedule({ category: 1, error: e2, task: this.retrySignalDisconnectTask, originalState: this.state });
29003
29014
  }, onOffline: (e2) => c2(this, null, function* () {
29004
- d2.d(A2, "socket offline", ir[this.state]);
29015
+ d2.d(I2, "socket offline", tr[this.state]);
29005
29016
  try {
29006
29017
  this.state !== "Leaving" && this.joinParameters && this.retryScheduler.schedule({ category: 1, error: S2.WebSocketConnectionErrors.WebSocketConnectionLost("RECONNECT_SIGNAL", e2), task: this.retrySignalDisconnectTask, originalState: this.state });
29007
29018
  } catch (t3) {
@@ -29009,19 +29020,19 @@ var init_dist = __esm({
29009
29020
  }
29010
29021
  }), onOnline: () => {
29011
29022
  var e2;
29012
- d2.d(A2, "socket online", ir[this.state]), this.analyticsSignalTransport.flushFailedEvents((e2 = this.store.getLocalPeer()) == null ? void 0 : e2.peerId);
29023
+ d2.d(I2, "socket online", tr[this.state]), this.analyticsSignalTransport.flushFailedEvents((e2 = this.store.getLocalPeer()) == null ? void 0 : e2.peerId);
29013
29024
  }, onNetworkOnline: () => {
29014
29025
  this.analyticsEventsService.flushFailedClientEvents();
29015
29026
  } };
29016
- this.signal = new zt(this.signalObserver);
29017
- this.analyticsSignalTransport = new nr(this.signal);
29027
+ this.signal = new Qt(this.signalObserver);
29028
+ this.analyticsSignalTransport = new or(this.signal);
29018
29029
  this.publishDtlsStateTimer = 0;
29019
29030
  this.lastPublishDtlsState = "new";
29020
29031
  this.publishConnectionObserver = { onRenegotiationNeeded: () => c2(this, null, function* () {
29021
29032
  yield this.performPublishRenegotiation();
29022
29033
  }), onDTLSTransportStateChange: (e2) => {
29023
29034
  var r3, s3, o3;
29024
- if ((e2 === "failed" ? d2.w.bind(d2) : d2.d.bind(d2))(A2, `Publisher on dtls transport state change: ${e2}`), !e2 || this.lastPublishDtlsState === e2 || (this.lastPublishDtlsState = e2, this.publishDtlsStateTimer !== 0 && (clearTimeout(this.publishDtlsStateTimer), this.publishDtlsStateTimer = 0), e2 !== "connecting" && e2 !== "failed"))
29035
+ if ((e2 === "failed" ? d2.w.bind(d2) : d2.d.bind(d2))(I2, `Publisher on dtls transport state change: ${e2}`), !e2 || this.lastPublishDtlsState === e2 || (this.lastPublishDtlsState = e2, this.publishDtlsStateTimer !== 0 && (clearTimeout(this.publishDtlsStateTimer), this.publishDtlsStateTimer = 0), e2 !== "connecting" && e2 !== "failed"))
29025
29036
  return;
29026
29037
  let i3 = (o3 = (s3 = (r3 = this.initConfig) == null ? void 0 : r3.config) == null ? void 0 : s3.dtlsStateTimeouts) == null ? void 0 : o3[e2];
29027
29038
  !i3 || i3 <= 0 || (this.publishDtlsStateTimer = window.setTimeout(() => {
@@ -29033,14 +29044,14 @@ var init_dist = __esm({
29033
29044
  }
29034
29045
  }, i3));
29035
29046
  }, onDTLSTransportError: (e2) => {
29036
- d2.e(A2, `onDTLSTransportError ${e2.name} ${e2.message}`, e2), this.eventBus.analytics.publish(y2.disconnect(e2));
29047
+ d2.e(I2, `onDTLSTransportError ${e2.name} ${e2.message}`, e2), this.eventBus.analytics.publish(y2.disconnect(e2));
29037
29048
  }, onIceConnectionChange: (e2) => c2(this, null, function* () {
29038
- (e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(A2, `Publish ice connection state change: ${e2}`);
29049
+ (e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(I2, `Publish ice connection state change: ${e2}`);
29039
29050
  }), onConnectionStateChange: (e2) => c2(this, null, function* () {
29040
29051
  var i3, r3, s3, o3, n3, l3, u3, p3;
29041
- (e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(A2, `Publish connection state change: ${e2}`), e2 === "connected" && ((i3 = this.connectivityListener) == null || i3.onICESuccess(true), (r3 = this.publishConnection) == null || r3.handleSelectedIceCandidatePairs()), e2 === "disconnected" && setTimeout(() => {
29042
- var h2, T, g2, v2, E2, k2, w2;
29043
- ((h2 = this.publishConnection) == null ? void 0 : h2.connectionState) === "disconnected" && this.handleIceConnectionFailure(0, S2.WebrtcErrors.ICEDisconnected("PUBLISH", `local candidate - ${(v2 = (g2 = (T = this.publishConnection) == null ? void 0 : T.selectedCandidatePair) == null ? void 0 : g2.local) == null ? void 0 : v2.candidate}; remote candidate - ${(w2 = (k2 = (E2 = this.publishConnection) == null ? void 0 : E2.selectedCandidatePair) == null ? void 0 : k2.remote) == null ? void 0 : w2.candidate}`));
29052
+ (e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(I2, `Publish connection state change: ${e2}`), e2 === "connected" && ((i3 = this.connectivityListener) == null || i3.onICESuccess(true), (r3 = this.publishConnection) == null || r3.handleSelectedIceCandidatePairs()), e2 === "disconnected" && setTimeout(() => {
29053
+ var h2, T, g2, f2, P8, k2, w2;
29054
+ ((h2 = this.publishConnection) == null ? void 0 : h2.connectionState) === "disconnected" && this.handleIceConnectionFailure(0, S2.WebrtcErrors.ICEDisconnected("PUBLISH", `local candidate - ${(f2 = (g2 = (T = this.publishConnection) == null ? void 0 : T.selectedCandidatePair) == null ? void 0 : g2.local) == null ? void 0 : f2.candidate}; remote candidate - ${(w2 = (k2 = (P8 = this.publishConnection) == null ? void 0 : P8.selectedCandidatePair) == null ? void 0 : k2.remote) == null ? void 0 : w2.candidate}`));
29044
29055
  }, 5e3), e2 === "failed" && (yield this.handleIceConnectionFailure(0, S2.WebrtcErrors.ICEFailure("PUBLISH", `local candidate - ${(n3 = (o3 = (s3 = this.publishConnection) == null ? void 0 : s3.selectedCandidatePair) == null ? void 0 : o3.local) == null ? void 0 : n3.candidate}; remote candidate - ${(p3 = (u3 = (l3 = this.publishConnection) == null ? void 0 : l3.selectedCandidatePair) == null ? void 0 : u3.remote) == null ? void 0 : p3.candidate}`)));
29045
29056
  }), onIceCandidate: (e2) => {
29046
29057
  var t3;
@@ -29052,20 +29063,20 @@ var init_dist = __esm({
29052
29063
  this.subscribeConnectionObserver = { onApiChannelMessage: (e2) => {
29053
29064
  this.observer.onNotification(JSON.parse(e2));
29054
29065
  }, onTrackAdd: (e2) => {
29055
- d2.d(A2, "[Subscribe] onTrackAdd", `${e2}`), this.observer.onTrackAdd(e2);
29066
+ d2.d(I2, "[Subscribe] onTrackAdd", `${e2}`), this.observer.onTrackAdd(e2);
29056
29067
  }, onTrackRemove: (e2) => {
29057
- d2.d(A2, "[Subscribe] onTrackRemove", `${e2}`), this.observer.onTrackRemove(e2);
29068
+ d2.d(I2, "[Subscribe] onTrackRemove", `${e2}`), this.observer.onTrackRemove(e2);
29058
29069
  }, onIceConnectionChange: (e2) => c2(this, null, function* () {
29059
29070
  var i3;
29060
- if ((e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(A2, `Subscribe ice connection state change: ${e2}`), e2 === "connected") {
29071
+ if ((e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(I2, `Subscribe ice connection state change: ${e2}`), e2 === "connected") {
29061
29072
  let r3 = this.callbacks.get(tt);
29062
29073
  this.callbacks.delete(tt), (i3 = this.connectivityListener) == null || i3.onICESuccess(false), r3 && r3.promise.resolve(true);
29063
29074
  }
29064
29075
  }), onConnectionStateChange: (e2) => c2(this, null, function* () {
29065
29076
  var i3, r3, s3, o3, n3, l3;
29066
- (e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(A2, `Subscribe connection state change: ${e2}`), e2 === "failed" && (yield this.handleIceConnectionFailure(1, S2.WebrtcErrors.ICEFailure("SUBSCRIBE", `local candidate - ${(s3 = (r3 = (i3 = this.subscribeConnection) == null ? void 0 : i3.selectedCandidatePair) == null ? void 0 : r3.local) == null ? void 0 : s3.candidate}; remote candidate - ${(l3 = (n3 = (o3 = this.subscribeConnection) == null ? void 0 : o3.selectedCandidatePair) == null ? void 0 : n3.remote) == null ? void 0 : l3.candidate}`))), e2 === "disconnected" && setTimeout(() => {
29067
- var u3, p3, h2, T, g2, v2, E2;
29068
- ((u3 = this.subscribeConnection) == null ? void 0 : u3.connectionState) === "disconnected" && this.handleIceConnectionFailure(1, S2.WebrtcErrors.ICEDisconnected("SUBSCRIBE", `local candidate - ${(T = (h2 = (p3 = this.subscribeConnection) == null ? void 0 : p3.selectedCandidatePair) == null ? void 0 : h2.local) == null ? void 0 : T.candidate}; remote candidate - ${(E2 = (v2 = (g2 = this.subscribeConnection) == null ? void 0 : g2.selectedCandidatePair) == null ? void 0 : v2.remote) == null ? void 0 : E2.candidate}`));
29077
+ (e2 === "disconnected" ? d2.w.bind(d2) : d2.d.bind(d2))(I2, `Subscribe connection state change: ${e2}`), e2 === "failed" && (yield this.handleIceConnectionFailure(1, S2.WebrtcErrors.ICEFailure("SUBSCRIBE", `local candidate - ${(s3 = (r3 = (i3 = this.subscribeConnection) == null ? void 0 : i3.selectedCandidatePair) == null ? void 0 : r3.local) == null ? void 0 : s3.candidate}; remote candidate - ${(l3 = (n3 = (o3 = this.subscribeConnection) == null ? void 0 : o3.selectedCandidatePair) == null ? void 0 : n3.remote) == null ? void 0 : l3.candidate}`))), e2 === "disconnected" && setTimeout(() => {
29078
+ var u3, p3, h2, T, g2, f2, P8;
29079
+ ((u3 = this.subscribeConnection) == null ? void 0 : u3.connectionState) === "disconnected" && this.handleIceConnectionFailure(1, S2.WebrtcErrors.ICEDisconnected("SUBSCRIBE", `local candidate - ${(T = (h2 = (p3 = this.subscribeConnection) == null ? void 0 : p3.selectedCandidatePair) == null ? void 0 : h2.local) == null ? void 0 : T.candidate}; remote candidate - ${(P8 = (f2 = (g2 = this.subscribeConnection) == null ? void 0 : g2.selectedCandidatePair) == null ? void 0 : f2.remote) == null ? void 0 : P8.candidate}`));
29069
29080
  }, 5e3), e2 === "connected" && this.handleSubscribeConnectionConnected();
29070
29081
  }), onIceCandidate: (e2) => {
29071
29082
  var t3;
@@ -29075,7 +29086,7 @@ var init_dist = __esm({
29075
29086
  (t3 = this.connectivityListener) == null || t3.onSelectedICECandidatePairChange(e2, false);
29076
29087
  } };
29077
29088
  this.handleLocalRoleUpdate = (i3) => c2(this, [i3], function* ({ oldRole: e2, newRole: t3 }) {
29078
- !this.doesRoleNeedWebRTC(e2) && this.doesRoleNeedWebRTC(t3) && (d2.d(A2, "Local peer role updated to webrtc role, creating PeerConnections and performing inital publish negotiation \u23F3"), this.createPeerConnections(), yield this.negotiateOnFirstPublish());
29089
+ !this.doesRoleNeedWebRTC(e2) && this.doesRoleNeedWebRTC(t3) && (d2.d(I2, "Local peer role updated to webrtc role, creating PeerConnections and performing inital publish negotiation \u23F3"), this.createPeerConnections(), yield this.negotiateOnFirstPublish());
29079
29090
  });
29080
29091
  this.retryPublishIceFailedTask = () => c2(this, null, function* () {
29081
29092
  if (this.publishConnection) {
@@ -29099,18 +29110,18 @@ var init_dist = __esm({
29099
29110
  });
29100
29111
  this.retrySignalDisconnectTask = () => c2(this, null, function* () {
29101
29112
  var t3;
29102
- d2.d(A2, "retrySignalDisconnectTask", { signalConnected: this.signal.isConnected }), this.signal.isConnected || (yield this.internalConnect(this.joinParameters.authToken, this.joinParameters.endpoint, this.joinParameters.peerId, this.joinParameters.iceServers));
29113
+ d2.d(I2, "retrySignalDisconnectTask", { signalConnected: this.signal.isConnected }), this.signal.isConnected || (yield this.internalConnect(this.joinParameters.authToken, this.joinParameters.endpoint, this.joinParameters.peerId, this.joinParameters.iceServers));
29103
29114
  let e2 = (t3 = this.store.getRoom()) != null && t3.joinedAt ? this.signal.isConnected && (yield this.retryPublishIceFailedTask()) : this.signal.isConnected;
29104
29115
  return this.signal.trackUpdate(this.trackStates), e2;
29105
29116
  });
29106
29117
  var u2, p2;
29107
- this.webrtcInternals = new hi(this.store, this.eventBus, (u2 = this.publishConnection) == null ? void 0 : u2.nativeConnection, (p2 = this.subscribeConnection) == null ? void 0 : p2.nativeConnection);
29118
+ this.webrtcInternals = new pi(this.store, this.eventBus, (u2 = this.publishConnection) == null ? void 0 : u2.nativeConnection, (p2 = this.subscribeConnection) == null ? void 0 : p2.nativeConnection);
29108
29119
  let l2 = (h2, T) => c2(this, null, function* () {
29109
29120
  h2 !== this.state && (this.state = h2, yield this.observer.onStateChange(this.state, T));
29110
29121
  });
29111
- this.retryScheduler = new sr(l2, this.sendErrorAnalyticsEvent.bind(this)), this.eventBus.statsUpdate.subscribe((h2) => {
29112
- var g2, v2;
29113
- let T = ((v2 = (g2 = h2.getLocalPeerStats()) == null ? void 0 : g2.subscribe) == null ? void 0 : v2.bitrate) || 0;
29122
+ this.retryScheduler = new rr(l2, this.sendErrorAnalyticsEvent.bind(this)), this.eventBus.statsUpdate.subscribe((h2) => {
29123
+ var g2, f2;
29124
+ let T = ((f2 = (g2 = h2.getLocalPeerStats()) == null ? void 0 : g2.subscribe) == null ? void 0 : f2.bitrate) || 0;
29114
29125
  this.maxSubscribeBitrate = Math.max(this.maxSubscribeBitrate, T);
29115
29126
  }), this.eventBus.localAudioEnabled.subscribe(({ track: h2 }) => this.trackUpdate(h2)), this.eventBus.localVideoEnabled.subscribe(({ track: h2 }) => this.trackUpdate(h2));
29116
29127
  }
@@ -29133,24 +29144,24 @@ var init_dist = __esm({
29133
29144
  }
29134
29145
  join(e, t2, i2, r2, s2 = false, o2) {
29135
29146
  return c2(this, null, function* () {
29136
- d2.d(A2, "join: started \u23F0");
29147
+ d2.d(I2, "join: started \u23F0");
29137
29148
  try {
29138
- (!this.signal.isConnected || !this.initConfig) && (yield this.connect(e, r2, t2, i2, s2, o2)), this.validateNotDisconnected("connect"), this.initConfig && (yield this.waitForLocalRoleAvailability(), yield this.createConnectionsAndNegotiateJoin(i2, s2), yield this.initRtcStatsMonitor(), d2.d(A2, "\u2705 join: Negotiated over PUBLISH connection"));
29149
+ (!this.signal.isConnected || !this.initConfig) && (yield this.connect(e, r2, t2, i2, s2, o2)), this.validateNotDisconnected("connect"), this.initConfig && (yield this.waitForLocalRoleAvailability(), yield this.createConnectionsAndNegotiateJoin(i2, s2), yield this.initRtcStatsMonitor(), d2.d(I2, "\u2705 join: Negotiated over PUBLISH connection"));
29139
29150
  } catch (n2) {
29140
- d2.e(A2, `join: failed \u274C [token=${e}]`, n2), this.state = "Failed";
29151
+ d2.e(I2, `join: failed \u274C [token=${e}]`, n2), this.state = "Failed";
29141
29152
  let l2 = n2;
29142
29153
  throw l2.isTerminal = l2.isTerminal || l2.code === 500, yield this.observer.onStateChange(this.state, l2), l2;
29143
29154
  }
29144
- d2.d(A2, "\u2705 join: successful"), this.state = "Joined", this.observer.onStateChange(this.state);
29155
+ d2.d(I2, "\u2705 join: successful"), this.state = "Joined", this.observer.onStateChange(this.state);
29145
29156
  });
29146
29157
  }
29147
29158
  connect(e, t2, i2, r2, s2 = false, o2) {
29148
29159
  return c2(this, null, function* () {
29149
- this.setTransportStateForConnect(), this.joinParameters = new tr(e, i2, r2.name, r2.metaData, t2, s2, o2);
29160
+ this.setTransportStateForConnect(), this.joinParameters = new er(e, i2, r2.name, r2.metaData, t2, s2, o2);
29150
29161
  try {
29151
29162
  return yield this.internalConnect(e, t2, i2, o2);
29152
29163
  } catch (n2) {
29153
- if (n2 instanceof f2 && ([P4.WebSocketConnectionErrors.WEBSOCKET_CONNECTION_LOST, P4.WebSocketConnectionErrors.FAILED_TO_CONNECT, P4.WebSocketConnectionErrors.ABNORMAL_CLOSE, P4.APIErrors.ENDPOINT_UNREACHABLE].includes(n2.code) || n2.code.toString().startsWith("5") || n2.code.toString().startsWith("429"))) {
29164
+ if (n2 instanceof v2 && ([E2.WebSocketConnectionErrors.WEBSOCKET_CONNECTION_LOST, E2.WebSocketConnectionErrors.FAILED_TO_CONNECT, E2.WebSocketConnectionErrors.ABNORMAL_CLOSE, E2.APIErrors.ENDPOINT_UNREACHABLE].includes(n2.code) || n2.code.toString().startsWith("5") || n2.code.toString().startsWith("429"))) {
29154
29165
  let u2 = () => c2(this, null, function* () {
29155
29166
  return yield this.internalConnect(e, t2, i2, o2), !!(this.initConfig && this.initConfig.endpoint);
29156
29167
  });
@@ -29163,18 +29174,18 @@ var init_dist = __esm({
29163
29174
  leave(e) {
29164
29175
  return c2(this, null, function* () {
29165
29176
  var t2, i2, r2, s2, o2;
29166
- this.retryScheduler.reset(), this.joinParameters = void 0, d2.d(A2, "leaving in transport");
29177
+ this.retryScheduler.reset(), this.joinParameters = void 0, d2.d(I2, "leaving in transport");
29167
29178
  try {
29168
29179
  let n2 = this.pluginUsageTracker.getPluginUsage("HMSKrispPlugin");
29169
29180
  if (n2 && this.eventBus.analytics.publish(y2.getKrispUsage(n2)), this.state = "Leaving", (t2 = this.publishStatsAnalytics) == null || t2.stop(), (i2 = this.subscribeStatsAnalytics) == null || i2.stop(), (r2 = this.webrtcInternals) == null || r2.cleanup(), yield (s2 = this.publishConnection) == null ? void 0 : s2.close(), yield (o2 = this.subscribeConnection) == null ? void 0 : o2.close(), e)
29170
29181
  try {
29171
- this.signal.leave(), d2.d(A2, "signal leave done");
29182
+ this.signal.leave(), d2.d(I2, "signal leave done");
29172
29183
  } catch (l2) {
29173
- d2.w(A2, "failed to send leave on websocket to server", l2);
29184
+ d2.w(I2, "failed to send leave on websocket to server", l2);
29174
29185
  }
29175
29186
  this.analyticsEventsService.flushFailedClientEvents(), this.analyticsEventsService.reset(), yield this.signal.close();
29176
29187
  } catch (n2) {
29177
- this.eventBus.analytics.publish(y2.disconnect(n2)), d2.e(A2, "leave: FAILED \u274C", n2);
29188
+ this.eventBus.analytics.publish(y2.disconnect(n2)), d2.e(I2, "leave: FAILED \u274C", n2);
29178
29189
  } finally {
29179
29190
  this.state = "Disconnected", this.observer.onStateChange(this.state);
29180
29191
  }
@@ -29200,26 +29211,26 @@ var init_dist = __esm({
29200
29211
  trackUpdate(e) {
29201
29212
  let i2 = Array.from(this.trackStates.values()).find((r2) => e.type === r2.type && e.source === r2.source);
29202
29213
  if (i2) {
29203
- let r2 = new Nt(M2(m({}, i2), { mute: !e.enabled }));
29204
- this.trackStates.set(i2.track_id, r2), d2.d(A2, "Track Update", this.trackStates, e), this.signal.trackUpdate(/* @__PURE__ */ new Map([[i2.track_id, r2]]));
29214
+ let r2 = new _t(M2(m({}, i2), { mute: !e.enabled }));
29215
+ this.trackStates.set(i2.track_id, r2), d2.d(I2, "Track Update", this.trackStates, e), this.signal.trackUpdate(/* @__PURE__ */ new Map([[i2.track_id, r2]]));
29205
29216
  }
29206
29217
  }
29207
29218
  publishTrack(e) {
29208
29219
  return c2(this, null, function* () {
29209
- e.publishedTrackId = e.getTrackIDBeingSent(), d2.d(A2, `\u23F3 publishTrack: trackId=${e.trackId}, toPublishTrackId=${e.publishedTrackId}`, `${e}`), this.trackStates.set(e.publishedTrackId, new Nt(e));
29220
+ e.publishedTrackId = e.getTrackIDBeingSent(), d2.d(I2, `\u23F3 publishTrack: trackId=${e.trackId}, toPublishTrackId=${e.publishedTrackId}`, `${e}`), this.trackStates.set(e.publishedTrackId, new _t(e));
29210
29221
  let t2 = new Promise((s2, o2) => {
29211
29222
  this.callbacks.set(et, { promise: { resolve: s2, reject: o2 }, action: "PUBLISH", extra: {} });
29212
29223
  }), i2 = e.stream;
29213
29224
  i2.setConnection(this.publishConnection);
29214
29225
  let r2 = this.store.getSimulcastLayers(e.source);
29215
29226
  i2.addTransceiver(e, r2), d2.time(`publish-${e.trackId}-${e.type}`), yield t2, d2.timeEnd(`publish-${e.trackId}-${e.type}`), this.store.addTrack(e), yield i2.setMaxBitrateAndFramerate(e).then(() => {
29216
- d2.d(A2, `Setting maxBitrate=${e.settings.maxBitrate} kpbs${e instanceof F ? ` and maxFramerate=${e.settings.maxFramerate}` : ""} for ${e.source} ${e.type} ${e.trackId}`);
29217
- }).catch((s2) => d2.w(A2, "Failed setting maxBitrate and maxFramerate", s2)), e.isPublished = true, d2.d(A2, `\u2705 publishTrack: trackId=${e.trackId}`, `${e}`, this.callbacks);
29227
+ d2.d(I2, `Setting maxBitrate=${e.settings.maxBitrate} kpbs${e instanceof F ? ` and maxFramerate=${e.settings.maxFramerate}` : ""} for ${e.source} ${e.type} ${e.trackId}`);
29228
+ }).catch((s2) => d2.w(I2, "Failed setting maxBitrate and maxFramerate", s2)), e.isPublished = true, d2.d(I2, `\u2705 publishTrack: trackId=${e.trackId}`, `${e}`, this.callbacks);
29218
29229
  });
29219
29230
  }
29220
29231
  unpublishTrack(e) {
29221
29232
  return c2(this, null, function* () {
29222
- if (d2.d(A2, `\u23F3 unpublishTrack: trackId=${e.trackId}`, `${e}`), e.publishedTrackId && this.trackStates.has(e.publishedTrackId))
29233
+ if (d2.d(I2, `\u23F3 unpublishTrack: trackId=${e.trackId}`, `${e}`), e.publishedTrackId && this.trackStates.has(e.publishedTrackId))
29223
29234
  this.trackStates.delete(e.publishedTrackId);
29224
29235
  else {
29225
29236
  let s2 = Array.from(this.trackStates.values()).find((o2) => e.type === o2.type && e.source === o2.source);
@@ -29228,7 +29239,7 @@ var init_dist = __esm({
29228
29239
  let t2 = new Promise((r2, s2) => {
29229
29240
  this.callbacks.set(et, { promise: { resolve: r2, reject: s2 }, action: "UNPUBLISH", extra: {} });
29230
29241
  });
29231
- e.stream.removeSender(e), yield t2, yield e.cleanup(), this.store.removeTrack(e), d2.d(A2, `\u2705 unpublishTrack: trackId=${e.trackId}`, this.callbacks);
29242
+ e.stream.removeSender(e), yield t2, yield e.cleanup(), this.store.removeTrack(e), d2.d(I2, `\u2705 unpublishTrack: trackId=${e.trackId}`, this.callbacks);
29232
29243
  });
29233
29244
  }
29234
29245
  waitForLocalRoleAvailability() {
@@ -29244,15 +29255,15 @@ var init_dist = __esm({
29244
29255
  });
29245
29256
  }
29246
29257
  createPeerConnections() {
29247
- this.initConfig && (this.publishConnection || (this.publishConnection = new qt(this.signal, this.initConfig.rtcConfiguration, this.publishConnectionObserver)), this.subscribeConnection || (this.subscribeConnection = new Jt(this.signal, this.initConfig.rtcConfiguration, this.isFlagEnabled.bind(this), this.subscribeConnectionObserver)));
29258
+ this.initConfig && (this.publishConnection || (this.publishConnection = new Kt(this.signal, this.initConfig.rtcConfiguration, this.publishConnectionObserver)), this.subscribeConnection || (this.subscribeConnection = new jt(this.signal, this.initConfig.rtcConfiguration, this.isFlagEnabled.bind(this), this.subscribeConnectionObserver)));
29248
29259
  }
29249
29260
  negotiateJoinWithRetry(s2) {
29250
29261
  return c2(this, arguments, function* ({ name: e, data: t2, autoSubscribeVideo: i2, isWebRTC: r2 = true }) {
29251
29262
  try {
29252
29263
  yield this.negotiateJoin({ name: e, data: t2, autoSubscribeVideo: i2, isWebRTC: r2 });
29253
29264
  } catch (o2) {
29254
- d2.e(A2, "Join negotiation failed \u274C", o2);
29255
- let n2 = o2 instanceof f2 ? o2 : S2.WebsocketMethodErrors.ServerErrors(500, "JOIN", `Websocket join error - ${o2.message}`), l2 = parseInt(`${n2.code / 100}`) === 5 || [P4.WebSocketConnectionErrors.WEBSOCKET_CONNECTION_LOST, 429].includes(n2.code);
29265
+ d2.e(I2, "Join negotiation failed \u274C", o2);
29266
+ let n2 = o2 instanceof v2 ? o2 : S2.WebsocketMethodErrors.ServerErrors(500, "JOIN", `Websocket join error - ${o2.message}`), l2 = parseInt(`${n2.code / 100}`) === 5 || [E2.WebSocketConnectionErrors.WEBSOCKET_CONNECTION_LOST, 429].includes(n2.code);
29256
29267
  if (n2.code === 410 && (n2.isTerminal = true), l2) {
29257
29268
  this.joinRetryCount = 0, n2.isTerminal = false;
29258
29269
  let u2 = () => c2(this, null, function* () {
@@ -29271,8 +29282,8 @@ var init_dist = __esm({
29271
29282
  }
29272
29283
  negotiateJoinWebRTC(r2) {
29273
29284
  return c2(this, arguments, function* ({ name: e, data: t2, autoSubscribeVideo: i2 }) {
29274
- if (d2.d(A2, "\u23F3 join: Negotiating over PUBLISH connection"), !this.publishConnection)
29275
- return d2.e(A2, "Publish peer connection not found, cannot negotiate"), false;
29285
+ if (d2.d(I2, "\u23F3 join: Negotiating over PUBLISH connection"), !this.publishConnection)
29286
+ return d2.e(I2, "Publish peer connection not found, cannot negotiate"), false;
29276
29287
  let s2 = yield this.publishConnection.createOffer();
29277
29288
  yield this.publishConnection.setLocalDescription(s2);
29278
29289
  let o2 = this.isFlagEnabled("subscribeDegradation"), n2 = this.isFlagEnabled("simulcast"), l2 = this.isFlagEnabled("onDemandTracks"), u2 = yield this.signal.join(e, t2, !i2, o2, n2, l2, s2);
@@ -29284,15 +29295,15 @@ var init_dist = __esm({
29284
29295
  }
29285
29296
  negotiateJoinNonWebRTC(r2) {
29286
29297
  return c2(this, arguments, function* ({ name: e, data: t2, autoSubscribeVideo: i2 }) {
29287
- d2.d(A2, "\u23F3 join: Negotiating Non-WebRTC");
29298
+ d2.d(I2, "\u23F3 join: Negotiating Non-WebRTC");
29288
29299
  let s2 = this.isFlagEnabled("subscribeDegradation"), o2 = this.isFlagEnabled("simulcast"), n2 = this.isFlagEnabled("onDemandTracks");
29289
29300
  return !!(yield this.signal.join(e, t2, !i2, s2, o2, n2));
29290
29301
  });
29291
29302
  }
29292
29303
  negotiateOnFirstPublish() {
29293
29304
  return c2(this, null, function* () {
29294
- if (d2.d(A2, "\u23F3 Negotiating offer over PUBLISH connection"), !this.publishConnection)
29295
- return d2.e(A2, "Publish peer connection not found, cannot negotiate"), false;
29305
+ if (d2.d(I2, "\u23F3 Negotiating offer over PUBLISH connection"), !this.publishConnection)
29306
+ return d2.e(I2, "Publish peer connection not found, cannot negotiate"), false;
29296
29307
  let e = yield this.publishConnection.createOffer(this.trackStates);
29297
29308
  yield this.publishConnection.setLocalDescription(e);
29298
29309
  let t2 = yield this.signal.offer(e, this.trackStates);
@@ -29304,21 +29315,21 @@ var init_dist = __esm({
29304
29315
  }
29305
29316
  performPublishRenegotiation(e) {
29306
29317
  return c2(this, null, function* () {
29307
- d2.d(A2, "\u23F3 [role=PUBLISH] onRenegotiationNeeded START", this.trackStates);
29318
+ d2.d(I2, "\u23F3 [role=PUBLISH] onRenegotiationNeeded START", this.trackStates);
29308
29319
  let t2 = this.callbacks.get(et);
29309
29320
  if (t2) {
29310
29321
  if (!this.publishConnection) {
29311
- d2.e(A2, "Publish peer connection not found, cannot renegotiate");
29322
+ d2.e(I2, "Publish peer connection not found, cannot renegotiate");
29312
29323
  return;
29313
29324
  }
29314
29325
  try {
29315
29326
  let i2 = yield this.publishConnection.createOffer(this.trackStates, e);
29316
29327
  yield this.publishConnection.setLocalDescription(i2), d2.time("renegotiation-offer-exchange");
29317
29328
  let r2 = yield this.signal.offer(i2, this.trackStates);
29318
- this.callbacks.delete(et), d2.timeEnd("renegotiation-offer-exchange"), yield this.publishConnection.setRemoteDescription(r2), t2.promise.resolve(true), d2.d(A2, "[role=PUBLISH] onRenegotiationNeeded DONE \u2705");
29329
+ this.callbacks.delete(et), d2.timeEnd("renegotiation-offer-exchange"), yield this.publishConnection.setRemoteDescription(r2), t2.promise.resolve(true), d2.d(I2, "[role=PUBLISH] onRenegotiationNeeded DONE \u2705");
29319
29330
  } catch (i2) {
29320
29331
  let r2;
29321
- i2 instanceof f2 ? r2 = i2 : r2 = S2.GenericErrors.Unknown("PUBLISH", i2.message), t2.promise.reject(r2), d2.d(A2, "[role=PUBLISH] onRenegotiationNeeded FAILED \u274C");
29332
+ i2 instanceof v2 ? r2 = i2 : r2 = S2.GenericErrors.Unknown("PUBLISH", i2.message), t2.promise.reject(r2), d2.d(I2, "[role=PUBLISH] onRenegotiationNeeded FAILED \u274C");
29322
29333
  }
29323
29334
  }
29324
29335
  });
@@ -29331,28 +29342,28 @@ var init_dist = __esm({
29331
29342
  internalConnect(e, t2, i2, r2) {
29332
29343
  return c2(this, null, function* () {
29333
29344
  var o2, n2, l2;
29334
- d2.d(A2, "connect: started \u23F0");
29345
+ d2.d(I2, "connect: started \u23F0");
29335
29346
  let s2 = /* @__PURE__ */ new Date();
29336
29347
  try {
29337
- this.analyticsTimer.start("init_response_time"), this.initConfig = yield Qt.fetchInitConfig({ token: e, peerId: i2, userAgent: this.store.getUserAgent(), initEndpoint: t2, iceServers: r2 }), (o2 = this.connectivityListener) == null || o2.onInitSuccess(this.initConfig.endpoint);
29348
+ this.analyticsTimer.start("init_response_time"), this.initConfig = yield Jt.fetchInitConfig({ token: e, peerId: i2, userAgent: this.store.getUserAgent(), initEndpoint: t2, iceServers: r2 }), (o2 = this.connectivityListener) == null || o2.onInitSuccess(this.initConfig.endpoint);
29338
29349
  let u2 = this.store.getRoom();
29339
- return u2 && (u2.effectsKey = (n2 = this.initConfig.config.vb) == null ? void 0 : n2.effectsKey, u2.isEffectsEnabled = this.isFlagEnabled("effectsSDKEnabled"), u2.isHipaaEnabled = this.isFlagEnabled("hipaa"), u2.isNoiseCancellationEnabled = this.isFlagEnabled("noiseCancellation")), this.analyticsTimer.end("init_response_time"), Pe.setWebsocketEndpoint(this.initConfig.endpoint), this.validateNotDisconnected("post init"), yield this.openSignal(e, i2), this.observer.onConnected(), (l2 = this.connectivityListener) == null || l2.onSignallingSuccess(), this.store.setSimulcastEnabled(this.isFlagEnabled("simulcast")), d2.d(A2, "Adding Analytics Transport: JsonRpcSignal"), this.analyticsEventsService.setTransport(this.analyticsSignalTransport), this.analyticsEventsService.flush(), this.initConfig;
29350
+ return u2 && (u2.effectsKey = (n2 = this.initConfig.config.vb) == null ? void 0 : n2.effectsKey, u2.isEffectsEnabled = this.isFlagEnabled("effectsSDKEnabled"), u2.isHipaaEnabled = this.isFlagEnabled("hipaa"), u2.isNoiseCancellationEnabled = this.isFlagEnabled("noiseCancellation")), this.analyticsTimer.end("init_response_time"), Pe.setWebsocketEndpoint(this.initConfig.endpoint), this.validateNotDisconnected("post init"), yield this.openSignal(e, i2), this.observer.onConnected(), (l2 = this.connectivityListener) == null || l2.onSignallingSuccess(), this.store.setSimulcastEnabled(this.isFlagEnabled("simulcast")), d2.d(I2, "Adding Analytics Transport: JsonRpcSignal"), this.analyticsEventsService.setTransport(this.analyticsSignalTransport), this.analyticsEventsService.flush(), this.initConfig;
29340
29351
  } catch (u2) {
29341
- throw this.state !== "Reconnecting" && this.eventBus.analytics.publish(y2.connect(u2, this.getAdditionalAnalyticsProperties(), s2, /* @__PURE__ */ new Date(), t2)), d2.e(A2, "\u274C internal connect: failed", u2), u2;
29352
+ throw this.state !== "Reconnecting" && this.eventBus.analytics.publish(y2.connect(u2, this.getAdditionalAnalyticsProperties(), s2, /* @__PURE__ */ new Date(), t2)), d2.e(I2, "\u274C internal connect: failed", u2), u2;
29342
29353
  }
29343
29354
  });
29344
29355
  }
29345
29356
  validateNotDisconnected(e) {
29346
29357
  if (this.state === "Disconnected")
29347
- throw d2.w(A2, "aborting join as transport state is disconnected"), S2.GenericErrors.ValidationFailed(`leave called before join could complete - stage=${e}`);
29358
+ throw d2.w(I2, "aborting join as transport state is disconnected"), S2.GenericErrors.ValidationFailed(`leave called before join could complete - stage=${e}`);
29348
29359
  }
29349
29360
  openSignal(e, t2) {
29350
29361
  return c2(this, null, function* () {
29351
29362
  if (!this.initConfig)
29352
29363
  throw S2.APIErrors.InitConfigNotAvailable("INIT", "Init Config not found");
29353
- d2.d(A2, "\u23F3 internal connect: connecting to ws endpoint", this.initConfig.endpoint);
29364
+ d2.d(I2, "\u23F3 internal connect: connecting to ws endpoint", this.initConfig.endpoint);
29354
29365
  let i2 = new URL(this.initConfig.endpoint);
29355
- i2.searchParams.set("peer", t2), i2.searchParams.set("token", e), i2.searchParams.set("user_agent_v2", this.store.getUserAgent()), i2.searchParams.set("protocol_version", Vs), i2.searchParams.set("protocol_spec", Fs), this.endpoint = i2.toString(), this.analyticsTimer.start("ws_connect_time"), yield this.signal.open(this.endpoint), this.analyticsTimer.end("ws_connect_time"), this.analyticsTimer.start("on_policy_change_time"), this.analyticsTimer.start("room_state_time"), d2.d(A2, "\u2705 internal connect: connected to ws endpoint");
29366
+ i2.searchParams.set("peer", t2), i2.searchParams.set("token", e), i2.searchParams.set("user_agent_v2", this.store.getUserAgent()), i2.searchParams.set("protocol_version", Vs), i2.searchParams.set("protocol_spec", Fs), this.endpoint = i2.toString(), this.analyticsTimer.start("ws_connect_time"), yield this.signal.open(this.endpoint), this.analyticsTimer.end("ws_connect_time"), this.analyticsTimer.start("on_policy_change_time"), this.analyticsTimer.start("room_state_time"), d2.d(I2, "\u2705 internal connect: connected to ws endpoint");
29356
29367
  });
29357
29368
  }
29358
29369
  initRtcStatsMonitor() {
@@ -29363,7 +29374,7 @@ var init_dist = __esm({
29363
29374
  }
29364
29375
  initStatsAnalytics() {
29365
29376
  var e, t2;
29366
- this.isFlagEnabled("publishStats") && (this.publishStatsAnalytics = new Wt(this.store, this.eventBus, this.getValueFromInitConfig("publishStats", "maxSampleWindowSize", 30), this.getValueFromInitConfig("publishStats", "maxSamplePushInterval", 300)), (e = this.getWebrtcInternals()) == null || e.start()), this.isFlagEnabled("subscribeStats") && (this.subscribeStatsAnalytics = new $t(this.store, this.eventBus, this.getValueFromInitConfig("subscribeStats", "maxSampleWindowSize", 10), this.getValueFromInitConfig("subscribeStats", "maxSamplePushInterval", 60)), (t2 = this.getWebrtcInternals()) == null || t2.start());
29377
+ this.isFlagEnabled("publishStats") && (this.publishStatsAnalytics = new Gt(this.store, this.eventBus, this.getValueFromInitConfig("publishStats", "maxSampleWindowSize", 30), this.getValueFromInitConfig("publishStats", "maxSamplePushInterval", 300)), (e = this.getWebrtcInternals()) == null || e.start()), this.isFlagEnabled("subscribeStats") && (this.subscribeStatsAnalytics = new Wt(this.store, this.eventBus, this.getValueFromInitConfig("subscribeStats", "maxSampleWindowSize", 10), this.getValueFromInitConfig("subscribeStats", "maxSamplePushInterval", 60)), (t2 = this.getWebrtcInternals()) == null || t2.start());
29367
29378
  }
29368
29379
  getValueFromInitConfig(e, t2, i2) {
29369
29380
  var r2, s2;
@@ -29418,7 +29429,7 @@ var init_dist = __esm({
29418
29429
  }
29419
29430
  getAdditionalAnalyticsProperties() {
29420
29431
  var o2, n2, l2, u2, p2, h2, T, g2;
29421
- let e = Ba(), t2 = typeof document != "undefined" && document.hidden, i2 = this.store.getRemoteVideoTracks().filter((v2) => v2.degraded).length, r2 = (u2 = (l2 = (n2 = (o2 = this.getWebrtcInternals()) == null ? void 0 : o2.getCurrentStats()) == null ? void 0 : n2.getLocalPeerStats()) == null ? void 0 : l2.publish) == null ? void 0 : u2.bitrate, s2 = (g2 = (T = (h2 = (p2 = this.getWebrtcInternals()) == null ? void 0 : p2.getCurrentStats()) == null ? void 0 : h2.getLocalPeerStats()) == null ? void 0 : T.subscribe) == null ? void 0 : g2.bitrate;
29432
+ let e = Ba(), t2 = typeof document != "undefined" && document.hidden, i2 = this.store.getRemoteVideoTracks().filter((f2) => f2.degraded).length, r2 = (u2 = (l2 = (n2 = (o2 = this.getWebrtcInternals()) == null ? void 0 : o2.getCurrentStats()) == null ? void 0 : n2.getLocalPeerStats()) == null ? void 0 : l2.publish) == null ? void 0 : u2.bitrate, s2 = (g2 = (T = (h2 = (p2 = this.getWebrtcInternals()) == null ? void 0 : p2.getCurrentStats()) == null ? void 0 : h2.getLocalPeerStats()) == null ? void 0 : T.subscribe) == null ? void 0 : g2.bitrate;
29422
29433
  return { network_info: e, document_hidden: t2, num_degraded_tracks: i2, bitrate: { publish: r2, subscribe: s2 }, max_sub_bitrate: this.maxSubscribeBitrate, recent_pong_response_times: this.signal.getPongResponseTimes(), transport_state: this.state };
29423
29434
  }
29424
29435
  };
@@ -29427,8 +29438,9 @@ var init_dist = __esm({
29427
29438
  constructor() {
29428
29439
  this.TAG = "[HMSSdk]:";
29429
29440
  this.transportState = "Disconnected";
29430
- this.analyticsTimer = new di();
29441
+ this.analyticsTimer = new ci();
29431
29442
  this.sdkState = m({}, Fa);
29443
+ this.isDiagnostics = false;
29432
29444
  this.playlistSettings = { video: { bitrate: Dr }, audio: { bitrate: wr } };
29433
29445
  this.handleAutoplayError = (e) => {
29434
29446
  var t2, i2;
@@ -29497,7 +29509,7 @@ var init_dist = __esm({
29497
29509
  var s2, o2, n2, l2;
29498
29510
  if (e.error && e.type) {
29499
29511
  let u2 = e.type.includes("audio") ? (s2 = this.localPeer) == null ? void 0 : s2.audioTrack : (o2 = this.localPeer) == null ? void 0 : o2.videoTrack;
29500
- (n2 = this.errorListener) == null || n2.onError(e.error), [P4.TracksErrors.CANT_ACCESS_CAPTURE_DEVICE, P4.TracksErrors.DEVICE_IN_USE, P4.TracksErrors.DEVICE_NOT_AVAILABLE].includes(e.error.code) && u2 && (u2.setEnabled(false), (l2 = this.listener) == null || l2.onTrackUpdate(2, u2, this.localPeer));
29512
+ (n2 = this.errorListener) == null || n2.onError(e.error), [E2.TracksErrors.CANT_ACCESS_CAPTURE_DEVICE, E2.TracksErrors.DEVICE_IN_USE, E2.TracksErrors.DEVICE_NOT_AVAILABLE].includes(e.error.code) && u2 && (u2.setEnabled(false), (l2 = this.listener) == null || l2.onTrackUpdate(2, u2, this.localPeer));
29501
29513
  }
29502
29514
  })();
29503
29515
  };
@@ -29510,8 +29522,9 @@ var init_dist = __esm({
29510
29522
  yield this.transport.handleLocalRoleUpdate({ oldRole: e, newRole: t2 }), yield (r2 = this.roleChangeManager) == null ? void 0 : r2.handleLocalPeerRoleUpdate({ oldRole: e, newRole: t2 }), yield this.interactivityCenter.whiteboard.handleLocalRoleUpdate();
29511
29523
  });
29512
29524
  this.sendAudioPresenceFailed = () => {
29525
+ var t2;
29513
29526
  let e = S2.TracksErrors.NoAudioDetected("PREVIEW");
29514
- d2.w(this.TAG, "Audio Presence Failure", this.transportState, e);
29527
+ d2.w(this.TAG, "Audio Presence Failure", this.transportState, e), this.isDiagnostics && ((t2 = this.listener) == null || t2.onError(e));
29515
29528
  };
29516
29529
  this.sendJoinAnalyticsEvent = (e = false, t2) => {
29517
29530
  this.eventBus.analytics.publish(y2.join(M2(m({ error: t2 }, this.analyticsTimer.getTimes()), { time: this.analyticsTimer.getTimeTaken("join_time"), is_preview_called: e, retries_join: this.transport.joinRetryCount })));
@@ -29520,11 +29533,11 @@ var init_dist = __esm({
29520
29533
  this.eventBus.analytics.publish(y2.preview(M2(m({ error: e }, this.analyticsTimer.getTimes()), { time: this.analyticsTimer.getTimeTaken("preview_time") })));
29521
29534
  };
29522
29535
  this.sendAnalyticsEvent = (e) => {
29523
- this.listener.onInitSuccess || this.analyticsEventsService.queue(e).flush();
29536
+ this.isDiagnostics || this.analyticsEventsService.queue(e).flush();
29524
29537
  };
29525
29538
  }
29526
29539
  initNotificationManager() {
29527
- this.notificationManager || (this.notificationManager = new Zi(this.store, this.eventBus, this.transport, this.listener, this.audioListener));
29540
+ this.notificationManager || (this.notificationManager = new Xi(this.store, this.eventBus, this.transport, this.listener, this.audioListener));
29528
29541
  }
29529
29542
  initStoreAndManagers(e) {
29530
29543
  var t2, i2;
@@ -29532,7 +29545,7 @@ var init_dist = __esm({
29532
29545
  (i2 = this.notificationManager) == null || i2.setListener(this.listener), this.audioSinkManager.setListener(this.listener), this.interactivityCenter.setListener(this.listener);
29533
29546
  return;
29534
29547
  }
29535
- this.sdkState.isInitialised = true, this.store = new Ot(), this.eventBus = new Bt(), this.pluginUsageTracker = new xi(this.eventBus), this.wakeLockManager = new Ni(), this.networkTestManager = new _i(this.eventBus, this.listener), this.playlistManager = new Rt(this, this.eventBus), this.deviceManager = new Ut(this.store, this.eventBus), this.audioSinkManager = new xt(this.store, this.deviceManager, this.eventBus), this.audioOutput = new Ui(this.deviceManager, this.audioSinkManager), this.audioSinkManager.setListener(this.listener), this.eventBus.autoplayError.subscribe(this.handleAutoplayError), this.localTrackManager = new ve(this.store, this.observer, this.deviceManager, this.eventBus, this.analyticsTimer), this.analyticsEventsService = new Oi(this.store), this.transport = new Yt(this.observer, this.deviceManager, this.store, this.eventBus, this.analyticsEventsService, this.analyticsTimer, this.pluginUsageTracker), e.onInitSuccess && this.transport.setConnectivityListener(e), this.sessionStore = new er(this.transport), this.interactivityCenter = new Ft(this.transport, this.store, this.listener), this.eventBus.analytics.subscribe(this.sendAnalyticsEvent), this.eventBus.deviceChange.subscribe(this.handleDeviceChange), this.eventBus.audioPluginFailed.subscribe(this.handleAudioPluginError);
29548
+ this.sdkState.isInitialised = true, this.store = new Nt(), this.eventBus = new Ut(), this.pluginUsageTracker = new Oi(this.eventBus), this.wakeLockManager = new _i(), this.networkTestManager = new wi(this.eventBus, this.listener), this.playlistManager = new bt(this, this.eventBus), this.deviceManager = new xt(this.store, this.eventBus), this.audioSinkManager = new Ot(this.store, this.deviceManager, this.eventBus), this.audioOutput = new xi(this.deviceManager, this.audioSinkManager), this.audioSinkManager.setListener(this.listener), this.eventBus.autoplayError.subscribe(this.handleAutoplayError), this.localTrackManager = new ve(this.store, this.observer, this.deviceManager, this.eventBus, this.analyticsTimer), this.analyticsEventsService = new Ni(this.store), this.transport = new zt(this.observer, this.deviceManager, this.store, this.eventBus, this.analyticsEventsService, this.analyticsTimer, this.pluginUsageTracker), e.onInitSuccess && this.transport.setConnectivityListener(e), this.sessionStore = new Zi(this.transport), this.interactivityCenter = new Vt(this.transport, this.store, this.listener), this.eventBus.analytics.subscribe(this.sendAnalyticsEvent), this.eventBus.deviceChange.subscribe(this.handleDeviceChange), this.eventBus.audioPluginFailed.subscribe(this.handleAudioPluginError);
29536
29549
  }
29537
29550
  validateJoined(e) {
29538
29551
  if (!this.localPeer)
@@ -29579,7 +29592,7 @@ var init_dist = __esm({
29579
29592
  return this.interactivityCenter;
29580
29593
  }
29581
29594
  getPeerListIterator(e) {
29582
- return new mi(this.transport, this.store, e);
29595
+ return new hi(this.transport, this.store, e);
29583
29596
  }
29584
29597
  updatePlaylistSettings(e) {
29585
29598
  e.video && Object.assign(this.playlistSettings.video, e.video), e.audio && Object.assign(this.playlistSettings.audio, e.audio);
@@ -29590,7 +29603,7 @@ var init_dist = __esm({
29590
29603
  }
29591
29604
  preview(e, t2) {
29592
29605
  return c2(this, null, function* () {
29593
- if (Tt(), gt(), this.sdkState.isPreviewInProgress)
29606
+ if (gt(), St(), this.sdkState.isPreviewInProgress)
29594
29607
  return Promise.reject(S2.GenericErrors.PreviewAlreadyInProgress("PREVIEW", "Preview already called"));
29595
29608
  if (["Joined", "Reconnecting"].includes(this.transportState))
29596
29609
  return this.midCallPreview(e.asRole, e.settings);
@@ -29650,17 +29663,17 @@ var init_dist = __esm({
29650
29663
  join(e, t2) {
29651
29664
  return c2(this, null, function* () {
29652
29665
  var l2, u2, p2, h2, T, g2;
29653
- if (Tt(), gt(), this.sdkState.isPreviewInProgress)
29666
+ if (gt(), St(), this.sdkState.isPreviewInProgress)
29654
29667
  throw S2.GenericErrors.NotReady("JOIN", "Preview is in progress, can't join");
29655
29668
  this.analyticsTimer.start("join_time"), this.sdkState.isJoinInProgress = true;
29656
- let { roomId: i2, userId: r2, role: s2 } = nt(e.authToken), o2 = ((u2 = (l2 = this.localPeer) == null ? void 0 : l2.asRole) == null ? void 0 : u2.name) || ((h2 = (p2 = this.localPeer) == null ? void 0 : p2.role) == null ? void 0 : h2.name);
29657
- (T = this.networkTestManager) == null || T.stop(), this.commonSetup(e, i2, t2), this.removeDevicesFromConfig(e), this.store.setConfig(e), this.store.createAndSetUserAgent(this.frameworkInfo), Ie.resumeContext();
29669
+ let { roomId: i2, userId: r2, role: s2 } = pr(e.authToken), o2 = ((u2 = (l2 = this.localPeer) == null ? void 0 : l2.asRole) == null ? void 0 : u2.name) || ((h2 = (p2 = this.localPeer) == null ? void 0 : p2.role) == null ? void 0 : h2.name);
29670
+ (T = this.networkTestManager) == null || T.stop(), this.commonSetup(e, i2, t2), this.removeDevicesFromConfig(e), this.store.setConfig(e), this.store.createAndSetUserAgent(this.frameworkInfo), He.resumeContext();
29658
29671
  let n2 = this.store.getConfig();
29659
- n2 != null && n2.autoManageWakeLock && this.wakeLockManager.acquireLock(), this.localPeer ? (this.localPeer.name = e.userName, this.localPeer.role = this.store.getPolicyForRole(s2), this.localPeer.customerUserId = r2, this.localPeer.metadata = e.metaData, delete this.localPeer.asRole) : this.createAndAddLocalPeerToStore(e, s2, r2), this.roleChangeManager = new _t(this.store, this.transport, this.deviceManager, this.getAndPublishTracks.bind(this), this.removeTrack.bind(this), this.listener), this.eventBus.localRoleUpdate.subscribe(this.handleLocalRoleUpdate), d2.d(this.TAG, `\u23F3 Joining room ${i2}`), d2.time(`join-room-${i2}`);
29672
+ n2 != null && n2.autoManageWakeLock && this.wakeLockManager.acquireLock(), this.localPeer ? (this.localPeer.name = e.userName, this.localPeer.role = this.store.getPolicyForRole(s2), this.localPeer.customerUserId = r2, this.localPeer.metadata = e.metaData, delete this.localPeer.asRole) : this.createAndAddLocalPeerToStore(e, s2, r2), this.roleChangeManager = new wt(this.store, this.transport, this.deviceManager, this.getAndPublishTracks.bind(this), this.removeTrack.bind(this), this.listener), this.eventBus.localRoleUpdate.subscribe(this.handleLocalRoleUpdate), d2.d(this.TAG, `\u23F3 Joining room ${i2}`), d2.time(`join-room-${i2}`);
29660
29673
  try {
29661
29674
  yield this.transport.join(e.authToken, this.localPeer.peerId, { name: e.userName, metaData: e.metaData }, e.initEndpoint, e.autoVideoSubscribe, e.iceServers), d2.d(this.TAG, `\u2705 Joined room ${i2}`), this.analyticsTimer.start("peer_list_time"), yield this.notifyJoin(), this.sdkState.isJoinInProgress = false, yield this.publish(e.settings, o2);
29662
- } catch (v2) {
29663
- throw this.analyticsTimer.end("join_time"), this.sdkState.isJoinInProgress = false, (g2 = this.listener) == null || g2.onError(v2), this.sendJoinAnalyticsEvent(this.sdkState.isPreviewCalled, v2), d2.e(this.TAG, "Unable to join room", v2), v2;
29675
+ } catch (f2) {
29676
+ throw this.analyticsTimer.end("join_time"), this.sdkState.isJoinInProgress = false, (g2 = this.listener) == null || g2.onError(f2), this.sendJoinAnalyticsEvent(this.sdkState.isPreviewCalled, f2), d2.e(this.TAG, "Unable to join room", f2), f2;
29664
29677
  }
29665
29678
  d2.timeEnd(`join-room-${i2}`);
29666
29679
  });
@@ -29670,20 +29683,22 @@ var init_dist = __esm({
29670
29683
  }
29671
29684
  cleanup() {
29672
29685
  var e, t2, i2;
29673
- this.cleanDeviceManagers(), this.eventBus.analytics.unsubscribe(this.sendAnalyticsEvent), this.analyticsTimer.cleanup(), z2.cleanup(), this.playlistManager.cleanup(), (e = this.wakeLockManager) == null || e.cleanup(), ve.cleanup(), this.notificationManager = void 0, d2.cleanup(), this.sdkState = m({}, Fa), this.localPeer && ((t2 = this.localPeer.audioTrack) == null || t2.cleanup(), this.localPeer.audioTrack = void 0, (i2 = this.localPeer.videoTrack) == null || i2.cleanup(), this.localPeer.videoTrack = void 0), this.store.cleanup(), this.listener = void 0, this.roleChangeManager && this.eventBus.localRoleUpdate.unsubscribe(this.handleLocalRoleUpdate);
29686
+ this.cleanDeviceManagers(), this.eventBus.analytics.unsubscribe(this.sendAnalyticsEvent), this.analyticsTimer.cleanup(), Q2.cleanup(), this.playlistManager.cleanup(), (e = this.wakeLockManager) == null || e.cleanup(), ve.cleanup(), this.notificationManager = void 0, d2.cleanup(), this.sdkState = m({}, Fa), this.localPeer && ((t2 = this.localPeer.audioTrack) == null || t2.cleanup(), this.localPeer.audioTrack = void 0, (i2 = this.localPeer.videoTrack) == null || i2.cleanup(), this.localPeer.videoTrack = void 0), this.store.cleanup(), this.listener = void 0, this.roleChangeManager && this.eventBus.localRoleUpdate.unsubscribe(this.handleLocalRoleUpdate);
29674
29687
  }
29675
29688
  leave(e) {
29676
29689
  return this.internalLeave(e);
29677
29690
  }
29678
29691
  internalLeave(e = true, t2) {
29679
29692
  return c2(this, null, function* () {
29680
- var r2, s2, o2;
29693
+ var r2, s2, o2, n2;
29681
29694
  let i2 = (r2 = this.store) == null ? void 0 : r2.getRoom();
29682
29695
  if (i2) {
29683
29696
  for (; (this.sdkState.isPreviewInProgress || this.sdkState.isJoinInProgress) && !(t2 != null && t2.isTerminal); )
29684
- yield Ce(100);
29685
- let n2 = i2.id;
29686
- (s2 = this.networkTestManager) == null || s2.stop(), this.eventBus.leave.publish(t2), d2.d(this.TAG, `\u23F3 Leaving room ${n2}`), yield (o2 = this.transport) == null ? void 0 : o2.leave(e), this.cleanup(), d2.d(this.TAG, `\u2705 Left room ${n2}`);
29697
+ yield Le(100);
29698
+ let l2 = i2.id;
29699
+ (s2 = this.networkTestManager) == null || s2.stop(), this.eventBus.leave.publish(t2);
29700
+ let u2 = (o2 = this.localPeer) == null ? void 0 : o2.peerId;
29701
+ d2.d(this.TAG, `\u23F3 Leaving room ${l2}, peerId=${u2}`), yield (n2 = this.transport) == null ? void 0 : n2.leave(e), this.cleanup(), d2.d(this.TAG, `\u2705 Left room ${l2}, peerId=${u2}`);
29687
29702
  }
29688
29703
  });
29689
29704
  }
@@ -29691,7 +29706,7 @@ var init_dist = __esm({
29691
29706
  return c2(this, null, function* () {
29692
29707
  let i2 = (t2 || {}).endpoint || "https://auth.100ms.live/v2/token";
29693
29708
  this.analyticsTimer.start("GET_TOKEN");
29694
- let r2 = yield Li(i2, { method: "POST", body: JSON.stringify({ code: e.roomCode, user_id: e.userId }) }, [429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511]), s2 = yield r2.json();
29709
+ let r2 = yield Ci(i2, { method: "POST", body: JSON.stringify({ code: e.roomCode, user_id: e.userId }) }, [429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511]), s2 = yield r2.json();
29695
29710
  if (this.analyticsTimer.end("GET_TOKEN"), !r2.ok)
29696
29711
  throw S2.APIErrors.ServerErrors(s2.code, "GET_TOKEN", s2.message, false);
29697
29712
  let { token: o2 } = s2;
@@ -29849,6 +29864,9 @@ var init_dist = __esm({
29849
29864
  var t2;
29850
29865
  (t2 = this.notificationManager) == null || t2.setConnectionQualityListener(e);
29851
29866
  }
29867
+ setIsDiagnostics(e) {
29868
+ this.isDiagnostics = e;
29869
+ }
29852
29870
  changeRole(e, t2, i2 = false) {
29853
29871
  return c2(this, null, function* () {
29854
29872
  var r2;
@@ -30102,7 +30120,7 @@ var init_dist = __esm({
30102
30120
  initDeviceManagers() {
30103
30121
  return c2(this, null, function* () {
30104
30122
  var e, t2, i2, r2, s2;
30105
- this.sdkState.deviceManagersInitialised || (this.sdkState.deviceManagersInitialised = true, yield this.deviceManager.init(), (yield this.deviceManager.updateOutputDevice((t2 = (e = this.store.getConfig()) == null ? void 0 : e.settings) == null ? void 0 : t2.audioOutputDeviceId)) || (yield this.deviceManager.updateOutputDevice((r2 = (i2 = z2.getSelection()) == null ? void 0 : i2.audioOutput) == null ? void 0 : r2.deviceId)), this.audioSinkManager.init((s2 = this.store.getConfig()) == null ? void 0 : s2.audioSinkElementId));
30123
+ this.sdkState.deviceManagersInitialised || (this.sdkState.deviceManagersInitialised = true, yield this.deviceManager.init(), (yield this.deviceManager.updateOutputDevice((t2 = (e = this.store.getConfig()) == null ? void 0 : e.settings) == null ? void 0 : t2.audioOutputDeviceId)) || (yield this.deviceManager.updateOutputDevice((r2 = (i2 = Q2.getSelection()) == null ? void 0 : i2.audioOutput) == null ? void 0 : r2.deviceId)), this.audioSinkManager.init((s2 = this.store.getConfig()) == null ? void 0 : s2.audioSinkElementId));
30106
30124
  });
30107
30125
  }
30108
30126
  cleanDeviceManagers() {
@@ -30139,7 +30157,7 @@ var init_dist = __esm({
30139
30157
  }
30140
30158
  setUpPreview(e, t2) {
30141
30159
  this.sdkState.isPreviewCalled = true, this.sdkState.isPreviewInProgress = true;
30142
- let { roomId: i2, userId: r2, role: s2 } = nt(e.authToken);
30160
+ let { roomId: i2, userId: r2, role: s2 } = pr(e.authToken);
30143
30161
  this.commonSetup(e, i2, t2), this.store.setConfig(e), this.store.createAndSetUserAgent(this.frameworkInfo), this.createAndAddLocalPeerToStore(e, s2, r2, e.asRole);
30144
30162
  }
30145
30163
  setPlaylistSettings(r2) {
@@ -30164,7 +30182,7 @@ var init_dist = __esm({
30164
30182
  this.store.addPeer(n2);
30165
30183
  }
30166
30184
  commonSetup(e, t2, i2) {
30167
- this.stringifyMetadata(e), e.initEndpoint || (e.initEndpoint = "https://prod-init.100ms.live"), this.initStoreAndManagers(i2), this.store.getRoom() || this.store.setRoom(new Ne(t2));
30185
+ this.stringifyMetadata(e), e.initEndpoint || (e.initEndpoint = "https://prod-init.100ms.live"), this.initStoreAndManagers(i2), this.store.getRoom() || this.store.setRoom(new Ke(t2));
30168
30186
  }
30169
30187
  removeDevicesFromConfig(e) {
30170
30188
  this.store.getConfig() && e.settings && (delete e.settings.audioOutputDeviceId, delete e.settings.videoDeviceId, delete e.settings.audioInputDeviceId);
@@ -30187,11 +30205,11 @@ var init_dist = __esm({
30187
30205
  e.source === "audioplaylist" ? this.playlistManager.stop("audio") : e.source === "videoplaylist" && this.playlistManager.stop("video");
30188
30206
  }
30189
30207
  };
30190
- ut = class a10 {
30208
+ lt = class a10 {
30191
30209
  constructor(e, t2, i2) {
30192
- this.getStats = () => (this.stats || (this.stats = new Xt(this.store, this.sdk)), this.stats);
30210
+ this.getStats = () => (this.stats || (this.stats = new Yt(this.store, this.sdk)), this.stats);
30193
30211
  this.getDiagnosticsSDK = () => (this.diagnostics || (this.diagnostics = this.actions.initDiagnostics()), this.diagnostics);
30194
- e ? this.store = e : this.store = a10.createNewHMSStore(wi("HMSStore"), ti), i2 ? this.notifications = i2 : this.notifications = new Pi(this.store), t2 ? this.actions = t2 : (this.sdk = new hr(), this.actions = new Di(this.store, this.sdk, this.notifications)), this.actions.setFrameworkInfo({ type: "js", sdkVersion: Mr().version }), this.initialTriggerOnSubscribe = false, O2 && (window.__hms = this);
30212
+ e ? this.store = e : this.store = a10.createNewHMSStore(Di("HMSStore"), ei), i2 ? this.notifications = i2 : this.notifications = new ki(this.store), t2 ? this.actions = t2 : (this.sdk = new hr(), this.actions = new Li(this.store, this.sdk, this.notifications)), this.actions.setFrameworkInfo({ type: "js", sdkVersion: Mr().version }), this.initialTriggerOnSubscribe = false, O2 && (window.__hms = this);
30195
30213
  }
30196
30214
  triggerOnSubscribe() {
30197
30215
  this.initialTriggerOnSubscribe || (a10.makeStoreTriggerOnSubscribe(this.store), this.initialTriggerOnSubscribe = true);
@@ -30291,13 +30309,13 @@ var init_dist = __esm({
30291
30309
  s2 && e.namedSetState((o2) => {
30292
30310
  o2.localPeer.id = s2;
30293
30311
  }, "localpeer-id");
30294
- }, ye), a11.getState(X2) ? e.namedSetState((s2) => {
30295
- s2.localPeer.videoTrack = a11.getState(X2);
30312
+ }, ye), a11.getState(Y2) ? e.namedSetState((s2) => {
30313
+ s2.localPeer.videoTrack = a11.getState(Y2);
30296
30314
  }, "localpeer-videotrack-id") : i2 = a11.subscribe((s2) => {
30297
30315
  s2 && e.namedSetState((o2) => {
30298
30316
  o2.localPeer.videoTrack = s2;
30299
30317
  }, "localpeer-videotrack-id");
30300
- }, X2), a11.getState(ae) ? e.namedSetState((s2) => {
30318
+ }, Y2), a11.getState(ae) ? e.namedSetState((s2) => {
30301
30319
  s2.localPeer.audioTrack = a11.getState(ae);
30302
30320
  }, "localpeer-audiotrack-id") : r2 = a11.subscribe((s2) => {
30303
30321
  s2 && e.namedSetState((o2) => {
@@ -30317,19 +30335,19 @@ var init_dist = __esm({
30317
30335
  }
30318
30336
  Kr(s2.remoteTrackStats, n2);
30319
30337
  let u2 = { [o2]: e.getLocalPeerStats() };
30320
- Kr(s2.peerStats, u2), Aa(s2.localTrackStats, e.getLocalTrackStats(), i2.store.getLocalPeerTracks());
30338
+ Kr(s2.peerStats, u2), Ia(s2.localTrackStats, e.getLocalTrackStats(), i2.store.getLocalPeerTracks());
30321
30339
  }, "webrtc-stats");
30322
30340
  };
30323
30341
  yn = (a11, e = "resetState") => {
30324
30342
  a11.namedSetState((t2) => {
30325
- Object.assign(t2, ii());
30343
+ Object.assign(t2, ti());
30326
30344
  }, e);
30327
30345
  };
30328
- Xt = class {
30346
+ Yt = class {
30329
30347
  constructor(e, t2) {
30330
30348
  this.hmsStore = e;
30331
30349
  this.sdk = t2;
30332
- this.store = ut.createNewHMSStore(wi("HMSStatsStore"), ii), this.getState = this.store.getState, this.subscribe = this.store.subscribe, this.getPublishPeerConnection = () => new Promise((i2) => {
30350
+ this.store = lt.createNewHMSStore(Di("HMSStatsStore"), ti), this.getState = this.store.getState, this.subscribe = this.store.subscribe, this.getPublishPeerConnection = () => new Promise((i2) => {
30333
30351
  var r2, s2;
30334
30352
  this.hmsStore.getState(ie) === "Connected" ? i2((s2 = (r2 = this.sdk) == null ? void 0 : r2.getWebrtcInternals()) == null ? void 0 : s2.getPublishPeerConnection()) : this.hmsStore.subscribe((o2) => {
30335
30353
  var n2, l2;
@@ -30353,11 +30371,11 @@ var init_dist = __esm({
30353
30371
  Ka = (a11) => a11.peerStats;
30354
30372
  Zr = (a11) => a11.localTrackStats;
30355
30373
  be = createSelector([Ka, kn], (a11, e) => a11[e]);
30356
- An = createSelector(be, (a11) => {
30374
+ In = createSelector(be, (a11) => {
30357
30375
  var e;
30358
30376
  return (e = a11 == null ? void 0 : a11.subscribe) == null ? void 0 : e.packetsLost;
30359
30377
  });
30360
- In = createSelector(be, (a11) => {
30378
+ An = createSelector(be, (a11) => {
30361
30379
  var e;
30362
30380
  return (e = a11 == null ? void 0 : a11.subscribe) == null ? void 0 : e.jitter;
30363
30381
  });
@@ -30388,18 +30406,18 @@ var init_dist = __esm({
30388
30406
  Nn = createSelector([Ka, bn], (a11, e) => e ? a11[e] : void 0);
30389
30407
  On = createSelector([Rn, $a], (a11, e) => e ? a11[e] : void 0);
30390
30408
  es = createSelector([Zr, $a], (a11, e) => e ? a11[e] : void 0);
30391
- xn = I2(Nn);
30392
- Un = I2(On);
30409
+ xn = A2(Nn);
30410
+ Un = A2(On);
30393
30411
  Bn = createSelector([Zr, Pn], (a11, e) => {
30394
30412
  var t2;
30395
30413
  return e ? (t2 = a11[e]) == null ? void 0 : t2[0] : void 0;
30396
30414
  });
30397
- Vn = I2(createSelector(es, (a11) => a11 == null ? void 0 : a11[0]));
30415
+ Vn = A2(createSelector(es, (a11) => a11 == null ? void 0 : a11[0]));
30398
30416
  Fn = createSelector([Zr, En], (a11, e) => {
30399
30417
  var t2;
30400
30418
  return e ? (t2 = a11[e]) == null ? void 0 : t2[0] : void 0;
30401
30419
  });
30402
- Gn = I2(createSelector(es, (a11) => a11));
30420
+ Gn = A2(createSelector(es, (a11) => a11));
30403
30421
  }
30404
30422
  });
30405
30423
 
@@ -40105,9 +40123,9 @@ var init_ScreenshareLayout = __esm({
40105
40123
  }
40106
40124
  });
40107
40125
 
40108
- // ../../../../../../../tmp/tmp-2777-ppkSGwyjZwID/19035d7bbbe0/index.css
40109
- var init_d7bbbe0 = __esm({
40110
- "../../../../../../../tmp/tmp-2777-ppkSGwyjZwID/19035d7bbbe0/index.css"() {
40126
+ // ../../../../../../../tmp/tmp-2791-2VpWUhe2QfhV/190499bfe9e1/index.css
40127
+ var init_bfe9e1 = __esm({
40128
+ "../../../../../../../tmp/tmp-2791-2VpWUhe2QfhV/190499bfe9e1/index.css"() {
40111
40129
  }
40112
40130
  });
40113
40131
 
@@ -40129,7 +40147,7 @@ var init_WhiteboardLayout = __esm({
40129
40147
  init_ProminenceLayout();
40130
40148
  init_useUISettings();
40131
40149
  init_constants();
40132
- init_d7bbbe0();
40150
+ init_bfe9e1();
40133
40151
  WhiteboardEmbed = () => {
40134
40152
  const isMobile = (0, import_react_use42.useMedia)(config.media.md);
40135
40153
  const { token, endpoint, zoomToContent } = (0, import_react_sdk93.useWhiteboard)(isMobile);
@@ -44125,67 +44143,11 @@ var init_ios_perm_0 = __esm({
44125
44143
  });
44126
44144
 
44127
44145
  // src/Prebuilt/components/Notifications/PermissionErrorModal.tsx
44128
- function PermissionErrorModal() {
44146
+ function PermissionErrorNotificationModal() {
44129
44147
  const notification = (0, import_react_sdk115.useHMSNotifications)(import_react_sdk115.HMSNotificationTypes.ERROR);
44130
- const [deviceType, setDeviceType] = (0, import_react223.useState)("");
44131
- const [isSystemError, setIsSystemError] = (0, import_react223.useState)(false);
44132
- const isMobile = (0, import_react_use53.useMedia)(config.media.md);
44133
- (0, import_react223.useEffect)(() => {
44134
- var _a8, _b7, _c, _d, _e2;
44135
- if (!notification || ((_a8 = notification.data) == null ? void 0 : _a8.code) !== 3001 && ((_b7 = notification.data) == null ? void 0 : _b7.code) !== 3011 || ((_c = notification.data) == null ? void 0 : _c.code) === 3001 && ((_d = notification.data) == null ? void 0 : _d.message.includes("screen"))) {
44136
- return;
44137
- }
44138
- console.error(`[${notification.type}]`, notification);
44139
- const errorMessage = (_e2 = notification.data) == null ? void 0 : _e2.message;
44140
- const hasAudio = errorMessage.includes("audio");
44141
- const hasVideo = errorMessage.includes("video");
44142
- const hasScreen = errorMessage.includes("screen");
44143
- if (hasAudio && hasVideo) {
44144
- setDeviceType("camera and microphone");
44145
- } else if (hasAudio) {
44146
- setDeviceType("microphone");
44147
- } else if (hasVideo) {
44148
- setDeviceType("camera");
44149
- } else if (hasScreen) {
44150
- setDeviceType("screen");
44151
- }
44152
- setIsSystemError(notification.data.code === 3011);
44153
- }, [notification]);
44154
- return deviceType ? /* @__PURE__ */ import_react223.default.createElement(Dialog.Root, { open: !!deviceType }, /* @__PURE__ */ import_react223.default.createElement(Dialog.Portal, null, /* @__PURE__ */ import_react223.default.createElement(Dialog.Overlay, null), /* @__PURE__ */ import_react223.default.createElement(
44155
- Dialog.Content,
44156
- {
44157
- css: {
44158
- w: "min(380px, 90%)",
44159
- p: "$8",
44160
- // overlay over Sheet.tsx
44161
- zIndex: 23
44162
- }
44163
- },
44164
- /* @__PURE__ */ import_react223.default.createElement(
44165
- Dialog.Title,
44166
- {
44167
- css: {
44168
- borderBottom: "1px solid $border_default"
44169
- }
44170
- },
44171
- isMobile && isIOS ? /* @__PURE__ */ import_react223.default.createElement("img", { style: { maxWidth: "100%", maxHeight: "100%" }, src: ios_perm_0_default, alt: "iOS Permission flow" }) : null,
44172
- isMobile && isAndroid ? /* @__PURE__ */ import_react223.default.createElement(
44173
- "img",
44174
- {
44175
- src: android_perm_1_default,
44176
- style: { maxWidth: "100%", maxHeight: "100%" },
44177
- alt: "Android Permission flow "
44178
- }
44179
- ) : null,
44180
- /* @__PURE__ */ import_react223.default.createElement(Text, { variant: "h6" }, "We can't access your ", deviceType)
44181
- ),
44182
- /* @__PURE__ */ import_react223.default.createElement(Text, { variant: "sm", css: { pt: "$4", pb: "$10", color: "$on_surface_medium" } }, isMobile && isIOS ? 'Enable permissions by reloading this page and clicking "Allow" on the pop-up, or change settings from the address bar.' : null, isMobile && isAndroid ? `To allow other users to see and hear you, click the blocked camera icon in your browser's address bar.` : null, !isMobile ? `Access to ${deviceType} is required. ` : null, isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from sytem settings` : null, !isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from address bar or browser settings.` : null),
44183
- isMobile && isIOS ? /* @__PURE__ */ import_react223.default.createElement(import_react223.default.Fragment, null, /* @__PURE__ */ import_react223.default.createElement(Button, { onClick: () => window.location.reload(), css: { w: "100%", mb: "$6" } }, "Reload"), /* @__PURE__ */ import_react223.default.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null,
44184
- isMobile && isAndroid ? /* @__PURE__ */ import_react223.default.createElement(import_react223.default.Fragment, null, /* @__PURE__ */ import_react223.default.createElement(Button, { onClick: () => setDeviceType(""), css: { w: "100%", mb: "$6" } }, "I've allowed access"), /* @__PURE__ */ import_react223.default.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null,
44185
- !isMobile ? /* @__PURE__ */ import_react223.default.createElement(Flex, { justify: "end", css: { w: "100%" } }, /* @__PURE__ */ import_react223.default.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType("") }, "Dismiss")) : null
44186
- ))) : null;
44148
+ return /* @__PURE__ */ import_react223.default.createElement(PermissionErrorModal, { error: notification == null ? void 0 : notification.data });
44187
44149
  }
44188
- var import_react223, import_react_use53, import_react_sdk115;
44150
+ var import_react223, import_react_use53, import_react_sdk115, PermissionErrorModal;
44189
44151
  var init_PermissionErrorModal = __esm({
44190
44152
  "src/Prebuilt/components/Notifications/PermissionErrorModal.tsx"() {
44191
44153
  "use strict";
@@ -44197,6 +44159,63 @@ var init_PermissionErrorModal = __esm({
44197
44159
  init_android_perm_1();
44198
44160
  init_ios_perm_0();
44199
44161
  init_constants();
44162
+ PermissionErrorModal = ({ error }) => {
44163
+ const [deviceType, setDeviceType] = (0, import_react223.useState)("");
44164
+ const [isSystemError, setIsSystemError] = (0, import_react223.useState)(false);
44165
+ const isMobile = (0, import_react_use53.useMedia)(config.media.md);
44166
+ (0, import_react223.useEffect)(() => {
44167
+ if (!error || (error == null ? void 0 : error.code) !== 3001 && (error == null ? void 0 : error.code) !== 3011 || (error == null ? void 0 : error.code) === 3001 && (error == null ? void 0 : error.message.includes("screen"))) {
44168
+ return;
44169
+ }
44170
+ const errorMessage = error == null ? void 0 : error.message;
44171
+ const hasAudio = errorMessage.includes("audio");
44172
+ const hasVideo = errorMessage.includes("video");
44173
+ const hasScreen = errorMessage.includes("screen");
44174
+ if (hasAudio && hasVideo) {
44175
+ setDeviceType("camera and microphone");
44176
+ } else if (hasAudio) {
44177
+ setDeviceType("microphone");
44178
+ } else if (hasVideo) {
44179
+ setDeviceType("camera");
44180
+ } else if (hasScreen) {
44181
+ setDeviceType("screen");
44182
+ }
44183
+ setIsSystemError(error.code === 3011);
44184
+ }, [error]);
44185
+ return deviceType ? /* @__PURE__ */ import_react223.default.createElement(Dialog.Root, { open: !!deviceType }, /* @__PURE__ */ import_react223.default.createElement(Dialog.Portal, null, /* @__PURE__ */ import_react223.default.createElement(Dialog.Overlay, null), /* @__PURE__ */ import_react223.default.createElement(
44186
+ Dialog.Content,
44187
+ {
44188
+ css: {
44189
+ w: "min(380px, 90%)",
44190
+ p: "$8",
44191
+ // overlay over Sheet.tsx
44192
+ zIndex: 23
44193
+ }
44194
+ },
44195
+ /* @__PURE__ */ import_react223.default.createElement(
44196
+ Dialog.Title,
44197
+ {
44198
+ css: {
44199
+ borderBottom: "1px solid $border_default"
44200
+ }
44201
+ },
44202
+ isMobile && isIOS ? /* @__PURE__ */ import_react223.default.createElement("img", { style: { maxWidth: "100%", maxHeight: "100%" }, src: ios_perm_0_default, alt: "iOS Permission flow" }) : null,
44203
+ isMobile && isAndroid ? /* @__PURE__ */ import_react223.default.createElement(
44204
+ "img",
44205
+ {
44206
+ src: android_perm_1_default,
44207
+ style: { maxWidth: "100%", maxHeight: "100%" },
44208
+ alt: "Android Permission flow "
44209
+ }
44210
+ ) : null,
44211
+ /* @__PURE__ */ import_react223.default.createElement(Text, { variant: "h6" }, "We can't access your ", deviceType)
44212
+ ),
44213
+ /* @__PURE__ */ import_react223.default.createElement(Text, { variant: "sm", css: { pt: "$4", pb: "$10", color: "$on_surface_medium" } }, isMobile && isIOS ? 'Enable permissions by reloading this page and clicking "Allow" on the pop-up, or change settings from the address bar.' : null, isMobile && isAndroid ? `To allow other users to see and hear you, click the blocked camera icon in your browser's address bar.` : null, !isMobile ? `Access to ${deviceType} is required. ` : null, isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from sytem settings` : null, !isSystemError && !isMobile ? `Enable permissions for ${deviceType}${deviceType === "screen" ? "share" : ""} from address bar or browser settings.` : null),
44214
+ isMobile && isIOS ? /* @__PURE__ */ import_react223.default.createElement(import_react223.default.Fragment, null, /* @__PURE__ */ import_react223.default.createElement(Button, { onClick: () => window.location.reload(), css: { w: "100%", mb: "$6" } }, "Reload"), /* @__PURE__ */ import_react223.default.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null,
44215
+ isMobile && isAndroid ? /* @__PURE__ */ import_react223.default.createElement(import_react223.default.Fragment, null, /* @__PURE__ */ import_react223.default.createElement(Button, { onClick: () => setDeviceType(""), css: { w: "100%", mb: "$6" } }, "I've allowed access"), /* @__PURE__ */ import_react223.default.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType(""), css: { w: "100%" } }, "Continue anyway")) : null,
44216
+ !isMobile ? /* @__PURE__ */ import_react223.default.createElement(Flex, { justify: "end", css: { w: "100%" } }, /* @__PURE__ */ import_react223.default.createElement(Button, { outlined: true, variant: "standard", onClick: () => setDeviceType("") }, "Dismiss")) : null
44217
+ ))) : null;
44218
+ };
44200
44219
  }
44201
44220
  });
44202
44221
 
@@ -44591,7 +44610,7 @@ function Notifications() {
44591
44610
  if (isNotificationDisabled) {
44592
44611
  return null;
44593
44612
  }
44594
- return /* @__PURE__ */ import_react229.default.createElement(import_react229.default.Fragment, null, /* @__PURE__ */ import_react229.default.createElement(TrackUnmuteModal, null), /* @__PURE__ */ import_react229.default.createElement(TrackBulkUnmuteModal, null), /* @__PURE__ */ import_react229.default.createElement(TrackNotifications, null), roomState === import_react_sdk121.HMSRoomState.Connected ? /* @__PURE__ */ import_react229.default.createElement(PeerNotifications, null) : null, /* @__PURE__ */ import_react229.default.createElement(ReconnectNotifications, null), /* @__PURE__ */ import_react229.default.createElement(AutoplayBlockedModal, null), /* @__PURE__ */ import_react229.default.createElement(PermissionErrorModal, null), /* @__PURE__ */ import_react229.default.createElement(InitErrorModal, null), /* @__PURE__ */ import_react229.default.createElement(ChatNotifications, null), /* @__PURE__ */ import_react229.default.createElement(HandRaisedNotifications, null), /* @__PURE__ */ import_react229.default.createElement(TranscriptionNotifications, null));
44613
+ return /* @__PURE__ */ import_react229.default.createElement(import_react229.default.Fragment, null, /* @__PURE__ */ import_react229.default.createElement(TrackUnmuteModal, null), /* @__PURE__ */ import_react229.default.createElement(TrackBulkUnmuteModal, null), /* @__PURE__ */ import_react229.default.createElement(TrackNotifications, null), roomState === import_react_sdk121.HMSRoomState.Connected ? /* @__PURE__ */ import_react229.default.createElement(PeerNotifications, null) : null, /* @__PURE__ */ import_react229.default.createElement(ReconnectNotifications, null), /* @__PURE__ */ import_react229.default.createElement(AutoplayBlockedModal, null), /* @__PURE__ */ import_react229.default.createElement(PermissionErrorNotificationModal, null), /* @__PURE__ */ import_react229.default.createElement(InitErrorModal, null), /* @__PURE__ */ import_react229.default.createElement(ChatNotifications, null), /* @__PURE__ */ import_react229.default.createElement(HandRaisedNotifications, null), /* @__PURE__ */ import_react229.default.createElement(TranscriptionNotifications, null));
44595
44614
  }
44596
44615
  var import_react229, import_react_sdk121, import_react_icons108, pollToastKey;
44597
44616
  var init_Notifications = __esm({
@@ -45306,7 +45325,7 @@ var init_hms = __esm({
45306
45325
  "use strict";
45307
45326
  init_define_process_env();
45308
45327
  init_dist();
45309
- hms = new ut();
45328
+ hms = new lt();
45310
45329
  hmsStore = hms.getStore();
45311
45330
  hmsActions = hms.getActions();
45312
45331
  hmsNotifications = hms.getNotifications();
@@ -45398,7 +45417,7 @@ var require_react_is_production_min = __commonJS({
45398
45417
  var c3 = b3 ? Symbol.for("react.element") : 60103;
45399
45418
  var d3 = b3 ? Symbol.for("react.portal") : 60106;
45400
45419
  var e = b3 ? Symbol.for("react.fragment") : 60107;
45401
- var f3 = b3 ? Symbol.for("react.strict_mode") : 60108;
45420
+ var f2 = b3 ? Symbol.for("react.strict_mode") : 60108;
45402
45421
  var g2 = b3 ? Symbol.for("react.profiler") : 60114;
45403
45422
  var h2 = b3 ? Symbol.for("react.provider") : 60109;
45404
45423
  var k2 = b3 ? Symbol.for("react.context") : 60110;
@@ -45409,7 +45428,7 @@ var require_react_is_production_min = __commonJS({
45409
45428
  var q3 = b3 ? Symbol.for("react.suspense_list") : 60120;
45410
45429
  var r2 = b3 ? Symbol.for("react.memo") : 60115;
45411
45430
  var t2 = b3 ? Symbol.for("react.lazy") : 60116;
45412
- var v2 = b3 ? Symbol.for("react.block") : 60121;
45431
+ var v3 = b3 ? Symbol.for("react.block") : 60121;
45413
45432
  var w2 = b3 ? Symbol.for("react.fundamental") : 60117;
45414
45433
  var x2 = b3 ? Symbol.for("react.responder") : 60118;
45415
45434
  var y3 = b3 ? Symbol.for("react.scope") : 60119;
@@ -45423,7 +45442,7 @@ var require_react_is_production_min = __commonJS({
45423
45442
  case m2:
45424
45443
  case e:
45425
45444
  case g2:
45426
- case f3:
45445
+ case f2:
45427
45446
  case p2:
45428
45447
  return a11;
45429
45448
  default:
@@ -45457,7 +45476,7 @@ var require_react_is_production_min = __commonJS({
45457
45476
  exports.Memo = r2;
45458
45477
  exports.Portal = d3;
45459
45478
  exports.Profiler = g2;
45460
- exports.StrictMode = f3;
45479
+ exports.StrictMode = f2;
45461
45480
  exports.Suspense = p2;
45462
45481
  exports.isAsyncMode = function(a11) {
45463
45482
  return A3(a11) || z3(a11) === l2;
@@ -45491,13 +45510,13 @@ var require_react_is_production_min = __commonJS({
45491
45510
  return z3(a11) === g2;
45492
45511
  };
45493
45512
  exports.isStrictMode = function(a11) {
45494
- return z3(a11) === f3;
45513
+ return z3(a11) === f2;
45495
45514
  };
45496
45515
  exports.isSuspense = function(a11) {
45497
45516
  return z3(a11) === p2;
45498
45517
  };
45499
45518
  exports.isValidElementType = function(a11) {
45500
- return "string" === typeof a11 || "function" === typeof a11 || a11 === e || a11 === m2 || a11 === g2 || a11 === f3 || a11 === p2 || a11 === q3 || "object" === typeof a11 && null !== a11 && (a11.$$typeof === t2 || a11.$$typeof === r2 || a11.$$typeof === h2 || a11.$$typeof === k2 || a11.$$typeof === n2 || a11.$$typeof === w2 || a11.$$typeof === x2 || a11.$$typeof === y3 || a11.$$typeof === v2);
45519
+ return "string" === typeof a11 || "function" === typeof a11 || a11 === e || a11 === m2 || a11 === g2 || a11 === f2 || a11 === p2 || a11 === q3 || "object" === typeof a11 && null !== a11 && (a11.$$typeof === t2 || a11.$$typeof === r2 || a11.$$typeof === h2 || a11.$$typeof === k2 || a11.$$typeof === n2 || a11.$$typeof === w2 || a11.$$typeof === x2 || a11.$$typeof === y3 || a11.$$typeof === v3);
45501
45520
  };
45502
45521
  exports.typeOf = z3;
45503
45522
  }
@@ -46431,6 +46450,7 @@ var init_AudioTest = __esm({
46431
46450
  import_react241 = __toESM(require("react"));
46432
46451
  import_react_sdk128 = require("@100mslive/react-sdk");
46433
46452
  import_react_icons110 = require("@100mslive/react-icons");
46453
+ init_PermissionErrorModal();
46434
46454
  init_components();
46435
46455
  init_Button2();
46436
46456
  init_Layout();
@@ -46441,12 +46461,11 @@ var init_AudioTest = __esm({
46441
46461
  init_useAudioOutputTest();
46442
46462
  init_constants();
46443
46463
  SelectContainer = ({ children }) => /* @__PURE__ */ import_react241.default.createElement(Box, { css: { w: "calc(50% - 0.75rem)", "@lg": { w: "100%" } } }, children);
46444
- MicTest = () => {
46464
+ MicTest = ({ setError }) => {
46445
46465
  var _a8, _b7;
46446
46466
  const devices = (0, import_react_sdk128.useHMSStore)(import_react_sdk128.selectDevices);
46447
46467
  const [isRecording, setIsRecording] = (0, import_react241.useState)(false);
46448
- const { audioInputDeviceId } = (0, import_react_sdk128.useHMSStore)(import_react_sdk128.selectLocalMediaSettings);
46449
- const [selectedMic, setSelectedMic] = (0, import_react241.useState)(audioInputDeviceId || ((_a8 = devices.audioInput[0]) == null ? void 0 : _a8.deviceId));
46468
+ const [selectedMic, setSelectedMic] = (0, import_react241.useState)(((_a8 = devices.audioInput[0]) == null ? void 0 : _a8.deviceId) || "default");
46450
46469
  const trackID = (0, import_react_sdk128.useHMSStore)(import_react_sdk128.selectLocalAudioTrackID);
46451
46470
  const audioLevel = (0, import_react_sdk128.useHMSStore)((0, import_react_sdk128.selectTrackAudioByID)(trackID));
46452
46471
  const { audioOutputDeviceId } = (0, import_react_sdk128.useHMSStore)(import_react_sdk128.selectLocalMediaSettings);
@@ -46463,7 +46482,6 @@ var init_AudioTest = __esm({
46463
46482
  onChange: (deviceId) => {
46464
46483
  setSelectedMic(deviceId);
46465
46484
  hmsDiagnostics.stopMicCheck();
46466
- setIsRecording(false);
46467
46485
  }
46468
46486
  }
46469
46487
  ), /* @__PURE__ */ import_react241.default.createElement(Flex, { css: { gap: "$6", alignItems: "center" } }, /* @__PURE__ */ import_react241.default.createElement(
@@ -46471,15 +46489,23 @@ var init_AudioTest = __esm({
46471
46489
  {
46472
46490
  variant: "standard",
46473
46491
  icon: true,
46474
- onClick: () => hmsDiagnostics.startMicCheck(selectedMic, () => {
46475
- setIsRecording(false);
46476
- }).then(() => {
46477
- setIsRecording(true);
46478
- }),
46479
- disabled: isRecording
46492
+ onClick: () => {
46493
+ isRecording ? hmsDiagnostics.stopMicCheck() : hmsDiagnostics.startMicCheck({
46494
+ inputDevice: selectedMic,
46495
+ onError: (err) => {
46496
+ setError(err);
46497
+ },
46498
+ onStop: () => {
46499
+ setIsRecording(false);
46500
+ }
46501
+ }).then(() => {
46502
+ setIsRecording(true);
46503
+ });
46504
+ },
46505
+ disabled: devices.audioInput.length === 0 || playing
46480
46506
  },
46481
- /* @__PURE__ */ import_react241.default.createElement(import_react_icons110.MicOnIcon, null),
46482
- isRecording ? "Recording..." : "Record"
46507
+ isRecording ? /* @__PURE__ */ import_react241.default.createElement(import_react_icons110.StopIcon, null) : /* @__PURE__ */ import_react241.default.createElement(import_react_icons110.MicOnIcon, null),
46508
+ isRecording ? "Stop Recording" : "Record"
46483
46509
  ), /* @__PURE__ */ import_react241.default.createElement(
46484
46510
  Button,
46485
46511
  {
@@ -46552,9 +46578,9 @@ var init_AudioTest = __esm({
46552
46578
  }
46553
46579
  }
46554
46580
  },
46555
- !error && /* @__PURE__ */ import_react241.default.createElement(MicTest, null),
46581
+ /* @__PURE__ */ import_react241.default.createElement(MicTest, { setError }),
46556
46582
  /* @__PURE__ */ import_react241.default.createElement(SpeakerTest, null)
46557
- )), /* @__PURE__ */ import_react241.default.createElement(TestFooter, { error, ctaText: "Does your audio sound good?" }));
46583
+ )), /* @__PURE__ */ import_react241.default.createElement(TestFooter, { error, ctaText: "Does your audio sound good?" }), /* @__PURE__ */ import_react241.default.createElement(PermissionErrorModal, { error }));
46558
46584
  };
46559
46585
  }
46560
46586
  });
@@ -46794,7 +46820,7 @@ var init_ConnectivityTest = __esm({
46794
46820
  return /* @__PURE__ */ import_react243.default.createElement(import_react243.default.Fragment, null, /* @__PURE__ */ import_react243.default.createElement(TestContainer, null, /* @__PURE__ */ import_react243.default.createElement(Text, { css: { c: "$on_primary_medium" } }, "Connectivity test has been completed."), /* @__PURE__ */ import_react243.default.createElement(SignallingResult, { result: result == null ? void 0 : result.signallingReport }), /* @__PURE__ */ import_react243.default.createElement(MediaServerResult, { result: result == null ? void 0 : result.mediaServerReport }), /* @__PURE__ */ import_react243.default.createElement(AudioStats, { stats: (_b7 = (_a8 = result == null ? void 0 : result.mediaServerReport) == null ? void 0 : _a8.stats) == null ? void 0 : _b7.audio }), /* @__PURE__ */ import_react243.default.createElement(VideoStats, { stats: (_d = (_c = result == null ? void 0 : result.mediaServerReport) == null ? void 0 : _c.stats) == null ? void 0 : _d.video })), /* @__PURE__ */ import_react243.default.createElement(Footer3, { result, restart: startTest, error }));
46795
46821
  }
46796
46822
  if (progress !== void 0) {
46797
- return /* @__PURE__ */ import_react243.default.createElement(TestContainer, { css: { textAlign: "center" } }, /* @__PURE__ */ import_react243.default.createElement(Text, { css: { c: "$primary_bright" } }, /* @__PURE__ */ import_react243.default.createElement(Loading, { size: "3.5rem", color: "currentColor" })), /* @__PURE__ */ import_react243.default.createElement(Text, { variant: "h6", css: { mt: "$8" } }, "Checking your connection..."), /* @__PURE__ */ import_react243.default.createElement(
46823
+ return /* @__PURE__ */ import_react243.default.createElement(TestContainer, { css: { textAlign: "center" } }, /* @__PURE__ */ import_react243.default.createElement(Text, { css: { c: "$primary_bright", textAlign: "center" } }, /* @__PURE__ */ import_react243.default.createElement(Loading, { size: "3.5rem", color: "currentColor" })), /* @__PURE__ */ import_react243.default.createElement(Text, { variant: "h6", css: { mt: "$8" } }, "Checking your connection..."), /* @__PURE__ */ import_react243.default.createElement(
46798
46824
  Text,
46799
46825
  {
46800
46826
  variant: "body2",
@@ -46900,6 +46926,7 @@ var init_VideoTest = __esm({
46900
46926
  import_react244 = __toESM(require("react"));
46901
46927
  import_react_sdk131 = require("@100mslive/react-sdk");
46902
46928
  import_react_icons112 = require("@100mslive/react-icons");
46929
+ init_PermissionErrorModal();
46903
46930
  init_components();
46904
46931
  init_Layout();
46905
46932
  init_Text2();
@@ -46939,7 +46966,7 @@ var init_VideoTest = __esm({
46939
46966
  hmsDiagnostics.startCameraCheck(deviceId);
46940
46967
  })
46941
46968
  }
46942
- ))), /* @__PURE__ */ import_react244.default.createElement(TestFooter, { error, ctaText: "Does your video look good?" }));
46969
+ ))), /* @__PURE__ */ import_react244.default.createElement(TestFooter, { error, ctaText: "Does your video look good?" }), /* @__PURE__ */ import_react244.default.createElement(PermissionErrorModal, { error }));
46943
46970
  };
46944
46971
  }
46945
46972
  });